Dynamixel
Driver for the Dynamixel servos from ROBOTIS. The module can control servos both in position and continuous (wheel) mode. The IDs of the modules can be set with the parameter 'servo_id'. If this parameter is not set, the module will instead scan the bus for servos.
When the index_mode indirect is set, the input and output arrays ranges from 0 to N, where N is the number of connected servos. If the module scanned for the IDs, they will be in numerical order, otherwise they will be in the order listen in the pramater servo_id.
When the index_mode is set to direct, the input and output arrays ranges from 0 to the ID of the servos with highest ID. In this mode, some of the elements in the input and output arrays may not be used and will always be set to 0.
If the parameter size is set, it will override the other calculations of the size of the arrays and either truncate or extend the array to the requested size.
The module comunicates with the servos using serial communication (TTL or RS-485).
Use USB2Dynamixel:
OSX:
It is usually necessary to install the drivers for the FTDI USB serial driver before using the
USB2Dynamixel with Ikaros. This driver is available from the FTDI site. When the driver is
installed a device called something like "cu.usbserial-A7005Lxn" will show up under the /dev directory.
Linux:
No drivers needed. The device will show up as "/dev/ttyUSB0" or similary.
Windows:
Not tested but devices should be COMX.
If the servo is set up to run in continuous mode, the module uses the input MOVING_SPEED to set the speed directly
between min (0) and max (1). No speed control is performed by this module.
Example XML definition
A simple example
<module class = "Dynamixel" name = "Dynamixel" />
Parameters
Name | Description | Type | Default |
---|---|---|---|
class | The class name for the module; must be "Dynamixel". | string | |
name | The name of this instance of the module. | string | |
device | Path to serial device | string | /dev/cu.usbserial-A7005Lxn |
baud_rate | Serial baud rate | int | 1000000 |
print_info | Print information about the servos to console. Minimal prints a few important features of the servo. Full prints the whole control table. | choices: none minimal full | minimal |
servo_id | The IDs of the Dynamixel servos. If this parameter is not set, the module will scan for servos | string | |
index_mode | The relation between the indices of the input and output arrays and the IDs of the servos. In direct mode, the index of the arrays correponds to the IDs of the servos while in indirect mode the inputs and outputs has the same size as the number of servos. | choices: direct indirect | direct |
angle_unit | What units should be used for position inputs and outputs? 0-360 (degrees), 0-2π (radians), or 0-1, where 1 either corresponds to 360° (tau). | choices: degrees radians tau | degrees |
max_servo_id | The maximum servo ID to scan for. This parameter must be increased if servos with higher IDs are used. The value can be decreased to speed up the start-up of the module. | int | 32 |
size | This parameter forces a specific size of the output. In the normal case when it is not set, the size will be derived from the list of servo_ids | int | 0 |
feedback | If set to 'no' the module works faster and do not ask servos for position feedback etc. Set to 'no' the feedback outputs will be filled with the inputs' values (FEEDBACK_GOAL_POSITION will just be a copy of the GOAL_POSITION). If the feedback does not have a matching input it will be set to -1 (FEEDBACK_PRESENT_VOLTAGE will be set to -1) | bool | yes |
start_up_delay | Number of ticks to wait before a position command is sent to the servos. | int | 1 |
Module Connections
Inputs
Name | Description |
---|---|
TORQUE_ENABLE | Torque Enable On/Off, ON if not connected |
LED | LED On/Off, Off if not connected |
D_GAIN | D value for PID regulation. Current set value if not connected |
I_GAIN | I value for PID regulation. Current set value if not connected |
P_GAIN | P value for PID regulation. Current set value if not connected |
GOAL_POSITION | The desired servo positions (in units set by angle_unit). Current set value if not connected |
MOVING_SPEED | The moving servo positions (0..1). Current set value if not connected |
TORQUE_LIMIT | The torque limit (0..1). Current set value if not connected |
GOAL_TORQUE | The goal torque value (Not yet tested) |
GOAL_ACCELERATION | The goal acceleration value (Not yet tested) |
Outputs
Name | Description |
---|---|
FEEDBACK_TORQUE_ENABLE | Torque Enable |
FEEDBACK_LED | LED |
FEEDBACK_D_GAIN | D value for PID regulation |
FEEDBACK_I_GAIN | I value for PID regulation. |
FEEDBACK_P_GAIN | P value for PID regulation. |
FEEDBACK_GOAL_POSITION | The desired servo positions set |
FEEDBACK_MOVING_SPEED | The moving servo positions set |
FEEDBACK_TORQUE_LIMIT | The torque limit set |
FEEDBACK_PRESENT_POSITION | The current servo positions (in units set by angle_units) |
FEEDBACK_PRESENT_SPEED | The current servo speed (in units set by angle_units) |
FEEDBACK_PRESENT_LOAD | The current load of the servo (in percent) |
FEEDBACK_PRESENT_VOLTAGE | The current voltage (in Volts) |
FEEDBACK_PRESENT_TEMPERATURE | The current temperature (in degrees Celsius, °C) |
FEEDBACK_PRESENT_CURRENT | The current Current (in mA)) |
FEEDBACK_GOAL_TORQUE | The goal torque value (Not yet tested) |
FEEDBACK_GOAL_ACCELERATION | The goal acceleration value (Not yet tested) |
Limitations
Only tested with AX-12, MX-28, MX-106.
Author
Christian Balkenius and Birger Johansson
Birger.johansson@lucs.lu.se
Lund University Cognitive Science
Files
Dynamixel.h
Dynamixel.cc
DynamixelComm.h
DynamixelComm.cc
DynamixelServo.cc
DynamixelServo.h
Dynamixel.ikc