Fly Electric!

Brushless Free-Flight Timer
('Flea')

The page describes how to convert a cheap commercial speed controller into a light, easy to use, brushless free flight timer. It is also a good introduction to brushless ESC's and you could even build your own. The conversion requires very little soldering and is lighter than most people will ever be able to build themselves (2g without wires). It uses free software, can run on 1, 2 or 3 lipos and deliver up to 6A.

The motor starts at the press of a button, ramping up to full power over 1 second. It then runs for a configurable duration before gradually fading over 6sec to smooth the transition into a glide. The run time is stored permanently in memory and can easily be changed between flights. The motor can be stopped manually at any time, and will cut within a second or two if the motor is stalled. At the risk of stating the obvious, you plug the flight pack (eg: 2 cell lipo) and motor into the ESC and that's all the electronics you need.

Having a brushless timer allows you to make use of the affordable 5g, 10g and similar brushless motors. The 6A should drive up to a CDRom-sized motor (~24g). The commercial ESC I have used goes by a few names. I bought the 'Turnigy Plush 6A' ESC. The software will only work without mods if your ESC is identical. It should run on most ESC's that have an Atmel chip although may require changes to the software if not the same as mine.

The timer software is based on a DIY ESC program written by Bernhard Konze. Bernhard has very kindly made his software available for free. I have based my timer mods on his 'Flea' program. Bernhard's software can run the Turnigy like a normal ESC. All I have done is replaced the part which looks for a signal from a radio. While that sounds simple it required me to learn the programming language, how ESC's work and how Bernhard's software works. So, in addition to being a FF timer, I have commented almost every line of code in the program so it would be an excellent starting point for understanding how sensorless brushless speed controllers work (BLDC).

PLEASE NOTE: THIS DESIGN IS PROVIDED WITHOUT WARRANTY AND FOR PERSONAL NON-COMMERCIAL USE ONLY.

ASM source | HEX code | EEP code | Old versions - | - PIC Projects | Beginners Guide


TURNIGY ESC

The brains of the chosen ESC is a programmable Atmel 'ATmega8L' AVR microprocessor and the full circuit is shown above (Eagle version here). This chip has 32 pins, each of which perform a specific purpose. So just as I have configured these in the Flea software, you have to use an identical controller or make similar changes for a different ESC. The software will only suit Atmel chips although will be a useful basis for other makes.

The design requires no modifications in its simplest form. However, you will have to do at least some soldering. The minimum and some more complex options follow:

* There are six pads on the board to which a 'programmer' is connected. This is the interface cable which allows you to link your PC to the ESC to install the Flea software. This connection would normally be removed once the ESC has been programmed.

* The program expects a pushbutton between the receiver's white signal wire and the black negative wire. It is needed to start the motor and change run times. A push button can be plugged into the Rx lead or soldered direct to the board. Pads on boards can easily be ripped off so any 'dangling' items need to be handled with care.

* I have added an SMD LED (0603 size) and suitable resistor between the two middle programming pads on the board. The LED is optional but makes programming run times much easier as motor beeps can be hard to hear sometimes. A normal 3 or 5mm LED and resistor could be used as they are soldered to tabs that are quite big and easy to access. However, again care is needed to protect the tabs. The ESC will be providing 5v normally and a resistor in series with the LED must limit current to 20mA to avoid damaging the AVR.

* The ESC is intended for 2 lipos. 3 cells will be OK with short flights but some components will be out of spec and the ESC will get a bit hotter. The issue is the extra current through R24, 26 and 28 (only an issue while the motor is running so risk of damage should be low).

* The ATmega8L chip is intended for 5v but can operate down to 2.7v. It is run via a regulator which provides 5v from 6 or more volts. Its output maintains a 1v gap as voltages fall. So the ESC will stop working at 3.7v (3.7-1v=2.7v min). You can therefore use 1 cell without mods down to 3.7v under load. However, you will need to bypass or remove the 5v regulator to make full use a single lipo. You could probably remove C1 at the same time if you want to save some weight. You should not use more than 1 cell if you remove the regulator.


PROGRAMMING

You need the HEX file above, software on your PC and an interface called a 'programmer' to install the Flea software. I have generated the hex file already. If you want to make changes, you will need the ASM source file above and Atmel's free AVR Studio 4 to recompile the program.

The simplest DIY programmer is AVR_PG1 but this requires a 'real' or PCI-based serial port (USB to serial convertors seldom work). Alternatively there are many USB options on ebay or get Atmel's AVRISP mkII.

The AVR_PG1 will need PonyProg to actually squirt the software into the ESC. Atmel's AVRISP will need their Studio 4 software. AVR chips have settings called 'fuses'. The required settings are shown above.

The motor run time is stored in the mega8's EEPROM (permanent but changeable memory). The program has a default run time of '1' (x 5sec). You can either install this default value using the EEP file above, or simply use the Flea program once installed to select the default (see below).


TIMER OPERATION

* Connect battery (1 beep/flash)
* A short button press starts the motor
* Once started a short press stops the motor (manual override) and resets the software (1 beep/flash)
* If the timer stops the motor, a short press is required to reset the software (1 beep/flash) (or reconnect the battery)

* Run times are stored in eeprom and can be set when programming the chip or changed manually between flights
* Run times are in multiples of 5s (+ ramp up/down)
* The motor ramps up over ~1s when started
* The motor ramps down over ~6s when the timer stops it

* A >4s button press is required before every change to the run time (long 'high' beep/flash)
* A short press (<1s) then reduces run time by 5s
* A medium press (1-2s) increases run time by 5s
* Only one 5s change can be made at a time
* After either change the motor beeps the run time (1 beep/flash per 5s)
* The software may reset itself and beep/flash again if it does
* The motor is ready to be started at the next button press (or enter programming mode again)
* There is a long 'low' error tone if a 'zero' run time is configured (and the motor will not run)

* The program has a default run time of '1' (5s)
* This is enabled by entering programming mode as described above (>4s press)...
* ... followed by another >4s press

* The program has a simple stall detection system. The standard Flea program reduces power to 25% when the motor stalls. I have made it cut completely and reset the software after about 2s.

OTHER COMMENTS

I have tried to interpret Bernhard's program and document how it works. These comments appear in the asm source file. Newcomers to brushless controllers will find this very helpful. I may have a few things wrong so please let me have any improvements. In particular I would like a quicker acting stall detection (I have found it difficult to distinguish between a stalled motor and one that is starting slowly). Components exist on the board to make low voltage detection easy to implement using the internal ADC so 'we' need to implement that in due course.

Back
Click on the links below for other pages.

Home Art of the Possible Absence of Matter Links Updates Email
SITE MAP