22 Jun 2002 hudson   » (Master)

I'm almost done with rev2 of my control board for my helicopter robots. Last week I redesigned the mainloop to make better use of the hardware available on the AVR MCU.

The first big improvement is using the hardware PWM generator to produce the PPM signal that drives the servos. A 4017 decade counter then divides the signal to ten servos. Since the Mega163 has two sixteen bit PWM outputs, we can drive twenty servos with zero interrupts and minimal CPU overhead. More importantly, the CPU overhead is "whenever" the mainloop gets to it, rather than having hard realtime constraints. The source code is in rev2/servo.h and here is an image of the board with the 4017 + 10 servos. As a side benefit, driving the twenty servos only requires three IO lines rather than twenty.

We can also decode a PPM signal in realtime with no CPU overhead thanks to the input capture feature on the MCU. I've written details on the PPM waveform and how to interface with it. The decoding source is in rev2/ppm.h.

There are other big changes. I need to finish the board design and have ExpressPCB fab up another set.

Latest blog entries     Older blog entries

X
Share this page