# Current flow in a simple flyback topology

I'm continuing my learning about flyback converters, and trying to understand the current flow and the magnetic fields involved.

For instance when the mosfet is on current will flow through the primary winding, but since the current flow in the secondary would be reverse biased no current flows into the capacitor (or from the capacitor back into the secondary). Current may flow out to the load at this point from the cap.

Now what I don't quite understand fully is what happens when the fet is turned off? I think the magnetic field will start to collapse and that this will result in current flowing in the other direction as the field collapses so now the diode will be forward biased and current will flow in the secondary loop.

But what happens on the primary side? Does the current flow through the body diode of the FET on the primary side? Or does the field somehow just collapse and pass it's energy onto the secondary with no need for any current flow in the primary. I seem to remember that's the point of the body diode when switching an inductive load but I'm not sure.

## Edit

After watching the video in the comments it gets to a point where it shows the current flowing in the opposite direction but he's just modeling it. So what he calls the magnetizing inductor isn't a real part. So what's providing the loop for the current to flow on the primary side?

• When the MOSFET turns off and the field in P starts to collapse, it will generate a positive voltage from the top end of P to the bottom end of P. The classic analogy is that an inductor is like a flywheel for current- current wants to keep flowing in the direction is is flowing even when the voltage across the inductor changes. – bigjosh Dec 4 '15 at 21:50
• Are you thinking in terms of idea components (in which case you need some resistors) or real components (in which case diode have reverse breakdown and transformers have non-unity coupling)? – bigjosh Dec 4 '15 at 22:51
• youtube.com/… – Fizz Dec 4 '15 at 23:38
• For steady state operation, the coupled inductor windings will have Volt-second balance. So, if P is pulled low by FET for VsTon, FET drain will have to go above Vs by VsTon Volt-seconds. S will do the same, scaled by turns ratio, and according to dot convention will be complementary to P. Put another way VsTon - VpToff = 0. – gsills Dec 5 '15 at 3:56
• @RespawnedFluff thanks for the video that helped, I'm still stuck on what is physically happening. I updated my question above :) – confused Dec 7 '15 at 14:08

So what he calls the magnetizing inductor isn't a real part.

The magnetizing inductance is real, the ideal transformer is the part that's not so real. An ideal transformer usually depicted like below has infinite magnetizing inductance and can store no energy (which means is not good enough to model a flyback). In an ideal transformer, no (AC) current flows in the primary when the secondary is open-circuit (because i2=0 iff i1=0 [easiest to see when n=1 so that i1=i2]).

So how [in your opinion] would any current flow/charge the flyback if didn't have magnetizing inductance, since on half the time the circuit looks open-circuit on the transformer's output?

An ideal transformer also has no magnetic field which is another unreal part about the ideal transformer. But that's not what happens in real life with a real transformer. Instead a real transformer is made of real inductors, that aren't infinite. So you have the following equivalent circuit (for a less unreal transformer that has winding inductance):

If the coupling is ideal (k=1) in this latter model, then leakage inductance can be ignored (becomes zero) but the magnetizing one does not!

Note that in [LT]spice it's impossible to even simulate an ideal transformer (using inductors) because in [LT]spice you can only create it by coupling real inductors, which have non-infinite inductance! (If you actually want to simulate an ideal transformer you have to do something silly like this using controlled sources.)

Here's what happens with a less unreal transformer: you can have current flowing in the primary even when the current in the secondary is negligible/zero.

Here because I2 is negligible, I1 is the magnetizing current, flowing through the magnetizing inductance. You can see it's 90 degrees out of phase and its average value is 3.18mA, which is exactly $V_1/ j\omega L_1$, i.e. $1/(100\pi)$ in magnitude in this 1 V, 50 Hz (and 1 H inductance) example.

Sorry if I broke the high-school physics curriculum. And yes the flyback does work exactly like Erickson said, current only flows in one winding at a time.

I guess you are confused [of what happens on the primary] because you've heard somewhere that the current of an inductor cannot change suddenly. And that's true, but a flyback "cheats" by having two coils wrapped around its core. If you want a more prosaic description, the collapsing magnetic field "wants" to cause the coil voltage ouptput to rise. But in the case of a flyback it has a "choice" because there are two coils around its core! So it takes the "path of least resistance" and causes the secondary voltage to rise because the resistance there is much lower when the FET is off.

More concretely, you can see above that the MOS voltage drain goes up to [roughly] twice the supply voltage when the FET goes off. So in this respect the flyback does work exactly like your average inductor "protesting" that you cut its current path. But when the drain voltage becomes twice the supply, the voltage drop across the [ideal transformer] winding is high enough (i.e. equal to supply) to open the diode on the secondary side. That's what actually saves the flyback form creating some kV arc on its primary (like a regular inductor would). Once the diode on the secondary opens the rising voltage [reflected there] meets the capacitor, which opposes sudden increases in voltage at its terminals, so the rapid increase in voltage becomes manageable. Conceptually, the magnetizing inductance charges the output cap through the ideal transformer, exactly like Erickson said.

There is nothing incorrect or deeply mysterious about that.

• Thank you for taking the time to write this explanation I really appreciate it. The last section especially made me understand what is happening. Now I finally get it :) – confused Dec 8 '15 at 14:18
• Actually, I struggle also where the primary side current flows when the energy is dumped into the secondary side. The picture that models the primary side as a magnetizing inductance and "primary side of ideal transformer" in parallel. But: only the magnetising inductance is real, so how can current form a loop in the primary when the transistor is off? How does the transfer of energy "through" the ideal transformer create a current path in the real world? – Junius Sep 30 '16 at 14:50

Now what I don't quite understand fully is what happens when the fet is turned off? I think the magnetic field will start to collapse and that this will result in current flowing in the other direction as the field collapses

No, this isn't what happens. The current doesn't change direction, the current stays the same and would gradually (if allowed) fall to zero dissipating the stored energy in other components.

So, in the beginning there was nothing then, suddenly, the FET turned on and current began to flow through the inductor starting at zero amps and rising to some positive value after a few microseconds. The ramp in current is Vs/Lp, that is supply voltage divided by primary inductance. Anything on the secondary doesn't count because of dot-notation and the diode in the secondary.

An amount of energy is stored in the magnetic field and when the FET open circuits that energy can only be passed through to the secondary and luckily (not really) the diode is going to conduct and pass that energy through to the load and storage capacitor.

Under no circumstances does the body diode of the FET conduct because the flyback voltage at the drain is positive. It has to be positive (and remains positive) while ever the fet is open circuit.

Just think about it - the long-term average voltage across an inductor has to be zero - if it isn't then the average current will be a rediculously large amount.

• I understand what you're saying but I'm still confused. If the inductor current kept flowing in the same direction how would current ever flow in the secondairy? When it's flowing through the fet in the first place the diode is reverse biased, if it stayed the same after the FET turned off why would things change? Sorry I know I'm just missing something. – confused Dec 7 '15 at 14:10
• In the absence of any connection to the secondary the energy has to be spent and, to avoid that energy causing a large primary voltage (hundreds or thousands of volts) components are placed across the primary that make use of a diode to dissipate that energy. If there is a normal secondary circuit and load, that energy gets removed into the load and capacitor. However a small amount won't be and usually a diode and resistor||capacitor across the primary snub out that dangerous back emf BUT the current exiting the primary is still the same direction as when the transistor was activated. – Andy aka Dec 7 '15 at 14:18
• See this picture: blog.fairchildsemi.com/wp-content/uploads/2014/07/… - note Dsn on the primary side - this only conducts when there is still energy left in the primary that can't be used by the secondary and it needs to be dealt with. The direction of the diode is at odds to the FET body diode. – Andy aka Dec 7 '15 at 14:21