Tuesday, January 7, 2014

Flashing Custom Firmware: OH THE HORROR!

   Well I knew this would have to be done sooner or later but what I had to realize is that pretty much every micro-controller needs to run on custom firmware. The 6 Atmega 8P based ESCs run on SimonK firmware, the ATMega2560 on the APM 2.5 runs on custom hexacopter firmware as well as the camera boards I am planning to add. This means a lot of manual flashing for me, so here is some details on how that was done.

Come to think about it, the haxacopter is like an Octopus in that it has multiple brains, one central main brain and several smaller brains in the arms.  So yeah, a cute little analogy here.

This is the main section of 1 of the ESCs, yu can see the voltage regulators as well as the Atmega 8P micro controller, a crystal oscillator, etc. Its really a small, full featured micro controller.


This is the back of the ESC, it reveals a large discharge capacitor as well as an array of 12  high current MOSFETs for a total peak continuous AC driving power of 30Amps with a peak power of 40Amps for 10 seconds on average cooling

To note here is that what the ESCs do is primarily convert DC voltage from the battery into AC voltage for the brushless motor. Secondly, they regulate a steady 5V @ 2A power supply for the APM and the rest of the system, assuring operation of the device. Since they are used as drivers for the motors, they will obviously also get throttle input from the APM. 

Normal ESCs will take the average PWM control single from the Rx and average the values to get a good overall speed for something like a plane, on a multi rotor on the other hand you need to have rapid and accurate throttle response. The SimonK and similar ESC firmwares bypass some of the features on the ESCs such as voltage protections and other unnecessary add-ons, favoring throttle response and thus allowing Multirotors to "Lock" in a direction, thus removing the whole that comes from the flight controller trying to stabilize the multi rotor.

First of all all flashing require a USB ASP or similar device .

The first method of flashing is smothering 6 wires to incredibly small and fragile pads on the controller, just for reference, the picture above is using 16 gauge if not 24 servo wire.

This method is slow and annoying. I've decided to not go for it.



The good folks over at Hobbyking have come up with this idea. Instead of having to solder to the actual board, you can simply touch the pins of the ATmega 8 and program it that way. Its fast and works wonders. 'Nuff said. Its about 20$ for the tool but it will save you a lot of defective ESCs, talking first hand here :)


On the software side I used the KK Flash tool, it works great and its kept up to date, I have registered some errors but overall its fine. 

A USB ASP device

I have made a tutorial on flashing using the KK Multicopter Flash Tool on actual KK 2.0 boards, although the software is compatible with many more boards and ESCs. 




No comments:

Post a Comment