A Sliding Mode Control Strategy with Repetitive Sliding Surface for Shunt Active Power Filter with an LCLCL Filter

: This paper proposes a novel sliding mode control (SMC) scheme with a repetitive sliding surface for shunt active power filters (SAPF) to enhance the system robustness and eliminate harmonic current tracking errors. Traditional control schemes, such as PI control, repetitive control (RC), proportional resonance control (PR), improve the stability of the SAPF in the stable grid to a certain extent. However, the robustness of the SAPF control system has not been improved. In this paper, the SMC is applied to SAPF, and a sliding mode controller is constructed by using a linear sliding mode surface composed of the system state variables and a fast exponential power-reaching law, which can effectively enhance the system robustness. When the grid parameters change or external disturbances exist, sliding surface drift and sliding mode chattering will occur. Although fast-tracking of the harmonic current can still be achieved, it is difficult to accurately compensate AC harmonic current. Moreover, this may cause the harmonic current compensation error to be amplified. RC can achieve infinite gain at multiples of the fundamental frequency and can track inputs without static errors. In order to fully eliminate the harmonic current tracking error and effectively suppress the total harmonic distortion (THD) of the grid, the sliding mode surface was modified. An RC term of harmonic current error is introduced to the sliding mode surface, and a novel plugin-repetitive sliding mode control strategy (RCSMC) for SAPF is proposed. Finally, simulation and experiment results on the LCLCL-filter based SAPF show the effectiveness of the proposed control strategy.


Introduction
Traditional control schemes applied to shunt active power filters (SAPF), such as PI control, repetitive control (RC), proportional resonance control (PR), and their hybrid control, can compensate the current harmonics accurately in the stable power grid [1][2][3]. This meets the expected requirements of industrial occasions. However, when the power grid parameters fluctuate, the transfer function of the SAPF control system is changed, which will cause system instability and affect system robustness. The sliding mode control (SMC) strategy has been applied in SAPF due to its good dynamic response, strong robustness, and good regulation performance in a wide operating condition. Various SMC methods for SAPF have been proposed [4,5]. Their robustness is always enhanced, and the steadystate accuracy is also highlighted.
In practical applications, the SMC method is implemented by a digital system. It needs to detect intermediate variables using multiple sensors, construct a state equation, and then establish the sliding mode surface. To meet the desired control objectives, it also relies on high switching frequency to achieve the sliding mode surface reach and follow. The ideal SMC method requires infinite switching of the power switches, so that the system state should always meet the sliding mode, ensuring the sliding mode motion, realizing accurate tracking, zero error adjustment and fast dynamic response [6,7]. However, during the SMC implementation, chattering caused by non-ideal infinite switch switching, discrete system delay, unmodeled dynamic effects and parameter uncertainty will restrict the steady-state compensation accuracy of the control system [8]. In the current research, the steady-state performance of SMC is improved by reaching law design and sliding surface modification. In general, the common linear sliding surface is composed of a linear combination of system state variables. When the system parameters are changed or external interference exists, the sliding surface would drift, which will affect the system output tracking error. Integral sliding mode control (ISMC), and intelligent SMC incorporating fuzzy logic and artificial neural networks have become a research focus, to improve SMC performance [8][9][10][11]. In [12], the integral term of the state variables is introduced into the sliding mode-switching function in the SMC to eliminate the steady-state error. In [13,14], an ISMC method is proposed for DC-DC converters and DC-AC inverters, which uses sequential integration to smooth chatter and improve system steadystate accuracy. Based on ISMC, a new dual-integral sliding mode controller (DISMC) is present for the maximum power point tracker (MPPT) in DC tracking systems [15]. The double integration term of tracking voltage error was used in its sliding surface to eliminate steady-state errors. Z. Liu [16] proposed a new sliding mode surface based on the learning rate, which maintains the advantages of high sliding speed of the traditional SMC strategy. The convergence speed will become slower when the error variable approaches the sliding mode surface, so the chattering problem that is caused by the high convergence speed can be suppressed and the system tracking accuracy can be improved. However, for AC tracking systems, these methods can reduce steady-state errors, but they cannot fully reduce the sinusoidal tracking errors of the inverter [13]. For SAPF, the above methods have a limited tracking ability for harmonics, and ISMC is prone to problems such as large overshoot and long adjustment time, which deteriorate transient performance. To address these deficiencies, [17] introduced a multi-resonance term of grid-connected current error on the sliding mode surface, and a multiresonance sliding mode controller (MRSMC) is proposed, which eliminated the gridconnected current tracking error by using the high-loop gain characteristics of resonance control to the periodic signal. The derivation and demonstration are only for a single-phase grid-connected inverter, and the influence of grid fluctuations on resonance control is not fully considered.
In this paper, a sliding mode controller composed of a linear sliding mode surface of state variables and a fast exponential power reaching law is designed to enhance the robustness of the SAPF. Furtherly, aiming at the steady-state error problem caused by chattering and parameter uncertainty, the sliding mode surface was modified. Considering the advantages of RC with gain amplification for harmonics and non-static error tracking for periodic signals, an RC term of harmonic current error is introduced to the sliding mode surface, and a novel plugin-repetitive sliding mode control strategy (RCSMC) for SAPF is proposed. Finally, simulation and experiment results on the LCLCL-based SAPF show the effectiveness of the proposed control strategy.
The rest of this paper is organized as follows: in Section 2, the SMC for SAPF with an LCLCL filter is designed. In Section 3, the RCSMC is proposed. An RC term of harmonic current error is introduced to the sliding mode surface to suppress the tracking error and THD. Section 4 and Section 5 present the simulation and experimental results, respectively. Finally, conclusions are stated in Section 6. Figure 1 shows the control system of the SAPF with an LCLCL filter. The main topology consists of a voltage source inverter and an LCLCL filter. The inverter is a harmonic generator. The DC side capacitors Cd1 and Cd2 are used to keep the DC voltage udc constant. The LCLCL filter is used to filter out the SAPF output current ripple. Where, Ls is the grid equivalent inductor, L1 is grid side inductor, L2 is inverter side inductor, Cf is filter capacitor, and Rd is parasitic damping resistor of Cf. The system introduces a resonant branch consisting of Lh and Ch, which is tuned at the switching frequency of the inverter. As a bandpass filter for switching ripple, it also reduces the power loss of the damping resistor. The non-linear load is a three-phase diode rectifier with a resistive load. In Figure 1, udc is the dc bus voltage; us is the grid voltage; ui is the inverter output voltage; uc is the capacitor branch voltage, and is, iL, ish, ic, iinv is grid current, current drawn by the non-linear load, SAPF grid-connected current, capacitor current, and inverter output current, respectively. The main circuit parameters are shown in Table 1.  The harmonic current control scheme is given in the control circuit part of Figure 1. It can be seen that the harmonic command current is calculated by detecting the load current and using the dq method based on the instantaneous reactive power theory. The composite current controller is used to control the inverter to provide a compensated harmonic current for the non-linear load. As a result, the grid current becomes an ideal sine wave. The inverter DC-side bus voltage is modulated by the traditional PI control strategy, which provides active power during harmonic compensation.

Sliding Mode Controller Design
The voltage and current vectors in Figure 1 are defined as follows The secondary parasitic series resistor associated with the inductor in the main circuit can be ignored in modeling, control design and simulation [18,19]. Because the additional LhCh resonant branch has an operating bandwidth that exceeds the Nyquist frequency, the controller design is not affected even if LhCh is ignored. Therefore, SAPF control model can be denoted as The inverter output voltage vector i u  in (1) can be expressed as follows, according to its relationship to the DC-side voltage udc: To further simplify the analysis, when the frequency is high enough, the high-frequency component of the PWM wave is ignored, and the PWM duty cycle dk (the average value of sk in one switching cycle) is used to replace sk [20]. Then, (2) can be written as Therefore, the continuous-time dynamic model can be expressed as For a three-phase symmetrical system, the three phases can be controlled independently. The analysis is based on the A-phase. The dynamic model of the A-phase can be written as where each symbol is a physical quantity of the A-phase. da is the duty cycle of A-phase, which is the control input of the A-phase. The sliding mode controller is designed based on the A-phase system model. The other two phases are similar to the A-phase, and the derivation results are consistent.
Define state variables x1a，x2a and x3a as i is the A-phase reference for inverter output current, the reference for filter capacitor voltage, and the reference for the SAPF grid-connected current (that is, harmonic command current), respectively. Those satisfy (5), and * inva i and * ca u can be written as x1a, x2a and x3a are the three error variables concerned. If the three error variables tend to 0 through the control input da, SAPF can achieve perfect harmonic compensation. Construct a state space equation as follows From (5) to (8), the following can be derived (assuming the grid voltage is constant): Then, the coefficients and state inputs of the system state space equation can be described as (13) Select linear sliding mode switching function σa can be described as where α1, α2 and α3 are positive real constants for achieving system stability.
The sliding mode motion suffers from the chattering, which may cause current harmonic misalignment and affect the accuracy of harmonic compensation. Therefore, in order to improve the quality of sliding mode motion and effectively suppress high-frequency chattering, a fast exponential power reaching law is selected [21]. The reaching law meets the reaching condition and makes the system stable.
Substituting (9), (13), and (14) into (15), (15) can be rewritten as By solving (16), the control law u of the system can be obtained, and the duty cycle da can be obtained as where, (17), the control input da can be divided into three parts: an equivalent part da_eq, a linear part da_l, and a non-linear part da_n. Where the equivalent part da_eq is an equivalent control law that can be obtained by solving 0 = a σ  , the linear part da_l and the non-linear part da_n are compensation effects of the fast exponential power-reaching law. Therefore, the A-phase control block diagram of SAPF based on SMC can be shown in Figure 2, where, the inverter output gain KPWM is udc/2. The control law of B-phase and C-phase is the same as that of the A-phase.

Error Analysis of Sliding Mode Controller
From (11) and (12), it can be obtained as follows Therefore, the sliding mode switching function becomes It can be seen that the sliding mode switching function is still essentially a linear combination of harmonic current tracking error and its various derivatives. Then, the sliding mode surface 0 = a σ can be deduced as The harmonic current error x3a can be obtained as Obviously, as long as m > 0 and n > 0 are guaranteed, the compensation current error x3a will tend to 0 when the steady state is reached, but an infinite switching frequency is required to achieve a high-precision steady-state performance. From (17), the control input da is closely related to the system parameters. Renewable energy is often produced far from the power load center and transmitted through long transmission lines and a large number of transformers, which causes the grid impedance to increase. In addition, temperature, voltage, and harmonics also affect the value of The equivalent part d a_eq

The plant
The non-linear part d a_n The linear part d a_l the capacitor. As a result, the system parameters will appear uncertain. In fact, because the system modeling is not necessarily accurate, and the system modeling may also be affected by the changes in system parameters or external interference, the sliding surface will drift, which will increase the output tracking error of the system. From (17) and (23), the harmonic current error x3a is directly related to the grid-connected inductor L1 and the filter capacitor Cf, and is related to the inverter-side inductor L2 through the control input da. The change in the parameters will directly affect the result of x3a. Taking the uncertainty of the filter capacitor Cf and the grid-side inductance L1 as examples, they are analyzed as follows.
Assuming that the initial nominal values of the filter capacitor and the grid-side inductor are Cf and L1, respectively, and those variations are ΔCf and ΔL1, the actual values after the change can be expressed as After the filter parameters change, the reference value of the filter capacitor voltage * ca u and the reference value of the inverter-side inductor current * inva i also change accordingly. The reference value of the grid-connected inductor current * sha i is given by the calculation of the harmonic detection algorithm, which is only related to the load and not affected by parameter changes. Therefore, (7) and (8) should be written as Consequently, the state variables x1a and x2a can be written as Compared with (22), the AC tracking error is introduced into the sliding surface, and the error term x3a can be calculated by the dsolve function in MATLAB. In addition to the first two items in (23), there are many harmonic components in the calculation results. Obviously, the defects in the system model make the sliding surface drift, which increase the harmonic current tracking error, and seriously affect the grid current THD.

Plug-in Repetitive Sliding Mode Controller Design
According to the internal model principle, the system controller can realize a zero tracking error control only if it contains the mathematical model which can generate the required reference input. RC is based on the internal model principle. It is able to provide an infinite loop gain for all harmonics. According to the nature of the exponential function [22], the internal model structural form of RC in the time domain can be expressed as where, kRC is the RC gain, T is the fundamental period of the input signal, ω is the fundamental frequency, and n is the harmonic order.
From (35), the internal model of the RC is very similar to the typical PR control. Compared with the PR control, the RC internal model adds a proportional control term, an integral control term which has infinite gain to the DC signal, and a multi-resonance control term which has infinite gain to the AC signal at multiple fundamental frequency. Therefore, the repetitive controller is essentially a combination of the PI and multi-resonant control. In practice, in order to increase the stability margin, a filter, Q, is usually connected in series in the internal model (taken as a constant less-than-1 or a low-pass filter). When Q is constant, (35) can be written as [23]  . When the ωc is much smaller than ω, (36) is established.
Obviously, compared with (35), the multi-resonance term in (36) has changed, which is similar to the structure of the PR controller. Therefore, as in [17], adding a multi-PR term, it is possible to add an RC term for the harmonic current error x3a into the sliding mode switching function.
First, after performing Laplace transform on (29), the sliding mode switching function can be transformed into a sliding mode in the s domain. when △L1 = 0.1 mH, △Cf = 1 uF, Ish7=1 A, kRC = 1, ω = 100π, ωc = 20, the bode plot of x3a(s) is shown in Figure 3. From Figure 3, the error x3a(s) has a large attenuation at the fundamental frequency and the harmonic frequency when RCSMC is applied, and the amplitude gain is less than −200 dB. Therefore, any harmonic error can be attenuated when the filter parameters are changed. Similarly, for other defects in the system model, the harmonic tracking errors can also be eliminated. It is proved that adding an RC term to the sliding surface can replace the multiple resonance term and play a better role in error correction. Obviously, the SAPF system based on RCSMC can not only enhance robustness, but also achieve full harmonic compensation and further reduce steady state errors. The A-phase control block diagram of the SMC system with RC term is shown in Figure 4. In Figure 4, an RC term of harmonic current error x3a is introduced to the sliding mode surface. The repetitive controller transfer function GRC (s) can achieve the best harmonic compensation by reasonably adding a compensator C(z) when the discrete implementation. According to [24], the compensator C(z) is composed of three parts: proportional gain kr, phase lead z k , and filter S(z). For the system parameters in this paper, the compensator is designed as [24]:

Simulation Results Analysis
To verify the proposed RCSMC scheme, the SAPF model with an LCLCL-filter is built in MATLAB. Compared with the traditional SMC, MRSMC and feedforward RC methods, the steadystate simulation and dynamic-state simulation is performed, respectively. For non-linear load, the DC side resistance of the rectifier is 40 Ω. The main circuit parameters and controller parameters are shown in Table 1 and Table 2.  6 and 7 show the simulation results of the steady-state waveform and spectrum of the grid current using SMC, MRSMC and RCSMC. The THD of the grid current is 1.87%, 1.29%, 0.82%, respectively. At the same non-linear load conditions, RCSMC scheme is the best. After the RC term is introduced into the sliding mode surface, the harmonic content of the grid current is further     Figure 8 shows the A-phase harmonic current error x3a(t) waveform using the SMC, MRSMC and RCSMC strategy. The x3a(t) waveform using traditional SMC is shown in Figure 8a. It is evident from Figure 8a that the uncertainty of system modeling and parameters make the sliding mode surface drift, which affects the harmonic current tracking error. As shown in Figure 8b, the harmonic current error x3a(t) is greatly reduced using MRSMC (the amplitude decreases from 3 A to 1 A), and the x3a(t) waveform is similar to the harmonic reference. However, the MRSMC strategy has a limited ability to achieve gain amplification for all order harmonics, so that it cannot fully eliminate the harmonic current error in steady state. The harmonic current error x3a(t) using RCSMC, as shown in Figure 8c, is further reduced. The amplitude of the harmonic current error is about 0.4 A, and the amplitude of the grid current is about 13.98 A. Compared with the other two control strategies, the high-precision compensation of the current harmonics is realized using RCSMC. Although the design of an RC internal model filter Q(z) and compensator C(z) is limited by the system stability so as to affect the harmonic compensation precision, the results presented are already excellent.   Figure 9 shows the dynamic simulation waveform of the grid current using RCSMC under the non-linear load step change. The non-linear load current amplitude is changed form 13.98 A to 20.39 A in 0.63 seconds. It can be seen that, when the non-linear load step changes, SAPF has good tracking ability and grid current is has perfect sinusoidal waveform. Due to the introduction of the RC term, there is a small distortion point at the peak of the current in the transient process, but the proposed control strategy still has a good dynamic response.

Robustness Analysis
An important feature of SMC is its strong robustness, which is reflected in the insensitivity of the control system to changes in grid parameters or SAPF parameters or external disturbances. When grid parameters are changed or disturbances exist, the system should not only maintain stability but also have perfect steady-state accuracy. By changing the grid inductor Ls (0.1 to 0.5 mH), the filter parameters L1 (△L1 = 0.1 mH) and Cf (△Cf = 1 uF), the anti-disturbance capability of the SAPF is verified in feedforward RC and RCSMC at the same nonlinear load condition, respectively, as shown in Figure 10 and Figure 11. Figure 10 shows the dynamic simulation results when the grid inductor Ls and filter parameters change in 0.53 seconds. As shown in Figure 10a, using the feedforward RC, the harmonic current error x3a increases by about ±1 A, and the grid current isa presents a distortion. The THD increased from 2.85% to 4.33%. As shown in Figure 10b, using RCSMC, the harmonic current error x3a increased by ± 0.1 A in an instant. The grid current THD changed from 0.82% to 0.94%.  Figure 11 shows the steady-state simulation results after the grid inductor Ls and filter parameters change. As can be seen from Figure 11a, using the feedforward RC, the results show that there is a significant error in the harmonic compensation current ish and the grid current is compensation accuracy decreases. The grid current is THD increased from the previous 4.33% to 8.05%, and the system becomes gradually unstable as the control model changes. As can be seen from Figure 11b using RCSMC, the reaching of the sliding mode surface has nothing to do with grid parameters, so the system is stable, and the THD remained at 0.94%, and the grid current waveform was still close to a standard sine wave. The simulation results show that, under the change in grid impedance and filter parameters, the feedforward RC strategy cannot suppress the external disturbances and make the system unstable, while the RCSMC method enables the grid to obtain precise and stable harmonic compensation and strong robustness.

Analysis of Experimental Results
An overview of the experimental platform built in the laboratory is shown in Figure 12. The platform consists of a 3-kVA SAPF with LCLCL filter and a 6-kVA three-phase uncontrolled rectified non-linear load with the parameters listed in Table 1 and Table 2. The total DC capacitor of SAPF is 3300 μF (Cd1 and Cd2 are respectively composed of two 3300 μF in parallel). The proposed control strategy was implemented in TMS320F28335 DSP based on experimental platform shown in Figure  1 and Figure 12.

Steady-State Experimental Results
In the steady-state experiment (the DC side is connected with 40 Ω resistor), the harmonic steady-state compensation performance is verified by using SMC, MRSMC and RCSMC. The experimental waveforms of the three control methods are shown in Figures 13, 14 and 15, respectively. Figure 13 shows that the harmonic current is insufficiently compensated using SMC and the grid current is non-sinusoidal waveform with a high THD (approximately 3.4%). As described in Section 2.2 and Section 4.1, the SAPF using SMC is unable to effectively compensate the harmonic current due to imperfect system modeling and parameter uncertainty and sampling delay. The compensation current has a periodic error of about ±1 A. Figure 14 shows the grid current and harmonic error waveforms using MRSMC. It can be seen that the grid current waveform has improved significantly. In view of the sliding mode surface drift, the MRSMC exerts an influence on the sliding mode surface, so that the specified low-order harmonics are compensated. The system has high steady-state accuracy, and the grid current THD is reduced to 2.4%. The experimental waveform using RCSMC is shown in Figure 15. As can be seen, the harmonic currents are effectively compensated and the grid current is almost sinusoidal, with a small THD of about 1.7%. It is fully proved that RC can enhance the tracking ability of the periodic harmonic of SAPF system, and realize the full harmonic compensation, and further improve the steady-state accuracy by introducing a great gain at all harmonic frequencies.

Dynamic Experimental Results
To evaluate the dynamic performance with load variations, the transient responses of the SAPF using different control strategies are shown in Figure 16 and Figure 17, respectively. As shown, as soon as the load is changed from 14 to 20 A, the SAPF current quickly responds to changes to compensate harmonic current and to ensure a sine grid current. It is verified that both the MRSMC and RCSMC strategy have good dynamic responses. In comparison, because of the inherent periodic delay in the RC, the fast response of harmonics is limited, and the dynamic response speed of the RCSMC is slightly lower than that of the MRSMC. However, the reaching law and the equivalent control law can make the system state variables stabilize on the sliding mode surface in a limited time, thereby ensuring the good sliding mode motion quality. In fact, due to the effect of SMC, the response time of the grid current is minimally increased, which is far less than one period of the grid voltage. Moreover, RCSMC results in a smaller current overshoot.   Figure 18 shows the grid current waveform using RCSMC after the filter inductor changes. It can be seen that, after the filter inductor changes from 0.7 to 0.8 mH, the harmonic current error x3a has hardly changed. The grid current THD increased from 1.7% to 1.8%. Although the inductor changes make the system model change accordingly, which will cause the sliding mode surface to drift and AC tracking error, the sliding mode function and the fast exponential power reaching law act commonly to keep the system stable, and the introduced RC term compensates excellently the tracking error. Experimental results show that RCSMC method has strong robustness.

Conclusions
This paper proposes a novel sliding mode control scheme with a repetitive sliding surface for SAPF with an LCLCL filter, which effectively eliminates grid-connected harmonic current tracking errors and enhances the system robustness.
(1) A sliding mode-switching function is established based on a linear combination of three error variables: inverter output current error, filter capacitor voltage error, and grid-connected harmonic current error. The control law is obtained through a fast exponential power reaching law. To address sliding mode surface drift caused by imperfect system modeling and system parameter uncertainty, the RC term of grid-connected harmonic current error are introduced into the sliding mode surface, and a plugin-repetitive sliding mode control strategy (RCSMC) is proposed. This strategy combines the advantages of RC and SMC to eliminate the harmonic current tracking error and suppress the grid current THD; (2) Simulation and experimental results on a 380 V, 3 kVA SAPF prototype show that, compared with SMC and MRSMC, the RCSMC has stronger robustness to perturbations, smaller tracking error, lower grid current THD and good dynamic response capabilities. The grid current THD can be reduced to 1.7% after compensation in experiment. The RCSMC is easier to realize in the discrete system, which has the advantage of simplicity and adaptability to SAPF.