Adaptive Command-Filtered Backstepping Control for Virtual Synchronous Generators

: Distributed energy sources are usually interfaced to the grid using power electronic converters, and lack of inertia in inverter dominated microgrids can affect the system stability. This paper presents a new method for virtual synchronous generator (VSG) control in order to solve the low system inertia and support the grid frequency problem. In this paper, the VSG based on electromagnetic transient characteristics is improved and an adaptive command ﬁlter back-stepping controller is designed. Firstly, the rotor swing equation and power part are modeled to complete the controller design for achieving system stability in the islanded, grid-connected and transition modes. In addition, a limited-amplitude command ﬁlter is used to deal with computational complexity and nonlinear saturation problems in the design process. Secondly, projection operator, and adaptive inertia and damping control are introduced to reduce the modeling error and disturbance caused by changing parameters. This ensures the boundedness of the estimated value and further improves the frequency response, especially in the transition mode. Finally, simulation results show that the proposed controller is more effective than the traditional control method for achieving power stability and frequency improvement.


Introduction
The development of wind turbines, photovoltaic cells and other renewable energy sources has increased the importance of implementing optimal control, operation and grid-connection of distributed generation (DG) units [1][2][3]. In general, as a result of sudden load fluctuation or motor overload in a traditional power system, the rotor of a traditional synchronous generator (SG) releases its kinetic energy gradually to make up for the power shortage and restrain the system frequency from changing rapidly [4]. However, distributed energy sources are connected to the power grid on a large scale through grid-connected inverter, and the DG units making up a distributed generation units lack mechanical inertia. As a result, when a power system based on these sources is disturbed, the power electronic inverter reacts rapidly, which results in a sudden change of all performance parameters that subsequently affects the stability of the power grid operations.
To deal with the instability in power grid operations in a system consisting of distributed energy sources, the concept of a virtual synchronous generator (VSG) was first proposed in [5]. By introducing the rotor swing equation, the virtual inertia and primary frequency regulation instructions were conceived to simulate the external characteristics of the SG using this concept. The VSG can increase the inertia of the inverter and improve the system output response [6][7][8][9]. Although the VSG is equivalent to the traditional synchronous generator in terms of output characteristics, it is still difficult to maintain system stability under high transient conditions.
As a common control method of a voltage source in the islanded mode, the VSG control is similar to droop control: when the load changes, it causes a permanent frequency offset [10]. Therefore, when the system is connected to the grid, a phase-locked loop (PLL) is always needed to obtain the frequency and the initial angle of the power grid [11]. In [12], a seamless transfer control based on the PLL was proposed. In this control method, the phase and magnitude of the load voltage were matched to the grid voltage, and there was no distortion of the load voltage and current when transferring from islanded mode to grid-connected mode. As the PLL measurement accuracy is often dependent on a parameter design, a synchronization method based on virtual impedance was proposed in [13]. This method did not require a PLL. When the virtual current decreased to zero, there was no power exchange with the power grid and the output voltage was indirectly consistent with the power grid voltage state. However, it still took nearly one second to synchronize the two voltages. All the methods mentioned previously require a pre-synchronization process. As a result, when the output voltage is inconsistent with the grid voltage, the system is likely to become unstable .
To further improve the grid frequency response, virtual inertia and damping can be used for parameter design. In [14], the inertia response of a synchronous motor was simulated by the energy storage system, and the frequency and power changes were reduced based on an optimal parameter selection algorithm. In [15], the damping effect of the variable inertia scheme was investigated using transient energy analysis, and the influence on the stability of adjacent motors was discussed. In [16], the effects of virtual inertia and damping were analyzed comprehensively to obtain fast and stable load disturbance frequency in grid-connected mode.
When dealing with high-order nonlinear systems, backstepping control (BSC) method can be applied. In this method, we can simplify the system in order to obtain low-order subsystems, and then intermediate virtual control variables and Lyapunov functions are selected in turn. The design of the control law of the whole system is completed recursively based on the Lyapunov stability principle [17,18]. However, with the increase of system order, the controller design becomes more complex as the analytic form of derivative of the virtual control quantity has to be calculated [19]. The use of command filter can effectively reduce the computational complexity in the BSC method and enhance the anti-interference ability of the system [20]. The traditional backstepping control needs accurate information of the controlled system model, and an adaptive method is widely used to deal with parameter uncertainty in the system modeling. In [21], a feedback control method combining the backstepping control and fuzzy controllers was adopted, which could approximate nonlinear functions and achieve good tracking. In [22], an artificial neural network was added to the backstepping control to control the induction motor drive system, which could efficiently estimate uncertain parameters online.
In this paper, the modeling errors of a VSG system are estimated using an adaptive method. These modeling errors include external bounded disturbances, virtual inertial and damping parameter variation disturbances. A projection operator is further introduced. This method can estimate uncertain parameters online and ensure the boundedness of these value. Several control strategies are compared in Table 1.

VSG
It mimics synchronous generator and realizes the smooth change of system frequency with virtual damping and inertia.

BSC
A complementary nonlinear signal is added to the VSG system to preserve system stability and to suppress the impulse current during the transition process.

ACB
The command filter and projection adaptive algorithm are applied to the BSC control to attenuate power oscillations.
Accordingly, the novel contributions of this paper are as follows:

1.
A nonlinear controller is proposed and it adds a supplementary signal to the VSG system to guarantee the stability of the system in the islanded, grid-connected and transition modes.

2.
The command filter is used to eliminate the differential expansion in the backstepping controller, and simplify the derivation process and controller design.

3.
In order to improve the frequency response of VSG in the transition process, this paper focuses on the adaptive adjustment of virtual inertia and damping. 4.
In view of actual model error and external disturbances, a projection operator is introduced. The use of the operator always keeps the estimated value of the parameter in the preset range, which ensures system convergence.
The rest of this paper is organized as follows. In Section 2, a mathematical model of the VSG system is introduced, followed by the adaptive adjustment of virtual inertia and damping of VSG. In Section 3, a state space model is obtained according to the structure of the controller. In Section 4, the adaptive command filter backstepping (ACB) control is designed for the VSG system and the stability of the controller is proved using the Lyapunov stability theorem. In Section 5, simulation results and comparisons with traditional control methods are presented to demonstrate the effectiveness of the proposed controller.

Mathematic Model of the VSG
An ideal three-phase round-rotor synchronous generator model of stator and field winding axis is shown in Figure 1 [6]. The rotation angle of the rotor magnetic field is denoted by θ. R s , L, R f and L f respectively represent the resistance and inductance of stator and rotor.
whereṽ,ĩ are defined as the the three-phase voltages and currents.ẽ is the back electromotive force (EMF) generated in the stator windings (due to the rotor movement) where ψ f = M f i f , can be obtained from the mutual inductance between the excitation windings and the stator windings and the excitation current. Similar to synchronous generator, rotor swing equation is introduced, as shown in Figure 2.
Its dynamic characteristic is given as where J and D are the virtual inertia and damping factor of the rotor. T e and T ref are the electromagnetic torque and the mechanical torque. ω and ω set are the mechanical speed and its rating. The output power can be calculated by the voltage and current of each phase where <, > denotes the inner product, select the three-phase current as Then Equation (4) can be rewritten as where δ = θ − ϕ, can be calculated by the phase Angle of voltage and current. The electromagnetic torque is given as Similarly, the reactive power of the system can be obtained as The generation principle of voltage is similar to that of synchronous generator, its frequency and phase angle are regulated by the power damping synchronous circuit, and the voltage amplitude is given by the flux regulating circuit, flux control is shown in Figure 3.
Where V ref and V m are the reference voltage amplitude and the actual voltage amplitude respectively, k p and k i are the PI controller parameters.
After the error is fed into the PI controller, a low pass filter is used to simulate the flux decay eauation in the synchronous generator [23]. Flux decay eauation is mainly due to the inductance of the rotor winding. When the dc voltage is applied on the rotor excitation, there is a delay on the stator side. The use of a low-pass filter also contributes to the design of the controller and to the elimination of the higher harmonics of the output, which will be discussed in the next section. Its transfer function is given as The reference voltage amplitude is calculated as follows where V s is the no-load voltage amplitude, Q e is the reactive power of the system, n is the droop coefficient.

Adjustment of Rotor Inertia and Damping Factor
According to Equation (3), (3) can be rewritten as That is, the steady-state offset of the system frequency is affected by D.
Reference [16] indicates that as the moment of inertia J increases, the rate of frequency change decreases, but the time needed for the frequency to stabilize increases. In the grid-connected mode, increasing the damping factor D can reduce the offset peak value of the frequency and reduce the time needed for the frequency to become stable. Combining with the general adaptive algorithm of moment of inertia, the improvement of frequency in transition process is considered where J 0 is the virtual inertia at steady state, k j is the regulation factor of virtual inertia, and C is the decision threshold, which can avoid small error changes in detection.
When the system switches directly to the grid-connected mode, the power grid begins to participate in power exchange, and the frequency reaches the rated value gradually. In this case, the damping factor D can be increased appropriately such that the frequency climbs down from the maximum deviation value to a stable value. When the system switches from grid-connected mode to islanded mode, the damping factor remains unchanged. In this case, the only factor influencing the frequency is the change of virtual inertia, which will be verified in the simulation analysis.

Controller Structure and Mathematical Model
The structure of the controller is shown in Figure 4. The deviation of power angle, virtual rotate speed and electromagnetic torque from their equilibrium point are selected as state variables, which are denoted as ∆δ, ∆ω and ∆T e , respectively. To obtain the power angle dynamics, assuming that the change of voltage is much faster than the change of current, then the rate of change of the power angle is proportional to the deviation of the voltage frequency [24]. It can be obtained from Equation (3) Take the derivative of Equation (7) T e = 3 2ψ f i cos δ + Substitute Equations (7) and (16) into Equation (15) to geṫ Using the same method in [23,25], Equation (17) can be rewritten as According to Equations (13), (14) and (18), the system state space model can be obtained where a 1 = −D/J, a 2 = −1/J, f(∆δ, ∆ω, ∆T e , i,

Controller Design
In view of the above model, the controller is designed by using the backstepping method. The commond filter is introduced to avoid the repeated derivation of the virtual controller, and the projection operator is used to keep the estimated values of parameters a 1 = −D/J and a 2 = −1/J within the preset range to ensure the convergence of the system. Define the error where ∆δ ref is the given reference instruction, ∆ω c and ∆T e c are the output of the command filter.
The structure of command filter is shown in Figure 5. In the design of backstepping controller, there is the problem of calculating expansion, and considering the input saturation in practice, the derivative of its virtual control variables can be obtained by integration using the commond filter [20,26]. The state equation of the command filter is given as where u is the input x d of the command filter, S M (·) and S R (·) are amplitude limiting and rate limiting, ζ i and ω ni are the damping and bandwidth of the command filter. The derivative of the error can be obtained from Equation (24) to Equation (26) Step 1. To stabilize Equation (28), Lyapunov function was selected as Take the derivative of Equation (31) and substitute Equation (28) into iṫ where k 1 is a constant greater than 0. Select the virtual control variable Replace ∆ω with ∆ω d in Equation (32), andV 1 is obtained aṡ In order to compensate the filtering error of the command filter, the error variable is redefined as where ε 1 is the error compensation signal of the command filter, and it is selected aṡ Step 2. To stabilize Equation (29), Lyapunov function was selected as Then we get the derivative of Equation (37) Take the derivative of Equation (35), and using Equations (28), (33) and (36), it can be calculated aṡē ThenV 2 is simplified tȯ where k 2 is a constant greater than 0. Select the virtual control variable Replace ∆T e with ∆T e d in Equation (40), andV 2 is obtained aṡ When external interference occurs, model parameters (including parameters of J and D in the transition process) will fluctuate. In addition, it is assumed that the change of voltage is much faster than the change of current, which may lead to certain errors. Therefore, adaptive estimated valuesâ 1 andâ 2 are used to replace a 1 and a 2 , and Equation (41) can be rewritten as In order to compensate the filtering error of the command filter, the error variable is redefined where ε 2 is the error compensation signal of the command filter, and it is selected aṡ Step 3. To stabilize Equation (30), Lyapunov function was selected as whereã 1 =â 1 − a 1 ,ã 2 =â 2 − a 2 is the parameter estimation error, γ 1 and γ 2 are the adaptive gains. Take the derivative of Equation (44), and using Equations (29), (43) and (45), it can be calculated aṡē ThenV 3 is simplified toV where k 3 is a constant greater than 0. Then the controller is designed as The parameter adaptive law can be chosen aṡâ where Proj(, ) is the projection operator,θ is an estimate of θ,θ =θ − θ is the estimated error. Thus the adaptive law can be designed as˙θ where γ is a constant greater than 0, x is the determined adaptive function, and the discontinuous projection operator is defined as In [27], it indicates that Proj(, ) has the following property for any x: According to the property of the projection operator, the estimated value of the parameter is within the preset range, and can be obtained Substitute Equations (52), (53) and u into Equation (48) to obtaiṅ Assuming that 0 < η < 1, Equation (54) can be rewritten aṡ According to [28], ε 2 is a bounded function of time t. If |ē 1 | × ε 2 − k 1 ηē 2 1 < 0, that is to say |ē 1 | ≥ ε 2 k 1 η , Equation (55) can be rewritten aṡ The above formula indicates thatē 1 ,ē 2 , e 3 ,ã 1 andã 2 are uniformly bounded [29], and the filtering error compensation signals ε 1 and ε 2 are bounded, so the tracking errors e 1 and e 2 are also bounded. Figure 6 shows the block diagram of ACB controller for VSG system.  Figure 6. Block diagram of ACB controller for VSG system.

Simulation Results
This section verifies the effectiveness of the designed controller through simulation analysis. The main parameters of the electrical simulation model built based on Matlab/Simulink are shown in Table 2. According to the Lyapunov stability theory, the appropriate k 1 , k 2 and k 3 can be selected to achieve the rapid stability of the system. For a better control effect, the parameters in this paper are selected as k 1 = 10, k 2 = 20, and k 3 = 20.

VSG's Connection and Disconnection to the Grid
In order to investigate effectiveness of the proposed controller, the system with a load of 13 kW is simulated to observe the performance parameters of VSG's connection and disconnection to the grid. The moment of inertia and damping factor are selected as J = 0.4 kg · m 2 , D = 20.26, respectively. Figure 7 shows the variation of frequency during the transition process and Figure 8 exhibits the variation of active power under ACB control strategy. According to the simulation results, at first, the VSG system operates in islanded mode. In this case, the VSG system provides 13 kW active power to supply essential local loads, and the frequency decreases by about 0.074 Hz. Since there are no fault conditions in the grid, it is necessary to connect the system to the grid at t = 0.3 s. Due to the re-establishment of the power angle relationship, the active power has a certain vibration and the settling time is less than 0.1 s. By using the ACB control method, the maximum oscillation range is 8.75 ∼ 10.13 kW. As Figure 9 shows, the maximum oscillation range for the traditional backstepping method is 8.37 ∼ 10.22 kW. It is evident that after the addition of the command filter and projection adaptive algorithm, the oscillation is reduced. After stabilization, about 3 kW active power is provided by the power grid, and the system frequency tends to be consistent with the power grid. At t = 0.6 s, due to a fault in the grid, the system is disconnected from the grid. No system reconfiguration changes are required during the transition from grid-connected to islanded mode. The VSG system output power increases immediately, and the frequency is reduced. It is obvious that during the transition process, the active power increases with no overshoot, and due to the existence of virtual inertia and damping, the system frequency changes smoothly. As can be seen from Figures 10 and 11, using ACB control strategy, the voltage waveform basically remains unchanged except for the part that decreases due to reactive power, while the current waveform shows slight fluctuations when it is connected to the grid. Figure 12 shows the variation of current under VSG control strategy without nonlinear controller. When connected directly to the grid, the current waveform is seriously unstable, and with the increase of the inconsistency between the output voltage and the grid voltage, the impulse current will be further increased, which must be avoided in normal operation.
The above results mainly verify that the designed controller can achieve smooth switching in the transition process, especially when connected to the power grid, the system can achieve improved stability without the need for pre-synchronous operation.

Load Power Disturbance and Power Distribution
Two systems run in parallel. System 1: P ref_1 = 10 kW, D 1 = 20.26, J 1 = 0.4 kg · m 2 , and the local load is 7 kW; System 2: P ref_2 = 15 kW, D 2 = 30.39, J 2 = 0.6 kg · m 2 , and the local load is 12 kW. At t = 0.4 s , the common load changes from 10 kW to 3 kW. The simulation results are as follows. Figure 13 exhibits the active power distribution of parallel systems. Figure 14 shows frequency variation. As can be observed from the simulation results, before the load is removed, the active power of system 1 is 11.4 kW, and that of system 2 is 17 kW. The total load power is higher than the preset powers and the frequency offset occurs. After load variation, active power stabilizes at 8.8 kW and 13.2 kW, respectively. Since the total load power is lower than the preset powers, both system frequency increase and about 0.4 s later, the whole system becomes stable and the frequency of both subsystems will tend to be the same value (50.03 Hz). It can be noted that the generated active power of each system (11.4:17 kW and 8.8:13.2 kW) is approximate to the damping factor (D 1 :D 2 = 20.26:30.39), and the Figure 14 also shows the overshoot of frequency of system 2 is less then that of system 1. It can be indicated that a larger moment of inertia J can increase the inertia of the system, that is, the system frequency can be changed smoothly by setting J reasonably.

Frequency Improvement during Transition
The influence of moment of inertia and damping factor on frequency in the transition process is considered below. Increasing the moment of inertia J at the initial stage of frequency fluctuation can reduce the frequency offset peak and the initial rate of change. When the frequency tends to be stable from the offset peak in grid-connected mode, increasing the damping factor D can reduce the adjustment time of frequency stability. Figure 15 shows the frequency response under different moment of inertia values. With the increase of J, the frequency change rate decreases, and no overstepping occurs. However, it still takes a long time to reach the rated value. The main reason is that the active power after the grid connection does not reach the rated value, i.e., there is a power shortage. In Figure 16, the moment of inertia remains unchanged and the damping factor increases instead.
Initially, the damping factor is selected as D 0 = 20.26, and changes to D 1 = 30 when the system is connected to the power grid. It can be observed that the frequency reaches the rated value more quickly with the increased damping factor, which proves that the damping factor can be increased appropriately to reduce the frequency adjustment time and quickly stabilize the system.
Since the damping factor will affect the steady-state deviation of the frequency, it will not change in islanded mode. Figure 17 shows frequency response under different moment of inertia when disconnected from the grid, where J 1 = 0.3 kg · m 2 , J 2 = 0.8 kg · m 2 , and J 3 is the adaptive moment of inertia. Accordingly, the steady-state moment of inertia J 0 = 0.2 kg · m 2 , the regulating factor k j = 0.05, and the threshold value C = 0.5 are selected. As can be seen in Figure 18, with the rapid decrease of frequency, the adaptive J 3 becomes larger to suppress the rapid change of frequency and avoid overshoot. When the frequency tends to the stable value, the rate of frequency change decreases, and a smaller J 3 can further reduce the frequency adjustment time.

Conclusions
In this paper, a novel method for VSG is designed with enhanced stability in islanded, grid-connected and transition modes. The linear controller part mimics SG and realizes the smooth change of system frequency with virtual damping and inertia. Suitable parameters can be selected, which cannot be achieved in SG, because the mechanical inertia is a constant related to the physical properties of the rotor. The simulation results show that the selected values improve the frequency response of the transition process by decreasing the frequency response time and reducing the frequency overshoot. Moreover, an adaptive command filter back-stepping controller is proposed and the nonlinear controller adds a supplementary signal to the voltage loop to improve system stability. The use of command filter effectively avoids the high computational complexity required in backstepping control, while a projection adaptive algorithm is used to estimate the modeling error and parameter variation, which helps in achieving rapid convergence of the system. Theoretical analysis has indicated that the proposed controller for VSG can achieve optimal performance in terms of disturbances and uncertainties in the system parameters, and the effectiveness is validated through simulation results.