Differences between revisions 1 and 2
Revision 1 as of 2014-11-01 10:51:21
Size: 7147
Editor: RudolfReuter
Comment: new
Revision 2 as of 2014-11-01 11:28:34
Size: 8157
Editor: RudolfReuter
Comment: new #2
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
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. 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 ms) from the '''Radio Control''' (RC). For a smoother control of the copter this update rate should be faster, about 500 Hz.
Line 11: Line 11:
In October 2004 Bernhard Konze, see Links, developed an assembler program (Atmel ATmega8) for such a faster ESC operation. For an explanation of the ESC, see at [[QuadrocopterESC#Links|Links 1]].
Line 13: Line 13:
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. In October 2004 Bernhard Konze, see at [[QuadrocopterESC#Links|Links 2]], developed an assembler program (Atmel ATmega8) for such a faster ESC operation.
Line 15: Line 15:
There is a good list which commercial ESC could be modified, see Links. 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 at [[QuadrocopterESC#Links|Links 3]].

There is a good list which commercial ESC could be modified, see at [[QuadrocopterESC#Links|Links 4]].
Line 19: Line 21:
||<tablestyle="float: right;">[[attachment:HK_SS18A_ProgIF_DSC05763.jpg|{{attachment:HK_SS18A_ProgIF_DSC05763.jpg||width="320"}}]]||
Line 20: Line 23:
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. I bought in October 2011 4 pieces of Hobbyking.com 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 (click on the picture to magnify).
Line 22: Line 25:
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 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 length. First the 2 '''power supply wires''' are soldered. The other 4
Line 24: Line 27:
 * pin IC socket, Signal, pin of the ATmega8
 1. MISO, 16 (lower row, most right)
 1. VCC, capacitor
 1. SCK, 17 (right side, most down)
 1. MOSI, 15 (lower row)
 1. Reset-, 29 (upper row, 4th from the left)
 1. GND, regulator pin

First I soldered the wire to the IC connector, the bent it, that the '''tinned end of the wire''' just touches the pin of the chip. Then, with a head lens and good light, I press for a few seconds with the '''soldering iron''' the wire down to the already tinned pin of the chip.
{{{
Wiring schematic:
pin IC socket, Signal name, pin of the ATmega8

1 MISO 16 (lower row, most right)
2 VCC capacitor
3 SCK 17 (right side, most down)
4 MOSI 15 (lower row)
5 Reset- 29 (upper row, 4th from the left)
6 GND regulator pin
}}}
Line 37: Line 46:
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'''. Unfortunately, once set, you can '''not''' delete this parameter by software, only by clearing the EEPROM content, which needs a programmer. The same is true for the parameter '''RC_CALIBRATION''', once set to '''1'''.
Line 39: Line 48:
Therefore I need to '''set those parameters myself''', and assemble the program myself. Therefore I need to '''set those parameters by myself''', and assemble the program by myself.
Line 41: Line 50:
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)). I wanted to do that on Mac OS, so I installed '''Crosspack-AVR''', see [[QuadrocopterESC#Links|Links 6]]. 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)), see [[QuadrocopterESC#Links|Links 7]].
Line 43: Line 52:
Next I tried '''avra on Mac OS''', unfortunately I got an error whiel asembly: Next I tried '''avra on Mac OS''', unfortunately I got an error while assembly:
Line 54: Line 63:
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. As a low cost programmer hardware '''USBtinyISP''' is used, see [[QuadrocopterESC#Links|Links 5]]. The software used was '''avrdude''' (version 6.0.1) which is available for Linux, Mac OS, and Win32.
Line 64: Line 73:
To check for the right '''fuse bits''', you can use an '''online calculator''', see at [[QuadrocopterESC#Links|Links 8]].
Line 66: Line 76:
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. 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 [[QuadrocopterESC#Links|Links 10]], or an '''Arduino board''', either Uno or Nano 3.0, and the program '''ArduinoUSBLinker''', see at [[QuadrocopterESC#Links|Links 9]].

Quadrocopter ESC

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 ms) from the Radio Control (RC). For a smoother control of the copter this update rate should be faster, about 500 Hz.

For an explanation of the ESC, see at Links 1.

In October 2004 Bernhard Konze, see at Links 2, 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 at Links 3.

There is a good list which commercial ESC could be modified, see at Links 4.

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.

attachment:HK_SS18A_ProgIF_DSC05763.jpg

Hobbyking SS18A ESC

I bought in October 2011 4 pieces of Hobbyking.com 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 (click on the picture to magnify).

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

First I soldered the wire to the IC connector, the bent it, that the tinned end of the wire just touches the pin of the chip. Then, with a head lens and good light, I press for a few seconds with the soldering iron the wire down to the already tinned pin of the chip.

Wiring schematic:
pin IC socket, Signal name, pin of the ATmega8

1  MISO    16 (lower row, most right)
2  VCC     capacitor
3  SCK     17 (right side, most down)
4  MOSI    15 (lower row)
5  Reset-  29 (upper row, 4th from the left) 
6  GND     regulator pin

Software Assembly

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, once set, you can not delete this parameter by software, 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 by myself, and assemble the program by myself.

I wanted to do that on Mac OS, so I installed Crosspack-AVR, see Links 6. 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)), see Links 7.

Next I tried avra on Mac OS, unfortunately I got an error while assembly:

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

To check for the right fuse bits, you can use an online calculator, see at Links 8.

ArduinoUSBLinker

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 10, or an Arduino board, either Uno or Nano 3.0, and the program ArduinoUSBLinker, see at Links 9.

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

  1. ESC = Electronic_speed_control

  2. Bernhard Konze, Reprogramming ESC

  3. SimonK, tgy -- Open Source Firmware for ATmega-based Brushless ESCs

  4. Spreadsheet list of ESC with status for modification posibility

  5. USBtinyISP, programmer for Atmel processors

  6. Crosspack-AVR for Mac OS

  7. avra assembler, source code

  8. Atmel fuse online calculator

  9. ArduinoUSBLinker

  10. hexTronik USB Key for HXT BESC

List of pages in this category:

-- RudolfReuter 2014-11-01 10:51:21


Go back to CategoryQuadrocopter or FrontPage ; KontaktEmail (ContactEmail)

QuadrocopterESC (last edited 2015-03-21 18:01:43 by RudolfReuter)