Maker Pro
Maker Pro

MOSFET H-bridge, weird effect...

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
built an H-bridge, and something very odd happens...

namely, normally, when the power is connected directly to the motor, it spins up, and when power is disconnected, the motor slows and stops over a period of around 1 second or so. similar also happens with my other H-bridges.

however, when using this H-bridge, when the input signal to the motor stops, the motor stops, immediately...
it actually stops so hard that the motor will try to jump off the floor and spin in mid air (requiring physically restraining it with something). (not sure what the effect would be with a PDM signal, not tested yet).

I am a bit of a loss here, unsure what is the nature of this behavior (nor its potential consequences).

otherwise, the motor spins good and hard, with minimal heating of the drive transistors.

this is the bridge intended to run the tool motor..


ok, here is the circuit diagram:
h_bridge3_0.png
built (on perfboard), seems to be working (generates voltage, and spins motor in both directions).
Correction: lower resistor is 680 Ohm, not 220 Ohm.

types of transistors used:
N-MOSFET: IRF540
P-MOSFET: IRF9640
NPN: 2N3904 (since very little current is needed for MOSFETs).

0.02 Ohm Resistor: made out of parallel small nails (2x 3d-14ga).
multiple nails were used, as notable heating was noticed (at 5A) with a single-nail shunt.

power traces are generally 2x20AWG or 18AWG, with 14AWG for the external power connections. 20AWG is the thickest wire that fits through the holes. for the 14AWG connections, just sort of tied down the wires (using 24 AWG wire as thread) and soldered the crap out of it.

the point of the lower circuit is to try to work like a current limiter.
first minor oddity: for the lower transistors, the measured voltage was only 0.8v.


a potential issue:
both sets of bridge transistors seem to turn on at intermediate voltages, so at (Gate) voltages between (I guess) around 2v and 10v, current seems to flow directly through the transistors, and they quickly start heating up (otherwise there is little heat).

I am not sure if this case could pop up with interactions with the current limiter (near the bottom of the diagram). would want the bridge to be either fully enabled or disabled at any given moment.

I had originally planned on having the current limiter drive another MOSFET (and switching main power), but got tired with all the wrangling of thick wire on-board, so tried to do it on the logic end instead.

but, I don't really trust this attempt at a limiter.


thoughts?...
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, that will happen, because when you drive both sides of the H-bridge to the same state, the H-bridge effectively shorts the motor out. This is called braking and it's different from simply disconnecting the power source from it, which produces the gradual slowing to a stop.

If you don't want braking, you need the bridge to have at least three inputs, so it's possible to set one side of the H-bridge to "floating", i.e. both MOSFETs OFF.

As you noted, that design will have a problem with cross-conduction aka shoot-through currents because as the gate voltage passes through the range of about 4V to 8V (in either direction), both MOSFETs will conduct to some extent. Of course, the shoot-through current will produce a voltage drop across your current shunt.

This is the same problem that CMOS ICs have, but on a much larger scale. This is one of the problems that a dedicated dual MOSFET driver avoids. Another advantage of using a driver IC is that all four MOSFETs can be N-channel; these have a lower RDS(on) per dollar compared to P-channel MOSFETs.

I haven't checked out your current limiter circuit and I can't say that I think it will work. I think the current monitoring should be done by a differential amplifier amplifying the voltage measured directly across the shunt resistor.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
yeah.

I guess the uncertainty is how braking would effect things like RPM and torque in the case of PWM or PDM driving, or if it poses a risk to the motor or similar.

I guess potentially, it could either adversely effect PDM driving, or maybe alternatively make it easier to achieve a particular target RPM (such as by slowing the motor more at lower duty cycles).


I had not seen this effect before with PNP and NPN H-bridges though...

I had briefly considered building another PNP+NPN bridge, but realized I would need an absurd number of transistors to get a 20A peak capacity (whereas with MOSFETs, I only needed about 4 of them, and could use small transistors to control it).

I am also left wondering if my trace wires are overkill.
would be a lot more convenient if I could use thinner wiring (I was mostly going off ampacity charts thus far, but wire sizes get crazy much over 10A).

I am left wondering partly as transistor leads seem to be thinner than what their rated amperage would otherwise seem to imply.


I would probably need to drive the bridge a bit differently to be able to turn the bridge off.
leaving the MOSFETs disconnected doesn't work (they seem to go into shoot-through mode, and so need to be kept "anchored" either at +12v or 0v).


the basic idea of the current limiter is, basically:
the voltage divider is used to increase the shunt-output voltage slightly.
say: 20A*0.02=0.4v, and 270/7.5 divider should pull this up to around 0.8v (0.4v + 0.4v).
this will saturate the first transistor, which will pull down the base for the second transistor to 0v (causing it to turn off). at this point, the MOSFETs would all get +12v, and the bridge would be off (0v on both sides).

the concern is that there may be a window between the on and off states, and that possibly the bridge could end up in or linger in this state (which seems to heat up the MOSFETs).

though, it is also possible that, if a 3.3v input signal is used, if the bridge starts cutting off, the input-handling NPN will turn off due to the rising emitter voltage (before getting high enough that cross-conduction becomes an issue for the MOSFETs).
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You didn't get the braking effect with the BJT bridges because there is not short circuit when, for instance, the bottom two transistors are on and the top ones are off. But with MOSFETs, one will conduct from source to drain through the body diode.

BJT bridges often have diodes placed like the body diodes in your MOSFET bridge in order to suppress high voltages on motor turn off. If you had used these, you would get the same braking effect.

Bob
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
You didn't get the braking effect with the BJT bridges because there is not short circuit when, for instance, the bottom two transistors are on and the top ones are off. But with MOSFETs, one will conduct from source to drain through the body diode.
What do you mean? Are you saying that if the bottom device is a MOSFET it will conduct in both directions, but if it's an NPN, it will only conduct in one direction?

AFAIK a MOSFET biased into conduction will conduct in both directions, with or without a body diode. And a saturated NPN will also conduct collector-emitter current in either direction. After all, a BJT doesn't have a body diode but it does have a collector-base diode! Or am I missing something?
 
Last edited:

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
You didn't get the braking effect with the BJT bridges because there is not short circuit when, for instance, the bottom two transistors are on and the top ones are off. But with MOSFETs, one will conduct from source to drain through the body diode.

BJT bridges often have diodes placed like the body diodes in your MOSFET bridge in order to suppress high voltages on motor turn off. If you had used these, you would get the same braking effect.

Bob

could be.

I didn't use flyback diodes before, as I don't have any yet. I had basically tried suppressing the voltage spikes in some of them using capacitors, but mostly this just seems to reduce PDM induced squealing.


What do you mean? Are you saying that if the bottom device is a MOSFET it will conduct in both directions, but if it's an NPN, it will only conduct in one direction?

AFAIK A MOSFET biased into conduction will conduct in both directions, with or without a body diode. And a saturated NPN will also conduct collector-emitter current in either direction. After all, a BJT doesn't have a body diode but it does have a collector-base diode! Or am I missing something?

does it make a difference if my past H-bridges didn't get enough gain to actually saturate the NPN's?...

I suspect this may be the case, as a lot of my past bridges were unable to give the full amperage from the transistors, and when looking more into the hFE's involved, noted that they generally could not actually get enough gain to reach saturation for the output-stage transistors (would need more aggressive preboosting).
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Sure. You need to saturate the transistors otherwise they will dissipate a lot of power. But MOSFETs are the way to go. I wouldn't even be considering transistors. That's why I recommended that you avoid the L298 in another thread.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
What do you mean? Are you saying that if the bottom device is a MOSFET it will conduct in both directions, but if it's an NPN, it will only conduct in one direction?

AFAIK a MOSFET biased into conduction will conduct in both directions, with or without a body diode. And a saturated NPN will also conduct collector-emitter current in either direction. After all, a BJT doesn't have a body diode but it does have a collector-base diode! Or am I missing something?
I just did a simulation with BJTs and it does conduct, but in a manner that will destroy the transistor, which is why you should always have flyback diodes across each transistor.

Here is the circuit, simulating an H-bridge with both lower transistors (NPN) biased on, and a motor that has been turned off. The motor is modeled as a current source since the inductance attempts to keep the current at the time it was switched off:

bridge.JPG

Current flows normally through Q1. In Q2, the base goes to -120V and current is split between the emitter and the base. If this really happened, Q2 would likely be destroyed.

Bob
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, so the transistor's base-collector junction will conduct and this will pull the base negative, causing zener breakdown in the base-emitter junction.

So if the catch diodes were present, as we agree they should be, a BJT bridge driver and a MOSFET driver would both brake the motor.

I see what you're saying. It's because the OP didn't have the (required) diodes that the BJT version didn't brake the motor.

You did explain that in post #4 and I replied too hastily. I was missing something!
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
Sure. You need to saturate the transistors otherwise they will dissipate a lot of power. But MOSFETs are the way to go. I wouldn't even be considering transistors. That's why I recommended that you avoid the L298 in another thread.

the L298 was a reasonably cost-effective option though.
most other options cost more.

the issue mostly is that saturating some of the transistors I have takes a lot of current, and it may be difficult to get enough hFE from low-power inputs to generate enough current to drive them (say, if we need several amps to drive the main transistors, which requires a lot of boosting).

so, more typically, the things are run non-saturated.


efficiency or heat, well, sort of an issue, but manageable.
for one earlier motor driver, I had hand-cut aluminum blocks as heat-sinks.

for other ones, I had basically used a big gobs of clay. the clay seems reasonably effective, and will conduct heat reasonably well, but is brittle (dropped a board like this at one point, heat-sink exploded. then I gathered the pieces pieces, and melted and re-applied the clay).

could try using clay-glue (a mix of clay and PVA glue), which is slightly less brittle (I have used it for making some other parts). other possibilities: clay+metal (dust, chips, or wire), clay+solder, clay+silicone, ...
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
I have a robot car that I built the bridges from dual P-N MOSFETs which cost me 25 cents for each H-bridge bridge. You can't get much cheaper than that.

Bob

Edit: Here are the MOSFETS I am using. I bought 100 at 12.1 cents each.

http://www.mouser.com/Search/Produc...7virtualkey62110000virtualkey621-DMG6602SVT-7

those could also work for low-power uses, though with a drawback of being surface-mount (most of what I am doing thus far is through-hole, no real good way to do SMD at present).

I used slightly bigger TO-220 style MOSFETs in the H-bridge I had built recently.


but, I meant for full Dual-H-bridge drivers ICs.
many cost a bit more, but the L298 chips I got were $4 each.

for low-power stuff, I also have some L293D drivers (10 for $5 or something IIRC).


with the NPN transistors I have (ex: MJE3055T), it is pretty easy to get 2 or 3 amps out of them. higher power output gets a little more problematic (hFE drops a bit, so need to supply more base current, meaning more and less-cheap boost transistors).

for example (costs on Amazon are $0.50 each, and $1.40 each):
http://www.ece.usu.edu/ece_store/spec/MJE2955T.pdf
http://www.onsemi.com/pub/Collateral/MJE13009-D.PDF

(quick look, NPN's much bigger than the MJE3055T or MJE13009 and similar get a bit more expensive).


with the IRF540 and IRF9640 (MOSFETs), at least in limited tests, they seem to give full power to the motors (though, I haven't tested it under heavier loads yet, and currently don't have any heatsinks on the MOSFETs, though they don't really seem to get hot in the tests thus far).

for example (both cost about $1 each):
http://pdf.datasheetcatalog.com/datasheet/fairchild/IRF540N.pdf
http://www.vishay.com/docs/91086/91086.pdf
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
with the IRF540 and IRF9640 (MOSFETs), at least in limited tests, they seem to give full power to the motors (though, I haven't tested it under heavier loads yet, and currently don't have any heatsinks on the MOSFETs, though they don't really seem to get hot in the tests thus far).
Right. That's why we recommend them! And speaking of recommendations, check out the pricing and specifications on this one: http://www.digikey.com/product-detail/en/NTD4906N-35G/NTD4906N-35GOS-ND/2194521
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
Right. That's why we recommend them! And speaking of recommendations, check out the pricing and specifications on this one: http://www.digikey.com/product-detail/en/NTD4906N-35G/NTD4906N-35GOS-ND/2194521

yep. I may consider something like this the next time I need some more MOSFETs.
for right now, I have 18 remaining N-MOSFETs and 8 remaining P-MOSFETs.


I originally found the ones I got partly as at the time I had considered the possibility of building a CNC welder / plasma cutter / welding-printer (to print things out of welding wire), so went looking for transistors which could handle a lot of current.

well, and also got some large diodes (around the size of the end of my finger), with a 400A peak current, and leads about as thick as house wire.

I later changed this idea to being a CNC mill, but many of the types of components needed are fairly similar in either case.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
status update:
observed that if both sides of the H-bridge are turned on at the same time, then the motor stops without braking.

for example:
00=off, break
01=on, forward
10=on, reverse
11=off, floating


also, here it is in action (driving the core from a cordless drill), but I didn't notice beforehand that I had the current limiting on the power supply turned down, so it was a little weak.

yeah, the video sucks, don't really have good lighting, was working in a cramped space on the floor, was doing everything one-handed (barely enough space to sit).

not really shown, I also have some of the stuff for a tachometer on there (an IR LED and an IR phototransistor), but realized I need to use a reflector on the chuck, as the motor is too fast to measure its speed directly (discovered it can only sample at around 600Hz, and the nyquist rate effect limits this to around 300Hz, which is slower than the rotation speed of the motor).

may try to find some other good way to do this.

otherwise was working on the code for a G-code interpreter, and the code for decoding the phototransistor output (it seems it outputs an FM signal, with the basic idea is that you decipher its light level by measuring its output frequency...).
 
Top