## Controller builders: a gem about shoot through protection.

Electric Motors and Controllers

### Re: Controller builders: a gem about shoot through protectio

John in CR wrote:Teh Stork,

I'm confused unless it's a different problem I need to solve. I run low inductance hubmotors that love to snack on controllers, and all but one new controller have always run hot with these motors. If the issue is caused by the energy delayed/stored by the inductors that needs to go somewhere when the switches turn off, wouldn't the lower inductance mean less energy is stored in the coils that needs to be dissipated in the fet diodes, or am I out in left field?

John

Uhm, this is rather hard to explain - but i hope you understand some of what I say.

The time constant of the system is affected by the inductance and the resistance. Maximum current (not that you would ever desire that) that can flow through the motor is given by I=U/R. Five time constants is what is needed to reach this top value. The curve is exponential and you can find current going through the motor by multiplying with (1-e^t/time constant). Check out LR system for more info.

The thing is. The current rise of a low inductance hubmotor will be very much faster than the current rise of a normal inductance motor. There is allways a limit in the controllers system to detect current rise - so the low inductance low resistance will carry a bigger current before the controller can act. This leads to increased current compared to a normal hubmotor - and this (I think) explains why some controllers cant handle low inductance low resistance motors.

For example (These are all fictional values). If a current limiting is triggered at 90A. Current sensor has a 20 ns delay. The normal hubmotor reaches this current after 100ns, and when the controller reacts - 50 ns later: Current is 120A. Then the same thing for the hubzilla(ish); It reaches the 90A current limit after just 25ns. Before the controller reacts: Current is 270A! In this example, the time constant of the hubzilla is one fourth of the normal hubbie.

Hope it makes some sence

bearing wrote:
Teh Stork wrote:The NOR gate is connected to gate-source and drain source of the lower fet. The gate-threshold is set to ~2v. The NOR gate should never go high. If both GS and DS is zero - that means we have a freewheeling mosfet (and NOR goes high). In turn, if NOR goes; deadtime is reduced. If it never goes high, deadtime is increased. This is the deadtime for the HIGH to LOW on transistion.

Then we have the LOW to HIGH on transisiton. Here i use a comparator sensing the lower fet. If body diode conduction happens here, drain to source voltage goes negative - implying that the deadtime is too big. If comparator goes high; deadtime is reduced. If it remains low; deadtime is increased.

Thanks for the explanation! I think I get it now. If the circuit has detected freewheeling on the last transition, it will decrease the deadtime on the next transition. If it still detects freewheeling, it will decrease the deadtime even more on the following transition. It will continue like this until it stops detecting freewheeling, and then increase deadtime one step to prevent shoot through. In "steady state" it will jitter between two adjacent deadtime values around the optimum.

How are you able to adjust deadtime in such small steps? fast MCU frequency?

Well, I'm a ATMEL fanboi - and AVR is the greatest thing ever. Buuut the 32 bit motor controll line TI offers has 65pS (yep, that is picoseconds!) resolution on their pwm outputs! Craazy The 3ns value just worked very nicely in my bridge setup. It could be a different value.
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

Thanks, I think got it, so the new controller I have which isn't getting hot is operating at a higher frequency and/or has the dead time better tuned to run the low inductance scooter hubbies.

FWIW, the Hubzilla is probably higher inductance than motors I'm talking about, because my problem motors are 2 turn 51 slot and 1.5 turn 63 slot motors.

If it would help you, I can see about sending you one of the controllers that seems to work distinctly better.

Thanks for sharing what you've found.

John
John in CR
100 GW

Posts: 11214
Joined: Tue May 20, 2008 12:58 am

### Re: Controller builders: a gem about shoot through protectio

John in CR wrote:Thanks, I think got it, so the new controller I have which isn't getting hot is operating at a higher frequency and/or has the dead time better tuned to run the low inductance scooter hubbies.

FWIW, the Hubzilla is probably higher inductance than motors I'm talking about, because my problem motors are 2 turn 51 slot and 1.5 turn 63 slot motors.

If it would help you, I can see about sending you one of the controllers that seems to work distinctly better.

Thanks for sharing what you've found.

John

It doesn't nessecarily mean that it operates at a higher frequency, it just means the control is more accurate and precise. Dead time does not really affect this - but propagation delay in gate drivers, microprosessor and sensors influence this. Having too much sensitivity without it being needed is bad design. China controllers often falls into the "does this crap really work" xD Bottom line: your new controller responds faster to the switching currents in your low inductance motors (And no, this is not off topic - as this is a very important area of controller design)

Ah, just remembered your hubzilla from a different thread, that thing is a beast !

2 and 1.5 turn motors, daaamn. Have you measured phase to phase resistance and inductance?

Sending controllers to Norway would be highly expencive, but thanks for your enthusiasm
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

Thanks for the patient explanation. I was thinking higher PWM frequency meant the controller would recognize "oops the phase current is too high, turn it off" in a shorter time frame. I remember reading that with brushless motors that it was important to tune the PWM frequency for best operation of a specific motor, and it's always frustrated me that's not a program option with our programmable ebike controllers like it is for some of the sensorless RC ESC's.

I love the high Kv hubmotors and can't wait for the day guys like yourself come up with a way to feed them properly. Hubmonster is nowhere close to its limits since even with quite a few hard launches it's still barely getting warm.

I don't have anything sensitive enough to measure these low inductance and resistances. A while back I bought an inductance meter, but I ordered the wrong one and the range is too high.

John
John in CR
100 GW

Posts: 11214
Joined: Tue May 20, 2008 12:58 am

### Re: Controller builders: a gem about shoot through protectio

Hehe, I've still got lots to learn (I especially lack experience with OP-amp incorporation ) - I plan this to be my master thesis (motor control) in three years from now - but I hope to have solutions for sale before that. I'm in the process of designing a cnc-cut heatsink for effectively cooling the dualcool packages. Cnc machining in China is dirt cheap xD
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

Teh Stork wrote:Cnc machining in China is dirt cheap xD

If you find a reliable and cheap cnc shop, please let me know
CNC shops are almost non-existant in my country.
Visit my blog, check out personal projects: ebike v2 | e-scooter | ebike v3

circuit
10 kW

Posts: 706
Joined: Thu Mar 19, 2009 11:43 am

### Re: Controller builders: a gem about shoot through protectio

circuit wrote:
Teh Stork wrote:Cnc machining in China is dirt cheap xD

If you find a reliable and cheap cnc shop, please let me know
CNC shops are almost non-existant in my country.

Same here, cnc machining in Norway is extremely expencive since our oil industry just pays what ever it costs, so unless you know some (something which I do not) - you're screwed. We have a cnc pcb machine in house, it can machiene aluminium and plastics. Unfortunately, our teachers do not have (and do not wish) to attain the knowledge to setup the machiene for that =/ I guess I'll have to do it myself. But the thing is; Aluminium are as expencive here in Norway that the price for the finished cut piece in China is the same as if I would buy raw materials here

I'll tell how my experience is
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

Teh Stork wrote:Aluminium are as expencive here in Norway that the price for the finished cut piece in China is the same as if I would buy raw materials here

I'll tell how my experience is

is this also true for one-offs? or only for large quantities?

i have access to a "small" cnc mill. i think i can help you out with some prototype work. i am in the netherlands
nieles
10 kW

Posts: 511
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

### Re: Controller builders: a gem about shoot through protectio

circuit wrote:
Teh Stork wrote:Cnc machining in China is dirt cheap xD

If you find a reliable and cheap cnc shop, please let me know
CNC shops are almost non-existant in my country.

Find someone who has a CNC that is programmed to clone itself, so you can have your own for cheap. I've heard of someone who got their own CNC that way. I hope the guys doing that don't make one that becomes self aware.
John in CR
100 GW

Posts: 11214
Joined: Tue May 20, 2008 12:58 am

### Re: Controller builders: a gem about shoot through protectio

nieles wrote:
Teh Stork wrote:Aluminium are as expencive here in Norway that the price for the finished cut piece in China is the same as if I would buy raw materials here

I'll tell how my experience is

is this also true for one-offs? or only for large quantities?

i have access to a "small" cnc mill. i think i can help you out with some prototype work. i am in the netherlands

Requesting a sample of their work is normally doable, promises of possible quantities to come makes them say yes - heard from a friend

Maybe I'll contact you once the layout is complete
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

I dont understand much about controllers and fets, but I have a friend that happens to be an eletronic engineer and he was saying things that looks alot like the ones posted here.
After hearing him sometimes I lend him a 9c and a ping, last time I spoke him he was already driving the motor with his own controller and shoulda be able to come with a simple igbt controller (no ca, no regen, no nothing) for testing with real current (5-10kw) in the coming weeks.
A decent 25mph bike will cost around \$1000.
A decent 35mph bike will cost around \$2000.
A \$1000 35mph bike will get you killed.
Justin we really appreciate what you did!

gensem
1 MW

Posts: 1525
Joined: Fri Apr 01, 2011 5:28 pm
Location: Sao Paulo - Brasil

### Re: Controller builders: a gem about shoot through protectio

gensem wrote:I dont understand much about controllers and fets, but I have a friend that happens to be an eletronic engineer and he was saying things that looks alot like the ones posted here.
After hearing him sometimes I lend him a 9c and a ping, last time I spoke him he was already driving the motor with his own controller and shoulda be able to come with a simple igbt controller (no ca, no regen, no nothing) for testing with real current (5-10kw) in the coming weeks.

You should have him look into mosfets! Igbt's are really unsuited because of the high forward voltage drop when current gets to "ebike-levels". But props for driving igbt, turning them on and off is a pain in the ass
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

I see.. I told him we should use another driver but ohwell, he is going to find why when the controller gets a real load.
A decent 25mph bike will cost around \$1000.
A decent 35mph bike will cost around \$2000.
A \$1000 35mph bike will get you killed.
Justin we really appreciate what you did!

gensem
1 MW

Posts: 1525
Joined: Fri Apr 01, 2011 5:28 pm
Location: Sao Paulo - Brasil

### Re: Controller builders: a gem about shoot through protectio

-- Alan W6AKB eESP, GreyBorg, eBikeE BMC, myEbikes, ezPCBs and Thanks to ebikes.ca for rescuing this forum!

Alan B
10 GW

Posts: 4302
Joined: Sat Sep 11, 2010 7:43 am
Location: San Francisco Bay Area, USA

### Re: Controller builders: a gem about shoot through protectio

So the 1st current peak below (labeled) would be the diode reverse recovery current (and subsequent ringing on parasitic inductance)?

Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

### Re: Controller builders: a gem about shoot through protectio

Yes, you can clearly see that once the fet reaches the miller plateau - the body diode forces the fet to spend much time in the transconductance stage - leading to heating.

You see the two spikes? Lets say the first spike is at 0 ns.
First spike, caused by turn on of fet, sets off high body diode recovery currents.
At 150ns the fet is fully turned off.
At around 270-280ns the fet is turned on again - here you see another spike. The body diode has been conducting again.

I believe, without being 100% certain, that if you turn on the high-fet and the low fet has been conducting - the body diode will actually speed up the transition of the high fet. You will have extremely low miller plateau time - and the high dV/dT presented at the low side mosfet might turn it on if your gate drive can't hold it off. Leading to a spectacular shoot-through

Also needs mentioning, that p-mos fet seems to be hard-recovery. These have short recovery times with very high currents. Today semiconductors are irradiated and, i believe, pallatinium (or something similar) doped to make them soft-recovery. This leads to longer recovery times with a less spiky behavior. All of the hexfets, feks, are made this way.
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

The P-MOS is actually an hexfet - IRF4905.

I just noticed something I need to re-measure, but I'll be able to do it only over the weekend. That gate waveform may actually be deceiving: it's measured from GND, but the N-MOS source is not at GND!
Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

### Re: Controller builders: a gem about shoot through protectio

I've re-measured, now placing my ground probe on the MOSFET's source. I put the second probe before the gate resistor so I could see the gate current, displayed the difference and voila, a rare real world scope shot of a MOSFET charging and discharging:

We can see the gate charging current going to zero around the time the diode reverse current shoots. Interesting. This shot was with a very short ON pulse (motor is even stopped); with higher load the gate current will not only go down to zero but will also reverse!
Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

### Re: Controller builders: a gem about shoot through protectio

Njay wrote:I've re-measured, now placing my ground probe on the MOSFET's source. I put the second probe before the gate resistor so I could see the gate current, displayed the difference and voila, a rare real world scope shot of a MOSFET charging and discharging:

We can see the gate charging current going to zero around the time the diode reverse current shoots. Interesting. This shot was with a very short ON pulse (motor is even stopped); with higher load the gate current will not only go down to zero but will also reverse!

Cool what kind of scope you using? What are you using for mesuring amps? Just the voltage drop of the gate resistor?
Thanks Justin at http://www.ebikes.ca/
Thanks to Methy at http://www.methtek.com/
And Dave who has Nomex, fets and current sensors etc. STUFF
My YSR build. viewtopic.php?f=10&t=18183
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them under your bed or were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!

Arlo1
100 GW

Posts: 5935
Joined: Sun Apr 26, 2009 10:36 pm

### Re: Controller builders: a gem about shoot through protectio

Njay wrote:I've re-measured, now placing my ground probe on the MOSFET's source. I put the second probe before the gate resistor so I could see the gate current, displayed the difference and voila, a rare real world scope shot of a MOSFET charging and discharging:

We can see the gate charging current going to zero around the time the diode reverse current shoots. Interesting. This shot was with a very short ON pulse (motor is even stopped); with higher load the gate current will not only go down to zero but will also reverse!

That looks much better. Amazing how ground isn't ground when it's just a few inches away.

Nice clear clean picture of the miller plateau and associated ringing through the trans-conductance period.

If you don't mind, since you've got a good capture method setup, try removing the gate drive resistor (or decreasing it to 0.5ohm so you can still use it as a current indicator), and re-run the test. Then try switching it to something huge like a few hundred ohm's and re-run the test.
For ebike parts, don't be a douche, buy from http://www.ebikes.ca or http://www.MethTek.com

Justin saved the forum at great personal expense! The man is a legend and a hero!

liveforphysics
100 GW

Posts: 11381
Joined: Wed Oct 29, 2008 1:48 am
Location: Santa Cruz, CA, USA

### Re: Controller builders: a gem about shoot through protectio

It's just a 2 channel 50MHz Rigol, Arlo. I need to get a 4 channel scope. And for the current measurement yes, just take the voltage (relative to the MOSFET's source) on both sides of the gate resistor, subtract them and divide by the resistor's value (10 Ohm in my case). It's plain and simple Ohm's Law.

Sure Luke, I'll do a few more tests and post more scope pics. The effect is more pronounced because there's a shunt to ground at the MOSFET's source, but there are also inductive effects (later might publish some scope images about that too). There's actually another MOSFET paralleled with this one each having 10 Ohm gate resistors going to the driver through another, single 10 Ohm resistor. I'll isolate the test to just one MOSFET and measure with another 2 gate resistor values. Once again, I now realize another error I did that is probably the cause for the deeper first ringing on the gate current: my driver is "grounded" at the system ground and not at the MOSFET source. So when current goes up, it causes a voltage drop on the current measure shunt resistor, and that "counter acts" the gate charging because the gate will go up by as much as the shunt voltage drop. Got to redesign all this, but it's very good learning . I now realize the real advantage of having the drivers input interface through optocouplers; this way we can "ground" the driver circuit on the MOSFET's source. The diode reverse current is starting to have less influence on what I'm measuring!
Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

### Re: Controller builders: a gem about shoot through protectio

Teh Stork wrote:(...) The deadtime is sensitive to so many factors. Current across the mosfet, temperature. I use a XOR gate to detect cross conduction from high to low switch. If it is triggered - I enlarge the deadtime by 3ns. Opposite, if it is not triggered - I shorten the deadtime by 3 ns. This value can be negative. From low to high, I use a comparator. Same story here.

This means my gate driver hunts in on the optimum dead time. In normal operation it hits it dead on with ~1ns overlap or deadtime. It works as a control loop - predicting what the next switching event should be. With driving a motor, there are no sudden load changes - so it keeps the lock on the switching really good. There are two separate dead time/overlap insertions, both constantly being tuned, for each half-bridge.

Have you though of, or considered, a full hw design? Automatically turning the MOSFET ON in hw when the body diode wants to start conducting. I understand that this would have to react *fast*.
Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

### Re: Controller builders: a gem about shoot through protectio

A full hw design can not do that, as the gate needs to be raised to just below the miller plateau threshold to have 'the best synchronous rectification'. The threshold witch the mosfet start conducting also varies some from batch to batch. Look up adaptive gate drive and you'll find gate drivers that has some drivers that are better than a fixed deadtime (it turns the other fet on once the other is off). There are some "green mosfet drivers" made for secondary side rectification that detects body diode conduction - but I don't think they're suited for nanosecond on-off matching as my software algorithm achieves.
Teh Stork
1 kW

Posts: 350
Joined: Wed May 25, 2011 8:02 am

### Re: Controller builders: a gem about shoot through protectio

I see, because this is kind of "predictive", you need to act in advance.
Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

### Re: Controller builders: a gem about shoot through protectio

I've just discovered a full hw implementation of this . These half-bridge drivers which also minimize MOSFET body diode reverse recovery current with a predictive algorithm for deadtime control (in 3ns steps, nominal). I haven't gone in detail through the datasheet yet, but unfortunately they use a "weird" MOSFET gate voltage, 6.5V. They have some very nice explanations and scope pics of comparing adaptive and predictive schemes. Good stuff from 2001; why don't we see more of this today? Maybe this predictive scheme is patented?

UCC27221 - UCC27222
http://www.ti.com/lit/ds/slus486b/slus486b.pdf

Predictive Gate Drive technology uses control loops which are stabilized internally and are
therefore transparent to the user. These loops use no external components, so no additional design
is needed to take advantage of the higher efficiency of these drivers.
delays to minimize the conduction time interval. This virtually eliminates body-diode conduction
while adjusting for temperature, load- dependent delays, and for different MOSFETs. Precise gate
timing at the nanosecond level reduces the reverse recovery time of the synchronous rectifier
MOSFET body-diode, reducing reverse recovery losses seen in the main (high-side) MOSFET.
Njay
10 kW

Posts: 642
Joined: Thu Sep 09, 2010 10:43 am
Location: Portugal

PreviousNext