# Multi-Timescale Control of Variable-Speed Wind Turbine for Inertia Provision
## 2 Principle of Inertia Emulation
### Inertia Provision Principle  
To achieve this objective, the output power of renewable energy resources (RESs) needs to be coupled with the power grid frequency. Figure 5 illustrates the inertia provision principle, where \(H_{v}\) is the virtual inertia provided by RESs, and \(\Delta P_{i\_pu}\) is the output power variation of the RES. From Figure 5, it can be seen that the power system frequency variation, \(\Delta f_{\_pu}\), is given by:  
\[\frac{d}{dt}\Delta f_{\_pu}=\frac{1}{2H_{  
approach for RoCoF value calculation [33; 34]. Initially, the grid voltage waveform is obtained, and its frequency, \(f_{g}\), can be detected through zero crossing or Fourier transformation. Then, a derivation block is implemented to calculate \(df_{g}/dt\), i.e., RoCoF. However, directly differentiating the frequency signal would result in noise amplification and therefore a compromise the RoCoF calculation performance. To address this problem, a measuring window (defined as the number of frequency-measuring periods over which the RoCoF is calculated) is usually employed. However, there is a tradeoff between RoCoF measurement accuracy and noise-rejection capability. If the length of the measuring window is considerable, the noise due to the derivation can be well attenuated. However, the measured RoCoF value will be differ more from the real value. If the filtering capability of the measuring window is weak, the measured RoCoF would be closer to the real RoCoF, whereas noise cannot be attenuated well.  
To address this problem, a frequency-locked loop (FLL) is implemented in this paper for RoCoF calculation. In comparison with the conventional RoCoF calculation method, the FLL-based approach avoids the use of a derivation block and therefore provides noise-free RoCoF acquisition. Figure 6 displays the control block diagram of the FLL-based RoCoF acquisition, where \(v_{g}\) is the power grid voltage, \(k_{\text{P-fill}}\) and \(k_{\text{i-fill}}\) are the PI control parameters, and \(v_{\text{fill-}\alpha}\) and \(v_{\text{fill-}\beta}\) are the orthogonal signals obtained from a second-order generalized integrator (SOGI) [35; 36].  
From Figure 7, the frequency-domain transfer functions from \(v_{g}\) to \(v_{\text{fill-}\alpha}\) and from \(v_{g}\) to \(v_{\text{fill-}\beta}\) can be respectively derived as:  
\[\frac{v_{\text{fill-}\alpha}(s)}{v_{g}(s)}=\frac{\omega_{0}k_{\text{P-fill}} \cdot s}{s^{2}+\omega_{0}k_{\text{P-fill}}\cdot s+\omega_{0}^{2}} \tag{5}\]  
\[\frac{v_{\text{fill-}\beta}(s)}{v_{g}(s)}=\frac{\omega_{0}^{2}k_{\text{P-fill} }}{s^{2}+\omega_{0}k_{\text{P-fill}}\cdot s+\omega_{0}^{2}} \tag{6}\]  
At the fundamental frequency, \(\omega_{0}\), it can be derived from (5) and (6) that:  
\[|v_{\text{fill-}\alpha}(j\omega_{0})|=|v_{\text{fill-}\beta}(j\omega_{0})|=|v _{g}(j\omega_{0})|, \tag{7}\]  
Figure 6: Conventional method for acquiring the grid RoCoF value. Figure 7: Control block diagram of the FLL-based RoCoF acquisition. \[\angle v_{\rm fill-\alpha}(j\omega_{0})=\angle v_{g}(j\omega_{0})=\angle v_{\rm fill- \beta}(j\omega_{0})+\frac{\pi}{2}. \tag{8}\]  
from which it is known that \(v_{\rm fill-\alpha}\) is in-phase with the grid voltage, \(v_{g}\) (with the same magnitude), whereas \(v_{\rm fill-\beta}\) is orthogonal with \(v_{g}\) (with the same magnitude). On this basis, the FLL dynamically adjusts \(\Delta\omega_{g}\) through the integral controller, \(k_{\rm i-HI}\)/s. By doing so, the frequency input of the SOCI, i.e., \(\omega_{0}+\Delta\omega_{g}\), can track with the real grid frequency. It should be noted that there is an inherent integral controller before \(\omega_{0}+\Delta\omega\). Therefore, the RoCoF can be obtained from the input of this integral controller, as illustrated in Figure 7. To further attenuate harmonic distortions and also improve the performance of RoCoF calculation, a moving average filter (MAF) is incorporated into the control loop, the time window of which should be properly selected to be one fundamental period, i.e., 20 ms for the 50 Hz power system.