While developing the µModule H-bridge I’ve learned a lot about H-bridges. Things that I have not seen written down anywhere but got burnt by them several times (literally in some cases). So I decided to share this information in the hope that it will be useful for others. Usual disclaimers apply so treat these pages as a starting point rather than a panacea.
Update: I’m working on a new, much updated version of this series. I’ll keep these pages around while that work is still in progress, but please check out the new pages for the latest information.
In general an H-bridge is a rather simple circuit, containing four switching element, with the load at the center, in an H-like configuration:
The switching elements (Q1..Q4) are usually bi-polar or FET transistors, in some high-voltage applications IGBTs. Integrated solutions also exist but whether the switching elements are integrated with their control circuits or not is not relevant for the most part fot this discussion. The diodes (D1..D4) are called catch diodes and are usually of a Schottky type. Though they are mentioned in most documents dealing with H-bridges, their role is usually neglected. They are of key importance for most of the discussion on this page.
In general all four switching elements can be turned on and off independently, though there are some obvious restrictions. Though there’s no theoretical restriction like that, by far the most pervasive load used with H-bridges are brushed DC or bipolar stepper motors (steppers need two H-bridges per motor).
The basic operating mode of an H-bridge is fairly simple: if Q2 and Q3 are turned on, the left lead of the motor will be connected to ground, while the right lead is connected to the power supply. Current starts flowing through the motor which energizes the motor in (let’s say) the forward direction and the motor shaft starts spinning. If Q1 and Q4 are turned on, the converse will happen, the motor gets energized in the reverse direction, and the shaft will start spinning in that way. If less than full-speed (or torqe) operation is intended one of the switches are controlled in a PWM fashion. The average voltage seen by the motor will be determined by the ratio between the ‘on’ and ‘off’ time of the PWM signal.
|Current flow in the forward direction||Current flow in the backward direction|
For the most part, the key decision to make for an H-bridge is the selection of the switching elements. There are many factors to be considered, the most important ones are the operating current, the operating voltage and the switching (PWM) frequency. For most cases a MOSFET switching element is a good selection, so for the rest of the document I will assume MOSFET switching elements.
MOSFETs, when operated as switches, have two states: on and off. In the ‘on’ state they have more or less behave like a small resistor. Their resistance is called channel resistance, and is denoted by rdson. Obviously the higher this value is, the higher the losses are on the MOSFET. While efficiency is not a big concern for most H-bridge designs, heat is. Since the loss on the MOSFET is converted to heat that has to be dissipated, the lower rdson is the better. Another factor to consider is that rdson is temperature-dependent and increases with temperature. Datasheets usually brag about rdson at 25oC, but that hardly can be considered as normal operating condition. So always look for rdson over the full temperature range to make sure you’re operating within safe limits.
A related decision to make is to decide if ‘N’-channel or ‘P’-channel MOSFETs are used. ‘N’ channel MOSFETs have a much lower rdson values but they are hard to control on the high-side (Q1 and Q3). In general the low-side switches are always ‘N’-channel transistors, while the high-side ones are sometime ‘N’ and sometime ‘P’ type. I will get back to the control problems later, here it’s sufficient to say that this decision has significant impact on the control circuit.
Once the type of the switches is decided, the part selection can be started. The operating current and the available cooling will determine the maximum allowable rdson. As a guideline, the bigger the package is, the more heat it can dissipate, and so the higher current it can be used at for any given rdson. Regular packages include SO-8, D-PAQ and D2-PAQ for surface mount and TO-92, TO-220 and TO-3 for through-hole mounting. There are of course other exotic packages but these are the most common ones. When working with surface-mount packages, it is important to note that thermal characteristics are highly dependent on the actual PCB layout. As an example, let’s take TO-220 package. Without any heat-sink it has a ~60oC/W thermal resistance, and the device itself can operate up to about 170oC. So, if you can keep the surrounding temperature (called ambient temperature) below 80oC, you can dissipate 1.5W of power. (1.5*60+80=170). Now, if you want to be able to switch 10A of current, from P=I2*R you get a maximum rdson of 15mOhm. That happens to be a quite nice fit for the IRF1010Z MOSFET, which has an rdson of 7.5mOhm at 25oC, and about twice of that at 170oC.
Of course if you can provide better cooling by a heat-sink, or a fan (or both!) than you can handle much higher currents. You can also shell out more money for MOSFETs with lower rdson. But there’s a catch: the lower rdson gets, the bigger the MOSFET becomes. The bigger the physical device is, the bigger it’s gate will be. The gate forms a capacitor towards the source (and the drain as well, but that’s less important for now). Since MOSFETs are voltage driven devices, their gate-source voltage has to be in a certain range to be turned on, and in another to be turned off. So, the on and off transient has to charge and discharge this parasitic capacitor. Given a driver strength, the higher the gate-capacitance is, the longer it takes to charge or discharge it. Why is it important?
MOSFETs have a low rdson when they are fully on, and they conduct almost no current when they’re are completely off. In both cases the dissipated power is relatively low. However they cannot transition from the on to the off state and vice versa instantly. There will be a short period where rdson is relatively high, but not high enough to stop significant current from flowing through the device. In these transitional periods both the voltage drop on the device (due to rdson) and the current through it are significant, resulting in high power-dissipation. Naturally you would like to keep this transition time as low as possible from this perspective, so a higher gate-capacitance will not be desirable. In fact gate capacitance limits the speed by which the element can be turned on and off, and thus poses an operating frequency limit.
There is another factor to be considered however: the faster the devices are switched the more sudden the voltage and current changes will be in the circuit. These changes will then generate EMI interference that is in general not a good thing. In short you don’t want the switching speed (not the frequency!) to be too high or else you will generate too much electro-magnetic noise.
Switching loss is usually not that big of an issue for low-frequency (couple of hundred Hz) operation but becomes significant as frequency increases. After a certain point it is the main contributor to the dissipated heat.
P- versus N- channel high-side switches
Let’s spend some time on this choice for the high-side elements. As said before, N-channel devices would be desirable for this role for their lower losses, but there’s a problem: for them to operate properly, their source must be connected to the motor leads and their drain to the power rail. When a P-channel device is used, its source will be connected to the power rail and its drain to the motor leads. Now, the problem is that both devices are controlled by their gate-source voltages. For P-channel devices it means that if the gate is connected to the power supply, the device will be opened (gate-source voltage is 0) and if the gate is grounded the device is closed (provided the power-supply is actually enough to close the device), since gate-source voltage is equal to the power supply voltage.
For an N-channel device however the picture is more complicated. If you connect the gate to ground or to source, the device is opened (gate-source voltage is below or equal to 0). But where to connect it to close the device? The power supply is not enough, since, when the device is closed (conducts current), it’s source and drain are roughly at the same potential. Since the drain is connected to power, the source will be at that potential as well, but than gate should be higher than that to keep the device closed. In fact at minimum 5V higher for so-called logic-level MOSFETs and 10-15V higher for normal MOSFETs. This is a significant problem, that voltage somehow has to be generated. In most cases some kind of a charge-pump is used for that, either in a stand-alone or a boot-strapped configuration. The latter however is only useful if the bridge is driven in the ‘locked anti-phase’ mode (see later). In any case, these high-side drivers usually cannot deliver as much current as a regular low-side driver can, which means longer turn-on and -off times for the high-side (lower current takes longer to charge-discharge the gate-capacitance). In high-frequency operation, where switching loss is a significant factor, a P-channel MOSFET might be a better solution because of this. In low-frequency, high-current operation, where switching loss is not a problem, but channel-resistance is, N-channel transistors are usually a better compromise.
Catch diodes (D1..D4) are often overlooked or just briefly mentioned in most H-bridge descriptions, but they are very important components. In fact, the main reason for this article is to share some experience I had with H-bridges with regards to catch diodes.
The basic principle is very simple: while the bridge is on, two of the four switching elements will carry the current, the diodes have no role. However once the bridge is turned off the switches will not conduct current any more. As discussed earlier, by far the most common load for an H-bridge is an electric DC motor, which is an inductive load. What this means is that during the on-time the motor will build an electromagnetic field inside it. When the switch is turned off, that field has to collapse, and until that happens, current must still flow through the windings. That current cannot flow through the switches since they are off, but it will find a way. The catch diodes, are in the design to provide a low-resistance path for that collapse current and thus keep the voltage on the motor terminals within a reasonable range.
Now, whenever a diode is conducting current, there will be a relatively constant voltage drop on it. This is called forward voltage drop and denoted as VF. It is in the 500..1000mV range for most components. This voltage drop, combined with the current through the diode will produce some heat dissipation. The actual heat dissipation depends on the average current flowing through the diode and the percentage of the time the diode conducts. As an example, if the field collapses in 1ms, the cycle time is 10ms, the current at the beginning of the off-cycle is 10A, and it drops linearly (assuming an ideal inductive load here), than there’s an average 5A current flowing through the diode for 10% of the time. The dissipated heat therefore will be 5A*0.5V*10%=0.25W (assuming here a 0.5V VF). If however the field collapses slower, let’s say in 5ms, the dissipation increases to 5A*0.5V*50%=1.25W. Numbers get even worse, if the field doesn’t completely collapse by the end of the off-cycle. From these numbers it can be seen that the dissipated heat over the diodes can be in the same ballpark as the heat dissipated on the switching elements.
It is important to see that for at least low-frequency operation, the selection of the switching elements is mainly determined by the maximum static current delivered by the bridge, while the selection of the diodes is more involved and includes analysis of the actual collapse of the inductive field. The diode selection will be dependent on the dynamic behavior of the bridge. The design and the control of the bridge has a significant effect on how long the diodes actually conduct, so with the one type of control the bridge can actually survive higher currents than with another. With some driving modes, the diodes almost don’t conduct at all.
One important feature of MOSFET transistors is that they contain an intrinsic (unavoidable, built-in) diode between their drain and source. This diode acts as a catch diode in an H-bridge configuration, and most MOSFET datasheets specify the parameters of this diode. It is thus possible to use this built-in diode of the transistors and not provide external ones if the specification of this diode meet the design requirements. For bipolar transistors there’s no such intrinsic diode so external diodes always have to be provided.
Diodes – mostly when they’re off – have a small capacitance between their leads. This capacitance will have to be discharged before the device can turn on and leads to a delay in response to a sudden change in the voltage. This capacitance depends on many factors, but in general grows with the surface area of the P-N transition, that is the current carrying capability of the device. In short, the beefier the device, the slower it is. When the bridge turns off, the motor current will need a way to continue flowing. The motor will forward-bias a diode (or diodes) in the bridge to create a route for that current, however the turn-on delay of the diodes will create a problem. Worst, this will happen at the point where the motor-current is at its maximum. Without mitigation the motor voltage can rise to dangerous levels and damage the switching elements. To bridge this interval where neither the switches nor the diodes conduct a capacitor has to be connected to the terminals of the motor. Some motors contain this capacitor already, but many require an external one. This capacitor will conduct the current until the diodes take over, but the terminal voltage of the motor will still rapidly increase. It is important to select diodes with a short turn-on delay, and this is the reason that Schottky-type diodes are preferred in this role.
Please reverse your open and closed nomenclature concerning mosfet conduction. When a device is biased on it is considered “closed” as far as current flow is concerned. Likewise, a device is “open” when it is not biased into conduction. Thank you for your sharing of information on this website.
Thanks for the suggestion. I’ve fixed the wording. Note that the new series I’ve already adopted this nomenclature.
Love the article I am working on some other mosfet problems besides the h bridge so the statement of why things are the way they are is very portable and useful. god bless you for the time you put in to share your knowledge
How do you prevent the situation of Q1=Q2=”1″
Well, in the static case, it’s rather simple: you don’t do it. For dynamic problems, see this part of the new series: http://modularcircuits.tantosonline.com/blog/articles/h-bridge-secrets/h-bridge-control/. Read the chapter on shoot-through protection.
nice but does this draws any current from it control circuit eg. microcontroller
Not really, but that depends a little bit on the drive circuitry as well. In general, MOSFETs present a tiny static load and even their dynamic load is fairly minimal at the operating frequencies of most motor controllers.
Pingback: back emf | Pearltrees
i understand your h bridge explanation on a regular motor. i need the mosfets to run a unipolar stepper motor off an arduino
Steppers are a very different beast. Some of the principles carry over, but this tutorial is not what you need if you want to understand them.
Great work with this article! It was very helpful for my final exam’s project.
Any good H bridge chip suggestion?
Not really, sorry. I haven’t dealt with H-bridges lately and back in the day when I did, I didn’t use integrated solutions. I do know there are lot of new chips out there for this market though.