Está en la página 1de 138

Qatar University

College of Engineering
Electrical Engineering Department

A Graduation Project Report

Design of Power System Stabilizer Based on Microcontroller for Power
System Stability Enhancement

By

SAMER SAID SAID
OSAMA BASHIR KAHLOUT


Supervisors
DR. KHALED ELLITHY & DR. TAREK EL-FOULY

June 2011
Dept. of EE, Qatar Univ.
P a g e | I

ACKNOWLEDGMENT

We would like to take the opportunity to thank our supervisor Dr. Khaled Ellithy for his
continuous supervision and commitment. Thank also goes to Dr. Tareq EL-Fouly for his support
and supervision all through the project.
We would like also to thank Dr. Nader Meskin & Eng. Mohammed Ayyad for their support
and help throughout the project.
We would like to extend our thanks to the Office of Academic Research, for funding our
project through the Student Grants (QUST-CENG-DEE-10/11-38).
Samer Said Said
Osama Bashir EL-Kahlout






Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | II

ABSTRACT

The problem of the poorly damped low-frequency (electro-mechanical) oscillations of
power systems has been a matter of concern to power engineers for a long time, because they
limit power transfers in transmission lines and induce stress in the mechanical shaft of machines.
Due to small disturbances, power systems experience these poorly damped low-frequency
oscillations. The dynamic stability of power systems are also affected by these low frequency
oscillations. With proper design of Power System Stabilizer (PSS), these oscillations can be well
damped and hence the system stability is enhanced. The basic functions of the PSS is to add a
stabilizing signal that compensates the oscillations of the voltage error of the excitation system
during the dynamic/transient state, and to provide a damping component when its on phase with
rotor speed deviation of machine.
This project presents a design of PSS based on microcontroller to enhance the dynamic
stability of power systems by improving the damping of the low frequency oscillations.
Damping torque and eigenvalues analysis are applied to the PSS design. The results of these
techniques have been verified by time-domain dynamic simulations. The designed PSS is applied
to a power system. The dynamic simulations results are presented for various system disturbances
under different system operating points to show the effectiveness and robustness of the designed
PSS. a Peripheral Interface Controller (PIC) microcontroller is used to design a PSS to enhance
the damping characteristic of power system to improve its stability. The s-domain PSS has been
transformed to digital (z-domain) PSS and then it is implemented on microcontroller chip.





Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | III

TABLE OF CONTENTS
Acknowledgment ............................................................................................................................ I
Abstract .......................................................................................................................................... II
Table of Contents .......................................................................................................................... III
List of Symbols ............................................................................................................................ VII
List of Abbreviations ..................................................................................................................... X
List of Figures .............................................................................................................................. XI
List of Tables ............................................................................................................................. XIV
Chapter 1: Introduction ................................................................................................................. 1
1.1 Introduction .................................................................................................................... 1
1.2 Background..................................................................................................................... 4
1.2.1 Power System and Problem Statement ......................................................... 4
1.2.2 Classification of Power System Stability ..................................................... 5
1.2.3 Damping of Power System Oscillations ....................................................... 6
1.3 Design Constraints.......................................................................................................... 6
1.3.1 Power System Constraints ............................................................................ 6
1.3.2 Stability Constraints ..................................................................................... 6
1.3.3 PSS Tuning Parameters Constraints ............................................................. 7
1.4 Digital Control & Microcontrollers MATLAB Interfacing ........................................... 7
1.5 IEEE Standards on Machine Models and Excitation Systems ....................................... 8
1.6 Objectives ....................................................................................................................... 8
Chapter 2: Modeling of Power Systems Using Component Connection Technique for
Dynamic Stability Study .............................................................................................................. 10
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | IV

2.1 Overview ...................................................................................................................... 10
2.2 Modeling of SMIB Power System Using CCT ............................................................ 13
2.2.1 Synchronous Generator Modeling .............................................................. 14
2.2.2 Exciter Modeling ........................................................................................ 18
2.2.3 AC Network ................................................................................................ 19
2.3 Overall System Model .................................................................................................. 21
2.4 Block Diagram Representation ..................................................................................... 24
2.4.1 Rotor Mechanical Equations ...................................................................... 24
2.4.2 Representation of Flux Decay .................................................................... 25
2.4.3 Representation of Excitation System .......................................................... 26
2.5 MATLAB/Simulink Model of the Power System ........................................................ 28
2.6 Variation of Constants [K
1
-K
6
] According to System Operating Points
................................
30
Chapter 3: Dynamic Stability Evaluation .................................................................................. 34
3.1 Techniques of Stability Evaluation .............................................................................. 34
3.1.1 Stability Evaluation Using Eigenvalues Technique
....................................................
34
3.1.2 Stability Evaluation Using Damping Torque Technique
........................................
36
3.1.3 Stability Evaluation Using Time-Domain Simulation Technique
....................
40
3.2 Dynamic Stability Evaluation of SMIB ....................................................................... 41
3.2.1 Dynamic Stability Evaluation of SMIB Using Eigenvalues Technique .... 42
3.2.2 Dynamic Stability Evaluation of SMIB Using Torques Technique ........... 43
3.2.3 Dynamic Stability Evaluation of SMIB Using Time-Domain Simulation
Technique ................................................................................................... 46
3.3 Effect of Different Operating Points on System Dynamic Stability ............................ 49
3.4 Effect of Excitation System Parameters on System Stability ....................................... 54
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | V

Chapter 4: Power System Stabilizer Design ............................................................................... 56
4.1 Introduction .................................................................................................................. 56
4.2 SMIB Power System Model Including PSS.....56
4.2.1 Modeling of PSS.56
4.2.2 SMIB Power System Bock Diagram Model Including PSS...57
4.2.3 State-Space Model of SMIB Power System Including PSS...60
4.2.4 MATLAB/Simulink Model of SMIB Power System Including PSS ......... 62
4.3 Dynamic Stability Enhancement using PSS.64
4.3.1 Eigenvalues Technique...64
4.3.2 Damping Torque Technique...64
4.3.3 Time-Domain Simulation Technique.....66
4.4 Tuning of PSS Parameters....66
4.5 Dynamic Stability Enhancement of SMIB Power System...67
4.5.1 Eigenvalues of SMIB Power System with PSS..67
4.5.2 Damping Torque of SMIB Power System with PSS..68
4.5.3 Time-Domain Simulation of SMIB Power System with PSS....72
4.6 Assessment of the Robustness of the Designed PSS74
Chapter 5: Design of Microcontroller Based Digital PSS ......................................................... 80
5.1 Digital Control .............................................................................................................. 80
5.2 What is a Microcontroller? ........................................................................................... 81
5.3 Architecture & Specifications of PIC18 Family........................................................... 82
5.4 Specifications of Microcontroller PIC18F4520 ........................................................... 83
5.5 Microcontrollers Basic Circuit .................................................................................... 84
5.6 Serial Communication USART .................................................................................... 86
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | VI

5.7 Design Constraints ........................................................................................................ 89
5.7.1 Microcontroller Constraints....89
5.7.2 Serial USART Constraints..89
5.8 Digital Domain of the Power System Stabilizer ........................................................... 90
5.9 s-domain to z-domain (Digital Domain) Transformation Steps in MATLAB ............. 99
5.10 Simulation of Digital PSS using Simulink ........................................................... 103
5.11 MATLAB and Microcontroller Interfacing .......................................................... 106
5.11.1 Microcontroller Programming..107
5.11.2 Simulink Model of the SMIB Power System with MCU PSS.111
5.12 Simulations of the SMIB Power System with MCU PSS .................................... 114
Chapter 6: Conclusion & Future Work ................................................................................... 118
6.1 Conclusion .................................................................................................................. 118
6.2 Future Work ................................................................................................................ 118
References .................................................................................................................................... 119
Appendix A ................................................................................................................................. A-1
Appendix B .................................................................................................................................. B-1






Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | VII

LIST OF SYMBOLS
Rotor Angle of Synchronous Generator in rad
f Frequency Oscillations in Hz
System Eigenvalue
o Real Part of Eigenvalue
, Damping Ratio

b
Rotor Speed Deviation in rad/sec (base speed)
e
d
Damping Frequency
e
n
Natural (Undamped) Frequency
e
|m
Zero dB Frequency in rad/s
D Damping Coefficient
E
fd
Excitation System Voltage in p.u.
E'
q
Voltage Proportional to Field Flux Linkages
F
osc
Frequency of Oscillations
G
O.L
(s) Transfer Function of Cascaded Connection between PSS and SMIB Power System
G
PSS
(s) Transfer Function of the Power System Stabilizer
G
SMIB
(s) Transfer Function of SMIB Power System
H Inertia Constant
H
1
(z) Phase Compensator Transfer Function in z-domain
H
2
(z) Washout Transfer Function in z-domain
I
d
, I
q
d and q Axes Generator Currents
I
e
d
, I
e
q
d and q axes Stator Currents in Synchronous Reference Frame (SRF)
I
e
d-bus
, I
e
q-bus
d and q axes Bus Currents in Synchronous Reference Frame (SRF)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | VIII

I
r
d
, I
r
q
d and q Axes Stator Currents in Rotor Reference Frame (RRF)
K
A
Exciter Gain
K
D
Damping Torque Coefficient
K
PSS
Power System Stabilizer Gain
K
S
Synchronizing Torque Coefficient
K
S (AVR)
Synchronizing Torque Coefficient of AVR
n Register SPBRG Value
P

Real Power Output
Q

Reactive Power Output
R
a
Armature Resistance
R
e
Transmission Line Resistance
S
b
Rated Complex Power
T Sampling Period
T
A
Exciter Time Constant
T
e
Electrical Power Output in p.u.
T
e (AVR)
Electrical Power Output of AVR in p.u.
T
m
Mechanical Power Input in p.u.
T
PSS
(z) Power System Stabilizer Transfer Function in z-domain
T
W
Washout Time Constant
T
1
Lead Time Constant
T
2
Lag Time Constant
T'
do
Open Circuit d-axis Time Constant in sec
V
b
Rated Voltage
V
d
,V
q
d and q Axes Generator Voltages
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | IX

V
e
d
, V
e
q
d and q Axes Stator Voltages in Synchronous Reference Frame (SRF)
V
r
d
, V
r
q
d and q Axes Stator Voltages in Rotor Reference Frame (RRF)
V
inf
Infinite Bus Voltage
V
ref
Exciter Reference Input
V
s
Power System Stabilizer Output Voltage
V
t
Terminal Voltage
V
w
Power System Stabilizer Washout Voltage
X
d
d-axis Synchronous Reactance in p.u.
X'
d
d-axis Transient Reactance in p.u.
X
q
q-axis Synchronous Reactance in p.u.
X'
q
q-axis Transient Reactance in p.u.
X
e
Transmission Line Reactance












Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | X

LIST OF ABBREVIATIONS
AVR Automatic Voltage Regulator
CCM Component Connection Model
CCT Component Connection Technique
RC6 Transmitting Pin
RC7 Receiving Pin
SMIB Single-Machine Infinite Bus













Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | XI

LIST OF FIGURES
Figure (2.1): Block Diagram of Component Connection Model (CCM) ....................................... 12
Figure (2.2): Single Line Diagram of SMIB System ..................................................................... 14
Figure (2.3): Block diagram of Synchronous Generator CCM ..................................................... 15
Figure (2.4): Excitation System ..................................................................................................... 18
Figure (2.5): Block Diagram of Overall System using CCM ........................................................ 21
Figure (2.6): The torque-angle Loop of Synchronous Machine .................................................... 25
Figure (2.7): Flux-Decay Model .................................................................................................... 26
Figure (2.8): Excitation System ..................................................................................................... 26
Figure (2.9): Overall Block Diagram of the Linearized Power System ........................................ 27
Figure (2.10): MATLAB/Simulink Model of the SMIB with Exciter Power System .................. 29
Figure (2.11): Variation of K
1
at Different Operating Points ........................................................ 30
Figure (2.12): Variation of K
2
at Different Operating Points ........................................................ 31
Figure (2.13): Variation of K
3
at Different Operating Points ........................................................ 31
Figure (2.14): Variation of K
4
at Different Operating Points ........................................................ 32
Figure (2.15): Variation of K
5
at Different Operating Points ........................................................ 32
Figure (2.16): Variation of K
6
at Different Operating Points ........................................................ 33
Figure (3.1): Torque-Angle Loop .................................................................................................. 39
Figure (3.2) Rotor Speed Deviation Response Under 1% Change in

at Nominal Operating
Point ................................................................................................................................................ 46
Figure (3.3) Rotor Speed Deviation and Terminal Voltage Deviation Response Under 1% Change
in

at Nominal Operating Point. .............................................................................................. 47


Figure (3.4) Rotor Speed Deviation Response Under 1% Change in

at Nominal Operating
Point ............................................................................................................................................... 48
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | XII

Figure (3.5) Rotor Speed Deviation Response Under 1% Change in

at Operating Point 1 ... 51


Figure (3.6) Rotor Speed Deviation Response Under 1% Change in

at Operating Point 2 ... 52


Figure (3.7) Rotor Speed Deviation Response Under 1% Change in

at Operating Point 3 ... 53


Figure (3.8) The Effect of Increasing K
A
to 400 in Operating Point 3 ........................................... 55
Figure (4.1) Block Diagram of SMIB Power System Including PSS ............................................ 58
Figure (4.2) Block Diagram of the Excitation System (AVR) Including PSS ............................... 59
Figure (4.3) MATLAB/Simulink Model of the SMIB with PSS Power System .......................... 63
Figure (4.4) Rotor Speed Deviation Response with & without PSS at nominal operating point
under change in

of 1% .......................................................................................................... 72
Figure (4.5) Rotor Speed Deviation Response with & without PSS at nominal operating point
under change in V_ref of 1% ....................................................................................................... 73
Figure (4.6) Rotor Angle Deviation Response with & without PSS at nominal operating point
under change in T_m of 1% ......................................................................................................... 73
Figure (4.7) Terminal Voltage Deviation Response with & without PSS at nominal operating
point under change in

of 1% .................................................................................................. 73
Figure (4.8) PSS Stabilizing Signal at nominal operating point under change in T_m of 1% .... 73
Figure (4.9) Rotor Speed Deviation Response with & without PSS at Operating Point 1 ............. 76
Figure (4.10) Rotor Speed Deviation Response with & without PSS at Unstable Operating Point
........................................................................................................................................................ 77
Figure (4.11) Rotor Speed Deviation Response with & without PSS at Operating Point 3 with
Exciter Gain Equal to 400 .............................................................................................................. 78
Figure (5.1) Typical Digital Control System .................................................................................. 80
Figure (5.2) Block Diagram of Microcontroller Based Digital Control System ............................ 81
Figure (5.3) Microcontroller Basic Circuit ..................................................................................... 84
Figure (5.4) Quartz Crystal Circuit Configuration ........................................................................ 86
Figure (5.5) Data Transformation in Asynchronous Mode ........................................................... 87
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | XIII

Figure (5.6) Serial UART (RS-232) Communication Circuit ........................................................ 89
Figure (5.7) SMIB Power System Simulink Model Input & Output Ports Highlighted ............... 95
Figure (5.8) Bode Plot of the Cascaded Open-Loop between PSS & SMIB Power System ......... 97
Figure (5.9) Effect of Sampling Frequency on the Frequency Response of the Digital PSS ......... 98
Figure (5.10) Comparison between the Frequency Response of the Designed Digital (z-domain)
PSS and the Response of the s-domain PSS ................................................................................ 103
Figure (5.11) MATLAB/Simulink Model of the SMIB Power System Including Simulated
Digital (z-domain) PSS Power System ......................................................................................... 104
Figure (5.12) Rotor Speed Deviation Response Comparison of Digital (Simulated) PSS & s-
domain PSS at Nominal Operating Point Under Change in

of 1% ...................................... 105
Figure (5.13) MATLAB (Laptop) & PIC18F4520 Microcontroller Interfacing Circuit .............. 106
Figure (5.14) Microcontroller C-Code Flowchart ........................................................................ 108
Figure (5.15) MATLAB/Simulink Model of the SMIB Power System Including Digital
(Microcontroller) PSS Power System ........................................................................................... 113
Figure (5.16) Photos from the Microcontroller Based Digital PSS Hardware ............................. 114
Figure (5.17) Rotor Speed Deviation Response Comparison of Digital (Microcontroller) PSS &
s-domain PSS at Nominal Operating Point Under Change in

of 1% ................................... 115
Figure (5.18) PSS Stabilizing Signal at nominal operating point under change in T
m
of 1% ... 116
Figure (5.19) Rotor Speed Deviation Response Comparison of Digital (Microcontroller) PSS &
s-domain PSS at Unstable Operating Point Under Change in

of 1% ................................... 117
Figure (5.20) Rotor Speed Deviation Response Comparison of Digital & s-domain PSS at
Unstable Operating Point of High Exciter Gain Under Change in

of 1% ............................ 117




Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | XIV

LIST OF TABLES
Table (3.1) The Eigenvalues and the Constants [K
1
-K
6
] of the Nominal Operating Point ........... 42
Table (3.2) Synchronizing and Damping Torques and Damping Ratios and Frequencies for
Nominal Operating Point ............................................................................................................... 45
Table (3.3) Different Operating Points for Power System Stability Evaluation ........................... 49
Table (3.4) Testing Operating Points Using Eigenvalues Technique ............................................ 49
Table (3.5) Synchronizing and Damping Torques and Damping Ratios and Frequencies for Three
Operating Points ............................................................................................................................. 50
Table (3.6) Results of Increasing the Gain K
A
of the Operating Point 3 ........................................ 54
Table (4.1) System Eigenvalues at Nominal Operating Point ........................................................ 67
Table (4.2) Torque Coefficients, Damping Ratio & Damping Frequency at Nominal Operating
Point Including PSS ....................................................................................................................... 71
Table (4.3) Different Operating Points for PSS Evaluation ........................................................... 74
Table (4.4) Testing Operating Points Using Eigenvalues Technique ............................................ 74
Table (4.5) Torque Coefficients, Damping Ratios & Damping Frequencies at Three Operating
Points ............................................................................................................................................. 75
Table (A-1) Comparison Between PIC Microcontrollers Families Features .............................. A-1



Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout

Dept. of EE, Qatar Univ.
P a g e | 1

CHAPTER 1: INTRODUCTION
1.1. Introduction
Power systems have developed from the original central generating station concept to a
modern interconnected system with improved technologies affecting each part of the system
separately. Successful operation of a power system depends largely on providing reliable and
uninterrupted service to the loads by the power utility. Ideally, constant voltage and frequency
should be supplied to the load at all times. In practical terms this means that both voltage and
frequency must be held within close tolerances so that the consumer loads run without
interruption. For example, the motor loads on the system may stop by a drop in voltage of l0-15%
or a drop of the system frequency of only a few hertz. Thus it can be accurately stated that the
power system operator must maintain a very high standard of continuous and reliable electrical
service. [1,5-7]
Small-signal stability, or the dynamic stability, can be defined as the behavior of the power
system when subjected to small disturbances. It is usually concerned as a problem of insufficient
or poorly damping of system oscillations. These oscillations are undesirable even at low-
frequencies, because they reduce the power transfer in the transmission line and sometimes
introduce stress in the system. Several types of these oscillations could be found in the system,
but the two most critical types that of concern are the local mode and the inter-area mode. The
local mode is associated with a single unit or station with respect to the whole system, whereas
the inter-area mode is associated with many units in an area with respect to other units in another
area. The aim of this project is to assess these low-frequency disturbances by having fast and
efficient computational tools in online stability assessment. [1-3]
An important requirement of reliable service is to keep the synchronous generators running
in parallel and with appropriate capacity to meet the load demand. If a generator loses
synchronism with the rest of the system, significant voltage and current fluctuations may occur
and transmission lines may be automatically tripped by their relays disconnecting important loads
from service.[7]
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 2

Subsequent adjustments of generation due to random changes in load are taking place at all
times which makes steady state operation of power system not actually true state. Furthermore,
major changes do take place at times, e.g., a fault on the network, failure in a piece of equipment,
sudden application of a major load, or loss of a line or generating unit. We may look at any of
these as a change from one equilibrium state to another. So successful operation requires only
that the new state be a stable state. For example, if a generator is lost, the remaining connected
generators must be capable of meeting the load demand; or if a line is lost, the power it was
carrying must be obtainable from another source, but this view is wrong in one important aspect:
it neglects the dynamics of the transition from one equilibrium state to another. Synchronism
frequently may be lost in that transition period, or growing oscillations may occur over a
transmission line, eventually leading to its tripping. [7-8]
Extensive emphasis on the economic design of generators, especially those of large ratings
was placed in the middle of the 20
th
century. This leads to the development of machines with very
large values for steady-state synchronous reactance, and that resulted in poor load-voltage
characteristics, especially when connected through long transmission lines. On load, significant
drop in the overall synchronizing torque caused by reduction of field flux which is due to the
armature reaction. Therefore, the transient stability related problems for synchronous operation
became the major concern. The problem was resolved by using high gain, fast acting excitation
control systems that provide sufficient synchronizing torque by virtually eliminating the effect of
armature reaction on reduction in synchronizing torque. However, voltage regulator action was
found to introduce negative damping torque at high power output and weak external network
conditions represented by long overhead transmission lines, a very common operating situation in
power systems around the world. Negative damping gave rise to an oscillatory instability
problem. The contradicting performance of the excitation control loop was resolved by adjusting
the voltage regulator reference input through an additional stabilizing signal, which was meant to
produce positive damping torque. The control circuitry producing this signal was termed a power
system stabilizer (PSS) [10-12].
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 3

Power system operating conditions are subjected to changes due to many reasons. One of
these reasons is the load changes in the system. These operating conditions affect the stability of
the synchronous machine. Therefore, in order to provide an estimate of the stability of the system
which is based on operating conditions of the system that is obtained by either computer
simulations or measurements, a small-signal stability analysis should be conducted [13,16].
Small-signal stability (also called dynamic stability) analysis studies the behavior of power
systems under small perturbations. Its main objective is to evaluate the low-frequency
oscillations (LFO) resulting from poorly damped rotor oscillations. The most important types of
these oscillations are the local-mode, which occurs between one machine and the rest of the
system, and the interarea-mode oscillations that occurs between interconnected machines.
Stability assessment of these low frequency oscillations is a vital concern and essential for secure
power system operation and control. Local-mode oscillations are the concern of this project.
[1,10,13]
Traditionally, small-signal stability analyses are carried out in frequency domain using
modal analysis method. This method implies estimation of the characteristic modes of a
linearized model of the system. It requires first load flow analysis, linearization of the power
system around the operating point, developing a state-space model of the power system, then
computing the eigenvalues, eigenvectors, and participation factors. Although eigenvalue analysis
is powerful, however, it is not suitable for online application in power system operation, as it
requires significantly large computational efforts. Alternative method based on electromagnetic
torque deviation has been developed. Torque deviation can be decomposed into synchronizing
and damping torques. The synchronizing and damping torques are usually expressed in terms of
the torque coefficients Ks and Kd. These coefficients can be calculated repeatedly and this makes
it suitable for online stability assessment. [13,15-16]



Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 4

1.2. Background
1.2.1. Power System and Problem statement
Power system stability may be generally defined as the characteristic of a power system
that enables it to remain in a state of operating equilibrium under normal operating conditions
and to regain an acceptable state of equilibrium after being subjected to a disturbance. The
stability of the power system is concerned with the behavior of the synchronous machines after
they have been disturbed. If the disturbance does not involve any net change in power, the
machines should return to their original state. If an unbalance between the supply and demand is
created by a change in load, in generation, or in network conditions, a new operating state is
necessary. In any case all interconnected synchronous machines should remain in synchronism if
the system is stable; i.e., they should all remain operating in parallel and at the same speed. [7-8,
10]
In the evaluation of stability, the concern is the behavior of the power system when
subjected to disturbance. The disturbance may be small or large. Small disturbances in the form
of load changes take place continually, and the system adjusts itself to the changing conditions.
The system must be able to operate satisfactory under these conditions and successfully supply
the maximum amount of load. It must also be capable of surviving numerous disturbance of a
severe nature, such as short-circuit of a transmission line, loss of large generator or load, or loss
of a tie between two subsystems. Much of the equipments are involved & affected during the
system response to a disturbance. For example, a short-circuit on a critical element followed by
its isolation by protective relays will cause variations in power transfers, machine rotor speeds,
and bus voltages; the voltage variations will actuate both generator and transmission system
voltage regulators; the speed variations will actuate prime mover governors; the change in tie line
loadings may actuate generation controls; the changes in voltage and frequency will affect loads
on the system in varying degrees depending on their individual characteristics. [10-11]
Interconnected AC generators produce torques that depend on the relative angular
displacement of their rotors. These torques act to keep the generators in synchronism. Thus, if the
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 5

angular difference between generators increases, an electrical torque is produced that tries to
reduce the angular displacement. The angular displacements should settle to values that maintain
the required power flows through the transmission network and supply the system load. If the
disturbance is large on the transmission system, the nonlinear nature of the synchronizing torque
may not be able to return the generator angles to a steady state. Some or all generators then loose
synchronism and the system exhibits transient instability. On the other hand, if the disturbance is
small, the synchronizing torques keep the generators nominally in synchronism, but the
generators relative angles oscillate. In a correctly designed and operated system, these
oscillations decay. In an overstressed system, small disturbances may result in oscillations that
increase in amplitude exponentially and lead the power system to instability. Moreover, The
transient following a system perturbation is oscillatory in nature; but if the system is stable, these
oscillations will be damped toward a new non-oscillatory operating condition. These oscillations,
however, are reflected as fluctuations in the power flow over the transmission lines. If a certain
line connecting two groups of machines undergoes excessive power fluctuations, it may be
tripped out by its protective equipment thereby disconnecting the two groups of machines. [1,7]
1.2.2. Classification of Power System Stability
Classification of power system stability can take many forms, but they all fallout into two main
stability types.
- Transient stability
which is the ability to maintain synchronism when the system is subjected to a
large disturbance. In the resulting system response, the changes in the dynamic variables
are large and the nonlinear behavior of the system is important. [10]
- Small Signal Stability (dynamic stability)
which is the ability of the system to maintain stability under small disturbance.
Such disturbances occur continuously in the normal operation of a power system due to
small variations in load and generation. The disturbances are considered sufficiently small
to permit the use of linearized system model in the analysis of the small signal stability.
[1,10]
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 6

1.2.3. Damping of Power System Oscillations
Early investigations considered attention in the literature of the excitation system and its
ability in enhancing stability of the power system. Researchers have found that the negative
damping of large interconnected coupled system introduced by voltage regulators with high gain
was the main reason to experience oscillations. A solution to improve the damping in the system
was achieved by introducing a stabilizing signal into the excitation system. This signal should be
taken from power system stabilizer [7,8].
1.3. Design Constrains
1.3.1. Power System Constraints
The Power System should meet some constraints in which it does not exceed the limits of
the generation. These constraints are summarized as follows:
- The system should have the ability to supply the total generation (demand and losses).
- Each bus in the system should not exceed its voltage magnitude beyond 5% of the
nominal bus voltage.
- Each generator should not exceed the real and reactive power capability constraints.
- All the transmission lines and the transformers should not be overloaded.
1.3.2. Stability Constraints
The system stability depends on the electric torque of a synchronous machine, which in
turns depends on the synchronizing and damping torque. If the synchronizing torque increased
above or decreased beyond a certain limit, this will lead the system to instability through an non-
periodic drift in the rotor angle. Whereas, if this happened in the damping torque, it will lead the
system to oscillatory instability.


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 7

1.3.3. PSS Tuning Parameters Constraints
The Power System Stabilizer tuning parameters should meet some constraints to make an
effective and useful stabilizing signal. These constraints are:
- The effect of the damping torque should cancel the effect of the negative one
introduced by the Auto-Voltage Regulator (AVR) of the excitation system. This is
done by increasing the damping torque to a high level.
- The PSS should include an appropriate phase compensation circuits, in which the
phase lag between the electrical torque and the exciter input is compensated.
- The PSS gain should not exceed the stabilizing signal limits.
1.4. Digital Control & Microcontrollers MATLAB Interfacing
The purpose of developing the digital control theory is to be able to understand, design and
build control systems where a computer is used as the controller in the system. In addition to the
normal control task, a computer can perform supervisory functions, such as reading data from a
keyboard, displaying data on a screen, turning a light or a buzzer on or off and so on.
Interest in digital control has grown rapidly in the last several decades since the
introduction of microcontrollers. A microcontroller is a single-chip computer, including most of a
computers features, but in limited sizes. Today, there are hundreds of different types of
microcontrollers, ranging from 8-pin devices to 40-pin, or even 64-pin or higher pin devices. [30
32]
Microcontrollers had its beginnings in the development of technology of integrated circuits.
This development has stored hundreds of thousands of transistors into one chip. The first
computers were made by adding external peripherals such as memory, input/output lines, timers
and others to it. Further increasing of package density resulted in creating an integrated circuit
which contained both processor and peripherals. That is how the first chip containing a
microcomputer, later known as a microcontroller, was developed. Microcontrollers are used
nowadays in automatically controlled products and devices, such as automobile engine control
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 8

systems, remote controls, office machines, power systems. Furthermore, the relatively fast
computational speed and the simplicity of implementing instructions into control systems makes
the microcontroller the optimum solution for implementing the PSS on it. [17]
Manufacturing companies are designing different types of microcontrollers, which are all
available in the market, such as Amtel AVR, Hyperstone, MIPS, PowerPC, Intel 8051, PIC,
Texas Instruments Microcontrollers, Parallax Propeller, etc. Each type has its own specifications
and they all differ in the capability of functioning. [17,29, 31]
Microchip Technology has developed the Peripheral Interface Controller (PIC) and
integrated it with a central processing unit, serial communication functionality, and some
peripherals such as memory, timer and input/output functions on an integrated circuit. Similar to
other microcontrollers, PICs are usually programmed in order to perform a certain function or
computation, so it is usually integrated in control system with other peripherals to control a plant.
PIC microcontrollers are more popular to industrial developers and hobbyists alike due to there
lower cost, wide availability, serial programming capability, and can be loaded with large user
base. Moreover, the serial communication capability of PIC microcontrollers with the MATLAB
software along with the Simulink, which is a graphical design tools in MATLAB, contributes in
developing many programs which are used in simulating and controlling electrical & mechanical
systems. The microcontroller used in this project is the PIC microcontroller which controls the
SMIB power system. [17,29, 31,33]
1.5. IEEE Standards on Machine Models and Excitation Systems
In this project, the model of synchronous generators and excitation systems is used in the
dynamic stability analysis according to the IEEE standards [36-39].
1.6. Objectives
The objectives of this project are summed into the following outlines:
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 9

- Conduct a literature survey on the power system dynamic models for dynamic stability
analysis;
- Conduct a literature survey on the component connection technique (CCT) for power
system modeling;
- Conduct a literature survey on different techniques for power system stabilizer (PSS)
design;
- Conduct a literature survey on microcontrollers (MCU);
- Derive the state-space equations of a SMIB power system;
- Develop the SMIB model on Simulink;
- Evaluate dynamic stability using eigenvalue analysis;
- Evaluate dynamic stability using synchronizing and damping torques concept;
- Implement time-domain simulations using the system developed on Simulink;
- Study the effect of the system operating point conditions and the excitation system
parameters on the system dynamic stability;
- Design a power system stabilizer to enhance system dynamic stability;
- Perform the time-domain simulations with and without the designed PSS;
- Transformation of the PSS transfer function in s-domain to z-domain;
- Implementation of the digital PSS on microcontroller;
- Perform the time-domain simulations with the designed PSS based on microcontroller.






Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 10

CHAPTER 2: MODELLING OF POWER SYSTEMS USING COMPONENT
CONNECTION TECHNIQUE FOR DYNAMIC STABILITY STUDY
2.1. Overview
The component connection technique (CCT) is a method for the evaluation of the system
state matrix which is then used to determine system stability. There are few methods for the
formulation of the state matrix, but the main drawback of these methods is that they require
extensive matrix inversions. As a result of these inversions, the system parameters are no longer
explicitly available in the overall system state matrix. Moreover, it may require formidable work
to form overall system state matrix for some large scale systems using the other methods. [24,25]
CCT details the formulation of the overall system state matrices from the state matrices of
the different subsystems forming the overall system. Modeling the system using Component
Connection Technique is called component connection model (CCM). The CCM of a linear
dynamical system consists of a set of two vector matrix equations separately describing
component dynamics and component interconnections. [24,25]
The main advantage of CCT is illustrated in the formulation of the overall system state
matrices from the state matrices of the component subsystems. Moreover, another important
advantage of CCT is the flexibility in subsystem modeling. The subsystems may be modeled to
any degree of detail as long as subsystem inputs and outputs remain the same, without
necessitating any change in the interconnection matrix. This is particularly useful for the
evaluation of different order models for a given system which requires the state matrix to be
determined for each of the alternative models. [24]
Consider an interconnected power system that is a composed of interconnected components
and let the


component have input vector

output vector

and state vector

Denote the
linear state model for the

component by

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 11


(2.1)


where

are constant matrices of appropriate dimension.


The composite component state model is constructed by stacking the n component
equations together. Symbolically, the composite component state model can be expressed as


(2.2)


where


and


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 12

Here, n is the number of components and in general is not equal to the number of states.
Component and system interconnections take the form

(2.3)
where is the system input vector, is the system output vector and

are the connection


matrices. Figure (2.1) shows the block diagram of the component connection model.
L
11
L
21
L
12
1
a1 b1
2
a2 b2
n
an bn

y A
L
22
u A a b

Figure (2.1): Block Diagram of Component Connection Model (CCM)
Under the assumption that the composite component state vector coincides with the
composite system state vector, the composite system state model has the form
(2.4)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 13


According to literature [25],

(2.4.1)

(2.4.2)

(2.4.3)

(2.4.4)
and



2.2. Modeling of SMIB Power System Using CCT
In this section, the single machine connected to an infinite bus through transmission line is
considered in this study. Figure (2.2) shows the single line diagram of the SMIB system.
Turbine-governor dynamics is neglected.


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 14

G
AVR
Exciter
t
V u Z 0 V

Z
Infinite
Bus
e
R
e
jX
Line

Figure (2.2): Single Line Diagram of SMIB System.
The parameters of the studied SMIB power system are taken from literature [7] as below.
Common System Parameters
- Rated (Base) operating frequency (

) = 314 rad/s
- Rated complex power (

) = 160 MVA
- Rated voltage (

) = 15 KV
Synchronous Generator Parameters
- Synchronous d-axis Reactance (

) = 1.7 p.u
- Synchronous q-axis Reactance (

) = 1.64 p.u
- Transient d-axis Reactance (

) = 0.245 p.u
- Field open circuit Time Constant (

) = 5.9 s
- Generator moment of inertia (H) = 2.37
- Mechanical Input torque (

) = 1.64 p.u
- Machine Damping coefficient (D) = 0
Voltage Regulator Exciter Parameters
- Exciter gain constant (

) = 50
- Voltage Regulator time constant (

)= 0.05 s
Transmission Line Parameters
- Transmission line resistance (

) = 0.02 p.u
- Transmission line reactance (

) = 0.4 p.u
Nominal Operating Point
- Real Power (P) = 136 MW
- Reactive Power (Q) = 83.2 MVAR
- Terminal Voltage (V
t
) = 17.3 KV 16.6
o

- Infinite Bus Voltage (V
inf
) = 15 KV 0
o

- Rotor Angle of Generator () = 49.16
o

2.2.1. Synchronous Generator Modeling
For synchronous generator modeling third-order model of synchronous generator was used.
To develop the component connection model (CCM) of the synchronous generator the model was
divided into components as shown in Figure (2.3).
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 15

1 3 6
2 4 5
fd
E A '
q
E A
r
qd
I A
e
qd
I A
e
qd
V A
r
qd
V A
r
q
V A
q
E A
b
e
e
A
m
T A
o A
r
q
I A

Figure (2.3): Block diagram of Synchronous Generator CCM
1- Component 1: Voltage proportional to field flux linkage

(2.5)
2- Component 2: Prime mover equations

(2.6)


3- Component 3: Stator currents in Rotor Reference Frame (RRF)


(2.7)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 16



4- Component 4: Voltage back of q-axis synchronous reactance

(2.7)

5- Component 5: Stator voltage in RRF

(2.8)



6- Component 6: Stator currents in Synchronous Reference Frame (SRF)

(2.9)


Armature resistance

. The linearized synchronous generator state


space final model may be written as


(2.10)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 17


Where the input-output vectors

are defined as

(2.11)
The final machine matrices was computed using the component connection technique discussed
in Section (2.1), for the SMIB power system given in Figure (2.2) at nominal operating point.


(2.12)
The matrices

are dependent on the type of generator model used, and the


number of inputs outputs variables.

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 18

2.2.2. Exciter modeling
Static exciter was used for AVR-exciter model. The Static exciter model is shown in
Figure (2.4).
1
A
A
K
T s +
fd
E A
ref
V A
t
V A

Figure (2.4): Excitation System
Static Exciter Component

(2.13)
The linearized exciter state space final model may be written as


(2.14)


Where the input-output vectors

are defined as

(2.15)
The final exciter matrices was computed using the component connection technique discussed in
Section (2.1), for the SMIB power system given in Figure (2.2) at nominal operating point.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 19




(2.16)
2.2.3. AC Network
AC Network Component


(2.17)




The linearized AC network state space subsystem model may be written as


(2.18)


Where the input-output vectors

are defined as

(2.19)
and the final AC network matrices was computed using the component connection technique
discussed in Section (2.1), for the SMIB system given in Figure (2.2) at nominal operating point.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 20





(2.20)
Relation Component


(2.21)


The linearized relation state space subsystem model may be written as


(2.22)


Where the input-output vectors

are defined as

(2.23)
and the final relation matrices was computed using the component connection technique
discussed in Section (2.1), for the SMIB system given in Figure (2.2) at nominal operating point.





(2.24)

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 21

2.3. Overall System Model
To develop the overall system component connection model the component connection technique
discussed in section (2.4.1) was used to interconnect the subsystems together. The overall system
is composed of synchronous generator subsystem, AC network & relation subsystem and static
exciter subsystem. Figure (2.5) shows the overall system component connection model (CCM).
1 3 6
2 4 5
m
T A
b
e
e
A
'
q
E A
Machine
o A
AC
Network
e
qd
V A
e
qd
I A
Static
Exciter
(AVR)
fd
E A
fd
E A
ref
V A
t
V A

Figure (2.5): Block Diagram of Overall System using CCM
Final matrices of subsystems was used as a components to develop the overall system. The
linearized overall system state space model may be written as


(2.25)


Where the input-output vectors

are defined as
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 22

(2.26)
The overall state-space model of the system (SMIB final matrices) is, [1, 13, 24, 25]


(2.27)


(2.28)
the overall system matrices was computed using the component connection technique discussed
in Section (2.1), for the SMIB system given in Figure (2.2) at nominal operating point.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 23


(2.29)
It is observed that the B matrix and D matrix, 4x1 matrix instead of 4x2 and this is because
turbine-governor dynamics was neglected.
In a power system described by Equations (2.27)-(2.28), the dynamic stability of the
system can be studied through the eigenvalues of the matrix A
F
. The eigenvalues are related to
different modes in the system. while the real part is a measure of the amount of damping, the
imaginary part is related to the natural frequency of oscillation of the corresponding modes. All
real eigenvalues and the real part of complex eigenvalues must be negative for system stability.
Constants [K
1
-K
6
] can be calculated from the overall matrices of the power system, as follows
K
1
= C
F
(4,3)= 1.3594 K
2
= C
F
(4,1)= 1.2309 K
3
= -1/(T
do
*A
F
(1,1))= 0.3072
K
4
= -T
do
*A
F
(1,3)= 1.6917 K
5
= C
F
(3,3)= 0.0529 K
6
= C
F
(3,1)= 0.5362
where
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 24

K
1
=

= the change in electrical torque for a change in rotor angle with considering
constant flux linkages in the d-axis.
K
2
=

= the change in the electrical torque for a change in the flux linkages in the d-axis
with considering a constant rotor angle.
K
3
=

= the impedance factor in which the external impedance is a pure reactance


K
4
=

= the demagnetizing effect of a change in rotor angle


K
5
=

= the change in the terminal voltage with respect to the change in the rotor angle
with considering a constant flux linkages in the d-axis
K
6
=

= the change in the terminal voltage with respect to the change in flux linkages in the
d-axis for a constant value of the rotor angle
2.4. Block Diagram Representation
2.4.1. Rotor Mechanical Equations
The following equations represents the torque angle loop of the synchronous machine:
where K
1
and K
2
are derived from section (2.3), and


(2.30)


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 25

The following block diagram represents the torque-angle loop of the synchronous machine. [11]
2
K
'
q
E A
b
s
e
e A e
T A
m
T A
S
K
o A
D
K
1
2


Figure (2.6): The Torque-Angle Loop of Synchronous Machine
2.4.2. Representation of Flux Decay
From Equation (2.32), the field windings equation can be expressed as:
where K
3
and K
4
are derived from section (2.3). The following block diagram represent the flux
decay model.

(2.31)

(2.32)

(2.33)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 26

3
3
1 '
do
K
K T s +
'
q
E A
4
K
o A
fd
E A

Figure (2.7): Flux-Decay Model
2.4.3. Representation of Excitation System
The equation of the exciter in the system is:
Where K
5
and K
6
are derived from section (2.3). The following block diagram represents the
excitation systems block diagram.
1
A
A
K
T s +
fd
E A
ref
V A
t
V A
'
q
E A
6
K
5
K
o A

Figure (2.8): Excitation System
The overall system block diagram representation consists of combining the block diagrams
of rotor swing equations, flux decay and excitation system. A single line representation of single
machine infinite bus (SMIB) with voltage regulator-excitation system is shown in Figure (2.2).

(2.34)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 27

The generator is connected to voltage regulator-static excitation system. For small oscillation
stability analysis, the fast stator transients can be neglected. Moreover, since d and q damper
windings always produce positive damping, they are often neglected for performance analysis of
power system stabilizers. Based on the above assumptions, the synchronous generator third-order
model along with voltage regulator-static exciter can be combined to form fourth-order model
with changes in the load angle , the rotor speed , the internal voltage of the generator

,
and the field voltage

, as the state variables. The state-space model of the system will be


discussed in the following section and the details of modeling procedure and the involvement of
the simplifying assumptions were discussed completely in the previous sections. The linear time
invariant model for this system is constructed by linearizing the system equations about any
given steady-state operating condition. The system inputs are the voltage regulator voltage
reference (

), and synchronous generator input mechanical torque (

. Figure (2.9)
shows the overall block diagram of the linearized system.
1
A
A
K
T s +
fd
E A
3
3
1 '
do
K
K T s +
2
K
'
q
E A
6
K
b
s
e
e A
4
K
e
T A
m
T A
1
K
D
5
K
ref
V A
t
V A
o A 1
2


Figure (2.9): Overall Block Diagram of the Linearized Power System

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 28

2.5. MATLAB/Simulink Model of the Power System
MATLAB/Simulink was used to simulate the overall block diagram (SMIB with voltage
regulator-exciter power system) that was shown in Figure (2.9). This MATLAB/Simulink model
will be used in later sections to study the dynamic response of the power system. Figure (2.10)
shows MATLAB/Simulink model of the SMIB with exciter power system.
The power system inputs

and

was implemented as step input to the system, and


the power system output signals , ,

and

were taken to scope and to the


MATLAB workstation so they can observed and used in computations.

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 29


Figure (2.10): MATLAB/Simulink Model of the SMIB with Exciter Power System
D
e
l
t
a
-

V
t
D
e
l
t
a
-

E
q
'
D
e
l
t
a
-

E
f
d
D
e
l
t
a
-

T
e
D
e
l
t
a
-

T
s
D
e
l
t
a
-

T
d
D
e
l
t
a
-

d
e
l
t
a
D
e
l
t
a
-

O
m
e
g
a
K
4
k
4
d
e
l
t
a
-
d
e
l
t
a
d
e
l
t
a
-
V
t
d
e
l
t
a
-
T
e
K
A
T
A
.
s
+
1
V
o
l
t
a
g
e

R
e
g
u
l
a
t
o
r
-
E
x
c
i
t
e
r
V

r
e
f
D
e
l
t
a
_
V
t
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

V
t
)
D
e
l
t
a
_
T
e
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

T
e
)
t
T
o

W
o
r
k
s
p
a
c
e
(
T
i
m
e
)
D
e
l
t
a
_
d
e
l
t
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

d
e
l
t
a
)
D
e
l
t
a
_
O
m
e
g
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

O
m
e
g
a
)
(
2
.
*
H
)
s
1
R
o
t
a
t
i
n
g

M
a
s
s
D
e
l
t
a

O
m
e
g
a
D
e
l
t
a

-

T
m
K
D
D
a
m
p
i
n
g

T
o
r
q
u
e
C
o
f
f
i
e
c
e
n
t
-
K
D
K
6
C
o
n
s
t
a
n
t
-
k
6
K
5
C
o
n
s
t
a
n
t
-
k
5
K
2
C
o
n
s
t
a
n
t
-
k
2
K
1
C
o
n
s
t
a
n
t
-
k
1
0
C
l
o
c
k
W
b
B
a
s
e

F
r
e
q
1 s
K
3
(
K
3
.
*
T
D
P
)
s
+
1

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 30

2.6. Variation of Constants K
1
-K
6
According to System Operating Points
The stability of the SMIB power system is related to the constants [K
1
-K
6
]. These constants
vary according to the variation of operating points. In order to evaluate the stability of SMIB
power system discussed in section (2.2), Figures (2.11)(2.16) shows the variations of these
constants according to following operating points.
(p.u) (2.35)
(p.u) (2.36)
where these operating points were calculated using the power flow solution. Power flow solution
is the computation of voltage magnitude and phase angle at each bus in a power system under
balanced three-phase steady-state conditions. As a by-product of this calculations, real and
reactive power flows in equipment such as transmission lines and transformers, as well as
equipment losses, is computed. Newton-Raphson method is used to obtain power flow solution.

Figure (2.11): Variation of K
1
at Different Operating Points
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
-0.5
0
0.5
1
1.5
0.8
1
1.2
1.4
1.6
1.8
2

Real Power, P (M
W
)
Variation of K1 at different operating points
R
e
a
c
tiv
e
P
o
w
e
r, Q
(M
V
A
R
)
C
o
n
s
t
a
n
t

K
1
0.8
0.9
1
1.1
1.2
1.3
1.4
1.5
1.6
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 31


Figure (2.12): Variation of K
2
at Different Operating Points

Figure (2.13): Variation of K
3
at Different Operating Points
0.2
0.4
0.6
0.8
1
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
0
0.5
1
1.5
2

R
e
a
l P
o
w
e
r, P
(M
W
)
Variation of K2 at different operating points
R
e
a
c
tiv
e
P
o
w
e
r
, Q
(
M
V
A
R
)

C
o
n
s
t
a
n
t

K
2
0.4
0.6
0.8
1
1.2
1.4
1.6
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
0.3072
0.3072
0.3072
0.3072
0.3072
0.3072
Real Power, P (M
W
)
Variation of K3 at different operating points
R
e
a
c
tiv
e
P
o
w
e
r,Q
(M
V
A
R
)
C
o
n
s
t
a
n
t

K
3
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 32


Figure (2.14): Variation of K
4
at Different Operating Points

Figure (2.15): Variation of K
5
at Different Operating Points
0.2
0.4
0.6
0.8
1
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
0
0.5
1
1.5
2
2.5

R
e
a
l P
o
w
e
r,P
(M
W
)
Variation of K4 at different operating points
R
e
a
c
tiv
e
P
o
w
e
r, Q
(M
V
A
R
)

C
o
n
s
t
a
n
t

K
4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
2.2
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
-0.5
0
0.5
1
1.5
-0.3
-0.2
-0.1
0
0.1
0.2

R
eal P
ow
er,P
(M
W
)
Variation of K5 at different operating points
R
e
a
c
tiv
e
P
o
w
e
r,Q
(M
V
A
R
)
C
o
n
s
t
a
n
t

K
5
-0.25
-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 33


Figure (2.16): Variation of K
6
at Different Operating Points
From the figures shown above, it is observed that [K
1
-K
6
] are always positive except K
5

which sometime might go to negative value and that is an indication for system instability.
Figure (2.15) shows that at operating points that stress the generator or at operating points that
the generator is absorbing reactive power, constant K
5
is negative.







0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
-0.5
0
0.5
1
1.5
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8

Real Pow
er, P (M
W
)
Variation of K6 at different operating points
R
e
a
c
tiv
e
P
o
w
e
r,Q
(M
V
A
R
)
C
o
n
s
t
a
n
t

K
6
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0.55
0.6
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 34

CHAPTER 3: DYNAMIC STABILITY EVALUATION
3.1. Techniques of Stability Evaluation
Stability can be evaluated by different methods, such as using Eigenvalues, Damping
Torques and Time-Domain Simulations. These methods are techniques that are used to determine
if the system is stable or unstable. The following sections describes these techniques in details by
taking different operating points.
3.1.1. Stability Evaluation Using Eigenvalues Technique
Consider the following state-space equations:
Note that all the partial derivatives above are evaluated at which small perturbation is being
analyzed. Now we need to get the state Equations (3.1)-(3.2) in the frequency domain. This is
done by taking the Laplace transform as follows:
Rearranging Equation (3.3):

(3.1)
(3.2)
(3.3)
(3.4)
(3.5)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 35

This yields to:
Substituting Equation (3.6) in (3.4) results in
Note that both Equations (3.6)-(3.7) have two components, one dependent on the initial
conditions and the other one dependent on the input [10]. The poles of Ax(s) and Ay(s) are
obtained from the roots of the characteristic equation of matrix A, which is:
where s is the eigenvalue of matrix A.
The stability of any system is determined by its eigenvalues as follows:
1. The real eigenvalue corresponds to a non-oscillatory mode. If it is negative, this
represents the decaying mode, and it decays fast as long as the magnitude of the
eigenvalue is high. However if it is positive, this would represent an aperiodic instability.
Note that if there is at least one positive real eigenvalue in the system, this would lead the
system to instability mode [10].
2. The complex eigenvalues appear in conjugate pairs, and each pair corresponds to an
oscillatory mode. The real component of the complex pair represents the damping, while
the imaginary component represents the frequency of oscillations [10]. For a complex pair
of eigenvalue:




(3.6)



(3.7)
(3.8)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 36

The damping ratio can be expressed as:
Where the frequency of oscillations in Hz is:
Equation (3.10) determines the rate of decay of the amplitude of the oscillation.
The stability of power system is related to position of the power system eigenvalues in real-
imaginary plane. The real component of the eigenvalue presents the damping, where the
imaginary component presents the frequency of oscillations. If the real part of the eigenvalue is
negative, the response is represented as damped oscillations which tends the system to be stable,
whereas if it is positive, the response is represented as increasing amplitude oscillations, thus the
system is instable.
3.1.2. Stability Evaluation using Damping Torque Technique
Stability of the power system is considered as a case of equilibrium between opposing
forces. The input mechanical torque and the output electrical torque of each machine is in
equilibrium state under steady-state conditions with a constant speed. If the system is subjected to
any disturbance during the equilibrium state, this would result in acceleration or deceleration of
the rotor of the machine. The stability of the motor depends on both components of the torque. If
any lack of sufficient damping torque occurs in the system, this would lead the system to
oscillatory instability. [10]
(3.9)


(3.10)

(3.11)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 37

Considering the block diagram of Figure (2.5) introduced in section (2.2), where AE
q

is
derived as:
Rearranging the equation yields to:
The expression of the torque-angle loop is given by:
By changing s to je then simplifying, Equation (3.14) becomes:
Suppose
Multiplying Equation (3.15) by yields to:
In Equation (3.18), the imaginary part plays an important role in the stability of the
system. If the imaginary part is greater than zero, positive damping is then implied, and hence the

(3.12)

(3.13)


(3.14)

(3.15)

and

(3.16)

(3.18)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 38

roots move to the left-half plane which makes the system stable. Whereas if it negative, or less
than zero, negative damping results which makes the system unstable [1].
For oscillation frequencies of 1 to 3 Hz, the effect of K
4
can be neglected [1]. By separating
Equation (3.18) into real and imaginary parts, neglecting the effect of K
4
and setting e = 0 for
the case of low frequencies, this results in:
where K
s
is the synchronizing torque coefficient due to

. By setting e = 0 for the low


frequencies case and considering a high grain K
A
, Equation (3.20) becomes:
The imaginary part of Equation (3.18) is:
The above equation results in a positive damping for K
5
> 0, but a negative damping for K
5

< 0. Our concern here is when K
5
is in negative, and K
A
is large enough to lead the system to
instability. The constant K
5
becomes positive for considering low value of external system
reactance and low generator outputs, whereas it is negative for high system reactance and high
generator outputs. In this case, this may offset the inherent machine damping torque. Therefore, a

(3.20)

(3.21)

(3.22)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 39

power system stabilizer (PSS) is introduced to eliminate the effect of the negative damping
torque and lead the system to stability [1].
The following figure shows the block diagram of the torque angle loop for a single-
machine infinite bus system.
2
K
'
q
E A
b
s
e
e A e
T A
m
T A
S
K
o A
D
K
1
2


Figure (3.1): Torque-Angle Loop
From Figure (3.1) we have:
After rearranging we get
The characteristic equation derived from Equation (3.24) is given by:

(3.23)

(3.24)

(3.25)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 40

Which is the general form of:
From Equations (3.25) and (3.26), the undamped natural frequency is
Also, the damping ratio is
Therefore the damping frequency can be calculated as:
An increase in the synchronizing torque coefficient K
S
causes the natural frequency to
increase and hence the damping ratio to decrease. But as the damping ratio coefficient K
D

increases, this would cause the damping ratio to increase again, in case that the inertia constant
does not decrease [10,11].
3.1.3. Stability Evaluation using Time-Domain Simulation Technique
In this project, Simulink model, that is shown in Figure 2.10, were used to model and simulate
SMIB power system discussed in Section 2.2 using a graphical block diagram, then MATLAB
can show rotor speed deviation response, rotor angle deviation response and terminal voltage
deviation response.

(3.26)


(3.27)


(3.28)


(3.29)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 41

3.2. Dynamic Stability Evaluation of SMIB
Consider the following Single-Machine Infinite Bus (SMIB) system with the parameters
shown below. The system has been evaluated for stability using the techniques mentioned in the
previous section at the nominal operating point.
G
AVR
Exciter
t
V u Z 0 V

Z
Infinite
Bus
e
R
e
jX
Line

The parameters of the studied SMIB power system are taken from literature [7] as below.
Common System Parameters
- Rated (Base) operating frequency (

) = 314 rad/s
- Rated complex power (

) = 160 MVA
- Rated voltage (

) = 15 KV
Synchronous Generator Parameters
- Synchronous d-axis Reactance (

) = 1.7 p.u
- Synchronous q-axis Reactance (

) = 1.64 p.u
- Transient d-axis Reactance (

) = 0.245 p.u
- Field open circuit Time Constant (

) = 5.9 s
- Generator moment of inertia (H) = 2.37
- Mechanical Input torque (

) = 1.64 p.u
- Machine Damping coefficient (D) = 0
Voltage Regulator Exciter Parameters
- Exciter gain constant (

) = 50
- Voltage Regulator time constant (

)= 0.05 s
Transmission Line Parameters
- Transmission line resistance (

) = 0.02 p.u
- Transmission line reactance (

) = 0.4 p.u
Nominal Operating Point
- Real Power (P) = 136 MW
- Reactive Power (Q) = 83.2 MVAR
- Terminal Voltage (V
t
) = 17.3 KV 16.6
o

- Infinite Bus Voltage (V
inf
) = 15 KV 0
o

- Rotor Angle of Generator () = 49.16
o


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 42

3.2.1. SMIB Power System Stability Evaluation Using Eigenvalues Technique
MATLAB were used to compute the eigenvalues of the previous SMIB power system for
stability evaluation. Table 3.1 shows the eigenvalues of the previous SMIB power system at
nominal operating point. Constants [K
1
-K
6
] are calculated using the Component Connection
Technique which was discussed in Section 2.1.
Table (3.1): The Eigenvalues and the Constants [K
1
-K
6
] of the Nominal Operating Point
Operating point 1
P (MW) 136
Q (MVAR) 83.2
K
1
1.3594
K
2
1.2309
K
3
0.3072
K
4
1.6917
K
5
0.0529
K
6
0.5362

1
-12.9502

2

-6.932

3

-0.3348 + j9.4219

4

-0.3348 - j9.4219
From the table above, it is clear that all real parts of the eigenvalues are negative, which
means that the system is stable.
By calculating the damping ratio ,, the rate of decay of the oscillations amplitude can be
obtained, which determines whether the system is stable or not. If the damping ratio is positive,
this means that the system has a decreasing oscillations amplitude, and hence the system is
stable which is the case in nominal operating point. By calculating the damping ratio of this
operating point considering
3
(-0.3348 + j9.4219), we get
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 43

Note that choosing
4
to calculate the damping ratio will end up with the same result as above.
3.2.2. Dynamic Stability Evaluation of SMIB Using Torques Technique
In order to calculate the synchronizing and damping torque for the nominal operating point
for the previous SMIB power system, the following expression is used to obtain field flux
linkage, which has been derived in section 3.1.2:
The value of the complex frequency obtained from the rotor oscillations is equal to
3
of
nominal operating point which is -0.3348 + j9.4219. Substituting it in Equation (3.30) and
simplifying yields to:
Moreover, the torque due to AE
q

is equal to:
Which results in


(3.30)




(3.31)


(3.32)

(3.33)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 44

From Figure (3.1) it is clear that
in per unit. Hence
Substituting jAo in Equation (3.33) yields to:
From the result above we can conclude that:

(p.u) (3.34)


(3.35)


(3.36)


(3.37)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 45

The total synchronizing torque is equal to:
From the above results, it is clear that the value of K
D
and K
S
are positive, which means that this
system is in stable mode. To ensure that the calculations are correct, the damping ratio of the
system is calculated using Equation (3.28) as follows:
The damping ratio here is equal to the one obtained in section 3.2.1. Therefore the system
is stable. The following table summarize all values of torque coefficients and damping ratio and
frequency for operating point 1.
Table (3.2): Synchronizing and Damping Torques and Damping Ratios and Frequencies for
Nominal Operating Point

Operating
Point 1
K
S
(p.u torque / rad)

1.3418
K
D
(p.u torque / rad)

3.1744
e
n
(rad/s) 9.4280

(3.38)








(3.39)


(3.40)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 46

, 0.0355
e
D
(rad/s)

9.4220

3.2.3. Dynamic Stability Evaluation of SMIB Using Time-Domain Simulation Technique
Time domain simulation technique that was discussed in Section (3.1.3) have been applied
to the studied SMIB power system discussed in Section (3.2) to obtain the rotor speed deviation
response, rotor angle deviation response and terminal voltage deviation response at the nominal
operating point under 1% change in

applied at t=3 sec as shown in Figures (3.2)(3.3).



Figure (3.2): Rotor Speed Deviation Response Under 1% Change in

at Nominal Operating
Point
0 2 4 6 8 10 12 14 16 18 20
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 47

From Figure (3.2) it is observed that at this operating point and exciter gain, the power
system rotor speed deviation goes to zero (i.e nominal value of rotor speed) which means that it is
stable. By also looking at the value of constant K
5
, the eigenvalues and the damping torque
coefficient K
D
of the power system at the nominal operating point, it is concluded that since all
the real parts of the system eigenvalues are negative and the damping torque coefficient K
D
is
positive this means that the system is stable at this operating point, and since K
5
is positive this
indicates that the system will be stable at higher values of exciter gain K
A
.


0 2 4 6 8 10 12 14 16 18 20
0
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
Rotor Angle Deviation Response
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

A
n
g
l
e

(
p
.
u
)

0 2 4 6 8 10 12 14 16 18 20
-6
-4
-2
0
2
4
x 10
-4
Terminal Voltage Deviation Response
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

T
e
r
m
i
n
a
l

V
o
l
t
a
g
e

(
p
.
u
)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 48

Figure (3.3): Rotor Speed Deviation and Terminal Voltage Deviation Response Under 1% Change
in

at Nominal Operating Point


From Figure (3.3) it is observed that at this operating point and exciter gain, the power
system rotor angle deviation, and terminal voltage deviation goes to another steady state value
which corresponds to the change in T
m
.
In order to evaluate the system under 1% change in V
ref
, time domain simulation
technique that was discussed in Section (3.1.3) have been applied to the studied SMIB power
system discussed in Section (3.2) to obtain the rotor speed deviation response, rotor angle
deviation response and terminal voltage deviation response at the nominal operating point.

Figure (3.4): Rotor Speed Deviation Response Under 1% Change in

at Nominal Operating
Point
0 2 4 6 8 10 12 14 16 18 20
-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 49

From Figure (3.4) it is observed that at this operating point and exciter gain, the power
system rotor speed deviation goes to zero (i.e nominal value of rotor speed) which means that it is
stable, from this we can conclude that the system will be stable for both types of perturbations
changing in T
m
or V
ref
.
3.3. Effect of Different Operating Points on System Dynamic Stability
In this section, the dynamic stability evaluation techniques discussed in Section (3.1) have
been applied to the SMIB power system (given in Section (3.2)) at three different operating
points to evaluate the effect of different operating points of system dynamic stability. The
different operating points at which the system is evaluated are given in Table (3.1).
Table (3.3): Different Operating Points for Power System Stability Evaluation
Operating point 1 Operating point 2 Operating point 3
P (MW) 144 112 168
Q (MVAR) 96 -32 64
As show in above table, at operating point 1 the generator is running at normal operating
conditions, but at operating point 2 the generator is absorbing reactive power and at operating
point 3 the generator is stressed or heavy loaded.
The following table shows the results of testing the operating points using the eigenvalues
technique.
Table (3.4): Testing Operating Points Using Eigenvalues Technique
Operating point 1 Operating point 2 Operating point 3
P (MW) 144 112 168
Q (MVAR) 96 -32 64
K
1
1.4025 1.111 1.3948
K
2
1.2357 1.592 1.4702
K
3
0.3072 0.3072 0.3072
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 50

K
4
1.693 2.254 2.0369
K
5
0.0462 -0.0913 -0.0052
K
6
0.5393 0.2398 0.4708

1

-12.788 -17.3355 -14.1658

2

-7.1633 0.2604 + 8.4500i -6.0672

3

-0.3002 + 9.5750i 0.2604 - 8.4500i -0.1594 + 9.5297i

4

-0.3002 - 9.5750i -3.737 -0.1594 - 9.5297i
,
0.0313 -0.0308 0.0167
From the above table, it is shown that the real part of the complex pair of the eigenvalues of
operating point 2 is positive, which means that the system is unstable. However, the other pairs of
eigenvalues are having negative real part for the other two operating points, which in turns
assures that the system is stable. This is proved by calculating the damping torque coefficient of
all operating points and check whether the damping ratio is negative or positive. As shown in
Table 3.5, the damping torque coefficient of operating point 2 is negative which proves that the
system is unstable, whereas it is positive for the other operating points, therefore the system at
each operating point is stable.
After testing the system at different operating points using the eigenvalues technique, the
torques technique is then used to evaluate the stability of the system. The following table shows
the values of synchronizing and damping coefficients and damping ratios and frequencies for the
three operating points.
Table (3.5): Synchronizing and Damping Torques and Damping Ratios and Frequencies for
Three Operating Points
Operating Point 1 Operating Point 2 Operating Point 3
K
S
(p.u torque / rad)

1.3853 1.0788 1.3713
K
D
(p.u torque / rad)

2.8442 -2.4675 1.5129
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 51

e
n

(rad/s)
9.5797 8.4539 9.5309
, 0.0313 -0.0308 0.0167
e
D
(rad/s)
9.5750 8.4499 9.5296
The results in the above table were as expected. The values of damping coefficient K
D
and
damping ratio are negative for operating point 2 (the unstable system), whereas for the other
operating points (the stable systems) they are positive. It is noticed that the damping ratios for the
three operating points are equal to the ones calculated for the eigenvalues technique.
The Time-Domain Simulation Technique that is discussed in Section (3.1) were used to
evaluate the stability at the different operating points mentioned above under 1% change in

.
Figures (3.6)-(3.8) shows rotor speed deviation at the operating points mentioned above.

0 2 4 6 8 10 12 14 16 18 20
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 52

Figure (3.5): Rotor Speed Deviation Response under 1% Change in

at Operating Point 1
From Figure (3.5) it is observed that at this operating point and exciter gain, the system is
stable. By also looking at the value of constant K
5
, the eigenvalues and the damping torque
coefficient K
D
of the power system at this operating point, it is concluded that since all the real
parts of the system eigenvalues are negative and the damping torque coefficient K
D
is positive
this means that the system is stable at this operating point, and since K
5
is positive this indicates
that the system will be stable at higher values of exciter gain K
A
.

Figure (3.6): Rotor Speed Deviation Response under 1% Change in

at Operating Point 2
From Figure (3.6) it is observed that at this operating point and exciter gain, the power
system is unstable. By also looking at the value of constant K
5
, the eigenvalues and the damping
torque coefficient K
D
of the power system at this operating point, it is concluded that since two of
the system eigenvalues are positive and the damping torque coefficient K
D
is negative this
0 2 4 6 8 10 12 14 16 18 20
-8
-6
-4
-2
0
2
4
6
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 53

means that the system is unstable at this operating point, and since K
5
is negative this indicates
that the system will be highly unstable at higher values of exciter gain K
A
.

Figure (3.7): Rotor Speed Deviation Response under 1% Change in

at Operating Point 3
From Figure (3.7) it is observed that at this operating point and exciter gain, the power
system is stable. By also looking at the value of constant K
5
, the eigenvalues and the damping
torque coefficient K
D
of the power system at this operating point, it is concluded that since all the
real parts of the system eigenvalues are negative and the damping torque coefficient K
D
is
positive this means that the system is stable at this operating point, and since K
5
is negative this
indicates that the system will be unstable at higher values of exciter gain K
A
.

0 2 4 6 8 10 12 14 16 18 20
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 54

3.4. The Effect of Excitation System Parameters on System Stability
The state-space equation of the system with the exciter is given as:
Consider operating point 3 introduced in section (3.3) where real power (P) = 168 MW,
reactive power (Q) = 64 MVAR and K
5
is negative. By increasing the value of K
A
the power
system tend to go to instability, Table (3.6) shows variation of power system damping torque
coefficient K
D
, Synchronizing torque coefficient K
S
, natural frequency, damping ratio and
damping frequency as the exciter gain K
A
increase in steps of 100 from the nominal value, and
Figure (3.8) shows the variation of rotor speed deviation response as the exciter gain K
A
increase
from the nominal value to 400.
Table (3.6): Results of Increasing the Gain K
A
of the Operating Point 3
K
A
50 150 250 350 450
K
S
1.3713 1.3641 1.3796 1.3893 1.3948
K
D
1.5129 0.2331 -0.2010 -0.2637 -0.2527
e
n
9.5309 9.5060 9.5599 9.5935 9.6126
, 0.0167 0.0026 -0.0022 -0.0029 -0.0028
e
D
9.5296 9.5060 9.5599 9.5934 9.6125

According to the table above, we can see that the value of K
D
and , became negative as K
A

increase which lead the system to instability

(3.41)

(3.42)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 55


Figure (3.8): The Effect of Increasing K
A
to 400 in Operating Point 3
Although that the system depends on the excitation constant K
A
for the stability case,
however, the time constant T
A
has a negligible effect on the stability of the system [10].
It is concluded from the above discussion that at certain operating points where constant K
5

is negative, the excitation system could lead the power system to instability at high values of
exciter gain K
A
, this is because at high values of exciter gain K
A
with K
5
being negative a
negative damping is introduced to the system which eventually lead the system to instability.
This is usually compensated for by the use of supplementary controlling signals from the Power
System Stabilizer (PSS) to produce positive damping. The design and implementation of Power
System Stabilizer based on microcontroller unit will conducted in part 2 of this project





0 2 4 6 8 10 12 14 16 18 20
-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
0.1
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



Exciter Gain 50
Exciter Gain 400
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 56

CHAPTER 4: POWER SYSTEM STABILIZER DESIGN
4.1. Introduction
Power System Stabilizer (PSS) is a device which provides additional supplementary
control loops to the automatic voltage regulators system (AVR). Power system stabilizers (PSS)
are often used as an effective means to add damping to the generator rotor oscillations. Adding
supplementary control loops to the generator AVR is one of the most common ways of enhancing
both dynamic and transient stability. To provide damping for the generator rotor oscillations, PSS
must produce a component of electrical torque in phase with rotor speed deviations.
The basic functions of the PSS is to add a stabilizing signal that compensates the
oscillations of the voltage error of the excitation system during the dynamic/transient state, and to
provide a damping component when its on phase with rotor speed deviation of machine. [1,
6,7,10]
4.2. SMIB Power System Model Including PSS
4.2.1 Modeling of PSS
The purpose of a PSS is to introduce a damping torque component in phase with the speed
deviation . PSS input signals can be derived from machine speed or power. Where PSS output
is connected to the input of the exciter.
A direct feedback of would result in a damping torque component if the exciter transfer
function K
a
and the generator transfer function between E
fd
and Te were pure gains as shown
in Figure (4.1). However, in practice both the generator and the exciter exhibit frequency
dependent gain and phase characteristic. Therefore, the G
PSS
(s) transfer function (given in
Equation 4.1), as shown in Figure (4.1) should have appropriate phase compensation circuits to
compensate for the phase lag between the exciter input and the electrical torque. In the ideal case,
with phase characteristic of PSS being an exact inverse of the exciter (AVR) and generator phase
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 57

characteristic to be compensated, the G
PSS
(s) would result in a pure damping torque at all
oscillation frequencies. [1, 6,7,10, 28]
If the phase-lead network provides more compensation than the phase lag between Te
and Vs, the PSS introduces, in addition to a damping component of torque, a negative
synchronizing torque component. Conversely, with under-compensation a positive synchronizing
torque component is introduced. Usually, the PSS is required to contribute to the damping of the
rotor oscillations over a range of frequencies, rather than a single frequency. [1, 6, 7, 10, 27, 28]
The Lead Lag PSS transfer function is given as,

(4.1)
4.2.2 SMIB Power System Block Diagram Model including PSS
The theoretical basis for a PSS may be illustrated with the aid of the block diagram shown
in Figure (4.1).
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 58

1
A
A
K
T s +
3
3
1 '
do
K
K T s +
2
K
'
q
E A
6
K
b
s
e
e A
4
K
e
T A
m
T A
1
K
D
5
K
ref
V A
t
V A
o A
fd
E A

1 +


1 +
1
1 +
2


PSS
AVR
1
2


Figure (4.1): Block Diagram of SMIB Power System Including PSS
Figure (4.2) shows the block diagram of the static excitation system, including AVR and
PSS. For small-signal stability study, stabilizer output limits and exciter output limits are not
considered so they are omitted in Figure (4.2).
As shown in Figure (4.2) the PSS block diagram representation is composed of three
blocks: a gain block, a signal washout block and phase compensation block.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 59

1 +


1 +
1
1 +
2


e A
1
A
A
K
T s +
ref
V A
t
V A
fd
E A
Gain Washout
Phase
Compensation
Power System Stabilizer

Figure (4.2): Block Diagram of the Excitation System (AVR) Including PSS
The stabilizer gain (K
PSS
) function is to determine the amount of damping introduced by
the PSS. [1, 6, 7, 10, 18, 21, 28]
The basic function of the washout block is to serve as a high-pass filter, also it allows the
PSS to respond only to changes in speed and it prevent the steady changes in speed to modify the
terminal voltage. From the viewpoint of the washout function, the value of T
w
is not critical and
may be in the range of 1 to 20 seconds. The main consideration is that it is long enough to pass
stabilizing signals at the frequencies of interest unchanged.
The function of the phase compensation block is to provides the appropriate phase-lead
characteristic to compensate for the phase lag between the exciter input and the generator
electrical (air-gap) torque. In Figure (4.2) a single first-order phase compensation block were
used to represent the phase compensation circuit. However, in practice two or more first-order
blocks may be used to achieve the desired phase compensation. In some cases, second-order
blocks with complex roots have been used. Normally, the frequency range is 0.1 to 2 Hz, and the
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 60

phase-lead network should provide compensation over this entire frequency range. The phase
characteristic to be compensated changes with system conditions; therefore, a compromise is
made and a characteristic acceptable for different conditions is selected. Generally some under-
compensation is desirable so that the PSS, in addition to significantly increasing the damping
torque, results in slight increase of the synchronizing torque. [1, 6, 7, 10, 21, 28]
4.2.3 State-Space Model of SMIB Power System Including PSS
In this section the SMIB with PSS power system state-space model will be derived using
the aid of static exciter with AVR and PSS block diagram which is shown in Figure (4.2).
Using exciter block in Figure (4.2),

(4.2)
and

(4.3)
Substituting Equation (4.3) in Equation (4.2),

(4.4)
Using Gain and Washout Blocks in Figure (4.2), and taking the output signal of the washout
block to be


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 61

(4.5)
and according to Figure (4.1),

(4.6)
and

(4.7)
Taking in Equation (4.6) and substituting Equation (4.7) in Equation (4.6)


(4.8)
Substituting Equation (4.8) in Equation (4.5)

(4.9)
Using phase compensation block in Figure (4.2),

(4.10)
Substituting Equation (4.9) in Equation (4.10)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 62


(4.11)
The overall state-space model of the power system (SMIB including PSS) [1] is


(4.12)


(4.13)
4.2.4 MATLAB/Simulink Model of SMIB Power System including PSS
MATLAB/Simulink was used to simulate the overall block diagram (SMIB with PSS) that
was shown in Figure (4.1). This MATLAB/Simulink model will be used to evaluate the dynamic
stability of the SMIB power system with PSS. Figure (4.3) shows MATLAB/Simulink model of
the SMIB with exciter power system.
The PSS input signal was taken from

, and the PSS output signal was introduced to


exciter input voltage as


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 63


Figure (4.3): MATLAB/Simulink Model of the SMIB with PSS Power System

D
e
l
t
a
-

V
t
D
e
l
t
a
-

E
q
'
D
e
l
t
a
-

E
f
d
D
e
l
t
a
-

T
e
D
e
l
t
a
-

T
s
D
e
l
t
a
-

T
d
D
e
l
t
a
-

d
e
l
t
a
D
e
l
t
a
-

O
m
e
g
a
D
e
l
t
a
-

V
s
K
4
k
4
d
e
l
t
a
-
d
e
l
t
a
d
e
l
t
a
-
V
t
d
e
l
t
a
-
T
e
T
w
.
s
T
w
.
s
+
1
W
a
s
h
o
u
t
K
A
T
A
.
s
+
1
V
o
l
t
a
g
e

R
e
g
u
l
a
t
o
r
-
E
x
c
i
t
e
r
V

r
e
f
D
e
l
t
a
_
V
t
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

V
t
)
D
e
l
t
a
_
T
e
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

T
e
)
t
T
o

W
o
r
k
s
p
a
c
e
(
T
i
m
e
)
D
e
l
t
a
_
d
e
l
t
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

d
e
l
t
a
)
D
e
l
t
a
_
O
m
e
g
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

O
m
e
g
a
)
T
1
.
s
+
1
T
2
.
s
+
1
S
t
a
g
e
1

P
h
a
s
e

C
o
m
p
(
2
.
*
H
)
s
1
R
o
t
a
t
i
n
g

M
a
s
s
K
p
s
s
P
S
S
-
G
a
i
n
D
e
l
t
a

O
m
e
g
a
D
e
l
t
a

-

T
m
K
D
D
a
m
p
i
n
g

T
o
r
q
u
e
C
o
f
f
i
e
c
e
n
t
-
K
D
K
6
C
o
n
s
t
a
n
t
-
k
6
K
5
C
o
n
s
t
a
n
t
-
k
5
K
2
C
o
n
s
t
a
n
t
-
k
2
K
1
C
o
n
s
t
a
n
t
-
k
1
0
C
l
o
c
k
W
b
B
a
s
e

F
r
e
q
1 s
K
3
(
K
3
.
*
T
D
P
)
s
+
1

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 64

4.3. Dynamic Stability Enhancement using PSS
In this section, stability enhancement of the SMIB power system is achieved by including
PSS in the system. The stability enhancement is evaluated by using the techniques that were
discussed in Chapter 3, namely the eigenvalues and damping torque. The results of using the two
techniques are verified using time-domain simulations. The following sections evaluates the
stability of the system at different operating points using these techniques.
4.3.1. Eigenvalues Technique
The eigenvalues technique is used to evaluate the dynamic stability of the system. The
eigenvalues of matrix A of the state-space equation given in Equation (4.12) is used in
evaluating the stability.
4.3.2. Damping Torque Technique
In this section, the damping torque expression is derived for the system with PSS. From the
block diagram of Figure (4.1),

due to PSS can be expressed as:


where
Moreover, it is known that


(4.14)


(4.15)

(4.16)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 65

Substituting (4.14)-(4.15) into (4.16) yields to:
Converting s to je yields to:
Hence the synchronizing and damping torques after simplifying will be:
The above expressions (4.19)-(4.20) are calculated for obtaining the synchronizing and damping
torques under the effect of the PSS only. In order to obtain the overall torques from the system,
these expressions should be added to the ones derived in Section 3.1.2 of the overall system
without the effect of PSS, as follows:


(4.17)


(4.18)


(4.19)


(4.20)


(4.21)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 66

where
4.3.3. Time Domain Simulation Technique
In this project, Simulink model shown in Figure (4.3), is used to simulate the time domain
response of SMIB with PSS power system that was discussed in Section (4.2).
4.4. Tuning of PSS Parameters
There are many ways to tune the PSS parameters such as root-locus, frequency-response,
and state-space design methods. In this project, the technique discussed in [1,27] is used to tune
the PSS parameters.
Typical values of the PSS parameters are:
-

is in the range of 0.1 to 50


-

is the lead time constant, 0.2 to 1.5 sec


-

is the lag time constant, 0.02 to 0.15 sec.


-

is the washout time constant and it is equal to 10 sec.


The desired stabilizer gain (

is obtained by first finding the gain at which the system


becomes unstable. This may be obtained be actual test or by root locus study. Then washout time
constant (

) is set at 10 sec. The purpose of this constant is to ensure that there is no steady-


(4.22)


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 67

state error of voltage reference due to speed deviation.

is then set at 1/3 of

*, where

* is the gain at which the system becomes unstable. Lead & lag time constants (T
1
and T
2
)
are set to values that is within the range.
In this project the PSS parameters [1] were chosen to be:
-

= 1.111
-

= 0.75 sec
-

= 0.075 sec
-

= 10 sec
4.5. Dynamic Stability Enhancement of SMIB Power System
Consider the Single-Machine Infinite Bus (SMIB) system having the parameters given in
section 3.2. The dynamic stability of this system is enhanced using PSS.
4.5.1. Eigenvalues of SMIB Power System with PSS
The following table shows the eigenvalues of the given system with PSS at nominal operating
point.
Table 4.1: System Eigenvalues at Nominal Operating Point
Nominal Operating
Point
P (136 MW)
Q (83.2 MVAR)

1
-18.7753

2,3

-0.9374 + j10.0523

4,5

-6.6175 + j3.4306

6

-0.1001
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 68

It is seen from the above table that all real parts of the eigenvalues are negative, which
proofs that the system is stable. Moreover, the damping of this operating point considering the
eigenvalue
2,3
(-0.9374 + j10.0523) is:
The damping ratio is positive and greater than the value without PSS ( ), which
indicates that the designed PSS has enhanced the stability of the system.
4.5.2. Damping Torque of SMIB Power System with PSS
In order to calculate the synchronizing and damping torques of the given SMIB power
system at the nominal operating point, Equation (4.18) is used. Substituting in this equation the
value of eigenvalue
4
as the complex frequency yields to:
It is known that
In per unit. Hence





(4.23)



Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 69

Substituting in Equation (4.23) yields to
Therefore,
The next step is to repeat the calculations made in section 3.2.2 for calculating


without PSS at the new obtained eigenvalue. Using Equation (3.15):

(4.24)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 70

where
Substituting (4.25) in (4.24), yields to
The torques are
Therefore the total synchronizing and damping torques with the PSS are equal to:
From the obtained results, it is clear that the effect of PSS has raised the value of K
D
and
K
S
, which has improved the stability of the system. By calculating also at the damping ratio and
damping frequency using Equations (3.27)-(3.29):



(4.25)

(4.26)






Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 71

It is noticed that the both damping ratio and damping frequency have increased, which also
improved the system stability. The following table summarize all values of torque coefficients,
damping ratio and damping frequency at nominal operating point including PSS in the system.
Table (4.2): Torque Coefficients, Damping Ratio & Damping Frequency at Nominal Operating
Point Including PSS

Nominal
Operating
Point
K
S
(p.u torque / rad)

1.5188
K
D
(p.u torque / rad)

8.7570
e
n
(rad/s) 10.0306
, 0.0925
e
D
(rad/s)

9.9890




Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 72

4.5.3. Time Domain Simulation of SMIB Power System with PSS
Time domain simulations have been obtained with PSS at the nominal operating point
under 1% change in

as shown in Figure (4.4).



Figure (4.4): Rotor Speed Deviation Response with & without PSS at nominal operating point
under change in

of 1%
From Figure (4.4) it is observed that the PSS has introduced a positive damping to the
power system, and this is obvious by looking at the settling time of the rotor speed response with
PSS it is much shorter than it without PSS.
0 1 2 3 4 5 6 7 8
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



With PSS
Without PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 73


Figure (4.5): Rotor Speed Deviation Response with &
without PSS at nominal operating point under change in

of 1%
Figure (4.6): Rotor Angle Deviation Response with &
without PSS at nominal operating point under change in

of 1%


Figure (4.7): Terminal Voltage Deviation Response
with & without PSS at nominal operating point under
change in

of 1%
Figure (4.8): PSS Stabilizing Signal at nominal
operating point under change in

of 1%
As observed in Figures (4.5)-(4.8), it is observed that the presence of the PSS has also
introduced damping to the rotor speed deviation response under different disturbance source
which is changing of the reference voltage (

= 1% ), moreover, it is observed that the rotor


0 1 2 3 4 5 6 7 8
-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



With PSS
Without PSS
0 1 2 3 4 5 6 7 8
0
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
Rotor Angle Deviation Response
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

A
n
g
l
e

(
p
.
u
)



With PSS
Without PSS
0 1 2 3 4 5 6 7 8
-1.5
-1
-0.5
0
0.5
1
x 10
-3
Terminal Voltage Deviation Response
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

T
e
r
m
i
n
a
l

V
o
l
t
a
g
e

(
p
.
u
)


With PSS
Without PSS
0 1 2 3 4 5 6 7 8
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-3
PSS Stabilizing Signal Voltage Deviation Response
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

P
S
S

S
t
a
b
i
l
i
z
i
n
g

S
i
g
n
a
l

V
o
l
t
a
g
e

(
p
.
u
)


PSS Stabilizing Sginal
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 74

angle of deviation response has also damped to a higher value faster than the response of the
power system without PSS and the same applies for the terminal voltage but it damped out to a
lower value. It is also observed that the PSS stabilizing signal goes to zero at the steady state, this
is because it only passes stabilizing signals only in the case of the disturbance.
4.6. Assessment of the Robustness of the Designed PSS
In this section, the robustness of the designed PSS is evaluated on the SMIB power system,
given in section (3.2), to test the effect of the designed PSS on the system at different operating
points using dynamic stability evaluation techniques. These operating points are given in Table
(4.3).
Table (4.3): Different Operating Points for PSS Evaluation
Operating point 1 Operating point 2 Operating point 3
P (MW) 144 112 168
Q (MVAR) 96 -32 64
As show in above table, at operating point 1 the generator is running at normal operating
conditions, but at operating point 2 the generator is absorbing reactive power and at operating
point 3 the generator is stressed or heavy loaded.
The following table shows the results of testing the operating points using the eigenvalues
technique.
Table (4.4): Testing Operating Points Using Eigenvalues Technique
Operating point 1
P (144 MW)
Q (96 MVAR)
Operating point 2
P (112 MW)
Q (-32 MVAR)
Operating point 3
P (168 MW)
Q (64 MVAR)

1

-18.7425 -21.0756 -19.5312

2,3
-0.8856 10.2037i -0.4095 9.2194i -0.8015 10.2853i

4

-6.6857 + 3.5047i -7.2586 -6.3654 + 3.0639i
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 75

5

-6.6857 3.5047i -4.7316 -6.3654 3.0639i

6

-0.1001 -0.1001 -0.1001
,
0.0868 0.0444 0.0777
From the above table, it is clear that all the eigenvalues, which are derived from the A
matrix of the state-space model, have negative real parts among the three operating points, and
the damping ratios are positive for the three cases. These results confirms that the system at each
operating point is stable.
After testing the system at different operating points using the eigenvalues technique, the
damping torque technique is then used to evaluate the stability of the system. Table (4.5) shows
the values of synchronizing and damping coefficients, damping ratios and damping frequencies at
the given three operating points.
Table (4.5): Torque Coefficients, Damping Ratios & Damping Frequencies at Three Operating
Points

Operating point 1
P (144 MW)
Q (96 MVAR)
Operating point 2
P (112 MW)
Q (-32 MVAR)
Operating point 3
P (168 MW)
Q (64 MVAR)
K
S
(p.u torque / rad)

1.5835 1.2856 1.6066
K
D
(p.u torque / rad)

8.3951 3.8822 7.5981
e
n

(rad/s)
10.2420 9.2285 10.3165
, 0.0865 0.0444 0.0777
e
D
(rad/s)
10.2037 9.2194 10.2853
The results in the above table were as expected. The values of damping coefficient K
D
and
damping ratio , are positive at all operating points, even at the unstable operating point which is
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 76

operating point 2. It is noticed that the damping ratios for the three operating points are equal to
the ones calculated for the eigenvalues technique.
Time domain simulation technique was also applied to test the robustness of the PSS by
observing the rotor speed deviation response of the SMIB with PSS power system at the three
different operating points. Figure (4.9) shows the rotor speed deviation response with & without
PSS at operating point 1.

Figure (4.9): Rotor Speed Deviation Response with & without PSS at Operating Point 1
From Figure (4.9) it is observed that the PSS has introduced a positive damping to the
power system, and this is obvious by looking at the settling time of the rotor speed deviation
response of the SMIB power system with PSS it is much shorter than it without PSS.
0 1 2 3 4 5 6 7 8
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



Without PSS
With PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 77

As shown in Figure (4.10) time domain simulation technique was also applied at operating
point 2 (discussed in section 3.3) at which the power system is unstable, to see the effect of PSS
in stabilizing the power system.

Figure (4.10): Rotor Speed Deviation Response with & without PSS at Unstable Operating Point
From Figure (4.10), it is observed that the PSS has introduced a positive damping to the
power system and it stabilized the system and this is obvious by looking at the rotor speed
deviation response with PSS.
Time domain simulation technique was applied on operating point 3, at which the
system is unstable at higher values of exciter gain, so to test the robustness of the PSS, rotor
speed deviation response of the SMIB with PSS power system were observed at 400 exciter gain
as shown in Figure (4.11).
0 1 2 3 4 5 6 7 8
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



With PSS
Without PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 78



Figure (4.11): Rotor Speed Deviation Response with & without PSS at Operating Point 3 with
Exciter Gain Equal to 400
From Figure (4.11), it is observed that the PSS has introduced a positive damping to the
power system and it stabilized the system even at higher values of exciter gain and this is obvious
by looking at the rotor speed deviation response with PSS.
After testing the robustness of the PSS, it is concluded that it plays an important role in
improving the systems stability. Not only it increasing the damping coefficient and damping
ratio of the unstable system, but also it enhances the behavior of the system at different operating
points, which ensures that the system by any means would not lead to instability. The third
technique, or the time-domain simulations technique, illustrated the simulations of the PSS at
0 1 2 3 4 5 6 7 8
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



With PSS
Without PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 79

different operating points, and showed that it enhanced and increased the damping of the system
which led it to stability.

















Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 80

CHAPTER 5: DESIGN OF MICROCONTROLLER BASED DIGITAL PSS
5.1. Digital Control
Nowadays, digital computers and microcontrollers are mostly used in control engineering
applications. Figure (5.1) illustrates an example of a typical computer controlled system. The
error signal in this system is analog, and an analog-to-digital (A/D) converter is used to convert
the signal and make it digital so that the computer can read it. The process of (A/D) conversion is
by sampling the input signal periodically and covert these samples into a digital code so that the
computer can process it. Then, the digital code is being run by a software for executing the given
actions in the code. [9, 30-32]
A/D
Digital Controller
(Computer)
D/A Plant
sensor
+
_
Input
Output

Figure (5.1): Typical Digital Control System
Converting the digital signal that comes from the computer into an analog signal is
normally done by using a digital-to-analog (D/A) converter. The operation of this converter is
usually approximated by zero-order hold transfer function.
The A/D and D/A converter circuits are built-in in many types of microcontrollers, so that
the microcontrollers can be connected directly to any analog signal or to the plant. In Figure
(5.1), the reference set point, sensor output and the plant (SMIB power system in this project)
input and output are all analog signals. In Figure (5.2) shows the block diagram of
microcontroller based digital control system. It is shown that microcontroller part includes built-
in A/D and D/A converters. [9, 30-32]
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 81

A/D Digital Controller D/A Plant
sensor
+
_
Input
Output
Microcontroller

Figure (5.2): Block Diagram of Microcontroller Based Digital Control System
5.2. What is a Microcontroller?
The microcontroller is considered as a self-contained computer system, which is designed
to have, in general, a microprocessor, memory and I/O connections in one small chip. This is
considered as an advantage where it doesnt need other specialized external components for its
applications, because all necessary circuits are already built-in it.
The microcontroller, when invented, was used to control machinery, which is different than
the microprocessor that was used as a replacement for the CPU in a mainframe. Some of the
earliest major applications of microcontrollers were the Epson dot matrix printer FX-80, which
was built around the 8048 microcontroller where it brought low-cost printers to the marketplace,
and the IBM personal computers keyboard, which contained a universal peripheral interface
(UPI) that appeared in 1977 as a microcontroller. This microcontroller was used to read
keystrokes from the computers keyboard. [17, 29, 31, 34]
Assembly language is the traditional language that was used to program the
microcontrollers. Today, the microcontrollers are programmed using high-level languages such
as BASIC, PASCAL or C language, which present numerous advantages that are summarized as
follows:
- Easier to develop programs using a high-level language.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 82

- Maintenance of programs is easier
- Testing programs is much easier.
- More user-friendly and less prone for making errors.
- Documenting programs is much easier.
Although of the several advantages of the high-level languages, however it has some
disadvantages. The memory usually has larger code length than the code length of the assembly,
and the programs developed using the high-level languages usually run slower than those
developed using assembly. In this project, the microcontroller type PIC184520 is used as a
digital controller, and it is programmed using high-level C language, and a comparison between
PIC microcontroller families is found in Appendix A. [17, 29, 31, 34]
5.3. Architecture & Specifications of PIC18 Family
The PIC microcontroller is drawn as a single block in the PIC-based system, because, as
discussed earlier, it contains the memory and I/O pins for most its applications. However,
additional memory or I/O capabilities can be connected to the microcontroller, but usually the
ones provided on the PIC is sufficiently enough for most applications.
The PIC18 microcontroller has different versions or packages that depends upon its
manufacturing and the number of pins. Some of these packages are PDIP (Plastic Dual Inline
Package), SOIC (Small Outline Integrated Circuit), PLCC (Plastic Leadless Chip Carrier), and
SSOP (Small Shrink Outline Package). The number of pins ranges from 18 to 128 pins, which
varies among the different packages. I/O pins in PDIP packages are limited to ports A and B in
18-pin versions, port A, B, and C in 28-pin versions, and port A,B,C,D, and E in 40-pin versions.
In all types of microcontrollers, the power supply connections are VDD for connection to a
nominal +5.0 V power supply, and VSS for connection to ground. The maximum allowable
supple voltage can reach to +7.5 V. Generally, the amount of power supply current ranges from
60 A to 12 mA. In addition, the clocking frequency affects the amount of power supply current,
which means that a 31-KHz clock results in 60 A current, while a 40-MHz clock or higher ends
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 83

up with 12 mA current. The maximum total allowable chip current is 200 mA, and the maximum
pin current is 25 mA per pin as long as 200 mA is not exceeded for the entire chip. [17,28,34]
5.4. Specifications of Microcontroller PIC18F4520
- Instruction set of 75 instructions
- Operating frequency DC 40 MHz
- Four Crystal modes, up to 40 MHz
o Two External RC modes, up to 4 MHz
o Two External Clock modes, up to 40 MHz
o 8 user selectable frequencies, from 31 kHz to 8 MHz
- Fail-Safe Clock Monitor
o Allows for safe shutdown if peripheral clock stops
- Power supply voltage 2.0-5.5V
o Timer1 oscillation: 1.8uA (2.0 V, 32 KHz), down to 5.8 uA (Idle mode), down to 0.1 uA
(Sleep mode)
- Programmable high/low-voltage detect
- Programmable Brown-out Reset
o With software enable option
- 36 input/output pins
- 256 bytes EEPROM memory
o With 1,000,000 erase/write cycle data EEPROM memory typical
- 1536 bytes RAM memory
- A/D converter:
o 13-channels, 10-bit resolution
- Enhanced USART module
o Supports RS-485, RS-232 and LIN 1.2
o RS-232 operation using internal oscillator block
o Auto-Baud Detect
- Master Synchronous Serial Port (MSSP)
o Supports SPI and I
2
C mode
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 84

The datasheet of the used microcontroller is presented in Appendix B
5.5. Microcontrollers Basic Circuit
As shown in Figure (5.3), in order to enable the microcontroller to operate properly it is
necessary to provide:
- Power Supply
- Reset Signal
- Clock Signal

Figure (5.3): Microcontroller Basic Circuit [29]


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 85

POWER SUPPLY
The power supply circuit is composed of AC or DC (6-12V) power supply input along with
full bridge rectified to convert AC to DC and then LM7805 is used to provides high-quality
voltage stability and quite enough current (up to 1A) to enable the microcontroller and peripheral
electronics to operate normally. [17, 29, 34]
RESET SIGNAL
In order that the microcontroller can operate properly, a logic one (VCC) must be applied
on the reset pin. The push button connecting the reset pin MCLR to GND is not necessary.
However, it is almost always provided because it enables the microcontroller to return safely to
normal operating conditions if something goes wrong. By pushing this button, 0V is brought to
the pin, the microcontroller is reset and the program execution starts from the beginning. A10K
resistor is used to allow 0V to be applied to the MCLR pin, via the push button, without shorting
the 5VDCrail to earth. [17, 29, 34]
CLOCK SIGNAL
Even though the microcontroller has a built-in oscillator, it cannot operate without external
components which stabilize its operation and determine its frequency (operating speed of the
microcontroller). Depending on elements in use as well as their frequencies, the oscillator can be
run in four different modes:
- LP Low Power Crystal
- XT Crystal / Resonator
- HS High Speed Crystal / Resonator
- RC Resistor / Capacitor
QUARTZ CRYSTAL
In this project, the quartz crystal was used for frequency stabilization. the advantage of
using quartz crystal is that it ensures the built-in oscillator to operate at a precise frequency which
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 86

is not affected by changes in temperature and power supply voltage. This frequency is usually
labeled on the crystal casing.
Apart from the crystal, capacitors C1 and C2 must also be connected as shown in Figure
(5.4). Their capacitance is not of great importance. Therefore, the values provided in the table
shown in Figure (5.4) below should be considered as a recommendation, not as a strict rule. [17,
29, 34]

Figure (5.4): Quartz Crystal Circuit Configuration [29]
5.6. Serial Communication USART
The Universal Synchronous/Asynchronous Receiver/Transmitter (USART), or it is also
known as Serial Communications Interface (SCI), transmits and receives synchronous or
asynchronous serial data using interrupts during normal operation. It contains all clock
generators, shift registers and data buffers necessary to perform an input/output serial data
transfer independently of the device program execution. Synchronous data are sent with a clock
pulse for synchronization, where asynchronous data are sent without clock pulse. Moreover, there
are three modes of sending serial data, which are Simplex, Half-Duplex and Full-Duplex.
Basically, Simplex mode is transmitting data in one direction, Half-Duplex mode is transmitting
or receiving information but in only one direction at a time, and Full-Duplex mode transmits and
receives information simultaneously. [17, 29, 34]
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 87

Most data today are asynchronous data. It usually has a size of 10 bits, which starts with a
start bit and ends with at least one stop bit, where data in between these bits are usually eight bits,
with the least significant bit sent first. Bit rate, or often called baud rate, should be determined so
that data are received successfully. For instance, if data are transmitted at 19200 bps (bits per
second), then 1920 characters or bytes are transmitted per second because each character is 10 bit
times. Therefore the bit rate is 1/19200 or 52.08 s per bit, and the data rate is 1920 Bps (Bytes
per second). [17, 29, 34]
Synchronous data are not very common today. Unlike the asynchronous data, the
synchronous data does not contain any start or stop pulse, where instead it is using 10 bit times
for a byte and only 8 bit times are used per byte. As a result, it takes less time to transmit
information than the asynchronous data. Synchronous data are normally transmitted in packets
containing fixed number of bytes, which includes bytes that indicates the start and end of the
packet. [17, 29, 34]
As discussed earlier, the asynchronous mode does not use the clock signal, because it
transmits and receives data using a standard non-return-to-zero (NRZ) format. The following
Figure (5.5) illustrates the transformation of data in the asynchronous mode.

Figure (5.5): Data Transformation in Asynchronous Mode [34]
As it is shown in the figure, each data is transferred in the following mechanism:
Data line has a logic one (1) during the idle state;
Transmission of a data starts with a logic zero (0);
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 88

Data is transmitted through an 8-bit wide;
Data is received at centre of each bit time;
Transmission of a data end with a logic one (1).
The bit rate of the serial data is calculated using a programmable baud rate generator in the
USART. This generator is programmed by loading a value n in a register called SPBRG, which
divides the system clock by the number loaded into the register. Three equations are used for
calculating the baud rate of synchronous and asynchronous data as follows:
Asynchronous baud rate at low speed:


(5.1)
Asynchronous baud rate at high speed:


(5.2)
Synchronous baud rate:


(5.3)
where F
osc
is the clock frequency. Usually, the default baud rate of serial interface operating
asynchronously on PC with 8 data bits is at 9600 bps. As shown in Figure (5.6), the USART uses
on some of the PIC18 family microcontrollers two pins for transmitting and receiving data, which
are RC6 (transmitter TX) and RC7 (receiver RX), where other pins are used for transmitting and
receiving in other family members. Logic levels in the standard RS-232C are defined as logic
zero at 3 V to 25 V and logic one at -3 V and -25 V. [17, 29, 34]
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 89


Figure (5.6): Serial UART (RS-232) Communication Circuit [29]
5.7. Design Constraints
5.7.1. Microcontroller Constraints
The microcontroller normal operation temperature capacity should be high, so a
PIC18F4520 have been selected that have normal operation temperature capacity of 85
o
.
5.7.2. Serial USART Constraints
Microcontroller voltage level is 5 V which is different from the computer voltage level so
MAX232 chip was used to shift the voltage level of the microcontroller to a level of voltage that
the computer understands

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 90

5.8. Digital Domain of the Power System Stabilizer
The input signal to the microcontroller is the sampled signal of the deviation in rotor speed
which comes from the MATLAB. The MATLAB/Simulink model is shown in Figure (4.3).
Since the PSS transfer function is in the frequency domain so it needs to be converted to digital
domain. Bilinear Transformation (Tustin Transformation) will be used to transfer the PSS
transfer function from the s domain to z domain.
Before doing the transformation, the region of stability should be determined first using the
Laplace transform of a discrete-time (digital domain) system, which is:

(5.4)
where T is the sampling period. It is known that the region of stability on the s-plane is in
the left half of it, therefore the region of stability on the z-domain is evaluated using the
definition by letting s in Equation (5.4) equals to :

(5.5)

(5.6)
When mapping each point in the s-plane into the z-plane, three different cases are faced.
The first case is when o is positive or in the right half of the s-plane. From Equation (5.6), the
magnitudes of the mapped points are

. Therefore, the points in the right half of the s-


plane are mapped outside the unit circle of the z-plane.
By looking at the second case where the points are mapped on the je-axis, the points have
zero values of o which yield to points on the z-plane with magnitudes equal to 1, the unit circle.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 91

Therefore the points that exists on the je-axis of the s-plane are mapped into points on the unit
circle of the z-plane.
The third case is where the points are on the left half of the s-plane. This case yields to
negative values of o, which are inturns mapped into the inside of the unit circle of the z-plane.
We conclude from these cases that a digital control system is: Stable if all poles of the closed-
loop transfer function are inside the unit circle of the z-plane, Unstable if at least one pole is
outside the unit circle, and Marginally stable if at least one pole are on the unit circle and all
other poles are inside the unit circle. [9, 30-32]
After determining the region of stability in the z-domain, the transformation from s-domain
to z-domain is obtained as follows:
Using Equation (5.4):



(5.7)
Writing Equation (5.7) in terms of z yields to:



(5.8)
The PSS loop includes two transfer functions multiplied by a gain which is K
PSS
, as it is
shown in Figure (4.2). Transforming the Phase Compensator transfer function to the z-domain
gives:
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 92





(5.9)
where a = T
1
and b = T
2
. Simplifying the equation:

(5.10)
where

, and

. Multiplying by


gives:

(5.11)
Now transforming the washout transfer function and letting T
w
= c:
















Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 93


(5.12)
where

, and

. Multiplying Equation (5.11) by (5.12) then by


the gain K
PSS
to get the open-loop transfer function:


Multiplying both sides by

gives:

(5.13)
And after substituting Equation (5.13) by

(5.14)
From Equation (5.14):


(5.15)
It should be noted that when multiplying y[n] or x[n] by z
-m
it becomes y[n-m] or x[n-m].
Therefore after solving for y[n], Equation (5.15) becomes:
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 94




(5.16)

Equation (5.16) is the digital PSS difference Equation (Function), which can be converted
to C language code and then used in a for loop to perform the function of the digital PSS.
The selection of the sampling time is the key for matching the s-domain PSS to the z-
domain PSS frequency response. According to the literature [35], Astrom and Wittenmart (1984)
have developed a guideline for selecting the sampling interval. According to them the value of T
in seconds should be in the range of 0.15/

to 0.5/

, where

is the zero dB frequency


(rad/s) of the magnitude frequency response curve for the cascaded analog compensator. [9, 30
32, 35]
Bode plot should be drawn in order to determine the zero dB frequency of the cascaded
connection between the PSS and the SMIB power system. The following steps shows how
MATLAB can be used as a tool to get the open-loop of the system using the Simulink.
- The output and the input of the SMIB power system have been identified, using output port
y and input port u as shown in Figure (5.7) (highlighted in blue), and then it should be
saved as Simulink file (in this project it was saved as under the name Open_Loop)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 95


Figure (5.7): SMIB Power System Simulink Model Input & Output Ports Highlighted
D
e
l
t
a
-

V
t
D
e
l
t
a
-

E
q
'
D
e
l
t
a
-

E
f
d
D
e
l
t
a
-

T
e
D
e
l
t
a
-

T
s
D
e
l
t
a
-

T
d
D
e
l
t
a
-

d
e
l
t
a
D
e
l
t
a
-

O
m
e
g
a
y 1
k
4 K
4
d
e
l
t
a
-
d
e
l
t
a
d
e
l
t
a
-
V
t
d
e
l
t
a
-
T
e
V
o
l
t
a
g
e

R
e
g
u
l
a
t
o
r
-
E
x
c
i
t
e
r
K
A
T
A
.
s
+
1
V

r
e
f
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

V
t
)
D
e
l
t
a
_
V
t
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

T
e
)
D
e
l
t
a
_
T
e
T
o

W
o
r
k
s
p
a
c
e
(
T
i
m
e
)
t
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

d
e
l
t
a
)
D
e
l
t
a
_
d
e
l
t
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

O
m
e
g
a
)
D
e
l
t
a
_
O
m
e
g
a
R
o
t
a
t
i
n
g

M
a
s
s
(
2
.
*
H
)
s
1
D
e
l
t
a

O
m
e
g
a
D
e
l
t
a

-

T
m
D
a
m
p
i
n
g

T
o
r
q
u
e
C
o
f
f
i
e
c
e
n
t
-
K
D
K
D
C
o
n
s
t
a
n
t
-
k
6
K
6
C
o
n
s
t
a
n
t
-
k
5
K
5
C
o
n
s
t
a
n
t
-
k
2
K
2
C
o
n
s
t
a
n
t
-
k
1
K
1
C
l
o
c
k
0
B
a
s
e

F
r
e
q
W
b
1 s
K
3
(
K
3
.
*
T
D
P
)
s
+
1
u 1
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 96

- The SMIB power system open loop transfer function has been computed at nominal operating
point using the following MATLAB code.

[A,B,C,D]=linmod('Open_Loop'); % Obtains state-space linear models from
Simulink model
[num_o,den_o]=ss2tf(A,B,C,D); % to get the transfer function from the state-
space model.

The open-loop transfer function of the SMIB power system is computed as



(5.17)
While the PSS open loop transfer function can be computed as


(5.18)


(5.19)
So the overall open-loop transfer function of the cascaded connection between the PSS and the
SMIB power system

(5.20)


(5.21)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 97

- The plotting of the cascaded open-loop connection between PSS and SMIB power system is
done using the following MATLAB code.

>> num_ov = [(-5.92057.*10^-14) (1.26307.*10^-12) (-366.748) (-488.998) (-
6.06273.*10^-11) 0];
>> den_ov = [(0.75) (25.4888) (352.035) (3324.89) (24583.3) (82216.4)
(7979.1)];
>> sys = tf(num_ov,den_ov); % to create a system model out of the transfer
function numerator and denominator
>> bodeplot(sys) % to plot the bode plot of the system

The bode plot of the cascaded open-loop connection between PSS and SMIB power system
is shown in Figure (5.8).

Figure (5.8): Bode plot of the Cascaded Open-Loop between PSS & SMIB Power System
10
-3
10
-2
10
-1
10
0
10
1
10
2
10
3
270
360
450
540
630
720
P
h
a
s
e

(
d
e
g
)
Bode
Diagram
Frequency (rad/sec)
-160
-140
-120
-100
-80
-60
-40
-20
0
20
System: sys
Frequency (rad/sec): 8.73
Magnitude (dB): 0.0009
M
a
g
n
i
t
u
d
e

(
d
B
)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 98

According the bode plot in Figure (5.8), it is observed the zero dB frequency

is
approximately equal to 8.73 rad/s, so the limits of the sampling interval are


and

, so the sampling frequency should between 17.45 Hz and 58.21 Hz.


As mentioned earlier that the sampling frequency or the sampling time is the key for
matching the s-domain PSS to the z-domain PSS frequency response, since the range of sampling
frequency has been determined it is important to see the effect of sampling frequency on the
frequency response of the system and to choose the best sampling frequency based on closest
frequency response of digital PSS to the s-domain PSS frequency response.
Figure (5.9) shows the effect of sampling frequency on the frequency response of the
digital PSS, it is observed that as the sampling frequency increases in the range of the sampling
frequency mentioned above, the frequency response of the digital filter gets closer to the s-
domain filter.

Figure (5.9): Effect of Sampling Frequency on the Frequency Response of the Digital PSS
0 20 40 60 80 100 120 140 160 180
0
2
4
6
8
10
12
frequency (Hz)
m
a
g
n
i
t
u
d
e


0 20 40 60 80 100 120 140 160 180
0
0.2
0.4
0.6
0.8
1
frequency (Hz)
a
n
g
l
e

(
r
a
d
)


z-domain at 25 Hz
z-domain at 35 Hz
z-domain at 45 Hz
z-domain at 55 Hz
s-domain
z-domain at 25 Hz
z-domain at 35 Hz
z-domain at 45 Hz
z-domain at 55 Hz
s-domain
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 99

In our project the sampling frequency f
s
have been selected as 55 Hz, and this is because at
this sampling frequency, the digital PSS has the closest frequency response the s-domain PSS.
In order to convert the digital PSS transfer function into C-code which can be implemented
in microcontroller to perform the digital PSS transfer function, the selected sampling time, which
is T=

= =0.01818 sec, should be substituted in the difference equation (Equation


5.16) as shown in Equation 5.22


(5.22)
This difference function can be transformed into the following C code,

y = 10.0199*x - 19.7998*xn1 + 9.7799*xn2 + 1.7820*yn1 - 0.7824*yn2;
xn2 = xn1;
xn1 = x;
yn2 = yn1;
yn1 = y;

Where x is x[n] , xn1 is x[n-1] , and xn2 is x[n-2] and same applies for y variable. This code can
be implemented on microcontroller using C language programming.
5.9. s-domain to z-domain (Digital Domain) Transformation Steps in
MATLAB
In order to transfer the PSS transfer function from s-domain to z-domain in MATLAB, the
following steps should be followed.
1- The PSS transfer function of Equation (4.1) should be rewritten as


(5.23)
Two variables are defined as num and den as shown below,
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 100


Num = Kpss.*[(T1.*Tw) (Tw) 0];
Den = [(T2.*Tw) (T2+Tw) 1];

2- Specifying the sampling frequency as

for the bilinear transformation.


3- The nominator numd and denominator dend coefficients of the digital PSS transfer
function (z-domain) can be formed using:

[numd,dend] = bilinear(num,den,55); % to convert the s-domain transfer
function to z-domain transfer function with sampling frequency of 55
Hz

The digital domain of the PSS transfer function is now specified by the numd and
dend obtained from step 3. Before going a further step in the implementation, the stability of
the digital transfer function needs to be checked. This is done using a MATLAB simple
command or function isstable( ). this function take the structure of the digital filter, numerator
and denominator and it checks the poles of the digital transfer function if they are inside the unit
circle or not. It returns the value 1 if the filter is stable or 0 if the filter is not stable.
The last step is to check the frequency response of the s-domain transfer function and z-
domain digital transfer function. Using freqs( ) function in MATLAB to get the frequency
response of the s-domain transfer function and freqz( ) to get the frequency response of the z-
domain transfer function.
In order to check correctness of the designed Digital PSS (shown in the previous section)
we will apply the steps mentioned above to the designed s-domain PSS mentioned in the previous
chapter.
Using the PSS parameters which is mentioned in Section 4.4:


(5.24)
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 101


Applying Equation (5.24) it in MATLAB m-file to transfer it to z-domain as shown below:


%PSS Parameters
Kpss = 1.111;
Tw = 10;
T1 = 0.75;
T2 = 0.075;

Num = Kpss.*[(T1.*Tw) (Tw) 0];
Den = [(T2.*Tw) (T2+Tw) 1];

[numd,dend] = bilinear(num,den,55)

numd

dend


The output on the MATLAB work space is


>> numd

numd =

10.0199 -19.7998 9.7799

>> dend

dend =

1.0000 -1.7820 0.7824

The above result confirms the digital PSS transfer function parameters calculation
mentioned in the previous section. Now to check the stability of the designed PSS, the following
MATLAB code is applied.


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 102


Hd = dfilt.df2(numd,dend); % returns a discrete-time filter with a
STRUCTURE of type Direct-form II
isstable(Hd) % ISSTABLE(Hd) returns 1 if filter Hd is stable, and 0
otherwise

The output on the MATLAB work space is

>> isstable(Hd) % to check if the system is stable or not.
ans =

1

So this confirms the stability of the designed digital PSS.
In order to plot the frequency response of the designed digital PSS and compare it to the
designed s-domain PSS, the following MATLAB code is applied.


s = tf(num,den); % to create an s-domain transfer func. Model (obj) to
the designed PSS
x = 1:1:180;
y = freqs(num,den,x); % to plot the s-domain frequency response of the
s-domain PSS.
[h,w] = freqz(numd,dend,55); % to plot the z-domain frequency response
of the s-domain PSS.
subplot(2,1,1)
plot(w*(180/pi),abs(h),x,abs(y),':r')
xlabel('frequency (Hz)');
ylabel('magnitude');
grid;
legend('z-domain','s-domain','Location','NorthEast');
subplot(2,1,2)
plot(w*(180/pi),angle(h),x,angle(y),':r')
xlabel('frequency (Hz)');
ylabel('angle (rad)');
grid;
legend('z-domain','s-domain','NorthWest');


Figure (5.10) shows the frequency response of the designed digital PSS compared to the s-
domain PSS.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 103



Figure (5.10): Comparison between the Frequency Response of the Designed Digital (z-domain)
PSS and the Response of the s-domain PSS

As shown in Figure (5.10), the designed Digital PSS frequency response is almost identical
to the frequency response of the s-domain designed PSS, which proves the effectiveness of the
designed digital PSS.
5.10. Simulation of Digital PSS using Simulink
In order to simulate the designed digital PSS, a digital filter block in Simulink is used to
implement the z-domain transfer function with the numerator numd and denominator dend
obtained from the bilinear transformation, as shown in Figure (5.11).
0 20 40 60 80 100 120 140 160 180
0
5
10
15
frequency (Hz)
m
a
g
n
i
t
u
d
e


z-domain
s-domain
0 20 40 60 80 100 120 140 160 180
0
0.5
1
frequency (Hz)
a
n
g
l
e

(
r
a
d
)


z-domain
s-domain
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 104



Figure (5.11): MATLAB/Simulink Model of the SMIB Power System Including Simulated
Digital (z-domain) PSS Power System
D
e
l
t
a
-

V
t
D
e
l
t
a
-

E
q
'
D
e
l
t
a
-

E
f
d
D
e
l
t
a
-

T
e
D
e
l
t
a
-

T
s
D
e
l
t
a
-

T
d
D
e
l
t
a
-

d
e
l
t
a
D
e
l
t
a
-

O
m
e
g
a
D
e
l
t
a
-

V
s
k
4 K
4
d
e
l
t
a
-
d
e
l
t
a
d
e
l
t
a
-
V
t
d
e
l
t
a
-
T
e
Z
e
r
o
-
O
r
d
e
r
H
o
l
d
V
o
l
t
a
g
e

R
e
g
u
l
a
t
o
r
-
E
x
c
i
t
e
r
K
A
T
A
.
s
+
1
V

r
e
f
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

V
t
)
D
e
l
t
a
_
V
t
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

T
e
)
D
e
l
t
a
_
T
e
T
o

W
o
r
k
s
p
a
c
e
(
T
i
m
e
)
t
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

d
e
l
t
a
)
D
e
l
t
a
_
d
e
l
t
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

O
m
e
g
a
)
D
e
l
t
a
_
O
m
e
g
a
R
o
t
a
t
i
n
g

M
a
s
s
(
2
.
*
H
)
s
1
D
i
g
i
t
a
l

F
i
l
t
e
r
D
F
I
L
T
:
H
d
D
e
l
t
a

O
m
e
g
a
D
e
l
t
a

-

T
m
D
a
m
p
i
n
g

T
o
r
q
u
e
C
o
f
f
i
e
c
e
n
t
-
K
D
K
D
C
o
n
s
t
a
n
t
-
k
6
K
6
C
o
n
s
t
a
n
t
-
k
5
K
5
C
o
n
s
t
a
n
t
-
k
2
K
2
C
o
n
s
t
a
n
t
-
k
1
K
1
C
l
o
c
k
0
B
a
s
e

F
r
e
q
W
b
1 s
K
3
(
K
3
.
*
T
D
P
)
s
+
1
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 105

The output response of the system model with the digital filter gives the same response
obtained from the s-domain transfer function with a slight mismatch due to bilinear
transformation as shown in Figure (5.12).

Figure (5.12): Rotor Speed Deviation Response Comparison of Digital (Simulated) PSS & s-
domain PSS at Nominal Operating Point Under Change in

of 1%

It is observed in Figure (5.12) that there is a high level of agreement between the digital
(simulated) PSS and s-domain PSS SMIB power system rotor speed deviation responses.


0 1 2 3 4 5 6 7 8
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



z-domain Simulated PSS
s-domain PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 106

5.11. MATLAB and Microcontroller Interfacing
The interfacing between the MATLAB and the microcontroller is done using serial
communication. It is performed using serial COM port1 in the computer and TX (RC6) and RX
(RC7) pins in the microcontroller. Because of the difference in the voltage level between the
microcontroller and the computer, MAX232 is used to match the voltage level between the
microcontroller (0 5V) and the computer (-10 10V). The overall system is represented in
Figure (5.13).

Figure (5.13): MATLAB (Laptop) & PIC18F4520 Microcontroller Interfacing Circuit [29]

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 107

5.11.1 Microcontroller Programming
There are many programming languages that could be used to program the microcontroller
such as C, basic and assembly. In this project C language has been used to program the
microcontroller, and it has been chosen because of the advantage of these languages which is the
simplicity of program writing. In this project the microcontroller C code had two main functions,
first function is microcontroller interfacing with MATLAB/Simulink and the other function it
acts as digital PSS that will give the same response as time domain PSS which was simulated in
Chapter 4.
Figure (5.14) shows the microcontroller code flow chart, while the C code of the
microcontroller is shown below the figure.

Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 108

Start
Variable Declaration
float m;
float xn1=0.0;
float xn2=0.0;
float yn1=0.0;
float yn2=0.0;
float y;
int i;
int j;
float rec;
char txt[25];
char txt2[25];
char *res;
Beginning of Main
Function
Void Main ()
ADCON1 = 0x07; // Configure AN pins as digital
CCP1CON = 0x00; // Disable Comparator 1
CCP2CON = 0x00; // Disable Comparator 2
for(i=0;i<25;i++)
txt[i]="\0"; //clear txt array (fill with null character)
txt2[i]="\0"; //clear txt2 array (fill with null character)
i = 25
No
Yes
UART1_Init(19200); // Initialize UART module at 19200 bps
Delay_ms(500); // Wait for UART module to stabilize
i= 0;
While (1)
if (UART1_Data_Ready()==1)
//if the microcontroller received data
UART1_Read_Text(txt, "\r", 255);
//Read the Data from UART Module 1 and save it
into txt string array
m=atof(txt); //convert txt from string to float
Digital PSS Difference Function Code
y=10.0199*m-
19.7998*xn1+9.7799*xn2+1.7820*yn1-
0.7824*yn2;
xn2=xn1;
xn1=m;
yn2=yn1;
yn1=y;
FloatToStr(y,txt2);
//convert (y) to string (txt2) array
Yes
No
res = strcat(txt2, "\r");
//add \r terminator to (txt2) array and save it in
(res) variable
UART1_Write_Text(res);
//Send the Data from UART Module 1 to Laptop
(Simulink)
for(i=0;i<25;i++)
txt[i]="\0"; //clear txt array (fill with null character)
txt2[i]="\0"; //clear txt2 array (fill with null character)
i = 25
No
Yes

Figure (5.14): Microcontroller C-Code Flowchart




Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 109

// Declaration of variables
float m;
float xn1 = 0.0;
float xn2 = 0.0;
float yn1 = 0.0;
float yn2 = 0.0;
float y;

int i;
int j;
float rec;
char txt[25];
char txt2[25];
char *res;


void main() {
ADCON1 = 0x07; // Configure AN pins as digital
CCP1CON = 0x00; // Disable comparator module 1
CCP2CON = 0x00; // Disable comparator module 2

for(i=0;i<25;i++) // Clear string arrays (txt) & (txt2)
{
txt[i]="\0";
txt2[i]="\0";
}

UART1_Init(19200); // Initialize UART module at 19200 bps
Delay_ms(500); // Wait for UART module to stabilize
i=0;

while (1)
{
if (UART1_Data_Ready()==1) // If data is present on the receive buffer
{
UART1_Read_Text(txt, "\r", 255); // read data until terminator \r if found
//=======================================
// Beginning Digital PSS Code
//=======================================
m = atof(txt); // Convert and save txt string array of received data to float
variable m

y = 10.0199*m-19.7998*xn1+9.7799*xn2+1.7820*yn1-0.7824*yn2;
xn2 = xn1;
xn1 = m;
yn2 = yn1;
yn1 = y;

FloatToStr(y,txt2); // Convert y float PSS output data to string array txt2
//=======================================
// End of Calculations
//=======================================
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 110

res = strcat(txt2, "\r"); // Add terminator \r at the end of the PSS string output
data and save it in variable res

UART1_Write_Text(res); // send res to the MATLAB in a form of string array


}
for(i=0;i<25;i++) // Clear string arrays (txt) & (txt2)
{
txt[i]="\0";
txt2[i]="\0";
}
}
}

In this project, MikroC Pro have been used for coding the microcontroller using C
language, the advantage of this compiler it provides a library of commands or functions that is
easy to use, and it facilitates the coding of microcontroller interaction with other system
peripherals (i.e UART module, Analogue to digital converter, LCD, etc).
First of all we started our code by configuring some PIC18F4520 microcontroller special
function registers (SFRS), ADCON1 = 0x07 was used to configure AN pins to digital since serial
communication is based on digital communication, also the comparator modules have been
disabled using CCP1CON = 0x00 and CCP2CON = 0x00 commands.
As shown in the above code to interface with MATLAB/Simulink one UART (UART1)
module has been used, and UART1_Init(19200) command was used to initializes hardware
UART1 module with the desired baud rate which is 19200 bps. Then UART1_Data_Ready()
was used to test if data in receive buffer is ready for reading. After that UART1_Read_Text(txt,
"\r", 255) was used to read characters received via UART until the \r terminator is detected.
The read sequence is stored in the string array (txt), where 255 parameter is to allow the
microprocessor keeps searching for \r terminator continuously.
UART1_Write_Text(res) was used to sends string (res) via UART to
MATLAB/Simulink, where (res) is the string array that contains the result of Digital PSS
difference function ended by \r terminator.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 111

Digital PSS difference function has been applied in the microcontroller C code using
normal multiplication and addition mathematical operations, besides some of the C commands
has been used such as atof(txt) to convert the received data from string type to float type,
moreover FloatToStr(y,txt2) has been used to convert the float output of the digital PSS
difference function (y) to (txt2) string array, which will be sent back to the MATLAB/Simulink.
5.11.2 Simulink Model of the SMIB Power System with MCU PSS
To communicate between MATLAB and the microcontroller via the serial port it is
necessary to create a serial port object (which is named scom) in MATLAB and specify the
port properties as in the microcontroller, Baud Rate, Data Bit, Parity Bit, stop bit and Hand-
Shaking. Then the serial port is opened using fopen(serial object) function. Consequently, the
communication channel is opened and ready to send and receive data. fprintf ( ) and fscanf( )
functions are used to send and receive data respectively. Since the microcontroller sends data as
strings, so the function srt2num( ) is used to convert the received string to number. Finally, the
serial port is closed using fclose(serial object) function.
The serial communications used in the interfacing has the flowing characteristics:
- Data bit: 8-bit
- Baud rate: 19200 bps
- Parity: none
- Stop Bit: 1
- Handshaking: none
In this project, a MATLAB function (shown in the code block below) has been written that
is used as MATLAB function block in the Simulink model that will act as digital PSS in the
simulated SMIB power system. The main role of this MATLAB function is:
1- Defining a serial port object;
2- Opening the serial port;
3- Converting data to string format;
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 112

4- Sending the data to the digital PSS (microcontroller);
5- Receiving the data from the digital PSS (microcontroller);
6- Converting the data from string type to numbers.

function y = ssr(u)
scom=serial('COM1','BaudRate',19200,'DataBits',8,'Timeout',30,'Terminator',13);
%define a serial communication object
fopen(scom); % Open the serial port

s = num2str(u, '%1.10f');
fprintf(scom,'%s\r',s); % Send u to the MCU
r = fscanf(scom); % receive from the MCU and store it in s

fclose(scom); % close the serial port
y = str2num(r); % Convert string s to number y

end

As shown in Figure (5.15), the time domain PSS have been replaced with Zero Order Hold
and MATLAB Function Simulink block, and these two blocks will act as digital PSS to the
SMIB power system. Zero Order Hold Simulink block is used to sample the frequency simulated
signal of the Simulink with 1/f
s
sampling time, which is equal to 0.01818 seconds. Moreover, the
above MATLAB function has been used to interface with the digital PSS.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 113


Figure (5.15): MATLAB/Simulink Model of the SMIB Power System including Digital
(Microcontroller) PSS Power System
D
e
l
t
a
-

V
t
D
e
l
t
a
-

E
q
'
D
e
l
t
a
-

E
f
d
D
e
l
t
a
-

T
e
D
e
l
t
a
-

T
s
D
e
l
t
a
-

T
d
D
e
l
t
a
-

d
e
l
t
a
D
e
l
t
a
-

O
m
e
g
a
D
e
l
t
a
-

V
s
k
4 K
4
d
e
l
t
a
-
d
e
l
t
a
d
e
l
t
a
-
V
t
d
e
l
t
a
-
T
e
Z
e
r
o
-
O
r
d
e
r
H
o
l
d
V
o
l
t
a
g
e

R
e
g
u
l
a
t
o
r
-
E
x
c
i
t
e
r
K
A
T
A
.
s
+
1
V

r
e
f
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

V
t
)
D
e
l
t
a
_
V
t
T
o

W
o
r
k
s
p
a
c
e

(
D
e
l
t
a

T
e
)
D
e
l
t
a
_
T
e
T
o

W
o
r
k
s
p
a
c
e
(
T
i
m
e
)
t
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

d
e
l
t
a
)
D
e
l
t
a
_
d
e
l
t
a
T
o

W
o
r
k
s
p
a
c
e
(
D
e
l
t
a

O
m
e
g
a
)
D
e
l
t
a
_
O
m
e
g
a
R
o
t
a
t
i
n
g

M
a
s
s
(
2
.
*
H
)
s
1
D
i
g
i
t
a
l

P
S
S
M
A
T
L
A
B
F
u
n
c
t
i
o
n
D
e
l
t
a

O
m
e
g
a
D
e
l
t
a

-

T
m
D
a
m
p
i
n
g

T
o
r
q
u
e
C
o
f
f
i
e
c
e
n
t
-
K
D
K
D
C
o
n
s
t
a
n
t
-
k
6
K
6
C
o
n
s
t
a
n
t
-
k
5
K
5
C
o
n
s
t
a
n
t
-
k
2
K
2
C
o
n
s
t
a
n
t
-
k
1
K
1
C
l
o
c
k
0
B
a
s
e

F
r
e
q
W
b
1 s
K
3
(
K
3
.
*
T
D
P
)
s
+
1
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 114

5.12. Simulations of the SMIB Power System with MCU PSS
As a final stage, a microcontroller based digital PSS has been implemented and it is had
successfully interfaced with MATLAB/Simulink, moreover it has also stabilized the simulated
SMIB power system at different operating points. Figure (5.16) shows photos of the hardware of
the designed microcontroller based digital PSS interfaced with MATLAB/Simulink workstation.


Figure (5.16): Photos from the Microcontroller Based Digital PSS Hardware
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 115

As shown in Figure (5.17) the time domain simulation of the SMIB power system
including the digital (z-domain) PSS has been compared to the time domain simulations of the
SMIB power including s-domain PSS at nominal operating point. Moreover, the robustness of the
designed digital PSS has been evaluated by comparing the SMIB power system time domain
response with digital PSS and with s-domain PSS, at different operating points (mentioned in
Section 4.6) as shown in Figures (5.18) (5.19).

Figure (5.17): Rotor Speed Deviation Response Comparison of Digital (Microcontroller) PSS &
s-domain PSS at Nominal Operating Point Under Change in

of 1%
It is observed in Figure (5.17) that there is a high level of agreement between the digital
(Microcontroller) PSS and s-domain PSS SMIB power system rotor speed deviation responses, it
is also observed that the s-domain PSS response has more damping and that is normal, because it
0 1 2 3 4 5 6 7 8
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



Digital PSS
s-domain PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 116

is continuous time so more samples from the frequency deviation signal are processed, and thus
more stabilizing signals samples are introduced to the power system.

Figure (5.18): PSS Stabilizing Signal at nominal operating point under change in T
m
of 1%
Its observed from Figure (5.18) that both the stabilizing signal of the s-domain PSS and the
z-domain PSS have a high level of agreement and this ensures the effectiveness of the
implemented microcontroller digital PSS.
0 1 2 3 4 5 6 7 8
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-3
PSS Stabilizing Signal Voltage Deviation Response
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

P
S
S

S
t
a
b
i
l
i
z
i
n
g

S
i
g
n
a
l

V
o
l
t
a
g
e

(
p
.
u
)


Digital PSS
s-domain PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 117



Figure (5.19): Rotor Speed Deviation Response
Comparison of Digital (Microcontroller) PSS & s-
domain PSS at Unstable Operating Point Under Change
in

of 1%
Figure (5.20): Rotor Speed Deviation Response
Comparison of Digital & s-domain PSS at Unstable
Operating Point of High Exciter Gain Under Change in

of 1%
It is observed in Figure (5.19) that the Digital (Microcontroller) PSS has also stabilized the
system at the unstable operating point. It is also observed from the figure that SMIB power
system response of Digital PSS and s-domain PSS were almost identical, which proves the
effectiveness of the designed Digital PSS. As shown in Figure (5.20), the SMIB power system
including the Digital (Microcontroller) PSS is stable at higher exciter gain unstable operating
point.
From Figures (5.17)-(5.20), it is concluded that the designed Digital (Microcontroller) PSS
is robust at different operating points. Moreover, there is a high level of agreement between the
Digital (Microcontroller) PSS compared to s-domain PSS SMIB Power System rotor speed
deviation responses, and this proves the effectiveness of the designed Digital (Microcontroller)
PSS.


0 1 2 3 4 5 6 7 8
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



Digital PSS
s-domain PSS
0 1 2 3 4 5 6 7 8
-0.04
-0.03
-0.02
-0.01
0
0.01
0.02
0.03
0.04
0.05
0.06
Rotor Speed Deviation
Time (sec)
D
e
v
i
a
t
i
o
n

o
f

R
o
t
o
r

S
p
e
e
d

(
R
a
d
/
s
)



Digital PSS
s-domain PSS
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 118

CHAPTER 6: CONCLUSIONS AND FUTURE WORK
6.1. Conclusions
- The developed state space model and Simulink model of the SMIB power system have
been used to evaluate the stability of the system.
- A robust PSS has been designed to improve the system stability under different operating
points.
- Eigenvalues analysis, damping torque and time-domain simulations have been used to
evaluate stability of the power system at different operating points
- The s-domain PSS have been transformed to z-domain using bilinear (Tustin)
transformation
- The digital (z-domain) PSS have been simulated using Simulink.
- MATLAB/Simulink have been interfaced with microcontroller using serial UART
interfacing.
- Digital PSS have been implemented on microcontroller
- The SMIB power system stability with the designed microcontroller PSS have been
evaluated using time domain simulation technique
- The robustness PSS based microcontroller have also been evaluated at different operating
points.
6.2. Future Work
- Design of Fuzzy logic PSS based microcontroller.
- Implement the designed PSS based microcontroller to multi-machine power systems.



Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 119

References
[1] P.W.Peter and M.A.Pai, Power System Dynamics and Stability, Prentice-Hall Press 1998.
[2] Y.L. Abdel-Magid, M.A. Abido, and A.H. Mantawy, "Robust Tuning of Power System
Stabilizers in Multimachine Power Systems", IEEE Transactions on Power Systems, Vol.
15, No. 2, May 2000.
[3] M. Klein, G. J. Rogers, and P. Kundur, A Fundamental Study of Inter-area Oscillations in
Power Systems, 91 WM 015-8 PWRS.
[4] D. C. Lee, R. E. Beaulieu and J. R. Service, A Power Stabilizer Using Speed and
Electrical Power Inputs Design and Field Experience, IEEE Transactions on power
apparatus and systems , Vol. PAS-100, No.9, September 1981.
[5] R. V. Larsen and D. A. Swann, Applying Power System Stabilizers , In Three Parts,
IEEE Transactions on power apparatus and systems, Vol. PAS-100, No.6, June 1981.
[6] K. R. Padiyar, Power System Dynamics Stability and Control, John Wiley & Sons Press
1996.
[7] P. M. Anderson, and A. A. Fouad, Power System Control and Stability, IEEE Press 1994.
[8] C. L. Chen and Y.Y. Hsu, Coordinated Synthesis of Multi-machine Power System Stabilizer
Using an Efficient Decentralized Modal Control Algorithm, IEEE Transactions on Power
Systems, Vol.2, No.3, August 1987.
[9] K. Ogata, Modern Control Engineering, Prentice-Hall 1992.
[10] P. Kundur, Power System Stability and Control, McGraw-Hill Press 1994.
[11] F. P. Demello and C. Concordia , Concepts of Synchronous Machine Stability as
Effected by Excitation Control, IEEE Transactions on power apparatus and
systems,Vol.PAS-88, No.4,April 1969 .
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 120

[12] V.Arcidiacono, E.Ferrari, R.Marconato, J.Dos Ghali , D.Grandez Evaluation and
Improvement of Electromechanical Oscillation Damping by Means of Eigenvalue-
Eigenvector - Analysis & practical results in the central peru power system, IEEE
Transactions on power apparatus and systems, Vol PAS-100 ,No.1, Jan 1981.
[13] E.A. Feilat,Performance Comparison of Adaptive Estimation Techniques for Power
System Small-Signal Stability Assessment, Proceedings of ICCCP 2009, Sultan Qaboos
University, Feb 2009.
[14] H. A. Moussa, Y. Yu, Optimal Power System Stabilization Through Excitation and/or
Governor Control, IEEE Transactions on Power Apparatus and Systems, Vol. PAS-91,
pp1166-1174, 1972.
[15] R. J. Fleming and J. Sun ,An Optimal Multivariable Stabilizer For a Multi-Machine
Plant , IEEE Transactions on Energy Conversion, Vol.5, No.1,March 1990.
[16] A. Ghosh, G. Ledwich , O. P. Malik and G. S. Hope, Power System Stabilizer Based on
Adaptive Control Techniques, IEEE Transactions on Power Apparatus and Systems,
Vol. PAS-103, No.8, August 1984.
[17] M. Verle, PIC Microcontrollers, mikroElektronika 2008.
[18] S. Cheng, Y. S. Chow , O. P. Malik and G. S. Hope ,An Adaptive Synchronous Machine
Stabilizer, IEEE Transactions on Power Apparatus and Systems, Vol. PWRS-1, No.3,
August 1986.
[19] V. Vittal, N. Bhatia, A. A. Fouad, Analysis of Inter-area Mode Phenomenon in Power
Systems Following Large Disturbances., IEEE Transactions on Power Systems, Vol.6,
No.4, November 1991.
[20] A. R. Messina, J. M. Ramirez, J. M. Canedo, An Investigation on The Use of Power
System Stabilizers for Damping Inter-area Oscillations in Longitudinal Power Systems.,
IEEE Transactions on Power Systems, Vol.13, No.2, May 1997.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 121

[21] C.M.Ong, Dynamic Simulation of Electric Machinery Using MATLAB/SIMULINK,
Prentice-Hall Press 1998.
[22] D.S. Watkins, "Fundamentals of Matrix Computations", John Wiley and Sons, 1991.
[23] S.M. Bamasak, "FACTS-Based Stabilizers for power system stability enhancement", Msc
Thesis, King Fahd University of Petroleum & Minerals, May 2005.
[24] Qureshy, Farooq Ahmad, "Steady State Stability Analysis of AC-DC Power Systems"
(1985). Open Dissertations and Theses. Paper 1225.
[25] Wasynczuk, O., & Decarlo, R. A. (1981). The Component Connection Model and Structure
Preserving Model Order Reduction. Automatica, Vol. 17, No.4 , 619-626.
[26] Y.L. Abdel-Magid, M.A. Abido, S. Al-Baiyat, and A.H. Mantawy, "Simultaneous
Stabilization of Multimachine Power Systems via Genetic Algorithms", IEEE Transaction
on Power Systems, Volume 14, No. 4, November 1999.
[27] J. H. Chow, G. E. Boukarim, and A. Murdoch, Power System Stabilizers as Undergraduate
Control Design Projects, IEEE Transactions on Power Systems, Special Issue on Power
Engineering Education, vol. 19, pp. 144-151, 2004.
[28] L. Vanfretti, Modeling and simulation of the synchronous machine and its operation in
power systems, Electrical Engineering Degree - Licenciatura Thesis, Universidad de San
Carlos de Guatemala, May 2005.
[29] M.Verle, PIC Microcontrollers - Programming in C, mikroElektronika, 2009.
[30] N.S. Nise, Control Systems Engineering, John Wiley & Sons, 2011.
[31] D. Ibrahim, Microcontroller Based Applied Digital Control, John Wiley & Sons, 2006.
[32] C. L. Phillips & H. T. Nagle, Digital Control System Analysis and Design, Prentice-Hall
Press, 1995.
Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout


Dept. of EE, Qatar Univ.
P a g e | 122

[33] S.H. Lee, Y.F. Li and V. Kapila, "Development of a Matlab-Based Graphical User Interface
Environment for PIC Microcontroller Projects", Proceedings of the 2004 American Society
for Engineering Education Annual Conference & Exposition, Session 2220, 2004.
[34] B. Brey, Applying PIC18 Microcontrollers: Architecture, Programming, and Interfacing
using C and Assembly, Prentice-Hall Press, 2007.
[35] K. J. Astrom & B. Wittenmark, Computer Controller Systems, Longman Higher Education,
1984.
[36] IEEE Std 1110, "IEEE Guide for Synchronous Generator Modeling Practices and
Application in Power System Stability Analysis", 2002.
[37] IEEE Standard Denitions for Excitation Systems for Syn-chronous Machines, IEEE
Standard 421.1, 1986.
[38] "Approved IEEE Draft Standard Definitions for Excitation Systems for Synchronous
Machines (Revision of IEEE 412.1-1986), IEEE Approved Std P421.1/D7, Nov 2006 , vol.
no. 2007
[39] "IEEE Recommended Practice for Excitation System Models for Power System Stability
Studies, IEEE Std 421.5-2005 (Revision of IEEE Std 421.5-1992) , vol. no. pp.0_1-85,
2006


Design of Power System Stabilizer Based on
Microcontroller for Power System Stability
Enhancement.
Said & Kahlout

Dept. of EE, Qatar Univ.
P a g e | A- 1

Appendix A: PIC Microcontrollers Comparison
The following table shows a comparison between PIC microcontrollers Families features.
Table (A-1): Comparison Between PIC Microcontrollers Families Features
[17]

También podría gustarte