Dynamixel

From Rsewiki
Revision as of 07:45, 26 October 2013 by Jca (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The plug-in interfaces to a number of dynamixel servos - build for version MX-28, but may work with others, as most registers in the servo interface is compatible.

Contents

Start sequence

The servos must have power before the a usb client is connected to the teensy controller, i.e. before RHD is started. The controller reads at start-up all registers from the servo, and assumes that all servos with no battery voltage reported is not connected, and thus stops receiving status from these servos.

Interface

The interface is through a microprocessor Atmel mega32u4 (teensy 2), the code for the microprocessor is in a subdirectory to the plugin code.

The microcontroller can be operated from a serial terminal (putty), and has on-line help. It is fully text oriented.

Read variables

The plugin has the following (configured for (up to) 5 servos)

servoPos[5]  Current angle of the servo in degrees x 10
servoMin[5]  Minimum servo angle (in degrees x 10) - defined in rhdconfig.xml - never updated
servoMax[5]  Maximum servi angle (in degrees x 10) - defined in rhdconfig.xml - never updated
servoVel[5]  Current servo velocity - as reported by the servo (i.e. not converted to degrees/sec)
servoLoad[5] Current servo load - as reported by the servo (motor current based)
servoVolt[5] Current battery voltage, measured by the servo (in volt x 10)
servoTemp[5] Current temperature in degrees C.
servoComErr[5] Count of communication errors (crc-fail, rx timeout, etc)
servoIntRef[5] Reference position in servo units (12bit unsigned)
servoIntPos[5] Current position in servo units (12 bit unsigned)
servoUpdCnt[5] Number of status updates received from each servo.


Write variables

The servos are controlled by an angle reference for each servo (in degrees x 10). The center position is defined in the rgdconfig.xml file.

servoref[5]

Sample rhdconfig entry

In this example only servo 0,3,4 of the 5 servos are connected. The actual servo ID (1,2,3,4,5) and interface speed (500kbit/s) is defined in the teensy firmware.

<! -- 
steering interface
* servo values (name from servo0 to servo10, value is "minpos centerpos maxpos scale",
* all positions in servo units, scale is used to and from RHD variable, set to 4096/360/10 = 1.1377778 to
* get sontrol and status in degrees (*10) relative to center position.
* dev is USB interface to teency 2 board
* dead zone (with no movement around target position) (0..255)
* safety > joystick (higher number, to get index to manual overwrite button - not used pt)
* debug if 1 then some errors during startup is ignored and more text printed
-- >
<dynamixel enable="true" lib="dynamixel.so.1"
 critical="true" 
 safety="2"
 dev="/dev/ttyACM0"
 servo0 = "1200 2450 3700 1.1377778"
 servo3 = "1300 2560 3800 1.1377778"
 servo4 = "300   800 1400 1.1377778"
 deadzone="3"
 debug="1">
 <dxlinit msg="i=0"/>
 <dxlinit msg="s=1"/>
 <dxlinit msg="j=0"/>
 <dxlinit msg="help"/>
</dynamixel>
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox