BLDC driver - Many Questions - Page 1
Forum section: electronics / beginners

author: uliano
author_rank: Regular Contributor
timestamp: October 26, 2021, 03:13:52 pm
content: I've come back to this hobby few weeks ago after a hiatus of maybe 20 years and I'm having a lot of fun.This weekend I started investigating PWM, hardware side this means MOSFET. After a false start in which breadbord capacitance connection inductance and probably gremlins gave me a hell of ringings I switched to pre-drilled protoyping PCB (I don't know the english term, in italian they are called "thousand holes") and got consistent results. First I built a simple common source switch(very easy). Then and H-bridge to drive a DC motor (easy and fun).Question 1) I grok all power MOS have body diodes. Are these enough to act as a freewheel (I think so) or am I supposed to add external part?Easy successes and lots of fun led my hubris making me greedy: i decided to approach BLDC motors the hard way, i.e. from scratch. My thinking was "a 3 phase bridge is jus one leg more than an H-bridge". Then I realized that maybe I would have liked to look at currents in the windings and inserted small resistor. Then I realized that I had no idea of the magnitude of those currents so, maybe, I had better foresee some kind of variable gain in the sense. Then I realized that it would have been nice to have comparators to look for zero crossings... I mean I had no idea if any of those things would work as expected but that's the point of prototyping. It is not the more up-to date technology: most of the components were in my drawers for more than 20 years!(decoupling capacitors 0.1uf and 1uf for TC4422 not shown)It took me one day, with some undoing and redoing, I did a sketch of the placement of most components but then comparators were added at mid work and some noob mistake (after 20 years you get back to noob again) like not considering front-back view of pinout of one chip :-(.Building it has been really instructive. As I was progressing I realized that there is an optimal order in connecting wires. After some hours I started to feel that something went wrong somewhere. Or I made a step too long or I'm not ready for this level of complexity with this prototyping technique) or whatever...Point is that this object (It didn't work) is not debuggable (not by me at least)Question 2) How would you have realized such a prototype? with a different technique or just with a larger board?It draws current at rest I even found a bug (a missing connection) but to no avail. It is nearly impossible to even see through the mess of cables. I'll keep it for onrment! :-DQuestion 3) Is it worth some more time?Even it was a failure I learned a lot by making it.Now I know that for this level of complexity I will make a PCB probably most, if not all, in SMD so I have to buy new components. Now it's a good moment to amend errors, add new functions and so on. What I would like to do is a board that lets me to learn about BLDC control, sensored, sensorless, FOC, whatever... for fun. So definitely no fancy components "I do it all" that would fail the learning focus and bring out in hardware as much as possible (just the contrary of real world), as I want to see most signals on the scope. The idea is to stay within 15V limit (4 lipo cells) possibly even less. As for the current, the biggest motor I ordered is this one 4100KVhttps://www.aliexpress.com/item/32833212767.html?spm=a2g0s.9042311.0.0.1ec64c4dPMJPJowhich I really don't understandQuestion 4) what 80A means? (I hope peak) andQuestion 5) what implication it has on dimensioning the MOSFETsMost important:Question 6) That's not a question, it is a suggestions session. Please criticize!

author: jmelson
author_rank: Super Contributor
timestamp: October 26, 2021, 04:22:15 pm
content: Quote from: uliano on October 26, 2021, 03:13:52 pmNo, the body diodes are VERY slow to turn on. I was having problems with a brushless drive I made years ago, and crept up toward the current level where the drive blew up. I was able to see the body diode being forward biased up to 12 V for ten us without starting to conduct. This ended up blowing the gate driver chip. I had to add a super-fast diode across the low-side FET to save the driver chip'shigh-side driver element.Jon

author: uliano
author_rank: Regular Contributor
timestamp: October 26, 2021, 04:24:53 pm
content: Quote from: jmelson on October 26, 2021, 04:22:15 pmSo, something like shottky?

author: Siwastaja
author_rank: Super Contributor
timestamp: October 26, 2021, 04:51:42 pm
content: Body diodes are usually just fine, I have never used parallel diodes in a motor controller MOSFET half or H bridge, ever, including brushed DC and BLDC controllers of different power levels. They turn on just fine, the "problem" is some excess reverse recovery charge compared to schottkys. I guess jmelson's problem has likely been something else or some special case. In DC/DC (synchronous buck) I have used parallel diodes once and saw minor improvements. Even then, the exact choice and placement of the diode was very important, and I remember Tim here commented the improvement might have been just due to the capacitance of the diode acting as a snubber. But you do see these schottkys sometimes in >1MHz DC/DC controller appnotes.

author: Terry Bites
author_rank: Super Contributor
timestamp: October 26, 2021, 05:02:28 pm
content: The series mosfets need separate non overlapping gate drives. If not then there will be times when top and bottom are on leading to meltdown. You wil probably need to use a bootstrap to get enough drive to the top FET. Have an informative read of the IR2111 dtasheet for instance. The body diode frewheel diodes are ok, but an extenal diode will save you the cost of a new FET.I would think that 80A is the peak current. Even so it seems very high for a small motor. If the spec is to be belived then on 15V at stall it would draw 1000A!! I cant find an actual data sheet for the motor so the spec is uncertain. Sizing of the FETs depends very much on relaible motor data. As suggested here a curent rating of 3x normal and a voltage rating of at leat 2x battery is a good idea:https://www.diodes.com/assets/Articles/Auto-MOSFET-BLDC2.pdfThen you need to work out how many watts of dissipation there will be in the FETs. Remember that the body diodes have thier own power to dissipate in additon to the FETs. How hot will they get?https://www.re-innovation.co.uk/docs/heatsink-calculations/Lots to think about.It can be educational to deconstruct a integrated solution, eg L6234 form ST (Satans Trolls).Where do the headers go?

author: Picuino
author_rank: Super Contributor
timestamp: October 26, 2021, 05:10:21 pm
content: This is a schematic of a commercial BLDC driver motor:Edit:I prefer to use KiCAD to make the schematic capture, although it is a matter of taste.https://www.kicad.org/

author: Siwastaja
author_rank: Super Contributor
timestamp: October 26, 2021, 05:16:04 pm
content: Totally useless schematic.At that power level, youneedreal gate drivers, and current sense.A lot of example designs available.Also basically all half-bridge gate drivers implement deadtimes and protection against accidental "switch both on" input, preventing destruction by shoot-through.Start by almost any half-bridge bootstrap gate drive IC, low-side current shunts (like 1mOhm) on two legs of your choice (between bottom MOSFET source and GND), and current sense amplifiers driving into the ADCs of the micro.Most moden MCUs have suitable HW to do all this, almost every chip in STM32 family for example.Tight layout and low-ESL DC link capacitance helps.Motor controllers can run at relatively low f_sw, like 10kHz or so, in practice this means #1 MOSFET loss element is conduction loss, so just calculating P = D * Rds_on * I^2 for each FET gives a good initial estimate, and then you can calculate die temperature from RthJ-A.

author: Picuino
author_rank: Super Contributor
timestamp: October 26, 2021, 05:22:34 pm
content: This is a schematic of a real commercial driver TowerPro of 25Amps.The first time I saw this scheme, I was also struck by its simplicity. But keep in mind that it works.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 26, 2021, 05:43:53 pm
content: Real commercial ebay hobbyking crap. It doesn't matter. Such "real" products are well known to blow up. Don't copy this design, you can do better, like actual real commercial products.I'm sure it "works" under specific conditions. They obviously have tuned the software (blowing gazillion of MOSFETs in the process) so that it doesn't usually blow parts when used with the most usual brands and types of motors, with the usual flight inputs.Guess how many MOSFETs I have blownduring developmentof my drivers during say last 10 years? Zero, because I start by verifying current sense and gate drive circuits. A huge time saver!A real gate driver costs like 50 cents and is trivial to solder in instead of those discrete transistors.

author: uliano
author_rank: Regular Contributor
timestamp: October 26, 2021, 06:14:25 pm
content: Quote from: Terry Bites on October 26, 2021, 05:02:28 pmyou mean that during the swing of the output of TC4422 from GND to VDD (or vice versa) there is a fraction of time in which both P and N mos are conducting shorting the power to ground?I made an H-bridge with the same schematic and it (seemed to) worked (I was able to control the DC motor so I didn't investigate any further)So Ir2111 or Ir2104 + NMOS on highside replacing PMOS is the way to go?Quoteto my scope, to MCU... It is educational I'd like to peek as much as possible.

author: Picuino
author_rank: Super Contributor
timestamp: October 26, 2021, 06:15:25 pm
content: I agree. It's better to use a gate driver for the mosfets.And the current sense gives you very interest information.It cost little bit more, but it's worth it.Another circuit in the schematic is a voltage sense of the motor lines, to sense the back-emf voltage of the motor and determine the mosfets sequence.R15 to R23Edit:https://www.nxp.com/docs/en/application-note/AN1914.pdfhttps://www.st.com/resource/en/application_note/cd00020086-sensorless-bldc-motor-control-and-bemf-sampling-methods-with--st7mc-stmicroelectronics.pdf

author: Siwastaja
author_rank: Super Contributor
timestamp: October 26, 2021, 06:35:16 pm
content: Current sense is not just to give information, it's to actively control current. Without current control, the motor is like an LED or a battery, basically a short circuit that can pull "infinite" current (if ideal); in reality, limited by resistance.So without current sense, you need to use massively oversized MOSFETs (again requiring even better gate driver). With very low-efficiency motors, this isn't as important because the current is limited by the large motor resistance (this manifests itself as a low ratio between nominal vs. stall current). On high-efficiency motor, stall current can be like 10-20 times the nominal current, yet running at anything past say 2x nominal current is worthless as the motor cannot create extra torque, just saturate and pull more current.Active current limiting is pretty easy because the motor offers you so much inductance to work with; this limits the rise time of the current so much that even quite slow sensing (like 10kHz sampling on ADC, or triggering any analog comparator on any MCU to enter ISR) works pretty well.Simplest implementation to get you running quickly is a low-side sense resistor driving microcontroller analog comparator pin, triggering interrupt which terminates the current PWM cycle and possibly reduces the setpoint for the next cycle. This is easy to test by injecting test voltage over the shunt and look what happens to the gate drive on an oscillosscope before you apply load. Saves you a few MOSFETs.If interested in writing your own code instead of playing with libraries, sensorless is extra effort so if at all possible, use motors with hall sensors. Then the commutation is trivial and performance at low speeds will be good.

author: Picuino
author_rank: Super Contributor
timestamp: October 26, 2021, 06:42:24 pm
content: https://www.st.com/resource/en/application_note/an5423-current-sensing-in-bldc-motor-application-stmicroelectronics.pdfhttps://www.ti.com/lit/an/sboa172/sboa172.pdfhttp://ww1.microchip.com/downloads/en/appnotes/00894a.pdfhttps://www.powerelectronicsnews.com/current-sensing-in-brushless-motor-drives/

author: Siwastaja
author_rank: Super Contributor
timestamp: October 26, 2021, 07:09:06 pm
content: Yes, TI INA series is fine. Placing the shunt at the low side leg greatly simplifies the common mode rejection requirements so almost any amplifier works there, but obviously higher end amplifier and good layout allow usage of smaller resistance values (smaller burden voltage) and less wasted power.Motor controllers thankfully run at low enough switching frequencies that there are many very low offset (chopper type) shunt amplifiers with enough bandwidth (some 50 kHz or more is enough).

author: xavier60
author_rank: Super Contributor
timestamp: October 26, 2021, 10:39:03 pm
content: Ground undershoot can upset and damage both channels in conventional driver ICs. The PCB needs to be carefully designed to minimize the the problem. There are 3 physically spaced half-bridges all trying to share the same Power and Digital grounds and what point do you call ground anyway.Galvanically isolated drivers will cost a bit more but will save expense and time by allowing for a simpler PCB design and avoiding damaged parts during development.I used STGAP drivers for my project on a 2 layer 2oz board. Power and Digital grounds are connected at one point at the CS resistor.How the output channels are powered needs some attention to avoid undershoots causing over charging of bypass capacitors.BTW: Be aware when choosing STGAP variants. Some have a rather high output channel operating voltage, not suited for simple MOSFET driving.

author: jmelson
author_rank: Super Contributor
timestamp: October 27, 2021, 12:14:49 am
content: Quote from: uliano on October 26, 2021, 04:24:53 pmIn my case, this was for a 20 A 120 V drive, so no Schottky diodes with that rating. But, for lower voltages, Schottky would be a good choice.Jon

author: xavier60
author_rank: Super Contributor
timestamp: October 27, 2021, 12:25:56 am
content: Or this. Described as a drop in optocoupler replacement but uses high frequency capacitive coupling.https://www.ti.com/lit/ds/symlink/ucc23313-q1.pdf?ts=1635291024970&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FUCC23313-Q1Page 17 shows how simple interlocking is done between a high/low pair.

author: David Hess
author_rank: Super Contributor
timestamp: October 27, 2021, 03:56:27 am
content: Quote from: uliano on October 26, 2021, 03:13:52 pmMOSFET body diodes can be used for that but doing so will increase dissipation within the power MOSFET. They are faster than standard recovery rectifiers but not quite as fast as fast recovery rectifiers. They should not be used at higher switching frequencies because reverse recovery losses will become excessive.

author: uliano
author_rank: Regular Contributor
timestamp: October 27, 2021, 06:21:26 am
content: Quote from: xavier60 on October 26, 2021, 10:39:03 pmI read inAN-978:<<International Rectifier’s control ICs are guaranteed to be completely immune to VS undershoot ofat least 5 V, measured with respect to COM. If undershoot exceeds this level, the high-sideoutput will temporarily latch in its current state. [...]>>With 15 (say absolute maximum 24) V am I supposed to expect more than -5V undershoot?Quotein the (nonfunctional) proto I referred all non power GND to a star point (using lots of wires). I'm not at all proficient in intricacies of good practice PCB design so a few more questions:each power leg (driver and mosfet pair) needs independent power+gnd tracks or can I start with thicker for 3 legs and make it thinner as they supply power to 2 and then 1 leg? my guess is separate.do each leg need a separate capacitor or can I just use a bigger one close to power input terminals? my guess is to use one.for the rest (nonpower) of the circuit is it enough to have a common gnd connected to the input - terminal?QuoteHow so?QuoteOh, I was just looking for new details to take care of...

author: xavier60
author_rank: Super Contributor
timestamp: October 27, 2021, 08:13:03 am
content: Quote from: uliano on October 27, 2021, 06:21:26 amI can't give much detailed advice on layout at the moment, actually find the topic rather confusing at times. One thing I'm certain of is that -5V undershoot is very easy to achieve.With galvanically isolated drivers, the input section and the 2 output sections are electrically insulated from each other and are able to withstand over 1000V difference of any polarity, it will not be affected at all by any likely amount of undershoot.So design the board to keep the high current loops as tight as possible without going to the extreme of having multiple power planes. Whatever undershoot that does occur isn't going to cause problems, with the exception of possibly affecting the VCC to the output sections, usually easily dealt with by adding series resistors to the VCC supply.OTH, it might surprise as to what can be made to work,https://www.eevblog.com/forum/projects/cordless-drill-hacking/msg1579870/#msg1579870The low-side MOSFETs are driven by the PIC via a BJT complementary buffer with the PIC over-volted to 6V.The high-side is driven by something like this.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 27, 2021, 09:33:07 am
content: Bootstrap drivers are very widely used but for the mentioned negative peak, look up the ratings. For example, MP1907 is rated:SW Voltage (VSW) .........................-5.0V to 105V-5V is quite OK and you can avoid that with decent layout and sensible Rg values. But it's a good idea to scope that on a prototype to see how close you are.I don't understand the comment about isolated gate drivers making layout easier. There is nothing much easier available than the single bootstrap IC right next to the two MOSFETs, directly wired into each other. Gate resistors are needed and the gate driver requires two capacitors.Large motor drivers then use isolated gate drivers and also usually supply isolated power to them. The cost is negligible part of a $5000 inverter.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 27, 2021, 09:43:27 am
content: Quote from: uliano on October 27, 2021, 06:21:26 amDefinitely a ground plane, a 4-layer board is cheap nowadays but in a pinch, 2-layer is workable, but requires more work to be good and is still a compromise. The 4-layer board is also good for heatsinking.Minimize the loop. The loop is formed from the closest capacitor +, through the two FETs and current sense resistor, finally to the - of said capacitor. From this description you can also infer the answer to your question regarding capacitors: as many as possible, as close as possible, as small as possible. My typical choice in such extra low voltage BLDC driver is a 50V, 2.2uF or 4.7uF, X7R 0805 MLCC, 2-5 pcs per leg. Soft terminated if at all possible. Avoid board flex anyway.You may want a few larger elcaps for damping the parasitic LC circuits from input wiring to very low ESR MLCC bank. Placement and value is non-critical. Also a TVS clamp is not a bad idea.With 4 layers, you can have a power plane as well (or nearly a plane; I mean, large fill of the Vin). Then connecting the capacitors, FETs, sense resistor is only matter of adding vias to these planes; use large number of small vias in parallel. The only "traces" are actually the gate signals from the drivers and even those should be short. Everything else - just make the parts hug and connect them with short and wide copper fills.

author: xavier60
author_rank: Super Contributor
timestamp: October 27, 2021, 02:28:13 pm
content: Quote from: uliano on October 27, 2021, 06:21:26 amThe supply voltage makes little difference to undershoot, it's a combination of peak current at the time the MOSFETs turn off, the MOSFET switching speed and circuit parasitic inductance.Star point wiring makes things worse because of the increased current path lengths.I checked the prices of those drivers I mentioned earlier. The TI part is expensive. The STGAP parts are better priced but many types are out of stock like a lot of things are.

author: jmelson
author_rank: Super Contributor
timestamp: October 27, 2021, 03:14:24 pm
content: Quote from: uliano on October 27, 2021, 06:21:26 amYes, it all depends on motor inductance. If the high-side transistor is on, and then shuts off, it has been sourcing current to the motor's inductance. When the high-side transistor shuts off, the inductor wants to keep sinking current, so the common node between high- and low-transistor will be pulled below ground during the deadtime when both transistors are off. How far below zero will it go? The current has to come from somewhere, and you do NOT want it to come through the gate driver chip!Jon

author: uliano
author_rank: Regular Contributor
timestamp: October 27, 2021, 03:21:50 pm
content: There is an aspect of - high side NMOS & charge pump driver - which I overlooked.IR2104 datasheet request it to be powered by a 10-20 supply, i guess to keep VGS of high NMOS in conduction & safe range as this is the potential used, when the low NMOS is conducting, to charge the capacitor used to drive the gate.with 3 lipo cells it should be ok, but what happens using 2? It stops working or just there could be not enough potential to switch *any* MOS fully on? In the second case one may thing using logic level MOS which should have plenty of conduction at 7.2V. Or a boost converter...And in case of higher than 20V supply one need regulating it down.I was wondering if the dual NMOS totem pole is worth the effort for low power with respect to a push pull PMOS NMOS like the one I posted in #1 which works at every voltage.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 27, 2021, 04:15:41 pm
content: With a 2s pack with low-voltage cutoff set at, say, 5.5V, you'd need to use MOSFETs that are certainly in low-enough Rds_on over the whole temperature range and full current at that 5.5V, and then you need to choose a driver with UVLO not activating until below that 5.5V.

author: Picuino
author_rank: Super Contributor
timestamp: October 27, 2021, 04:18:49 pm
content: Or a little boost converter for supply the driver.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 27, 2021, 04:25:37 pm
content: Or even a classic PMOS/NMOS bridge instead of all-NMOS, but for high currents that's impractical because P-channel MOSFETs are worse.

author: Terry Bites
author_rank: Super Contributor
timestamp: October 27, 2021, 04:49:06 pm
content: How very rude.

author: uliano
author_rank: Regular Contributor
timestamp: October 28, 2021, 01:49:56 pm
content: So I come up with this draft.D1,3,5,6,8,9 can be found in some schematics possibly to help discharge the gate, I added them so that I have the pads on the PCB in case they were needed.This is my first PCB of some complexity. I hope not to have overlooked something stupid.For sure it'll be a prototyping base much better than the previous.Power tracks have 15 mil clearence, is it enough? The rest is 10mil. 2 sides 2oz copper weigth, leg tracks are 2mm wide, Vdd starts at 4mm then 3...All "small" resistors and capacitors al 1206 to keep it simple the debugging.I'll probably make another PCB with the tc4422 and the Push Pull legs so that I save the shipment.

author: xavier60
author_rank: Super Contributor
timestamp: November 07, 2021, 11:47:30 am
content: Quote from: xavier60 on October 27, 2021, 02:28:13 pmThe STGAP2D is back in stock at Mouser, while they last. I was surprised by the small price difference to the IR2104https://au.mouser.com/ProductDetail/STMicroelectronics/STGAP2DMTR?qs=W0yvOO0ixfF%252Bp5Pfo9gPjQ%3D%3Dhttps://au.mouser.com/ProductDetail/Infineon-IR/IR2104STRPBF?qs=2r01AXMCG3NCbspWVHqTYw%3D%3D