Thread Tools
This thread is privately moderated by crteensy, who may elect to delete unwanted replies.
Jan 01, 2020, 03:14 PM
Registered User
Thread OP
Discussion

Building a BLHeli_S ESC


So here's my first attempt at building a BLHeli_S ESC. The current hardware is made for testing the overall circuit and part choice; the overall goal is a small and lightweight AIO FC.

I'm not sure what the max current will be, but anything above 10 A would be a good start. Battery input: 1 - 3S, maybe 4S.
5V and 3V3 rails are supplied with a TPS630701 buck/boost regulator for 5V and a TPS62823 regulator for 3V3. Those two seem to work.

Schematic: ESC-0.3-single <- THIS SCHEMATIC CONTAINS AN ERROR: Ac/Ap, Bc/Bp and Cc/Cp are swapped.
Apparently fixed schematic in https://www.rcgroups.com/forums/show...6#post43810839

Most parts were chosen for their small size. The NCP81253 gate driver is just 2x2 mm, but needs 5 V logic. There's a level shifter in front, built with a DMN2990UDJ-7 and two resistors. The gate driver drives a SIZ322DT NFET pair.

Here's a screenshot of one channel (and it contains the same error as the first schematic above):
Name: Screenshot from 2020-01-01 01-39-25.png
Views: 89
Size: 13.6 KB
Description:

When the gate driver's PWM input is around 2.5 V, it will disable both out FETs.

Here's a logic table for the Ac and Ap signals with their effect on the output:
Code:
    Ac Ap PWM PFET NFET
1)  0  1  2V5 off  off
2)  1  1  0V  off  on
3)  0  0  5V  on   off
4)  1  0  0V  off  on
The last two columns are labeled PFET and NFET because the level shifter logic makes the whole gate driver look like a pair of PFET and NFET to the MCU. As far as I understand it, O-type firmware should work for this.

Top Layer Silk Screen for header and pin names:
Name: Screenshot from 2020-01-01 20-46-40.png
Views: 36
Size: 50.7 KB
Description:

3D view:
Name: ESC-0.3-single-3D.png
Views: 39
Size: 79.5 KB
Description:

Screwed to a piece of wood, with a breadboard to wire everything up (attached is a 2S 300 mAh battery but that changes later. The most important point here is that it's not on fire):
Name: DSC_1529.jpg
Views: 15
Size: 605.6 KB
Description:
There's a 470 uF 25V low ESR cap (Panasonic FM-A) to the battery input.
On the breadboard, top left: voltage regulators for 5V and 3V3.

I'll update this post to add details if required. If anything is unclear, please ask! This thread is for testing the hardware and debugging it, because it's not yet working as expected. Some of the testing will be described in individual posts.
Last edited by crteensy; Feb 12, 2020 at 04:52 PM.
Sign up now
to remove ads between posts
Jan 01, 2020, 03:37 PM
Registered User
Thread OP

First test: is level shifting correct? Shorts in the output?


Test setup:
  • on-board EFM8BB2 isn't programmed yet and doesn't output anything actively
  • Power is supplied with a 3S battery
  • each signal for every pair of inputs to the level shifter (Ac/Ap, Bc/Bp, Cc/Cp) is the same, so I have Ac=Ap, Bc=Bp, Cc=Cp.
  • the outputs are loaded with 167 Ohm (6 1k 1/4W resistors parallel)
  • an external MCU outputs a 24 kHz, 10% duty cycle PWM signal to one of the input pairs at a time through J3 (external MCU was a teensy 3.2).

Here's a scope screenshot for Ac=Ap=10% duty cycle PWM (Ch1) and output Pad A (Ch2):
Name: ds1054z-scope-display_2019-12-30_23-48-21_3S_Ch1-Ap_Ch2_APad.png
Views: 12
Size: 28.2 KB
Description:
it shows that the 10% PWM is inverted, resulting in 90% duty cycle at the gate driver's input (this is expected). The output toggles between 0V and 11.4 V, as it should. All other input channels (Bc/Bp and Cc/Cp) were tied to GND and their output pads showed a steady GND as well.

The same test was done with
  • PWM input to channel B; A and C tied to GND: Pad B shows proper toggling between VBat and GND, all other channels steady GND
  • PWM input to channel C; A and B tied to GND: Pad C shows proper toggling between VBat and GND, all other channels steady GND

What I conclude concluded from this test is that I don't have any shorts in the level shifters and output stages and that the gate drivers are working as expected.

Well for some reason I can now measure a short in channel C between VBat and the Motor Pad. That would be here:
Name: ESC-v0.3-short-PadC.png
Views: 19
Size: 32.1 KB
Description:
If it's this, it wasn't possible to visually spot this short after assembling the board. I might be able to rework it, but it's not going to be easy.
Last edited by crteensy; Jan 01, 2020 at 05:40 PM.
Jan 01, 2020, 03:51 PM
Registered User
Thread OP

Flashing the MCU


The BLHeli_S repo has some HEX files for us to use, but Silabs' python tools only accept their .efm8 file format. However, the creator of the fishpepper ESC wrote his own tool which I just tried. Links:He only tested it with the EFM8BB10F8G but the tool didn't complain about the BB2 I have on my board. I think flashing was successful because I ran into problems with the hardware later, so the MCU started to output *something*.

I used a FT232RL breakout board for communicating with the BB2.
Last edited by crteensy; Jan 04, 2020 at 06:21 PM.
Jan 01, 2020, 05:31 PM
Registered User
Great work. Following with interest.

Is the motivation here to produce something 'better' than is already available, or just the satisfaction of having made it yourself?
Jan 01, 2020, 05:46 PM
Registered User
Thread OP
I'm leaning towards the satisfaction.

We're currently doing other small things as well, like a 1.5 g GNSS board, that can really save weight which is helpful for maximizing flight times (see here: http://www.kopterforum.de/topic/8327...auglich/page-1, flight times well over 100 minutes).

The available AIO boards usually only handle 1-2S or 2-4S and low-ish currents, so building an AIO that can do slightly more might actually be a thing, but not in terms of saving weight. It will be an F7 with ESCs based on this design, but nothing ground breaking.

Regarding the current ESC hardware: I found a short, see end of post #2
Jan 01, 2020, 07:01 PM
Registered User
Wow, your long range/duration build is truly amazing. Congratulations!
Jan 01, 2020, 07:38 PM
Registered User
Thread OP
I want to clarify that I just recently chimed in there. The actual long range builds are not mine, and I'm only trying to contribute by making hardware that's lighter than some off the shelf components.
Jan 01, 2020, 09:42 PM
Brisbane, Australia
The drivers and fet's you have chosen have a very small footprint, nice work. I know how tedious fet searches are. I saw in the other forum thread you mentioned the HAKRC HK1S 16x16mm 2gm as a possible light esc for an endurance 2S quad. Did you look into the design and the fet specs on this one?
Jan 02, 2020, 07:37 AM
Registered User
I hope you get the short solved and get this up and running ! As another option to the 2mm driver and level shifter, there are these TI drivers http://www.ti.com/product/TPS51604. They probably cost a considerable amount more though.
I really like the mosfets used in your design, should handle quite a bit of power.

I have a 1-3s (4s?) design on my blog pages but uses a large deadtime .. and uses p channel upper fets.
Jan 02, 2020, 08:11 AM
Registered User
Thread OP
Quote:
Originally Posted by AlkaM
I hope you get the short solved and get this up and running ! As another option to the 2mm driver and level shifter, there are these TI drivers http://www.ti.com/product/TPS51604. They probably cost a considerable amount more though.
I really like the mosfets used in your design, should handle quite a bit of power.

I have a 1-3s (4s?) design on my blog pages but uses a large deadtime .. and uses p channel upper fets.
I already replaced the channel C FET pair and really hope that I didn't fry the rest of the board in that process. Removing the pin headers was the hardest part. Couldn't test yet, though.

The TPS51604 is interesting because it might not require level shifting (limits are close though). It's more expensive, but saving 12 x 2 mm˛ might be worth it!
Jan 02, 2020, 08:16 AM
Registered User
Thread OP
Quote:
Originally Posted by Ian444
The drivers and fet's you have chosen have a very small footprint, nice work. I know how tedious fet searches are. I saw in the other forum thread you mentioned the HAKRC HK1S 16x16mm 2gm as a possible light esc for an endurance 2S quad. Did you look into the design and the fet specs on this one?
I'd have to find that ESC to check, and chances are that the part markings are so crippled that I won't be able to identify them.
Last edited by crteensy; Jan 02, 2020 at 12:17 PM.
Jan 02, 2020, 06:49 PM
Registered User
Thread OP

It beeps!


So apparently I successfully replaced the channel C FET pair.

First thing I checked after wiring everything up again was to see if the level shifter logic was still ok. Somewhen during this step I managed to fry both the 5V and the 3V3 voltage regulators, but I could get 5V from USB and 3V3 from an MCP1700 that I had in a bag of random parts. A better overall setup might have avoided this (this is my first ESC, after all). These errors happen when there's too much to rewire and too little risk mitigation.

This is the end result of setting everything up:
Name: DSC_1545.jpg
Views: 12
Size: 1.20 MB
Description:

Small breadboard: 3V3 regulator and ESC connections.

Large breadboard: To the left is a Teensy 3.2 (I fried one of those, too!) for injecting PWM to the level shifters, to the right I have dummy loads to ground for each phase (500 Ohm each, as 2 x 1k in parallel). They are not connected in the picture, as are the scope probes. 5V for the ESC are supplied via the Teensy's USB connection. That's not actually plugged into a computer, but my bench PSU which has a current limited USB power output.

I had to solder two wires to each motor phase pad: one for the actual motor and one for the dummy loads.

At the top is an unconnected RDQ smoke stopper. The picture was taken after I made this round of testing and the smoke stopper was actually plugged in when I started.

So to recap the first test:
  • No motor
  • VBat disconnected
  • MCU not powered
  • 10% PWM injected to the level shifters with an external Teensy
The level shifters properly shifted and inverted 10% to 90%.

Second test:
  • No Motor
  • VBat connected through smoke stopper to bench PSU set to 7.4 V and limited to 0.2 A
  • MCU powered from 3V3 rail
  • dummy loads to ground
  • External Teensy disconnected (because level shifter input now comes from the MCU)
The scope showed some pulses after power up, then silence. I assumed these to be what would become the first three startup tones. Nothing suspicious happened so I proceeded.

Third test:
  • Motor connected (Mamba 1408 4000 KV)
  • VBat + smoke stopper, as above (7.4 V, 0.2 A)
  • MCU powered from 3V3 rail
  • no more dummy loads
  • External Teensy disconnected
I didn't hear any startup tones, but three clicks with a timing similar to that of startup tones. Then it came to me that the PSU's current limit might be too low to make any sounds with the motor.

I then increased the current limit with the smoke stopper still installed:
  • 3 A: faint beeps, the higher the frequency the fainter. All of them sounded somewhat short.
  • 5 A: the first two beeps were well audible, the third one fainter and shorter than the first two.
  • 6 A: all beeps well audible and same length

With the smoke stopper removed, a 3 A limit was sufficient to produce normal beeps. I didn't test lower or higher currents without the smoke stopper.

I didn't test DShot input yet because getting an FC into that setup feels much too fiddly. I'll rather try to produce a usable DShot signal with my Teensy because it's just more prototyping friendly.

Lessons learned so far:
  • Easily replaceable voltage regulators and bunch of spares
  • Either use voltage regulators with a current limiter, or add a polyfuse to each digital power rail (5V and 3V3)
  • no smoke stopper if you need more current than what you can get with one
  • separate PCBs for MCU and the rest (level shifting, gate driver and output FETs)
  • current limiting resistors for the MCU outputs, on the MCU board
  • separate pads for the VBat cap
  • seperate pins for accessing VBat for measurements or for supplying other circuitry
  • Test pads for MCU output
  • Test pads for level shifter output
  • Test pads for gate driver output
  • 3 sets of motor wire connections: motor (pads), dummy loads (screw terminals or pins), scope probes (pins)
  • Cable management on the whole board for USB, VBat, scope probes, and everything else. Things tend to fall off if they're not secured, ripping out cables or even causing shorts
Jan 04, 2020, 06:20 PM
Registered User
Thread OP

It spins! (sort of)


I built a simple DShot600 generator with a potentiometer to control throttle. The ESC now produces 3+2 beeps on startup and actually tries to spin up the motor when I raise the throttle.

However, my PSU is limited at 6 A (voltage set to 7.4 V) which is apparently too low for spinning the motor without a prop attached.
Video for those who want to "hear" the outcome:
Building an ESC, first spin up (0 min 9 sec)

Firmware is BLHeli_S O_H_90_REV16_71.HEX

Unfortunately, two FET pairs released their magic smoke when I attached a 3S battery to see if that would lead to a different behavior. Something's wrong...

Edit: I don't know if the EFM8BB2 was powered when I plugged in the battery. It's possible that the output FETs were in a state that caused a short.
Last edited by crteensy; Jan 04, 2020 at 06:41 PM.
Jan 04, 2020, 08:57 PM
Registered User
So close! I'm surprised that 6A isn't enough to get the motor turning, something seems off. I'm also surprised that the dedicated driver chip would allow both FETs on at the same time, isn't that the point of an enable/pwm driver? Good luck finding the answers, my curiosity is killing me
Jan 05, 2020, 03:40 AM
Registered User
Thread OP
Well, for starters, is the firmware chosen correctly? The reason why "O" was chosen is that the fishpepper ESC uses a pair of PFET and NFET (using "O"), and the level shifter in the ESC discussed in this thread makes the whole driver stage look like such a pair as well (more or less).

Then there's the lack of pull resistors on the level shifter inputs that I'm concerned about. One pair of driver FETs shouldn't be causing a short. However, if floating gates in the level shifter energized a motor coil by accident (through two driver stages like A and B for example) , can this be a short powerful enough to blow the FETs?
Last edited by crteensy; Jan 05, 2020 at 03:47 AM.


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
New Product EMAX Lightning_S 35A ESC (BLHeli_S ESC) EMAX Yin Yan Multirotor Drone Power Systems 225 Jan 05, 2017 10:52 AM
Discussion Maytech BLHeli_S ESC programmer, 4 in1 BLheli_S ESC MaytechRC Multirotor Drone Electronics 27 Nov 29, 2016 07:20 AM