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

      class = "Dynamixel"
      name = "Dynamixel"


classThe class name for the module; must be "Dynamixel".string
nameThe name of this instance of the module.string
devicePath to serial devicestring/dev/cu.usbserial-A7005Lxn
baud_rateSerial baud rateint1000000
print_infoPrint information about the servos to console. Minimal prints a few important features of the servo. Full prints the whole control table.choices:
servo_idThe IDs of the Dynamixel servos. If this parameter is not set, the module will scan for servosstring
index_modeThe 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:
angle_unitWhat 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:
max_servo_idThe 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.int32
sizeThis 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_idsint0
feedbackIf 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)boolyes
start_up_delayNumber of ticks to wait before a position command is sent to the servos.int1

Module Connections


TORQUE_ENABLETorque Enable On/Off, ON if not connected
LEDLED On/Off, Off if not connected
D_GAIND value for PID regulation. Current set value if not connected
I_GAINI value for PID regulation. Current set value if not connected
P_GAINP value for PID regulation. Current set value if not connected
GOAL_POSITIONThe desired servo positions (in units set by angle_unit). Current set value if not connected
MOVING_SPEEDThe moving servo positions (0..1). Current set value if not connected
TORQUE_LIMITThe torque limit (0..1). Current set value if not connected
GOAL_TORQUEThe goal torque value (Not yet tested)
GOAL_ACCELERATIONThe goal acceleration value (Not yet tested)


FEEDBACK_D_GAIND value for PID regulation
FEEDBACK_I_GAINI value for PID regulation.
FEEDBACK_P_GAINP value for PID regulation.
FEEDBACK_GOAL_POSITIONThe desired servo positions set
FEEDBACK_MOVING_SPEEDThe moving servo positions set
FEEDBACK_TORQUE_LIMITThe torque limit set
FEEDBACK_PRESENT_POSITIONThe current servo positions (in units set by angle_units)
FEEDBACK_PRESENT_SPEEDThe current servo speed (in units set by angle_units)
FEEDBACK_PRESENT_LOADThe current load of the servo (in percent)
FEEDBACK_PRESENT_VOLTAGEThe current voltage (in Volts)
FEEDBACK_PRESENT_TEMPERATUREThe current temperature (in degrees Celsius, °C)
FEEDBACK_PRESENT_CURRENTThe current Current (in mA))
FEEDBACK_GOAL_TORQUEThe goal torque value (Not yet tested)
FEEDBACK_GOAL_ACCELERATIONThe goal acceleration value (Not yet tested)


Only tested with AX-12, MX-28, MX-106.


Christian Balkenius and Birger Johansson
Lund University Cognitive Science



blog comments powered by Disqus