Skip to content
ASLبشمهندس عسلAGENT / 101
HomeWorkToolsNotesAboutStart a project

OPEN FOR SELECTED COLLABORATIONS / 101

Bring the system that needs an answer.

Send a project briefEmail Ahmed

اسأل. تعلّم.

ابنِ. اختبر.

© 2026 AHMED IBRAHIM ASLبشمهندس عسلEGYPT / SYSTEMS ENGINEER / AGENT 101
← Power Conversion & Supplies

Power Conversion / design models

SMPS Design

Explore AC-mains and DC-input isolated flyback supplies, calculate a first-pass DCM operating point, and follow energy through an interactive circuit.

Answer first

How do I estimate a DCM flyback SMPS operating point?

Use this flyback SMPS designer to estimate duty cycle, primary inductance, turns ratio, peak current, and semiconductor stress for a discontinuous-conduction operating point. The result gives you a first design to examine, not a production-ready mains supply. Magnetics, snubbers, feedback stability, isolation, EMI, and safety still need engineering review.

One topology / Two input arrangements

Where does the power come from?

Both use a fixed-frequency DCM flyback model. Changing mode loads its example values. The existing buck tool is a different, non-isolated step-down topology.

Mains safety: rectified mains can be lethal and capacitors can remain charged after unplugging. This is an educational estimator, not a safe-to-build schematic. Do not prototype the mains stage on a solderless breadboard. A transformer symbol does not certify isolation. A qualified design review and hardware testing are required.

01 / Targets and assumptions

Set the operating point

ON + transfer must stay below 100%. Remaining time is idle. Example values illustrate the model; they are not recommended component ratings.

02 / Follow one switching cycle

Mains-fed flyback

COMPONENT SCHEMATIC / DCM FLYBACKQ1 ON · D5 blocks
Component-level flyback power stageSeparate primary and secondary returns. AC rectification is not synchronized to the high-frequency switching phase. Gate drive is functional; protection, compensation and controller supply are not specified.RECTIFIED MAINS / PRIMARYISOLATED SECONDARYD1: anode to cathodeD2: anode to cathodeD3: anode to cathodeD4: anode to cathodeLND1D2D3D4AC bridgeLine frequencyCbulkInput reservoirT1NpNsQ1N-MOSFETDGSPWMGate driveD5Output rectifierCoutReservoirLoadVout +PRIMARY RETURN · HAZARDOUSSECONDARY RETURNNo electrical connection across the isolation barrier
Primary DC bus
271.3–356.4 V
T1 · primary Lm
3608 µH
T1 · Np : Ns
16.88 : 1
Cout · ideal minimum
60.06 µF
DC output
12 V

Component-level power stage, not a finished supply: input filtering and protection, clamp/snubber, feedback, controller supply and compensation still require design. Cbulk is shown but not sized. Gold marks the selected switching-current path; it does not model the AC bridge charging pulses.

Scroll horizontally on a small screen. Gold shows the highlighted path; dashed control lines are not power wires.

ON35 %
TRANSFER45 %
IDLE20 %

The primary switch is ON. Primary current rises from zero and energy builds in the magnetic field. The secondary diode is reverse biased; the output capacitor supplies the load.

Flyback magnetics

This is a coupled energy-storage inductor, often called a flyback transformer. The calculated ratio Np/Ns is not a winding recipe. Core material, effective area, gap, saturation, losses, insulation, creepage and leakage inductance require a separate magnetic design. Dot markers show winding polarity.

03 / Analytical results, not a bill of materials

First-pass design estimates

Primary DC bus range271.3 –356.4 V
Output power12 W
Primary inductance Lm3608 µH
Turns ratio Np / Ns16.88 : 1
Primary peak / RMS0.2632 / 0.08991 A
Secondary peak / RMS4.444 / 1.721 A
Ideal switch blocking voltage567.4 V
Ideal diode reverse voltage33.11 V
Ideal ripple capacitance60.06 µF
Idle interval at minimum input20 %
Required ON interval at maximum input26.65 %

Calculations include the entered secondary diode drop but otherwise assume lossless transfer, ideal coupling and fixed frequency. At higher input voltage the controller must reduce ON time. Voltage stresses shown are ideal lower estimates; they omit leakage spikes and ringing. Do not select parts directly at these numbers.

How the calculation works

Energy and primary peak current
Pt=(Vo+VD)Io=12LmIp,pk2fs,Ip,pk=2PtVbus,minDP_t=(V_o+V_D)I_o=\frac12L_m I_{p,pk}^2f_s,\qquad I_{p,pk}=\frac{2P_t}{V_{bus,min}D}Pt​=(Vo​+VD​)Io​=21​Lm​Ip,pk2​fs​,Ip,pk​=Vbus,min​D2Pt​​
Inductance and winding ratio
Lm=Vbus,minDfsIp,pk,NpNs=Vbus,minD(Vo+VD)D2L_m=\frac{V_{bus,min}D}{f_s I_{p,pk}},\qquad \frac{N_p}{N_s}=\frac{V_{bus,min}D}{(V_o+V_D)D_2}Lm​=fs​Ip,pk​Vbus,min​D​,Ns​Np​​=(Vo​+VD​)D2​Vbus,min​D​
Ideal voltage stresses
VDS=Vbus,max+NpNs(Vo+VD),VR,diode=Vo+Vbus,maxNp/NsV_{DS}=V_{bus,max}+\frac{N_p}{N_s}(V_o+V_D),\qquad V_{R,diode}=V_o+\frac{V_{bus,max}}{N_p/N_s}VDS​=Vbus,max​+Ns​Np​​(Vo​+VD​),VR,diode​=Vo​+Np​/Ns​Vbus,max​​
Ideal capacitor charge balance
Co=IofsΔVpp(1−D2+D2Io2Is,pk)C_o=\frac{I_o}{f_s\Delta V_{pp}}\left(1-D_2+\frac{D_2 I_o}{2I_{s,pk}}\right)Co​=fs​ΔVpp​Io​​(1−D2​+2Is,pk​D2​Io​​)

D is the ON fraction, D₂ is the secondary energy-delivery fraction, and 1 − D − D₂ is idle. Estimates apply to the specified full-load operating point. Startup, light-load behavior and transient control are outside this model.

Technical reference: TI — Designing a DCM flyback converter ↗

What must still be designed?

Core and winding construction; isolation barriers; controller and gate drive; feedback compensation; current limiting; startup and auxiliary supply; snubber/clamp; input filtering; fuse, surge and inrush protection; capacitor ripple-current ratings; thermal behavior; layout and EMC. This tool does not generate an approved mains power supply.

Design guide

Use the result with engineering context

Technical content reviewed September 15, 2026

When this tool is useful

  • Comparing an AC-input flyback with a DC-input isolated converter
  • Checking whether a target power and switching frequency produce practical first-pass stresses

What the result includes

  • Duty cycle, turns ratio, primary inductance, and peak current
  • Estimated MOSFET, diode, and winding stress for the selected operating point

What the model does not guarantee

  • The model does not design insulation, creepage, clearance, EMI filtering, or a certified transformer
  • It does not replace loop-compensation, leakage-inductance, snubber, thermal, and bench validation

Worked approach

Start with the energy path

Enter the input range, output target, efficiency estimate, and switching frequency. Compare the calculated stresses with realistic controller, MOSFET, diode, core, and winding limits before selecting parts.

Common decisions

Questions engineers ask

Is this enough to build a mains-powered SMPS?

No. Mains designs require isolation, protection, transformer construction, creepage, clearance, fusing, EMI, thermal, and regulatory work that a browser calculator cannot approve.

Why does switching frequency change the transformer design?

A higher frequency transfers energy in shorter cycles and can reduce the inductance and core size, but it also raises switching, magnetic, gate-drive, and EMI losses.

What should I verify in a controller datasheet?

Check startup behavior, maximum duty cycle, current-sense threshold, gate-drive capability, compensation method, protection modes, and the voltage range used by the controller itself.

Related build evidence

AgriBot system architecture

See how power, sensing, control, connectivity, and an operator interface fit inside one embedded system. This project is system evidence, not a claim that it uses the flyback values shown here.

See the project

Apply it to real hardware

Need a power stage reviewed as part of a prototype?

Send the input range, output rails, load profile, isolation need, size limit, and parts you have already considered.

Discuss the system
Ahmed Ibrahim Asl
Behind the workbenchAhmed Ibrahim Asl

Embedded Systems & IoT R&D Engineer

From a calculation to a working prototype.

I build embedded firmware, connected hardware, and the interfaces that make them usable. Explore the projects behind this workbench, or tell me what you need to build.

See embedded & IoT projects ↗Discuss a project ↗Read engineering notes ↗