Adaptive Virtual Synchronous Generator Based on Model Predictive Control with Improved Frequency Stability

: With the massive integration of renewable energy into the grid, grid inertia and its stability continue to decrease. To improve inertia and facilitate grid restoration, a control strategy for radial basis function virtual synchronous generators based on model predictive control (MPC-VSG-RBF) is proposed in this paper. In this method, virtual synchronous generator (VSG) control strategy is introduced into the model predictive control (MPC), so that the reference value of the inner loop current can vary with the grid voltage and frequency. Using the radial basis function (RBF) neural network to adjust the VSG virtual inertia online can solve the large ﬂuctuation of frequency and power caused by excessive load ﬂuctuation. The simulation model was built based on MATLAB and compared and analyzed with the MPC control method. The simulation results show that: when the output power of the inverter changes, the model predictive control of the adaptive virtual synchronous generator can increase the inertia and stability of the power grid; by adjusting the moment of inertia, the system damping ratio is improved to effectively suppress the transient process overshoot and oscillation in medium power.


Introduction
At present, the energy crisis has quietly arrived and the world's environmental pollution is becoming increasingly serious.In this context, renewable energy has attracted attention to all sides [1,2].The proportion of renewable energy to the power grid is increasing, and grid-connected inverters need to meet stringent requirements in terms of cost and reliability [3][4][5].Model predictive control (MPC) is not only very flexible, but also relatively simple and easy to implement; therefore, scholars in this field have carried out research in succession [6,7].MPC can compare the predicted value and its reference value with the cost function.The most ideal switching state of the inverter can be obtained and does not need phase-locked loop, proportional integration.MPC has been used in permanent magnet synchronous generators (PMSG), modular multilevel converters, and bi-directional DC-DC converters [8][9][10].The literature [11] studies a hybrid model predictive control based on active-neutral-point-clamped converter, which can ensure the operation of the base frequency of low frequency cell and improve the steady-state performance.A fixed-switching frequency resilient power model predictive control approach centered on PWM rectifier is studied in the literature [12], which can improve the robustness of MPC controller.A MPC scheme based on two-stage optimization is proposed for the driver of a PMSG by a five-level active neutral clamp converter.Control and modulation stages are combined in a single layer, and the whole performance optimization can be realized by a simple implementation process [13].However, the above literature does not take into account that with the gradual increase in the grid-connected capacity of renewable energy, there is not enough inertia in the power system.While the MPC control inverter cannot respond to changes in grid, it also cannot support a certain inertia.
In order to compensate for grid inertia, virtual synchronous generator (VSG) control is proposed [14,15].The VSG method has been applied in various studies.The converter of a distributed generation system can provide active and reactive power support for the system by imitating the working characteristics of a synchronous motor and realize the balance and stability of the system force [16][17][18].The authors of [19] propose a virtual inertia control strategy that is adaptive.In this method, when the frequency deviates from the nominal value, a large amount of inertia is used.However, little inertia is used to speed up the system dynamics when the frequency returns to the nominal frequency.By incorporating the variation of virtual angular frequency into the adaptive control strategy of virtual impedance, the active regulation process of the VSG system can be sped up [20].In [21], the bang-bang algorithm incorporates fuzzy control to achieve the correction of virtual inertia.It improves the algorithm's fault tolerance, adaptability, and stability.Severe power oscillation may happen when multi-VSGs are connected in parallel.The authors of [22] suggest using an adaptive virtual impedance method with a multi-VSG power grid.Modifying the output active power through adaptive virtual impedance is the main concept.In [23,24], virtual inertia J is adjusted using a radial basis function (RBF) neural network, which significantly enhances the frequency stability of VSG.However, design of voltage current double closed loop control and the calculation of complex parameters are not considered in the above documents.
In summary, this paper proposes an adaptive virtual synchronous generator strategy based on model predictive control (MPC-VSG-RBF) for the moment of inertia.By using virtual synchronous generator control strategy to simulate the basic characteristics of a synchronous generator, it can provide certain inertial support to the power grid.RBF neural network is utilized to the moment of inertia in automatically to weaken the overshoot and oscillation of the system.After MPC selects each switch state, it can obtain the corresponding predicted current at the next moment.A switching state that minimizes the cost function can be viewed as an optimal state.Finally, a simulation model is created using MATLAB software to ensure that the suggested method is correct.

Mathematical Model of LCL Grid-Connected Inverter
Compared with the L-type filter, the LCL filter used in this paper is more portable, and its high frequency harmonic filter effect is relatively mild.At present, this kind of filter has been implemented in a wide range.The basic topology diagram of the inverter is shown in Figure 1.U dc is dc power supplied; L 1abc is the filter inductance on the inverter side; e abc is grid voltage; i 1abc is the inverter side current; U inabc is the output voltage of inverter; U cabc is the filter capacitor voltage; i 2abc is the network side current; R 1abc is the parasitic resistor.Based on the classical Kirchhoff's law, the mathematical model of LCL grid-connected inverter can be obtained.After Clark transformation, (1) can be obtained.Based on the classical Kirchhoff's law, the mathematical model of LCL grid-connected inverter can be obtained.After Clark transformation, (1) can be obtained.
3. Principle and Design of RBF Adaptive Virtual Synchronous Generator 3.1.The Basic Principle of Virtual Synchronous Generator During the experiment, the synchronous generator can be specifically divided into 2, 3, and 5 order models [25,26].In order to weaken the complex coupling relationship with synchronous generator, the second-order model is selected in this paper.According to the mechanical and electromagnetic characteristics of the simulated synchronous generator, VSG shows the damping characteristics basically consistent with those of the synchronous generator.To achieve current model predictive control.VSG can obtain a reference current through the control shown in Figure 2. Based on the classical Kirchhoff's law, the mathematical model of LCL gri nected inverter can be obtained.After Clark transformation, (1) can be obtained.

The Basic Principle of Virtual Synchronous Generator
During the experiment, the synchronous generator can be specifically divided 3, and 5 order models [25,26].In order to weaken the complex coupling relationshi synchronous generator, the second-order model is selected in this paper.According mechanical and electromagnetic characteristics of the simulated synchronous gen VSG shows the damping characteristics basically consistent with those of the synchr generator.To achieve current model predictive control.VSG can obtain a referenc rent through the control shown in Figure 2. The control method can be specifically classified into three parts.The first part to adjust the active frequency.The second part needs to adjust the reactive voltag third separate outputs the reference current.The mechanical torque equation is sim by the following two formulas to simulate the motor's own motion characteristics.The control method can be specifically classified into three parts.The first part needs to adjust the active frequency.The second part needs to adjust the reactive voltage.The third separate outputs the reference current.The mechanical torque equation is simulated by the following two formulas to simulate the motor's own motion characteristics.
where D p -active damping coefficient; T e -VSG output torque; ω o -rated electrical angular velocity; T set -torque given value; ω-when the polar logarithm is 1, the electrical and mechanical angular velocities are the same; J-moment of inertia.
Based on the reactive voltage relationship, the E value of VSG can be adjusted, as showed in Equaiton (4): where Q e -the reactive power output by the inverter; D q -reactive voltage droop coefficient; U g -effective value of grid voltage; Q set -reactive power set value; E m -effective value of internal potential of inverter; U o -grid voltage reference value; K-integral coefficient of the reactive power ring.
P e and Q e represent the instantaneous measurement value corresponding to the incoming power, as showed in Equaitons ( 5) and ( 6): ) where e αβ -network measuring voltage; i 2αβ -net measuring current.Formula ( 7) illustrates the counter-electromotive force produced by rotor movement in the stator windings: In the above equation, there is an error voltage between the E abc of VSG and the capacitor voltage V c , which can generate a MPC reference current.See Figure 2 for details, Equation ( 8) can be obtained.
When the VSG method is used, the three-phase inverter is similar to the traditional generator.When the frequency of the power grid fluctuates, the active power will also change, giving a certain inertial support to the power grid.

RBF Neural Network
Neural network algorithm is just an artificial intelligence algorithm that imitates the human nervous system.In the neural network, there is an algorithm to imitate the human brain nervous system, which is called RBF neural network.A three-layer forward RBF neural network often provides a decent approximation effect for continuous nonlinear functions.In addition, the algorithm is straightforward.Learning is powerful, and learning happens quickly, all of which are necessary for real-time control.
The input of the RBF neural network is as follows: The output of the j neuron in the hidden layer of the neural network is c j : The central point factorization value c j = [c j1 , c j2 , . . ., c jn ] in the formula above corresponds to the neuron in j hidden layer.
Equation (11) illustrates the broad vector corresponding to the gaussian basis function used in this study: The breadth of the gaussian basis function corresponding to the j neuron in the hidden layer is indicated by the symbol b j > 0 in the formula above.
Equation (12) provides specifics on the network weights used in this study.
Equation ( 13) illustrates this condition's related neural network output: Energies 2022, 15, 8385 5 of 13 The following criteria are used to optimize the RBF neural network so that it can satisfy the predetermined control requirements.
(1) According to the principle of RBF neural network, gaussian basis function of hidden layer introduces nonlinear factors.But there is a direct linear connection between hidden layer and output layer, which leads to its nonlinear ability is not as good as BP neural network; (2) The generator rotor's moment of inertia serves as the object on which the RBF neural network in this study acts.The following criteria are utilized to optimize the RBF neural network so that it can satisfy the predetermined control requirements.The value of the moment of inertia is under a limited range.The moment of inertia can neither be negative nor set too large.Otherwise, it may adversely affect the stability of the system.
Combining the above two reasons, the nonlinear operation the output node of the conventional RBF neural network receives the addition of a sigmoid function.Which can not only increase the nonlinear ability of the network output, but also limit the value of the network output.
e y e y + e −y (14)

The Establishment and Analysis of Adaptive Model
Figure 3 depicts the system architecture for enhanced RBF neural network-based virtual inertia adaptive control.Three layers account for the neural network: an input layer, an output layer, and a hidden layer.Input layer node, hidden layer node, and output layer node are each represented by j, I, and l, respectively.In this instance, there are for two input layers, five hidden levels, and one output layer.In Figure 4, two input of RBF neural network node corresponding angular frequency variation of virtual synchronous generator and angular frequency change rate and hidden layer function chooses gaussian basis function.The output node corresponds to the virtual moment of inertia J, because the moment of inertia of the physical significance of the decision output cannot be negative, so the output layer joins the sigmoid activation function.

 
T 12 = , , , m w w w w (12) Equation ( 13) illustrates this condition's related neural network output: The following criteria are used to optimize the RBF neural network so that it can satisfy the predetermined control requirements.
(1) According to the principle of RBF neural network, gaussian basis function of hidden layer introduces nonlinear factors.But there is a direct linear connection between hidden layer and output layer, which leads to its nonlinear ability is not as good as BP neural network; (2) The generator rotor's moment of inertia serves as the object on which the RBF neural network in this study acts.The following criteria are utilized to optimize the RBF neural network so that it can satisfy the predetermined control requirements.The value of the moment of inertia is under a limited range.The moment of inertia can neither be negative nor set too large.Otherwise, it may adversely affect the stability of the system.
Combining the above two reasons, the nonlinear operation the output node of the conventional RBF neural network receives the addition of a sigmoid function.Which can not only increase the nonlinear ability of the network output, but also limit the value of the network output.

The Establishment and Analysis of Adaptive Model
Figure 3 depicts the system architecture for enhanced RBF neural network-based virtual inertia adaptive control.Three layers account for the neural network: an input layer, an output layer, and a hidden layer.Input layer node, hidden layer node, and output layer node are each represented by j, I, and l, respectively.In this instance, there are for two input layers, five hidden levels, and one output layer.In Figure 4, two input of RBF neural network node corresponding angular frequency variation of virtual synchronous generator and angular frequency change rate and hidden layer function chooses gaussian basis function.The output node corresponds to the virtual moment of inertia J, because the moment of inertia of the physical significance of the decision output cannot be negative, so the output layer joins the sigmoid activation function.Details may be seen in Figure 3. Equation ( 15) displays the output of the input layer corresponding to the neural network.
, ( The output of the hidden layer is: The three levels of the neural network are indicated in the formula above by the numbers (1), (2), and (3), in that sequence.Equation ( 18) describes the gaussian basis function in detail.
The input of the output layer is shown in Equation ( 19): The output results of the neural network are as follows: (3) ( ) 0.5* ( ( )), 1 () The matching weight from the hidden layer to the output layer is represented by wli (3)  in the formula above.
Equation ( 22) illustrates the activation function for the neural network's output layer.

U dc
Cost  The output of the hidden layer is: The three levels of the neural network are indicated in the formula above by the numbers (1), (2), and (3), in that sequence.Equation (18) describes the gaussian basis function in detail.
The input of the output layer is shown in Equation (19): The output results of the neural network are as follows: The matching weight from the hidden layer to the output layer is represented by w li (3) in the formula above.Equation ( 22) illustrates the activation function for the neural network's output layer.
The performance index function of RBF is configured as follows in this paper: Energies 2022, 15, 8385 7 of 13 The weight of the network is modified in this study using the gradient descent method.In this article, an inertia term is incorporated to effectively increase the convergence speed.
The learning rate is denoted by η and the inertia coefficient by α in the preceding expression.
The relative changes in ω(k) and J(k) can be solved since ω(k)/J(k) must be applied during the weight update and the derivation is rather complicated.
In this step, we only need to obtain the positive or negative of Equaiton ( 26), so we use the sign function: The solution of Equation ( 27) will contain some error, but the learning rate can correct it.Equation (28) illustrates the appropriate regulatory formula for RBF weight in this situation:

Model Predictive Current Control Algorithm
It should be noted that the prediction model should be discredited.One of the more common methods in this link is the typical forward difference method, as showed in Equation ( 29): In (30), U inαβ (k) refers to the voltage vector output by the inverter at k.The specific relationship between the two vectors is shown in Table 1.In each sampling period, eight output voltage vectors are substituted into the above formula one by one.

Topology
The MPC based adaptive VSG scheme is illustrated in Figure 4.It is including RBF neural network, VSG control, LCL filter, etc.The sampling module is responsible for directly transferring the corresponding state value at the specified time to the controller, which is intended to be processed in the next step.In addition, the MPC prediction model is responsible for predicting the next state value based on the state value at one time.
This paper combines MPC with adaptive VSG.The output of the RBF neural network is the virtual moment of inertia J, and VSG outputs the reference current of MPC.The inverter is then guided by the MPC to follow the reference current.VSG control in Figure 2, which adapts to variations in grid frequency and voltage, is how the reference current is acquired, as illustrated in Figure 4.The prediction function may be used to determine the expected current of various voltage vectors at the succeeding instant (30).The cost function Equation ( 31) is utilized to pick the ideal voltage vector through an enhanced voltage vector selection, with the goal of bringing the output current as close as possible to the reference value.The voltage vector of the following instant can be utilized if the cost function g reduces to a minimum.
The working principle is as follows: First, sample the current values i 1abc and i 2abc corresponding to the inverter side and the network side at the current moment, and the sampling capacitance and the voltage values corresponding to the power grid U cabc and e abc .Second, necessary Clark transformation was performed for the above state values, and MPC prediction model was put in place to solve the problem.Lastly, Park transformation was performed on the predicted values obtained by adaptive VSG control of RBF neural network, and cost function was introduced.

Results
In order to verify the viability of the suggested technique, the simulation model in Figure 4 is established, and the proposed control algorithm is applied to the simulation model.Then, using MATLAB software, a simulation model was built for verification.See Table 2 for the parameters.The simulation duration is 1.6 s.In the initial stage, the set value of active and reactive power is 0. To simulate power grid disturbance, active load of 10 kW is suddenly added when t = 0.6 s.In this paper, MPC-VSG-RBF has excellent characteristics that can adjust active power and frequency.The experimental waveform, which MPC control, is shown in Figures 5 and 6; MPC-VSG and MPC-VSG-RBF control are successively carried out.
power is 0. To simulate power grid disturbance, active load of 10 kW is suddenly added when t = 0.6 s.In this paper, MPC-VSG-RBF has excellent characteristics that can adjust active power and frequency.The experimental waveform, which MPC control, is shown in Figures 5 and 6  As can be seen from Figure 5, the typical MPC control technique reacts to a rapid rise in active power, the adjustment time is extremely fast, the frequency does not change, and the system lacks the inertia of synchronous generator.MPC-VSG control, when the active power changes, the VSG frequency fluctuation, and active response quickly tracks the frequency change.The current change is smoother, with better dynamic performance, which better improves the system frequency and power dynamic response and stability.After adaptive adjustment of virtual inertia is adopted, the active power increases suddenly; although the inertia is reduced to a certain extent, there is no oscillation process.As can be seen from Figure 5, the typical MPC control technique reacts to a rapid rise in active power, the adjustment time is extremely fast, the frequency does not change, and the system lacks the inertia of synchronous generator.MPC-VSG control, when the active power changes, the VSG frequency fluctuation, and active response quickly tracks the frequency change.The current change is smoother, with better dynamic performance, which better improves the system frequency and power dynamic response and stability.After adaptive adjustment of virtual inertia is adopted, the active power increases suddenly; although the inertia is reduced to a certain extent, there is no oscillation process.The actual values of indicators for increases in active power are shown in Table 3.The active power overshoot is 380 W and the settling time is 0.675 s when the adaptive control strategy is not used.The overshoot is decreased by 42% and the settling time is decreased by 12% when the RBF adaptive control strategy is used.The angular velocity overshoot is 0.2 rad/s when the adaptive control strategy is not used.The overshoot is cut in half when RBF adaptive control is used.The MPC-VSG-RBF control strategy, in conclusion, has a better control effect.Figure 6 shows the simulation current waveform of current-controlled grid-connected inverter, conventional VSG and inertia adaptive VSG.Traditional VSG has the external characteristics of synchronous generator due to the addition of damping and inertia links.Overshoot and oscillation phenomena occur when power changes are given.The current overshoot is 1 A, and the settling time is 0.675 s.When RBF adaptive control strategy is used.The current overshoot is reduced by 31% and the settling time is reduced by 12%.MPC-VSG-RBF control strategy current waveform had better dynamic response.
Figure 7 shows results under the disturbance of grid frequency.According to Table 3, when the adaptive control strategy is not adopted, the active power overshoot is 440 W and the settling time is 0.55 s.When using the RBF adaptive control strategy, the overshoot is reduced by 50% and the settling time is reduced by 16%.Without adaptive control strategy, the angular velocity overshoot is 0.06 rad/s.When the RBF adaptive control strategy is used, the overshoot decreases by 50%.In conclusion, the MPC-VSG-RBF control strategy gets a better control effect.

Conclusions
Based on the traditional MPC control, this paper proposes an improved scheme of rotational inertia adaptive VSG.The advantages of the two control strategies are effectively combined, which not only reduces the parameter setting and optimizes the control structure, but also plays an important role in providing inertial support for the power grid.The power fluctuation and overcurrent problems of VSG control in transient process are effectively solved, and the active power and frequency stability of autonomous microgrid are improved.The main work completed is as following: (1) A VSG is introduced into the model predictive control algorithm.The advantages of the two are effectively combined, which not only reduces the parameter setting, but also provides certain inertial support for the power grid;

Conclusions
Based on the traditional MPC control, this paper proposes an improved scheme of rotational inertia adaptive VSG.The advantages of the two control strategies are effectively combined, which not only reduces the parameter setting and optimizes the control structure, but also plays an important role in providing inertial support for the power grid.The power fluctuation and overcurrent problems of VSG control in transient process are effectively solved, and the active power and frequency stability of autonomous micro-grid are improved.The main work completed is as following: (1) A VSG is introduced into the model predictive control algorithm.The advantages of the two are effectively combined, which not only reduces the parameter setting, but also provides certain inertial support for the power grid; (2) Based on VSG control, optimization control of RBF virtual moment of inertia adaptive adjustment is proposed.It effectively solves the power fluctuation and overcurrent problems of traditional VSG control in the transient process, and improves the active power and frequency stability of independent micro-grid; (3) The traditional MPC control strategy is compared with the proposed MPC-VSG-RBF control method of simulation.The control strategy applied in this paper can improve the inertial response capability of the independent micro-grid and optimize the transient process of the system when the power of the grid is abrupt.

Figure 1 .
Figure 1.Topology of a three-phase LCL-type grid-connected inverter.

Figure 1 .
Figure 1.Topology of a three-phase LCL-type grid-connected inverter.

Figure 2 .
Figure 2. The control structure of the VSG.

Figure 2 .
Figure 2. The control structure of the VSG.

Figure 3 .
Figure 3. Structural diagram of RBF adaptive virtual synchronous generator.

Figure 3 .
Figure 3. Structural diagram of RBF adaptive virtual synchronous generator.

Figure 5 ;Figure 5 .
Figure 5.Under imbalance of power supply and demand: (a) active power waveform comparison; (b) angular velocity waveform correlation.;(c) change in moment of inertia J.

Figure 5 .
Figure 5.Under imbalance of power supply and demand: (a) active power waveform comparison; (b) angular velocity waveform correlation.;(c) change in moment of inertia J.

Figure 7 .
Figure 7.Under grid frequency disturbance: (a) active power waveform comparison; (b) angular velocity waveform correlation.;(c) change in moment of inertia J.

Figure 7 .
Figure 7.Under grid frequency disturbance: (a) active power waveform comparison; (b) angular velocity waveform correlation.;(c) change in moment of inertia J.

Table 1 .
Switching state and inverter output voltage vector corresponding table.

Table 2 .
System parameters of three-phase LCL Filter grid-connected inverter.

Table 3 .
Indicator values of active power increases and grid frequency disturbance.