Power Electronics
DPsim provides several averaged power-electronic inverter models for simulation using EMT, DP, and SP network modeling domains.
Three-Phase Averaged Voltage Source Inverter with State-Space Nodal Interface
The EMT::Ph3::AvVoltSourceInverterStateSpace model represents a grid-following averaged voltage source inverter in the EMT domain.
It is implemented as a variable state-space nodal component and can therefore be directly stamped into the MNA system.
The model includes a PLL, filtered active/reactive power measurement, outer power control, inner current control, and an LC filter with coupling resistance to the grid node.
The terminal input is the PCC voltage vector
and the state vector is
The model output is the interface current injected into the MNA system,
Model equations
The controller uses the opposite current direction, i.e. positive current denotes inverter injection into the grid,
The Park transformation with PLL angle $\theta_{\mathrm{PLL}}$ is used to obtain dq quantities,
The instantaneous active and reactive powers are calculated as
The PLL and power-filter dynamics are
The outer power-control integrators and current references are
The inner current-control integrators and voltage references are
The reference voltage is transformed back to abc coordinates,
The LC filter dynamics are
At each simulation step, the nonlinear model is locally linearized into the affine state-space form
which is then discretized and stamped into the EMT MNA system.
Source code and examples
- Source code: header, implementation
- C++ example
- Python notebook
Single-Phase Averaged Voltage Source Inverter with State-Space Nodal Interface (Dynamic Phasor)
The DP::Ph1::AvVoltSourceInverterStateSpace model ports the same grid-following averaged inverter into the dynamic-phasor (DP) domain, as a single positive-sequence complex envelope rather than three abc waveforms.
The PLL, power filter, outer power control, and inner current control are baseband and stay real; only the LC filter’s two states are genuine carrier-band envelopes and carry the $-j\omega_n$ shift described in State-Space Nodal.
The terminal input is the PCC voltage envelope
and the state vector is the mixed real/complex-envelope form
where $\psi := \theta_{\mathrm{PLL}} - \omega_n t$ is the PLL angle’s deviation from the nominal carrier phase, tracked instead of the raw, unboundedly growing $\theta_{\mathrm{PLL}}$ for relinearization accuracy, and $V_c$, $I_f$ are complex envelopes replacing EMT’s six abc filter states.
The model output is the interface current injected into the MNA system,
Model equations
The controller uses the opposite current direction, i.e. positive current denotes inverter injection into the grid,
Because the DP envelope already demodulates the carrier, the dq quantities are obtained by rotating the envelope by $\psi$ alone, not by the full absolute angle $\theta_{\mathrm{PLL}}$,
with $v_{c,d} = \operatorname{Re}{V_{c,dq}}$, $v_{c,q} = \operatorname{Im}{V_{c,dq}}$, and likewise for $i_{rc,d}$, $i_{rc,q}$.
The instantaneous active and reactive powers are calculated as
identical in form to EMT’s; DP::Ph1’s own voltage/current scale already represents total power directly, with no three-phase multiplier.
The PLL and power-filter dynamics are
The outer power-control integrators and current references are
The inner current-control integrators and voltage references are
The reference voltage is transformed back to a complex envelope, rotating by $\psi$,
The LC filter dynamics carry the envelope’s carrier shift explicitly,
At each simulation step, the nonlinear model is locally linearized into the affine state-space form, packing the 8 real states and the real/imaginary parts of the 2 complex states into one real 12-vector,
which is then discretized and stamped into the DP MNA system.
Source code and examples
- Source code: header, implementation
- C++ example
- Python notebook