-
2022-09-23 10:24:11
One article to understand H bridge drive circuit
1. The principle of H bridge
A typical DC motor control circuit is shown in Figure 1. The circuit gets its name from the "H-Bridge Drive Circuit" because its shape resembles the letter H. 4 triodes make up the 4 vertical legs of H, and the motor is the horizontal bar in H (note: Figure 1 and the following two figures are only schematic diagrams, not complete circuit diagrams, in which the driving circuit of the triode is not drawn).
As shown in the figure, the H-bridge motor drive circuit consists of 4 transistors and a motor. To make the motor run, a pair of transistors on the diagonal must be turned on. Depending on the conduction of different pairs of transistors, current may flow through the motor from left to right or from right to left, controlling the steering of the motor.
Figure 1 H-bridge motor drive circuit To make the motor run, a pair of triodes on the diagonal must be turned on. For example, as shown in Figure 2, when the Q1 and Q4 tubes are turned on, the current flows from the positive pole of the power supply through Q1 from left to right through the motor, and then returns to the negative pole of the power supply through Q4. As shown by the current arrow in the figure, the current flowing in this direction will drive the motor to rotate clockwise. When transistors Q1 and Q4 are on, current flows through the motor from left to right, driving the motor to turn in a specific direction (the arrows around the motor indicate clockwise).
Figure 2 H-bridge circuit drives the motor to rotate clockwise. Figure 3 shows another pair of transistors Q2 and Q3 being turned on, and the current will flow through the motor from right to left. When transistors Q2 and Q3 are on, current flows through the motor from right to left, driving the motor in the other direction (the arrows around the motor indicate counterclockwise).
Figure 3 H-bridge circuit drives the motor to rotate counterclockwise
2. When enabling the control and direction logic to drive the motor, it is very important to ensure that the two transistors on the same side of the H bridge will not be turned on at the same time. If the transistors Q1 and Q2 are turned on at the same time, the current will flow from the positive pole through the two transistors directly back to the negative pole. At this time, there is no other load in the circuit except the triode, so the current on the circuit may reach the maximum value (this current is only limited by the performance of the power supply), or even burn out the triode. Based on the above reasons, in the actual driving circuit, the switch of the triode is usually conveniently controlled by a hardware circuit. Figure 4 shows an improved circuit based on this consideration, which adds 4 AND gates and 2 NOT gates to the basic H-bridge circuit. The four AND gates are connected to the same "enable" turn-on signal, so that the switch of the entire circuit can be controlled with this one signal. The two NOT gates can ensure that only one transistor can be turned on at any time on the same side leg of the H bridge by providing a direction input. (Like the schematic diagrams earlier in this section, the diagram shown in Figure 4 is not a complete circuit diagram, especially if the direct connection of the AND gate and the triode does not work properly.)
Figure 4 H-bridge circuit with enable control and direction logic
Using the above method, the operation of the motor only needs to be controlled by three signals: two direction signals and an enable signal. If the DIR-L signal is 0, the DIR-R signal is 1, and the enable signal is 1, then the transistors Q1 and Q4 are turned on, and the current flows through the motor from left to right (as shown in Figure 4.16); if DIR-L The signal becomes 1, and the DIR-R signal becomes 0, then Q2 and Q3 will be turned on, and the current will flow through the motor in the reverse direction.
Figure 5 Use of enable signal and direction signal
In actual use, it is very troublesome to use discrete parts to make an H-bridge type. Fortunately, there are many packaged H-bridge integrated circuits on the market. It can be used after connecting the power supply, motor and control signal. It is very convenient and reliable to use within the current. For example, commonly used L293D , L298N, TA7257P , SN754410 and so on.
3. MOS tube H bridge 1. Upper arm PMOS, lower arm NMOS It consists of 2 P-type field effect transistors Q1, Q2 and 2 N-type field effect transistors Q3, Q3, so it is called a P-NMOS tube H bridge. The four FETs on the bridge arm are equivalent to four switches. The P-type transistor is turned on when the gate is low and turned off when the gate is high; the N-type tube is turned on when the gate is high and turned off when the gate is low. The FET is a voltage-controlled element, and the current through the gate is almost "zero". Because of this feature, after connecting the circuit in the figure below, when control arm 1 is set to high level (U=VCC) and control arm 2 is set to low level (U=0), Q1 and Q4 are turned off, and Q2 and Q3 are turned on. , the left end of the motor is low and the right end is high, so the current flows in the direction of the arrow. Set the motor to run forward.
Figure 6 Control arm 1 high level, control arm 2 low level, forward rotation
When control arm 1 is set to low level and control arm 2 is set to high level, Q2 and Q3 are turned off, Q1 and Q4 are turned on, the left end of the motor is high and the right end is low, so the current flows in the direction of the arrow. Set the motor to reverse.
Figure 7 Control arm 1 low level, control arm 2 high level, reverse
When control arms 1 and 2 are both at low level, Q1 and Q2 are turned on, Q3 and Q4 are turned off, both ends of the motor are at high level, and the motor does not rotate; when control arms 1 and 2 are at high level, Q1, Q2 is turned off, Q3 and Q4 are turned on, both ends of the motor are at low level, and the motor does not rotate. Therefore, this circuit has an advantage that no matter what the state of the control arm is (no floating state is allowed), the H bridge will not appear. "Common conduction" (short circuit).
2. The H-bridge of 4 N-type FETs also has 4 H-bridges of N-type FETs, which have smaller internal resistance and have the phenomenon of "common-state conduction". The gate drive circuit is more complicated, or special Driver chips, such as MC33883 , are basically similar in principle and will not be repeated here. The following is the gate drive circuit composed of the NAND gate CD4011 , because the output voltage of the single-chip microcomputer is 0~5V, and the control arm of the H bridge used by our car needs 0V or 7.2V voltage to make the FET fully turned on, and the PWM input At 0V or 5V, the gate drive circuit output voltage is 0V or 7.2V, provided that the CD4011 power supply voltage is 7.2V. Remember! ! Therefore, CD4011 is only used for "voltage amplification". The reason for using a two-level NAND gate is for compatibility with the MC33886.
The combination of the two is the following circuit: during debugging, one of the two PWM input terminals is grounded, and the other is floating (pull-up is set to 1), and the motor turns to normal. Monitor the temperature of the MOS tube, cut off the power immediately and check the circuit if it heats up. The 14th pin of CD4011 is connected to 7.2V, and the 7th pin is grounded.
When in use, the PWM output signal of the single-chip microcomputer: 1 channel is a PWM square wave signal, and the other channel is a high level (set to 1). The reverse is also true.