Voltecx is in beta. The macOS build comes first; Windows and Linux packages are still being tested.Beta. macOS comes first; Windows and Linux are still in testing. What's new

A flyback "transformer" is really a coupled inductor: it stores energy while the switch is on and delivers it to the output while the switch is off. That changes how you design it. The core has to hold energy in an air gap, the turns ratio sets the voltage stress on both semiconductors, and the leakage inductance turns into clamp loss. This article walks through the design of a 24 W offline flyback in ten steps.

The specification

  • Input: rectified universal mains. Take the bulk-capacitor valley at low line as Vin,min=100V_{in,min} = 100 V and the peak at high line as Vin,max=375V_{in,max} = 375 V.
  • Output: Vout=12V_{out} = 12 V at Iout=2I_{out} = 2 A, so Pout=24P_{out} = 24 W.
  • Switching frequency: fsw=100f_{sw} = 100 kHz.
  • Expected efficiency: η=0.85\eta = 0.85.
  • Switch: a 650 V MOSFET. Output rectifier forward drop: Vf=0.5V_f = 0.5 V.

Step 1: input power

Pin=Poutη=240.85=28.2 WP_{in} = \frac{P_{out}}{\eta} = \frac{24}{0.85} = 28.2\ \text{W}

Step 2: choose the reflected voltage

While the secondary conducts, the output voltage is reflected to the primary as VOR=n(Vout+Vf)V_{OR} = n (V_{out} + V_f). The MOSFET then sees

VDS,max=Vin,max+VOR+VspikeV_{DS,max} = V_{in,max} + V_{OR} + V_{spike}

A higher VORV_{OR} gives a larger duty cycle and lower primary currents, but more voltage stress. Take VOR=100V_{OR} = 100 V. With 375 V of input, that leaves 175 V of a 650 V rating for the leakage spike and margin.

Step 3: turns ratio

n=NpNs=VORVout+Vf=10012.5=8n = \frac{N_p}{N_s} = \frac{V_{OR}}{V_{out} + V_f} = \frac{100}{12.5} = 8

The rectifier diode then blocks Vout+Vin,max/n=12+375/8=59V_{out} + V_{in,max}/n = 12 + 375/8 = 59 V, plus ringing.

Step 4: maximum duty cycle

At the boundary between continuous and discontinuous conduction, volt-second balance on the magnetising inductance gives

Dmax=VORVin,min+VOR=100100+100=0.5D_{max} = \frac{V_{OR}}{V_{in,min} + V_{OR}} = \frac{100}{100 + 100} = 0.5

Step 5: magnetising inductance

Decide on the conduction mode first. This design runs in discontinuous conduction (DCM) at full load and low line, which keeps the loop simple and removes the diode's reverse recovery. At the boundary, the average input current and the peak current are

Iin=PinVin,min=0.282 A,Ipk=2IinDmax=1.13 AI_{in} = \frac{P_{in}}{V_{in,min}} = 0.282\ \text{A}, \qquad I_{pk} = \frac{2 I_{in}}{D_{max}} = 1.13\ \text{A}
Lm,BCM=Vin,minDmaxfswIpk=100×0.5100k×1.13=442 μHL_{m,BCM} = \frac{V_{in,min} D_{max}}{f_{sw} I_{pk}} = \frac{100 \times 0.5}{100\text{k} \times 1.13} = 442\ \mu\text{H}

Any LmL_m below this keeps the converter in DCM. Choose Lm=400L_m = 400 µH. In DCM the energy per cycle sets the peak current:

Ipk=2PinLmfsw=2×28.2400 μ×100k=1.19 AI_{pk} = \sqrt{\frac{2 P_{in}}{L_m f_{sw}}} = \sqrt{\frac{2 \times 28.2}{400\,\mu \times 100\text{k}}} = 1.19\ \text{A}
D=IpkLmfswVin,min=1.19×400 μ×100k100=0.475D = \frac{I_{pk} L_m f_{sw}}{V_{in,min}} = \frac{1.19 \times 400\,\mu \times 100\text{k}}{100} = 0.475

The secondary conducts for D2=D⋅Vin,min/VOR=0.475D_2 = D \cdot V_{in,min}/V_{OR} = 0.475 of the period. Since D+D2=0.95<1D + D_2 = 0.95 < 1, the core resets before the next cycle, and the converter is in DCM as intended.

Step 6: RMS currents

For a triangular current pulse of peak IpkI_{pk} and duty DD, the RMS value is IpkD/3I_{pk}\sqrt{D/3}:

Ip,rms=1.19×0.475/3=0.47 AI_{p,rms} = 1.19 \times \sqrt{0.475/3} = 0.47\ \text{A}
Is,pk=nIpk=9.5 A,Is,rms=9.5×0.475/3=3.78 AI_{s,pk} = n I_{pk} = 9.5\ \text{A}, \qquad I_{s,rms} = 9.5 \times \sqrt{0.475/3} = 3.78\ \text{A}

These secondary values are slightly pessimistic, because they assume the full input power reaches the secondary.

Step 7: core size by area product

The area product method sizes the core from the energy it must store and the copper it must hold:

Ap=AeAw=LmIpkIp,rmsBmaxJKuA_p = A_e A_w = \frac{L_m I_{pk} I_{p,rms}}{B_{max} J K_u}

Take Bmax=0.25B_{max} = 0.25 T for a power ferrite at 100 kHz, a current density J=4J = 4 A/mm², and a window share Ku=0.25K_u = 0.25 for the primary (the secondary, insulation and margins take the rest):

Ap=400 μ×1.19×0.470.25×4×106×0.25≈9.0×10−10 m4=900 mm4A_p = \frac{400\,\mu \times 1.19 \times 0.47}{0.25 \times 4 \times 10^{6} \times 0.25} \approx 9.0 \times 10^{-10}\ \text{m}^4 = 900\ \text{mm}^4

Pick a core above this with room for safety insulation. For the rest of the example, suppose the chosen core has Ae=32A_e = 32 mm² and a window larger than 28 mm² (the minimum that satisfies ApA_p).

Step 8: turns

The primary turns keep the peak flux density below BmaxB_{max}:

Np≥LmIpkBmaxAe=400 μ×1.190.25×32 μ=59.5N_p \ge \frac{L_m I_{pk}}{B_{max} A_e} = \frac{400\,\mu \times 1.19}{0.25 \times 32\,\mu} = 59.5

Choose Np=64N_p = 64 and Ns=Np/n=8N_s = N_p / n = 8. The peak flux density is then 400 μ×1.19/(64×32 μ)=0.232400\,\mu \times 1.19 / (64 \times 32\,\mu) = 0.232 T.

Step 9: air gap

The inductance factor is

AL=LmNp2=400 μH4096=97.7 nH/turn2A_L = \frac{L_m}{N_p^2} = \frac{400\,\mu\text{H}}{4096} = 97.7\ \text{nH/turn}^2

Neglecting fringing and the core's own reluctance, the gap length is

lg≈μ0Np2AeLm=4π×10−7×4096×32×10−6400×10−6=0.41 mml_g \approx \frac{\mu_0 N_p^2 A_e}{L_m} = \frac{4\pi \times 10^{-7} \times 4096 \times 32 \times 10^{-6}}{400 \times 10^{-6}} = 0.41\ \text{mm}

Fringing makes the effective gap area larger than AeA_e, so the measured inductance comes out higher. In practice you order the gapped core by its ALA_L value and trim on the bench.

Step 10: wire, leakage and clamp

Wire. The primary needs 0.47/4=0.120.47 / 4 = 0.12 mm², a round wire of about 0.39 mm. The skin depth of copper at 100 kHz is about 66/f66/\sqrt{f} mm =0.21= 0.21 mm, so a single 0.39 mm strand is acceptable. The secondary's 3.78 A RMS needs about 0.95 mm², which should be several parallel strands or litz wire. Interleaving the primary around the secondary reduces both leakage and proximity loss.

Leakage and clamp. The leakage inductance does not couple to the secondary, so its energy must go somewhere at turn-off. An RCD clamp absorbs it. With leakage at 1 % of LmL_m (Llk=4L_{lk} = 4 µH) and a clamp voltage Vcl=150V_{cl} = 150 V:

Pclamp=12LlkIpk2fswVclVcl−VOR=12×4 μ×1.41×100k×15050=0.85 WP_{clamp} = \frac{1}{2} L_{lk} I_{pk}^2 f_{sw} \frac{V_{cl}}{V_{cl} - V_{OR}} = \frac{1}{2} \times 4\,\mu \times 1.41 \times 100\text{k} \times \frac{150}{50} = 0.85\ \text{W}

That is 3.5 % of the output power, which is why low leakage matters. The MOSFET peak is 375+150=525375 + 150 = 525 V before ringing, inside the 650 V rating.

Two switching periods of this flyback at low line, simulated in Voltecx: the primary current i(S1), the secondary current i(D1) and the drain voltage v(drain).

A simulated check. The design was simulated in Voltecx at low line: 100 V input, D=0.475D = 0.475, Lm=400L_m = 400 µH, n=8n = 8, 1 % leakage, a 0.5 V rectifier and an RCD clamp. It runs in DCM as intended, with idle time in every period. The primary current peaks at 1.10 A rather than 1.19 A: during the idle time the drain rings (the magnetising inductance with the switch's capacitance), and the next on-time starts from a small negative current. The secondary peaks at 11.2 A, and its current and the drain voltage ring with the leakage inductance. With the clamp resistor sized for 0.85 W at 150 V (26.5 kΩ), the clamp settles at 135 V and the resistor takes 0.69 W, so the clamp-loss formula errs on the safe side here.

What to verify next

  • Run the design at high line, where the duty cycle is smallest and the switch voltage highest.
  • Check that the peak flux density stays below saturation at the hottest core temperature, since ferrite saturation flux falls with temperature.
  • Estimate core loss from the manufacturer's loss curves at the actual flux swing and frequency, and copper loss including AC resistance.

The method follows the energy-storage design of coupled inductors in R. W. Erickson and D. Maksimović, Fundamentals of Power Electronics, 3rd ed., in its chapters on inductor and transformer design. Core and material data come from the manufacturer's data sheet.

Try it in Voltecx

  • The flyback and flybackClosedLoop examples show an open-loop and a closed-loop flyback with a coupled inductor.
  • magnetics.design designs an inductor or transformer from its simulated current: core, material, gap, turns and wire. A coupled part is checked on its magnetising current.
  • design.auto with "topology": "flyback" draws a flyback, designs its magnetics, closes the loop over the input and load corners and, for an isolated design, sizes a TL431 and optocoupler feedback network.

magnetics.design searches the OpenMagnetics MAS starter set, which is a subset of cores, materials and wires. Its temperature rise is a natural-convection estimate, and saturation is modelled as two straight slopes. Confirm the chosen core, gap and wire against the manufacturer's data sheet.