TExcelTAD
Home › Power Electronics & Motor Drives › The Flyback Converter

The Flyback Converter

A phone charger, a standby supply inside a television and the bias supply of an inverter's gate drivers all solve the same problem: make one or several isolated low voltages from a higher one, cheaply, below about 100 W100\ \text{W}. The flyback does it with a single switch, a single magnetic part and one diode per output. It is the buck-boost converter of Buck-Boost, Ćuk and SEPIC Converters with its inductor split into two windings on one core. That one change brings isolation, any step-up or step-down ratio through the turns ratio, and a new problem: the energy trapped in the leakage inductance, which shows up as a voltage spike on the switch.

How it works

+ Vin12 V Q d (drain) DcCc 1 uFRc1k DC 100 uFR5 Ohm out Np : Ns = 2 : 1, Lm = 100 uH (primary) core

The dots mark winding ends that go positive together. They sit at opposite ends here, so the secondary diode is reverse-biased while the switch conducts.

  • Switch on (DTsDT_s): VinV_\text{in} appears across the primary, the magnetising current ramps up by VinDTs/LmV_\text{in} D T_s / L_m and energy builds up in the core (in its air gap, in fact). No current flows in the secondary.
  • Switch off ((1−D)Ts(1 - D)T_s): the core flux cannot change instantly, so the current moves to the secondary and the diode conducts. The secondary voltage is clamped at VoutV_\text{out}, so the core discharges into the output and the primary sees the reflected voltage nVoutnV_\text{out}, with n=Np/Nsn = N_p/N_s.

Volt-second balance on the magnetising inductance, referred to the primary, gives the continuous-conduction (CCM) gain:

VinD=nVout(1−D)⇒Vout=Vinn D1−DV_\text{in} D = n V_\text{out} (1 - D) \quad\Rightarrow\quad V_\text{out} = \frac{V_\text{in}}{n}\,\frac{D}{1 - D}

The off-state switch voltage is Vin+nVoutV_\text{in} + nV_\text{out}, the buck-boost's Vin+VoutV_\text{in} + V_\text{out} with the output referred through the transformer. Choosing nn trades switch voltage against duty cycle and secondary current.

Leakage inductance and the clamp

The windings never couple perfectly. The part of the primary inductance not linked with the secondary, the leakage inductance LlkL_{lk} (1 to 3 % of LmL_m in a good wound component), still carries the peak current IpkI_{pk} when the switch opens, and it has nowhere to go. Without a clamp it would ring the drain up to the switch's avalanche voltage. The RCD clamp (DcD_c, CcC_c, RcR_c) catches it: the drain rises to Vin+VcV_\text{in} + V_c, where VcV_c is the clamp voltage above VinV_\text{in}, and the leakage energy goes to the clamp capacitor, which RcR_c discharges. While the leakage current falls, the clamp also takes part of the magnetising energy, so the clamp loss is larger than 12LlkIpk2fsw\frac{1}{2}L_{lk}I_{pk}^2 f_{sw}:

Pclamp=12LlkIpk2fsw VcVc−nVoutP_\text{clamp} = \tfrac{1}{2} L_{lk} I_{pk}^2 f_{sw}\,\frac{V_c}{V_c - nV_\text{out}}

A clamp voltage only a little above nVoutnV_\text{out} makes the loss blow up. A clamp voltage set too high puts the switch near its rating. The usual choice is Vc≈1.5V_c \approx 1.5 to 2.5 nVout2.5\,nV_\text{out}.

In DCM the core empties every cycle. All the stored energy 12LmIpk2\frac{1}{2}L_m I_{pk}^2 goes to the load, so Pout=12LmIpk2fswP_\text{out} = \frac{1}{2} L_m I_{pk}^2 f_{sw} and the output voltage depends on the load: Vout=VinDR/(2Lmfsw)V_\text{out} = V_\text{in} D \sqrt{R/(2 L_m f_{sw})}. Small off-line flybacks often run in DCM or at the boundary, which removes the diode's reverse-recovery loss and gives an easier control loop, at the price of higher peak currents.

Worked example

Given: a low-voltage flyback, Vin=12 VV_\text{in} = 12\ \text{V}, Vout=5 VV_\text{out} = 5\ \text{V} at 1 A1\ \text{A}, n=2n = 2, Lm=100 μHL_m = 100\ \mu\text{H}, Llk=2 μHL_{lk} = 2\ \mu\text{H}, fsw=100 kHzf_{sw} = 100\ \text{kHz}, clamp at Vc=20 VV_c = 20\ \text{V} above VinV_\text{in}; ideal switch and diodes.

Find: DD, the magnetising-current ripple and peak, the switch voltage before the spike, the clamp loss and the CCM/DCM boundary load.

Solve:

D=nVoutVin+nVout=1022=0.4545Iˉm=PinVinD=5 W12 V⋅0.4545=0.917 A,ΔIm=12 V⋅0.4545100 μH⋅100 kHz=0.545 AIpk=0.917+0.273=1.189 A (secondary peak nIpk=2.38 A),VDS,off=12+10=22 VPclamp=12⋅2 μH⋅(1.189 A)2⋅100 kHz⋅2020−10=0.283 W\begin{aligned} D &= \frac{nV_\text{out}}{V_\text{in} + nV_\text{out}} = \frac{10}{22} = 0.4545 \\ \bar I_m &= \frac{P_\text{in}}{V_\text{in} D} = \frac{5\ \text{W}}{12\ \text{V} \cdot 0.4545} = 0.917\ \text{A}, \qquad \Delta I_m = \frac{12\ \text{V} \cdot 0.4545}{100\ \mu\text{H} \cdot 100\ \text{kHz}} = 0.545\ \text{A} \\ I_{pk} &= 0.917 + 0.273 = 1.189\ \text{A}\ (\text{secondary peak } nI_{pk} = 2.38\ \text{A}), \qquad V_{DS,\text{off}} = 12 + 10 = 22\ \text{V} \\ P_\text{clamp} &= \tfrac{1}{2} \cdot 2\ \mu\text{H} \cdot (1.189\ \text{A})^2 \cdot 100\ \text{kHz} \cdot \frac{20}{20 - 10} = 0.283\ \text{W} \end{aligned}

Check: the clamp burns 5.7 % of the output power, a typical figure, and the drain reaches 12+20=32 V12 + 20 = 32\ \text{V}, so a 60 V60\ \text{V} MOSFET has margin. CCM holds while ΔIm/2<Iˉm\Delta I_m/2 < \bar I_m; the code finds the boundary.

python · try it yourself
import numpy as np

Vin, Vout, n, Lm, Llk, fsw, Vc = 12.0, 5.0, 2.0, 100e-6, 2e-6, 100e3, 20.0
Ts = 1 / fsw

def ccm_point(Iout):
    D = n * Vout / (Vin + n * Vout)
    Im = Vout * Iout / (Vin * D)                # average primary current during the on time
    dIm = Vin * D * Ts / Lm
    return D, Im, dIm

D, Im, dIm = ccm_point(1.0)
Ipk = Im + dIm / 2
Pcl = 0.5 * Llk * Ipk**2 * fsw * Vc / (Vc - n * Vout)
print(f"D = {D:.4f}, Im avg = {Im:.3f} A, dIm = {dIm:.3f} A, Ipk = {Ipk:.3f} A, secondary peak = {n*Ipk:.2f} A")
print(f"switch off-state voltage = {Vin + n*Vout:.0f} V, clamped drain = {Vin + Vc:.0f} V, clamp loss = {Pcl:.3f} W")

# boundary: dIm/2 = Im  ->  Iout_b = Vin*D*dIm/(2*Vout)
Iout_b = Vin * D * dIm / (2 * Vout)
print(f"CCM/DCM boundary at Iout = {Iout_b:.3f} A (R = {Vout/Iout_b:.1f} ohm)")

# below the boundary: DCM, Vout = Vin*D*sqrt(R/(2 Lm fsw)) at the same D
for R in (5, 20, 40, 100):
    if Vout / R > Iout_b:
        print(f"  R = {R:3d} ohm: CCM, Vout = {Vin/n*D/(1-D):.2f} V")
    else:
        print(f"  R = {R:3d} ohm: DCM, Vout at fixed D would be {Vin*D*np.sqrt(R/(2*Lm*fsw)):.2f} V")

# clamp loss against the clamp voltage
print("Vc (V)  drain peak (V)  clamp loss (W)")
for v in (12, 15, 20, 30, 40):
    print(f"{v:5.0f} {Vin+v:12.0f} {0.5*Llk*Ipk**2*fsw*v/(v-n*Vout):14.3f}")
D = 0.4545, Im avg = 0.917 A, dIm = 0.545 A, Ipk = 1.189 A, secondary peak = 2.38 A
switch off-state voltage = 22 V, clamped drain = 32 V, clamp loss = 0.283 W
CCM/DCM boundary at Iout = 0.298 A (R = 16.8 ohm)
  R =   5 ohm: CCM, Vout = 5.00 V
  R =  20 ohm: DCM, Vout at fixed D would be 5.45 V
  R =  40 ohm: DCM, Vout at fixed D would be 7.71 V
  R = 100 ohm: DCM, Vout at fixed D would be 12.20 V
Vc (V)  drain peak (V)  clamp loss (W)
   12           24          0.849
   15           27          0.424
   20           32          0.283
   30           42          0.212
   40           52          0.189

At a fixed duty cycle the output of a lightly loaded flyback rises without limit, which is why a flyback must never run open loop without a load: the feedback loop (usually an optocoupler and a TL431-type reference across the isolation barrier) cuts DD back.

Cross-check in ngspice: coupled windings and an RCD clamp

The deck couples a 100 μH100\ \mu\text{H} primary and a 25 μH25\ \mu\text{H} secondary (n=100/25=2n = \sqrt{100/25} = 2) with k=0.98k = 0.98, so the leakage seen from the primary is about (1−k2)⋅100 μH≈4 μH(1 - k^2) \cdot 100\ \mu\text{H} \approx 4\ \mu\text{H}, twice the 2 μH2\ \mu\text{H} of the example. The switch is an ngspice voltage-controlled switch (50 mΩ50\ \text{m}\Omega), and D=0.49D = 0.49 makes up for the diode drop. The open-loop converter rings slowly after start-up, so the output is averaged over 2 to 4 ms.

bash · try it yourself
cat > flyback.cir <<'EOF'
* Flyback 12 V -> 5 V: Np:Ns = 2:1, Lm = 100u, k = 0.98, RCD clamp, 100 kHz
.model SW SW(Ron=0.05 Roff=1meg Vt=2.5 Vh=0)
.model DS D(Is=2u N=1.05 Rs=0.02 Cjo=200p)
.model DF D(Is=1n N=1.8 Rs=0.05 Cjo=20p TT=20n)
VIN vin 0 12
VG g 0 PULSE(0 5 0 10n 10n 4.9u 10u)
LP vin d 100u
LS 0 s 25u
K1 LP LS 0.98
S1 d 0 g 0 SW
D1 s out DS
C1 out 0 100u
RL out 0 5
DC d c DF
CC c vin 1u
RC c vin 1k
.control
tran 20n 4m 0 20n
meas tran vout avg v(out) from=2m to=4m
meas tran vdpk max v(d) from=3m to=4m
meas tran vclamp avg v(c) from=2m to=4m
let pin = -v(vin)*i(VIN)
meas tran pin_avg avg pin from=2m to=4m
let pout = vout*vout/5
let pclamp = (vclamp-12)*(vclamp-12)/1000
let eff = 100*pout/pin_avg
print pout pclamp eff
.endc
.end
EOF
ngspice -b flyback.cir 2>&1 | grep -E '^(vout|vdpk|vclamp|pin_avg|pout|pclamp|eff) +='
vout                =  5.019541e+00 from=  2.000000e-03 to=  4.000000e-03
vdpk                =  4.584070e+01 at=  3.240000e-03
vclamp              =  4.049463e+01 from=  2.000000e-03 to=  4.000000e-03
pin_avg             =  6.485234e+00 from=  2.000000e-03 to=  4.000000e-03
pout = 5.039158e+00
pclamp = 8.119439e-01
eff = 7.770203e+01

The output averages 5.02 V5.02\ \text{V}. The clamp node settles at 40.5 V40.5\ \text{V}, which is 28.5 V28.5\ \text{V} above VinV_\text{in} and about 2.8 times the reflected voltage, and the drain peaks at 45.8 V45.8\ \text{V}, almost four times the input. The clamp resistor burns 0.81 W0.81\ \text{W}, so the efficiency is only 77.7 %. Half the loss is the clamp, because k=0.98k = 0.98 leaves about twice the leakage of the worked example. Better winding (interleaved primary and secondary) or an active clamp that recycles the energy are the usual fixes.

Guided lab: a low-voltage flyback evaluation board

Hand calculation. From the board's documentation take nn, LmL_m, fswf_{sw} and the clamp parts. At your input (for example 12 V12\ \text{V}) and load, compute DD, IpkI_{pk}, the reflected voltage nVoutnV_\text{out} and the expected drain plateau Vin+nVoutV_\text{in} + nV_\text{out}.

Simulation. Put your values in the Python cell and in the deck. Lower kk to 0.95 and watch the clamp voltage and loss rise.

What you would measure. Use only a flyback evaluation board designed for a DC input of 24 V or less (bias-supply boards for 1212 or 24 V24\ \text{V} rails exist; PoE boards run from about 48 V48\ \text{V} and are not for this lab), from a bench supply set to 12 V12\ \text{V} with its current limit at about 1.5 times the expected input current. Load it with a power resistor. With a 10:110{:}1 probe and a short ground spring on the drain, expect the off-state plateau near Vin+nVoutV_\text{in} + nV_\text{out} (within a volt or so, because of the diode drop), a spike up to the clamp voltage at turn-off, and ringing between LlkL_{lk} and the drain capacitance at tens of megahertz. When the board runs in DCM, the drain also rings down towards VinV_\text{in} once the secondary current has stopped. Expect efficiency in the 75 to 85 % range at a few watts, ±1\pm 1 percentage point from the meters.

Hazards and safe setup. The drain voltage is several times the input: from a 24 V24\ \text{V} input, expect drain spikes of 60 V60\ \text{V} or more, so treat the primary side as live, use probes rated for it and keep the clamp parts in place (removing the clamp destroys the MOSFET). The clamp resistor, the transformer and the switch get hot. Never run the board without a load. Off-line flybacks (phone chargers, mains adapters) work the same way from about 325325 to 375 V375\ \text{V} of rectified mains, with drain peaks of 500500 to 650 V650\ \text{V} and charged bulk capacitors that stay lethal after unplugging: in this course they are calculation and simulation only. Never open or build one.

Pitfalls

  • Forgetting the leakage spike when choosing the MOSFET rating. Size it for Vin,max+VcV_\text{in,max} + V_c plus margin, not Vin+nVoutV_\text{in} + nV_\text{out}.
  • Running open loop or unloaded. The output climbs with R\sqrt R in DCM until something breaks.
  • Treating the flyback transformer as a transformer. It is a coupled inductor that stores energy, so it needs a gapped core sized for 12LmIpk2\frac{1}{2}L_m I_{pk}^2 (Inductor Design).
  • Ignoring the RHP zero. In CCM the flyback, like the boost, has a right-half-plane zero that limits the loop bandwidth (Averaged and Small-Signal Models).

Practice

  1. A flyback with n=4n = 4 makes 12 V12\ \text{V} from 48 V48\ \text{V} in CCM. Find DD and the switch off-state voltage.
  2. A DCM flyback with Lm=200 μHL_m = 200\ \mu\text{H} at 65 kHz65\ \text{kHz} must deliver 10 W10\ \text{W}. Find IpkI_{pk}.
  3. With Llk=3 μHL_{lk} = 3\ \mu\text{H}, Ipk=2 AI_{pk} = 2\ \text{A}, fsw=100 kHzf_{sw} = 100\ \text{kHz}, nVout=20 VnV_\text{out} = 20\ \text{V} and Vc=40 VV_c = 40\ \text{V}, find the clamp loss.
Answer
  1. nVout=48 VnV_\text{out} = 48\ \text{V}, D=48/(48+48)=0.5D = 48/(48 + 48) = 0.5; VDS=48+48=96 VV_{DS} = 48 + 48 = 96\ \text{V} before the leakage spike.
  2. Ipk=2P/(Lmfsw)=20/(200×10−6⋅65 000)=1.24 AI_{pk} = \sqrt{2P/(L_m f_{sw})} = \sqrt{20/(200 \times 10^{-6} \cdot 65\,000)} = 1.24\ \text{A}.
  3. P=12⋅3 μH⋅4 A2⋅100 kHz⋅40/20=1.2 WP = \frac{1}{2} \cdot 3\ \mu\text{H} \cdot 4\ \text{A}^2 \cdot 100\ \text{kHz} \cdot 40/20 = 1.2\ \text{W}.

Test yourself

Where is the energy of a flyback converter stored during the switch on-time?

  1. In the output capacitor only
  2. In the magnetising inductance of the coupled inductor (its air gap)
  3. In the clamp capacitor
  4. In the secondary diode

A CCM flyback has Vin=24 VV_\text{in} = 24\ \text{V}, n=3n = 3 and Vout=5 VV_\text{out} = 5\ \text{V}. The switch voltage during the off-time, before the leakage spike, is…

  1. 24 V24\ \text{V}
  2. 29 V29\ \text{V}
  3. 39 V39\ \text{V}
  4. 72 V72\ \text{V}

Why does lowering the RCD clamp voltage towards nVoutnV_\text{out} increase the clamp loss?

  1. The clamp resistor gets smaller
  2. The leakage current takes longer to reset, so more magnetising energy goes into the clamp: the loss scales with Vc/(Vc−nVout)V_c/(V_c - nV_\text{out})
  3. The diode conducts in reverse
  4. The switching frequency rises

A DCM flyback runs at a fixed duty cycle with no feedback. If the load resistance is quadrupled, the output voltage…

  1. stays the same
  2. doubles
  3. quadruples
  4. halves