QR flyback converter schematic with drain voltage ringing and valley switching waveform
Posted in

QR Flyback Converter Design and Analysis: Step-by-Step Guide + Calculator

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.

Key takeaways
  • 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.

AC inBridgeCbulk RCD clampNp:NsLp Q1RcsQR ctrl D Dout+VoutCoutLoad TL431 + optoIsolation barrier
QR flyback converter: bridge rectifier and bulk capacitor, transformer primary with RCD clamp, MOSFET Q1 with current-sense resistor, QR controller, secondary winding with output diode and capacitor, and TL431 plus optocoupler feedback across the isolation barrier. The dots mark winding polarity.

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.

Vds Vin+VclVin+VRVin0 V demagnetizingringingvalley → turn on Primary current Ip0 A Secondary current Is0 A ONOFF
QR flyback waveforms at the second valley. After the clamp spike, the drain sits at Vin + VR while the secondary delivers energy. When the transformer is empty, the drain rings around Vin, and the controller turns Q1 on at a valley.

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² × f

As 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

ParameterFormulaNotes
Output and input powerPout = Vout × Iout, Pin = Pout / ηAssume η ≈ 0.85 to start
Bulk capacitor minimum voltageVmin = √(2 × Vac(min)² − 2 × Pin × (1 / (2 × fline) − tc) / Cbulk)tc ≈ 3 ms (bridge conduction time)
Maximum DC busVin(max) = √2 × Vac(max)375 V for 265 Vac
Turns ration = Np / Ns = VR / (Vout + Vf)VR usually 80 to 130 V for 650 V MOSFETs
Ring time to first valleytv = π × √(Lp × Cd)Cd = Coss + winding capacitance
Switching periodT = Lp Ipk (1/Vin + 1/VR) + (2k − 1) tvk = valley number
Energy balancePin = ½ × Lp × Ipk² × fSolve with T at Vmin, full load, fmin
Duty cycleD = ton / T = Lp × Ipk / (Vin × T)Largest at low line
Primary RMS currentIp(rms) = Ipk × √(D / 3)Triangular pulse
Secondary peak and RMSIs(pk) = n × Ipk, Is(rms) = Is(pk) × √(toff / (3 T))Sets diode and Cout ripple
Primary turnsNp ≥ Lp × Ipk / (Bmax × Ae)Bmax ≈ 0.25 to 0.3 T for ferrite
Gapped core ALAL = Lp / Np²Order the core with this gap
MOSFET peak voltageVds(pk) = Vin(max) + Vclamp + ringingKeep below about 85 to 90% of rating
Output diode reverse voltageVr = Vin(max) / n + VoutAdd 30% margin
Clamp lossPclamp = ½ × Llk × Ipk² × f × Vcl / (Vcl − VR)Vcl ≈ 1.5 to 2 × VR
Valley turn-on lossPon = ½ × Cd × Vvalley² × fVvalley ≈ Vin − VR
Sense resistorRcs = Vcs(limit) / (1.1 to 1.2 × Ipk)Sets the power limit
Output capacitorCout ≥ 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.

SpecificationValue
AC input85 to 265 Vac, 60 Hz
Output12 V, 2 A (24 W)
Design efficiency85%
Bulk capacitor47 µF, 400 V
Reflected voltage VR100 V
Minimum frequency (low line, full load)65 kHz
Maximum frequency (valley hopping limit)130 kHz
Drain node capacitance Cd150 pF
Leakage inductance1% of Lp
CoreEF25-class, Ae = 52 mm², Bmax = 0.3 T
MOSFET650 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 V

The 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) = 8

Step 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 µs

Step 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 V

A 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 line

A 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 rms

Use 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

InputDC bus (avg)ValleyFrequencyValley voltageDutyEfficiency
85 Vac, 2 A105 V178 kHz13 V (near ZVS)45%88.6%
220 Vac, 2 A306 V2102 kHz227 V18%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 source85 Vac220 Vac
MOSFET conduction233 mW70 mW
MOSFET turn-on (valley)1 mW397 mW
MOSFET turn-off182 mW411 mW
RCD clamp (leakage)813 mW813 mW
Output diode1.00 W1.00 W
Transformer copper209 mW138 mW
Bridge rectifier462 mW159 mW
Sense resistor, gate drive, ESR186 mW108 mW
Total3.08 W3.10 W
Efficiency88.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%.

Tip: To push efficiency past 90%, replace the output diode with a synchronous rectifier MOSFET, reduce leakage with better interleaving, and use a MOSFET with low Coss. A higher VR also helps at low line by giving ZVS, but raises the drain voltage.

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 voltageHigher output diode reverse voltage
Higher duty cycle, lower primary RMS currentLower duty cycle, higher primary RMS current
Deeper valleys, ZVS over more of the line rangeShallower valleys, more turn-on loss
Less clamp loss for a given leakageMore 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

FeatureQR flybackFixed-frequency DCMFixed-frequency CCM
FrequencyVaries with line and loadFixedFixed
MOSFET turn-onAt a valley (or ZVS)Random point on the ringingHard, at Vin + VR
Output diode turn-offSoft (zero current)Soft (zero current)Reverse recovery loss
Peak currentHigherHighestLowest
RHP zeroNoNoYes
EMILow and spread outMediumHigher
Typical useChargers and adapters, 5 to 75 WLow-power auxiliary suppliesHigher 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

  1. Define the AC range, output voltage and current, and target efficiency.
  2. Choose the bulk capacitor and find Vin(min) at low line and Vin(max) at high line.
  3. Choose VR and calculate the turns ratio.
  4. Calculate Lp and Ipk at low line, full load, first valley and the minimum frequency.
  5. Choose the core, calculate Np, Ns and the gapped AL.
  6. Check MOSFET voltage: Vin(max) + Vclamp + ringing below about 90% of rating.
  7. Size the RCD clamp from the leakage inductance.
  8. Choose the output diode (or synchronous rectifier) and output capacitor.
  9. Set the sense resistor and check the operating points at low and high line.
  10. 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.

1. Specifications
2. Transformer and QR design
3. Devices
4. Operating point

    Live circuit

    Switching period

    Q1 on (energy stored in Lp)Q1 off (energy delivered to output)Resonant ring, waiting for the valley
    Switching frequency
    Duty cycle
    Primary peak current
    Valley voltage
    Bulk voltage
    Output ripple

    Transformer and component selection

    Primary inductance Lp
    Turns ratio Np:Ns
    Turns and gap
    Bulk capacitor
    Output capacitor
    Current-sense resistor
    RCD clamp
    MOSFET Q1
    Output diode

    Voltage and current of each device

    Power, losses and temperature

    Efficiency
    Pout ÷ Pin at this operating point.
    Input power
    Total loss
    MOSFET junction temp.
    MOSFET conductionMOSFET switchingClamp (leakage)Output diodeTransformer copperBridge, sense, gate, ESR

    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.

    QR Flyback Converter FAQ

    What is a QR flyback converter?
    A QR (quasi-resonant) flyback converter is an isolated flyback power supply that turns the MOSFET on at a valley of the drain-voltage ringing instead of at a fixed clock time. This valley switching reduces turn-on loss and EMI, which is why QR flybacks are used in most phone chargers and AC adapters from about 5 W to 75 W.
    What does quasi-resonant mean in a flyback converter?
    After the transformer delivers all its energy, the primary inductance resonates with the drain capacitance and the drain voltage rings around the input voltage. A quasi-resonant controller detects this ringing and turns the MOSFET on at a minimum (valley), where the drain voltage is about Vin − VR.
    What is valley switching and valley hopping?
    Valley switching means turning the MOSFET on at the lowest point of the drain ringing to reduce the capacitive turn-on loss ½ × Cd × V² × f. Valley hopping means waiting for the second, third or later valley at high line or light load, so the switching frequency does not climb above the controller limit.
    What is the reflected voltage VR in a flyback?
    VR is the output voltage plus the diode drop, multiplied by the turns ratio: VR = (Np / Ns) × (Vout + Vf). It appears on the MOSFET drain while the secondary conducts, so the MOSFET sees Vin + VR plus the leakage spike. For 650 V MOSFETs on universal input, VR of 90 to 110 V is common.
    How do you calculate the primary inductance of a QR flyback?
    Use the worst case of minimum bulk voltage and full load at the minimum frequency. Solve T = Lp × Ipk × (1/Vin + 1/VR) + π√(Lp × Cd) together with Pin = ½ × Lp × Ipk² × f. For a 24 W, 85 to 265 Vac design with VR = 100 V at 65 kHz, this gives about 540 µH and 1.27 A peak.
    How many primary turns does a flyback transformer need?
    Np must be at least Lp × Ipk / (Bmax × Ae) so the core does not saturate, where Bmax is about 0.25 to 0.3 T for ferrite and Ae is the core area. The secondary turns are Np divided by the turns ratio, and the core gap is chosen for AL = Lp / Np².
    What MOSFET voltage rating does a flyback need?
    The MOSFET must withstand Vin(max) + Vclamp plus some ringing margin. With 265 Vac input (375 V DC) and a 150 V clamp, the peak is about 525 V, so a 650 V MOSFET gives around 85% utilization. Higher VR or clamp voltages need 700 V or 800 V parts.
    Why does a flyback need an RCD clamp?
    The leakage inductance of the transformer stores energy that cannot reach the secondary. At turn-off it would ring the drain far above the MOSFET rating. The RCD clamp catches this spike at a set voltage and dissipates the energy, about ½ × Llk × Ipk² × f × Vcl / (Vcl − VR).
    What is ZVS in a QR flyback?
    When the reflected voltage VR is higher than the bulk voltage Vin, the drain rings all the way down to 0 V before the MOSFET turns on. This is zero-voltage switching (ZVS): the capacitive turn-on loss almost disappears. In universal-input designs it usually happens at low line.
    What is the difference between QR and fixed-frequency flyback?
    A fixed-frequency flyback turns the MOSFET on at a fixed clock time, which can land on a peak of the ringing or force hard switching in CCM. A QR flyback lets the frequency vary and always switches at a valley, giving lower turn-on loss, soft output diode turn-off, no right-half-plane zero and spread-out EMI, at the cost of a higher peak current.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    electronics believer