Repetitive Predictive Control for Current Control of Grid-Connected Inverter Under Distorted Voltage Conditions

A repetitive predictive control for grid-connected inverter current control scheme is presented in this paper under voltage harmonic distortion in the stationary reference frame. Predictive control is an approach that uses a receding horizon to achieve the optimal track for the reference. In this approach, the repetitive controller behavior is added to the predictive control to increase its performance under distorted voltage conditions. In addition, to apply the controller in the generation system, controller is designed from the perspectives of the power system. The controller is designed considering the state-space model in the stationary reference frame. The controller performance was verified using a laboratory experimental setup under distorted grid voltage condition. Experimental results confirm that the proposed controller can effectively suppress harmonics under both normal operation and distorted grid voltage conditions, and also satisfy the requirements stipulated in IEEE Std. 1547.2-2008.


I. INTRODUCTION
To decrease CO 2 emissions from power generation the demand for renewable energy is rapidly increasing around the world [1]. Many of the intermittent renewable energy based generators have an inverter connected to a grid, which is focused on applications that can take advantage from voltage regulation. One of the most common ways to grid connect a power source is via an active rectifier [2], that can be used for photovoltaic (PV) systems [3], [4]. Another example of a renewable system is Doubly Fed Induction Generators (DFIG) based wind energy conversion system. The DFIG machines have a rotor linked to the grid by a backto-back inverter and the stator is directly connected to the The associate editor coordinating the review of this manuscript and approving it for publication was Mouloud Denai . grid [5]. In this way, the power electronics made possible the use of inverters to control the power injected to the grid in different ways [6], the converter used in this work has a good efficiency because it is a converter already known in the literature [4], [7].To connect the inverter to the grid L, LC, and LCL are typically used, but for this article due to the simple implementation, the L filter is applied as presented in [7], [8].
A large number of current control strategies have been proposed for grid-connected inverters like the Voltage Oriented Control(VOC) are responsible for the control of active and reactive power [7], [9].
Voltage distortions can be introduced by nonlinear loads and could also be resulted due to the voltage source inverter (VSI) deadtime and ultimately affect the quality of the electrical power supply system [10]. Controllers were designed to mitigate the impact of Total Harmonic Distortion VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ (THD) in the grid current [11]. A few solutions to voltage distortion are proposed as follows: Repetitive Control [12], which is used for tracking signal reference and it allows to obtain a low output THD. H∞ Repetitive Control [13] that proposes a current controller based on two classic techniques in control system to reduce its THD value. In Resonant Proportional Control based on Lyapunov-Function [4], [14], the Lyapunov-Function is responsible for obtaining global stability of the system and the proportional-resonant to zero-error signal. And finally a Deadbeat Control law with an observer, which is applied in Robust Predictive Control [15] is used to estimate the future behavior.
This paper proposes to evaluate the predictive and repetitive characteristics in a unique controller. Additionally, this technique has not been presented in previous literature when the grid-connected inverter is used.
Many predictive control techniques have been proposed for grid-connected inverters, one of them is the Model Predictive Control (MPC) [16], [17], which uses the future behavior of the system to obtain the control law and achieve the reference signal [18], [19]. The Finite Control Set (FCS) is a controller that has a limited number of voltage vectors to track the reference signal [20], notice that [8] is one of the few papers related to FCS, which addresses voltage distortion, and solves the problem of variable switching that is common in classic FCS.
The Generalized Predictive Control (GPC) acquires the control law through a transfer function (TF) or a state-space (SS) model [21]. The predictive controllers have a lower computational effort, if compared to controller that uses nonlinear models, and their strong capability to handle with coupling components are very helpful [22].
Repetitive Control (RC) [23] is based on the internal model [24], which uses a TF or a SS model of the system. These control states can provide a zero-error tracking reference signal. In order to achieve a referential signal a polynomial equation should be added to the denominator of the controller system [25]. The controller works as a tracker of periodic reference signal and on applications, such as robotic plants [26] and Power Electronics fields [27]. A repetitive controller is designed from a control signal that is often generated by the controller through transfer function. A desired coefficient can be chosen to track the reference or eliminate a disturbance [28].
Summarizing the ideas presented in this paper, a new controller is proposed by combining the repetitive control and predictive control schemes, which is named as Repetitive Predictive Control (RPC). This research contributes to the academic literature as it proposes an alternative technique to mitigate the grid current due to the deformation caused by the harmonic components in grid voltage. This type of controller can be found in the robotics system as presented in [29], and also in power electronics as PMSM machines which operate with variable switching frequency [30]. However, in gridconnected inverter under distorted voltage this type of control has not been applied yet. To validate this proposed controller the experimental results are presented in section IV.

II. MODELING OF THE GRID-CONNECTED
The grid connected inverter was modeled according to the grid voltage reference frame, the inverter and the inductive filter (R g , L g ). The inductive filter was applied between the inverter and the grid, and it can be noticed in Figure 1. The following equation can be used to represent the system and making it possible to analyze the flow of power injected into the grid.
The power inverter links the grid using an inductive filter and its state-space in stationary reference frame (αβ) can be written as [31]: where i and v are the current and voltage vectors, the subscript g represents the variable from the grid. The inductance and internal resistance are represented as L g and R g respectively, and the variables from inverter are presented by subscript inv . The stationary frame are represented as α for real component and β for imaginary component and C i is the identity matrix.
In [32] the authors provide the equation (2) to determine the filter L g connected to the inverter grid, using the following expression presented below.
In the above equation, the effective value of the fundamental voltage is represented by V RMS , the switching frequency is represented by f 0 , and the current variation in the inductor is represented by I .
The Eq. (1) can be represented in discrete form as presented in the Eq. (3) using the zero-order-hold (ZOH) with sampling time T without delay.
where A d ∼ = I + A i T , B d ∼ = B i T , and C d is the identity matrix I .
The inverter voltage can be assumed as v inv,αβ (k) ∼ = v inv,αβ (k + 1) ∼ = . . . ∼ = v inv,αβ (k + n y − 1) since the sampling time T is much smaller compared to the period of the grid.
The references i g,αRef and i g,βRef are the grid current vector in the fundamental frequency. They are provided by the (5) based on the P r , Q r references.

III. PREDICTIVE-REPETITIVE CONTROL TECHNIQUE
The Model Predictive Control (MPC) technique is based on the future states using a predictive mathematical model [33]. The control law uses a cost function to make the optimal decisions to achieve the reference signal, the controller uses other parameters or other constraints to take the decisions. In [29] the authors provide the steps to design a Repetitive Controller(RC) which is designed through an internal model principle. The polynomial D(z) is necessary to integrate in the system model in state-space representation. The merge between system model and the polynomial generates an expanded state-space model. After creating the expanded model it is added the MPC theory. Finally, the Repetitive Predictive Control (RPC) proposed in this paper is applied to inverter grid-connected and modeled by the fundamental frequency, but to evaluate the efficiency the tests were performed under distorted voltage.
The RPC is designed to follow the reference path and, therefore, using the principle of the internal model, the signal generator polynomial must be included in the transfer function denominator.

A. INTERNAL MODEL AND DISTURBANCE
Assuming that the plant to be controlled has p input and m output and considering the state space model below, where D(z) is given by the following equation, notice that the polynomial vector and the states vector should have the same size.
where l i is the index of the harmonic components and ω is the fundamental frequency of the signal to be followed. The plant model is composed of the matrices A m , B m , C m , using the matrices seen in (4) and can be seen below, the C m matrix is an identity matrix 2 × 2 due to the states of the systems being also the output. The disturbance µ(k) can be described by the time delay operator q −1 , therefore, D(q −1 )µ(k) = 0, and auxiliary variables obtained using the perturbation model were introduced.
Applying D(q −1 ) to (6), Now similar to the output, it can be obtained, isolating y(k + 1) then obtaining, Finally, the state space model of the plant and disturbance has a new state vector such as, (17) and the model is, where Denote that O is a vector n × 1 of zeros, used to adapt the dimensions of the matrices in systems with multi-variable plant. The same principle is used for the I identity matrices that are multiplied by the factors

B. REPETITIVE PREDICTIVE CONTROL (RPC) IN DISCRETE TIME
As the system in state-space model with the disturbance was obtained, the next step is to synthesize the filtered u s (k) signal control using the predictive model. Considering the sampling time k i > 0 and assuming that the states can be measured, the future control value can be written in vector form as; N c is the control horizon, which dictates the number of parameters used to capture the future trajectory of the control. Since x(k i ), the future state vector predicted in N p samples, where N p is the prediction horizon, it must be assumed that N c ≤ N p . Since x(k i + j|k i ), 1 ≤ j ≤ N p then, In this way, the control horizon is selected to be smaller than the prediction horizon, so the computational effort can be reduced. Thus it is assumed that before N c samples the filtered control u s (k i + k) is zero for all future samples (k ≥ N c ).
Using the state space model (18), the future state vector can be obtained by, being, The objective of the repetitive predictive controller is now to find the vector U s using the following cost equation, where Wx is a semi-defined positive symmetric diagonal block matrix, which weights the error in the state vector, and Wx is a defined positive symmetric matrix that weights the system control effort, this weight can be tuned using the approach presented in [34]. Therefore, substituting (24) in (27), Finally, abstaining from the system restrictions and algebraic manipulation, the optimal control vector can be obtained as, using the recent control horizon, the only component in U s corresponding to u s (k i ) is applied to the plant actuator as, meaning that it is; where it has both the optimal control u s (k i ) and its previous values.
When the control is used to follow a reference signal, it is necessary that the reference value is subtracted from the output value, thus creating an error vector like, This error signal should be inserted in place of the output elements in the state vector x(k i ) used in (24).
Finally, Figure 1 presents the text block of the predictive repetitive controller for the grid connected inverter.

IV. EXPERIMENTAL RESULTS
Several experiments were carried out in order to verify the effectiveness of the proposed controller and all tests were based on the system depicted in Figure 1. The experimental workbench consists of a Texas Instruments Digital Signal Processor (DSP) model TMS320F28335, electronic boards for the correct acquisition of the current (i) and voltage (v) variables and a Back-to-Back inverter of the model ''Semikron SKS20F (B6CI)2P + E1CIF + B6U 14V12'' connected to a distorted grid by means of inductive filters.
To recreate the distorted grid it was used a controllable electronic voltage source of the model FCATHQ 450-38-50-n55210 (which is in another experimental bank but connected to the presented test bank) connected to the inverter and besides that, the block in Figure 1 called ''Current estimator function'' was created using a Phase Locked Loop that is robust to harmonic distortions, like the one in [35], implementing it on the DSP mentioned above. Figure 2 shows the picture of the setup of the workstation, in this case there is an electrical contactor that is in charge of the connection between the inverter and the controllable electronic voltage source. The DSP unit is the one in charge of all the trigger signals on the inverter to make possible the power exchange, using Space Vector Modulation (SVM) at 20kHz as the switching technique and the same frequency for the sampling time. In order to implement the Predictive-Repetitive control algorithm described in the section III the chosen control and prediction horizon were N p = 3 and N c = 2, respectively.

A. NORMAL OPERATION
The first test to evaluate the controller under normal operation is a active power step change, from 500W to 750W . Figure 3 presents the dynamic response according to the degree and the current injected into the grid. It is noticed that in this test the grid voltage is only the fundamental harmonic in 60Hz with 110V of magnitude. The controller achieves the reference, the current increases from 2.2A to 3.1A according to the active power step change. In the following subsection approach, the controller is applied to the same system, however, the voltage is distorted.

B. VOLTAGE DISTORTED OPERATION
To test the proposed controller, one grid situation with a characteristic distortion was chosen, this consists of a grid that contains harmonic distortion in the 5th, 7th, 11th, 13th, 17th and 19th components, and it was inspired from [36]. The distortion values for each one of the components can be seen in Table 1. This grid distortion scenario was used to test different capabilities of the proposed controller, such VOLUME 10, 2022 as, general control behavior, step response time, harmonic suppression ability in the grid current and its corresponding THD evaluation. The optimal control behavior expected from the proposed controller is to track controlled variables over their references at various operating points along the time, which is shown in Figure 4. The test was developed using the distorted grid described in Table 1, and in a summary, this test varies the power references from 0var to −300var, and vice versa for ''Q'' and from 500W to 750W and vice versa for ''P,'' in this way, 4 operating points are obtained, the points ''P1, P2, P3 and P4'' which are shown below: P1 : (Q = 0var, P = 500W ); P2 : (Q = 0var, P = 750W ); P3 : (Q = −300var, P = 500W ); P4 : (Q = −300var, P = 750W ).
As this implementation is for current control, the reference values of the currents i αRef , i βRef are calculated using the (33), where the power references of the points P1, P2, P3 and P4 are used to obtain the current references and they can be seen in Figure 5.  Figure 4, it can be seen that both the active and reactive power references are tracked accurately by the proposed controller. However, less ripple and better tracking in the active power is highly notable when compared to reactive power.

Now observing
On other hand, another good information about the capabilities of the proposed controller can be extracted from this general behavior, and these are the step response times for the control of the active (P) and reactive (Q) power. The zoomed view of Figure 4 at the points where the step change occurs, are shown in Figures 6 and 7. Step response time of the active power P. Figure 6 shows the zoom of the active power step change from P = 500W to P = 750W , while reactive power is kept at Q = 0var and it is observed a response without an overshoot and the settling time is equal to 1.8ms, approximately. Second, Figure 7 shows the zoom for the reactive power while the step change from Q = −300var to Q = 0var is happening and the active power remains at P = 500W , this time the settling time observed is 1.5ms and also no overshoot is happening.
Continuing with the tests of this Predictive-Repetitive controller capabilities, other kind of figures are shown. These are Step response time of the reactive power Q.
the Figures 8 and 9 that show the behavior of the grid current and voltage α for the stationary frame αβ (v α , i α ), while the powers (P, Q) change. According to the power references and using the equation (33) a new current reference is provided. This new current reference is being controlled and tracked when the power step changes. Figure 8 depicts the active power and Figure 9 depicts the reactive power. In the case of Figure 8, the distorted voltage v α and current i α can be observed while the active power P is changing from 500W to 750W . It can be seen that in the left side, the grid current has a value (i α = 2.2A) that corresponds to 500W of active power, and right after the step change of the power to 750W the amplitude of the grid current also increases, as expected and documented in [37] for the grid side inverter. Figure 9, shows the behavior of the grid current (i α ) while there is a step change in the reactive power (Q) from −300var to 0var. In this case, it happens something similar to the first case, on the left side of the reactive power step exists a grid current value (i α = 2.4A) and right after the variation this current changes to another value (i α = 2.2A). It is important to note that in this case there is not just the amplitude of the current changes but also the phase. This is because the grid current changes amplitude and phase as the function of the power that is expected to be delivered or consumed.
The most important observation that must be made and the focus of this research is the behavior and waveform of the grid current during its operation under distorted voltage. In both Figures 8 and 9 the distorted voltage v α with THD of 4, 51% can be seen clearly, however, the grid current remains sinusoidal with THDi of 1.82% due to Predictive-Repetitive controller that calculates the reference values for the currents through the power reference values and rejects the disturbances injected to the system by the grid to achieve an optimal current control even under distorted voltage.
Indeed, this sinusoidal grid current under distorted voltage is the reason for the ripple present in both active and reactive power (P, Q), in this sense, these ripples are the trade off, that the system pays to maintain a sinusoidal current in the grid under distorted grid voltage conditions.
As last, it is important to give a quality measurement of the implemented controller. In this case, the THDi of the grid current plays an important role, because it is the best quality indicator used for these disturbed systems, so Figure 10 is presented with a THDi value of 1.82% in the grid current, which means that the controller can maintain the grid current at acceptable levels of distortion (1.82%) even when voltage is clearly distorted with all the distorted components. These results demonstrate the effectiveness of the controller.

C. CONTROLLER COMPARISON TEST
A performance comparison was made between the proposed controller and the controllers commonly reported in the literature, such as FCS. However, FCS is a predictive controller that focuses on minimizing a cost function with the future values of the control variables and obtains the voltage vector, which provides the lowest cost.
The results below show the comparison between the controller proposed in this article and the controllers already reported in the literature. In order to make a fair comparison, VOLUME 10, 2022 the FCS used here uses a three-vector algorithm to solve the variable switching frequency problem that exists in conventional FCS [38]. Figures 11 and 12 show the two controllers as a function of active power steps in normal operation, that is, without distortion in the grid voltage. The results were obtained from the points provided in the bench tests through the.CSV files. It is remarkable that all controllers are capable of changing the amplitude of the injected current as a function of the active power step. However, the controllers have different rise times and higher oscillations around the reference, which results in a higher THD in the injected current. Table 2 presents the THD values and rise time of each controller.  The next tests, they were also carried out using an active power step, but under distorted grid voltage with the harmonics presented in the Table 1.  Tests with distorted voltage present more oscillations in power due to the fact that power is the product of voltage and current and as the voltage is distorted, this reflects in  the power signal. However, even under distorted grid voltage, the backup controller provides the lowest THD in comparison with FCS controllers. The Table 3 also presents the THD and rise time values for each controller to illustrate the difference between the controllers. This highlights the fact that the FCS is unable to reject the distortion provided by the grid voltage.

D. ROBUSTNESS TEST
To evaluate the robustness of the proposed controllers, the same test performed in Figure 8 was repeated, but now the inductance filter was replaced by an inductance with the value 13.2mH and maintain the same gains, the gains are related to the matrices Wy and Wu from (29), of the controller. This represents a reduction of the filter by 40% compared to the old value 22mH presented in the previous tests. Figure 15 presents the dynamic response of the system, the controller input is the active power degree from 500W to 750W .
Notice that the controller is capable to achieve the reference and provides a sinusoidal current signal as expected. Figure 16 presents the THDi of the new test, the value is 4.24% which is still under the limit values stipulated in IEEE Std 1547. 2-2008 [39].
It is possible to conclude that even under the same gains for the controller, which was tuned for the specific 22mH filter, with a variation of inductance of 40%, the RPC is capable to achieve the reference and delivery a quality current output as stipulated in the IEEE standard. However, if it is necessary to reduce the THDi, new gains should be used for the RPC according to the new inductance value.

V. CONCLUSION
The RPC presented in this paper is applied to the current control of the grid-connected inverter. The proposed controller has good performance in harmonic suppression where the grid voltage is distorted. The expansion of the grid model is necessary to incorporate the D(z) polynomial, which represents the repetitive part of the control system, and after design D(z), the optimization of the cost function is added to represent the predictive part of the system. All experiments were performed with the RPC designed with the relevant parameters shown in Table 4, producing satisfactory result relating the harmonic content in the grid with 1.82% of THD value, the rising time for degree transition is under 2ms with no overshoot, it maintains consistent performance under different scenarios demonstrating effective harmonic suppression on the grid in accordance with the requirements of the IEEE Std 1547.2-2008 [39].
There are some drawbacks and limitations of the RPC. As it is a predictive type controller, depending on the chosen horizons, whether prediction or control, there is an increase in the computational effort needed to perform the calculation of the gains. Another disadvantage that should be highlighted is the fact that the choice of Wu and Wy matrices, as they are directly linked to the controller performance. In the presented research the values for these matrices are heuristically chosen and in future works, it is expected to determine these values via analytical methods similar to [34].
Finally, regardless of the controller's limitations, it presented itself as a viable solution for systems with inverters connected to the electrical grid to suppress harmonics under distorted grid voltage. APPENDIX See Table 4.