Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Page
Chapter
1.5 Supervisory Control and Data Acquisition, and Phasor Measurement Units ..... 9
vi
2.3.1 Weighted Least Squares Algorithm .............................................................. 21
2.5.1.1 Example on the use of Chi-Square Distribution for Bad Data Detection . 40
2.5.1.2 Bad Data Detection in the Weighted Least Square Approach .................. 42
vii
Update Step ................................................................................................... 58
equations ........................................................................................................... 63
References ....................................................................................................................... 93
viii
LIST OF TABLES
Tables Page
1. Measurement data of a quantity at an arbitrary bus ............................................. 40
2. PMSMs parameters............................................................................................. 69
ix
LIST OF FIGURES
Figures Page
x
1
Chapter 1
ESTIMATION
State estimation (S.E) is a technique used to find unknown values of the state
variables based on some imperfect measurements. This method uses statistical criteria to
estimate the actual value of those unknown variables. One of the most common criteria is
to minimize the sum of the squares of the error. The reason why the sum of squares of the
error is taken and not just the sum of the errors is because the estimated value might be
greater or smaller than the true value, and thus cancelation of any of the errors is
prevented. The previously mentioned criterion has existed since the early nineteenth
applications to help estimate the state variable of a system. It has been used first in the
aerospace field to solve problems that involved finding an estimate of the location of an
aerospace vehicle, which could be a missile, an airplane, or even a space vehicle [1].
In the twentieth century, state estimation has been used in several fields that vary
from NASA space applications, to control engineering, and power systems [2]. This
report will discuss the use of state estimation specifically in the field of power systems. In
power systems, the imperfect measurements of the power system or inputs for the state
estimators are the voltage magnitude in Volts, the active and reactive power in Watts and
reactive phase angles, and voltage phase angles are sometimes considered as the
unknown state variables that have to be estimated at the systems nodes or buses. Even
though the measurements might not always be true, accurate or even close to being
precise, but at least they are needed for systems security, control, and constraints for
In our current society, electrical power systems play a very vital role in our lives.
Throughout the years, the populations demand for electric power has increased
dramatically, showing the importance of electricity in this world. Electric power has
become essential to residences, hospitals, military basis, industries, commercial uses, and
even transportation uses. People believe in an almost perfect reliability of the electric
power to meet the daily needs. On regular basis, people turn the light switch on, plug
their phones to the charger, or power up an X-ray machine for example and expect them
to automatically work. However, people dont think of the efforts, studies, and research
being carried out by electrical engineers, universities, and electric utilities and
Power systems operate in three possible states, which are: normal, emergency,
and restorative states [4]. When the system is in the normal state, it means that all the
system state variables are operating within their operating limits. When the system
parameters violate their operational range, the system is considered in danger. When such
contingencies take place, the power system will be unbalanced, and unsecured. Such state
3
is considered an emergency state of the power system. In order to bring back the system
to a normal operating state from the emergency one, some control procedures and actions
should take place. Control devices and other monitoring and regulatory applications are
used to refresh the system. At this state the system is in the restorative state, where it
has to be restored to the initial state where it was balanced and operating with no
system violations.
Presently, many electric power systems around the world are experiencing crucial
operational changes. Numerous participants in the electric power industry are leaning
towards the commercial aspect instead of the technical. The electric grid is facing new
challenges that it hasnt been designed for. Some of these challenges include back flow of
power, congestions, multiple contingencies, new and unexpected states, and several
others. Therefore, electric power companies would like to have dynamic data about the
systems states. The main important property of any simulation model is to be as close as
possible to the real-time scheme. This is where the Energy Management System (EMS)
engages by providing measured data and by the use of computer applications, finding
other variables to help control the network. Some of these applications include state
Electric power grids are designed for large power systems, and one of the main
means to support their reliability is by providing enough information and feedback to the
control center governing it. Monitoring the electric grid has been one of the main
objectives for electrical engineers to establish over the years. Getting the measurement
4
for every value and comparing it to its limit is very important in keeping the power
system secured and stable. Power system operators would know exactly what to upgrade,
improve, add power generation or fix any problem in the system if they know where the
system stands in terms of its control and stability. Corrective actions can be taken quickly
when the system models contain updated information whether some system variables are
Engineering decisions about the operations will be easier if the control center is
provided with precise measurements and information about the state of the power system.
However, the information and measurements provided by the meters, and power
electronic devices are not always accurate. This is due to several reasons commonly
found in electronics such as when the communication channel between the device and the
Therefore, the control center will receive a zero value to feed into the system, which is
totally incorrect. To add up, measuring devices are always subjected to errors, or
malfunction. Even the smallest errors can have an effect on the system since they can
accumulate and can be very hard to detect. Some of the equipment might be connected
In modern EMS systems, state estimators are very important engineering key
tools. State estimation is an essential method used for monitoring power systems. It has
also a vital function that acts as a dry cleaner in which it detects and identifies bad
5
measurement errors and excludes them [4]. It is used to solve the previously mentioned
problems in which it can smooth out small random errors in meter readings, detect and
identify gross measurement errors, and fill in meter readings that have failed due to
communications failures [1]. State estimators are also used by the EMS for many
purposes such as improving algorithms for Locational Marginal Pricing (LMP), such that
the pricing of power by the location and the power flow from and to the grid, that would
help in the removal of congestions in power systems [5]. The data needed for state
estimation depends greatly on the type of the method executed. Classical methods and
criteria such as the maximum likelihood criterion, weighted least-squares criterion, and
minimum variance criterion use input data namely: active and reactive powers
One of the key functions of EMS applications is power system state estimation.
Therefore, the most important element to make this logic work is by continuously
keeping the monitoring station connected to the field. It is obvious that with nowadays
room through the phone. Its well known that technology is used for communication and
transfer of data. Some exceptions may apply where equipment statuses from power plants
are managed manually. However, in some emergency situations, it is difficult to get all
the accurate measurements for an urgent decision during transients. Therefore, one way
to overcome and reliably approximate the unknown values and filtering the errors is
though state estimation. This report focuses on this concept and how to overcome the
Lets consider the example in Figure 1.1 below, to show the importance of state
estimation in calculating state variables in real life based on the imperfect and inaccurate
measurements. The following 3-BUS system has two generators. One is located at the
swing bus, bus 1, which is generating 70 MW into the system. The second generator
example, real power is considered as the main power flowing in the system. For
simplicity reasons, reactive powers are neglected, and therefore, are not included in any
Note that all the values depicted in figure 1.1, are given in per unit. All per unit
measurements are stated based on 100 MVA base. Power flows between buses are shown
in the diagram, where Pij expresses the real power flowing from bus i to bus j. Similarly,
line reactances, Xij give the impedance of the line from bus i to bus j. Thus, the network
Line flows:
P12 = 10MW = 0.1pu.
P13 = 45MW = 0.45pu.
P23 = 55MW = 0.55pu.
Line Reactances:
X12 = 0.2pu
X13 = 0.3pu
X23 = 0.4pu
7
flows with their corresponding reactances to calculate the unknown state variables, 2 and
3. Therefore, based on the following power flow equations 2 and 3 can be calculated
(1.1)
The state variables calculations and values are based on the True measurements of the
line power flows. However, in real life, those measurements sent from substations or
measuring devices to the control center, are not always accurate. Therefore, consider the
case where the following parameters have been received from the measuring devices,
requiring the engineers in the control center to determine the values of the state variables
Imperfect measurements:
If two of these measurements are taken as before, then using equations (1.1) 2
and 3 can be calculated. With the same steps and procedure as performed earlier,
substituting P12 and P13 would result in -0.024, and -0.144 radians for 2, and 3,
calculating the state variables, on the third power flow between bus 2 and bus 3, we refer
to the P23 equation. Using the estimated values for the state variables, P23 is predicted as
follow:
.
9
It is noticed that 0.3 per unit or 30MW for the real power flowing from bus 2 to
bus 3 is relatively low compared to the original value of 55 MW or 0.55 per unit.
Similarly, if other values were considered to calculate the same state variables, then it
would be impossible to predict the actual behavior of the system based on the bad
algorithm to estimate and find a close estimate to the true values of the state variables.
This is where state estimation techniques are used to build the tool needed to model a
close to real power system model for providing system security, protection, regulation,
and stability.
1.5 Supervisory Control and Data Acquisition, and Phasor Measurement Units
Not long time ago, engineers thought that the real-time data provided by the
Supervisory Control and Data Acquisition (SCADA) were accurate. However, they
discovered that by using SCADA, the measurements are still subjected to errors, and
sometimes are even unavailable [7]. SCADA collects data such as active and reactive
powers, voltage and current magnitudes, and phase angles from the Remote Terminal
Units (RTUs). For a long time, it was difficult to get the voltage phase angle because time
order to solve this problem, engineers began using global positioning system (GPS) to
synchronize the measurements. Phasor Measurement Units (PMUs) were equipped with
GPS receivers. By doing this, the measurements are delivered to the control center with a
time stamp from the GPS, which helps getting the voltage phase angles [9]. Therefore,
10
PMUs are known to improve the voltage angle accuracy when used in the proper way in
state estimators.
The relations between the phasor measurements and the state variables make the
PMUs much faster than the traditional methods. Additionally, they contribute in
improving the reliability and robustness of state estimation [10]. Therefore, the idea of
replacing the SCADA with PMUs was suggested, however, was cancelled due to the
great expenses of substitution. Nevertheless, PMUs can be used to help improve the
classical methods used in state estimators that were based on SCADA data.
Renewable Generation has been growing for the past few years, yielding cleaner
energy. However, with that rapid increase in the renewable energy, an increase in power
penetration has been noticed as well. Due to that occurrence, an effect was noticed on
lower voltage systems all through the power system network. Validating the power
system models is crucial at this point because of the continuous unbalance caused by the
load fluctuation and/or the renewable energy penetration. Therefore, state estimators play
There are several ways in which state estimators can be improved and enhanced
in order to work properly and as efficient as possible. One way of doing this is through
the conversion of the measurements from single phase into a full three-phase one.
However, this means that the whole system would grow in size and complexity and
therefore, will be difficult to solve, in addition to being costly. On the other hand, an
11
easier and simpler way of approaching this improvement problem is to use the synchro-
By using PMU measurements rather than the SCADA ones, there will be no need
to work with non-linear equations or algorithms. An advantage of using the data from the
PMU is the fact that adequate number of measurements will be collected making the
system fully observable. In this case, the measurement equations become linear, resulting
in straightforward non-iterative solution for the system state variables [17]. Unlike the
common method of transforming and then feeding the data into the model, measurements
taken from PMUs are in the form of either voltage or current phasors, which make them
easier to be imported and transformed into the model than the usual power flows and
Several aspects caused the synchro-phasors to develop to where they are right
now. One major issue when it comes to dealing with parameters of a power network is
dealing with its three-phase measurements, for example Vab, Vbc, and Vac. It would have
This recursive algorithm made it simpler to calculate the symmetrical components of the
phase voltage and phase current for the power system [18].
Another major development that dramatically improved and publicized the use of
PMU is the foundation of the GPS. The GPS technology made it possible for the
synchronized measurements taken from the PMUs to get time-stamped. By doing this, it
12
became easier to synchronize those measurements into the network analysis practices
the one in electric power systems will be less complicated and thus manageable with this
implementation.
power grid, and find means to enhance it. After studying August 2003 blackout that took
place in the Midwest of the United States, engineers noticed that one of the reasons
behind the failure of the power grid was because the monitoring tools of the system did
not work properly. In addition, state estimators of the Midcontinent Independent System
Operator (MISO) were not fully mature and still under development at that time. First of
all, MISO forgot to turn on the automatic function of the state estimators to work every
five minutes [11]. Second, after all the data that the state estimators missed, during that
time frame, eventually lead them to fail to function properly and calculate the correct
parameters [11]. Therefore, engineers concluded that if the state estimators were working
appropriately and quickly, it would have been possible for the system to act fast enough
to either isolate or shed some of the loads to prevent the sequences of contingencies and
failure in the system. In these critical situations, a strongly built state estimator that
converges accurately and promptly would be helpful to prevent the cascading occurrence
There are several problems that the power system network has been facing that
concern the practical use of state estimators in real life. A lot of these problems, as
mentioned previously in the blackout event, were caused by human errors, incorrect tasks
of measuring equipment, and system problems preventing state estimators from being
updated with the latest statuses of some elements in the system. However, as noticed,
these issues are not related to the algorithm that state estimators rely on. Therefore,
researchers can do so little when it comes to those types of problems. Nevertheless, what
researchers can do is improve the method that state estimation uses so that when needed
Earlier in the days, integrated utilities were responsible for regulating and keeping
the electric power system stable. However, recently the control and monitoring
functionality has been given to a separate entity called Independent System Operator
(ISO). This organization is an independent and non-profit organization that has been
assigned to take full control and assure security to the power system. Every region in the
United States has a different ISO. These Independent System Operators and Regional
Transmission Operators (RTOs) include California ISO, Midcontinent ISO, New York
ISO, New England ISO, Alberta Electric System Operator, PJM Interconnection,
Southwest Power Pool, Electric Reliability Council of Texas, New Brunswick System
With the huge complex power system that we have nowadays, the use of
computer applications is the most important step in controlling the grid. Several
algorithms were developed over the years to control and monitor the power network;
however, none of these methods were very efficient in controlling and securing the grid
reliably. Therefore, ISOs started integrating state estimators in their control methods and
applications to help in the monitoring process. Not only state estimators helped predicting
the unknown parameters, but also improved many other applications such as contingency
management systems such as the LMP. Thus, state estimators are used by these
applications to calculate and predict the state of the system, which facilitates the market-
pricing approach, LMP, control congestions occurring on the bulk power grid. Similarly,
contingency analysis and dispatch tools use state estimators as well to prevent
contingencies from occurring in the system, since state estimators provide updated data
M.B. Do Coutto Filho, A.M. Leite da Silva, and D.M. Falco prepared a
bibliography found in [12], of the first two decades of power system state estimation
from1969 until 1989, talking about the discoveries and improvements done towards the
implementation of state estimation. Fred Schweppe, however, was the person who
introduced the Weighted Least Square (WLS) method for power system state estimation
back in 1969 [3]. Several methods such as decoupled WLS, and the Least Absolute Value
15
(LAV) methods were developed based on this concept. His original method is used until
Power Systems which was a generalized approach towards that subject. In his book he
discussed and introduced the topic of state estimation in a deeper level and specifically
the WLS method. Monticelli covered many topics in his book from analysis in power
flow basis, to the decoupled method, bad data analysis, matrix solution methods, and so
many other practical applications. In 2004 Ali Abur and Antonio Gmez Expsito
published another book that gives an overview of power system operation and the role of
The report is organized in a way that chapter 2, introduces the power system state
estimation methods and techniques. It gives a brief introduction to these methods, and
then provides more details on the Maximum Likelihood state estimation, and the
Weighted Least Square method. It also gives an example on how to carry out the WLS
method. Towards the end of chapter 2, bad data detection and identification schemes are
explained with a numerical example showing the use of the Chi-Square Distribution
Chapter 3 discusses the techniques used for non-linear systems. This chapter
explains methods that can be used for complex non-linear systems such as power systems.
The main topic of chapter 3 is the Kalman Filtering techniques and methods. Three
16
different Kalman Filtering methods are discussed and explained in this chapter, the
classical Kalman Filter, the Extended Kalman Filter, and the Unscented Kalman Filter.
and carries out two different methods for solving the state estimation: a general linear
approach, and the Extended Kalman Filtering algorithm for estimating the state variables
of that system. A brief comparison of the results obtained is performed to evaluate each
of these methods.
Finally, the conclusion sums up the objectives in addition to the major results. It
also discusses the benefits of the best-fitted method chosen from the simulation chapter,
and mentions the drawbacks of the other techniques. Finally, it discusses future work that
Chapter 2
for the unknown state variables in the system obtained from imperfect measurements.
The control center receives those imperfect measurements via the SCADA system. State
estimation tools are used to process these defective measurements, filter them, detect
errors, remove the corrupt data, and find the best estimate for the state variables at every
substation or bus. Those state variables are complex voltages, which are the voltage
The three mostly used methods or criteria in state estimation are listed and
described as follow:
1. Maximum Likelihood: This method is used to maximize the probability that the
estimated value for the state variable is close to the actual value. This method will
2. Weighted Least Squares (WLS): This method is the most popular method in the
industry. Its main objective is to minimize the sum of the squares of the difference
between the estimated and the actual value of the state variable, which is also
known as the error. This technique will be described in details in section 2.3.
18
minimizes the expected value of the sum of the errors as described in the WLS
vector is created from all the measurements. A likelihood function for the measurement
vector is then formed. This is done by multiplying all of the probability density functions
(pdfs) of each of the measurements in the vector with each other. The density function is
shown in equation 2.1 below, in which is the standard deviation, is the expected value
or the mean, and z is the random variable of the pdf. f(z) is the function which will output
the probability of the measurement that we receive from SCADA , for example, being the
correct value would have a probability closer to 1 or 100%. It is assumed that the
(2.1)
The likelihood function, which was described earlier, is given in equation 2.2
below. The objective of the maximum likelihood method is to maximize this function in
order to increase the probability of estimating the true value of the state variable. In the
measurement [4]:
(2.2)
19
The likelihood function, fm(z), acts as a measure of the chance of detecting certain
measurements in the measurement vector. As noticed and assumed from equation 2.1,
functions f(z) are independent of each other. However, f(z) is dependent on the mean ,
and the standard deviation . Therefore, by alternating and changing those parameters to
optimum values, the likelihood function can be expressed in a logarithmic form. This
logarithmic function approach modifies the function to become as follow, with m number
of measurements [4]:
(2.3)
(2.4)
minimizing the sum of the squares of the standardized normal variable as shown below or
By taking the minimization part of the above equation, and assuming that
simplify the process. In addition, the squares of the standard deviations are expressed in
(2.5)
where:
The process of minimizing the sum of the squares of a specific weight on the
residuals is known as the Weighted Least Squares method and is described in details in
Weighted Least Square (WLS) method is one of the most commonly used
methods for power systems state estimators tool. This report explains how state
estimation methods aim to predict the closest possible approximation for the state
variable. The maximum likelihood principle is to increase the probability of getting close
to the true value; however, another approach is to minimize the difference between the
approximated value and the actual state variable value. This is exactly what WLS method
does. Its main objective is to minimize the squares of the measurements errors. This
section describes the WLS algorithm, formation of the measurement function and the
Jacobian matrix, and provides an example to show how WLS method can be applied to a
network.
21
Assuming that the measurements received from the SCADA system are of size m
(2.6)
(2.7)
where:
Of course for these state variables, there exist true measurement values. Therefore,
the calculated estimate given from h(x) will deviate from the actual value with an
unknown error denoted by e. This error is a vector of similar size to the measurement
vector z, and is given in equation 2.8. Note that each error is independent of the other
(2.8)
22
unknown state variables, x, using the non-linear function, h(x), in addition to the error
vector to compensate for the difference between the actual and the computed value.
(2.9)
In order to solve the state estimation problem using the WLS state estimation
technique, an objective function should be minimized. This means that the Jacobian
matrix given below has to be minimized. The Jacobian matrix is composed of the
(2.10)
where:
zi : ith measurement.
matrix, which means that the off diagonal values are equal to zero, since the
23
measurements are independent of each other with independent errors as well. The
(2.11)
In order to minimize the objective function, the partial derivatives of J(x) with
respect to the state variables x have to be obtained. Thus, is the derivative of the
objective function and is denoted by g(x), as referred to by most power system state
derivative as well since it is part of the equation, as shown in equation 2.13 below. Matrix
H(x) is formulated and called the measurement Jacobian matrix, which is equal to
(2.12)
where:
steps in the WLS algorithm. Therefore, it is very essential to learn the procedure of
calculating this matrix. In electric power systems, the relationship between the various
parameters obtained through the SCADA system for example, is clearly non-linear. Thus,
24
making the process of calculating the measurement Jacobian matrix a little more
details showing the partial derivatives of real powers, reactive powers, and current
magnitudes in terms of the state variables, which in power system analysis are the voltage
(2.13)
where:
: Real power injection measurements at bus i with respect to the phase angles.
magnitudes.
: Reactive power injection measurements at bus i with respect to the phase angles.
magnitudes.
25
: Real power flow measurements from bus i to bus j with respect to the phase
angles.
: Real power flow measurements from bus i to bus j with respect to the voltage
magnitudes.
: Reactive power flow measurements from bus i to bus j with respect to the phase
angles.
: Reactive power flow measurements from bus i to bus j with respect to the
voltage magnitudes.
: Current magnitude measurements from bus i to bus j with respect to the phase
angles.
: Current magnitude measurements from bus i to bus j with respect to the voltage
magnitudes.
= 1; = 0; = 0; = 0.
According to Taylor series expansion in [4], the higher order term of equation
(2.12) can be neglected and thus the equation can be solved iteratively, by Gauss-Seidel
26
solve for the state variable, x, in terms of the previously explained measurement Jacobian
matrix, covariance matrix, measurement vector, and the measurement function as:
(2.14)
(2.15)
where:
k : iteration key.
[G(xk)] is sparse, positive definite and symmetric provided that the system is
fully observable [4]. Notice that both g(xk) and G(xk) contain the measurement function,
h(x), the Jacobian measurement matrix, H(x), and the covariance matrix, R. The required
data can be calculated using the power system model, branch parameters, measurement
location and type [4]. However, calculating G(xk) is a bit trickier than expected. Since
27
G(xk) is a sparse matrix, therefore, the inverse of that according to equation 2.15 is a full
matrix. In order to avoid the full matrix on the right hand side, some adjustments and
manipulations are done to equation 2.15. First, xk is moved to the left hand side of the
equation, which yields the difference between the two consecutive iterations, x = (x k+1)
- (xk). Then the whole equation is multiplied by G(xk) to get rid of it from the right hand
side and move it to the left part. By doing this, inverting it was avoided as discussed. The
(2.16)
To start the process, we put k=0 (initial iteration) and set the initial state value, x0,
as 1 per unit (pu) for the voltage magnitude, and 0 degree for the voltage phase or angle.
Next, calculate g(xk) and G(xk), in order to find the next iteration state variable, x1, by
substituting into equation 2.15. Repeat the procedure for the rest of the iterations until the
difference between x(k+1) and x(k)is within a certain pre-assigned threshold, . Figure 2 .1
Overdetermined Case:
Note that the original equation 2.14, was derived and formed based on the
assumption that the total number of measurements, m, is greater than the total number of
On the other hand, when the total number of measurements is equal to that of the
estimated parameters, m = n, then the equations can be modified so that the estimated
state variables, xest, fits exactly the number of measurements in the z vector. Therefore,
the equation to calculate the estimated state variables for this completely determined
(2.17)
Underdetermined Case:
measurements is less than that of the estimated parameters, m < n. This case frequently
happens in the power system network when measurements are lost or cannot be sent
through the SCADA system. Therefore, the underdetermined problem is unsolvable since
the figure below, if only M12 is known, then the only relationship that can be concluded is
30
the one between bus 1 and bus 2. Hence, there is not enough information or data between
bus 1 or bus 2 with bus 3. So neither the voltage magnitude nor the voltage phase at bus 3
meaning that the state variables cannot be observed or estimated using the given
measurements.
reactive powers need to be calculated by means other than direct measurement. The
Therefore, those measurements can be used to substitute for the missing actual
measurements to continue the process of state estimation. The question is how do you
know what are the correct values to replace the missing measurements? One possibility is
31
to call the power plant and record the measurements manually into the state estimator tool.
The other option is to use historical records that show the relationship between the buses
and their loads compared to the total system load [1]. Therefore, equation 2.18 would be
used for the underdetermined case to find an estimate for the state variables.
(2.18)
Lets consider the example that was given in section 1.4. The given measurements
are used to calculate the unknown 2 and 3 since 1 was considered the reference angle
and was equal to zero. Therefore, in order to estimate the two angles at bus 2 and 3, the
squares of the sum of the residuals, divided by the variance, has to be minimized as
discussed earlier. If the error for the WLS was considered to follow normal distribution
as shown in figure 2.3 below, then assuming metering accuracy of 3MW, would result
in a 99% chance that the measurement is correct. So is then 1%, which is 0.01 pu.
Frequently, if it is known that one of the metering devices might have more
accurate readings and historically gives closer measurements than other devices. Thus its
can be dropped down to a lower value, for example 0.001pu, which increases the
greater than the number of the state variables that need to be calculated. Therefore, it is
obvious that this case follows the over determined procedure, and thus we use equation
(2.19)
H(x) in this case becomes H(2, 3), since 2 and 3 are the state variables.
Therefore, it is essential to express the measurements P12, P13, P32 in terms of the state
variables 2 and 3.
33
Yielding:
Since P12, P13, and P32 is the same value for the whole system then the covariance
By substituting the estimated values, 2 and 3, in the real power equations earlier and
based on the assumption that all of the measuring devices have metering error variance of
When comparing these numbers with the original power flow numbers, it is clear
that theyre off. However, there are several reasons behind why the numbers are so
different from the original values. One of the reasons is obviously the measurement. The
measurements themselves are deviated from the True value by almost 10%, taking the
real power flowing between bus 2 and bus 3 as an example. The second reason is the
error variance of the measuring devices. In this case, was taken to be 0.01. Therefore,
the main objective function behind the Weighted Least Square method is to minimize the
The residual is a big number and therefore, engineers have worked for decades
trying to build efficient power electronic measuring devices that would give closer to
however, nowadays the accuracy level is much better than that. So if this accuracy is
reduced to one tenth of its value for one of the measuring devices, then the covariance
matrix will change based on the new value, which is 0.001 instead of 0.01. With the
following new covariance matrix and new measurements, there will be a dramatic change
in the value of the residual, state variables, and their corresponding calculated power
flows.
The new covariance matrix, R, based on the more accurate measurements is:
New measurements:
It is observed that with the new weight that was put on the measuring device on
the line between bus 1 and bus 2, the value of P12 is close to the original value as given in
figure 1.1. However, with the new weight being put on P12, it is witnessed that P13, and
P32 values were affected as well. P12 value got closer to the True measure, and
improved the estimated value from 6.5MW to 8.9MW, which is closer to the 10MW.
However, this leaves a negative effect on the estimated value P13, and P32. Both values,
moved a bit further than the previous example, from 55MW to 57MW for P13, and from
measuring devices and their performance relative to the actual measurements, the WLS
method can be applied. As seen from this example, the measuring device M12 was noticed
37
to give more accurate results compared to the other measuring devices. Therefore, a
weight was added to the equation to stress on the M12 measurements more than the rest
since it is more accurate historically. Therefore, the estimated value for the state variable
and the corresponding P12 improved and became closer to the real value. By applying this
concept to all of the parameters and components of the network, the residual Jacobian
matrix is minimized, and the error becomes smaller as the iterations progress.
method, however the minimum variance criterion minimizes the expected value of the
sum of the error that has been described in the previous section. In other words, it is a
statistical method that merges individual elements into groups based on the residual
The minimum variance criteria were originally introduced by Joe H. Ward Junior
[6]. This method is widely used due to its simplicity and its advantage of not requiring
the complete statistical description of the random errors. The first and second orders of
the measurement errors are the only two variables needed in this method.
malfunctions, life cycle, incorrect wiring, or anything of that kind. Therefore, detection of
bad measurement data is vital at this point to the power system modeling. If bad data is
continuously present as an input to the state estimators, then the systems state variables
38
will be off from the desired estimates. An algorithm has to be incorporated with the state
estimation method in order to identify bad measurements and eliminate them from the
system. Detecting bad data can be done using several techniques and one of them is
through the use of the Chi-Square test. The identification is found by the largest
normalized residual test, which is one of the main methods used for bad data test [15]. In
One indicator for the existence of corrupted data in the set of measurements is the
magnitude of the residual, J(x), which is a product of state estimation as discussed in this
report. A fairly small magnitude of J(x) indicates that the measurement set does not
In order to determine the boundary or the range in which the residual magnitude
can be considered a good or a bad number, the residual would have to follow a specific
distribution just like the measurement function. Therefore, the residual J(x) is considered
as the degree of freedom parameter of this distribution, which is the difference between
the number of measurements and the number of states as shown below [1]:
(2.20)
where:
39
Nm : number of measurements.
Ns : number of states.
n : number of buses.
A threshold has to be specified by the user for the residual. It has been observed
that the presence of bad data shows a standard deviation of higher than 3 error bound
for the measurement [1]. Lets assume that the threshold is defined as LJ, as a limit or
boundary for the residual. A hypothesis test would be performed on the Chi-Square
distribution to determine if the residual lies within the acceptable region or not. Hence,
choosing the right threshold is important at this point. If the limit is being set too low,
then the test might fail in a way in which the residual would be noticed to be bigger that
the threshold and thus would fail the test even though it doesnt necessarily contain bad
data. On the other hand, the other option is that the boundary limit would be set too high
to identify or choose a threshold value as long as the significant figure, , is known. The
significant figure indicates the probability in which the residual, J(x), would be bigger
than a specified threshold, LJ. For further explanation and depiction of this method, an
2.5.1.1 Example on the use of Chi-Square Distribution for Bad Data Detection
Lets assume that six independent measurements are received from a substation
for that single bus for the quantities shown in the following table, knowing that they have
Variable x1 x2 x3 x4 x5 x6
detection using the Chi-Square distribution. From the problem statement, it is concluded
that the significant figure, , is 100-95 = 5, and that the degree of freedom is calculated as
follows:
Therefore, in order to obtain the probability of getting this value using the Chi-
Square method, the sum of the squares of those six measurements has to be calculated.
41
By using the Chi-Square distribution table and the calculated values, the degree of
freedom and the significant figure, a value for the threshold was extracted, where LJ =
11.070. Therefore, as seen from the figure below, the sum of the squares happened to be
lying in the rejected area. This is because the value L was bigger than the threshold, LJ, as
J(x) = 18.45 > LJ =11.070. This means that the data collected failed the test, which shows
can be calculated using the WLS method. Therefore, this objective function can be used
to detect bad data in a system. With the use of the Chi-Square test and the data obtained
from J(x), the following steps can be used to determine whether a set of data holds bad
data or not.
I. The measurement residual function or the objective function, J(x), is first solved
using equation 2.10 as shown earlier in section 2.3. The following equation is
II. According to the pre-stated confidence percentage and the degree of freedom in
the problem statement, a value from the Chi-Square distribution table is then
III. Both J(x) and LJ are compared to evaluate the presence of bad data in the system.
Therefore, if J(x) LJ, then bad data is present, otherwise, the measurements set
is presumed to be acceptable.
One of the methods that can be used to identify and remove corrupted data is
known to be the largest normalized residual test. The method is implemented differently
depending on the type of bad data. The first case corresponds to a single bad data with
large error. The second case corresponds to multiple bad data in the set of measurements.
43
The single bad data detection case is easier to deal with, since only one bad data point
has to be identified and extracted. In this situation, the bad data measurement would
correspond to the largest normalized residual described shortly afterwards. The other case,
where multiple corrupted data is recognized, can be divided into three groups:
1. Non-interacting: this group of bad data has weak relationship between the
residuals, which means that the residuals are not significantly affected by other
adjacent ones.
2. Interacting: if multiple bad data points interact with each other, then that could
indicate the presence of false errors in good measurements. This happens when
there is a strong correlation between the good and the bad data.
3. Interacting but non-conforming: this group is explained in the same sense as the
Interacting group, except when the errors are matching or compatible then they
will appear as consistent with each other, and therefore, very difficult to identify
Clearly, the magnitude of the residual can determine the presence of false data;
however, J(x) didnt show which measurement was the corrupted one. After the Chi-
Square test is executed, based on its results, the largest normalized residual test is carried
out in order to find the bad measurements. This process simply finds the difference
between the calculated and the true measurements, then dividing the resulting
44
approach found in [16], describes the following steps for executing this test:
1. The first step is to find the residual, which, as described earlier, is an output from
the state estimation process. The residual or the error, e, as expressed earlier in
(2.21)
2. The second step is to normalize the residuals. In order to do that, the residual is
square root of the covariance, the new modification is as follow with the addition
(2.22)
is usually set to 3.0 [4]. The residual is identified as a bad data and is removed
4. After removing and eliminating the corrupted measurements, the state estimation
process is repeated after extracting the bad data. Afterwards, steps 1 through 3 are
Chapter 3
3.1 Introduction
Despite the fact that the WLS method can be used to accurately solve the
unknown state variables of a power system, it remains a static approach. This means
that the WLS method uses measurements from the power network at a certain snapshot,
and calculates or estimates values close to the True value for the unknown state
Dynamic State estimation is a technique used to predict the future state variables
solution for the current snapshot at time t, in addition to the next upcoming state vector at
time t+1, without the need to know the measurements. Just like the static approach, the
dynamic techniques can also detect bad data and identify errors. Moreover, it works
efficiently under normal or emergency conditions, which makes it very suitable and
useful for the power system state estimation development. Therefore, a great advantage
of this is that engineers can know in advance what sort of problems to expect from the
system. This provides more time to act and respond quicker to critical conditions and
unexpected events.
Although dynamic state estimation was explored at the same time as static state
estimation, the technology was too primitive to develop and improve it. However, with
state estimation is at its raise nowadays. Measurements such as PMUs and synchro-
phasors provide engineers with fast and accurate data for enhancing the estimators, and
Kalman Filter is one of the main methods used for dynamic state estimation. The
classic Kalman Filter technique is used for linear dynamic state estimation, which can be
helpful for some electric power systems. However, as discussed earlier, power system
problems are non-linear and therefore, some adjustments and improvements to the
classical Kalman Filter method were done to accommodate those needs. The two
improvements of the classical Kalman Filter method are known as The Extended
Kalman Filter, and The Unscented Kalman Filter, which will be discussed in this
chapter.
spacecraft, airplanes, vehicles, power systems, and other engineering fields. It is used for
guidance, prediction, control, navigation, signal processing and many more. The concept
behind Kalman Filter is to find precise values for unknown variables of a certain system,
imprecise, containing noise and errors. Since Kalman Filter is a dynamic state estimator,
it operates over time, by observing the input data and trying to find an optimal estimate
For this method to work appropriately, some assumptions have been made. The
first assumption is that the studied system has to be of a linear nature. The second
supposition is that the measurements error follows a Gaussian distribution. The following
Some observations can be grasped from the figure above. First, the mean and the
state covariance vary with respect to time. Second, the states mean and the covariance
are the Kalman Filters mean and covariance, respectively. The third and final is that
once the measurement data has been entered into the system, both the mean and the
In order to follow the process of the classical Kalman Filter and calculate or
estimate the state variable of the system, one should create the following matrices:
Fk : the state-transition model that is applied to the previous state variable (k-1).
uk : control vector.
Bk : the control-input model applied to the control vector for every timeframe.
Hk : relies on the measurement data to map the observed state of the system based on
Therefore, based on the above list of matrices, two formulas are created for the state
(3.1)
This equation has been further modified and split into the predicted state estimation
(3.2)
(3.3)
(3.4)
The state update equation is also expanded to show the error residual , residual
covariance Sk, Kalman Gain Kk, and finally similar to the prediction phase, the state
estimate and the covariance estimate for the update stage, and Pk|k, respectively.
(3.5)
51
(3.6)
(3.7)
(3.8)
(3.9)
The whole idea behind Kalman Filter method can be explained by concentrating
on equation 3.8. Depending on the error residual, which is the difference between the
SCADA or synchro-phasors for example, the state estimate value is evaluated. Therefore,
if the error residual, , is zero, meaning that the measurements were practically the same,
then the predicted value of the state variable at time k, , is considered to be the same as
the state at k-1, , and therefore, wouldnt need an update. On the other hand, if the
error residual is not equal to zero, then the Kalman Gain Kk controls by how much to
correct the estimate to bring it to the actual estimate at time k. Therefore, the
However, as discussed earlier, this classical method is not suitable for non-linear
power system network problems. Thus, the following sections explain the different kinds
of non-linear Kalman Filter methods that have been developed for such particular
problems.
52
new techniques were presented to handle non-linear systems, since the classical methods
are not very suitable for non-linear systems. Therefore, the next sections will discuss two
extensions of the classical methods, namely the Extended Kalman Filter method, and the
methods, such as the Taylor Series expansion method. In this method, the system models
dont have to be linear in order for the Kalman Filter to work. The process described
below explains how the extended Kalman Filter linearizes the non-linear function at the
As seen in equations 3.10 and 3.11 below, a similar concept is to the classical
procedure is applied. However, this time few adjustments were made to make sure that
the equations would be compatible and working well with non-linear systems.
(3.10)
(3.11)
where:
f(xk-1, uk-1) : is any linear or non-linear function that is used to compute the predicted
h(xk) : is a similar function to f(x, u), however, it is used for the predicted
measurement calculation.
e and c : system and estimation error at specified time, just as defined earlier,
In order to calculate for the covariance estimate, the Jacobian matrix, which is a
partial derivative matrix, has to be formed and computed. Equation 3.3 for prediction is
applied to this approach, in addition to the formulas from 3.6 to 3.9 for the update.
However, a new definition for the H and the F matrix is outlined in terms of the partial
derivatives.
(3.12)
(3.13)
(3.14)
54
estimate for the state variables in our power system network problems. However, one of
the disadvantages of the Extended Kalman Filter method is that it does not result in an
optimal solution or estimate. The estimate relies on two items. First, the accuracy of the
set of measurements. Another important key is the transition model of the power system
and how close its transitions get. The closer these two keys get to being linear, the closer
the Extended Kalman Filter moves towards the classical Kalman Filter method. The
Extended Kalman Filter (EKF) is probably the most widely used estimation algorithm for
community has shown that it is difficult to implement, difficult to tune, and only reliable
for systems that are almost linear on the time scale of the updates. Many of these
Following the Extended Kalman Filter (EKF) procedure, some of its drawbacks
were observed. To name a few, the approximation that it provides is not an accurate
estimate since the process linearizes the function, in addition to neglecting the non-linear
iterative means or other similar ways to get closer to the True value. Therefore, a
different approach was developed that does not linearize the function of the power system
UKF is a similar method to the EKF, however, its known to be the derivative
free technique. UKF uses the non-linear function, unlike the linearization of the EKF. It
then finds the state estimation by approximating the probability distribution of the non-
linear system. A strong mathematical function has been introduced to improve the
probability are known as sigma points. After performing the transformation, an estimate
of results is produced in the form of mean vector and its error covariance matrix by
The unscented transform is the key technique in the Unscented Kalman Filter
method. By using this technique, the non-linear function is actually being used to help get
the estimate as close as possible to the True value. The estimate resulting from the
UKF is closer than that of the EKF, because the function is not linearized and the high
order terms are actually used and not neglected. One other benefit of using this method is
the removal of the derivation step. Because the power system model is huge and complex,
the creation of a Jacobian matrix like the one used in EKF would be costly and time
consuming. Therefore, by using the UKF method, there will be no need for the formation
of the Jacobian matrix. Another major advantage of using the unscented transformation
method in the Kalman Filter is that it includes the third order and therefore increases the
An easy way to explain this is by using the non-linear function, a set of samples is
propagated around the last known state of the system. By using weighted matrices,
described later in this section, an estimated mean and covariance are produced from those
sampling points.
Prediction Step
considering the underlying state of dimension n. Therefore, 2n+1 sigma points are
derived from the state and the covariance matrix. This is composed of one equation for
the initial state, and two equations for each augmented state as shown below:
(3.15)
(3.16)
(3.17)
where:
= 2( + n) n (3.18)
10-3 1
= zero, or = 3 n.
Combining equations 3.16 and 3.17 together into one expression results in the equation
below:
(3.19)
where contains the sigma points calculated from the state vector and the covariance
functionality of the UKF in order to produce the matrix of the same size, , with the
sigma points according to equation 3.20. Next by using equations 3.21 and 3.22, the
predicted state mean vector and its corresponding covariance matrix are extracted from
(3.20)
(3.21)
(3.22)
58
(3.23)
(3.24)
(3.25)
Superscripts c and m stand for covariance and mean, respectively. Both weights
them.
Update Step
predicted step. The calculated predicted mean vector and covariance matrix from
equations 3.21 and 3.22 in the previous stage are fed to this part of the correction. Using
the sigma points from equation 3.19, new sigma points are evaluated and updated based
on the latest data. Those sigma points are propagated one at a time through the non-linear
measurement function h as shown below. Since was used for the first created sigma
points, let be the new updated sigma points, where subscript k is the timestamp.
(3.26)
(3.27)
59
The updated sigma points are then weighted and combined together to form the
Equations 3.28 and 3.29 are used based on the same concept used earlier in the classical
(3.28)
(3.29)
At this point, in order to calculate the Kalmans Gain (Kk), the predicted
calculation as well, which is known as the cross-covariance matrix of the state. This
matrix uses the predicted state mean calculated in the previous step, in addition to the
initial sigma points from the prediction state. Therefore, the cross-covariance matrix (Ck),
is calculated as follow:
(3.30)
matrix with the inverse of the predicted measurement covariance matrix according to
(3.31)
60
Finally, after calculating the Kalmans gain, the mean of the sigma points, the
predicted state mean vector, the predicted covariance, and the predicted measurement
covariance matrix, the systems state and covariance matrix are computed by:
(3.32)
(3.33)
chosen over the EKF to be impeded in state estimator tools since power systems are
complicated models and need a method such as the UKF to deal with its non-linearity. As
observed from the discussion provided in this section, the UKF method does not need the
process of deriving and creating the Jacobian matrix. Accordingly, the estimated state
variables are closer to being accurate than either the classical Kalman Filter method or
the EKF technique. With that being said, power system models get more realistic which
enable engineers to control and monitor the power network efficiently without worrying
about the fact that the model was built based on a linearization procedure or algorithm.
61
Chapter 4
non-linear approach such as the Extended Kalman Filter (EKF), method for solving an
permanent magnet synchronous motor (PMSM). Using the two previously mentioned
approaches, the currents through the two windings of the PMSM, in addition to the
A review of the EKF structure will be illustrated. Moreover, the PMSM system
vectors and matrices of the system. Both the linear and the non-linear approaches will be
performed on the same motor model, control system, and using the same parameters
(resistances, moment of inertia, flux constant, covariances, etc.) for best comparison. The
4.1 Introduction
PMSMs are greatly growing in nowadays industrial demands. There are so many
reasons behind why PMSMs are becoming the main variablespeed alternative current
motor drives. One of the reasons is its high efficiency due to the negligible rotor loss
State estimation is vital for the sensorless PMSMs, a special kind of PMSMs that
uses this type of control technique to enhance the motor and increase its efficiency,
62
reliability and reduce its cost. Therefore, for this type of PMSM, the motors position and
speed need to be estimated and consequently fed back into the system.
produce the optimal estimate of a systems states. The EKF is specifically designed to
work with non-linear systems, such as the one that will be introduced in this chapter.
EKF as discussed in 3.3.1 uses the linearization technique or principle for finding the
estimates. The EKF is a great method to be applied to the PMSM; however, as mentioned
previously, it has its disadvantages when being used for larger and more complex systems,
but wont affect this system since its not as complicated. The EKF approach is costly
sometimes when used on complex non-linear systems because of the need to create the
Jacobian matrices. This method uses linearization techniques, which removes the higher-
This chapter is structured as follows: section 4.2.1 talks about the general
representation of the sensorless PMSM and some of its useful equations. The next
subsection discusses the specific PMSM case study, stating its parameters, non-linear
equations, and other useful information that is used for both the linear and the non-linear
approaches in the following sections. In part 4.3 the first approach, the linear one, is
described and used to solve the estimates and finally present its simulation scheme. The
same steps are reflected on the EKF method in section 4.4. Finally, the last section,
discusses, analyzes and compares the results obtained from using the two methods
mentioned.
63
equations
PMSMs have been widely used in the new generation of electrical motors because
of their reliability, and high performance. PMSMs have high torque due to the small
motor size leading to small moment of inertia [19]. However, one of the drawbacks of
these motors is that they need a constant update on the rotors position. There are two
ways of providing this: one way is through the use of mechanical sensors, which can be
expensive to include in the mechanism. Another way is through the use of estimators.
The latter illuminates the use of sensors and, therefore, would make the motors cost
effective. However, in order to accurately provide the rotors position, there must be a
reliable technique used for that estimation. This chapter will be discussing some of the
Like induction motors, PMSMs have a three-phase coil as the stator where the
permanent magnets are fixed on the rotors surface. A PMSM provides rotation at a
fixed speed in synchronization with the frequency of the power source, regardless of the
fluctuation of the load or line voltage [19]. In other words, regardless of the torque, of
course within the motors limit, the PMSM will still operate at a constant synchronous
speed that matches the main frequency its connected to. Due to the fact that PMSMs are
brushless, unlike the DC motors, therefore, they will not face problems of mechanical
wear or replacement of any brushes or mechanical moving parts. For that purpose, an
64
increase in demand on PMSMs has been noticed in the power industry for power
generators.
sensorless PMSM. Starting from the left-hand side of the figure, the rotors reference
mechanical speed, in electrical rad/s, is initially being fed into the system. A
mechanical speed corrector or upgrader, from the estimator, will be added to that value to
set it to the right amount, which will be discussed soon in this section. The net value of
the rotors mechanical speed is then imported into the Proportional-Integral (PI)
used in the control systems in the engineering industry. The first PI controller specifically
controls the mechanical speed of the rotor, hence the name PI speed controller. This
controller outputs the reference value for the exciting current, iq, to the next block.
65
The LUT block stands for Lookup Table. It is a form of controller that can be
set up to perform any form of logic function. This feed-forward type of control strategy is
useful since it takes the logic function and gives out two outputs. The first output is the
reference value for the field exciting current, , which is kept at zero value in this case
due to the permanent magnets at the rotors. The second output is the reference value for
Both exciting reference current values are then fed into another control block, the
PI currents controller block. This type of PI controller needs more than just one input,
compared to the PI speed controller. The PI current controller needs four inputs in order
to process the logic, resulting in two different outputs for the voltage references, .
The four inputs for the PI currents controller are: the stators reference exciting currents
in the dq-frame, and , as well as the estimated values for those exciting currents of
the stator also in the dq-reference frame, isq and isd. The estimated values are obtained
from the state estimator that will be discussed in the next steps in this section.
A Pulse Width Modulation (PWM) is used to convert the two voltage vectors that
resulted from the PI current controller to three-phase current. This is done by using the
the PWM block, which is the angular position, . This angular position is also obtained
Using both the PWM and the Inverter, as seen in the furthest right-hand side of
the figure, 3-phase currents are the product of that control scheme. These 3-phase
66
currents are then used as inputs for the PMSM. However, before they get into the PMSM,
two of the three current vectors are taken, ia and ib, and are processed using different state
estimation methods and techniques to estimate the parameters mentioned earlier to be fed
As discussed earlier in the previous steps, those parameters were fed back into the
system for an update and correction of some of the components. The estimated rotors
speed was used to correct the reference in the first steps of the control scheme. The
estimated stators currents in the dq-reference frame were used as inputs for the PI
current controller block, as explained earlier. Finally the angular position was used as an
input for the PWM, and based on that the voltages were converted accordingly.
The general non-linear state equations for the permanent magnet synchronous
(4.1)
(4.2)
where:
67
State matrices:
(4.3)
68
The state variables vector for this type of non-linear PMSM system is:
(4.4)
where:
Tl : Loads Torque in Nm
69
q1, q2 : uncertainty in control inputs process noise with zero mean and 0.1 amps
standard deviation
q3 : load torque disturbance noise with zero mean and 0.5 rad/sec2 standard
deviation
For the study case or example that will be carried out in this chapter, table 2
Parameter Value
Rr 1.9
L 3 mH
0.1 Wb
J 0.18x10-3 kg.m2
F 0.001 Pa.s
ub(t) = cos(2t)
Finally, the output winding currents are the estimated value or the measured value
added to some process noise, j(1) and j(2), with standard deviation equal to 0.1 amps, of
course because of currents, and zero mean. They are represented as follow:
70
y(2) = ib + j(2)
therefore, linear systems tools can be applied after linearizing it first. The linearization in
this case would be around a nominal operating point that is time-variant since the system
is time-dependent. Thus, it will be beneficial to use linear methods for state estimation,
(4.7)
For simplicity, the process noises, qi, were removed from equation 4.3. After the
minor modification, the model vector is defined as the main function for this system as:
(4.8)
Thus, in order to linearize the system, the system equations in equation 4.3 need
to be partially derived with respect to x and u. By doing so, a partial derivative matrix in
that matrix G is the same as that mentioned in equation 4.1 and matrix A was denoted as
Fk in previous chapters.
71
(4.9)
where, ;
The problem right now is to apply and verify this in MATLAB for the quadratic
linearization of the dynamic PMSM system. Therefore, since it is difficult to solve this
manually, ordinary differential equation (ODE) MATLAB built-in functions can be used
First, a function was created to include the differential equations of the PMSM
system stated in equation 4.8. The PMSM.m file was saved in the directory to be used by
the ODE function during the simulation. Then the simulation for the linearized and the
real function was formed and constructed as follow: Initial values were set for the state
variables, time span and other similar parameters. Then the ode function extracted those
resulted in two outputs, time as a vector (t), and state variables as a matrix (X). Each row
Next, after all the parameters of the PMSM were defined, two loops were created.
One loop saves the data obtained from the ODE solution in arrays for plotting at the end
of the simulation, and the other performs the real differential non-linear equations.
Equation 4.8 was calculated at every cycle, considering the most updated or recent state
variable available at that iteration. Of course, the loop primarily ran with the initial value
that was pre-defined. Afterwards, the noise, previously seen in equation 4.3, was added
before the state variable value was updated by the addition of the calculated .
previously discussed. For this section, we will use the continuous-time EKF to estimate
the state of the PMSM explained in section 4.2. A brief revision will be listed to show
how the algorithm and the programming sequence part will be arranged. Then a step by
step description of the EKF approach will be explained using the PMSM parameters, and
Therefore, the basic idea behind applying EKF algorithm on this specific problem
is to linearize the state-space model represented below. This linearization is done for each
The non-linear state equations for the PMSM are represented in the following
(4.10)
where c and e are the Gaussian process noise, and measurements noise, respectively.
Both noises have zero mean with a covariance matrix, Q for process noise and R for the
measurement one.
Below is the list of steps for the continuous-time EKF algorithm that will be
(4.11)
2. Partial derivatives are obtained in the form of matrices with respect to x, in this
case the currents, angular position, and the rotors velocity. Also with respect to
both of the noises associated with the system equations, c and e. The notations
(4.12)
74
(4.13)
4. Finally, the Kalman Filter equations, as described and listed in equations 3.5 to
3.9, are applied to the PMSM linearized system and are relisted below:
(4.14)
system equations that were shown in matrix form in equation 4.3. However, the equations
below are the first step of the algorithm shown in a detachable form for a clearer
understanding.
75
Of course, before listing all these equations in MATLAB, the definitions for the
parameters were identified. This ranges from the winding resistance, to the winding
friction, control and measurement noise, input frequency, and of course the initial state
estimation covariance and state. Most of these parameters are either listed in table 4.1 or
mentioned in the description in section 4.2.2. The covariance matrices R and Q are
calculated using e, q1, q2, q3, where qis are the measurement noise, as follow:
Other parameters that were not mentioned but are vital for the programming and
plotting sections are: the integration step size, which I chose to be 0.0005 in order to be
76
accurate enough, the simulation time, and a parameter on how often to plot the results,
are 1.5 and 0.01, respectively. Finally, some arrays were defined to contain all the useful
A for loop was stated from time 0 to the simulation time of 1.5 seconds with
0.0005 increments. The nominal time-dependent control inputs, ua(t), and ua(t) were
defined inside the loop since they depend on the time. Then the is calculated and the
noises are added to it after being multiplied by a random number between 0 and 1 to
make it a more realistic system. The change in x being calculated is then added to the
initial guess. Therefore, every time the iteration moves forward, the x is updated with the
In the same loop, the Kalman Filter equations are used for the final steps. The
partial derivatives were calculated as explained in the second step in the above algorithm
and substituted using . Following the partial derivative, using the equations in the fourth
step, the prediction of the state can be calculated. Afterwards, they are updated using the
correction step as explained in section 3.3.1 of the Extended Kalman Filter. The
equations listed in step number 4 are divided in two parts, the prediction step, and the
Prediction Step:
77
Correction Step:
where:
This means that at time, tk, the optimal state estimation , and its covariance
, go through the loop mentioned and are processed in two steps: the prediction and
the correction steps. The prediction step takes the estimate at time k-1 with its mean and
applies it to the equations from the previous time sample to the current one. Then in the
correction step, the actual current measurements are obtained from the motor and
therefore, those predicted state estimations are corrected using the actual measures.
In this section, the plots obtained from performing the generalized linear approach,
and that of using the EKF method are analyzed. Figures 4.2 and 4.3 below show the plots
for the linear and EKF approaches, respectively. The plots contain four subplots within
them. Moving clockwise from the first top left, we start with the first ia current in Amps
78
plotted with respect to the time in seconds. Going forward from there comes ib current,
followed by the position in radians, and finally the speed in radians per second, all with
0.6 0.4
0.4
0.2
0.2
ia (A)
ib (A)
0
0
-0.2
-0.2
-0.4 -0.4
0 0.5 1 1.5 0 0.5 1 1.5
10 8
True
Speed (Rad/Sec)
5
Position (Rad)
6 Linear Est
0 4
-5 2
-10 0
0 0.5 1 1.5 0 0.5 1 1.5
Time (s) Time (s)
0.5 0.4
0.2
ia (A)
ib (A)
0 0
-0.2
-0.5 -0.4
0 0.5 1 1.5 0 0.5 1 1.5
Time (Seconds) Time (Seconds)
10 8
5 6 EKF
0 4
-5 2
-10 0
0 0.5 1 1.5 0 0.5 1 1.5
Time (Seconds) Time (Seconds)
red line, which is the estimated state variable using EKF, is almost overlapping with the
true non-linear function. However, when looking at that of the linear approach, the
prediction is not as close as that of the EKF. This shows the advantage of using EKF over
the simple linearized approach. However, this system is comparably small with that of
the power system network model. Therefore, in order to better compare those results, the
difference between the true and the estimated values for both methods were computed
and plotted for each of the subplots. Keeping in mind that the arrangement of the subplots
is the same as before. The y-axis depicts the error or the difference, and the x-axis shows
the time in seconds. Figures 4.4 and 4.5 below show those errors for the linear and the
0.1 0.1
0.05 0.05
Error
Error
0 0
-0.05 -0.05
-0.1 -0.1
0 0.5 1 1.5 0 0.5 1 1.5
Time (s) Time (s)
2 5
1 0
Error
Error
0 -5
-1 -10
0 0.5 1 1.5 0 0.5 1 1.5
Time (s) Time (s)
0.1 0.1
0.05 0.05
Error
Error
0 0
-0.05 -0.05
-0.1 -0.1
0 0.5 1 1.5 0 0.5 1 1.5
Time (s) Time (s)
2 0.6
0.4
1
Error
Error
0.2
0
0
-1 -0.2
0 0.5 1 1.5 0 0.5 1 1.5
Time (s) Time (s)
The error plots help visualizing the difference between the two methods. It is
noticed that the error in the currents using the linear approach keeps on fluctuating
between -0.07 and 0.05 for ia and between -0.9 and 0.05 for ib. On the other hand, when
looking at the EKF difference, it is observed that the fluctuation of 0.06 takes place
within the first 0.3 to 0.4 seconds, and oscillates around 0 for the rest of the time. This
shows that the EKF gives a better estimate as time progresses and throughout the
simulation. Similarly, looking at both the position and the speed error subplots for both
methods, related observation is concluded. EKF error fluctuates at the beginning of the
simulation and gets minimized as time progresses oscillating around 0. Unlike the first
method, where the error fluctuates at a higher value throughout the whole simulation
timeframe.
82
Chapter 5
State estimation plays a very important role in the control and monitoring of
power systems. In power systems, state estimators process the available data obtained
from either SCADA or PMU, then estimate and predict the best possible value for the
voltage magnitude and angle in the network. The state estimator gathers all the data
available from the network, filters it, and uses it for calculating and predicting the other
unknown parameters. As explained and shown in this report, the input data, for example,
the active or reactive power, are most of the time imperfect, redundant, contain process
Several methods were discussed and explained throughout this report. Some of
to estimate a value close to the true one. Maximizing the probability of obtaining the
true value is one of the techniques used for state estimation. However, the most
common and well known method is the weighted least square (WLS) method, which
mainly minimizes the sum of the errors, also known as the difference between the true
and the estimated values. This method is very useful in the power engineering world. To
add up, several methods were introduced based on the principle of the least squared
technique.
power system state estimation, the dynamic approach would be the best fit. As known,
83
power systems are highly non-linear systems. The structure of the network is very
complex and complicated that simple static state estimation methods wont produce the
expected results. In this report, some of these static state estimators were introduced and
carried out through various examples showing their inaccuracy and the difficulty of
applying those techniques to such systems. Therefore, methods like the WLS, and other
The state variables in power systems again are the voltage magnitude and voltage
phase angle at the networks buses. Imperfect measurements are gathered from all the
measuring devices, and substations along the system. These imperfect power
measurements contain errors or noise when fed into the state estimators. As useful as the
WLS can be in estimating the state variables, it cannot predict the future state of the
system. In other words, the initial state has to be changed at every iteration and time
stamp. For that reason, non-linear state estimation methods were developed to meet this
purpose.
At the present time, communication and data transfer are easier to implement with
the advancement in technology. Fast and accurate measurements are available for the
estimators even with a time stamp using the GPS technology. Thus dynamic state
estimators are becoming more common and are highly reliable estimation tool not only to
estimate the current state at time t but also to predict the future state at time t+1. With that
being said, often the problem that we come across is an over-determined one. This means
that it is the case when there are more measurements available than the number of output
84
results expected by the estimator. This is very useful for the estimator since there is
State estimators have another useful function other than just estimating the state
of the system. They have the ability to filter out the bad data obtained from the network.
The imperfect measurements are sorted out and cleaned by the estimator; bad data points
chapter 2. After detecting the bad measurements, a removal process is then carried out to
keep the better measurements that can be valuable for the state estimation process.
Once the estimation tools have been developed to estimate the states or
parameters, and detect/remove the bad data, a more realistic model can be simulated. The
to the real system. By doing this, engineers can not only increase the reliability of power
systems, but also detect bad data and probably identify the problem and fix what is
causing it. In addition to improving the accuracy of voltage magnitude, and phase
estimates. Hence, State estimators increase the overall efficiency of the system,
interconnected networks as seen from EMS [22]. The energy market is in an increasing
demand now more than ever. This means that the network models have to be very precise
and realistic. This cannot be done without the use of state estimators. In this report and
specifically in chapter 3, non-linear state estimation methods were introduced, namely the
85
Kalman Filter. As discussed, the Kalman Filter is a famous approach used for non-linear
systems such as power systems. Three different approaches of the Kalman Filter were
introduced: the Classical Kalman Filter, the Extended Kalman Filter, and the Unscented
Kalman Filter.
Two different methods were used in solving a case study that was introduced in
chapter 4. The problem statement on the Permanent Magnet Synchronous Motor (PMSM)
was explained. The state variables to be estimated for the PMSM were the stators
currents, as well as the angular position and velocity of the rotor. This system was chosen
because of its high non-linearity and complexity, but at the same time simple enough to
explain and show the advantages and drawbacks of some of the methods used.
The first method was a linear approach used for this non-linear system. This
method showed how linear techniques are not as good and accurate when applied to non-
linear systems such as the PMSM. It showed that the difference or the error between the
actual and the estimated value kept on fluctuating throughout the simulation. The second
method that was performed and used was the EKF. EKF is specifically designed for non-
linear state estimation. This technique, in addition to the generalized linear approach, was
studied on the PMSM problem and their results were compared. EKF was found to be
suitable for such non-linear systems. The results and outputs generated from its algorithm
were close enough to the real value of the state variables, and as the simulation time
progressed, the error got smaller. However, the results from the linear approach were
good, keeping in mind that the PMSM problem is a small one compared to the complex
86
power systems. Nevertheless, the main objective of the study carried out in chapter 4 was
to compare the two different methods and determine, based on the results, which one is
approach. In EKF and other state estimation algorithms, a linearization process is initially
performed on the non-linear system before executing the estimation scheme. The latter
less when using UKF because of its Jacobian-free approach. By adopting RTOs as an
example, power engineering companies will thus save time and money.
This report discusses the different methods that can be used for estimating the
state variables of non-linear systems, and concludes that the EKF technique was the most
suitable approach for the PMSM case study. A possible future work or improvement is to
apply the iterated Extended Kalman Filter (IEKF) algorithm, or use a hybrid of Kalman
Filter approach and Monte Carlo Simulation technique. The performance of the new
Appendices
clear all
clc
%Plotting Parameters:
dt = 0.0005; % Integration step size
tf = 1.5; % Simulation length
dtPlot = 0.01; % How often to plot results
tPlot = -inf;
% Plot data.
close all;
figure;
plot(tArray, XArr(2,:),'r:');
ylabel('ib (A)');
figure(2);
for k=1:4
subplot(2,2,k)
plot(tArray, diff(k,:))
xlabel('Time (s)'); ylabel('Error');
end
ua0 = sin(w*t);
ub0 = cos(w*t);
dx(1)=-Rr/L*x(1) + x(3)*lambda*sin(x(4))/L + ua0/L;
dx(2)=-Rr*x(2)/L - x(3)*lambda*cos(x(4))/L + ub0/L;
dx(3)=-(3*lambda*x(1)*sin(x(4)))/(2*J)+3*lambda*x(2)*cos(x(4))/(2*J)-Vf*x(3)/J;
dx(4)=x(3);
dx=dx';
return
90
clear all
clc
% PMSM Parameters:
Rr = 1.9; % Resistance
L = 0.003; % Inductance
Vf = 0.001; % Viscous friction coefficient
J = 0.00018; % Moment of inertia
Lam = 0.1; % Flux constant (Lam for Lambda)
w=2*pi; % System Frequency
% Plotting Parameters:
dt = 0.0005; % Step size
Sim_End_Time = 1.5; % Simulation End Time
dtPlot = 0.01; % Frequency of Plotting
tPlot = -inf;
% EKF Initial Values:
x = [0; 0; 0; 0]; % Initial state
P = eye(4); % Initial state estimation covariance
x_Hat = x; % State estimate
n=4; % # of state variables
% Simulation:
for t = 0 : dt : Sim_End_Time
% Saving useful data for plotting purposes:
if t >= tPlot + dtPlot
tPlot = t + dtPlot - eps;
x_Array = [x_Array x];
x_Hat_Array = [x_Hat_Arrayx_Hat];
time_Array = [time_Array t];
diff = [diff x-x_Hat];
end
%%
% EKF:
% Nominal Input Voltages:
ua0 = sin(w*t);
ub0 = cos(w*t);
% Plotting
close all; figure(1);
figure(2);
for k=1:4
subplot(2,2,k)
plot(time_Array, diff(k,:))
xlabel('Time (s)'); ylabel('Error');
end
93
References
[1] Allen J. Wood, and Bruce F. Wollenberg. Power Generation Operation and Control.
[2] Substance Abuse and Mental Health Services Administration, Center for Behavioral
Health Statistics and Quality. (January 8, 2013). The NSDUH Report: State Estimates of
[3] Schweppe F, Wildes J, and Rom D. Power system static state estimation: Parts I, II,
and III. Denver, Colorado: Power Industry Computer Conference (PICA), June, 1969.
[4] Ali Abur. Antonio Gomez Exposito. Power System State Estimation. New York:
[7] Singh N. State Estimation: Reality Check and practical considerations. RTE-VT
Workshop, 2006.
[8] Jian Chien, Measurement Enhancement for State Estimation. Texas A&M
[9] Ali Abur, Antonio Gomez-Exposito, Antonio de la Villa Jaen, Patricia Rousseaux,
and Catalina Gomez-Quiles. On the Use of PMUs in Power System State Estimation.
[10] Hongxian Wu, and Giri, J. PMU Impact on State Estimation Reliability for
[11] August 14, 2003, Blackout Final NERC Report. July 13, 2004.
[12] The Open Source Phasor Data Concentrator, Grid Protection Alliance, April 2011.
[13] Julier S.J, and Uhlmann J.K. Unscented filtering and nonlinear estimation.
Proceedings of the IEEE. Volume: 92. Issue: 3. March 2004. Pages: 401-422.
[15] Monticelli, A. and Garcia, A. Reliable Bad Data Procession for Real-time State
[16] Grainger, John J, and William D. Stevenson, Jr. Power System Analysis. New
[17] Ming Zhou, V.A. Centeno, J.S. Thorp, and A.G. Phadke. An alternative for
[19] Janiszewski, D. Extended Kalman Filter Based Speed Sensorless PMSM Control
with Load Reconstruction. IEEE Industrial Electronics, IECON 2006 32nd Annual
[20] Borsje, P, Chan T.F, Wong Y.K, Ho S.L. A Comparative Study of Kalman Filtering
Machine and Drives, 2005 IEEE International Conference on 15 May 2005. Pages: 815-
822.
[21] Dan Simon. Optimal State Estimation. A John Wiley & Sons Inc., Publication,
Year 2006.