Analysis of the Sensitivity of the Extended Kalman Filter Based Inertia Estimation Method to the Assumed Time of Disturbance

The inertia constant of an electric power system determines the frequency behavior immediately after a disturbance. The increasing penetration of renewable energy sources is leading to a smaller and more variable inertia, thereby compromising the frequency stability of modern grids. Therefore, a real-time estimation of the inertia would be beneficial for grid operators, as they would become more aware of the frequency stability of their grids. This paper focuses on an estimation method based on the extended Kalman filter. To be started, such method requires the knowledge of the time of disturbance, which, in turn, needs to be estimated. The purpose of this paper is to evaluate the sensitivity of the extended Kalman filter based inertia estimation method to the assumed time of disturbance.


I. INTRODUCTION
The frequency of an electric power system is an important parameter that is kept under control by grid operators by means of primary, secondary and tertiary frequency control.The frequency deviates from its nominal value every time the mechanical power provided by the generating plants no longer coincides with the electrical power withdrawn by the loads (or, in other words, when a power mismatch occurs).In particular, in the immediate aftermath of a power mismatch and before the activation of frequency adjustment mechanisms, the frequency shows a linear behaviour (also known as inertial response [1]), which is defined by the so-called swing equation: where P m is the mechanical power output of the generators; P e is the electrical power withdrawn by the loads; f is the frequency of the grid; and H is the inertia constant of the electric power system.With the exception of H (which is expressed in s), all the other parameters are expressed in per-unit.Equation (1) allows to understand the crucial role played by the inertia constant in the frequency stability of electric power systems: considering a fixed amount of power imbalance (i.e., the difference between P m and P e ), the higher the inertia constant, the lower the frequency variation right after a power mismatch and, thus, the more stable the frequency of the grid.
In traditional power systems, the inertia mainly comes from the synchronous generators, whose rotating masses exchange kinetic energy in the grid so that the balance between P m and P e is restored.However, the current shift in generation mix towards renewables is causing the phase out of synchronous generators, leading to a smaller and more variable inertia [2].
In fact, unless synthetic inertia is implemented, generators fuelled by renewable energy sources (RES) are typically not able to provide inertia to the grid for two possible reasons.First, they may lack of a kinetic energy buffer that would be exploited to restore the power balance (as in the case of photovoltaic plants).Second, they are connected to the grid by means of electronic power converters, which cause a decoupling between the generators and the grid.Hence, although the generator may be characterized by rotating masses (as in the case of wind farms), the link between the frequency of the system and the generator rotating speed is lost (i.e., the swing equation no longer holds).In other words, due to the converter, these generators do not modify their power outputs to counteract frequency deviations.
As a result, the frequency stability of modern grids (microgrids especially, given their higher share of converterconnected generation) may not be guaranteed [3].In the light of the changes currently experienced by electric power systems, a continuous, real-time estimation of inertia would be beneficial for grid operators, as it would increase their situational awareness and provide useful inputs to proactive control and protection systems.This paper focuses on an inertia estimation method based on the extended Kalman filter (EKF).
This paper is structured as follows.Section II briefly describes the working principle of the EKF from a theoretical perspective.Section III explains the inertia estimation method based on EKF.Such method has been tested on a simulated grid, whose characteristics are described in Section IV.In the same Section, the sensitivity of the method to the assumed time of disturbance is analyzed.Section V provides closing remarks and highlights possible future research directions.

II. THE EXTENDED KALMAN FILTER
EKF is a tool that allows to estimate the state variables of a system [4].In order to start the filter, an initial assumption of the state variables xk−1 and of the error covariance matrix P k−1 is required.
The estimation process consists in the execution at each time step of two phases.In the first phase, known as the prediction phase, the state variable estimations xk−1 are projected ahead for the next time step k.In addition, the a priori covariance matrix P − k is predicted.
As it can be observed from (2a)-(2b), the update of the a priori state variable estimations and of the covariance matrix requires the knowledge of the inputs u k , the function f (modelling the state variable dynamics over time) and of the process covariance matrix Q k−1 .In addition, the Jacobian matrix A k in (2c) must be computed every time step.
Starting from the above data, it is possible to predict the outputs of the system ŷk as follows: where g is the function that describes the system output dynamics over time.
In the second phase, known as the correction phase, the predicted and measured outputs (ŷ k and z k ) are compared: any difference between these two outputs is interpreted by the EKF as an estimation error in the state variables.Such error is exploited by the filter in order to correct the state variable estimations and to compute the a posteriori covariance matrix P k .The computations carried out in the correction phase are the following: where R k is the noise covariance matrix, K k is the Kalman gain and H k is a Jacobian matrix analogous to A k .Correction and prediction phases are carried out by the EKF at each time step, allowing the state variable estimations to converge eventually to their true value.

III. THE EKF-BASED INERTIA ESTIMATION METHOD
EKF can be adopted to estimate in real time the inertia constant of an equivalent synchronous generator [5], [6].In this method, the state variables considered are the rotor electrical angle δ, its per-unit angular speed ω and the inertia constant of the generator H (5).
The state variables are updated every time step using (6): where: ; ω 0 and ω B are the reference rotor angular speed in per unit and in rad/s; ∆t is the filter time step; X d and D are respectively the generator's internal reactance and damping factor; and E is the no load voltage of the generator.
The inputs used by the EKF are the generator mechanical power output P m , the voltage V and the load angle ϑ at the point of connection of the generator.
The outputs predicted by the EKF and also measured in the system are the active and reactive power of the synchronous generator (7).
As it can be observed from ( 5), the EKF-based inertia estimation method relies on equations that describe the dynamic behavior of the synchronous generator.In particular, the equation used to update the rotor angular speed ω at each time step describes the inertial response, which corresponds to the frequency behavior of the synchronous generator right after a power disturbance.
Therefore, to operate properly, the EKF-based inertia estimation process requires to be started at about the true time of disturbance.Otherwise, the measured output may not reflect the inertial response of the generator, thereby preventing the correct estimation of the state variables.The time of disturbance is a parameter that can only be estimated, as it cannot be known in advance.In [7], a disturbance is deemed to occur when the magnitude of the rate of change of frequency (ROCOF) trespasses a given threshold (e.g., 0.04 Hz/s).However, it is argued that a common threshold may not always be applicable to every power system, as the ROCOF depends on the size of the disturbance and on the characteristics of the grid (e.g., inertia constant, topology).Therefore, the time of disturbance could be inaccurately estimated.In turn, this could lead to additional errors in the inertia estimations obtained with the EKF-based method.The purpose of this paper is to evaluate the sensitivity of the EKF-based inertia estimation method to the assumed time of disturbance.

IV. SIMULATION RESULTS
The EKF-based method has been tested to estimate the inertia constant of a low voltage microgrid simulated on Simulink, whose schematic is shown in Fig. 1.Contrary to [8], the external power supply has been replaced with a synchronous generator, with an inertia of 6.5 s.The parameters of transformer, loads, lines, and synchronous generator used in the simulations are depicted in Tables III-VI in Appendix.
Different scenarios (shown in Table I) were simulated, assuming the presence (or the absence) of primary frequency regulation and the adoption of a complete (or simplified) model of the synchronous generator.Simulations were executed for 8 s, with a sampling time of 10 ms.The disturbance, given by the disconnection of the line between the nodes 9 and 10 and of the load L7 (whose active power withdrawal is 21.25 kW), occurs at 3 s.In order to make the simulated circuit resemble a real one, noise signals (whose standard deviations are shown in Table II) have been added to the measured data.The power base value for P e , Q e and P m (i.e., the active, reactive and mechanical power outputs of the generator) is 1 MW, whereas the voltage reference value is 400 V. E-the no-load voltage-has been considered constant, assuming that no voltage control is implemented in the simulated grid.In order to limit the influence of the measurement noise in the inertia estimation process, every signal has been filtered by means of 10-sample moving average window.
Previous works [5], [6] have shown that the EKF-based method allows to accurately estimate the inertia constant of a synchronous generator.However, this holds provided that two conditions are respected: (i) the sampling time adopted must be low enough (e.g., 0.1 ms); and (ii) the EKF must be used for at least 1s, starting from about the true time of disturbance.While the first condition can be fulfilled by means of data interpolation, the second one cannot be achieved in practice, as the time of disturbance cannot be known in advance but it can only be estimated.
As already mentioned, the time of disturbance could be estimated by examining when the ROCOF trespasses a given threshold.Consider for instance Fig. 2 and Fig. 3.The former compares the true ROCOF and the ROCOF obtained by filtering the noisy frequency measurements of case A, while the latter shows how the assumed time of disturbance changes based on the ROCOF threshold adopted.It can be observed that, unless grid operators know in advance a range of ROCOF values that the system may take, the ROCOF threshold trespassing criterion could lead to inaccurate time of disturbance estimations.This proves that, based on the threshold chosen, the EKF-based estimation process may be started at an assumed time of disturbance different from the true one.In turn, this could lead to additional inertia estimation errors.
Consider for instance Fig. 4, which depicts the inertia estimation error that would be obtained in case A if the EKFbased method was used for t dur = 1 s with a sampling time t s of 0.1 ms, starting from an assumed time of disturbance t ranging between 2 s and 4 s.The 11 coloured curves in the plot are related with different initial inertia estimations (whose estimation error ranges from −90% to +100%) that have been used to start the EKF-based method.In order to start the EKF, the initially assumed values of δ and ω have been set to 0 rad and 1 p.u. respectively.Furthermore, the diagonal elements of the error covariance matrix P k−1 (a 3-by-3 matrix) have been set to 2 rad, 0.001 p.u. and 10 s.It can be observed that the EKF-based method is more susceptible to time of disturbance underestimation than overestimation.In fact, if t is higher than 3 s (the true time of disturbance), the inertia estimate of each curve changes slightly with t.On the contrary, if t is lower than 3 s, the inertia estimations change noticeably with t.The reason for this biased susceptibility can be explained as follows.In order to guarantee a correct operation, EKF needs to receive measurements pertinent with the generator inertial response.A time of disturbance underestimation implies that some measurement samples that are also prior to the disturbance are adopted.However, such samples do not contribute to an improvement in the state variable estimation, as they do not reflect the dynamics of the generator right after a power mismatch.In particular, the more severe the time of disturbance underestimation, the higher the inertia estimation error, because the number of post-disturbance samples (the only ones allowing an improvement in the inertia estimations) used by the filter decreases.On the contrary, if the time of disturbance is overestimated, the inertia estimation error is slightly affected because the measurement samples that would be adopted describe anyway the behavior of the generator after a disturbance.Fig. 5 shows that if the utilization time (t dur ) of the EKF is increased (in this case, from 1 s to 2 s), the sensitivity of the estimation method to the assumed time of disturbance decreases.In fact, apart from the yellow and purple curves, inertia estimations in case of time of disturbance underestimation and overestimation tend to increasingly resemble.Besides, a higher utilization time makes it more likely for the EKF to receive enough post-disturbance samples to make the inertia estimations to converge to a final value, regardless of underestimations in the time of disturbance.On the contrary, for what concerns the yellow and purple curves (associated respectively with an initial inertia estimation error of −90% and −75% respectively), it can be observed that, despite the increase in the utilization time of the EKF, the inertia estimations are still inaccurate (with estimation errors higher  than +20% in module), even in case of time of disturbance overestimation.This occurs because the EKF is started with initial inertia estimations that deviate too much from the true one, leading to an unstable behaviour of the filter.Fig. 6-7 show the estimation results of case B, when t s = 0.1 ms and t dur is 1 s and 2 s respectively.With respect to case A, it can be observed that in case B the inertia estimations are less accurate and change much more significantly in case of time of disturbance underestimation.These shortcomings are due to the fact that the model of the EKF described in this paper updates the state variables at each time step based on (6).Such equation describes the behaviour of the simplified model of the synchronous generator, which consists of a voltage source in series with a synchronous reactance and resistance.The simplified model neglects all the other selfand magnetizing inductances of the armature, damping and field windings, which, on the contrary, are considered in the complete model, simulated in case B. As a result, (6) describes only approximately the behaviour of the complete model of the synchronous generator.Therefore, using the EKF-based method to estimate the inertia of the complete model of the  generator causes the unstable behaviour of the EKF and more inaccurate inertia estimations with respect to the ones obtained with the simplified model of the generator.
Compare for instance the inertia estimation results of Fig. 5 and Fig. 7, where the simplified and complete models of the synchronous generator are adopted.From Fig. 5, it can be observed that the inertia estimation error is lower than 5% in module (see black dashed lines) for 8 out of 11 curves, both in case of time of disturbance overestimation and underestimation.On the contrary, in Fig. 7 the inertia estimation error is never lower than 5% in module for any curve.In particular, for 8 out of 11 curves the inertia estimation error ranges between −13% and −20%.This holds only in case of time of disturbance overestimation, otherwise higher estimation errors are obtained.
Fig. 8-9 show the inertia estimation results of case C and D, where the sampling time t s and t dur are 0.1 ms and 2 s respectively.In these cases primary frequency regulation is activated.As it can be observed from the comparison of Fig. 5 and Fig. 8 (and of Fig. 7 and Fig. 9), the implementation of primary frequency regulation does not lead to significant variations in the inertia estimations, with the only exceptions of the yellow and purple curves, which are inaccurate, due to the already-mentioned unstable behaviour of the EKF.

V. CONCLUSION
In this paper, the sensitivity of the EKF-based inertia estimation method to the assumed time of disturbance is evaluated.Simulation results show that the method is more susceptible to time of disturbance overestimation than underestimation.Such sensitivity, however, decreases as the utilization time of the EKF increases.Results also show that the inertia estimations strongly depend on the model of the synchronous generator adopted in the simulations.In fact, when the complete model is adopted in the simulations, the EKF is more unstable and the inertia estimations are less accurate.A possible future research direction could be aimed at developing a new model of the EKF, whose equations are able to describe more accurately the behaviour of the complete model of the synchronous generator, as well as of other equipment (such as frequency and voltage regulation systems).This, in turn, could improve the inertia estimation process, both in terms of accuracy and of sensitivity to a wrong assumed time of disturbance.

APPENDIX
This Section shows the parameters of transformer, loads, lines, and synchronous generator used in the simulated circuit (Tables III-VI).

Fig. 1 .
Fig.1.Schematic of the circuit used for the validation of the EKF-based method[8].The segments between each couple of nodes correspond to r-l lines, whose parameters are specified in the Appendix.

Fig. 4 .
Fig. 4. EKF-based inertia estimation error as a function of the assumed time of disturbance (ts = 0.1 ms, t dur = 1 s) (Case A).

Fig. 5 .
Fig. 5. EKF-based inertia estimation error as a function of the assumed time of disturbance (ts = 0.1 ms, t dur = 2 s) (Case A).

Fig. 6 .
Fig. 6.EKF-based inertia estimation error as a function of the assumed time of disturbance (ts = 0.1 ms, t dur = 1 s) (Case B).

Fig. 7 .
Fig. 7. EKF-based inertia estimation error as a function of the assumed time of disturbance (ts = 0.1 ms, t dur = 2 s) (Case B).

Fig. 8 .
Fig. 8. EKF-based inertia estimation error as a function of the assumed time of disturbance (ts = 0.1 ms, t dur = 2 s) (Case C).

Fig. 9 .
Fig. 9. EKF-based inertia estimation error as a function of the assumed time of disturbance (ts = 0.1 ms, t dur = 2 s) (Case D).

TABLE II STANDARD
DEVIATIONS FOR NOISE PROFILES ADOPTED DURING THE

TABLE III CHARACTERISTICS
OF THE MV/LV TRANSFORMER (NODES 1-2)