Active Damping Adaptive Controller for Grid-Connected Inverter Under Weak Grid

The stability of grid-connected inverters is very sensitive to varying grid impedance, especially in the weak grid condition. In this paper, based on the Lyapunov method and with the micro-grid impedance identification, an active damping adaptive control strategy is proposed to guarantee local asymptotic stability for an LCL inverter system. First, using the backstepping design and taking the state variable errors as new variables, an appropriate Lyapunov function is constructed, so that the asymptotic stability control law can be obtained. Then, with this asymptotic stability controller, taking the varying impedance into account, an adaptive controller is developed using the Lyapunov direct method. Hence, the controller presented here can assure asymptotic stability, the system performance can also be improved instantly according to the adaptive control, and the expected stability and performance can also be achieved. Finally, the feasibility of the proposed control strategy was verified via a simulation and an experiment.


I. INTRODUCTION
A grid-connected inverter (GCI) with an LCL filter is widely used in the renewable energy generation (REG) systems [1], [2]. In many practical applications, the microgrid shows a weak grid characteristic, and thus the GCI may be unstable because of the wide variation of the grid impedance [3], [4]. Recently, increasing numbers of solutions have been presented by researchers around the world; among them, an adaptive controller is one of the choices for improving system stability and performance. For a GCI system under a weak grid, to ensure robustness against impedance variation, many control methods [5]- [19] have been proposed to achieve large stability regions, such as feedforward of the grid voltage at the point of common coupling (PCC) [8], [9], a phase-locked loop(PLL) [10]- [12], damping of LCL resonance [13]- [15], and a current controller [16], [17] among others [18]- [21]. A virtualinductance adaptive control scheme based on a direct model reference is presented in [22], in which the virtual inductance is updated in real-time according to an adaptation control law, so that the dynamic response of the reference model The associate editor coordinating the review of this manuscript and approving it for publication was Dipankar Deb .
can be ensured. The advantage of this scheme is that it does not require information regarding the grid impedance Z g ; however, constructing a suitable reference model is still a challenge, and unsuitable model selection will lead to poor dynamic performance. To improve the robustness against grid impedance variation, a robust design for an LCL filter and controller were presented in [23], combined with a grid voltage feedforward regulator, where the system stability was improved by a robust designed filter capacitance; however, since the robust control system does not operate around the optimal point, the steady accuracy may not be guaranteed. To widen the stability region of a GCI under a wide-range grid impedance, an auto-tuning high-performance multi-loop control scheme was employed in [24], but for sinusoidal inputs, the zero steady-state error could not be easily obtained because of the PI controller used in the outer loop. A digital deadbeat auto-tuning current controller is employed in [25] to achieve good performance, but the deadbeat controllers require accurate system information, which is difficult to obtain in practice. At the same time, this method is only used for a single phase GCI with an LC output filter, and once the LCL filter is selected, the implemented controller will be more complex. To enlarge the stability regions for varying grid impedance, an adaptive impedance compensator is proposed in [26], in which the compensator parameters were computed instantly using online grid impedance measurement; however, this method requires the inverter output impedance, and in practical systems, the impedance is not only related to the current controller, but is also affected by the PLL. A novel impedance-phased compensation control strategy is depicted in [27], where the effect of the PLL loop and the digital control delays have been taken into account. The robustness against grid impedance is improved by increasing the phase margin of the GCI. However, the additional passive damping will inevitably increase the power loss of the system. In summary, the methods mentioned above can provide solutions to prevent performance deterioration of the current controller with varying grid impedance, but the resonant damping of the LCL is not taken into account, and thus the further investigations are needed.
Generally speaking, the resonance phenomenon caused by an LCL filter will lead to system instability [28], [25], and thus damping strategies must be used to avoid instability [26], [27], [29]. However, in the case of a weak grid, the changing grid impedance will affect the LCL resonance frequency (f res ), and thus the resonance damping could be ineffective with changing resonance frequency f res [12]. A previous report [28] shows that when the resonance frequency f res is at or below a critical frequency (f crit ), the resonant pole pairs will be far away from the unit circle, so without damping, the system will be unstable no matter what controllers are employed. Therefore, with varying grid impedance, the damping control may fail, and the system may be unstable. Therefore, an adequate damping scheme is needed in the current controller, so that it can pullback the pole pairs to the stable domain again.
Based on previous studies, a solution for the instability problem caused by changing grid impedance is presented in this paper, where additional active damping is not needed, which can greatly simplify the controller design. At the same time, the possibility of coupling between active damping and the current controller is avoided. In this paper, an adaptive controller based on a Lyapunov function and impedance identification is presented to guarantee local stability. By constructing a proper Lyapunov function using the state variable errors as new variables, the asymptotic stability control law for a GCI is obtained. Moreover, the grid impedance is identified online, after which the adaptive controller is obtained by constructing a suitable Lyapunov function, so the controller behavior can be optimized instantly according to the grid impedance; also, auxiliary adaptive active damping is designed for LCL resonance. Therefore, the main accomplishments of this study are summarized as follows: 1) First, a backstepping design was used to decompose the LCL third-order plant into three first-order subsystems, which can greatly simplify the controller design. 2) Second, as the impedance parameters can be identified online, a local asymptotic stability adaptive controller is developed carefully through a combination of backstepping design and the Lyapunov direct method, so that asymptotic tracking of the reference signal can be obtained and the plant state can tend to a desired value. 3) Finally, an active damping strategy is also obtained for suppressing the LCL resonance under time-varying impedance conditions.
The remainder of this paper is organized as follows: first, the model of a single-phase GCI with an LCL filter is presented in Section II. Second, the backstepping design is discussed in Section III. In Section IV, the adaptive controller is presented to improve the performance with varying grid impedance. Simulation and experimental results are given to verify the proposed method in Section V. Finally, this paper concludes in Section VI. Fig.1 shows a simplified block diagram of a single-phase grid-connected full bridge inverter. In the system, u dc is the DC voltage of the inverter and C dc represents the DC-link capacitor. S 1 -S 4 are four power switches with an antiparallel diode, and u in is the output voltage of the inverter. Inverterside current is denoted i 1 . L 1 is the filter inductance on the inverter side. C and L 2 represent the grid-side capacitor and inductor respectively, composing a third-order filter. In addition, u pcc denotes the voltage of the PCC; u g and Z g are the ideal grid voltage and its equivalent grid impendence, respectively; i g represents the grid-side current; and u c is the capacitor voltage. In this paper, Z g is assumed to be pure inductance, which can be added to L 2 to construct a total inductor L g , i.e., L g = L 2 + Z g . The DC-link voltage is fed by a rectifier, and thus the DC voltage can be assumed to be constant. All power switches work in the ideal state, and pulse-width modulation (PWM) technology is employed to generate the desired sine waves. Neglecting the equivalent series resistances of passive components, the mathematical model of a single-phase GCI with an LCL filter can be deduced by applying the Kirchhoff voltage and current laws. In the equations below, x 1 , x 2 and x 3 , represent i 1 , i g , and u c , respectively, and y denotes the system VOLUME 9, 2021 output. Then, the state space equation of the inverter can be written as follows:

II. MODELING OF GRID-CONNECTED INVERTER WITH LCL FILTER
Here, the scalar quantity µ denotes the signal of a modulated pulse width, acting as the external control input to the system. The following design analysis is based on this model.

III. CONTROLLER DESIGN BASED ON BACKSTEPPING
In this section, the nonlinear controller is designed based on the backstepping method. the application of the backstepping method is straightforward due to the simplicity of scalar designs. For higher-dimensional systems, we can retain this simplicity via recursive application of backstepping through decompose system into lower-order components, which might be easier to analyze and design. First, using backstepping design, the high-order system is decomposed into low-order subsystems. Then, virtual variables of each subsystem can be obtained by constructing an appropriate Lyapunov function. Finally, the control law is completed by integrating them back into the entire system.
In this study, a recursive subsystem design method for a third-order LCL-type inverter is performed. This system can be regarded as a cascade system consisting of three subsystems; the first is (1.2), with x 3 as the input; the second is (1.3), with x 1 as the input; and the third is (1.1), with µ as the input. As shown in Fig.2, the subsystems are denoted as A, B, and C, respectively. The virtual control law for each corresponding subsystem will be selected using the Lyapunov stability theorem [30]. Therefore, the backstepping control method can guarantee the internal dynamic stability because of the strict Lyapunov function in each step. We start with system A and view x 3 as the control input. Supposing the grid impedance to be zero, the goal is to adjust the output y to track its desired operating point y s = x 2d .
Introducing the first tracking error variable We take the time derivative of both sides of (2); combining (1) and (2), we obtain x 3 acts as the virtual control error of this subsystem. To improve the system's robustness against modeling uncertainties and external disturbance [31], the integral term of z 1 is introduced before selecting the first candidate Lyapunov function.
Now, we take the first candidate Lyapunov function as Here, λ represents the integral adjustment parameter. The time derivative of V 1 is computed as To satisfy the strict negative property of (6), we select where k 1 > 0. Combining (6) and (7), the virtual control law is calculated as follows α 1 is just the stable variable of x 3 , not the actual control law. Therefore, let α 1 to be the desired value of x 3 . This can be prescribed as Here x 3d represents the expected value of x 3 . Let z 2 be the error between x 3 and its desired value x 3d .
Substituting (10) into (3), the equation can expressed as The time derivative of z 2 can be written as follows: In the new coordinates (z 1 , z 2 ), the subsystem is expressed as Then, x 1 is the virtual control law of subsystem (13), and the asymptotic stability of (13) is guaranteed by designing an appropriate virtual control law. Constructing candidate Lyapunov function V 2 with a quadratic term in the error variable z 2 , The time derivative of V 2 is computed as To satisfy the strict negative property of the time derivative of the candidate function V 2 , we select where k 2 > 0. Then, the expression of virtual control law α 2 can be achieved by comparing equations (16) and (15), the stabilizing function of x 1 However, the real control variable is not x 1 , and α 2 is just a desired value for x 1 , which can be described as Here x 1d is the desired value of x 1 . Let z 3 be the error of x 1 from its desired value x 1d .
Then (12) can be expressed as Taking the time derivative of both sides of equation (19), the time derivative of z 3 can be written as Here a 0 = u dc L 1 . By recursive application of backstepping, the system can be represented as (22) in the new coordinates (z 1 , z 2 , z 3 ).
Then, the open-loop system in (z 1 , z 2 , z 3, z 0 ) can be written as where The actual control law is presented in the system (22), so the uniformly asymptotic stability of (22) must be guaranteed. By adding a new variable z 3 quadratic term into (14), a new candidate Lyapunov function V 3 can be achieved as follows The time derivative of V 3 is computed as Here, µ must be designed to make (24) strictly negative. The control law is where k 3 > 0, which yields First, according to the Lyapunov stability theory, error system (22) is of uniformly asymptotic stability, which implies the uniform boundedness of tracking errors z 1 , z 2 , and z 3 . Then, because the desired grid current reference signal (x 2d ) is bounded, the uniform boundedness of x 2 can be achieved. Similarly, the boundedness of virtual control signals in (8) and (17) can also be concluded from the boundedness of signals z 1 , z 2 , and u g , as well as their time derivatives Based on the above analysis, the boundedness of µ can be ensured; thus, the time derivative of the error signals in (22) and the candidate Lyapunov function (24) are also bound. Moreover, according to equation (26), the dissipation of the system can be guaranteed, which indicates that z 1 , z 2 , z 3 ∈ L 2 . Combining z 1 , z 2 , z 3 ∈ L ∞ , z 1 , z 2 , z 3 ∈ L 2 with • z 3 ∈ L ∞ , the following conclusions are obvious: z 1 , z 2 , and z 3 asymptotically converge to 0.  In short, the state variables x 1 , x 2 , and x 3 converge to their respective reference values α 2 , x 2d , and α 1 asymptotically. In this paper, the reference current signal and grid voltage are treated as ideal sinusoid signals; thus, the control law (26) can be described as (28). The results show that the proposed control scheme requires not only an additional PCC voltage feedforward, but also LCL resonance damping, which have already been integrated into the controller.
However, the above controllers are carried out under the assumption that Z g is zero. Actually, in the case of a weak grid, Z g varies when it is integrated into L 2 , the LCL resonance frequency f res will change. As shown in Fig.3, as Z g increases the resonant frequency f rg gradually decreases. However, in (28), the active damping term does not change, so the resonance damping could be ineffective and the system may be unstable. Therefore, it is necessary to adjust the control parameter adaptively to stabilize the system [32].

IV. ADPTIVE CONTROLLER DESIGN AND PARAMETER SELECTION A. ADAPTIVE CONTROL BASED ON THE IDENTIFICATION OF GRID IMPEDANCE
To solve the problem in Section III, an adaptive controller based on grid impedance identification is designed in this section.
The control law (28) is given to maintain the system stability. However, when Z g varies widely, the system will deteriorate, even reaching instability. Therefore, an adaptive backstepping controller is proposed to address those issues.
First, the identified Z g is treated as a new variable. The uncertainly of Z g leads to the uncertainty of total inductance on the grid side. Therefore, we set L g as θ before designing an adaptive controller. Then, system (22) in the new coordinates (z 1 , z 2 , z 3 ) can be obtained as follows The estimated value ∧ θ can be used to replace θ because of the parameter uncertainty, so that control law (28) can be described as Moreover, (21) can be rewritten as θ is the parameter estimation error. Finally, the closed-loop system with parameters estimated under the new coordinates (z 1 , z 2 , z 3 ) can be expressed as Now the last augmented Lyapunov function is chosen as Here, γ > 0 is the adaptation gain. The time derivative of V 4 can be written as In (34), all terms containing ∼ θ have been merged together. To eliminate them, the updated law would be Then, substituting the analytical expression of update (34) into (33), we obtain The closed-loop error system becomes (37). The control block diagram is shown in Fig.4.
The state space expression of the closed-loop system is Here The nonlinear control law shown in (30) is quite complex, which causes difficulty for the selection of controller parameters. Substituting (17) into (30), (30) can be rewritten as (39). where In order to achieve the control parameters to optimize the system performance, optimization design of controller parameters based on the ITAE (Integrated Time and Absolute Error) index is selected. Firstly, two corollaries are introduced [33]: VOLUME 9, 2021 FIGURE 5.
Step response with adaptive control when Z g varies: (a) system step response, (b) unit step disturbance response.
Corollary 1: if the closed-loop transfer function for a stable system has the following general form Here a 0 = b 0 , then the optimal coefficient of φ(s) can be determined, and the ITAE performance index of the system to step response is minimal. i.e. ITAE = t f 0 t|e(t)|dt is minimal. The steady-state error of system to step response is 0.
Corollary 2: For the step response of a fourth-order system, the characteristic polynomial optimal system based on the ITAE index is presented as: where, ω n is the natural frequency of the system. According to the closed-loop system (38), the characteristic equation can be calculated as follow:  Let represents the error between the actual system output and the steady-state output, and choose = 0.05, so that the system adjustment time t s is Here ξ is damping rate. Let ξ = 0.707, then t s = 3.5 ξ ω n = 0.06s, so ω n = 82 (45) Substitute (45) into (42), and the nominal values of the main circuit are shown in Table 1. The optimal control parameters base on the ITAE performance index can be obtained as (k 1 , k 2 , k 3 , λ) = (4.5 × 10 2 , 2.99 × 10 5 , 2.12 × 10 5 , × 2.13 × 10 5 ) (46) According to the closed-loop transfer function (47), to further improve the system performance, the pre-integrator (dCL 2 /s) is connected to the input to make the closed-loop transfer function in the form of (40), so as to have the expected optimal ITAE index.
The closed-loop transfer function after introducing the preintegrator can be expression as MATLAB/Simulink is used to analyse the step response of the system. The step response of the closed-loop system under the unit step input and unit step disturbance are shown in Fig,5. As can be seen from the block line in Fig5, when the optimal control parameters (46) are used to control the system, the overshoot for step response is only 12%, the adjustment time is 0.06s, the steady-state error is 0%, and the maximum output under unit step disturbance is only 0.006. However, the above analysis is based on the grid impedance is zero, in fact, the grid impedance is timevarying, which can affect system performance. So, in this paper, grid impedance identification is carried out by using a non-characteristic frequency injection method [34], [35]. The 75Hz harmonic component is injected into the reference signal of grid-connected current, then the amplitude and phase of the 75Hz harmonic component in the grid-connected current and PCC voltage are extracted by using the discrete Fourier transform. The grid impedance can be calculated by (49) where f i = 75Hz, u pcc_75 and i 2_75 are the harmonic components of PCC voltage and grid-connected current at 75Hz, respectively. The identification results are used for adaptive control. The step response under the adaptive control is shown as blue and red lines in Fig5. It can be found that the adaptive controller proposed in this paper can guarantee better performance.

V. SIMULATION AND EXPERENMENT RESULTS
A single-phase GCI with an LCL output filter was constructed for simulation and experimental verification in this section. Simulations were carried out by MATLAB/Simulink. The proposed control strategy was implemented using  Table 1 were used. Moreover, the only difference between the simulation and experiment is that ideal switches and an ideal power source were used in simulations, which is not the case in practice.

A. PERFORMANCE ANALYSIS THROUGH SIMULATION
In this section, the initial control parameters chosen were set as (46). The first simulation was carried out using the controller based on backstepping method proposed in Section III, where the Z g values were set at 0mH, 1mH and 2mH. The simulation waveforms are shown in Fig. 6. In the case of a stiff grid, a better dynamic and steady-state performance can be obtained, as shown in Fig. 6(a), and u pcc is not affected during dynamic switching. With increasing Z g , the control performance deteriorated, as shown in Fig. 6(b) and Fig. 6(c). When Z g is 1mH, both i g and u pcc have large ripples, and the high amount of ripple across the inverter-side inductor will contribute greatly to the system power losses. At the moment of dynamic switching, u pcc is affected by i g . As shown  in Fig. 6(c), the steady-state i g and u pcc waveforms were degraded as Z g increased. Therefore, when Z g varies over a wide range, it is necessary to design an adaptive controller for the GCI to improve the system performance. Fig. 7 shows the waveforms of i g and u pcc with an adaptive controller. When Z g is zero, i g tracks its reference well and is in phase with u pcc . In the process of dynamic switching, i g is stable after a slight oscillation, while u pcc is not affected. With Z g increasing, the dynamic and steady-state performances are better than those without the adaptive controller, as shown in Fig. 7(b) and Fig. 7(c). The i g tends to become stable after a small oscillation at the moment of switching, and u pcc is only slightly affected.
In Fig.8, the THD results of the full-load i g waveform in Fig. 6 and the THD results of the full-load i g in Fig. 7 are presented, which indicate that the THDs with adaptive control are 1.98%, 2.26%, and 2.85%, respectively, showing that the THDs with the adaptive controller are far lower than those without adaptive control. In addition, when Z g varies, the THDs with non-adaptive control greatly exceed the gridconnected standard.
Based on the above analysis, the following conclusions are clear: under weak grid conditions, the system stability can be guaranteed by the proposed adaptive controller, and good dynamic and steady-state performance can also be obtained.

B. EXPERIMENTAL RESULTS
The experiment was carried out for Z g values of 0mH, 1mH and 2mH, respectively. Systems with an backstepping controller and an adaptive controller were built at the same time. The corresponding experimental waveforms are shown in Fig. 9 and Fig. 10, respectively.
The result in Fig. 9(a) shows that the system can operate safely and stably in a stiff grid condition. Once it works under a weak grid, the current and voltage all have a high amount of ripples, as shown in Fig. 9 (b) and Fig. 9(c). The grid impedance has a serious impact on the grid current and thus affects the stability and performance of the system, which is consistent with the simulation results in Fig. 6. Fig. 10 shows the experimental waveforms with the adaptive controller proposed in this paper. This control scheme can guarantee system stability, even when Z g is increased up to 2mH. Moreover, the i g can be kept in desirable steady-state performance, and Z g has almost no influence on it.
To verify the dynamic response of the proposed controller, this paper compares it with an adaptive control based on the PI(proportional-integrator) method, a classical control method. The results based on backstepping and PI are shown in Fig.11 and Fig 12, respectively. Fig. 11(a) and Fig. 12(a) show that as load switches from 20 A to 10 A, the output current changes smoothly to track the reference, and the transition time is only 2 ms. At the zero-crossing point, the current waveform is slightly distorted, which is mostly a result of the dead zone time. The current waveform as the load switches from 10 A to 20 A is shown in Fig. 11(b) and Fig. 12(b). At that moment, the peak current value reaches 26 A, exceeding the rating by 30%, but it recovered immediately after 2 ms. At the same time, the u pcc is only slightly affected. The results of the corresponding harmonic analysis of i g under full load is shown in Fig. 11(c) and Fig. 12(c), where their THDs are only 2.9% and 2.8%, respectively, meeting the grid-connected requirements. These results show that both of the two control methods can achieve a good control effect when the grid impedance is known.
However, once there is a deviation in the estimation of grid impedance, the effect of adaptive control based on PI is significantly worse than that based on backstepping method, as shown in Fig.13 and Fig.14. The steady-state waveform with Lg =2.4 mH and 1.6 mH, deviations of 20% from the actual value of 2 mH, are given in Figs.13(a,b) and Fig14(a,b), respectively. Their corresponding THDs are shown in Figs.13(c,d) and Fig14(c,d), respectively. Obviously, the ripple of PI-based adaptive controller is larger than that based on the backstepping method, the corresponding THDs are 4.7% and 4.6%, respectively. While the THDs of the adaptive control based on backstepping method are only 3.5% and 3.4%, respectively. These results show that the adaptive control algorithm proposed in this paper has a greater tolerance for the deviation of grid impedance estimation.

VI. CONCLUSION
In this paper, an adaptive control strategy based on the Lyapunov direct method and impedance identification was proposed. Detailed procedures for adaptive backstepping design were given, and a 2.2-kW laboratory prototype was also constructed. The major conclusions can be summarized as follows: 1) Backstepping design is an effective approach to simplify controller development resulting from plant decomposition, i.e., the LCL filter can be considered as three first-order plants, which makes the controller design very simple. 2) The developed adaptive controller can track the reference signal asymptotically, and the plant state can tend to a desired value. The system's local stability, can be obtained using the proper Lyapunov candidate function. 3) An adaptive active damping strategy is also given for damping of the LCL resonance with grid impedance variation. Simulation and experimental results were consistent with the analysis, verifying the effectiveness of the proposed methods. However, for this system, the selection of a more appropriate Lyapunov function remains to be investigated.