← IBR Dynamic Modeling and Simulation

IBR Dynamic Modeling and Simulation

Averaged Converter and LCL Plant

C1-03 · Lesson + simulation + practice · Allow 60 minutes

Derive the electrical states shared by several controller families.

Learning objectives

  • Derive the LCL equations in a rotating frame.
  • Separate physical inductance from virtual impedance.

From structure to model

Retain the six electrical states

An averaged converter imposes a continuous voltage command u rather than individual switching events. The LCL plant retains converter-side current i₁, capacitor voltage v_c and output current i₂, each with d and q components. The grid-side filter and grid inductance carry the same current, so combine their series r and ℓ for the differential equation; reconstruct the PoC voltage when a separate terminal measurement is needed.

Use J = [[0, 1], [−1, 0]]. In a frame rotating at ω_b ω, a complex dq vector acquires the term −jω_bω times itself. The real form is +ω_bωJ times the vector. These signs follow directly from differentiating a rotating coordinate transform.

Commands and closed-loop states are different

The experiment holds the converter voltage at its equilibrium value, then adds 0.005 pu to its d component at 10 ms. It is an open-loop plant experiment. A closed-loop droop GFM also needs angle, P–Q filters, voltage PI and current PI states. Six electrical states plus one angle, two power filters and four PI integrators give the repository’s 13-state droop realization.

Initialize all components consistently

Take i₂ = 0.6 − j0 at the infinite-bus port. Compute v_c = 1 + (r₂ + jω_bℓ₂)i₂, i₁ = i₂ + jω_b c v_c and u = v_c + (r₁ + jω_bℓ₁)i₁. Starting the capacitor at 1 and both currents at zero would introduce an unintended energization transient.

The default coefficients are r₁ = 0.00625, ℓ₁ = 84.375 μs, c = 0.0008 s, r₂ = 0.00625 + r_g and ω_bℓ₂ = 0.1 + x_g. The open-loop case uses a 2 μs integration step over 30 ms. These are declared teaching parameters, not a reproduction of every source notebook parameter profile.

Audit energy, not only the plotted curve

Define W = (ℓ₁|i₁|² + c|v_c|² + ℓ₂|i₂|²)/2. Cross-axis terms cancel in Ẇ. The energy-rate identity below checks voltage signs, branch directions and loss terms together. Its residual is an equation-consistency check, not an external validation of the converter.

Core equations

\dot i_1=\frac{u-v_c-r_1i_1}{\ell_1}+\omega_b\omega Ji_1
\dot v_c=\frac{i_1-i_2}{c}+\omega_b\omega Jv_c,\qquad\dot i_2=\frac{v_c-v_g-r_2i_2}{\ell_2}+\omega_b\omega Ji_2
v_{PoC}=v_c-r_{f2}i_2-\ell_{f2}(\dot i_2-\omega_b\omega Ji_2)
\dot W=u^Ti_1-v_g^Ti_2-r_1\lVert i_1\rVert^2-r_2\lVert i_2\rVert^2

Simulation experiment

  1. Run the +0.005 pu converter-voltage step and inspect the first 20 ms after the event.
  2. Reduce SCR from 5 to 2 and rerun; explain what changed in the electrical branch.
  3. Inspect lcl_run(): identify each stored-energy term and verify the energy-rate residual.

Laboratory · Python runs in your browser

Predict → run → inspect

Predict the response, then change a parameter and run. The initial plot is a baseline generated by the same solver. The first computation downloads Python; later runs reuse it.

Loading the baseline…

Numerical audit and samples

Six-state averaged LCL; open-loop voltage step at 10 ms, fixed 2 μs integration step. PI control, PWM, DC dynamics and current limits are omitted.

Edit the model and reproduce the experiment

The code reads the controls above and plots its own result. Edit the experiment or expand the solver source to test your prediction. Download experiment produces one .py file containing the parameters, full solver and experiment code; local execution needs only Python 3.

case is a snapshot of the controls when you press Run. Call solve(case) and assign the final solution to result to plot it.

Download solver

The first run needs internet access to download Python. Computation stays in your browser; the solver uses only the standard library.

Ready to run.

Output appears here.
Inspect and edit the model source (advanced)

The source contains the transforms, LCL, PLL, droop, VSM, shared PCC and explicit reset. Source edits affect the next Python experiment; the laboratory above retains the original teaching equations.

Check your understanding

Which states does this open-loop LCL experiment contain?

List the electrical states and explain the measured terminal.

Continue in the source repository

Adapted from local PINN-IBR materials reviewed on 2026-10-03. The web code is a separately authored teaching realization. These repository paths contain the detailed models, configurations and research cases.

  • Coding/Modeling/src/ibrsim/models/droop_gfm.py
  • Coding/Modeling/src/ibrsim/conventions.py

PINN-IBR repository

All nine modules
  1. System Boundaries and Model Representations
  2. Reference Frames and Per-Unit Conventions
  3. Averaged Converter and LCL Plant
  4. PLL and Grid-Following Control
  5. Droop Grid-Forming Control
  6. VSM and Virtual Inertia
  7. Parallel GFL–GFM Hybrid Models
  8. Mode-Switching Hybrid Models
  9. Equilibrium, Disturbances, and Fair Comparison