Application of Repetitive Control in Electric Spring

With the increasing of the grid-connected capacity of renewable energy such as wind energy and solar energy, its instability, intermittence and uncontrollability have a serious impact on the stable operation of power system, such as voltage fluctuation, frequency flicker, etc. Therefore, Electric Spring (ES) system has become a current research hotspot. Aiming at the deficiencies of the resonance control strategy, a control method that combines quasi-proportional resonance (QPR) control and repetitive control is proposed. The quasi proportional resonance control is used to realize the tracking without static error, and the internal model principle of repetitive control is used to suppress the periodic disturbance of the grid voltage, so as to improve the power quality of the grid. Compared with the traditional quasi proportional resonant control, the introduction of repetitive control can effectively improve the steady-state accuracy, reduce the system harmonic and enhance the ability of anti-harmonic interference. The modeling of ES and the design method of repetitive controller parameters are discussed in detail. The simulation model is built using MATLAB / Simulink, and the ES experimental platform is built with dSPACE as the control core, the results verify the feasibility and effectiveness of the proposed control strategy.


I. INTRODUCTION
Nowadays, there is a considerable amount of power contribution from renewable energy sources like wind and solar to meet our daily needs. With the increase of grid-connected capacity of renewable energy generation year by year, its instability, intermission and uncontrollable have brought serious impact on the stable operation of the power system, such as voltage fluctuation, harmonic pollution, frequency flicker, etc., resulting in the decline of power quality [1]- [3]. For those problems, Electric Spring (ES) system has become a current research hotspot. ES can not only compensate reactive power but also active power; when the voltage fluctuates, it can transfer the voltage (energy) fluctuation of critical load (CL) to non-critical load (NCL) in the grid, so as to stabilize CL voltage and reduce CL voltage distortion; it can automatically adjust the power consumption of NCL to achieve a dynamic balance between self-generation and power consumption.
At present, the existing control method of power spring is to control the effective value and phase of the critical load voltage respectively, but it is easy to introduce The associate editor coordinating the review of this manuscript and approving it for publication was Fabio Massaro . grid harmonics. Yan et al. proposed the dq0 decoupling control method in [4], which converts the current variable in the system into dq0 coordinate system, and uses a proportional integral (PI) controller to control the d and q axis currents respectively. This control method can simultaneously control the power factor angle of smart load (SL) and the stability of CL voltage, but there is a coupling problem. Based on the radial-chord decomposition (RCD) technique, the voltage of the ES is divided into two components of radial and chord [5]. The former is responsible for voltage control, and the latter performs the power factor correction in the open-loop manner. The radial component is set to be in phase with NCL that makes it impossible to control active and reactive power, independently. Parag et al. based on PI control mode proposed to use multi-resonance controller and second-order generalized integrator to suppress harmonics, and to stabilize CL voltage through double closed-loop control, but the power grid voltage disturbance is ignored [6]. Cheng et al. considered the disturbance of power grid voltage, proposed a control strategy combining quasi-proportional resonant (QPR) controller with power grid voltage feed-forward in [7] to eliminate harmonic pollution. However, obtaining controller parameters according to pole placement method requires a large number of formulas and calculations, which increases the amount of calculation. Wang et al. proposed a phase control method in [8], in which the QPR controller is used to control the CL voltage as the outer loop, and the proportional (P) controller is used to control the inductance current as the inner loop. This control method simplifies the complex control system, but depends on circuit parameters.
The PI control algorithm is simple and its parameter is easy to design, which is the most widely used control strategy at present [9], [10]. However, PI control cannot achieve static error-free tracking of AC signals, and its dynamic response time and overshoot cannot reach optimal values at the same time. The QPR control can track AC signal without static error by using the high gain at the resonant frequency, but it cannot suppress the periodic disturbance [11], [12]. The deadbeat control has good dynamic performance, but it requires high precision of the system mathematical model. When the mathematical model is different from the actual object, it not only fails to achieve good control effect, but also reduces the output performance and endangers the safe operation of the converter [13]. Compared with other controllers, repetitive control has the following advantages: its repeatability can be used to achieve harmonic suppression of periodic interference signals [14], [15]; it has good steady-state performance, and can theoretically realize no static error tracking [16]. However, its dynamic performance and performance in suppressing non-periodic interference are not good.
To solve the above problems, based on the phase control algorithm, this paper proposes a compound control strategy that combines quasi-proportional resonance control and repetitive control, which not only ensures dynamic performance, but also improves the steady-state tracking performance and anti-harmonic interference performance.

II. ELECTRIC SPRING THEORY A. OPERATING PRINCIPLE OF THE ES
The typical application topology of ES is shown in Fig. 1. The ES is connected in series with a non-critical load Z 3 to form a smart load(SL) can provide voltage support at the point of common coupling (PCC) and can continuously adapt to the intermittent renewable generation. During normal operation i.e. whenever the generation in the micro grid is sufficient, ES will not operate and full rated value of voltage is applied to the non-critical loads by closing the switch 'S' shown in Fig. 1. Whenever there is a necessity to suppress the voltage being applied to the non-critical load the switch 'S' is made open and the spring is made active. The ES is operated only if there is any uncertainty in power produced by the renewable generators present in the micro grid. At this moment, ES acts like a voltage source and now the voltage across the non-critical load V 0 is the difference in voltage at the PCC and voltage appearing across the filter capacitor V ES . The ES by providing voltage support to the system also reduces the voltage being applied to the NCL which in turn reduces the real power consumption at the PCC.
According to Norton's equivalent principle, the ES system is modeled and the S-domain expression of the critical load voltage V S is obtained: where If there is no controller, the open loop transfer function from reference to output is expressed as: where K pwm is the ratio of the inverter DC side voltage V dc to the carrier amplitude V tri . It can be seen from (2) that ES system is a dual-input single-output system, which is difficult to control. In actual control, the output voltage V i of the inverter bridge can be regarded as the control quantity, and the grid voltage V G as the disturbance quantity. Different compensation modes of ES are determined by the phase angle between i ES and V ES . i ES is the vector of ES current, which equals to the current i 3 flowing through the NCL. Pure reactive power compensation means the phase angle between i ES and V ES always keeps 90 • , either leading or lagging. Thus, a circle can be depicted as shown in Fig. 2. When the V G does not fluctuate, the voltage of electric V ES is zero. The grid voltage at this time is defined as the reference value, and the ES operates at resistive mode. When V G is lower than the reference value, by adjusting the filter capacitor current i C , the V ES lags i 3 by 90 • . So that ES can provide capacitive reactive power to improve CL voltage V S , making it stable near the expected value and meaning that ES operates at capacitive mode. Moreover, When V G is higher than the reference value, the ES operates to decreases the CL voltage V S to its expected value, V ES is 90 • leading to the current i 3 , which means that ES operates at inductive mode.

B. EXISTING CONTROL STRATEGY OF THE ES
Double closed-loop control is used in the existing control, as shown in Fig. 3 The outer-loop adopts QPR controller, in which the critical load voltage is controlled to follow a sinusoidal reference,  and the inner-loop adopts the P controller, which uses the i L as the feedback variable to modify the output of the voltage controller [8].
The transfer function of the QPR controller is: where k p and k r are the proportional coefficient and resonant coefficient, respectively. ω c is the cutoff frequency for the resonant main bandwidth control. ω 0 is the resonant frequency and ω 0 = 100 πrad/s. The QPR controller can achieve high gain, zero steady-state error tracking and a wide bandwidth near the resonant frequency. However, the discrete process of QPR controller mostly adopts the realization method of bilinear transformation digital signal processor (DSP). As the number of harmonics increases, such as the 3rd, 5th, 7th and other harmonics need to be compensated at the same time, in order to reduce the grid harmonic pollution, it is necessary to introduce a corresponding number of resonance compensators, as shown in Fig. 4, which increases the computational complexity of the digital signal processor. Furthermore, in order to ensure the stability of the current loop, the harmonic order that the harmonic compensator can suppress is limited by the bandwidth of the current loop [17]- [19].
In the Fig. 4, R(z), Y(z), E(z), and D(z) represent the reference input, system output, tracking error, and periodic harmonic disturbance respectively. G o (z) is the open loop transfer function of the control object.
In [8], the controller parameters are selected by experience, and then the parameters are verified by bode dia- gram. The final controller parameters and circuit parameters are list in Table 1.

III. PROPOSED CONTEOL STRATEGY OF THE ES
Aiming at the above defects of QPR control harmonic compensation; this paper proposes that, on the basis of QPR control, a repetitive controller is introduced to eliminate harmonic interference of power grid. The repetitive controller is mathematically equivalent to a combination of an integral term, a proportional term, and countless resonant controllers. Applying the repetitive controller to the power spring system can well eliminate the repetitive distortion caused by the 3rd, 5th, 7th and other harmonics, which not only simplifies the calculation of the digital signal processor, but also improve the control effect.

A. PRINCIPLE OF REPETITIVE CONTROLLER
The repetitive controller based on the theory of internal model produces correction signal based on the control error of the last cycle to eliminate the error in the latter cycle. QPR and VOLUME 8, 2020  repetitive control work together to suppress harmonic control block diagram, as shown in Fig. 5.
The dashed frame is the repeat controller. The filter Q(z) is used to improve the internal model; z −N is a periodic delay control link; C(z) is the compensator, which is used to provide amplitude compensation and phase compensation. The internal model of the repetitive controller is: where N is the sampling number in a fundamental period, and Q(z) should have low-pass characteristics to suppress periodic interference. The closed-loop transfer function of the repetitive control system in Fig. 5 is: According to the stability theory of discrete system, the system is stable when the root of characteristic equation is less than 1: where: Equation (8) is drawn as the system stability vector analysis diagram shown in Fig. 6. As long as the trajectory formed at the top of C(z)G o (z) vector is always included in the unit circle, the system meets the stability condition. When Q(z) = 1, the system is in a critically stable state. Considering the steady-state margin, Q(z) is usually designed as a constant less than 1, or a low-pass filter (LPF) with gain less than 1. Since the phase of the LPF changes with frequency, phase compensation needs to be added. Therefore, Q(z) is designed to be a constant less than 1.
The compensator C(z) makes the compensated control object have the characteristics of zero phase shift and zero gain. There are two common design schemes for C(Z): One is the finite impulse response (FIR) digital filter, which has a linear phase shift characteristic and can accurately compensate the phase delay. But there is no ready-made design formula for FIR filter. Another solution is a combination of a second-order low-pass filter and a zero-phase shift notch filter. The second-order low-pass filter is used to attenuate the high frequency band, and the zero-phase shift notch filter is used to offset the resonance spikes. The combination of the two filters can obtain ideal mid-and high-frequency attenuation characteristics. Therefore, the design of the compensator adopts the second scheme.

B. PERFORMANCE ANALYSIS OF REPETITIVE CONTROLLER
The transfer function from disturbance signal to error signal in Fig. 5 is: When Q(z) = 1, if the disturbance signal is the harmonic form of the input signal, i.e., z −N = 1, the error caused by the disturbance signal is zero. It is shown that the ideal repetitive controller can completely suppress the periodic disturbance whose frequency is equal to an integer multiple of the reference signal.
When Q(z)<1, the disturbance signal in the form of harmonic cannot be eliminated, but the error can be attenuated to the original |1 − Q(z)|/|1 − [Q(z) − C(z)G o (z)]| times, which indicates that the harmonic suppression characteristics become better after repetitive control is introduced. The closer that Q(z) value is to 1, the stronger the disturbance suppression ability is.
The relationship between steady-state error and reference signal, disturbance signal in Fig. 5 is: Take absolute value on both sides: It can be seen from (11) that when the system is stable, the tracking error and disturbance error can be attenuated to the original |1-Q(z)|/|1-[Q(z)-C(z)Go(z)]| times, which shows that the steady-state tracking performance of the system is improved after adding the repetitive controller [20]- [22].

C. PARAMETER DESIGN OF REPETITIVE CONTROLLER
The quality of the repetitive controller depends on Q(Z), C(Z), and the relationship between various parameters should be considered comprehensively in the design.

Substituting circuit parameters into (3), the open-loop transfer function from CL voltage to reference voltage is:
G o (s) = 3.046e 9 s + 1.269e 11 s 3 + 1351.842s 2 + 1.462e 7 s + 6.095e 9 (12) When the sampling frequency is 40 kHz, the zero-order holder is used to discretize (12): Fig. 7 is the bode diagram of G o (z). In the figure, G 0 (z) has a resonant peak at the resonant frequency f 0 = 589Hz, the peak value reaches 65.9dB, and the phase lags rapidly after the resonant frequency.

2) DESIGN OF Z −N AND Q(Z)
The function of z −N is to delay the control command for one cycle. In this paper, the sampling frequency is 40 kHz and the fundamental frequency of output voltage is 50Hz, then N = 40000 / 50 = 800. In order to improve the stability of the system, Q(z) is added to the internal model, which is taken as 0.95 according to engineering experience.

3) DESIGN OF COMPENSATOR C(Z)
Based on the frequency response characteristics of the controlled object G o (z), C(z) is divided into phase compensation and amplitude compensation: where K r is the repetitive control gain; z k is the phase compensator; S 1 (z) is the zero-phase shift notch filter, and S 2 (z) is the second-order low-pass filter. 1) K r is the quality factor used to improve the internal model critical stability characteristics of repetitive controller, and the value range is (0-1). Under the premise of ensuring the stability of the system, the value should be as close as possible to 1. In this paper, the K r = 0.98. 2) The function of S 1 (z) is to eliminate the resonance peak of G o (z) in Fig. 7 by using its zero phase shift characteristic. The expression is as follows: According to the relationship between z-domain and frequency-domain z = e iwT = e jθ (T is the sampling time): where m determines the notch frequency. Since the first attenuation point of the notch filter has the largest attenuation range, it is designed to cancel with f 0 = 589 ≈ 600Hz, then: Fig. 8 shows the frequency characteristics of S 1 (z), which can attenuate the resonance peak to the maximum extent, and no phase compensation. 3) S 2 (z) is used to attenuate the amplitude above the cut-off frequency, so as to eliminate the high-order harmonics. According to the system compensation requirements, 600Hz is taken as the cut-off frequency. In order to prevent oscillation, the damping ratio is taken as 1.2. S 2 (s) is:  The sampling frequency is 40 kHz, and the zero-order holder is used to discretize (19): Fig. 9 is a comparison chart before and after correction. It can be seen that after compensating S 1 (z) and S 2 (z) at the same time, the high-frequency gain decreases rapidly and the resonance peak is attenuated. 4) It can be seen from Fig. 7 and 9 that G o (z) and S 2 (z) have phase lag, which makes the system unable to track accurately. Therefore, the phase leading function z k with zero gain amplitude is selected for phase compensation, and the leading step k=16. Fig. 10 shows the frequency characteristics of G o (z)S 2 (z) and z 16 at different frequencies. It can be seen from Fig. 10 that the phase compensation error of G o (z)S 2 (z) and z 16 in the middle and low frequency band is small, and the leading link can provide phase compensation to make the system tend to zero phase; in the high frequency band, the phase compensation is excessive, but the amplitude attenuation amplitude in the high frequency band is relatively large, and the impact is small, so the phase in the high frequency band is not considered.

IV. SIMULATION RESULTS
To verify the aforementioned analytical discussion a detailed simulation study is carried out in MATLAB/SIMULIINK environment using SIMPOWERSYSTEM block-sets. The off-line model of electric spring based on quasi proportional resonance and repetitive control is shown in Fig. 11, whereas the system parameters are shown in Table 1.
V S is the transient voltage of the critical load, V S−fb is the feedback voltage sensed from V S multiplied by a coefficient k vf (e.g., 1). Signal V Sref is the predefined sinusoidal reference of which the magnitude is given as needed and phase lags V G by δ. The voltage error is used to generate reference of current loop via the QPR parallel repetitive controller. The feedback i L_ fb is sensed from inductor current i L , just multiplied by a coefficient k if (e.g., 0.5). The current error is used to generate the modulation signal via the P controller and a limiter. Through the combination of modulation signal and triangular carrier signal, the pulse signal which changes according to the sinusoidal law is generated to control the power switch on and off, and convert DC to AC. After LC filtering, the ES current i C is output. By adjusting the i C , the output voltage of ES lags behind the current i 3 of NCL by 90 • so that ES can provide capacitive or inductive reactive power and stabilize V S .
Under the parameter settings in Table 1, it can be calculated that the effective voltage range that ES can achieve pure reactive power compensation is 192V≤ V G ≤ 267V. When V ES = 0, V G = 243.7V, ES works in resistive mode. 192V and 267V are the minimum operating voltage of capacitive mode and the maximum operating voltage of inductive mode respectively. We choose the grid voltages of 190V and 280V beyond the effective range to observe the changes in the ES working state under the control strategy combining QPR and repetitive control, as shown in Fig. 12.
In Fig. 12(a) and (b), we observe the phase difference between the voltage measured on the third channel and the fourth channel exceeds 90 • , it means that the ES at this time also emits(or absorbs) some active power on the basis of the capacitive state(or inductive state). In addition, we also noticed that as the absolute value of the grid voltage deviation from the effective voltage range increases, the effective value of the NCL voltage also increases. Although the allowable voltage range of NCL is relatively wide, the maximum allowable operating voltage range should be paid attention to during actual operation. Therefore, in order to ensure the safe operation of the entire ES system, a safety range must also be set. When the grid voltage exceeds this range, CL and NCL must be automatically cut off.

A. STEADY STATE TRACKING PERFORMANCE
On the basis of the effective value of the grid voltage V G of 192V (the amplitude is 272V), some harmonic content is added. The order and magnitude of the harmonic components of the grid voltages are set as follows: 3rd, 5th and 7th, with magnitude of 12%, 6% and 3% of the grid voltage respectively. We observed the waveforms of CL voltage (V S ) and voltage tracking error (e u ), as shown in Fig. 13.
It can be seen from Fig. 13 that the amplitude of e u is 30.17V under the QPR + P double closed-loop control, and it drops to 14.92V after adding repeated control. Under the two control strategies, the waveform of CL voltage is sine wave, and the effective value is stable around 220V. The results show that the introduction of repetitive control makes the system have higher steady-state accuracy.

B. HARMONIC SUPPRESSION PERFORMANCE
In order to further verify the harmonic suppression performance of the proposed control strategy, we observed the total harmonic distortion (THD) of the CL voltage. Fig. 14 shows that the THD of the CL voltage is 10.16% under the QPR+P control, but after adding a repetitive controller, it is reduced to 2.56%, which meets the IEEE std.929-2000 standard. It is proved that the proposed control strategy has strong anti-harmonic interference ability.

C. DYNAMIC PERFORMANCE
The initial value of grid voltage is set as 243.7V, which drops to 192V at 0.2s and rises to 267V at 0.4s. We observed the dynamic waveforms, as shown in Fig. 15.  It can be seen from channel 2 of Fig. 15(a) and (b) that the root mean square (RMS) values of the CL voltages are regulated at 220V, maintaining the stability of the CL voltage.
In Fig. 15, during 0.15s-0.2s, V G is 243.7V, the RMS value of the ES voltages drops nearly to zero, meaning that ES operates in resistive mode; during 0.2s-0.4s, V G is 192V, the V ES lags V 0 by 90 • after entering the steady state, meaning that ES operates in capacitive mode; during 0.4s-0.6s, V G is 267V, the V ES leads V 0 by 90 • , ES operates in inductive mode. The analysis shows that the simulation results of the two control strategies are consistent with the theoretical analysis results of the ES working mode.
When the V G is switched to 267V, under the control of QPR + P, after 5-6 cycles, ES is adjusted to inductive mode, VOLUME 8, 2020  as shown in Fig. 15(a). However, after adding the repeat controller, it takes 7-8 cycles, as shown in Fig. 15(b).

V. EXPERIMENTAL RESULTS
In order to verify the effectiveness of the composite control strategy combining quasi-proportional resonance and repetitive control proposed in this paper, dSPACE is used as the control core with corresponding peripheral circuits to build ES system experimental platform, as shown in Fig. 16.  The main circuit parameters are the same as table I. Due to the limitation of oscilloscope output amplitude, the amplitude of output waveform is reduced by 31 times.

A. STEADY STATE TRACKING PERFORMANCE
On the basis of the effective value of the grid voltage V G of 192V (the amplitude is 272V), some harmonic content is added. The order and magnitude of the harmonic components of the grid voltages are set as follows: 3rd, 5th and 7th, with magnitude of 12%, 6% and 3% of the grid voltage respectively. We observed the e u , as shown in Fig. 17.
It can be seen from Fig. 17 that the amplitude of e u is 1000mV under the QPR + P control, and it drops to 500mV after adding repeated control. The introduction of repetitive controllers can improve the steady-state accuracy.

B. HARMONIC SUPPRESSION PERFORMANCE
Then, we further observed the experimental waveform of CL voltage and the THD, as shown in Fig. 18 and 19.  It can be seen that the THD of the CL voltage is 6.14% under the QPR +P double closed-loop control, but after adding a repetitive controller, it is reduced to 1.57%, which shows that the introduction of the repeated controller can weaken the grid voltage disturbance and improve the anti-harmonic interference ability.

C. DYNAMIC PERFORMANCE
When V G = 192V, ES works in capacitive state, and V G = 267V, ES works in inductive state. Therefore, the dynamic switching process of capacitive and inductive modes is observed by switching between the two input voltages.
It can be seen from Fig. 20 and 21 that the experimental results are similar to the simulated results. When V G = 192V, V ES of channel 3 lags V 0 of channel 4 by 90 • , and ES works in capacitive mode; when V G = 267V, V ES leads V 0 by 90 • , and ES works in induction mode; When the grid voltage is switched to 267V, under the control of QPR+P, after 4-5 cycles, ES is adjusted to inductive mode, as shown in Fig. 21(a). However, after adding the repeat controller, it takes 8-9 cycles, as shown in Fig. 21(b).

VI. CONCLUSION
In view of the shortcomings of QPR control harmonic compensation, ES system and related technologies were studied, and a repetitive control improvement scheme based on double closed-loop control was proposed. On the basis of simulation, an experimental platform based on dSPACE was built, and the following conclusions were drawn: 1) The controller designed in this paper can achieve the following goals: One is that the critical load voltage can accurately track the given value and transfer the fluctuation of grid voltage to non-critical load; the other is that ES can automatically work in capacitive, resistive and inductive modes with the change of grid voltage.
2) After introducing the repetitive controller, the steadystate tracking error of the critical load voltage is 500mV. Compared with the original QPR+P control steady-state tracking error of 1000mV, the steady-state tracking capability has been improved.
3) Using a control strategy that combines QPR and repeated control, the total harmonic distortion of the critical VOLUME 8, 2020 load voltage is reduced from 6.14% to 1.57%, and the distortion of the critical load voltage waveform is improved. The introduction of the repetitive controller can effectively improve the anti-harmonic interference ability of the system on the basis of ensuring the good dynamic performance of the system. 4) ES has a wide application prospect, but the related research is still in its infancy, and many problems need to be further studied.