ChRoMicro - Cheap Robotic Microhelicopter HOWTO
Copyright © 2005 pascal.brisset@wanadoo.fr
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.
| Revision History | ||
|---|---|---|
| Revision 1.0 | 2005-06-02 | PB |
| First public release. | ||
| Revision 0 | 2005-05-27 | PB |
| Document created. | ||

Table of Contents
List of Figures
List of Tables
RC model helicopter prices have reached a point where all sorts of challenging (i.e. crash-prone) robotics projects become affordable. This document explains how to build a 300 g, 3D-capable helicopter with embedded Linux and Bluetooth datalink for less than 500 EUR.
As a proof of concept, we provide software which allows the helicopter to be remotely controlled over Bluetooth with a PC joystick. Future work will focus on the integration of sensors (IMU, altitude, magnetic compas, GPS, camera) and flight control software (either third-party or dedicated).
A number of inexpensive microhelicopters are now available to RC model hobbyists: Ikarus Piccolo, MS Hornet, Carboon, Dragonfly, Hummingbird, Tiny, Aerohawk. These are essentially scaled-down versions of regular model helicopters, made possible by advances in battery technology. Some models have a rotor head with fixed collective pitch (FP), while others have both cyclic and collective pitch (CP). Most have a dedicated tail motor rather than a variable-pitch tail rotor.
A recent radical innovation is the "ProxFlyer" self-stabilizing deformable rotor design. Unfortunately, current commercial implementations are too small to be used as robotic platforms. Besides, stability is obtained by sacrificing maneuverability.
For this project we use a commercial ARF microelicopter kit containing:
A pre-assembled helicopter with collective-pitch rotor, two brushed motors and three miniature servos
An electronics package with BEC, 6-channel RC receiver, yaw gyro, and motor drivers
A 41 MHz 6-channel RC transmitter with hardwired CCPM mixing
A 11.1 V, 850 mAh lithium-polymer battery
A battery charger.
The aircraft weighs 270 g and can lift at least 50 g of payload.
The electronics package is a "black box" which connects all components together. This is in contrast with larger model helicopters, where the connections between the receiver, gyro, BEC and motor drivers are exposed and documented. Integrating all these components reduces size, weight and cost, but makes modifications harder.
Fortunately, in some commercial microhelicopters, the "black box" can be tinkered with fairly easily. It actually consists of two boards connected back-to-back with a 2x3-pin connector (see Figure 1):
A generic RC receiver board with seven 3-pin PWM servo outputs.
A power/gyro board with BEC, gyro, failsafe, and motor controllers.
Table 1 lists the PWM outputs, two of which are routed internally between the two boards.
Table 1. RC receiver PWM outputs.
| Channel | Usage |
|---|---|
| 1 | Right servo |
| 2 | Front servo |
| 3 | Main motor (internally connected to the power/gyro board) |
| 4 | Tail rotor (internally connected to the power/gyro board) |
| 5 | Unused |
| 6 | Left servo |
| B | Unused (12 ms sync pulses) |
Any similar helicopter can be used. The main requirements are:
The controller board must use PWM signals. Generating PCM signals would require more work, especially if proprietary encodings are involved.
The controller board must expose the multiplexed PWM signal between the FM radio receiver and the demultiplexer (see Section 3.2), or at least the PWM inputs to the motor drivers.
The helicopter must be strong enough to lift at least 30 g of payload.
The battery must be able to supply 200mA of additional current.
We use a Gumstix single-board computer with the following features:
200 MHz XScale PXA255 processor (ARM)
4 MiB flash with factory-installed Linux-2.6.10 and utilities
64 MiB SDRAM
General-purpose I/O pins
I/O daughterboard with 2.54 mm pads
I2C bus
Bluetooth module and antenna
Comprehensive software development environment
Some features are not used:
Hardware PWM generator: Intended for driving the brightness and contrast of a LCD display. We need more than two channels.
USB client interface: Intended for ARM-based PDAs. usbnet is useful for logging into the Gumstix, but we can use Bluetooth instead.
The power/gyro board has two +5 V voltage regulators labelled CX1117-5.0 and mounted in parallel. Idle current is 50 mA.
Since this +5 V rail is exposed on each servo connector (including the unused ones), the Gumstix can be conveniently powered from it. In order to accomodate the extra current (100-200 mA total), it might be necessary to replace the two voltage regulators with a larger, externally-mounted 7805.
In order control the helicopter, we modify the RC receiver board so that the Gumstix can inject its own PWM signal into the PWM demultiplexer.
Why not get rid of the receiver board entirely and generate five PWM signals with the Gumstix ? The proposed approach has several advantages:
No need to build a custom PCB.
Only three wires between the Gumstix and the helicopter (GND, +5 V, multiplexed PWM).
The PWM demultiplexer adds one layer of electrical isolation between the Gumstix and the power electronics.
Figure 2 shows details of a typical RC receiver board and the modification. Simply cut the correct PCB trace(s) and connect both ends to a 2-pin connector outside of the plastic enclosure. Chronograms should help locate the signals.
The original functionality can be restored by disconnecting the Gumstix and inserting a jumper.
Xbox controllers are widely available, cheap, and have well-defined functionality (unlike PC joysticks). They can be connected to a PC by replacing the proprietary connector with a USB plug.
Alternatively, any USB joystick (a.k.a. joypad or gamepad) with two dual-axis analog sticks can be used. In this case the mixer configuration file must be adjusted to match the layout of the axes (see Section 4.3).
Source code is available from http://perso.wanadoo.fr/pascal.brisset/chromicro/dist/chromicro-1.0.tgz.
pxa_mpwm.ko is a timer-based multi-channel PWM signal generator for the PXA255, implemented as a loadable kernel module for linux-2.6.10gum.
It can be configured to a generate a single multi-channel PWM signal and/or multiple single-channel PWM signals on GPIO pins. GPIO pins, channels and timings are configured with module parameters as illustrated in Table 2.
Table 2. MPWM configuration examples.
| Application | Module parameters |
|---|---|
| One output signal with 6 multiplexed PWM channels | modprobe pxa_mpwm gpio=61 nchans=6 tmin=500 tmax=1500 tpause=500 tsync=12000 |
| Same with single-channel servo outputs except CH5 | modprobe pxa_mpwm gpio=61 nchans=6 servo=58,59,60,62,-1,63 tmin=500 tmax=1500 tpause=500 tsync=12000 |
| Single-channel servo outputs only | modprobe pxa_mpwm nchans=6 servo=58,59,60,62,-1,63 tmin=500 tmax=1500 tpause=500 tsync=12000 |
User-mode programs drive the PWM generator through a device interface. See Table 3. PWM generation begins when a program opens the device and sets values for all channels. GPIO pins are reverted to a logical 1 when the program closes the device.
Table 3. MPWM devices.
| Device | Usage |
|---|---|
| /dev/mpwm0 | PWM signal #1 (all channels written at once) |
| /dev/mpwm0-0 | Channel #1 of PWM signal #1 |
| /dev/mpwm0-1 | Channel #2 of PWM signal #1 |
| /dev/mpwm0-2 | Channel #3 of PWM signal #1 |
| /dev/mpwm0-3 | Channel #4 of PWM signal #1 |
| /dev/mpwm0-4 | Channel #5 of PWM signal #1 |
| /dev/mpwm0-5 | Channel #6 of PWM signal #1 |
MPWM uses OSMR1 (OS Match Register 1), which is normally available on the Gumstix. (OSMR0 is used by the Linux system timer and OSMR3 is used by the watchdog.)
The PXA255 timer period is 270 ns, which provides 11 bits of resolution for a typical PWM signal with 1 ms range. Although MPWM uses a high-priority PXA255 FIQ rather than a regular IRQ, jitter can be as high as several microseconds. This is still good enough for flying a helicopter. See also Section 9.2.
bluerc_rx is a user-mode program designed to run on the Gumstix. It receives RC data as UDP packets over a Bluetooth BNEP connection and forwards them to the PWM generator.
The program will terminate if it does not receive any UDP packet during a configurable interval. This will disable the PWM outputs and (hopefully) cause the power/gyro board to shutdown the motors.
Usage: bluerc_rx [-p
Example: bluerc_rx -p 9000 -t 2000 -c /dev/mpwm0
bluerc_tx is a user-mode program designed to run on a Linux host with a Bluetooth dongle and a USB joystick. It reads the positions of the analog sticks and triggers, mixes them linearly into 6 RC channels, and sends the channel values to the helicopter as 6-byte UDP packets over a Bluetooth BNEP link.
Usage: bluerc_tx [-c
Example: bluerc_tx -c /dev/js0 -r 50 -m xpad_ccpm120_mode2.mix -d 192.168.10.1 -p 9000
The mapping from joystick axes to RC channels is defined by a matrix in the configuration file. Figure 3 shows the default setup.
Procedure 1. Trimming
Bring the sticks to the desired "neutral" setting.
Depress the "back" button.
Allow the sticks to return to their central position.
Release the "back" button.
In this scenario (Figure 7) we simply emulate a regular remote control. There are no sensors on the helicopter, no complex embedded software, and no feedback from the helicopter to the ground station.
For a quick start, try make tx and make rx in the src directory.
Procedure 2. Startup
Start bluerc_tx on the PC.
Connect the battery. The GPIO pin will be pulled high while the Gumstix is booting.
Setup networking over Bluetooth (BNEP). This can be automated with pand.
Load pxa_mpwm.ko on the Gumstix. The GPIO pin will be configured for output, but kept at logical 1.
Start bluerc_rx on the Gumstix. PWM will be generated as soon as UDP packets are received.
Procedure 3. Shutdown
Either disconnect the battery, stop bluerc_rx, or stop bluerc_tx. All alternatives should be equally safe. Note that with the original FM remote control, it is mandatory to disconnect the receiver or battery before stopping the transmitter.
Use these instructions and the related software at your own risk.
This is experimental software with none of the failsafe features one could expect in a commercial product.
Remote-controlled aircrafts are not toys. They are usually operated by properly-trained and insured hobbyists on dedicated airfields.
Due to their mechanical complexity and moving parts, helicopters are among the most dangerous aircrafts.
Robotic aircrafts tend to wander in unpredictable ways.
Software dumps core; hardware just crashes.
Lithium-polymer batteries are known to burst in flames when damaged.
Bluetooth radio range is 10 m. This is not appropriate for outdoor flight.
rcpilot - http://rcpilot.sourceforge.net/
Autopilot - http://autopilot.sourceforge.net/
Paparazzi - http://www.nongnu.org/paparazzi/ (Note: I am *NOT* related to pascal.brisset (at) enac (dot) fr).
Remove the Gumstix daughterboard. Connect directly to the 60-pin Hirose connector.
Remove the RC receiver board. Generate 5 PWM signals.
Goal: Reduce the jitter of the timer-based PWM generator.
Lock the FIQ handler in the I/D cache ?
Inertial measurement unit. 6 DOF, I2C interface.
Video camera
Magnetometer. I2C interface.
Pressure (altitude, airspeed). I2C interface.
Camera.
Goal: Get rid of the computer.
Thanks to the next generation of videogame consoles, cheap Bluetooth joysticks should be available in 2006.
Refers to a model aircraft which is sold pre-assembled.
A DC-DC voltage converter (linear regulator or switching converter) which is used to power a RC receiver and servos from the same battery as the motors. Output is typically 4.8V or 5V.
Provides an ethernet-like interface (e.g. bnep0) at each end of a Bluetooth connection.
Refers to a helicopter rotor design with variable collective pitch. Thrust is controlled by varying either the collective pitch or the speed of the main motor.
See Also Fixed pitch.
Refers to a helicopter rotor design with cyclic pitch, but fixed collective pitch. Thurst is controlled by varying the speed of the main motor. This causes more inertia than a "CP" helicopter. Besides, "FP" helicopters cannot fly inverted.
See Also Collective pitch.
The PXA255 has 85 general-purpose pins which can be independently configured for input or output, or connected to integrated peripheral functions (e.g. serial ports and LCD).
Accelerometers (translation) and gyros (rotation)
Alternative layouts for axes on a RC helicopter transmitter.
A generic term for digital transmission.
An improper term for PWM, in RC terminology
A modulation which encodes an analog signal into variable-length digital pulses.
Not necessarily autonomous.

你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=1863915