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

Size a flyback's RCD clamp by choosing the clamp voltage VcV_c above the reflected voltage VorV_{or} (typically 1.5 to 2.5 times it), then the resistor dissipates P=12LkIpk2fsw Vc/(Vc−Vor)P = \frac{1}{2} L_k I_{pk}^2 f_{sw}\, V_c/(V_c - V_{or}), so Rc=Vc2/PR_c = V_c^2/P, and the capacitor sets the ripple, ΔVc≈Vc/(RcCcfsw)\Delta V_c \approx V_c/(R_c C_c f_{sw}). For a 48 V to 12 V, 24 W, 100 kHz flyback with 7.7 µH of leakage and a 1.375 A peak, a 64 V clamp gives 1.46 W, 2.81 kΩ and 71 nF; simulated, the clamp settles at 59.9 V and the resistor takes 1.28 W, and the formula stays within 2 % of the simulation when it is given the simulated peak current and reflected voltage.

This article explains why the clamp is needed, how to choose its voltage, where the formula comes from and where it stops being accurate, what the capacitor does, and when a TVS diode is the better clamp. The numbers come from Voltecx runs, checked by a test in the Voltecx source.

Why a flyback needs a clamp

A flyback transformer is a coupled inductor: while the switch is on, the primary stores energy in the magnetising inductance; when it turns off, the secondary diode conducts and the energy goes to the output. The coupling is never perfect. A part of the primary inductance, the leakage inductance LkL_k, is not coupled to the secondary, and its current IpkI_{pk} at turn-off has nowhere to go: it cannot jump to the secondary.

Without a clamp, the leakage current charges the switch's output capacitance and the drain rises until the switch avalanches. With an RCD clamp, the drain rises only until the clamp diode conducts at Vin+VcV_{in} + V_c; the leakage current then flows into the clamp capacitor and falls at the rate (Vc−Vor)/Lk(V_c - V_{or})/L_k, while the secondary current rises. The clamp capacitor holds VcV_c and the resistor bleeds the energy off between pulses.

Erickson and Maksimović (Fundamentals of Power Electronics, 3rd ed., chapter 6) derive the flyback; C. Basso, Switch-Mode Power Supplies: SPICE Simulations and Practical Designs, 2nd ed., chapter 7, covers the clamp in practice; and Fairchild Semiconductor's application note AN-4147, Design Guidelines for RCD Snubber of Flyback Converters, gives the formulas used below (its equations 3 to 5).

The circuit

The example is the flyback template of Voltecx (circuit.template with {"topology":"flyback","vin":48,"vout":12,"iout":2,"fsw":100e3}): 48 V to 12 V at 2 A, 100 kHz, duty cycle 0.4, continuous conduction. The template computes:

  • the turns ratio n=Ns/Np=Vout(1−D)/(VinD)=0.375n = N_s/N_p = V_{out}(1-D)/(V_{in} D) = 0.375, so the reflected voltage is Vor=Vout/n=32V_{or} = V_{out}/n = 32 V;
  • the magnetising current ILm=nIout/(1−D)=1.25I_{Lm} = n I_{out}/(1-D) = 1.25 A with a 20 % ripple of 0.25 A, so the primary peak is Ipk=1.375I_{pk} = 1.375 A;
  • the primary inductance L1L_1 = 771.9 µH and a coupling of kk = 0.995, so the leakage is Lk=(1−k2)L1=7.70L_k = (1-k^2) L_1 = 7.70 µH;
  • an ideal switch with 340 pF across it, a 10 mΩ clamp diode, and the clamp RsnR_{sn} and CsnC_{sn} from the clamp voltage Vc=2Vor=64V_c = 2 V_{or} = 64 V.

The flyback template at 48 V to 12 V, 2 A: the RCD clamp Dsn, Csn and Rsn from the drain to the input, the coupled inductor T1, the switch S1 driven by the label g, and the output rectifier D1.

The runs last 8 ms on the template's fixed 50 ns step, long enough for the clamp to settle (its time constant is at most 1.6 ms in the sweeps), and the measurements use the last 0.2 ms.

Choosing the clamp voltage

The clamp voltage is a trade-off between the switch's voltage rating and the clamp's loss:

  • The switch sees Vin,max+VcV_{in,max} + V_c plus a small overshoot. Here 48+64=11248 + 64 = 112 V, so a 150 V MOSFET has margin.
  • The clamp must stay above the reflected voltage, or it would conduct the magnetising energy that belongs to the output. As VcV_c approaches VorV_{or}, the leakage current falls slowly (its rate is (Vc−Vor)/Lk(V_c - V_{or})/L_k), the secondary takes over slowly, and the clamp takes energy from the input as well as the leakage.

That is the factor Vc/(Vc−Vor)V_c/(V_c - V_{or}) in the loss formula. At Vc=2VorV_c = 2V_{or} the clamp dissipates twice the leakage energy; at Vc=1.5VorV_c = 1.5 V_{or}, three times; at Vc=3VorV_c = 3 V_{or}, 1.5 times. Most designs settle between 1.5 and 2.5 times VorV_{or}, and the template uses 2.

The formula

During the clamp interval the leakage current falls linearly from IpkI_{pk} to zero in

ts=LkIpkVc−Vort_s = \frac{L_k I_{pk}}{V_c - V_{or}}

and the clamp receives Vc⋅12IpktsV_c \cdot \frac{1}{2} I_{pk} t_s per period. Per second:

P=12LkIpk2fsw⋅VcVc−VorP = \frac{1}{2} L_k I_{pk}^2 f_{sw} \cdot \frac{V_c}{V_c - V_{or}}

For the example:

12LkIpk2fsw=12×7.70 μH×(1.375 A)2×100 kHz=0.728 W\frac{1}{2} L_k I_{pk}^2 f_{sw} = \frac{1}{2} \times 7.70\,\mu\text{H} \times (1.375\ \text{A})^2 \times 100\ \text{kHz} = 0.728\ \text{W}
P=0.728×6464−32=1.456 W,Rsn=Vc2P=6421.456=2.81 kΩP = 0.728 \times \frac{64}{64 - 32} = 1.456\ \text{W}, \qquad R_{sn} = \frac{V_c^2}{P} = \frac{64^2}{1.456} = 2.81\ \text{k}\Omega

The capacitor is chosen for the ripple of the clamp voltage. It is charged once per period and discharges through RsnR_{sn} for nearly a whole period:

ΔVc≈VcRsnCsnfsw⇒Csn=VcΔVcRsnfsw\Delta V_c \approx \frac{V_c}{R_{sn} C_{sn} f_{sw}} \quad\Rightarrow\quad C_{sn} = \frac{V_c}{\Delta V_c R_{sn} f_{sw}}

For a 5 % ripple, ΔVc=3.2\Delta V_c = 3.2 V and Csn=1/(0.05×2.81 k×100 k)=71.1C_{sn} = 1/(0.05 \times 2.81\,\text{k} \times 100\,\text{k}) = 71.1 nF.

What the simulation shows

Two periods in steady state: the drain voltage, the primary current i(T1.1) and the clamp diode's current i(Dsn), and the clamp voltage (Rsn's current times Rsn). The clamp diode takes the leakage current at each turn-off; the clamp voltage jumps by its ripple and decays until the next one.

At the designed values the clamp settles at 59.9 V and its resistor takes 1.28 W, both below the design's 64 V and 1.456 W. The drain peaks at 108.7 V. After the clamp diode stops, the drain rings around Vin+VorV_{in} + V_{or}: the leakage inductance against the switch's 340 pF.

Two things in the simulation differ from the design's assumptions:

  • the primary current peaks at 1.32 A, not 1.375 A, and
  • the output sits at 11.2 V, not 12 V: the template runs open loop at D = 0.4, and its source has 0.96 Ω, so the reflected voltage is 11.22/0.375=29.911.22/0.375 = 29.9 V.

Given those two, the formula gives 60.9 V, 1.7 % above the simulated 59.9 V. The design formula is on the safe side: it overestimates the loss and the clamp voltage, which is what you want for choosing the resistor's rating and the switch's.

The ripple is 2.91 V against the formula's 3.00 V, 3 % below it.

Sweeping the resistor

Changing RsnR_{sn} moves the clamp voltage: with more resistance the capacitor must charge higher before the resistor bleeds off the energy. Solving the formula for VcV_c:

Vc2R=WVcVc−Vor⇒Vc=Vor2+Vor24+RW\frac{V_c^2}{R} = W \frac{V_c}{V_c - V_{or}} \quad\Rightarrow\quad V_c = \frac{V_{or}}{2} + \sqrt{\frac{V_{or}^2}{4} + R W}

with W=12LkIpk2fswW = \frac{1}{2} L_k I_{pk}^2 f_{sw}. Against the simulation (the formula with the simulated peak and reflected voltage at each point):

RsnR_{sn} VcV_c, Voltecx Loss, Voltecx Formula below simulation by
0.7 kΩ 41.9 V 2.51 W 0.9 %
1.4 kΩ 49.6 V 1.76 W 1.0 %
2.81 kΩ 59.9 V 1.28 W 1.7 %
5.6 kΩ 76.5 V 1.05 W 3.2 %
11.2 kΩ 95.5 V 0.82 W 8.4 %
22.4 kΩ 118.1 V 0.62 W 14.9 %

(The last column is how far the simulated clamp voltage is below the formula's.)

The clamp voltage and the clamp resistor's loss against Rsn: the formula with the simulated peak current and reflected voltage, and the Voltecx runs. The marker is the design's 2.81 kΩ; the line at 32 V is the reflected voltage.

Up to about twice the reflected voltage, the formula is within 2 %. At higher clamp voltages it overestimates more and more: at 118.1 V the simulated clamp is 15 % below it and the resistor takes 0.62 W, less than the leakage energy alone (0.67 W at the simulated peak). The formula assumes all the leakage energy reaches the clamp. In the circuit, the switch's output capacitance takes part of it on the way: the drain must charge from Vin+VorV_{in} + V_{or} to Vin+VcV_{in} + V_c before the clamp diode conducts, and that capacitive energy grows with VcV_c; it later rings back. Cutting the switch's capacitance from 340 pF to 20 pF at 22.4 kΩ reduces the gap from 15 % to 4 %. The remaining 4 % comes from the formula's other simplifications, such as the secondary current that starts to flow while the drain is still rising.

For design this is good news: at the usual 1.5 to 2.5 times VorV_{or} the formula is accurate, and above that it errs on the safe side.

Sweeping the capacitor

At 2.81 kΩ, changing CsnC_{sn} hardly moves the mean clamp voltage but sets its ripple:

CsnC_{sn} Ripple, Voltecx Vc/(RCfsw)V_c/(R C f_{sw})
10 nF 20.5 V 21.2 V
22 nF 9.37 V 9.66 V
71.1 nF 2.91 V 3.00 V
220 nF 0.94 V 0.97 V

The ripple of the clamp voltage against Csn at Rsn = 2.81 kΩ: the formula and the Voltecx runs, 3 % apart.

The ripple matters because the drain peak follows the top of it: with 10 nF the drain reaches 117.6 V instead of 108.7 V. A capacitor too small wastes the switch's voltage margin; one too large only costs board area and slows the clamp's response at start-up and in load steps. The clamp capacitor carries the leakage current pulses, so use a part rated for pulse current (film or C0G ceramic).

A TVS clamp

A TVS diode (or a Zener) clamps at a fixed voltage instead of one set by a resistor and the leakage energy. Voltecx's flybackTvsClamp example shows it on a small flyback: 12 V in, a 1:1 coupled inductor of 50 µH with kk = 0.95 (so Lk=(1−k2)L1=4.9L_k = (1-k^2) L_1 = 4.9 µH), 100 kHz at D = 0.4, an RCD clamp with a deliberately large 100 kΩ resistor, and a Vishay SMBJ24A across the resistor (document 88392, revision 09-Jan-2024: stand-off 24 V, breakdown 26.7 to 29.5 V, 38.9 V at 15.4 A).

  • With the TVS, the clamp stays between 27.6 V and 32.2 V (mean 28.4 V), the drain peaks at 44.2 V (12+32.212 + 32.2 V), the TVS carries 0.80 A pulses and takes 0.40 W.
  • Without it, the 100 kΩ resistor cannot bleed the energy until the clamp has climbed to 178 V, most of the way within a millisecond and all of it by about 2 ms, and the drain peaks at 191 V.

The clamp voltage of the flybackTvsClamp example from start-up, with the TVS (held at about 28 V) and without it (climbing to 178 V with 100 kΩ alone).

A TVS clamp holds the drain at a known voltage regardless of the load and the leakage, which an RCD cannot, so it is common in low-power supplies and as the upper limit in parallel with an RCD. Its losses are the same leakage energy times the same Vc/(Vc−Vor)V_c/(V_c - V_{or}) factor, only at a fixed VcV_c, and they heat a small package: check the TVS's average power rating, not only its pulse rating. Its clamping voltage also moves with current and temperature, so the switch's margin must cover the upper end of its range.

Common mistakes

  • A clamp voltage too close to VorV_{or}. The clamp then takes magnetising energy as well, the loss grows steeply, and the efficiency falls.
  • Forgetting the input voltage. The switch sees Vin+VcV_{in} + V_c; at high line it is the input that sets the switch's rating.
  • Sizing at the nominal point only. The leakage energy grows with the square of the peak current; size the clamp where the peak is highest. Voltecx's design flow sizes it at the highest input and full load.
  • A slow clamp diode. Use an ultrafast diode: during its reverse recovery the clamp capacitor discharges back into the leakage.
  • Using the formula far above 2Vor2V_{or}. It overestimates there; at high clamp voltages simulate it.

How to do it in Voltecx

  1. Build the flyback with circuit.template and {"topology":"flyback","vin":48,"vout":12,"iout":2,"fsw":100e3}; its reply lists the design values with their formulas, among them Llk, Vsn, Psn, Rsn and Csn.
  2. Set Simulation › Settings (simulation.settings) tEnd to 8 ms and run (Simulation › Run Simulation, simulation.run).
  3. Measure over the last 0.2 ms with Scope › Measurements (scope.measure): the mean of i(Rsn) times RsnR_{sn} is the clamp voltage, its RMS squared times RsnR_{sn} is the loss, and the maximum of i(T1.1) is the primary peak.
  4. Sweep Rsn.r or Csn.c with Analysis › Parameter Sweep (analysis.paramSweep).
  5. Open File › Open Example › flybackTvsClamp (Power quality) for the TVS clamp.
  6. The automatic design (design.auto) re-sizes the clamp with the designed transformer's own leakage at the highest input and full load.

The numbers are checked by the_rcd_post_clamp_voltage_and_loss_match_the_formula and the_rcd_post_tvs_caps_the_clamp_voltage in crates/engine/src/auto/tests_blog.rs. The transformer side of the same design is in flyback transformer design, step by step.

Frequently asked questions

What clamp voltage should a flyback RCD clamp have?

Between about 1.5 and 2.5 times the reflected voltage Vor=VoutNp/NsV_{or} = V_{out} N_p/N_s, and low enough that Vin,max+VcV_{in,max} + V_c plus an overshoot stays inside the switch's rating. At 2Vor2V_{or} the clamp dissipates twice the leakage energy.

How do I calculate the RCD clamp resistor?

Compute the clamp power P=12LkIpk2fswVc/(Vc−Vor)P = \frac{1}{2} L_k I_{pk}^2 f_{sw} V_c/(V_c - V_{or}) at the highest peak current, then R=Vc2/PR = V_c^2/P. In the example, 1.456 W at 64 V gives 2.81 kΩ.

How do I size the clamp capacitor?

For the ripple you accept: C=Vc/(ΔVcRfsw)C = V_c/(\Delta V_c R f_{sw}). A 5 % ripple on 64 V with 2.81 kΩ at 100 kHz needs 71 nF. The simulated ripple is 3 % below the formula.

Why is my clamp voltage lower than calculated?

The formula assumes the whole leakage energy reaches the clamp. Part of it charges the switch's capacitance, and part goes to the secondary while the drain is still rising, so the clamp settles lower, increasingly so at high clamp voltages. In the example the clamp is 1.7 % below the formula at the design point and 15 % below it at 22.4 kΩ.

RCD or TVS clamp?

An RCD clamp's voltage floats with the load and the leakage; a TVS holds a fixed voltage. A TVS gives a predictable switch stress and suits low power; an RCD spreads the loss over a resistor and suits higher power. Many designs use an RCD with a TVS as the upper limit.