Prescribed Performance-Based Adaptive Terminal Sliding Mode Control for Virtual Synchronous Generators

Due to the lack of inertia and damping in the distributed power system with power electronic devices as interface, the stability of the power system will be adversely affected when the distributed power system is connected to the grid. In order to solve the problem of low inertia and improve stability, an adaptive terminal sliding mode control method based on the electromagnetic transient characteristics of virtual synchronous generators is proposed. During the design process, projection operators and parameter adaptive law control methods are introduced to compensate for parameter errors caused by environmental inter-ference. Furthermore, by utilizing a prescribed performance function, the terminal sliding surface of the system will have the desired dynamic response, and variations of the system tracking error can be restricted. Simulation results show that the proposed controller has improved control accuracy and response speed, frequency stability, and power response.


Introduction
e development of grid-connected distributed energy systems with grid-connected converters has been expanding due to increasing energy demand and environmental concerns [1]. e stability of grid frequency could seriously threaten due to the unpredictable power supplied by distributed generation (DG) units. However, when DG is combined with supply side energy storage, the power and frequency uctuations of the distributed system can be mitigated [2][3][4]. ese systems still su er from low inertia such that they cannot implicitly provide the necessary inertial support to compensate for microgrids with poor stability problem of the system which has always existed; that is, when quality and reliability of the power supply are disturbed, the grid-connected converter cannot provide the necessary inertial support for the poor stable microgrid [5].
In order to solve the system instability problem described above, the virtual synchronous generators (VSGs) have been proposed [6]. is is achieved by introducing the mechanical and electromagnetic equations of the synchronous generator (SG) and simulating its external characteristics. e virtual inertia and primary frequency can be adjusted to increase the virtual inertial of the inverter and improve the quality of the system output response [7,8]. In general, two di erent control mode structures have been studied that treat the VSG as a voltage-source or currentsource. e current-source-mode converter has been shown to inadequately simulate the rotor motion characteristics of SG, thereby making voltage-source-mode the preferred method [9,10]. In [11], a detailed VSG model is presented and the system stability is determined from an Eigenvalues analysis. e main purpose of this method is to adjust the inverter's power control loop, but in order to respond to changes in grid frequency, power grid frequency detection and control should also be taken into account. In [12,13], a VSG regulation scheme for active and reactive power is proposed, to achieve seamless switching function that can be connected and disconnected from the grid. e system virtual inertia and damping characteristics and its tuning method are analyzed in detail. It should be noted that although the above method guarantees a simple control system architecture, the implementation of grid failure and transient protections systems is complicated [14]. e VSG control strategy is mainly based on the classic second-order SG model. When controlled as a voltagesource, it has similar characteristics to the droop control, load changes result in mismatched the grid angle, and frequency when operating in island mode [10]. erefore, when connected to the grid, a phase-locked-loop (PLL) is required to obtain the frequency and initial angle to prevent deviation. is technique relies upon grid-DG communication that becomes more susceptible to interruptions as the number of DG systems increases [15,16]. Power synchronization technology is proposed in [17] that eliminates the communication dependence of a PLL to keep the output voltage consistent with the grid voltage. However, this system requires a presynchronization process that can prevent plug-and-play converter deployment and is susceptible to instability caused by short-term voltage out-ofsync events. In addition, the method based on frequency derivative can effectively enhance the virtual inertia of the system and improve the response speed of the system [18,19]. In [20], a comprehensive analysis of the effects of virtual inertia is performed to obtain the load disturbance frequency in grid-connected mode quickly and stably. In [21], a VSG control strategy based on RBF neural network is proposed and has good performance in damping of oscillation. In [22], the VSG parameters are adjusted by using quantitative feedback theory (QFT) to ensure the robust stability and performance of the system. To the best of the authors' knowledge, the above research work does not use the VSG adaptive terminal sliding mode control method based on preset performance to solve the transient events of grid-connected and off-grid.
Backstepping control (BSC) can simplify the system structure for nonlinear systems and can recursively prove system stability when combined with the Lyapunov function. With the introduction of adaptive methods and projection operators, uncertain parameters in the system are allowed to be effectively estimated, and the estimated values are then constrained to prevent exceeding predetermined limits [23][24][25]. In addition, sliding mode control (SMC) has been proven to handle complex systems due to its advantages of reliability, anti-interference, and simple design [26]. However, chattering is one of the main factors affecting the accuracy of sliding mode control [27]. Terminal sliding mode control is an effective control method to deal with system uncertainty, especially for nonlinear systems [28]. Compared with traditional sliding mode control, the terminal sliding mode control can make the tracking error reach to zero in finite time and has the advantages of eliminating chattering and robustness against external disturbance and parameter perturbation [29,30]. All these advantages greatly improve the performance of the controller. In [31], a backstepping controller that combines command-filter and integral sliding mode control is used to investigate microgrid dynamics. e prescribed performance control (PPC) method uses a performance function and error transformation to achieve predetermined convergence speed, overshoot, and track error performance [32].
In this paper, a prescribed performance-based adaptive terminal sliding mode backstepping controller for the nonlinear VSG system error model is proposed. e projection operator is used to constrain the system parameter error and limits the sliding surface to predetermined values when combined with the prescribed performance function. e contributions of this paper are as follows: (i) e projection operator adaptive law is used to estimate the virtual inertia parameters and damping parameters of the system, so as to improve the accuracy of the system model (ii) e parameter error of the system is constrained by the projection operator, and the sliding mode surface is limited to the predetermined range combined with the prescribed performance function (iii) e controller is implemented in state space, and the Lyapunov function is used to verify the system stability (iv) e designed controller can operate stably in a wide range of operation scenarios, including island, gridconnected, and transient events e paper is organized as follows. In section 2, the systems mathematical model is established. A state space equation and an adaptive terminal SMC strategy based on prescribed performance are presented in section 3. Simulation results are presented in section 4 and compared with other control methods to demonstrate its improved performance. Conclusions are given in section 5.

Overview of the Model
In Figure 1, the primary model of VSG inverter in MG is introduced in detail, which plays the role of DC-AC conversion and power transmission [7,33]. e resistance R s and inductance L s represent the stator impedance in an ideal synchronous motor as shown in Figure 2. Among them, i � i a i b i c represents the current of the stator winding, and the voltage of the capacitor terminal u � u a u b u c is the terminal voltage of SG. R f and L f represent the impedance of the rotor. e voltage generation principle is similar to the back electromotive force (EMF) in SG: e � ωψ f sin θ.
(1) e mathematical model of the VSG can be formulated as shown in Figure 3, T ref and T e are, respectively, the virtual input mechanical torque and the virtual electromagnetic torque of the rotor, J is the virtual inertia, D p is the virtual mechanical friction coefficient, which is also the drooping coefficient of the frequency droop control loop, and θ and _ θ are the rotor angle and the virtual angular speed. e equation of mechanical dynamic can be expressed as e output power can be obtained by the inner product of the three-phase voltage and current: Formula (3) can be transformed as follows: where δ � (θ − φ) is the power angle. en, the virtual electromagnetic torque can be expressed as follows: Correspondingly, the solution of reactive power is similar to active power, which can be obtained as follows: e virtual excitation module is similar to the excitation control system of SG, and the terminal voltage and reactive power are regulated by controlling the virtual potential of VSG [34,35]. e controlling process is shown in Figure 4. e reference voltage V ref can be obtained from the formula as follows: where V s and V m are the no-load voltage and actual voltage amplitude, Q e is the actual reactive power, Q ref is the reference reactive power, and m is the droop factor. A PI controller is used to track the reference voltage error to generate a control signal ψ f . In order to make the VSG acts as a real SG, a low-pass filter is being used to simulate the flux decay. Equation due to the influence of the rotor wingding inductance [8] is given as follows: where τ a is the flux loop time constant which is used to appropriate voltage transient response.

Prescribed Performance Control (PPC).
e prescribed performance control has the following definition [32,36].
is paper selects the following function as the default performance function: where ρ 0 is the initial value of the performance function, ρ ∞ is the allowable range of the system steady-state error, and h is the convergence rate of the performance function.

Mathematical Problems in Engineering
In this paper, the target of control is the terminal sliding surface s 2 ; apparently, the s 2 boundary is guaranteed to have the following equivalent: for all t ≥ 0, where 0 ≤ δ ≤ 1.

Error Transformation.
In order to make the control object s 2 easy to implement, the inequality constraint shown in (10) can be transformed into the form of the equality constraint, and the following form of error transformation is introduced: where ε(t) is the transformed error and ϑ(ε(t)) is a function possessing the following properties: (1) ϑ(ε(t)) is smooth and strictly increasing. erefore, the conversion error ε(t) can be obtained by inverse transformation of (11): (2) e variables are constrained as follows.

Remark 1.
With the monotonously decreasing property of performance function and error transformation property, the system error will converge to a predetermined range in finite time by selecting appropriate parameters ρ 0 , ρ ∞ , and h. Notice that ρ 0 shall be selected relatively large considering the maximum overshoot of s 2 and ρ ∞ shall be selected relatively small to achieve tracking performance. Besides, considering the transient process of grid-connected and offgrid, h should be taken appropriately to avoid singularity problems.

Voltage Control Scheme.
e overall structure is presented in Figure 5. In order to obtain the dynamics of δ, it is assumed that dynamics of voltage angle are faster than dynamics of current angle [37], which means that the rate of δ change of is proportional to voltage frequency deviation from its rated value.
en, comparing the load angle δ, frequency ω, and electromagnetic torque T e with their equilibrium points, the state variables load angle error, frequency error, and electromagnetic torque error are obtained, as shown in Figure 5.

Adaptive Terminal Sliding Mode Control Strategy with PPC.
e state space model has been described in the above section and in this section. e detailed controller design procedure proposed for VSG is described as follows. Defining the tracking error variables e 1 , e 2 , and e 3 , where Defining the terminal sliding mode surface, where z 1 > 0 and z 2 > 0 represent the designed constants of sliding mode surface and p 1 , p 2 , q 1 , and q 2 are the positive odd numbers, where 1 < (p 1 /q 1 ) < 2 and 1 < (p 2 /q 2 ) < 2. e derivative of (24) can be calculated as follows: Using the backstepping method to stabilize the load angle δ, the Lyapunov function is selected as follows: e derivation of (26) is According to the requirements of the Lyapunov stability condition, the equation _ V 1 < 0 needs to be satisfied; therefore, the optimal choice of the virtual controller Δw ref is as follows:

Mathematical Problems in Engineering
where k 1 > 0, en, the Lyapunov function V 2 is selected to stabilize the frequency error Δw as follows: e derivation of (30) is as follows: Similarity, in order to meet the equation _ V 2 < 0, the constraint conditions of controller _ s 1 can be designed as follows: where λ 1 > 0 and sgn(·) means Substituting (32) into (31), obtain _ V 2 as follows: erefore, the virtual controller ΔT s ref is as follows: Considering the parameter error at the same time, the form of the virtual error variable is obtained as follows: where σ 1 and σ 2 are the parameter estimation values. en, using the above mentioned prescribed performance control method, the terminal sliding mode surface s 2 can be converted to ε through error conversion. erefore, the new Lyapunov equation can be expressed as follows: where r 1 and r 2 are the gains of adaptive law, σ 1 � σ 1 − σ 1 , σ 2 � σ 2 − σ 2 , and the derivation of (37) is as follows: where k 2 > 0, and the controller u can be designed as follows: e projection operator adaptive law can be designed as follows: where function Proj(·, ·) is the projection operator adaptive law [38] valid for a robust adaptive controller which needs multiple differentiation, designed as follows: and Proj(·, ·) has the conclusion as follows: Taking (39) and (40) into (38), the Lyapunov funtion can be expressed as follows: erefore, according to the above derivation process, equation _ V 3 ≤ 0 can prove that the designed controller meets the Lyapunov stability condition.

Simulation Results and Analysis
In this section, a simulation model demonstrates the control performance of the proposed controller for the VSG system. Figure 5 summarizes the detailed control method of this article, and the configuration of the VSG system and adjustable parameters system is shown in Table 1.
e simulation results verify the control performance of the proposed controller under grid-connected and off-grid conditions, and the rated load is set at 10kW. e simulation results are shown as follows. Figure 6 shows variation of active power when the system is connected to the grid at 0.4s and then disconnected again to the island state at 1.8s. e simulation results show that the controller designed in this paper can make the active power output smoother in the switching process of grid-connected and island, the oscillation range is smaller than the command-filtered backstepping controller (CBC) and terminal sliding mode controller (SMC) without adaptive law, and the control performance is better. Figure 7 and Figure 8 also show the frequency, voltage, and current changes of the system in the transient process. It is seen that the frequency changes tend to the rating. e waveforms of voltage and current have no obvious change when the system is connected to the grid and disconnected to the island state. Figure 9 shows the comparison of tracking errors e 1 , e 2 , and e 3 under the three control methods. It can be seen that the tracking errors e 1 and e 2 of the virtual control quantity Δδ and the virtual control quantity Δw are significantly smaller than the strategy of CBC, indicating that the proposed control strategy can better achieve error control and ensure the stability of the system. In addition, the tracking error error e 2 of the adaptive terminal sliding mode control       Mathematical Problems in Engineering with prescribed performance is smoother and more stable in the transient adjustment process. Similarly, e 3 can more accurately follow the system's adjustments to achieve state stability. From Figure 10, the terminal sliding mode surface s 1 and the terminal sliding mode surface s 2 with the prescribed performance are shown, and we can observe that s 1 and s 2 satisfy robust convergence. In addition, s 2 also meets requirements for performance functions and is limited to a predetermined range. As can be seen from Figure 11, compared with the method proposed in [39], the control method adopted in this paper can make the output active power and frequency smoother in the process of gridconnected and off-grid and can reach the rated value more quickly after grid-connected and off-grid with less fluctuation.

Conclusion
An adaptive terminal sliding mode control strategy based on a prescribed performance function is proposed that improves VSG inverter stability in isolated islands, grid-connected, and transient operations. Compared with the traditional voltage-source inverter, the improved stability is realized by simulating a SG to introduce virtual damping and inertia. A projection operator and the parameter adaptive law are used to effectively estimate and limit the parameter values. e introduction of terminal sliding mode control method improves the system robustness of the system under transient situations and effectively limits the fluctuation range of the sliding mode surface through the prescribed performance. Simulation results show that the system can be better achieved including the fast response times and improved robustness and the adaptive estimation of uncertain parameter based on the linear virtual damping and inertia control and the nonlinear backstepping sliding mode control strategy under different conditions.
In the future work, we will study the cooperative control of multiple VSGs and introduce multiagent information exchange network on this basis.

Data Availability
Access to data is restricted. The Method in [39] (a) Mathematical Problems in Engineering 9