A Single-Phase Globally Stable Frequency-Locked Loop Based on the Second-Order Harmonic Oscillator Model

: This paper presents a novel frequency-locked-loop (FLL) scheme that provides estimates of the in-phase and square-phase fundamental components of a distorted single-phase reference signal and an estimate of its fundamental angular frequency. The main feature of the proposed scheme is that its design is fully based on the dynamical model of a single-phase signal generator, namely, the second-order harmonic oscillator (SOHO), which adds originality to the scheme. In fact, the proposed scheme owns a particular structure involving a set of orthogonal signals, which can be seen as the ﬁxed-frame representation of three-phase balanced signals. Additionally, a plug-in block is included as a mechanism to mitigate the effect of the harmonic distortion. A proof of global stability for the proposed scheme based on nonlinear argumentation is also included, which contributes to the novelty of the work and ensures convergence disregarding the initial conditions of the to-be-estimated signal components. In addition, explicit conditions are presented for the tuning of control parameters. Experimental results corroborate the performance of the proposed scheme under angular frequency variations, phase jumps, voltage sags and harmonic distortion on the reference signal. For comparison purposes, also the state-of-the-art second-order-generalized-integrator-based FLL and the single-phase synchronous-reference frame phase-locked loop are tested.


Introduction
Grid synchronization for the integration to the utility grid of renewable energy generation (REG) systems by means of grid-side converters (GSC) is a challenging problem due to the presence of harmonic distortion, sags/swells, noise and other disturbances, e.g., frequency deviations. In fact, this problem in the utility grid is an adverse impact due to the increased penetration level of GSC and the excessive usage of single-phase, asymmetric, and non-linear loads. Specifically, harmonic distortion exists due to the nonlinear characteristics of devices, and loads and harmonic currents result from the normal operation of non-linear devices on the power system [1]. Therefore, GSC for REG (such as photovoltaic and wind power systems) must be provided with control systems including a synchronization unit to guarantee the injection of power towards the grid with the proper phase-shift and respecting the standard requirements despite of such perturbations. For this, the synchronization unit may provide a clean estimation of the phase angle, frequency and amplitude of a periodic reference, namely, the grid voltage and/or current [2][3][4].
Conventionally, phase-locked loop (PLL) systems have served as synchronization units. Their standard structure is a feedback system, where the periodic reference represents the input, and the estimate signal is the output, generally, a sinusoidal signal; a product (or correlation) between input and output is used as a phase detector, which is then processed in the direct loop composed by the cascade interconnection of the loop filter (LF) and the voltage-controlled oscillator (VCO), [5]. Recently, a new family of synchronization units appeared, these schemes were referred to as frequency-locked-loop (FLL) schemes [6][7][8][9]. The main difference between FLL and the conventional PLL is the omission of the VCO in the FLL [5]. Hence, these schemes were also referred to as the VCO-less representation of the PLL. Furthermore, in the FLL case, the fundamental frequency is directly estimated and the operation is based on such an estimate, while the operation in the PLL is based on the estimation of the phase angle [6,10,11]. Both types of schemes have been thoroughly explored; in some schemes, such a difference is not very clear, and thus, the name PLL and FLL has been used indistinctly. Another way, perhaps clearer to distinguish between these two approaches is that in the FLL there is not explicit expressions of sinusoidal signals.
Moreover, despite the synchronization in three-phase systems, possibly motivated by traditional power systems (see some applications in REG systems [12,13]), singlephase PLLs are becoming of central interest for investigation and development due to the current massive deployment of grid-tie inverters at residential levels, due to domestic photovoltaic (PV) installations [14]. Additionally, PLL has been extensively used for the control purposes and for stability improvement [15,16]. Initially, the main idea of singlephase PLLs was to follow a similar approach as that of the balanced three-phase case, i.e., by generating orthogonal signals, which seemingly fit in the context of (fixed-frame) αβ-coordinates, where the single-phase synchronous reference frame (SRF)-based PLL is widely used thanks to its desirable performance and its simple yet robust structure, see for instance [5,17]. In [17], an extension of the well-known three-phase SRF-based PLL is presented, for the single-phase case. This intuitive solution provides a good platform for the development of future improvements in terms of disturbance rejection, harmonic compensation and so forth.
Among the current widespread strategies that can be found in the literature, the orthogonal-signal-generators-based single-phase PLL is perhaps the most appealing. This family of PLLs is very popular due to its simple implementation, and that it displays a robust performance against common grid disturbances. The solutions based on this general strategy vary in their level of conservatism, robustness and additional features such as harmonic compensation, design guidelines and stability. A review of the most widespread versions have been condensed in the survey [18]. Other contributions that are classified as power-based and quadrature signal generation-based as well as their advantages and disadvantages, are gathered and presented in detail in [19]. It is argued that quadrature-signal-based PLLs display a superior performance with respect to powerbased PLLs in terms of double-frequency disturbance rejection, dynamic response and harmonic filtering. However, power-based PLLs have a much simpler structure that facilitates their implementation and reduces the computational burden.
More recently, Ref. [20] presents a revision of most PLL or FLL schemes reported so far, where authors use linearization arguments to get the representative transfer functions, in some cases also referred to as small signal modelling. At this level, most of the linearized synchronization schemes surely become very similar to each other, and some are just identical, which is not a mystery, as they mostly become band-pass-filters (BPF) tuned at the fundamental frequency. However, this is just a local appreciation. The synchronization schemes are usually nonlinear and may have quite different dynamical models, which distinguish themselves from one another. Then authors in [20] apply simple tools from linear systems theory to perform the stability analysis. However, all these results are only valid locally.
In [21], the dynamic assessment of several single-phase PLLs is presented. It is shown that the Park-PLL and the second-order-generalized-integrator (SOGI)-based FLL can be unified and moreover, it is also argued that there is still room for improvement in terms of their optimization via the fine-tuning of their parameters. In [22], the SOGI-based FLL quadrature signal generator is carefully examined. It is shown that a reported disadvantage of this strategy, corresponding to the lack of accuracy due to the frequency closed-loop estimation, can be alleviated by removing such loop assuming a fixed frequency and adding a compensation strategy for correcting errors caused under small-signal variations in the line frequency. In [23], a phase-estimation under frequency variations for distorted signals is presented, as well as experimental results. Despite the fact that the occurrence of oscillations in the experiments denotes the possibility of improvement, the general contribution is very promising.
Motivated by the aforementioned issues and challenges, this paper focuses on the study of a novel continuous-time FLL strategy that is able to directly estimate the fundamental component, as well as its quadrature component, of a highly distorted single-phase reference signal. This characteristic is corroborated and documented with respect to classical approaches in this work. Moreover, it also provides an accurate estimation of the fundamental angular frequency of the reference signal. The originality of this contribution lies in the model-based design of the proposed scheme, i.e., the design is based on a quite general model of a single-phase sinusoidal signal generator, which turns out to be a second-order harmonic oscillator (SOHO). The proposed strategy is thus referred to as SOHO-FLL. In the case of periodic signals, such a generator is composed by a bank of SOHOs with adaptive capabilities with respect to the presence of harmonics.
To the best of the authors' knowledge, this nonlinear scheme has never been reported before. There are, however, certain similarities with the M-SOGI scheme [7], whose structure is also based on a second-order oscillator. Nevertheless, the nonlinear dynamical model description, and the states considered for the state space realization are quite different, as will be explained later. Consequently, both of these schemes may present similar performances. Thus, the proposed SOHO-FLL can be seen as an alternative more natural solution for the synchronization issue.
As above mentioned, the linearization of the proposed SOHO-FLL around the equilibrium yields a BPF similar to other synchronization schemes. This is perhaps the reason why many practitioners consider that most orthogonal-signal-generators-based single-phase PLLs are equivalent. However, this is by no means a complete view of the scheme, and no conclusion other than local stability can be established, as well as first tuning rules of parameters. Therefore, another contribution of the present work is a stability analysis that relies on nonlinear argumentation rather than on conventional linearization arguments usually appealed in many previous works, thus incorporating novelty to the work. For this, a transformation to the synchronous reference frame coordinates is proposed, where it is simpler to find an energy-storage function to proof stability using the Lyapunov approach. As a result, explicit conditions on the parameters are obtained to ensure global stability. Parameter tuning rules for performance are also included, which are similar to previously reported schemes, as they are also based on linearization [24]. Therefore, the proposed scheme is intended to guarantee synchronization with a reference signal (either voltage or current) in a single-phase system subject to harmonic distortion, with guaranteed stability and good performance, as the structure follows from the model of a quite generic periodic signal.
A series of experiments are included, where the performance of the FLL scheme is tested under stepwise angular frequency variations, phase-jump disturbances, voltage sags and the effect of the harmonic compensation mechanism. All tests take into account a relatively strong harmonic distortion in the reference signals. Moreover, the experiments include tests of the single phase versions of the SOGI-based FLL and the SRF-based PLL strategies to compare the responses among all schemes.

Model of the Generator of a Sinusoidal Signal
A harmonic oscillator is a system able to generate a sinusoidal signal. The basic structure of this generator, in continuous time domain, involves a second-order system. It is referred to in the paper as a second-order harmonic oscillator (SOHO) [24]. This structure is derived in what follows for the sake of completeness, and will be used later on for the design of the proposed PLL.
Consider a single-phase reference signal v α (t) comprising a fundamental component only, i.e., a pure sinusoidal signal without harmonic distortion. This signal may represent, for instance, the voltage signal of the grid. This signal can be described in a quite general form using the following basic representation: where ρ is a vector rotating at the fundamental frequency ω 0 , v dq is the vector of constant coefficients at the fundamental frequency, also referred to as the phasor. Usually, v d and v q are referred to as the real and the imaginary components of the phasor, respectively. Notice that, in particular, v α (0) = v d .
The time derivative of (1) is given bẏ where J is a skew symmetric matrix, i.e., J 2 = −I 2 , J −1 = −J, with I 2 the 2 × 2 identity matrix. Now, define the following auxiliary variable which is referred to as the square-phase component, while v α (t) is referred to as the in-phase component [25]. Notice that v β (0) = v q . The time derivative of (3) is given bẏ This leads to the complete description, i.e., the generator, of the sinusoidal signal v(t), which is given byv The model (5) represents a SOHO, i.e., a simple resonator, oscillating at a frequency ω 0 . In fact, the in-phase component v α (t) and the square-phase component v β (t) represent two orthogonal signals, which can be interpreted as the fixed-frame coordinates or αβcoordinates, respectively, of a virtual balanced three-phase system.
Using the auxiliary vector variable v (5) can be written in matrix form as follows:v where v αβ (t),v αβ (t) ∈ R 2 . From now on, the time argument is removed to facilitate the reading of equations. Based on definitions (1) and (3), the following relationship referred to as the inverse Park transformation [26] can be recovered: which permits the transformation from (synchronous-frame) dq-coordinates to (fixed-frame) αβ-coordinates. This transformation can be written in matrix form as In principle, v d and v q are two constants that define the amplitude and phase-shift of the rotating vector v αβ . An interesting case occurs when v q = 0, which yields the following description for v αβ : v This means that v q = 0 imposes a zero phase-shift to vector v αβ , while its amplitude is given by v d . This particular case will be used in the next section to simplify the presentation.
The inverse of transformation (8) is referred to as the Park transformation, and is given by where e −Jω 0 t = e Jω 0 t . These transformations are used in what follows to describe the proposed SOHO-based FLL in terms of the dq-coordinates.

Single-Phase SOHO-Based FLL
Based on the dynamical model of the SOHO (5), which represents the generator of a set of orthogonal signals, the following estimator referred to as the SOHO-based FLL has been proposed:˙v wherev α andv β are the estimates of signals v α and v β , respectively; γ > 0 is a design parameter used to introduce the required damping, andω 0 is the estimate of the unknown, though constant, fundamental frequency ω 0 . The proposed SOHO-based FLL comprises a copy of system (5) with an additional damping term, which is referred to as the SOHO-based quadrature signal generator (SOHO-QSG). The SOHO-QSG, represented by subsystem (11) and (12), is an oscillator aimed to follow the response of the SOHO (5) by forcingv α to follow v α . The proposed SOHObased FLL is enhanced with an adaptive law (13) to reconstructω 0 , which is referred to as the fundamental frequency estimator (FFE). Notice that the estimation of theω 0 in (13) involves the use of the product between the orthogonal signals as a mechanism to detect the phase in the FFE. The estimateω 0 is then used in the SOHO-QSG. Roughly speaking, the proposed SOHO-based FLL is aimed to reconstruct a clean (filtered version of v α ) in-phase componentv α , its corresponding square-phase componentv β , which form a set of orthogonal signals, and an estimate of the fundamental frequencyω 0 . Notice that the controller exclusively involves feedback of the output v α , as this signal is the only available output. Figure 1 shows the block-diagram of the overall proposed SOHO-based FLL, which comprises the SOHO-QSG coupled with the FFE.

Remark 2.
If the fundamental frequency is considered known and constant, then the proposed scheme can be reduced to the following simplified scheme that has been used in earlier works [27]:v which turns out to be a simple BPF, i.e., a second-order linear time invariant system.

Differences between the Proposed SOHO-and the SOGI-Based FLL
At first glance, the structure of this scheme is similar to the SOGI-based FLL extensively addressed in the literature [6]. Figure 2 shows the block diagram of the SOGI-based FLL, whose dynamics are described by the following mathematical model:v where, as in the SOHO-based FLL,v α andv β represent estimates of signals v α and v β , respectively; γ > 0 is a design parameter used to introduce the required damping, and ω 0 is the estimate of the unknown fundamental frequency ω 0 . Notice that, in contrast to the SOHO-based FLL, the state variables are represented byv α and ϕ, whilev β is considered as an output variable in the SOGI-based scheme. The issue here is that the scales between these two states is different by an order of ω 0 , i.e., the state variable ϕ is a scaled down version ofv β as shown in (19). This may demand a special attention during the implementation process, most of all in a fixed-point implementation, as the scales are too different. Therefore, it is recommended to use in this case a floating-point device for the implementation of the SOGI-based FLL. Notice that the SOGI-based FLL involves a scheme that also generates the orthogonal signals (SOGI-QSG), and a scheme to estimate the fundamental frequency (FLL). However, there are significant structural differences between the blocks named SOHO and SOGI, which are described next.
(i) Notice that the model in the SOGI-based FLL involves additional products byω 0 , which causes, in principle, the existence of a square ofω 0 , as observed in (16). In contrast, the SHOHO-based FLL described by (11)-(13) does not exhibit any square ofω 0 . (ii) The latter may entail numerical errors ifω 0 contains residues of higher order harmonics. This could be the case, for instance, if the reference signal v α is considerably distorted with higher order harmonics, and the scheme does not incorporate a mechanism to compensate such a distortion. This could also happen if the adaptive law (18) does not filter well the second harmonic caused by the product between sinusoidal signals in the phase detector, i.e., the product between the error (v α −v α ) and ϕ.
Recall that squaring a sinusoidal signal produces an unavoidable DC-offset, which, at the end, is added as a DC offset error to the estimateω 0 . (iii) This same DC-offset error may also entail a small unbalance between the estimated orthogonal signalsv α andv β , as the estimation ofv β is obtained indirectly by multiplying the auxiliary state ϕ byω 0 , as described in (19). In fact, this issue has been observed during the experimental tests, where a distorted reference signal was considered without enabling the harmonic compensation mechanism. It was observed that, under these conditions, the SOGI-based FLL exhibited a more pronounced steady state error than in the SOHO-based FLL. In both schemes, this issue is alleviated after introducing the compensation mechanism to cope with the harmonic distortion.

Stability Analysis
This section shows that the estimatesv α ,v β andω converge towards their corresponding references v α , v β and ω 0 with guaranteed stability. The study is based on the transformation of subsystem (11) and (12), originally expressed in terms of virtual αβ-coordinateŝ v α andv β , to its representation in terms of the equivalent synchronous-reference frame coordinates, i.e., in terms of the corresponding dq-coordinates. For this, the Park transformation above described (10) and its inverse (8) are considered. (1), where the fundamental frequency ω 0 > 0 and the coefficients v d and v q are real and unknown constants. For a proper selection of parameters γ > 0 and λ > 0, in such a way to fix a bandwidth well below 2ω 0 , the SOHO-based FLL (11)-(13) has a unique equilibrium point, which is globally asymptotically stable. (11) and (12) can be written in matrix form as followṡv

Proof. Subsystem
The transformation of system (20) to its representation in dq-coordinates is based on the following coordinates transformation, which corresponds to the above Park transformation: whose inverse is given byv which can be alternatively written as follows: Then, obtaining the time derivative of (21), and using (20) yieldṡv where the fact that Je −Jω 0 t = e −Jω 0 t J has been appealed. For ease of presentation, and without loss of generality, the particular definition of v α = v d cos (ω 0 t) given in (9) is used in the above expression, which yieldṡv Replacingv α in the above expression by its description in (23), and after some lengthy but straightforward calculations, the following expression is obtained:v In what follows, a description in terms of dq-coordinates is obtained for the expression (13) used to reconstruct the estimateω 0 . For this, the definition of v α = v d cos (ω 0 t) given in (9), as well as the description ofv α andv β given in (23) and (24) are used in (13), which yields the following expression:ω Notice that second-order harmonics, due to products between sinusoidal signals, arise in (26) and (27). However, as the main interests are in the average of the estimatesv dq and ω 0 , then system parameters must be designed in such a way to filter out all second-order harmonic perturbations, i.e., the bandwidth of both subsystems must be limited well bellow the second-order harmonic. Therefore, these harmonics can be neglected from expressions (26) and (27), i.e., only their DC components are preserved (Strictly speaking, the stability of the scheme can only be guaranteed in the ultimately boundedness sense due to the above averaging assumption). This yields the following simplified expressions, which describes the dynamics of subsystem (20) and (13) in terms of the dq-coordinateṡv av dq = (ω av where (·) av stands for the average or DC component of (·).
In summary, the overall model of the proposed SOHO-based FLL expressed in dqcoordinates is given by expressions (28) and (29). The representation of this model in terms and has a unique equilibrium point at the origin, i.e., [ṽ d ,ṽ q ,ω 0 ] = [0, 0, 0].

Mechanism for Harmonic Distortion Compensation
In many applications, the systems may include nonlinear components that affect the waveform of the variables involved, despite this, synchronization with respect to these distorted variables has to be guaranteed for the proper operation of controllers [2]. This is the case of, for instance, active filters, grid tied inverters, an so on. If the reference signal v α is distorted with higher harmonic components, then the above estimator (11)- (13) can be augmented with a harmonic compensation mechanism (HCM) aimed to estimate the higher-order harmonics part of v α , whose design is explained in what follows. For this, consider that the estimatev α can be expressed as the sum of their fundamental and harmonic parts as follows:v where the harmonic partv α,h is described bŷ withv α,n representing the estimate of the nth harmonic component and H = {1, 3, 5, . . . } being the set of harmonics under consideration. The design of the estimator for the nth harmonic component is based on the structure of the SOHO-based FLL, i.e., copies of the SOHOs of the generator model of the periodic signal. In particular, the first two Equations (11) and (12), representing the SOHO, are modified and tuned for the nth harmonic ofω 0 , i.e., it is proposed to estimate the nth harmonic component as follows:v where γ n > 0 (n ∈ H) is a design gain to insert damping for the nth harmonic component. The set of Equations (36) and (37) is referred to as the SOHO-n (n ∈ H). The fundamental frequency estimator (13) does not require any modification. The only difference is thatv α includes now both parts, fundamental and harmonic, as described in (34). The parallel connection of the SOHO-n (n ∈ H) is referred to as the HCM. A block diagram of this scheme is shown in Figure 3. Figure 4 shows the way to insert the HCM in the SOHObased FLL. In fact, the HCM block can be included or not depending on how distorted the reference v α is. A similar structure composed by a bank of harmonic oscillators has also been reported in earlier works for harmonic compensation [6,7], which is based on the internal model principle [24]. The main difference here is the model describing the harmonic oscillator dynamics, that, in the present case, follow the model of the SOHOs of the generator model of the periodic signal.

Tuning of Control Parameters
The above conditions λ > 0 and γ > 0 (re-named as γ 1 in case of involving an HCM) are necessary conditions for stability only. In what follows, explicit expressions are obtained to design the controller parameters to accomplish a performance criterium. The design follows similar guidelines as described in [24], as these tuning rules are based on the linearization of the system model.
The tuning of λ and γ 1 (originally γ in the non distorted case, i.e., without HCM) is based on the linearization of system (30) and (31), which yields the following LTI system: Notice that this linearized system is formed by two decoupled subsystems, namely, a stable first-order subsystem represented by the first row of (38), and a second-order subsystem composed by the two last rows.
The first-order subsystem has a cut-off frequency of ω c1 = γ 1 /2. Recalling that the transformation to dq-coordinates involved products of sinusoidal waveforms of frequency ω 0 , which produces second-order harmonics as disturbances as observed in (26) and (27), these disturbances were neglected as the interest was on the average component of the variables; therefore, it is convenient to maintain the ω c1 < 2ω 0 , which yields the following restriction for γ 1 γ 1 < 4ω 0 .
The second-order system has a characteristic polynomial given by s 2 + γ 1 s/2 + λv 2 d /2 = 0, whose natural frequency is given by ω n = v d √ λ/2. In a second-order system, if the damping factor varies in the interval [0, 1], then its bandwidth ω BW is included in the range 0.64ω n ≤ ω BW ≤ 1.55ω n . Out of this, the λ can be tuned according to where, as in the first-order system, a bandwidth of ω BW ≤ 2ω 0 can also be considered.
In what follows, a first tuning rule for estimation gains γ n (n ∈ {3, 5, 7, ...}) of the SOHOs is presented. For this, it is assumed that the SOHOs are very selective, and that ω 0 ∼ = ω 0 , i.e., the effect of the dynamics of the FFE, is neglected. Out of this, the dynamics of each SOHO-n (n ∈ H, n = 1) can be analysed separately. Based on this, (36) and (37) are reduced to the following set of second-order LTI systems: The characteristic polynomial of the nth second-order system is given by s 2 + γ n s + n 2 ω 2 0 = 0. Fixing a settling time τ st,n following a 2% criterion for the envelope response of the n-th harmonic component yields the following condition for γ n :

Experimental Results
The proposed SOHO-based FLL scheme was programmed in the fixed-point DSP TMS320F2808 (manufactured by Texas Instruments Inc., Dallas, TX, USA). This scheme has been discretized using a Euler-backward approximation. The sampling frequency has been fixed to f s = 12 kHz, which is sufficiently large to compensate the imperfections of such an approximation, and allows enough time to solve the algorithm equations, including an HCM, to cope with harmonic distortion.
For the sake of comparison, the SOGI-based FLL [7] and the single-phase SRF-PLL [17] (shown in Figure 5) have been implemented and tested under similar conditions as for the proposed SOHO-based FLL. As before, the Euler-backward approximation for their discretization has been used. A first tuning for the SOGI-based FLL has been performed according to the rules suggested in [7,9]. The parameters tuning was then refined by trial and error until a similar response to that of the SOHO-based FLL was obtained. In particular, the same gain for the FLL has been used in both schemes. It was observed also that the SOGI-based FLL requires a careful selection of the fixed-point formats for implementation, as the scheme is very sensitive to the resolution of signals to guarantee a similar response as for the SOHO-based FLL. The tuning of the SRF-based PLL scheme has been performed according to the rules suggested in [5,17]. The SOGI-based FLL includes the HCM described in [7], which allows a fair comparison with respect to the proposed scheme including its HCM. In the case of the SRF-based PLL, there is not such a version involving an HCM up to now.
The reference signal v α has an amplitude of its fundamental component of 300 V, and a fundamental frequency of f 0 = 50 Hz ( ω 0 = 100π r/s), unless otherwise indicated. The reference signal is polluted with a small amount of harmonic distortion, as described in Table 1, i.e., it comprises a fundamental component and odd harmonics all in the set H = {1, 3, 5, 7}, unless otherwise indicated. The HCM involves modules tuned at these harmonics. It was observed that there is a compromise between the amount of harmonic components to compensate and the sampling frequency. More harmonics to compensate, more computational burden, and the sampling frequency have to be lowered, which entails more numerical errors due to the discrete approximation. In this tests, a sampling frequency has been fixed to 12 kHz which is enough to allow compensation of the harmonics in H, while preserving a negligible amount of steady state error in the frequency estimate. The SOHO-based FLL parameters are set to: λ = 30, γ 1 = 200, γ 3 = 250, γ 5 = 350, and γ 7 = 600. The design of these parameters follows the tuning rules (39), (40) and (42) above given. All of them are positive, which is a necessary condition to preserve stability.  As above described, the SOGI-based scheme has two additional gain multiplications and one additional multiplication between two variables on each harmonic oscillator, which may not be as relevant in cases where only a few harmonic components are compensated, but may become an issue if more harmonic oscillators are incorporated in the scheme. The present case study considers only four harmonic oscillators tuned at 1st, 3rd, 5th and 7th harmonics. Therefore, as expected, there is a minimal difference between the execution times of the proposed SOHO-based FLL and the SOGI-based FLL schemes due to these additional operations. In fact, the execution time of the proposed SOHO based scheme is 37.2 µs, while that of the SOGI-based scheme is 38 µs. In the case of the SRF, the execution time grows to 41.2 µs, which is mainly due to the additional integrator and the use of trigonometric functions for its realization.
The following list of experiments is proposed to evaluate the performance of the proposed scheme: (i) Steady state response at fundamental frequency f 0 = 50 Hz (ω 0 = 100π rad/s) and frequency spectrum; (ii) Stepwise variation of the fundamental frequency f 0 fluctuating between 50 Hz (100π rad/s) and 47 Hz (50π rad/s); (ii) Enabling the HCM at a given time while preserving a fixed frequency f 0 = 50 Hz; (iii) A phase jump of −30 degrees, while maintaining a fixed frequency f 0 = 50 Hz; (iv) A voltage sag going from 100% to 50% and back. vv ,1v ,1 Figure 6. Steady state responses of the proposed SOHO-based FLL at f 0 = 50 Hz of (top) v α , and (bottom)v α,1 andv β,1 (x-axis: 10 ms/div; y-axis: 200 V/div). Figure 6 shows the steady state response of the SOHO-based FLL considering a distorted reference signal v α at a fundamental frequency of 50 Hz. Notice that the estimated fundamental in-phase componentv α and its square-phase companion signalv β are almost pure sinusoidal signals, despite the harmonic distortion present in the reference signal v α . At first sight, the estimatedv α (bottom plot) seems to be approximately in phase with the distorted reference v α (top plot). In fact, the proposed SOHO-based scheme guarantees thatv α must be in phase with the fundamental component of v α only, otherwise SOHO-1 (tuned at the fundamental frequency) will explode due to its relatively high gain at this resonance frequency. The steady state response of these signals in the SOGI-based scheme and in the SRF-based PLL are very similar to the response of those in the SOHO-based scheme. They are not included here for the sake of space limitation. This is not the case of the fundamental frequency estimation, as explained next. Figure 7 shows the transient response of the SOHO-based scheme going from a pure sinusoidal signal to a distorted signal. The HCM is working at every moment. Notice that the estimate of the fundamental frequencyω 0 stays almost constant despite the introduction of the harmonic distortion. The response of the SOGI-based scheme is very similar as well, and is not included for the sake of space limitation.   Figure 8 shows the transient response of the SRF-based PLL scheme going from a pure sinusoidal signal to a distorted signal. Notice that, in this case, the scheme is very sensitive to harmonic distortion and thus the estimateω 0 exhibits a considerable ripple.   Figure 9 shows the frequency spectra, under the SOHO-based FLL, obtained by means of the fast Fourier transform (FFT) of (top) the reference v α , and (bottom) the estimatê v α,1 for a fundamental frequency fixed to 50 Hz. The estimatedv α,1 for the SOHO-based scheme achieves a THD of 1.25%, which can be calculated from Figure 9. The frequency spectra of the SOGI-based FLL and the SRF-based PLL are very similar to the spectrum of the SOHO-based scheme. They are ommited here for the sake of space limitation. In the case of the SOGI-based FLL the THD of the estimatedv α,1 achieves a THD of 1.6%, while the THD for the SRF-based PLL achieves 1.9%. Notice that all three THDs are much smaller than the THD of 14.5% of v α .

Frequency Step
The transient responses during a step change of f 0 going from 50 Hz to 47 Hz are shown in Figure 10 for the proposed SOHO-based FLL, the SOGI-based FLL and the SRF-based PLL. Notice that, in either case, the estimateω 0 (third plot from top) reaches the desired reference after a relatively short transience. In fact, the the proposed SOHO-based scheme settles at about 2 cycles, while the SOGI-based FLL settles in about 3 cycles. A slight steady state error in the SOGI-based scheme was also noticed. This figure also shows that the estimated signalv α (second plot from top) becomes almost pure sinusoidal waveforms after a relatively short transient despite of the harmonic distortion present in the reference signal v α . Figure 10c shows the corresponding signals for the SRF-based PLL, where the ripple due to the harmonic distortion is always present in the estimateω 0 . This ripple can be reduced by reducing the gains of the SRF-based PLL at the expenses of deteriorating the dynamical response. As observed, the algorithm settles (in average) at about three cycles, reaching (on average) the frequency reference. (top) v α ,v α,1 (x-axis: 10 ms/div; y-axis: 400 V/div) (middle)ω 0 (x-axis 10 ms/div; y-axis 97.66 rad/s/div) and (bottom) step-change enable signal. Figure 11a,b show the transient response of the estimated frequencyω 0 (in the top plots) and the estimatedv α,1 after the HCM is enabled in the proposed SOHO-based FLL and in the SOGI-based FLL, respectively. The enabling signal is depicted in the bottom plot, while the fundamental frequency reference ω 0 = 100π rad/s is marked with a dotted line on the top plots of both figures. Notice that, as above described, before enabling the corresponding HCM, a small ripple and a slight steady state error with respect to ω 0 = 100π rad/s are observed in both cases. In particular, the SOGI-based FLL exhibits a slightly bigger steady state error before the HCM is enabled. Then, after the HCM is enabled, both the ripple and the steady state error are minimized in both cases.  Figure 12 shows the transient responses during a phase jump of −30 degrees in the reference of all three schemes under test, while keeping f 0 = 50 Hz at every moment. Phase jumps are typically associated with distribution system faults and are in the range of −30 to +30 degrees. For transmission faults, the phase jump is small, typically less than 5 degrees; see [1] for further details. Notice that, after a relatively short transience, the estimatesω 0 of both the SOHO-based and SOGI-based schemes converge to the correct value of the fundamental frequency of the reference. However, the corresponding transient response of the SRF-based PLL under this same phase jump, shown in Figure 12c, exhibits a slightly bigger transient, which takes about three cycles. This response shows, in addition, a considerable ripple due to the inability of this scheme to cope with harmonic distortion. (y-axis: 400 V/div),ω 0 (y-axis: 97.66 rad/s/div), and (bottom) phase-jump enable signal (x-axis: 10 ms/div in all plots). Figure 13 presents the transient response of the proposed SOHO-based FLL during a voltage sag going from (a) 100% to 50% and (b) back, while keeping f 0 = 50 Hz and the harmonic distortion. Notice that, in either case, the estimated signalv α gets almost pure sinusoidal waveforms after a relatively short transient despite of the harmonic distortion present in the reference signal v α . Moreover, this figure also shows that, in the proposed SOHO-based scheme, the estimateω 0 (top plot) reaches the desired reference after an almost imperceptible transient. The response of the SOGI-based scheme is very similar, and is omitted here for the sake of space limitations. The corresponding response of the SRF-based PLL is shown in Figure 14. Notice that, after a relatively short transience, the estimateω 0 recuperates its reference. Moreover, it was observed that during the sag, the ripple is smaller than in normal operation.  Figure 13. Transient responses of the proposed SOHO-based FLL after a voltage sag (a) from 100% to 50%, and (b) back from 50% to 100%, while keeping f 0 = 50 Hz and with harmonic distortion: (from top to bottom) v α ,v α,1 (y-axis: 400 V/div),ω 0 (x-axis: 10 ms/div; y-axis: 97.66 rad/s/div), and voltage-sag enable signal (x-axis: 10 ms/div in all plots).  Figure 14. Transient responses of the SRF-based PLL after a voltage sag (a) from 100% to 50%, and (b) back from 50% to 100%, while keeping f 0 = 50 Hz and with harmonic distortion: (from top to bottom) v α ,v α,1 (y-axis: 400 V/div),ω 0 (x-axis: 10 ms/div; y-axis: 97.66 rad/s/div), and voltage-sag enable signal (x-axis: 10 ms/div in all plots).

Discussion
The experimental evidence showed that the performance between the SOHO-based and the SOGI-based FLLs was quite similar, except for slight differences in the transients. A slightly bigger steady-state error was also observed in the frequency estimation in the SOGI-based FLL for a reference signal with harmonic distortion and without enabling the HCM. As expected, the response of the fundamental frequency estimate in the SRFbased PLL contained a considerable amount of ripple due to the inability of this scheme to cope with harmonic distortion present in the reference signal. The transients due to perturbations were also bigger on the frequency estimate in this scheme. However, the effect of perturbations was not noticeable in the estimates of the in-phase and squarephase components of none of the three schemes. Theoretically, it was also noticed that the additional nonlinearities in the SOGI-based FLL structure caused a considerable difference between the scales of its state variables. This may entail numerical errors if the resolution of the digital device is limited. Moreover, it was observed that the SOGI-based FLL included additional operations on each harmonic oscillator considered, which may demand more computational effort, most of all, if the harmonic oscillators used to compensate harmonics grows. As the experiments in the present work were realized in a fixed-point device, special attention was given to every single fixed-point format used in the mathematical operations to achieve a proper operation. This sensitivity took much more effort during the implementation process of the SOGI-based FLL due to this inherent difference in amplitudes among states. Therefore, it is highly recommended to use a floating-point implementation instead.

Conclusions
In this paper, a novel single-phase FLL system was proposed, whose design was based on the generator model of a sinusoidal reference signal referred to as a second-order harmonic oscillator (SOHO). The proposed SOHO-based FLL comprised an in-phase and square-phase generator based on the SOHO structure (SOHO-QSG), plus a fundamental frequency estimator (FFE). In case of a reference signal highly distorted with harmonics, an additional modular harmonic compensation mechanism (HCM) was proposed to reduce the effects of the low-harmonics distortion. The HCM not only preserved the speed of response, but also helped to improve the precision of the response. The proposed SOHObased FLL produced two orthogonal signals (with a phase-shift of 90 degrees among them), emulating a set of three-phase balanced signals expressed in αβ coordinates. The proposed SOHO-based FLL did not require the transformation to synchronous reference frame coordinates as in other schemes. For practical applications, e.g., the proposed scheme as synchronization unit of GSC for REG systems, the experimental evidence showed that the proposed SOHO-based FLL produced undistorted and accurate estimations of the fundamental components and frequency, despite a fluctuation of the fundamental frequency. It was observed that, under the presence of harmonic distortion in the periodic signal reference, a steady state error came up on the estimation of the fundamental frequency, as well as a harmonic distortion mainly in the in-phase signal estimate. However, this error was considerably reduced after activation of the HCM scheme. For comparison purposes, the state-of-the-art SOGI-based FLL and the conventional single-phase synchronous-reference frame-based PLL was also implemented and tested. In addition, as theoretical contribution, a stability analysis based on non-linear tools, such as the Lyapunov approach, rather than in linearization arguments was also performed, based on the transformation to synchronousframe coordinates representation of the proposed SOHO-based FLL. Finally, the theoretical application of the stability analysis are the obtained explicit conditions to get a first tuning of the control parameters in order to achieve certain performance specifications of the proposed SOHO-based FLL. Funding: The work of D. del Puerto-Flores was partially supported by the internal project UdeG-PROSNI-2021.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.

Acknowledgments:
We thank the Mexican government of the 4T, led by President A.M. Lopez Obrador, for maintaining the SNI's fellowship stimulus to researchers attached to private schools.

Conflicts of Interest:
The authors declare no conflict of interest.