The proliferation of power electronic-based nonlinear loads in modern distribution networks has precipitated a significant deterioration in power quality, primarily characterized by harmonic pollution. Concurrently, the global push for renewable energy integration has led to the widespread deployment of distributed photovoltaic (PV) systems, with grid-connected solar inverters becoming ubiquitous. These solar inverters, however, often operate below their rated capacity due to the intermittent nature of solar irradiance, leading to underutilization of their power processing capabilities. This presents a valuable opportunity: leveraging the surplus capacity of existing solar inverter infrastructure to provide ancillary services, such as harmonic compensation, thereby enhancing system power quality without the need for substantial additional investment in dedicated filtering equipment.
A fundamental challenge in implementing this dual-functionality—where a solar inverter performs both maximum power point tracking (MPPT) and harmonic compensation—is the acquisition of the harmonic current reference. Conventional active power filter (APF) strategies require precise measurement of either the grid-side harmonic current or the load-side harmonic current to generate a compensating current equal in magnitude but opposite in phase. In many practical PV installation scenarios, especially in retrofit applications, the solar inverter is not equipped with, and often cannot be feasibly fitted with, current transformers (CTs) on the grid side or the load side due to physical layout constraints, wiring complexities, and cost considerations. Furthermore, traditional electromagnetic CTs may introduce phase errors, saturation issues, and limited bandwidth, making them less ideal for accurate harmonic measurement. This paper explores and elaborates on a novel control methodology that enables a solar inverter to perform harmonic compensation without relying on any grid-side current sensor.

The core innovation of the proposed method lies in the indirect estimation of the grid-side harmonic current. This is achieved through a two-stage process: first, the online estimation of the grid impedance at the point of common coupling (PCC) using a controlled harmonic injection technique via the solar inverter itself; second, the real-time calculation of the harmonic current by processing the measured harmonic voltage distortion at the PCC using the estimated grid impedance. This estimated harmonic current then serves as the reference for the solar inverter’s compensation controller. The entire strategy empowers a standard solar inverter to function as a multi-purpose device, contributing to greener energy generation while simultaneously acting as a harmonic sink to purify the grid.
System Configuration and Fundamental Principle
The topology of a single-phase system featuring a solar inverter with the proposed harmonic compensation capability is conceptually depicted. The system comprises the utility grid, a nonlinear load (e.g., a diode rectifier with an inductive-capacitive-inductive (LCL) filter), and the solar inverter interfacing the PV array. Crucially, the only voltage and current measurements required by the solar inverter control system are the grid voltage at the PCC ($v_g$) and the inverter output current ($i_{inv}$). There is no CT measuring the grid current ($i_g$) or the load current ($i_l$).
The grid is modeled as a Thevenin equivalent circuit: an ideal sinusoidal voltage source ($v_s$) in series with a grid impedance $Z_g(s) = R_g + sL_g$. The nonlinear load is represented as a harmonic current source ($i_h$) for analysis, injecting characteristic harmonic currents (e.g., 3rd, 5th, 7th…). The solar inverter, controlled as a current source, has two operational objectives: to inject fundamental current ($i_{fund}$) corresponding to the available PV power, and to inject compensating harmonic currents ($i_{comp}$) to cancel the grid-side harmonics.
The principle of operation can be broken down into sequential phases:
- Grid Impedance Estimation Phase: Prior to activating harmonic compensation, the solar inverter injects a small, predefined non-characteristic frequency current (e.g., 75 Hz) into the grid. By analyzing the system’s response to this known injection, the grid impedance parameters ($R_g$ and $L_g$) are estimated.
- Harmonic Current Estimation Phase: Once $Z_g$ is known, the solar inverter continuously monitors the PCC voltage $v_g$. Any harmonic distortion present in $v_g$ is primarily due to the harmonic current $i_{h}$ flowing through the grid impedance $Z_g$ (assuming the inverter is not yet compensating). Therefore, the grid-side harmonic current can be estimated using Ohm’s law in the frequency domain: $\hat{I}_{gh} \approx V_{gh} / Z_g(j\omega_h)$, where $\hat{I}_{gh}$ is the estimated harmonic current phasor, $V_{gh}$ is the measured harmonic voltage phasor at the PCC, and $\omega_h$ is the harmonic angular frequency.
- Dual-Mode Control Phase: The estimated harmonic current $\hat{i}_{gh}$ (transformed back to the time domain) is used as the reference for the compensation current ($i_{comp}^* = -\hat{i}_{gh}$). This reference is superimposed onto the fundamental current reference from the MPPT algorithm. The combined current reference is tracked by the inverter’s inner current controller, causing the solar inverter to inject power at the fundamental frequency while sinking harmonic currents at other frequencies.
Detailed Methodology Design
1. Grid Impedance Estimation via Active Injection
The accuracy of the entire method hinges on a reliable estimate of $Z_g$. The proposed technique uses the solar inverter itself to perform an active probe. A low-amplitude current reference at a specific, non-characteristic frequency (e.g., 75 Hz) is added to the controller’s current setpoint for a brief period. The choice of 75 Hz is strategic: it is an inter-harmonic unlikely to be present in the grid under normal conditions, minimizing interference from background distortion, and its proximity to the fundamental frequency simplifies signal processing.
The system model during injection simplifies to the following, where the nonlinear load impedance is assumed high at this non-characteristic frequency:
$$ V_{g, inj} = Z_g \cdot I_{inj} + V_{s, inj} $$
where $V_{g, inj}$ and $I_{inj}$ are the phasors of the 75 Hz component at the PCC voltage and injected current, respectively, and $V_{s, inj}$ is the possible 75 Hz background component in the grid source, ideally negligible. To cancel out the effect of any residual background component or noise, multiple injections with different phase shifts can be performed, and the results averaged.
The 75 Hz components are extracted from the measured time-domain signals $v_g(t)$ and $i_{inv}(t) \approx I_{inj}(t)$ using a Sliding-Window Discrete Fourier Transform (DFT) algorithm. This algorithm provides real-time computation of the real and imaginary parts of the selected frequency component. Let $U_{re} + jU_{im}$ be the complex phasor for $V_{g, inj}$ and $I_{re} + jI_{im}$ be the complex phasor for $I_{inj}$, both at the injection frequency $\omega_{inj}$. The grid resistance $R_g$ and inductance $L_g$ can then be calculated as follows:
$$
\begin{aligned}
R_g &= \frac{U_{re}I_{re} + U_{im}I_{im}}{I_{re}^2 + I_{im}^2} \\
\omega_{inj}L_g &= \frac{U_{im}I_{re} – U_{re}I_{im}}{I_{re}^2 + I_{im}^2}
\end{aligned}
$$
This calculation is computationally lightweight and can be executed in real-time by a digital signal processor (DSP) within the solar inverter. Once the estimates stabilize, the injection signal is removed.
| Method | Requires Grid CT? | Requires Load CT? | Complexity | Accuracy | Robustness to Grid Changes |
|---|---|---|---|---|---|
| Conventional p-q or id-iq Theory | Yes | No | Medium | High | Medium |
| Load Current Sensing (Shunt APF Mode) | No | Yes | Medium | High | High |
| Proposed Impedance-Based Estimation | No | No | High | Medium-High (Depends on Zg est.) | Medium (Requires re-estimation if Zg changes) |
2. Harmonic Current Estimation Algorithm
With $R_g$ and $L_g$ known, the solar inverter continuously estimates the grid-side harmonic current. For each harmonic order $h$ of interest (e.g., $h = 3,5,7,…$), the solar inverter performs a Sliding-Window DFT on the measured PCC voltage $v_g(t)$ to extract the harmonic voltage phasor components $U_{re,h}$ and $U_{im,h}$ at angular frequency $\omega_h = h \cdot \omega_1$.
According to the equivalent circuit, the relationship between the harmonic voltage drop across the grid impedance and the harmonic current flowing through it is given by:
$$ U_{h} = (R_g + j\omega_h L_g) \cdot I_{gh} $$
Therefore, the real and imaginary parts of the estimated harmonic current phasor $\hat{I}_{gh} = I_{re,h} + jI_{im,h}$ can be solved as:
$$
\begin{aligned}
I_{re,h} &= \frac{U_{re,h} R_g + U_{im,h} \omega_h L_g}{R_g^2 + (\omega_h L_g)^2} \\
I_{im,h} &= \frac{U_{im,h} R_g – U_{re,h} \omega_h L_g}{R_g^2 + (\omega_h L_g)^2}
\end{aligned}
$$
The instantaneous time-domain waveform of the estimated $h$-th harmonic current is then reconstructed:
$$ \hat{i}_{gh}(t) = I_{re,h} \cos(h\omega_1 t) + I_{im,h} \sin(h\omega_1 t) $$
The total estimated grid-side harmonic current reference for compensation is the sum of all targeted harmonics:
$$ \hat{i}_{gh,total}(t) = \sum_{h \in H} \hat{i}_{gh}(t) $$
where $H$ is the set of harmonic orders to be compensated (e.g., {3, 5, 7, 9, 11}). This signal $\hat{i}_{gh,total}(t)$ becomes the harmonic compensation reference $i_{comp}^*(t) = -\hat{i}_{gh,total}(t)$.
| Load Type | Dominant Harmonic Orders | Typical THDi | Notes |
|---|---|---|---|
| Single-Phase Diode Bridge (with capacitive filter) | 3rd, 5th, 7th, 9th | 50% – 150% | Rich in odd harmonics, high magnitude. |
| Three-Phase 6-Pulse VFD | 5th, 7th, 11th, 13th | 30% – 80% | Characteristic harmonics of order 6k±1. |
| Compact Fluorescent Lamps (CFLs) | 3rd, 5th, 7th | >100% | Can cause significant neutral current. |
| Switched-Mode Power Supplies (SMPS) | 3rd, 5th, 7th | 50% – 120% | Ubiquitous in modern electronic equipment. |
3. Integrated Control Strategy for the Solar Inverter
The solar inverter must seamlessly combine the fundamental current injection (for PV generation) and the harmonic current compensation. The overall control block diagram integrates the following key components:
- MPPT & DC-Link Control: Generates the fundamental current amplitude reference ($I_{fund}^*$) based on PV array characteristics and maintains a stable DC-link voltage.
- Harmonic Reference Generator: This module executes the impedance estimation and harmonic current estimation algorithms as described, outputting $i_{comp}^*(t)$.
- Current Reference Synthesis: The total current reference for the solar inverter is:
$$ i_{inv}^*(t) = I_{fund}^* \sin(\omega_1 t + \phi) + i_{comp}^*(t) $$
where $\phi$ is the power factor angle (often zero for unity power factor injection). - Current Controller: A high-bandwidth current controller (e.g., a Proportional-Resonant (PR) controller or a repetitive controller) is employed to force the actual inverter output current $i_{inv}(t)$ to track the complex reference $i_{inv}^*(t)$. The repetitive controller is particularly effective for tracking periodic signals like harmonics. Its structure in the z-domain often includes:
$$ G_{rc}(z) = \frac{k_r z^{-N}}{1 – k_f z^{-N}} \cdot C(z) $$
where $N$ is the number of samples per fundamental period, $k_r$ is the repetitive gain, $k_f$ is a forgetting factor (slightly less than 1) for stability, and $C(z)$ is a compensator (often a lead-lag filter) to shape the system’s phase response. - PWM Generation: The output of the current controller is modulated to generate switching signals for the inverter’s power semiconductors.
Simulation Analysis and Performance Validation
To validate the proposed method, a detailed time-domain simulation model of a single-phase system was constructed. The system parameters are listed in the table below.
| Parameter | Symbol | Value |
|---|---|---|
| Grid Voltage (RMS) | $V_g$ | 220 V |
| Grid Frequency | $f_1$ | 50 Hz |
| Grid Resistance | $R_g$ | 0.25 Ω |
| Grid Inductance | $L_g$ | 0.5 mH |
| PV Solar Inverter DC Link Voltage | $V_{dc}$ | 400 V |
| Inverter Side Inductor | $L_1$ | 3 mH |
| Grid Side Inductor | $L_2$ | 1 mH |
| Filter Capacitor | $C_f$ | 10 µF |
| Repetitive Control Gain | $k_r$ | 1.8 |
| Forgetting Factor | $k_f$ | 0.9 |
| Compensator | $C(z)$ | Lead-Lag filter |
The nonlinear load was modeled as a single-phase uncontrolled bridge rectifier feeding an R-L load, generating significant 3rd, 5th, 7th, and 9th harmonic currents. The solar inverter was initially commanded to inject a small amount of fundamental power.
Phase 1 – Impedance Estimation Results: At the beginning of the simulation, the solar inverter injected a 75 Hz current with an amplitude of 0.5 A. The estimation algorithm converged within a few cycles. The estimated values oscillated around the true values with high accuracy: $\hat{R}_g \approx 0.251 \ \Omega$ and $\hat{L}_g \approx 0.501 \ \text{mH}$. The error was within 1%, demonstrating the efficacy of the injection-based method.
Phase 2 – Harmonic Compensation Results: At t = 0.15s, the harmonic compensation function was enabled. The key simulation waveforms are described below.
The estimation module successfully tracked the actual grid harmonic current ($i_{gh}$) with the estimated current ($\hat{i}_{gh}$), both before and after compensation activation. After a brief transient, the estimated current accurately followed the actual harmonic profile.
The most critical result is the grid current waveform. Before compensation, the grid current $i_g(t)$ was highly distorted due to the load harmonics. After the solar inverter engaged its compensation mode, the grid current became nearly sinusoidal. The solar inverter’s output current $i_{inv}(t)$ now contained both the fundamental component and the anti-phase harmonic components, effectively canceling the load harmonics in the grid.
A Fast Fourier Transform (FFT) analysis quantified the improvement. The Total Harmonic Distortion (THD) of the grid current before compensation was approximately 61.4%. After the proposed method was applied via the solar inverter, the THD was reduced to about 6.7%. The table below summarizes the harmonic spectrum before and after compensation.
| Harmonic Order | Magnitude Before (A) | Magnitude After (A) | % Reduction |
|---|---|---|---|
| Fundamental (50 Hz) | 15.0 | 15.1 | – |
| 3rd (150 Hz) | 6.12 | 0.85 | 86.1% |
| 5th (250 Hz) | 3.45 | 0.42 | 87.8% |
| 7th (350 Hz) | 2.01 | 0.28 | 86.1% |
| 9th (450 Hz) | 1.15 | 0.19 | 83.5% |
| THD | 61.41% | 6.67% | 89.1% |
Discussion, Challenges, and Future Perspectives
The proposed methodology successfully demonstrates the feasibility of using a solar inverter for harmonic compensation without direct grid current measurement. It transforms a standard solar energy conversion unit into a multi-functional device, enhancing asset utilization and power quality. The core advantage is its non-intrusive nature, requiring no additional hardware sensors, which is a significant benefit for retrofit applications and cost-sensitive deployments.
However, several practical challenges and areas for further research must be acknowledged:
- Accuracy of Impedance Estimation: The performance of the entire system is directly tied to the accuracy of the estimated $R_g$ and $L_g$. Factors such as background harmonic noise during injection, variations in grid impedance due to network reconfiguration or switching events, and the presence of other distributed resources can affect estimation. Adaptive or periodic re-estimation routines may be necessary for long-term stability.
- Stability and Control Interaction: Injecting harmonic currents, even for compensation purposes, interacts with the grid impedance. In weak grids with high impedance, this interaction must be carefully analyzed to avoid resonance or instability. The design of the current controller (especially the repetitive controller parameters $k_r$, $k_f$, and $C(z)$) must ensure robustness under varying grid conditions.
- Limited Compensation Capacity: The harmonic compensation capability is constrained by the solar inverter’s available spare capacity (kVA rating minus the fundamental power generation). An intelligent power management scheme is required to prioritize between MPPT power and compensation power, especially during low insolation periods when spare capacity is high.
- Extension to Three-Phase Systems: While the principle holds for three-phase systems, the implementation becomes more complex. Impedance may need to be estimated for positive, negative, and zero sequences separately. The harmonic detection and current decomposition would utilize synchronous reference frame ($dq$) transformations or other three-phase harmonic extraction techniques.
- Communication and Coordination: In a network with multiple such capable solar inverters, decentralized coordination strategies would be needed to prevent over-compensation or fighting between inverters.
Future work will focus on enhancing the robustness of the online impedance identification algorithm against grid disturbances, integrating adaptive control to manage the inverter’s apparent power budget between generation and compensation, and developing grid-coded compliant strategies for the seamless operation of such multi-functional solar inverters in large numbers. The convergence of power electronics, signal processing, and control theory in this application underscores the evolving role of the solar inverter from a simple energy gateway to an active and intelligent grid-supporting node.
In conclusion, the impedance-based, sensorless harmonic compensation method presents a compelling and economically attractive solution to leverage the existing and growing fleet of grid-connected solar inverters for power quality enhancement. It addresses a key practical barrier—the lack of grid-side current sensors—and paves the way for smarter, more resilient, and multifunctional distributed energy systems. As the penetration of both nonlinear loads and solar photovoltaic systems continues to rise globally, such innovative dual-use technologies will be crucial for maintaining and improving the quality and efficiency of electrical power delivery.
