Renewable Energy System on Frequency Stability Control Strategy Using Virtual Synchronous Generator

This study constructs a novel virtual synchronous generator system based on a transfer function, and optimizes the parameters of the model by using the improved whale algorithm to improve the frequency control ability of virtual synchronous generator. Virtual synchronous generator technology helps to solve the problem that the integration of large-scale renewable energy generation into the power system leads to the deterioration of system frequency stability. It can maintain the symmetry of grid-connected scale and system stability. The virtual synchronous generator technology makes the inverter to have the inertia and damping characteristics of a synchronous generator. The inverter has the inertia characteristics and damps to reduce the frequency instability of high penetration renewable energy power system. The improved whale algorithm is efficient to find the best combination of control parameters and the effectiveness of the algorithm is verified by microgrid and power system. The results show that the proposed frequency coordination control scheme suppresses the frequency deviation of power system and keep the system frequency in a reasonable range.


Introduction
Renewable energy (RE), such as solar energy and wind energy, has the advantages of being clean and pollution-free. A large-scale development of RE such as solar energy and wind energy is increasingly valued for environmental reasons [1][2][3][4]. Karasoy et al. [5] argued the relationship between energy consumption and environmental pollution and proved the RE consumption reduces carbon emissions at any time scale. Anastasiadis et al. [6] presented the power network feasibility including solar power generation and wind power generation. Shankar et al. [7] presented the results of solar cooling thermal power plant to show the system proposed is suitable for industry and family needs. Stritih et al. [8] studied the solar energy storage and the results show that the economic and effective thermal energy storage is necessary. RE has shown practical value in the fields of power generation; especially, when it is integrated into the micro-grid that leads more advantages [9][10][11][12]. This is considered as an attractive substitute for fossil energy. The increase in the grid connection rate of renewable energy has brought the system instability problem. Therefore, the symmetry between the grid connection rate of renewable energy and the stability of the system should be maintained.
Synchronous generator (SG) has better inertia and damping characteristics to support the power system frequency [13]. Power electronic inverters have replaced SG in a large number in the renewable energy power generation system. The inverter has no inertia and damping characteristics and has a weak ability to adjust system fluctuations [14,15]. Renewable power generation has low inertia and results in serious frequency fluctuations [16][17][18]. The instability of the system limits the power transmission capacity [19][20][21][22]. This instability limits the RE penetration in power systems to limit grid de-carbonization [23,24]. In view of this problem, prior studies have put forward solutions to improve the RE penetration in the power system. One is to design a specific inverter control algorithm to make the inverter have the SG inertia characteristics and improve the stability of the system frequency [25][26][27]. This systematic control method is called virtual synchronous generator (VSG). For instance, Zheng et al. [28] presented VSG and control strategies were proposed, but parameters were not optimized. Intelligent algorithms have advantages in parameter optimization and are used in various problems of parameter optimization [29][30][31]. Magdy et al. [32] discussed the optimizing control parameters by using intelligent algorithm to improve the performance of control strategy. These studies are lacking to address and research on model optimization. Using intelligent algorithms to optimize model parameters enhances the performance of the model.
The objective is to propose a VSG control method based on algorithm optimization to improve the frequency stability of renewable energy power systems due to improving the stability of the renewable energy power system and promoting the use of clean energy. A VSG control structure and parameter optimization method are proposed and the optimal value of parameters is set by using the improved whale optimization algorithm (WOA). The contributions of this study are as follows: (1) A VSG-based systematic control method for RE power system inverter is developed. The method is beneficial to improve the system inertia and stabilize the system frequency; (2) the control parameters are optimized with an improved WOA; but the algorithm has few parameters, fast convergence speed, and high convergence accuracy; and (3) the effectiveness of the control strategy is validated on two experimental test models: one is a micro-grid system and the other is a large power system. The simulations show that the proposed VSG systematic control method has a better practical effect.
The rest of this study is arranged as follows. Section 2 is literature review, Section 3 introduces the VSG model, Section 4 introduces the configuration of the test model, Section 5 discusses and analyzes the experimental results, and the conclusion is in Section 6.

Literature Review
VSG improves the inertia and the frequency stability of the system. The proposed control strategy measures the disturbance and generate reference power. The proposed control strategy provides more inertia and disturbance attenuation for the inverter. Prior studies on VSG included system stability, grid connection, and optimal control [33][34][35][36].
VSG system stability studies the stability of control system and its influence on power system stability. In order to improve the system stability, for instance, Li et al. [33] studied the virtual damping link and root locus method, established the VSG small signal model, analyzed the relationship between control parameters and system stability, and designed the system parameters quantitatively. Chen and O'Donnell [34] argued a VSG comprehensive analysis based on a transfer function that was proposed to improve the performance. In the work of Shuai et al. [35], the safety and stability of the system are initially analyzed in qualitative consideration and proposed to use Lyapunov direct method to analyze Symmetry 2020, 12, 1697 3 of 22 the VSG transient angle stability. The adverse effects of reactive power circuits on system stability and the effects of different parameters on transient angle stability are analyzed, which provides a basis for system stability design. Du et al. [37] proposed a method to avoid mode approaching and divides the influence on the mode approaching. The relationship between VSG and power system stability is studied to guide the design. The expansibility needs to be further proven. Shi et al. [38] proposed a VSG self-adjusting parameter on control strategy when the system frequency oscillates; this leads to VSG increasing or decreasing the virtual inertia according to the virtual angular velocity. Virtual damping improves the frequency stability of microgrid, but at the same time increases the burden of energy storage system. Magdy et al. [39] presented a frequency coordination strategy based on optimal PID controller to optimize relevant parameters with intelligent algorithm and the control strategy leads to robustness. Hu et al. [40] argued the multiple VSG coordination control and joint use reduced the oscillation period and overshoot during transient response to enhance the operation performance and anti-interference ability. Ding et al. [41] analyzed the dynamic characteristics of the parallel capacitor photovoltaic power supply in depth, and proposed a VSG systematic control method to solve the problem that photovoltaic power supply cannot be used as a DC power supply due to the fluctuation.
VSG grid connected study means to pre synchronize the phase and reduce the impact of the inverter grid connected to the power system. There is a restriction relationship between the VSG response speed and the power output overshoot. For instance, Zhang et al. [42] showed the lumped interference is compensated by feedforward. A power controller for grid connection is proposed based on the linear active interference suppression control. A power controller for grid connection transmits the active power to the grid in time and avoids overshoot. The system has strong robustness. Wang and Sun [43] studied the imbalance phenomenon and expanded the application scenario of self-synchronous VSG strategy in the balanced power grid and the second-order generalized integrator is used to deal with the double frequency ripple component, which improves the accuracy of self-synchronization. Shi et al. [44] proposed a VSG integrated switching systematic control method and includes quasi synchronous algorithm and islanding monitoring algorithm. The integration method improves the reliability and quality of the power supply. In the energy storage research, the problems of capacity allocation and optimal control of energy storage system matching with VSG are discussed. Li et al. [33] studied the cascaded H-bridge converter technology and proposed a transformer free energy storage system. In the field of battery and supercapacitor, Fang et al. [45] proposed a hybrid system composed of the two to fulfill the gap in this study.
Prior studies on the VSG optimal control attempted to design a reasonable control structure ad optimize the relevant parameters to achieve the best control effect. For instance, in vector current control, Asrari et al. [46] proposed a VSG systematic control method to provide stable power transmission for an extremely weak AC power grid while the power grid voltage is unbalanced and the traditional control method has no corresponding measures, and the output current is distorted. Zheng et al. [47] proposed a new control method to solve and reduce the power system's oscillation. The inertia of the traditional VSG rotor is fixed, which cannot meet the requirements of various operating environments. In order to solve this problem, Zeng and Su [48] proposed an adaptive adjustment method of rotor inertia. In the oscillation simulation, VSG adaptively changes the inertia of virtual rotor, so as to adjust the inertia of the whole system, making it more conducive to the stability of the system. The grid connected inverter controlled by VSG suffers the inherent low-frequency vibration. For instance, Liu et al. [49] and Cao et al. [50] studied the control scheme to solve the VSG low-frequency oscillation problem and the grid connection process is interfered by various factors. In traditional VSG, it is hard to eliminate these factors and results in performance degradation. Yu and Hu [51] studied the VSG auto disturbance rejection control method, which effectively improved the performance when connected to the grid.
To sum up, prior studies have proposed specific control strategies, but have not studied the optimal selection of control strategy parameters in depth. The control parameters have an important influence on the quality of control effects. Different parameter values have different control effects and Symmetry 2020, 12, 1697 4 of 22 a reasonable value of parameters is of great help to improve the control effect of the control strategy. A novel design of a VSG system is proposed. The power electronic inverter has the similar frequency support ability as SG by simulating the rotor and frequency modulation function of SG. The WOA is applied to optimize the control parameters of the controller, so that the controller achieves the best performance. The superiority of the proposed control scheme is verified by experiments.

Virtual Synchronous Generator Model
RE has poor inertia and damping that leads to the undesired increase of frequency fluctuation [22]. VSG technology introduces a "virtual rotor" into the power electronic inverter, to create "simulated inertia" to dampen frequency fluctuations. The rotor of SG has the following energy relationship.
H r is the inertia constant of the rotor, D r is the damping coefficient, P Mec is the change of input mechanical power, P Load is the change of load power, and f (s) is the frequency offset. Equation (1) presents the rotor inertia constant H r and damping coefficient D r which play an important role in stabilizing the system frequency. Under the same power deviation condition, the larger the rotor inertia is, the smaller the frequency deviation is. In time scale, the frequency of the SG regulating system includes three processes: Inertia response process, governor regulating process, and frequency regulator regulating process. When the system power is unbalanced, the power of the SG rotor is adjusted first, which depends on the energy stored in the rotor rotation. If a large frequency deviation is still caused, the system governor is activated and the governor regulates the system frequency by controlling the input mechanical power. The frequency regulator adjusts the system frequency in a longer time range, so that the frequency does not exceed the specified range. The functions of SG should be taken into account, so that designing VSG has the same functions as inertia regulation, governor regulation, and frequency regulator regulation of SG.

Virtual Inertia and Damping Characteristics
The inertia of SG is supported by the rotor, so the function of "virtual rotor" should be designed in the VSG. The function of the virtual rotor is described by Equation (2).
P re f is the reference power output, H v is the VSG virtual rotor virtual inertia, and D v is the virtual damping coefficient. VSGs have the characteristics of SG rotor by designing "virtual rotor" with Equation (2).

Virtual Primary Frequency Modulation and Virtual Secondary Frequency Modulation
The SG has a governor device to adjust the input mechanical power after the frequency offset, and compensate the power and frequency offset proportions. The corresponding proportional link is designed to achieve the VSG primary frequency regulation function. The secondary frequency modulation of SG is to adjust the frequency of system to the rated value, so the integration link is designed to play the role in a longer time span and realize the role of virtual secondary frequency modulation. The control relationship is described by Equation (3).
∆P is the power value of the virtual primary frequency modulation and virtual secondary frequency modulation. K 1 and K 2 are virtual primary and virtual secondary gain, respectively.

Inverter Model
The output power of the power electronic inverter follows the command signal through pulse width modulation. The response speed of power electronic inverter is faster compared with SG. Based on this feature, the inverter is modeled as an inertial link, as shown in Equation (4).

Structure Design of Virtual Controller
The structure of virtual controller not only affects the VSG system stability, but also has a decisive influence on the control performance. The structure of virtual controller includes not only virtual rotor, virtual primary frequency modulation, and virtual secondary frequency modulation, but also an independent integration link. This design is to give full play to the ability of the controller to adjust the system frequency and improve the frequency stability of the system. The schematic of the controller is shown below.
In Figure 1, K 3 is the gain of the controller integration link, and other parameters are as described.
Symmetry 2020, 12, x FOR PEER REVIEW 5 of 23 Based on this feature, the inverter is modeled as an inertial link, as shown in Equation (4

Structure Design of Virtual Controller
The structure of virtual controller not only affects the VSG system stability, but also has a decisive influence on the control performance. The structure of virtual controller includes not only virtual rotor, virtual primary frequency modulation, and virtual secondary frequency modulation, but also an independent integration link. This design is to give full play to the ability of the controller to adjust the system frequency and improve the frequency stability of the system. The schematic of the controller is shown below.
In Figure 1, 3 K is the gain of the controller integration link, and other parameters are as described.

Parameter Design of Virtual Controller
The parameter selection of the virtual controller has an important influence on the performance of the virtual controller. The VSG virtual controller has three important parameters, namely, the virtual main controller coefficient 1 K , the virtual auxiliary controller coefficient 2 K , and the integral controller coefficient 3 K , these parameters not only affect the VSG frequency regulation effect, but also affect the stability of the whole control system. Conventional methods are hard to determine the best value of these three key parameters. The improved WOA is used to find the optimal combination of parameters to obtain the optimal control performance.

Example description
Equation (5) is the transfer function of the virtual controller. The parameters of the controller are set according to the results of the improved whale algorithm to achieve the optimal control performance. The issue of frequency control in power systems has been studied, and the object of VSG frequency control is to minimize the frequency deviation [52,53]. Therefore, the objective function of the improved WOA is the sum of the squares of the frequency offset in the steady state, and in consideration of the dynamic performance of the system, the frequency offset value in the dynamic process is added to the objective function, and the weighted sum of the two is the final objective function value. The final form of the objective function is shown in Equation (6).

Parameter Design of Virtual Controller
The parameter selection of the virtual controller has an important influence on the performance of the virtual controller. The VSG virtual controller has three important parameters, namely, the virtual main controller coefficient, the virtual auxiliary controller coefficient K 2 , and the integral controller coefficient K 3 , these parameters not only affect the VSG frequency regulation effect, but also affect the stability of the whole control system. Conventional methods are hard to determine the best value of these three key parameters. The improved WOA is used to find the optimal combination of parameters to obtain the optimal control performance.

Example description
Equation (5) is the transfer function of the virtual controller. The parameters of the controller are set according to the results of the improved whale algorithm to achieve the optimal control performance. The issue of frequency control in power systems has been studied, and the object of VSG frequency control is to minimize the frequency deviation [52,53]. Therefore, the objective function of the improved WOA is the sum of the squares of the frequency offset in the steady state, and in consideration of the dynamic performance of the system, the frequency offset value in the dynamic process is added to the objective function, and the weighted sum of the two is the final objective function value. The final form of the objective function is shown in Equation (6).
Symmetry 2020, 12, 1697 In Equation (6), m 1 and m 2 are weighting coefficients and satisfy m 1 + m 2 = 1, t sim is simulation time, and this time does not include transient time, t min is transient start time, t max is transient end time.

2.
Whale Optimization Algorithm WOA is a novel heuristic algorithm, which is inspired by humpback whale's bubble hunting strategy [54]. WOA has the advantages of few parameters and strong global optimization characteristics. It is applied here to the controller design to find the optimal controller parameters. The WOA consists of the following main processes.
(1) Random search The mathematical expression of the hunt process is as follows.
In the Equation, X r represents a position randomly selected from the current group position; X i stands for the position vector of the individual; t stands for the current number of iterations; Equation (7) is the distance between the individual and the random individual. B and E are coefficients.
a decreases as the number of iterations increases; r is a random number between 0 and 1.
X best (t) stands for the position vector of the current optimal individual, which changes with the number of iterations.
(3) Attack prey Humpback whales approach prey in a spiral manner, and the mathematical model of attacking prey is shown in the following Equation.
In Equation (13), When whales approach their prey in a spiral shape, they also need to shrink and encircle their prey. To simulate this behavior, this study assumes to choose between the spiral motion and the shrinking encirclement with a probability of 50%. The Equation is as follows.
Parameter A is the random vector between the intervals [−2,2]. When 0 ≤|A|≤ 1 , the current random individual position X rand is the position of the prey, and humpback whales attack close to the prey. When |A|> 1 , whales are far away from the random individual. Changing the change mode of convergence factor a from linear reduction to nonlinear reduction increases the global search ability of whale algorithm and the improved mode is adopted. In order to prove the advantages of the improved algorithm, run the following six different test functions. The results of improved WOA and the unimproved WOA are shown in Figure 2. In general, the improved WOA algorithm improves the solution accuracy and speed compared with the original algorithm.
Parameter A is the random vector between the intervals [-2,2]. When 0 | | 1 A  , the current random individual position rand X is the position of the prey, and humpback whales attack close to the prey. When | | 1 A  , whales are far away from the random individual.
Changing the change mode of convergence factor a from linear reduction to nonlinear reduction increases the global search ability of whale algorithm and the improved mode is adopted. In order to prove the advantages of the improved algorithm, run the following six different test functions. The results of improved WOA and the unimproved WOA are shown in Figure 2. In general, the improved WOA algorithm improves the solution accuracy and speed compared with the original algorithm. To conclude, the steps to search the optimal solution of controller parameters by using the improved WOA are as follows:


Initialization of algorithm, number of iterations, population size, and other parameters related to the operation of initialization algorithm.  Population initialization, set the initialization population. The optimal individual of each iteration cycle is recorded.  Update iteratively, update each individual according to the algorithm update method described, and calculate the fitness of each individual.  Update the parameters such as the optimal individual and the number of iterations. When the end condition is reached, go to step (5), otherwise, return to step (3).  The optimal solution of the optimization problem is obtained. To conclude, the steps to search the optimal solution of controller parameters by using the improved WOA are as follows: • Initialization of algorithm, number of iterations, population size, and other parameters related to the operation of initialization algorithm.

•
Population initialization, set the initialization population. The optimal individual of each iteration cycle is recorded.

•
Update iteratively, update each individual according to the algorithm update method described, and calculate the fitness of each individual.

•
Update the parameters such as the optimal individual and the number of iterations. When the end condition is reached, go to step (5), otherwise, return to step (3).

•
The optimal solution of the optimization problem is obtained.

Wind Farm
The wind power generation system model is shown in Figure 3 [39]. The random wind speed is simulated by the white noise module of MATLAB.

Model Description
The wind power generation system model is shown in Figure 3 [39]. The random wind speed is simulated by the white noise module of MATLAB.
 is the pitch angle, and 1 B~6 B are the turbine coefficients.
L  is the intermittent optimal tip speed ratio determined by U  and  , which are determined by Equation (17).
U  is the best tip speed ratio, as shown in Equation (18).
Assume that under all wind speed conditions, it operates at the best tip speed ratio, that is optimal UU   , T r is the radius.
The test system is tested when there is a wind farm. The parameter values of the wind turbine unit are shown in Table 1.  The output power of wind power generation is calculated using Equation (15).
ρ (Kg/m 3 ) is the air density, A m 2 is the swept area of the rotor, V wind (m/s) is the wind speed, and C(λ, β) is the power conversion coefficient, which is calculated by the following Equation.
β is the pitch angle, and B 1~B6 are the turbine coefficients. λ L is the intermittent optimal tip speed ratio determined by λ U and β, which are determined by Equation (17). λ U is the best tip speed ratio, as shown in Equation (18).
Assume that under all wind speed conditions, it operates at the best tip speed ratio, that is λ U = λ U optimal , r T is the radius.
The test system is tested when there is a wind farm. The parameter values of the wind turbine unit are shown in Table 1.

Photovoltaic Power Plant
The photovoltaic output power includes basic power and random fluctuation power. The fluctuation power is obtained by multiplying the random fluctuation by the standard deviation of the initial power. The solar power deviation is simulated by Equation (19). The schematic diagram is presented in Figure 4.

Photovoltaic Power Plant
The photovoltaic output power includes basic power and random fluctuation power. The fluctuation power is obtained by multiplying the random fluctuation by the standard deviation of the initial power. The solar power deviation is simulated by Equation (19). The schematic diagram is presented in Figure 4.

Load Model
The random module is multiplied by standard deviation of the initial load value to simulate the random fluctuation of load curve. The load deviation close to the actual load change is simulated by Equation (20). Figure 5 is the load model.

Load Model
The random module is multiplied by standard deviation of the initial load value to simulate the random fluctuation of load curve. The load deviation close to the actual load change is simulated by Equation (20). Figure 5 is the load model.

Photovoltaic Power Plant
The photovoltaic output power includes basic power and random fluctuation power. The fluctuation power is obtained by multiplying the random fluctuation by the standard deviation of the initial power. The solar power deviation is simulated by Equation (19). The schematic diagram is presented in Figure 4.

Load Model
The random module is multiplied by standard deviation of the initial load value to simulate the random fluctuation of load curve. The load deviation close to the actual load change is simulated by Equation (20). Figure 5 is the load model.

Microgrid System
The micro-grid model is constructed, and the proposed control scheme is simulated and verified. The micro-grid structure is simple, the construction is flexible, and it is convenient to verify the applicability of the control strategy.

System Configuration
The model consists of a traditional energy power plant, RE power plant, and household load. The detailed configuration of the system is shown in Table 2, and Figure 6 shows the structure of the system. The wind, solar, and load models are described earlier.

Microgrid System
The micro-grid model is constructed, and the proposed control scheme is simulated and verified. The micro-grid structure is simple, the construction is flexible, and it is convenient to verify the applicability of the control strategy.

System Configuration
The model consists of a traditional energy power plant, RE power plant, and household load. The detailed configuration of the system is shown in Table 2, and Figure 6 shows the structure of the system. The wind, solar, and load models are described earlier.

Whale Optimization Algorithm Application
The WOA code is run to obtain the optimal combination of controller parameters after the micro-grid model is built. The objective function of algorithm optimization is given in Equation (6), and the WOA code is executed in MATLAB. Table 3 shows the parameter values of WOA. Assign the optimization results to the controller so that the controller plays a better role. Table 4 shows the optimization results of WOA.

Egyptian Power System
A simulation model of power system is established building on the data provided in the 2017 Egyptian power holding company annual report [55]. The control algorithm proposed is applied to compare with the traditional control algorithm to verify the performance of the algorithm proposed. Figure 7 shows the structure of Egypt's power system. WOA code is executed in MATLAB. Table 3 shows the parameter values of WOA. Assign the optimization results to the controller so that the controller plays a better role. Table 4 shows the optimization results of WOA.

Egyptian Power System
A simulation model of power system is established building on the data provided in the 2017 Egyptian power holding company annual report [55]. The control algorithm proposed is applied to compare with the traditional control algorithm to verify the performance of the algorithm proposed. Figure 7 shows the structure of Egypt's power system.   Table 5.

Application of WOA
The WOA is applied to optimize the proportion and integral coefficient, and the configuration of WOA parameters is shown in Table 3. The objective function has been given in the previous experiments. When the objective function is the smallest, the optimal controller parameters are found. The performance of the controller is optimal after the optimal parameters are configured. Table 6 shows the optimization results.

Results
The model is built in Simulink, the relevant parameters are configured to test the effectiveness of the frequency control scheme. Different power system scenarios are simulated by changing the system inertia parameters. Compared with the traditional non inertial systematic control method, the effectiveness of the frequency control method is tested.

Evaluation of System Performance in High Inertia Environment
According to the original parameter configuration model, the test is carried out under step load and random load. The test results and analysis are as follows.

Step Load Test
When t = 500 s, a step load is added to the system to simulate the impact of sudden load or generator unit shutdown on the system. The test results are showed in Figure 8. The traditional control is primary and secondary frequency control, and the VSG control is added with inertia control. When t = 500 s, the system frequency drops due to the sudden increase of load in the system. In the conventional control, the time of frequency change point A and recovery point B is 500 s and 534 s, respectively, which takes a total of 34 s. In VSG control, the time of points A and B is 500 s and 514 s, respectively, which takes a total of 14 s. The control has the advantages of faster frequency recovery and stable frequency and less fluctuation compared with the conventional control. respectively, which takes a total of 34 s. In VSG control, the time of points A and B is 500 s and 514 s, respectively, which takes a total of 14 s. The control has the advantages of faster frequency recovery and stable frequency and less fluctuation compared with the conventional control.  Figure 9 is a waveform of random load. Figure 10 shows the test results for random load. The random load is connected at t = 500 s to test the ability of the system to deal with random disturbance. The system frequency fluctuates when the random load is connected. In the conventional control, the time of frequency change point A and recovery point B is 500 s and 533 s, respectively, which takes a total of 33 s. In VSG control, the time of points A and B is 500 s and 506 s respectively, which takes a total of 6 s. Compared with conventional control, the system frequency recovery is faster and more stable when VSG control.   Figure 9 is a waveform of random load. Figure 10 shows the test results for random load. The random load is connected at t = 500 s to test the ability of the system to deal with random disturbance. The system frequency fluctuates when the random load is connected. In the conventional control, the time of frequency change point A and recovery point B is 500 s and 533 s, respectively, which takes a total of 33 s. In VSG control, the time of points A and B is 500 s and 506 s respectively, which takes a total of 6 s. Compared with conventional control, the system frequency recovery is faster and more stable when VSG control. respectively, which takes a total of 34 s. In VSG control, the time of points A and B is 500 s and 514 s, respectively, which takes a total of 14 s. The control has the advantages of faster frequency recovery and stable frequency and less fluctuation compared with the conventional control.  Figure 9 is a waveform of random load. Figure 10 shows the test results for random load. The random load is connected at t = 500 s to test the ability of the system to deal with random disturbance. The system frequency fluctuates when the random load is connected. In the conventional control, the time of frequency change point A and recovery point B is 500 s and 533 s, respectively, which takes a total of 33 s. In VSG control, the time of points A and B is 500 s and 506 s respectively, which takes a total of 6 s. Compared with conventional control, the system frequency recovery is faster and more stable when VSG control.

Evaluation of System Performance in Low Inertia Environment
The same test is to test the control effect of the frequency control method in the environment of low system inertia. The test is also carried out under step load and random load. The test results and analysis are as follows.

Step Load Test
At t = 500 s, step load is added to the system, and the experimental results are shown in Figure  11. The frequency offset increases under the same load disturbance due to the decrease of system inertia, and the frequency drop increases from 0.15 Hz under high inertia to 0.2 Hz. In the conventional control, the time of frequency change point A and recovery point B is 500 s and 534 s, respectively, which takes a total of 34 s. In VSG control, the time of points A and B is 500 s and 508 s, respectively, which takes a total of 8 s. The VSG control system frequency recovery time is shorter than that of traditional control, and the frequency is more stable.

Evaluation of System Performance in Low Inertia Environment
The same test is to test the control effect of the frequency control method in the environment of low system inertia. The test is also carried out under step load and random load. The test results and analysis are as follows.

Step Load Test
At t = 500 s, step load is added to the system, and the experimental results are shown in Figure 11. The frequency offset increases under the same load disturbance due to the decrease of system inertia, and the frequency drop increases from 0.15 Hz under high inertia to 0.2 Hz. In the conventional control, the time of frequency change point A and recovery point B is 500 s and 534 s, respectively, which takes a total of 34 s. In VSG control, the time of points A and B is 500 s and 508 s, respectively, which takes a total of 8 s. The VSG control system frequency recovery time is shorter than that of traditional control, and the frequency is more stable.

Random Load Disturbance Test
When t = 500 s, the random load is added to the system, and the experimental results are shown in Figure 12. The frequency is decreased under the disturbance of the same load compared with that of the high inertia. As the system inertia decreases, the frequency deviation increases under the same disturbance. However, in the conventional control, the time of frequency change point A and recovery point B is 500 s and 531 s, respectively, which takes a total of 31 s. In VSG control, the time of points A and B is 500 s and 509 s, respectively, which takes a total of 9 s. VSG control system frequency recovery time is shorter and frequency is more stable compared with the traditional frequency control system.

Random Load Disturbance Test
When t = 500 s, the random load is added to the system, and the experimental results are shown in Figure 12. The frequency is decreased under the disturbance of the same load compared with that of the high inertia. As the system inertia decreases, the frequency deviation increases under the same disturbance. However, in the conventional control, the time of frequency change point A and recovery point B is 500 s and 531 s, respectively, which takes a total of 31 s. In VSG control, the time of points A and B is 500 s and 509 s, respectively, which takes a total of 9 s. VSG control system frequency recovery time is shorter and frequency is more stable compared with the traditional frequency control system. In summary, step load and random load are added to the system, and carry the experiments under different inertial conditions to prove the adaptability of the control algorithm. VSG control system has shorter frequency recovery time and stronger frequency stability compared with the traditional control, no matter the high system inertia, low system inertia, time step load change, or random load change, which verifies the effectiveness and adaptability of the algorithm proposed. The reason is that VSG enhances the inertia of the system, and the VSG optimized by algorithm enhances the adaptability to the environment, thus restraining the large fluctuation of frequency.

Egyptian Power System Test
The frequency control scheme proposed is compared with the results of the conventional In summary, step load and random load are added to the system, and carry the experiments under different inertial conditions to prove the adaptability of the control algorithm. VSG control system has shorter frequency recovery time and stronger frequency stability compared with the traditional control, no matter the high system inertia, low system inertia, time step load change, or random load change, which verifies the effectiveness and adaptability of the algorithm proposed. The reason is that VSG enhances the inertia of the system, and the VSG optimized by algorithm enhances the adaptability to the environment, thus restraining the large fluctuation of frequency.

Egyptian Power System Test
The frequency control scheme proposed is compared with the results of the conventional frequency control schemes to verify the superiority of the scheme.
Step load and random load are tested in the test, and the test results prove the adaptability of the scheme. The tests are described in detail below.

Step Load Test
In the Egyptian power system model mentioned, step load is added when t = 500 s and the load value is 0.05 pu to test the system's ability to cope with step load and system stability. The test results are showed in Figure 13. The first figure is the result of traditional frequency control, the second figure is the result of inertial control strategy proposed. Step load test diagram.
The system is connected to step load at t = 500 s, the frequency of both control schemes decreases. However, it is obvious that the frequency control scheme proposed to reduce the frequency reduction amplitude, frequency recovery time, and the disturbance degree of step load to the system is due to providing certain inertia to the system. In contrast, the traditional control system does not provide inertial support. During the load disturbance, the frequency fluctuation amplitude is large and the time is long, which affects the frequency stability of the system.

Random Load Disturbance Test
When t = 500 s, the system is connected with the random load to simulate the large-scale random load in real life connected to the power system at any time. The random load waveform is shown in Figure 9. The test results are shown in Figure 14. Step load test diagram.
The system is connected to step load at t = 500 s, the frequency of both control schemes decreases. However, it is obvious that the frequency control scheme proposed to reduce the frequency reduction amplitude, frequency recovery time, and the disturbance degree of step load to the system is due to providing certain inertia to the system. In contrast, the traditional control system does not provide inertial support. During the load disturbance, the frequency fluctuation amplitude is large and the time is long, which affects the frequency stability of the system.

Random Load Disturbance Test
When t = 500 s, the system is connected with the random load to simulate the large-scale random load in real life connected to the power system at any time. The random load waveform is shown in Figure 9. The test results are shown in Figure 14. When t = 500 s, the random load is connected and the system frequency drops. Without inertia control, the drop amplitude reaches 0.004 Hz, the frequency instability time is longer. With inertia control, the frequency drop amplitude is 0.002 Hz, the frequency instability time is shorter, and the steady-state frequency is smoother. The inertia and frequency stability of the system are increased by using the frequency control method proposed in this study. The results verify the effectiveness of the frequency control scheme. The frequency control method proposed is superior to the traditional control method.

Conclusions
In RE systems, this study develops a VSG frequency systematic control method to solve the problem of frequency stability of new energy power systems, which becomes a key challenge for large-scale access of new energy to power systems. The control strategy makes the inverter have the characteristics of traditional SG and also includes the primary and secondary frequency regulation mechanisms. The control loop has certain inertia, which increases the ability of a system to suppress frequency fluctuation, thereby increasing the RE power system frequency stability. The unique control loop structure is designed. The parameters of the control strategy are optimized by using the improved WOA. The virtual controller is designed by the optimization results of the algorithm to achieve the best control effect.
Two kinds of test models are established. The small power system verifies the control effect and adaptive performance of frequency coordination strategy under different inertia conditions. The simulation system is established to verify the VSG systematic control method performance in power system based on the data of an Egyptian electric power holding company. The experimental results show that the proposed frequency coordinated control strategy increases the inertia and damping of the system, so the frequency is more stable compared with the traditional frequency control method. Under the same disturbance, the system frequency fluctuation amplitude and time are significantly reduced, which proves the excellent performance of the frequency coordinated control strategy. The systematic control method proposed in this study improves the inertia of the inverter, so as to improve the frequency stability of the system. The main contribution of this study is to propose a When t = 500 s, the random load is connected and the system frequency drops. Without inertia control, the drop amplitude reaches 0.004 Hz, the frequency instability time is longer. With inertia control, the frequency drop amplitude is 0.002 Hz, the frequency instability time is shorter, and the steady-state frequency is smoother. The inertia and frequency stability of the system are increased by using the frequency control method proposed in this study. The results verify the effectiveness of the frequency control scheme. The frequency control method proposed is superior to the traditional control method.

Conclusions
In RE systems, this study develops a VSG frequency systematic control method to solve the problem of frequency stability of new energy power systems, which becomes a key challenge for large-scale access of new energy to power systems. The control strategy makes the inverter have the characteristics of traditional SG and also includes the primary and secondary frequency regulation mechanisms. The control loop has certain inertia, which increases the ability of a system to suppress frequency fluctuation, thereby increasing the RE power system frequency stability. The unique control loop structure is designed. The parameters of the control strategy are optimized by using the improved WOA. The virtual controller is designed by the optimization results of the algorithm to achieve the best control effect.
Two kinds of test models are established. The small power system verifies the control effect and adaptive performance of frequency coordination strategy under different inertia conditions. The simulation system is established to verify the VSG systematic control method performance in power system based on the data of an Egyptian electric power holding company. The experimental results show that the proposed frequency coordinated control strategy increases the inertia and damping of the system, so the frequency is more stable compared with the traditional frequency control method. Under the same disturbance, the system frequency fluctuation amplitude and time are significantly reduced, which proves the excellent performance of the frequency coordinated control strategy. The systematic control method proposed in this study improves the inertia of the inverter, so as to improve the frequency stability of the system. The main contribution of this study is to propose a novel control strategy, and also to apply the improved WOA to parameter optimization, so as to maximize the performance of the control strategy. This study solves the problems of low inertia and unstable frequency of RE power system, promotes the penetration of clean energy in power system and promotes sustainable development of environment.
The VSG frequency control is studied to ensure the frequency stability and active power balance of the system. The voltage control is not discussed, which is the deficiency of this study. Reactive power balance and voltage stability of a power system occupy the same important position as frequency stability. Future studies might be on VSG voltage control and more optimization methods to this field to further improve the control strategy and maintain the symmetry between the grid connection rate of new energy and the voltage stability of power system.