As the integration of renewable energy sources into the power grid accelerates, the number of solar inverters connected to the distribution network has grown significantly. While solar inverters are primarily designed for photovoltaic (PV) energy conversion, their power electronic topology is inherently similar to that of active power filters (APFs). This similarity has motivated the development of multifunctional solar inverters that can simultaneously inject active power from the PV array and compensate for harmonic currents produced by nonlinear loads. The key challenge lies in achieving fast and accurate tracking of both the fundamental active current and multiple harmonic components, especially under dynamic load changes. Traditional methods, such as using only a proportional‑integral (PI) controller in a synchronous rotating frame, suffer from limited bandwidth and cannot eliminate steady‑state errors for harmonic frequencies. On the other hand, repetitive control offers excellent steady‑state tracking for periodic signals, but its dynamic response is inherently slowed by one fundamental period delay. In this work, I propose an improved control scheme that combines a PI controller, a repetitive controller, and a feed‑forward path based on zero‑phase‑error tracking. The PI controller handles the fundamental component, the repetitive controller suppresses multiple harmonics, and the feed‑forward path accelerates the transient response by bypassing the delay of the repetitive controller. I design a compensator for the LCL filter to ensure stability and uniform gain at low frequencies while attenuating high‑frequency resonances. Simulation results demonstrate that the proposed method achieves lower total harmonic distortion (THD) and faster dynamic response compared to conventional PI or PI‑plus‑repetitive control.

The remainder of this article is organized as follows. Section 2 presents the system model of a grid‑connected solar inverter with an LCL filter. Section 3 details the design of the proposed repetitive controller and the compensator, followed by the improved control structure with feed‑forward. Section 4 provides comprehensive simulation results and comparisons. Section 5 concludes the work.
System Modeling of the Solar Inverter
Consider a three‑phase solar inverter connected to the grid through an LCL filter. The inverter bridge generates a PWM voltage \(u_a\), which is filtered by the inductors \(L_1\) (inverter‑side), \(L_2\) (grid‑side), and capacitor \(C\). The parasitic resistances are denoted as \(R_1\), \(R_C\), and \(R_2\). Typically, \(R_1\) and \(R_2\) are small and can be neglected for the transfer function derivation. The transfer function from the inverter output voltage to the grid current \(i_2\) is given by:
$$ G(s) = \frac{R_C C s + 1}{L_1 L_2 C s^3 + (L_1+L_2) R_C C s^2 + (L_1+L_2) s} $$
This LCL filter introduces a resonant peak at the frequency:
$$ \omega_0 = \sqrt{\frac{L_1+L_2}{L_1 L_2 C}} $$
Table 1 summarises the key parameters used in this work.
| Parameter | Symbol | Value |
|---|---|---|
| Grid voltage (RMS, line‑to‑line) | \(V_g\) | 380 V |
| Grid frequency | \(f_0\) | 50 Hz |
| Inverter‑side inductor | \(L_1\) | 0.74 mH |
| Grid‑side inductor | \(L_2\) | 55 μH |
| Filter capacitor | \(C\) | 6.6 μF |
| Capacitor damping resistor | \(R_C\) | 0.5 Ω |
| Resonant frequency | \(f_0\) | 866 Hz |
| Sampling / switching frequency | \(f_s\) | 20 kHz |
| PV array rated power | \(P_{PV}\) | 8 kW |
| Linear load (per phase) | \(R_L\) | 5 Ω |
| Non‑linear load (three‑phase rectifier) | \(R_d\), \(L_d\) | 30 Ω, 2 mH |
The uncompensated LCL filter has a sharp resonance peak that must be suppressed to ensure closed‑loop stability. In the next section, I design a compensator that shapes the frequency response of the plant \(G(s)\) so that it behaves like a uniform‑gain, zero‑phase‑shift system up to several hundred hertz.
Design of the Repetitive Controller and Compensator
Repetitive Control Internal Model
Repetitive control is based on the internal model principle. For periodic disturbances with fundamental period \(T_0 = 20\) ms, the internal model in the discrete‑time domain is:
$$ G_R(z) = \frac{1}{1 – Q(z) z^{-N}} $$
where \(N = f_s / f_0 = 400\) is the number of samples per fundamental period, and \(Q(z)\) is a low‑pass filter (or a constant slightly less than unity) to improve robustness. In this work, I choose \(Q(z) = 0.95\), which provides a gain of about 26 dB at all harmonic frequencies while avoiding infinite gain that would cause instability.
Compensator Design for the LCL Plant
The repetitive controller must be cascaded with a compensator \(S(z)\) that corrects the magnitude and phase of the plant \(G(z)\). The compensator consists of three parts:
- Inertial differentiator \(D(s)\): to cancel the low‑frequency integrator effect of the LCL filter
- Notch filter \(F_n(s)\): to suppress the resonant peak at \(\omega_0\)
- Second‑order low‑pass filter \(F_2(s)\): to attenuate high‑frequency gain
The continuous‑time expressions are:
$$ D(s) = \frac{L_1 s}{\tau s + 1}, \quad \tau = \frac{1}{\omega_0} $$
$$ F_n(s) = \frac{s^2 + \omega_0^2}{s^2 + 2\xi \omega_0 s + \omega_0^2}, \quad \xi = 0.707 $$
$$ F_2(s) = \frac{\omega_0^2}{s^2 + 2\xi \omega_0 s + \omega_0^2} $$
After discretizing these filters with the sampling time \(T_s = 1/f_s\), the overall compensator is:
$$ S(z) = D(z) \cdot F_n(z) \cdot F_2(z) \cdot z^k $$
The lead term \(z^k\) compensates for the phase lag introduced by the filters. Through frequency‑domain analysis, I determine \(k = 2\) samples (i.e., 2/20000 = 0.1 ms) to achieve nearly zero phase error up to 1 kHz. Table 2 shows the compensated plant gain and phase at selected harmonic frequencies.
| Frequency (Hz) | Magnitude (dB) | Phase (°) |
|---|---|---|
| 50 | 0.02 | 0.1 |
| 250 (5th) | 0.05 | 0.3 |
| 350 (7th) | 0.08 | 0.5 |
| 550 (11th) | 0.12 | 0.8 |
| 650 (13th) | 0.15 | 1.1 |
| 850 (17th) | 0.20 | 1.6 |
| 950 (19th) | 0.23 | 2.0 |
The compensated plant exhibits a magnitude deviation less than 0.25 dB and phase error less than 2° for harmonics up to the 19th order, which guarantees accurate tracking.
Proposed Improved PI + Repetitive Control
The classical PI + repetitive control structure is shown in Figure 2 of the original paper (not reproduced here). The transfer function of the combined controller is:
$$ C(s) = k_p + \frac{k_i}{s} + \frac{1}{1 – 0.95 e^{-T_0 s}} $$
While the PI part quickly tracks the fundamental component in the synchronous d‑q frame, the repetitive part handles all harmonic references simultaneously. However, during the first period after a load change, the repetitive controller output remains unchanged, leaving only the PI controller to suppress harmonics. Since the PI controller has limited ability to track non‑fundamental components, the dynamic response is poor.
To overcome this delay, I add a feed‑forward path for the harmonic current references, as depicted conceptually in Figure 5 of the original paper. The improved structure is:
- Extract harmonic reference currents \(i_{hdq}\) using the instantaneous reactive power theory.
- Compensate the phase lag of the subsequent filters by applying a phase advance \(\theta_k\) before the dq‑to‑abc transformation. The phase advance is derived from the lead factor \(k\):
$$ \theta_k = \frac{2k\pi f_0}{f_s} = \frac{2 \times 2 \times \pi \times 50}{20000} = 0.0314 \text{ rad} $$
The feed‑forward harmonic reference is then added after the PI output and before the repetitive controller output. This allows the inverter to respond to harmonic components within the same sampling period, drastically reducing the settling time.
The complete discrete‑time implementation of the proposed controller is summarized in Table 3.
| Component | Expression |
|---|---|
| PI controller | \(C_{PI}(z) = k_p + \frac{k_i T_s}{1 – z^{-1}}\) |
| Repetitive internal model | \(G_R(z) = \frac{1}{1 – 0.95 z^{-400}}\) |
| Compensator (after splitting lead) | \(S'(z) = D(z) F_n(z) F_2(z)\) |
| Lead term | \(z^2\) (incorporated in the forward path) |
| Feed‑forward phase advance | \(z^2\) (via \(\theta_k\) in abc/dq) |
Simulation Results and Discussion
I built the complete system in Matlab/Simulink and compared three control strategies:
- Case I: PI controller only
- Case II: PI + repetitive controller (without feed‑forward)
- Case III: Proposed improved PI + repetitive control with feed‑forward
In all cases, the same linear load (5 Ω per phase) is connected at all times. A non‑linear load (three‑phase diode rectifier with 30 Ω and 2 mH) is switched in at \(t = 0.2\) s. The harmonic compensation function is enabled at \(t = 0.3\) s. The PV array operates at its maximum power point, delivering 8 kW.
Current Waveforms and Dynamic Response
Figure 7 in the original paper (not reproduced) shows the grid current phase‑a waveforms for the three cases. A key observation is that during the first cycle after compensation is enabled (0.3 s – 0.32 s), only Case III quickly returns the current to a sinusoidal shape. Cases I and II exhibit a large dip and slow recovery. After three cycles (0.3 s – 0.36 s), Cases II and III produce nearly identical sinusoidal currents, while Case I still contains significant harmonic notches.
The d‑axis and q‑axis current errors are shown in Figure 8 of the original paper. Table 4 quantifies the peak overshoot and the settling time for the q‑axis error.
| Control Scheme | Peak positive error (A) | Peak negative error (A) | Settling time to ±1 A (ms) |
|---|---|---|---|
| Case I (PI only) | 5.915 | −0.366 | > 60 |
| Case II (PI + repetitive) | 5.621 | −0.366 | > 60 |
| Case III (proposed) | 4.525 | −1.557 | < 2 |
The proposed controller reduces the peak error by about 20% and achieves settling within 2 ms, whereas the other two strategies require more than 60 ms (essentially the repetitive controller period) to converge.
Steady‑State Harmonic Suppression Performance
Figure 9 of the original paper shows the harmonic spectrum of the grid current during the first, second, and tenth cycles after enabling compensation. The total harmonic distortion (THD) values are listed in Table 5.
| Control Scheme | Before compensation | Cycle 1 | Cycle 2 | Cycle 10 (steady state) |
|---|---|---|---|---|
| Case I (PI only) | 10.8% | 9.2% | 7.5% | 3.61% |
| Case II (PI + repetitive) | 10.8% | 9.1% | 6.3% | 1.61% |
| Case III (proposed) | 10.8% | 6.4% | 3.2% | 1.71% |
Case III reduces the THD to 6.4% already in the first cycle, while the other two remain above 9%. In steady state, both Case II and III achieve similarly low THD (around 1.6%–1.7%), confirming that the feed‑forward does not degrade steady‑state accuracy. The PI‑only controller cannot drive the THD below 3.6% due to its limited harmonic tracking ability.
Individual Harmonic Content
Table 6 details the individual harmonic magnitudes (percentage of fundamental) for the 5th, 7th, 11th, 13th, 17th, and 19th components before compensation and after 10 cycles with each controller.
| Harmonic order | Before compensation | Case I | Case II | Case III |
|---|---|---|---|---|
| 5th | 9.2 | 2.5 | 0.4 | 0.5 |
| 7th | 4.1 | 1.6 | 0.3 | 0.3 |
| 11th | 2.8 | 1.0 | 0.2 | 0.2 |
| 13th | 1.7 | 0.8 | 0.1 | 0.1 |
| 17th | 1.2 | 0.6 | 0.1 | 0.1 |
| 19th | 0.9 | 0.5 | 0.1 | 0.1 |
The repetitive‑based schemes (Case II and III) reduce each individual harmonic to below 0.5%, while the PI‑only controller leaves magnitudes up to 2.5%. The proposed method not only matches the steady‑state performance of the classical repetitive control but also achieves this suppression in a fraction of the time.
Conclusion
In this work, I have presented an improved PI + repetitive control method for multifunctional solar inverters that can simultaneously deliver active power and suppress grid harmonics. The controller design incorporates a carefully crafted compensator that flattens the LCL filter’s frequency response and ensures stability. By adding a feed‑forward path with zero‑phase‑error compensation, the dynamic response of the harmonic suppression is dramatically improved: the current distortion drops to 6.4% within the first fundamental cycle, compared to 9%+ for the conventional approach. Steady‑state THD reaches about 1.6% for both the proposed and the classical repetitive control, demonstrating that the feed‑forward does not compromise accuracy. The method requires only a modest increase in computational burden (one additional phase‑advance calculation and a summing node) and is fully compatible with existing inverter control hardware. Future work will extend the approach to handle unbalanced and interharmonic components, and to validate the controller on a laboratory prototype.
