Skip to content

Dynamixel actuators

Rich Wareham edited this page Aug 4, 2014 · 5 revisions

Overview

NOTE I created a package called dynamixel_playground in a branch if you want to follow along.

ROS has a driver and controller package for the Dynamixel actuators. Each actuator has a unique id and actuators are daisy-chained together. The input port is on the left and the output port is on the right. The images below show a single actuator wired into the USB-to-dynamixel adaptor.

FIXME: Image

The default ros container we use has the dynamixel drivers installed. Note that, in the Makefile, we have to explicitly expose /dev/ttyUSB0 to the container. This device is the USB serial device which the USB-to-dynamixel adaptor appears as. If, for some reason, on your machine this is different, we'll need to change the Makefile.

Setting actuator id

Each actuator is factory-programmed with an id of "1". The dynamixel_driver package has a utility to change the id:

ros@e69ce9ff2a9c:~$ rosrun dynamixel_driver change_id.py                     
Usage: change_id.py [options] OLD_ID NEW_ID                                  
                                                                             
Changes the unique ID of a Dynamixel servo motor.                            
                                                                             
Options:                                                                     
  -h, --help            show this help message and exit                      
  -p PORT, --port=PORT  motors of specified controllers are connected to PORT
                        [default: /dev/ttyUSB0]                              
  -b BAUD, --baud=BAUD  connection to serial port will be established at BAUD
                        bps [default: 1000000]                               

For example, to change the actuator with id "1" to have id "2":

ros@e69ce9ff2a9c:~$ rosrun dynamixel_driver change_id.py 1 2  
Changing motor id from 1 to 2...  done                        
Verifying new id...  done                                     

Sending commands to the actuator

Following the tutorial, I created the dynamixel_playground package in a personal branch. I daisy-chained the actuators together as in the picture below:

FIXME: Image

Important: There can be a lot of cross-talk on the bus if the wires are bunched up like this. Make sure you separate the actuators out if you're replicating this.

ROS uses "joint controllers" to manage actuators. In essence these are topics to which one publishes a joint angle in radians (with 0 being the central position) and topics which publish the current joint state. I created an example launch file to reset the actuators and nudge them in turn to the left and then right. DO NOT RUN THIS COMMAND WHEN THE ARM IS BUILT.

$ make launch PKG=dynamixel_playground LAUNCH=daisy_chain_example.launch

Reliability problems

I found that running the actuators at the full 1000000 (i.e. 1Mbps) baud rate was unreliable. I configures the actuators to run at 200000 (i.e. 200Kbps):

ros@c682aa024418:~$ rosrun dynamixel_driver set_servo_config.py -r 9 1 2 3 4 5 6 7

The "7" here comes from the technical manual.

EDIT This was completely wrong. In fact the ground for the USB and the ground for the PSU were different.

Pair-wise controller

The pair_chain_example.launch file is an example of launching a pair-aware controller which slaves one motor to another. This is important for our arm.

Clone this wiki locally