Effective virtual inertia control using inverter optimization method in renewable energy generation

The high-level penetration of intermittent renewable power generation may limit power system inertia, resulting in system frequency instability in increasing power converter-based energy sources. To resolve this problem, virtual inertia control using distributed gray wolf optimization (DGWO) method in a synchronous generator is simulated under a distinct output fluctuation condition. First, the DGWO algorithm was established to achieve a local and global balance solution, and standard test functions were employed to verify the model convergence. Second, the key parameters that determine the effect of the virtual inertia controller in the power grid were analyzed. A DGWO-based optimization strategy to stabilize inertia was also developed. Finally, simulation results using step and random loads under a high permeability level are provided to verify the effectiveness of the proposed model. In the step load disturbance, the system can recover from the disturbance point to the stable point after 3 s under the regulation of the proposed control strategy, which is reduced by 18 s compared with the traditional control method. In the random load test, it takes only 12 s, 63 s less than the traditional one. Accordingly, the power system frequency can be stabilized more quickly from a disturbance state to a stable stage.


Introduction
Currently, various renewable energies with generation uncertainty and availability are being widely incorporated into modern power systems. Additionally, converter utilization in power systems has increased rapidly in recent years. (Kung et al., 2021;Lak et al., 2020;Nair and Kumar, 2021). However, this may result in a significant reduction in inertia in the interconnected power system (Fang et al., 2018;Ferna´ndez-Guillam on et al., 2019;Rezkalla et al., 2018). As a result, the stability of the power system frequency and voltage is seriously threatened, and the security of the entire power system is affected (Ali et al., 2019;Kabir et al., 2018;Liu et al., 2021;Saidi, 2020). To address the problem of system instability, some research has focused on mathematically simulating the behavior of synchronous motors using virtual inertia-based inverters, including synchronizers, virtual synchronous machines (VSMs), and virtual synchronous generators (VSGs) (Feldmann and de Oliveira, 2021;Yap et al., 2019Yap et al., , 2020. Among them, VSG provides a control scheme for the inverter of a distributed generator by imitating the behavior of a synchronous motor (Fathi et al., 2018;Terazono et al., 2021). Yang et al. (2019), , and Li et al. (2019) proposed different control strategies for virtual generators; however, their control parameters were not optimized. Alternatively, Alipoor et al. (2018) adopted particle swarm optimization to optimize the VSG parameters. Therefore, transient stability under significant system disturbance can be enhanced.
In this study, a new VSG control method using inverter optimization was developed to effectively increase the power system inertia in a renewable energy power generation system. The remainder of this paper is organized as follows: the next section reviews the VGSrelated works in the literature. Then, the principle of the VGS mathematical model is described. The VGS control optimization strategy based on the DGWO algorithm is presented in 'Virtual controller parameters optimization based on DGWO algorithm' section. The simulation results are provided and discussed in the penultimate section, and the conclusions are presented in the final section. Huang et al. (2018) unveiled the influence of VSG on low-frequency oscillation of power system by analyzing the equivalent damped torque of VSG. The results showed that it can provide a forward damped torque to effectively suppress the low frequency oscillation in the power grid. Magdy et al. (2019) combined the virtual inertial control with VSG to stabilize the power frequency and dynamic security in the power system. Chen and O'Donnell (2019a) proposed a converter-based VSG method to control the virtual inertia in power electronic connections. Roldan-Perez et al. (2019) established a simplified third-order small signal VSG model based on the traditional synchronous generator model. In this study, the influence of induction and weak resistance power grid was worked out. Wang et al. (2020) proposed a VSG function using the Unified Power Flow Controller (UPFC) to compensate the voltage change in public coupling points. The remote RE system connected with a constant voltage benchmark was also developed here. Chen and O'Donnell (2019b) provided a comprehensive VGS control analysis based on a transfer function, which could be used for transient and steady-state VSG design. Nian and Jiao (2020) proposed an improved VSG control strategy for symmetrical voltage failure in doubly-fed asynchronous generator (DFIG). Air gap flux feedback was designed to accelerate the attenuation of transient components and limit rotor current to improve the stability of the system. Shi et al. (2020) proposed an optimal control strategy to reduce power oscillation and frequency fluctuation. The parallel VSG system was established to analyze the rotor inertia and damping coefficient influence on active power output. El Tawil et al. (2019) designed a VSG control strategy applicable to renewable energy power generation systems in an independent microgrid environment. Moulichon et al. (2021) proposed an observer-based VGS current controller that is composed of a linear quadratic regulator for synchronous generators. Chen et al. (2020) reported the VGS control to meet the required power and maintain the stability of the power grid. Karanveer and Mukesh (2018) proposed a VSG control algorithm using an EV charging station, which can provide the inertia and stabilize system frequency. Tebib and Boudour (2021) proposed a high voltage direct current (HVDC) control adjustment method based on the virtual synchronous power (VSP). An improved gray wolf algorithm was employed to optimize the VSP-based control parameters. Rakhshani et al. (2017) applied the VSP to simulate the dynamic impact of virtual inertia in HVDC link. The automatic generation control model was used to improve the dynamic performance of the system. Based on the VSP control strategy of HVDC interconnected system, Rakhshani et al. (2016) developed a new modeling for the effect of virtual inertia on frequency stability in multi area interconnected system. The sensitivity analysis of VSP-based HVDC in frequency control was also studied. Abdollahi et al. (2020) proposed a dynamic tuning analysis method for renewable static synchronous generator set controlled by synchronous power controller (SPC). It could improve the stability of high penetration power generation region and support the synchronization between interconnected regions in a tworegion Kundur system. For the grid connected converter with SPC, Zhang et al. (2019) presented three different active power control schemes. It revealed that SPC has a good performance in inertial response and droop characteristics. Shuai et al. (2019) used an enhanced control strategy to improve the transient angular stability by adjusting the reference power. When the vibration mode was close to the mechanical vibration mode on the complex plane, the VSG could introduce a strong dynamic interaction to stabilize the small signal angle drift in the power system. Du et al. (2019) presented a VSG method to avoid modal proximity and the adverse effect on small signal angle stability of power system. Al-Tameemi et al. (2020) applied VSG control strategy to achieve synchronization and frequency stability in each terminal, thereby providing multiterminal formation capabilities. Wu and Wang (2020) analyzed the large-signal synchronization stability and developed a mode adaptive VSG power angle control method to improve transient stability.  proposed a power decoupling method based on virtual steady-state synchronous impedance (VSSI) and current dynamic decoupling compensation (CDDC). It indicated that the power coupling could be performed more effectively. Besides, the dynamic and steady-state responses from active and reactive power can be more efficient. Santhoshkumar and Senthilkumar (2020) combined the whale algorithm and the Ant Lion algorithm to reduce the calculation complexity. However, a large error may arise in the frequency response under dynamic conditions.

Model of virtual synchronous generator
With the increasing use of renewable energy power, the penetration rate of these energy sources has significantly impacted the power system inertia and significantly affected grid frequency fluctuation (Alayi and Jahanbin, 2020;Bevrani et al., 2014;. The most vulnerable factors are the inertia and damping characteristics of synchronous generators; they can be determined by a virtual rotor, inverter, and primary and secondary frequency controls. Consequently, the VSG was developed to simulate the synchronous generator to avoid the inertia reduction caused by renewable energy access (Shintai et al., 2014). The VSG is shown in Figure 1.
As revealed in Figure 1, it consists of four blocks, including virtual primary control, virtual secondary control, virtual rotor and inverter, where K 1 is the virtual main control coefficient, and K 2 is the virtual auxiliary control coefficient. The "virtual rotor" connected with the inverter is introduced to represent the damping and inertia characteristics of the power generator. In the model, K 1 and K 2 are the key factors in the frequency regulation and the control stability of the system. The relationship between the mechanical power change and load power change in the swing equation of a synchronous generator is as follows (Alipoor et al., 2015): where DP machine represents the mechanical power change; DP load is the load power change; H is the system inertia coefficient; D represents the damping coefficient; Df is the power system frequency deviation. The power reference value (P r ) of the inverter is obtained through the swing equation of the synchronous generator, as follows: where H v is the virtual inertia coefficient, and D v is the virtual damping coefficient. H v and D v are constant and used to simulate the inertia and damping characteristics of synchronous generator in the virtual rotor, respectively. The first-order transfer function is used to model the inverter, expressed as follows: where T t is a time constant with a small value. The primary frequency control and secondary frequency control in the synchronous generator were simulated using a PI controller as follows: where K 1 represents the primary frequency control gain; K 2 represents the second frequency control gain.

Virtual controller parameters optimization based on DGWO algorithm
Fundamental of GWO GWO algorithm was proposed by Mirjalili et al. (2014). It simulates the behaviors of wolves in searching and hunting for food in nature environment. The wolves are divided into a wolf, b wolf, d wolf and x wolf according to the searching food capability. Wolves can cooperate with each other to complete the search process. a wolf is the leading wolf with an absolute dominant position, which is mainly responsible for food searching and hunting. b wolf is working under the leadership of a wolf and leads d wolf and x wolf. d and x wolves work at the lowest level, where they are subject to the leadership of a and b wolves. The process of GWO algorithm is shown as follows (Mirjalili et al., 2016;Sulaiman et al., 2015): 1. First, the fitness value of the population is calculated, and the wolf pack is divided from the fitness values. Three wolves with the best fitness values are in order labeled as a wolf, b wolf and d wolf, respectively. The remaining wolves are regarded as x wolves. 2. The wolves begin to surround the prey after finding it. At this time, the gray wolf location is obtained as: where iter represents the current iteration number; P L (iter) is the prey position; G(G ¼ 2 v 1 ) indicates the swing coefficient; v 1 denotes the random number in the [0, 1] interval; A is the convergence coefficient and calculated as follows: where v 2 is the random number in the [0, 1] interval; a is the convergence factor, which determines the value of A.
a¼2 Á 1 À iter Iter (8) where Iter is the maximum number of iterations; a decreases linearly from 2 to 0.
(3) The wolves hunt the prey when a wolf finds it. At this time, the swing coefficients of a, b and d wolves are updated as: The positions of a, b and d wolves are updated as follows: The location of x wolf is calculated as: The positions of a, b, d and x wolves are depicted in Figure 2.

Selection of convergence factor in GWO algorithm
The wolves search and surround the prey by adjusting the convergence coefficient A in the GWO algorithm. The value of A is determined by the convergence factor a, where a decreases linearly from 2 to 0; the interval of A is [À2a, 2a]. In practice, the linear convergence factor a cannot balance local and global search abilities concurrently. Therefore, the dynamic convergence factor a d is introduced to reach the target balance between the local and global searches.
where iter represents the current number of iterations, and Iter is the maximum number of iterations.
The convergence coefficient A based on the dynamic convergence factor is obtained as follows: The curves of the linear and dynamic convergence factors over the number of iterations are shown in Figure 3.
During 500 iterations, a converges to 0 linearly, as shown in Figure 3(a). Figure 3(b) shows that a d decreases linearly before 250 iterations; after 250 iterations, a d decreases nonlinearly. The linear and nonlinear variations in a d were used to enhance the convergence performance of the GWO. Indeed, before 250 iterations, a d leads to a global search to find the prey location; after 250 iterations, the a d convergence speed is accelerated; at this time, it is focused on a local search.
On the other hand, the population diversity may decrease in the later stage of GWO iteration, especially for individuals with poor fitness, which can easily fall into a local optimum. The random walk characteristic of the Levy flight makes GWO have a stronger global search ability. Therefore, this study uses the Levy mutation to prevent the x wolf from prematurely falling into extreme values. Levy flight has strong randomness and variability in long-distance jumping situations. The random walk characteristics of the flight path are presented in Figure 4.
Levy's random walk feature was applied to improve the population diversity in the later stages of the GWO algorithm. Its flight path is expressed as follows (Edwards et al., 2007):  where c (1 <c < 3); u(u$N(0, r u 2 )) and e(e$N(0, r e 2 )) obey a normal distribution; r u and r e are calculated as follows (Barthelemy et al., 2008): During the iteration process, the DGWO algorithm easily falls into a local optimal value and is unlikely to reach the global optimization solution. By making use of the random walk characteristics of Levy flight, the DGWO algorithm can maintain a strong global search performance in the later iteration period, thus achieving better convergence results.
After Levy flight is introduced into the x wolf, the gray wolf location can be found, expressed as follows:

Validation of the proposed DGWO algorithm
The nonlinear convergence factor and Levy mutation are integrated to ensure the balance of search ability and population diversity in the DGWO algorithm. Unimodal and multimodal functions are used to evaluate the algorithm performance efficiency. Unimodal test functions have one global optimal point without extremum points. Multimodal functions have multiple extremum points in addition to a global optimum. Accordingly, unimodal functions are used to test the global optimization ability, and the multimodal function are used to test the ability of escaping from local extremes. Two unimodal functions (F 1 and F 2 ) and three multimodal functions (F 3 , F 4 and F 5 ) are employed to analyze the convergence effect, as shown in Table 1. The testing dimensions of the five standard test functions are unified to 50, and the global optimal values are all set as 0. Whale Optimization Algorithm (WOA), Particle Swarm Optimization Algorithm (PSO) (Van den Bergh and Engelbrecht, 2004), GWO algorithm and the DGWO algorithm were tested for comparison. The parameter settings of these algorithms are listed in Table 2.
The maximum number of iterations and population size in four algorithms are set under the same values, where the maximum number of iterations is 500 and the population size is 30. For PSO algorithm, w max and w min represent the maximum and minimum weights, respectively; c 1 and c 2 denote the self-learning and social learning abilities, respectively. For the WOA algorithm, the spiral coefficient b is set as 1. As above, GWO and DGWO have less adjustable parameters number compared with PSO and WOA algorithms.
The convergence performance is evaluated using worst convergence value, optimal convergence value, mean convergence value, and standard deviation (std) under 30 repeated runs. The convergence test results are concluded in Table 3.
It is clear that DGWO algorithm provides most satisfactory results from F 1 to F 5 , particularly convergence value equal to 0 in F 1 , F 3 and F 5 . Although the convergence values of GWO and WOA algorithms can reach 0 in F 3 and F 5 in some convergence values, they do not achieve 0 in all values. On the contrary, PSO algorithm has worse Table 1. Unimodal and multimodal test functions (Li et al., , 2021.

Algorithm Parameters
The convergence curves using GWO and DGWO algorithms from F 1 to F 5 tests are shown in Figure 5.
As can be seen, the DGWO algorithm has larger convergence slope from F 1 to F 5 test, and it indicates a faster convergence rate compared with GWO algorithm. For example, the convergence value of DGWO algorithm in F 5 test reaches 0 within around 100 iterations, but the GWO algorithm requires around 280 iterations.

Parameters optimization process in virtual controller
The VSG can simulate the inertial response of the synchronous generator through the signal sent by virtual controller. The virtual control is realized through the proportional gain K 1 and the integral gain K 2 in the VSG model. The system inertia and the system frequency can be stabilized by adjusting K 1 and K 2 . The transfer function of the virtual controller is expressed as follows: The DGWO algorithm is introduced to select appropriate K 1 and K 2 based on the parameters optimization process. The square of the frequency deviation is defined as the fitness function to evaluate the system frequency deviation, shown as below: where t s represents the simulation time; t 1 and t 2 are the start time and stop time of the system during the transient operation, respectively. Note that both steady state and transient state in the system frequency deviation are taken account in realization simultaneously.

Performance simulation and analysis
High permeability renewable energy grid modeling A high permeability renewable energy grid system is considered in the proposed VSG control strategy. It includes photovoltaic power generation system, wind power generation system, traditional thermal power generation system and electric load. Among them, the generation and governor dead zone constraints are used to simulate the nonlinear constraints of the generator set. The renewable energy grid system with virtual synchronous machine control is depicted in Figure 6, and the major parameters of renewable energy grid system are listed in Table 4. As shown in Figure 6, the renewable energy grid system is built using the MATLAB/ Simulink simulation platform. It includes 5 MW solar power generation, 10 MW wind power generation, 15 MW power load and 20 MW thermal power generation. Simultaneously, the inherent nonlinear requirements in the system are considered and expressed by the saturation limit model.
Wind power generation model. The wind power is generated by random wind speed on the basis of the rated wind speed and the white noise signal in the Matlab simulation module. The specific wind power model is depicted in Figure 7.
As revealed in Figure 7, when the random wind speed is obtained, the wind power is calculated as follows: where d air (¼1.23) denotes the air density; A r (¼5905) represents the reduced area of the rotor; W speed (¼12) is the wind speed; C(k, e) is the power conversion coefficient. The mathematical model is expressed as follows: where o 1 is the intermittent best tip speed ratio; o 2 is the best tip speed ratio; h(h 1 ¼0.39; h 2 ¼116; h 3 ¼0.40; h 4 ¼0.42; h 5 ¼21; h 6 ¼0.02) represents the turbine coefficient; e is the pitch angle.
The wind turbine parameters are listed in Table 5. The wind power generation distribution depicted in Figure 8 is produced from equation (23) based on the wind power model in Figure 7. It indicates that the wind power has strong nonlinearity and volatility characteristics. Photovoltaic power generation model. The rated power of photovoltaic power generation is equivalent to the sum of the rated power values of each photovoltaic unit. In an actual situation, the photovoltaic power generation has randomness depending on a weather condition. For this reason, it is simulated through the white noise signal and the standard deviation using the Matlab simulation module. The photovoltaic power generation model is shown in Figure 9. The PV power deviation is expressed as follows: Based on the PV photovoltaic power model in Figure 9, the PV power generation distribution is shown in Figure 10. Similarly, the power curve reveals strong randomness and volatility.
Power load model. In reality, there are various non-linear loads utilized in the power line. For this reason, the white noise signal multiplying the initial load deviation is used to simulate the electric power load in the Matlab simulation module, as shown in Figure 11. Load deviation to simulate the actual load variation is expressed as The random load power is simulated based on the power load model from Figure 11, and its result is shown in Figure 12. In this model, the load power contains white noise signal so that it can represent possible real circumstance with strong randomness.

Validation of the proposed virtual inertial control strategy
Performance test under step load disturbance. The overall schematic process in optimizing virtual control parameters in the DGWO algorithm is illustrated in Figure 13. Figure 13 depicts the virtual controller parameter optimization process on the basis of the DGWO algorithm, including the following aspects:   8. Update the optimal position; 9. Determine whether to terminate the iteration when the condition of iteration termination is met. Otherwise, return to the fourth step; 10. Output the optimal parameters K 1 and K 2 of the virtual controller.
The Matlab/Simulink R2019a module is used to validate the proposed method. First, the simulation performance was carried out under a low inertia system (30% of its nominal value). The proposed method is tested under step load and random load. The amplitude of step load does not change with time, while the amplitude of random load varies with time. The step load is added to simulate the influence of sudden generator shutdown or random load increase in the power system. The performance period time is 1000 s, and 0.05pu step load is added at t ¼ 600s. The comparison between traditional and proposed control strategies is revealed in Figure 14.
In Figure 14(a), the power system frequency begins to drop at t ¼ 600s. For traditional control, it is found that 21 s was demanded for the system to recover from the frequency disturbance point back to the frequency stability point. In contrast, it only requires 3 s for the system returning to normal by the proposed control strategy. It is obvious that the frequency fluctuation in Figure 14(a) is greater than that in Figure 14(b) when the step load is added. It shows that the proposed control strategy has better stability in system frequency. Moreover, the inverter in the virtual controller has an inertial effect so that the system frequency can drop more slowly than traditional one.
Performance test under random load disturbance. In the test using the random load (as depicted in Figure 12), the power system frequency begins to drop at t ¼ 600s during 1000 s period time. The results from traditional and the proposed control methods are revealed in Figure 15. From the test results as above, the frequency fluctuations of both control methods are greater than the step load, and longer time is needed to return to a stable state. It indicates that 75 s is taken for the system frequency to recover from the fluctuation point to the stable point in the traditional control method. In the proposed virtual control strategy, only 12 s is required for the system frequency returning to normal. Besides, it is clear that the frequency changing slope from t ¼ 600s is considerably lower than the conventional one.
Through the above analysis, it is found that the frequency regulation of the system is sensitive to parameters K 1 and K 2 . In two load cases study, it is confirmed that the fluctuation of system frequency can be sufficiently stabilized in a shorter time. It implies that the sensitivity of system frequency regulation to parameters K 1 and K 2 can be reduced efficiently through parameter optimization process.

Conclusions
The high penetration level generated from renewable energy generation can reduce the power system inertia, affecting the system stability in a large-scale grid. Accordingly, the proposed virtual inertia control strategy can stabilize the system frequency in less time under a distinct power system fluctuation.
The main contributions in this study are concluded as follows: 1. The DGWO algorithm has been proven to present stronger local and global search balance ability than the GWO algorithm. 2. The convergence effect from DGWO algorithm is verified using unimodal and multimodal functions. 3. The crucial parameters such as K1 and K2 in the virtual synchronous VSM controller can be optimized based on the DGWO algorithm.

4.
A feasible solution for stabilizing the system frequency and increasing the renewable energy permeability can be realized using the proposed control strategy.
Moreover, this study reveals that the operation time required to restore the system frequency to a stable condition takes 18 s and 63 s for step load and random load, respectively, indicating significantly less time than the traditional control algorithms. Future studies should focus on the generalization ability of multiple microgrid systems under a variety of renewable power sources.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/ or publication of this article.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.