Introduction

Over the past few decades, power systems have become highly complex and dynamic. While state estimators now use measured data from a supervisory control and data acquisition in time intervals of several seconds, this level of granularity has traditionally not translated into methods for accurately capturing system dynamics. In recent times, however, phasor measurement technology promises significant improvement in real-time system state tracking, particularly when combined with dynamic state estimation techniques.

Kalman filters are among the most popular dynamic state estimation techniques that have found applications in a wide range of disciplines, from weather forecasting to missile tracking. In traditional power system studies, power system state can be estimated by combining Kalman filters with a hypothetically “true model and available measurements. In the ideal case, the hypothetical system model has accurate noise statistical characteristics incorporated into it. However, in reality, noise statistics can never be really known exactly. Apart from errors arising in the modeling phase, the measurements are also riddled with errors due to device failure or even worse, malicious data attacks. To facilitate illegal activities like energy theft, attachers construct bad data which evades bad data detection mechanisms in power systems. This can have devastating effects like false dispatch in the distribution process and device breakdown during power generation [1].

The two limitations stated above—viz. inaccuracies in the system model and bad data—present key areas of improvement. Towards that end, we propose an adaptive Kalman filter with inflatable noise variances (AKF with InNoVa) for more robust and accurate state estimation. Primarily, this novel approach distinguishes itself from other classic Kalman filter techniques with a dual-test procedure: normalized innovation test and normalized residual test, which can effectively identify modeling errors and measurement errors separately. Followed by dynamic noise parameters adjustment, our algorithm is remarkably efficient in dealing with various adverse conditions such as inaccurate system models and measurement data errors/attacks.

In “Problem Formulation and Methods” section we define the problem and describe the different Kalman filter techniques tested in this study, including traditional Kalman filter (KF), naive Robust Kalman filter (naive RKF), ensemble Kalman filter (EnKF), ensemble adjustment Kalman filter (EAKF), and our proposed adaptive Kalman filter with inflatable noise variances (AKF with InNoVa) with its principles and implementation details. Simulation results are given in “Case Studies” section, which compare these Kalman filter techniques under different abnormal conditions. “Conclusions and Future Work” section concludes the paper and proposes future ideas.

Problem Formulation and Methods

State estimation claims an indispensable position in modern power system operations. The purpose of a state estimator is to generate a reliable database which is critical for other operation functions, such as real-time monitoring, load forecasting, and frequency control. A typical state estimation procedure [2] involves \((1)\) modeling, which determines network topology and preliminary data; \((2)\) observability determination, which classifies various measurements as critical or redundant; \((3)\) state estimation, which generates a set of state variables from near-real-time telemetered measurements to reflect a best estimate of the system conditions; and \((4)\) detection and identification of errors.

A state estimator can be roughly classified as static or dynamic: the former calculates the state from the measurement set only for a certain time instant, while the latter has the ability to estimate and forecast the state ahead of time. Classic static estimators such as the weighted least square (WLS) estimator have been used for decades in power system studies [3]. Nowadays with the rapid advancement of synchrophasor technology [4], the use of dynamic estimators has seen an explosion in interest for real-time monitoring and control applications.

Synchrophasor technology has been considered to be one of the key factors that enable smart grids with the deployment of phasor measurement units (PMUs). They are synchronized by the common GPS radio clock to provide high frequency (\(30\) Hz or higher) voltage and current phasor measurements [5], which significantly reduces the complexity and increases the accuracy of power system state computation. It is commonly assumed that a PMU installed at a bus can not only measure the bus voltage phasor, but also all the current phasors along lines incident to this bus [6]. A more detailed system modeling can be found in our previous research [7]. In this setting the rectangular coordinate formulation will be preferable, where the real and imaginary parts of bus voltages are considered state variables [6].

Traditional Kalman Filter

A large portion of dynamic state estimation algorithms are Kalman-filter-based. The original Kalman filter (KF) was proposed in the 1960s [8, 9] as a recursive mean squared error minimizer to estimate the state of a process, using noisy measurements as feedback. The equations fall into two groups—time update (“Predict”) and measurement update (“Correct”):

$$\begin{aligned}&\text {Predict} \left\{ \begin{array}{ll} &{}\hat{x}_k^- = A\hat{x}_{k-1}+Bu_{k-1}\\ &{}P_k^- = AP_{k-1}A^T+Q \end{array} \right. \nonumber \\&\text {Correct} \left\{ \begin{array}{ll} &{}K_k=P_k^-H^T(HP_k^-H^T+R)^{-1}\\ &{}\hat{x}_k=\hat{x}_k^-+K_k(z_k-H\hat{x}_k^-)\\ &{}P_k=(I-K_kH)P_k^- \end{array} \right. \end{aligned}$$
(1)

where \(\hat{x}_k^-\in \mathcal {R}^n\) is the a priori state estimate at time step \(k\) given the knowledge of the process prior to \(k, P_k^-\) is the a priori estimate error covariance, \(Q\) is the process noise covariance. The “prediction” projects the previous state \(x_{k-1}\) and error covariance estimates \(P_{k-1}\) forward in time, to obtain the a priori estimates for time step \(k\). \(\hat{x}_k\) is called a posteriori state estimate at time step \(k\) given measurement vector \(z_k\in \mathcal {R}^m, P_k\) is the a posteriori estimate error covariance, \(R\) is the measurement noise covariance. The “correction” incorporates new measurements into the estimate through Kalman gain matrix \(K\), which weighs how much we trust the measurement \(z_k\) versus the prediction \(\hat{z}_k^-=H\hat{x}_k^-\). The larger \(R\) is, the more we trust the predicted value; the smaller \(R\) is, the more we trust the measured values.

Naive Robust Kalman Filter

In the WLS estimator, the most commonly used methods for bad data detection and identification are largest normalized residual test and hypothesis testing identification [3]. Now with phasor measurements incorporated, the same techniques still apply, an example is the WLS state estimator with largest normalized residual tests [10]. Similarly in this study, we define a naive robust Kalman filter (naive RKF) that combines the largest normalized innovation test with the traditional KF to identify and exclude bad measurements, without adjusting model parameters.

Ensemble Kalman Filter

In reality, the process and the measurement’s relationship to the state are often nonlinear, so one solution is the extended Kalman filter (EKF), which linearize those non-linear functions about the point of interest \(x\) in the state space [9]. EKF rose to prominence in aerospace and motion tracking applications where the state space is small; however in systems with high-dimensional state space such as those in weather and disease prediction, it falls short due to the intractable computational burden associated with Jacobian matrices at each time step.

One way to avoid such labor-intensive computation is to use data assimilation techniques, such as the ensemble Kalman filter (EnKF) [11] and the particle filter [12]. These filters are related in the sense that a particle is an ensemble member; the difference is that EnKF assumes Gaussian distributed noise characteristics, and if that is the case, EnKF is more efficient than the particle filter. The essential ideas of EnKF are \((1)\) maintaining an ensemble of state estimates (a collection of state samples) instead of a single estimate, \((2)\) simply advancing each member of the ensemble and \((3)\) calculating the mean and error covariance matrix directly from this ensemble instead of maintaining a separate covariance matrix. As a comparison, the Kalman gain is calculated as

$$\begin{aligned} K_k=\frac{corr(\hat{x}_k^-,\hat{z}_k^-)}{cov(\hat{z}_k^-)+cov(z_k)}, \end{aligned}$$
(2)

where \(corr\) and \(cov\) denote the sample correlation and sample covariance operations respectively.

EnKF offers great ease of implementation and handling of nonlinearity due to the absence of Jacobian calculations; on the other hand, it is critical to choose an ensemble size that is large enough to be statistically representative. The choice of an optimal ensemble size should be addressed based on the knowledge of trade-offs between estimation accuracy and computational complexity. The theories and implementation details of EnKF can be found in [11, 13, 14].

Ensemble Adjustment Kalman Filter

The ensemble adjustment Kalman filter (EAKF) is a variation of the EnKF. The difference lies in that EAKF does not add Gaussian noise to the measurement prediction. Instead, the EAKF deterministically adjusts each ensemble member so that the posterior variance is identical to that predicted by Bayes theorem under Gaussian distribution assumptions, while keeping the ensemble mean unchanged. The detailed description of EAKF can be found in [1417].

Adaptive Kalman Filter with Inflatable Noise Variances

Bearing in mind that a state evolution model may not always be correct in practice (for now we do not consider cases with multiple/switching process models), and the data is prone to instrument and man-made error, we are motivated to develop this approach, AKF with InNoVa. By definition, these errors are unknown and unpredictable, so they cannot be reflected in process noise covariance \(Q\) and measurement noise covariance \(R\).

AKF with InNoVa differs from the above mentioned Kalman filter techniques in that it can dynamically adjust \(Q\) and \(R\) by analyzing the innovation and residual. The innovation is defined as \(\mathcal {I}_k^-=(z_k-H\hat{x}_k^-)\), which is the difference between the measurement and that being computed from the a priori state estimate; the residual is defined as \(\mathcal {I}_k=(z_k-H\hat{x}_k)\), which is the difference between the measurement and that being computed from the a posteriori state estimate [18]. Ideally, the innovation should be normally distributed with zero mean and covariance \(S_k=HP_k^-H^T+R\) [19]; the residual should also be normally distributed with zero mean and covariance \(T_k=RS_k^{-1}R\) [20].

A naive RKF is capable, in a limited manner, of detecting and identifying bad data. Under abnormal conditions, the innovation distribution will change and RKF is able to capture that when the normalized innovation (normalized by its covariance \(S_k\)) exceeds a predetermined threshold. However, since \(Q\) and \(R\) are already blended in \(S_k\), it is impossible for this method to determine whether the anomaly is caused by a wrong process model, a wrong measurement model, or both. However in AKF with InNoVa, by investigating both innovation and residual, we make it possible to distinguish process errors from measurement errors.

AKF with InNoVa contains the following steps (the time step count \(k\) is omitted to simplify the notation):

  1. 1.

    Predict the state and error covariance using “predict” equations in (1).

  2. 2.

    Compute the ideal innovation covariance \(S\) and the normalized innovation \(\tilde{\mathcal {I}}^-\) where

    $$\begin{aligned} \tilde{\mathcal {I}}^-_i=|\mathcal {I}^-_i|/\sqrt{S_{ii}}, \quad i=1,2,...m. \end{aligned}$$
    (3)

    If \(\tilde{\mathcal {I}}^-_i > \tau \) for some threshold \(\tau \), then \(i\in Out\). We set \(\tau =3\) (measurement units) in our experiments. \(Out\) is the set that holds potential outlier indices. If \(Out=\emptyset \), deflate \(Q\) to \(Q*e^{-r}\) and \(R\) to \(R*e^{-r}\) with user customized decay constant \(r\) according to the user’s expectation and the specific circumstances, and go to step 8. Else, continue.

  3. 3.

    We first assume the anomalies are caused by unknown process error. If we “inflate” \(Q\) by a diagonal matrix \({\varDelta }Q, P^-\) will also be inflated by \({\varDelta }Q\) and \(S\) will in turn be inflated by \({\varDelta }S=H({\varDelta }Q)H^T\) with diagonal elements

    $$\begin{aligned} {\varDelta }S_{ii}&=\sum \limits _{j=1}^{n}H_{ij}^2{\varDelta }Q_{j}=(H(i,:)\nonumber \\&\quad \cdot H(i,:))([{\varDelta }Q_1,...{\varDelta }Q_n]^T), \end{aligned}$$
    (4)

    where “\(\cdot \)” denotes dot product. In order to achieve

    $$\begin{aligned} \tilde{\mathcal {I}}^-_i=|\mathcal {I}^-_i|/\sqrt{S_{ii}+{\varDelta }S_{ii}}\le \tau , \quad i=1,2,...m, \end{aligned}$$
    (5)

    we construct the linear programming problem and solve for \({\varDelta }Q_i\):

    $$\begin{aligned}&\min \sum \limits _{i=1}^{n} {\varDelta }Q_i\\ s.t.\quad {\varDelta }S_{ii}&=(H(i,:)\cdot H(i,:))([{\varDelta }Q_1,...{\varDelta }Q_n]^T)\nonumber \\&\ge (|\mathcal {I}^-_i|/\tau )^2-S_{ii},\quad \forall i\in Out\nonumber \\ {\varDelta }Q_1&\ge 0, {\varDelta }Q_2\ge 0,... {\varDelta }Q_n\ge 0.\nonumber \end{aligned}$$
    (6)
  4. 4.

    Similarly, we compute the ideal residual covariance \(T\) and the normalized residual \(\tilde{\mathcal {I}}\) where

    $$\begin{aligned} \tilde{\mathcal {I}}_i=|\mathcal {I}_i|/\sqrt{T_{ii}}, \quad i=1,2,...m. \end{aligned}$$
    (7)

    If \(\tilde{\mathcal {I}}_i>\tau \), then \(i\in MeasOut\). \(MeasOut\) is the set that holds measurement outlier indices, indicating abnormal measurements. Now we can separate the measurement factors from the process factors. Let us denote \(ProcOut=Out\backslash \) \( MeasOut=\{i:i\in Out \quad and \quad i\notin MeasOut\}\) as the process outliers, which is the set difference between \(Out\) and \(MeasOut\). If \(MeasOut=\emptyset \), go to step 7. Else, continue.

  5. 5.

    Reconstruct the optimization problem (6) for \(\forall i\in ProcOut\) and solve for \({\varDelta }Q_i\).

  6. 6.

    As for the measurements, for \(\forall i\in MeasOut\), if \(R_{ii}\) is inflated to \({\uplambda }_i R_{ii}\) then \(T=RS^{-1}R\) will also be inflated where the \(i\)th diagonal element becomes \({\uplambda }_i^2 T_{ii}\). In order to achieve

    $$\begin{aligned} \tilde{\mathcal {I}}_i=|\mathcal {I}_i|/{\uplambda }_i\sqrt{T_{ii}}\le \tau , \quad i=1,2,...m, \end{aligned}$$
    (8)

    we need to solve for \({\uplambda }_i\)s using

    $$\begin{aligned} {\uplambda }_i=(|\mathcal {I}_i|/\sqrt{T_{ii}})/\tau , \quad i\in MeasOut. \end{aligned}$$
    (9)

    Then we can inflate measurement noise \(R_{ii}\) to \({\uplambda }_i R_{ii}\).

  7. 7.

    Inflate process noise \(Q_{ii}\) to \(Q_{ii}+{\varDelta }Q_i\).

  8. 8.

    With updated \(Q\) and \(R\), correct the state and error covariance using “correct” equations in (1) and go to step 1.

Case Studies

The above mentioned Kalman filter methods have been tested on a 16-generator-68-bus New England Test System and New York Power System model [7] for a head-to-head comparison. They are simulated at time intervals of \(0.01\) s, with a three-phase fault at bus \(29\) occurs \(t=1.1\) second and clears in \(0.05\) s. On top of this unexpected event causing voltage oscillations, bad measurements are also injected into the system to further complicate our testing cases.

According to the latest IEEE Standard for Synchrophasor Measurements for Power Systems IEEE C37.118.1–2011 ([5]), PMU data are assumed to contain \(1\,\%\) random noise. It is also assumed that the users are unaware of any possible contingencies, hence a quasi-static model of a power system has been deployed as the process model (which no longer holds once the fault occurs). In each testing case we executed five Kalman filters: the traditional KF, the naive RKF, the EnKF with 200 ensembles, the EAKF with 200 ensembles and the AKF with InNoVa.

For a fair comparison we use Mean Absolute Error (MAE) plots and their histogram plots to evaluate these filters. MAE is one of the most commonly used accuracy evaluation criteria in quantitative methods of forecasting, which is defined as:

$$\begin{aligned} \textit{MAE}=\frac{1}{n}\sum ^{n}_{i=1}\Vert \hat{x}_i-x_i\Vert =\frac{1}{n}\sum ^{n}_{i=1}\Vert e_i\Vert \end{aligned}$$
(10)

where \(\hat{x}_i\) and \(x_i\) are the estimated and actual state of the \(i\)th state variable respectively. In this particular application, the \(i\)th state variable is the voltage phasor at bus \(i\). Thus \(e_i=\Vert \hat{x}_i-x_i\Vert \) is the absolute error (norm of the phasor error). To maintain consistency of our experiments in this subsection, the bin (i.e. interval) size of each histogram is set to be \(0.001\).

Case 1: Low Process Noise Setting, a PMU with Bad Data Injection

In this case each state variable is initialized with a very small process noise (\(0.2\,\%\)), which means that the user is very confident with the system being stable. The voltage measurement provided by the PMU at bus \(25\) is injected with additional error, with normal distribution \(\mathcal {N} (2,0.1^2)\). The accuracy evaluation of all filters is shown in Fig. 1.

Fig. 1
figure 1

State estimation accuracy comparison of five Kalman filters in case 1

Under this setting, traditional KF is more influenced by the measurement error, while EnKF is more influenced by the quasi-static process setting. EAKF performs slightly better than EnKF, but it is still heavily dominated by the wrong process model. Naive RKF can identify and drop the bad measurements, yet still being affected by the under-valued process noise \(Q\). AKF with InNoVa delivers the most impressive performance: it not only adjusts process noise parameters (among which, the largest process noise which occurs at bus \(29\) has grown to \(34.13\,\%\) is in consistent with the fact that the fault happened at bus \(29\)), but also detects and identifies the bad measurement. Notice that AKF with InNoVa does not drop measurements in order to avoid unobservable conditions by maintaining sufficient redundancy, however the noise of this bad data injected measurement has grown to \(73.21\,\%\) in \(5\) s, which is significantly larger than the others at \(1\,\%\), hence this measurement has a negligible impact on the estimated state.

Case 2: Fair Process Noise Setting, a PMU with Bad Data Injection

With the same bad data injection at bus \(25\), this time the process noise is set more appropriately at \(20\,\%\).

Figure 2 confirms that both EnKF and EAKF have converged to traditional KF, however they are all suffered from the impact of this bad data injection, hence the shifted tracking results. AKF with InNoVa, on the other hand, has its process noise at bus \(29\) grown to \(34.15\,\%\); it also identifies the bad measurement at bus \(25\) and inflated the corresponding measurement noise to \(74.32\,\%\). Compared to others at \(1\,\%\), it is quite obvious that the voltage measurement at bus \(25\) is questionable. While the AKF with InNoVa still performs the best, in this case naive RKF is able to correctly identify and eliminate bad data, making it achieve comparable performance to AKF with InNoVa.

Fig. 2
figure 2

State estimation accuracy comparison of five Kalman filters in case 2

Case 3: High Process Noise Setting, a PMU with Bad Data Injection

Now the initial process noise is assigned with a much larger value: \(50\,\%\), meaning that the user is not confident with the system being stable. An injected error with uniform distribution \(\mathcal {U} (1.2,1.4)\) is added to the PMU voltage measurement at bus \(25\).

Figure 3 shows that EnKF and EAKF are both not only converged to traditional KF, but also in overlapping with naive RKF. The reason why naive RKF does not detect the bad data is that the process noise \(Q\) is set so high (hence \(S\) is so high), the normalized innovations always fall below the threshold. However the error is captured by the normalized residual test in AKF with InNoVa. The noise of this bad measurement has been inflated to \(46.67\,\%\), in comparison with other measurement noise at \(1\,\%\). Figure 3 illustrated the best estimates produced by AKF with InNoVa, while all other Kalman filters fall short.

Fig. 3
figure 3

State estimation accuracy comparison of five Kalman filters in case 3

Case 4: High Process Noise Setting, Multiple Bad Data Injections

With the same process noise setting as in case 3, now we are facing more complicated bad data injections (notice we do NOT constrain them to be Gaussian and white, which is rarely the case in reality): from \(t=0\) to \(t=1\), bus \(2\) voltage measurement is injected by a constant value of \(1\); from \(t=1\) to \(t=2\), a uniformly distributed error \(\mathcal {U} (2,2.1)\) is injected to bus \(12\) voltage measurement; from \(t=2\) to \(t=3\), bus \(22\) voltage measurement is injected by two bad data sources, one with uniformly distribution \(\mathcal {U} (1,2)\) and another with normal distribution \(\mathcal {N} (0,1^2)\); from \(t=3\) to \(t=4\), a normally distributed error \(\mathcal {N} (0,15^2)\) is injected to line \(22\)\(21\) current measurement; and from \(t=4\) to \(t=5\), bus \(32\) voltage measurement is injected by a uniformly distributed error \(\mathcal {U} (1,1.5)\), while at the same time, bus \(42\) voltage measurement is injected by a normally distributed error \(\mathcal {N} (0,0.5^2)\).

Figure 4 shows that traditional KF, EnKF and EAKF are all vulnerable to these bad data injections. Naive RKF is able to correctly detect bad measurements and calibrate results only when the error is significant enough (e.g., from \(t=1\) to \(t=2\)), otherwise it does not perform well. Fortunately AKF with InNoVa provides highly accurate estimation results throughout, showing impressive robustness under various adverse conditions.

Fig. 4
figure 4

State estimation accuracy comparison of five Kalman filters in case 4

Conclusions and Future Work

This paper has tested and compared some of the most popular Kalman filter techniques against a novel method called AKF with InNoVa in estimating power system state with real-time phasor measurements provided by PMUs. This method has demonstrated a promising path towards secure and dynamic power system state estimation under various adverse conditions. The key ideas are \((1)\) using a dual-test procedure (normalized innovation test and normalized residual test) to help separate the process and measurement factors, and \((2)\) adaptively adjusting the process and measurement noise parameters on-the-fly and separately, to deal with wrong system modeling as well as bad measurements. Another benefit that comes along is, the inflation of process noise indicates change of system dynamics/wrong model, while the inflation of measurement noise signals users of a need to inspect and repair devices or defend against data attacks. An exponential decay process is also adopted to ensure automatic deflation of noise parameters if problems are resolved.

In non-linear applications such as using electro-mechanical power system model to estimate generator state [21], AKF with InNoVa can be combined with EKF to form a two-stage filtering approach to achieve satisfying results [20]. However in systems with much higher dimensional state space and more severe non-linearity, EnKF and EAKF will be a better choice to alleviate computational burden considering the limited capabilities of current computer technology. Thus a future research direction is to incorporate the same philosophy of adaptive noise parameters in EnKF and EAKF, which will require further exploration in uncertainty quantification and big data technologies.