Orangutan X2 serial baud

Hi, it’s me again.

I got dynamixel ax-12a servo. It’s controlled by serial (half-duplex)
But my problem is that to change baud rate i have to communicate with it on default baud 1000000bps, but “Standard values up to 115200 should work fine; for higher speeds,
please consult the AVR documentation” (Pololu AVR commands reference)
I wrote code, but it isn’t working, and i wonder if i fucked up, or orangutan cannot handle 1Mbps on UART1 ???
Maybe somebody have tried high baud rates before??

Hello.

I looked up the Dynamixel_AX12 and indeed you do have to communicate with it at 1,000,000 baud before you can change the baud rate to something more tractable. Other people have had this problem too:

wiki.tinyclr.com/index.php?title … t_baudrate

Unfortunately, AVRs are not great for generating high baud rates. According to the ATmega1284P datasheet (Table 17-1), a 20 MHz ATmega1284p can generate a baud rate of .833 Mbps or 1.25 Mbps, but nothing between.

The CP2102 on your Orangutan X2 can only go up to 921.6 kbps.

Do you have any other devices with serial interfaces available? I just tested a jrk 21v3 and I was able to generate good 1 Mbps serial bytes on its TX line. That baud rate is not officially supported because the jrk can not receive and transmit constant streams of bytes at that speed, but it should work well enough to send a few bytes to your servo to reconfigure its baud rate. Most of our USB devices are based on the same chip as the jrk, so they should work too.

Do you have an AVR running at 16 MHz, such as an Arduino?

If not, you could always write some carefully optimized software serial code for the Orangutan X2 that sends the right bytes. It would be relatively easy since you can hardcode the specific bytes that you need to send.

–David

uhmmmm,
yes i did it from arduino, i played with it little bit (great servo!) and now problem is that in theory i set it to 57600bps, but i checked every baud from datasheet and it isn’t responding :confused:

Hello.

I know nothing about this particular servo, but I’d be very surprised if there wasn’t some mechanism (maybe undocumented?) for restoring the communication settings to the default to avoid this very kind of problem. I think you should try contacting the manufacturer and maybe they can give you some help. Do you still have the code showing exactly what command you sent to change the baud rate?

- Ben

thanks, i will try on my own today, but i used this lib pablogindel.com/descargas/

with this code:

AX12 motor;

void setup() {
 
  motor = AX12();
  
   AX12::init (1000000);
  byte detect;          
  byte num = AX12::autoDetect (&detect, 1); // detección de IDs
  
  motor.id = detect; // asigna las ID detectadas a los motores definidos previamente
  motor.SRL = RETURN_ALL;
  motor.writeInfo(BAUD_RATE,0x22);
}

EDIT: I solved it myself, i wrote a piece of code, which took start serial baud 1000000 , decreased by some amount in every loop, and i found (by manual bin search) baud, which i set (in fact, which this servo set), it was 52000 (should be 57600), i changed it back to 1M and for now its enought. Anyway, on my robot, there will be arduino & orangutan, so let arduino take care of those servos (servos are controlling grabber, so i will build one more digital line between MCUs - HIGH-grab; LOW-release).
Assuming this one and my previous thread - Arduino is much more comprehensive, and it doesn’t require much time to get sth workin. But Pololu Employees are very helpful :wink: