by Fraser » Thu Dec 30, 2010 5:22 am
by Fraser
Thu Dec 30, 2010 5:22 am
Well humanoidA is all back together with 18 servos all with new low level firmware. That was quite a ride!
Over a 250kbps link (servos directly to usb2dynamixel to win7 PC) the system achieves a 111Hz loop for all servos. After playing for over half an hour with lots of movements I did not count one checksum error on the PC (over 3.5million checksums were checked). I don't know If any checksum errors happened in any AX12, but movement seemed smooth throughout.
Control loop is closed with my cheapo win7 netbook (via usb2dynamixel). This gives average latency of ~25ms and of course the packets do not all lie perfectly evenly spaced, that's why I have to drop to 111Hz. If I used a realtime controller instead of my PC then the rate should theoretically go to 250Hz at 250kbps, according to simulator timings the firmware should be fast enough to reach 1KHz over a 1Mbps link.
Despite the PCs latency and jitter the closed loop control is quite good and all servos hold there positions without stuttering. Using a realtime controller should give solid control.
With the protocol being just; send out PWM and receive Position, I had to write in a dead mans handle to prevent the servos continuing to rotate if the comms are dropped. So in a short time interrupt I check for valid packets received since last check, if not found then PWM is killed and servo LED lights. When good packets resume PWM is live again and LED goes out.
This evening I experimented with mixing sinusoidal position sequences on top of user control, this yielded some quite organic movements. I will shoot a short video tomorrow showing that.
I must add that debugging this system with multiple servos was quite tedious to say the very least! luckily I didn't have to go through too many debug iterations. Without a serial line sniffer it would have been painful. This sniffer worked great and is free to download:
http://www.serial-port-monitor.com/index.html
edit: I had better update the comms spec to reflect the actual protocol
Well humanoidA is all back together with 18 servos all with new low level firmware. That was quite a ride!
Over a 250kbps link (servos directly to usb2dynamixel to win7 PC) the system achieves a 111Hz loop for all servos. After playing for over half an hour with lots of movements I did not count one checksum error on the PC (over 3.5million checksums were checked). I don't know If any checksum errors happened in any AX12, but movement seemed smooth throughout.
Control loop is closed with my cheapo win7 netbook (via usb2dynamixel). This gives average latency of ~25ms and of course the packets do not all lie perfectly evenly spaced, that's why I have to drop to 111Hz. If I used a realtime controller instead of my PC then the rate should theoretically go to 250Hz at 250kbps, according to simulator timings the firmware should be fast enough to reach 1KHz over a 1Mbps link.
Despite the PCs latency and jitter the closed loop control is quite good and all servos hold there positions without stuttering. Using a realtime controller should give solid control.
With the protocol being just; send out PWM and receive Position, I had to write in a dead mans handle to prevent the servos continuing to rotate if the comms are dropped. So in a short time interrupt I check for valid packets received since last check, if not found then PWM is killed and servo LED lights. When good packets resume PWM is live again and LED goes out.
This evening I experimented with mixing sinusoidal position sequences on top of user control, this yielded some quite organic movements. I will shoot a short video tomorrow showing that.
I must add that debugging this system with multiple servos was quite tedious to say the very least! luckily I didn't have to go through too many debug iterations. Without a serial line sniffer it would have been painful. This sniffer worked great and is free to download:
http://www.serial-port-monitor.com/index.html
edit: I had better update the comms spec to reflect the actual protocol