# Analysis and Design of A PMQR-Type Repetitive Control Scheme for Grid-Connected H6 Inverters
## 3 Analysis and Design of the PMQR-Type RC Scheme
### SOGI-PLL Design  
In order to synchronize the grid-connected inverter output current frequency and phase with the grid voltage, the grid current reference signal tracking the phase and frequency accurately and quickly of the grid voltage should be ensured at first [27]. Therefore, the phase-locked loop (PLL) achieves a high sinusoidal current reference signal through phase negative feedback control. At the same time, the system uses the PLL to monitor the parameters of the grid voltage (such as the grid voltage amplitude and frequency), so as to guarantee the working performance and state of the grid-connected inverter. Because the accuracy of hardware-based PLL is limited by sensors and zero-crossing comparisons and it is difficult to overcome the disturbance of harmonic and unbalanced grid voltage, software-based digital PLL technology has been widely used [28]. For the digital PLL design of single-phase inverters, a pair of orthogonal signals needs to be constructed by a certain algorithm [29]. While a simple method is to use the traditional delay module in [30] to generate a fictitious signal with \(90^{\circ}\) phase difference, frequency, and amplitude consistent with the grid voltage, which forms a pair of orthogonal components with the grid fundamental voltage, other methods, such as Hilbert transform, inverse-park transform, and so on, are devoted to generating accurate orthogonal virtual signals without delay [28; 31]. Considering the interference of harmonics in the system and the dynamic performance of PLLs, this paper applied a new second-order generalized integrator (SOGI) phase-locked module to generate quadrature signals. The SOGI-PLL can not only detect the grid voltage phase, but also extract the magnitude and frequency of the grid voltage. The SOGI-based PLL structure is shown in Figure 6. It mainly consists of three parts: a phase detector (PD) consisting of an SOGI module, a \(\alpha\beta-dq\) coordinate transformation module, a loop filter (LF), and a voltage-controlled oscillator (VCO) [32]. The SOGI-based orthogonal signal generator (OSG) structure diagram is shown in Figure 7. It generates a pair of orthogonal signals, where the amplitude, phase, and frequency of the output signal \(v^{\prime}\) are equal to the input signal \(v\). The other output virtual voltage signal \(qv^{\prime}\) is delayed by \(90^{\circ}\) from the signal \(v^{\prime}\). The SOGI transfer function can be expressed as:  
\[SOGI\left(s\right)=\frac{\omega s}{s^{2}+\omega^{2}} \tag{27}\]  
where \(\omega\) is the resonant frequency of SOGI block. Therefore, the closed-loop transfer function between the two output signals (\(v^{\prime}\), \(qv^{\prime}\)) and the input signal (\(v\)) can be expressed as:  
\[ \begin{split} H_{d}\left(s\right)=\frac{v^{\prime}}{v}\left(s \right)=\frac{k\omega s}{s^{2}+k\omega s+\omega^{2}}\\ H_{q}\left(s\right)=\frac{qv^{\prime}}{v}\left(s\right)=\frac{ k\omega^{2}}{s^{2}+k\omega s+\omega^{2}}\end{split}  \tag{28}\]  
These transfer functions show that the bandwidth of the closed-loop system is directly determined by the gain \(k\) and is not affected by the resonant frequency \(\omega\), which means the grid frequency fluctuation has little effect on the system. Take the function \(H_{d}\left(s\right)\) as an example, when the gain \(k\) takes different values, the obtained Bode plot is shown in Figure 8, where the green, orange, and blue lines correspond to \(k\) = 0.3, \(k\) = 1, and \(k\) = 3, respectively. As can be seen from Figure 8, the system has no attenuation, only at the resonant frequency (50 Hz). The farther away from the resonant frequency, the greater the attenuation. Since the resonant frequency \(\omega\) of the SOGI block is exactly equal to the grid voltage frequency \(w_{g}\), the harmonic content of a pair of orthogonal signals is significantly reduced and has good filtering performance. Moreover, when the value of \(k\) decreases, the system bandwidth becomes narrower, and the filtering effect is enhanced.