View Single Post
Old 05-01-2012, 09:06 PM   #1 (permalink)
Registered Users
Posts: 7,689
My HF Map location
Join Date: Sep 2011
Default My BLHeli thread

You've probably read my Oversky6A/C05M setup thread and Oversky10A/hp05s setup thread. I loved the Oversky ESCs in that no converter was needed and they were specifically designed for mCPx to ease getting into TX-programming mode. But then, when the "finished product" of the BLHeli emerged from the BLHeli for SiLabs ESCs thread it blew me away how accessible all the stuff is required to build a BLHeli-coded ESC and I knew that's definitely what I would do next.

Steffen did a great job in his comprehensive thread about building a BLHeli-coded ESC from hardware list to software list to all details on what needs to be done so there's no need to repeat here. My main goal for this thread is to focus on my particular build(s), and hopefully answer frequently asked questions and add any extra info in one place that one may be interested in to do their own BLHeli-coded ESC build. I know this is going to be a long post and perhaps long thread as well, but unlike a plug-and-play ESC, BLHeli-code ESC build is more involving. If you follow instructions properly though this is not a difficult build. And if you love BLHeli, here's a chance to show a little appreciation to Steffen Skaug for his hard work to make it possible for all of us to enjoy!

So why BLHeli code?
It can understand brushed motor signal directly. No need for extra hardware to convert that signal to the servo signal most ESCs understand. TheSteve and AEO brushless converter are going to be history. I started off my BLHeli builds with my existing Oversky10A/hp05s bird by replacing the Oversky ESC with a double-FET-modded DP3A ESC flashed with BLHeli code. Sounds easy but first thing first.

Ever since the "finished product" of BLHeli came out, most related parts ran out of stock at many places especially in North America. There are two places I enjoy dealing with. Dylan at Astroid Design and Benny at are great guys. Excellent customer service. As of now, Astroid Design's stocks on BLHeli related items come and go. Benny at Hawk-RC is getting ready to sell BLHeli related items including toolsticks. Keep checking their sites for part availability. The reason I started with a DP3A was that I was going to order other stuff from HobbyKing anyways and decided to order some DP3As and XP3As at the same time. So why DP3A not XP3A? Original FETs are better on the XP3A than the DP3A so I planned to reserve my XP3As for tail use. Why not order all XP3As then? Same old answer for adventurous works, "I want one of each just in case". With the help of Benny at Hawk-RC I should be getting an XP12A to work on next. Will compare it with my double-FET DP3A.

I got my toolstick from digikey. They have been out of stock pretty much shortly after I ordered the last one a month or so ago. Last time I heard, they would be in stock soon but if you can't wait, you can order the toolstick starter kit which is 8 bucks more and comes with a fully functional F330 daughter board that you can program and run for educational purpose and more. When my friend asked me to order base adapter for him after I got mine and the base adapter was out of stock, I ordered this starter kit (I paid for the extra to get the daughter board because I'd like to use them for educational purpose later). I also bought the debug adapter which I soldered the 3 wires onto

so that I don't have to mess with the toolstick base adapter since I need it to run my daughter card. Alternative to the debug adapter, you can get a 1/16" double-sided clad board like this one from digikey, cut it into shape, cut some traces and solder wires to it and just plug it into the base adapter.

That way you don't need to modify the base adapter. And while ordering from DigiKey, perhaps order some FETs for potential double-FET mod and potential tail-FET replacement (if not running dual-brushless).

Alternatively, you can buy ESCs that's already been flashed with BLHeli code from Dylan at Astroid Design. Benny at is also getting ready to provide flash service. No need to buy toolstick, although you won't be ready to flash the latest BLHeli update as it comes out. It's still cheaper than to buy a convertor which adds weight and complexity and you won't get to run the more superior governor mode.

To solder the wires to the ESC, I know I'll need in the future the wires more than once and flash more than one ESC so I solder plugs on the debug adapter and each ESC permanently. I use mCPx servo plugs and sockets because they are light and I have many of them from my dead servos plus the reverse-programming cables from the 2.3g servos.

Steffen has done a great job laying out all the works required to get a double-FET DP3A running BLHeli code, but those are still quite some tasks so I decided to divide up the tasks into steps in case I ran into problems. I was going to post the exact steps I made but since BLHeli and BLHeliSetup tool have evolved so much I'll take out the steps that don't apply to the latest software:

1. Test original DP3A ESC with Orange Rx (Spektrum compatible) and the 2g tail motor I have. You can use a cyclic servo output for now if you don't skip this step.
2. Solder up wires and flash with latest BLHeliSetup tool.
3. Remove original FETs and replace with new FETs. Test operation with single-FET (6 FETs) first, best with a limited-current power source if possible.
4. Stack another 6 FETs to make it double-FET and test again.
5. Solder final correct wires and test with real battery and motor.
6. Flash with latest BLHeli version if available (yes, they came out that fast at the time)

On my 1st try, everything went perfectly well until step 4. I figured I perhaps spent too much time in each step so I tried to combine step 4 to 6 in one shot. Bad decision. On fire up with real battery, I fried 4 FETs and the F330 chip on the ESC! I still haven't confirmed what caused it but I highly suspected one of the FETs (12 of them) had an intermittent connection (most likely the Gate leg) which allowed more than 1 set of push-pull FETs turned on at the smae time and short-circuited power source. I'm surprised it took out the F330 chip though. My advice to those doing double-FET mod is make sure all FETs have sure connections that can survive heli crash.

BLHeliSetup tool (visit 4712's blog for the latest version) has evolved so much now you don't need to download hex files or flash utility separately. Everything you need is in the BLHeliSetup tool. It's very easy to use so nothing to add here (thanks 4712!). Just use all default settings so you can test your ESC if you don't know what each setting does.

Arming ESC
BLHeli has a different arming sequence than most other ESCs. Most ESCs need to see a zero throttle before it'll start the motor to prevent accidental startup on plug-in. BLHeli needs to see a zero throttle first, then a part-throttle, and then another zero throttle, before it'll start the motor. Here's the sequence of events:

1. Zero throttle on TX.
2. Plug in flight battery -> 3 beeps.
3. Mid-throttle -> low-tone beep
4. Zero throttle -> high-tone beep -> ESC is ready to start motor.

I highly recommend using throttle stick instead of throttle hold or idle-up switch to arm ESC because when 3-in-1 board sees a throttle jump of more than 50% from 0 on startup, it'll trigger its soft-start procedure. That means at point 3 above, throttle value varies depends on how long you wait before going to step 4. As you read on, max thorttle value seen at point 3 is very important. You don't want it random.

TX Programming
Like most ESCs, you can program parameters using TX. To enter program mode, follow steps above for the arming sequence but use full-throttle in step 3 instead of mid-throttle. Make sure your throttle curve runs up to 100%. Again, use throttle stick instead of throttle-hold or idle-up switch to avoid 3-in-1's built-in soft-start sequence. Follow instructions in the programming manual.

From the BLHeliSetup tool you can choose to require or not this arming/program-mode sequence after motor stops every time. When "enable arming after every Start" option is checked, you'll have to go thru' the same sequence again every time after motor has stopped. When this option is unchecked, you'll go thru' this arming sequence only the first time after plugging in the battery.

Governor modes
BLHeli comes default with governor TX mode. Don't just plug in the newly flashed ESC and expect it to fly just like throttle mode. It needs a totally different set up on the TX. For those who aren't familiar with governor mode operation, this is when the ESC tries to maintain a certain motor speed regardless of load. Governor mode on heli main rotor is good for its predictable and consistent performance thru' various load range and various discharge state when set up properly. In fact, the performance is so consistent that you can easily not notice power drop towards end of charge until it hits LVC. It's also good for not over-spinning main rotor on descend which often triggers wobble on a not-so-perfect rotor head.

Since governor operates totally different than throttle mode, you need to know a few things to set up governor mode operation properly. In governor mode, throttle value determines targeted motor speed (thus headspeed). This spreadsheet cross-references throttle value to headspeed (assuming 8T pinion on 64T main gear with a 6-magnet 9-solenoid motor, X9/8 if you run 9T). That means regardless of power level of your brushless motor say hp05s vs hp07, setting a throttle value of say 68% gives you the same motor speed for both motors. On the other hand, hp05s for example cannot achieve speed set by throttle value 75% or higher so note that throttle value may not be accurate depending on which version of 3-in-1 board and whether to get signal from motor port or direct MCU output. V2 board runs a lower frequency PWM motor port signal so it's usable and can resolve up to 80%+ throttle value. If you run hp07 (hp06v2) or lower motor you cannot reach target speed set by 82% or higher anyways. V1 board however can only resolve throttle to about 60% so in that case I highly recommend running signal directly from MCU output.

That said, if you run motor port signal from v2 board, most (if not all) compatible ESCs run high-impedance input which means you need to run a pull-down 1k ohm resistor across motor port and ground. This is best done on the ESC side for clean install.

How do I know what headspeed to start play with? In general, start with max 10% throttle value lower than what throttle value that results in max achievable headspeed for that motor then lowers it according to how much bogging on hard maneuvers or just according to your liking. This in general gives enough headroom for ESC to increase power on high load situation to maintain headspeed. If you get bogging but feel like headspeed is already too low for your taste, of course you can keep that headspeed without going any lower, but beware that you're not utilising the full capability of the governor mode. Either reduce pitch travel (reduce load) or upgrade to a hotter motor. Here's a little trick I used to easily test different headspeed in TX mode. Follow this trick, you'll be starting with 50% throttle which is about stock and you can get a feel of what headspeed is like before settling with one. Note that in that post the spreadsheet was based on an earlier version from Steffen which incorrectly assumed a 66T main gear. You can correct by multiply it by 66 and divide by 64. Here're a few common #s:
- hp07/hp06v2 maxes out at 80-84%
- hp05s maxes out at 70-74%
- c05m maxes out at (estimated, haven't tried) 60-64%

That means when I set my hp07 to run 70% it's basically like running an hp05s except better bail-out power, less bogging, and more consistent power towards end of flight, in return for a little shorter flight time (how short depends on how often I load up the motor and requires ESC to maintain governor headspeed).

Governor TX mode
There are three ways to run governor mode. Default is TX mode which constantly reads throttle signal and converts to its corresponding motor speed. In this mode a flat throttle curve for idle-up mode is required to maintain a governed headspeed or else you get a yo-yo effect because ESC tries to slowly (because ESC runs a sophisticated algorithm for smooth governor performance) vary motor speed to a new desired headspeed. You can still run a linear throttle curve in normal mode for take-off and landing, but be aware of the governor mode operation where it'll not change motor speed instantly to throttle change.

Governor arm mode
Instead of reading real-time throttle value for targeted headspeed, arm mode sets targeted headspeed by reading the max throttle seen during arming sequence. Once armed, the ESC will run in throttle mode until about 20% throttle (may change in future BLHeli versions) and switch to governor mode for the targeted headspeed. Any real-time throttle change above 20% will be ignored by the ESC. To properly set up arm mode, Set up normal curve to 0-20-20-20-X where X is your desired throttle value corresponding to your target headpseed. Throttle curve for idle-up can be anything as long as all values higher than 20%. Will talk about that later. To arm ESC in arm mode, move throttle stick to full up instead of part-throttle for about 1 second and then back to zero. This will make the ESC reads throttle value X. To start motor, flip to idle-up mode and then move throttle stick to just below zero-pitch and wait for spool up. Do not use throttle hold or idle-up switch to arm ESC in arm mode. The problem is that when 3-in-1 board sees a sudden jump of throttle value from zero to more than 50%, it'll trigger its soft-start procedure. That means until you wait for soft-start to finish (about 5s for V1 and 10s for v2), the ESC will not see the targeted throttle X value to correctly set governor headspeed.

So why all these extra to run governor mode? This provides opportunity to fine-tune tail-mix for the 3-in-1 board. What tail, aren't we talking main motor? Here's some background info. A heading-hold gyro is a negative feedback control system which like any negative feedback control system reads a certain value to see how far it's off from its desired value and then corrects it. If too far left for example, a more right is required and vice versa and hence the name "negative feedback". In the heading-hold tail gyro case, it needs to correct tail motor power to maintain heading of the tail. Theoretically, we can just feed tail motor an arbitrary amount of power and let the tail gyro do its job to vary it and maintain heading. The problem is that a negative feedback system is always susceptible to delay and glitches (consider how it works as I mentioned above). It's much better to start feeding the tail with close enough power and let the gyro do the rest. In an analogy, you keep your car driving straight on the road by constant correction on the steering wheel (like heading-hold gyro). You can have your wheel alignment way off that the car always pull to one side yet you can still keep the car going straight by constantly pulling the steering wheel. What happens when you accelerate or brake hard suddenly and generate different pull on the steering wheel? If you hands are quick enough you may be able to keep the car going straight. What if you lose grip of the steering wheel for a moment? You get the idea. It's the same situation with heading-hold gyro for heli tail. Unlike a main motor driven tail, you don't get increased tail thrust by increasing main motor power. That's why a tail-mix is built-in the 3-in-1 board to apply tail power proportinal to main power. With a flat throttle curve for the main motor however, heading hold gyro needs to constantly vary tail power a lot for the corresponding load on the main motor. With stock power setup, tail gyro can handle it no problem. Remember with a much higher power setup, you still require similar amount of power to hover. That means the operating power range is much wider. With a matching power tail motor, that means the tail needs to throttle down much more to maintain hover. This is why 120SR tail motor and up are more susceptible to the infamous CW-1/4-turn kick where the tail gyro loses its ability to substantially reduce tail power even in just a short moment. Vibes, glitch, wobble, etc. can confuse the tail gyro for even just a moement and you get the CW-1/4-turn kick. Sure enough if you go the extra mile to make sure every rotating parts is perfect to prevent vibes you're less likely to get the CW-1/4-turn kick. However, the root cause of the problem is still because tail mix is way off and the tail gyro has to constantly reduce tail power to correct. What if we run a V-shaped throttle curve to reduce throttle signal intended to the main motor to the 3-in-1 board around zero pitch (low load)? The 3-in-1 board will reduce tail power around zero pitch. Of course the final tail power is still controlled by the heading hold gyro, but the tail gyro needs not to significantly reduce tail power all the time around zero pitch and that means any vibes or glitch will less likely trigger a CW-1/4-turn kick. Ever since I run less than 100% idle-up throttle curve, I've never seen a single CW-1/4-turn kick on my hp07 bird no matter how sloppy my servos are, or how unbalanced my main rotor head, or how broken my way-overdue frame, canopy, and landing gear are. When I ran 100% flat idle-up throttle curve at first with my hp05s setup when virtually every part was new, any tiny bit of details like un-hooking the canopy from 1 of the 4 canopy posts or exact location of the ESC over the 3-in-1 board would trigger a CW-1/4-turn kick. Besides the infamous CW-1/4-turn kick, a V-shaped throttle curve also helps tail hold during pitch pumps. A flat 100% throttle curve means during pitch pumps from hover, tail gyro needs to transition quickly from significantly reduce tail power to significnatly add tail power, and may result in not enough tail thrust doing pitch pumps, even though tail motor have enough power capability. Like any negative feedback control system, you cannot expect it to perform perfect with no delay. A V-shaped curve in this case means tail power requirement is better estimated and tail gyro needs not to do as dramatic a job to hold the tail.

Since tail mix depends on a lot of factors like main/tail motor power and efficiency, etc., you'll need trial-and-error to tailor your own V-shaped curve. Start with a 100-75-50-75-100 curve in arm mode. Again, don't run V-curve in TX mode. If you notice tail-kick to the left, reduce throttle value near that throttle point or increase throttle value below that point for a gentler slope, and vice versa. You'll need lots of trial-and-error but the bottom line is a V-curve (again, in arm mode) is always better than a flat curve. Also, do not run any throttle point below 20% which triggers ESC to disable governor mode.

Setup mode
BLHeli version 3 up has a new governor mode option called Setup mode. This mode has the same operation as arm mode but without the extra work to arm the ESC. Instead of reading max throttle value during arming sequence, ESC takes a preset value (only settable thru' BLHeliSetup tool). That means you can arm ESC in arm mode like you do TX mode or direct-throttle mode. This can be handy for those who don't need to change targeted headspeed often.

Governor mode and LVC
Since governor mode works so well that when set up properly you get consistent power throughout entire battery charge so good that you won't notice power drop until LVC. If you run governor TX mode, stock 3-in-1 LVC works very well. As soon as LVC kicks in, ESC drops throttle to target a lower headspeed reflected by the reduced throttle. However, if you run governor arm mode or governor setup mode, ESC doesn't respond to reduced throtttle from 3-in-1's LVC until it drops out of 20%. This throttle value may be changed in the future but at least it works better than 0% in the beginning like I mentioned in this thread for more background reading.

Will talk about brushless tail next. Again, if you love BLHeli, here's a chance to show a little appreciation to Steffen Skaug for his hard work to make it possible for all of us to enjoy!
Attached Thumbnails
Click image for larger version

Name:	DSC_6814DebugAdapter.JPG
Views:	2020
Size:	76.9 KB
ID:	313122   Click image for larger version

Name:	DSC_6815DebugAdapter.JPG
Views:	1723
Size:	87.9 KB
ID:	313123  

Last edited by DoubleCH; 05-04-2012 at 02:31 PM..
DoubleCH is offline        Reply With Quote