LLC resonant converter simulator
The companion to the LLC course. An LLC's whole design story is one picture: the gain curve — output voltage regulated by moving the switching frequency fsw across a resonant characteristic that itself changes shape with load. Drag fsw and watch the operating point slide along the curve below, live, no run needed; drag Rload and watch the whole curve change shape under it. Press Run to see the real switched tank — resonant current, magnetising current, and the difference that actually reaches the rectifier — on the running frozen 1 kW, 390 V → 48 V Chapter 1 example. Course links above the simulator resolve source-bound scenarios without depending on a saved browser session.
Configure the converter
ZVS (primary legs) and ZCS (secondary rectifier) are different axes — ZVS holds everywhere in the inductive region; ZCS only at or below fr.
Write the controller
Pick what to plot, then run
Parameter sweep vary parameters across a grid, then explore the result
| parameter | start | stop | steps | spacing |
|---|
Real engine: a switched LLC tank (resonant current iLr, resonant-cap voltage, magnetising current iLm, output voltage — see sim.config.js) integrated with symplectic Euler, half-bridge held at a fixed 50% duty — fsw is the lever, not a control loop (Step 2). This is a DIFFERENT model from fig. 1b's gain curve: fig. 1b is the first-harmonic approximation (FHA), this is the real switched circuit — they agree closely near/above fr and diverge below it, exactly Ch.3's point. From a standing start Vout ramps up over a few output-cap time constants (real LLC start-up looks like a short — Ch.8); the default plot from (Step 1) skips past that ramp to the settled waveform — set it to 0 to watch the start-up. Long timebases block-average each point; a short window (or a late plot from) keeps per-cycle resolution so iLr and iLm are individually visible, not just their envelope. All measured channels (Vout, iLr, iLm, iLr−iLm, node voltages, branch currents) are sent to the explorer.
Plotting guidemeasurements, running, sweeps, and the Plot Explorer — everything
1 · What gets plotted
Pressing Run sim → simulates the converter and opens the result in the embedded Plot Explorer below. The simulation is never run automatically — only when you press Run (or Run sweep). Every channel the engine records is made available to the Explorer:
Topology (Step 1): Standard (diode) and Bidirectional half-bridge are switched models — real PWM, switching ripple, fine timestep. Averaged model replaces the switching network with a controllable voltage source (vSW = duty·Vin): smooth waveforms, no PWM ripple, and a much faster run — ideal for control/transient studies and sweeps. It assumes continuous conduction (CCM).
- Built-ins —
V_out,i_L,duty, plus node voltages and branch currents you add as measurements (below). - signals.py — every signal you define (e.g.
Vref,Power) is recorded over the run and plottable by its name. - plot(...) channels — any internal controller variable you expose (see §3).
2 · Measurements (under the schematic, Step 1)
The Measurements panel sits beneath the schematic. A relevant default set is preloaded (Vout, i(L), Vin, input/load/cap currents, v(Q1)…). Each is a chip:
- Click a chip to include it as a channel in the Explorer (highlighted = on). It is available to plot, not force-drawn — you pick curves in the Explorer.
- + current → then click a component on the schematic to measure the current through it.
- + voltage → then click two nodes to measure the voltage between them.
- You name each probe on add (Cancel discards it). The ✕ on a chip removes it.
3 · Plotting controller variables — plot()
Expose any internal variable from voltage.c / current.c / pwm.c
as a channel:
float i_ref = KP*err + KI*integ;
plot(i_ref); // → channel "i_ref"
plot("err", Vref-Vout); // → channel "err" (named)
The value is sampled at the controller's rate and recorded for the whole run.
4 · The Plot Explorer
Each plot card draws one or more curves. Use + Add standard plot / + Add 3D plot to compare slices side by side.
- Curves — each row is a variable + operation, or switch it to ✎ expression… for a freeform expression. + add curve for more.
- Horizontal axis — usually
t; set it to ✎ expression… for a transform (t*1000) or a parametric plot (X =V_out, Y =i_L). - Subplots — stack 1–4 plots sharing the X axis; assign each curve to a subplot.
- Style — every curve has a colour picker and a line style (solid / dashed / dotted / dash-dot).
- ⊹ cursors — drop A & B lines, drag them to read exact values, Δx, Δy, and add mean / RMS / min / max / pk-pk over the interval.
- Curve expressions — click the ? next to a plot for the full function
reference. Highlights: reductions
RMS(i)/MEAN(i)… (scalar); per-cycle with a frequencyRMS(i_L*V_out, 50)(one value per 1/f cycle); rollingRMS_R(i, w); filtersLPF(i, fc)/HPF(i, fc); element-wiseABS/SQRT/LOG/DERIV…; slicingi[a:b]; arithmetic+ − * / ** %.
5 · Sweeps
Open Parameter sweep. Tick any parameters (circuit values and controller
#define gains) and set start / stop / steps and linear / log spacing.
The combo count and a cap are shown; press Run sweep →.
- Every combination is simulated and the whole set loads at once.
- Sliders appear for the swept dimensions — drag one to morph the waveform. Each
slider has lock/float, a scale dropdown —
lin/log/✎ expr…(pick expr to type a custom monotonic transform like1/Land slide in that space) — and ⬆ to promote it to the global header. - Switch a card to 3D for a heatmap / contour / surface: two swept params as
axes, a reduced metric as the value (e.g.
MEAN(V_out),P2P(i_L)). - Interpolate (smooth curves) renders lines as cubic splines (visual only).
6 · Saving & download
- Your setup — controller C code, signals.py, parameters, probes, sweep config, every setting — is saved in your browser and restored on reload. The simulation waveforms are not saved.
- Download data ↓ exports the waveforms as CSV: a single run gives
t+ all channels (+ signals + plot() channels); a sweep gives the full long-format grid.