Building an H Bridge

It's time to dump the L298Ns.

I'd like to build a quad H bridge driver that will work for the little yellow 6V TT motors, but also work later with 3 amp motors up to 30V.

I've found a nice IC that I'd like to use:

And @LarryD posted a fantastic resource:

For a reversible PWM MOSFET based H bridge the bottom center and the bottom right circuits should both due, but I have questions:

  • Have I selected an IC that will work for my requirements?
  • What is the advantage of the 2 pin or the 4 pin design? That is to ask, do you gain more control by controlling the N-MOSes directly?
  • If the 4 pins is better, don't you only need to control one ore the other N-MOS at a time so couldn't those be flip-flopped onto the same pin? Low, High, and Input for all off?
  • I looked at Pololu and found the 2520 it's comparable but expensive. Is this the least expensive model with these specs that's worth looking at?
  • I do not see radio caps on the schematic above. Aren't they required for using an H bridge with PWM as a motor driver? I see them on every module, that's why I ask.
  • Are there any other discrete components or supporting circuitry that I've missed?

Hehe no arguments there, but unless you have a burning reason to roll your own there will almost certainly be a modern 21st century driver that fits the bill. Have a look at (eg) Pololu who have a good range with various voltage and current combinations.

To learn, kinda like learning to make a radix structure even though you will always use one from a library in any real production.

I have checked Pololu:

And I'd like to attempt to build a good quad H bridge for under $40 which is their price point.

That's a good reason, in fact it's the only one I would consider if I was to roll my own. Otherwise, off-the-shelf, for sure.

Agreed. I just need to build the same level of understanding of this level as I have from my decades of work in 3rd and 4th level programming languages and logic design.
I need to own the concepts if I'm going to make better things down the road.

First rule of H-bridges - there shall be no shoot-through. This means that the botton right circuit with 2 inputs is a bad circuit. It also cannot be used over a range of voltages.

Turn off one set of switching devices before turning on the other, else huge currents will try to flow direct between the rails - the device you mention has a total of 75 milliohms for the high- and low-side switches.

At 30V that means shoot-through currents of up to 400A (or limited by the supply). That SOIC8 chip won't handle 12kW pulses very gracefully!

So the centre-bottom circuit with 4 inputs is suitable - so long as the switching is sequenced safely with enough dead-time between switch-off and switch-on.

In practice its tricky to get high-power H-bridges working solidly - without good protection circuitry its all too easy to pop the MOSFETs in microseconds or milliseconds if you make a mistake. I'd recommend getting an integrated H-bridge chip if you want to control a motor, building H-bridges from scratch is a learning process more than a means to an end (to start with!).

BTW both those circuits use extra Schottky free-wheel diodes for improved efficiency - these are not required, just for some efficiency improvement.

It is necessary to clarify whether the purpose is to get a working circuit or just to learn.

In addition, since it is important to manage the dead time of the H-bridge, it is inevitably necessary to be able to operate the four arms individually.

Primarily to learn, but I will want to use them in cars that I make.

I suspected this to be the case. The 2 input one looks nice and saving a couple pins is cool, but not at the expense of safety and control.
I cannot imagine ever needing both closed at the same time though, so possible to control the N-MOS gates with signal P-MOSes and use a single pin to drive both? That way I can have only one, the other or neither.

I was also considering something similar for the PWM inputs.
So one possibility would be 3 pins:

  • PWM in
  • Reverse Low for forward, high for reverse
  • Enable - N-MOS 3 state pin

I think this would force coordination and simplify software

MOSFETs take small time to transition current and voltage.
Therefore, it cannot be controlled by a gate signal that is simply inverted.
"Dead time" exists for that.

There is a way to have 2-pin control, but this involves one input controlling top-left and bottom-right switches, the other controlling top-right and bottom-left.

You still need dead-time.

I see

I'm driving one direction with PWM and have to opposing N-MOS flowing.
Then I disengage the PWM
Then I disengage the N-MOS
Then I engage the other N-MOS
Then I can use PWM on the other pin
Is the switching time and sequence correct, or di I need to add a pause in the middle?

Like this?

Yes but with sensible resistor values if you want to use PWM. 120k pullups are way too large for fast switching required for PWM.

And 24V on an IRF4905 gate is not the wisest choice, you'd use a zener/resistor divider on the p-channel gates for high supply voltages. [The symbols are not right for power MOSFETs BTW]

But most importantly using 20V Schottky diodes in a 24V circuit is going to lead to blown diodes!

My mistake. Same config but with the IC I selected from above and of course sensible relay choices.

I still don't see where the radio caps go though.

In the case of PWM, it is necessary to consider whether to use MOSFET or (body) diode for regenerative current.
Many efficient H-bridge ICs provide a path for regenerative current through MOSFETs.
It requires individual control of 4 arms.
Furthermore, depending on the PWM frequency, you will probably use the outside of the audible range, so you need a powerful gate drive circuit.
MOSFETs that can carry a large amount of current have a large input capacitance, and if the gate drive is poor, the switching speed will decrease, causing a large loss.
If you don't use a gate driver, you'll need to lower the PWM frequency considerably, which will generate a lot of loud noise in the audible range.

That circuit comes from circuitlab and its well broken! So much shoddy stuff like this online alas... Someone took a 12V circuit and thought they'd label it 24V for no reason and with no insight. Sigh.

Anyway yes, you use decoupling on switching circuits, that's a given, and a combination of ceramic fast decoupling and electrolytic bulk capacitance is usually normal for high current circuits like motor drivers. A few microfarads MLCC and as much electrolytic as you can reasonable fit on the PCB is wise to keep the noise and interference down (or rather reduce how much noise from the switching gets to radiate from and along the power supply wiring).

Normally for a brushed motor you'd use 1 to 10nF of ceramic directly across the terminals to reduce EMI from the brush arcing. This is perhaps what's meant by "radio cap" above? Not needed for brushless motors of course. This capacitor shouldn't be too large as that increases noise from current pulses (inrush) on the motor wiring.

Indeed. I knew decoupling would come into play on a switching circuit. The radio part is from my Heathkit days. The guy who ran the electronics shop called them radio caps because of their high-frequency switching capabilities and the tendency to see them in radios.

Design a circuit board with a pair of L293Ds on top.

Isn't the current a little low for my listed requirements? Also looking to use MOSFETs.

Yeah I'm not sure if the little L293Ds would be able to handle that many volts. I don't have anything to test though.