The Hobby eStore - RC helicopters, planes cars and tanks
Shop online for RC Helicopters, Planes, Cars, Tanks and Boats.
Free Shipping from China, Hong Kong and the UK. All Prices are in GBP.

(We no longer ship to the USA or Canada)
Log In  |  Create a Profile
Your Shopping Cart   Shopping Cart.
Cart is empty..
NEW! Forum | RSS Feed | Bookmark Us | Contact Us      
RC Helicopters RC Planes RC Cars RC Boats RC Tanks RC Radio Gear Simulators Spares Upgrades
  Home » General Help » HOW TO: Build a Robotic Helicopter
Categories
 RC Helicopters  (77)


 RC Planes  (28)


 RC Cars  (18)


 RC Boats  (20)


 RC Tanks (6)


 RC Radio Gear (4)


 Simulators (3)


 Spares  (870)


 Upgrades (14)

Great hot deals


Newest Products

The DG-RC eStores Amazon store
Manufacturers
Quick Find
 
Use keywords to find the product you are looking for.
Advanced Search
Articles
IMPORTANT Please read
General Help
Nitro Car Advice
Electric Car Advice
Airplane Advice
Helicopter Advice
Helicopter Flying School
Receiving our emails
What's New? more
WH2-012 - 3 in 1 Board.
WH2-012 - 3 in 1 Board.
GBP £32.00
GBP £19.20
Information
Shipping & Returns
Warranty & Disclaimer.
Privacy Notice
Conditions of Use
Contact Us
Catalog Feed
HOW TO: Build a Robotic Helicopter

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.


1. Introduction

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).

2. Off-the-shelf Components

2.1. Helicopter platform

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.

Figure 1. Contents of the integrated controller in a typical commercial microhelicopter kit.

Contents of the integrated controller in a typical commercial microhelicopter kit.

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.

2.2. Embedded computer

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.

2.3. Other equipment

  • Linux computer with USB and Bluetooth

  • Xbox-compatible controller

  • 12 V, 5 A regulated power supply

  • 10 Mhz analog oscilloscope (recommended)

3. Hardware

3.1. Voltage regulator mod

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.

3.2. PWM injection mod

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.

Figure 2. RC receiver board details and modifications (in red).

RC receiver board details and modifications (in red).

The original functionality can be restored by disconnecting the Gumstix and inserting a jumper.

3.3. Xbox controller mod

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).

4. Software

Source code is available from http://perso.wanadoo.fr/pascal.brisset/chromicro/dist/chromicro-1.0.tgz.

4.1. MPWM: Multi-channel PWM generator

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.

4.2. Bluetooth RC receiver emulator

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 <port>] [-t <timeout>] [-c <PWM device>]

Example: bluerc_rx -p 9000 -t 2000 -c /dev/mpwm0

4.3. Bluetooth RC transmitter emulator

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 <joystick>] [-r <refresh rate>] [-m <matrix>] [-d <dest IP>] [-p <dest port>]

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

  1. Bring the sticks to the desired "neutral" setting.

  2. Depress the "back" button.

  3. Allow the sticks to return to their central position.

  4. Release the "back" button.

Figure 3. Mixer configuration xpad_ccpm120_mode2.mix.

Mixer configuration xpad_ccpm120_mode2.mix.

Figure 4. Coefficients for 120° CCPM mixing.

Coefficients for 120° CCPM mixing.

5. System integration

Figure 5. Helicopter + ARM + Linux.

Helicopter + ARM + Linux.

Figure 6 and Table 4 show the connection with the Gumstix daughterboard.

Figure 6. Rear view with connector on I/O daughterboard.

Rear view with connector on I/O daughterboard.

Table 4. Gumstix daughterboard I/O pin assignments.

Pin Signal Usage
10 NACRESET (disconnected) +5 V CC in
16 GND GND
18 GPIO61 6-channel PWM out

6. Operation

6.1. Bluetooth remote control

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.

Figure 7. Bluetooth remote control overview.

Bluetooth remote control overview.

For a quick start, try make tx and make rx in the src directory.

Procedure 2. Startup

  1. Start bluerc_tx on the PC.

  2. Connect the battery. The GPIO pin will be pulled high while the Gumstix is booting.

  3. Setup networking over Bluetooth (BNEP). This can be automated with pand.

  4. Load pxa_mpwm.ko on the Gumstix. The GPIO pin will be configured for output, but kept at logical 1.

  5. 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.

7. Disclaimer

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.

8. Related open-source projects

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).

9. Roadmap

9.1. Weight reduction

  • Remove the Gumstix daughterboard. Connect directly to the 60-pin Hirose connector.

  • Remove the RC receiver board. Generate 5 PWM signals.

9.2. PWM generator accuracy

Goal: Reduce the jitter of the timer-based PWM generator.

Lock the FIQ handler in the I/D cache ?

9.3. Sensors

  • Inertial measurement unit. 6 DOF, I2C interface.

  • Video camera

  • Magnetometer. I2C interface.

  • Pressure (altitude, airspeed). I2C interface.

  • Camera.

9.4. Bluetooth QoS

Goal: Reduce datalink latency.

Use a more appropriate protocol than BNEP.

9.5. WiFi datalink

Goal: Improve range.

9.6. Bluetooth-enabled controller

Goal: Get rid of the computer.

Thanks to the next generation of videogame consoles, cheap Bluetooth joysticks should be available in 2006.

9.7. Flight control software

  • Assisted flight: stable hover, 3D

  • Waypoints

  • Takeoff and landing

  • Autonomous navigation, image processing

References

[pxa255_dev] Intel PXA255 Processor. Developer's manual.

[pxa255_user] Intel XScale Microarchitecture for the PXA255 Processor. User's Manual.

[pxa255_elec] Intel PXA255 Processor. Electrical, Mechanical, and Thermal Specification.

Glossary

Almost Ready to Fly (ARF)

Refers to a model aircraft which is sold pre-assembled.

Battery-Elimination Circuit (BEC)

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.

Bluetooth Network Encapsulation Protocol (BNEP)

Provides an ethernet-like interface (e.g. bnep0) at each end of a Bluetooth connection.

Collective pitch (CP)

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.

Cyclic-Collective Pitch Mixing (CCPM)
Fixed pitch (FP)

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.

General-Purpose I/O (GPIO)

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).

Global Positioning System (GPS)
Inertial Measurement Unit (IMU)

Accelerometers (translation) and gyros (rotation)

Lithium-Polymer (LiPo)
Mode 1 / Mode 2 ()

Alternative layouts for axes on a RC helicopter transmitter.

Printed Circuit Board (PCB)
Pulse Code Modulation (PCM)

A generic term for digital transmission.

Pulse Position Modulation (PPM)

An improper term for PWM, in RC terminology

Pulse Width Modulation (PWM)

A modulation which encodes an analog signal into variable-length digital pulses.

Unmanned Aerial Vehicle (UAV)

Not necessarily autonomous.

Current Reviews: 0
Write Review
Bestsellers
01.Honey Bee CP2 eSky 6CH 3D RC Helicopter - NEW.
02.EK4-0000 Wooden Main Blades.
03.EK1-0221 Training Gear.
04.Plastic Main Rotor Blades.
05.EK1-0200A Rotor Head Set.
06.EK1-0201 Main Blades Control Link.
07.Honey Bee Esky King 2 6CH CCPM Electric RC Helicopter RTF.
08.USB Sim Cable (Esky, JR, Futaba).
09.New eSky FP 4CH Helicopter (E004).
10.EK1-0224 Main Motor Heat Sink.
Specials more
HM-4#3-Z-12 Battery Frame.
HM-4#3-Z-12 Battery Frame.
GBP £3.00
GBP £2.10
Verification Seals
Official PayPal Seal
Reviews more
Honey Bee CP2 eSky 6CH 3D RC Helicopter - NEW.
Thanks DG-RC, I have purchased stuff from China before, but ..
5 of 5 Stars!
Testimonials more

Hi, Thanks for taking my comments on board. I noticed the web page has been changed already.Good Wor...

Read More


David M     
Babelfish Translation





Copyright © DG-RC eStores 2006 - 2009