A QR flyback converter (quasi-resonant flyback) is the power supply inside most phone chargers, laptop adapters, TV standby supplies and LED drivers. It converts the AC mains (85 to 265 Vac) into an isolated low-voltage DC output with just one MOSFET and a transformer. What makes it “quasi-resonant” is valley switching: instead of turning the MOSFET on at a fixed time, the controller waits until the drain voltage rings down to its lowest point, which cuts turn-on switching loss and EMI. In this guide you will learn QR flyback converter analysis and design step by step: how a flyback works, how quasi-resonant valley switching and valley hopping work, how to choose the reflected voltage, how to design the transformer (Lp, turns ratio, turns and gap), how to size the bulk and output capacitors, the RCD clamp, the sense resistor, and how to estimate losses and efficiency. A complete worked example and a live calculator are included.
- A flyback is an isolated buck-boost: the transformer stores energy while the MOSFET is on and releases it to the output while it is off.
- QR operation runs at the boundary of CCM and DCM and turns the MOSFET on at a valley of the drain ringing.
- The valley voltage is about Vin − VR. When VR is above Vin, the drain rings to 0 V and you get zero-voltage switching.
- Switching frequency varies with line and load. Controllers use valley hopping and burst mode to limit it at high line and light load.
- The MOSFET must withstand Vin(max) + Vclamp, and the reflected voltage VR sets the balance between MOSFET and diode stress.
- Leakage inductance energy goes to the RCD clamp, so good transformer construction matters as much as the circuit.
What Is a QR Flyback Converter?
A flyback converter is the isolated version of the inverting buck-boost converter. The single inductor is replaced by a coupled inductor (usually called a flyback transformer) with a primary and a secondary winding. The windings provide galvanic isolation between the dangerous mains side and the safe low-voltage output, and the turns ratio lets the converter step 300 V down to 12 V or 5 V without extreme duty cycles.
A flyback can run in three ways:
- Fixed-frequency CCM: the transformer never fully empties. Lower peak current, but a hard turn-on and a right-half-plane zero.
- Fixed-frequency DCM: the transformer empties, then the drain rings until the next fixed clock edge, which may land on a peak or a valley.
- Quasi-resonant (QR): the controller detects when the transformer is empty and turns the MOSFET on at the bottom (valley) of the ringing. The frequency varies, but turn-on loss and EMI drop sharply.
QR flyback controllers are cheap, widely available and simple to use, which is why the QR flyback dominates chargers and adapters from about 5 W to 75 W.
How a Flyback Converter Works
1. MOSFET ON: storing energy
Q1 connects the primary across the bulk capacitor voltage Vin. Because of the winding dots, the secondary voltage reverse biases the output diode, so no current flows in the secondary. The primary current rises linearly, Ip = Vin × t / Lp, and energy builds up in the transformer’s air gap: E = ½ × Lp × Ipk². Meanwhile the output capacitor alone feeds the load.
2. MOSFET OFF: delivering energy
When Q1 turns off, the transformer voltage reverses. The output diode turns on and the stored energy flows out through the secondary into the output. The secondary clamps its voltage to Vout + Vf, and that voltage is reflected back to the primary as VR = n × (Vout + Vf), where n = Np / Ns. The drain therefore sits at Vin + VR while the secondary conducts.
At the instant of turn-off, the leakage inductance (the part of the primary inductance not coupled to the secondary) cannot transfer its energy to the output. It drives the drain to a spike that the RCD clamp catches at Vin + Vclamp.
3. Ringing: the transformer is empty
When the secondary current reaches zero, nothing holds the drain at Vin + VR anymore. The primary inductance Lp resonates with the total drain capacitance Cd (MOSFET Coss, winding capacitance and the clamp diode), and the drain voltage rings around Vin with an amplitude of VR:
Vds(t) = Vin + VR × cos(t / √(Lp × Cd)), time to the first valley tv = π × √(Lp × Cd)This ringing is where the quasi-resonant controller makes its move.
Quasi-Resonant Operation and Valley Switching
Every time a MOSFET turns on, it discharges its drain capacitance through its own channel, wasting ½ × Cd × V² per cycle. In a fixed-frequency flyback, V can be as high as Vin + VR, around 400 V at high line. A QR controller senses the ringing, usually through an auxiliary winding connected to a zero-current detect (ZCD) pin, and turns Q1 on at a valley, where:
Vvalley ≈ Vin − VR- At high line (Vin ≈ 310 V, VR = 100 V), the valley is about 210 to 230 V. Turn-on loss drops by roughly 70% compared with hard switching at 400 V.
- At low line (Vin ≈ 100 V), the valley is near 0 V. When VR ≥ Vin, the drain rings all the way to zero and the body diode conducts, giving zero-voltage switching (ZVS).
Variable frequency and valley hopping
Because Q1 turns on whenever the transformer empties, the frequency depends on the operating point:
T = ton + toff + tring = Lp × Ipk / Vin + Lp × Ipk / VR + (2k − 1) × tv, Pin = ½ × Lp × Ipk² × fAs the load drops or the line rises, Ipk falls and the frequency rises. To stop it climbing too high, controllers skip valleys: if switching at valley 1 would exceed the maximum frequency (often 100 to 150 kHz), they wait for valley 2, 3, 4 and so on. This is called valley hopping or valley lockout. At very light load they switch to burst mode, firing a few pulses and then pausing, to keep standby power under regulations such as the 75 mW to 100 mW no-load targets.
QR Flyback Design Equations
| Parameter | Formula | Notes |
|---|---|---|
| Output and input power | Pout = Vout × Iout, Pin = Pout / η | Assume η ≈ 0.85 to start |
| Bulk capacitor minimum voltage | Vmin = √(2 × Vac(min)² − 2 × Pin × (1 / (2 × fline) − tc) / Cbulk) | tc ≈ 3 ms (bridge conduction time) |
| Maximum DC bus | Vin(max) = √2 × Vac(max) | 375 V for 265 Vac |
| Turns ratio | n = Np / Ns = VR / (Vout + Vf) | VR usually 80 to 130 V for 650 V MOSFETs |
| Ring time to first valley | tv = π × √(Lp × Cd) | Cd = Coss + winding capacitance |
| Switching period | T = Lp Ipk (1/Vin + 1/VR) + (2k − 1) tv | k = valley number |
| Energy balance | Pin = ½ × Lp × Ipk² × f | Solve with T at Vmin, full load, fmin |
| Duty cycle | D = ton / T = Lp × Ipk / (Vin × T) | Largest at low line |
| Primary RMS current | Ip(rms) = Ipk × √(D / 3) | Triangular pulse |
| Secondary peak and RMS | Is(pk) = n × Ipk, Is(rms) = Is(pk) × √(toff / (3 T)) | Sets diode and Cout ripple |
| Primary turns | Np ≥ Lp × Ipk / (Bmax × Ae) | Bmax ≈ 0.25 to 0.3 T for ferrite |
| Gapped core AL | AL = Lp / Np² | Order the core with this gap |
| MOSFET peak voltage | Vds(pk) = Vin(max) + Vclamp + ringing | Keep below about 85 to 90% of rating |
| Output diode reverse voltage | Vr = Vin(max) / n + Vout | Add 30% margin |
| Clamp loss | Pclamp = ½ × Llk × Ipk² × f × Vcl / (Vcl − VR) | Vcl ≈ 1.5 to 2 × VR |
| Valley turn-on loss | Pon = ½ × Cd × Vvalley² × f | Vvalley ≈ Vin − VR |
| Sense resistor | Rcs = Vcs(limit) / (1.1 to 1.2 × Ipk) | Sets the power limit |
| Output capacitor | Cout ≥ Iout × (T − toff) / ΔVcap, ESR ≤ ΔVesr / Is(pk) | ESR usually dominates |
QR Flyback Design Example: 85–265 Vac to 12 V, 2 A (24 W)
Let us design a 24 W universal-input adapter. The same values are loaded in the live calculator below.
| Specification | Value |
|---|---|
| AC input | 85 to 265 Vac, 60 Hz |
| Output | 12 V, 2 A (24 W) |
| Design efficiency | 85% |
| Bulk capacitor | 47 µF, 400 V |
| Reflected voltage VR | 100 V |
| Minimum frequency (low line, full load) | 65 kHz |
| Maximum frequency (valley hopping limit) | 130 kHz |
| Drain node capacitance Cd | 150 pF |
| Leakage inductance | 1% of Lp |
| Core | EF25-class, Ae = 52 mm², Bmax = 0.3 T |
| MOSFET | 650 V, 1.2 Ω |
Step 1: Bulk capacitor voltage
Pin = 24 / 0.85 = 28.2 W, Vmin = √(2 × 85² − 2 × 28.2 × (8.33 ms − 3 ms) / 47 µF) = 90 V, Vin(max) = √2 × 265 = 375 VThe bus sags to 90 V in the valley of the line cycle at 85 Vac. The universal-input rule of thumb is 2 to 3 µF per watt, so 47 µF is on the lean side but workable. A larger capacitor lowers the low-line RMS currents.
Step 2: Turns ratio from the reflected voltage
n = VR / (Vout + Vf) = 100 / (12 + 0.5) = 8Step 3: Primary inductance and peak current
At the worst case (90 V bus, full load, first valley, 65 kHz), solving T = Lp Ipk (1/Vin + 1/VR) + tv together with Pin = ½ Lp Ipk² f gives:
Lp = 540 µH, Ipk = 1.27 A, tv = π √(540 µH × 150 pF) = 0.89 µsStep 4: Turns and gap
Np ≥ 540 µH × 1.27 A / (0.3 T × 52 mm²) = 44 turns, Ns = ⌈44 / 8⌉ = 6, Np = 48, AL = 540 µH / 48² = 234 nH/turn²Order the core gapped for about 234 nH/turn². Interleave the windings (half primary, secondary, half primary) to keep leakage near 1% of Lp.
Step 5: MOSFET and clamp
Vclamp = 1.5 × 100 = 150 V, Vds(pk) = 375 + 150 = 525 V (+ about 20 V ringing) → 84% of 650 VA 650 V MOSFET has comfortable margin. At 220 Vac and full load the clamp absorbs about 0.81 W, so the clamp resistor is about 28 kΩ (rated 1 W or more), the clamp capacitor at least 3.5 nF, and the clamp diode a fast or ultrafast 650 V+ part.
Step 6: Output diode
Vr = 375 / 8 + 12 = 59 V → 80 V or 100 V part, Is(pk) up to 10 A at low lineA 100 V Schottky is a common choice. At 2 A it dissipates about 1 W, the largest single loss, which is why higher-current adapters use synchronous rectification with a secondary MOSFET.
Step 7: Current-sense resistor
Rcs = 0.8 V / (1.15 × 1.27 A) = 0.55 Ω → 0.51 ΩThe sense resistor sets the maximum peak current, and therefore the maximum power the supply can deliver before current limiting.
Step 8: Output capacitor
Cout ≥ 228 µF, ESR ≤ 7.4 mΩ, ripple current ≈ 3.4 A rmsUse 330 µF low-ESR polymer (or two 470 µF low-ESR electrolytics plus a small LC post-filter). The secondary delivers pulses of up to 8 to 10 A, so the ripple current rating matters more than the capacitance.
Step 9: Check the operating points
| Input | DC bus (avg) | Valley | Frequency | Valley voltage | Duty | Efficiency |
|---|---|---|---|---|---|---|
| 85 Vac, 2 A | 105 V | 1 | 78 kHz | 13 V (near ZVS) | 45% | 88.6% |
| 220 Vac, 2 A | 306 V | 2 | 102 kHz | 227 V | 18% | 88.6% |
At 220 Vac the first valley would exceed the 130 kHz limit, so the controller hops to valley 2.
QR Flyback Loss and Efficiency Analysis
| Loss source | 85 Vac | 220 Vac |
|---|---|---|
| MOSFET conduction | 233 mW | 70 mW |
| MOSFET turn-on (valley) | 1 mW | 397 mW |
| MOSFET turn-off | 182 mW | 411 mW |
| RCD clamp (leakage) | 813 mW | 813 mW |
| Output diode | 1.00 W | 1.00 W |
| Transformer copper | 209 mW | 138 mW |
| Bridge rectifier | 462 mW | 159 mW |
| Sense resistor, gate drive, ESR | 186 mW | 108 mW |
| Total | 3.08 W | 3.10 W |
| Efficiency | 88.6% | 88.6% |
The loss pattern changes with line voltage. At low line, the MOSFET switches at almost 0 V, but conduction and bridge losses are high because the currents are larger. At high line, conduction loss is small, but switching losses rise because the valley is at 227 V. The output diode and the clamp are the two biggest losses at both ends. Core loss and controller standby power are not included, so expect a real adapter to land around 86 to 88%.
Choosing the Reflected Voltage VR
VR is the single most important design choice in a flyback. It sets the turns ratio and trades stress between the primary and secondary:
| Higher VR (e.g. 120 to 130 V) | Lower VR (e.g. 70 to 90 V) |
|---|---|
| Higher MOSFET voltage (needs 700 to 800 V parts) | Lower MOSFET voltage |
| Lower output diode reverse voltage | Higher output diode reverse voltage |
| Higher duty cycle, lower primary RMS current | Lower duty cycle, higher primary RMS current |
| Deeper valleys, ZVS over more of the line range | Shallower valleys, more turn-on loss |
| Less clamp loss for a given leakage | More clamp loss |
For a 650 V MOSFET on universal input, VR between 90 and 110 V is the usual sweet spot: 375 V + 1.5 × 100 V = 525 V leaves room for ringing.
The RCD Clamp and Leakage Inductance
The leakage inductance Llk stores ½ × Llk × Ipk² every cycle, and none of it reaches the output. Without a clamp, it would ring the drain far above the MOSFET’s rating. The RCD clamp diode catches the spike and dumps the energy into the clamp capacitor, and the resistor burns it off. Because the clamp also pulls some energy from the magnetizing inductance while it conducts, the loss is multiplied by Vcl / (Vcl − VR):
Pclamp = ½ × Llk × Ipk² × f × Vcl / (Vcl − VR)A lower clamp voltage wastes more power, while a higher one stresses the MOSFET. Vcl of 1.5 to 2 × VR is typical. The best fix is a transformer with low leakage: interleaved windings, a well-filled window and minimal insulation margin tape where safety rules allow.
Feedback, Control and Protection
- Feedback: a TL431 shunt regulator on the secondary drives an optocoupler LED. The optocoupler transistor pulls the controller’s feedback pin, carrying the error signal across the isolation barrier.
- Current-mode control: the controller compares the sense-resistor voltage with the feedback level each cycle, giving inherent cycle-by-cycle current limiting.
- ZCD / valley detection: the auxiliary winding mirrors the drain ringing; the controller detects its zero crossing and turns Q1 on at the valley after a short delay.
- Auxiliary winding: it also powers the controller after startup and enables output over-voltage protection.
- Protections: over-current, over-voltage, over-temperature, brown-in/brown-out and output short-circuit protection are standard in modern QR controllers.
Because a QR flyback runs at the boundary of CCM and DCM, it has no right-half-plane zero, so the loop is easier to compensate than a CCM flyback or a boost converter.
QR vs Fixed-Frequency Flyback
| Feature | QR flyback | Fixed-frequency DCM | Fixed-frequency CCM |
|---|---|---|---|
| Frequency | Varies with line and load | Fixed | Fixed |
| MOSFET turn-on | At a valley (or ZVS) | Random point on the ringing | Hard, at Vin + VR |
| Output diode turn-off | Soft (zero current) | Soft (zero current) | Reverse recovery loss |
| Peak current | Higher | Highest | Lowest |
| RHP zero | No | No | Yes |
| EMI | Low and spread out | Medium | Higher |
| Typical use | Chargers and adapters, 5 to 75 W | Low-power auxiliary supplies | Higher power or low-line designs |
PCB Layout and Safety Tips
- Keep the primary loop tiny: bulk capacitor, transformer primary, MOSFET and sense resistor. This loop carries fast current edges.
- Keep the drain node small. It swings by hundreds of volts and is the main EMI source.
- Place the clamp right at the transformer primary and drain.
- Keep the secondary loop tight: secondary winding, output diode and output capacitor.
- Respect creepage and clearance. Keep the required distance (often 6 mm or more for reinforced insulation) across the isolation barrier, including under the optocoupler and the Y capacitor.
- Use a Y capacitor from primary to secondary ground to cut common-mode EMI, within the leakage current limits of your safety standard.
- Test safely. The primary side carries lethal voltages and the bulk capacitor stays charged after unplugging. Use an isolation transformer and discharge the capacitor before touching anything.
Common QR Flyback Design Mistakes
- Choosing VR without checking Vin(max) + Vclamp + ringing against the MOSFET rating.
- Designing Lp at the average bus voltage instead of the bulk capacitor valley at low line.
- Ignoring leakage inductance, then finding the clamp too hot and efficiency too low.
- Saturating the core because Np was chosen without checking Bmax at the maximum peak current.
- Choosing the output capacitor by capacitance and ignoring its ripple current and ESR.
- Forgetting that the frequency rises at high line and light load, pushing it into EMI bands or audible burst noise.
- Violating creepage and clearance across the isolation barrier.
QR Flyback Design Checklist
- Define the AC range, output voltage and current, and target efficiency.
- Choose the bulk capacitor and find Vin(min) at low line and Vin(max) at high line.
- Choose VR and calculate the turns ratio.
- Calculate Lp and Ipk at low line, full load, first valley and the minimum frequency.
- Choose the core, calculate Np, Ns and the gapped AL.
- Check MOSFET voltage: Vin(max) + Vclamp + ringing below about 90% of rating.
- Size the RCD clamp from the leakage inductance.
- Choose the output diode (or synchronous rectifier) and output capacitor.
- Set the sense resistor and check the operating points at low and high line.
- Estimate losses, check temperatures, and lay out with safe creepage and clearance.
Try the Live QR Flyback Design Calculator
Use the calculator below to design your own QR flyback. Enter the AC range, output, bulk capacitor, reflected voltage, frequency limits, core and devices. It designs the transformer (Lp, turns ratio, turns and AL), sizes the bulk and output capacitors, the sense resistor and the RCD clamp, checks MOSFET and diode voltages, finds the valley and frequency at any line and load, breaks down every loss, and animates the live circuit and the drain voltage, primary current, secondary current and output ripple waveforms.
QR Flyback Converter Design Calculator
Universal offline quasi-resonant flyback. Enter your specs, then slide the AC input and load to watch valley switching, valley hopping, losses and the live circuit update.
Live circuit
Switching period
Transformer and component selection
Voltage and current of each device
Power, losses and temperature
Live waveforms
Estimates for first-pass design. Core loss, controller standby power, EMI filter, auxiliary winding and snubber ringing details are not modeled, so expect real efficiency a little lower. Offline converters work with lethal voltages: build and test with an isolation transformer and proper safety precautions, and confirm every value with your controller datasheet and safety standards.
