An Efficient Adaptive Virtual Inertia Controller for Virtual Synchronous Generators

This paper proposes an efficient adaptive strategy to control virtual inertia of virtual synchronous generators (VSGs). This adaptive virtual inertia can provide low frequency oscillation (LFO) damping and simultaneously improve primary frequency control (PFC) in power systems. The virtual inertia is synthesized by two components named the LFO and the PFC components. The former provides LFO damping. It increases the virtual inertia whenever the VSG frequency diverges from grid center-of-inertia (COI) frequency and decreases it when the VSG frequency converges to the COI frequency. The PFC component increases the virtual inertia after a power outage event until the COI frequency reaches its nadir in order to reduce the rate of grid frequency drop. Following frequency nadir instant, the PFC component decreases the virtual inertia to achieve a faster frequency recovery. The efficiency of the suggested method is validated through a power system with VSG penetration level ranges from 25% to 75% of the system generation rating. The achieved results verify the superiority of the proposed scheme in the PFC improving and the LFO damping in comparison with the existing methods. Moreover, the suggested approach decreases the required size of the VSG energy storage by about 15%.


Introduction
Inertia of a power system is defined as its ability to oppose deviations in system frequency due to resistance provided by kinetic energy of rotating shafts in turbinegenerators [1]. The rate-of-change-of-frequency (RoCoF) is inversely proportional to the system inertia [2]. It is believed that converter-based devices may constitute more than 50% of the rated capacity of future networks [3]. These devises do not inherently provide inertia to the system and then system inertia will be radically reduced [4]. Virtual synchronous generator (VSG) concept will take over the responsibility of inertia support in the converter-dominated grids [5]. By deploying this control scheme, power converters can emulate the static and dynamic features of synchronous generators (SGs) [6].
Primary frequency control (PFC) aims to maintain a balance between system generation and its demand, using turbine governors [7]. In this context, the system frequency should not fall below a given value to avoid load shedding. Thus, system frequency RoCoF should be restricted to a specified value to buy time for starting the PFC action [8].
In the other hand, sufficient damping of system low frequency oscillations (LFOs) must be available to ensure a stable system operation [9]. However, the converterdominated grids may affect the PFC proficiency and the LFO damping. To solve this problem, parameters of the VSGs can be set freely to improve stability of the low inertia power systems [10].
In the case of the LFO damping, there are several offline [11]- [16] and on-line [17]- [22] techniques set forth in the literature to control the virtual inertia and damping coefficient of the VSGs. In the off-line methods, the VSG parameters are determined at the design stage. It was shown that the desirable speed response of the VSG power could not be achieved by only adjusting the VSG virtual inertia [11]. To tackle this issue, the damping coefficient of the VSG can be modified through a correction loop based on the derivative of the VSG torque [11]. However, damping coefficient variation affects the VSG power dynamics distinguishably under discrepant operating conditions [12]. Therefore, the suggested method in [11] was improved to derive the virtual inertia and damping coefficient of the VSG according to specified mode of its power control loop [12]. The VSG concept has been extended to control voltage source converters (VSCs) in high-voltage direct current (HVDC) transmission systems [13]. It was revealed that phase-locked loop (PLL) of the VSG-based HVDC has a negative impact on its LFO damping [14]. This negative effect can be eliminated by a phase compensation to change the phase of the PLL equivalent torque [14]. An enhanced power system stabilizer (PSS) was proposed for the VSGs in [15]. The suggested PSS improves the LFO damping of the VSG without scarifying its inertial response. In this PSS, the VSG frequency deviation with respect to the grid frequency was estimated by derivative of a trigonometric function of the VSG output voltage [15]. The VSG parameters setting should avoid modal proximity of the VSG to the LFO mode of the power systems. Otherwise, the VSGs will have detrimental impact on the LFO damping [16].
In the on-line methods, the VSG parameters can be modified even during system operation. In [17], the LFO damping was improved by appending a reactive powerdependent term into the VSG swing equation. In the added term, a factor was continuously changed using linearized deviations of the VSG active and reactive powers [17]. A bang-bang strategy for the VSG virtual inertia control was introduced in [18]. In this scheme, a big virtual inertia was selected for the VSG when its frequency diverges from the grid frequency. On the other hand, a small virtual inertia was adopted while the VSG frequency converges to the grid frequency. In [19], a self-adaptive scheme controls the virtual inertia and damping coefficient of the VSG. In this scheme, the virtual inertia is increased during the VSG frequency divergence interval, while the damping coefficient is fixed. On the contrary, the damping coefficient is increased in the VSG frequency convergence interval, whereas the virtual inertia remains constant [19]. Another adaptive strategy by selecting different virtual inertia and damping coefficient during distinguished operating states was established in [20]. Compared to the methods in [17]- [19], the optimal damping ratio for the VSG can be maintained, while fast speed response and small overshoot can also be assured [20]. To improve frequency regulation of microgrids, a unified expression was presented for the VSG virtual inertia [21]. In particular, the virtual inertia was built by two terms of fixed and variable values. The latter one was obtained by multiplying a fixed gain, the VSG frequency deviation and its time derivative [21]. Recently, a dual-adaptivity inertia control has been presented to optimize both the power and frequency oscillations of the VSGs [22]. This strategy decreases the virtual inertia when the VSG power deviation is large. It decreases the virtual inertia whenever the VSG frequency deviation is large.
In the case of the PFC proficiency, the VSG-based HVDC systems can be equipped with PFC [23] and automatic generation control [24] capabilities by adjusting their DC link voltage. For microgrids, an extended VSG (EVSG) was presented through combining the virtual inertia, virtual primary and secondary frequency controllers [25]. The parameters of the EVSG were optimally tuned using ∞ robust control method considering power fluctuations of the renewable energy sources and the system demand.
In the all described strategies, the VSG parameters setting to improve the LFO damping and the PFC performance was individually done so far. However, this paper proposes an efficient strategy to control parameters of the VSG in order to meet these objectives, simultaneously. In this regard, the VSG virtual inertia is synthesized by two parts named the PFC and the LFO components. To reduce system frequency gradient, the PFC component increases the virtual inertia when the system center-of-inertia (COI) frequency decreases. On the other hand, this component decreases virtual inertia during the COI frequency rebound period to achieve a faster frequency recovery. The LFO component increases the virtual inertia whenever the VSG frequency diverges from the COI frequency and vice versa. In this context, calculation of the VSG frequency deviation with respect to the COI frequency plays an important role. This study deploys an estimation of the second derivative of the VSG frequency to calculate this frequency deviation. The simulation results demonstrated the superiority of the proposed strategy in the system performance modification in comparison with the existing methods. Further, an energy storage is typically used in the VSG systems to emulate the inertia. The suggested approach decreases the capacity of this storage by about 15%. This paper is organized as follows: Section 2 elaborates on the equations of the VSG model. The proposed VSG virtual inertia control strategy is presented in Section 3 following the brief descriptions of two existing methods. The effectiveness of the suggested technique is evaluated in Section 4. Finally, the conclusions and further remarks are provided in Section 5.

Virtual Synchronous Generator Model
The different methods to model a VSG can be found in literature such as [26]. In this section, a fourth order model is established for the VSG by considering a round rotor synchronous generator. This model has a virtual field circuit in direct axis of its virtual rotor as shown in Fig. 1. It has also a virtual damper circuit in quadrature axis of the virtual rotor. These virtual circuits are denoted by fd and 1q subscripts, respectively. Time derivatives of flux linkages per second of these circuits can be extracted as follows [27]: 1 11 fd fd q n e fd fd n q q ad where, and 1 are resistances of the field and damper circuits, respectively. Denote the nominal angular speed of the VSG. The field voltage is and the d-and q-axes magnetizing reactances (xad and xaq) are defined as: with and as the d-and q-axes synchronous reactances. The leakage reactance of the virtual stator is denoted by . The currents of the virtual rotor circuits (ifd and i1q) can be expressed as [28]: where: Reactances of the virtual field and damper windings are represented by and 1 , correspondingly. The d-and qaxes magnetizing flux linkages per second (ψad and ψaq) in terms of currents are: The VSG virtual stator flux linkages become: The virtual stator voltages (ud and uq) can be written as follows [9]: where, the transient voltages are defined by [9]: with as the VSG rotor speed (or frequency). The transient flux linkages can be calculated as follows [28]: The transient reactances are [27]: The VSG rotor resistances (rfd and r1q) can be derived in The VSG electromagnetic torque Te can be derived as follows [28]: (12) where, PF denotes nominal power factor of the VSG. The VSG electrical power (Pe) is obtained by [27]:

Fig. 1 The d-and q-axes equivalent circuits of the VSG model
The VSG virtual rotor speed (or frequency) is governed by the swing equation as follows [28]: 1 with as virtual mechanical power. In (14), parameter is virtual acceleration time constant, defined as [28]: where, represents virtual inertia constant of the VSG in seconds [9]. The angle of the d-axis represented by , referenced to the real axis in stationary reference frame [27], can be determined as follows [28]: Denote the slack machine frequency in per unit. Here, the q-axis leads the d-axis by 90 degrees.
The steady-state and transient saliencies of the VSG virtual rotor should be ignored to simplify its model. This means it can be assumed that = and ′ = ′ . It is important to mention that dynamics of the VSG flux linkages will be deployed to estimate second time derivative of the VSG frequency. In addition, neglecting rotor saliencies in the VSG modelling results in more simplicity in the mentioned estimation. Note that the second-order VSG models in [18]- [22] do not have this capability. More details are provided in Section 3.4.
A VSG power plant may have supplementary elements as portrayed in Fig. 2. Denote ̅ and ̅ the VSG current and voltage vectors in the stationary reference frame [27]. An automatic voltage regulator (AVR) maintains the VSG voltage at the set point values. A power system stabilizer (PSS) may be used to provide additional damping torque [9]. The governor function is modelled by the primary controller (PCO) block. The virtual prime mover (VPM) simulates dynamics of a prime mover.

Virtual Inertia Control Strategies
In this section, two existing VSG virtual inertia control schemes proposed in [18] and [22] are firstly reviewed. Then, the proposed strategy is clearly presented in details.

Bang-Bang Virtual Inertia Control Strategy
In the bang-bang strategy, the virtual inertia of the VSG was modulated to provide the LFO damping as follows [18]: Denote and ∆̃ the VSG frequency and its deviation with respect to the grid frequency ̃ [18] where: Any method was not suggested in [18] to measure the grid frequency. In fact, it should be the COI grid frequency. However, the exact calculation of this quantity needs widearea measurements. As an alternative, an estimated COI frequency is used in this study, which is derived by moving average function as follows: as the time window of averaging. This parameter should be 50% greater than period of slowest low frequency oscillation in the power system. Note that the "~" character is used in this paper to represent the estimated quantities.

Dual-Adaptivity Virtual Inertia Control Strategy
The dual-adaptivity virtual inertia control was proposed to mitigate the VSG frequency oscillations simultaneously with its power oscillations [22]. In this scheme, the virtual inertia of the VSG changes as follows: To achieve a compromise between frequency and power regulations, parameter was defined as [22]: where is a predesigned constant and ∆P can be written as:

Proposed Virtual Inertia Control Strategy
For the sake of reliable operation of the VSG with adaptive virtual inertia, there is a need for energy storage, particularly when the VSG is deployed to control intermittent renewable energy sources. In this regard, the virtual inertia control efficiency is of vital consideration to minimize the capacity of the storage. In the other hand, flexibility in the virtual inertia has been used for providing the LFO damping and mitigating the PFC action individually so far. Indeed, this flexibility should be used to improve overall system performance. To this end, the VSG virtual inertia is defined as follows: and ∆̃ defined in (19). The former represent deviation in the estimated COI frequency with respect to the system nominal frequency. Accordingly, an averaged time derivate of the ̃ may be obtained as follows:    (30) in which, the sampling period is set to 100 ms to comply with the commercially available RoCoF relays [29]. as the base value. When sign of the ∆̃ times its derivative is positive, i.e., the COI frequency is deviating from the nominal frequency, 1 is set to its upper limit and vice versa. However, 1 remains 1.0 p.u., whenever the absolute value of the COI frequency derivative ̃ is lower than a predefined value (See eq. (28)). The PFC component is identical with 1 , except for lower than 1. In the next page, it will be shown that remains 1.0 during one second after a frequency drop event.
In other words, the component aims at reducing COI

Fig. 4 The principles of the LFO component derivation
RoCoF during the frequency arrest period and increasing it at the frequency rebound stage. The LFO component is used to support the LFO damping. Thus, its operating frequency is similar with that of the LFO oscillations such as the bang-bang method [18]. In order to elucidate the principles of modulating this component, let us consider the VSG frequency , which contains sinusoidal low frequency oscillations as portrayed in Fig. 4. The first and second time derivatives of the are also shwon. For off-nominal system frequencies, a major difficulty in providing the LFO damping by the bang-bang virtual inertia is the COI frequency estimation. Remember from (17) that, the sign of difference between the VSG frequency and the estimated COI frequency is employed to change the virtual inertia. In this regard, a strategy is proposed to derive this sign indirectly. As can be seen from Fig. 4, the sign of the second derivative of the has a negative value in contrast with ∆̃, regardless of the COI frequency value. The second derivative may be calculated directly from the first derivative of the VSG frequency; however, another approach is deployed. The detail explanation of this approach is provided at Section 3.4.
Returning to Fig. 4, it can be observed that the is modulated by a bang-bang method, which is modified through the variables 1 and 2 . These variables are defined as: are the predesigned constant ranges from zero to 1. The solid parts of the trace in Fig. 4 are determined by the first term of (33). In these sort of time intervals, the LFO component remains until 1 decreases to 1 . Subsequently, it slowly reduces to with 1 . On the other hand, dotted parts of the trace are modulated by the second term of (33). In this case, maintains until 2 decreases to 2 . Afterwards, it softly increases to with 2 . The proposed modified bang-bang virtual inertia can be converted to that of defined by (17), if both critical constants 1 and 2 are set to zero. Nevertheless, the non-zero values are suggested in this study for these constants. In fact, the non-zero 1 and 2 moderate the VSG frequency derivative changes due to the virtual inertia changes. This moderation alleviates in turn the second derivative variations and gives a more precise zero-crossing detection for the VSG frequency derivatives.
The contribution of the and components in the virtual inertia can be determined by the . This parameter may be defined as follows: where, the auxiliary PFC component participation factors 0 and 1 are illustrated in Fig. 5. Let the event flag is initially zero. Suppose the system frequency abruptly drops at 0 . Next, the VSG increases its electrical power. Afterward, the flag jumps to 1 when the power deviation ∆ , defined in (23), reaches 0.01 per unit. The time in Fig. 5 denotes this instant. Then, the flag resets to zero after one second. The factor 0 remains 1.0 during this time interval and then it reduces to zero within 2 seconds. In the other hand, the 1 increases linearly with the absolute value of the COI RoCoF ̃, defined by (30). The parameter is the permissible maximum COI RoCoF [8]. Note that the second term in (34) is in fact the average value of the factors 0 and 1 .
where, the flux linkages derivatives are defined by (1). The current derivatives can be calculated by the delay and lowpass filter (LPF) functions as explained in Fig. 6. The time delay should be small in comparison to the time period of the LFO oscillations. The LPF filter eliminates high frequency oscillations. Its time constant should cause at most 10 degrees lag at the LFO frequency. Note that, the "~" character on top of "d 2 " in (31)-(33) and (35)-(36) means that the second derivative of the VSG frequency is an estimated quantity.

Simulation Results And Discussions
In this section, the studied power system is firstly described. Then, the proposed scheme is compared against the dual-adaptivity and bang-bang methods explained in Section 3. Finally, the performance of the primary frequency control is discussed for various VSG penetration levels ranged from 25% to 75% of the total system generation.

Description of the Studied Power System
The studied two-area system is implemented in DIgSILENT PowerFactory 2019, as depicted in Fig. 7. This benchmark poses the challenge of the LFO damping [30]. The original system data can be found in [9]. The nominal system frequency is 50 Hz. In the VSG 25% scenario, one of the four SGs is replaced by a VSG labelled VSG4. Parameters of the VSG and its virtual inertia controller are listed in Table 1 and Table 2. The power factor of the VSG unit is 0.85. All SG and VSG units are equipped with static exciters with high transient gain [9]. A reheat steam turbine and a generic speed governor are used as the VPM and PCO   Fig. 8 illustrates schematics of the VPM and PCO systems and their parameters are provided in Table 3. To deteriorate the system LFO damping, the PSSs are deliberately deactivated and self-damping of the loads is ignored. In addition, the system demand is increased by 10% to make the LFO oscillations unstable. The reactive compensations are also increased by 10%. The static generator ST5 is added to the original system to supply the increased load and model a generation loss event. It do not provide inertia. The power flow data are given in Table 4.

System Performance under Low VSG Penetration
In the VSG 25% scenario, the VSG4 is a single generation unit with adaptive virtual inertia. It is assumed that the virtual inertia can be gone up and down by 100% and 50% with respect to its base value, respectively. In the following, the system performance under deploying the proposed scheme are compared with those of the dualadaptivity and the bang-bang strategies, in response to tripping off the generator ST5.
The simulation results of the VSG 25% scenario are illustrated in Figs. 9 to 14, using a fixed step size (2.5 ms) RMS simulation. All speed and frequency variables, hereafter, are shown in percentage of the nominal frequency 50 Hz. In addition, to gain a better insight into the results, the power and energy quantities are presented in percentage of the system base demand 2734 MW. Furthermore, the VSG virtual inertia * is per unitized by its base value. The COI frequency deviation and the variations of the VSG frequency with respect to the COI frequency are depicted in Figs. 9.a and 9.b, respectively. Note that these quantities are obtained by the simulation and thus are not estimated. As    Fig. 10 The VSG4 virtual inertia for the VSG 25% scenario (a) Dual-adaptivity strategy, (b) Bang-bang strategy observed, the proposed method provides more oscillations damping than the dual-adaptivity and the bang-bang techniques. This can also be seen in the electrical power quantity portrayed in Fig. 9.c. The amount of the kinetic energy, which is released by the VSG during 1 seconds, can be calculated as: It is interesting to observe that the suggested technique needs an energy source roughly 22% smaller than that of the bang-bang method (See Fig. 9.d). Fig. 10.a shows how the dual-adaptivity method modulates the VSG virtual inertia. Its key parameter was found by trial and error to be 1e13. The system experiences lowest oscillations under this value of . However, the system will be eventually unstable even with this value of . On the contrary, the bang-bang strategy damps the 7 oscillations successfully. The virtual inertia variations are presented in Fig. 10.b, when this approach is used. In case of the proposed strategy, derivation of the PFC component is described in Fig. 11. The allowable maximum COI RoCoF assumed to be 0.25 Hz/s [8]. Also, the parameter mentioned in (28) supposed to be 10 times smaller than the . Following the contingency, the PFC component steps up to its upper limit when the rate of the estimated COI frequency exceeds . Afterward, it maintains constant until the COI frequency rate reduces again to at the end of the arrest period. On the other hand, the PFC component decreases to its lower limit during the rebound period to achieve a faster frequency recovery.
The LFO component of the VSG4 virtual inertia is adaptively changed as depicted in Fig. 12. In order to explain the underlying concepts behind it, let us consider a zoomed view of Fig. 12, which are displayed in Fig. 13  restrict the frequency deviation. From Point B to Point C, the LFO component drops from its upper limit to its lower limit proportional with 1 . Then, this component persists on its lower limit up to Point D, where 2 reaches its critical value 2 , in order to speed up the frequency recovery. After which, the LFO component returns to its upper limit in proportional with 2 reduction. Finally, how the virtual inertia is synthesized by the PFC and LFO components is clarified at Fig. 14. The parameter along with its constituents 0 and 1 are plotted in Fig. 14.a. It steps up to one and sustains up to 1.0 seconds immediately after the event. Next, it changes in proportional with the absolute value of the estimated COI RoCoF. As stated by (24), this parameter determines the portion of the each components in the virtual inertia. The impact of on increasing and decreasing of the virtual inertia at the arrest and rebound stages can be clearly seen in Fig. 14 Table 5. The parameters of the VSG units are identical with Table 1 and Table 2. However, the base inertia constant of each VSGs is equal to the replaced SG generator. The other system information are similar with Table 3 and Table 4. The generators 1 and 3 conduct the PFC in all of the scenarios. Fig. 15 compares the performance of the proposed strategy and that of the bangbang method for different VSG penetration levels. The considered event is tripping out of the ST5. The maximum COI frequency deviation ∆ and the frequency recovery time are defined in Fig. 16. In addition, the denotes the minimum COI RoCoF during 2 seconds following the event, which is calculated with 0.  For the sake of comparison, the results of the Fixed Inertia scenario, in which virtual inertia of the VSGs maintains at 1.0 p.u. following the event, are also shown in Fig. 15. However, the system is not stable in this case. As can be seen, the system frequency is recovered significantly faster once the proposed scheme is deployed. However, the maximum COI frequency deviation in case of the suggested approach is larger than that of the bang-bang strategy. In fact, this superiority of the bang-bang method involves higher cost due to the requirement of larger sources of energy (See Fig. 15.d). The effectiveness of the proposed and the bang-bang techniques in mitigation of the is approximately similar. Fig. 17 shows deviations of the VSG4 frequency with respect to the COI frequency for the studied scenarios. It can be clearly seen that the proposed strategy provides more LFO damping. For better comparison, the damped frequency and damping ratio [9] of these traces are provided in Fig. 18. The damped frequency declines with the VSG penetration for both strategies. Although, the proposed scheme provides substantially more damping in comparison to the bang-bang method.

Conclusion
In this paper, an efficient adaptive strategy is proposed to control the virtual inertia of the virtual synchronous generators (VSGs). This can mitigate primary frequency control (PFC) considering the three proposed optimization problems simultaneously. mechanism and provide the electromechanical low frequency oscillations (LFOs) damping. Accordingly, the virtual inertia is synthesized by two parts named PFC and LFO components. The former one is synchronized with the PFC operational time. It rises the virtual inertia during the center-of-inertia (COI) frequency drop period to reduce the rate of change of frequency and decreases it in frequency recovery period to accomplish a faster frequency recovery. The LFO component, which is used to provide LFO damping, is synchronized with the LFO oscillations. It increases the virtual inertia whenever the VSG frequency diverges from the COI frequency and decreases it while the VSG frequency converges to the COI frequency. In this context, the second derivative of the VSG frequency is deployed to estimate the VSG frequency deviation with respect to the COI frequency. The second derivative itself is estimated using the derivatives of the VSG state-space variables and currents of its virtual circuits. The simulation results confirm the superiority of the proposed strategy in the PFC performance mitigation and the LFO damping in comparison with the recently proposed methods in literatures. Furthermore, the proposed approach decreases the required capacity of the VSG energy source by about 15%.