Saturday, June 14, 2014
Reflashing a quad ESC to BLHELI firmware in an attempt to solve pancake motor cogging issues
Ever since I've switched motors and ESC's on my "primary" quadcopter, I have been running on problems keeping it reliable. Every now and then it would crash, once because of a motor connection that got broken, and other times in a unpredictable manner without a cause that I could identify. More recently I decided to spend more time around the problem, and after testing a single motor spinning up and down a propeller aggressively, to my surprise I realized that it would cog with relative ease, even from intermediate throttle levels to full throttle or moderate throttle variations. This gave me a strong indication that something was wrong with the ESC - motor system. I had knowledge that pancake motors were more prone to cogging issues (including ESCs flashed with SimonK), so my only chance here would be to try a different firmware.
As this quadruple ESC is based on Silabs MCUs, using SimonK would be out of question as it is only developed for Atmel AVR MCU's (besides of course its bad reputation in respect to pancake motors).
The only option would be BLHELI, a project initially aimed for conventional helicopters, turning cheap ESCs into more efficient and functional speed controllers (including governor mode, which is a very interesting feature for conventional single rotor, collective pitch helicopters, ensuring a constant head speed).
As with the reflashing of many other commercial products, doing this would engage me in a point of no return, as the original firmware is read protected. If the BLHELI would not work for some reason it would be another part into the electronics scrap parts bin.
Doing this however would be no easy treat, as first of all I had no Silabs specific programming tool. After researching I found that with a piece of arduino software called owsilprog (http://www.olliw.eu/2012/owsilprog/), I could get away with using some board with a atmega MCU on it. The only one I had laying around was broken KK flight controller board with its atmega 168.
Another challenge was the fact that the tool to flash Silabs MCUs "owsilprog" is closed source and the only binaries for atmega168 would require a 16MHz clock. The KK board relied on the MCU internal clock which tops at 8 MHz. I had to somehow stuff a 16 MHz crystal and a couple of capacitors into the board:
All that to at the end find out that I could and shoud have used the BLHeli-Setup tool (http://www.helifreak.com/blog.php?b=2001), which has a atmel firmware for 8 MHz operation, and also manages the configuration of the later BLHELI versions:
I ended up having to use this tool anyway, as owsilprog was too old to handle the newer versions of BLHeli, in respect to configuring the parameters.
For my case I blindly tweaked only three parameters:
* PWM frequency - set to "Low", to avoid heating problems with the FETs;
* Motor timing - set to "Medium-high" (from Medium), to better prevent cogging issues;
* PPM max throttle - increased to 1948 us to be according to the flight controller.
Anyway I left the leads soltered to the programming pads accessible from the outside, so that it is easy to reflash the ESCs in the future.
Everything else was left as is. The firmware was already preloaded with settings more appropriate for multicopters (e.g. governor mode disabled).
So far I have repeated the aggressive throttle test on a single propeller, and no cogging occured. At the same time the motors seem more responsive, wich is a great sign. Tomorrow I will do more thorough testing with a few flights hopefully.