Robust Gradient Estimator for Unknown Frequency Estimation in Noisy Environment: Application to Grid-Synchronization

Grid-connected converters are an important class of power electronic systems. Many power and energy applications require grid-connected converters. To control grid-connected converters, precise information of the grid voltage frequency and phase are required. Gradient estimators can be very useful in this regard. They are suitable to estimate the frequency and phase of the grid voltage signal. Various gradient estimators are already available in the literature e.g. regression-based techniques. However, most of them are designed by using the instantaneous estimation error as the cost-function. This amplifies the effect of noise in the estimated parameters. To overcome this issue, an integral cost-function is considered in this paper. The integral cost-function tries to minimize the estimation error over the integration window leading to reduce the effect of noise in the estimated frequency and phase. Moreover, the cost-function uses tunable forgetting factor to give more importance to recent data. The proposed gradient estimator assumes the grid frequency to be constant. However, in practice the frequency is variable with known nominal value. To overcome this problem, a frequency estimation block is coupled with the gradient estimator. The frequency estimation block uses the idea of phase-based frequency estimation. Comparative numerical simulation and experimental studies are performed to demonstrate the suitability of the proposed technique over three other advanced techniques from the literature.


I. INTRODUCTION
Renewable energy sources (RES) are playing a very important role in decarbonization of the existing electric power grid. The penetration of RES in the power grid is increasing at a very encouraging rate. RES are generally connected to the grid through grid-connected power converters [1]- [7]. Grid-connected converters are also used in various other power and energy systems applications, e.g. grid-connected The associate editor coordinating the review of this manuscript and approving it for publication was Taha Selim Ustun . rectifier [8], electric vehicles (EV) on-board charger [9], islanding detection [10], active power filter [11], [12], dynamic voltage restorer [13], [14], etc. All these applications highlight the importance of designing efficient controllers of grid-connected converters.
Control of grid-connected converter is a well-studied technical problem and many results have been presented so far. Many of these results require the precise information of the grid voltage frequency and instantaneous phase. However, frequency and instantaneous phase can not be directly measured rather to be estimated from the grid voltage signal. Frequency and instantaneous phase are then used to synchronize the output voltage of the power converter to that of the grid voltage. This process is generally known as grid synchronization. An overview of the control scheme used in a single-stage grid-connected solar photovoltaic (PV) system is given in Fig. 1. Figure 1 shows that grid synchronization is an important part of the current control scheme of grid-connected converters typically used in solar PV system.
Since grid voltage signal is periodic in nature, frequency domain techniques such as DFT [22], [23] are very suitable for grid voltage parameter estimation. However, DFT implementation can be computationally expensive due to large memory requirement. Recursive implementation overcomes this issue. Controllers for power converters are often implemented in digital micro-processor or micro-controller. This may lead to accumulation error. This issue has been solved in [23], however, through additional computational cost. Although the nominal frequency of power grid is fixed at either 50Hz or 60Hz, in practice it moves around the nominal value. Moreover, sometime the frequency can drop or increase. Spectral leakage in DFT can occur in these types of off-nominal conditions. Moreover, in the presence of harmonics, large window size is required which can limit the application of DFT-based control technique in low-cost micro-controllers.
Demodulation [18]- [20] is another well known technique to estimate the parameters of a grid voltage signal. Its implementation is very simple and based on the idea of demodulation originally used in telecommunication to extract the message from the carrier signal. In this type of approach, the grid voltage signal is multiplied independently with sine and cosine signal of fixed frequency to obtain the demodulated signals. Then by using low-pass filters (LPF) with high cut-off frequency on the demodulated signals, the parameters can be estimated easily. Due to the non-ideal behavior of practical LPF, demodulation-based techniques are sensitive to off-nominal operating conditions as large attenuation of the signals amplitude can be caused by the LPFs.
Adaptive observer [24]- [27] is another technique that got some attention in recent time. Using the theory of Luenberger type linear observers, this type of technique can provide globally asymptotically convergent estimation of the grid voltage parameters. One big limitation of this technique is that it does not use gain normalization in the frequency update law. This can be limiting in the case of providing low-voltage ride through capability to grid-connected converter. Moreover, the performance deteriorates significantly in off-nominal conditions.
Phase locked-loop (PLL) [28]- [34] is undoubtedly the most popular technique available in the literature. Moreover, it has wider acceptability in the industrial applications as well. A big number of PLL techniques available in the literature rely on the synchronous reference frame PLL (SRF-PLL) concept. In this approach, using the Park transformation [36], two DC (constant) signals (direct and quadrature axes) are generated. Then, by passing the quadrature axis signal through a low-pass filter (typically of proportional-integral type), the unknown frequency can be easily estimated. To implement Park transformation, orthogonal signals are required. Single-phase system has only one measured signal. As such a quadrature signal generator (QSG) is required. Most of the variations of PLL proposed in the literature are based on different techniques of generating the quadrature signal from the measured signal. The traditional PLL structure is simple, easy-to-implement, and has excellent performance in nominal conditions. However, the performance suffers in presence of harmonics and/or DC offset. Moreover, there is a trade-off between fast dynamic response and accuracy.
Frequency locked-loop (FLL) [35]- [38] is another approach to estimate the unknown frequency of the grid voltage signal. Unlike PLL-type techniques, FLLs can directly estimate the frequency by exploiting the relationship between the direct axis signal estimation error and the quadrature axis signal. FLLs require QSG similar to various variants of PLL. The quadrature signals can be generated by using various techniques e.g. linear harmonic oscillator [43], nonlinear harmonic oscillator [48].
Regression-based technique [15]- [17] generally use a parameterized linear model of the grid voltage signal. Using this model, least-squares type algorithms are used for parameter estimation purpose. This type of techniques generally can not estimate the frequency directly. They are often equipped with PLL. The performance of regression-based techniques are often dependent on the performance of the PLL.
Kalman filter [39], [40] is another technique that has a long history in the literature. Kalman filter is very suitable in noisy environment. It is well known from the literature that Kalman filter is the optimal linear estimator in the case of Gaussian noise. Most of the existing Kalman filters used in grid-connected converter applications assume the noise covariance to be constant. As the Hall effect sensor or the analog-to-digital converter (ADC) ages with time, the noise property of the sensor and ADC also change. This may degrade the performance of the Kalman filter in the long run. One solution is to use adaptive Kalman filter that estimate the noise online. However, this adds additional computational complexity to already computation heavy Kalman filter.
Noise is inevitable in designing the control system for gridconnected converters. The control systems are often implemented in discrete-time in micro-controller. Many low-cost micro-controllers use cheap ADC. ADC introduces noise in the measured voltage signal. Moreover, Hall effect sensors are often used to measure the grid voltage signal. Sensors also introduce noise in the measurement. As such, if proper cares are not taken, then the grid voltage signal feedback to the controller can be very noisy. This is most often the case in low-cost implementation.
To overcome the effect of noise, Kalman filter can be a suitable solution. However, as previously mentioned, adaptive Kalman filters need to be used as opposed to traditional non-adaptive Kalman filter. However, this increases the computational cost. One potential solution is to use gradient estimators that use integral cost-functions. Gradient estimators are not new in in grid-synchronization application. Regression-based techniques e.g. various variants of least-squares are actually gradient estimators. These estimators are designed by considering the instantaneous estimator error as the cost-function. Then the closed-form solution of the estimator can be obtained by calculating the gradient of the instantaneous cost-function. However, in noisy environment, minimizing the instantaneous error can be problematic as this will amplify the effect of noise. To overcome this issue, integral of the estimation error cost-function is more suitable. This cost-function tries to minimize the error over the integration window leading to reduce the effect of the noise. Moreover, if a tunable forgetting factor can be included in the cost-function, this will give the designer the choice to give importance to recent data. One such cost-function has already been considered in the adaptive estimation literature [49], [50]. In this paper, a frequency adaptive gradient estimator will be developed by considering the integral of the estimation error as the cost-function to minimize the effect of the noise. The proposed gradient estimator-based synchronization technique will be very suitable for gridsynchronization application in noisy environment. Moreover, the technique presented in this paper is very general and can be applied to unknown frequency estimation of any sinusoidal signal as well.
The rest of the article is organized as follows: details of the proposed approach is given in Sec. II while the comparative experimental results and discussions are given in Sec. III. Finally, Sec. IV concludes this paper.

II. PROPOSED APPROACH
A single-phase grid voltage signal can be written as: where A is the amplitude, ω = 2πf is the angular frequency (with nominal value being ω n = 100π), ϕ is the phase angle, and ∈ [0, 2π) is the instantaneous phase of the grid voltage signal. Considering the phase angles as state variables [39], model (1) can be written as: If we assume that the grid voltage is constant, then eq. (2) is a linear parametric model of the grid voltage (1), where the unknown amplitude and phase angle i.e. unknown parameter vector θ is linearly parameterized w.r.t. the known vector φ.
In practice, the frequency ω is also unknown with known nominal value. However, this issue will be dealt later on in this Section. Gradient estimators are generally designed by considering the estimation error as the cost-function and try to minimize the estimation error. To demonstrate this fact, let us consider the following cost-function for model (2) [49]: whereˆindicates estimated value. Gradient estimators generally involve the gradient of the cost-function (3) and has the following form:θ where = T > 0 is the tuning parameter and the gradient J is given by: Cost-function (3) considers the instantaneous error. This may be problematic in a noisy environment. To overcome this problem, considering an integral cost-function could be interesting from practical point of view. In this context, the following cost-function has been proposed in the literature [50]: where q > 0 is a positive design constant that works as a forgetting factor. Cost-function (6) is also known as discount integral cost-function in the literature. An advantage of costfunction (6) is that it penalizes all past estimation error i.e. integral of the estimation error within the integration window. Moreover, the decaying exponential term in (6) gives more importance to recent data by giving less weight to earlier data. Similar to the instantaneous cost-based gradient estimator, VOLUME 8, 2020 integral cost-based gradient estimator also takes the same form and given below: where the gradient of the cost-function is given below [49]: where R and Q are defined as: where R ∈ R 2×2 and Q ∈ R 2×1 . By plugging in the gradient (8) in eq. (7), the integral cost-based gradient estimator can be obtained as:θ As presented in [50], the integrals involved in the definition of R and Q can be considered as convolution integral. As such, R and Q can be generated by the following differential equations:Ṙ From the estimated parametersθ = [θ 1 ;θ 2 ], the phase angle can be estimated as:φ = arctan From the estimated phase angleφ, using phase angle based frequency estimation technique e.g. [18], the unknown frequency can easily be estimated. To implement the proposed integral cost-based gradient estimator (GE), eq. (9) and (10) are required. The block diagram of the proposed estimator is given in Fig. 2. Details are given in Fig. 3. The proposed frequency adaptive gradient estimator has three parameters to tune. They are and q in the gradient estimator block and κ in the frequency estimation block. The parameter is a diagonal matrix and can be written as = γ I 2 , γ > 0, where I 2 is the identity matrix of dimension 2×2. The convergence speed of the proposed estimator depends on γ while q is the forgetting factor. The parameter q should be always selected much smaller than γ . Through extensive numerical simulation we found γ = 10000 and q = 100 to be good values. The parameter κ determines the convergence speed of the frequency estimation. This parameter has to be selected as a trade-off between fast convergence speed and acceptable transient performance. In this regard, κ = 150 was found to be a good value.

III. RESULTS AND DISCUSSIONS
In this section, comparative simulation and experimental studies are considered. Numerical simulation studies are performed in Matlab/Simulink. As experimental platform, the dSPACE 1104 board has been considered. The experimental setup considered in this work is similar to [46, Fig. 12]. Overview of the experimental setup is given in Fig. 4. As mentioned in the Introduction Section, Kalman filter is well known technique in grid synchronization literature. Kalman filter performs well in noisy environment. As such we have selected the linear Kalman filter frequency-locked loop (LKF-FLL) [51] as one of the comparison technique. In addition, instantaneous cost-function-based gradient estimator (IGE) [18] and second-order generalized integrator FLL (SOGI-FLL) [36] are also considered as the comparative techniques. The parameters of the proposed technique have been selected as: γ = 10 6 , q = 100, and κ = 150. The parameters of LKF-FLL are selected as: P 0 = 1000I 2 , Q = 0.02I 2 , R = 1, x 0 = [0.01; 0.01], and γ = 40ω n . Parameters of IGE have been selected as: α = 400 and k = 50. Parameters of SOGI-FLL are selected as: k = √ 2 and γ = 50. All the continuous integrator are discretized using trapezoidal method with a sampling period T s = 10 −4 sec. To emulate noisy environment, Gaussian noise has been added to the voltage signal. The considered noisy signal has signal-to-noise ratio (SNR) of 27dB. In this test, the grid voltage was initially set as 1p.u. Suddenly the voltage dropped to 0.5p.u. Many grid codes require the grid-connected converters to be connected to the grid despite this kind of low-voltage condition. The numerical simulation and experimental results for Test-I are given in Figs. 5 and 6. Results show that all techniques are very quick to respond to large change in the amplitude. SOGI-FLL and LKF-FLL have very high peak overshoot of ≈ 2Hz. Gradient estimators have significantly smaller overshoot w.r.t. FLL techniques. FLL techniques demonstrated high peak overshoot for phase estimation error also. The proposed technique has a peak overshoot of only ≈ 4 • while it is 5 times more for SOGI-FLL at ≈ 20 • . These results demonstrate the suitability of the the proposed technique when large voltage sag occurs in the grid voltage signal.

2) TEST-II: −45 • PHASE STEP CHANGE
In this test, the phase angle suddenly changed from 0 • to −45 • . This type of test condition is very challenging for any grid-synchronization algorithm. The numerical simulation and experimental results for Test-II are given in Figs. 7 and 8. Experimental results show that all techniques have similar convergence speed. However, the proposed technique has significantly smaller peak overshoot w.r.t. FLL-based techniques. The peak frequency overshoot of the gradient estimators are similar. However, zoomed figure shows that the proposed technique is less sensitive to noise than IGE. Similar performance can be observed for the phase estimation error as well. These demonstrate the suitability of the proposed technique when sudden large jump in phase angle occurs in the grid voltage signal.

3) TEST-III: +2HZ FREQUENCY STEP CHANGE
In this test, the frequency suddenly changed from 50Hz to 52Hz. The numerical simulation and experimental results for Test-III are given in Figs. 9 and 10. Experimental results VOLUME 8, 2020  demonstrate that the convergence times all techniques are similar. Except LKF-FLL, the estimated frequency by the  other techniques did not show any peak overshoot. Zoomed figure shows that the proposed technique is less sensitive to In this paper, we did not consider the effect of DC offset in model development. However, due to signal conversion or transformer saturation issue, sometimes DC offset is unavoidable. This test consider the effect of DC offset in the estimated parameters. In this test, a DC offset +0.1p.u. is suddenly added to the grid voltage signal. In the presence of DC offset, estimation ripples are present in the estimated frequency and phase by all techniques. However, the proposed technique has the lowest ripple magnitude. The ripple magnitudes are ≈ 2 times smaller than SOGI-FLL. These results demonstrate the suitability of the proposed technique in the presence of DC offset.

5) TEST-V: DISTORTED GRID VOLTAGE
In today's power system, the effect of harmonics cannot be longer neglected. The rise of nonlinear loads and switch mode power supplies are making the grid more and more distorted. To test the effectiveness of the proposed technique, a distorted grid voltage is considered. In this test, the grid voltage is suddenly corrupted with 6.75% total harmonic distortions (THD). The considered harmonics are: 20Hz  sub-harmonics -2.7%, 3 rd -2.2%, 160Hz inter-harmonics -2.5%, 5 th − 2.7%, 7 th − 1.5%, 9 th − 2.5%, and 11 th − 2.3%. A summary of the harmonics generated by the comparative techniques are given in Fig. 13. Figure 13 shows that the proposed technique has the lowest total harmonic distortion (THD). The numerical simulation results for Test-V are given in Fig. 14. Despite the grid voltage being highly distorted, the proposed technique's frequency estimation ripple is bounded by mere ±0.1Hz while it is at least 4 times higher for LKF-FLL. However, the performance of LKF-FLL improved in phase estimation error case as the peak-to-peak estimation error ripple of LKF-FLL is comparable to the proposed technique. Simulation results demonstrated the suitability of the proposed technique in heavily distorted grid.

IV. CONCLUSION AND FUTURE WORKS
This paper developed an integral cost-function-based gradient estimator for frequency and phase estimation of singlephase grid voltage signal. First, a linear parametric model of the grid voltage is considered. The model assumed the grid frequency to be known while amplitude and phase angle to be unknown. Then using existing results from the adaptive estimation literature, an integral of the estimation error cost-function is considered. Unlike instantaneous error costfunction, this cost-function penalizes the estimation error over the integration window. This helps to reduce the effect of noise. Based on the integral cost-function, a gradient estimator is designed to estimate the unknown frequency and phase of the grid voltage signal. To make the gradient estimator frequency-adaptive, a frequency estimation law is proposed. Extensive comparative numerical simulation and experimental studies are considered using various challenging test scenarios. Comparative results with linear Kalman filter frequency-locked loop (LKF-FLL) demonstrated the suitability of the proposed technique. Control parameters of the proposed integral of estimation error cost-function-based gradient estimator are chosen using trial and error method. However, this is not systematic. Small-signal modeling-based parameter tuning will be considered in a future work. The proposed technique require the calculation of integrals. This comparatively slows down the dynamic response with respect to some other techniques available in the literature. As such the application of this technique can be limiting where very fast dynamic response is required. Dynamic performance improvement will also be considered as a future work.