Enhanced Grid-Connected Phase-Locked Loop Based on a Moving Average Filter

Moving average filter (MAF)-based phase-locked loops (PLLs) have received considerable attention in recent years due to their attractive features. Indeed, they are able to completely eliminate the unwanted effect of harmonics, dc offset, and unbalanced voltages. Unfortunately, these advantages come at the cost of open-loop bandwidth reduction, which worsens the system’s dynamic response. The main challenge is to estimate the phase and frequency timely and precisely from an imbalanced and distorted voltage. In addition, optimized parameter design is also a difficult issue. The main aim of this paper is to present an enhanced PLL based on a moving average filter (EMAF-PLL) and a control method with a novel compensation algorithm. The EMAF-PLL can maintain high performance even under harsh grid conditions, and the novel control method enables the designer to set the controller parameters simply and effectively. The design method compensates the PLL small-signal model to form a type-II classic system and then optimizes the control-loop design by the rules of type-II systems. Finally, experimental investigations are performed to validate the effectiveness of the EMAF-PLL. The experimental results are also presented, and comparison with conventional PLLs verifies that the dynamic performance can be significantly improved.


I. INTRODUCTION
Appropriate synchronization with the utility grid, particularly when the grid voltage is affected by unwanted and severe disturbances such as voltage sags, high distortions, and frequency jumps, is an issue of high importance for almost all grid-connected power electronic equipment. Many synchronization techniques have been proposed in recent years [1]. A popular approach is to use a phase-locked loop (PLL) [2]- [4]. The PLL is a closed-loop feedback control system that is used in a variety of applications, particularly for synchronization and control of power electronic based devices [5]- [7]. With the proliferation of new grid-connected equipment and growing interest in the generation of power based on renewable energy sources such as wind and solar, the importance of PLLs has increased [8]. Focusing on gridconnected applications, a major challenge associated with PLLs is how to precisely and quickly estimate the phase The associate editor coordinating the review of this manuscript and approving it for publication was Yong Chen . and frequency when the grid voltage is unbalanced and/or distorted. To deal with this challenge, the incorporation of different filtering techniques into the PLL structure has been proposed in the literature [9]- [12]. A basic method is to include a moving average filter (MAF) in the control loop. In [13], several types of PLL techniques, including the MAF-PLL, are compared to perform the synchronization of the active power filter. According to the results, the author has demonstrated that the MAF-PLL provides good filtering capability, which is attained at the cost of a slower dynamic response. To overcome this challenge, several approaches, such as removing the in-loop MAF(s) and placing them before the input of the PLL [14], using a quasi-type-I PLL structure [15], [16], and using a hybrid type-I/type-II PLL structure [17], have been proposed in the recently published literature.
Furthermore, MAF-PLLs are limited because there is no uniform and effective control method. The controller parameter settings reported previously still rely on engineering experience. In [18], the MAF as a delay link was ignored, and parameter tuning based on a second-order linear system was given. However, it is difficult for the control parameters obtained by ignoring the MAF to achieve excellent phase-locking performance. In [19], design methods for proportional-integral (PI) and proportional-integralderivative (PID) control methods are given, providing a reference for further research and application of MAF-PLLs. However, these approaches approximated the MAF as an inertial link in the design, thereby limiting the optimization of the controller parameters. A design method for selecting the control parameters of the MA-PLL is also suggested in [20]. In this method, the dynamic of the MAF is approximated by a first-order LPF with a time-constant of T w , i.e., G MAF (s) ≈ 1/( T w s+1), which is not optimized [21]. However, the design method is based on a trial-and-error procedure and, therefore, is time consuming.
To improve the dynamic response of the standard MAF-PLL, an enhanced moving average filter-based PLL (EMAF-PLL) is suggested in this paper. The effectiveness of the suggested approach is confirmed through experimental verification. Simulation by using MATLAB/Simulink is performed to verify the validity and effectiveness. The experimental results are also presented, and the comparison with a conventional synchronous reference frame PLL (SRF-PLL) and MAF-PLL verify that the dynamic performance can be significantly improved.
In this paper, an optimized control method of an MAF-PLL composed of two parts-a correction section and a PI regulator, which facilitates digitization-is presented. First, the MAF-PLL is modeled and analyzed, and it is calibrated as a typical type-II system whose parameter optimization method can yield the MAF-PLL controller parameters. The digitization introduces an EMAF-PLL based on this optimized design and compares it with the conventional SRF-PLL and MAF-PLL reported previously [21]. The experimental results show that the steady-state phase locking of the EMAF-PLL exhibit high accuracy, and its dynamic response speedup is significant.

II. MAF CHARACTERISTICS
MAFs are linear-phase finite-impulse-response (FIR) filters that can act as ideal low-pass filters (LPFs) if certain conditions hold [14], [22]. They are easy to realize in practice and are cost effective in terms of the computational burden [14], [21], [22]. The average value of the input signals sampled in the sliding time window T w is calculated continuously as the filter output to bypass undesirable harmonics and distortions.
It is assumed that the input and output signals of the MAF are x(t) andx(t), respectively, and that the number of samplings completed in T w is N , which is also called the MAF order. Thus,x where x(k) indicates the current sample. In the continuoustime domain, (1) can be written as Performing a Laplace transform on Equation (2) yields the MAF transfer function: Equation (3) shows that the MAF suffers a response delay of T w . Typically, a smaller T w selected means a shorter MAF response delay; however, the filtering performance is also dependent on T w [23].
The MAF Bode plot in Fig. 1 with T w = 0.01 s shows a low-pass filtering characteristic with periodic notch-type attenuation. Since harmonic components in the utility grid voltage are mostly integer multiples of the line frequency, the periodic attenuation characteristic of the MAF is suitable to block the voltage harmonics and distortions, thus making the MAF-PLL an attractive candidate for grid-connected applications. In [24], [25], the MAF window length is adapted to the grid frequency variations by adaptively adjusting the PLL sampling frequency. It should be noted that the PLL is a small part of the control strategy in most cases. Therefore, due to the restrictions and requirements of the control strategy, implementation of a variable-sampling-rate PLL may not always be possible.  parts are similar to those of SRF-PLLs, while the LF part uses MAFs as filters for enhancing the applicability to the nonideal grid conditions and then compensates the loop by a specially designed controller. The feedforward angular frequency ω ff is the line frequency of the grid (2π × 50 rad/s in this paper). Then, the MAF-PLL can accurately obtain the voltage phase angles even in grids with severe harmonics and distortions. However, the integrated MAF introduces a response delay in the MAF-PLL, which slows down the PLL dynamic response. The controller part in this paper, which will be elaborated in the next section, can significantly compensate for the PLL dynamic response to be faster than conventional SRF-PLLs without degrading the static accuracy.

III. MODELING OF MAF-PLLS
To suitably design the controller, the small-signal model of the MAF-PLL must be established. The three-phase grid voltage can be assumed as (ω g is the angular frequency of the fundamental voltage). Performing a Clarke transform on (5) yields where Based on the estimated fundamental phase angleθ + 1 , the Park transform of (6) can be performed, leading to where The PLL rapidly enters a phase-locked state under the loop control, where the estimated angular frequencyω g is equal to that of the grid. Thus, (7) can be represented as where the estimation error of the phase angle is δ = θ + 1 − θ + 1 ≈ 0. Equation (8) shows that the dc components of u d and u q are trigonometric functions of the phase angle error, whereas the even harmonic components, F d and F q , remain the disturbances for the acquisition of the phase angle error. By setting the two MAFs with a T w of half the grid fundamental period, the even harmonic ripples F d and F q in u d and u q can be filtered out. T w = 0.01 s can be selected when the grid frequency is 50 Hz; then, one can obtain It is indicated that coupling exists between the phase angle error δ and the amplitude of the fundamental positive sequence voltage U + 1 inū q . To remove the influence of U + 1 and enable the PLL to obtain the ideal phase-locking 5310 VOLUME 8, 2020  performance under overvoltage or undervoltage conditions, a normalization ofū q withū d yields Thus, the small-signal model of the MAF-PLL, as shown in Fig. 3, can be obtained. G Ctrl (s) represents the transfer function of the controller, which consists of a compensation module and a PI regulator for the EMAF-PLL. The control loop is mainly composed of the MAF, the controller, and an integrator. The controller will be designed in the next section.

IV. EMAF-PLL CONTROLLER DESIGN
According to the analysis in Section II, the MAF transfer function has a nonlinear delay item e −T w s . Consequently, conventional linear control methods cannot be applied directly. In this paper, the second-order Padé approximation of e −T w s is used to linearize the small-signal model of the EMAF-PLL, which is further modified into a type-II classic system with an inserted compensation module. Then, a PI regulator with parameters optimized for type-II control systems is adopted to improve the PLL performance. The diagram of the controller is shown in Fig. 4.

A. COMPENSATION MODULE
Since the design of PI regulators is based on linear control systems, the nonlinear delay item e −T w s must be linearized to obtain a linear small-signal model of the EMAF-PLL. Here, the second-order Padé approximation is applied to ensure the approximation accuracy, which states Thus, the transfer function of MAF can be represented as Then, the compensation module can be accordingly set as G c (s) = 1 + T w s 2 + T 2 w s 2 12 1 + βT w s (13) where β is the compensation coefficient. The compensated MAF transfer function can be derived by the combination of Here, β determines the dynamic performance of the compensated EMAF-PLL and must be appropriately selected. Theoretically, a smaller β means a smaller PLL delay and a faster dynamic response. However, stability issues arise as β decreases. Thus, a suitable β should be selected by taking into account the system stability margin and the dynamic response, and β will be determined later in conjunction with the PI regulator design.

B. PI REGULATOR DESIGN
A PI regulator is used to control the compensated PLL with a transfer function of Based on the compensated MAF transfer function in (14), one can obtain the open-loop transfer function of the EMAF-PLL from Fig. 3 as VOLUME 8, 2020   Equation (16) indicates that the EMAF-PLL is a type-II classic system [26], and the dynamic response can be optimized by selecting the PI parameters as where h refers to the intermediate frequency width in type-II systems. When h is equal to 5, the control system obtains the shortest settling time and hence the fastest dynamic response. Therefore, h = 5 was selected for this design; then, the control overshoot of the system can be predicted as 37.6%, and the regulation process oscillates twice.
Since T w in the EMAF-PLL is selected as 0.01 s for a 50 Hz utility grid, k p and k i in (17) can be determined once β is  (16) and (17), as illustrated in Fig. 5. The different crossover frequencies f c and phase margins (PMs) for different β values are also included in Fig. 5, which indicates that the PM of the EMAF-PLL decreases sharply when β decreases than 0.2 but slightly increases when β is larger than 0.3. Therefore, a β between 0.2 and 0.3 is recommended to improve the PLL dynamic response with a sufficient stability margin. Here, β = 0.25 is selected in this design. The corresponding crossover frequency and phase margin are 35.8 Hz and 38.7 • , respectively. Then, the PI parameters, k p = 240 and k i = 19200, can be calculated from (17).

V. EXPERIMENTAL VERIFICATION
To verify the effectiveness of the proposed EMAF-PLL, experiments were carried out on a GE RX7i control system based on a VME bus, as shown in Fig. 6. The EMAF-PLL was implemented on the VMIVME-7807 control board with a sampling frequency of 10 kHz. All the variable VOLUME 8, 2020 waveforms measured in the experiments were generated via the VMIVME-4140 analog-output board and recorded using a HIOKI MR8880. To test the phase and frequency tracking characteristics of the EMAF-PLL, four critical voltage conditions were programmed in the IOWorks platform: Case I: Heavy harmonics of 0.2 p.u. (5 th ) and 0.1 p.u. (7 th ) injected into the fundamental voltage, starting at 0.05 s.
Case II: Severe voltage drops by dropping the phase A voltage by half and the phase B voltage to zero, starting at 0.05 s.
Case III: Frequency step change from 50 to 55 Hz at 0.05 s. Case IV: Phase angle jump of 40 • at 0.05 s. Cases I and II can test the PLL anti-disturbance performance under distorted voltage conditions and the PLL adaptability to nonideal grid environments. Cases III and IV focus on testing the PLL dynamic responses. Although the frequency and phase-angle steps rarely occur in real power grids, they may exist during the PLL startup. Moreover, these two cases are typically effective in verifying the dynamic performance of PLLs [3], [19], [21], [27]. To better demonstrate the effectiveness of the EMAF-PLL over these four testing cases, three other typical PLLs were also tested and compared with the EMAF-PLL, namely, a conventional SRF-PLL, a MAF-PLL based on a PI controller, and a MAF-PLL based on a PID controller (named MAF-PLL_PI and MAF-PLL_PID, respectively). The EMAF-PLL is designed as discussed in Section IV, and the control parameters of the SRF-PLL, MAF-PLL_PI, and MAF-PLL_PID are based on the symmetric optimal method [7], [18], [19].
The measured waveforms are shown in Fig. 9, with the testing results detailed in Table 1, Table 2 and Fig. 7. Under cases I and II, the EMAF-PLL, MAF-PLL_PI, and MAF-PLL_PID all exhibit high steady-state phase-locking accuracy with zero tracking error for distorted voltages, owing to the filtering characteristics of the MAF. In contrast, the conventional SRF-PLL cannot accurately lock the voltage phase or frequency due to the absence of filters. Under cases III and IV, it is evident that the MAF considerably increases the PLL settling time and slows down the dynamic response in comparison to the MAF-PLL_PI and the SRF-PLL. Under case IV, for example, as Fig. 7 shows, the settling time of the EMAF-PLL is significantly shortened to 68% shorter than that of the MAF-PLL_PI and 36% shorter than that of the MAF-PLL_PID (from 72.9/36.7 ms to 23.3 ms), while the phase and frequency overshoots are increased by only 24.1% and 6.3% (from 36.5%/42.6% to 45.3%), respectively. The measured overshoot of the EMAF-PLL is approximately 45%, slightly higher than the predicted value in the design. This error is caused by the approximation of the delay item.
As the PLL maintains an unlocked state until it converges within the permitted error, it is clear that the modification leads to significant improvements even though a tradeoff is made. Moreover, a 45.3% overshoot is still smaller than half the amplitude of the introduced phase and frequency variations, so the overshoot is usually allowed if such phase and frequency variations are tolerable. Furthermore, the EMAF-PLL results in a much better stability than the MAF-PLL_PID. This conclusion can also be confirmed through the closed-loop Bode plots shown in Fig. 8. The EMAF-PLL results in a phase margin (PM) of 65 • and a crossover frequency (CF) of 62 Hz (better than MAF-PLL_PID (PM = 43 • , CF = 58.3 Hz)), which improves the PLL performance and enhances the phase noise immunity.
As the waveforms in Fig. 9(c) and (d) show, the EMAF-PLL curve is made considerably smoother than the PID-based MAF-PLL curve by reducing unnecessary oscillations, which is usually more favorable than other approaches from the control perspective.

VI. CONCLUSION
The MAFs with a periodic notch and low-pass characteristics are effective for filtering the harmonics and distortions in utility grids and are thus suitable for PLLs in grid-connected applications. The MAF-PLLs can achieve high phase-locking accuracy but suffer from slow dynamic responses. This paper presents an enhanced control strategy that can effectively speed up the dynamic performance of the MAF-PLL. The EMAF-PLL exhibits high robustness, high phase-locking accuracy, and fast dynamic response. Moreover, the control strategy of linearizing and modifying the manipulated system into a classic system with an inserted compensation module and then optimizing the control with rules of classic systems is valuable and provides insight for other applications.