# Cant get a grasp on how a full bridge on IR2104 works

I'm trying to build a full bridge DC motor driver on two IR2401 using an Arduino Motor Driver Shield as a reference. It is recommended (if i understand right) to drive this kind of circuit as follows: put a HIGH at [!SD] to enable the circuit and PWM at [IN], where PWM duty cycle will set the duty cycle of upper or lower FET in a half-bridge.

Now when I try to combine it to form a full bridge - here comes trouble. If I understand right, there will be a moment in circuit's operation, when the opposite direction FETs will be toggled, so my motor will basically be braking a certain percentage of time. The bridge is powered by booster circuit, so FETs don't need bootstrapping. For example, if I want to turn the engine ON to 20% of power I will send a 20% PWM to the upper IR2104 and 80% PWM to the lower, this way it will open corresponding FETs (Q6 and Q7), but at the other PWM's half-period there will be Q5 and Q8 opened, effectively setting the motor to a counter-rotation mode. Is there any logic in this opearation mode for this circuit or I'm misleaded in some way?

Pic 1: Normal operation, simple logic LOW on the "B" side, PWM to control power on the "A" side.

Pic 2: Motor winding short circuit when PWM goes to negative half-period.

• If you do ground the right hand side of the bridge, why should the left side switching between ground and VM at PWM frequencies pose the motor a problem? Current will continue to flow through the motor because of its self inductance and within several microseconds you will be pulling the left side of the motor high again. I think you are thinking too hard over this. – Andy aka Feb 8 '18 at 13:24

If you operate the H bridge as you describe then yes, your motor will be reversing. The sensible approach is to use one half of the H bridge for PWM and the other half with logic levels that switch either the top or bottom MOSFET on for the duration of rotation in the direction you wish to go.

In my innocence on this subject of PWM switching I raised this question (a few years ago) that you may find useful to read. If you still want to have full PWM on both halves, you have to consider that the 50% PWM scenario is the "motor-stopped" situation.

• Thanks for your answer! I've omitted a booster circuit at the upper FET side. The problem is: when the second driver is set, for example, to ground the right side of a bridge, the negative PWM half-periods of the left side will trigger windings short-circuit on the motor. – Roustikov Feb 8 '18 at 13:08
• Then 50% duty is your motor-stopped PWM setting and if you want half speed then it's going to be at 75% PWM. – Andy aka Feb 8 '18 at 13:12
• Another question; if you do ground the right hand side of the bridge, why should the left side switching between ground and VM at PWM frequencies pose the motor a problem? – Andy aka Feb 8 '18 at 13:18
• Synchronous rectification. Run each leg at 50-50 and vary the phase angle between the legs to run the motor. – winny Feb 8 '18 at 16:35
• @Roustikov Show waveforms! – winny Feb 9 '18 at 7:54

OK, I think there are different things to consider in this question. I try to cover them one by one.

# Common switching of both legs with the same PWM

This was your first approach, where either Q1&Q4 or Q2&Q3 are conducting (lower images in the question). To be fair this is not 100% correct but can be used as a valid simplification for now.

Your motor (or whatever you put at the output) must have inductive properties to make everything work. This will allow the current to rise during one phase and shrink during the other phase. Your H bridge can reach all 4 quadrants (voltage and current in both directions). So by this definition, you have to control the current flowing through your motor with a reasonable PWM duty cycle. If your switching frequency is large enough, the current ripple will be small enough to be ignored compared to the average current through your motor.

The drawback of this technique is that as you already saw, your motor gets reversely polarized. But this is not an energy problem in the sense that you waste energy! When you reverse the polarity the current keeps flowing in the same direction as the inductivity does not allow the current to be changed non-continuously. Now your motor is working as a generator and pots energy back into the power supply (typically into some capacitors). This can get problematic if your capacitor is too small. Then the voltage might rise above the desired level and damage other parts.

The benefit on the other side is that the voltages in both the input and the output dictate the needed duty cycle exactly: You need $$\\tau =\frac12 + \frac{u_o}{2u_i}\$$ with $$\u_o\$$ the output voltage and $$\u_i\$$ the input voltage. To get this equation you need to solve the idealized differential equations. I did this for you ;-). So you have one equation to reach the whole output voltage interval $$\[-u_i,u_i]\$$.

# Switching of only one leg

Another approach is to keep one of the legs fixed and play with the other. So you would keep Q4 active and only switch Q1/Q2 alternating with your PWM. This can be seen as if the motor was fixed at 0V on the right side.

Side remark: Now you have a half bridge on the left side switching. This is only a 2 quadrant converter. You can either speed up your motor or use it as a generator. But all this is only possible in a dedicated direction an no longer arbitrary.

If you turn on Q1 the current flows through Q1. If you turn it off, through D2 (or Q2 if activated). Now your duty cycle must be $$\\tau = \frac{u_o}{u_i}\$$. But the output voltage is now always positive (in my definition). You cannot reverse the voltage of the motor, that is you cannot reverse the motor movement's direction.

To reverse direction you have to keep Q2 active and toggle with Q3 (and potentially Q4). Then the duty cycle must be chosen as $$\\tau=-\frac{u_o}{u_i}\$$.

So all in all, during the conduction of Q1/Q4 (resp Q2/Q3) power flows from the source to both the motor AND the magnetic field in the inductor. During the second phase (Q2/Q4, Q1/Q3) the power flows from the magnetic field to the motor. The source is not delivering any power during this phase.

The benefit is that the current ripple is smaller as the applied voltage during the phase where Q2&Q4 are conducting, is smaller. This makes the current more stable with a given PWM frequency.

The drawback is that you have to switch the legs when you want to position control your motor. When you want simple movements, this can maybe neglected but if you want to do it right, you have to carefully create an algorithm that handles this switching characteristics. It is doable but you have to spend some minuted thinking there.

## Optimizing the dissipated power

You can even optimize the dissipated power distribution in the FETs by doing some fancy stuff. You could start by conducting Q1/Q4. Then Q2/Q4, Q1/Q4, Q1/Q3. Otherwise the FET Q3 will not get any energy and the others more of it.

Hint: If you do not need this, clam the inactive leg to 0V. The high side FET is always worse from the perspective of circuit design as you might have problems with supply of the gate.

# Some words on switching

I told you that we are doing some simplifications by only looking at the states Q1/Q4 and Q2/Q3 etc. Consider Q1/Q4 conducting and there is flowing quite some current right now. Now you want to disable Q1/Q4 and enable Q2/Q3. You turn off the FETs Q1/Q4 and turn on Q2/Q3. As the gate drivers have some shoot through protection, they directly inactivate the FETs Q1/Q4 but wait a few ns before the other FETs get activated.

The current must flow somewhere. The only way for the current now goes through D3, the source and D2. Here you see, why the diodes are really of importance! Otherwise the current would cause a voltage spike and break any device connected. As soon as the FETs get activated, the voltage drop on the diodes is reduced and the power dissipation reduced.

The same happens in the single leg case.

for normal h-bridge operation, try using shutdown pin. if you need 20% pwm pulse on forward direction, then give 20% pwm pulse to IN1 and in remaining 80% of time shutdown the process ,by doing this we can achieve normal h_bridge operation

Looks like it is easier to use MOSFET gate driver with individual inputs for each output.

A bit more sophisticated PWM generator is going to be needed, such as a microcontroller with required deadtime in the drive sequence.

With individual pins you can use, for example, left upper MOSFET to set speed with 5-95% PWM duty cycle and set right lower MOSFET to logic 1 or 0 to set direction. Well, that is my vision of the problem.

• I suspect you are attracting down votes because the quality of your answer is poor and that using the comment area to enhance an already weak question is frowned upon. I have not down voted BTW. – Andy aka Feb 8 '18 at 14:04