I got interested recently into some USB to PPM devices and related devices, that let you generate PPM signal from your computer. What’s PPM (Pulse Position Modulation) you say? That’s a more or less standard signal many RC Radios output for “buddy boxing” for example.
This means one RC Radio controls the other one. Chances are that you also use it, when you plug your RC Radio on your computer to fly your simulator.
These devices are expensive. However, a PPM signal can travel very well over an audio channel at high rate and high precision.
I first proposed this solution on a well known RC forum, where I got a usual warm reception “it can’t work”. Somehow, as a weak human I decided they know better and left it out.
Few weeks later, I got myself one of these USB2PPM cable for $1 as part as a cheap developer program. However this cable cannot yet work on my Spektrum DX7 due to a different PPM signal. I notified the author so this might be fixed. :)
However, it was a good occasion for my PPM over audio idea to re-surface. You know, this kind of: “but of course it’s going to work, what was I thinking?!”. I thus bring to you a small open source PPM generator, that should work with most RC Radios and computers and will cost you nothing.
- An RC Radio with a trainer port supporting PPM (I use a Spektrum DX7)
- A mono or stereo audio cable male-male or stereo/mono male plugs
- A pair of hands and preferably 10 fingers (your own will do.)
While this is UNTESTED with other than Spektrum radios, this should work for your own radio, if you’re willing to solder and program a little bit. So DO THIS AT YOUR OWN RISKS. Now that you’re warned, let’s go..
I’ll link several times to the excellent SmartPropoPlus, which does just the opposite of what we’re going here, sending PPM from the RC Radio to the computer using an audio cable. (In case you did not get it yet, we send PPM from the computer to the RC Radio instead).
Easiest, if you don’t feel like you need to protect your sound card you can use a regular stereo or mono male-male wire - i’m doing just that!):
Note: PCM probably works very well too, but you’ll need to modify the program, I don’t have a PCM Radio yet. We’re only dealing with PPM today!
The Spektrum DX7 PPM signal
The PPM frame is 22.5 milliseconds.
It starts with a PPM “stop”, negative signal of 0.4 milliseconds.
Each channel (8 channels, no matter how many the transmitter supports) is a positive signal of 0.7 milliseconds to 1.5 milliseconds. This means, 0.7 milliseconds is “full left” servo position, 1.5 milliseconds is “full right” servo position and 1.1 milliseconds is “middle” or neutral position (default stick position, except for throttle).
- Vertical stabilizer
- Aux2 or Gear
- Aux2 or Gear
- Usually a mix
- Unused on the DX7
After a channel signal, a 0.4 millisecond “stop” is inserted.
Once all channels and stop have been stored into the PPM frame, a leading “blank” (flat signal) is inserted so that the complete signal is 22.5 milliseconds (so the size of the flat signal depends on servos positions, that’s why it’s calculated at the end.. even if its put at the start of the signal).
The amplitude is important. It depends on your sound card. In reality, it’s 1.3volts. If the amplitude is incorrect, the Spektrum DX7 just won’t understand the PPM signal!
Currently, this is only a Linux program using ALSA as audio output. This is basically a demo program.
You’ll need pygtk, gtk, alsa-lib, pyalsaaudio to run the program. Please excuse the code, it’s only used as a working proof of concept, and may help you code your own! Here is the PPM generation extract only:
The full program is available here (again, Linux only!)
I plan to port this program to Windows (in fact, it might become Windows only for a while as my video capture USB stick has only Windows drivers and I can’t be bothered to reverse them on Linux. Then I can fly my stuff using a joystick while looking at the video feed :). Feel free to make your own program tho. I’ll appreciate if there’s a mention of where you got the idea from :P
The Windows program will interface with Windows joysticks so you can use your joystick to control your RC aircraft. With luck, someone will improve it later to support PCM and maybe trims/mixing. I do not currently plan to implement it as my Spektrum DX7 takes care of this (P-LINK mode), but I might upon request.