RX-64 + Arbotix controller question

159 views
Skip to first unread message

cryptoguy

unread,
Jul 27, 2010, 12:23:10 PM7/27/10
to robocontroller
Hi everyone,

I am having trouble connecting the RX-64 Dynamixel servo to the RX
bridge + Arbotix microcontroller. I am powering everything properly
and I know that the code I upload to the microcontroller is being
received because I added a simple blink command to pin 0 of the
arbotix and I see the LED blink accordingly. The problem is that the
Dynamixel does not seem to respond to any commands.

I took the code from here (http://code.google.com/p/arbotix/wiki/
GettingSetup) but when I plug everything in, the RX-64 does not move
(I do see a red light on the back of the RX-64 flash once though). The
code compiles and uploads with no errors so I think the problem is
somewhere in the RX bridge - Dynamixel interface. I also notice that
the motor is getting somewhat warm on the area a little lower of the
red light. The Dual motor driver chip on the arbotix board also feels
warm. I am powering the board with 7 volts and the RX-64 with 18. What
do you think could be the problem?

Thanks in advance for any assistance and I apologize if this isn't the
correct place to post questions (in which case, I'd appreciate a
redirection!)

Ilya.

Fergy

unread,
Jul 27, 2010, 1:17:29 PM7/27/10
to robocontroller
Have you edited the library as needed, for RX support:
http://code.google.com/p/arbotix/wiki/RxBridge ?

-Fergs

cryptoguy

unread,
Jul 27, 2010, 1:40:47 PM7/27/10
to robocontroller
Yes, I uncommented the proper line in that file.

cryptoguy

unread,
Jul 27, 2010, 2:59:21 PM7/27/10
to robocontroller
Also, I started trying to communicate with the RX-64 by saying
Serial.println(ax12GetRegister(1, AX_MODEL_NUMBER_L, 2)); in hopes
that this would print out something legitimate but it keeps printing
-1 which I guess means that it isn't communicating properly? Any
ideas?

Fergy

unread,
Jul 27, 2010, 3:04:46 PM7/27/10
to robocontroller
-1 does mean it's not getting anything back. If you do a
'SetPosition(1,512)' does the servo move at all? If not, then data is
going out either (which means you definitely won't get anything coming
back). Are you sure that your servo is set to ID 1, and that you have
the correct baud rate? (I know the RX's are a bit funkier than AX
servos, and I believe they come set to ID0 and a lower baud rate than
1MBPs initially)

-Fergs

cryptoguy

unread,
Jul 27, 2010, 4:04:50 PM7/27/10
to robocontroller
Thanks for the response. The servo does not move at all when I give it
the SetPosition command. From the RX-64 Data sheet, it says that the
IDs range from 0 to 253 but on the Dynamixel page it says they all
come shipped with a default ID of 1 but I tried both IDs with
SetPosition and neither works. Again from the datasheet, it says that
the communication speed is 7343bps ~ 1 Mbps and later it says that the
initial value of Baud Rate is 57600 so I tried using BioloidController
bioloid = BioloidController(1000000); and BioloidController bioloid =
BioloidController(57600); and BioloidController bioloid =
BioloidController(7343);, all to no avail. But I realized that I'm not
even using the bioloid commands in the program, so is there an
explicit way I can set the baud rate of the communication link between
the Dynamixel and the microcontroller?

Thanks again.

Jon Hylands

unread,
Jul 28, 2010, 12:18:05 PM7/28/10
to robocon...@googlegroups.com
Note that RX-64's come from the factory set to 57600 baud rate - you have to change it manually to 1.0 mbps...

- Jon

cryptoguy

unread,
Jul 28, 2010, 1:00:45 PM7/28/10
to robocontroller
Thanks for the reply, but how would I do that without having the motor
communicate to the microcontroller first? I actually checked the
digital signal coming into the motor and it does look like the baud
rate is indeed approx. 57600 or at least it looks like it is within 3%
of it (this is apparently the appropriate range of the RX-64, from the
datasheet). I also ran a Serial.println(ax12GetRegister(x, 0x03, 1));
command in a loop where I incremented x from 0 to 254 hoping to find
an ID where it would send something other than -1 back, but it keeps
sending -1! Any thoughts?

Jon Hylands

unread,
Jul 28, 2010, 1:07:08 PM7/28/10
to robocon...@googlegroups.com
The ID for new Dynamixel servos is always 1.

If its not working, there may be a problem with the servo, or there may be a problem with the hardware you're connecting to.

Do you have access to a USB2Dynamixel?

- Jon

cryptoguy

unread,
Jul 28, 2010, 1:55:02 PM7/28/10
to robocontroller
Unfortunately I do not... Should only one cable be attached from the
RX bridge to the RX-64? If so, what side of the motor should it attach
to?

Jon Hylands

unread,
Jul 29, 2010, 10:20:08 AM7/29/10
to robocon...@googlegroups.com
Doesn't matter - both plugs on the RX-64 are wired together. The second plug is so you can daisy chain other servos to the first one. You should definitely not be plugging both sides into the RX-bridge.

So, plug the RX-64 into the bridge with one cable, set the software to 57,600 baud, and do a ping against ID 1. If you don't get anything back, then try a ping against ID 254, which is the special broadcast ID. If you get something back, it will include the ID of the servo (see the return format of a PING command in the RX-64 manual).

Actually, I don't remember if the Arbotix code implements a PING - Mike?

- Jon

cryptoguy

unread,
Jul 31, 2010, 4:02:08 PM7/31/10
to robocontroller
Ok, I have looked on the signal line and of the MAX485 chip and I see
what the immediate problem is; however I have zero idea how to fix it.
Based on your suggestion, I PINGed the motor and did get a response
back!
To do this, I did the following in the loop():

setTX();
ax12writeB(0xFF);
ax12writeB(0xFF);
ax12writeB(and so on...);
setRX();

Then I just read what the motor was saying on the RO pin of the chip.

However, when I read the response with a scope, I saw that there was
an error bit that was high: bit 4 which is Checksum error. Upon
further examination, it looks like while the Arbotix is sending out
the correct command to the RS-232, the 'Recieve Output NOT Enable' and
'Driver Output Enable' pins of the MAX485 go low (aka signal the chip
to stop transmitting) before the last byte of the packet is sent
through! Of course this means that the checksum is never getting sent
through, no matter which command I send (which explains the error I
get back). I've tried other commands, and the packet the RX-64 sends
back is correct, except for that error bit. I am operating it at 57600
bps, as per instructions.

Does anyone have ANY idea why the enable line goes low before it's
supposed to? Is the Bioloid library compatible with baud rates under
1Mbps?

Thanks for any help!

Fergy

unread,
Jul 31, 2010, 4:38:25 PM7/31/10
to robocontroller
You know, I thought of this, but then figured it was certainly not an
issue at a lower baud rate (but obviously I was thinking about this
completely the wrong way -- it takes longer to transmit at a slower
rate, and so we need to wait longer times). As you can imagine, there
aren't nearly as many people who can afford RX servos as AX servos, so
our RX testing has been a bit less than the AX stuff. I can't say that
we have tested on this lower baud rate, but obviously we have to.

Inside ax12.cpp in your libraries/Bioloid folder, you'll find this
piece of code in SetRX():

#ifdef RX_PROTOCOL
int i;
// Need to wait for last byte to be sent before turning the bus
around.
// Check the Transmit complete flag
while (bit_is_clear(UCSR1A, UDRE1));
for(i=0; i<25; i++)
asm("nop");
PORTD &= 0xEF;
#endif

As you can see, we wait until the last byte has transferred out, then
wait a bit more, then lower the 485's DO enable line. If you increase
that "25" you'll eventually get the checksum byte out there. This is
actually on my list to do more testing with, and find some way to get
rid of the constant -- but I've currently only got 1 DX-117, Andrew
(Tyberius) did most of our testing on his Dragoon RX-64 platform --
but his servos were already set to 1MBPs.

If you bounce it up in a few increments, you should get it working
pretty fast (I'd guess that, at 1/20th the rate, you might try 20*25
as the number, and see if all gets through -- if the value is too
high, you'll miss the 0xff 0xff at the beginning of the return
packet). If you would be so kind as to let us know what value you
eventually settle on as working for 56700, that'd be awesome.

-Fergs

cryptoguy

unread,
Jul 31, 2010, 6:45:21 PM7/31/10
to robocontroller
Thanks for the prompt response. I actually found that bit of code
several hours ago and experimented with the for loop. I found that the
Enable line does in fact extend when you change the stopping value for
i; however, this did not seem to help the problem because when I did
this, the motor still spit out a checksum error and refused to obey
any commands I send it. Is there another place in the code I may need
to change?

Also, would it be possible for me to change the baud rate of the motor
without the help of the microcontroller? I am thinking that setting
that baud rate to 1 Mbps may alleviate my problems!

Thanks again.
Reply all
Reply to author
Forward
0 new messages