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 . 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
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 (): appears across the primary, the magnetising current ramps up by and energy builds up in the core (in its air gap, in fact). No current flows in the secondary.
- Switch off (): the core flux cannot change instantly, so the current moves to the secondary and the diode conducts. The secondary voltage is clamped at , so the core discharges into the output and the primary sees the reflected voltage , with .
Volt-second balance on the magnetising inductance, referred to the primary, gives the continuous-conduction (CCM) gain:
The off-state switch voltage is , the buck-boost's with the output referred through the transformer. Choosing 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 (1 to 3 % of in a good wound component), still carries the peak current 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 (, , ) catches it: the drain rises to , where is the clamp voltage above , and the leakage energy goes to the clamp capacitor, which discharges. While the leakage current falls, the clamp also takes part of the magnetising energy, so the clamp loss is larger than :
A clamp voltage only a little above makes the loss blow up. A clamp voltage set too high puts the switch near its rating. The usual choice is to .
In DCM the core empties every cycle. All the stored energy goes to the load, so and the output voltage depends on the load: . 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, , at , , , , , clamp at above ; ideal switch and diodes.
Find: , the magnetising-current ripple and peak, the switch voltage before the spike, the clamp loss and the CCM/DCM boundary load.
Solve:
Check: the clamp burns 5.7 % of the output power, a typical figure, and the drain reaches , so a MOSFET has margin. CCM holds while ; the code finds the boundary.
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 back.
Cross-check in ngspice: coupled windings and an RCD clamp
The deck couples a primary and a secondary () with , so the leakage seen from the primary is about , twice the of the example. The switch is an ngspice voltage-controlled switch (), and 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.
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 . The clamp node settles at , which is above and about 2.8 times the reflected voltage, and the drain peaks at , almost four times the input. The clamp resistor burns , so the efficiency is only 77.7 %. Half the loss is the clamp, because 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 , , and the clamp parts. At your input (for example ) and load, compute , , the reflected voltage and the expected drain plateau .
Simulation. Put your values in the Python cell and in the deck. Lower 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 or rails exist; PoE boards run from about and are not for this lab), from a bench supply set to with its current limit at about 1.5 times the expected input current. Load it with a power resistor. With a probe and a short ground spring on the drain, expect the off-state plateau near (within a volt or so, because of the diode drop), a spike up to the clamp voltage at turn-off, and ringing between and the drain capacitance at tens of megahertz. When the board runs in DCM, the drain also rings down towards once the secondary current has stopped. Expect efficiency in the 75 to 85 % range at a few watts, percentage point from the meters.
Hazards and safe setup. The drain voltage is several times the input: from a input, expect drain spikes of 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 to of rectified mains, with drain peaks of to 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 plus margin, not .
- Running open loop or unloaded. The output climbs with 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 (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
- A flyback with makes from in CCM. Find and the switch off-state voltage.
- A DCM flyback with at must deliver . Find .
- With , , , and , find the clamp loss.
Answer
- , ; before the leakage spike.
- .
- .
Test yourself
Where is the energy of a flyback converter stored during the switch on-time?
- In the output capacitor only
- In the magnetising inductance of the coupled inductor (its air gap)
- In the clamp capacitor
- In the secondary diode
A CCM flyback has , and . The switch voltage during the off-time, before the leakage spike, is…
Why does lowering the RCD clamp voltage towards increase the clamp loss?
- The clamp resistor gets smaller
- The leakage current takes longer to reset, so more magnetising energy goes into the clamp: the loss scales with
- The diode conducts in reverse
- 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…
- stays the same
- doubles
- quadruples
- halves