by i-Bot » Tue Nov 06, 2012 4:16 pm
by i-Bot
Tue Nov 06, 2012 4:16 pm
In the early days of the DARwin framework when I wrote this:
http://robosavvy.com/site/index.php?opt ... 7&Itemid=2
, it was pretty easy to modify the DARwin frame work to work on AX servo based robots.
More recent developments in the the DARwin software and the MX28 servos made this more difficult without large C++ code changes.
The move from 1024 resolution to 4096, and PID, can be managed through the #defines, though you need an early 1024 friendly version of Roboplus too.
The most significant change was the introduction of the Bulk Read command to the Dynamixel protocol. The Bulk Read is implemented by the MX28, CM730, and the FSR feet to greatly optimise the return of data from these devices through the USB and Linux kernel to the application. The DARwin code runs on an 8ms cycle, so this is important. The DARwin code can be changed to make individual reads, but each of these goes through the USB and kernel as seperate transaction, this is slow especially if an FTDI USB2serial is used with a 1ms latency.
To resolve this problem I have made a new code version for the USB2AX from Xevel. This code converts the Bulk Read to individual reads within the USB2AX and sends the responses back. The only change to the DARwin code is to now use ttyACM0 instead of ttyUSB0, and the AX servos look like 1024 MX servos. The Sync write of servo position and the Bulk Read fit well within the 8ms window.
The Bulk Read is not well documented by Robotis, but is basically a broadcast message received by all the MX28, CM730 and FSR. They all reaspond individually in the same way as a normal read, except they sequence their responses in the order they were listed in the broadcast packet. They simply watch the bus for the previous ID packet to end before sending.
I will send the code to Xevel, so he can add it to the USB2AX repository.
This code could easily be ported onto the CM900 too !
In the early days of the DARwin framework when I wrote this:
http://robosavvy.com/site/index.php?opt ... 7&Itemid=2
, it was pretty easy to modify the DARwin frame work to work on AX servo based robots.
More recent developments in the the DARwin software and the MX28 servos made this more difficult without large C++ code changes.
The move from 1024 resolution to 4096, and PID, can be managed through the #defines, though you need an early 1024 friendly version of Roboplus too.
The most significant change was the introduction of the Bulk Read command to the Dynamixel protocol. The Bulk Read is implemented by the MX28, CM730, and the FSR feet to greatly optimise the return of data from these devices through the USB and Linux kernel to the application. The DARwin code runs on an 8ms cycle, so this is important. The DARwin code can be changed to make individual reads, but each of these goes through the USB and kernel as seperate transaction, this is slow especially if an FTDI USB2serial is used with a 1ms latency.
To resolve this problem I have made a new code version for the USB2AX from Xevel. This code converts the Bulk Read to individual reads within the USB2AX and sends the responses back. The only change to the DARwin code is to now use ttyACM0 instead of ttyUSB0, and the AX servos look like 1024 MX servos. The Sync write of servo position and the Bulk Read fit well within the 8ms window.
The Bulk Read is not well documented by Robotis, but is basically a broadcast message received by all the MX28, CM730 and FSR. They all reaspond individually in the same way as a normal read, except they sequence their responses in the order they were listed in the broadcast packet. They simply watch the bus for the previous ID packet to end before sending.
I will send the code to Xevel, so he can add it to the USB2AX repository.
This code could easily be ported onto the CM900 too !