PPM signal decoding and driving 10 RC servo motors

Hi All,

Is there an open source PIC project out there which can do PPM signal decoding from a RC (Radio Control) transmitter and drive 10 servo motors with a PIC (PIC18F6680) and a CD4017 decade counter?

Appearetly some how using a CD4017 decade counter with a microcontroller helps to minimize the processing load on the controller to manage multiple RC servos. (Do you know how?)

Aaron

Reply to
<Aaron Molavitz>
Loading thread data ...

Please look at the Wikipedia entry for "cross posting" and ponder the difference between that and multiple posting, which is what you have done on this group and the RC group.

--
Tim Wescott
Wescott Design Services
 Click to see the full signature
Reply to
Tim Wescott

The 4017 is a Johnson counter, so you get 10 outputs, with one high at a time. The active output advances to the next pin each time you clock it. The servo signal inputs would tie to the counter output bits. Tie the counter clock input to the output of a timer on your micro. Set your timer up as a one-shot timer with an interrupt on time expiration. Declare an array of 10 values that will correspond to the pulse lengths for each servo. Inside your timer interrupt service routine, load the timer from the next array location each time, wrapping back to the first one after 10.

Decoding the data stream from the receiver is a similar task. Inside an RC receiver, you will find a shift register chip or possibly a 4017 chip. Solder a wire to the clock input signal for the shift register or counter and another one to ground on the chip. Bring the clock signal into the input of a timer in your micro and tie the ground to the digital ground of your micro. Configure the timer to measure the width of the pulses rising edge to rising edge on the input, with an interrupt on each rising edge. In the interrupt handler, you will need to sync the software with the incoming data stream. PPM RC systems transmit between

2 and 10 pulses, followed by a sync pulse. The signal pulses are normally between 1.0 and 2.0mS wide and the sync pulse is usually at least 3 or 4 mS long. At startup, watch the pulse lengths for one that is a good bit longer than 2mS and reset your channel index. The next pulse will be channel 1, store its period in array[0], the pulse after will be channel 2, put it's length into array[1] and so on. It's a good idea to wait for the second or third sync pulse before your start calling your data real and sensing loss of signal is a good thing that will show up in timer overflows.

RC systems normally send frames at about a 50 Hz rate or 20mS per frame. A four channel system for example would send four channel pulses between

1.0 and 2.0 mS long, so the sync pulse would be about 12 mS. Note that a four channel radio may send more than four channels of data. The range of 1.0 to 2.0 mS is kind of a guide. Some radios may send 0.9 to 2.1 mS and some may send 1.1 to 1.9 mS. Computer transmitters can be configured to what they will send. All current radios assume 1.5 mS is control centered.

I have done the decoding stuff in a Freescale 56F807 for a project and it was easy to do and very solid.

You might be able to do the receive decode and manage 10 output channels in a polling loop without interrupts, but variable latency in loading the timer will result in jitter to the servo signal.

Good Luck, Bob

Reply to
BobH

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.