An αβ-Frame Moving Average Filter to Improve the Dynamic Performance of Phase-Locked Loop

The moving average filter (MAF) is one of the most widely used methods to block harmonics in a phase-locked loop (PLL). This paper proposes a simple structure for MAF to work directly in the <inline-formula> <tex-math notation="LaTeX">$\alpha \beta $ </tex-math></inline-formula>-frame (called <inline-formula> <tex-math notation="LaTeX">$\alpha \beta $ </tex-math></inline-formula>MAF). Compared with the standard <italic>dq</italic>-frame MAF (<italic>dq</italic>MAF) used as an in-loop filter, <inline-formula> <tex-math notation="LaTeX">$\alpha \beta $ </tex-math></inline-formula>MAF acts as a prefilter and significantly improves the PLL dynamic response. Its derivation process and implementation is described in detail in both continuous and discrete time domains. In an adaptive prefilter-based PLL, a frequency feedback loop (FFL) is indispensable, but it is not easy to design. Therefore, nonadaptive <inline-formula> <tex-math notation="LaTeX">$\alpha \beta $ </tex-math></inline-formula>MAF is suggested, and a corrector is added to eliminate the phase error at off-nominal frequencies. In this paper, the small signal model of the proposed PLL is carried out through the perspective of frequency shift, which simplifies the derivation process. The effectiveness of the proposed technique is confirmed through simulation and experimental results.


I. INTRODUCTION
With the growth of renewable energy sources and nonlinear loads, the grid synchronization task becomes more challenging, and the synchronization approach may significantly influence the performance of grid-connected equipment. A phase-locked loop (PLL) is a widely used synchronization technology [1]- [5]. To enhance the PLL performance, many filtering techniques have been proposed. As a band-rejection filter, the notch filter (NF) blocks the harmonics at selected frequencies and passes all other harmonics [6], [7]. The complex coefficient filter (CCF) is an interesting filter that has an asymmetrical frequency response around zero frequency [8], [9]. The delayed signal cancellation (DSC) operator is a kind of finite-impulse-response (FIR) filter and can be employed in the dq-or αβ-frame [1], [10]- [14]. To block all harmonics under complex conditions, multiple NFs, CCFs or DSC operators are required. The second-order generalized integrator (SOGI) is a single-input and dual-output structure [15]. To enhance the rejection capability, different methods have been proposed, such as the multiple SOGIs The associate editor coordinating the review of this manuscript and approving it for publication was Yong Chen .
The traditional moving average filter works in the dq-frame (called dqMAF) and can block multiple characteristic frequency harmonics under adverse grid conditions [20]- [24]. When the window length of dqMAF is equal to the fundamental period, the DC offset and all integer harmonics can be eliminated by one dqMAF unit. In [21], to improve the rejection capability of the PLL, dqMAF is used to replace a low-pass filter (LPF). In the synchronous reference frame PLL (SRF-PLL), the filters can be classified into two categories: in-loop filters and prefilters [1]. The in-loop filter is placed in the PLL feedback loop, and the prefilter is placed in front of the PLL feedback loop. A common drawback of in-loop filters is that phase delay is introduced into the feedback loop, slowing down the response speed of the PLL.
Usually, the PLL has only one dq-frame, and dqMAF is placed in this dq-frame with a proportional-integral (PI) controller and used as an in-loop filter. When the window length is large, the slowdown of the dynamic response caused by dqMAF is very pronounced. To handle this VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ problem, many approaches have been proposed. In [20], a proportional-integral-derivative (PID) controller is used to replace the PI controller. The derivative compensates for the phase delay caused by the dqMAF, but weakens the harmonic rejection capability. In [22], a phase-lead compensator (PLC) is used to reduce the delay. The window length of this compensator is equal to that of the dqMAF, which significantly increases the number of samples stored in the digital controller and also weakens the harmonic rejection capability. In [23] an improved dqMAF (IMAF) is proposed. A correction link is added to improve the response speed, and an adaptive IMAF with weighted mean value (WMV) is used to improve the harmonic rejection capability, and a quasitype-1 (QT1) PLL is adopted to further improve the response speed. In [24], a special structure is proposed to shorten the window length of dqMAF to 1/6 fundamental period. In this structure, the phase delay of the feedback loop is reduced, but it can block only the nontriplen odd harmonics and DC offset. In [25], to improve the dynamic response, the dqMAF with a short window length is proposed to eliminate only high-frequency harmonics, and a delay operation period filter (DOPF) is added to eliminate fundamental frequency negative-sequence (FFNS) component. However, this method exhibits very limited rejection capability for most low order harmonics.In [26], another method for shortening the window length is suggested, and it includes both DSC operator and dqMAF. Even harmonics and DC offset are eliminated by a special αβ DSC operator (acts as a prefilter), and then odd harmonics are eliminated by a dqMAF (acts as an in-loop filter). In this structure, the window length of dqMAF is shortened to a half of the fundamental period, but a phase delay is still introduced into the control loop. To compensate the delay caused by the dqMAF, a QT1-PLL is adopted. In some works, the PLL with dqMAF-based prefiltering stage (dqPMAF) is used, which requires two dq-frames [27]- [29].
In the dqPMAF-PLL, the dqMAF is placed in the front dq-frame, and the PI controller is placed in the back one. This structure provides a favourable dynamic performance, but the additional dq-frame increases computational burden.
In general, adaptive filters are used in the PLLs [1]. To achieve frequency adaptivity, the filter parameters must be adjusted in real time to match the grid frequency, and an additional FFL is required [13], [27]. The FFL makes the system highly nonlinear and increases the complexity of implementation [14]. In this paper, nonadaptive αβMAF is suggested. When grid voltage is at off-nominal frequencies, nonadaptive αβMAF will cause phase error, so a phase corrector is added to to eliminate the error. This paper is organized as follows. Section II provides an analysis of dqMAF-PLL. In Section III, the structures of αβ MAF in both the continuous and discrete time domains are presented. The small signal model and control parameters of the proposed PLL are also analyzed. Section IV provides the simulation and experimental results. Section V concludes this paper.

II. ANALYSIS OF DQ MAF-PLL A. IMPLEMENTATION OF dqMAF IN THE CONTINUOUS TIME DOMAIN
The transfer function of dqMAF in the continuous time domain can be expressed as [20], [23] The transfer function (1) can be rewritten as where G CF (s) and G I (s) are the transfer functions of the comb filter (CF) [30] and integrator, respectively. According to (2), G dqMAF (s) is equal to the product of G CF (s) and G I (s). In the continuous time domain, dqMAF can be implemented by a cascade of CF and integrator; therefore, dqMAF is also called a cascade integrator comb (CIC) filter in some works [31]- [33]. Fig. 1 shows the implementation of dqMAF.
By substituting s = jω into (1), the frequency response of dqMAF can be obtained as The nominal grid period T n = 0.02 s and nominal grid angular frequency ω n = 2π/T n = 2π×50 rad/s are considered in this paper. The window length T ω should be selected according to the actual harmonics [20], [24]. The window lengths for different application scenarios are summarized in Table 1.

B. IMPLEMENTATION OF dqMAF IN THE DISCRETE TIME DOMAIN
In the digital control system, dqMAF must be discretized.
In this paper, f s and T s represent the system sampling frequency and period, respectively. Assume the window length T ω contains N ω samples, i.e., T ω = N ω T s .
The transfer function of dqMAF in the z domain can be expressed as [20], [23] The transfer function (6) can be rewritten as where G CF (z) and G BDI (z) are the transfer functions of the CF and the backward-difference integrator (BDI) [34] in the z domain, respectively. As shown in Fig. 2, dqMAF can be implemented by a cascade of the CF and BDI in the discrete time domain.  The dqMAF is placed in the dq-frame and acts as an in-loop filter, which slows down the PLL dynamic response. An amplitude normalization scheme (ANS, i.e., v d /v q ) is also added to the PLL [1]. In [12] and [35], the structure of conventional PLL is analyzed. In the dqMAF-PLL, an integrator works as the voltage-controlled oscillator (VCO).

III. THE PROPOSED METHOD A. IMPLEMENTATION OF α βMAF IN THE CONTINUOUS TIME DOMAIN
In frequency domain, the transformation of the stationary reference frame (αβ-frame) and synchronous reference frame (dq-frame) corresponds to a frequency shift [36]- [38]. Therefore, the transfer function of αβMAF can be obtained by substituting s of the transfer function (1) with sjω n (corresponding to a frequency shift from the dq-frame to the αβ-frame) in the s domain, yields Note that the window length T ω is unchanged in the derivation from (1) to (10). In what follows, we will derive the implementation structure of the transfer function (10).
By defining m = T n /T ω , (10) can be rewritten as where G C−CF (s) and G CI (s) are the transfer functions of the complex comb filter (called C-CF to distinguish it from the abbreviation of the complex coefficient filter) and complex integrator (CI) [34], respectively. In (12), c 1 = cos(2π/m) and c 2 = sin(2π/m), and Table 2 lists the values of c 1 and c 2 with different window lengths. According to (11), αβMAF can be implemented by a cascade of the C-CF and CI in the continuous time domain, as shown in Fig.4. The dqMAF is a single-input and singleoutput filter, and the αβMAF is a dual-input and dual-output filter. VOLUME 8, 2020 The frequency response of αβMAF can be obtained as  The transfer functions (6) can be rewritten as Assume that the nominal period T n contains N n samples and that m = N n /N ω . The expression of αβMAF can be obtained by substituting ω with (ω -ω n ) in (15), yields where According to (16), the transfer function of αβMAF in the z domain can be obtained as The transfer function (18) can be rewritten as where G C−CF (z) and G CBDI (z) are the transfer functions of the C-CF and complex BDI (CBDI) in the z domain, respectively. The values of c 1 and c 2 are listed in Table 2. To obtain the implementation structure of the CBDI, the transfer function (21) is rewritten as where c 3 = cos(2π/N n ) and c 4 = sin(2π/N n ). According to (22), Fig. 6 shows the implementation structure of CBDI. According to (19), (20) and Fig. 6, Fig. 7 shows the implementation structure of αβMAF in the discrete time domain.

C. PHASE ERROR CORRECTION UNDER A FREQUENCY-VARYING GRID
According to Fig. 5, the αβMAF causes a phase error at off-nominal frequencies. According to (14), the phase error caused by αβMAF can be obtained as where ω g denotes the deviation frequency. In the derivation of (23), no approximation is made. Fig. 8 shows the phase error ϕ caused by αβ MAF with different window lengths.
The window length T ω is a constant in (23). Fig. 9 shows the proposed PLL structure (called αβCMAF-PLL), where a phase corrector is included in the αβMAF-PLL, andω g and θ c are the estimations of the grid angular frequency and phase, respectively. This corrector contains only one multiplication and one addition, and can be easily implemented.
According to Fig. 11, the closed-loop transfer function of αβCMAF-PLL can be obtained as Since the control loop corresponds to a second-order function, it is easy to design, and the proportional and integral gains can be expressed as [13], [39] where ζ and ω a are the damping factor and natural angular frequency, respectively. Here, ζ = 1 and ω a = 2π × 35 rad/s are selected, and the corresponding control parameters are k p = 439.6 and k i = 48312. Fig. 12 shows a dynamic performance comparison between the actual αβCMAF-PLL and its small signal model. A +25 • phase jump and a +5 Hz frequency step change are triggered in turn. The small signal model accurately predicts the dynamic behaviour of the αβCMAF-PLL, which confirms its accuracy.
In the αβMAF, the expressions of c 3 and c 4 include trigonometric functions. When nonadaptive αβMAF is adopted, the values of c 3 and c 4 are constant. Therefore, the coefficients c 1 , c 2 , c 3 and c 4 can be directly assigned constant values, and no trigonometric function needs to be performed in the nonadaptive αβMAF, which is of great significance for some low-cost digital controllers or at a high sampling frequency [40]- [42]. Compared with dqPMAF and space-vector Fourier transform (SVFT) [1], [29], the implementation structure of the αβMAF is simpler and requires less computation burden in most scenarios. Compared with the modeling methods in [14] and [29], the proposed modeling method (based on the perspective of the frequency shift) in this paper is relatively simpler and more intuitive.
Nonadaptive αβMAF may have an imperfect disturbance rejection capability when grid voltage suffers large frequency drift. Fortunately, in actual grid, the fluctuation range of voltage frequency is very limited around the nominal value [43], which is a key reason why nonadaptive αβMAF is recommended. In a digital control system, the structure of αβMAF VOLUME 8, 2020  in the continuous time domain (Fig. 4) is not recommended, and may cause rounding errors, because an ideal continuous integrator is difficult or impossible to implement in the discrete time domain. Note that adaptive αβMAF may also suffer rounding errors. Moreover, in the adaptive prefilter-based PLL, an additional FFL is required, which makes the system tuning sensitive and is not easy to design.
In the tests, it is considered that a PLL settles to a steady state when the following conditions are satisfied at the same time: the phase fluctuation is less than 0.5 • , and frequency fluctuation is less than 0.2 Hz.    and 62.15 ms, respectively. The αβCMAF-PLL exhibits the shortest phase and frequency settling times.

B. TEST 2: PHASE JUMP WITH HARMONICS
In this test, the grid frequency is fixed at 48 Hz. A −10 • phase jump and single-phase voltage sag (v c : 0.75 pu) is triggered. To further verify the robustness of all PLLs, some odd harmonics are also injected. The orders of harmonics are +3, +5, +7 and +9, and their amplitudes are all equal to 0.05 pu. Fig. 15 shows the simulation and experimental results. The αβ CMAF-PLL and dqMAF-PLL exhibit the shortest and longest settling times, respectively.  Fig. 16 shows the simulation and experimental results. The MAFPLC-PLL cannot effectively block the DC offset, so it suffers from large oscillatory errors and is considered unstable. The αβ CMAF-PLL, dqMAF-PLL and IMAF-QT1 can block the disturbance and restore steady state.

D. TEST 4: FREQUENCY STEP CHANGE WITH VOLTAGE SAG
The initial grid frequency is 51 Hz. A −3 Hz frequency step change and an asymmetrical three-phase voltage sag (v a : 0. 5 pu, v b : 0.7 pu, v c : 0.9 pu) is triggered. The simulation and experimental results are shown in Fig. 17 In this test, the initial grid frequency is 50 Hz, and a +1 Hz frequency step change and an asymmetrical three-phase voltage sag (v a : 0.8 pu, v b : 0.8 pu, v c : 1 pu) are triggered. To further verify the robustness of PLLs, all integer harmonics (the highest order of the harmonics is not higher than 20, i.e., h ≤ 20) are injected, and their amplitudes are not larger than the maximum allowed values of the IEC standards [44]. Fig. 18 shows the simulation and experimental results. The αβCMAF-PLL experiences the shortest settling time and the smallest peak phase error, whereas the dqMAF-PLL experiences the longest settling time and the largest peak phase error.
The detailed information of all test results is listed in Table 4. Compared with standard dqMAF-PLL,  αβ CMAF-PLL improves the dynamic response, which is consistent with the theoretical prediction. Table 5 lists the required samples of different filters in the discrete time domain. VOLUME 8, 2020

V. CONCLUSION
This paper proposes an implementation structure of MAF in the αβ-frame. Compared with the standard dqMAF, the proposed αβMAF does not introduce a phase delay into the feedback loop, and significantly improves the dynamic response of the PLL. In the continuous time domain, αβ MAF is implemented by a cascade of complex comb filter and complex backward-difference integrator. Nonadaptive αβMAF is suggested and its coefficients are all constant. By directly assigning constant values to these coefficients, no trigonometric function needs to be performed, which is useful for some low-cost digital controllers or at a high sampling frequency. The phase corrector can eliminate the phase error caused by nonadaptive αβMAF at off-nominal frequencies. This corrector requires only one multiplication and one addition, so it is easy to implement. The small-signal model of the proposed PLL is carried out, and the control parameters are also tuned. The simulation and experimental results demonstrate the effectiveness of the proposed technique.