LLC resonant converter simulator
Set the resonant tank, load and switching frequency, then run an LLC simulation with a programmable frequency controller. Probe currents and voltages, sweep the design, and explore the waveforms.
Configure the converter
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 with bounded frequency control (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; the default plot from skips that ramp to the settled waveform. Long timebases block-average each point; a short window keeps iLr and iLm individually visible. All measured channels (Vout, iLr, iLm, iLr−iLm, node voltages, and 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:
Model view (Step 1): Switched LLC is the real half-bridge, resonant Lr–Cr–Lm tank, transformer and rectifier with switching ripple. First-harmonic approximation is the analytical gain view used for design; it is not substituted for the switched time-domain model.
- Built-ins —
V_out,i_Lr,i_Lm, and the LLC 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.
2 · Measurements (under the schematic, Step 1)
The Measurements panel sits beneath the schematic. A relevant default set is preloaded (Vout, i(Lr), i(Lm), vsw, input/load and bridge currents). 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 / 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_Lr). - 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_Lr*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_Lr)). - 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.