Thread Tools
Sep 03, 2012, 04:03 PM
Just another user
Dennis Frie's Avatar
Thread OP
Discussion

DIY PPM generator PPM reader and PPM expander


This is mainly meant as inspiration for an easy and reliable way to create and read PPM-signals very accurate.

It's written for Arduino and should be easy to use if you need to hook up a joystick, sensor or whatever.

It's all written with best performance in mind. Both PPM generate and reading is done with hardware-peripherals to get a very accurate timing.

PPM create:
Shows how to use timer1 and compare register A to generate a hardware-timed PPM signal. As the PPM-signal is being triggered by hardware it should give a very accurate timing.

1-12 channels PPM out
Adjustable dead-time.
PPM-value can just be set within main-loop

PPM read:
In the PPM read 2 ways to read the PPM signal is included. One uses pin-change interrupt, while the other one uses the input-capture. While the pin-change interrupt works fine, the timing is a lot more accurate on input capture, as it is hardware-controlled instead of software.

It will automatic detect number of channels received.

12 channel PPM out:


8-channel PPM out:


Comparison between pin-change interrupt and input capture. First ½ graph is input-capture, last path is pin-change interrupt.
Please note input-capture only deviates +/- 1, which is most likely just "jitter" between the 2 different clocks.


Another comparison between pin-interrupt and input capture:
First ½ graph is pin-change interrupt, the last is input-capture.


I'll maybe add a solution for PPM read and generate later (can be used for PPM-expansion etc.).

The code is attached.
Last edited by Dennis Frie; Sep 06, 2012 at 03:05 PM.
Sign up now
to remove ads between posts
Sep 03, 2012, 04:12 PM
Registered User
junioro16v's Avatar
Another good DIY project Dennis.
Subscribed
Sep 04, 2012, 12:42 PM
Registered User
jalves's Avatar
Another diy!

Good work Dennis.
Sep 05, 2012, 02:47 PM
Just another user
Dennis Frie's Avatar
Thread OP
Thanks

The code for PPM expansion is also written, just need a bit of testing before I'll upload.

Testing with 3 Arduinos creating, reading, creating reading and creating PPM again to make sure it doesn't make any weird behaviors

Last edited by Dennis Frie; Sep 05, 2012 at 03:23 PM.
Sep 06, 2012, 03:05 PM
Just another user
Dennis Frie's Avatar
Thread OP
PPM expander added to post #1.

Read PPM-input and create PPM-output. Can be used to expand an existing x-channel PPM-stream to 12-channel PPM-stream or whatever.
Oct 23, 2012, 12:32 PM
Registered User
What about reading PWM and creating another PWM based on that? Like if loss of signal on one channel, create pulse of specified micro-seconds?
Oct 23, 2012, 02:58 PM
Just another user
Dennis Frie's Avatar
Thread OP
Quote:
Originally Posted by msev
What about reading PWM and creating another PWM based on that? Like if loss of signal on one channel, create pulse of specified micro-seconds?
Pretty much already done. You can just assign the PPM readings to an array and add something like:

if (channel x > failsafe_detected) {
Do something
}
Oct 23, 2012, 04:32 PM
Up up and away!
FpvKiwi's Avatar
I don't mean to hijack the thread but if anyone would prefer hardware customized for RC, here's my Channel Wizard with a lot of features configurable without compiling any code.
Oct 24, 2012, 02:35 AM
Registered User
Shameless advertising...Some people like to make things on their own.
Oct 27, 2012, 06:44 PM
Registered User

Is PPM generator compatible with TSLRS?


Is this PPM generator compatible with TSLRS?
TSLRS requires constant frame length for every combination of values in single channels.
If that is the case I am interested to make one, it will be for me definitely the most cost effective solution for this problem.
Oct 27, 2012, 07:03 PM
LKJ
LKJ
Lars k Jensen
Quote:
Originally Posted by nebeski
Is this PPM generator compatible with TSLRS?
TSLRS requires constant frame length for every combination of values in single channels.
If that is the case I am interested to make one, it will be for me definitely the most cost effective solution for this problem.
Dennis fly TSLRS so i think so. so yes.

Lars.
Oct 29, 2012, 01:02 PM
Registered User
Thanks Dennis! Looks like another great project.

I've heard the PPM stream is standardized for all RC Tx that are module-based.
I have a Futaba 7CAP which is not module-based. Anyone have any idea if this would work with it?

For that matter, I find the Generate_PPM hard to follow. Where does the code read the analog values on which to base the PPM stream (like from an analog joystick)?

Regards,
Alex
Nov 08, 2012, 12:23 AM
ROFLCOPTER
Iron Savior's Avatar
Quote:
Originally Posted by sandmaninator
Thanks Dennis! Looks like another great project.

I've heard the PPM stream is standardized for all RC Tx that are module-based.
I have a Futaba 7CAP which is not module-based. Anyone have any idea if this would work with it?

For that matter, I find the Generate_PPM hard to follow. Where does the code read the analog values on which to base the PPM stream (like from an analog joystick)?

Regards,
Alex
Generate_PPM doesn't read any values, they're pre-determined at compile time.
Nov 08, 2012, 12:45 PM
ROFLCOPTER
Iron Savior's Avatar
Here's a question about the PPM generator. I'm not so familiar with the AVR, but the notion of how the timers and interrupts work is not lost on me. How accurate can these pulse widths be (as in the finest degree of precision you can reliably produce) when generated like this using this uC?
Nov 08, 2012, 12:48 PM
Just another user
Dennis Frie's Avatar
Thread OP
Quote:
Originally Posted by Iron Savior
Here's a question about the PPM generator. I'm not so familiar with the AVR, but the notion of how the timers and interrupts work is not lost on me. How accurate can these pulse widths be (as in the finest degree of precision you can reliably produce) when generated like this using this uC?
The PPM-signal is all hardware-generated. In theory, it should be as accurate as the clock. The clock divider will ofc. define the resolution


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion DIY Wireless Simulator w/frsky PPM out RX michaelkramer11 Simulators 4 Nov 14, 2020 08:17 AM
Question PPM to TX problem with arduino generated PPM Nase DIY Electronics 65 Jul 22, 2016 06:42 PM
Question DIY Engine Sound Generator Maverickk Scale Kit/Scratch Built 1 Jun 30, 2012 05:15 PM
Discussion Generate a PPM signal fkendoul UAV - Unmanned Aerial Vehicles 0 Dec 15, 2007 10:22 AM
Idea Generate buddy-box PPM from a soundcard? iter DIY Electronics 0 Mar 13, 2006 01:38 AM