Controlling a Dynamixel RX-24F (RS-485 coms)
Lawson
Posts: 870
I'm trying to control a Dynamixel RX-24F servo. I haven't found an object for it. I have found two objects to drive the Dynamixel AX series servos. (this and this ) But the RX-24F uses RS-485 physical signaling so the drivers need to use a direction pin along with separate TX and RX pins. Beyond that, the manual says the protocol is the same.
Lawson
P.S. I haven't been able to find a serial object that supports half-duplex RS485 either.
Lawson
P.S. I haven't been able to find a serial object that supports half-duplex RS485 either.
Comments
[Edit] Removed code with typo -- replace with new (working) version in post below.
Lawson
Marty
Now to wrap this minimum code into an object so I can complete the rest of this project. Later I'll come and port the protocol layers from the other DX series objects to use the RX signaling. Then maybe I'll post an object on OBEX.
Lawson
Here's the working test code. It still works after I fixed the output circuit and switched FDX back to non-inverted TX and RX. (D+ and D- were swapped due to a poor schematic)
Lawson
The attached code is working in both TX and RX mode. Perhaps you'll find this version useful.
Attached is a bare-bones minimum driver for the RX-24F. All it will do is send position update packets to any servo ID on the buss and listen for the return status packet/byte. At the default 57142 baud it should be fast enough to update 8-10 servos at about 60Hz. (it'll run more at a higher baud rate) For now all configuration and discovery will need to be done with the software and PC dongle from Robotis.
I'll mark this thread as solved and update it with a full driver later.
Lawson
Nope -- testing shows that the configuration I use (checking TX buffer while the RX line is idle) limits the throughput to about 800K -- and this is tested using two UARTs inside the Propeller with direct pin-to-pin connections. Using actual wiring would probably reduce that. I'm content with the driver as is; 250K is plenty fast for what I do.
Lawson
Update: It seems that the code configuration use where the TX buffer is checked while waiting on a start bit does in fact limit the throughput to about 800K baud. I would suggest you take this code and split it into separate RX and TX cogs to get the maximum possible speed. Come to think of it, that's what happens in Tachyon, the program that inspired me to unroll the RX and TX loops.