+ heli-sim
+ Roadmap
+ Scenarios
+ Download
+ Credits
+ Links
Mailing list:
+ Archives
+ Subscribe
+ Admin
+ PCB v2
+ PCB v1
+ Systems
+ Sensors
+ Field support
+ Prototypes
+ Summary
+ Bugs
+ Tasks
+ Stats
+ Non-SSL
<Blurry image of the first prototype in flight>

Interfacing with a "buddy box"

[ The first prototype in flight ]

[ Futaba 8U with interface board ] Commercially available joysticks like the Logitech Wingman tend to have non-linear responses, large dead-bands, and poor repeatability. These problems make them very difficult for use with precision controls, such as we require for controlling the helicopter. Luckily, most radios include a "buddy box" or training port that outputs the control positions.

Electrically interfacing with this is quite simple. Eriq Jaakkola has details on building a Futaba <--> TTL converter with pinouts for the training port. We use the transistor driver circuit, but don't connect it to the parallel port of our computer. Decoding the pulses is a real-time intensive activity, so we offload that to an embedded microcontroller.

[ PPM waveform (c) Risto Koiva ] The output is either PPM or PCM, depending on how the radio is configured. Decoding PCM is much more difficult, so we use the PPM format. Risto Koiva has written very informative details on the waveforms of the two formats. These were invaluable in decoding the signals without an oscilliscope to help visualize the format. The image on the left is an example of a PPM waveform from Risto's site.

Our software to do this for the ATmega163 on our Rev 1 IMU boards is available from onboard/src/joystick.c. The main loop of the routine looks like this:


	while( get_pulse() != sync_pulse )
		push pulse_width;

	print pulse_widths;

According to Risto Koiva's details, the sync pulse is 10ms or longer. The data pulses are similar to the actual servo encoding format, which specifies the servo position as a PWM signal. Since the data pulses are a maximum of 2 ms, this makes detecting the sync pulse fairly easy.

Currently, the system provides an interface similar to our sim/joystick.c Linux kernel interface. The source code for mapping the output of our onboard program to 'struct js_event' values is in sim/trainer.c.

The IMU board is overkill for this small application. We plan to design and build a smaller AVR based board that will provide the same interface to the trainer port. This stand-alone board will be useful for both data collection flights and flying in the simulator. A preliminary version for the ATtiny12 written in assembly is in onboard/src/tinystick.S and the software UART is in onboard/src/uart.S.

Autopilot Logo SourceForge HTML 4.0!
$Id: trainer.html,v 1.8 2002/08/05 03:44:39 tramm Exp $