PPM2USB - RC PPM to USB-Adapter
The USB side of the adapter behaves like a standard USB joystick (HID-Device). Therefore you don't need a driver for Windows or Linux (tested with Windows XP and Ubuntu 9.10). In Mac OS it should work well too, but this is not yet tested. The adapter is ideal for use with a model aircraft simulator on the PC.
Most R/C remote controls provides a so-called PPM-signal. It consists of a pulse train with about 0.4 ms long pulses. The time interval tn between the pulses corresponds to the stick-position of each channel. A time of 1.5 ms corresponds to the center position, 1ms is the minimum and 2ms is the maximum position. A pulse train consists of n+1 pulses - for 5 channels thus 6 pulses. The pulse train is repeated every 20ms (50Hz).
Bild 2: The PPM signal of a remote control with 5 channels
On my R/C transmitter, the PPM signal can be found at the trainer port. The pinout of the 4-pin. Mini-DIN connector is shown in Bild 3.
Bild 3: pinout of the trainer port on the Esky Remote
An overview of the pin connection for the trainer jacks of other manufacturers (including Graupner, Robbe, Futaba, Multiplex, Hitec) can be found here: Pinouts of various R/C transmitters
Bild 4: The schematics of the PPM2USB adapter
The circuit is quite simple and can be build on a breadboard or on a perfboard. The resistors and Zenerdiodes provide the USB-required voltage levels. The PPM signal is connected directly to the ICP-pin of the ATmega8. This works with signal levels from 1.5-5V. For the right timing an external 12MHz crystal is used.
Note: The ISP circuitry for programming the controller was left in the schematic way.
The software was developed with the AVR-GCC tool chain and consists of three parts:
The PPM decoder is completely interrupt driven. To measure the time, a 16 bit timer is used which is directly connected to the CPU clock (12MHz).
The ATmega8 has actually no USB interface. However, it is possible to implement such in software. For this purpose the free USB stack called V-USB is used.
In the main program V-USB is initialized. Then the controller goes into a infinite loop and transfers new joystick positions to the PC. It will only transfer data when the stick positions have changed. This is indicated by brief flashes of the LED.
- The included hex file is compiled for a ATMega8. The source code can be easily adapted to other AVRs (if they are supported by V-USB).
- For programming, the described programming cable can be used.
- Fuses: external crystal (lfuse: 0xEF, hfuse: 0xC9)
- You may not use this work for commercial purposes
- Projekt-Download, Git-Repository
For simulating model airplanes you can use the Free Flight Model Simulator (FMS).
Video 1: FMS test flight with A380 and Quadropcopter using the PPM2USB-adapter