Show Posts
Pages: [1]
1  Using Arduino / Motors, Mechanics, and Power / Re: Dynamixel Servo Library on: October 29, 2012, 09:26:47 am
changing my baud rate to 57600 since I read that it's the default for a brand new the MX-28.
AX12::init (57600);

Hi Amartin2,

Sorry for the late reply, I don't check this forum very often.
Sorry I didn't make it clear in the instructions, you need to use AX12::init(1000000) because the library is designed to work at that speed.
This means that you need to change the baud rate of the dynamixels to 1Mbps. The only way I was able to do this was using their Dynamixel2USB adapter.
I know its annoying that you have to buy yet another piece of kit, but at least you only have to buy one.
2  Using Arduino / Motors, Mechanics, and Power / Re: Dynamixel Servo Library on: August 16, 2012, 09:33:06 am
The only issue with the Savage Electronics library is that it requires extra hardware to work.
The one I recommended doesn't need anything.
3  Using Arduino / Motors, Mechanics, and Power / Dynamixel Servo Library on: July 26, 2012, 11:27:45 am
Hello All,

I have recently been playing with the new Dynamixel MX-28T Servos
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 -

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;
  store_char(c, &rx_buffer1);

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.

Good luck!
Pages: [1]