RCU Forums

RCU Forums (https://www.rcuniverse.com/forum/)
-   RC Radios, Transmitters, Receivers, Servos, gyros (https://www.rcuniverse.com/forum/rc-radios-transmitters-receivers-servos-gyros-157/)
-   -   Convert PPM to PWM (https://www.rcuniverse.com/forum/rc-radios-transmitters-receivers-servos-gyros-157/2606244-convert-ppm-pwm.html)

Dj Vinz 01-31-2005 05:36 PM

Convert PPM to PWM
 
Hi there!

I am making my end of year school project,
with 2 friends, and we have to read PPM signal from a gyro or receiver,
into our digital microcontroller (µC) (a PIC16F873 @ 4 mhz)

I have some PWM input in my µC,
but no PPM input, i tried to read it via analog digital conversion,

but all i get is 0 or 255,
wich is normal, since PPM consists of a little peak, every time a PWM signal would stop.
They both start at the beginning of your period in a predefined frequency.

.freq: |_________|_________|_________|_________|

PWM: |¯¯¯¯|____|¯¯|______|¯¯¯¯¯|___|¯¯¯¯ ¯|____|

.PPM: _____|_______|____________|________|_____

What i need to know, is, how i could easily convert the PPM signal to a PWM signal,
and maybe backwards.

Anyone has some experience?

Thanks!

laryboy 02-01-2005 11:03 AM

RE: Convert PPM to PWM
 
a simple chip called a j-k flip flop should do the trick. the freq input goes to the j input and the ppm goes to the k input. since these flops trigger on negative edges signal inversion is necessay. probably many other ideas will be posted. i hope i am not dating myself wit j-k flip flops

Dj Vinz 02-01-2005 11:08 AM

RE: Convert PPM to PWM
 
Thanks!!
I really can't find ANY information anywhere...
Even my teachers at school have no idea!

I'm allready very happy with your reply,
and hope other people have idea's too!

Thanks!

laryboy 02-01-2005 11:34 AM

RE: Convert PPM to PWM
 
the key is to notice that the pwm signal goes positive at each freq tic mark and negative at each ppm tic mark

Dj Vinz 02-01-2005 11:44 AM

RE: Convert PPM to PWM
 
Yes, indeed.

I really understand the difference and the relation between the two signal modulations,
but i didn't knew how i could easily convert / demodulate the signal.

I found some great site explaining the two types of signal modulations,
but nothing about conversion
http://www.tpub.com/content/neets/14.../14184_135.htm

Dj Vinz 02-06-2005 03:35 PM

RE: Convert PPM to PWM
 
mm less reply than i thought...
* up...

mr.rc-cam 02-06-2005 04:20 PM

RE: Convert PPM to PWM
 
Examples of PIC routines for servos is found here: http://www.piclist.com/techref/microchip/servos.htm

Decoding the full R/C PPM frame is MUCH more complex. You must determine the start of the frame (look for the frame reset), then start measuring the width of each channel as it is serially presented. The channels are separated by sync's, which must be detected by your software. Each frame is separated by a reset pulse.

Your code must do everything. You can use simple polling techniques or take advantage of the interrupt features that are available on some PICs. This sort of project is not well suited for an entry level PIC programmer.

Gayu 05-24-2016 02:12 AM

PPM to PWM conversion can be made using a Bistable Multivibrator


All times are GMT -8. The time now is 01:06 AM.


Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.