new here, H-bridge frustrations...

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
ok, I am new here...
and, I am relatively new to electronics as well (my main thing is mostly programming, but I have been messing a bit with electronics over the past several months).


but, one thing I have noticed is an annoyance with trying to build H-bridges which work well...

in comparison, simpler on/off drivers are easier to get working well.


one design I had got working ok involves 2x PNP and 2x NPN drive transistors (per H-bridge), with 2x NPN booster transistors (to boost up from 3.3v 6mA signal currents), and a bunch of biasing resistors.

basically, an NPN transistor drives a pulldown, which is then fed (via resistors) to the Base for the drive PNP/NPN transistors, with additional pullup/pulldown for each transistor.

a big drawback that it needs a bunch of resistors (8 resistors per H-bridge), has a bit of leakage current (there is a path to ground via the resistors), and puts a limit on base current (base current needs to be kept low enough to not fry the resistors), which limits output current (mostly due to issues with gain). had to fiddle a fair bit with this design to get it to work correctly (want both good switching power, and also the transistors to be fully off when not active)

this generally being with transistors like the MJE2955T and MJE3055T (TO-220).

usually using a Darlington pair of a 2N3904 and an MJE3055T as boosters (yes, a 2N2222A would be better, but I don't have any yet, although some have been ordered and should show up eventually, along with some 30A N-MOSFETs, and a few 4A H-bridge driver ICs...).


another design I had seen had used 4x NPN transistors for the H-bridge. this seems more simple/elegant by eliminating the need for biasing things.

I had tried building one, with an NPN/PNP booster pair (3094 and TIP42A in this case) being used to drive each side of a dual H-bridge (with the wires flipped from the booster to drive the opposite transistor on the opposite side of the bridge, for each bridge).

this being for trying to build a dual H-bridge to run a bipolar stepper motor, without much success at getting the stepper going. it seems I get weak output (low output voltage and current, was only getting around +/- 1V with minimal current), and most of the current (several amps) just seems to go through the transistors when it is active (not sure if it is going between the H-bridge transistors, or is mostly going through the transistor bases), though it stops when no signal is applied.

possible fiddling is possible, for example, unlike the designs online I had skipped most of the base-resistors (some designs had showed a resistor for each base, but this would be an issue in this case, and I had ran the output of the main boost transistors directly into the base pins of the bridge transistors).

in some past tests, it seemed like the transistor base pin will pull current regardless of whether there is significant collector current. maybe most of the current is being sucked up by the transistor bases?... (originally, I had thought Ib was proportional to Ic, in addition to Ic depending on Ib, but some tests imply that Ib is more "whatever you throw at it").


the eventual goal here to drive 3 stepper motors (for XYZ movement), and a tool-head motor (target output is approx 20 amps, at 12 VDC, and will likely be spinning a 1/4 inch endmill or similar, intended to carve aluminum).

when the driver ICs get here, will probably just use these for the steppers, but probably will still need a good/powerful H-bridge for the tool motor (though, should hopefully produce at least 15A and power use should not exceed 20A, mostly for sake of the power-supply). there will also be approx 2A for each stepper.

I may be able to use the MOSFETs as well, when they get here.


thoughts?...
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Hi there and welcome to Electronics Point :)

There are lots of H-bridge ICs available, with internal or external switches. Many of them are SMT so you should decide, then tell us, whether you want to go in that direction.

Digi-Key is always a good place to start when you're looking to see what's available. They have categories for bridge ICs with internal switches (http://www.digikey.com/product-sear...rs-internal-switch/2556632?stock=1&quantity=1) and external switches (http://www.digikey.com/product-sear...rs-external-switch/2556427?stock=1&quantity=1)

If you want 15A you will need to use discretes. One option is using transistors in an unbiased class C-type output stage. The general idea is like this:

unbiased complementary output stage.png
... but you cascade two or three of these stages, effectively creating a Darlington arrangement, to give the required current handling capability. When the input swings between VEE and VCC, the output swings to within about n base-emitter voltage drops of the supply rails (where n is the number of cascaded stages). So significant power is wasted in the output transistors. Or you can create wider rails for biasing the earlier stages. This has the advantage that shoot-through or cross-conduction is not a concern. But you should still use fast catch diodes.

The other option of course is MOSFETs; you can again connect them as source followers and generate extra rails to bias them properly, to ensure full conduction.

Re the specific problems you mention, it's hard to comment without seeing schematics and exact problem descriptions.

There are several people here with lots of relevant experience who will be able to give you some good direct advice, especially if you post more details about what you've tried, the part numbers of your motors, what parts you've ordered, and what your project is all about.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
I have some integrated drivers (L298N) ordered (just waiting for them to show up), these will probably be used for the steppers. also, for low-power uses, also have some L293D drivers ordered.


ok, I had tried an arrangement like above in the past, although I had used the transistors on the opposite side (PNP to Vcc, NPN to Vee), will need to evaluate more. this was where all the biasing resistors came in.

but, something like:
h_bridge1_1.png
(correction: 480 ohm should be 470 ohm, but close enough).

a common problem I had seen in my case was that typically both transistors would come on at the same time, dumping power through themselves. a bunch of resistors could reduce this, but the reliance on resistors for the input stage limited the output (unless maybe it were done Darlington style for each output).

I guess linking them like in the other diagram could reduce this (I guess triggering would depend on the output voltage, which would float somewhere between Vcc and Vee).

one issue I have observed is that reverse-biasing is a problem, as-in, the transistors don't work correctly if reverse biased (they don't turn off).


the other design I had tried was more like found in this diagram (found online):
1335122304-h-bridge.gif


just, without resistors, and with external driving transistors (NPN+PNP), and with 2 H-bridges for driving each coil of the stepper.

but, I couldn't really get it to behave correctly.


I am leaning towards MOSFETs for the 15A driver, just need to wait for them to show up as well.

as-is, the BJT transistors I have on-hand are not rated for this much current (8A max, 16A peak), so would need to double them up.

as for parts:
steppers: 42HS4013A4
tool motor: ADRS550SH

in this case, the project is building a small CNC machine (mill/router, with a 12-inch table), intended primarily for wood and aluminum and similar. likely it will be run on a 450W ATX power supply or similar.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Right, the first diagram, with PNPs and NPNs with their collectors connected together, is a bad idea because of the cross-conduction, which will occur whenever the voltage at the collector of the driver transistor is between about (VCC - 1V) and (GND + 1V). That can be avoided by driving each of the four transistors separately; this will give the lowest steady-state losses of any topology using bipolar junction transistors (as opposed to MOSFETs) because all four transistors operate as saturated switches.

The simplest solution is the diagram in my post; this avoids cross-conduction, but at the expense of voltage drop and wasted power, because none of the transistors saturate - they are all emitter followers.

Also there are no catch diodes in those circuits. Catch diodes are needed whenever there is any dead time. (Dead time is a forced delay between one device turning OFF and the other device turning ON; it's used to prevent cross-conduction). So catch diodes aren't needed with the circuit in my post, but they are with most other arrangements. IIRC the L293 and L298 don't have catch diodes built in either, and you have to provide those externally. The more modern H-bridge ICs do have the diodes built in. Many of them also use MOSFETs in the output stage, for better efficiency.

Transistors should never be "reverse-biased" because the base-emitter junction behaves like a zener, with a voltage around 7V, and forcing that junction to conduct in the reverse direction causes permanent deterioration in the transistor's characteristics, at least. If the circuit could apply reverse base-emitter voltage to any transistor, it should be modified with either a series diode to the base, or (preferably) a diode reverse-connected across the base-emitter junction.

Your second circuit, with the four NPNs, will work, but it needs the resistors (at least the resistors to the bases of the NPNs at the bottom). It should also have catch diodes, and diodes to protect the base-emitter junctions of the top two NPNs. It can also suffer from cross-conduction and it will work best when each transistor is driven independently; once you add that complexity, the first circuit in your post is no more complex, and has lower losses. (In the four NPN circuit, the bottom NPNs saturate, but the top NPNs don't.)

Thanks for the other information. That may be important for others who can give you more specific guidance. I think using an ATX power supply is a good idea. You have the right ideas.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
the circuit with the collectors connected together:
yeah, I had to add the extra resistors to keep the transistors off, otherwise, they would turn on by themselves and dump current, I had suspected conduction between the transistor bases, as current flow would stop whenever the connection between the bases was broken, but was independent of the input signal.

could try doing things the other way around, maybe it will work better.

with the 4 NPNs, dunno exactly, but if it is more conduction between bases, this could cause something.

maybe triggering one side somehow causes conduction which turns the other side on, say, a voltage in A causes a current flow between the bases in B, in turn causing these to activate?...


yeah, I think the L293 and L298 will need diodes, as the diagrams in the datasheets tend to portray external diodes. as-is, I don't have any diodes yet (still waiting on these...).

putting capacitors between the outputs and ground also seems to help things, but in a few cases I have noticed the capacitors getting hot.

about reverse biasing, I don't know all the specifics, but have noted that if emitter and collector are mixed up (at least with the MJE3055T and similar) then the thing basically just stays on (and the transistor quickly gets hot).

I did this a few times on accident, first time the transistor quickly shut itself down (in less than a second) and I had thought I had fried it, but, it started working again later after it cooled off again. dunno how hot exactly it got, but it was "up there".


ATX power supply: yeah, these are a relatively cheap source of reasonably good current for 12V and 5V power, and will drop power if shorted or significantly overloaded.

though, I have a 300W PSU where it seems the 12V rail voltage will drop significantly (down to approx 6V near the upper end) prior to triggering overcurrent protection (can't measure, multimeter limited to 10A). will still dump immediately on shorts though.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
the circuit with the collectors connected together: yeah, I had to add the extra resistors to keep the transistors off, otherwise, they would turn on by themselves and dump current, I had suspected conduction between the transistor bases, as current flow would stop whenever the connection between the bases was broken, but was independent of the input signal.
Right. That circuit is dangerous in that way, because the default state for the output transistors is for both of them to be ON. It's only when the drive signal is within about 1V of the positive or negative supply that one of them will turn OFF! That will happen when the drive transistor is turned ON, but when it's OFF, you get a voltage divider effect between its collector load resistor (180Ω) and the resistors connected to the output transistors. That could mean that both output transistors conduct at that time, especially if the VCC voltage is increased.

That circuit can be improved by adding zener diodes in series with the 470Ω resistors, but it's still not very ideal. The only real advantage it has is the low voltage loss, but this is better achieved using MOSFETs nowadays.
with the 4 NPNs, dunno exactly, but if it is more conduction between bases, this could cause something. maybe triggering one side somehow causes conduction which turns the other side on, say, a voltage in A causes a current flow between the bases in B, in turn causing these to activate?...
No. Behaviour of that circuit is pretty well defined by the voltages on the two incoming control signals. That circuit uses the top transistors as emitter followers, and the bottom transistors as common emitter saturated switches. This means its behaviour is not symmetrical. Also, dead time needs to be enforced - during any change of state, both control signals need to remain at 0V for long enough for the bottom transistors to turn OFF, otherwise you get cross-conduction.
yeah, I think the L293 and L298 will need diodes, as the diagrams in the datasheets tend to portray external diodes. as-is, I don't have any diodes yet (still waiting on these...).
Yes.
putting capacitors between the outputs and ground also seems to help things, but in a few cases I have noticed the capacitors getting hot.
That's probably not a good idea. What have you tried?
about reverse biasing, I don't know all the specifics, but have noted that if emitter and collector are mixed up (at least with the MJE3055T and similar) then the thing basically just stays on (and the transistor quickly gets hot).
That's pretty normal for semiconductors. If you put them in the wrong way round, they will often be damaged!
I did this a few times on accident, first time the transistor quickly shut itself down (in less than a second) and I had thought I had fried it, but, it started working again later after it cooled off again. dunno how hot exactly it got, but it was "up there".
Reverse base-emitter current can cause permanent degradation. I would mark those transistors as suspect - actually I would throw them away.
ATX power supply: yeah, these are a relatively cheap source of reasonably good current for 12V and 5V power, and will drop power if shorted or significantly overloaded. though, I have a 300W PSU where it seems the 12V rail voltage will drop significantly (down to approx 6V near the upper end) prior to triggering overcurrent protection (can't measure, multimeter limited to 10A). will still dump immediately on shorts though.
Hmm. I can't suggest anything there.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
Right. That circuit is dangerous in that way, because the default state for the output transistors is for both of them to be ON. It's only when the drive signal is within about 1V of the positive or negative supply that one of them will turn OFF! That will happen when the drive transistor is turned ON, but when it's OFF, you get a voltage divider effect between its collector load resistor (180Ω) and the resistors connected to the output transistors. That could mean that both output transistors conduct at that time, especially if the VCC voltage is increased.

I had noticed an effect like this before, namely that it would be stable at a lower voltage, but current would jump up when voltage was increased. I fiddled with the resistors for a while until I got it stable at 12v.


That circuit can be improved by adding zener diodes in series with the 470Ω resistors, but it's still not very ideal. The only real advantage it has is the low voltage loss, but this is better achieved using MOSFETs nowadays.

could be. I had wanted maximum motor power, but this seems to depend more on amps than volts (more amps=more torque, but more volts=more speed, ex: was getting surprisingly good results with something running some 12v motors at 1.5 volts with D-cells).

at the time, I ordered PNPs and NPNs as I had no real first-hand experience with MOSFETs and didn't really know what their behavior is like.

I have since ordered some as they are higher current and seem better suited to power-switching than BJTs.


No. Behaviour of that circuit is pretty well defined by the voltages on the two incoming control signals. That circuit uses the top transistors as emitter followers, and the bottom transistors as common emitter saturated switches. This means its behaviour is not symmetrical. Also, dead time needs to be enforced - during any change of state, both control signals need to remain at 0V for long enough for the bottom transistors to turn OFF, otherwise you get cross-conduction.

yeah, may have to look more into this...

as-is, I still don't fully understand what is going on in this case, but my understanding may be limited in some areas.


That's probably not a good idea. What have you tried?

I have tried using them mostly for direct-switching (single direction) motor drivers, and also for spinning BLDC motors in Wye configuration (driven by a Raspberry Pi).

I had before built a motor driver (for a BLDC motor, namely an HDD spindle motor) where the common wire was connected to Vcc, and NPN Darlington pairs were used to drive each winding. I had capacitors connected between ground and the windings to help reduce voltage spikes and make the spinning a little smoother.

I had also made the curious observation that if I had one finger touching one of the inputs, and another touching the collector for a different winding, then sometimes the motor would spontaneously spin up (spinning at a high RPM and seemingly behaving much like a conventional brushed motor). (other times, it would start to ring/whine, and would then spin up if the whine was loud enough, and would often spin up if manually spun in the right direction).

I was later able to approximately recreate this effect using approx 700k Ohm of resistors (instead of fingers).

however, the capacitors seemed to get pretty hot in this use-case (in this case they are 0.47uF).

not entirely sure how this works...


That's pretty normal for semiconductors. If you put them in the wrong way round, they will often be damaged!

Reverse base-emitter current can cause permanent degradation. I would mark those transistors as suspect - actually I would throw them away.

too cheap to throw stuff away.

actually, these first transistors were mostly scavenged from old electronics (such as a fried PC power supply, which got fried during a power bump). I desoldered some of the more interesting components, but left a lot of the rest as desoldering is a pain.

I was doing some initial experiments with power-switching circuits at the time, and was using a LiFe motorcycle battery as a 12V power-source (with automotive fuses for safety, don't need to throw 400A at the problem). (my dad had it extra, said I could use it for a robot project).

but, trying to work with this is disturbing, partly as frequent sparks where wires fuse together or sometimes partially disappear is a bit extreme and off-putting (the fuses don't seem to prevent this, but will generally only blow in more extreme cases).

after that, I switched mostly to using an ATX PSU, which will dump power pretty much immediately on a short (often preferable, except for having issues running motors on it without dumping the PSU...).


Hmm. I can't suggest anything there.

yeah, dunno...

the 300W PSU is rated for 19A at 12V (but rated for 25A at 5V), and I guess the voltage drop is probably somewhere between hitting 19A and the PSU dumping power.

though, I also recently got a lab power supply, which is pretty nice for being adjustable, although it does have a drawback of 5A max output (getting higher max amperage requires a more expensive power-supply).

they have different properties and use-cases though.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
could be. I had wanted maximum motor power, but this seems to depend more on amps than volts (more amps=more torque, but more volts=more speed,
You don't understand voltage and current properly. When a circuit can't supply as much current as the load wants, the voltage drops. Voltage and current into a load are interrelated. Do some web research on the relationship between voltage, current and resistance in relation to drivers and loads.
at the time, I ordered PNPs and NPNs as I had no real first-hand experience with MOSFETs and didn't really know what their behavior is like. I have since ordered some as they are higher current and seem better suited to power-switching than BJTs.
Yes they are. You may need to generate a voltage rail higher than the positive supply rail though, to supply the necessary gate bias voltage.
I had before built a motor driver (for a BLDC motor, namely an HDD spindle motor) where the common wire was connected to Vcc, and NPN Darlington pairs were used to drive each winding. I had capacitors connected between ground and the windings to help reduce voltage spikes and make the spinning a little smoother.
Oh.
too cheap to throw stuff away.
But not concerned about wasting hours trying to figure out why your circuit doesn't work properly when the problem is faulty transistors that you should not be using?
the 300W PSU is rated for 19A at 12V (but rated for 25A at 5V), and I guess the voltage drop is probably somewhere between hitting 19A and the PSU dumping power.
"dumping power" doesn't mean anything in this context. If you mean that the power supply detects overcurrent and goes into limiting, hiccuping, or shutdown, then I know what you mean.
though, I also recently got a lab power supply, which is pretty nice for being adjustable, although it does have a drawback of 5A max output (getting higher max amperage requires a more expensive power-supply). they have different properties and use-cases though.
Right. They're great, but not intended for really heavy current applications.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
You don't understand voltage and current properly. When a circuit can't supply as much current as the load wants, the voltage drops. Voltage and current into a load are interrelated. Do some web research on the relationship between voltage, current and resistance in relation to drivers and loads.

I meant being fed into the motor.

if I set a variable power supply to a low voltage, but have a higher amperage, it spins pretty hard, but is slower.

if it is set to a higher voltage, but the amperage limit is low, it spins fast but is easily stalled.granted, yes, the motor does drop the voltage a bit in use.

I know about Ohm's Law and similar, but stuff gets weird with motors.


Yes they are. You may need to generate a voltage rail higher than the positive supply rail though, to supply the necessary gate bias voltage.

hmm...

I ordered some P-MOSFETs in addition to the N-MOSFETs.



yeah, dunno about hot caps.
AFAICT, it has to do with switching speed, and 0.47uF wasn't really low enough for this.

they don't seem to have an issue with normal PWM or PDM though (I am generally doing PDM in software, so I can have an arbitrary number of PDM outputs). in this case, I had used 4.7uF caps.


But not concerned about wasting hours trying to figure out why your circuit doesn't work properly when the problem is faulty transistors that you should not be using?

I tested these ones, they still did their expected behaviors.
they are still stuck on some earlier prototype boards though, so aren't in much immediate danger of reuse.

these things aren't free though. ones' time may be cheaper than trying to order another $4 20-pack of the things or similar.

though, yes, they are apparently a lot cheaper if one buys them in larger amounts.


"dumping power" doesn't mean anything in this context. If you mean that the power supply detects overcurrent and goes into limiting, hiccuping, or shutdown, then I know what you mean.

all output voltages drop to 0V until one unplugs it and unhooks the jumper keeping it running, then plugging these back in, then power returns.

apparently, this particular PSU lacks overcurrent protection per-se, and relies mostly on overpower protection (and disables itself when total power usage hits 300W or similar).


so, this is basically why the motor driver would need to limit max current: mostly to avoid the motor kicking on causing the PSU to disable power output.

I once considered similar when half-imagining the possibility of using a big PC PSU (probably 750W or similar) to drive a small (also CNC controlled) welder. this would likely require current limiting (say, to 50A), otherwise the PSU would disable itself as soon as the thing struck an arc.


Right. They're great, but not intended for really heavy current applications.

yeah.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
in other news:
got around to wiring up the transistors with the emitters connected together (like in the first reply), seemed to work pretty good, at least in the initial tests (need more testing).

testing with 7v, got +/- 5v output. no obvious significant current leaks.

for example (more-or-less the basic design):
h_bridge2_0.png
seemed to work ok.

may need to test more.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, it will work fine. The only problem is the voltage drop in the output transistors, as I pointed out. Measure the voltage across the load; it will be at least 1.2V less than the power supply voltage.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
Yes, it will work fine. The only problem is the voltage drop in the output transistors, as I pointed out. Measure the voltage across the load; it will be at least 1.2V less than the power supply voltage.

yeah. when I measured it earlier, I was getting around 5v for a 7v input.
if it is 10v or 11v for a 12v input, probably good enough...

didn't get around to trying to use it to spin up the stepper yet, but by pulsing the pins, the stepper did move slightly, and when powered up in a single state, held strong enough that the shaft couldn't be rotated by hand (using fingers).


ADD: works, got stepper motor spinning at around 100RPM with the power-supply at 7V (for testing). much past 100RPM and the motor seems to stall. apparently, motor is rated for a max speed of 600RPM when operating at 24V. this means that table probably wont exactly move all that fast in any case (it will move by having the steppers spin some all-thread).
 
Last edited:
Top