I have recently been playing with the new Dynamixel MX-28T Servos http://www.robotis.com/xe/dynamixel_en
Unfortunately because they are fairly new there isn't much information online about them, and more importantly how to use them with an Arduino!
It took a bit of research and a little hacking to get them working, so I thought I would save others the trouble of going through the same and provide some instructions.
The first thing that made things alot easier was that a developer by the name of Pablo Gindel had already written a library for Dynamixel's previous line of servos, the AX-12's.
Here is a link to his page which contains the download and some simple instructions - http://www.pablogindel.com/informacion/the-arduinodynamixel-resource-page/
However all is not as simple as it may first seem. This library is almost 2 years old, and the instructions are now incorrect and require a little bit extra effort to get working.
So the first thing to do is download the file and place the ax12 folder in the /libraries
directory in your Arduino IDE install directory.
Now we need to update it.
The change is rather simple, open the ax12 folder you have just copied and open the ax12.cpp file using a text editor.
Find the "wiring.h"
include, and change it to "Arduino.h"
Save the file, and close it.
The next alteration must be made to core Arduino IDE files. I must point out that this change allows this library to work, but I don't know what effect it has outside the use of these servos.
You need to find the HardwareSerial.cpp file, you should find it in /hardware/arduino/cores/arduino
folder of you Arduino IDE install directory.
This change is documented in the original instructions but unfortunately the file has changed since and the code you are meant to comment out no longer exists.
The code you need to comment out looks like this:
unsigned char c = UDR1;
This modification is necessary as the ax12 library rewrites how the serial port is used. I should mention that obviously you are going to be controlling the Dynamixel servos using the serial port (TX1 and RX1 on the Mega, TX and RX on anything else), I would therefore strongly suggest you use an Arduino Mega for your project as it has multiple serial ports and still allows you to debug through the USB serial port. I have got this working on a Duemilanove though so it's not a problem, just remember to unplug the tx and rx wires connecting the Arduino to the servo when downloading a new program
, don't use any serial communications (take a look at SoftwareSerial), and you will also need to comment out more lines in the HardwareSerial.cpp file - everything after the store_char
function up to the serialEventRun
function. For the current version this is lines 88 - 160.
OK and finally remember to common your grounds!
The ground on the Arduino must be connected to the servo ground otherwise you will find that communication is very intermittent (if at all).
I hope this very quick guide has helped a few of you, because I failed to find anything on the internet that was recent enough to work easily. This should work with all Dynamixel servos - AX MX RX and EX. Although if you choose to use the RS485 models (4 wire) rather than the TTL models (3 wire) you will have to use the adapter which can be found in Pablo Gindel's original link above.