by DerekZahn » Thu Jan 11, 2007 5:58 pm
by DerekZahn
Thu Jan 11, 2007 5:58 pm
Most of the wiring for the lower torso is complete, and I thought I'd describe Bing's communication scheme, which is in some ways a bit peculiar.
The processor module that I'm using for various tasks (the NewMicros tini2131) has a built-in RS232 level converter, so RS232 is the communication mechanism. Each processor controls 3 servos (and may have additional sensors), so since Bing has 21 servos, that's 7 processor modules. One additional module is the one for accelerometers and gyros, for a total of 8 processors. These processors are daisy-chained together so that the TX from one module goes to the RX of the next. In this way the only wiring that needs to be routed from one point to another is +V,GND,RX,TX.
The protocol is designed for low latency -- The main controller sends out servo positions in a big packet (about 50 bytes total), but each node in the chain sends a byte as soon as it gets a byte -- it doesn't need to wait for the whole packet. If it sees a servo position command intended for one of the servos it is controlling, it replaces those bytes with the bytes for a position report command so when the packet gets back to the main controller, it contains servo positions instead of the original servo commands. If a module wants to add additional sensors (like the pressure sensors in the foot), it appends them to the end of the packet.
So far I have 6 of the 8 modules chained together (just the ones for the arms are not done yet). A complete cycle from the time that the PC queues up the packet until the whole packet is received back again from Bing is about 11 milliseconds, which is plenty fast for my needs.
I hope that made sense. It might seem odd to use RS232 in this way -- other protocols like SPI or I2C are possibly better, but I know how to use RS232 and the pins are sitting there anyway so I thought I'd use them.
Most of the wiring for the lower torso is complete, and I thought I'd describe Bing's communication scheme, which is in some ways a bit peculiar.
The processor module that I'm using for various tasks (the NewMicros tini2131) has a built-in RS232 level converter, so RS232 is the communication mechanism. Each processor controls 3 servos (and may have additional sensors), so since Bing has 21 servos, that's 7 processor modules. One additional module is the one for accelerometers and gyros, for a total of 8 processors. These processors are daisy-chained together so that the TX from one module goes to the RX of the next. In this way the only wiring that needs to be routed from one point to another is +V,GND,RX,TX.
The protocol is designed for low latency -- The main controller sends out servo positions in a big packet (about 50 bytes total), but each node in the chain sends a byte as soon as it gets a byte -- it doesn't need to wait for the whole packet. If it sees a servo position command intended for one of the servos it is controlling, it replaces those bytes with the bytes for a position report command so when the packet gets back to the main controller, it contains servo positions instead of the original servo commands. If a module wants to add additional sensors (like the pressure sensors in the foot), it appends them to the end of the packet.
So far I have 6 of the 8 modules chained together (just the ones for the arms are not done yet). A complete cycle from the time that the PC queues up the packet until the whole packet is received back again from Bing is about 11 milliseconds, which is plenty fast for my needs.
I hope that made sense. It might seem odd to use RS232 in this way -- other protocols like SPI or I2C are possibly better, but I know how to use RS232 and the pins are sitting there anyway so I thought I'd use them.