Yet another FET-based H-bridge

Drives motors

I was inspired by Chuck McManis and his BJT-based H-bridge tutorial and I wanted to build a similar H-bridge based on MOSFETs. The design goal was for the H-bridge to have simple logic-level interfacing with a minimal number of pins and being PWM'able by a single pin similar to what Chuck's H-bridge has and a low count on distinct components - and of course keeping the H-bridge fairly cheap. I'm sorry to say that I had completely forgotten about OddBot's excellent H-bridge when designing the H-bridge (sorry for not using the LMR-search and sorry for drinking so much booze that I can't remember anything) - but hey... the more the merrier, right? :-)

Like OddBot's H-bridge this one can handle 20A since we use the same MOSFETs. Also like OddBot I've not added flyback diodes since the body diodes in the MOSFETs are doing a good job.

I deferred from using the LM339 quad-comparator for level-shifting that I used in my TinyTim robot (and which OddBot is also using in his H-bridge) and instead made level-shifting inverters using a resistor and a BJT - they are the resistors and BJTs closest to the MOSFETs in the schematic and where the resistor is connected to V_BAT (why on Earth didn't I put component names in for easy reference?). For the curious George the components interfacing the two lower MOSFETs form two level-shifting AND-gates (the input to the lower-left MOSFET is (B AND ENABLE) shifted to V_BAT level and the input to the lower-right MOSFET is (A AND ENABLE) shiftet to V_BAT level.

Pins A and B are interfaced from the microcontroller and control motor function:

1. (A, B) = (LOW, LOW) : off
2. (A, B) = (HIGH, LOW) : rotate one way
3. (A, B) = (LOW, HIGH) : rotate the other way
4. (A, B) = (HIGH, HIGH) : electronic braking (low-side)

The ENABLE pin is also interfaced from the microcontroller and is used for PWM speed control of the motor, so you would typically connect this to a PWM capable pin of your microcontroller.

V_BAT should be connected to the positive supply on your motor battery.

I'm currently using two of these H-bridges on my new robot (still waiting to be enrolled into LMR) and they are doing very well - being controlled by an Atmel Tiny26 which will eventually turn into an I2C enabled dual motor controller.

This H-bridge is a little more power hungry than ones not using the resistor + BJT construction for level-shifting and logic but this should not be a major concern unless you really want to minimize power consumption. The motor is still by far going to be the major power consumer.

Comment viewing options

Hello,

I think I'll start building two of these modules. What is the maximum voltage this module can handle?

JR

Thanks. Im testing ur circuit. It works fine except for the breaking function. How do you brake the motor. For A=B=1 the motor terminals are connected to the ground and no current flows through the motor at all. Doesnt that put the motor in a free state instead of a locked state ? If not how do we introduce the locked state ?

I forgot to mention that electronic braking is also controlled by the ENABLE pins, so you can do smooth braking by PWM'ing the enable pins. If A=B=1 or A=B=0 then motor is in free running if ENABLE=0 and in braking if ENABLE=1

I dont that that PWM'ing the ENABLE pin alone is going brake the motor. Beacause for both the [00] and [11] AB states the PMOS switches will stay OFF.

If A, B and Enable are all 1, the top two MOSFETs are off, but the bottom two MOSFETs are on, allowing for low-side braking.
The back EMF current from the motor has a path via ground to complete the circuit, so electric braking is possible.

Ah yes sorry, I was thinking of another design I made, where I could switch between high and low side braking (by using either A = B = 0 and A = B = 1). This design only supports low side braking just like you explained.

Ok. Thanks a lot for your help. You too telefox :)

Can someone explain the process of back emf braking to me ? Thankyou

When the permanent magnet motor is spinning, but unpowered, it acts as an electrical generator.

The coils in the rotor spin through the magnetic field produced by the stator, and they create a back EMF voltage. If the rotor coils are shorted to themselves then the back EMF voltage can drive a current through the coils, and this current in turn causes the coils to produce their own magnetic field.

The magnetic field produced by the coils is opposite to (but weaker than) the magnetic field from the stator magnets, and so the coils create a torque that resists the spinning of the rotor, slowing the motor down. The braking torque is related to the speed the motor is spinning at - at high speeds the dynamic back EMF braking effect will be strong, but at low speeds there will be almost no braking torque at all.

You can easily demonstrate this effect by grabbing a small permanent magnet motor (gearmotors are best!) and disconnecting the motor wires from everything. Spin the rotor and feel how easy it is to turn.
Now twist the two motor wires together to short out the coils and spin the rotor again. The faster you spin the motor, the more fiercely the back EMF braking effect will resist you.

Ok. I get it now. Thankyou for taking the time to explain it to me :)