PDA

View Full Version : Discussion 8 channel PPM generator


BushmanLA
Jul 21, 2009, 12:37 AM
Hi guys, I'm currently writing code for a PIC based PPM generator. Basically it will read 8 analog voltages and convert this into a 'standard' PPM frame that most RC radios will be able to read into their trainer port.

I hope to have the following features in the final design.
8 proportional channels
end point adjustment
trim
aircraft profiles
channel mixing

I'm posting this here because I'm not nearly as familiar with RC radio features as you guys are and I'm hoping to get some advice as to what kind of things would be useful etc.

The basic idea is that many stand alone radio modules can be purchased that accept a PPM signal. The PPM generator could be used instead of buying an expensive RC controller. It can also be used to turn a cheap 4 or 6 channel radio into an 8 channel radio. My main reason for building this is so that I can use my X45 joystick to control my FPV aircraft. I've been flying PC sims for so long I just don't enjoy the feel of a thumb stick.


Anyway, if something like this already exists, or if you have any ideas of features you think should be added. Let me know. I'll be posting my progress here so you can tell me what I'm doing wrong or stupid. I always value the opinions of people who actually know what they are doing :)



So here is the plan so far. I'm using a PIC 18F4525. The PPM frame is generated using the CCP module working in compare mode with timer3.
Timer3 is incrementing every .4us, when the value of timer3 = the value I give to the CCP module, an interrupt is generated, the output pin is toggled, and I calculate and assing a new value to put into the CCP module for the next rise/fall of the signal.
I figured doing it this was has two main benefits.
1. I can program the rest of the user interface etc without worrying about missing the PPM timing.
2. As long as I can calculate and enter the next CCP match value before the time for the toggle has actually passed, there will never be any jitter or signal distortion etc. Since the shortest time I'll ever have is about 300us and I'm executing an instruction every .1us, this is a trivial task.


The interrupt code has been written and is working great so far.


Now I'm working on the AD inputs and converting this into appropriate signal timing.

So a few questions for you guys.
Should I go ahead and make this 12 channels while I'm at it?
How important is exponential rates etc, and what is the most common method of applying it?
What kind of channel mixing options should I try and fit in?

iter
Jul 21, 2009, 02:15 AM
Some of the lessons I am learning with my Polyglot project, which seems to address some of the same niches as yours:

* It's a ton of fun.
* It's not cheaper than COTS stuff (not if I factor in the programming time).
* I have a whole new appreciation for COTS stuff. As I am designing my own, I am learning about what some higher-end radios do, and I wonder if how much I can achieve if I hack one instead of rolling my own. It is certainly the cheaper route.
* A great benefit of building my own is that i get to make it exactly how I want it. I don't want to put in a feature that I don't have (or understand) the need for.

The bit about COTS is especially important. If all you want is a joystick that can drive your real-life model, you can simply solder its pots to an existing TX and not worry about building your own device. You can find out in a couple of hours what other features you may or may not want on top of that.

My code, though for a different uC, is under the GPL is you want to compare notes.

Ari.

BushmanLA
Jul 21, 2009, 05:32 AM
My code, though for a different uC, is under the GPL is you want to compare notes.

Ari.


I would love to, do you have a link? I plan on releasing all my code and schematics as well, as soon as the code is in at least in a non embarrassing form. :)

iter
Jul 21, 2009, 12:26 PM
http://www.rcgroups.com/forums/showthread.php?t=1069110
http://www.rcgroups.com/forums/attachment.php?attachmentid=2625904

fmkit
Jul 22, 2009, 12:01 PM
..................................
So a few questions for you guys.
Should I go ahead and make this 12 channels while I'm at it?
How important is exponential rates etc, and what is the most common method of applying it?
What kind of channel mixing options should I try and fit in?

I'm less than 3 years into RC hobby and never got used to thumbsticks.
I used Cypress PSOC controllers to make my own transmitter.
With these you can get most of work done in hardware (no jitter) with empty main loop. You can have max 8 analog (proportional channels) per chip and 20 servo outputs (per chip).
I've learned that making 20ch PPM frame cost speed
make 8-10 channels frame with 2-3 modifiers(SHIFT keys) so RX side will make 40channels out of 10 received.
It is better to make TX as simple as possible - no mixes, no expo...no models!
if you can make your PPM stream you probably can decode it too so let RX do all the specifics and never crash anything because of wrong model set.

I have one controller for everything: tank,cars,planes and even tricopter/heli.

obor
Jul 22, 2009, 03:05 PM
Hi BushmanLA,
Nice project with lot of features.
I do not understand if you want to make a TX from a PC without sticks, or if you want to go for a new TX.
Anyway, you will have a lot of fun with mixes, and trying to make something different is always interesting.
There is a lot of things to do in mixes, so you might want to focus first on a model that you want to fly.
Olivier

BushmanLA
Jul 27, 2009, 03:19 AM
Hi BushmanLA,
I do not understand if you want to make a TX from a PC without sticks, or if you want to go for a new TX.



My device will be simple be a PPM generator. You have to supply the analog inputs from an old joystick or whatever.

Right now I have the PPM frame generated pretty much like fmkit mentioned. It is all done in with timer hardware so there is no jitter, and the frame length is kept constant (this important for some receivers like bergs).

Now I just have to add support for an LCD display, saving presets in EEPROM, switches for adding trim, blah blah blah.

Janusz
Jul 31, 2009, 05:24 PM
Hi.

XJet
Jul 31, 2009, 07:22 PM
Hi.
Hey Janusz, the 16F84 has no ADCs so your circuit won't work -- unless you're planning on simply triggering an off/on change with the variable resistors.

JimDrew
Jul 31, 2009, 10:26 PM
There are pin compatible PICs that do have A/D converters.