Phasor Estimation for Grid Power Monitoring: Least Square vs. Linear Kalman Filter

: This paper deals with a comparative study of two phasor estimators based on the least square (LS) and the linear Kalman ﬁlter (KF) methods, while assuming that the fundamental frequency is unknown. To solve this issue, the maximum likelihood technique is used with an iterative Newton–Raphson-based algorithm that allows minimizing the likelihood function. Both least square (LSE) and Kalman ﬁlter estimators (KFE) are evaluated using simulated and real power system events data. The obtained results clearly show that the LS-based technique yields the highest statistical performance and has a lower computation complexity.


Introduction
The concept of smart grids has become a focal point by introducing new requirements in distribution networks, power quality, communications technologies, and power electronic technologies, and this is due to the expansion and deployment of a high rate of renewable energies (REs) penetration [1][2][3][4]. In fact, the non-predictable, non-dispatchable, and intermittent natures of RES could have a substantial impact on the power balance [5,6]. Consequently, power quality (PQ) has become more challenging and is considered as a major issue to realize the envisioned smart grid [7][8][9][10][11][12]. Therefore, the smart grid should use an efficient way to continuously monitor the power system to ensure the balance between power production and consumption [1,3,6,13,14], and to allow power quality state estimation.The task of PQ disturbance consists of two classes: the first class concerns the variation that is a steady-state disturbance, characterized by a small deviation from its nominal value (cf. EN 50160), whereas the second class concerns events with a large deviation from its nominal value [15][16][17], such as supply interruption or outage, voltage sag, and swell. Plethora of literature indexes the electrical phasor as short path to the extraction of relevant disturbances parameters [18][19][20], and the phasor estimation is indexed as the main important step to assess the power quality disturbances, and it is clear that a fast, robust, and accurate estimator is required in [21]. For this purpose, phasor measurement units (PMUs) are used to estimate power system parameters, such as frequency, phasor, synchrophasor, and positive sequence voltages and currents [22][23][24], and can also provide trustworthy information on the distribution grid [25]. The international standard IEEE C37.118.1 [26] and IEEE C37.118.1a [27] define the synchrophasor and frequency requirements under steady-state and dynamic conditions in order to ensure reliability and interoperability among PMUs. In this standard, frequency error (FE) and total vector error (TVE) are the criterion used to assess the estimation performances of the frequency and the phasor under steady-state and dynamic conditions [28][29][30]. Moreover, two performance classes are defined in this standard: • P-class that deals with the measurement applications and it is applied for fast and dynamic events. • M-class refers to the applications that require a high estimation performances and requires a FE and TVE smaller than 5 mHz and 1%, respectively.
In this paper, we will focus on the M-class. For this purpose, and in order to meet the estimation requirements provided in this standard, many techniques and methods have been studied according to the application [31] and according to the characterization of the studied disturbance, which can be an event or a transient. A survey and state of the art on signal processing techniques and methods were presented in [32], where the FFT and the RMS methodes are indexed as the widely used techniques to estimate the fundamental harmonic the amplitude of the phasor for steady state signals, and fail to estimate transient and extract instantaneous information [33,34]. It was also highlighted that the complexity and uncertainty associated with power quality requires investigation with advanced signal processing techniques [35][36][37]. The main purpose of this work is to present a comparative study of synchrophasor estimators obtained with the least square method and the Kalman filter in terms of TVE defined in the PMU standard [35,[38][39][40][41]. Moreover, a simulation, real data-based validation, and comparison of both techniques using time-varying real power system signals were carried out. However, the authors of [35] have shown the usefulness of the above-cited synchrophasor estimators in a power quality context, this work provides a deeper study with further investigations to evaluate both estimation methods performance according to standard C37.118.2014 requirements.
This paper is organized as follows. Section 2 provides the characterization of the power quality disturbances. Section 3 presents the estimation method of the frequency and phasor and Section 4 focuses on simulation and real data-based performance evaluations.

Power Quality Disturbances Characterization
This section presents the characterization of power quality (PQ) disturbances, which is one of the most important PQ monitoring issue. The disturbances are characterized by international standard [15][16][17] and they depend on different parameters, i.e., frequency, amplitude, and initial phase, so the disturbance parameters estimation is of great important in the PQ disturbance characterization. For power quality disturbances characterization, some indices are reported in [35,42]. These indices and severity parameters depend on the type of the disturbance:

•
For individual events, magnitude and duration are investigated.

•
For steady-state disturbances, only are magnitude.

•
For intermittent disturbances, the frequency of occurrence is used as severity indices.
It will be noted that most PQ disturbances cause changes in the voltage waveforms, which is why PQ indices are developed for voltage waveforms that present a wide variety of characteristics.
In the next section, we present the three-phase and phasor models used for signal parameters estimation.

Three-Phase Signal Model
In this study, it is assumed that the three-phase system is working under noisy conditions and it does not contain any harmonics (A low pass-filter can be used to filter all harmonic components). For electric power system, the three-phase signals can be expressed as follows.
The nominal three-phase signal for phase m ∈ {a, b, c} is given in a general form by [43] x m [n] = a m cos (nω 0 where ω 0 refers to the normalized angular frequency, a m is the maximum amplitude, and ϕ m corresponds to the phase angle for phase m. b m [n] correspond to the additive Gaussian noise.

Phasor Model
In analytic representation, the signal model given in (2) can be related to a phasor concept that is a complex number representing the sinusoidal function. This representation allows analyzing linear power system under steady-state conditions. For phase m, the complex phasor is mathematically defined as It should be mentioned that under steady-state conditions, the fundamental frequency ( f 0 ) is equal to the nominal value ( f n = 50/60 Hz) and the amplitudes (a m ) are equal to 1 pu with a phase shift between phases equal to 120 • [44,45]. In real power system, the signal parameters ( f 0 , a m , ϕ m ) deviate significantly from their nominal values. In this context, frequency and phasor estimation techniques are required in order to determine the parameters of PQ disturbance.

Frequency and Phasor Estimation Methods
This section presents frequency and phasor estimators based on advance signal processing methods. This estimation method can be divided into two steps: (1) we estimate the fundamental frequency from X, and (2) then, the phasors' (amplitudes and initial phases) estimation can be obtained once the fundamental frequency is estimated. In the following subsections, we describe these two steps.

Frequency Estimator
Herein, we present a frequency estimation technique-based on maximum Likelihood technique. This technique uses the Newton-Raphson algorithm to optimize the likelihood function, this algorithm is presented in [29] where its straightforward implementation is described step by step. This frequency estimator has a high estimation performances for a small signal length [46]. In practice, we use the recorded data (N) from three-phase voltage to estimate the frequency of power system. Let consider that the signal sensors record N consecutive samples (n = 0, 1, · · · , N − 1). By using the matrix form, the signal model defined in (2) can be described as [47] where • X is a N ×3 matrix containing the three-phase recorded data and is given by • B is N × 3 a that containing the noise samples and is defined as • A is a N × 2 real-valued matrix and it is defined as • C is a 2 × 3 real-valued matrix relying on the unknown phasors V m and it is defined as where c m = a m exp(jϕ m ), m ∈ a, b, c. Under white Gaussian noise, the estimation of f can be obtained by minimizing the following cost function [46], where . 2 F corresponds to the Frobenius norm.
It will be noted that the cost function optimization in 7-dimensional space as expressed by Equation (9) is a challenging task in term of the frequency estimation. However, as the phasors C are linearly separable, the frequency and C estimations can be decoupled into two steps [46]. • First, the f 0 estimation can be obtained by maximizing a 1-dimensional function.

•
Second, the C estimation can be obtained by replacing f 0 with its estimatef 0 .
An iterative algorithm-based on Newton-Raphson method is used to maximizing the cost function. The estimation of the fundamental frequency is given bŷ where the cost function J (w) is defined as where (.) −1 and (.) T are the matrix inverse and matrix transpose, respectively. Tr [.] corresponds to the trace of an N-by-N square matrix, which is equal to the sum of the elements on the main diagonal.
In the forthcoming subsections, two techniques for phasor estimation are presented.

Phasor Estimation
This section presents two phasor estimators-based on advances signal processing methods, called least square and Kalman filter estimators.
Phasor Estimator-Based on Least Square Technique After the estimation of the fundamental frequency (f 0 ), the estimate of the phasor matrix, C, is given byĈ wheref 0 is the estimated value of the fundamental frequency by LSE presented in Equation (10). Using the definition C in Equation (8), the LS estimator of the phasor is therefore given by

Phasor Estimator-Based on Kalman Filter Technique
Kalman filters are considered as a useful tools in power system applications. It is widely used for PQ disturbance estimation, such as transient, and for real-time tacking harmonics in power system protection [35,48]. In this study, Kalman filter is used to estimate the three-phase signal parameters. It can be described by the following state equation, where y[n + 1] is the state variables vector that has the unknown parameters to be estimated at instant n + 1. D[n] corresponds to transition matrix and w[n + 1] refers to the additive noise vector. In this study, the additive noise, as an approximation, is supposed to be a white Gaussian noise with zero mean and variance σ 2 . The three-phase signals, under harmonic environment, on phase m can be rewritten as where H is the total number of harmonic in the three-phase system. S cos m,k refers to kth harmonic component, k ∈ {1, . . . , H}, and it is expressed as S cos m,k = a m,k cos(nω k + ϕ m,k ).
Let consider the state variables S m,k [n + 1] at instant n + 1. Using trigonometric formulas, we obtain S m,k [n + 1] = a m,k cos((n + 1)ω k + ϕ m,k ) One should note that the parameters a m,k , ω m,k , and ϕ m,k are constant in the interval [n n + 1]. The three-phase signals do not contain any harmonic component, then the state transition matrix D is expressed as The estimator-based on Kalman filter allows estimation of amplitudes and initial phases using the recorded data. The amplitude estimate is given bŷ and the phase estimate is given bŷ For the fundamental frequency, k = 1, the phasor estimate can be obtained bŷ

Simulation and Real Data-Based Validation
The performances of least square estimator (LSE), provided in Equation (13), and those of the Kalman filter estimator (KFE), provided in Equation (22), are compared. The estimated frequency is the value that is maximizing the cost function, provided in Equation (10). This estimation is performed using the Newton-Raphson-based optimization algorithm proposed in [29] and it is resolved for four iterations.

Simulation Results
The IEEE has released a phasor PMU standard to assess the estimator performances. The standard C37.118.2014 defines the total vector error (TVE) to evaluate the performance of the phasors estimators. Monte Carlo simulations are carried out to evaluate the performances of the estimators in term of TVE. Under noiseless conditions, we present the mean value of the TVE criterion for M c = 1000 Monte Carlo trials by generating the input signal according to the model of signal in (2). The used parameters of three-phase signal are given in Table 1. Then, the mean of the TVE is defined as whereV m and V m correspond to the estimated phasor and real phasor, respectively, for the nth Monte Carlo trial. The sampling frequency F s is set to F s = 48 × f n , where f n refers to the nominal frequency. The objective of the next subsections is to show the effect of off-nominal frequency deviation, length signal, signal-to-noise ration (SNR) on the performance of estimators. The SNR can be expressed, in term of noise variance σ 2 and amplitudes a k where k ∈ {0, 1, 2}, as

Off-Nominal Frequency Effect on the Phasor Estimators Performance
In practical cases, the nominal frequency may deviate from its nominal value, i.e., f n = 50/60 Hz. In this section, we evaluate the influence of the frequency deviation on the performance of the phasor estimators. First, the angular frequency ω is set to ω 0 = ω n + δ, δ refers to the angular frequency deviation and ω n = 2 f n π F s . The frequency is estimated using the LS-based on Newton-Raphson (LS-NR) algorithm. The phasor estimation uses the estimated angular frequency, ω =ω. Figure 1 shows the TVE mean of least square and Kalman filter estimators. The number of samples, N, and the SNR are set to N = 144 samples and SNR = 100 dB, respectively. It can be clearly observed that the TVE mean of least square has a highest estimation performances ever under frequency deviation. The TVE mean of Kalman filter increases steadily when the frequency deviation is increasing. Under nominal conditions, the KF estimate is caused by the additive noise. These simulations highlight the influence of frequency deviation on the performances of the KF estimator.  Figure 3 shows the TVE mean of LS-NR and KF-NR estimators versus noise, SNR, for N = 144 samples. The obtained results shows that the LS-NR estimator outperform the KF-NR estimator even for high value of the noise. For SNR levels > 4 dB, the KF-NR estimator can meet the requirement defined by the IEEE standard, whereas the KF-NR estimator can only meet this requirement for SNR > 8 dB. Additionally, both estimators cannot meet the IEEE requirement when the SNR is greater that 4 dB.

Harmonic Components Effect on the Phasor Estimators Performance
In real power system, the behaviour of nonlinear loads and electronics converters introduce harmonic components, this is an issue that should be taken in consideration [49]. Let us consider the signal model in (2), by adding harmonic components and we obtain x m [n] = a m cos(nω 0 + ϕ) where a mh is the amplitude of the hth order harmonic and ϕ mh is the initial phase of the hth order harmonic. By varying the criterion α, we can vary the total harmonic distortion (THD ) of the signal. Then, the THD is defined by the IEC standard 61000-4-7 as follows.
IEEE C37.118.2014 recommends adding to the fundamental signal each harmonic component up to 50th. Their amplitudes of harmonic components are set to a mh = 10% pu and F s = 144 × 60 Hz. Figure 4 presents the TVE mean versus THD. The obtained results show clearly that the harmonic components have a negative impact on the performances of LS-NR and KF-NR estimators. The estimation error of both estimators is increasing when the THD f is increasing. This is caused by the reality of mismatch. Moreover, the LS-NR estimator has a better performances compared to those of the KF-NR estimator whatever the THD F value is. The LS-NR estimator seems meeting on an average the standard limit, while the KF-NR estimator does not meet this requirement. On the other hand, we have added two inter-harmonic components to analyze their effect on the phasor estimator performances. Their amplitudes and frequencies are set to a ih = 5% pu and f ih1 = 30 Hz f ih1 = 85 Hz, respectively. Table 2 shows the TVE mean of the phasor estimators for N = 192 samples with noiseless signals. It can be seen in this Table that

Performance Evaluation on Real World Data
In this section, we evaluate the performance of LS-NR and KF-NR estimators using real power system data. These are obtained form DOE/EPRI National Database of Power System Events [50]. for the evaluation test, two events coded 2911 and 2912 in the database are investigated, they include balanced system, voltage sag, and swell caused by a fault on the transmission power system. Regarding the window length, N, we have used a N = 64 samples that allows the KF-NR estimate working under favorable conditions. Figures 5-7 show the estimated frequency and phasor parameters for event 2911. It can be seen that LS-NR and KF-NR estimators lead to different results under balanced conditions, when 0 s < t < 0.04 s & 0.12 s < t < 0.16 s, and under unbalanced condition, when 0.04 s < t < 0.012 s. During the balanced conditions (0 s < t < 0.04 s). After 0.12 s (post-fault), the LS-NR estimators quickly converge to the nominal value with high estimation performance compared to the KF-NR estimator. Figures 8-10 present the estimated frequency and phasor parameters for event 2912. It can be seen that during balancing conditions, 0 s < t ≤ 0.04 s and 0.14 s < t ≤ 0.16 s, the LS-NR and KF-NR estimators converge quickly to the nominal value. However, the LS-NR estimator seems having a higher estimation compared to those of KF-NR estimator. After 0.04 s, the KF-NR estimator seems underestimating the voltage of phase a.

Conclusions
In this paper, a comparative study between the least square and Kalman filter estimators has been performed. This phasor estimation can be used and applied in PQ monitoring for a reliable operation of smart grid. For the frequency estimation, an optimization algorithm based on the Newton-Raphson method with four iterations has been used. According to IEEE standard C37.118, several simulation tests have been carried out and analyzed in order to evaluate and compare the performances of both techniques. The obtained simulation results show that the least square estimator clearly outperforms the Kalman filter estimator in term of TVE whatever the number of samples, noise, harmonics and interhamonics, and for off-nominal deviation. The simulation results have shown that the least square technique fulfills the requirements of the M-class in terms of TVE. Finally, the achieved results have clearly shown that under different disturbances environment and during frequency variation, the LS-NR estimator has a higher accuracy and speed performances than KF-NR estimator.