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.

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.

If the servo is set up to run in continuous mode, the module uses the input SPEED to set the speed directly between min (0) and max (1). No speed control is performed by this module.

If the TORQUE input is connected, the torque for each servo can be set individually between min (0) and max (1).

Example XML definition

A simple example

  <module
      class = "Dynamixel"
      name = "Dynamixel"
      speed = "0.2"
  />

Parameters

NameDescriptionTypeDefault
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
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.listdirect
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) or the maximum angle for servo (range)listdegrees
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
feedbackShould the module ask the servos for data? If set to 'no' the module works faster and never receives any data from the servo. Instead, the OUTPUT is set to a copy of the last INPUT.boolyes
position_speedOverall speed in fraction of maximum speed. Not used in real time mode.float0.1
start_up_delayNumber of ticks to wait before a position command is sent to the servos.int1

Module Connections

Inputs

NameDescription
INPUTThe desired servo positions (in units set by angle_unit)
TORQUEThe torque for each servo (0-1). A torque of 1 is used if this input is not connected.
SPEEDThe speed for each servo (0-1) that is run in continuous mode. This input is ignored for servos in position mode.

Outputs

NameDescription
OUTPUTThe current servo positions (in units set by angle_units)
LOADThe current load of the servo (in percent)
VOLTAGEThe current voltage (in Volts)
TEMPERATUREThe current temperature (in degrees Celsius, °C)

Limitations

The module should ping the servos to see how many there are and set the output accordingly to allow automatic reconfiguration of the controller.

The module should read additional data such as temperature and force from the servos.

Author

Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science

Files

Dynamixel.h
Dynamixel.cc
DynamixelComm.h
DynamixelComm.cc
Dynamixel.ikc

blog comments powered by Disqus