Poll
Question: arduino duemilanove + dynamixel ax12
programar - 0 (0%)
comunicacion - 0 (0%)
Total Voters: 0

Pages: [1] 2   Go Down
Author Topic: Arduino and robotis dynamixel servo  (Read 12017 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
http://real2electronics.blogspot.com/2009/09/arduino-and-rs485-english-version.html

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() {
Serial.begin(57600);
//int DEPin= 2; // The pin to be used for enable/disable signal
//digitalWrite(DEPin, HIGH); // tell max485 to transmit
pinMode(ledPin,OUTPUT);
}

//___________________________________________________________________
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Run main Function
void loop() {
//Transmission section
delay(1);

if (i%2 ==0){
activateServos(servoID, ledOn);
delay(200);
}else{
activateServos(servoID, ledOff);
delay(200);
}

i++;
if (i>1000){
  i=1;
  }
}

//_____________________________________________________//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//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
}

« Last Edit: November 24, 2009, 06:57:40 am by alfurey » Logged

France
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3009
There is an Arduino for that
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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)
LENGTH
 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.
« Last Edit: November 24, 2009, 10:58:51 am by fdufnews » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

France
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3009
There is an Arduino for that
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you still stuck ? need help ?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
« Last Edit: April 06, 2010, 09:19:56 am by ksamay » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just posted a similar example  here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1278919947

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Montevideo, Uruguay
Offline Offline
Newbie
*
Karma: 1
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.pablogindel.com/2010/01/biblioteca-de-arduino-para-ax-12/
Logged

Montevideo, Uruguay
Offline Offline
Newbie
*
Karma: 1
Posts: 30
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Logged

Pages: [1] 2   Go Up
Jump to: