Dynamixel
(Created page with "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. ===Start s...") |
(→Sample rhdconfig entry) |
||
(3 intermediate revisions by one user not shown) | |||
Line 38: | Line 38: | ||
===Sample rhdconfig entry=== | ===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 | steering interface | ||
* servo values (name from servo0 to servo10, value is "minpos centerpos maxpos scale", | * servo values (name from servo0 to servo10, value is "minpos centerpos maxpos scale", | ||
Line 45: | Line 48: | ||
* dev is USB interface to teency 2 board | * dev is USB interface to teency 2 board | ||
* dead zone (with no movement around target position) (0..255) | * dead zone (with no movement around target position) (0..255) | ||
− | * safety > joystick | + | * 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 | * debug if 1 then some errors during startup is ignored and more text printed | ||
− | --> | + | -- > |
<dynamixel enable="true" lib="dynamixel.so.1" | <dynamixel enable="true" lib="dynamixel.so.1" | ||
critical="true" | critical="true" |
Latest revision as of 07:45, 26 October 2013
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 |
[edit] 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.
[edit] 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.
[edit] 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.
[edit] 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]
[edit] 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>