Single-phase photovoltaic off-grid inverter based on quasi-PR control

Given the rapid growth of renewable energy generation, photovoltaic inverters have gained widespread adoption in power generation systems. To achieve improved precision in control and enhanced quality in the output waveform of the inverters, this article presents a single-phase photovoltaic inverter designed for both grid-connected and off-grid systems. It utilizes a quasi-proportional-resonant control technique. Initially, the mathematical representation of the grid-connected and off-grid inverter is established. Following this, the quasi-proportional resonant control strategy is introduced, with the corresponding implementation method of the controller derived from its equivalent block diagram. Furthermore, the control block diagrams of the grid-connected and off-grid inverters undergo a detailed analysis, and the system’s transfer function is obtained from the control block diagram. The incorporation of grid voltage feedforward control is introduced for examining the system’s tracking performance. Ultimately, the proposed control approach is validated for its effectiveness and practicality through Simulink simulation.


Introduction
Currently, the main methods for controlling single-phase photovoltaic inverters include proportionalintegral-derivative (PID) control, repetitive control, hysteresis control, and proportional-resonant control.The PID control features a simple structure, ease of implementation, and strong robustness.However, this approach cannot achieve steady-state error-free regulation [1] .Repetitive control is based on internal model principles aimed at eliminating periodic disturbances, but it only possesses good stability capabilities while the dynamic characteristics are difficult to achieve [2] .Proportional-resonant control is renowned for its infinite gain characteristic, capable of eliminating not only steady-state errors in the amplitude of the inverter's output waveform but also steady-state errors in the phase.However, the bandwidth under this control method is relatively low [3] .In recent years, some scholars have made significant innovations and improvements based on traditional control strategies.Wan et al. studied a current single-closed-loop control scheme based on multiple sampling for the inverter side.By adjusting different Ke values, it is possible to achieve stable operation of both the current flowing through the inverter and the current flowing through the grid in the event of a sudden load increase [4] .Ma et al.  proposed a PI + repetitive control coupling mechanism for grid-connected inverter control, proving the system's stability when periodic attenuation distortion occurs during the dynamic process [5] .Gao et al. proposed a double-closed-loop control strategy based on combined state feedback, which utilizes combined state feedback of capacitor current and grid current for the inner loop, and grid current feedback for the outer loop.This control scheme can achieve steady-state tracking of system voltage and exhibits good dynamic characteristics [6] .Mohammadi et al. proposed a dual-closed-loop control

Circuit schematic and its simplified diagram
The structure diagram of the single-phase grid-connected and off-grid inverter [10] is depicted in Figure 1.The DC side is equivalent to providing a DC source by energy storage devices.The DC electricity converts to PWM AC after the inverter bridge and provides power to the loads or feeds energy into the grid after LC filtering.In this structure, C1 represents the storage capacitor, L is the filter inductance, C2 is the filter capacitor, r is the equivalent resistance of L and the line, R represents the load, and represents the grid voltage.The simplified model of a single-phase grid-connected and off-grid inverter can be seen in Figure 2.
Utilizing the prior comprehension of the circuit structure and operational principles of the inverter, the mathematical model of the grid-connected and off-grid inverter will now be specifically analyzed through the simplified circuit.

Equivalent block diagram of off-grid inverter
Based on the simplified model in Figure 2, the simplified block diagram of the off-grid inverter circuit can be obtained by taking the inductance current and the filter capacitor voltage as state variables while applying KCL and KVL, as shown in Figure 3:

Grid-connected inverter mathematical model
Given that grid connection aims to synchronize the current with the grid voltage and that this paper employs inductance current feedback control, it is sufficient to establish state equations with the inductance current as the state variable, as shown in Equation (1):

Quasi-PR control analysis
The transfer function of quasi-PR control is as follows: The proportional coefficient , the resonant coefficient Kr, the bandwidth coefficient , and the fundamental frequency are elements of the equation.The introduction of ensures that the quasi-PR controller possesses a specific range of frequencies at the fundamental frequency, with a very high amplitude gain, demonstrating the system's good anti-grid voltage disturbance performance.
For ease of implementation, the open-loop transfer function of quasi-PR control is decomposed below.After decomposing, an equivalent block diagram of quasi-PR control is obtained, as shown in Figure 4.

Off-grid inverter control
The off-grid inverter adopts dual closed-loop voltage and current control [11] , where voltage control uses output filter capacitor voltage feedback to accurately follow the given voltage, and current control uses capacitor current feedback to improve the rapid response of the system.Combining the preceding circuit equivalent block diagram analysis yields the overall control block diagram shown in Figure 5.

( ) and
( ) represent the quasi-PR controllers for the voltage loop and current loop, respectively; represents the given voltage, and after closed-loop control, the given current is obtained; refers to the proportional coefficient of the inverter bridge, which can be approximated as the ratio between the magnitude of the provided AC voltage and the DC voltage.
In the diagram, the current feedback adopted is capacitor current feedback control.At times, inductance current feedback control is used, and seldom do papers specifically discuss the pros and cons of these two.Here, by deriving the form of the transfer function, a comprehensive examination of the disparities between these two phenomena is carried out.For convenience in calculation, the effect of the internal resistance r is neglected.
Accordingly, the transfer function when using inductance current feedback can be obtained: () i Accordingly, the transfer function when using capacitor current feedback is obtained: By comparing equations ( ) and ( ) , it can be seen that they have identical tracking capabilities for the given voltage.Since the numerator and denominator of ( ) are both close to 1, they indicate good tracking capability for the given voltage.The latter part of the two transfer functions demonstrates that the influence of the load current disturbance is greater for ( ) due to the numerator of ( ) being greater than that of ( ), with identical denominators.This implies that capacitor current feedback has a stronger ability to resist load current disturbance, leading to better voltage-tracking performance.In addition, the capacitor itself has a derivative function, allowing the capacitor current to correct the output capacitor voltage in advance and offering a good dynamic suppression effect.Therefore, the research paper opts for the adoption of capacitance-dependent current feedback to regulate the current of the off-grid inverter.

Grid-connected inverter control
To achieve grid connection control, the grid-connected inverter's output is designed to function as a current source.This is achieved by utilizing a phase-locked loop (PLL) technique, specifically based on a second-order generalized integrator (SOGI).The phase of the grid voltage is extracted using the PLL technique, and then an in-phase current signal, synchronized with the grid voltage, is injected into the grid.This grid injection is achieved through closed-loop control of inductance current.Figure 6 provides a visual representation of the control block diagram.
Figure 6 shows the control block diagram with added grid voltage feedforward, where ( ) is the transfer function for the feedforward, ( ) is the transfer function for proportional-resonant control, is the equivalent coefficient for the inverter, and and represent grid voltage and the inductor current of the filter, respectively.The given current value obtains the phase angle of the grid through the PLL and enters it into the sine function multiplied by the given current magnitude to get the given sine current signal.If the given current magnitude is negative, it will work in a rectifying state, achieving bidirectional energy flow.Below is an explanation of the advantages of adding grid voltage feedforward control through the derivation of the transfer function form.

()
Thus, without considering grid voltage feedforward compensation, the following can be obtained: It can be noted that the output current is affected by the grid voltage disturbance, leading to a tracking error.
Combining the last two terms yields: According to the above equation, if the second part is set to 0, then the disturbance from the grid voltage can be eliminated: It is obtained that: In this paper, is approximately 1. Thus, by introducing grid voltage feedforward control, the disturbance from the grid voltage can be neutralized.
From Figure 6, without grid voltage feedforward, the output of the quasi-proportional-resonant controller would include both the inductor voltage and the grid voltage.In such a case, the output is relatively large, and if the grid voltage has a high instantaneous value during the connection to the grid, a large reverse current may be generated that could impact the inverter.With grid voltage feedforward included, the feedforward voltage and grid voltage cancel each other out.Therefore, the quasiproportional-resonant controller only needs to provide the inductance voltage, resulting in a smaller output.Moreover, as the advanced voltage can offset the effects of grid voltage, even in the presence of harmonics in the grid, they will nullify each other without significantly affecting the quality of the injected current.Otherwise, the current waveform could become distorted.

Off-grid inverter simulation
The simulation parameters for the off-grid are shown in Table 1. Figure 7 compares the output voltage FFT analysis results using capacitor current feedback control with inductance current feedback control.From the simulation results, the output voltage on the right is slightly lower than the set value, whereas the voltage on the left is essentially consistent with the set value, indicating that the output voltage obtained with capacitance current feedback is more ideal.
Figure 8 shows the output voltage waveform when the given voltage value suddenly changes from 110 V to 220 V at 0.1 s.As can be seen, the output performs very well in following the change.6.2 Grid-connected Inverter Simulation Table 2 lists some parameters for grid-connected simulation, with the rest being the same as those in off-grid mode.The following test compares the output current waveforms with and without grid voltage feedforward after injecting the third harmonic into the grid.
By comparing the simulation results in Figure 9 and Figure 10, it is clear that when the third harmonic is introduced on the grid side and grid voltage feedforward is employed, the output current remains unaffected.Not only is it able to lock onto the grid phase, but it also remains a relatively ideal sine wave, unaffected by the grid's third harmonic content.SOGI only extracts the fundamental component, with the third harmonic being automatically filtered out.The output current is not affected by the third harmonic because of the counteracting effect of grid voltage feedforward.As seen in Figure 12, once the third harmonic is introduced on the grid side, and without grid voltage feedforward, the output current waveform is seriously distorted, and THD exceeds the national standard.

Conclusion
This paper proposes an improved proportional resonant (PR) control strategy for single-phase gridconnected and off-grid inverters, which significantly enhances inverter performance through precision mathematical modeling and advanced control techniques.The model developed herein comprehensively depicts the electrical behavior of inverters under various operational conditions.Simulation validation confirms the superiority of the control strategy, particularly in maintaining high-quality current output in the face of grid disturbances and harmonic interference.The incorporation of a synchronous orthogonal generator integrator (SOGI), phase-locked loop (PLL), and voltage feed-forward compensation further strengthens the system's resilience to perturbations.Through simulation and theoretical analysis, the study corroborates the control system's rapid adaptability to dynamic load changes, which is vital for the stability of photovoltaic power systems.Ultimately, the proposed control strategy is suitable not only for efficient energy conversion under ideal conditions but also in fluctuating

Figure 1 .
Figure 1.Various devices connected to the microgrid.

Figure 2 .
Figure 2. Simplified circuit model of the grid-connected and off-grid inverter.

Figure 3 .
Figure 3. Simplified circuit block diagram of the off-grid inverter.

Figure 4 .
Figure 4. Equivalent block diagram of the quasi-PR control.

Figure 5 .
Figure 5.Control block diagram of the grid-tied inverter.

Figure 7 .
Figure 7. FFT analysis comparison between capacitor current feedback and inductor current feedback.

Figure 8 .
Figure 8.Output voltage waveform when the given voltage suddenly changes.

Figure 9 .
Figure 9. Current waveform with grid voltage feed-forward.

Figure 11 .
Figure 11.FFT analysis of current waveform with grid voltage feed-forward.

Figure 12 .
Figure 12.FFT analysis of current waveform without grid voltage feed-forward.

Table 1 .
Parameters for off-grid simulation.