An Adaptive Frequency Phase-Locked Loop Based on a Third Order Generalized Integrator

In this paper, the basic principle and characteristics of a phase-locked loop (PLL) in a single phase grid-connected system are analyzed, and this paper introduces one type virtual orthogonal voltage vector method based on a third order generalized integrator (TOGI) to construct an alpha and beta static coordinate system. The TOGI structure can eliminate the DC offset in a voltage signal or zero offset in the sampling process, and ensure the amplitude of the virtual orthogonal signal is consistent. At the same time, the adaptive frequency estimation unit is introduced, which can effectively deal with the power grid voltage frequency changes and ensure the accuracy of PLL. MATLAB (R2012a, MathWorks, Natick, MA, USA) is used to simulate the variation of power grid voltage frequency, DC component injection, harmonics injection and other parameters, and the performance of PLL is adequately verified. In addition, a 5kW single-phase energy router experimental platform is built to verify the proposed PLL. The experimental results show that the PLL can well track the frequency change of the grid voltage and eliminate the DC offset, so as to achieve accurate phase tracking.


Introduction
With the introduction of the Energy Internet and the continuous development of power electronics technology, the architecture, theory, technology and application research of the next generation of smart power distribution networks with key equipment power routers have become more and more a hot topic in the field of renewable energy [1,2].With the application of power electronic equipment in distribution networks, there are still many practical problems that need to be solved.The Future Renewable Electric Energy Delivery and Management (FREEDM) system puts forward the concept of energy router [3].Reference [4] summarizes the Energy Internet architecture and technical framework, in addition, it analyses the key problems and challenges of information technology in the Energy Internet development process.Reference [5] discussed the implementation model of the Energy Internet with energy routers as the core exchange device, and illustrated that in the research directions in this field, there is an urgent need of breakthroughs based on the existing research results.Reference [6] puts forward the advanced energy and information interaction technology to realize the Energy Internet, and analyzes and discusses the scientific issues involved in various key technologies.All the above articles introduce the power energy router from the power system perspective, without considering the control application from a power electronics perspective.
Phase-locked loop (PLL) is a common method to obtain phase information of a power grid.With the rapid development of renewable energy technology, PLL has begun to be widely applied in future energy systems [7].The structure of a single-phase PLL is shown in Figure 1.The PLL is realized based on the instantaneous reactive power theory and the beta-axis vector control of the grid voltage under the rotating coordinate system is set to 0, so as to realize the tracking of the voltage phase of the grid.However, due to the insufficient phase number of grid voltage signals in single-phase grid-connected converter, Clark/Park transformation cannot be carried out directly, so virtual orthogonal vectors need to be constructed by special units.
Energies 2018, 11, x FOR PEER REVIEW 2 of 21 realized based on the instantaneous reactive power theory and the beta-axis vector control of the grid voltage under the rotating coordinate system is set to 0, so as to realize the tracking of the voltage phase of the grid.However, due to the insufficient phase number of grid voltage signals in single-phase grid-connected converter, Clark/Park transformation cannot be carried out directly, so virtual orthogonal vectors need to be constructed by special units.There are two difficult existing issues in the PLL structure: firstly, there is direct current (DC) offset due to the amplifier and voltage sensor during the sampling process.Secondary, the frequency of the voltage is not a constant 50 Hz and when there is frequency fluctuation, the traditional PLL can't track the grid voltage frequency immediately because the reference frequency is constant.This paper provides a new approach to solve the above issue through a high performance single phase PLL.
In a three-phase system, a synchronous reference frame PLL (SRF-PLL) is usually adopted for PLL [8].In order to apply SRF-PLL mode to single-phase PLL, a orthogonal signal generator (OSG) needs to be constructed [9].The single-phase voltage input signal constitutes the two-phase orthogonal signal through the orthogonal signal generator, and then the Park transform can be used to obtain the phase error signal with high accuracy, so as to solve the problem of quadratic frequency double harmonics [10].However, when the orthogonal signal is implemented by delay, it will not be able to adapt to the rapid change of frequency.Currently, orthogonal signal realization methods commonly used Hilbert transform (HT) [11], inverse Park transform [12], adaptive notch filter (ANF) [13], and second order generalized integrator (SOGI) [14].Differential PLL (DPLL) [15] is a kind of differential method to construct the structure of the virtual orthogonal signal, through the power grid voltage signal differential can get a signal with a difference of 90°.Hilbert Transform PLL (HT-PLL) [16] is a method to construct virtual orthogonal vectors through Hilbert transform, which is generally realized by Finite Impulse Response (FIR) HT or Infinite Impulse Response (IIR) HT.However, it has two disadvantages: the phase deviation caused by delayed links and he amplitude inconsistency of orthogonal signals.Finite Impulse Response PLL (SDFT-PLL) [17] is a method to construct virtual orthogonal vectors through a discrete Fourier transform.The difficulty of this method lies in how to enhance the stability of PLL in long-term operation by controlling rounding deviation and adjust bias and resonance error through adaptive sampling frequency.In a word, it is a PLL structure with excellent effect.Enhanced PLL (EPLL) [18] is a special OSG-PLL structure, but its research is also very extensive.The control effect is very good when the grid voltage frequency remains unchanged, but there will be phase deviation when the frequency fluctuates.A kind of EPLL structure with harmonic elimination and DC elimination is proposed in [19].The SOGI [20] appliance has excellent dynamic performance and can effectively suppress noise, but in the generation process of its orthogonal signals, frequency signal feedback is needed as the natural oscillation frequency.Considering the DC offset, harmonic distortion and frequency mutation, the phase locking precision of SOGI based single PLL is still insufficient.
Reference [21] has studied the introduction of frequency estimation units in three-phase SOGI PLL, but these units are too complex.Reference [22] studied the frequency estimation unit in the PLL of single-phase SOGI structure to realize frequency adaptive.Reference [23] adopted the unit of frequency correction to solve the problem of phase locking misalignment under frequency fluctuation.References [24] and [25] involve the FLL to estimate the reference frequency in the There are two difficult existing issues in the PLL structure: firstly, there is direct current (DC) offset due to the amplifier and voltage sensor during the sampling process.Secondary, the frequency of the voltage is not a constant 50 Hz and when there is frequency fluctuation, the traditional PLL can't track the grid voltage frequency immediately because the reference frequency is constant.This paper provides a new approach to solve the above issue through a high performance single phase PLL.
In a three-phase system, a synchronous reference frame PLL (SRF-PLL) is usually adopted for PLL [8].In order to apply SRF-PLL mode to single-phase PLL, a orthogonal signal generator (OSG) needs to be constructed [9].The single-phase voltage input signal constitutes the two-phase orthogonal signal through the orthogonal signal generator, and then the Park transform can be used to obtain the phase error signal with high accuracy, so as to solve the problem of quadratic frequency double harmonics [10].However, when the orthogonal signal is implemented by delay, it will not be able to adapt to the rapid change of frequency.Currently, orthogonal signal realization methods commonly used Hilbert transform (HT) [11], inverse Park transform [12], adaptive notch filter (ANF) [13], and second order generalized integrator (SOGI) [14].Differential PLL (DPLL) [15] is a kind of differential method to construct the structure of the virtual orthogonal signal, through the power grid voltage signal differential can get a signal with a difference of 90 • .Hilbert Transform PLL (HT-PLL) [16] is a method to construct virtual orthogonal vectors through Hilbert transform, which is generally realized by Finite Impulse Response (FIR) HT or Infinite Impulse Response (IIR) HT.However, it has two disadvantages: the phase deviation caused by delayed links and he amplitude inconsistency of orthogonal signals.Finite Impulse Response PLL (SDFT-PLL) [17] is a method to construct virtual orthogonal vectors through a discrete Fourier transform.The difficulty of this method lies in how to enhance the stability of PLL in long-term operation by controlling rounding deviation and adjust bias and resonance error through adaptive sampling frequency.In a word, it is a PLL structure with excellent effect.Enhanced PLL (EPLL) [18] is a special OSG-PLL structure, but its research is also very extensive.The control effect is very good when the grid voltage frequency remains unchanged, but there will be phase deviation when the frequency fluctuates.A kind of EPLL structure with harmonic elimination and DC elimination is proposed in [19].The SOGI [20] appliance has excellent dynamic performance and can effectively suppress noise, but in the generation process of its orthogonal signals, frequency signal feedback is needed as the natural oscillation frequency.Considering the DC offset, harmonic distortion and frequency mutation, the phase locking precision of SOGI based single PLL is still insufficient.Reference [21] has studied the introduction of frequency estimation units in three-phase SOGI PLL, but these units are too complex.Reference [22] studied the frequency estimation unit in the PLL of single-phase SOGI structure to realize frequency adaptive.Reference [23] adopted the unit of frequency correction to solve the problem of phase locking misalignment under frequency fluctuation.References [24] and [25] involve the FLL to estimate the reference frequency in Energies 2019, 12, 309 3 of 20 the structure of the SOGI, and SOGI-FLL is proposed to tracking frequency in the case of mutation of the frequency, however, it still can't deal with the DC offset issue.Reference [26] proposed a PLL structure of cascaded SOGI, which could eliminate DC components in the input signal, but introduced two sets of SOGI structures to increase the delay of the system.Reference [27] summarizes a variety of DC elimination PLL methods based on an improved SOGI structure, whose essence is to introduce filtering units.Although DC elimination can be achieved, the dynamic characteristics of the system are greatly reduced.The traditional digital signal process technique of a Kalman filter is applied to eliminate the DC offset in literature [28], but the approach of the Kalman is so complicated with the discretization equation, also adding to the computation load of DSP.In [29], a cascaded double SOGI is proposed to eliminate the DC offset of the grid voltage, and it achieves high low pass filter performance, but the transfer function is up to fourth-order, it involves complex discretization and affects the system stability.In summary, [28,29] don't have frequency tracking functions during the mutation of frequency.The above papers has done sufficient and detailed work in the study of PLL, but for the practical engineering field, the use of multi-stage filters increases the delay unit of the system, and has an impact on the integrity of the signal.At the same time, in the actual Digital Signal Processor (DSP) or Field-Programmable Gate Array (FPGA) programming, the algorithm is too complex to implement and increases the computational burden.In addition, the frequency variation and DC components in the actual power system are not considered simultaneously, which can only solve a single problem and has limited effect in practical application.
Based on the problems in the above papers and considering its application in practical engineering, a frequency-adaptive phase-locked ring structure based on the TOGI is proposed in this paper.The main innovations are as follows: TOGI can effectively eliminate the zero drift or grid voltage DC offset caused by the sampling process or another cause.At the same time, it can achieve frequency adaptive tracking in the case of the frequency fluctuation of the power grid voltage, and improve the tracking precision and adaptability of the PLL.Finally a MATLAB simulation and experiments for the proposed PLL based on TOGI structure are verified.
The content structure of this paper is as follows: the structure of adaptive frequency TOGI was introduced in Section 1.The transfer function bode of TOGI analysis in Section 2. The discretization of TOGI with a trapezoidal method is introduced in Section 4. In addition, the proposed TOGI was verified by a MATLAB simulation in comparison to SOGI in Section 5. Finally, the TOGI PLL was further validated in a bidirectional energy router experimental platform which was developed based on TMS320F28335 DSP and Xilinx FPGA Spartan6 LX9 in Section 6.

PLL Based on SOGI Structure
The most popular PLL for the single phase grid connected converter is based on SOGI, and it transforms the single phase alternative current (AC) signal into an orthogonal one without delay, as well, it filters the high frequency of the input signal.The corresponding block diagram is shown in Figure 2.
Energies 2018, 11, x FOR PEER REVIEW 3 of 21 structure of the SOGI, and SOGI-FLL is proposed to tracking frequency in the case of mutation of the frequency, however, it still can't deal with the DC offset issue.Reference [26] proposed a PLL structure of cascaded SOGI, which could eliminate DC components in the input signal, but introduced two sets of SOGI structures to increase the delay of the system.Reference [27] summarizes a variety of DC elimination PLL methods based on an improved SOGI structure, whose essence is to introduce filtering units.Although DC elimination can be achieved, the dynamic characteristics of the system are greatly reduced.The traditional digital signal process technique of a Kalman filter is applied to eliminate the DC offset in literature [28], but the approach of the Kalman is so complicated with the discretization equation, also adding to the computation load of DSP.In [29], a cascaded double SOGI is proposed to eliminate the DC offset of the grid voltage, and it achieves high low pass filter performance, but the transfer function is up to fourth-order, it involves complex discretization and affects the system stability.In summary, [28,29] don't have frequency tracking functions during the mutation of frequency.The above papers has done sufficient and detailed work in the study of PLL, but for the practical engineering field, the use of multi-stage filters increases the delay unit of the system, and has an impact on the integrity of the signal.At the same time, in the actual Digital Signal Processor (DSP) or Field-Programmable Gate Array (FPGA) programming, the algorithm is too complex to implement and increases the computational burden.In addition, the frequency variation and DC components in the actual power system are not considered simultaneously, which can only solve a single problem and has limited effect in practical application.
Based on the problems in the above papers and considering its application in practical engineering, a frequency-adaptive phase-locked ring structure based on the TOGI is proposed in The content structure of this paper is as follows: the structure of adaptive frequency TOGI was introduced in Section 1.The transfer function bode of TOGI analysis in Section 2. The discretization of TOGI with a trapezoidal method is introduced in Section 4. In addition, the proposed TOGI was verified by a MATLAB simulation in comparison to SOGI in Section 5. Finally, the TOGI PLL was further validated in a bidirectional energy router experimental platform which was developed based on TMS320F28335 DSP and Xilinx FPGA Spartan6 LX9 in Section 6.

PLL Based on SOGI Structure
The most popular PLL for the single phase grid connected converter is based on SOGI, and it transforms the single phase alternative current (AC) signal into an orthogonal one without delay, as well, it filters the high frequency of the input signal.The corresponding block diagram is shown in The transfer functions of the SOGI are defined as:  The transfer functions of the SOGI are defined as: With the assumption that the grid frequency ω 0 is 314rad/sec, we can draw the Bode diagram of the closed-loop of SOGI at different values of gain k (0.5, 1.0, 2.0), as shown in Figure 3.
With the assumption that the grid frequency 0 ω is 314rad/sec, we can draw the Bode diagram of the closed-loop of SOGI at different values of gain k (0.5, 1.0, 2.0), as shown in Figure 3.According to the transfer function and Bode diagram, we see that H vd (s) is equivalent to a band-pass filter, and it can extract the fundamental signal from a complex signal including the high frequency harmonics and DC offset.From the phase Bode diagram, the total phase delay of the SOGI is close to zero.The transfer function H vq (s) is equivalent to a low-pass filter, which can perfectly extract the fundamental signal and attenuate the high-frequency signal from the complex signal including the high frequency harmonics and DC offset.But the DC offset will pass the SOGI to make a DC difference Energies 2019, 12, 309 5 of 20 in the magnitude of the orthogonal vectors.Therefore, in the OSG structure, H vq (s) is also expected to present the characteristics of the band-pass filter and retain the information of the baseband signal.
Although the SOGI achieves high reliability to synchronize the fundamental signal of the power grid, and track the phase angle, it has the drawback that limits its application in practice.For instance, when the A/D circuit sampling has a DC offset because of some inherent feature of the amplifier, the SOGI cannot eliminate the DC signal because its performance is low pass filer.Moreover, the other important disadvantage of the ω 0 of SOGI is a fixed parameter, not a variable parameter.Based on the above analysis, we need to reconstruct the conventional SOGI to eliminate the DC signal and generate an adaptive frequency reference.
As shown in Figure 4, a frequency locked loop (FLL) was introduced into the SOGI structure in [30], which can track the power grid frequency and realize adaptive frequency.However, according to the transfer function of Equation ( 2), it can still be seen that the difference between the transfer function of SOGI-FLL structure and the transfer function of SOGI structure is the fixed frequency value ω 0 and the adaptive frequency value ω .Therefore, the PLL based on SOGI-FLL structure achieves frequency adaptation, but it cannot realize the DC offset elimination, so a PLL based on a novel OSG structure should be studied and it is significant.Although the SOGI achieves high reliability to synchronize the fundamental signal of the power grid, and track the phase angle, it has the drawback that limits its application in practice.For instance, when the A/D circuit sampling has a DC offset because of some inherent feature of the amplifier, the SOGI cannot eliminate the DC signal because its performance is low pass filer.
Moreover, the other important disadvantage of the 0 ω of SOGI is a fixed parameter, not a variable parameter.Based on the above analysis, we need to reconstruct the conventional SOGI to eliminate the DC signal and generate an adaptive frequency reference.As shown in Figure 4, a frequency locked loop (FLL) was introduced into the SOGI structure in [30], which can track the power grid frequency and realize adaptive frequency.However, according to the transfer function of Equation ( 2), it can still be seen that the difference between the transfer function of SOGI-FLL structure and the transfer function of SOGI structure is the fixed frequency value 0 ω and the adaptive frequency value ' ω .Therefore, the PLL based on SOGI-FLL structure achieves frequency adaptation, but it cannot realize the DC offset elimination, so a PLL based on a novel OSG structure should be studied and it is significant.

Adaptive Frequency PLL Based on TOGI
To solve the accuracy issue of conventional SOGI PLL in the case of grid power and its sampling system with the DC offset and flexibility input reference, this paper presents a new adaptive frequency PLL approach based on the TOGI.The block diagram is shown in Figure 5.
Compared to SOGI, it involves two new blocks to improve the drawback of the SOGI, which are a DC elimination unit and a frequency estimation unit.
The detailed functions of the added two units are described as follows: 1) The DC elimination unit eliminates the DC offset which is generated by the A/D sampling

Adaptive Frequency PLL Based on TOGI
To solve the accuracy issue of conventional SOGI PLL in the case of grid power and its sampling system with the DC offset and flexibility input reference, this paper presents a new adaptive frequency PLL approach based on the TOGI.The block diagram is shown in Figure 5. Compared to SOGI, it involves two new blocks to improve the drawback of the SOGI, which are a DC elimination unit and a frequency estimation unit.
The detailed functions of the added two units are described as follows: (1) The DC elimination unit eliminates the DC offset which is generated by the A/D sampling deviation, and it makes sure the only the AC signal passes to the TOGI.The amplitude of orthogonal signals is equal without the DC offset, and phase of signals has a difference of 90 deg.(2) The frequency estimation unit involving the adaptive frequency unit can extract the frequency accurately during a disturbance of the power grid frequency.Furthermore, the resonant frequency of TOGI is guaranteed to change with the grid frequency in real time, and the grid voltage orthogonal signal is constructed accurately.
The DC elimination unit and the frequency estimation unit will be explained in details in Sections 3.1 and 3.2, respectively.The DC elimination unit and the frequency estimation unit will be explained in details in sections 3.1 and 3.2, respectively.
The block diagram of the adaptive frequency PLL based on a TOGI structure.

DC Offset Elimination Unit Based on TOGI
The TOGI transfer function is shown below based on Figure 5: 3) represents the transfer function of the fundamental voltage signal for the power grid, its corresponding orthogonal signal and DC offset.It found that the three transfer functions have same characteristic equation, shown in Equation ( 4): In order to analyze the TOGI structure of the Bode diagram, we need to select a reasonable proportional coefficient k and dc k .According to [31], the characteristic equation has the same resonance frequency, and assuming that they have the same real part, the characteristic equation can be expressed as follows: Hence, the proportional coefficient k and dc k can be obtained as follows: ( ) According to the analysis results of the Routh, we draw the Equation

DC Offset Elimination Unit Based on TOGI
The TOGI transfer function is shown below based on Figure 5: Equation ( 3) represents the transfer function of the fundamental voltage signal for the power grid, its corresponding orthogonal signal and DC offset.It found that the three transfer functions have same characteristic equation, shown in Equation ( 4): In order to analyze the TOGI structure of the Bode diagram, we need to select a reasonable proportional coefficient k and k dc .According to [31], the characteristic equation has the same resonance frequency, and assuming that they have the same real part, the characteristic equation can be expressed as follows: Hence, the proportional coefficient k and k dc can be obtained as follows: According to the analysis results of the Routh, we draw the Equation (3) Bode diagram based on the coefficients k = √ 2 and k dc = 0.221.In Figure 6, the Bode diagrams of the H vd (s) and H vd (s) demonstrate that both Bode diagrams have same amplitude and phase characteristics in the high frequency domain.In the low frequency domain, the TOGI has more attenuation than the SOGI, so it can filter the low frequency noise.At frequency ω point, the amplitude gain is 0 dB, and phase shift is 0 deg, hence v α is the optimal point to extract the synchronization the u g of the power grid.
According to the H vq (s) and H vq (s) amplitude Bode diagrams in Figure 7, the analysis results is the same as the Bode diagram of H vd (s) and H vd (s), so based on the above analysis, the TOGI not only can provide the orthogonal signal, but also have band pass filter performance.In Figure 8, the bode diagram of H dc (s) has a low-pass filter performance, and filters the high frequency signals, especially, it can extract the DC signal completely with 0 deg phase shift.As well, there is high attenuation at the ω frequency.Hence, we add the DC unit H dc (s) as the feedback unit of the TOGI to eliminate the DC part of the grid voltage.In signal processing, high-pass filters (HBFs) are widely used for filtering out low-frequency signals (including DC signals).Considering this, it is feasible to apply a high-pass filter to eliminate the DC component in PLL, which is also mentioned by a large number of scholars.In general, HBF adopts a first-order high-pass filter (FOHBF) or second-order high-pass filter (SOHBF).As shown in Figure 9, the DC offset can be eliminated by adding an HBF after the output of the SOGI structure.This paper focuses on analyzing the effect of using an HBF structure and a TOGI structure to construct orthogonal signals in detail.Referring to Equation (1), the transfer function of the OSG structure adopting SOGI-FOHBF can be explained as follows: The transfer function of OSG structure adopting SOGI-SOHBF can be expressed as: In order to compare the DC offset elimination effects between the TOGI、SOGI-FOHBF and SOGI-SOHBF, by selecting the cutoff frequency of the HBF as 0.1 Hz, 1 Hz and 10 Hz, the beta-axis DC offset elimination effects through the Bode diagrams are compared and analyzed in Figure 10, Figure 11 and Figure 12, respectively.In the figures, the red line, blue line and green line represent the Bode curves of the TOGI structure, SOGI-FOHBF structure and SOGI-SOHBF structure, respectively.
Figure 10 shows the comparative analysis of the high-pass filter at 0.1 Hz cut-off frequency.
According to the amplitude-frequency characteristics, it can be seen that the low-frequency attenuation ability of the TOGI structure is very strong, but the low-frequency attenuation abilities of the SOGI-FOHBF structure and SOGI-SOHBF structure are not obvious and cannot eliminate the DC offset of the beta axis output signal.Meanwhile, it can be seen from the phase frequency characteristic curve at the grid frequency 0 ω , that the phase shift of the TOGI structure is −90 deg, Referring to Equation (1), the transfer function of the OSG structure adopting SOGI-FOHBF can be explained as follows: The transfer function of OSG structure adopting SOGI-SOHBF can be expressed as: In order to compare the DC offset elimination effects between the TOGI, SOGI-FOHBF and SOGI-SOHBF, by selecting the cutoff frequency of the HBF as 0.1 Hz, 1 Hz and 10 Hz, the beta-axis DC offset elimination effects through the Bode diagrams are compared and analyzed in Figures 10-12, respectively.In the figures, the red line, blue line and green line represent the Bode curves of the TOGI structure, SOGI-FOHBF structure and SOGI-SOHBF structure, respectively.
Figure 10 shows the comparative analysis of the high-pass filter at 0.1 Hz cut-off frequency.According to the amplitude-frequency characteristics, it can be seen that the low-frequency attenuation ability of the TOGI structure is very strong, but the low-frequency attenuation abilities of the SOGI-FOHBF structure and SOGI-SOHBF structure are not obvious and cannot eliminate the DC offset of the beta axis output signal.Meanwhile, it can be seen from the phase frequency characteristic curve at the grid frequency ω 0 , that the phase shift of the TOGI structure is −90 deg, but the phase shift of the SOGI-FOHBF structure and SOGI-SOHBF structure are greater than −90 deg, and almost −89.8 deg.
Figure 11 shows the comparative analysis of the high-pass filter at 1 Hz cut-off frequency.According to the amplitude-frequency characteristics, it can be seen that low-frequency attenuation abilities of the SOGI-FOHBF structure and SOGI-SOHBF structure are pretty good, but the low-frequency attenuation ability of the TOGI structure is better.Meanwhile, it can be seen from the phase frequency characteristic curve at the grid frequency ω 0 , that the phase shift of the TOGI structure is still −90 deg, but the phase shifts of the SOGI-FOHBF structure and the SOGI-SOHBF structure are almost −88.9 deg and −89.2 deg, respectively.They are unable to generate standard orthogonal signals with a 90 deg phase difference.
Figure 12 shows the comparative analysis of the high-pass filter at 10 Hz cut-off frequency.According to the amplitude-frequency characteristics, it can be seen that the SOGI-FOHBF structure and TOGI structure have similar low frequency attenuation ability, and the low frequency attenuation ability of the SOGI-SOHBF structure is better than that of the TOGI structure.Meanwhile, it can be seen from the phase frequency characteristic curve at the grid frequency ω 0 , that the phase shift of the SOGI-FOHBF structure and SOGI-SOHBF structure are almost −79 deg and −82 deg, respectively.This is unacceptable for constructing orthogonal signals with a 90 deg phase difference.Based on the above analysis, the SOGI-FOHBF structure and SOGI-SOHBF structure can achieve better low-frequency elimination characteristics by adjusting the cutoff frequency, but their phase-frequency characteristics are not very good.The essence of the OSG structure is to construct orthogonal signals with a phase difference of 90 deg, so the phase frequency characteristic is also an important reference for selecting an OSG structure.Therefore, this paper concludes that the SOGI-FOHBF structure and SOGI-SOHBF structure are not suitable for the construction of OSG structures, while the TOGI structure performances well in the aspects of both amplitude frequency and phase frequency.

Adaptive Frequency Unit Based on TOGI
In order to implement adaptive frequency of PLL, it introduces the frequency adaptive feedback unit.When the input signal frequency disturbance, it can track frequency accurately [32].Combine the predict frequency part with TOGI as the reference frequency.The adaptive transfer function can be expressed as follows: To verify adaptive frequency unit, it can use the difference ε and output v β as the feedback control, and implement reference frequency ω tracking.The transfer function of difference ε and output v β can be obtained as follows: Energies 2019, 12, 309 11 of 20 In Figure 13, the bode diagrams of H vq (s) and H ε (s) demonstrate that, when the frequency power grid is lower than the TOGI resonant frequency (ω < ω ), the difference ε and output v β have the same trend change.On the contrary, when the frequency of power grid is higher than the TOGI resonant frequency (ω > ω ), the difference ε and output v β have the opposite trend.Hence, the product result of difference ε and output v β determines the frequency difference signal ∆ f .When ω < ω , ∆ f > 0; When ω = ω , ∆ f = 0; When ω > ω , ∆ f < 0; Therefore, it can adjust the difference of the ω and ω to zero through the proportional coefficient k f which is negative feedback gain, thus implementing frequency tracking.
In Figure 13, the bode diagrams of ( )

Discretization of TOGI
A continuous signal model cannot be realized by programming in DSP or FPGA chips.Therefore, discrete processing of the TOGI PLL continuous model is necessary in practical engineering.Generally, there are three type discretization methods to implement, as shown in Table 1.Second order integrator Considering the calculation complexity and accuracy, thus we adopt the trapezoidal method to implement the discretization of the close loop transfer function for Equation (3).
Replacing the s by 2 3), it can be expressed as: Simplifying Equation (11) gives: Energies 2019, 12, 309 12 of 20 Making the following substitution: We transform Equation ( 12) into a canonical form as follows: Substituting the equation 13), it can be represented as follows: The same approach applies to the discrete beta-axis, and the result is as follows:

Simulation
In order to verify the frequency adaptive frequency PLL based on the TOGI structure proposed in this paper, the following comparative simulation experiments are carried out.The MATLAB simulation parameters are shown in Table 2.

Simulation of DC Offset Elimination
The conditions of the first simulation are about a larger DC offset and smaller AC signal harmonic: grid voltage signal that contains the fundamental signal amplitude (311 V), a three order harmonic (amplitude 5 V) and a DC component (+30 V).In order to prove the TOGI structure has the ability to filter out the DC component, the simulation results are compared as shown in the following Figure 14.
The conditions of the second simulation concern a smaller DC offset and larger AC signal harmonic; the grid voltage signal contains a fundamental wave signal amplitude (311 V), three harmonic (amplitude 30 V), five harmonics (amplitude 20 V), nine harmonic (amplitude 5 V) and a DC component (+5 V).In order to prove the TOGI structure has the ability to filter out the DC component and extract the fundamental AC signal, the simulation results are compared as shown in Figure 15: (1) In both the SOGI structure and TOGI structure, the synchronous signal v α and signal v α accurately extract the voltage signal of the power grid, but still contains a small amount of harmonics.
(2) In the SOGI structure, the orthogonal signal v β contains a large number of DC components, and the DC components content in the grid voltage signal is significantly obvious; however, in the TOGI structure, the DC components in the grid voltage signal are almost completely filtered out in the orthogonal signal v β , and only a small number of DC components remain.
(3) Through simulation comparison, without changing ac signal filtering effect of the SOGI structure, the TOGI structure increases the DC signal filtering effect in the orthogonal signal, so as to achieve accurate phase tracking when DC components are included in a power grid voltage signal.accurately extract the voltage signal of the power grid, but still contains a small amount of harmonics.
2) In the SOGI structure, the orthogonal signal v β contains a large number of DC components, and the DC components content in the grid voltage signal is significantly obvious; however, in the TOGI structure, the DC components in the grid voltage signal are almost completely filtered out in the orthogonal signal ' v β , and only a small number of DC components remain.
3) Through simulation comparison, without changing ac signal filtering effect of the SOGI structure, the TOGI structure increases the DC signal filtering effect in the orthogonal signal, so as to achieve accurate phase tracking when DC components are included in a power grid voltage signal.

Simulation of TOGI PLL
Simulation conditions: The reference fundamental frequency is 50 Hz.At 0.5 s, the power grid voltage frequency jumps from 50 Hz to 52 Hz.In order to facilitate the analysis in the same figure and reduce the voltage signal of the power grid to a certain extent, the simulation waveform is

Simulation of TOGI PLL
Simulation conditions: The reference fundamental frequency is 50 Hz.At 0.5 s, the power grid voltage frequency jumps from 50 Hz to 52 Hz.In order to facilitate the analysis in the same figure and reduce the voltage signal of the power grid to a certain extent, the simulation waveform is shown in Figure 16.

Simulation of TOGI PLL
Simulation conditions: The reference fundamental frequency is 50 Hz.At 0.5 s, the power grid voltage frequency jumps from 50 Hz to 52 Hz.In order to facilitate the analysis in the same figure and reduce the voltage signal of the power grid to a certain extent, the simulation waveform is shown in Figure 16.The analysis results are as follows: (1) When the power grid frequency is 50 Hz, both the SOGI PLL and TOGI PLL can complete the power grid voltage phase and frequency locking, and the synchronization result of the two approaches are almost same and equally accurate (refer to the detailed waveform from 0.3 s-0.34 s). ( 2) When the grid voltage frequency jumps from the 50 Hz to 52 Hz, the SOGI PLL can't synchronize the grid voltage frequency and has an angular difference, but the TOGI can track the grid voltage frequency.However, the overshoot and adjusting time of the TOGI PLL is less than SOGI PLL.
In the detailed waveform from 0.8 s-0.84 s, the SOGI PLL has a small vibration in the zoom-in area, but the TOGI PLL tracks the new frequency well.(3) For the frequency estimation unit in the PLL structure, both the SOGI structure and TOGI structure can achieve accurate frequency estimation at 50 Hz, but the overshoot and adjustment time in the dynamic response process of the traditional SOGI structure are much larger than those of the TOGI structure.When the voltage signal of the power grid suddenly changes to 52 Hz, the frequency estimation result of the SOGI structure shows serious oscillations, while the frequency estimation effect of the TOGI structure is much better than that of SOGI structure due to the introduction of the frequency adaptive unit.
To summarize the above analysis, the adaptive frequency PLL based on the TOGI structure is proposed to solve the issue of grid voltage signals with direct current components, as well as to track the frequency in the case of frequency change.In summary, the advantage of TOGI compared to traditional SOGI was verified by the effectiveness of the simulation results and practicability of the single-phase PLL design.

Experimental Results
In this section, the adaptive frequency PLL based on TOGI is verified by an experimental test platform, which is a single-phase 5-kW bidirectional energy router equipment unit based on main control by a TMS320F28335 DSP and Xilinx FPGA Spartan6 LX9.
As shown in Figure 17, the 5-kW single-phase bidirectional energy router is a three-stage power electronic converter, consisting of AC/DC converter, DAB converter, and DC/AC converter.At the same time, two DC power interfaces and two AC power interfaces can be derived to realize the access to distributed ac devices and distributed DC devices.The bidirectional power energy router can realize bidirectional power flow and energy exchange between the distribution network and the microgrid.Since this experiment is mainly to verify the validity of PLL, only the controller structure of AC/DC converter is given.By using the control strategy of DC voltage outer loop and AC current inner loop, the DC voltage stability and AC side current control can be controlled effectively.
The structure of the AC/DC controller is shown in Figure 18.The AC/DC controller includes the DC voltage outer loop of and the AC current inner loop.Meanwhile, the phase of the grid voltage is tracked in real time through the TOGI PLL.The PLL parameters are same as with simulation parameters; Moreover, the hardware parameters and controller parameters of the energy router experimental platform are shown in Table 3.  3.According to [33], the ac voltage control-loop bandwidth is around five times lower than the inner-loop current controller and that satisfies the standard bandwidth ratio design criterion.Therefore, the system is expected to operate stably.Meanwhile, the inner-loop current controller is tuned at 4 + 800/s and the close-loop control bandwidth is 160 Hz, and inner-loop voltage controller is tuned at 1 + 3/s and the control bandwidth is 7.2 Hz in this section.Thus, the stability of the inner current and outer voltage loop can be ensured.
Figure 19 shows that SOGI and TOGI output signals from the sample data.In order to demonstrate the test result, we add a 20 V DC offset in the grid voltage, and the peak value of the grid voltage is −306 V and 346 V. Figure 19a is the SOGI orthogonal output signal, and it can extract the grid voltage sine wave, but the peak voltage values are −306 V and 346 V, which means it includes the DC offset.Figure 19b is the TOGI orthogonal output signal, and it can extract the grid voltage sine wave as well, but the peak voltage values are −330 V and 330 V, which means there is no DC offset in the TOGI output.Figure 20 shows at fundamental grid voltage and grid angle comparison between the SOGI scheme and the TOGI scheme.Figure 20a is the SOGI PLL output, and it is obvious that there is zero-cross deviation between the grid voltage and PLL angle extraction.Figure 20b is the TOGI PLL output, and it shows that the grid voltage zero-cross point is almost same PLL 0 deg.In brief, in the case of the grid voltage with DC offset, the TOGI can track the grid voltage angle without deviation.
Figure 20 shows at fundamental grid voltage and grid angle comparison between the SOGI scheme and the TOGI scheme.Figure 20a is the SOGI PLL output, and it is obvious that there is zero-cross deviation between the grid voltage and PLL angle extraction.Figure 20b       Figure 21 shows grid connection current and voltage waveform.Figure 21a shows SOGI PLL grid connection waveforms, and it has deviation of the zero-cross point between the current and voltage.Figure 21b shows TOGI PLL grid connection waveforms, and the zero-cross point is almost same.The practice test results demonstrate that TOGI with DC elimination and adaptive frequency tracking function improve the performance of the PLL.Finally, accomplish the unit power factor grid connecting and energy transfer.In order to express the power factor of grid-connected converter more clearly, the power factor (PF) of two groups of grid-connected current was analyzed by a FLUKE power quality analyzer.As  In order to express the power factor of grid-connected converter more clearly, the power factor (PF) of two groups of grid-connected current was analyzed by a FLUKE power quality analyzer.As shown in Figure 22, the PF based on SOGI PLL structure is 0.94, while the PF based on TOGI PLL is 0.99.It can be seen from the comparison that the grid-connected converter based on TOGI PLL can realize the operation of close to unit PF.In order to express the power factor of grid-connected converter more clearly, the power factor (PF) of two groups of grid-connected current was analyzed by a FLUKE power quality analyzer.As shown in Figure 22, the PF based on SOGI PLL structure is 0.94, while the PF based on TOGI PLL is 0.99.It can be seen from the comparison that the grid-connected converter based on TOGI PLL can realize the operation of close to unit PF.In addition, through measuring the harmonics of the grid voltage and grid-connected current with the FLUKE power analyzer, it is proved that the TOGI PLL has better harmonic elimination effects.The specific Total Harmonic Distortion (THD) analysis as shown in Table 4.

Conclusions
The traditional SOGI PLL and its improved PLL structure have many problems in the aspects of branch component elimination, frequency adaptation and DSP programming difficulty.This paper presents an adaptive frequency single phase PLL based on TOGI and draws a conclusion based on the above analysis.Compared to the SOGI structure orthogonal output, it can filter the low frequency noise to improve the accuracy of the PLL.By introducing an adaptive frequency unit, it can adjust the resonance frequency automatically in the case of grid voltage vibration, and enhance the sensitivity of the PLL.In the DSP implementation process, the programming workload is not complex, and the actual

Figure 1 .
Figure 1.The structure of a single phase phase-locked loop (PLL).

Figure 1 .
Figure 1.The structure of a single phase phase-locked loop (PLL).
this paper.The main innovations are as follows: TOGI can effectively eliminate the zero drift or grid voltage DC offset caused by the sampling process or another cause.At the same time, it can achieve frequency adaptive tracking in the case of the frequency fluctuation of the power grid voltage, and improve the tracking precision and adaptability of the PLL.Finally a MATLAB simulation and experiments for the proposed PLL based on TOGI structure are verified.

Figure 2 .
Figure 2. The block diagram of the second order generalized integrator (SOGI).

Figure 3 .
Figure 3.The Bode diagram for the SOGI structure.

Figure 3 .
Figure 3.The Bode diagram for the SOGI structure.

kω 2 s 2 +kω s+ω 2 ( 2 )
Energies 2018, 11, x FOR PEER REVIEW 5 of 21to make a DC difference in the magnitude of the orthogonal vectors.Therefore, in the OSG structure, also expected to present the characteristics of the band-pass filter and retain the information of the baseband signal.

Figure 4 .
Figure 4.The block diagram of SOGI with FLL.

Figure 4 .
Figure 4.The block diagram of SOGI with FLL.

Figure 5 .
Figure 5.The block diagram of the adaptive frequency PLL based on a TOGI structure.

Figure 6 .
Figure 6.The Bode diagram of

Figure 7 .
Figure 7.The Bode diagram of

Figure 6 .
Figure 6.The Bode diagram of H vd (s) and H vd (s).

Figure 6 .
Figure 6.The Bode diagram of

Figure 7 .
Figure 7.The Bode diagram of H vq (s) and H vq (s).

Figure 8 .
Figure 8.The Bode diagram of

Figure 8 .
Figure 8.The Bode diagram of H dc (s).

Figure 9 .
Figure 9.The block diagram of SOGI with a high-pass filter (HBF).
and TOGI structure have similar low frequency attenuation ability, and the low frequency attenuation ability of the SOGI-SOHBF structure is better than that of the TOGI structure.Meanwhile, it can be seen from the phase frequency characteristic curve at the grid frequency 0 ω , that the phase shift of the SOGI-FOHBF structure and SOGI-SOHBF structure are almost −79 deg and −82 deg, respectively.This is unacceptable for constructing orthogonal signals with a 90 deg phase difference.

Figure 10 .
Figure 10.The comparison of Bode diagrams between TOGI and SOGI-HBF at 0.1 Hz.

Figure 11 .
Figure 11.The comparison of Bode diagrams between TOGI and SOGI-HBF at 1 Hz.

Figure 11 .
Figure 11.The comparison of Bode diagrams between TOGI and SOGI-HBF at 1 Hz.

Figure 12 .
Figure 12.The comparison of Bode diagrams between TOGI and SOGI-HBF at 10 Hz.

Figure 12 .
Figure 12.The comparison of Bode diagrams between TOGI and SOGI-HBF at 10 Hz.
difference ε and output ' v β have the same trend change.On the contrary, when the frequency of power grid is higher than the TOGI resonant frequency ( difference ε and output ' v β have the opposite trend.Hence, the product result of difference ε and output ' v β determines the frequency difference signal f Therefore, it can adjust the difference of the ω and ' ω to zero through the proportional coefficient f k which is negative feedback gain, thus implementing frequency tracking.

1
Simulation of DC Offset Elimination 301 The conditions of the first simulation are about a larger DC offset and smaller AC signal 302 harmonic: grid voltage signal that contains the fundamental signal amplitude (311 V), a three order 303 harmonic (amplitude 5 V) and a DC component (+30 V).In order to prove the TOGI structure has 304 the ability to filter out the DC component, the simulation results are compared as shown in the 305 following Figure 14.

Figure 15 .
Figure 15.The comparison of input/output signals for SOGI and TOGI in condition 2.

Figure 16 .
Figure 16.Simulation result of PLL based on TOGI structure and SOGI structure.

Figure 16 .
Figure 16.Simulation result of PLL based on TOGI structure and SOGI structure.
power electronic converter, consisting of AC/DC converter, DAB converter, and DC/AC converter.At the same time, two DC power interfaces and two AC power interfaces can be derived to realize the access to distributed ac devices and distributed DC devices.The bidirectional power energy router can realize bidirectional power flow and energy exchange between the distribution network and the microgrid.
Energies 2018, 11, x FOR PEER REVIEW 16 of 21 Since this experiment is mainly to verify the validity of PLL, only the controller structure of AC/DC converter is given.By using the control strategy of DC voltage outer loop and AC current inner loop, the DC voltage stability and AC side current control can be controlled effectively.The structure of the AC/DC controller is shown in Figure 18.The AC/DC controller includes the DC voltage outer loop of and the AC current inner loop.Meanwhile, the phase of the grid voltage is tracked in real time through the TOGI PLL.The PLL parameters are same as with simulation parameters; Moreover, the hardware parameters and controller parameters of the energy router experimental platform are shown in Table

Figure 18 .
Figure 18.The control block diagram of energy router.

Figure 18 .
Figure 18.The control block diagram of energy router.

21 Figure 19
Figure 19 shows that SOGI and TOGI output signals from the sample data.In order to demonstrate the test result, we add a 20 V DC offset in the grid voltage, and the peak value of the grid voltage is −306 V and 346 V.Figure 19(a) is the SOGI orthogonal output signal, and it can Figure 19(a) is the SOGI orthogonal output signal, and it can extract the grid voltage sine wave, but the peak voltage values are −306 V and 346 V, which means it includes the DC offset.Figure 19b is the TOGI orthogonal output signal, and it can extract the grid voltage sine wave as well, but the peak voltage values are −330 V and 330 V, which means there is no DC offset in the TOGI output.

Figure 19 .
Figure 19.The grid voltage signal and orthogonal voltage signal.

Figure 20 shows
Figure20shows at fundamental grid voltage and grid angle comparison between the SOGI scheme and the TOGI scheme.Figure20ais the SOGI PLL output, and it is obvious that there is zero-cross deviation between the grid voltage and PLL angle extraction.Figure20bis the TOGI PLL output, and it shows that the grid voltage zero-cross point is almost same PLL 0 deg.In brief, in the case of the grid voltage with DC offset, the TOGI can track the grid voltage angle without deviation.

Figure 19 .
Figure 19.The grid voltage signal and orthogonal voltage signal.
is the TOGI PLL output, and it shows that the grid voltage zero-cross point is almost same PLL 0 deg.In brief, in the case of the grid voltage with DC offset, the TOGI can track the grid voltage angle without deviation.

Figure 20 .
Figure 20.The fundamental grid voltage and grid voltage phase.

Figure 21
Figure21shows grid connection current and voltage waveform.Figure21ashows SOGI PLL Figure21shows grid connection current and voltage waveform.Figure21ashows SOGI PLL grid connection waveforms, and it has deviation of the zero-cross point between the current and voltage.Figure21bshows TOGI PLL grid connection waveforms, and the zero-cross point is almost

Figure 20 .
Figure 20.The fundamental grid voltage and grid voltage phase.

shown in Figure 22 ,
the PF based on SOGI PLL structure is 0.94, while the PF based on TOGI PLL is 0.99.It can be seen from the comparison that the grid-connected converter based on TOGI PLL can realize the operation of close to unit PF.

Figure 22 .
Figure 22.Power factor analysis of grid connected converter.

Figure 22 .
Figure 22.Power factor analysis of grid connected converter.

Table 3 .
Hardware parameters of experimental platform

Table 3 .
Hardware parameters of experimental platform.

Table 4 .
Total Harmonic Distortion (THD) analysis of grid voltage and current based on TOGI PLL and SOGI PLL.