LLC simulator
An LLC resonant converter you can program. Set the resonant tank, load and switching frequency, then write the control loop in C and run the switched tank, an FHA model, or a primary-leg commutation edge. Probe voltages and currents, sweep parameters, 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: your C controller drives the selected LLC model through the shared simulation loop. Long timebases block-average each point; shorten the run to see commutation and tank detail. All selected node voltages, tank currents, branch currents and controller channels 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): Switched tank integrates a reduced Lr–Cr–Lm teaching plant with bridge PWM and rectifier conduction. ZVS commutation replays one deterministic primary high-to-low edge. FHA averaged follows the low-frequency first-harmonic operating point for control and sweep studies without switching ripple.
- 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 (vSw, resonant/commutation current, switch-channel current and body-diode current). 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.