> > Note that this algorithm wasn't designed for 128 servos to be controlled by > one processor. (Geez that is way more than I ever hope to own) External > circuitry External circuitry is quite simple, actually. A 74-series demux (for up to 8 channels for 4 pins) or a single PLD (which could do all servos in 1 chip) will give you LOTS of controls in a small package. > > excessive. It simply depends upon your application. I want a great way to > control servos, in software, and have a chunk of free time. That is what > this code does. Every 1mS (1000 uS) the processor does an average of 30 instructions. That's a 3% loading. As I understand, you were doing 24% earlier? At significantly less resolution (4uS)? > > I decided that even a realtime-controlled, model airplane does not need a > servo update of 50 times/sec. Thats means that every single pulse the servo > receives Actually, it depends more upon airspeed and dynamic loading. The refresh rate greatly affects the apparent torque of the servo. I did my servo controller for a robotic application, and for a model plane. For the model version, one PWM input was used to capture an almost-standard signal from the tx (I supported well more than 9 channels, but since I did both TX and RX it didn't matter, although it was still compatible with a standard 8-channel tx). This limited the number of outputs I had to 256 servos . For the robotic controller, the input was from the USART. The problem with that many servos becomes RAM to store the desired positions, not pins or time. > > Simple calculus/physics is all that takes. Resolution, however, is more > important. The Serial-Parallel servo controller combined with a parallel 1uS is more resolution than most standard servos will give you (2uS is typical, despite claims to the contrary). Airtronics makes some _excellent_ servos on their high end which will handle 1/2 uS reliably. If you go to an 8 MHz oscillator on the PIC, you get 1/2 uS resolution and 1.5% processor loading. Only good Pattern pilots see the difference between 1/2uS and 1uS in operation, and then only on a tight airplane. Andy ================================================================== Andy Kunz Life is what we do to prepare for Eternity ------------------------------------------------------------------ andy@rc-hydros.com http://www.rc-hydros.com - Race Boats andy@montanadesign.com http://www.montanadesign.com - Electronics ==================================================================