# RMS Modeling and Control of a Grid-Forming E-STATCOM for Power System Stability in Isolated Grids
## 3 GFM Converter Modeling and Control
### GFM Model  
A vector diagram of the AC voltages and currents of the GFM model is presented in Figure 3a. The \(DQ\) axes are considered as the global reference frame rotating at the fundamental frequency \(\omega_{0}\), with axis \(D\) as the angular reference. The internal voltage angle \(\delta\) defines the q-axis of another reference frame rotating at frequency \(\omega\), aligning with the vector \(\vec{E}=Ee^{i\delta}\). When the GFM converter is synchronized to the grid, both frequencies, \(\omega_{0}\) and \(\omega\), are the same. The GFM acts as a real voltage source, where its magnitude \(E\) and angle \(\delta\) are variable states of the GFM model. The GFM output filter dynamics is neglected to ensure compatibility with the transmission network so that it is represented as a complex impedance \(Z_{G}e^{i\varphi}=R_{G}+jX_{G}\), the inverse of which is the admittance \(\vec{Y}=G_{G}+jB_{G}\). The current vector injected into the grid is determined through the Norton equivalent, as depicted in Figure 3b and expressed in Equation (1),  
\[I_{DG}+jl_{QG}=I_{G}e^{i\gamma}=(G_{G}+jB_{G})(Ee^{i\delta}-V_{G}e^{i\theta}) \tag{1}\]  
and separated into real and imaginary parts in Equations (2) and (3):  
\[I_{DG} =G_{G}(E\cos\delta-V_{G}\cos\theta)-B_{G}(E\sin\delta-V_{G}\sin\theta) \tag{2}\] \[I_{QG} =G_{G}(E\sin\delta-V_{G}\sin\theta)+B_{G}(E\cos\delta-V_{G}\cos\theta) \tag{3}\]  
When the current vector \(I_{DG}+jl_{QG}\) is expressed in a reference frame aligned to the voltage \(V_{G}e^{i\theta}\), the active and reactive components are obtained as follows,  
\[I_{aG}+jl_{FG}=(I_{DG}+jl_{QG})e^{-i\theta}=(G_{G}+jB_{G})(Ee^{i(\delta-\theta )}-V_{G}) \tag{4}\]  
and this is separated into real and imaginary parts in Equations (5) and (6):  
\[I_{aG} =G_{G}(E\cos\left(\delta-\theta\right)-V_{G})-B_{G}E\sin\left( \delta-\theta\right) \tag{5}\] \[I_{FG} =G_{G}E\sin\left(\delta-\theta\right)+B_{G}(E\cos\left(\delta- \theta\right)-V_{G}) \tag{6}\]  
Figure 3: Vector diagram and Norton equivalent of the GFM converter. (**a**) Vector diagram. (**b**) Norton equivalent. These two components, \(I_{aG}\) and \(I_{rG}\), are derived separately to ensure that each can be limited independently, thereby ensuring that the current does not surpass the maximum limit set for the GFM. Active and reactive power are then directly calculated in per unit (p.u.) using Equations (5) and (6), as per Equation (7),  
\[P_{G}+jQ_{G}=V_{G}(I_{aG}-jI_{rG}) \tag{7}\]  
so that, active power \(P_{G}\) is proportional to the active current \(I_{aG}\) and the voltage magnitude \(V_{G}\). Similarly, the reactive power \(Q_{G}\) is given by the product of \(V_{G}\) and the reactive current \(I_{rG}\), but with a minus sign. When the complex impedance \(Z_{G}e^{j\varphi}\) has only an imaginary part, \(G_{G}=0\) and \(B_{G}=-1/X_{G}\); substituting these values of the complex admittance into Equations (5) and (6) yields the well-known expressions for active and reactive power, with all variables in p.u [34], as given by Equations (8) and (9). \[P_{G}=\frac{V_{G}}{X_{G}}E\sin{(\delta-\theta)} \tag{8}\] \[Q_{G}=\frac{V_{G}}{X_{G}}(E\cos{(\delta-\theta)}-V_{G}) \tag{9}\]  
As shown in Figure 2, the GFM model provides the active and reactive current limits to the control blocks. In general, for a GFM operating as a static synchronous compensator, these limits are variable to optimize its performance. For instance, when there is no frequency change in the grid, the GFM does not exchange active power, and its active current limit \(I_{aG}^{max}\) could be zero. All the current capacity of the converter \(I_{G}^{max}\) is used to exchange reactive power for voltage control, so that \(I_{rG}^{max}=I_{G}^{max}\). On the contrary, when no reactive power is required, all the current capacity could also be active, and \(I_{aG}^{max}=I_{G}^{max}\). However, it is interesting to allocate part of the current for voltage control since the frequency response can last several seconds or even minutes, and therefore \(I_{rG}^{max}\) should be nonzero.