German versionGerman

Use your Model-Aircraft-RC as Joystick

employing PIC18F2455


back to other projects , PIC-microcontrollers , Electronic , Homepage


General
Preface
Schematic
Download

back to my projects



General

Power supply:


via USB
Clock:


20-MHz-crystal
analog Axis:

5

8 bit resolution
controled by Channel 1..5
Buttons:
14 max

controled by Channel 6..12
RC-Typ:



3... 12 Channel RC with
PPM-Teacher/Student-output
Joystick-Controller



Preface
Model aircraft pilots like to use PC-flight-simulator software to train the handling of model aircraft without the risk of the loss of real models. It makes sense to use the own model aircraft remote control (RC) as input devise for the software. This requires an adapter. This adapter has to convert the RC into a virtual USB-joystick.

This adapter has to be connected to the teacher/student-connector of the RC, and acts as a USB-joystick with 5 axis and 16 buttons (only up to 14 buttons can be used).

The most RCs have 8 channels. This adapter supports up to 12 channels. The minimum are 3 channels.




Schematic
The joystick-controller is powered and controlled via USB. The capacitors C1 and C5 stabilize the supply voltage. C2 is stabilizing the USB-voltage if the internal 3.3V-voltage regulator.

Q1, C3 and C4 feed the microcontroller with a stable 20-MHz clock.

R1 pulls up Pin 1 of the microcontroller to high level.

The circuit is designed for a PIC18F2455. However,  PIC18F2458/2550/2553 can be used as well. (No changes at the hardware or HEX-file would be necessary.)


Teacher/Student-signal
The microcontroller expects the PPM-teacher/student-signal at the interconnected pins 12 & 13. These are Schmitt-trigger-inputs. The high-part of the PPM-signal has to be >4V and the low part has to be <1V. The polarity of the PPM-pulses (normal or inverted) is unimportant.
Never apply voltages above 5V or below 0V directly to the pins 12 &13 !

The practical output voltage levels of teacher/student-signal vary from 0.6V to 9V (depending on the brand).  This signal has to be converted to the correct voltage level for the micro controller. The circuitry contains a level converter (R3, R2, C6, Q2) to convert nearly every signal level to the correct voltage level for the microcontroller.

The teacher/student-signal of the RC has to be connected to the connector JP1.

An LED can be connected to Pin 11 (RC0). This pin is high, if a valid teacher/student-signal is received.
Schematic


Axis
The adapter emulates an 5-axis-joystick. The 5 axis are controlled by the Channels 1 ... 5 of the RC.

Buttons
The adapter emulates a joystick with 16 buttons. If a 8-channel-RC is used, then only buttons 1 ... 6 are used. Every additional channel will use 2 additional buttons. A 12-channel-RC will use the buttons 1 ... 14. The other 2  buttons have no functions at the moment. I may use them for future functions or may remove them.
Every channel controls 2 buttons. The first button becomes active, if the channels pulse width is below 25% (< 1.25 ms). The second button becomes active, if the pulse with is above 75% (> 1.75 ms).
Chanel 6 ... 8 control the buttons 1 ... 6.
The Channels 9 ... 12 (if available) control the buttons 7 ... 14.


DIP-Switch S1
The DIP-switch S1 contains 8 contacts SW1..SW8. They can be used to modify the conversion of the PPM-teacher/student-signal into the joystick emulation.

SW8
SW7
SW6  SW5 SW4 SW3 SW2 SW1
invert Channel unused unused Order of Channels

The first 4 axis of a joystick are in flight simulation programs by default used for the following functions:

Joystick Axis
1. Axis 2. Axis 3. Axis 4. Axis 5. Axis 6. Axis
Name
X
Y
Z
X-rotation
Y-rotation Z-rotation
Function in PC
Aileron Elevator Throttle Rudder - -

This is identical to the function of the first 4 channels of a Futabe-RC. But RCs of other brands use a different order. The adapter can change the order of the channels. This reordering is controlled by the positions of the contacts SW1 and SW2.

SW2
SW1
RC-Typ (Brand)
Channel 1
Channel 2
Channel 3
Channel 4
open
open Futaba / Hitec
Aileron
Elevator
Throttle
Rudder
open closed
Graupner / JR
Throttle Aileron Elevator Rudder
closed open MPX / robbe
Aileron Elevator Rudder Throttle
closed closed Sanwa
Elevator Aileron Throttle Rudder

RC-channel 5 is always assigned to joystick-axis 5. It is normally used as second (right side) aileron-channel. Flight simulations don't need this.

The contacts SW5 ... SW8 can be used to invert the channels 1 ... 4. If a contact is closed then the related Channel will be inverted. This feature is not very important, because the very most RCs can invert the signals too.
 
SW8
SW7
SW6 SW5
Channel 4
Channel 3 Channel 2 Channel 1




Download


History

08.06.2012
Bugfix: moved 2nd input from pin 24 to pin 12 (for use without bootloader))

07.06.2012
Update
- number of buttons reduced to 16
- voltage level at pin RC0 indicates a valid teacher/student-signal

06.06.2012
Update

05/06.06.2012
Prototype


back to other projects , PIC-microcontrollers , Electronic , Homepage
Author: sprut
created: 06.06.2012
last change: 08.06.2012