Go Down

Topic: Arduino and robotis dynamixel servo (Read 28488 times) previous topic - next topic


Hi there,
have been using an arduino to control some hi-tec servos, but due to the high strength and some other nice features like compliance, lots of data feedback etc I want to use the robotis dynamixel servo, (the rx-64).

Does anyone have any experience of using these? it is going to be a long weekend of hacking about otherwise!

They use RS485 for comms and I'm going to use a MAX485 IC chip to get the Arduino rs232 to talk to the servos. Any advise would be appreciated, will update on progress to save other people time in future.


Nov 24, 2009, 12:23 pm Last Edit: Nov 24, 2009, 12:57 pm by alfurey Reason: 1
So here's an update.... This has turned out be a bit of a nightmare. After much faffing I managed to set up an Arduino to arduino network to test the rs485 communication. Pretty much everything i needed to know was here:

That way i could set up the instuction packets as per the rx-64 manual. So far so good. Right so now powered up the servo, and send the data across, just to test comms by turning the LED on the servo on and off aaaannnndd........ Nothing, nada, rien.

Have checked the message is ok, wiring is same as the working ard-ard rs485 network. Have tried serial.print(0xFF, byte) and serial.print(0xFF, BIN) and neither work....

Someone out there must have done this before!

Here is my code to turn the light on and off, please tell me if you can see anything wrong..

// Xbee to dynamixel via rs485

// Define/preallocate parameters
int ledPin =  13;    // LED connected to digital pin 13
int i = 0;
byte startAddress;
byte servoID= 0x01;
byte ledOn = 0x01;
byte ledOff = 0x00;

// Run setup Function
void setup() {
//int DEPin= 2; // The pin to be used for enable/disable signal
//digitalWrite(DEPin, HIGH); // tell max485 to transmit

// Run main Function
void loop() {
//Transmission section

if (i%2 ==0){
activateServos(servoID, ledOn);
activateServos(servoID, ledOff);

if (i>1000){

//Function Definitions

void activateServos (byte servoID, byte newValue){
 int checksum_ACK;
 byte notchecksum;
 startAddress = 0X19;     // Turning on led
 checksum_ACK =  servoID + 0x03 + 0x03 + startAddress + newValue;
 notchecksum = ~checksum_ACK;
 digitalWrite(2,HIGH);     // Notify max485 transciever to accept tx
 delay(5);                 // Allow this to take effect

 Serial.print(0xFF,BYTE);  // 1.These 2 bytes are 'start message'
 Serial.print(0xFF,BYTE);  // 2.These 2 bytes are 'start message'
 Serial.print(servoID,BYTE);  // 3.Address 1 is target servo or 0xfe which is broadcast mode
 Serial.print(0x03,BYTE);  // 4.Length of string
 Serial.print(0x03,BYTE);  // 5.Ping read write or syncwrite 0x01,2,3,83
 Serial.print(startAddress,BYTE);  // 6.Start address for data to be written
 Serial.print(newValue,BYTE);  //  7.Turning on signal
 Serial.print(notchecksum,BYTE); //8. the notchecksum
 delay(3); // allow last byte to go through


Nov 24, 2009, 04:53 pm Last Edit: Nov 24, 2009, 04:58 pm by fdufnews Reason: 1
Serial.print(0x03,BYTE);  // 4.Length of string
Serial.print(0x03,BYTE);  // 5.Ping read write or syncwrite 0x01,2,3,83

(RX-64 user guide)
It is the length of the packet. The length is calculated as "the number of Parameters (N)
+ 2".

You're wrong on the string length. The write command use 2 parameters so you should send 4 as the length (number of parameters + 2)

You never release the bus at the end of the function so there is a bus contention when the status packet is sent by the servo.


fduf news, you are a legend, well spotted. It works now!


can some one help me with the control of Dynamixel ax-12 using an arduino duemilanove (atmega 328)..
please help me out. im searching a solution for this from last one month.


Have you read the user guide http://robosavvy.com/site/docs/Bioloid/AX-12(english).pdf
Can you explain what you are in trouble with.


thnaks for your response..

im using arduino for controlling an biped robot. this robot is fixed witht he dynamixel servos..

my probles are,
firstly for controllin a dynamixel servo, v hav to send a instruction packet to the servo to control that..how can we send that through arduino...

secondly...i want to know about the half duplex signal out of the arduino....

pls help me out...



Yeah still facing problem with the issue. Can you please help me....


Apr 06, 2010, 04:18 pm Last Edit: Apr 06, 2010, 04:19 pm by ksamay Reason: 1
Would love to.

So what is your setup ?

Which arduino board ? AX or RX type motors ?

Do you have the TTL or RS485 circuit ready & running ?

Where exactly are you stuck ? Hardware or software ?


Hi everyone,

I am also thinking about using Dynamixels for a college robotics project and since I have 0 experience in non-PWM control of motors, I would appreciate some help.

I haven't decided on a particular Arduino board yet, is there one that would work better than others?

Additionally, what other hardware will I need to communicate with the motor? I saw on the Dynamixel website a USB2Dynamixel converter. Is this something I would need or should I get another piece of hardware?

Finally, if anyone has any example code for controlling the Dynamixel motors using the Arduino (specifically, I am looking into controlling their torque) or any helpful tutorials, I will be very thankful if you could post them here or send them to me.

Thanks in advance.


I just posted a similar example  here:

Use the interface circuit from the AX12 manual using HC126. You don't need the inverter, use the outputs on D2 and D3. You would only need the USB2Dynamixel to talk direct from PC over USB to Dynamixel.

If you want an arduino based board for controlling dynamixel, then Arbotix is best because it has two UARTS to talk to servo at the same time as the normal serial . Also has interface and library already.

For specific dynamixel help, try trossen or robosavvy forums.


hola  tengo problemas quiero usar uns servos dynamixel ax-12 programados con el arduino duemilanove alguien me puede ayudar por donde empezar gracias





Go Up