Driving a MOSFET with PWM.

In one of my previous articles we looked at how to choose a mosfet operating in switching mode, but it said nothing about the power losses that occur when the switch toggles, the so-called dynamic losses.

Now the same thing in plain language: imagine we have a small motor and want to turn it on; to do this, we need to apply voltage to it. If we want to turn the motor on at certain moments for 10 seconds, it's convenient to put a button in series with it and press it when we want to turn the motor on. A microcontroller can't press buttons, so to control the motor with a microcontroller we replace the button with a mosfet; in this case the mosfet is said to operate in switching mode, i.e. as a button or switch. We looked at how to choose a mosfet for this mode in this article.

Let's change the task a little: now we want to control the motor speed using the same mosfet (our motor is powerful and PWM can't be applied to it directly). The easiest way to do this is to apply PWM to the mosfet gate; then, by changing the PWM duty cycle, we change the average voltage on the motor, and thus can regulate the motor speed. The difference from the previous example is that switching happens frequently, so we need to take into account the switching power losses, in other words, dynamic losses.

In this case the formula for an N-mosfet looks like this:
Driving a MOSFET with PWM.

Let's start with the first term, which accounts for conduction power losses. I think someone may wonder where the letter D came from and what it means.
The letter D denotes the duty cycle (Duty Cycle), which is calculated as the ratio of the pulse duration to the pulse repetition period.

It's intuitively clear that since the switch isn't on constantly but turns on for a certain time each period, this must be taken into account, but why exactly multiply by the duty cycle?
To understand this, let's look at the picture below.
Driving a MOSFET with PWM.

The picture shows that in the time domain the power appears as bursts, but for calculations it's more convenient if the power is constant over time; for this we need to find its average value.

How do we do that?
We can spread the power dissipated during a burst evenly over the whole period, thus obtaining the average power dissipated over the entire period. And since the periods repeat, the power in the time domain becomes constant. Spreading the power over the period is very simple: divide the power dissipated during the burst by the period and multiply by the burst duration, which is what we do in the first term.

That's it for the first term; let's move on to the second, which accounts for the dynamic losses; in the figure they are shown as yellow triangles labeled Psw.
Driving a MOSFET with PWM.

But in fact this figure can lead to the wrong conclusion that the yellow triangles are the power dissipated during switching; in reality the power graph looks like this.
Driving a MOSFET with PWM.

Moreover, the peak of the power graph will be at the point Id/2 and Uds/2; remember these values, we'll use them later.

For a theoretical calculation of switching power losses, you need to find the area of the "bell" drawn in gray, which means calculating an integral, but I think many readers won't find that interesting, so I simply advise you to remember that the switching power losses are approximately equal to:
Driving a MOSFET with PWM.


And now in words: "The AVERAGE value OVER THE ACTIVE REGION TIME is approximately half the peak power."
Why approximately?
Because in reality they are slightly lower, and we take them with a small margin. As you can see, the values I suggested remembering are needed to find the peak power.

Now we need to do the same as above: spread the resulting power over the whole period by multiplying it by the switching time and dividing by the duration of one period; this gives us the average power per period. And as we remember, the periods repeat, so the power can be considered constant over time.
Driving a MOSFET with PWM.

In the formula, division by the period is replaced by multiplication by the frequency.

As for the switching time, the easiest way to find it is to use the total gate charge Qg (specified at given Vds, Id and Vgs) from the datasheet. Then the gate current can be found using the formula Ig = Qg/t, where t is the required switching time.
Why did I say this is the easiest way, when you could use the capacitance values? Because the capacitances are highly nonlinear and depend on voltages, and you also have to account for the Miller effect. The total gate charge (Qg) was introduced by the manufacturers precisely to make our lives easier.

In principle, we could stop here, but there's one more thing I'd like to share. If we rewrite the first formula in terms of the duty factor (S) and the duty factor of the active region (Sa),
Driving a MOSFET with PWM.

it becomes clear why people write:
The duty factor determines the ratio between the peak and average pulse power.