Basic H-Bridge with switches
Figure 1 very basic H-bridge.

H-Bridge Motor Control with Power MOSFETs

by Lewis Loflin

Webmaster Homepage and contact information.

Update Dec. 2019. I no longer recommend using IRF630 n-channel and IRF9630 p-channel MOSFETs. These devices are dated and have a high turn on resistance or rDS(on). This wastes power and the p-channel in particular runs hot.

Replace the IRF630 with the IRFZ44N. Replace the IRF9630 with the IRF4905. My recent tests have proven these devices work far better. Their low on resistance delivers more power to the motor.

See the following page for test results:

Test Power MOSFET Transistors, IGBTs Results, Observations.

Any number of solid-state switches can be used for H-Bridges. This depends on motor voltage and current that determines the H-Bridge construction. Here I emphasize power MOSFETs.

It is just as easy to use combinations of MOSFETs, bipolar transistors, and even insulated gate bipolar transistors.

The information below is 100% relevant today. Using the newer transistors the operating voltage is 5V to 20V. The 20-volt limit is due to the Vgs (voltage gate-source max) of the MOSFETs.

The newer material addresses these issues but is still based on material below. Go through that first. MOSFETs can be connected in parallel for high power and lower on resistance.

All of this is addressed in the following videos and links at the bottom of the page.

Update Dec. 2019. Many micro-controllers today are using 3.3-volt Vcc. This is also true of Raspberry Pi. I found two MOSFETs that work at 3.3-volts.

The IRFZ44N is an N-channel device rated at 55V and RDS(on) resistance of 0.032 Ohms max. The other is a P-channel device rated at 55V and a RDS(on) of 0.02 Ohms max.

See the following spec sheets:

Also see Test Power MOSFET Transistors, Results, Observations

The ultimate goal is the H-Bridge shown as hb_big1.jpg




Permanent magnet DC motors have been around for many years and come in a variety of sizes and voltages. Their direction of rotation is dependant upon the polarity of the applied voltage. Reverse the voltage, the direction of rotation reverses. One of the most common solid-state controls is known as the H-bridge.

In figure 1 we have a very basic H-bridge using two spring-loaded, single-pole, double-throw switches. The normally closed (NC) contacts are grounded and normally open (NO) contacts are connected to +12 volts. A DC motor is connected between the two commons. In its normal state, both motor connections are grounded through the switches. Both switches are spring loaded.

If we press SW1 the NC contact opens and the NO closes supplying +12 volts to one side of the motor while the other side is still grounded through SW2. The motor will spin at full speed say counter-clockwise. Release Sw1 and press SW2 and +12 volts is supplied to the '+' side of the motor while the negative side is grounded through SW1. The direction now is clockwise. Press both switches and both sides of the motor will be at +12 volts and won't run.

MOSFET H-Bridge with motor voltage isolation.
Figure 2 MOSFET H-Bridge with motor voltage isolation.

In Fig. 2 illustrates how the use of opto-couplers OC1 and OC2 allows electrical isolation of motor voltage from the microcontroller circuits.

MOSFET H-Bridge with motor voltage common with control circuit.
Figure 3 MOSFET H-Bridge with motor voltage common with control circuit.

Fig. 3 illustrates a common ground between microcontroller control circuits and the h-bridge common ground.

MOSFET H-Bridge control truth table.
Figure 4 MOSFET H-Bridge control truth table.

This was based on a Toshiba TA8050P H-bridge. See the spec sheet ta8050p.pdf.

MOSFET H-Bridge motor control in break mode.
Figure 5 MOSFET H-Bridge motor control in break mode.

In break mode both sides of the motor are grounded through the lower N-channel MOSFETs. Counter EMF from the motor motion acts to break the motor direction of rotation..



MOSFET H-Bridge motor control clockwise rotation.
Figure 6 MOSFET H-Bridge motor control clockwise rotation.

When a HIGH turns on opto-coupler OC1, Q1 is turned off while Q3 is turned on. This creates a current path for the motor through Q2 and Q3. The motor will rotate I'll say clockwise.

MOSFET H-Bridge motor control counter-clockwise rotation.
Figure 7 MOSFET H-Bridge motor control counter-clockwise rotation.

Here we turned off opto-coupler OC1 (turns Q1 on and Q2 off) and turned on OC2. This turns off Q3 and turns on Q4. Q1 and Q4 provide a current path for the motor, but in the opposite direction for the current flow. This results in counter-clockwise or reversal of rotation of the motor.

MOSFET H-Bridge motor control in stop mode.
Figure 8 MOSFET H-Bridge motor control in stop mode.

Fig. 8 illustrates stop mode - the motor is simply turned off as Q2-Q4 are turned on while Q1-Q3 are turned off.

MOSFET H-Bridge motor control with shoot-through.
Figure 9 MOSFET H-Bridge motor control with shoot-through.

Now I'll address the problem of shoot through. This is a condition where a transistor, let's say Q2, has not switched fully off as Q1 is switched on. This creates power supply overload and possible damage to MOSFETs. I've used this circuit without problem, but we can't ignore this problem.

This can be a particular risk with high speed motor direction change or using pulse-width modulation to control motor speed.

MOSFET H-Bridge motor control with motor power on-off control.
Figure 10 MOSFET H-Bridge motor control with motor power on-off control.

Fig. 10 illustrates the use of a motor power switch to turn off a generic h-bridge circuit. Based on the above schematics simply switch motor voltage off, change direction, then motor voltage back on. That prevents any chance of shoot-trough. We can also pulse-width modulate the switch to control motor speed.

MOSFET H-Bridge motor control with motor power on-off control circuit.
Figure 11

Fig. 11 illustrates a possible power switch circuit.

The circuit above: Design 10-Amp 2N3055 Based Power Switch



MOSFET H-Bridge motor control circuit issues.
Figure 12

Now I will address other issues.

I will be normal for the p-channel MOSFET to get hotter than the n-channel. This is due to higher DS-on resistance of the p-channel.

Rb serves to discharges the gate-source circuit to turn off Q2. In the past I used a 10K resistor, it can be dropped to 1000 ohms. This can result in faster turn off.

The 1N914 diode across Rb suppresses any gate-source discharge noise with Rb.

Finally we can use a NPN transistor instead of an opto-couple.

And the following two videos: