For Copter use the ESC (Electronic Speed Control) for the brushless motors needs to be modified. Usually the signal update rate for the ESC is 50 Hz (20 m) from the Radio Control (RC). For a smoother control of the copter this update rate should be faster, about 500 Hz.
In October 2004 Bernhard Konze, see Links, developed an assembler program (Atmel ATmega8) for such a faster ESC operation.
In 2011 Simon Kirky updated the software (Atmel ATmega8) to allow a broader range of commercial ESC to be modified to a faster update rate, see Links.
There is a good list which commercial ESC could be modified, see Links.
Unfortunately in 2014 more ESC are build with a SiLabs C8051F334 MPU (Micro Processing Unit, 8051 core), which could be no longer modified. The good thing is, that Hobbyking.com is now selling ESC with SimonK program already included.
Hobbyking SS18A ESC
I bought in October 2011 4 pieces of Hobbyking SS Series 15-18A ESC. Yes, they are very cheap, but the cable to the receiver was shorted to 10 cm, and the Atmel ATmega8 MPU was no longer in the TQFP (Thin Profile Plastic Quad Flat Package, 9 x 9 mm, 0.8 mm pin spacing), instead in the MLF (Micro Lead Frame Package, 5 x 5 mm, 0.5 mm pin spacing), which makes it more difficult to solder wires to the chip for reprogramming, see the picture to the right.
For the wires I used thin wire-wrap wire. At the free side I glued with hot glue a 6 pin IC socket to the board, and shorted the pins to about 1 mm. First the 2 power supply wires are soldered. The other 4 wires are soldered one after the other to the chip, see the data sheet page 2 for the pin out.
- pin IC socket, Signal, pin of the ATmega8
- MISO, 16 (lower row, most right)
- VCC, capacitor
- SCK, 17 (right side, most down)
- MOSI, 15 (lower row)
- Reset-, 29 (upper row, 4th from the left)
- GND, regulator pin
For test I use a Servo Tester board.
I started with a hex file tp_8khz.hex and it worked, the motor turned. In the test I once powered the ESC up with the pulse width in the middle (about 1.5 ms). Then I could let the motor run forward and backward, why? It has to do with the parameter RC_PULS_REVERSE which was set to 1 in the source code.
Unfortunately you can not delete this parameter by software, once set, only by clearing the EEPROM content, which needs a programmer. The same is true for the parameter RC_CALIBRATION, once set to 1.
Therefore I need to set those parameters myself, and assemble the program myself.
I wanted to do that on Mac OS, so I installed Crosspack-AVR, see Links. Unfortunately the assembler does not follow the Atmel syntax, so I ve to use either Atmel Studio (actual version 6.2, win32 only, about 700 MB), or avra (version 1.3, freeware for Linux, Mac OS, Win32)).
Next I tried avra on Mac OS, unfortunately I got an error whiel asembly:
make tgy.hex Pass 1... /bin/bash: line 1: 729 Abort trap: 6 avra -fI -o tgy.hex -D tgy_esc -e tgy.eeprom -d tgy.obj tgy.asm 2>&1 730 Done | grep -v 'PRAGMA directives currently ignored' make: *** [tgy.hex] Error 134
Doing the same thing on Linux (Ubuntu 14.0), it works perfect.
Programmer USBtinyISP, avrdude
As a low cost programmer hardware USBtinyISP is used, see Links. The software used was avrdude (version 6.0.1) which is available for Linux, Mac OS, and Win32.
I am working on Mac OS, so the command line for programming looks like:
# flashing the ESC program $ avrdude -c usbtiny -p m8 -U flash:w:tp_8khz.hex # flashing the fuses for boot load, and brown out voltage 4.0 V $ avrdude -c usbtiny -p m8 -U lfuse:w:0x3f:m -U hfuse:w:0xca:m
Once the ESC is mounted, it is no longer easy to reflash a new program. In this case it would be nice to reflash the ESC via the pulse input wire. That can be done with either the Hobbyking.com hexTronik USB Key for HXT BESC, see at Links, or an Arduino board, either Uno or Nano 3.0.
Take care, that you can not flash the fuses, just the program itself.
I have used an Arduino Nano 3.0 board. The connection is:
Arduino Nano ESC GND GND D2 Pulse Input # +5 V must NOT be connected
First the program ArduinoUSBLinker.ino must be programmed with the Arduino IDE. You can check if it works by starting the Arduino Monitor with a Baud Rate 19200 baud:
# type: $M< ENTER # answer: P18:B32:R19200:PINS:B0:C8:D16
Then make a connection from the Arduino board to the ESC. The ESC must be self powered. The handling to flash a new program under Mac OS is:
- Connect the Arduino board to an USB port of your computer.
- Find out the interface name, e.g. from the Arduino IDE (Ports, e.g. /dev/cu.usbserial-A9GNVXD1)
- Connect the ESC without power.
- Supply the ESC with power (7 - 12 V)
- Program the ESC with avrdude in the command line:
# check for good function: $ avrdude -c stk500v2 -b 19200 -P /dev/cu.usbserial-A9GNVXD1 -p m8 avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.10s avrdude: Device signature = 0x1e9307 avrdude: safemode: Fuses OK (H:FF, E:00, L:00) avrdude done. Thank you. # flash the new file tp_8khz.hex: $ avrdude -c stk500v2 -b 19200 -P /dev/cu.usbserial-A9GNVXD1 -p m8 -U flash:v:tp_8khz.hex:i
List of pages in this category:
-- RudolfReuter 2014-11-01 10:51:21