Stability Analysis of Shunt Active Power Filter with Predictive Closed-Loop Control of Supply Current

: This paper presents a shunt active power ﬁlter connected to the grid via an LCL coupling circuit with implemented closed-loop control. The proposed control system allows selective harmonic currents compensation up to the 50th harmonic with the utilization of a model-based predictive current controller. As the system is fully predictive, it provides high effectiveness of the harmonic reduction, which is proved by waveforms achieved in performed tests. On the other hand, the control system is prone to loss of stability. Therefore, the paper is focused on the stability analysis of the discussed control system with the additional outer control loop of the supply current with predictive control of this current. The conducted stability analysis encompasses the assessment of system stability as a function of the coupling circuit parameter identiﬁcation accuracy, whose values are implemented in the current controller, as well as parameters such as the sampling frequency and proportional-integral (PI) controller coefﬁcients. The obtained results show that the ranges of the LCL circuit parameter identiﬁcation accuracy for which the system remains stable are relatively wide. However, the most effective compensation of the supply current distortion is achieved for the parameters identiﬁed correctly, and the greatest impact on the compensation quality has the value of L 1 inductance.


Introduction
The active power filter (APF) is a proven tool for power quality problems as it provides controllable and very effective harmonic currents compensation. On account of this, such a device has become more and more popular, which is reflected by the numerous research works on its control strategies published in scientific journals.
APFs can be classified into three types on the basis of their topology and connection to the power grid. The series APF, which is connected to the grid via a coupling transformer, constitutes a controlled voltage source and is utilized to directly mitigate voltage distortion [1,2]. However, the shunt APF, being connected in parallel between the supply and non-linear loads via a passive circuit, compensates directly for current distortion  and also, indirectly, the grid voltage. It acts as a controlled current source and is characterized by more merits in comparison to the series APF, which has made it widely used in industrial applications. The hybrid APF [31,32], holding the advantages of both passive and active power filters, combines improved performance and cost-effective solutions. There are two prominent configurations of the hybrid APF: a combination of the series APF and a shunt passive filter and a combination of the shunt APF and a shunt passive filter.
There are two main control strategies for the shunt APF in accordance with the control theory: feedforward open-loop control [8,11,17,19,[24][25][26] and feedback closed-loop control [3][4][5][6][7][9][10][11][12]15,16,18,[21][22][23]30]. They are based on the selection of the current around the point of common coupling (PCC), which is used in the control. The load current measurement is used to determine the set current in the open-loop system, while the supply current measurement is utilized in the closed-loop control. This control system is more complex than open-loop control as it requires the use of an outer control loop of the upstream current with simultaneous control of this current. It is less popular than the open-loop control structure on account of the fact that it is more prone to loss of stability. On the other hand, it ensures a higher level of harmonic currents compensation. Another less common control strategy is based on the measurement of voltage in the PCC. The reference current, which is proportional to voltage harmonic components, ensures compensation of distortions regardless of whether they come from the load or the supply side [28,29].
Determination of current harmonics to be compensated is significant and established on their detection with the utilization of the particular techniques in either the time or the frequency domain. The former approach encompasses methods such as instantaneous reactive power theory (p-q theory) [8,[13][14][15], stationary reference frame theory [12] or synchronous rotational reference frame theory relying on Park's transformation (d-q transformation) [3,7,18,22,25], whereas the latter comprises Fourier transform techniques (FFT, DFT) [11,20] as well as their variations [4][5][6][7]11]. Apart from this, harmonic currents compensation can be broadband or selective, often comprising harmonic current orders equal to 6k ± 1 as they are the most common existing in three-phase plants. There are also new approaches for this issue, such as the one presented in [32], which shows a hybrid APF defining the reference current on the basis of the sliding mode control. Another interesting study case is presented in [18], which proposes rectifying the problem in the electromagnetic compatibility of power electronics equipment by developing the APF's high control accuracy based on d-q control.
A crucial element of the APF control structure is a current controller due to the fact that it determines the quality of the reference current tracking. There is a wide range of various current controllers, among which one can distinguish a simple proportional-integral (PI) controller [3,4,7,10,15,17,18], a proportional-resonance (PR) controller [13,16,23], a deadbeat controller [12] and a model-based predictive controller (MPC) [8,20]. The challenges for current controllers include maximizing the harmonic currents compensation, correction of delays between the measurements and control and cooperation with the coupling circuit. In APFs, an LCL circuit has to be used as a coupling circuit due to its facility to mitigate current ripples resulting from the pulse modulation of the converter. However, it causes a resonance hazard. One solution to this issue is applying the active damping method [16,23,33]. The literature [16] presents the combination of using a current controller based on PR units with phase compensation along with the inverter-side current feedback active damping to attenuate the LCL resonance peak. Another approach for developing a current controller is shown in [22], which presents a current controller consisting of n parallel-connected PI controllers. There is a coupling circuit in the form of the inductance which does not cause a risk of resonance, but it is less effective in attenuating the switching ripples. However, although the mentioned solutions are well developed, they do not compensate the delays resulting from the discrete control system. Achieving this is possible with the utilization of a predictive current controller. The MPC of the control system proposed in this paper not only compensates for the mentioned delays but also fully blocks the resonance of the LCL circuit and is characterized by great dynamics of operation. Using this controller with the additional outer control loop of the upstream current in a control system of an APF is a novelty. Nevertheless, the application of the additional outer control loop for the upstream current with the predictive control of this current implies the necessity of applying prediction also when determining the reference current, which makes it more complex. Another problematic issue resulting from this outer current feedback loop is its proneness to loss of stability in the system. Therefore, defining the stability margins for this control system is of high importance. The stability analysis of the proposed system has not been presented in the literature. Generally, the stability analysis is an important issue in control systems which is why it is shared by some researchers [8,[22][23][24]28]. Not only does it present the impact of particular parameters on the system stability but it also allows defining the range of their possible changes in such a way as to avoid the loss of stability. There are very little papers focusing on the stability analysis of an APF with external closed-loop control from the supply current. Existing ones, such as [22,23], do not involve predictive solutions; therefore, such an analysis seems to be important to introduce. Although the significance of such an analysis is considerable, conducting it can be complicated. Therefore, the introduction of some simplification is often demanded, especially in systems with complex structures.
The main subject of this paper is the stability analysis of a three-phase shunt APF with an implemented control system with an additional predictive outer control loop of the upstream current with predictive control of this current. This includes defining transfer functions of the system and examining the impact of the sampling period value, control system parameters and the accuracy of coupling circuit parameter identification on the system stability.
The paper is divided into five sections. Section 2 presents a circuit structure, a description of the implemented control and the parameters of the discussed system. Then, sample waveforms to illustrate the operation and a harmonic currents compensation level realized by the proposed shunt APF are presented. Section 3 focuses on the stability analysis of the system with the defining partial and overall transfer functions of the control system. Section 4 depicts root locations as a function of the changes in the particular control system's parameter values and defines the margins of the system stability for this system. The paper ends with a brief conclusion summarizing the significant contributions of the work in Section 5.

Proposed Control System
The presented system is a shunt APF which is connected in parallel between the supply and the load. Its circuit structure along with detailed parameters and proposed control strategy is described below.

System Description
The system under study is a three-phase, three-wire low-voltage power grid with a non-linear load connected to the grid via L L inductors. The load consists of a three-phase rectifier with the RL load on the DC side of this converter. The implemented shunt APF comprises a two-level voltage source inverter (VSI), which acts as a controlled current source, connected to the grid between the source and the load in the PCC via a coupling circuit. An LCL circuit was applied to ensure the attenuation of current ripples which are caused by the impulse operation of the converter. The proposed main circuit topology, which is a diagram of the tested system, is shown in Figure 1. The parameters in the figure indicate the following: i u -upstream current, i d -downstream current, i 1 -L 1 current, i 2 = i k -L 2 current. The values of the circuit's parameters along with the parameters of the control are presented in Table 1.  Figure 1. Main circuit structure.

Control Structure
The proposed control system is a predictive closed-loop control of the shunt APF which utilizes the outer control loop of the upstream current with simultaneous realization of the control of this current. Its main units include the uDC controller, which serves the superordinate function in the system, the predictive set current determination unit, the predictive current controller and the space vector pulse width modulation (SVPWM) modulator. The system's block diagram is presented in Figure 2.  The selection of the LCL circuit parameter values as well as the value of the sampling period was performed in accordance with the methodology proposed in [8].

Control Structure
The proposed control system is a predictive closed-loop control of the shunt APF which utilizes the outer control loop of the upstream current with simultaneous realization of the control of this current. Its main units include the u DC controller, which serves the superordinate function in the system, the predictive set current determination unit, the predictive current controller and the space vector pulse width modulation (SVPWM) modulator. The system's block diagram is presented in Figure 2. The implemented control algorithm is developed in the orthogonal stationary reference frame projected on the complex plane α-jβ with the usage of the Clarke transform with power invariance. The application of prediction demands the use of the predictive current controller, which provides correction of delays between the feedbacks and control, prediction of the supply voltage and prediction of the reference current.
The outer control loop of the upstream current is predictive and determines the APF reference current in a selective manner. It was set to allow compensating harmonic currents whose orders are equal to ±(6k ± 1), up to the 50th harmonic. The particular reference harmonic current calculation, which is shown as a block diagram in Figure 3, includes the discrete Fourier transform (DFT), PI control, inverse discrete Fourier transform (IDFT) and prediction. The outer PI controllers, which are independent for each of the compensated current harmonics, control the complex amplitudes of these current harmonics to be equal to zero (separately, their orthogonal real and imaginary components), which are constant for the quasi-steady state of the compensated non-linear loads. Therefore, the task of these outer PI controllers is to completely eliminate the compensated current harmonics from the upstream current thanks to the action of its integral parts. The dynamics of these outer loop PI current controllers determine only the APF response time for changes in the power of compensated loads. They substantially improve the APF current compensation effectiveness in quasi-steady states, regardless of the dynamics of the inner current controller. Particular symbols appearing in the figure, not mentioned before, indicate: φe,1-the instantaneous phase angle of the supply voltage fundamental harmonic, k-the order of harmonic current to be compensated, r-prediction horizon, n-sample number.
The resultant reference current is a superposition of the currents of individual harmonics determined in accordance with the diagram shown in Figure 3. The applied prediction horizon is equal to 3 on account of the fact that LCL is a third-order circuit. It means that zero error of the set current is possible to achieve in a discrete control system in three control steps, which corresponds to three sampling periods Ts.
The implemented control algorithm is developed in the orthogonal stationary reference frame projected on the complex plane α-jβ with the usage of the Clarke transform with power invariance. The application of prediction demands the use of the predictive current controller, which provides correction of delays between the feedbacks and control, prediction of the supply voltage and prediction of the reference current.
The outer control loop of the upstream current is predictive and determines the APF reference current in a selective manner. It was set to allow compensating harmonic currents whose orders are equal to ±(6k ± 1), up to the 50th harmonic. The particular reference harmonic current calculation, which is shown as a block diagram in Figure 3, includes the discrete Fourier transform (DFT), PI control, inverse discrete Fourier transform (IDFT) and prediction. The outer PI controllers, which are independent for each of the compensated current harmonics, control the complex amplitudes of these current harmonics to be equal to zero (separately, their orthogonal real and imaginary components), which are constant for the quasi-steady state of the compensated non-linear loads. Therefore, the task of these outer PI controllers is to completely eliminate the compensated current harmonics from the upstream current thanks to the action of its integral parts. The dynamics of these outer loop PI current controllers determine only the APF response time for changes in the power of compensated loads. They substantially improve the APF current compensation effectiveness in quasi-steady states, regardless of the dynamics of the inner current controller. Particular symbols appearing in the figure, not mentioned before, indicate: ϕ e,1 -the instantaneous phase angle of the supply voltage fundamental harmonic, k-the order of harmonic current to be compensated, r-prediction horizon, n-sample number.

Sample Waveforms
The discussed system, whose structure is presented in Figure 1, was examined in the simulation tests conducted in the PLECS software. The control system, shown in Figure 2,  The resultant reference current is a superposition of the currents of individual harmonics determined in accordance with the diagram shown in Figure 3. The applied prediction horizon is equal to 3 on account of the fact that LCL is a third-order circuit. It means that zero error of the set current is possible to achieve in a discrete control system in three control steps, which corresponds to three sampling periods T s .

Sample Waveforms
The discussed system, whose structure is presented in Figure 1, was examined in the simulation tests conducted in the PLECS software. The control system, shown in Figure 2, and the diagram for the outer control loop of the upstream current, determining the APF's reference current, which is depicted in Figure 3, were implemented as an algorithm written in the C programming language. The simulation tests were conducted taking into consideration the feedback path from the upstream current, delays between the feedback and the control and the non-linearities resulting from the impulse operation of the converter. The presented results, which are depicted in Figures 4 and 5, were achieved for the system's parameters given in Table 1. Figure 4 shows waveforms in the PCC when there is no harmonic compensation in the system, whilst Figure 5 presents the transients when the APF is enabled.

Sample Waveforms
The discussed system, whose structure is presented in Figure 1, was examined in the simulation tests conducted in the PLECS software. The control system, shown in Figure 2, and the diagram for the outer control loop of the upstream current, determining the APF's reference current, which is depicted in Figure 3, were implemented as an algorithm written in the C programming language. The simulation tests were conducted taking into consideration the feedback path from the upstream current, delays between the feedback and the control and the non-linearities resulting from the impulse operation of the converter. The presented results, which are depicted in Figures 4 and 5, were achieved for the system's parameters given in Table 1. Figure 4 shows waveforms in the PCC when there is no harmonic compensation in the system, whilst Figure 5 presents the transients when the APF is enabled.   The above results prove that the proposed control strategy provided a high level of harmonic current limitation, which resulted, consequently, in voltage harmonics mitigation. THD i decreased about twenty-seven times, whereas THD u decreased almost four and a half times. Moreover, waveforms depicted in Figure 5c,d reflect the effect of the influence of the LCL circuit on the system. The ripples contained in the APF current observed in Figure 5c and related to pulse modulation were reduced almost completely, which can be noticed in Figure 5d.

Sample Waveforms
The discussed system, whose structure is presented in Figure 1, was examined in the simulation tests conducted in the PLECS software. The control system, shown in Figure 2, and the diagram for the outer control loop of the upstream current, determining the APF's reference current, which is depicted in Figure 3, were implemented as an algorithm written in the C programming language. The simulation tests were conducted taking into consideration the feedback path from the upstream current, delays between the feedback and the control and the non-linearities resulting from the impulse operation of the converter. The presented results, which are depicted in Figures 4 and 5, were achieved for the system's parameters given in Table 1. Figure 4 shows waveforms in the PCC when there is no harmonic compensation in the system, whilst Figure 5 presents the transients when the APF is enabled.  The above results prove that the proposed control strategy provided a high level of harmonic current limitation, which resulted, consequently, in voltage harmonics mitigation. THDi decreased about twenty-seven times, whereas THDu decreased almost four and a half times. Moreover, waveforms depicted in Figure 5c,d reflect the effect of the influence of the LCL circuit on the system. The ripples contained in the APF current observed in Figure 5c and related to pulse modulation were reduced almost completely, which can be noticed in Figure 5d. Figure 6 shows examples of waveforms obtained for the laboratory model. They illustrate the effectiveness of the predictive controller along with the current and voltage prediction algorithms. The presented laboratory system is a three-phase low-voltage power network (400 V, 50 Hz) and a non-linear load of apparent power equal to 10.3 kVA, in the form of a diode rectifier with an RC load on the DC side. A shunt active power filter with rated power equal to 10 kVA was connected between the supply network and the load via an LCL circuit with the following parameters: L1 = 2.0 mH, L2 = 1.4 mH, C = 10 µF. The value of the THDi coefficient of the upstream current was equal to 44% with disabled compensation in the system. The results achieved when the APF was enabled show that the upstream current distortion was compensated to THDi = 2.5%, whilst the value of the THDu coefficient was compensated to 1.69%.   The above results prove that the proposed control strategy provided a high level of harmonic current limitation, which resulted, consequently, in voltage harmonics mitigation. THDi decreased about twenty-seven times, whereas THDu decreased almost four and a half times. Moreover, waveforms depicted in Figure 5c,d reflect the effect of the influence of the LCL circuit on the system. The ripples contained in the APF current observed in Figure 5c and related to pulse modulation were reduced almost completely, which can be noticed in Figure 5d. Figure 6 shows examples of waveforms obtained for the laboratory model. They illustrate the effectiveness of the predictive controller along with the current and voltage prediction algorithms. The presented laboratory system is a three-phase low-voltage power network (400 V, 50 Hz) and a non-linear load of apparent power equal to 10.3 kVA, in the form of a diode rectifier with an RC load on the DC side. A shunt active power filter with rated power equal to 10 kVA was connected between the supply network and the load via an LCL circuit with the following parameters: L1 = 2.0 mH, L2 = 1.4 mH, C = 10 µF. The value of the THDi coefficient of the upstream current was equal to 44% with disabled compensation in the system. The results achieved when the APF was enabled show that the upstream current distortion was compensated to THDi = 2.5%, whilst the value of the THDu coefficient was compensated to 1.69%. The value of the THD i coefficient of the upstream current was equal to 44% with disabled compensation in the system. The results achieved when the APF was enabled show that the upstream current distortion was compensated to THD i = 2.5%, whilst the value of the THD u coefficient was compensated to 1.69%.

Stability Analysis
The subject of the stability analysis is the control system with the outer closed-loop current reference control, inner model-based predictive current controller and an object in the form of an LCL coupling circuit, an ideal grid voltage source and a current source-based load. The current controller requires both the information about state variables of the LCL circuit and the reference current signal for proper operation. Such a system is prone to the loss of stability in case of operating with an improper control sampling frequency and poor identification of the LCL circuit parameters required by the MPC controller. The presence of the outer control loop results in additional roots of the characteristic equation of the system. As the proposed control system is not designed to be adaptive, its important quality factor is the robustness. Due to the relatively high complexity of the system, certain simplifications were adopted for the need to perform this analysis. Performing the stability analysis demanded defining particular transfer functions of the system first and then determining their generalization. These operations as well as the stability analysis were performed with the utilization of MATLAB software with the following toolboxes: System Identification Toolbox, Control System Toolbox and Symbolic Math Toolbox.

Assumptions
The stability analysis was conducted with the presumption that the grid is ideally stiff, and thus operation under conditions of a weak grid is not considered in this paper. The discussed system is based on the discrete-continuous model, in which the applied predictive current controller is the discrete part, and the continuous parts are the voltage inverter and the LCL circuit. Therefore, the stability analysis of the entire system is possible only when it is reduced to either a continuous or a discrete form. However, reducing it to the discrete form allows the stability analysis as a function of the sampling frequency, which constitutes an essential parameter of the system as it affects the stability of the control system. On account of that, continuous parts were discretized and the whole system was examined in the z-domain. Furthermore, the model of the inverter was linearized and simplified. Assuming an unlimited u DC voltage and neglecting the inverter's nonlinearities, there is an opportunity to adopt a linear model of the inverter as a zero-order hold (ZOH).

Stability Analysis
The subject of the stability analysis is the control system with the outer closed-loop current reference control, inner model-based predictive current controller and an object in the form of an LCL coupling circuit, an ideal grid voltage source and a current source-based load. The current controller requires both the information about state variables of the LCL circuit and the reference current signal for proper operation. Such a system is prone to the loss of stability in case of operating with an improper control sampling frequency and poor identification of the LCL circuit parameters required by the MPC controller. The presence of the outer control loop results in additional roots of the characteristic equation of the system. As the proposed control system is not designed to be adaptive, its important quality factor is the robustness. Due to the relatively high complexity of the system, certain simplifications were adopted for the need to perform this analysis. Performing the stability analysis demanded defining particular transfer functions of the system first and then determining their generalization. These operations as well as the stability analysis were performed with the utilization of MATLAB software with the following toolboxes: System Identification Toolbox, Control System Toolbox and Symbolic Math Toolbox.

Assumptions
The stability analysis was conducted with the presumption that the grid is ideally stiff, and thus operation under conditions of a weak grid is not considered in this paper. The discussed system is based on the discrete-continuous model, in which the applied predictive current controller is the discrete part, and the continuous parts are the voltage inverter and the LCL circuit. Therefore, the stability analysis of the entire system is possible only when it is reduced to either a continuous or a discrete form. However, reducing it to the discrete form allows the stability analysis as a function of the sampling frequency, which constitutes an essential parameter of the system as it affects the stability of the control system. On account of that, continuous parts were discretized and the whole system was examined in the z-domain. Furthermore, the model of the inverter was linearized and simplified. Assuming an unlimited uDC voltage and neglecting the inverter's non-linearities, there is an opportunity to adopt a linear model of the inverter as a zero-order hold (ZOH). Figure 7 presents the z-domain block diagram of the proposed system with compensation for a particular harmonic current. This scheme contains all considered partial transfer functions, whilst equivalent block diagrams with generalized transfer functions are depicted in Figure 8. All symbols utilized both in diagrams and transfer functions are consistent with those used in the previous figures, tables and text.  The discrete transfer function matrix of the predictive model-based current controller derives from difference equations described in detail in [8] and is as follows:

Overall and Partial Transfer Functions
where Ts denotes the sampling period. The discrete transfer function matrix of the LCL circuit (analog part of the system) results from the cascade connection of the ZOH, which reflects the pulse operation of the APF inverter, and the LCL continuous transfer function matrix derived from differential equations of the LCL coupling circuit outlined in [8]. Therefore, the GLCL(z) matrix is described by the following equation: where ωr is the LCL resonant angular frequency: while the resonant frequency is expressed by which in the discussed system is equal to fr = 2.25 kHz. GCL(z) is the set current transfer function. Determining the reference current in the presented circuit requires transforming the signal into the frequency domain with the usage of the DFT. From a mathematical point of view, this operation is identical to the Park transform, where the angle of rotation is the product of the order of a given har- The discrete transfer function matrix of the predictive model-based current controller derives from difference equations described in detail in [8] and is as follows: where T s denotes the sampling period. The discrete transfer function matrix of the LCL circuit (analog part of the system) results from the cascade connection of the ZOH, which reflects the pulse operation of the APF inverter, and the LCL continuous transfer function matrix derived from differential equations of the LCL coupling circuit outlined in [8]. Therefore, the G LCL (z) matrix is described by the following equation: where ω r is the LCL resonant angular frequency: while the resonant frequency is expressed by which in the discussed system is equal to f r = 2.25 kHz. G CL (z) is the set current transfer function. Determining the reference current in the presented circuit requires transforming the signal into the frequency domain with the usage of the DFT. From a mathematical point of view, this operation is identical to the Park transform, where the angle of rotation is the product of the order of a given harmonic and the instantaneous angle of the grid voltage obtained from the phase-locked loop (PLL), followed by low-pass filtering. The next steps consist of PI control, prediction and the IDFT, which is the same as the inverse Park transform. Bearing this in mind, the G CL (z) matrix derives from the following equation: where ϕ and k denote the instantaneous phase angle of the supply voltage fundamental harmonic and the order of the compensated harmonic current, respectively.
In the case where the matrices between the Park transforms are diagonal with the same coefficients on the main diagonal, the Park transform matrices do not affect the value of the resultant matrix. This is because the product of Park transform matrices is the identity matrix: cos(ϕk) sin(ϕk) − sin(ϕk) cos(ϕk) · cos(ϕk) − sin(ϕk) sin(ϕk) cos(ϕk) = 1 0 0 1 Therefore, the final transfer function can be expressed by and is represented as follows: where a is the coefficient of the low-pass filter, while K p and K i denote proportional and integral coefficients of the PI controller.
The whole system is reduced to the single-input, single-output (SISO) form, as it is shown in Figure 8. On account of that, the overall transfer function is represented as with G OL (z) expressed by the following equation: where the minus in the denominator results from taking into account the negative feedbacks in the transfer function of the current controller.

Results
The stability of the considered control system results from the root locations of the characteristic equation of the G(z) transfer function on the z-plane. In the discussed APF circuit, it is conditioned by the value of the sampling period, the K p and K i coefficients and the identification accuracy of the LCL coupling circuit parameters. The latter aspect is especially significant when the applied current controller is predictive. To examine the impact of this factor on stability, the exact parameters L 1 , L 2 and C in the predictive controller transfer function G C (z) were replaced with the identified (measured or estimated) values L 1c , L 2c and C c , respectively. This results from the fact that parameters of the LCL circuit implemented in the control algorithm (L 1c , L 2c , C c ) constitute the parameters of the current controller. Changes in their values, which determine the percentage accuracy of their compliance with the parameters of the LCL circuit, as well as the range of values of changes in the T s , K p and K i parameters, define the area of stable operation of the system.
Root locus analyses of the APF feedback control system as a function of the abovementioned parameters are presented in Figure 9. Red crosses in each figure indicate the pole locations of the discussed system for the following parameters: L 1c = L 1 = 150 µH, L 2c = L 2 = 75 µH, C c = C = 100 µF, T s = 6.25 10 −5 s, K p = 0.02, K i = 10.0. The presented results were obtained from tests conducted in MATLAB software.
The spans of the permissible changes in the K p and K i coefficients in the area of system stability are below 1.08 and above 120, respectively, when the other parameter remains unchanged. This control system was not tested under the conditions of changes in both coefficients simultaneously.
The control system is stable in terms of the sampling period value being below 7.38 10 −5 s and in the range from 1.35 10 −4 s to 1.5 10 −4 s. These values correspond to the sampling frequency between 6.67 and 7.46 kHz and above 13.55 kHz. The relation between the sampling frequency f s and the modulation frequency f PWM in the proposed system is as follows: and thus the system remains stable when the modulator pulsation frequency is in the range from 3.33 to 3.73 kHz and above 6.77 kHz. This means that the minimum sampling frequency within the stable area is approximately 1.5 times the LCL circuit resonant frequency: f PWM = 1.5 f r . However, a relatively large margin of stability can be obtained when f PWM > 3 f r .
As far as the changes in the identification accuracy of the LCL coupling circuit parameters are concerned, the feedback control system remains stable for the given inductance value L 1c in the range from 88% to 136% of the exact value (L 1 ), for the inductance L 2c above 64% of the exact value (L 2 ) and for the capacitance C c in the range from 74% to 290% of the exact value (C). Not only do these ranges far exceed the practical tolerances of the choke and capacitor parameters but they are also beyond the achievable accuracy of measurements of these quantities. The spans of the permissible changes in the Kp and Ki coefficients in the area of system stability are below 1.08 and above 120, respectively, when the other parameter remains unchanged. This control system was not tested under the conditions of changes in both coefficients simultaneously.
The control system is stable in terms of the sampling period value being below 7.38⸱10 −5 s and in the range from 1.35⸱10 −4 s to 1.5⸱10 −4 s. These values correspond to the sampling frequency between 6.67 and 7.46 kHz and above 13.55 kHz. The relation between the sampling frequency fs and the modulation frequency fPWM in the proposed system is as follows: and thus the system remains stable when the modulator pulsation frequency is in the range from 3.33 to 3.73 kHz and above 6.77 kHz. This means that the minimum sampling frequency within the stable area is approximately 1.5 times the LCL circuit resonant frequency: fPWM = 1.5 fr. However, a relatively large margin of stability can be obtained when fPWM > 3 fr. As far as the changes in the identification accuracy of the LCL coupling circuit parameters are concerned, the feedback control system remains stable for the given inductance value L1c in the range from 88% to 136% of the exact value (L1), for the inductance L2c above 64% of the exact value (L2) and for the capacitance Cc in the range from 74% to 290% of the exact value (C). Not only do these ranges far exceed the practical tolerances of the choke and capacitor parameters but they are also beyond the achievable accuracy of measurements of these quantities.
Simulation tests were conducted in PLECS to define the values of the considered parameters, for which the loss of stability is observed in the control system. The simulated control system is stable when the value of the L1c parameter is within the range from Simulation tests were conducted in PLECS to define the values of the considered parameters, for which the loss of stability is observed in the control system. The simulated control system is stable when the value of the L 1c parameter is within the range from 89% to 136% of the exact value (L 1 ), the value of L 2c is above 64% of the exact value (L 2 ) and the value of C c is between 74% and 325% of the exact value (C). The loss of stability occurs when the sampling period is above 1.49 10 −4 s and in the range from 1.29·10 −4 to 7.38 10 −5 s. The obtained values are almost completely consistent with the values achieved in the stability analysis conducted in MATLAB, which makes the results reliable.
Further tests performed for the determinants of the experimental system provided results which show that the stability regions for the examined parameters are wider than those obtained in the stability analysis. This is due to limits of the control signals which result from the value of the u DC voltage (and, consequently, the range of the inverter AC voltage) as well as the value of the APF's maximum current. However, a relatively high consistency is obtained for the T s parameter. It is an important issue on account of the fact that this parameter determines the value of the inverter modulation frequency f PWM , and in consequence, due to switching losses, the maximum rated power of the singleinverter-based APF. Although the system remains stable in a wide range of the mentioned parameter value changes, the compensation effectiveness beyond the stability region is noticeably lower, which is shown further in the paper. The comparison of the results obtained on the basis of the simulation tests, the stability analysis and tests performed for the determinants of the experimental system is presented in Table 2.
Presented results prove that the stability margins obtained by the analytical method ensure the stability in actual systems.
Sample waveforms of the APF current, measured on L 1 and L 2 inductances, illustrating the loss of stability are shown in Figure 10. The values of parameters L 2c and C c are equal to parameters L 2 and C, respectively, given in Table 1. The value of parameter L 1c is changed in the time equal to 0.5 s from the value L 1c = 136% of L 1 to the value L 1c = 137% of L 1 , which is the same as exceeding the stability limit shown in Table 2. The waveforms up to time t = 0.5 s present stable operation of the system, whilst the waveforms in the time ranges from 0.5 to 0.6 s depict the system's operation in case of loss of stability. The choice of the L 1c parameter to represent the system stability loss results from the fact that the value of this parameter has the greatest impact on the system stability, which will be presented later in the paper.
The obtained results show that the greatest effects of the loss of stability in the control system are visible on the waveforms of currents i 1 and i C as they reached very high values. The value of the current i 2 is smaller due to the secondary influence of the resonance formed in the circuit L 1 -C. Figure 11 presents values of THD i in the PCC as a function of the LCL circuit parameter identification. It completes previous results and shows the effectiveness of compensation performed by the APF in case of introducing LCL parameters inaccurately in the control system. The presented characteristics are an approximation of the points obtained on the basis of a series of simulations, assuming that only one of the parameters is changed while the others are identified correctly and remain unchanged. The discussed parameters were tested within the following identification accuracy ranges: L 1c : 30% ÷ 200% of L 1 , L 2c : 30% ÷ 250% of L 2 , C c : 50% ÷ 200% of C. obtained on the basis of a series of simulations, assuming that only one of the parameters is changed while the others are identified correctly and remain unchanged. The discussed parameters were tested within the following identification accuracy ranges: L1c: 30% ÷ 200% of L1, L2c: 30% ÷ 250% of L2, Cc: 50% ÷ 200% of C.  The obtained results show that the optimal values of the current controller parameters (L1c, L2c, Cc), from the point of view of the compensation effectiveness determined on the basis of the THD coefficient, are the exact values of the LCL circuit. It is also noticeable from the characteristics that the correctness of determining the value of inductance L1 has the greatest impact on the quality of compensation.

Conclusions
The obtained simulation results confirm a great level of grid harmonic currents compensation of an LCL-based shunt APF with predictive closed-loop control. Along with the high effective filtering performance, a simultaneous high reduction in filter current ripples associated with the pulse width modulation (PWM) modulation was achieved.
The presented stability analysis included the determination of overall and partial transfer functions of the discussed control system and defining the boundaries of particular parameter changes for which the control system remains stable. The APF stability region, obtained by the analytical method, is determined by the values of the parameters L1c, L2c, Cc, Kp, Ki and Ts in the following ranges: L1c = 88% ÷ 136% of L1, L2c > 64% of L2, Cc = 74% ÷ 290% of C, Kp < 1.08, Ki > 120, Ts < 7.38⸱10-5 s and Ts =1.35⸱10-4 ÷ 1.5⸱10-4 s, which correspond to the sampling frequency fs = 6.67 ÷ 7.46 kHz and fs > 13.55 kHz. The achieved results show that there is a wide range of the LCL circuit parameter identification accuracy for which the system is stable. This is very important in control systems with predictive current controllers. The stability range for the LCL circuit parameter value changes achieved by tests conducted for the determinants of the experimental system is even wider. From a practical point of view, this means that introducing the values of the  Figure 11. THD i value changes as a function of the accuracy of LCL circuit parameter identification.

Conclusions
The obtained simulation results confirm a great level of grid harmonic currents compensation of an LCL-based shunt APF with predictive closed-loop control. Along with the high effective filtering performance, a simultaneous high reduction in filter current ripples associated with the pulse width modulation (PWM) modulation was achieved.
The presented stability analysis included the determination of overall and partial transfer functions of the discussed control system and defining the boundaries of particular parameter changes for which the control system remains stable. The APF stability region, obtained by the analytical method, is determined by the values of the parameters L 1c , L 2c , C c , K p , K i and T s in the following ranges: L 1c = 88% ÷ 136% of L 1 , L 2c > 64% of L 2 , C c = 74% ÷ 290% of C, K p < 1.08, K i > 120, T s < 7.38 10 −5 s and T s =1.35 10 −4 ÷ 1.5 10 −4 s, which correspond to the sampling frequency f s = 6.67 ÷ 7.46 kHz and f s > 13.55 kHz. The achieved results show that there is a wide range of the LCL circuit parameter identification accuracy for which the system is stable. This is very important in control systems with predictive current controllers. The stability range for the LCL circuit parameter value changes achieved by tests conducted for the determinants of the experimental system is even wider. From a practical point of view, this means that introducing the values of the parameters L 1 , L 2 and C to the system on the basis of their rating plates, which are given with certain tolerances, ensures the system's robustness to a sufficient degree. Furthermore, the obtained range of the switching frequency proves the possibility of the application of this APF in a system which requires a low switching frequency of the power transistors. Results acquired in the stability analysis performed in MATLAB were confirmed by simulation tests conducted in PLECS. Parameter values for which the control system lost its stability, obtained in both the stability analysis and simulation examinations, were consistent. Further analysis showed that the value of inductance L 1 implemented in the control system (L 1c ) was the most influential regarding the effectiveness of compensation expressed by the value of the THD i coefficient. It was also noticed that the accuracy of LCL parameter identification affects the compensation quality realized by the APF. The greatest level of harmonic currents compensation was obtained for the values implemented in the current controller equal to the actual values of the coupling circuit.
Further research will focus on considering other factors influencing the stability of the system, such as the value of the grid impedance, as well as the type of load and its voltage susceptibility.