<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DPsim – Power Electronics</title><link>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/</link><description>Recent content in Power Electronics on DPsim</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: EMT Ph3 Averaged Voltage Source Inverter</title><link>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/emt-ph3-averaged-vsi/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/emt-ph3-averaged-vsi/</guid><description>
&lt;p>This model represents a grid-following averaged voltage source inverter in the EMT domain.
Because its state-space form is recomputed as the operating point moves, it is solved simultaneously with the network rather than through a delayed injection.
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.&lt;/p>
&lt;p>The terminal input is the PCC voltage vector&lt;/p>
&lt;div class="math">$$\mathbf{u} =
\begin{bmatrix}
u_a &amp; u_b &amp; u_c
\end{bmatrix}^\top ,$$&lt;/div>&lt;p>and the state vector is&lt;/p>
&lt;div class="math">$$\mathbf{x} =
\begin{bmatrix}
\theta_{\mathrm{PLL}} &amp;
\phi_{\mathrm{PLL}} &amp;
P &amp;
Q &amp;
\phi_d &amp;
\phi_q &amp;
\gamma_d &amp;
\gamma_q &amp;
v_{c,a} &amp;
v_{c,b} &amp;
v_{c,c} &amp;
i_{f,a} &amp;
i_{f,b} &amp;
i_{f,c}
\end{bmatrix}^\top .$$&lt;/div>&lt;p>The model output is the interface current injected into the MNA system,&lt;/p>
&lt;div class="math">$$\mathbf{y} =
\frac{\mathbf{u} - \mathbf{v}_c}{R_c}.$$&lt;/div>&lt;h2 id="model-equations">Model equations&lt;/h2>
&lt;p>The controller uses the opposite current direction, i.e. positive current denotes inverter injection into the grid,&lt;/p>
&lt;div class="math">$$\mathbf{i}_{rc} =
\frac{\mathbf{v}_c - \mathbf{u}}{R_c}.$$&lt;/div>&lt;p>The Park transformation with PLL angle $\theta_{\mathrm{PLL}}$ is used to obtain dq quantities,&lt;/p>
&lt;div class="math">$$\begin{bmatrix}
v_{c,d} \\
v_{c,q}
\end{bmatrix}
=
\mathbf{T}(\theta_{\mathrm{PLL}})\mathbf{v}_c,
\qquad
\begin{bmatrix}
i_{rc,d} \\
i_{rc,q}
\end{bmatrix}
=
\mathbf{T}(\theta_{\mathrm{PLL}})\mathbf{i}_{rc}.$$&lt;/div>&lt;p>The instantaneous active and reactive powers are calculated as&lt;/p>
&lt;div class="math">$$p = v_{c,d} i_{rc,d} + v_{c,q} i_{rc,q},$$&lt;/div>
&lt;div class="math">$$q = -v_{c,d} i_{rc,q} + v_{c,q} i_{rc,d}.$$&lt;/div>&lt;p>The PLL and power-filter dynamics are&lt;/p>
&lt;div class="math">$$\dot{\theta}_{\mathrm{PLL}}
=
\omega_n + K_{p,\mathrm{PLL}} v_{c,q} +
K_{i,\mathrm{PLL}} \phi_{\mathrm{PLL}},$$&lt;/div>
&lt;div class="math">$$\dot{\phi}_{\mathrm{PLL}} = v_{c,q},$$&lt;/div>
&lt;div class="math">$$\dot{P} = \omega_c(p - P),
\qquad
\dot{Q} = \omega_c(q - Q).$$&lt;/div>&lt;p>The outer power-control integrators and current references are&lt;/p>
&lt;div class="math">$$\dot{\phi}_d = P_{\mathrm{ref}} - P,
\qquad
\dot{\phi}_q = Q - Q_{\mathrm{ref}},$$&lt;/div>
&lt;div class="math">$$i_{d,\mathrm{ref}}
=
K_{p,P}(P_{\mathrm{ref}} - P) + K_{i,P}\phi_d,$$&lt;/div>
&lt;div class="math">$$i_{q,\mathrm{ref}}
=
K_{p,P}(Q - Q_{\mathrm{ref}}) + K_{i,P}\phi_q.$$&lt;/div>&lt;p>The inner current-control integrators and voltage references are&lt;/p>
&lt;div class="math">$$\dot{\gamma}_d = i_{d,\mathrm{ref}} - i_{rc,d},
\qquad
\dot{\gamma}_q = i_{q,\mathrm{ref}} - i_{rc,q},$$&lt;/div>
&lt;div class="math">$$v_{d,\mathrm{ref}}
=
K_{p,I}(i_{d,\mathrm{ref}} - i_{rc,d}) +
K_{i,I}\gamma_d,$$&lt;/div>
&lt;div class="math">$$v_{q,\mathrm{ref}}
=
K_{p,I}(i_{q,\mathrm{ref}} - i_{rc,q}) +
K_{i,I}\gamma_q.$$&lt;/div>&lt;p>The reference voltage is transformed back to abc coordinates,&lt;/p>
&lt;div class="math">$$\mathbf{v}_{\mathrm{ref}}
=
\mathbf{T}^{-1}(\theta_{\mathrm{PLL}})
\begin{bmatrix}
v_{d,\mathrm{ref}} \\
v_{q,\mathrm{ref}}
\end{bmatrix}.$$&lt;/div>&lt;p>The LC filter dynamics are&lt;/p>
&lt;div class="math">$$\dot{\mathbf{v}}_c
=
\frac{1}{C_f}\mathbf{i}_f
+
\frac{1}{C_f R_c}(\mathbf{u} - \mathbf{v}_c),$$&lt;/div>
&lt;div class="math">$$\dot{\mathbf{i}}_f
=
\frac{1}{L_f}
\left(
\mathbf{v}_{\mathrm{ref}}
-
\mathbf{v}_c
-
R_f \mathbf{i}_f
\right).$$&lt;/div>&lt;p>At each simulation step, the nonlinear model is locally linearized into the affine state-space form&lt;/p>
&lt;div class="math">$$\dot{\mathbf{x}}
\approx
\mathbf{A}\mathbf{x}
+
\mathbf{B}\mathbf{u}
+
\mathbf{E},$$&lt;/div>
&lt;div class="math">$$\mathbf{y}
\approx
\mathbf{C}\mathbf{x}
+
\mathbf{D}\mathbf{u}
+
\mathbf{F},$$&lt;/div>&lt;p>which is then discretized and stamped into the EMT MNA system.&lt;/p>
&lt;p>How this is arranged in code, together with the source and the runnable examples, is covered under
&lt;a href="https://dpsim.fein-aachen.org/docs/developer-guide/model-implementations/emt-ph3-averaged-vsi-implementation/">EMT Ph3 averaged VSI implementation&lt;/a>.&lt;/p></description></item><item><title>Docs: DP Ph1 Averaged Voltage Source Inverter</title><link>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/dp-ph1-averaged-vsi/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/dp-ph1-averaged-vsi/</guid><description>
&lt;p>This 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&amp;rsquo;s two states are genuine carrier-band envelopes and carry the $-j\omega_n$ shift described in &lt;a href="https://dpsim.fein-aachen.org/docs/concepts/state-space-nodal/">State-Space Nodal&lt;/a>.&lt;/p>
&lt;p>The terminal input is the PCC voltage envelope&lt;/p>
&lt;div class="math">$$u = U ,$$&lt;/div>&lt;p>and the state vector is the mixed real/complex-envelope form&lt;/p>
&lt;div class="math">$$\mathbf{x} =
\begin{bmatrix}
\psi &amp;
\phi_{\mathrm{PLL}} &amp;
P &amp;
Q &amp;
\phi_d &amp;
\phi_q &amp;
\gamma_d &amp;
\gamma_q &amp;
\operatorname{Re}\{V_c\} &amp;
\operatorname{Im}\{V_c\} &amp;
\operatorname{Re}\{I_f\} &amp;
\operatorname{Im}\{I_f\}
\end{bmatrix}^\top ,$$&lt;/div>&lt;p>where $\psi := \theta_{\mathrm{PLL}} - \omega_n t$ is the PLL angle&amp;rsquo;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&amp;rsquo;s six abc filter states.&lt;/p>
&lt;p>The model output is the interface current injected into the MNA system,&lt;/p>
&lt;div class="math">$$y = \frac{U - V_c}{R_c}.$$&lt;/div>&lt;h2 id="model-equations">Model equations&lt;/h2>
&lt;p>The controller uses the opposite current direction, i.e. positive current denotes inverter injection into the grid,&lt;/p>
&lt;div class="math">$$I_{rc} = \frac{V_c - U}{R_c}.$$&lt;/div>&lt;p>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}}$,&lt;/p>
&lt;div class="math">$$V_{c,dq} = V_c\, e^{-j\psi}, \qquad I_{rc,dq} = I_{rc}\, e^{-j\psi},$$&lt;/div>&lt;p>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}$.&lt;/p>
&lt;p>The instantaneous active and reactive powers are calculated as&lt;/p>
&lt;div class="math">$$p = v_{c,d} i_{rc,d} + v_{c,q} i_{rc,q},$$&lt;/div>
&lt;div class="math">$$q = -v_{c,d} i_{rc,q} + v_{c,q} i_{rc,d},$$&lt;/div>&lt;p>identical in form to EMT&amp;rsquo;s; &lt;code>DP::Ph1&lt;/code>&amp;rsquo;s own voltage/current scale already represents total power directly, with no three-phase multiplier.&lt;/p>
&lt;p>The PLL and power-filter dynamics are&lt;/p>
&lt;div class="math">$$\dot{\psi}
=
K_{p,\mathrm{PLL}} v_{c,q} +
K_{i,\mathrm{PLL}} \phi_{\mathrm{PLL}},$$&lt;/div>
&lt;div class="math">$$\dot{\phi}_{\mathrm{PLL}} = v_{c,q},$$&lt;/div>
&lt;div class="math">$$\dot{P} = \omega_c(p - P),
\qquad
\dot{Q} = \omega_c(q - Q).$$&lt;/div>&lt;p>The outer power-control integrators and current references are&lt;/p>
&lt;div class="math">$$\dot{\phi}_d = P_{\mathrm{ref}} - P,
\qquad
\dot{\phi}_q = Q - Q_{\mathrm{ref}},$$&lt;/div>
&lt;div class="math">$$i_{d,\mathrm{ref}}
=
K_{p,P}(P_{\mathrm{ref}} - P) + K_{i,P}\phi_d,$$&lt;/div>
&lt;div class="math">$$i_{q,\mathrm{ref}}
=
K_{p,P}(Q - Q_{\mathrm{ref}}) + K_{i,P}\phi_q.$$&lt;/div>&lt;p>The inner current-control integrators and voltage references are&lt;/p>
&lt;div class="math">$$\dot{\gamma}_d = i_{d,\mathrm{ref}} - i_{rc,d},
\qquad
\dot{\gamma}_q = i_{q,\mathrm{ref}} - i_{rc,q},$$&lt;/div>
&lt;div class="math">$$v_{d,\mathrm{ref}}
=
K_{p,I}(i_{d,\mathrm{ref}} - i_{rc,d}) +
K_{i,I}\gamma_d,$$&lt;/div>
&lt;div class="math">$$v_{q,\mathrm{ref}}
=
K_{p,I}(i_{q,\mathrm{ref}} - i_{rc,q}) +
K_{i,I}\gamma_q.$$&lt;/div>&lt;p>The reference voltage is transformed back to a complex envelope, rotating by $\psi$,&lt;/p>
&lt;div class="math">$$V_{\mathrm{ref}} = (v_{d,\mathrm{ref}} + j v_{q,\mathrm{ref}})\, e^{j\psi}.$$&lt;/div>&lt;p>The LC filter dynamics carry the envelope&amp;rsquo;s carrier shift explicitly,&lt;/p>
&lt;div class="math">$$\dot{V}_c
=
\frac{1}{C_f} I_f
+
\frac{1}{C_f R_c}(U - V_c)
- j\omega_n V_c,$$&lt;/div>
&lt;div class="math">$$\dot{I}_f
=
\frac{1}{L_f}
\left(
V_{\mathrm{ref}}
-
V_c
-
R_f I_f
\right)
- j\omega_n I_f.$$&lt;/div>&lt;p>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,&lt;/p>
&lt;div class="math">$$\dot{\mathbf{x}}
\approx
\mathbf{A}\mathbf{x}
+
\mathbf{B}\mathbf{u}
+
\mathbf{E},$$&lt;/div>
&lt;div class="math">$$\mathbf{y}
\approx
\mathbf{C}\mathbf{x}
+
\mathbf{D}\mathbf{u}
+
\mathbf{F},$$&lt;/div>&lt;p>which is then discretized and stamped into the network equations.&lt;/p>
&lt;p>How this is arranged in code, together with the source and the runnable examples, is covered under
&lt;a href="https://dpsim.fein-aachen.org/docs/developer-guide/model-implementations/dp-ph1-averaged-vsi-implementation/">DP Ph1 averaged VSI implementation&lt;/a>.&lt;/p></description></item><item><title>Docs: DP Ph3 Averaged Voltage Source Inverter</title><link>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/dp-ph3-averaged-vsi/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/dp-ph3-averaged-vsi/</guid><description>
&lt;p>This model extends the single-phase grid-following averaged inverter to the three-phase dynamic-phasor (DP) domain.
Each phase of the LC filter is represented by an independent complex envelope, $V_{c,a/b/c}$ and $I_{f,a/b/c}$, in contrast to the single positive-sequence envelope of the single-phase model, whereas the controller retains a single positive-sequence $dq$ frame shared by the PLL, the power filter, and the outer and inner control loops.
As in the single-phase case, the control states are baseband quantities and remain real-valued; only the six per-phase filter envelopes are carrier-band quantities, and each carries the $-j\omega_n$ frequency shift introduced in &lt;a href="https://dpsim.fein-aachen.org/docs/concepts/state-space-nodal/">State-Space Nodal&lt;/a>.&lt;/p>
&lt;p>The terminal input is the PCC voltage envelope of the three phases,&lt;/p>
&lt;div class="math">$$u = \begin{bmatrix} U_a &amp; U_b &amp; U_c \end{bmatrix}^\top ,$$&lt;/div>&lt;p>and the state vector concatenates the 6 complex per-phase envelopes ahead of the 8 real control states, keeping the carrier-band and baseband blocks separate,&lt;/p>
&lt;div class="math">$$\mathbf{x} =
\big[\,
V_{c,a} \;\;
V_{c,b} \;\;
V_{c,c} \;\;
I_{f,a} \;\;
I_{f,b} \;\;
I_{f,c} \;\;
\psi \;\;
\phi_{\mathrm{PLL}} \;\;
P \;\;
Q \;\;
\phi_d \;\;
\phi_q \;\;
\gamma_d \;\;
\gamma_q
\,\big]^\top ,$$&lt;/div>&lt;p>where $\psi := \theta_{\mathrm{PLL}} - \omega_n t$ again denotes the deviation of the PLL angle from the nominal carrier phase, retained as a state to preserve relinearization accuracy. Each per-phase envelope contributes its real and imaginary parts to the packed real vector, yielding 20 real states in total, or 22 with the optional negative-sequence loop described below.&lt;/p>
&lt;p>The model output is the per-phase interface current injected into the MNA system,&lt;/p>
&lt;div class="math">$$y_p = \frac{U_p - V_{c,p}}{R_c}, \qquad p \in \{a, b, c\}.$$&lt;/div>&lt;h2 id="model-equations">Model equations&lt;/h2>
&lt;p>The main extension relative to &lt;code>DP::Ph1&lt;/code> is the per-phase projection onto, and redistribution from, the single positive-sequence $dq$ control frame.
The three capacitor-voltage envelopes are projected onto a single positive-sequence phasor,&lt;/p>
&lt;div class="math">$$\underline{V}_c = V_{c,a} + a\, V_{c,b} + a^2 V_{c,c},
\qquad a = e^{\,j 2\pi/3},$$&lt;/div>&lt;p>and the PCC input $\underline{U}$ is projected identically, so that the coupling-current envelope seen by the controller is $\underline{I}_{rc} = (\underline{V}_c - \underline{U})/R_c$, with positive current again denoting injection from the inverter into the grid.
The $dq$ quantities are obtained by rotating the projected envelopes by $\psi$,&lt;/p>
&lt;div class="math">$$V_{c,dq} = \tfrac{1}{2}\sqrt{\tfrac{2}{3}}\, e^{-j\psi}\, \underline{V}_c,
\qquad
I_{rc,dq} = \tfrac{1}{2}\sqrt{\tfrac{2}{3}}\, e^{-j\psi}\, \underline{I}_{rc},$$&lt;/div>&lt;p>with $v_{c,d} = \operatorname{Re}{V_{c,dq}}$, $v_{c,q} = \operatorname{Im}{V_{c,dq}}$, and analogously for $i_{rc,d}$ and $i_{rc,q}$.
Taken together, the $1\times 3$ projection, the scalar $dq$ rotation, and the $3\times 1$ redistribution defined below constitute a rank-one $3\times 3$ Park mapping on the envelope triple, which reduces to the single-envelope relation of &lt;code>DP::Ph1&lt;/code> under balanced operation.&lt;/p>
&lt;p>The positive-sequence active and reactive power measurements used by the controller are&lt;/p>
&lt;div class="math">$$p = v_{c,d} i_{rc,d} + v_{c,q} i_{rc,q},
\qquad
q = -v_{c,d} i_{rc,q} + v_{c,q} i_{rc,d},$$&lt;/div>&lt;p>with the projection scaling chosen so that $p$ and $q$ match the total three-phase active and reactive powers under balanced operation; under unbalanced operation they are the positive-sequence components seen by the single-frame controller.&lt;/p>
&lt;p>The control chain from the PLL through the inner current loop is identical in form to that of &lt;code>DP::Ph1&lt;/code> and operates on the single positive-sequence $dq$ pair. The PLL and power-filter dynamics read&lt;/p>
&lt;div class="math">$$\dot{\psi}
=
K_{p,\mathrm{PLL}} v_{c,q} +
K_{i,\mathrm{PLL}} \phi_{\mathrm{PLL}},
\qquad
\dot{\phi}_{\mathrm{PLL}} = v_{c,q},$$&lt;/div>
&lt;div class="math">$$\dot{P} = \omega_c(p - P),
\qquad
\dot{Q} = \omega_c(q - Q).$$&lt;/div>&lt;p>The outer power-control integrators and current references are&lt;/p>
&lt;div class="math">$$\dot{\phi}_d = P_{\mathrm{ref}} - P,
\qquad
\dot{\phi}_q = Q - Q_{\mathrm{ref}},$$&lt;/div>
&lt;div class="math">$$i_{d,\mathrm{ref}}
=
K_{p,P}(P_{\mathrm{ref}} - P) + K_{i,P}\phi_d,
\qquad
i_{q,\mathrm{ref}}
=
K_{p,P}(Q - Q_{\mathrm{ref}}) + K_{i,P}\phi_q,$$&lt;/div>&lt;p>and the inner current-control integrators and voltage references are&lt;/p>
&lt;div class="math">$$\dot{\gamma}_d = i_{d,\mathrm{ref}} - i_{rc,d},
\qquad
\dot{\gamma}_q = i_{q,\mathrm{ref}} - i_{rc,q},$$&lt;/div>
&lt;div class="math">$$v_{d,\mathrm{ref}}
=
K_{p,I}(i_{d,\mathrm{ref}} - i_{rc,d}) +
K_{i,I}\gamma_d,
\qquad
v_{q,\mathrm{ref}}
=
K_{p,I}(i_{q,\mathrm{ref}} - i_{rc,q}) +
K_{i,I}\gamma_q.$$&lt;/div>&lt;p>The single $dq$ voltage reference $V_{\mathrm{ref},dq} = v_{d,\mathrm{ref}} + j v_{q,\mathrm{ref}}$ is redistributed to the per-phase bridge-voltage envelopes through the inverse projection,&lt;/p>
&lt;div class="math">$$V_{\mathrm{ref},p} = \bar{a}_p \sqrt{\tfrac{2}{3}}\, V_{\mathrm{ref},dq}\, e^{j\psi},
\qquad
\bar{a}_{a/b/c} = \{1,\; a^2,\; a\},$$&lt;/div>&lt;p>so that all three phases are driven by the same positive-sequence command.&lt;/p>
&lt;p>The LC-filter dynamics are decoupled per phase within the plant and carry the carrier shift of the envelope explicitly,&lt;/p>
&lt;div class="math">$$\dot{V}_{c,p}
=
\frac{1}{C_f} I_{f,p}
+
\frac{1}{C_f R_c}(U_p - V_{c,p})
- j\omega_n V_{c,p},$$&lt;/div>
&lt;div class="math">$$\dot{I}_{f,p}
=
\frac{1}{L_f}
\left(
V_{\mathrm{ref},p}
-
V_{c,p}
-
R_f I_{f,p}
\right)
- j\omega_n I_{f,p},$$&lt;/div>&lt;p>the phases being coupled only through the shared control chain, that is, through $V_{\mathrm{ref},p}$.&lt;/p>
&lt;p>At each simulation step the nonlinear model is linearized about the current operating point into the affine state-space form, with the real and imaginary parts of the 6 complex per-phase envelopes and the 8 real control states packed into a single real 20-vector,&lt;/p>
&lt;div class="math">$$\dot{\mathbf{x}}
\approx
\mathbf{A}\mathbf{x}
+
\mathbf{B}\mathbf{u}
+
\mathbf{E},
\qquad
\mathbf{y}
\approx
\mathbf{C}\mathbf{x}
+
\mathbf{D}\mathbf{u}
+
\mathbf{F},$$&lt;/div>&lt;p>which is subsequently discretized and stamped into the DP MNA system.&lt;/p>
&lt;p>In this default configuration the controller operates in a single positive-sequence $dq$ frame, so only the positive-sequence component of an unbalanced terminal is regulated. The negative-sequence response is present in the per-phase filter envelopes but is not itself a control state, and the $2\omega_n$ ripple it would otherwise induce in the $dq$ frame is therefore not represented.&lt;/p>
&lt;h2 id="optional-negative-sequence-current-control">Optional negative-sequence current control&lt;/h2>
&lt;p>A second, negative-sequence current-control loop can be added alongside the positive-sequence one, giving the dual-sequence structure of Yazdani and Iravani, chapter 8. The two configurations answer different questions: without the loop the model has the same 20 states and the same eigenvalue count as its &lt;code>EMT::Ph3&lt;/code> counterpart, which is what a cross-domain comparison requires, while with it the model gains 2 states and can regulate an unbalanced terminal.&lt;/p>
&lt;p>The negative-sequence quantities are obtained by projecting the same three envelopes onto the conjugate sequence set,&lt;/p>
&lt;div class="math">$$\underline{V}_c^- = V_{c,a} + a^2 V_{c,b} + a\, V_{c,c},
\qquad
\underline{I}_{rc}^- = \frac{\underline{V}_c^- - \underline{U}^-}{R_c}.$$&lt;/div>&lt;p>A negative-sequence component rotates backwards relative to the PLL frame, so in envelope terms its $dq$ image follows from conjugating the projected phasor and rotating by $+\psi$ rather than $-\psi$,&lt;/p>
&lt;div class="math">$$I_{rc,dq}^- = \tfrac{1}{2}\sqrt{\tfrac{2}{3}}\, e^{\,j\psi}\, \overline{\underline{I}_{rc}^-} .$$&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Both sequence images are baseband&lt;/h4>
This is what keeps the extension cheap. The negative-sequence loop costs only the two real integrator states $\gamma_{nd}$ and $\gamma_{nq}$, with no second carrier and no $2\omega_n$ term anywhere in the model.
&lt;/div>
&lt;p>The loop itself is the same PI structure as the positive-sequence inner loop,&lt;/p>
&lt;div class="math">$$\dot{\gamma}_{nd} = i_{nd,\mathrm{ref}} - i_{rc,nd},
\qquad
\dot{\gamma}_{nq} = i_{nq,\mathrm{ref}} - i_{rc,nq},$$&lt;/div>
&lt;div class="math">$$v_{nd,\mathrm{ref}}
=
K_{p,I}(i_{nd,\mathrm{ref}} - i_{rc,nd}) +
K_{i,I}\gamma_{nd},
\qquad
v_{nq,\mathrm{ref}}
=
K_{p,I}(i_{nq,\mathrm{ref}} - i_{rc,nq}) +
K_{i,I}\gamma_{nq},$$&lt;/div>&lt;p>reusing the inner-loop gains $K_{p,I}$ and $K_{i,I}$. Its output is redistributed to the per-phase bridge voltages through the sequence-orthogonal set, and adds to the positive-sequence command of the previous section,&lt;/p>
&lt;div class="math">$$V_{\mathrm{ref},p}
=
\bar{a}_p \sqrt{\tfrac{2}{3}}\, V_{\mathrm{ref},dq}\, e^{j\psi}
+
a_p \sqrt{\tfrac{2}{3}}\, \overline{V_{\mathrm{ref},dq}^-}\, e^{j\psi},
\qquad
a_{a/b/c} = \{1,\; a,\; a^2\}.$$&lt;/div>&lt;p>The two references $i_{nd,\mathrm{ref}}$ and $i_{nq,\mathrm{ref}}$ default to zero, which makes the loop a negative-sequence suppressor. A non-zero pair commands a deliberate negative-sequence injection instead, as required by some unbalanced fault ride-through grid codes.&lt;/p>
&lt;p>The state vector grows to 22 by appending the two integrators after the control block, so that the envelope and positive-sequence control indices are unaffected. Under a single-line-to-ground fault, enabling the loop suppresses the negative-sequence component of the injected current by about 40 percent while moving the positive-sequence component by less than 0.1 percent.&lt;/p>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>M. Mirz, S. Vogel, G. Reinke, and A. Monti, “DPsim: A dynamic phasor real-time simulator for power systems,” &lt;em>SoftwareX&lt;/em>, vol. 10, art. 100253, 2019. &lt;a href="https://doi.org/10.1016/j.softx.2019.100253">https://doi.org/10.1016/j.softx.2019.100253&lt;/a>&lt;/li>
&lt;li>A. Yazdani and R. Iravani, &lt;em>Voltage-Sourced Converters in Power Systems: Modeling, Control, and Applications&lt;/em>. Hoboken, NJ: Wiley-IEEE Press, 2010. &lt;a href="https://ieeexplore.ieee.org/book/5237659">https://ieeexplore.ieee.org/book/5237659&lt;/a>&lt;/li>
&lt;li>X. Gao, D. Zhou, A. Anvari-Moghaddam, and F. Blaabjerg, “Stability Analysis of Grid-Following and Grid-Forming Converters Based on State-Space Model,” in &lt;em>Proc. 2022 International Power Electronics Conference (IPEC-Himeji 2022, ECCE Asia)&lt;/em>, pp. 422–428. &lt;a href="https://ieeexplore.ieee.org/document/9806927">https://ieeexplore.ieee.org/document/9806927&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>How this is arranged in code, together with the source and the runnable examples, is covered under
&lt;a href="https://dpsim.fein-aachen.org/docs/developer-guide/model-implementations/dp-ph3-averaged-vsi-implementation/">DP Ph3 averaged VSI implementation&lt;/a>.&lt;/p></description></item><item><title>Docs: EMT Ph3 Grid-Forming Inverter</title><link>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/emt-ph3-grid-forming-vsi/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dpsim.fein-aachen.org/docs/concepts/models/power-electronics/emt-ph3-grid-forming-vsi/</guid><description>
&lt;p>This model represents a grid-forming averaged voltage source inverter in the EMT domain.
The control structure follows the state-space grid-forming converter of &lt;a href="https://ieeexplore.ieee.org/document/9806927">Gao2022&lt;/a> (VSG algorithm loop, voltage loop, current loop with active damping), whose grid-following counterpart in the same paper is the basis for the averaged inverter above; the inner voltage/current control and LC filter modeling follow &lt;a href="https://ieeexplore.ieee.org/book/5237659">Yazdani2010&lt;/a>.
Like the grid-following inverter above it is a variable state-space nodal component stamped directly into the MNA system, but instead of a PLL that locks to the grid it carries its own virtual synchronous machine (VSG): the internal angle and voltage magnitude are states driven by active- and reactive-power balance, so the inverter imposes a voltage and can run islanded.
The model includes the VSG swing dynamics, a reactive-power/voltage excitation loop, filtered active/reactive power measurement, a cascaded voltage and current controller, a first-order converter/digital-delay approximation, and an LC filter with coupling resistance to the grid node.&lt;/p>
&lt;p>The terminal input is the PCC voltage vector&lt;/p>
&lt;div class="math">$$\mathbf{u} =
\begin{bmatrix}
u_a &amp; u_b &amp; u_c
\end{bmatrix}^\top ,$$&lt;/div>&lt;p>and the 17-element state vector is&lt;/p>
&lt;div class="math">$$\mathbf{x} =
\begin{bmatrix}
P &amp; Q &amp; \omega &amp; \theta &amp; E &amp;
\xi_{v,d} &amp; \xi_{v,q} &amp;
\xi_{i,d} &amp; \xi_{i,q} &amp;
v_{\mathrm{del},d} &amp; v_{\mathrm{del},q} &amp;
v_{c,a} &amp; v_{c,b} &amp; v_{c,c} &amp;
i_{f,a} &amp; i_{f,b} &amp; i_{f,c}
\end{bmatrix}^\top ,$$&lt;/div>&lt;p>where $\theta$ is the VSG angle (there is no PLL), $E$ is the excitation-controlled voltage magnitude, $\xi_{v}$, $\xi_{i}$ are the voltage- and current-loop integrators, and $v_{\mathrm{del}}$ are the two delay states.&lt;/p>
&lt;p>The model output is the interface current injected into the MNA system,&lt;/p>
&lt;div class="math">$$\mathbf{y} =
\frac{\mathbf{u} - \mathbf{v}_c}{R_c}.$$&lt;/div>&lt;h2 id="control-structure">Control structure&lt;/h2>
&lt;div class="mermaid">
graph LR
U["PCC voltage u"] --> FILT["LC filter&lt;br/>vc, if"]
FILT --> MEAS["Power measurement&lt;br/>p, q"]
MEAS --> PF["Measurement filters&lt;br/>P, Q"]
PF -->|P| SWING["VSG swing&lt;br/>omega, theta"]
PF -->|Q| EXC["Excitation /&lt;br/>Q-V droop -> E"]
EXC --> VZ["Virtual impedance&lt;br/>E - Zv*if"]
VZ --> VCTRL["Voltage controller&lt;br/>-> i_ref"]
VCTRL --> ICTRL["Current controller&lt;br/>-> v_conv"]
ICTRL --> DELAY["Converter delay"]
DELAY --> FILT
SWING -->|theta| VCTRL
FILT --> Y["Interface current y"]
&lt;/div>
&lt;p>The virtual synchronous machine sets the internal angle from the active-power balance and the internal magnitude from the reactive-power/voltage loop; the cascaded voltage and current controllers then track that internal reference through the LC filter. The dashed grid-connected extensions (virtual impedance, feed-forward scaling, Q-V droop) are described below.&lt;/p>
&lt;h2 id="model-equations">Model equations&lt;/h2>
&lt;p>The physical grid current, positive for injection into the grid, is&lt;/p>
&lt;div class="math">$$\mathbf{i}_g = \frac{\mathbf{v}_c - \mathbf{u}}{R_c}.$$&lt;/div>&lt;p>All dq quantities use the VSG angle $\theta$ (amplitude-invariant Park transform $\mathbf{T}(\theta)$),&lt;/p>
&lt;div class="math">$$\mathbf{v}_{c,dq} = \mathbf{T}(\theta)\mathbf{v}_c, \qquad
\mathbf{i}_{f,dq} = \mathbf{T}(\theta)\mathbf{i}_f, \qquad
\mathbf{i}_{g,dq} = \mathbf{T}(\theta)\mathbf{i}_g,$$&lt;/div>&lt;p>and the capacitor current is $\mathbf{i}&lt;em>{\mathrm{cap},dq} = \mathbf{i}&lt;/em>{f,dq} - \mathbf{i}_{g,dq}$.
Because the Park transform is amplitude invariant, three-phase instantaneous power carries the factor $3/2$,&lt;/p>
&lt;div class="math">$$p = \tfrac{3}{2}\,(v_{c,d} i_{g,d} + v_{c,q} i_{g,q}),
\qquad
q = \tfrac{3}{2}\,(v_{c,q} i_{g,d} - v_{c,d} i_{g,q}),$$&lt;/div>&lt;p>and the PCC voltage magnitude is $U_{\mathrm{pcc}} = \sqrt{v_{c,d}^2 + v_{c,q}^2}$.&lt;/p>
&lt;p>The measurement filters are first-order lags,&lt;/p>
&lt;div class="math">$$\dot{P} = \omega_c(p - P),
\qquad
\dot{Q} = \omega_c(q - Q).$$&lt;/div>&lt;p>The VSG swing equation sets the angle from the active-power balance,&lt;/p>
&lt;div class="math">$$J\dot{\omega} = \frac{P_{\mathrm{ref}} - P}{\omega} - D(\omega - \omega_n),
\qquad
\dot{\theta} = \omega,$$&lt;/div>&lt;p>with virtual inertia $J$ and damping $D$.
The reactive-power/voltage excitation controller sets the internal magnitude,&lt;/p>
&lt;div class="math">$$\dot{E} = K_q(Q_{\mathrm{ref}} - Q) + K_u(U_n - U_{\mathrm{pcc}}),$$&lt;/div>&lt;p>an integral law on the reactive error with a voltage-droop term.
The excitation defines the dq voltage reference; in the islanded model it is aligned with the d-axis,&lt;/p>
&lt;div class="math">$$v_{d,\mathrm{ref}} = E, \qquad v_{q,\mathrm{ref}} = 0 .$$&lt;/div>&lt;p>The voltage controller integrates the voltage error and forms the current reference with the capacitor-current feed-forward and dq decoupling,&lt;/p>
&lt;div class="math">$$\dot{\xi}_{v,d} = v_{d,\mathrm{ref}} - v_{c,d},
\qquad
\dot{\xi}_{v,q} = v_{q,\mathrm{ref}} - v_{c,q},$$&lt;/div>
&lt;div class="math">$$i_{d,\mathrm{ref}} = i_{g,d} - \omega C_f v_{c,q}
+ K_{p,V}(v_{d,\mathrm{ref}} - v_{c,d}) + K_{i,V}\xi_{v,d},$$&lt;/div>
&lt;div class="math">$$i_{q,\mathrm{ref}} = i_{g,q} + \omega C_f v_{c,d}
+ K_{p,V}(v_{q,\mathrm{ref}} - v_{c,q}) + K_{i,V}\xi_{v,q}.$$&lt;/div>&lt;p>The current controller integrates the current error and forms the converter voltage reference, with inductor decoupling and optional active damping on the capacitor current,&lt;/p>
&lt;div class="math">$$\dot{\xi}_{i,d} = i_{d,\mathrm{ref}} - i_{f,d},
\qquad
\dot{\xi}_{i,q} = i_{q,\mathrm{ref}} - i_{f,q},$$&lt;/div>
&lt;div class="math">$$v_{d,\mathrm{conv}} = v_{c,d} - \omega L_f i_{f,q}
+ K_{p,I}(i_{d,\mathrm{ref}} - i_{f,d}) + K_{i,I}\xi_{i,d} - K_{ad} i_{\mathrm{cap},d},$$&lt;/div>
&lt;div class="math">$$v_{q,\mathrm{conv}} = v_{c,q} + \omega L_f i_{f,d}
+ K_{p,I}(i_{q,\mathrm{ref}} - i_{f,q}) + K_{i,I}\xi_{i,q} - K_{ad} i_{\mathrm{cap},q}.$$&lt;/div>&lt;p>A first-order lag approximates the converter/digital delay,&lt;/p>
&lt;div class="math">$$\dot{v}_{\mathrm{del},d} = \omega_d(v_{d,\mathrm{conv}} - v_{\mathrm{del},d}),
\qquad
\dot{v}_{\mathrm{del},q} = \omega_d(v_{q,\mathrm{conv}} - v_{\mathrm{del},q}),$$&lt;/div>&lt;p>and its output, transformed back to abc as $\mathbf{v}&lt;em>{\mathrm{inv}} = \mathbf{T}^{-1}(\theta),[v&lt;/em>{\mathrm{del},d}\ v_{\mathrm{del},q}]^\top$, drives the LC filter,&lt;/p>
&lt;div class="math">$$\dot{\mathbf{v}}_c = \frac{1}{C_f}\left(\mathbf{i}_f + \frac{\mathbf{u} - \mathbf{v}_c}{R_c}\right),
\qquad
\dot{\mathbf{i}}_f = \frac{1}{L_f}\left(\mathbf{v}_{\mathrm{inv}} - \mathbf{v}_c - R_f\mathbf{i}_f\right).$$&lt;/div>&lt;h2 id="grid-connected-control-extensions">Grid-connected control extensions&lt;/h2>
&lt;p>The equations above describe the islanded inverter. Three opt-in extensions adapt it to a stiff grid; each defaults to the value that recovers the islanded model exactly, so the eigenstructure is unchanged unless a setter is called.&lt;/p>
&lt;p>&lt;strong>Virtual output impedance.&lt;/strong> A virtual impedance $Z_v = R_v + jX_v$ is subtracted from the excitation to form the voltage reference, using the filter current $\mathbf{i}_{f,dq}$,&lt;/p>
&lt;div class="math">$$v_{d,\mathrm{ref}} + j v_{q,\mathrm{ref}}
= E - Z_v\,(i_{f,d} + j i_{f,q}),$$&lt;/div>&lt;p>i.e.&lt;/p>
&lt;div class="math">$$v_{d,\mathrm{ref}} = E - (R_v i_{f,d} - X_v i_{f,q}),
\qquad
v_{q,\mathrm{ref}} = -(R_v i_{f,q} + X_v i_{f,d}).$$&lt;/div>&lt;p>$Z_v = 0$ recovers $v_{d,\mathrm{ref}} = E,\ v_{q,\mathrm{ref}} = 0$.
A finite $R_v$ adds a current-proportional term opposing motion, damping the power-synchronization loop on a stiff grid at the electrical timescale, an alternative to raising the mechanical damping $D$.
The drop is taken off the filter-current &lt;em>state&lt;/em> $\mathbf{i}_f$ rather than the algebraically reconstructed grid current $\mathbf{i}_g = (\mathbf{v}_c-\mathbf{u})/R_c$; the latter would multiply the reference by a factor $\propto 1/R_c$, amplifying state and linearization error.&lt;/p>
&lt;p>&lt;strong>Grid-current feed-forward scale.&lt;/strong> A scalar $\kappa$ scales the grid-current feed-forward in the current reference,&lt;/p>
&lt;div class="math">$$i_{d,\mathrm{ref}} = \kappa\, i_{g,d} - \omega C_f v_{c,q} + \dots,
\qquad
i_{q,\mathrm{ref}} = \kappa\, i_{g,q} + \omega C_f v_{c,d} + \dots,$$&lt;/div>&lt;p>with $\kappa = 1$ the default full feed-forward.&lt;/p>
&lt;p>&lt;strong>Proportional reactive-power droop.&lt;/strong> When a cutoff $\omega_q &amp;gt; 0$ is set, the integral excitation is replaced by a proportional Q-V droop,&lt;/p>
&lt;div class="math">$$\dot{E} = \omega_q\big(E_{\mathrm{set}} + D_q(Q_{\mathrm{ref}} - Q) - E\big),$$&lt;/div>&lt;p>a first-order lag with a stable fixed point $E^* = E_{\mathrm{set}} + D_q(Q_{\mathrm{ref}} - Q)$ and pole at $-\omega_q$.
On a stiff grid the network fixes $U_{\mathrm{pcc}}$, so the reactive error $Q_{\mathrm{ref}} - Q$ cannot be driven to zero and the integral law $\dot E = K_q(Q_{\mathrm{ref}} - Q) + K_u(U_n - U_{\mathrm{pcc}})$ has no reachable equilibrium (reactive windup); the proportional droop always has one.
The setpoint $E_{\mathrm{set}}$ is captured at initialization as the operating magnitude, so $\dot{E} = 0$ when $Q = Q_{\mathrm{ref}}$ at $t = 0$.&lt;/p>
&lt;h2 id="linearization-and-stamping">Linearization and stamping&lt;/h2>
&lt;p>The model is nonlinear (Park transforms with the moving angle $\theta$, the $1/\omega$ swing term, the power products). It is not linearized by hand; at each simulation step the state and output Jacobians are computed by central finite differences of the nonlinear functions $\mathbf{f}(\mathbf{x},\mathbf{u}) = \dot{\mathbf{x}}$ and $\mathbf{g}(\mathbf{x},\mathbf{u}) = \mathbf{y}$,&lt;/p>
&lt;div class="math">$$\mathbf{A} = \frac{\partial \mathbf{f}}{\partial \mathbf{x}},\quad
\mathbf{B} = \frac{\partial \mathbf{f}}{\partial \mathbf{u}},\quad
\mathbf{C} = \frac{\partial \mathbf{g}}{\partial \mathbf{x}},\quad
\mathbf{D} = \frac{\partial \mathbf{g}}{\partial \mathbf{u}},$$&lt;/div>&lt;p>each column $j$ evaluated as $[\mathbf{f}(\mathbf{x}+\delta_j\mathbf{e}_j,\mathbf{u}) - \mathbf{f}(\mathbf{x}-\delta_j\mathbf{e}_j,\mathbf{u})]/(2\delta_j)$ with a mixed relative/absolute step $\delta_j$.
Because the grid-connected extensions above all enter through $\mathbf{f}$, they are captured in $\mathbf{A}$, $\mathbf{B}$, $\mathbf{C}$ and $\mathbf{D}$ automatically.
The affine offsets fix the model to the current operating point,&lt;/p>
&lt;div class="math">$$\mathbf{E} = \mathbf{f}(\mathbf{x}_0,\mathbf{u}_0) - \mathbf{A}\mathbf{x}_0 - \mathbf{B}\mathbf{u}_0,
\qquad
\mathbf{F} = \mathbf{g}(\mathbf{x}_0,\mathbf{u}_0) - \mathbf{C}\mathbf{x}_0 - \mathbf{D}\mathbf{u}_0,$$&lt;/div>&lt;p>giving the affine state-space form&lt;/p>
&lt;div class="math">$$\dot{\mathbf{x}} \approx \mathbf{A}\mathbf{x} + \mathbf{B}\mathbf{u} + \mathbf{E},
\qquad
\mathbf{y} \approx \mathbf{C}\mathbf{x} + \mathbf{D}\mathbf{u} + \mathbf{F},$$&lt;/div>&lt;p>The dq/abc transformations and the nonlinear controls make this local model time varying, so it holds only in a neighbourhood of the operating point it was formed at.&lt;/p>
&lt;p>How the linearization is carried out and stamped, together with the source and the runnable examples, is covered under
&lt;a href="https://dpsim.fein-aachen.org/docs/developer-guide/model-implementations/emt-ph3-grid-forming-vsi-implementation/">EMT Ph3 grid-forming VSI implementation&lt;/a>.&lt;/p>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>&lt;a name="Gao2022">&lt;/a>[Gao2022] X. Gao, D. Zhou, A. Anvari-Moghaddam, and F. Blaabjerg, &amp;ldquo;Stability Analysis of Grid-Following and Grid-Forming Converters Based on State-Space Model,&amp;rdquo; in &lt;em>2022 International Power Electronics Conference (IPEC-Himeji 2022 - ECCE Asia)&lt;/em>, 2022, pp. 422-428. Source of both the grid-following and grid-forming state-space control structures. Its eigenvalue analysis finds grid-following control better suited to a stiff grid and grid-forming control to a weak grid; the grid-connected extensions above (virtual impedance, Q-V droop) are what let the grid-forming model stay stable when connected to a stiff grid.&lt;/li>
&lt;li>&lt;a name="Yazdani2010">&lt;/a>[Yazdani2010] A. Yazdani and R. Iravani, &lt;em>Voltage-Sourced Converters in Power Systems: Modeling, Control, and Applications&lt;/em>. Hoboken, NJ: Wiley-IEEE Press, 2010. Basis for the inner voltage/current control and LC-filter modeling of both inverters.&lt;/li>
&lt;/ul></description></item></channel></rss>