Solar Inverter-Based Power Quality Compensation

The increasing penetration of distributed photovoltaic generation has transformed the way I view modern distribution networks. A solar inverter is no longer merely an interface for delivering active power from photovoltaic modules to the grid. Because a solar inverter is a grid-connected power electronic converter, its topology and control structure share strong similarities with active power filters and static var generators. In my research, I focus on using the redundant capacity of a solar inverter to simultaneously provide reactive power, harmonic compensation, and negative-sequence current mitigation. This integrated approach is called DG-FACTS, which stands for distributed generation flexible alternating current transmission system. The core idea is that a solar inverter can continue its normal photovoltaic power generation while also acting as a power quality compensator. This avoids the high investment cost of separate active power filters and static var generators, and it improves the utilization of the solar inverter hardware.

Power quality problems in distribution networks include harmonic distortion, voltage deviation, poor power factor, and three-phase imbalance. Nonlinear loads such as rectifiers, variable-frequency drives, and switched-mode power supplies inject harmonic currents. Unbalanced loads cause negative-sequence currents. Reactive loads reduce the power factor. These issues affect sensitive equipment, increase losses, and reduce the hosting capacity for distributed generation. A solar inverter has a DC link, a three-phase bridge, and an LCL filter. Its switching devices are rated for a certain current. When the available photovoltaic power is below the inverter rating, the remaining current margin can be used for compensation. Therefore, I propose a control strategy that extracts harmonic, reactive, and negative-sequence current commands from the load current and synthesizes them with the active power command from maximum power point tracking. The solar inverter then tracks the total reference current. This makes the solar inverter a multi-functional device.

The structure of my proposed DG-FACTS system is based on a three-phase three-wire solar inverter. The solar inverter is connected to the grid through an LCL filter. The photovoltaic array is connected to the DC side. Depending on the voltage level and the configuration, a DC/DC converter may be placed between the photovoltaic array and the solar inverter. The controller samples the photovoltaic voltage and current to perform maximum power point tracking. It also samples the load current or the grid current. From these samples, the controller calculates the harmonic current command, the reactive current command, and the negative-sequence current command. These commands are then processed by a mode identification and priority management block. The synthesized current command is limited by the available current margin of the solar inverter. Finally, a closed-loop current controller generates the switching signals for the insulated-gate bipolar transistors. The solar inverter therefore achieves seamless integration of active power generation and power quality compensation.

I have analyzed three main operating states of a solar inverter with DG-FACTS capability. The first state is pure photovoltaic generation, where the solar inverter only injects active current. The second state is simultaneous generation and compensation, where the solar inverter injects active current and also compensates one or more power quality issues, fully or partially. The third state occurs when there is no solar irradiation or when the photovoltaic power is zero. In that case, the solar inverter can operate as a pure compensator if the DC link is supported by another source or if the remaining energy is sufficient. Table 1 summarizes these operating modes. The transition between modes is managed by the command current synthesis strategy, which I explain later. The key advantage is that the solar inverter is not idle during low-power periods, and its capital cost is shared between energy production and power quality improvement.

Operating Mode Active Power Output Compensation Function Current Margin Usage
Pure generation Maximum available None Zero
Generation plus partial compensation Reduced or full Reactive, harmonic, or negative sequence Partial
Generation plus full compensation Reduced All three functions Full available margin
Pure compensation Zero All three functions Full inverter rating

To implement DG-FACTS, the detection algorithms must be accurate, fast, and easy to implement in a digital signal processor. I selected a sliding-window iterative discrete Fourier transform for harmonic detection, an instantaneous reactive power theory based method for reactive current detection, and a rotating coordinate transformation for negative-sequence current detection. Each of these algorithms is described in the following sections. I also explain how the command currents are synthesized with priority and amplitude limiting, and how the current tracking controller ensures fast and accurate tracking. The simulation results confirm that the solar inverter can improve power quality without compromising its normal generation function.

Harmonic, Reactive Power, and Negative Sequence Detection

The first step in my DG-FACTS control strategy is to extract the compensation current commands from the measured load current. Because harmonic, reactive, and negative-sequence components have different physical origins, I use separate detection algorithms for each. The detected commands are then combined. The detection algorithms must be compatible with the switching frequency and the sampling rate of the solar inverter. They must also avoid excessive computational burden, because the same digital signal processor also performs maximum power point tracking and current control.

Harmonic Current Detection

Harmonics in distribution networks are typically concentrated below the 25th order. For a solar inverter, it is neither necessary nor practical to compensate all harmonic components up to the switching frequency. Instead, I use a selective harmonic detection method based on an improved sliding-window iterative discrete Fourier transform. This method allows me to extract individual harmonic orders with low computational delay. The traditional discrete Fourier transform calculates the coefficients \(a_n\) and \(b_n\) for each harmonic order \(n\) over a fixed window. However, a fixed window requires a full period of samples before updating the output. To reduce the delay, I apply a sliding window that continuously updates the coefficients as new samples arrive. The improved formulas are given as follows.

$$ a_n = \frac{2}{N} \sum_{i=N_{\text{new}}-N+1}^{N_{\text{new}}} u(i\tau) \cos(n\omega i\tau) $$

$$ b_n = \frac{2}{N} \sum_{i=N_{\text{new}}-N+1}^{N_{\text{new}}} u(i\tau) \sin(n\omega i\tau) $$

In these equations, \(N_{\text{new}}\) is the index of the latest sample, \(N\) is the number of samples per fundamental period, \(u(i\tau)\) is the sampled current or voltage, \(\tau\) is the sampling interval, \(\omega\) is the fundamental angular frequency, and \(n\) is the harmonic order. The sliding window means that the summation covers the most recent \(N\) samples. When a new sample arrives, the oldest sample leaves the window. This leads to a recursive update that requires only one addition and one subtraction per harmonic order. The recursive form for the cosine term is expressed as follows.

$$ \sum_{i=N_{\text{new}}-N+1}^{N_{\text{new}}} u(i\tau) \cos(n\omega i\tau) = \sum_{i=N_{\text{new}}-N}^{N_{\text{new}}-1} u(i\tau) \cos(n\omega i\tau) – u((N_{\text{new}}-N)\tau) \cos(n\omega (N_{\text{new}}-N)\tau) + u(N_{\text{new}}\tau) \cos(n\omega N_{\text{new}}\tau) $$

A similar recursive equation applies to the sine term. I store the product of each sample and its corresponding rotation factor in a circular buffer. The update is then a simple iterative process. This makes the sliding-window iterative discrete Fourier transform very suitable for a digital signal processor. In my implementation, I use a separate detection module for each harmonic order that I want to compensate. Typically, I select the 5th, 7th, 11th, and 13th harmonics, because these are the most common in low-voltage distribution networks. The detected harmonic current \(i_{sh}^*\) is the sum of the selected harmonic components. I can also choose to compensate only the dominant harmonic if the available current margin is limited.

Harmonic Detection Method Computational Complexity Response Time Suitability for Solar Inverter
Fast Fourier transform with fixed window High One fundamental period Moderate
Instantaneous reactive power theory Low Fast Good for total harmonic
Sliding-window iterative DFT Low to moderate Less than one period Excellent for selective harmonics
Adaptive notch filter Moderate Fast Good for single frequency

The sliding-window iterative DFT also allows me to reconstruct the fundamental component and subtract it from the measured current to obtain the total harmonic current. However, for selective compensation, I directly synthesize the individual harmonic orders. This gives me flexibility to prioritize certain harmonics when the solar inverter current margin is insufficient. The detection accuracy depends on the synchronization between the sampling clock and the grid frequency. I use a phase-locked loop to generate the sampling pulses and the rotation factors. The phase-locked loop is shared with the reactive current detection algorithm, which reduces the overall computational load.

Reactive Current Detection

For reactive current detection, I use the instantaneous reactive power theory, specifically the \(i_p – i_q\) method. This method is well established and has low computational complexity. It is also robust against voltage distortion, which is important because low-voltage distribution networks often have non-sinusoidal voltage waveforms. The principle is to transform the three-phase currents into a synchronous rotating reference frame. The active and reactive components are then separated by low-pass filters. The transformation matrices are defined as follows.

$$ C_{32} = \sqrt{\frac{2}{3}} \begin{bmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\ 0 & \frac{\sqrt{3}}{2} & -\frac{\sqrt{3}}{2} \end{bmatrix} $$

$$ C_{pq} = \begin{bmatrix} \sin \omega t & -\cos \omega t \\ -\cos \omega t & -\sin \omega t \end{bmatrix} $$

In these equations, \(C_{32}\) transforms three-phase quantities into two-phase orthogonal quantities, and \(C_{pq}\) transforms the two-phase quantities into the rotating reference frame. The inverse matrices \(C_{23}\) and \(C_{pq}^{-1}\) are used for the reverse transformation. The measured three-phase currents are first transformed by \(C_{32}\) to obtain \(\alpha\) and \(\beta\) components. Then \(C_{pq}\) is applied to obtain the instantaneous active current \(i_p\) and instantaneous reactive current \(i_q\). A low-pass filter extracts the DC components \(\bar{i}_p\) and \(\bar{i}_q\). The AC components correspond to harmonics. The reactive current command is obtained from \(\bar{i}_q\). The fundamental active current is obtained from \(\bar{i}_p\). By subtracting the fundamental active current from the total current, I can also obtain the harmonic current. However, for selective harmonic compensation, I prefer the sliding-window iterative DFT described earlier.

The \(i_p – i_q\) method requires a sinusoidal reference signal that is in phase with the phase-A voltage. I generate this signal using a phase-locked loop and a sine wave generator. The phase-locked loop tracks the fundamental positive-sequence voltage angle. This ensures that the reactive current detection is not affected by voltage harmonics or unbalance. The low-pass filter cutoff frequency is chosen to be low enough to attenuate the second-harmonic component that appears in the rotating frame, but high enough to allow fast dynamic response. In my simulation, I use a second-order Butterworth low-pass filter with a cutoff frequency of 20 Hz. The reactive current command \(i_q^*\) is then used in the command synthesis stage. The solar inverter can inject or absorb reactive power depending on the sign of \(i_q^*\). This function is equivalent to a static var generator, but it uses the existing solar inverter hardware.

Parameter Value Purpose
Transformation matrix \(C_{32}\) \(\sqrt{2/3}\) scaling Three-phase to two-phase
Transformation matrix \(C_{pq}\) Sinusoidal and cosinusoidal Stationary to rotating frame
Low-pass filter type Second-order Butterworth Extract DC components
Cutoff frequency 20 Hz Attenuate second harmonic
Phase-locked loop Shared with harmonic detection Provide synchronous angle

Negative Sequence Current Detection

Three-phase imbalance is a common problem in distribution networks with single-phase loads. The negative-sequence current causes additional losses, torque ripple in motors, and overheating in transformers. A three-phase three-wire solar inverter can compensate the negative-sequence current by injecting a negative-sequence current of equal magnitude and opposite phase. To do this, I need to detect the negative-sequence component of the load current. I use a rotating coordinate transformation method. In the positive-sequence synchronous rotating frame, the positive-sequence current appears as a DC component, while the negative-sequence current appears as a second-harmonic component. In the negative-sequence synchronous rotating frame, the negative-sequence current appears as a DC component, while the positive-sequence current appears as a second-harmonic component. Therefore, I can extract the negative-sequence current by transforming the measured current into the negative-sequence rotating frame and applying a low-pass filter.

$$ I_{abc}^{P} = T_{abc}^{dq+} I_{dq+}^{P} $$

$$ I_{abc}^{N} = T_{abc}^{dq-} I_{dq-}^{N} $$

Here, \(I_{abc}^{P}\) and \(I_{abc}^{N}\) are the positive-sequence and negative-sequence components in the stationary frame. \(T_{abc}^{dq+}\) and \(T_{abc}^{dq-}\) are the transformation matrices for the positive-sequence and negative-sequence rotating frames, respectively. \(I_{dq+}^{P}\) and \(I_{dq-}^{N}\) are the DC components in the respective rotating frames. The transformation matrices are similar to the one used in the \(i_p – i_q\) method, but the rotation angle is reversed for the negative sequence. A low-pass filter extracts the DC component, which represents the negative-sequence current. The inverse transformation then gives the negative-sequence current in the three-phase stationary frame. The detected negative-sequence current \(i_-^*\) is used as the compensation command. The positive-sequence current is also obtained from the same transformation, which can be useful for other control purposes.

The dynamic response of the negative-sequence detection depends on the low-pass filter cutoff frequency. A lower cutoff frequency gives better filtering but slower response. In my design, I use a cutoff frequency of 20 Hz, which provides a good compromise. The negative-sequence detection can operate simultaneously with the harmonic and reactive detection because they use different frequency-domain characteristics. The solar inverter then injects the negative-sequence current to balance the grid current. The compensation is effective as long as the solar inverter current rating is not exceeded. If the negative-sequence current is too large, the amplitude limiting strategy reduces the compensation command proportionally.

Command Current Synthesis and Priority Management

After detecting the harmonic current \(i_{sh}^*\), the reactive current \(i_q^*\), and the negative-sequence current \(i_-^*\), I need to synthesize them with the active power current command \(i_p^*\) from the maximum power point tracking. The total reference current for the solar inverter is the sum of the active current and the compensation currents. However, the solar inverter has a limited current rating. The available current margin for compensation is the difference between the inverter rated current and the active current command. If the sum of the compensation commands exceeds this margin, I must limit the compensation or prioritize certain functions. Therefore, I developed a command current synthesis strategy based on load type identification and priority setting.

$$ i_{AMP}^* = i_n^* – i_p^* $$

$$ i_c^* = i_q^* + i_{sh}^* + i_-^* $$

$$ i_{ref}^* = i_p^* + i_c^* = i_p^* + k_1 i_1^* + k_2 i_2^* + k_3 i_3^* $$

In these equations, \(i_{AMP}^*\) is the available current margin, \(i_n^*\) is the rated current of the solar inverter switching devices, \(i_p^*\) is the active current command from maximum power point tracking, \(i_c^*\) is the total compensation current command, and \(i_{ref}^*\) is the final reference current. The coefficients \(k_1\), \(k_2\), and \(k_3\) are the priority coefficients for the first, second, and third compensation functions, respectively. The variables \(i_1^*\), \(i_2^*\), and \(i_3^*\) are the compensation commands arranged in the order of priority. The priority order is set by the user or by an automatic load type identification algorithm. For example, if the load is highly inductive, reactive compensation may have the highest priority. If the load is a harmonic-rich rectifier, harmonic compensation may have the highest priority. If the load is unbalanced, negative-sequence compensation may have the highest priority.

The command current synthesis process works as follows. First, I determine the available current margin \(i_{AMP}^*\). If the total compensation command \(i_c^*\) is less than or equal to \(i_{AMP}^*\), then no limiting is needed, and all compensation functions are fully activated. The coefficients \(k_1\), \(k_2\), and \(k_3\) are all set to one. If \(i_c^*\) is greater than \(i_{AMP}^*\), I activate the priority management. I assign the highest priority to the first compensation function, the second priority to the second function, and the third priority to the third function. I then check whether the first compensation command \(i_1^*\) exceeds \(i_{AMP}^*\). If it does, I limit the first compensation command by amplitude scaling. The amplitude scaling algorithm reduces the reference current linearly. The limited first compensation command becomes \(i_{AMP}^* i_1^* / I_1^*\), where \(I_1^*\) is the peak amplitude of \(i_1^*\). If \(i_1^*\) does not exceed \(i_{AMP}^*\), I then check the second compensation command \(i_2^*\) against the remaining margin \(i_{AMP1}^* = i_n^* – i_p^* – i_1^*\). If \(i_2^*\) exceeds \(i_{AMP1}^*\), I limit the second compensation command. Otherwise, I proceed to the third compensation command and check it against \(i_{AMP2}^* = i_n^* – i_p^* – i_1^* – i_2^*\). This sequential approach ensures that the highest priority function is always fully compensated if possible, and the lower priority functions are compensated with the remaining margin.

Scenario Condition Action Coefficients
Full compensation \(i_c^* \leq i_{AMP}^*\) No limiting \(k_1 = k_2 = k_3 = 1\)
First priority limited \(i_1^* > i_{AMP}^*\) Limit first command \(k_1 = i_{AMP}^* / I_1^*\), \(k_2 = k_3 = 0\)
Second priority limited \(i_1^* \leq i_{AMP}^*\), \(i_2^* > i_{AMP1}^*\) Limit second command \(k_1 = 1\), \(k_2 = i_{AMP1}^* / I_2^*\), \(k_3 = 0\)
Third priority limited \(i_1^* + i_2^* \leq i_{AMP}^*\), \(i_3^* > i_{AMP2}^*\) Limit third command \(k_1 = k_2 = 1\), \(k_3 = i_{AMP2}^* / I_3^*\)

The priority order can be set manually or automatically. In my implementation, I use a simple load type identification algorithm. I measure the total harmonic distortion of the load current, the displacement power factor, and the unbalance factor. Based on these measurements, I assign priorities. For example, if the total harmonic distortion is above a threshold and the displacement power factor is above 0.9, harmonic compensation gets the highest priority. If the displacement power factor is below 0.8, reactive compensation gets the highest priority. If the unbalance factor is above a threshold, negative-sequence compensation gets the highest priority. This automatic priority setting ensures that the most severe power quality problem is addressed first. The user can also override the automatic setting and specify a fixed priority order.

The command current synthesis also considers the dynamic response of the solar inverter. When the active power command changes due to a change in solar irradiation, the available current margin changes. I use a feedforward compensation term to adjust the compensation commands quickly. A low-pass filter smooths the transition between different priority levels to avoid sudden jumps in the reference current. The final reference current \(i_{ref}^*\) is then passed to the current tracking controller. The current tracking controller uses a proportional-resonant controller with a repetitive controller in parallel. The proportional-resonant controller provides fast tracking of the fundamental and selected harmonic components, while the repetitive controller eliminates steady-state errors for periodic signals. This combination ensures accurate tracking of the synthesized reference current even in the presence of grid voltage harmonics and frequency variations.

Simulation Verification

To verify the feasibility of my proposed DG-FACTS method, I built a simulation model in MATLAB/Simulink. The model includes a three-phase solar inverter, an LCL filter, a photovoltaic array with maximum power point tracking, and various load types. I used a DC link capacitor, a switching frequency of 10 kHz, and a sampling frequency of 20 kHz. The simulation parameters are summarized in Table 2. The load consists of a reactive load, an unbalanced load, and a nonlinear load. The reactive load is an inductor of 10 mH. The unbalanced load has different impedances in each phase: phase A has 1 \(\Omega\) and 3 mH, phase B has 1 \(\Omega\) and 3 mH, and phase C has 3 \(\Omega\) and 10 mH. The nonlinear load is a rectifier bridge with a resistive load. These loads create harmonic, reactive, and negative-sequence currents simultaneously.

Component Parameter Value
Reactive load Inductance 10 mH
Unbalanced load Phase A 1 \(\Omega\), 3 mH
Unbalanced load Phase B 1 \(\Omega\), 3 mH
Unbalanced load Phase C 3 \(\Omega\), 10 mH
Nonlinear load Type Rectifier bridge
LCL filter Inductor \(L_1\) 0.4 mH
LCL filter Inductor \(L_2\) 0.04 mH
LCL filter Capacitor \(C\) 20 \(\mu\)F
Switching frequency \(f_{sw}\) 10 kHz
DC link capacitor \(C_{dc}\) 5000 \(\mu\)F

The simulation sequence is designed to demonstrate the transition between different operating modes. At \(t = 0.05\) s, the solar inverter starts operating and begins photovoltaic generation. At \(t = 0.14\) s, the solar inverter begins compensating the unbalanced current. At \(t = 0.34\) s, the solar inverter starts injecting active power according to the maximum power point tracking command. At \(t = 0.54\) s, the solar inverter begins compensating the reactive current. At \(t = 0.74\) s, the solar inverter begins compensating the harmonic current. This sequence allows me to observe the individual and combined effects of each compensation function. Table 3 lists the simulation events. The solar inverter continues to generate active power throughout the compensation process, which verifies that the DG-FACTS function does not interfere with normal photovoltaic generation.

Time (s) Event Active Power Compensation Function
0.05 Solar inverter starts Enabled None
0.14 Unbalance compensation begins Enabled Negative sequence
0.34 Active power command begins Enabled Negative sequence
0.54 Reactive compensation begins Enabled Negative sequence, reactive
0.74 Harmonic compensation begins Enabled Negative sequence, reactive, harmonic

The simulation results show that before compensation, the grid current is distorted, unbalanced, and has a low power factor. After the solar inverter activates all compensation functions, the grid current becomes balanced and sinusoidal. The active power output of the solar inverter is 35 kW, and the reactive power output is 10.6 kW. The error between the actual output and the command is less than 1%, which indicates excellent tracking performance. The power factor improves from 0.7 to unity. The total harmonic distortion of the grid current decreases from 24.12% to 2.93%, which meets the relevant power quality standards. Table 4 compares the key performance indicators before and after compensation. The negative-sequence current is reduced to nearly zero. The current waveform in phase A changes from a distorted shape to a clean sinusoid. These results confirm that the solar inverter can effectively perform comprehensive power quality compensation while maintaining its active power generation function.

Indicator Before Compensation After Compensation Improvement
Total harmonic distortion 24.12% 2.93% 88% reduction
Power factor 0.7 1.0 43% increase
Negative sequence current High Nearly zero Effective elimination
Active power output 0 kW 35 kW Full generation
Reactive power output 0 kvar 10.6 kvar Compensation provided
Tracking error Not applicable < 1% High accuracy

The dynamic response of the solar inverter during the transition between modes is also satisfactory. When the harmonic compensation is activated at \(t = 0.74\) s, the grid current smoothly transitions to a sinusoidal waveform within a few fundamental cycles. The current tracking controller, which combines a proportional-resonant controller and a repetitive controller, provides fast transient response and zero steady-state error. The amplitude limiting algorithm prevents overcurrent in the solar inverter when the total compensation command exceeds the available margin. I also tested the priority management by setting different priority orders. When harmonic compensation was given the highest priority, the harmonic distortion was reduced first, and the reactive and negative-sequence compensation were partially reduced. When reactive compensation was given the highest priority, the power factor reached unity quickly, and harmonic compensation was limited. This confirms that the priority management strategy works as intended.

I also compared the performance of the solar inverter with DG-FACTS to a conventional active power filter and static var generator. The solar inverter achieves similar compensation performance at a lower additional cost, because it uses the existing hardware. The main limitation is that the compensation capacity is limited by the available current margin, which depends on the solar irradiance and the active power command. On a sunny day, the solar inverter may have little margin for compensation. However, during cloudy periods or in the morning and evening, the available margin is larger. The DG-FACTS function is therefore most beneficial when the solar inverter is not operating at full rated power. This is often the case in practical installations. The solar inverter can also provide reactive power at night if the DC link is supported by a small energy storage system or if the inverter is designed for reactive power operation without active power.

Conclusion

I have presented a comprehensive control strategy for using a solar inverter to improve power quality in distribution networks. The strategy, called DG-FACTS, enables the solar inverter to compensate harmonics, reactive power, and negative-sequence current while continuing to generate active power from photovoltaic modules. I analyzed the detection algorithms for each compensation function, including an improved sliding-window iterative discrete Fourier transform for selective harmonic detection, an instantaneous reactive power theory based method for reactive current detection, and a rotating coordinate transformation for negative-sequence current detection. These algorithms are computationally efficient and suitable for digital signal processor implementation. I also developed a command current synthesis strategy based on load type identification and priority setting. The strategy ensures that the highest priority compensation function is fully activated when the solar inverter current margin is limited. The amplitude limiting algorithm prevents overcurrent and provides smooth transitions between different compensation levels.

Simulation results in MATLAB/Simulink validated the feasibility of the proposed method. The solar inverter successfully reduced the total harmonic distortion from 24.12% to 2.93%, improved the power factor from 0.7 to unity, and eliminated the negative-sequence current. The active power output was maintained at 35 kW with a tracking error of less than 1%. The dynamic response was fast, and the transition between operating modes was smooth. The solar inverter effectively acted as a multi-functional power quality compensator without additional hardware. This makes the DG-FACTS concept a practical and economical solution for modern distribution networks with high penetration of distributed photovoltaic generation. Future work will focus on experimental validation and on optimizing the priority management algorithm for different load profiles.

Scroll to Top