Sei sulla pagina 1di 101

TABLE OF CONTENTS

Page

List of Tables ..................................................................................................................... ix

List of Figures ..................................................................................................................... x

Chapter

1. INTRODUCTION AND HISTORY OF POWER SYSTEMS STATE ESTIMATION . 1

1.1 General State Estimation Definition and Functions............................................ 1

1.2 Introduction to Power Systems and Electric Power Grid ................................... 2

1.3 Importance of State Estimators in Power Systems ............................................. 4

1.4 Numerical Example on the Importance of State Estimators ............................... 6

1.5 Supervisory Control and Data Acquisition, and Phasor Measurement Units ..... 9

1.6 Learning from Blackout Events ........................................................................ 12

1.7 State Estimators in Practical Implementation ................................................... 13

1.8 History of Power Systems State Estimation ..................................................... 14

1.9 Organization of the Report................................................................................ 15

2. POWER SYSTEM STATE ESTIMATION METHODS.............................................. 17

2.1 Introduction to State Estimation methods ......................................................... 17

2.2 Maximum Likelihood Method .......................................................................... 18

2.3 Weighted Least Squares Method (WLS) .......................................................... 20

vi
2.3.1 Weighted Least Squares Algorithm .............................................................. 21

Overdetermined Case .................................................................................... 21

Completely Determined Case ....................................................................... 21

Underdetermined Case .................................................................................. 21

2.3.2 State Estimation Example using WLS .......................................................... 31

2.4 Minimum Variance ........................................................................................... 37

2.5 Bad Data Detection and Identification .............................................................. 37

2.5.1 Detecting Bad Data ...................................................................................... 38

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

2.5.2 Identification and Removal of Bad Data ...................................................... 42

3. STATE ESTIMATION TECHNIQUES FOR NON-LINEAR SYSTEMS .................. 46

3.1 Introduction ....................................................................................................... 46

3.2 Classical Kalman Filter ..................................................................................... 47

3.3 Non-Linear Kalman Filter Methods.................................................................. 52

3.3.1 The Extended Kalman Filter Method ........................................................... 52

3.3.2 The Unscented Kalman Filter Method .......................................................... 54

Prediction Step .............................................................................................. 56

vii
Update Step ................................................................................................... 58

4. TESTING AND SIMULATION RESULTS ................................................................. 61

4.1 Introduction ....................................................................................................... 61

4.2 Permanent Magnet Synchronous Motor (PMSM) representation and .................

equations ........................................................................................................... 63

4.3 Linear Approach ............................................................................................... 70

4.4 Extended Kalman Filter Approach ................................................................... 72

4.5 Analysis and Comparison ................................................................................. 77

5. CONCLUSION AND FUTURE WORK ...................................................................... 82

Appendix A. Linear PMSM Approach MATLAB Code .................................................. 87

Appendix B. Extended Kalman Filter PMSM MATLAB Code ....................................... 90

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

1.1: 3-BUS Network Configuration .......................................................................... 7

2.1: Weighted Least Square Algorithm .................................................................. 30

2.2: Underdetermined Case Measurement Network ............................................... 30

2.3: Meter errors following Normal Distribution ................................................... 32

2.4: Chi-Square Distribution Threshold Probability Testing .................................. 41

3.1: Kalman Filter Algorithm ................................................................................. 48

4.1: Sensorless PMSM control Scheme .................................................................. 64

4.2: Linear Approach PMSM State Variable Estimation........................................ 78

4.3: EKF Approach PMSM State Variable Estimation .......................................... 79

4.4: Linear method Error......................................................................................... 80

4.5: EKF Approach Error ........................................................................................ 80

x
1

Chapter 1

INTRODUCTION AND HISTORY OF POWER SYSTEMS STATE

ESTIMATION

1.1 General State Estimation Definition and Functions

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

century, however, only recently engineers started implementing it into computer

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

VARs, respectively, or even ampere flows measurements. Therefore, voltage magnitudes,


2

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

economic dispatch [1].

1.2 Introduction to Power Systems and Electric Power Grid

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

organizations, to sustain the high reliability of the power system.

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

estimators, and contingency constrained Optimal Power Flow.

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

out of their limits or not.

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

control center is damaged or completely out of service, leading to miscommunication.

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

backwards, which can lead to a negative measurement of that parameter value.

1.3 Importance of State Estimators in Power Systems

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

measurements, as well as voltage and current measurements.

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

technology, it is seldom to send measurements from a field or a station to the control

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

challenges using state estimation techniques.


6

1.4 Numerical Example on the Importance of State Estimators

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

generates 30 MW at bus 2. A load at bus 3 is consuming 100 MW of power. In this

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

of the equations or calculations.

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

has the following parameters:

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

Figure 1.1: 3-BUS Network Configuration


Since bus 1 is known to be the reference bus, we can take two of the line power

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

from the True measurements.

(1.1)

Thus, knowing that bus 1 is the reference, then 1 = 0 rad.


8

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

just as discussed earlier.

Imperfect measurements:

P12 = 12MW = 0.12pu.

P13 = 48MW = 0.48pu.

P23 = 50MW = 0.5pu.

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,

respectively. In order to see the effect of these two imperfect measurements, in

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

analyzed estimations. Therefore, this shows the importance of developing a method or an

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

reference needed to be supplied in order for the measurements to be synchronized [8]. In

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

the main role in monitoring the system and its states.

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-

phasor measurements available from the PMU as discussed earlier.

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

injection data taken from SCADA measurements.

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

been challenging for the synchro-phasors to advance if it wasnt because of the

Symmetrical Component Discrete Fourier Transform (SCDFT) concept or algorithm [18].

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

such as state estimation techniques. Moreover, monitoring a dynamic behavior such as

the one in electric power systems will be less complicated and thus manageable with this

implementation.

1.6 Learning from Blackout Events

Blackout incidences triggered engineers and research facilities to reexamine the

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

that took place.


13

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

can work effectively and quickly.

1.7 State Estimators in Practical Implementation

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

Operator, and finally Ontario Independent Electricity System Operator.


14

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

analysis. In addition, state estimators have also contributed in the 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

for system models.

1.8 History of Power Systems State Estimation

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

now in state estimation applications and dominating other techniques.

In 1999, A. Monticelli published a book called State Estimation in Electric

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

state estimation in energy management.

1.9 Organization of the Report

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

method for bad data detection.

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.

Chapter 4 introduces a Permanent Magnet Synchronous Motor (PMSM) problem

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

can be done to improve the state estimation techniques.


17

Chapter 2

POWER SYSTEM STATE ESTIMATION METHODS

2.1 Introduction to State Estimation methods

As described earlier in chapter 1, state estimation is used to find an approximation

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

magnitude and voltage angle.

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

be briefly described in section 2.2.

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

3. Minimum Variance: The minimum variance is similar to the WLS, but it

minimizes the expected value of the sum of the errors as described in the WLS

method. This method will be briefly described in section 2.4.

2.2 Maximum Likelihood Method

Maximum Likelihood estimation is a statistics based method. First a measurement

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

probability density function for the errors is of a normal distribution.

(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

following equation, m is the number of measurements, and subscript i is the ith

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)

By doing this, the maximum likelihood method can be solved by either

minimizing the sum of the squares of the standardized normal variable as shown below or

by maximizing the logarithm, L, of the likelihood function.

By taking the minimization part of the above equation, and assuming that

is the residual of the measurements of the vector z, a simple modification is done to

simplify the process. In addition, the squares of the standard deviations are expressed in

matrix form and the whole equation is written as shown below:


20

(2.5)

where:

ri : the residual of the ith measurement.

Wii : the weight of the residuals.

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

the next section of this chapter.

2.3 Weighted Least Squares Method (WLS)

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

2.3.1 Weighted Least Squares Algorithm

Assuming that the measurements received from the SCADA system are of size m

and represented as a vector z as follow:

(2.6)

Next, a state vector denoted by x is considered. Since the power system is a

complex network, state estimation follows a non-linear function h(x) as shown in

equation 2.7 below:

(2.7)

where:

n : total number of the system state variables

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

errors, with zero mean and independent covariance.

(2.8)
22

Thus, the true measurements, z, is equal to the calculated measurements of the

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.

Equation 2.9 below shows the state equation after derivation.

(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

summation of the squares of the measurement errors, in addition to a weighted matrix

known as the covariance matrix as described below:

(2.10)

where:

J(x) : Jacobian matrix, also known as the measurement residual function.

zi : ith measurement.

m : total number of measurements.

: ith measurement variance.

R : is called the covariance matrix of measurement errors [1]. It is a diagonal

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

covariance matrix is represented below:

(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

estimation books. Furthermore, the measurement function, h(x), undergoes partial

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

[4]. The objective function in terms of g(x) and H(x) is as follow:

(2.12)

where:

T : the transpose of the matrix.

Calculating the measurement Jacobian matrix, H, is one of the most important

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

complicated than linear systems. Below, the construction of matrix H is explained in

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

magnitude and phase angle as discussed earlier in this report.

(2.13)

where:

: Real power injection measurements at bus i with respect to the phase angles.

: Real power injection measurements at bus i with respect to the voltage

magnitudes.

: Reactive power injection measurements at bus i with respect to the phase angles.

: Reactive power injection measurements at bus i with respect to the voltage

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.

: Voltage magnitude measurements with respect to their corresponding voltage

magnitude at bus i or bus j. Such that:

= 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

or Newton-Raphson method. The following formula shows the iterative technique to

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)

Equation 2.12 can be rewritten as shown in equation 2.15 below as:

(2.15)

where:

G(xk) : = known as the gain matrix.

g(xk) : = the non-linear function.

k : iteration key.

(xk) : solution vector for the kth iteration.

[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

modified equation now becomes equation 2.16 below:

(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

illustrates the WLS procedure or algorithm.


28

Figure 2.1: Weighted Least Square Algorithm [1]


29

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

parameters, n, being calculated. The previous case, where m > n, is considered as an

overdetermined state estimation problem.

Completely determined Case:

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

state estimation problem is as follow:

(2.17)

Underdetermined Case:

Finally, for an underdetermined state estimation problem, the total number of

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

G(xk) = , is singular and therefore, has no inverse. As seen from

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

can be calculated. The network at this point is considered as an unobservable network,

meaning that the state variables cannot be observed or estimated using the given

measurements.

Figure 2.2: Underdetermined Case Measurement Network


In order to solve this problem, the missing measurements such as the real or

reactive powers need to be calculated by means other than direct measurement. The

measurements calculated using an indirect approach are called pseudo measurements.

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)

2.3.2 State Estimation Example using WLS

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

probability of getting an accurate measurement to 99.9%. Therefore, knowing the value

of is so essential for the numerical calculations.


32

Figure 2.3: Meter errors following Normal Distribution


It is concluded from the problem, that the number of measurements provided is

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.14 for calculating 2 and 3.

In this case, we have:

(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

matrix can be calculated as follows:

The measurement matrix is calculated as follow:


34

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

0.01, result in the follow P12, P13, and P32.

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

Jacobian matrix, given in equation 2.10.

Considering the arbitrary numbers given in this example, by substituting them

into equation 2.10, the residual is calculated as follow:


35

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

accurate measurements. In this example we took the accuracy measure to be 3MW,

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:

The estimated state variables become:


36

The corresponding power flows are:

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

38.4MW to 38.8MW for P32.

In conclusion, based on statistical data and historical information about the

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.

2.4 Minimum Variance

As previously mentioned, the minimum variance is very similar to the WLS

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

errors of those individual points from that of the clustered ones.

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.

2.5 Bad Data Detection and Identification

Technological instruments or meters are constantly subject to errors due to

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

this section, these two techniques are briefly discussed.

2.5.1 Detecting Bad Data

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

contain corrupted measurements. However, if the residual converges to a larger number,

then there is a possibility for the presence of bad data.

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

to have a probability distribution function of Chi-Square distribution, 2(K). K is known

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

so that all measurements would be considered acceptable; however, the set of

measurements might have a high possibility of containing bad parameters.

Since a hypothesis test is to be performed on the residual value, there is no need

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

example is given below.


40

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

been taken from a sample following a normal distribution.

Variable x1 x2 x3 x4 x5 x6

Measured Value 1.7 0.8 -2.3 0.3 -1.5 2.7

Table 1: Measurement data of a quantity at an arbitrary bus


In order to solve for this problem, a 95% confidence is considered for the bad data

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:

K=Nm - (2n - 1) = 6 (2 x 1 -1) = 6 1 = 5

where, n is 1, since a single bus data was considered, and Nm is 6.

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

that it contains bad data.

Figure 2.4: Chi-Square Distribution Threshold Probability Testing [4]


42

2.5.1.2 Bad Data Detection in the Weighted Least Square Approach

As discussed previously in section 2.3, the measurement residual function, J(x),

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

used as a reaffirmation for calculating J(x):

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

recorded for that probability as a threshold, LJ.

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.

2.5.2 Identification and Removal of Bad Data

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

Single versus multiple bad data detection:

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

the corrupted from the clean measurements.

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

difference by their corresponding element in the residual covariance matrix. The

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

equation 2.9, can be rewritten as:

(2.21)

2. The second step is to normalize the residuals. In order to do that, the residual is

divided by its corresponding element in the residual covariance matrix as

described earlier. However, one small adjustment is done to the covariance

element to emphasis on its sensitivity. Therefore, instead of dividing over the

square root of the covariance, the new modification is as follow with the addition

of the sensitivity element:

(2.22)

3. The normalized residual is then compared to a specific threshold, t. This threshold

is usually set to 3.0 [4]. The residual is identified as a bad data and is removed

from the set of measurements if:


45

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

repeated to remove any further corrupted data measurements.


46

Chapter 3

STATE ESTIMATION TECHNIQUES FOR NON-LINEAR SYSTEMS

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

variable. However, WLS cannot be used for dynamic state estimation.

Dynamic State estimation is a technique used to predict the future state variables

before gathering measurements. In other words, dynamic state estimators provide a

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

the new advancement in computer science and communication technologies, dynamic


47

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

thus the power system model.

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.

3.2 Classical Kalman Filter

Classic Kalman Filter is an algorithm used for multiple applications such as

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,

based on imperfect measurements or inputs. These imperfect values are known to be

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 the original system state variables.


48

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

figure shows the fundamental stages of prediction and update.

Figure 3.1: Kalman Filter Algorithm


where:

Pk : The error covariance matrix at time k.

Xk : The state estimate at time k.

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

covariance are updated promptly.


49

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).

xk-1 : previous state variable.

xk : actual state variable.

uk : control vector.

Bk : the control-input model applied to the control vector for every timeframe.

ck : system error or noise, following zero mean (normal distribution) and Qk

covariance shown below.

ek : measurement error or noise, following zero mean (normal distribution) and Rk

covariance shown below.


50

Hk : relies on the measurement data to map the observed state of the system based on

the true one, which is similar to H matrix in WLS method.

zk : the measurements matrix at time k.

Therefore, based on the above list of matrices, two formulas are created for the state

prediction and for the state update as shown below.

State prediction equation:

(3.1)

This equation has been further modified and split into the predicted state estimation

equation and the predicted estimate covariance, respectively.

(3.2)

(3.3)

State update equation:

(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

actual measurement and the calculated or predicted measurement provided by 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

part of the equation is considered as a correction term.

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

3.3 Non-Linear Kalman Filter Methods

As mentioned in the introduction section of this chapter, some improvements and

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

unscented Kalman Filter method.

3.3.1 The Extended Kalman Filter Method

The Extended Kalman Filter technique was reformed based on linearization

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

current timestamp estimate.

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

state from the previous estimate.


53

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,

following a Gaussian distribution, with zero mean and discrete covariance

matrices of Rk and Qk-1, respectively.

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.

State transition matrix is given in equation 3.12 below:

(3.12)

State observation matrix is given in equation 3.13 below:

(3.13)

Of course the measurement residual has to be adjusted accordingly, and therefore,

equation 3.11 is rewritten as:

(3.14)
54

The Extended Kalman Filter technique is a practical method to calculate an

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

nonlinear systems. However, more than 35 years of experience in the estimation

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

difficulties arise from the use of linearization [13].

3.3.2 The Unscented Kalman Filter Method

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

components. It would be pricy, in the technological aspect, to improve that method by

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

network as in the Extended Kalman Filter.


55

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

Kalman Filter, which is known as the Unscented Transform (UT). UT is a mathematical

or statistical algorithm that is used in non-linear functions to transform them into a

probability distribution corresponding to a finite set. Those transformed points in 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

applying the known nonlinear function h(x) to each of those vectors.

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

accuracy of the mean transformation.


56

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

The size of state vector is formed with a covariance matrix,

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:

: ith column of the square root matrix , which should

be formed using a solid mathematical technique such as the

Cholesky factorization method.

: a mean and covariance control parameter or also known as weight,

and is given by the equation below:


57

= 2( + n) n (3.18)

and : regulatory values to control the scattering of the sigma points.

Typical values for those parameters are as follows [14]:

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

matrix, its dimension is . Then it will be evaluated by the prediction

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

that is created in 3.20 [13].

(3.20)

(3.21)

(3.22)
58

where W is a weight to emphasize on certain parameters and values in system [14]:

(3.23)

(3.24)

(3.25)

Superscripts c and m stand for covariance and mean, respectively. Both weights

take the same numerical values but it is necessary to differentiate between

them.

Update Step

The updated phase can be considered as a form of correction to the previous

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)

The propagated sigma points are calculated as follow:

(3.27)
59

The updated sigma points are then weighted and combined together to form the

predicted measurement or mean of propagated sigma points ( , the predicted

measurement covariance , also referred to earlier as the residual covariance.

Equations 3.28 and 3.29 are used based on the same concept used earlier in the classical

method of the Kalman Filter.

(3.28)

(3.29)

At this point, in order to calculate the Kalmans Gain (Kk), the predicted

measurement covariance should be used. An additional matrix is needed for this

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)

Thus the Kalmans Gain (Kk) is calculated by multiplying the cross-covariance

matrix with the inverse of the predicted measurement covariance matrix according to

equation 3.24, as shown below:

(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)

UKF is used in some power system state estimation applications nowadays. It is

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

TESTING AND SIMULATION RESULTS

This chapter presents a comparative study of a generalized linear approach, and a

non-linear approach such as the Extended Kalman Filter (EKF), method for solving an

estimate of a non-linear system. The non-linear system in this chapter is a two-phased

permanent magnet synchronous motor (PMSM). Using the two previously mentioned

approaches, the currents through the two windings of the PMSM, in addition to the

angular position and velocity of its rotor will be estimated.

A review of the EKF structure will be illustrated. Moreover, the PMSM system

will be fully described, including a complete explanation of the models, algorithms,

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

simulation studies will be carried out using MATLAB.

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

when compared to other motors such as the inverter-based ones.

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.

As discussed in chapter 3, the Kalman Filter is one of the methods used to

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-

order terms during the estimation process.

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

4.2 Permanent Magnet Synchronous Motor (PMSM) representation and

equations

4.2.1 General sensorless PMSM illustration and control schemes

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

proper control methods and algorithms for that purpose.

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.

Figure 4.1: Sensorless PMSM control Scheme


Figure 4.1 shown above explains the topology behind the control strategy of the

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)

controller. A PI controller is a generic control loop feedback mechanism, very commonly

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

the exciting current with the q-axis, .

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

PWM inverter. In order to do that, an additional input needs to be added or imported to

the PWM block, which is the angular position, . This angular position is also obtained

from the state estimation block.

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

back into the system. These parameters are:

1. The rotors mechanical speed estimate, .

2. The stators current estimate in the q-axis, isq or ia.

3. The stators current estimate in the d-axis, isd or ib.

4. The angular position estimate, .

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.

4.2.2 PMSM Equations and problem statement

The general non-linear state equations for the permanent magnet synchronous

motors are expressed in the following form [20]:

(4.1)

(4.2)

where:
67

State matrices:

K : Back EMF Constant

However, the first state equation can be re-expressed as:

(4.3)
68

The state variables vector for this type of non-linear PMSM system is:

(4.4)

where:

ia and ib : currents through the two windings in amps

Rr : windings resistance in ohms

L : windings inductance in Henries

: angular position of the rotor in rad

: rotors speed in rad/s

: flux constant of the motor in Webber

ua and ub : voltages applied across the two windings

J : moment of inertia of the motor shaft and load in kg.m2

F : viscous friction of the rotor in Pascal.sec or Nm.s

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

shows the values of the abovementioned parameters.

Parameter Value

Rr 1.9

L 3 mH

0.1 Wb

J 0.18x10-3 kg.m2

F 0.001 Pa.s

Table 2: PMSMs parameters


The nominal input voltages with respect to time are defined as:

ua(t) = sin(2t) (4.5)

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(1) = ia + j(1) (4.6)

y(2) = ib + j(2)

4.3 Linear Approach

The system explained in section 4.2.2 is obviously a non-linear system, and

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,

and the linear system would be represented as [21]:

(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

terms of x, matrix A, is produced, in addition to another one in terms of u, matrix G. Note

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

to solve the dynamic equations.

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

parameters, in addition to the PMSM differential equations mentioned earlier, and


72

resulted in two outputs, time as a vector (t), and state variables as a matrix (X). Each row

in the vector t corresponds to that row in X at that specific timestamp.

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 .

4.4 Extended Kalman Filter Approach

EKF is an optimal state estimator used for dynamic non-linear systems as

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

other useful equations and statements.

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

time interval or instant that the state estimator goes through.

The non-linear state equations for the PMSM are represented in the following

discrete form as mentioned in equations 3.1 and 3.4:


73

(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

followed upon solving for the PMSM state estimation.

1. System equations are written in the form of:

(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

are as follow and as mentioned in equations 3.12 and 3.13:

(4.12)
74

3. Afterwards, calculate matrices and or given in the equations below:

(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)

In this section, the abovementioned algorithm will be applied to the PMSM

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

inductance, motor constant or flux constant , moment of inertia, coefficient of viscous

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

data to be ready for plotting at the end of the simulation.

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

change in x or x. For clarification note the equation below.

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

correction step and are stated below for further clarification:

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.

4.5 Analysis and Comparison

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

respect to time in seconds.

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)

Figure 4.2: Linear Approach PMSM State Variable Estimation


79

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

Theta Position (Rad)


True
w speed (Rad/Sec)

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)

Figure 4.3: EKF Approach PMSM State Variable Estimation


It is obvious from the two figures shown above that in the EKF method, the dotted

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

EKF methods, respectively.


80

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)

Figure 4.4: Linear method Error

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)

Figure 4.5: EKF Approach Error


81

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

CONCLUSION AND FUTURE WORK

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

and measurement errors from the equipment, or even human errors.

Several methods were discussed and explained throughout this report. Some of

these methods involve minimization or maximization of certain statistical criteria in order

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.

State estimators can be either static or dynamic; however, when focusing on

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

non-linear approaches such as Kalman Filters were introduced.

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

enough data to process and find an accurate and reliable estimate.

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

are detected using different schemes such as Chi-Square distribution as explained in

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

main objective of power system engineers is to obtain a model to be as close as possible

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,

financially as well as performance wise.

State estimation is the key function in determining real-time models for

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

more suitable for non-linear systems.

To conclude, EKF shows a better performance than the generalized linear

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

causes a loss of accuracy in large systems. Furthermore, the technological requirement is

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

algorithm can be tested for its robustness and effectiveness.


87

Appendices

Appendix A: Linear PMSM Approach MATLAB code

clear all
clc

% Using ODE45 to solve the problem:


options=odeset('RelTol',6e-1);
Xo = [0;0;0;0]; % Initial conditions
tspan = 0:0.0005:1.5; % Timespan
[t,X] = ode15s(@PMSM,tspan,Xo,options);

% Simulating the non-linear problem:


x1 = [0; 0; 0; 0]; % Initial state
w = 2 * pi; % Control input frequency
Rr = 1.9; % Winding resistance
L = 0.003; % Winding inductance
LAm = 0.1; % Motor constant
J = 0.00018; % Moment of inertia
Vf = 0.001; % Coefficient of viscous friction

%Setting Arrays for plotting:


tArray = []; %Time Array
x1Array = []; %Predicted State
tArr=[]; %Time Array
XArr=[]; %Actual State
ControlNoise = 0.01; % stddev of uncertainty in control inputs
xdotNoise = [ControlNoise/L ControlNoise/L 0.5^2 0];
%xdotNoise=(ControlNoise^2)*[1 1 1 1]; %Noise

%Plotting Parameters:
dt = 0.0005; % Integration step size
tf = 1.5; % Simulation length
dtPlot = 0.01; % How often to plot results
tPlot = -inf;

X=X'; %Transpose of vector for operation purposes


col=0; %Initiating Column.
for t = 0 : dt : tf
if t >= tPlot + dtPlot
col=col+1;
% Save data for plotting
88

tPlot = t + dtPlot - eps;


tArr = [tArr t];
XArr = [XArrX(:,(t/0.0005)+1)];
XArr(4,col) = mod(XArr(4,col), 2*pi);%Keeping angle within range.
end
end

dtPlot = 0.01; % How often to plot results


tPlot = -inf;
% Begin simulation loop
for T = 0 : dt : tf
if T >= tPlot + dtPlot
% Save data for plotting
tPlot = T + dtPlot - eps;
x1Array = [x1Array x1];
tArray = [tArray T];
end
% Nonlinear simulation
ua0 = sin(w*T);
ub0 = cos(w*T);
xdot = [-Rr/L*x1(1) + x1(3)*LAm/L*sin(x1(4)) + ua0/L;
-Rr/L*x1(2) - x1(3)*LAm/L*cos(x1(4)) + ub0/L;
-3/2*LAm/J*x1(1)*sin(x1(4)) + 3/2*LAm/J*x1(2)*cos(x1(4)) - Vf/J*x1(3);
x1(3)];
xdot = xdot + [xdotNoise(1)*randn; xdotNoise(2)*randn; xdotNoise(3)*randn;
xdotNoise(4)*randn]*sqrt(dt);
x1 = x1 + xdot * dt;
x1(4) = mod(x1(4), 2*pi);%Keeping angle within range.
end

diff=[]; %Error Array


diff=XArr-x1Array;

% Plot data.
close all;
figure;

subplot(2,2,1); hold on;


plot(tArray, x1Array(1,:),'b-');
plot(tArray, XArr(1,:),'r:');
ylabel('ia (A)');

subplot(2,2,2); hold on;


plot(tArray, x1Array(2,:),'b-');
89

plot(tArray, XArr(2,:),'r:');
ylabel('ib (A)');

subplot(2,2,3); hold on;


plot(tArray, x1Array(3,:), 'b-');
plot(tArray, XArr(3,:), 'r:');
xlabel('Time (s)'); ylabel('Speed (Rad/Sec)');

subplot(2,2,4); hold on;


plot(tArray, x1Array(4,:), 'b-');
plot(tArray,XArr(4,:), 'r:');
xlabel('Time (s)'); ylabel('Position (Rad)');
legend('True','LinearEst');

figure(2);
for k=1:4
subplot(2,2,k)
plot(tArray, diff(k,:))
xlabel('Time (s)'); ylabel('Error');
end

function [dx]= PMSM(t,x)


Rr = 1.9; % Winding resistance
L = 0.003; % Winding inductance
lambda = 0.1; % Motor constant
J = 0.00018; % Moment of inertia
Vf = 0.001; % Coefficient of viscous friction
w=2*pi; %System Frequency

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

Appendix B: Extended Kalman Filter PMSM MATLAB code

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

% Setting up the noises:


q1_q2 = 0.01; % Control Inputs Uncertainty Standard Deviation (Amps)
q3=0.5; % Load Torque Disturbance Noise (rad/sec^2)
e = 0.1; % Measurement Noise Standard Deviation
% Measurement Noise Covariance
R = [e^2, 0;
0, e^2];
% Process noise covariance
Q = [(q1_q2/L)^2, 0, 0, 0;
0, (q1_q2/L)^2, 0, 0;
0, 0, (q3)^2, 0;
0, 0, 0, 0];
% Q=(q1_q2^2)*eye(4);

% 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

% Defining Arrays for plotting


x_Array = [];
x_Hat_Array = [];
time_Array = [];
diff = [];
91

% 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);

% Calculating the state equation "x dot" with respect to x.


x_DOT = [-(Rr*x(1))/L + x(3)*Lam*sin(x(4))/L + ua0/L;
-Rr*x(2)/L - x(3)*Lam*cos(x(4))/L + ub0/L;
-3*Lam*x(1)*sin(x(4))/(2*J) + 3*Lam*x(2)*cos(x(4))/(2*J) - Vf*x(3)/J;
x(3)];
% Adding Noise to "x dot".
x_DOT = x_DOT + [Q(1,1)*randn;Q(2,2)*randn;Q(3,3)*randn;Q(4,4)*randn] * sqrt(dt);
% Updating x by adding the "x dot".
x = x + x_DOT * dt;
x(4) = mod(x(4), 2*pi); % Modifying "theta" to stay within range.

% Calculating the partial derivative with respect to "x hat"


F = [-Rr/L, 0, Lam*sin(x_Hat(4))/L, x_Hat(3)*Lam*cos(x_Hat(4))/L;
0, -Rr/L, -Lam*cos(x_Hat(4))/L, x_Hat(3)*Lam*sin(x_Hat(4))/L;
-3*Lam*sin(x_Hat(4))/(2*J), 3*Lam*cos(x_Hat(4))/(2*J), -Vf/J, ...
-3*Lam*(x_Hat(1)*cos(x_Hat(4))+x_Hat(2)*sin(x_Hat(4)))/(2*J);
0, 0, 1, 0];
H = [1, 0, 0, 0;
0, 1, 0, 0];
% Actual measurement
z = H*x + [e*randn; e*randn]/sqrt(dt);
% Calculating the state equation "x dot" with respect to "x hat".
xhatdot = [-Rr*x_Hat(1)/L + x_Hat(3)*Lam*sin(x_Hat(4))/L + ua0/L;
-Rr*x_Hat(2)/L - x_Hat(3)*Lam*cos(x_Hat(4))/L + ub0/L;
-3*Lam*x_Hat(1)*sin(x_Hat(4))/(2*J) + 3*Lam*x_Hat(2)*cos(x_Hat(4))/(2*J) -
Vf*x_Hat(3)/J;
x_Hat(3)];
92

% Applying Step 4 equations from the EKF algorithm:


K = P*H'/R;
xhatdot = xhatdot + K*(z-H*x_Hat);
x_Hat = x_Hat + xhatdot * dt;
x_Hat(4) = mod(x_Hat(4), 2*pi);
Pdot = F*P + P*F' + Q - P*H'/R*H*P;
% Updated Pk
P = P + Pdot*dt;
end

% Plotting
close all; figure(1);

subplot(2,2,1); hold on; box on;


plot(time_Array, x_Array(1,:), 'b-');
plot(time_Array, x_Hat_Array(1,:), 'r:')
xlabel('Time (Seconds)'); ylabel('ia (A)');

subplot(2,2,2); hold on; box on;


plot(time_Array, x_Array(2,:), 'b-');
plot(time_Array, x_Hat_Array(2,:), 'r:')
xlabel('Time (Seconds)'); ylabel('ib (A)');

subplot(2,2,3); hold on; box on;


plot(time_Array, x_Array(3,:), 'b-');
plot(time_Array, x_Hat_Array(3,:), 'r:')
xlabel('Time (Seconds)'); ylabel('w speed (Rad/Sec)');

subplot(2,2,4); hold on; box on;


plot(time_Array, x_Array(4,:), 'b-');
plot(time_Array,x_Hat_Array(4,:), 'r:')
xlabel('Time (Seconds)'); ylabel('Theta Position (Rad)');
legend('True','EKF');

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.

John Wiley & Sons Inc. Year 1996.

[2] Substance Abuse and Mental Health Services Administration, Center for Behavioral

Health Statistics and Quality. (January 8, 2013). The NSDUH Report: State Estimates of

Nonmedical Use of Prescription Pain Relievers. Rockville, MD.

[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:

Marcel Dekker, 2004.

[5] Hamoud G, and Bradley I. Assessment of Transmission Congestion Cost and

Locational Marginal Pricing in a Competitive Electricity Market. IEEE Transactions on

Power Systems, Vol. 19, No. 2, May 2004.

[6] Ward J.H. Jr (1963). Hierarchical Grouping to Optimize an Objective Function.

Journal of the American Statistical Association, 58, 236-244.

[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

University Electrical Engineering Thesis, May 2008.


94

[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.

17th Power Systems Computation Conference, August 22-26, 2011.

[10] Hongxian Wu, and Giri, J. PMU Impact on State Estimation Reliability for

Improved Grid Security. Transmission and Distribution Conference and Exhibition,

2005/2006 IEEE PES 21-24 May, 2006. Pages: 1349-1351.

[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.

[14] D. Simon. Optimate State Estimation: Kalman, H infinity, and Nonlinear

Approaches. New Jersey: John Wiley & Sons, Inc. 2006.

[15] Monticelli, A. and Garcia, A. Reliable Bad Data Procession for Real-time State

Estimation. IEEE Transactions on Power Apparatus and Systems, Volume. PAS-102,

No. 5, May 1983. Pages: 1126-1138.

[16] Grainger, John J, and William D. Stevenson, Jr. Power System Analysis. New

York: McGraw-Hill, Inc., 1994.


95

[17] Ming Zhou, V.A. Centeno, J.S. Thorp, and A.G. Phadke. An alternative for

Including Phasor Measurements in State Estimator. IEEE Transactions on Power

Systems. Volume: 21. No. 4. November 2006. Pages: 1930-1937.

[18] Linwood Matthews Ross. Synchrophasors Application in State Estimation. EEE

Thesis, Clemson University, December 2008.

[19] Janiszewski, D. Extended Kalman Filter Based Speed Sensorless PMSM Control

with Load Reconstruction. IEEE Industrial Electronics, IECON 2006 32nd Annual

Conference on 6-10 Nov 2006. Pages: 1465-1468.

[20] Borsje, P, Chan T.F, Wong Y.K, Ho S.L. A Comparative Study of Kalman Filtering

for Sensorless Control of a Permanent-Magnet Synchronous Motor Drive. Electric

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.

[22] James A. Mamoh. Electric Power System Applications of Optimization. CRC

Press Publisher, 2nd Edition. Year 2008.


96

Potrebbero piacerti anche