In this work, I investigate a control strategy for household solar inverters that operate at the remote end of a distribution network. Many conventional solar inverters are designed to inject only active power at unity power factor. However, residential loads are often inductive, and when a large number of solar inverters ignore reactive power, the grid must supply all the reactive current. This situation can lead to voltage fluctuations, increased losses, and voltage drops. Therefore, I propose a dual-function control strategy for solar inverters: unity-power-factor active power generation and dynamic reactive power compensation. The approach uses a second-order generalized integrator (SOGI) to reconstruct orthogonal vectors, instantaneous reactive power theory to detect load reactive current, and a current inner loop with parallel proportional-integral (PI) and repetitive control. I verify the method through simulation and analyze its performance.

1. Introduction and Motivation
I focus on household solar inverters because they are increasingly deployed at the grid edge. The main power circuit I consider consists of a DC/DC Boost converter and a single-phase full-bridge DC/AC inverter. The Boost stage performs maximum power point tracking (MPPT). The full-bridge stage connects to the grid through an output inductor. A local load is connected at the point of common coupling. The solar inverter can therefore supply active power to the load and the grid, and it can also provide reactive power to the load. The control objective is to keep the grid current sinusoidal and in phase with the grid voltage while the solar inverter compensates the load reactive current.
I define the following variables: the grid voltage is ug, the grid current is ig, the inverter output current is iinv, and the load current is iL. By Kirchhoff’s current law at the point of common coupling, I have
$$ i_{inv} = i_L + i_g $$
If the grid current is controlled to be purely active, then
$$ i_g = I_g \sin(\omega t) $$
where Ig is the peak value of the grid current. The load current typically contains both active and reactive components. Therefore, the inverter current must contain the reactive component of the load and the active component that is not supplied by the grid. This is the core idea of the dual-function solar inverter.
The growing penetration of solar inverters in low-voltage networks introduces new challenges. When many solar inverters inject only active power, the reactive power demand of inductive loads must be met entirely by the upstream grid. This increases the current flowing through transformers and feeders, which raises losses and can cause voltage sag. If solar inverters can provide reactive power locally, the grid current can be reduced, and the voltage profile can be improved. My proposed strategy enables solar inverters to perform both active power generation and reactive power compensation without additional hardware.
I summarize the system parameters in Table 1. These parameters are used in my simulation study.
| Parameter | Symbol | Value | Unit |
|---|---|---|---|
| Grid voltage (RMS) | Ug | 220 | V |
| Grid frequency | f0 | 50 | Hz |
| Angular frequency | ω0 = 2πf0 | 314.16 | rad/s |
| Maximum active power reference | Pref | 3000 | W |
| Local load active power | PL | 1000 | W |
| Local load reactive power | QL | 1000 | Var |
| SOGI gain | k | 0.7 | – |
| Switching frequency | fsw | 20 | kHz |
| DC-link voltage | Udc | 400 | V |
| Output inductor | Lf | 3 | mH |
2. System Architecture and Operating Principle
The household solar inverter system I study has two power stages. The first stage is a Boost converter that interfaces the photovoltaic array to the DC link. The Boost converter adjusts its duty cycle to track the maximum power point of the solar panels. The second stage is a single-phase full-bridge inverter that converts DC power to AC power and connects to the grid through an L filter. The local load is connected in parallel with the grid at the point of common coupling.
The control system has several parts: MPPT control for the Boost converter, DC-link voltage control, reactive current detection, power control, and current inner loop control. The DC-link voltage is regulated by the power control loop, which generates the active current reference. The reactive current reference is obtained from the load current detection. The sum of these two references forms the current inner loop reference. The current inner loop uses a hybrid PI plus repetitive controller to track the reference and generate the switching signals for the full-bridge inverter.
The power balance equation for the DC link is
$$ P_{pv} = P_{inv} + P_{loss} + \frac{1}{2} C_{dc} \frac{d u_{dc}^2}{dt} $$
where Ppv is the photovoltaic power, Pinv is the inverter output power, Ploss is the converter loss, and Cdc is the DC-link capacitance. By controlling the inverter output power, the DC-link voltage can be regulated. The power control loop generates the active current command based on the difference between the DC-link voltage and its reference.
3. Single-Phase Instantaneous Reactive Power Theory
Single-phase systems do not have a natural quadrature component. To apply instantaneous reactive power theory, I need two orthogonal signals. A common method is to delay the measured current by one-quarter of the fundamental period. However, this delay introduces a time lag and reduces the dynamic response of the solar inverter. Therefore, I use a second-order generalized integrator (SOGI) to generate the orthogonal signals in real time.
The instantaneous reactive power theory was originally developed for three-phase systems. In a three-phase system, the instantaneous active and reactive powers are calculated from the alpha-beta components of voltage and current. For a single-phase system, I can create a virtual two-phase system by generating a quadrature component of the measured current. The alpha-beta components are then used in the same way as in a three-phase system.
If the voltage and current in the alpha-beta frame are vα, vβ, iα, and iβ, the instantaneous active power p and reactive power q are
$$ p = \frac{1}{2} (v_\alpha i_\alpha + v_\beta i_\beta) $$
$$ q = \frac{1}{2} (v_\beta i_\alpha – v_\alpha i_\beta) $$
In my application, I use the grid voltage as the reference. The grid voltage is sinusoidal and can be represented as
$$ v_g = V_m \sin(\omega t) $$
where Vm is the peak grid voltage. The virtual quadrature voltage is
$$ v_{g\beta} = -V_m \cos(\omega t) $$
Similarly, the load current and its quadrature component form the current vector in the alpha-beta frame. By applying the Park transform, I can obtain the active and reactive current components in the d–q frame. This allows me to separate the fundamental active and reactive currents from harmonics and other disturbances.
4. Second-Order Generalized Integrator for Orthogonal Signal Generation
The SOGI produces two output signals from the input load current iL. The first output iα is in phase with iL, and the second output iβ lags iα by 90 degrees. The closed-loop transfer functions of the SOGI are
$$ D(s) = \frac{i_\alpha(s)}{i_L(s)} = \frac{k \omega s}{s^2 + k \omega s + \omega^2} $$
$$ Q(s) = \frac{i_\beta(s)}{i_L(s)} = \frac{k \omega^2}{s^2 + k \omega s + \omega^2} $$
Here ω is the resonant angular frequency, which I set to the grid fundamental angular frequency, and k is the damping gain. The transfer function D(s) is a band-pass filter, while Q(s) is a low-pass filter with a 90-degree phase shift. The error transfer function is
$$ E(s) = 1 – D(s) = \frac{s^2 + \omega^2}{s^2 + k \omega s + \omega^2} $$
This error transfer function has zero gain at the resonant frequency, which means that the SOGI can track the fundamental component without steady-state error. The gain k affects both the bandwidth and the transient response. A larger k gives a faster response but also allows more harmonics to pass. A smaller k gives better filtering but slower response. After evaluating the trade-off, I select k = 0.7. The resonant frequency is set to ω = 2π × 50 rad/s.
The state-space representation of the SOGI is
$$ \dot{x}_1 = -\omega x_2 + k \omega (u – x_1) $$
$$ \dot{x}_2 = \omega x_1 $$
where x1 = iα, x2 = iβ, and u = iL. This representation is useful for digital implementation. In discrete time, I use the Tustin transformation or a similar method to obtain the difference equations. The sampling frequency is much higher than the fundamental frequency, so the discretization error is small.
In Table 2, I summarize the properties of the two SOGI outputs.
| Signal | Amplitude | Phase relative to iL | Function |
|---|---|---|---|
| iα | Equal to iL | 0 degrees | In-phase component for Park transform |
| iβ | Equal to iL | -90 degrees | Quadrature component for Park transform |
The SOGI also acts as a filter. It attenuates harmonic components around the fundamental frequency and improves the quality of the detected signals. Because the SOGI uses feedback, it does not introduce a full quarter-cycle delay like the traditional delay method. This is important for the dynamic performance of solar inverters that must respond quickly to load changes.
5. Load Reactive Current Detection and Extraction
Once I have iα and iβ, I apply the Park transform to obtain the active and reactive components in the d–q reference frame. The load current can be expressed as a Fourier series:
$$ i_L = i_{L\alpha} = \sqrt{2} \sum_{n=1}^{\infty} i_{Ln} \sin(n \omega t – \theta_n) $$
After the SOGI, the two-phase signals are iLα and iLβ. The Park transform matrix is
$$ T_{dq} = \begin{bmatrix} \sin \omega_0 t & -\cos \omega_0 t \\ -\cos \omega_0 t & -\sin \omega_0 t \end{bmatrix} $$
Applying this matrix gives
$$ \begin{bmatrix} i_{Lp} \\ i_{Lq} \end{bmatrix} = T_{dq} \begin{bmatrix} i_{L\alpha} \\ i_{L\beta} \end{bmatrix} = \begin{bmatrix} I_{Lp} + \tilde{I}_{Lp} \\ I_{Lq} + \tilde{I}_{Lq} \end{bmatrix} $$
where ILp and ILq are the DC components corresponding to the fundamental active and reactive currents, and ĨLp and ĨLq are AC components caused by harmonics and other frequencies. I then use low-pass filters to extract the DC components. The first-order low-pass filter I use is
$$ H_{LPF}(s) = \frac{\omega_c}{s + \omega_c} $$
with a cutoff frequency ωc chosen to be much lower than the fundamental frequency but high enough to allow fast detection. After filtering, I obtain the reference active and reactive current components of the load:
$$ I_{Lpref} = \sqrt{2} I_{Lp} \cos \theta_L $$
$$ I_{Lqref} = -\sqrt{2} I_{Lp} \sin \theta_L $$
Here θL is the phase angle of the load current fundamental component. The negative sign in ILqref follows the convention that inductive reactive current is positive in the q-axis. For an inductive load, ILqref is positive, and the solar inverter should inject a compensating reactive current with opposite sign. The detection method is summarized in Table 3.
| Step | Operation | Result |
|---|---|---|
| 1 | Measure load current iL | Single-phase signal |
| 2 | Apply SOGI | iLα, iLβ |
| 3 | Apply Park transform | iLp, iLq |
| 4 | Low-pass filtering | ILpref, ILqref |
| 5 | Use ILqref for compensation | Reactive current reference |
The low-pass filter introduces a small delay, but it is much smaller than the quarter-cycle delay of the traditional method. I choose the cutoff frequency to be 20 Hz, which provides a good balance between filtering and response speed. The SOGI itself also provides filtering, so the overall detection is robust against harmonics and noise.
6. Power Control and Reference Current Synthesis
The active power reference Pref comes from the MPPT stage. The reactive power reference Qref is usually set to zero for the solar inverter itself, because the goal is to compensate the load reactive power, not to exchange reactive power with the grid. The power control loop calculates the active and reactive current commands. In the d–q frame, I use
$$ i_{dref} = \frac{P_{ref}}{u_d} $$
$$ i_{qref} = -\frac{Q_{ref}}{u_d} $$
where ud is the d-axis component of the grid voltage. Because the grid voltage is aligned with the d-axis, ud is approximately constant and equal to the peak grid voltage. The reactive current command from the power control is usually zero for unity power factor operation of the solar inverter. However, the load reactive current ILqref must be added to the inverter current reference so that the grid current remains purely active.
To synthesize the current inner loop reference, I combine idref and ILqref. The resulting d–q reference is
$$ \begin{bmatrix} i_d^* \\ i_q^* \end{bmatrix} = \begin{bmatrix} i_{dref} \\ I_{Lqref} \end{bmatrix} $$
Then I apply the inverse Park transform to obtain the reference current in the α–β frame:
$$ \begin{bmatrix} i_\alpha^* \\ i_\beta^* \end{bmatrix} = T_{dq}^T \begin{bmatrix} i_d^* \\ i_q^* \end{bmatrix} = \begin{bmatrix} \sin \omega t & -\cos \omega t \\ -\cos \omega t & -\sin \omega t \end{bmatrix} \begin{bmatrix} i_{dref} \\ I_{Lqref} \end{bmatrix} $$
Expanding the matrix gives
$$ i_\alpha^* = i_{dref} \sin \omega t – I_{Lqref} \cos \omega t $$
$$ i_\beta^* = -i_{dref} \cos \omega t – I_{Lqref} \sin \omega t $$
The current inner loop reference is iα*. This reference contains both the active power command from the MPPT and the reactive compensation command from the load detection. By tracking this reference, the solar inverter supplies the active power and compensates the load reactive current. The grid current then remains in phase with the grid voltage, achieving unity power factor at the grid side.
I can also express the reference current in a more intuitive form. If the load current has a fundamental component iL = √2 IL sin(ωt – φL), then the active and reactive components are
$$ I_{Lp} = I_L \cos \phi_L $$
$$ I_{Lq} = I_L \sin \phi_L $$
After filtering, the reactive reference for compensation is
$$ I_{Lqref} = \sqrt{2} I_L \sin \phi_L $$
The inverter current reference becomes
$$ i_{inv}^* = i_{dref} \sin \omega t – I_{Lqref} \cos \omega t $$
This equation shows that the inverter current has two orthogonal components: one in phase with the grid voltage for active power, and one in quadrature for reactive compensation. The magnitude and sign of the quadrature component are determined by the load reactive current.
7. Current Inner Loop Control Design
The current inner loop must track the reference current with high accuracy and fast dynamic response. I use a hybrid controller consisting of a PI controller in parallel with a repetitive controller. The PI controller provides fast transient response, while the repetitive controller eliminates steady-state error and rejects periodic disturbances.
The PI controller in continuous time is
$$ G_{PI}(s) = K_p + \frac{K_i}{s} $$
In discrete time, using the trapezoidal integration, the PI controller becomes
$$ G_{PI}(z) = K_p + K_i \frac{T_s}{2} \frac{1 + z^{-1}}{1 – z^{-1}} $$
The repetitive controller is based on the internal model principle. It stores the error of the previous fundamental period and uses it to correct the current period. The transfer function of the repetitive controller is
$$ G_{RC}(z) = \frac{z^{-N}}{1 – Q(z) z^{-N}} S(z) $$
where N is the number of samples per fundamental period, Q(z) is a filter that improves stability, and S(z) is a compensator that shapes the frequency response. I choose Q(z) as a constant slightly less than 1, or as a first-order low-pass filter. The compensator S(z) is designed to cancel the phase lag of the plant and to provide sufficient gain at the harmonic frequencies.
The composite controller is
$$ G_c(z) = G_{PI}(z) + G_{RC}(z) $$
In the time domain, the control signal is the sum of the PI output and the repetitive output. When a disturbance occurs, the PI controller reacts immediately. The repetitive controller needs one fundamental period to learn the disturbance, but after that it cancels the periodic error. This combination gives both fast dynamic response and excellent steady-state accuracy. Table 4 shows the control parameters I used in the simulation.
| Parameter | Symbol | Value |
|---|---|---|
| PI proportional gain | Kp | 12 |
| PI integral gain | Ki | 800 |
| Sampling time | Ts | 50 μs |
| Number of samples per period | N | 400 |
| Repetitive filter constant | Q | 0.95 |
| Compensator gain | Krc | 0.8 |
The current inner loop also includes a pulse-width modulation (PWM) stage and a gate driver for the single-phase full-bridge. The output current is measured and fed back. The error between the reference and the feedback is processed by the composite controller. The output of the controller is compared with a triangular carrier to generate the switching signals. The switching frequency is 20 kHz, which is well above the fundamental frequency and the harmonic frequencies of interest.
For stability analysis, I consider the plant transfer function from the inverter output voltage to the output current:
$$ P(s) = \frac{1}{L_f s + R_f} $$
where Rf is the parasitic resistance of the inductor. The PI controller provides a phase margin that ensures stability. The repetitive controller is designed such that the overall loop gain satisfies the Nyquist criterion. The filter Q(z) is chosen to be less than 1 to avoid infinite gain at the repetitive frequencies, which could cause instability. The compensator S(z) is a low-pass filter that attenuates high-frequency components and prevents noise amplification.
8. Simulation Model and Parameters
I built a simulation model in MATLAB/Simulink to verify the proposed control strategy. The model includes the Boost converter with MPPT, the single-phase full-bridge inverter, the SOGI-based reactive current detection, the power control loop, and the composite current controller. The simulation parameters are listed in Table 1. The load is connected at 0.06 s. Before 0.06 s, there is no local load, and the solar inverter injects all active power into the grid. After 0.06 s, a load of 1000 W and 1000 Var is connected. I observe the inverter output current, grid voltage, grid current, active power, reactive power, and total harmonic distortion (THD).
Table 5 shows the additional simulation parameters for the detection and control loops.
| Parameter | Symbol | Value |
|---|---|---|
| SOGI resonant frequency | ω | 314.16 rad/s |
| Low-pass filter cutoff | ωc | 125.66 rad/s |
| DC-link voltage reference | Udc* | 400 V |
| Grid voltage peak | Vm | 311 V |
| Load connection time | tload | 0.06 s |
| Simulation time step | Ts | 50 μs |
9. Simulation Results and Analysis
Before 0.06 s, the inverter output current and the grid voltage are in phase. The grid current is also in phase with the grid voltage, which means the solar inverter is operating at unity power factor. The inverter output reactive power is zero. The active power injected into the grid is approximately 3000 W minus losses. The grid does not supply any reactive power because there is no load. This is the normal operation of a solar inverter without reactive compensation.
At 0.06 s, the inductive load is connected. Without compensation, the load would draw reactive power from the grid, and the grid current would lag the grid voltage. However, with my proposed strategy, the SOGI detects the load current and extracts the reactive component. The power control loop maintains the active power reference. The current inner loop reference now includes the reactive compensation component. After a short transient, the inverter output current becomes out of phase with the grid voltage, because it is supplying both active and reactive power. The grid current, however, remains in phase with the grid voltage. This means the grid still sees a unity power factor load. The reactive power is supplied locally by the solar inverter.
Table 6 summarizes the simulation results before and after compensation. The grid active power and reactive power are measured at the point of common coupling. A negative sign indicates power flowing from the solar inverter to the grid.
| Condition | Grid active power Pg (W) | Grid reactive power Qg (Var) | Power factor |
|---|---|---|---|
| No load, no compensation | -3000 | 0 | 1.000 |
| Load connected, no compensation | -2007 | 933 | 0.910 |
| Load connected, with proposed compensation | -1988 | -110 | 0.997 |
The power factor is calculated as
$$ PF = \frac{P}{\sqrt{P^2 + Q^2}} $$
For the uncompensated case, PF = 2007 / √(20072 + 9332) = 0.91. For the compensated case, PF = 1988 / √(19882 + 1102) = 0.997. This confirms that the proposed strategy achieves near-unity power factor at the grid side.
I also measure the total harmonic distortion of the grid current. The THD is calculated as
$$ THD_i = \sqrt{\frac{\sum_{h=2}^{H} I_h^2}{I_1^2}} \times 100\% $$
The measured THD after compensation is 2.05%, which is below the 5% limit required by many grid codes. Table 7 summarizes the THD and power factor results.
| Parameter | Value | Requirement |
|---|---|---|
| Grid current THD | 2.05% | < 5% |
| Grid power factor | 0.997 | > 0.95 |
| Reactive power compensation error | < 10% | – |
| Dynamic response time | One fundamental period | – |
10. Performance Comparison and Discussion
The simulation results show that the proposed control strategy enables household solar inverters to perform two functions simultaneously: active power generation at unity power factor and dynamic reactive power compensation. The SOGI-based detection avoids the quarter-cycle delay of traditional methods, so the solar inverter responds quickly to load changes. The PI plus repetitive controller provides both fast dynamic response and excellent steady-state accuracy. The grid current remains sinusoidal and in phase with the grid voltage even when the local load is inductive.
I compare the proposed method with the traditional delay-based method in Table 8. The SOGI method has better real-time performance and provides filtering, while the delay method is simpler but slower.
| Method | Delay | Real-time performance | Filtering capability | Complexity |
|---|---|---|---|---|
| Quarter-cycle delay | 5 ms at 50 Hz | Poor | None | Low |
| SOGI | Near zero | Good | Band-pass | Moderate |
The proposed strategy also has some limitations. The SOGI gain k must be tuned carefully. If k is too large, harmonics may pass through the detection stage. If k is too small, the transient response becomes slow. The repetitive controller requires one fundamental period to learn the disturbance, so the first cycle after a load change may have larger error. However, the PI controller covers this period. The overall performance is satisfactory for household solar inverters.
In Table 9, I compare the performance of the PI controller alone, the repetitive controller alone, and the hybrid controller. The hybrid controller achieves the best trade-off between dynamic response and steady-state accuracy.
| Controller | Dynamic response | Steady-state error | Harmonic rejection |
|---|---|---|---|
| PI only | Fast | Small | Moderate |
| Repetitive only | Slow | Very small | Excellent |
| Hybrid PI + repetitive | Fast | Very small | Excellent |
The proposed strategy also reduces the reactive power drawn from the grid. Before compensation, the grid supplies 933 Var to the load. After compensation, the grid reactive power is -110 Var, which is close to zero. The small negative value is due to the compensation error and the reactive power consumed by the output filter. This confirms that the solar inverter can effectively compensate the load reactive power.
In the future, I plan to extend this work to three-phase solar inverters and to test the strategy under distorted grid conditions. I also plan to implement the control algorithm on a digital signal processor to validate the simulation results experimentally. Another direction is to consider the interaction between multiple solar inverters in a microgrid, where coordinated reactive power control could further improve the voltage profile.
11. Conclusion
I have presented a reactive power compensation control strategy for household solar inverters. The strategy uses a second-order generalized integrator to generate orthogonal signals, instantaneous reactive power theory to detect the load reactive current, and a composite PI plus repetitive current controller. The solar inverter can therefore generate active power at unity power factor while compensating the reactive power of local loads. Simulation results show that the grid power factor improves from 0.91 to 0.997, and the grid current THD is 2.05%. The proposed strategy is suitable for solar inverters installed at the end of the distribution grid, where reactive power support is important for power quality. By using this control strategy, solar inverters can contribute to both energy generation and voltage support, making them more valuable assets in modern power systems.
I have also summarized the key equations and parameters in the tables and equations above. The dual-function operation of solar inverters can reduce grid losses, improve voltage profiles, and increase the penetration of renewable energy. I believe this strategy can be applied to many types of solar inverters, including single-phase residential units and small commercial systems.
In conclusion, the proposed control strategy provides a practical solution for household solar inverters that need to meet both active power and reactive power requirements. The use of SOGI, instantaneous reactive power theory, and hybrid current control achieves the desired performance. The simulation results validate the effectiveness of the approach. With further development, this strategy can help solar inverters become active participants in grid support rather than passive energy sources.
