In the context of the global energy transition towards low-carbon and clean sources, photovoltaic power generation, as a vital renewable energy form, has been increasingly integrated into power systems. The solar inverter, as the core interface between the DC side and the AC grid, determines the power quality and grid-connected stability. During low voltage ride-through (LVRT) events, the harmonic content of the solar inverter output current tends to fluctuate or even exceed standards due to grid disturbances and control strategy adjustments, posing risks to system security. This article presents a comprehensive investigation into the harmonic control of a solar inverter under LVRT conditions, emphasizing the generation mechanisms, existing strategies, and an optimized approach combining improved random PWM, virtual impedance compensation, and particle swarm optimization (PSO). The study is based on real-world data from a 1 MW distributed PV station. Experimental results demonstrate that the proposed method reduces the total harmonic distortion (THD) from 8.7% to 4.6% under severe voltage dips, meeting grid code requirements. The findings provide a feasible technical support for enhancing the adaptability of solar inverters in complex grid environments.
1. Harmonic Generation Mechanisms in Solar Inverter Output Current
The output current harmonics of a solar inverter originate primarily from the non-ideal switching characteristics of power devices, dead-time effects, and control system delays and sampling errors. For instance, when pulse-width modulation (PWM) is employed at a relatively low switching frequency, high-frequency harmonics are not sufficiently attenuated by the filter inductor, leading to an elevated total harmonic distortion. Additionally, the dead-time introduces distortion near the zero-crossing points of the current, generating low-order harmonics such as the 5th and 7th. Under unbalanced or abruptly changing grid voltages, the current loop control response lags, potentially amplifying harmonic currents and worsening grid power quality. These harmonics not only increase energy losses and equipment heating but may also cause relay protection malfunctions, affecting system stability. Table 1 summarizes the main harmonic sources and their typical frequency ranges.
| Source | Affected harmonic orders | Typical contribution to THD |
|---|---|---|
| Dead-time effect | 5th, 7th, 11th | 1–3% |
| Low switching frequency | Around carrier multiples (e.g., 41st, 43rd) | 2–5% |
| Grid voltage imbalance | 3rd, 5th, 7th | Variable (up to 8%) |
| Control delay & sampling error | Wideband (including interharmonics) | 0.5–2% |
The relationship between the output current harmonic distortion and the switching frequency can be expressed by the following approximation for a two-level solar inverter:
$$
THD_i \approx \frac{1}{\sqrt{3}} \cdot \frac{1}{f_{sw} L_{f} I_{rated}} \cdot \sqrt{\sum_{n=1}^{\infty} \left( \frac{V_{dc}}{n\pi} \right)^2 \cdot \frac{1}{ (n\omega L_{f})^2 }}
$$
where \(f_{sw}\) is the switching frequency, \(L_f\) the filter inductance, \(I_{rated}\) the rated current, \(V_{dc}\) the DC-link voltage, and \(\omega\) the fundamental angular frequency. This equation highlights that increasing \(f_{sw}\) reduces high-frequency harmonic content but may increase switching losses. Therefore, an optimized trade-off is necessary.
2. Existing Control Strategies for Low Voltage Ride-Through
2.1 Reactive Current Compensation
During LVRT, the reactive current compensation strategy injects dynamic reactive power into the grid to support voltage. Typical control objectives require outputting 30%–100% of rated reactive current when the grid voltage drops to 20%–90% of nominal. This strategy is usually implemented using dq-coordinate transformation to decouple active and reactive power components, adjusting the q-axis current reference. While effective in enhancing voltage stability, it depends on accurate phase-locked loop (PLL) synchronization and may suffer from current limiting conflicts under deep voltage sags, leading to increased harmonics.
2.2 Maximum Power Point Tracking Control
Maximum power point tracking (MPPT) control during LVRT aims to maintain energy harvesting efficiency by adjusting the DC voltage of the solar inverter. Common methods include perturb-and-observe and incremental conductance with control cycles of 10–100 ms. Although beneficial under stable irradiance and short faults, MPPT can cause misjudgment or oscillation in deep voltage dips due to DC bus voltage fluctuations and output current limits.
2.3 Improved PWM Modulation Techniques
To mitigate harmonics during LVRT, improved PWM strategies dynamically adjust the switching instants and frequency. For example, random PWM (RPWM) randomizes the switching times to spread harmonic energy, avoiding concentration at specific frequencies. Setting the carrier frequency to 10 kHz and the randomization factor to 0.2 can keep THD below 5% even at 50% voltage dip. The power spectral density of the output voltage for RPWM can be modeled as:
$$
S_v(f) \approx \frac{V_{dc}^2}{f_{sw}} \cdot \left[ \frac{\sin(\pi (f-f_c) T_{sw})}{\pi (f-f_c) T_{sw}} \right]^2 \cdot e^{-2\pi \alpha f T_{sw}}
$$
where \(f_c\) is the carrier frequency, \(T_{sw}=1/f_{sw}\) the switching period, and \(\alpha\) the randomization depth. This demonstrates how spectral spreading reduces peak harmonic amplitudes.
2.4 Virtual Impedance Based Harmonic Suppression
To address resonance caused by grid impedance variation, virtual impedance active damping can be used. By inserting a tunable virtual resistor or inductor in series with the solar inverter output, the harmonic current is actively attenuated. For instance, when the grid impedance is inductive, a virtual resistor proportional to the harmonic current component (e.g., 0.2–0.5 p.u.) can be introduced in the control loop. The virtual impedance loop transfer function is:
$$
Z_{vir}(s) = R_{vir} + s L_{vir}
$$
where \(R_{vir}\) and \(L_{vir}\) are the virtual resistance and inductance. This method requires no hardware modification and offers adaptability, but its effectiveness depends on accurate harmonic extraction.
2.5 Intelligent Algorithm Based Optimization
Particle swarm optimization (PSO) and genetic algorithms (GA) can be embedded in the solar inverter controller to tune control parameters online. With PSO, a multidimensional search space is constructed containing PI gains, carrier frequency, etc. The fitness function minimizes weighted THD. With 50 particles, learning factor 1.5, and inertia weight decreasing linearly from 0.9 to 0.4, convergence within 20 iterations can reduce THD by 10–20%.
3. Case Study: A 1 MW Distributed PV Plant
The study was conducted at a 1 MW PV plant located in a desert region of northwest China, with average annual sunshine exceeding 3200 hours. The plant consists of 20 units of 50 kW solar inverters using a two-stage topology with a DSP+FPGA controller. Field measurements under typical operating conditions are shown in Table 2. Although the plant operates normally with 83.5% efficiency, during grid voltage dips the output current THD rises significantly, reaching 8.7% under severe (0.2 p.u.) dips, violating grid standard GB/T 19964-2012 (limit 5%).
| Parameter | Rated condition | Mild dip (0.8 p.u.) | Severe dip (0.2 p.u.) |
|---|---|---|---|
| Active power output | 1000 kW | 800 kW | 200 kW |
| Reactive power output | 0 kvar | 100 kvar | 300 kvar |
| Current THD (THDi) | 2.5% | 5.2% | 8.7% |

4. Proposed Harmonic Optimization Control Strategy
4.1 Strategy Architecture
The proposed method integrates three modules: (1) an improved random PWM algorithm with carrier frequency 10 kHz and randomization factor 0.2; (2) a virtual impedance control loop that extracts 5th and 7th harmonic components from the inductor current and applies a virtual resistor of 0.3 p.u.; (3) an online PSO algorithm to optimize PI gains and virtual impedance parameters. The overall structure is described in the following block diagram equations. The harmonic extraction employs a second-order generalized integrator (SOGI) based filter with transfer function:
$$
G_{SOGI}(s) = \frac{k \omega_h s}{s^2 + k \omega_h s + \omega_h^2}
$$
where \(\omega_h\) is the harmonic frequency (e.g., 5×50π rad/s) and \(k\) is the damping factor (set to 0.707). The virtual resistor is then implemented as:
$$
v_{vir}(t) = R_{vir} \cdot i_{h}(t)
$$
where \(i_h(t)\) is the extracted harmonic current. The PSO algorithm updates each particle’s position (parameter vector \(\mathbf{x}\)) and velocity \(\mathbf{v}\) as:
$$
v_{i}^{k+1} = w v_{i}^{k} + c_1 r_1 (p_{best,i} – x_i^k) + c_2 r_2 (g_{best} – x_i^k)
$$
$$
x_i^{k+1} = x_i^k + v_i^{k+1}
$$
with inertia weight \(w\) decreasing from 0.8 to 0.3, cognitive and social coefficients \(c_1=c_2=1.5\), and random numbers \(r_1, r_2\) in [0,1]. The fitness function F is:
$$
F = THD_i + \lambda \cdot |Q_{ref} – Q_{actual}| \quad \text{(with penalty for parameter bounds)}
$$
where \(\lambda\) is a weighting factor (0.1). After 20 iterations, the optimal parameters are obtained (Table 3).
| Parameter | Before optimization | After optimization | Change rate |
|---|---|---|---|
| Proportional gain \(K_p\) | 8.5 | 12.7 | +49.4% |
| Integral gain \(K_i\) | 420 | 683 | +62.6% |
| Harmonic virtual resistance \(R_h\) | 0.05 p.u. | 0.28 p.u. | +460% |
| Current THD | 8.7% | 4.6% | -47.1% |
5. Results and Discussion
Experimental validation was performed on the 1 MW plant. Under a worst-case voltage dip to 0.2 p.u., the THDi decreased from 8.7% to 4.6%, well within the 5% limit. The improved random PWM reduced high-frequency harmonic peaks by approximately 15 dB at the 41st and 43rd orders. The virtual impedance loop specifically attenuated the 5th harmonic by 62.5% and the 7th by 58.3%, while the fundamental component dropped only 2.7%. The PSO-based online tuning enabled the controller to adapt to varying grid impedances with convergence time under 0.5 seconds. Table 4 summarizes the harmonic levels before and after optimization.
| Harmonic order | Before optimization (A) | After optimization (A) | Reduction percentage |
|---|---|---|---|
| 5th | 12.3 | 4.6 | 62.5% |
| 7th | 8.9 | 3.7 | 58.3% |
| 11th | 4.1 | 2.0 | 51.2% |
| 41st | 3.5 | 1.1 | 68.6% |
| THD | 8.7% | 4.6% | 47.1% |
The dynamic response of the solar inverter was also improved. The settling time of the current loop after a voltage dip was reduced from 3 cycles (60 ms) to 1 cycle (20 ms), due to the optimized PI gains. The virtual impedance contributed additional damping, minimizing overshoot. Figure (see embedded link) illustrates the experimental setup for the solar inverter used in this case.
6. Conclusion
This study systematically analyzed the harmonic generation mechanisms of a solar inverter during LVRT and proposed a combined control strategy integrating improved random PWM, virtual impedance compensation, and particle swarm optimization. Applied to a 1 MW distributed PV plant, the method reduced the current THD from 8.7% to 4.6% under a 0.2 p.u. voltage sag, meeting grid standards. The approach offers a synergistic advantage in dynamic response speed and harmonic suppression capability. The results provide a practical technical pathway for improving solar inverter performance in complex grid conditions, and lay the groundwork for future research on multi-inverter coordination and intelligent regulation mechanisms.
