# Flyback transformer design in ten steps, with a worked example

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 $V_{in,min} = 100$ V and the peak at high line as $V_{in,max} = 375$ V.
- Output: $V_{out} = 12$ V at $I_{out} = 2$ A, so $P_{out} = 24$ W.
- Switching frequency: $f_{sw} = 100$ kHz.
- Expected efficiency: $\eta = 0.85$.
- Switch: a 650 V MOSFET. Output rectifier forward drop: $V_f = 0.5$ V.

## Step 1: input power

$$P_{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 $V_{OR} = n (V_{out} + V_f)$. The MOSFET then sees

$$V_{DS,max} = V_{in,max} + V_{OR} + V_{spike}$$

A higher $V_{OR}$ gives a larger duty cycle and lower primary currents, but more voltage stress. Take $V_{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 = \frac{N_p}{N_s} = \frac{V_{OR}}{V_{out} + V_f} = \frac{100}{12.5} = 8$$

The rectifier diode then blocks $V_{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

$$D_{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

$$I_{in} = \frac{P_{in}}{V_{in,min}} = 0.282\ \text{A}, \qquad I_{pk} = \frac{2 I_{in}}{D_{max}} = 1.13\ \text{A}$$

$$L_{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 $L_m$ below this keeps the converter in DCM. Choose $L_m = 400$ µH. In DCM the energy per cycle sets the peak current:

$$I_{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 = \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 $D_2 = D \cdot V_{in,min}/V_{OR} = 0.475$ of the period. Since $D + 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 $I_{pk}$ and duty $D$, the RMS value is $I_{pk}\sqrt{D/3}$:

$$I_{p,rms} = 1.19 \times \sqrt{0.475/3} = 0.47\ \text{A}$$

$$I_{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:

$$A_p = A_e A_w = \frac{L_m I_{pk} I_{p,rms}}{B_{max} J K_u}$$

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

$$A_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 $A_e = 32$ mm² and a window larger than 28 mm² (the minimum that satisfies $A_p$).

## Step 8: turns

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

$$N_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 $N_p = 64$ and $N_s = N_p / n = 8$. The peak flux density is then $400\,\mu \times 1.19 / (64 \times 32\,\mu) = 0.232$ T.

## Step 9: air gap

The inductance factor is

$$A_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

$$l_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 $A_e$, so the measured inductance comes out higher. In practice you order the gapped core by its $A_L$ value and trim on the bench.

## Step 10: wire, leakage and clamp

**Wire.** The primary needs $0.47 / 4 = 0.12$ mm², a round wire of about 0.39 mm. The skin depth of copper at 100 kHz is about $66/\sqrt{f}$ mm $= 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 $L_m$ ($L_{lk} = 4$ µH) and a clamp voltage $V_{cl} = 150$ V:

$$P_{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 = 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).](https://voltecx-web.nguyenvanqui291.workers.dev/media/blog/flyback-transformer-design-steps/winding-currents.svg)

**A simulated check.** The design was simulated in Voltecx at low line: 100 V input, $D = 0.475$, $L_m = 400$ µH, $n = 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.
