Вы находитесь на странице: 1из 79

Implementation of an Adaptive

Controller for Controlled Series


Compensators in PSS/E

Huang Wenkan

Master of Science Thesis


Stockholm, Sweden 2007
XR-EE-EME 2007:009
Implementation of an Adaptive
Controller for Controlled Series
Compensators in PSS/E

Huang Wenkan

Master’s Thesis in Power Electronics (20 credits)


at the School of Electrical Engineering
Royal Institute of Technology year 2007
Supervisor at EME is Nicklas Johansson
Supervisor at ABB is Lennart Ängquist
Examiner is Hans-Peter Nee

XR-EE-EME 2007:009

Royal Institute of Technology


School of Electrical Engineering
Division of Electrical Machines and Power Electronics

KTH EE EME
SE-100 44 Stockholm, Sweden

URL: www.eme.ee.kth.se
Abstract
In electric power systems, controlled series compensators (CSC) are used to control
the power flow, improve the transient stability of the system, and to improve the
damping of power oscillations. However, a challenge in designing a controller for
power oscillation damping using a CSC is the fact that the power system is in constant
change, and its present state is not known to the controller. To address this issue, an
adaptive controller for damping of power oscillations, transient stability improvement,
and power flow control using a CSC has been developed.

The task of this thesis work is to implement the adaptive controller for a CSC in the
power system simulation software PSS/E, and to compare the simulation results with
results from another digital simulation platform, SIMPOW. The Kundur four machine
model of a power system is used to demonstrate the performance of the controller for
different contingencies and operating points.

Key words: CSC, Damping Controller, PSS/E, SIMPOW, Kundur’s System

I
Acknowledgement
This project is conducted in cooperation between ABB (Västerås) and KTH
(Stockholm). First of all, I would like to thank ABB gave me a chance to finish my
thesis in one of the world’s leading engineering company. I am also willing to thank
the power electronic department in KTH that they arranged a nice place in the
laboratory for me. This helped me to concentrate on my work greatly.

The thesis task could not have been finished without Nicklas.Johansson who
considered as my supervisor in KTH. He is the most important advisor for me during
these six months period. He guided me from the beginning to the end, although he
was busy in his teaching and researching, although he just had his baby, although
sometimes he was not being at school, he always managed to help me in the fastest
and warmhearted way. He gave me patient explanation about the theory and detailed
proofread of the report. I learnt many things from Nicklas that how to face the
challenge and puzzle, how to work individually, how to solve a difficult problem step
by step.

Also, I like to thank my supervisor Lennart Ängquist from ABB, who gave me great
help during this period as well. He instructed me how to run the software and analyze
the code. More importantly, he taught me how to work in a right direction and
encouraged me when i was at a loss. His characteristics of responsible and profound
gave me great impressions. I wish there would be one day that I can solve the
problems as effective and competent as him.

I also want to thank my examiner Hans-Peter Nee for leading me to the laboratory and
introduce me to so many kindness colleagues. As well as for checking and correcting
my thesis report carefully in many details.

Beside my supervisors and examiners, I would like to thank Peter Lönn, who gave me
absolutely necessarily support on software and extend my access authority to the lab
for so many times.

On the other hand, i want to thank my parents for their living with me in the summer.
During that period, I didn’t need to make food by my self and I had a feeling of a
family. Hereby I got the most achievement of the task at that time.

Last but not least, a deeply appreciation is given to my chinese friends Wang Ruoli,
Fan ling, Tong Fan, Yu Yang, Yu Lu, Yang Yan and Dong Yu. The deep friendship
between us gave me a great support and let me go through the thesis work
successfully.

II
Content
ABSTRACT .................................................................................................................................................. I
ACKNOWLEDGEMENTS ........................................................................................................................II

CHAPTER 1 INTRODUCTION.............................................................................................................. 1
1.1 BACKGROUND ...................................................................................................................................1
1.2 SCOPE OF THESIS WORK .....................................................................................................................5
1.3 OUTLINE OF THE THESIS ...............................................................................................................5

CHAPTER 2 POWER SYSTEM MODELLING STUDY..................................................................... 7


2.1 KUNDUR’S TWO-AREA SYSTEM ..................................................................................................7
2.2 POWER FLOW CALCULATION OF KUNDUR’S SYSTEM .......................................................8
2.3 DYNAMIC STUDY OF KUNDUR’S SYSTEM IN PSS/E............................................................12
2.4 MODELLING COMPARISON BETWEEN PSS/E AND SIMOW...............................................17
CHAPTER 3 ADAPTIVE CONTROL METHODS ............................................................................. 24
3.1 REDUCED GRID MODEL ...........................................................................................................24
3.2 PHASOR ESTIMATION...............................................................................................................26
3.3 THEORY OF ADAPTIVE DAMPING CONTROLLER ..............................................................29
CHAPTER 4 IMPLEMENTATION OF THE CLOSED LOOP ADAPTIVE
CONTROLLER IN PSS/E................................................................................................ 34
4.1 MODEL WRITING IN PSS/E........................................................................................................34
4.2 CONTROL STRATEGY IMPLEMENTATION IN PSS/E ...........................................................37
4.3 IMPLEMETATION RESULT IN PSS/E .......................................................................................39
CHAPTER 5 DYNAMIC SIMULATION RESULTS COMPARISON BETWEEN
SIMPOW AND PSS/E..................................................................................................... 44
5.1 SETUP OF THE RESULT COMPARISON ..................................................................................44
5.2 COMPARISON RESULT ANALYSIS .........................................................................................45
CHAPTER 6 CONCLUSIONS AND FUTURE WORK...................................................................... 56
6.1 CONCLUSIONS .................................................................................................................................56
6.2 FUTURE WORK .................................................................................................................................56

APPENDIX A POWER FLOW RAW DATA ...................................................................................... 58

APPENDIX B FLECS CODE FOR THE CONTROLLER IN PSS/E................................................ 60

REFERENCE ............................................................................................................................................. 74

III
Chapter 1
Introduction
This chapter provides a brief background concerning the phenomena of power
oscillations. Furthermore, the discussion includes what can be done about it. Finally,
the motivation and objective of the thesis are given.

1.1 Background
1.1.1 Power Oscillation Phenomena in Electric Power
Systems
In electric power systems, dynamic phenomena are induced either due to a
disturbance in the system or by a change in a system variable. The disturbance can
originate either from the occurrence of a fault or from switching actions. In order to
consider the system to be stable, the system must reach steady state in a finite time
after the disturbance.

When dynamic events occur in an electrical power system, electro-mechanical


oscillations are an important phenomenon. These oscillations originate from rotor
oscillations of synchronous machines. Once the system cannot withstand the
oscillation, the rotor will accelerate and the system becomes unstable. It is often said
that the generator loses synchronism or the system falls out of phase.

Consequently, it is desirable that the power system can withstand as many


disturbances as possible without being unstable.

There are many ways to increase system stability. One possibility is to provide
supplementary damping to the system. The traditional method is installation of power
system stabilizers, PSS, at the excitation system of generators in the system using the
shaft speed as input signal. These can be constructed using a cascade connection of
washout filters and lead-lag filters. Unfortunately, this procedure does not always
work, especially not for inter-area power oscillations at low frequencies
(approximately 0,2-0,7 Hz).

In this situation, FACTS (Flexible AC Transmission Systems) devices can be used to


provide damping. For example, CSC (Controlled series Compensators) may offer a
cost-effective, robust power oscillation damping. By means of rapid dynamic
modulation of the inserted reactance at interconnecting points between transmission
grids, the modulation can provide a strong damping torque on inter-area
electromechanical oscillations.

1
1.1.2 Power Flow Pattern
During the last decade, many electricity markets have become deregulated. This has
lead to a changing power flow pattern which has been seen to cause bottlenecks in
many power systems. One way to solve the problem is to build new lines, but this
costs a lot of money and takes a lot of time. For this reason, FACTS devices are being
investigated to improve the situation. These devices can be used both to increase the
transfer capability of a power system and to minimize the losses in the power system.
This is accomplished by enhancement of the power system stability and by control of
the power flows in the system.

For instance, the maximum active power transferable over a certain power line is
inversely proportional to the series reactance of the line. By compensating the series
reactance to a certain degree, using a series capacitor, an electrically shorter line is
realized and higher active power transfer is achieved.

1.1.3 Scheme of FACTS devices

As mentioned above, FACTS devices, like the controlled series compensator, can be
used to improve the damping of the power oscillations, which are often present in
power systems, to improve the transient stability of the system and to control the
power flow in the power system.

Figure 1.1 Control of power flow between regions

The scheme of the controlled series compensator is described in figure 1-1. The power
transmission on the compensated line is determined by the equation 1.1:

2
U1 U 2
P (t ) = ⋅ sin (θ12 (t ) ) (1.1)
X L − X C (t )

By using CSC to insert a proper value of X C , the power oscillation may be damped
out and the desired power flow can be obtained.

1.1.4 Adaptive Control of CSC


One challenge in designing a controller for power oscillation damping using CSC is
the fact that the power system parameters often change dramatically during a
contingency and its present state is not known to the controller. A controller which
shows a good function in one operating point and one system configuration may be
inadequate in another. To fix this issue, an adaptive controller has been developed
based on a model predictive approach to power oscillation damping.

The method is based on step-wise series reactance modulation. The controller


stabilizes an oscillation in a power system exhibiting one dominant mode of
oscillation by switching a reactance in series with one transmission line, thereby
changing the total reactance between two grid areas involved in the oscillation. The
stationary voltage angle difference between the areas is changed to coincide with the
present angle at an instant when the speed deviation between the lumped machine
representations of the areas is zero.. This is the case at the peak of the oscillation. To
determine the required reactance step to be inserted at this moment, a reduced model
of the power system is used, and model parameters are calculated by the measurement
of the active power responses on the reactance controlled line.

3
1.1.5 Outline of the Adaptive Controller

CSC Line Phasor


Power Estimation Oscillation
(RLS) Detector

Pxbv

Power Flow System


Reactance on & Damping Parameter
CSC Line Controller Estimation

Figure 1.2 Simplified block diagram of the adaptive controller

CSC Line Input signal of the controller, used in the phasor estimation,
Power Local active power measurement
Measurement

Phasor Extracts a phasor that represents the power swing with an


Estimation(RLS) expected oscillation frequency. Also the average power on the
line is estimated.
Oscillation Detects the oscillation in the transmission system, and triggers
Detector the reaction of the adaptive controller

System Parameter Performs the estimation of the series reactance Xi and the
Estimation parallel reactance Xeq, which characterizes the reduced model of
the power system
Pxbv Input signal of the desired power flow value on the control line

Power Flow & Calculates how much reactance is required in each reactance
Damping step (with limitation and protection). Main part of the adaptive
Controller controller

Reactance on Output signal of the adaptive controller. The reactance value to


CSC Line be added by the CSC facility.

Table 1.1 Overview of the parts of the adaptive controller

4
1.2 Scope of the Thesis Work

1.2.1 Motivation
The adaptive controller mentioned above has been developed at KTH, and it has been
implemented on one digital simulation platform (SIMPOW). In order to test the
controller for larger and more realistic models of the power system, it is necessary to
implement the controller in another simulation software (PSS/E).

PSS/E is a system of programs and structured data files designed to handle the basic
functions of power system performance simulation work. It can do the data handling,
power flow calculation, fault analysis, dynamic simulation. The functions of power
flow calculation, modelling writing, dynamic simulation will be used to implement
the developed controller.

1.2.2 Objectives

The task of the thesis is to implement the adaptive controller for a CSC in PSS/E. A
simple four-machine model of a power system will be used to demonstrate the
performance of the controller for different contingencies and operating points.

To achieve this goal, the work will be divided into the following steps:

a). Modelling of a four-machine power system in PSS/E


b). Power flow calculation and dynamic study of the four-machine system in PSS/E
c). Comparison of the simulation results for the same power system model with
another simulation software - SIMPOW
d). Model writing of the adaptive controller in PSS/E
e). Testing the model of the controller on a four machine system in PSS/E
f). Conclusion of the whole work by comparing the simulation result of the
controller both in PSS/E and SIMPOW. Investigate the differences between the
implementations.

1.3 Outline of the thesis


Chapter 2 gives a general overview of how to build a system model and how to run
the power flow calculations in PSS/E. The four machine Kundur system is built here.
Later the four machine system is implemented both in SIMPOW and PSS/E, both
with classical generator models and round rotor generator models, which are
implemented with and without excitation control models.

5
Chapter 3 contains the theory of the developed adaptive controller, the modules of
the reduced grid model, estimation of the reduced model parameters, phasor detector
and theory of the damping methods.

Chapter 4 begins by an introduction of how to write a code in PSS/E, furthermore,


how the control strategy is implemented in PSS/E. Finally instructions are given of
how to run the code in PSS/E and how to export the result files.

Chapter 5 covers the experimental work with comparison result between SIMPOW
and PSS/E. Subsequently, the differences of the implementations are explained.

Chapter 6 summarises the whole thesis work and provides some suggestions for
future work in the field.

6
Chapter 2
Power System Modelling Study

This chapter initially provides an introduction to Kundur’s two-area system. After that,
power flow calculation and dynamic studies of the Kundur system in PSS/E are
presented. Finally, the difference between the results from SIMPOW and PSS/E are
analyzed.

2.1 Kundur’s Two-Area System


2.1.1 System Diagram

In this thesis work, a transmission system is needed to test the performance of the
developed adaptive controller. Hereby, a two area system is built based on the
example 12.6 at page 813 in the textbook “Power System Stability and Control”,
written by Prabha Kundur. The main topology is depicted in figure 2.1. The term
Kundur system will be used for this system even if the topology is somewhat changed
from the original system. The differences from the original system are that the inter-
tie lines have been stretched geographically and that a third interconnection line has
been added. Moreover, reactive shunt compensation has been added at node 8.
G1 G3

Power Flow

1 13 3
L13 1km

5 6 7 8 9 10 11
25km 150km 150km 25km
10km 10km

150km

C7 C9
C8 12
Area 1 L7 L9 Area 2
2 4

G2 G4
Figure 2.1 Single-line diagram of the Kundur two-area system

This system consists of two similar areas and twelve buses, connected by a weak tie
between bus 7 and bus 9. The system has a fundamental frequency of 60 Hz. Loads
are applied to the buses 7 and 9. Three shunt capacitors are also connected: to bus 7,

7
bus 8, and bus 9. The left half of the system is identified as area 1 and the right half
side is identified as area 2, each area consisting of two generators. The system is
operating with area 1 exporting power to area 2. In this thesis work, two different
cases, one with high power transfer, 600MW, and another with low power transfer,
200MW, between the two areas are studied.

2.1.2 Basic damping control strategy for Kundur’s System

In order to run dynamic tests on the Kundur system, the system needs certain basic
control strategies to control the small-signal stability of the system. Here all four
machine generators are equipped with thyristor exciters with high transient gains and
power system stabilizers (PSS). The block diagram of the thyristor excitation system
with PSS is shown in figure 2.2.

Vref

TGR
Exciter Efd
Et 1 + sTA

1
KA
1 + sTR 1 + sTB
Vs

Power system stabilizer


Δω r sTw 1 + sT 1 1 + sT 3
KSTAB
1 + sTw 1 + sT 2 1 + sT 4

Figure 2.2 Excitation system with PSS

The excitation system is used to feed the field windings of the synchronous machines
with a controlled direct current, and thus the main flux in the rotor is generated.

2.2 Power Flow Calculation of Kundur’s System

2.2.1 Setup of PSS/E-29 Load flow Program Psslf4

Psslf4 is a module for power flow calculation in PSS/E. By setting up a power system
model in the working file and operating on this model with PSS/E activities, the
power flow results are produced.

8
Initially, a new power flow case is to be set up. This is done by establishing the initial
set of system data in a power flow raw data file. The Kundur system for the high
power flow case described above is presented in the file four_machine_system.raw as
shown in appendix A. In this file, the load power consumption at all buses and the
generator power production at each power plant are given. Furthermore, transformer
and line characteristics can also be found.

In psslf4, after the data has been added to the case files and the components have been
added and checked, solution activities need to be selected. In this thesis work, the
power flow solution activity “FDNS” is used. FDNS utilizes a fix-slope decoupled
Newton-Raphson iterative algorithm. It gives a solution for the bus voltages needed to
satisfy the bus boundary conditions contained in the working case.

In order to initialize the generators in the working case for successive dynamic
simulation, the generator conversion activity “CONG” is necessary in the response
file. This will let a generator be represented by a voltage behind an apparent
impendence in the dynamic simulation, which is handled by a Norton equivalent for
each generator.

At the same time, the load characters also need to be changed by the activity “CONL”
in order to define the dynamic behaviour of the loads. In this thesis, constant current
loads for the active power, and constant admittances for the reactive power are
selected. The performance is expressed by the following equation,
P = P ' 0 ⋅U / U 0
(2.1)
Q = Q ' 0 ⋅ (U / U 0) 2
where P ' 0, Q ' 0 are initial values of power, U 0 is initial voltage, and U is current
voltage.

Following this step, the output files of the results need to be defined. This can be done
by the comprehensive power flow output activity “POUT”. This instruction can
provide an output report with full power flow information.

The procedure described above can be run using the response file with the suffix .idv,
shown in figure 2-3. (The folder part in the file name should be changed to the
currently used folder name.)

9
MENU,OFF /* FORCE MENU TO CORRECT STATUS
optn
11
60.00 Pick up case
0
BAT_Read 0
"C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2.raw"
BAT_FDNS, 0, 0, 0, 1, 1, 0, 99, 0 ; Solution method selected
BAT_SAVE
"C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2.sav"
OPEN
201
C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2_LF.dat
BAT_POUT 0 1
CLOS
BAT_CONG 0 Generation and
CONL all
100.00 0.00 Load Conversion
0.00 100.00 Case save for
1
SAVE
Dynamic Simulation
C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2.cnv
ECHO
@END
Figure 2.2 Response file for load flow calculation

In figure 2.2, the Kundur system modelled in the case file Studysys2.raw is calculated.
The case is saved for use in dynamic simulation in the files Studysys2.sav and
Studysys2.cnv. The generators and loads are converted for transient simulation. The
result from the load calculation is saved in the file Studysys_LF.dat.

2.2.1 Power Flow Results Comparison in PSS/E & SIMPOW

One fragment of the high power flow case results from the calculation of on the
Kundur system is presented in the figure 2.3

Figure 2.3 Fragmental result of high power-flow case calculation

10
In the above results, bus 100, 200, 300, 400 represent the nodes 1, 2, 3, 4 in the
Kundur system. In the fix-slope decoupled Newton-Raphson iterative algorithm, a
slack bus needs to be defined. Here, bus3 is the slack bus and its voltage angle is fixed
to -6.8 degrees. The voltages of the generator are set to the value 1,03 p.u for G1 and
G3, 1,01 for G2 and G4.

The thesis work is to implement the developed adaptive controller which has been
successfully validated in the simulation software SIMPOW. To achieve this, it is
necessary to compare the initial power flow results in both softwares, in order to
assure the similarity of the two implementations.

Below, a comparison table of the high power flow case results between PSS/E and
SIMPOW is shown.

Synchronous P[MW] P[MW] Q[Mvar] Q[Mvar] Et [p.u.] Et [p.u.]


machine (PSS/E) (SIMPOW) (PSS/E) (SIMPOW) (PSS/E) (SIMPOW)
G1 800 800 171.1 170.5 1.03∠29.63° 1.03∠29.42°
G2 800 800 153.3 151.7 1.01∠18.52° 1.01∠18.31°
G3 744.5 743.9 163.1 162.1 1.03∠ − 6.8° 1.03∠ − 6.8°
G4 700 700 156.1 154.0 1.01∠ − 17.55° 1.01∠ − 17.53°

BUS 7 To Load To Shunt To Bus 13 To Bus 8 To Bus 6


IN PSS/E 717.0 MW 250.1 MW 591.6 MW -1558.8 MW
50.0 Mvar -395.8 Mvar 50.5 Mvar 295.5 Mvar
IN SIMPOW 717.0 MW 250.1 MW 591.6 MW -1558.8 MW
50.0 Mvar -396.1 Mvar 50.5 Mvar 297.1 Mvar

BUS 9 To Load To Shunt To Bus 8 To Bus 10 To Bus 12


IN PSS/E 1967.0 MW -370.6 MW -1409.9 MW -186.5 MW
100.0 Mvar -388.8 Mvar 62.0 Mvar 195.5Mvar 31.5 Mvar
IN SIMPOW 1967.0 MW -371.6 MW -1409.4 MW -185.9 MW
100.0 Mvar -389.3 Mvar 61.6 Mvar 197.7Mvar 30.5 Mvar

Table 2.1 Comparison Result of High Power Flow Case

As seen from the table, there are slight differences in the reactive power production
for the two machines, G2 and G4, and also voltage angle for machines G1 and G2. On
the other hand, the transmission differences of reactive power are much more obvious
than active power transfer. Since all the differences are small and acceptable, they will
not be analyzed further in this thesis work.

11
2.3 Dynamic Study of Kundur’s System in PSS/E

2.3.1 Structure of PSS/E-29 Dynamic Simulation


PSS/E is able to run dynamic simulations when these are entered at its dynamic entry
point, PSSDS4. In this module, the behaviour of a system is described by a set of
differential equations. At each time step, the time derivatives of the state variables in
the system are calculated. Then, combining this information with the constant and
variable parameters, the details of the system can be described. From the present value
of each state variable and its time derivative, the next step variable value can be
determined. The simulation time is advanced and the process is repeated.

The procedure of the dynamic simulation is following the steps shown in figure 2.4,

Data Assimilation
Optional disturbance

Initialization Advance Time

Network Solution Numerial Integration

Time Derivative Calculation Output

Figure 2.4 Logic flow of the dynamic simulation

The system model is composed of the load flow working case, dynamic data working
memory, and a set of connection subroutine, which link together equipment models
and their data with network elements.

2.3.2 Setup of PSS/E-29 Dynamic Simulation

First of all, the saved case file contains a “converted” network constructed in the
previous power flow calculation.

Also, a snapshot file is required, which contains both the constant parameters
associated with the dynamic equipment models and those arrays which indicate the
instantaneous condition of the equipment models. The activity DYRE can be used for
invoking a file with a .dyr suffix, specifying the model dynamics and insert the
equipment models to the snapshot file. The dynamic data input file of equipment
configuration is shown in figure 2.5.

12
Generator
Model
Excitation System

Adaptive
Controller

Figure 2.5: File specifying the model dynamics

Proceeding by the activity DYRE, this will generate two connection subroutines
(CONEC and CONET), which are necessary to associate dynamic equipment and
other models with power flow network elements. Also a compiling file is entered. The
usage of this compiling file is encouraged since it guarantees the correct specification
of the compiler option setting in compiling these subroutines. In this thesis work, this
execution was also used to identify errors in the user-written code of the adaptive
controller.

Then, the data arrays associated with the modelling of the dynamic equipment are
recorded. In order to monitor the variables during the dynamic simulation, those
quantities should also be placed by the selection activity, CHAN, into the snapshot
file. After that, the selected variables can be monitored by the auxiliary plotting
program PSSPLT.

Now, the necessary steps of initializing the dynamic model can be summarized as
follows, with reference to [9].

1). Set up the "converted" Saved Case (Should be done in the power flow study)
2). Initiate PSS/E at its dynamic simulation entry point, PSSDS4.
3). Link to the load flow activity selector with activity LOFL.
4). Retrieve the "converted" Saved Case with activity CASE.
5). Return to the dynamic simulation activity selector with activity RTRN.
6). Execute activity DYRE, specify the filenames to place the CONEC and CONET
subroutines, as well specify a filename to be used as a compiling file.
7). If any dc line supplementary signal models are being used, modify subroutines
CONEC and CONET. (This step is not necessary for the modelling study, but it is
necessary in the later test with a controller model)
8). Selecting output channels with the activity CHAN
9). Update the Snapshot with activity SNAP.

13
Note: The steps summarized above are only the essential ones for the modelling task
in this thesis work, besides these PSS/E provides additional activities used for data
error checking and documenting tabulation.

All of the steps can be run in one response file as shown in Figure 2.6

Saved Case Route

Dynamic Model Route

Figure 2.6: Response file for dynamic initialization

After initializing the dynamic model, the software is ready to run the simulation. The
required sequence needs to be loaded in the following steps:

1). Ensure that the CONEC and CONET subroutines have been compiled and
linked into the PSS/E program structure as described above. Then, start up
PSS/E at its dynamic simulation entry point, PSSDS4.
2). Execute activity RSTR specifying the name of the file containing the system
model Snapshot.
3). Execute activity LOFL to link to the load flow activity selector.
4). Execute activity CASE specifying the name of the "converted" load flow Saved
Case.
5). Execute activity FACT to calculate the factorized system admittance matrix and
preserve it in the factored matrix working file.
6). Execute activity RTRN to link back to the dynamic simulation activity selector.

14
7). Execute activity STRT which initializes all simulation models. The channel
output file whichs record the result of the simulation is also generated here.
8). Execute the state-space time simulation activity, RUN. It solves the
differential equations of the system and the electrical network at each time step.
Note:
If the network solution parameters: maximum number of iterations, acceleration
factor, and convergence tolerance need to be adjusted, an additional step could be
added after the sixth step by executing the activity ALTR.
On the other hand, the STRT activity running in step 7 is really important in the
simulation steps, since it can check the compatibility of the snapshot and loadflow
cave case.
Furthermore, since the simulation time for this task is approximately 20 seconds,
it is necessary to define a separate log file for the simulating progress record.
Otherwise, the window for running the simulation will be full of undesired records.
This can be done by executing the activity PDEV and ODEV before the step 7.

Besides the necessary steps to run the simulation mentioned above, it is important to
know how to apply disturbances. This can be achieved either by the power flow data
modification activity, CHNG, or by the dynamic data change activity, ALTR. Here
ALTR is preferred, because it is much more effective in generating three-phase short
circuits.

The response file produced when running simulations is shown in figure 2.7.

Figure 2.7: Response file produced when running the dynamic


simulation

In the figure 2.7, snapshot file studysys21.snp and powerflow case file studysys2.cnv
are picked up. Maximum number of iterations, acceleration factor, and convergence
tolerance are set to be 100; 0,99; and 0,0001 respectively. Progressing data records are

15
stored in the file studysys2.log. The output file to be used in PSSPLT is defined as
studysts2_DYN.out. After initializing the system by the activity, the system will run 1
second without any disturbance. At time=1 s, a three-phase short circuit is induced in
bus 8. The fault lasts for 0,2 seconds. Then, at time= 1.2 s, the fault is cleared, and
one line between bus 8 and bus 9 is disconnected. After that, the system continues to
run until time = 20 sec.

The results of the test are the most interesting things after the simulation. Here, PSS/E
plot program pssplt.exe provides several methods to display the simulation results. In
this thesis, since comparison between PSS/E and SIMPOW is needed, task activity
PRNT is executed to generate an output table, which can be read by MATLAB. The
response file to be used in PSSPLT is shown in figure 2.8.

Figure 2.8: Response file of plotting results in PSSPLT

In figure 2.8, the simulation result is collected from the file studysys2_DYN.out. The
displayed time scale is adjusted to 15 seconds while the readable file for MATLAB is
studysys2_DYN.dat with 12 channels.

Now, the setup of the PSS/E dynamic simulation is finished. The comparison of the
result with SIMPOW will be discussed in the next section. However, PSSPLT could
also generate the displayed results by itself. This is enough for simulation only in
PSS/E.

The plot graph for the high power flow case in Kundur’s system with 200 ms three
phase short circuit disconnection is shown in figure 2.9. The green curve is the active
power flow between bus 8 and bus 12 and the blue curve is the production of active
power on G1. The scale of the y axis are on the right side of the picture. The line
power is for the nominal value from 0 to 500MW, and the G1 power production is for
the p.u. value from 0 to 10, with the base power 100MW. In this case, the power

16
system oscillation is stabilized by the excitation system, but slowly. Supplementary
damping would be beneficial to provide adequate damping for the power oscillation.

Figure 2.9: Plotting results from PSSPLT

2.4 Modelling comparison between PSS/E &


SIMPOW

2.4.1 Comparative analysis

After finishing the simulation in PSS/E, it is now possible to compare the simulation
results with the those from SIMPOW for the same power system model.

First, the simulation result of the four machine system with PSS is generated in
Matlab, by using the output file studysys2_DYN.dat from PSS/E and an output text
file of each variable from SIMPOW.

The plotted results are shown in figure 2.10. In this case, the general trend of the
results from the different softwares is the same. However, there are minor
discrepancies. The left top diagram shows the production power of generator G1 in
the four machine system. It reveals that both oscillations of them are damped, but the
result from PSS/E is better damped than the result from SIMPOW. The phenomenon
also can be seen in the right bottom diagram in the figure. This plot is the transmission

17
power between bus 8 and bus 12. On the other hand, the other two plots in the figure
reveal that the acceleration of the generator speed in SIMPOW is much more obvious
than in PSS/E.

Generator power [MW ] Generator Speed [HZ]


1000 60.7
SIMPOW SIMPOW
PSS/E 60.6 PSS/E
900

60.5
800

60.4
700
60.3

600
60.2

500
60.1

400 60

300 59.9
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time [s] Time [s]

Generator Ang [DEGREE] TCSC Line Power [MW ]


3000 450
SIMPOW SIMPOW
PSS/E 400 PSS/E
2500
350

2000 300

250
1500
200

1000 150

100
500
50

0
0
0 2 4 6 8 10 12 14 16 18 20
Time [s] -50
0 2 4 6 8 10 12 14 16 18 20
Time [s]

Figure 2.10 Comparison of results from PSS/E and SIMPOW with PSS
Top left: Generation Power of G1 Top Right: Generator Speed of G1
Bottom left: Generator Angle of G1 Bottom Right: Line Power N8-N12

The differences between the generator behaviourshown in figure 2.10 are first of all
due to generator modelling differences between the two softwares. This will be shown
in the next section by simplification of the generator modelling.

The behaviour of the load at node 7 in the Kundur system with voltage dependent load
characteristics is plotted in figure 2.11. Seen from this table, the loads are voltage
dependent and then the variations of the load are not exactly the same in SIMPOW
and PSS/E. This may be one factor contributing to the differences which are seen in
the dynamics of the generator angles. When the system is operating without governors
as in Figure 2.10, it is very sensitive to discrepancies between the mechanically
generated power and the load power. Any difference is seen directly as an increase or
decrease in the system electrical frequency.

18
Load Characteristic of Active Power [MW ] at Node 7 Load Characteristic of Reactive Power [VAr] at Node 7
900 80
SIMPOW SIMPOW
850 PSS/E PSS/E
70
800

750 60

700
50
650
40
600

550 30

500
20
450

400 10
0 5 10 15 0 5 10 15
Time [s] Time [s]

Figure 2.11 Load Characteristic Result in PSS/E and SIMPOW


Left diagram: Active Power
Right diagram: Reactive Power

It is hard to exactly compare the generator model in PSS/E with the one in SIMPOW.
In SIMPOW, the synchronous machine is modelled with one field winding, one
damper winding in d-axis, and two damper windings in q-axis, as well as with
saturation effect. In order to insert uniform generator parameters of the Kundur
system to the model in both softwares, the generator model GENROE is selected in
PSS/E, which represents a solid rotor generator at the subtransient level. In SIMPOW
saturation effects are accounted for by means of the saturation table for the resulting
air-gap flux, but in PSS/E it is done by calculating the saturation factor in two points
on a curve, and inputting the values.

2.4.2 Results Comparison by Modelling Adjustment

In the previous section, the advanced model of generator is used to describe both
steady state and dynamic machine properties. By using the above advanced sixth
order model, the dynamic effects behind the synchronizing and damping torques are
determined by the relative values of the synchronous, transient, and subtransient
reactance.

For minimizing the effects induced by the generators, the classical generator model is
utilized here to replace the advanced ones. In PSS/E, the GENCLS model is used. The
classical model is a constant voltage source behind the transient reactance. Since a
simplified model is used, the EFD signal will not be used to adjust the performance of
the generator and accordingly the excitation systems are also removed. A comparison
of the results for this case is plotted in figure 2.12.

19
Generator power [MW ] Generator Speed [HZ]
900 66
SIMPOW SIMPOW
PSS/E PSS/E
65
800

64
700

63
600
62

500
61

400
60

300 59
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time [s] Time [s]

4
x 10 Generator Ang [DEGREE] TCSC Line Power [MW ]
2 300
SIMPOW SIMPOW
1.8 PSS/E PSS/E
250
1.6

1.4 200

1.2
150
1

0.8 100

0.6
50
0.4

0.2
0

0
0 2 4 6 8 10 12 14 16 18 20 -50
0 2 4 6 8 10 12 14 16 18 20
Time [s]
Time [s]

Figure 2.12 Comparison of Results using Simplified Generator Models


Top left: Generation Power of G1 Top Right: Generator Speed of G1
Bottom left: Generator Angle of G1 Bottom Right: Line Power N8-N12

In figure 2.12, the three-phase short circuit during 200ms is applied at time = 1 second,
and after clearing the fault, one line between line 8 and line 9 is being disconnected.
This is the same case as in figure 2.10 with advanced generator models. It can be seen
here that the errors are reduced. The amplitudes of the oscillations in PSS/E and
SIMPOW are quite close, also the acceleration of the generator shows almost the
same performance. However, the difference in oscillation frequency is increased
compared to the previous result. This is due to that no excitation system control
strategy is used here. Considering that the error is not so obvious, the four machine
system with classical model will be treated as being the same in PSS/E and SIMPOW.

When turbine governors are included together with an accurate model of the
generators, the differences between the two software implementations are much
smaller, which is seen from figure 2.13.

20
Generator power [MW ] TCSC Line Power [MW]
1000 450
SIMPOW SIMPOW
PSS/E 400 PSS/E
900
350

800 300

250
700
200
600
150

500 100

50
400
0

300 -50
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time [s] Time [s]

Generator Mech Torque [MW ] Generator Speed [HZ]


810 60.45
SIMPOW SIMPOW
PSS/E 60.4 PSS/E
800
60.35

60.3
790
60.25

780 60.2

60.15
770
60.1

60.05
760
60

750 59.95
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time [s] Time [s]

Figure 2.13 Comparison of Results for control strategy with turbine governor
Top left: Generation Power of G1 Top Right: Line Power N8-N12
Bottom left: Mechanical Torque of G1 Bottom Right: Generator Speed of G1

The results in Figure 2.13 are from simulations using an excitation system for the
standard Kundur system and adding a turbine governor control for the frequency
regulation. The simulation shows that in this case the oscillation is well damped and
the performance has very good agreement between PSS/E and SIMPOW. This is due
to that the mechanical torque of the turbine and the generator frequency both are
controlled as shown in the bottom left plot in this figure.

However, in this thesis work, in order to run the adaptive controller in the same grid
environment, a system with fixed modelling is required. Here, the four machine
system with PSS control (Run as in Figure 2.10) is selected. The PSS control is
intentionally set with low gain. This is due to: (1) this system modelling has an
acceptable agreement. (2) A comparably badly damped original model is needed
to allow the adaptive controller to be tested in the most effective way.

21
2.4.3 Results: Comparison of Various Disturbances
In the previous section, comparison results of different modelling techniques are
discussed. Here, several kinds of disturbances are induced to test the dynamic
performance of the four machine system. The Kundur’s four machine system with
excitation control is tested here in the following six cases of disturbances:

A 3-phase short circuit in node 8, cleared after 200 ms without disconnection of any
line High power transfer case with 600MW powerflow from N7 to N9
B 3-phase short circuit in node 8, cleared after 200 ms with disconnection of one
N8-N9 line
. High power transfer case with 600MW powerflow from N7 toN9
C 3-phase short circuit in node 8, cleared after 200 ms with disconnection of one
N7-N8 line. High power transfer case with 600MW powerflow from N7 toN9
D 3-phase short circuit in node 8, cleared after 200 ms without disconnection of any
line.
Low power transfer case with 180MW powerflow from N7 toN9
E 3-phase short circuit in node 8, cleared after 200 ms with disconnection of one
N8-N9 line . Low power transfer case with 180MW powerflow from N7 to N9
F 3-phase short circuit in node 8, cleared after 200 ms with disconnection of one
N7-N8 line. Low power transfer case with 180MW powerflow from N7 toN9

The transmission power between node 8 and node 12 of the six cases are compared
here, since in the following chapter, the CSC facility controlled by the developed
adaptive controller will be added to this line. All the results are shown in the
following figure 2.14:

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection, Four-machine system, 3-ph SC for 200ms, TCSC line power transfer,
TCSC line power transfer, comparison between PSS/E and Simpow Comparison between PSS/E and Simpow
350 500
PSS/E PSS/E
SIMPOW 450 SIMPOW
300

400
250
350

200
Active Power[MW]

Active Power[MW]

300

150 250

200
100

150
50

Case A 100 Case B


0
50

-50 0
0 2.5 5 7.5 10 12.5 15 0 2.5 5 7.5 10 12.5 15
Time [s] Time [s]

22
Four-machine system, 3-ph SC for 200ms, High Power Case disconnec tion one of the N7-N8 lines, Four-machine system, 3-ph SC for 200ms, Low Power Case without line disconnectio
TCSC line power transfer without controller, Comparison between PSS/E and Simpow TCSC line power transfer, comparison between PSS/E and Simpow
300
140
PSS/E
PSS/E
SIMPOW
SIMPOW
250 120

100
200

Active Power[MW]
80
Active Power[MW]

150

60
100

40

50
20

0 CaseAC
Case 0
Case D
-50 -20
0 2.5 5 7.5 10 12.5 15 0 2.5 5 7.5 10 12.5 15
Time [s]
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 li
TCSC line power transfer, comparison between PSS/E and Simpow
180
Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N7-N8 lines,
PSS/E
TCSC line power transfer, comparison between PSS/E and Simpow
160 SIMPOW

140 PSS/E
140 SIMPOW

120
120
Active Power[MW]

100 Active Power[MW] 100

80 80

60
60

40
40
20 Case E Case F
20
0

0
-20
0 2.5 5 7.5 10 12.5 15
Time [s]
-20
0 2.5 5 7.5 10 12.5 15
Time [s]

Figure 2.14 Comparison of Results with different disturbances

From the simulation result presented in figure 2.14, it is shown that the power flow
transfer on line between node 7 and node 8 has very good agreement between PSS/E
and SIMPOW, especially for the cases D, E and F, which are the low power cases. In
the high power cases, the line disconnection action gives some errors in the magnitude
of the power oscillation when comparing the two software packages. The initial
damping for PSS/E is larger than that of SIMPOW. However, generally speaking, the
six three phase short circuit disturbances give almost the same system performance in
PSS/E and in SIMPOW. Hence, the same cases will be used in the following chapter
to test the behaviour of the developed adapted controller.

23
Chapter 3
Adaptive Control Methods

This chapter describes the developed adaptive control method that eliminates power
oscillation and controls the power flow in the power system. An overview of the
theory will be introduced here, since it is the focus of this thesis work.This chapter is
indispensable, because all the implementation of the controller, to be presented in the
following, in the software is based on the theory which is described here.

A system model is required for the design of any type of controller for power
oscillation damping and power flow control. Since the power system topology and
characteristics is constantly changing and its current state is not completely known to
the controller, a method which is robust to changes in the grid status is necessary. In
this project, we will use an adaptive controller which uses a very simplified grid
model to describe power systems with the common characteristic that they exhibit one
dominating mode of inter-area oscillation. The generic grid model has a few
parameters that are estimated by analysing the step response of the locally measured
FACTS line power to the changes in the line reactance initiated by the FACTS device.
The controller only utilizes signals measured locally at the FACTS device as inputs.

3.1 Reduced Grid Model


3.1.1 Reduced Grid Model Diagram

The reduced model of the power system consists of two synchronous machines with
interconnection transmission lines as outlined in figure 3.1. The line is characterized
by three parameters; one series reactance Xi which includes the inner reactance of
each machine and the reactance in the grid outside the loop, one reactance Xeq in
parallel with the control line, and one variable reactance X where the FACTS device
is installed. When applied to real power system, the model is considered as a
representation of two different areas with lumped moments of inertia and their
connecting power line. Ptot is the total active power transfer between two areas. The
power flow though the reactance controlled line is denoted by Pline .

Xeq X i = X i1 + X i 2
Ptot Pline

Xi1 X Xi 2
U 1, θ 1 U 2, θ 2

Figure 3.1 Reduced model diagram

24
3.1.2 Estimation of the Reduced Grid Model
Since the grid often changes topology when a power oscillation is initiated, the values
of the parameters in the reduced grid model have to be updated. This is done
measurement of the average power magnitude and the instantaneous value of the line
power. The average value of the line power during the oscillation is extracted by the
RLS (Recursive Least Squares) algorithm. The methods for phasor estimation using
RLS will be introduced in next section. The power magnitude instantaneous values
are collected right before and right after the controller initiates a discrete change in the
line reactance. The input data required for parameter estimation are presented in
figure 3.2,
Reduced Grid Parameter Estimation
500

400
P ´ xs ta te
Active Power (MW)

300

200 P´x
P xs ta te
Px

Series reactance (p.u.)


100 0


X

0 -0.05
0 5 T0 10 15
Time [s]

Figure 3.2 Reduced Grid Parameter Estimation

The plot illustrates the case of a three phase short circuit fault applied during 200ms at
t = 1 s. Subsequently, the fault is cleared and some lines are disconnected at t = 1.2 s.
The FACTS line active power flow curve is presented. Due to the line disconnection,
the reduced grid parameters are changed, so a new estimation of the parameters is
necessary. This can be achieved by one step reactance adjustment on FACTS line. At
time instant T 0 , line reactance is changed from the value X to X ´ . During the step
response, four different measurements are needed to be measured in order to get
updated value of Xi & Xeq . Those are,

Pxstate Average power on the line before the step


P′xstate Average power on the line after the step
Px Instantaneous power on the line before the step
P′x Instantaneous power on the line after the step

25
First, the estimation of Xeq , which can be interpreted as the total amount of reactance
connected in parallel to the FACTS line, is calculated based on the change in average
active line power Pxstate and P′xstate using the below expression.

P′Xstate
X− X′
Xeq = PXstate (3.1)
P′Xstate
−1
PXstate

The derivation of expression 3.1 and the expression for the new grid parameter Xi
described below are described in the references [1] and [2]. One key assumption to
derive these equations is that the total active power flow between the grid areas
remains constantbefore and after the change in the grid parameters.

The parameter Xi is derived from equations 3.2, 3.3 and 3.4,

X ′Xeq XXeq
ΔXtot = − . (3.2)
X ′ + Xeq X + Xeq

Here ΔXtot is the change in total reactance between areas due to the reactance step,

ΔXtot
Xtot = . (3.3)
PX ( X + Xeq )
−1
P′X ( X ′ + Xeq )

Xtot is the total reactance between areas. Finally, Xi is calculated as

X ⋅ Xeq
Xi = Xtot − . (3.4)
X + Xeq

In this estimation method, the accuracy of the measurement is very essential. Also,
when only a small change of reactance is executed, the calculation of parameter
updating should be inhibited. Otherwise, this may cause large estimation errors
especially for the value of Xi .

3.2 Phasor Estimation


3.2.1 Principle
In order to obtain the signals which are required in the reduced model estimation and
to implement the adaptive controller, it is necessary to separate the average and the
oscillation part of the measured line active power signal. This is accomplished by
using a Recursive Least Squares (RLS) algorithm. The algorithm is presented in the
reference [5]. The algorithm is based on the assumption that the power oscillation is

26
composed of one average component and one component with known frequency
range. The inputs of the RLS estimator are the measured power signal and the
expected power oscillation frequency Ω . The output of the RLS is the estimated value
of the line average power component and the oscillation power component (complex
number i.e. a phasor). It is represented by the expression 3.5
JG
{ }
P (t ) = Pav + Re Δ Pe jΩt . (3.5)
JK
Here Pav is the average power and Δ P is the extracted phasor. The phasor represents
the power oscillation in a coordinate system, which rotates with the expected
oscillation frequency. Once the phasor has been obtained, the real part of the phasor is
the oscillation power component. Furthermore, the imaginary part of the phasor is
also utilized in order to find the instants when the high and low peaks of the power
JG
{ }
oscillation occur. In these situations, Im Δ Pe jΩt = 0 .

3.2.2 Frequency Correction


As mentioned above, the phasor estimation requires the expected frequency of power
oscillation as an input signal. A small variation of the oscillation frequency will occur
due to varying network conditions. When the oscillation frequency deviates from the
phasor estimation frequency a phase error is obtained. In reference [4], an
introduction is given of how the frequency parameter is adapted to the actual
oscillation frequency by a PI controller. A frequency deviation limitation is used to
prevent the phasor estimation frequency from deviating too much from the expected
oscillation frequency.

3.2.3 Double RLS Estimation Method


In the RLS Estimation, the output signal Pav is sensitive to the filter’s bandwidth in the
phasor estimation algorithm. In order to measure the average active power P′xstate after
every step with a response time that is less that half the oscillation cycle, a fast
response of the Pav signal is required. This can be achieved by increasing the
bandwidth of the filter and resetting the RLS estimation after each step. However, a
high bandwidth for the filter brings gives undesired oscillations to the estimation
JK
value. Furthermore, resetting the RLS causes the phasor signal Δ P to change
dramatically after each control step. This will influence the frequency correction,
since the frequency correction module is using the phasor signal as input signal.

Therefore, in the developed adaptive controller, a double RLS estimation method is


utilized. The configuration diagram is in figure 3.3,

27
JK
RLS Estimation with
ΔP Frequency
Low Bandwidth Correction
Measured
Line Power Corrected Frequency

JK
RLS Estimation with Pav & Δ P signals
High Bandwidth for controller

Figure 3.3 Double RLS Estimation Diagram

In the figure 3.3, two RLS estimation modules are used. One module is using low
JK
bandwidth and its output signal Δ P is used as the input signal to the frequency
correction mechanism. Another module uses high bandwidth and resetting after each
JK
control step or fault. Hence the output signal Pav & Δ P will have fast responses which
is necessary for accurate parameter estimation. The simulation results of RLS
estimation during the damping of a power oscillation are shown in figure 3.4.

Double RLS estimation Output PAV Signal


450
MW LINE
400 RLS with High Bandwidth & Reset
RLS with Low Bandwidth
350

300
Active Power (MW)

250

200

150

100

50

0
0 5 10 15
Time [s]

28
Double RLS estimation Outout Phasor Signal
500
MW LINE
RLS with High Bandwidth & Reset
400 RLS with Low Bandwidth

300
Active Power (MW)

200

100

-100
0 5 10 15
Time [s]
JK
Figure 3.4 Double RLS Estimation Results of Pav & Δ P in PSS/E
Upper figure: Estimation of Average Component
Lower figure: Estimation of Oscillative Component

In figure 3.4, the result of RLS estimation with different bandwidths (–3 dB) is shown.
In the upper diagram the RLS estimator with high relative bandwidth,
(ΩHI-ΩLO) / (2Ω) = 1.5, and resetting configuration accurately estimates the average
power in power oscillation within one half cycle of power oscillation. In the lower
diagram, the real part of the phasor coordinate is plotted. This describes the oscillation
component in the measured line power. The red curve is with high bandwidth (ΩHI-
ΩLO) / (2Ω) = 1.6 and resetting configuration. This curve gives a good description of
the oscillation in the line power which is shown by the blue line. On the other hand,
the green curve with the low bandwidth setting (ΩHI-ΩLO) / (2Ω) = 0.3 changes more
smoothly which is important for the oscillation frequency correction. This signal will
is used as the input of the frequency correction module.

3.3 Theory of Adaptive Damping Controller


3.3.1 Problem Formulation
The theory of the adaptive damping controller is presented in detail in reference [5].
For the synchronous machine, when there exist an unbalance between mechanical
power fed into the machine and the electrical power extracted from it, a swing
equation can be used to describe how the rotor of the machine will move. Slightly
modifying the swing equation; the power swing of the reduced grid system which was
described in figure 3.1 can be derived using the following equation 3.6.

29
d 2θ 1 ω 0 ⎛ U 1U 2 sin(θ 1 − θ 2) ⎞
= ⎜ Pm1 − ⎟
dt 2
2H 1 ⎝ Xtot ⎠
(3.6)
d θ 2 ω0 ⎛
2
U 1U 2 sin(θ 2 − θ 1) ⎞
= ⎜ Pm 2 − ⎟
dt 2
2H 2 ⎝ Xtot ⎠

Here H 1, 2 are the inertia constants of each lumped machine representation, θ 1, 2 are the
electrical angles relative to the rotating frame of each machine. Pm1, 2 is the
mechanical power for each machine which assumed to be constant. U 1, 2 are the
voltages at the lumped machine terminals which are assumed to be well controlled
and constant. Xtot is the total reactance between the two swinging generators (areas)
and ω 0 is the electrical angular frequency of the grid.

The idea behind the control system that will be presented here is that once the reduced
model system is subject to an electro-mechanical oscillation, the control variable Xtot is
only allowed to change at the time instants coinciding with peaks of the power
oscillation. This is because at these instants, the time derivatives of the system state
variables θ 1, 2 are zero and the reactance between the model areas can be chosen such
that the steady state power flow at the actual angle difference between the machine
voltages corresponds to the actual measured power flow. . Since the time-derivatives
of the state variable are zero, no further oscillation will then occur.

The controller can, based on this principle, be designed to stabilize the system
completely in a number (N) of time steps. This can be done by adjusting the FACTS
line reactance between the machines, X , so that the resulting total reactance, Xtot,
fulfils equation 3.7,

U 1U 2 sin(θ 1 − θ 2)
Ptot = (3.7)
Xtot

Then the damping control problem can be written as an optimization problem defined
by 3.8,

( Ptot (θ 1( N ),θ 2( N ), Xtot ( N )) − Ptot 0 )


2
min (3.8)
Xtot (0... N )

Here Ptot 0 is the total average active power flow between the grid areas which is
estimated using the RLS algorithm and the knowledge of the reduced model
parameters.

3.3.3 Open loop Damping Controller with Power Set-Point


If the total reactance Xtot in the reduced grid changes due to the adjustment in the
series reactance X , (θ 1 − θ 2) in equation 3.7 will in the millisecond time-range stay
constant due to the machine inertias of the two areas. U 1 and U 2 are well controlled

30
and constant. Then, equation 3.7 is valid both before and after the reactance change,
and it can be extended to equation 3.9:

Pp 0 Xtot 0 = Pp1 Xtot1 (3.9)

Here, Pp 0 and Pp1 separately denote the total active power transmitted directly before
and directly after the step. Xtot 0 denotes the initial total reactance between areas
and Xtot1 is the reactance after the step. This relation can be used to find the necessary
change in line reactance in order to stabilize an oscillation by solving 3.8 to derive
controllers which ideally stabilize an oscillation in one or several discrete time-steps.

It is also possible to derive controllers which combine the two objectives power
oscillation damping and power flow control. It was shown in [4] how a controller
which changes the FACTS line power flow to a predefined set-point simultaneously
as a power oscillation is damped can be derived.

In this method, a given reactance is first connected in series with the line at one
oscillation peak, then a second change of line reactance is inserted half an oscillation
cycle later when the next oscillation peak occurs.

In order for the controller to function well, the grid parameters need to be estimated
with a reasonable accuracy. Since the grid parameters according to the reduced model
are not known directly after a fault, initial values have to be used. These have to be
chosen such that they do not give rise to instabilities in any system configuration.
Hence, damping based on these parameters will be generally suboptimal. However,
the initial actions of the damping controller based on the initial parameter values give
step response information to the parameter estimation routines and the controller
operation can be optimized as the damping action progresses.

The initial damping steps of the controller based on the two-step approach in 600MW
high power transfer case are shown in figure 3.5. The constant values of Xi = 0.01 and
Xeq = 0.35 are used here since the parameter estimation only can be performed after
these two-steps execution.

In the figure 3.5, the first step is inserted at time instant 2.8s, the second step is at 3.5s.
The power set-point is set to 300MW. The ideal result of the strategy should damp all
the oscillation in these two control steps. However, since the initial guess of the grid
parameters is conservative, the damping is not completed in two steps. On the other
hand, the damping action is partly hidden by the simultaneous change of
compensations which increased the observability of the oscillation. It is necessary to
reapply the controller with up-dated parameter values to complete the oscillation
damping. This procedure is described in the following section.

31
Two step power oscillation damping from PSS/E
500

Active Power (MW) 400

300

Series reactance (p.u.)


C SC L i n e Po w e r
200
First Step
0
Second Step
100 -0.02
C SC Se ri e s R e a cta n ce
-0.04

0 -0.06
0 2.5 5 7.5 10 12.5 15

Figure 3.5 Two-steps Action Results of FACTS Line Power &Reactance

3.3.3 Adaptive Controller with closed loop


As discussed above, the open loop controller is not sufficient to damp all the
oscillations or make an exact power flow control. In order to reduce the sensitivity to
model and parameter errors, a method using a feedback of the control parameter in
conjunction with the open loop control method is applied. This method solves the
optimization problem on the equation 3.8 in every time step, adjusting the control
signal from the latest result of the optimization.

Here the method is started by solving the equation 3.8 for two steps control. Then
after the second step, the FACTS line active power is measured and it is evaluated by
RLS whether the system is still in oscillation. In this case, another two steps action
will be triggered based on the updated estimation values of parameter Xi, Xeq and ω as
well as the measurement of the line average power and the magnitude of the
oscillation.

This process is repeated until no further oscillations are seen. At this point the
oscillation will be eliminated and power flow is controlled on a predefined set point.
The results of simulation using closed loop controller with two-steps action in
600MW high power transfer case are shown in figure 3.6.

From Figure 3.6 it can be seen that the power oscillation after a fault in the system is
well damped after six time steps with reactance changes. The power flow through the
FACTS line also ends up close to the predefined set point of 300MW. The time
period for stabilization is 7.1 seconds in this case. On the other hand, the grid

32
parameters are updated after each reactance step. These operations can help to
optimize the damping action progress.

Four-machine system, 3-ph SC for 200ms, FACTS line power and series reactance, from PSS/E
500 0.15

450 0.125
TC S C E n g a g e d
400 0.1
TC S C D i s e n g a g e d
350 0.075

S e rie s re a c ta n c e (p .u .)
A c tiv e P o w e r (M W )

300 0.05

250 0.025

200 0

150 -0.025

100 -0.05
TC S C R e a cta n ce
50 -0.075

0 -0.1
0 5 10 15
Time [s]

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Parameter Xi and Xeq, from PSS/E
0.4 0.2

0.36 0.18

0.32 0.16
XI

0.28 0.14
Reactance Xeq(p.u.)

Reactance XI(p.u.)

0.24 0.12

0.2 0.1

0.16 0.08

XE Q
0.12 0.06

0.08 0.04

0.04 0.02

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Figure 3.6 Closed Loop Control Results from PSS/E


Top Diagram: FACTS Line Power &Reactance
Bottom Diagram: Updated Grid Parameter Estimation

33
Chapter 4
Implementation of the Closed Loop Adaptive
Controller in PSS/E

This chapter will present how to simulate the closed loop adaptive controller in the
software PSS/E. The first section will give an introduction about the model writing in
PSS/E. The second part is meant to describe the construction of the code that models
the control strategy.

4.1 Model Writing in PSS/E


4.1.1 Background
In PSS/E, the goal of the dynamic simulations is to accurately simulate the response
of a physical system to some event. In order to simulate the system, the differential
equations describing the dynamic behaviour of the system must be supplied.

The PSS/E library contains a variety of models, which could fulfil the basic
simulation task. For example the generator model ‘GENROE’ ‘GENCLS’ and the
excitation system model ‘STAB1’ ‘EXAC4’, which are used in chapter 2 for basic
system testing. However, situations may arise in which there is no library model
which accurately describes a certain part of the system. In this thesis work, this is the
case when the developed adaptive controller should be added to the network for
dynamic simulation.

4.1.2 Model Requirements

First of all, the knowledge of either the FORTRAN programming language or FLECS
is required since all the syntax is based on these two languages.

After that, understanding of the requirement of the PSS/E model is necessary since
each module in the system is required to make different types of computations at
different stages in the dynamic simulation process.

A set of scalar variables are used to communicate between the PSS/E dynamic activity
and the different equipment models. PSS/E activities (STRT, RUN…) which invoke
equipment models set seven flags before calling these modules. At the most basic
model writing level, the MODE flag is the most critical of these variables. There are
totally 8 modes, but in this thesis work the checking and reporting functions are not

34
required, so only 4 model conditions need to be well defined in the code. The
significance of each MODE is described in table 4.1.

MODE=1 The model must initialize all of its state variables and algebraic variables
before the first network iteration
MODE=2 The model must make all computations for the state variables and place
time derivatives into the DSTATE array
MODE=3 The model must compute the present value of its output signal and place
it in to the network. In the controller in this thesis , the change of
network work impedence should be done here.
MODE=4 The model must update the PSS/E variable NINTEG indicating the
highest numbered of STATE being used. In this controller, two more
state variables are added to the previously given code.

Table 4.1 Function of the MODE Flag in PSS/E

The explanations of the other flags will not be given here since these flags will not
influence the main structure of the code in this thesis work.

4.1.3 Coordinated Call Models


Many equipment models are called to calculate current injections which are dependent
on the voltage at the bus to which they are connected. Models that contain both
differential equation responsibilities and current injection responsibilities need to be
implemented as ‘coordinated call’ models. Models for equipment such as static Var
systems, dc lines and FACTS devices are usually implemented as coordinated call.
Hereby, the code structure of the adaptive controller will also be considered as a
coordinate call model. The model is called from the subroutine CONEC for
calculation related to its differential equations and from the subroutine CONET for
current injection calculations.

There are two entry points in a coordinated call models. The model is called at its
primary entry point for the state variable calculation, which is done by the MODE flag
(MODE 1 through MODE 4) indicated. At each of the network iteration solutions, the
model is also called at the supplementary entry point to inject the model’s
contribution into the CURNT array. The CURNT array is the network solution current
injection to the bus at which the equipment is connected. Compared with the
SIMPOW code structure, the coordinate call models are unique in PSS/E, no current
incremental injection is needed in SIMPOW.

The supplementary ENTRY point name of a coordinated call model is formed by


replacing the first character of the subroutine name with a ‘T’. For the described
controller here, the subroutine which called from CONEC is named ‘MAINTC’, and
the subroutine which called from CONET is named ‘TAINTC’.

35
As mentioned above, due to that different models have different responsibilities in
PSS/E, the independent modules in the adaptive controller need to be located in the
corresponding models. Since the RLS routine and frequency correction are specified
by differential equations, they will be appended to subroutine ‘MAINTC’. However,
the parameter estimation and reactance step calculation will be put in the subroutine
‘TAINTC’ because they are only specified by algebraic equations.

4.1.4 Dynamic Simulation Setup with Controller Start-ups


The defined controller model is stored in the file ‘MAINTC.flx’. Once the model has
been written, it needs to be incorporated into the dynamic setup. Subsequently, some
change will be made compared to the introduction of dynamic simulation setup in
Chapter 2.

In the previous modelling study case, the two connection routines ‘conec.flx’ and
‘conet.flx’ are produced by the activity DYRE. Also a compiling file for compiling the
connection subroutines CONEC and CONET is generated by activity DYRE in the
form of a BATCH file. In order to compile the defined controller model together
with those modelling files, MAINTC.flx is also required to be compiled and linked in
the BATCH file. This is done by adding some commands into the BATCH file as
below,

Table 4.2 BATCH File for Compiling in PSS/E

In Table 4.2, the black part is the original portion generated by activity DYRE. If the
dynamic simulation is done without a user-written model, the execution of the batch
file will compile the subroutines CONEC and CONET. The red part is the user-
written model which can also be compiled together with PSS/E library models.
Through the CLOAD4 activity, the maintc.flx which defines controller model is
linked together with the network.

When this procedure is finished, provided that the user-written model is included,
three object files conec.obj, connect.obj and maintc.obj and a custom dynamically
linked library DSUSR.DLL will be generated in the working case directory.

36
Once the dynamic simulation starts, this custom DSUSR will be loaded instead of the
default (standard one) in the PSS/E library directory. Following the steps mentioned
above, the process in running simulation and plotting results will be the same as the
ones presented in Chapter 2.

4.2 Control Strategy Implementation in PSS/E

4.2.1 Original Code of Adaptive Controller in SIMPOW


Before this thesis work, the closed loop adaptive controller had been implemented and
tested on the digital simulation platform SIMPOW. However, the coding language
and the code structure are different from the ones used in PSS/E. One of the main
tasks for this thesis was to understand the control strategy from the code in SIMPOW
and try to transform it to into an acceptable structure for PSS/E.

In SIMPOW, the implementation of the controller can be divided into two parts. The
first part is power flow calculation by the OPTPOW module. In chapter 2, the
comparison results have already shown that the differences are small between PSS/E
and SIMPOW. The second part is dynamic simulation by DYNPOW. In this part, the
user-written code is formed by the DSL (Dynamic Simulation Language). Each signal
modules of the controller which are described in figure 1.2 are specified into
independent processes.

4.2.2 Strategy for transformation from SIMPOW to PSS/E


Due to the differences in code construction and language definition between
SIMPOW and PSS/E, some changes to the control strategy implementation should be
made in order to implement the controller in PSS/E using the same principles as in
SIMPOW. The changes in the implementation will be presented below, but note that
the softwares also differ in variable definition, measured signal extraction and
disturbance insertion. These functions will also have different settings, but since these
differences will not influence the code structure in general, they will not be described
here.

First of all, the simulation model is not defined in the same way by SIMPOW and
PSS/E. In SIMPOW, the dynamic simulation model is specified in a decomposed
form where it consists of several interconnected process. The processes are
interconnected with system variables and constants. Therefore, each module of the
controller can be described in an independent process, and it will communicate with
other processes using global variables. However, in PSS/E, a dynamic simulation
model should be specified as the way described in session 4.1. Following the common
way to model a FACTS device, the controller is defined in a coordinated model. In
this case, only two subroutines are used. All the independent modules of the controller

37
will be put into either the first entry point subroutine or the secondary entry point
subroutine.

Secondly, as described above, the control strategy contains reduced grid parameters
estimation and reactance step calculation. The time sequence scheduling of these two
modules are interlaced. In SIMPOW, these two functional modules are written in two
processes. The time sequence scheduling is finished by a DELAY function with a
constant delay time. However, in PSS/E these two modules of the controller need to
be united, since no time delay signal is available. This is done by defining four stages
for circulation in a time sequence for the parameter estimation and the step calculation.
The activities in these four stages are shown in table 4.3 and the scheme is shown in
figure 4.1.
Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 lines,
FACTS line power and series reactance, from PSS/E
175

s ta g e 1 ,2 ,3

150
s ta g e 4

125
Active Power (MW)

100

75

Series reactance (p.u.)


50 0,1
s ta g e 4
s ta g e 1 ,2 ,3
25 0

0 -0,1
0 5 10 15
Time [s]

Figure 4.1 Stages Distribution in PSS/E simulation

Stage 1 Measure P′xstate , X ′ , update Xi & Xeq as described in 3.1


Stage 2 Measure Pxstate , Px and X
Stage 3 Calculate the necessary reactance step ΔX
Stage 4 Measure P′

Pxstate Average power on the line before the step


P′xstate Average power on the line after the step
Px Instantaneous power on the line before the step
P′x Instantaneous power on the line after the step
X FACTS line reactance before the step
X′ FACTS line reactance after the step

Table 4.3 Activity Description of Stages in PSS/E

38
For the closed loop adaptive controller, stage 1 to 4 will be implemented repeatedly
until the oscillation is eliminated. Ideally, stage 1, 2 and 3 should be done at the peak
of the oscillation in the same instant. However, this is hard to achieve due to the time
required at each step for the calculations. Thus, stages will be triggered sequentially.
The interval between each stage is the simulation time step defined as ‘DELT’ in
PSS/E. Since the value of DELT is small (8.3ms), the assumption made here is that
the activities in stage 1 to stage 3 are processed at the same time.

Furthermore, the strategy of the adaptive controller requires that the peak value of the
power oscillation is detected and measured. This is achieved by the RLS phasor
detector. When the imaginary part of the phasor is zero, the oscillation is detected to
be at the peak value. In SIMPOW, the software can accept the definition as
‘Zim.EQ.0’. However, in PSS/E, the exact value definition is not valid for variables.
Thus, the sentence ‘Zim.GT.-0.02.AND.Zim.LT.0.02’ is used to find the peak of the
oscillation. Due to this, the grid parameters estimation and reactance step calculation
will not be triggered at exactly the same time instant in PSS/E and in SIMPOW. This
is one of the main reasons which induces estimation and calculation errors that causes
deviations between the simulation results using PSS/E and SIMPOW respectively.

4.3 Implementation Results in PSS/E

4.3.1 Results Analysis of Single RLS Estimation


Once the model of the controlled series reactance with the adaptive controller has
been inserted in series with one tie-line between bus 8 and bus 12 in the modified
Kundur system model, the improvement of the system stability can be evaluated by
time-domain simulations.

Initially the frequency correction system will be disabled in order to test the controller
in a simple and reliable way. A fixed frequency of 0.6 Hz is used for phasor
estimation. This means that the double RLS estimation routine will not be used
initially. Only the single RLS estimation with high bandwidth and resetting is utilized.

Initially, one fault case will be simulated in PSS/E. It is a three phase short circuit
fault at node 8, and after 200 ms the fault is cleared without line disconnection. A
high power transfer is used with totally 600MW flowing between the two areas in the
Kundur system. The post fault set point for the power flow on the line with the
FACTS controller is chosen to be 250MW. This is the same case as the Case A of the
modelling study in chapter 2. The results of the dynamical response for this high
power transmission case are plotted in figure 4.2.

39
Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
FACTS line power and series reactance, from PSS/E
400 0.15

350 0.125
TC SC En g a g e d

300 0.1
TC S C D i s e n g a g e d

250 0.075

Series reactance (p.u.)


200 0.05
Active Power (MW)

150 0.025

100 0

T C S C R e a c ta n c e
50 -0.025

0 -0.05

-50 -0.075

-100 -0.1
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Total line power transfer between two areas, from PSS/E
1200

1000

800
TC S C D i s e n g a g e d
Active Power[MW]

600

400

TC S C E n g a g e d

200

0
0 2.5 5 7.5 10 12.5 15
Time [s]

40
Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Parameter Xi and Xeq, from PSS/E
0.4 0.2

0.36 0.18

0.32 0.16
XI

0.28 0.14
Reactance Xeq(p.u.)

Reactance XI(p.u.)
0.24 0.12

0.2 0.1

0.16 0.08

XE Q
0.12 0.06

0.08 0.04

0.04 0.02

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Figure 4.2 High Power Case Result of Controller Test in PSS/E


Top: FACTS line active power
Middle: Total transfer power between two areas
Bottom: Updated grid parameters Xi and Xeq

As presented in figure 4.2, test results show that the closed loop adaptive controller
gives a good improvement in the system oscillation damping. The top graph reveals
that the powerflow reach the set point 250MW around 6.5 seconds after the
disturbance. Totally 7 steps are required to reach the control goals. The first step hits
the limitation of the bank capacity of the FACTS device. Due to this, the calculated
second step in the two-steps loop is inhibited and the controller is reset to recalculate
two new steps at the next oscillation peak. In this controller, the physical reactance
limitation of capacitor bank is set to be ±0.075 p.u. , the corresponding degree of
compensation in the FACTS line is 50%.

The middle graph shows the total power transfer between the two areas. It can be seen
that the oscillation of the total power also is stabilized at the value 600MW about 6.5
seconds after disturbance, which is the same as before the fault.

The bottom graph shows the updated value of the grid parameters Xi & Xeq . At first,
the grid parameters are unknown and the parameters are set to safe values which will
not introduce negative damping in any possible configuration of the system. Then the
parameters Xi & Xeq are updated after each reactance step response in the FACTS line
active power provided that the step response exceeds a certain magnitude. This low
limit for estimation is used to reduce the risk of errors in the estimation process. As
the system parameters are estimated with better accuracy, the damping is more and

41
more effective. It can be seen from the figure that the parameters Xi & Xeq start from
the safe value at Xi = 0.10 p.u. and Xeq = 0.35 p.u. , and stabilize close to Xi = 0.175 p.u.
and Xeq = 0.085 p.u. after seven steps in the FACTS device series reactance.

Due to the importance of the estimation module in the adaptive controller, some limits
and protection schemes are added to the estimation routine. For example, if the
estimation of Xi & Xeq results in negative values, the estimation data will not be
updated. Also, a forgetting factor is used to balance how much weight is put on old
values of estimated parameters compared to recently estimated ones. Here, the
forgetting factor will set to be 1, which means that the average of the last parameter
value and new estimated value will be considered as the updated value. The function
of the forgetting factor is illustrated in figure 4.3

Forgetting Factor Influence on XEQ estimation


0.35
Updated value
Estimated value
0.3

0.25
Reactance Xeq(p.u.)

0.2

0.15

0.1

0.05

0
0 5 10 15
Time [s]

Figure 4.3 Forgetting Factor Influence on Xeq Updated

The above figure 4.3 shows the progression of the grid parameter Xeq in the high
power transfer case tested in PSS/E. The red line in the figure shows that the
estimated value is quite similar after each step, which means the performance of
estimation routine is accurate. The blue line reveals that the updated value is
approaching to the estimation value by step by step. Thus, in this case, the forgetting
factor delays the estimation of an accurate Xeq value. However in some other cases
this function will prevent the system from accepting bad estimation values directly by
using the old values to neutralize the errors.

42
The above figures show that the performance of the adaptive control strategy which is
simulated in PSS/E is satisfactory in this fault case. In this high power transfer case, after
adding the controller into the Kundur system network, the damping of the oscillation
mode became adequate and the power flow on the control line was also stabilized close to
the set point. One assumption made here is that all signals measured at the FACTS line is
without noise and delay. Under this circumstance, both grid parameters estimation and
reactance steps calculation are reasonable and effective.

It should be noted though that since the detection frequency is set to a constant value, the
extraction result from the phasor detector would will have a small phase shift compared
original system oscillation curve if the actual value of the frequency deviates from the
initial guess. Consequently, the time instants for step insertion will not be completely
correct.

Later on, in order to find out a more accurate way of control strategy,the adaptive
controller with double RLS estimation method which was mentioned in section 3.2.3 will
be tested.

43
Chapter 5
Dynamic Simulation Results Comparison
between SIMPOW & PSS/E

This chapter will give the simulation results of the damping controller both in
SIMPOW and in PSS/E. Three high power transfer cases and three low power cases
with different line disconnections will be tested here. A discussion of the results is
also included.

5.1 Setup of the Result Comparison


5.1.1 Basic System Coherence
Since the comparison will be done in two different softwares, the coherence of the basic
system in these two softwares is important. In chapter 2, the four-machine Kundur system
was simulated in six different cases without the developed controller both in power flow
calculation and in dynamic simulation part. Although the results reveal some differences
between the softwares, the general impression is that the implementations have almost
the same static and dynamical behaviour.

Especially in the dynamic simulation, the power oscillation after faults in different cases
all have the same oscillation frequency in the two softwares, but they show a slight error
in the magnitude of the oscillation. This means that, when the controller is implemented,
the reactance steps for damping in the different softwares should have the same rhythm,
but they may have slightly different magnitudes.

In this chapter, the dynamic simulation result differences, when different software
programs were utilized, for the initial system will be neglected, and the assumption is
made that the Kundur system has the same initial performance in PSS/E and in SIMPOW
when the developed controller is not used.

5.1.2 Results comparison in Matlab

The output plot function has different configurations in PSS/E and SIMPOW. In
PSS/E it is necessary to select the variables which should be observed before
compilation by the activity CHAN. In SIMPOW, this is done bypredefining the
variables by the statement PLOT in the user-written process.

The output file generated by PSS/E has the suffix .dat, and the output file of
SIMPOW has the suffix .txt. Both kinds of files are readable in Matlab. However, the
file generated by PSS/E is using character explanation for each variable. Due to this,
an extraction process is necessary in order to get a pure numeric file. This is done

44
principally by the instruction FGETL in Matlab. Subsequently, the Matlab function
DLMREAD is used to read the numeric data into a matrix. The comparison can be
done by extracting corresponding columns in the different matrices of the results.

5.2 Comparison Results Analysis


5.2.1 Results Summarized
In order to demonstrate the damping performance of the controller, the system is
simulated in six different cases for a high (200 MW/line) and a low (60 MW/line)
loading situation of the tie lines between the areas. These are the same cases which
have been tested in the modeling study of chapter 2. All loads are voltage dependent
with constant current characteristics for the active power and constant impedance
characteristics for the reactive power load.

To include frequency correction, the double RLS estimation routine is used here. The
initial search frequency is 0.6 Hz , and the frequency correction limits are ±0.15Hz .
Once the power oscillation exceeds a certain range, the frequency correction will be
triggered. When the oscillation is eliminated, the frequency correction will be turned
off.

The studied cases are:

A&D 3-phase short circuit in node 8, cleared with no line disconnecting after 200ms.
High(A)/Low(D) power transfer case with 600 MW (A) / 180 MW (D)
powerflow between N7-N9
B&E 3-phase short circuit in node 8, cleared with disconnecting one N8-N9 line
after 200ms. High(B)/Low(E) power transfer case with 600 MW (B) / 180
MW (E) powerflow between N7-N9
C&F 3-phase short circuit in node 8, cleared with disconnecting one N7-N8 line
after 200ms. High(C)/Low(F) power transfer case with 600 MW (C) / 180
MW (F) powerflow between N7-N9

The results are summarized in table 5.1. Here, the power oscillation maximum peak-
to-peak value is given as Oscpp (MW); the damping exponent with the damping
controller disengaged is denoted σ i . The inter-area mode oscillation frequency fi for
each case is given in Hz. The time for the system to stabilize (when the oscillation
amplitude has dropped to below 10MW) is given for the undamped system as Ti(S)
and for the damped system as Tcsc( s) . The necessary number of reactance steps for
complete damping is denoted as Steps. The power flow set point is defined
as Pxbv and P csc is the final active power flow on the FACTS line after simulation.
The value of the original parameters σ i, fi and Ti are quoted from reference [3].

45
CASE A CASE B CASE C
fi = 0.65 fi = 0.55 fi = 0.54
σ i = −0.001 σ i = −0.045 σ i = −0.059
Ti = 3700 Ti = 82 Ti = 56
Pxbv = 250 Pxbv = 300 Pxbv = 200

600MW OSCpp = 260 OSCpp = 240 OSCpp = 140


N7-N9 T csc = 7.2 T csc = 7.1 T csc = 8.9
From PSS/E Steps = 7 Steps = 5 Steps = 8
P csc = 250 P csc = 300 P csc = 200

600MW OSCpp = 260 OSCpp = 250 OSCpp = 180


N7-N9 T csc = 7.2 T csc = 8.0 T csc = 8.8
From SIMPOW Steps = 7 Steps = 6 Steps = 8
P csc = 250 P csc = 300 P csc = 200

CASE D CASE E CASE F


fi = 0.72 fi = 0.68 fi = 0.68
σ i = −0.12 σ i = −0.097 σ i = −0.1
Ti = 26 Ti = 36 Ti = 32
Pxbv = 60 Pxbv = 90 Pxbv = 70

180MW OSCpp = 100 OSCpp = 120 OSCpp = 100


N7-N9 T csc = 5.9 T csc = 4.2 T csc = 5.4
From PSS/E Steps = 6 Steps = 4 Steps = 5
P csc = 60 P csc = 90 P csc = 70

180MW OSCpp = 90 OSCpp = 120 OSCpp = 100


N7-N9 T csc = 6.0 T csc = 4.2 T csc = 5.5
From SIMPOW Steps = 5 Steps = 4 Steps = 5
P csc = 60 P csc = 90 P csc = 70

Table 5.1 Dynamic Simulation Result of Damping


Controller in PSS/E & SIMPOW

It can be seen from the table 5.1 that the damping of the system is significantly
improved, and that the oscillations in all cases are eliminated within ten seconds after
the fault.

It can be noted that in the high power transfer situation, more steps are needed to
damp the oscillation with the same fault comparing to the low power transfer case.
The stabilization times in the same case are generally close to equal in PSS/E and in
SIMPOW. The number of steps required for damping is equal in all cases except for
cases B and D.

46
5.2.2 Plot Results Analysis

All the comparison results of time domain simulation in the six cases mentioned
above are plotted in Matlab. The results reveal that the control strategy performance is
very similar in SIMPOW and PSS/E. However, some small differences still exist
between the implementation, especially in the high power transfer cases.

Here, firstly contingency B will be discussed since this fault case shows the largest
deviations between the two softwares. The results of the other five cases will be
presented later in this section, since all these results show better agreements than the
case B.

In case B, the initial oscillation of the Kundur system without damping controller
already shows some deviation in the amplitudes for the two softwares. This was
presented in table 2.5, and it is shown again in figure 5.1
Four-machine system, 3-ph SC for 200ms, TCSC line power transfer,
Comparison between PSS/E and Simpow
500
PSS/E
450 SIMPOW

400

350
Active Power[MW]

300

250

200

150

100

50

0
0 2.5 5 7.5 10 12.5 15
Time [s]

Figure 5.1 FACTS line power of Case B without


Adaptive Controller in PSS/E & SIMPOW

Figure 5.1 reveals that the oscillation in SIMPOW is less damped than the one in
PSS/E, which means more supplementary damping is required for stabilizing the
oscillation in SIMPOW than in PSS/E. The adaptive damping controller is then used
to improve the damping. In this case, we expect that the controller reactance step
reactions in SIMPOW should have larger magnitudes than those of PSS/E.

The FACTS line transmitted power and reactance step reactions of case B are plotted
in figure 5.2,

47
Four-machine system, 3-ph SC for 200ms, High Power Case disconnection one of the N8-N9 lines,
TCSC line power transfer & TCSC Reactance, Comparison between PSS/E and Simpow
500 0.15
SIMPOW
450 PSS/E 0.125

FAC TS Line P ow er
400 0.1

350 0.075

Series reactance (p.u.)


Active Power (MW)

300 0.05

250 0.025

200 0

150 -0.025

100 -0.05
S eries R eac tanc ed
50 -0.075

0 -0.1
0 2.5 5 7.5 10 12.5 15
Time [s]

Figure 5.1 Results of FACTS line power and Series Reactance Steps
of Case B with Adaptive Controller in PSS/E & SIMPOW

From figure 5.1 it is seen that one more reactance step is necessary in SIMPOW than
in PSS/E to damp the oscillation. This is due to that the magnitude of the oscillation at
t=5 seconds larger in magnitude in SIMPOW than in PSS/E. Also, the reactance step
differences between the two softwares are influenced by grid parameter estimation
differences. The estimation results of Xi and Xeq are plotted in figure 5.2.

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Parameter XI & XEQ, Comparison between PSS/E and Simpow
0.4 0.24
PSS/E
SIMPOW
0.35 0.21

0.3 0.18

XI
Reactance Xeq(p.u.)

0.25 0.15
Reactance XI(p.u.)

0.2 0.12

0.15 0.09

XEQ
0.1 0.06

0.05 0.03

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]
Fig 5.2 Grid Parameter Estimation
Comparison in PSS/E & SIMPOW

48
Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Corrected Frequency, comparison between PSS/E and Simpow
0.8
PSS/E
0.75 SIMPOW

0.7
A c tiv e P ower[M W ]

0.65

0.6

0.55

0.5

0.45

0.4
0 2.5 5 7.5 10 12.5 15
Time [s]

Fig 5.3 Frequency Correction


Comparison in PSS/E & SIMPOW

Figure 5.2 shows that all of the estimation values after steps are in an acceptable range.
The estimation values of Xeq in the different softwares are closer to each other than
those for the parameter Xi . The estimation of Xi is more sensitive to modelling and
measurement errors since it uses instantaneously measured data. The estimation of
Xeq on the other hand utilizes average values of data which is more reliable making it
the estimation process more accurate. The measured data in PSS/E & SIMPOW will
not be exactly the same at the same time instant, which is the main reason for the
difference in grid parameter estimation.

In figure 5.3, the frequency correction results for PSS/E and SIMPOW are presented.
In this case, the differences in the frequency correction are more obvious than those in
of the other parameters. This is due to that in this high power transfer case, the initial
power flow and the reactance steps of the control strategy are different in PSS/E and
SIMPOW. Before t=5 seconds in the simulation, the results show better agreement
since the power flow and reactance are almost the same in the two softwares.
However, after t=5 seconds, due to the more dramatic change of the fourth reactance
step in SIMPOW, the frequency correction is also changed dramatically in SIMPOW.
The frequency correction is terminated one second later in SIMPOW since one more
reactance step is executed in this software.

Here the results of the other five cases simulated in PSS/E & SIMPOW will be shown.
The cases are:

49
A&D 3-phase short circuit in node 8, cleared with no line disconnecting after 200 ms.
High (A) /Low (D) power transfer case with 600 MW (A) / 180 MW (D)
powerflow between N7-N9
E 3-phase short circuit in node 8, cleared with disconnecting one N8-N9 line
after 200 ms. Low power transfer case with 180 MW powerflow between N7-
N9
C&F 3-phase short circuit in node 8, cleared with disconnecting one N7-N8 line
after 200 ms. High (C) /Low (F) power transfer case with 600 MW (C) / 180
MW (F) powerflow between N7-N9

From the above discussion as well as from results of the other five cases shown here,
it can be seen that although some slight different can be found in the simulation
results of the PSS/E and SIMPOW implementations, the control strategy generally
shows very similar and good performance both in PSS/E and SIMPOW.

The figures of each case are arranged in the following order:

1. Results of active power flow on the FACTS line and series reactance steps
2. Estimation results of grid parameters Xi & Xeq
3. Results of frequency correction

50
CASE A
Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
TCSC line power transfer & TCSC Reactance, Comparison between PSS/E and Simpow
400
SIMPOW
PSS/E
350

300

250

200

Active Power (MW) 150 0,1

Series reactance (p.u.)


100 0,06

50 0,02

0 -0,02

-50 -0,06

-100 -0,1
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Parameter XI & XEQ, Comparison between PSS/E and Simpow
0,4 0,4
SIMPOW
PSS/E
0,35

0,3 0,3

XI
Reactance Xeq(p.u.)

Reactance XI(p.u.)
0,25

0,2 0,2

0,15

0,1 0,1

0,05
XE Q

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Corrected Frequency, comparison between PSS/E and Simpow
0.8
PSS/E
SIMPOW
0.75

0.7

0.65
Active Power[MW]

0.6

0.55

0.5

0.45

0.4
0 2.5 5 7.5 10 12.5 15
Time [s]

51
CASE C
Four-machine system, 3-ph SC for 200ms, High Power Case disconnection one of the N7-N8 lines,
TCSC line power transfer & TCSC Reactance, Comparison between PSS/E and Simpow
400
SIMPOW
350 PSS/E

300

250

Active Power (MW) 200

150 0,1

Series reactance (p.u.)


100 0,06

50 0,02

0 -0,02

-50 -0,06

-100 -0,1
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, High Power Case disconnection one of the N7-N8 lines,
Parameter XI & XEQ, Comparison between PSS/E and Simpow
0.4 0.4
SIMPOW
0.36 PSS/E 0.36

0.32 0.32

0.28 0.28
Reactance Xeq(p.u.)

Reactance XI(p.u.)
0.24 0.24

0.2 0.2

0.16 0.16

0.12 0.12

0.08 0.08

0.04 0.04

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, High Power Case without line disconnection,
Corrected Frequency, comparison between PSS/E and Simpow
0.8
PSS/E
SIMPOW
0.75

0.7

0.65
Active Power[MW]

0.6

0.55

0.5

0.45

0.4
0 2.5 5 7.5 10 12.5 15
Time [s]

52
CASE D
Four-machine system, 3-ph SC for 200ms, Low Power Case without line disconnection,
TCSC line power transfer & TCSC Reactance, Comparison between PSS/E and Simpow
150
SIMPOW
PSS/E
125

100

Active Power (MW) 75

50 0.1

Series reactance (p.u.)


25 0.05

0 0

-25 -0.05

-50 -0.1
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case without line disconnection,
Parameter XI & XEQ, Comparison between PSS/E and Simpow
0.4 0.2
SIMPOW
PSS/E
0.35

0.3 0.15
Reactance Xeq(p.u.)

Reactance XI(p.u.)
0.25
XI

0.2 0.1

0.15

0.1 0.05

XE Q
0.05

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case without line disconnection,
Corrected Frequency, comparison between PSS/E and Simpow
0.85
PSS/E
SIMPOW
0.8

0.75
Active Power[MW]

0.7

0.65

0.6

0.55

0.5
0 2.5 5 7.5 10 12.5 15
Time [s]

53
CASE E
Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 lines,
TCSC line power transfer & TCSC Reactance, Comparison between PSS/E and Simpow
200
SIMPOW
175 PSS/E

150

125

Active Power (MW)


100

75 0,1

Series reactance (p.u.)


50 0,06

25 0,02

0 -0,02

-25 -0,06

-50 -0,1
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 lines,
Parameter XI & XEQ, Comparison between PSS/E and Simpow
0,48 0.2
SIMPOW
PSS/E

XI
0,36 0.15
Reactance Xeq(p.u.)

0,24 0.1 Reactance XI(p.u.)

XE Q

0,12 0.05

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 lines,
Corrected Frequency, comparison between PSS/E and Simpow
0.8
PSS/E
SIMPOW

0.75

0.7
Active Power[MW]

0.65

0.6

0.55

0.5
0 2.5 5 7.5 10 12.5 15
Time [s]

54
CASE F
Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N7-N8 lines,
TCSC line power transfer & TCSC Reactance, Comparison between PSS/E and Simpow
150
SIMPOW
PSS/E
125

100

Active Power (MW) 75

50 0,1

Series reactance (p.u.)


25 0,05

0 0

-25 -0,05

-50 -0,1
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N7-N8 lines,
Parameter XI & XEQ, Comparison between PSS/E and Simpow
0,4 0.2
SIMPOW
PSS/E

0,32 0.16
Reactance Xeq(p.u.)

Reactance XI(p.u.)
0,24 XI 0.12

0,16 0.08

0,08 0.04

XE Q

0 0
0 2.5 5 7.5 10 12.5 15
Time [s]

Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 lines,
Corrected Frequency, comparison between PSS/E and Simpow
0.8
PSS/E
SIMPOW
0.75

0.7

0.65
Active Power[MW]

0.6

0.55

0.5

0.45

0.4
0 2.5 5 7.5 10 12.5 15
Time [s]

55
Chapter 6
Conclusions and Future Work

This chapter will summarize the work and the achievements of the thesis work. Also
possible future work in this project will be suggested.

6.1 Conclusions
The task of this Master thesis work was to implement the adaptive controller for a
CSC in the power system simulation software PSS/E. A simple four-machine model
of a power system is used to demonstrate the performance of the controller for
different contingencies and operating points.

The research in this thesis includes two parts. One part is the modeling study, and the
other part is the controller implementation and comparison in PSS/E and SIMPOW.

The first part shows that both in the power flow study and in the dynamic study, the
performances of the Kundur four machine system show good agreement in PSS/E and
SIMPOW. Consequently, this system model can be utilized for testing of the proposed
controller.

The other part describes the implementation of the adaptive controller in PSS/E. The
result shows that this control strategy can be carried out satisfactory in PSS/E. Due to
the slight differences in the power system model in PSS/E and SIMPOW, the
reactance steps required to fulfill the tasks are not exactly the same. However, the
controller can damp oscillations and adjust the power flow to the set point within ten
seconds after the fault both in SIMPOW and PSS/E for all the studied fault cases.

In other words, the simulation results of the thesis have validated the feasibility of the
developed adaptive controller in the power system simulation software PSS/E.

6.2 Future Work


Although the adaptive controller has a promising performance in PSS/E, some
improvements can still be made.

First of all, all of the simulations in PSS/E were done by the assumption that no
measurement noise is present at the controller input. In a future implementation it
would be interesting to look at how the controller operation is affected by pseudo-
random noise added to the controller input.

56
Secondly, in this control strategy, the precision of the reduced grid parameters
estimation is improved stepwise by reactance step execution. Some improvements can
be done in order to make the accuracy the estimations better.

Furthermore, the simulation software PSS/E should be used to test the adaptive
controller in a more realistic power system model of higher complexity as well as in
some other faults and disconnection circumstances for the four machine system in
order to perform a full verification of the controller.

57
Appendix A
Power Flow Raw Data
A power flow raw data file which describes the Kundur’s system for the high power
flow case is presented in here.

0, 100.00 / PSS/E-29.0 SUN, SEP 16 2007 17:17


A FOUR MACHINE SYSTEM

100,'GEN1 ', 20.0000,2, 0.000, 0.000, 1, 1,1.03000, 20.2000, 1


200,'GEN2 ', 20.0000,2, 0.000, 0.000, 1, 1,1.01000, 10.5000, 1
300,'GEN3 ', 20.0000,3, 0.000, 0.000, 2, 1,1.03000, -6.8000, 1
400,'GEN4 ', 20.0000,2, 0.000, 0.000, 2, 1,1.01000, -17.0000, 1
500,'TRAN1 ', 230.0000,1, 0.000, 0.000, 1, 1,1.00000, 0.0000, 1
600,'TRAN2 ', 230.0000,1, 0.000, 0.000, 1, 1,1.00000, 0.0000, 1
700,'BUSAREA1', 230.0000,1, 0.000, 400.000, 1, 1,1.00000, 0.0000, 1
710,'LOADBUS1', 230.0000,1, 0.000, 0.000, 1, 1,1.00000, 0.0000, 1
800,'BUSAREA3', 230.0000,1, 0.000, 100.000, 3, 1,1.00000, 0.0000, 1
900,'BUSAREA2', 230.0000,1, 0.000, 400.000, 2, 1,1.00000, 0.0000, 1
1000,'TRAN4 ', 230.0000,1, 0.000, 0.000, 2, 1,1.00000, 0.0000, 1
1100,'TRAN3 ', 230.0000,1, 0.000, 0.000, 2, 1,1.00000, 0.0000, 1
1200,'TCSC ', 230.0000,1, 0.000, 0.000, 3, 1,1.00000, 0.0000, 1
0 / END OF BUS DATA, BEGIN LOAD DATA
700,'1 ',1, 1, 1, 717.000, 50.000, 0.000, 0.000, 0.000, 0.000, 1
710,'1 ',1, 1, 1, 250.000, 50.000, 0.000, 0.000, 0.000, 0.000, 1
900,'1 ',1, 2, 1, 1967.000, 100.000, 0.000, 0.000, 0.000, 0.000, 1
0 / END OF LOAD DATA, BEGIN GENERATOR DATA
100,'1 ', 800.000, 185.000, 9999.000, -9999.000,1.03000, 0, 900.000, 0.00000, 0.30000,
0.00000, 0.00000,1.00000,1, 100.0, 9999.000, -9999.000, 1,1.0000
200,'1 ', 800.000, 235.000, 9999.000, -9999.000,1.01000, 0, 900.000, 0.00000, 0.30000,
0.00000, 0.00000,1.00000,1, 100.0, 9999.000, -9999.000, 1,1.0000
300,'1 ', 719.000, 176.000, 9999.000, -9999.000,1.03000, 0, 900.000, 0.00000, 0.30000,
0.00000, 0.00000,1.00000,1, 100.0, 9999.000, -9999.000, 1,1.0000
400,'1 ', 700.000, 202.000, 9999.000, -9999.000,1.01000, 0, 900.000, 0.00000, 0.30000,
0.00000, 0.00000,1.00000,1, 100.0, 9999.000, -9999.000, 1,1.0000
0 / END OF GENERATOR DATA, BEGIN BRANCH DATA
500, 600,'1 ', 0.00250, 0.02500, 0.04375, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
600, 700,'1 ', 0.00100, 0.01000, 0.01750, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
700, 710,'1 ', 0.00010, 0.00100, 0.00175, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
700, 800,'1 ', 0.01500, 0.15000, 0.26250, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
700, 800,'2 ', 0.01500, 0.15000, 0.26250, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
700, 800,'3 ', 0.01500, 0.15000, 0.26250, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
800, 900,'1 ', 0.01500, 0.15000, 0.26250, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
800, 900,'2 ', 0.01500, 0.15000, 0.26250, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
800, 1200,'1 ', 0.00000, -0.00001, 0.00000, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000

58
900, 1000,'1 ', 0.00100, 0.01000, 0.01750, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
900, 1200,'1 ', 0.01500, 0.15000, 0.26250, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
1000, 1100,'1 ', 0.00250, 0.02500, 0.04375, 0.00, 0.00, 0.00, 0.00000, 0.00000, 0.00000,
0.00000,1, 0.00, 1,1.0000
0 / END OF BRANCH DATA, BEGIN TRANSFORMER DATA
100, 500, 0,'1 ',1,2,1, 0.00000, 0.00000,2,'TRANS1 ',1, 1,1.0000
0.00000, 0.15000, 900.00
1.00000, 0.000, 0.000, 0.00, 0.00, 0.00, 0, 0, 1.10000, 0.90000, 1.10000, 0.90000, 33, 0,
0.00000, 0.00000
1.00000, 0.000
200, 600, 0,'1 ',1,2,1, 0.00000, 0.00000,2,'TRANS2 ',1, 1,1.0000
0.00000, 0.15000, 900.00
1.00000, 0.000, 0.000, 0.00, 0.00, 0.00, 0, 0, 1.10000, 0.90000, 1.10000, 0.90000, 33, 0,
0.00000, 0.00000
1.00000, 0.000
300, 1100, 0,'1 ',1,2,1, 0.00000, 0.00000,2,'TRANS3 ',1, 1,1.0000
0.00000, 0.15000, 900.00
1.00000, 0.000, 0.000, 0.00, 0.00, 0.00, 0, 0, 1.10000, 0.90000, 1.10000, 0.90000, 33, 0,
0.00000, 0.00000
1.00000, 0.000
400, 1000, 0,'1 ',1,2,1, 0.00000, 0.00000,2,'TRANS4 ',1, 1,1.0000
0.00000, 0.15000, 900.00
1.00000, 0.000, 0.000, 0.00, 0.00, 0.00, 0, 0, 1.10000, 0.90000, 1.10000, 0.90000, 33, 0,
0.00000, 0.00000
1.00000, 0.000
0 / END OF TRANSFORMER DATA, BEGIN AREA DATA
0 / END OF AREA DATA, BEGIN TWO-TERMINAL DC DATA
0 / END OF TWO-TERMINAL DC DATA, BEGIN VSC DC LINE DATA
0 / END OF VSC DC LINE DATA, BEGIN SWITCHED SHUNT DATA
0 / END OF SWITCHED SHUNT DATA, BEGIN IMPEDANCE CORRECTION DATA
0 / END OF IMPEDANCE CORRECTION DATA, BEGIN MULTI-TERMINAL DC DATA
0 / END OF MULTI-TERMINAL DC DATA, BEGIN MULTI-SECTION LINE DATA
0 / END OF MULTI-SECTION LINE DATA, BEGIN ZONE DATA
0 / END OF ZONE DATA, BEGIN INTER-AREA TRANSFER DATA
0 / END OF INTER-AREA TRANSFER DATA, BEGIN OWNER DATA
0 / END OF OWNER DATA, BEGIN FACTS DEVICE DATA
0 / END OF FACTS DEVICE DATA

59
REAL STSBST, K1GAIN, K2GAIN, PHASOR, SIGNAL, MWLINE, NEWSIGNAL, C[MAINTC]
BYPSSTIME, MNTBYPSS,MXCAPBST C
REAL PAV, REALDP, IMAGDP, DPAV, DREALDP, DIMAGDP, PI, FRQOSC, WREF, THETA, SUBROUTINE MAINTC (I,J,K,L)
DTHETA, REALRF, IMAGRF C
REAL REALTM, IMAGTM, REALAU, IMAGAU, COAVFRQ, COFLFRQ, ALPHA, KAV, KPH, C
RE_REF, IM_REF, TSTART,DEL_I,DDEL_I C
REAL OPERAT, TETACS, DTETACS, PHREAL, PHIMAG, NEWFRQ, ARGREF, XDIF, YDIF, C SUBROUTINE MAINTC/TAINTC
ANGDIF, KDF, TDF, DELFRQ C TCSC MAIN CIRCUIT MODEL
REAL DFMAX, DFMIN, STOREKP6 C
REAL TK C I = STARTING 'ICON' INDEX [ USES ICON(I) THROUGH ICON(I+22) ]
REAL XSIAV, XSIPH, KAPPAAV, KAPPACS, KAPPASN, MWHAT, INNOV C J = STARTING 'CON' INDEX [ USES CON(J) THROUGH CON(J+24) ]
REAL X1 C K = STARTING 'STATE' INDEX [ USES STATE(K) THROUGH STATE(K+6) ]
REAL XI XD XEQ XINIT C L = STARTING 'VAR' INDEX [ USES VAR(L) THROUGH VAR(L+30) ]
Appendix B

REAL XOLD XTOT0 PTOT0 POSC C


REAL DELTAXTOT A1 C INTICN(I) = FROM BUS SEQUENCE NUMBER
REAL TRIGGERTIME PPEAK1 C INTICN(I+1) = TO BUS SEQUENCE NUMBER
current studied controller.
REAL PMEAN1 XSTART XFINAL PMEAN0 PPEAK0 C INTICN(I+2) = BRANCH SINGLE ENTRY LIST INDEX
REAL XEQEST XTOTINIT XIEST DELTAXTOT1 XIOLD XEQOLD $1
REAL DELTAXBV PXBV DELTAXBV1 XTOT2BV XTOT1BV C
REAL DXTOTBV1 DXTOTBV2 XSTEP1 XDBV1 XSTEP2 USE DYNAMICS, ONLY: CON, VAR, ICON, INTICN,
REAL XHILIM, XLOWLIM, DELTAX, DELTAX2ND * CHRICN,
REAL FAULTTIME FAULTDELAY FAULTDELAY2 STEPTIME TIMESTAGE4 * STORMT, STATE, DSTATE, STORE,
REAL MWLINETOT * BSFREQ
REAL PAV1, REALDP1, IMAGDP1, DPAV1, DREALDP1, DIMAGDP1 USE PSSCM4, ONLY: BASVLT, BUSNAM, VOLT,
REAL XSIAV1, XSIPH1, KAPPAAV1, KAPPACS1, KAPPASN1, MWHAT1, INNOV1, lambda, * ICOM,
OscLimit * GB,

60
INTEGER ATSTEP * TAPNO,
INTEGER PROT,FLGSWG,OPMODE, MODEOP, WORKAS, FLGSTART STAGE * ZERNUM
LOGICAL TRIGGER1 TRIGGERTIME1 TRIGGERTIME2 X0 TRIGGER2 USE LFSOLN_MODULE, ONLY: CURNT
LOGICAL FAULTINHIBIT FAULTRES ISOSC ESTITOREAL LIM INCLUDE 'KEYPTI.INS'
SAVE STOREKP6 INCLUDE 'SYSDEP.INS'
C INCLUDE 'PERM4.INS'
EQUIVALENCE (RX,RXR,R), (RXR(2),X), INCLUDE 'HEADR4.INS'
* (CORT,ICKT,CBUF), (ADDER,T2) INCLUDE 'DSCOM4.INS'
C C
DATA IVEC/'AB'/ INTEGER I, J, K, L
DATA PI/3.141592654/ C
C INTRINSIC ABS, CMPLX, REAL, AIMAG, ATAN2
IF (MODE.GT.4) GO TO 1000 C EXTERNAL ADINTN, BSSEQN, CKTIDS, CONINT, DOCUHD, FACT, - bring back when
$1 print heading is enabled
C EXTERNAL ADINTN, BSSEQN, CKTIDS, CONINT, FACT,
MOVE-CONS-INTO-LOCAL-VARIABLES * FNDKF1, LINMOD, LOFLSB, RTRNSB, VLTFR6
C C
Flecs Code for the Controller in PSS/E

C VARIABLE DEFINITIONS AS IN CTRLTCSC.DSL INTEGER II, JJ, IBUS, KF, STRAT, MTHDPE
C REAL R, X, RXR(2), T1, T2, MAG, LINX
MINTCSC=XBANK*MNCAPBST COMPLEX ADDER, RX
UHYST=UMXTCSC*0.1 LOGICAL NEW ,SKIP
INDTCSC=XBANK*INDBST CHARACTER CB1*6, CB2*6, CB3*6, CB4*6, NAME(2)*18
CHARACTER IVEC(1)*2, CORT*1, ICKT*2, CBUF(1)*6
C C VARIABLES FOR DSL CODE
REAL UTCSC,ITCSC,MINTCSC,MNCAPBST,INDBST,UMXTCSC,UHYST
REAL XINS, INDTCSC, XBANK, TKBYP, TKCAP, XTCSC, DXTCSC, XREQ, XOHM
This flecs code may contain some information relates to another damping controller
which developed previously. Those codes will not influence the implementation of the
. IF (ZERNUM(KF).GT.0) WRITE(LPDEV,137) ICKT,ICON(I),ICON(I+1) NEW=MODE.EQ.4
C . C
. IF (NEW) ! MODE = 4--SET NINTEG IF (NEW .OR. (MODE.EQ.3 .AND. KPAUSE.EQ.2) )
. . IF ( (K+9).GT.NINTEG ) NINTEG=K+9 . ICKT=CHRICN(I+2)
. . RETURN C .
. ...FIN . IF (ICKT.EQ.'$$')
C . . . KF=ICON(I+2)
...FIN C . .
$1 . . IF (KF.LT.0 .OR. KF.GT.99)
IF (INTICN(I).EQ.0) RETURN . . . WRITE(LPDEV,127) KF,ICON(I),ICON(I+1)
C . . . GO TO 900
IF (MODE.EQ.2) ! CALCULATE DERIVATIVES . . ...FIN
. GET-ICONS C . .
. GET-VARS . . WHEN (KF.LE.9) WRITE(ICKT,'(I1,1X)') KF
. GET-STATES . . ELSE WRITE(ICKT,'(I2)') KF
C . SET STORE VALUE CALCULATED IN MODE 1 C . .
. IF(TIME .LE. -2.*DELT) . . CHRICN(I+2)=ICKT
. . STORE(K+6)=STOREKP6 . ...FIN
. ...FIN C .
C . . IBUS=ICON(I)
C START OF CODE FROM MWPOWER.DSL C .
C . . IF (IBUS.LE.0) GO TO 900
C .
. MWLINE=VAR(L)*COS(VAR(L+1)*PI/180.)*VAR(L+4)*COS(VAR(L+5)*PI/180.) . CALL BSSEQN(IBUS,II,*800)
. MWLINE=MWLINE+VAR(L)*SIN(VAR(L+1)*PI/180.)*VAR(L+4)*SIN(VAR(L+5)*PI/180.) C .
. MWLINETOT=(VAR(L+28)+VAR(L+29)+VAR(L+30))/SBASE . IBUS=ICON(I+1)

61
. CALL BSSEQN(IBUS,JJ,*800)
C . C .
C START OF CODE REPLACING PHSEST.DSL . CALL FNDKF1(II,JJ,ICKT,KF)
C . C .
C REFERENCE PHASOR GENERATOR . IF (KF.EQ.0)
C . . . WRITE(LPDEV,107) ICKT,ICON(I),ICON(I+1)
C FOLLOWING LINE REPLACED ON ACCOUNT OF FREQUENCY CORRECTION . . GO TO 900
C . . WREF=2.*PI*FRQOSC . ...FIN
C . C .
. WREF=2.*PI*NEWFRQ . IF (TAPNO(KF).NE.0)
. DTHETA=WREF . . WRITE(LPDEV,157) ICKT,ICON(I),ICON(I+1)
. REALRF=COS(THETA) . . GO TO 900
. IMAGRF=SIN(THETA) . ...FIN
C . C .
C PHASOR ESTIMATION USING LOWPASS FILTER METHOD . IF (ICOM(KF).LE.0) GO TO 900
. WHEN (MTHDPE.EQ.0) C .
C FOR A PERFECT WREF HZ INPUT OSCILLATION REALDP AND IMAGDP ARE CONSTANTS - I.E. DP IS A C . MODEL NOT IMPLEMENTED FOR MSTR/MRUN
VECTOR (NOT A PHASOR) . IF (MIDTRM)
C TEMP IS PRODUCT OF NEGATIVE REFERENCE PHASOR TIMES CONJUGATE OF DP . . WRITE(LPDEV,167) ICKT,ICON(I),ICON(I+1)
. . REALTM=REALDP*REALRF-IMAGDP*IMAGRF . . GO TO 900
. . IMAGTM=-1.*(REALDP*IMAGRF+IMAGDP*REALRF) . ...FIN
C DERIVATIVE OF AVERAGE CALCULATOR C .
. . REALAU=MWLINE-REALTM . INTICN(I )=II
. . DPAV=(REALAU-PAV)*COAVFRQ*2.*PI . INTICN(I+1)=JJ
. INTICN(I+2)=KF
C .
C STORE OSCILLATORY COMPONENT FOR INPUT TO FRQCORR.DSL C SUBTRACT TEMP FROM TWO TIMES (INPUT SIGNAL - AVERAGE)
C . . . REALAU=2.*(MWLINE-PAV)-REALTM
. RE_REF=REALDP1 . . IMAGAU=-IMAGTM
. IM_REF=IMAGDP1 C MULTIPLY BY NEGATIVE REFERENCE PHASOR - THESE ARE THE INPUTS TO THE DP
C TIMES E TO THE J TIMES ALPHA TIME CONSTANTS
. REALAU=REALTM*COS(ALPHA*PI/180.)-IMAGTM*SIN(ALPHA*PI/180.) . . REALTM=REALAU*REALRF+IMAGAU*IMAGRF
C . . . IMAGTM=REALRF*IMAGAU-IMAGRF*REALAU
C PHASOR IS A LINEAR COMBINATION OF AVERAGE AND OSCILLATORY POWER C DERIVATIVES OF REAL AND IMAGINARY PARTS OF DP
C . . . DREALDP=(REALTM-REALDP)*COFLFRQ*2.*PI
. PHASOR=KAV*PAV+KPH*REALAU . . DIMAGDP=(IMAGTM-IMAGDP)*COFLFRQ*2.*PI
C . . ...FIN
C START OF CODE FROM FRQCORR.DSL C .
C . C PHASOR ESTIMATION USING RLS FILTER METHOD
. WHEN (SQRT(IM_REF**2+RE_REF**2).GE.OPERAT) . ELSE
. . IF(TSTART.GT.100000.) TSTART=TIME . . KAPPAAV=XSIAV*(1+XSIAV*XSIAV)
. . WHEN((TIME-TSTART).GT.2.) . . KAPPACS=XSIPH*(2-XSIPH*XSIPH)
. . . DTETACS=2.*PI*NEWFRQ . . KAPPASN=3*XSIPH*XSIPH
. . . PHREAL=RE_REF*COS(TETACS)+IM_REF*SIN(TETACS) . . MWHAT=PAV+REALDP
. . . PHIMAG=IM_REF*COS(TETACS)-RE_REF*SIN(TETACS) . . INNOV=MWLINE-MWHAT
. . . IF (FLGSTART.EQ.0) . . WHEN((TRIGGER2.EQ.1).OR.FAULTRES.EQ.1)
. . . . ARGREF=ATAN2(PHIMAG,PHREAL) . . . MWHAT=0.
. . . . FLGSTART=1 . . . INNOV=0.
. . . ...FIN . . . DPAV=0.
. . . XDIF=PHREAL*COS(ARGREF)+PHIMAG*SIN(ARGREF) . . . STATE(K+1)=MWLINE
. . . YDIF=PHIMAG*COS(ARGREF)-PHREAL*SIN(ARGREF) . . . STORE(K+1)=MWLINE
. . . WHEN((XDIF.EQ.0.).AND.(YDIF.EQ.0.)) ANGDIF=0. . . . STATE(K+2)=0.001

62
. . . ELSE ANGDIF=ATAN2(YDIF,XDIF) . . . STORE(K+2)=0.001
. . . DDEL_I=KDF*ANGDIF/TDF . . . STATE(K+3)=0.001
. . . DELFRQ=DEL_I+KDF*ANGDIF . . . STORE(K+3)=0.001
. . . WHEN(DELFRQ.GT.DFMAX) . . . DREALDP=0.
. . . . DELFRQ=DFMAX . . . DIMAGDP=0.
. . . . ARGREF=ATAN2(PHIMAG,PHREAL) . . ...FIN
. . . . STATE(K+4)=DFMAX . . ELSE
. . . . STORE(K+4)=STATE(K+4) . . . DPAV=WREF*KAPPAAV*INNOV
. . . . DDEL_I=0. . . . DREALDP=WREF*(KAPPACS*INNOV-IMAGDP)
. . . ...FIN . . . DIMAGDP=WREF*(-KAPPASN*INNOV+REALDP)
. . . ELSE . . ...FIN
. . . . IF(DELFRQ.LT.DFMIN) . . KAPPAAV1=XSIAV1*(1+XSIAV1*XSIAV1)
. . . . . DELFRQ=DFMIN . . KAPPACS1=XSIPH1*(2-XSIPH1*XSIPH1)
. . . . . ARGREF=ATAN2(PHIMAG,PHREAL) . . KAPPASN1=3*XSIPH1*XSIPH1
. . . . . STATE(K+4)=DFMIN . . MWHAT1=PAV1+REALDP1
. . . . . STORE(K+4)=STATE(K+4) . . INNOV1=MWLINE-MWHAT1
. . . . . DDEL_I=0. . . DPAV1=WREF*KAPPAAV1*INNOV1
. . . . ...FIN . . DREALDP1=WREF*(KAPPACS1*INNOV1-IMAGDP1)
. . . ...FIN . . DIMAGDP1=WREF*(-KAPPASN1*INNOV1+REALDP1)
. . . NEWFRQ=FRQOSC+DELFRQ . ...FIN
. . ...FIN C .
. . ELSE C TIMES REFERENCE PHASOR
. . . ARGREF=0. . REALTM=REALDP
. . . DELFRQ=0. . IMAGTM=IMAGDP
. . . STATE(K+4)=0. C .
C . . . . STORE(K+4)=0.
C START OF CODE FROM CTRLTCSC.DSL . . . DDEL_I=0.
C . . . . STATE(K+5)=0.
. WHEN ((MINTCSC*ITCSC+UMXTCSC).LT.0.) . . . STORE(K+5)=0.
. . IF(PROT.EQ.0) WRITE(LPDEV,177) ICKT,ICON(I),ICON(I+1),TIME . . . DTETACS=0.
. . PROT=1 . . ...FIN
. ...FIN . ...FIN
. ELSE . ELSE
. . IF ((MINTCSC*ITCSC+UMXTCSC).GT.UHYST) . . TSTART=999999.
. . . IF(PROT.EQ.1) WRITE(LPDEV,178) ICKT,ICON(I),ICON(I+1),TIME . . FLGSTART=0
. . . PROT=0 . . ARGREF=0.
. . ...FIN . . DELFRQ=0.
. ...FIN . . STATE(K+4)=0.
. WHEN (FLGSWG.GT.0) . . STORE(K+4)=0.
. . XINS=XBANK*3. . . DDEL_I=0.
. . OPMODE=0 . . STATE(K+5)=0.
. ...FIN . . STORE(K+5)=0.
. ELSE . . DTETACS=0.
. . XINS=XREQ . ...FIN
. . OPMODE=MODEOP C .
. ...FIN C START OF CODE FROM XREQUIRED.DSL
. WHEN (XTCSC.GT.MINTCSC) TK=TKBYP C .
. ELSE TK=TKCAP . WHEN (WORKAS.EQ.2)
. WHEN((PROT+OPMODE).GT.0) . . MODEOP=1
. . WHEN (TK.GT.2.*DELT) DXTCSC=(INDTCSC-XTCSC)/TK . . XREQ=INDBST*XBANK
. . ELSE . ...FIN

63
. . . XTCSC=INDTCSC . ELSE
. . . STATE(K)=XTCSC . . SIGNAL=K1GAIN*K2GAIN*PHASOR
. . . STORE(K)=XTCSC . . WHEN (MWLINE.LT.0.) NEWSIGNAL=-1.*SIGNAL
. . . DXTCSC=0. . . ELSE NEWSIGNAL=SIGNAL
. . ...FIN . . XREQ=STSBST*XBANK+NEWSIGNAL
. ...FIN . . IF (XREQ.LT.(MXCAPBST*XBANK)) XREQ=MXCAPBST*XBANK
. ELSE . . WHEN (WORKAS.EQ.1)
. . WHEN (TK.GT.2.*DELT) DXTCSC=(XINS-XTCSC)/TK . . . WHEN (XREQ.GT.(0.5*(MNCAPBST+INDBST)*XBANK))
. . ELSE . . . . IF (MODEOP.EQ.0)
. . . XTCSC=XINS . . . . . BYPSSTIME=TIME
. . . STATE(K)=XTCSC . . . . . WRITE(LPDEV,177) ICKT,ICON(I),ICON(I+1),TIME
. . . STORE(K)=XTCSC . . . . ...FIN
. . . DXTCSC=0. . . . . MODEOP=1
. . ...FIN . . . ...FIN
. ...FIN . . . ELSE
. SET-DSTATES . . . . IF(TIME.GT.(BYPSSTIME+MNTBYPSS))
. SET-ICONS . . . . . IF (MODEOP.EQ.1)
. SET-VARS . . . . . . WRITE(LPDEV,178) ICKT,ICON(I),ICON(I+1),TIME
C . . . . . . ...FIN
. RETURN . . . . . MODEOP=0
...FIN . . . . . BYPSSTIME=999999.
$1 . . . . ...FIN
. . . ...FIN
. . ...FIN
. . ELSE MODEOP=0
. . WHEN (MODEOP.EQ.0) IF(XREQ.GT.(MNCAPBST*XBANK))XREQ=MNCAPBST*XBANK
. . ELSE XREQ=INDBST*XBANK
. ...FIN
IF (MODE.EQ.1) ! INITIALIZATION IF (MODE.EQ.3)
. KF=INTICN(I+2) C .
. RX=-1./GB(KF) . KF=INTICN(I+2)
C . . ICKT=CHRICN(I+2)
C . INITIALIZE ACCELERATION AUXILIARY VARIABLES WITH LOADFLOW MAGNITUDES . WHEN(ICON(I+3).EQ.0)
C . . . RX=-1./GB(KF)
. IF(ICON(I+3).EQ.0) C . .
. . VAR(L+13)=X C CHANGE NETWORK IMPEDANCE IF DEVIATION TOO LARGE OR TAKING TOO MANY
. ...FIN ITERATIONS TO CONVERGE
. XTCSC=X . . IF((ITMXDS-ITER).LT.5.OR.ABS((X-VAR(L+15))/CON(J+5)).GT.CON(J+2))
C . . . . RX=CMPLX(0.,VAR(L+15))
C . INITIALIZATION OF PHEST.DSL . . . GB(KF)=-1./RX
C . C . . .
. GET-STATES . . . WRITE(LPDEV,77) ICKT,ICON(I),ICON(I+1),TIME
. GET-VARS C . . .
. PAV=MWLINE . . . CALL LOFLSB
. REALDP=0. . . . CALL FACT
. IMAGDP=0. . . . CALL RTRNSB
. PAV1=MWLINE . . ...FIN
. REALDP1=0. C . .
. IMAGDP1=0. . . ICON(I+4)=1
. DPAV1=0 . . INTICN(I+4)=1
. DREALDP1=0. . ...FIN
. DIMAGDP1=0. . ELSE
. THETA=0. . . WHEN(INTICN(I+3).EQ.0)INTICN(I+3)=1
C . . . ELSE

64
C NOTE: STORE(TIME=-2*DELT)=STATE(TIME=-DELT)- DSTATE(TIME=-2*DELT)*DELT*3./2. . . . RX=-1./GB(KF)
C . . . . WHEN(WORKAS.NE.2)
. NEWFRQ=FRQOSC . . . . IF(ABS((X-CON(J+4))/CON(J+5)).GT.CON(J+2))
. WREF=2.*PI*NEWFRQ . . . . . RX=CMPLX(0.,CON(J+4))
. DTHETA=WREF . . . . . GB(KF)=-1./RX
. STOREKP6=THETA+DTHETA*DELT-DTHETA*DELT*1.5 C . . . . .
. WRITE(LPDEV,247) CHRICN(I+2),ICON(I),ICON(I+1),K+6 . . . . . WRITE(LPDEV,77) ICKT,ICON(I),ICON(I+1),TIME
C . C . . . . .
. GET-ICONS . . . . . CALL LOFLSB
C . . . . . . CALL FACT
C . INITIALIZATION OF XREQUIRED.DSL . . . . . CALL RTRNSB
C . . . . . . INTICN(I+3)=2
. WHEN(WORKAS.NE.2) . . . . ...FIN
. . MODEOP=0 . . . ...FIN
. . XREQ=STSBST*XBANK . . . ELSE
. ...FIN . . . . IF(ABS((X-CON(J+5)*CON(J+9))/CON(J+5)).GT.CON(J+2))
. ELSE . . . . . RX=CMPLX(0.,CON(J+5)*CON(J+9))
. . MODEOP=1 . . . . . GB(KF)=-1./RX
. . XREQ=INDBST*XBANK C . . . . .
. . WRITE(LPDEV,149) CHRICN(I+2),ICON(I),ICON(I+1) . . . . . WRITE(LPDEV,77) ICKT,ICON(I),ICON(I+1),TIME
. ...FIN C . . . . .
. K1GAIN=1. . . . . . CALL LOFLSB
. K2GAIN=1. . . . . . CALL FACT
. BYPSSTIME=999999. . . . . . CALL RTRNSB
. . . . . INTICN(I+3)=2
. . . . ...FIN
. . . ...FIN
. . ...FIN
. ...FIN
. RETURN
...FIN
C . CHECK FOR DISCREPANCIES BETWEEN CONTROL SECTIONS AND LOADFLOW C . MORE INITIALIZATION OF CTRLTCSC.DSL
C . C .
. IF (ABS(R).GT.0.0001) C .
. . WRITE(LPDEV,147) CHRICN(I+2),ICON(I),ICON(I+1),R . PROT=0
. ...FIN . FLGSWG=0
C . . XOHM=XREQ
C . C .
. IF (ABS(X-VAR(L+15)).GT.0.0001) C . INITIALIZATION OF FRQCORR.DSL
. . WRITE(LPDEV,148) CHRICN(I+2),ICON(I),ICON(I+1),X,XOHM C .
. ...FIN C .
C . . DEL_I=0.
C . PREPARE FOR ALTERNATIVE CONVERGENCE STRATEGY . FLGSTART=0
C . . TSTART=999999.
. IF(ICON(I+3).EQ.1) . TETACS=0.
. . INTICN(I+3)=0 C .
. . VAR(L+12)=0. C . INITIALIZATION OF ADD CODE
. . VAR(L+13)=0. . XI=0.01
. ...FIN . XEQ=0.35
C . . XINIT=0.15
. RETURN . X1=0.
...FIN . A1=0.
C . TRIGGERTIME=9999.
C BUS IBUS NOT FOUND . TRIGGERTIME1=9999.
C . TRIGGERTIME2=9999.
800 WRITE(LPDEV,117) IBUS,ICKT,ICON(I),ICON(I+1) . PPEAK1=0.
C . PMEAN1=0.

65
C MODEL IGNORED . TRIGGER1=1
C . ATSTEP=0
900 INTICN(I)=0 . XHILIM=0.075
DO (II=1,28) VAR(L+II-1)=0. . XLOWLIM=-0.075
DO (II=1,10) . X0=-0.0001
. STATE(K+II-1)=0. . TRIGGER2=0
. STORE(K+II-1)=0. . FAULTTIME=1.0
. DSTATE(K+II-1)=0. . FAULTDELAY=0.35
...FIN . FAULTDELAY2=1.2
RETURN . FAULTINHIBIT=0
. FAULTRES=0
. ISOSC=0
$1 . STAGE=0
C MODE > 4 (MAINCR) . STEPTIME=999.
C . TIMESTAGE4=999.
1000 IF (MODE.EQ.6) GO TO 2000 . ESTITOREAL=1
C . XIOLD=XI
C MODE = 5 OR 7--ACTIVITY DOCU . XEQOLD=XEQ
C . LIM=0
CHECK-FOR-SELECTIVE-DOCU
C C .
IF (MODE.EQ.7) ! DATA CHECKING MODE C .
. NEW=.FALSE. . SET-ICONS
C . . SET-VARS
C . . SET-STATES
C
CALL CKTIDS(I,1,CBUF) . UNLESS (CON(J).GE.0. .AND. CON(J).LE.1.0)
WRITE(IPRT,27) ICON(I ),NAME(1)(1:12),NAME(1)(13:18), . . PRINT-HEADING
* ICON(I+1),NAME(2)(1:12),NAME(2)(13:18),CBUF, . . WRITE(IPRT,217) CON(J)
* (CON(II),II=J,JJ) . ...FIN
WHEN((ICON(I+12).GT.0).AND.(ICON(I+12).LT.4)) WRITE(IPRT,37) I+12,ICON(I+12) . UNLESS (CON(J+1).GE.0. .AND. CON(J+1).LE.1.0)
ELSE WRITE(IPRT,47) I+12,ICON(I+12) . . PRINT-HEADING
CONDITIONAL . . WRITE(IPRT,218) CON(J+1)
. (ICON(I+10).EQ.0) WRITE(IPRT,48) . ...FIN
. (ICON(I+10).EQ.1) WRITE(IPRT,49) . UNLESS (CON(J+2).GT.0.0)
. (ICON(I+10).EQ.2) WRITE(IPRT,50) . . PRINT-HEADING
. (OTHERWISE) WRITE(IPRT,51) I+1,ICON(I+1) . . WRITE(IPRT,219) CON(J+2)
...FIN . ...FIN
1500 RETURN . UNLESS (CON(J+3).GT.1.)
$1 . . PRINT-HEADING
C MODE = 6--ACTIVITY DYDA . . WRITE(IPRT,220) CON(J+3)
C . ...FIN
2000 IF (IBDOCU.GT.0 .AND. ICON(I).NE.IBDOCU) RETURN . UNLESS (CON(J+4).GT.0.)
C . . PRINT-HEADING
CALL CONINT(IVEC,1,JJ) . . WRITE(IPRT,221) CON(J+4)
IF (JJ.NE.0) RETURN . ...FIN
C . UNLESS (CON(J+5).LT.0.)
CALL CKTIDS(I,1,CBUF) . . PRINT-HEADING
C . . WRITE(IPRT,222) CON(J+5)
WRITE(IPRT,507) ICON(I),ICON(I+1),CBUF,ICON(I+3),ICON(I+10),(ICON(II),II=I+12,I+21),(CON(JJ),JJ=J,J+24) . ...FIN
RETURN . UNLESS (CON(J+7).GT.1.)
C . . PRINT-HEADING

66
C MODE > 4 (TAINCR) . . WRITE(IPRT,224) CON(J+7)
C . ...FIN
4000 IF (MODE.GT.5) RETURN . UNLESS (CON(J+6).GT.CON(J+7))
C . . PRINT-HEADING
C ACTIVITY DOCU REPORTING MODE . . WRITE(IPRT,225) CON(J+6), CON(J+7)
C . ...FIN
CHECK-FOR-SELECTIVE-DOCU . UNLESS (CON(J+8).GT.CON(J+6))
C . . PRINT-HEADING
CORT='T' . . WRITE(IPRT,223) CON(J+8), CON(J+6)
TABULATE-MODEL . ...FIN
C . UNLESS (CON(J+9).LT.0.)
RETURN . . PRINT-HEADING
$1 . . WRITE(IPRT,226) CON(J+9)
. ...FIN
...FIN
C
CORT='M'
TABULATE-MODEL
C
KF=1
SET-BUS-NAME
C
KF=2
SET-BUS-NAME
C
C IF THERE IS AN OSCILLATION, START CONTROL C[TAINTC] ! CALLED FROM 'CONET'
C
IF(ISOSC.EQ.1) ENTRY TAINTC (I,J,K,L)
. IF(FAULTINHIBIT.EQ.0) C
. . IF(STAGE.EQ.0.AND.IMAGTM.GT.-0.02.AND.IMAGTM.LT.0.02) IF (MODE.GT.4) GO TO 4000
. . . STAGE=1 C
. . ...FIN II=INTICN(I)
. ...FIN IF (II.EQ.0) RETURN
...FIN JJ=INTICN(I+1)
KF=INTICN(I+2)
C STAGE1 MEASURE P'XSTATE, X'; UPDATE XI AND XEQ ICKT=CHRICN(I+2)
MOVE-CONS-INTO-LOCAL-VARIABLES
IF(STAGE.EQ.1) GET-STATES
. XFINAL=XINIT+XOHM GET-VARS
. PMEAN1=PAV IF (IFLAG.AND.((ICON(I+12).GT.0).AND.(ICON(I+12).LT.4)))
. IF(PMEAN0.NE.0) . CALL FLOW1(I+13,L+28,0,0)
. . WHEN(PMEAN1.NE.PMEAN0) . CALL FLOW1(I+16,L+29,0,0)
. . . WHEN((PPEAK0*((XSTART+XEQ)/(XFINAL+XEQ))/PPEAK1).NE.1) . CALL FLOW1(I+19,L+30,0,0)
. . . . WHEN(((PPEAK1/PPEAK0).GE.1.05).OR.((PPEAK1/PPEAK0).LT.0.95)) ...FIN
. . . . . WHEN(((PMEAN1/PMEAN0).GE.1.05).OR.((PMEAN1/PMEAN0).LT.0.95)) C
. . . . . . XEQEST=(XSTART-PMEAN1/PMEAN0*XFINAL)/(PMEAN1/PMEAN0-1) C MODE 1 CALL REQUIRED TO INITIALIZE PHASOR
. . . . . . DELTAXTOT1=XFINAL*XEQEST/(XFINAL+XEQEST)-XSTART*XEQEST/(XSTART+XEQEST) C MEASUREMENT OF THE LINEPOWER
. . . . . . XTOTINIT=DELTAXTOT1/(PPEAK0*((XSTART+XEQEST)/(XFINAL+XEQEST))/PPEAK1-1) IF (MODE.EQ.1)
. . . . . . XIEST=XTOTINIT-XSTART*XEQEST/(XSTART+XEQEST) . IF (IFLAG)
. . . . . ...FIN . . ADDER=CMPLX(0.,0.)
. . . . . ELSE . . POPULATE-VOLTS-LINECURRENT

67
. . . . . . XEQEST=XEQ . . MWLINE=VAR(L)*COS(VAR(L+1)*PI/180.)*VAR(L+4)*COS(VAR(L+5)*PI/180.)
. . . . . . XIEST=XI . . MWLINE=MWLINE+VAR(L)*SIN(VAR(L+1)*PI/180.)*VAR(L+4)*SIN(VAR(L+5)*PI/180.)
. . . . . ...FIN . . MWLINETOT=(VAR(L+28)+VAR(L+29)+VAR(L+30))/SBASE
. . . . ...FIN . . SET-VARS
. . . . ELSE . ...FIN
. . . . . XEQEST=XEQ . RETURN
. . . . . XIEST=XI ...FIN
. . . . ...FIN C .
. . . ...FIN
. . . ELSE C CODE Of CONTROL SIGNAL
. . . . XEQEST=XEQ C
. . . . XIEST=XI WHEN((TIME.GT.FAULTTIME).AND.(TIME.LE.(FAULTTIME+FAULTDELAY2))) FAULTINHIBIT=1
. . . ...FIN ELSE
. . ...FIN . FAULTINHIBIT=0
. . ELSE ...FIN
. . . XEQEST=XEQ
. . . XIEST=XI WHEN((TIME.GT.FAULTTIME).AND.(TIME.LE.(FAULTTIME+FAULTDELAY))) FAULTRES=1
. . ...FIN ELSE
. . IF(XIEST.GT.0.AND.XEQEST.GT.0.) . FAULTRES=0
. . . XI=(XIEST+XIOLD*lambda)/(1+lambda) ...FIN
. . . XEQ=(XEQEST+XEQOLD*lambda)/(1+lambda)
. . ...FIN C
. ...FIN C CODE of determines if there is an oscillation
. XIOLD=XI
. XEQOLD=XEQ WHEN((REALTM.GT.OscLimit).OR.(REALTM.LT.-OscLimit)) ISOSC=1
. STAGE=2 ELSE
...FIN . ISOSC=0
...FIN
. . . ELSE C STAGE2 MEASURE PXSTATE PX AND X
. . . . DELTAX=XSTEP1
. . . . DELTAX2ND=XSTEP2 IF(STAGE.EQ.2)
. . . ...FIN . PMEAN0=PAV
. . ...FIN . PPEAK0=MWLINE
. . XOHM=XOHM+DELTAX . XSTART=XOHM+XINIT
. . ATSTEP=2 . STAGE=3
. . STAGE=4 ...FIN
. . TRIGGERTIME1=TIME
. . STEPTIME=TIME C STAGE3 CALCULATE THE NECESSARY REACTANCE STEP
. ...FIN
. IF((ATSTEP.EQ.2).AND.TRIGGERTIME2.GT.999.AND.TRIGGER2.EQ.0.AND.(TIME.GT.STEPTIME+0.3)) IF(STAGE.EQ.3)
. . IF(DELTAX2ND*REALTM.GT.0) XOHM=XOHM+DELTAX2ND . IF(ATSTEP.EQ.0.AND.ESTITOREAL.EQ.1)
. . TRIGGERTIME2=TIME . . XD=XINIT+XOHM
. . STEPTIME=TIME . . POSC=PAV+REALTM
. . ESTITOREAL=1 . . XTOT0=XI+XD*XEQ/(XD+XEQ)
. . STAGE=4 . . PTOT0=(XD+XEQ)/XEQ*PAV
. . ATSTEP=0 . . PMEAN0=PAV
. ...FIN . . DELTAXBV=(XD+XEQ)/(PXBV/PMEAN0)-XEQ-XD
...FIN . . WHEN((XOHM+DELTAXBV).GT.XHILIM) DELTAXBV1=XHILIM-XOHM+0.0001
. . ELSE
. . . WHEN((XOHM+DELTAXBV).LT.XLOWLIM) DELTAXBV1=XLOWLIM-XOHM+0.0001
C STAGE4 CALCULATE PX' Instantaneous power on the line after the step . . . ELSE DELTAXBV1=DELTAXBV
. . ...FIN
IF(STAGE.EQ.4) . . XTOT2BV=XI+(XD+DELTAXBV1)*XEQ/(XD+DELTAXBV1+XEQ)
. IF(TIME.GT.(STEPTIME+0.02).AND.TIME.LT.(STEPTIME+0.03)) . . XTOT1BV=(XTOT2BV+POSC/PTOT0*(XD+XEQ)/XEQ*1*XTOT0)/(1+1)

68
. . PPEAK1=MWLINE . . DXTOTBV1=XTOT1BV-XTOT0
. . TIMESTAGE4=TIME . . DXTOTBV2=XTOT2BV-XTOT1BV
. . WHEN(ATSTEP.EQ.0) STAGE=0 . . WHEN((XTOT0+DXTOTBV1).GE.(XI+XEQ))
. . ELSE . . . XSTEP1=XHILIM-XOHM
. . . WHEN(LIM.EQ.1) . . . XSTEP2=-XSTEP1
. . . . LIM=0 . . ...FIN
. . . . STAGE=0 . . ELSE
. . . . ESTITOREAL=1 . . . WHEN((XTOT0+DXTOTBV1).LE.XI)
. . . . ATSTEP=0 . . . . XSTEP1=XLOWLIM-XOHM+0.0001
. . . ...FIN . . . . XSTEP2=-XSTEP1
. . . ELSE STAGE=5 . . . ...FIN
. . ...FIN . . . ELSE
. ...FIN . . . . XSTEP1=-DXTOTBV1*(XD*XD+2*XD*XEQ+XEQ*XEQ)/(-
...FIN XEQ*XEQ+DXTOTBV1*XD+DXTOTBV1*XEQ)
. . . . XDBV1=XD+XSTEP1
IF(STAGE.EQ.5) . . . . XSTEP2=-DXTOTBV2*(XDBV1*XDBV1+2*XDBV1*XEQ+XEQ*XEQ)/(-
. IF(TIME.GT.(TIMESTAGE4+0.5)) XEQ*XEQ+DXTOTBV2*XDBV1+DXTOTBV2*XEQ)
. . IF(IMAGTM.GT.-0.01.AND.IMAGTM.LT.0.01) . . . ...FIN
. . . STAGE=1 . . ...FIN
. . ...FIN . . ESTITOREAL=0
. ...FIN . . WHEN((XOHM+XSTEP1).GT.XHILIM)
...FIN . . . DELTAX=XHILIM-XOHM
. . . DELTAX2ND=-XHILIM+0.0001
C SIGNAL FOR RLS RESETTING . . . LIM=1
. . ...FIN
IF(TIME.GT.(TRIGGERTIME1+0.05).AND.TIME.LT.(TRIGGERTIME1+0.06)) . . ELSE
. TRIGGER2=1 . . . WHEN((XOHM+XSTEP1).LT.XLOWLIM)
...FIN . . . . DELTAX=XLOWLIM-XOHM
. . . . DELTAX2ND=-XLOWLIM+0.0001
. . . . LIM=1
. . . ...FIN
. WHEN (ICON(I+3).EQ.0) IF(TIME.GT.(TRIGGERTIME1+0.06).AND.TIME.LT.(TRIGGERTIME1+0.07))
C . . DECELERATED DESIRED MAGNITUDES . TRIGGER2=0
. . WHEN (ICON(I+4).EQ.0.AND.CMX.LE.CON(J+3)*TOL.AND.ITER.LT.ITMXDS*3/4) . TRIGGERTIME1=9999.
. . . R=0. ...FIN
. . . X=VAR(L+13)+(VAR(L+15)-VAR(L+13))*CON(J+1)
. . . VAR(L+13)=X IF(TIME.GT.(TRIGGERTIME2+0.05).AND.TIME.LT.(TRIGGERTIME2+0.06))
C . . . ICON(I+4)=1 . TRIGGER2=1
. . ...FIN ...FIN
. . ELSE
. . . R=0. IF(TIME.GT.(TRIGGERTIME2+0.06).AND.TIME.LT.TRIGGERTIME2+0.07)
. . . X=VAR(L+13) . TRIGGER2=0
. . ...FIN . TRIGGERTIME2=9999.
. ...FIN ...FIN
. ELSE
. . R=0.
. . X=VAR(L+15) SET-VARS
. ...FIN C
C . C
. WHEN (X.GE.0.) X=X*T1 IF(ICON(I+3).EQ.0)
. ELSE X=X/T1 . RX=-1./GB(KF)
C . . IF(ITER.GT.ITMXDS/4.AND.INTICN(I+4).EQ.1)
. ADDER= (1./RX) - ADDER . . ICON(I+4)=1
...FIN . . INTICN(I+4)=2
ELSE . ...FIN
. WHEN (ICON(I+3).EQ.0) . IF(ITER.GT.ITMXDS/2.AND.INTICN(I+4).EQ.2)
C . . DECELERATED DESIRED MAGNITUDES . . ICON(I+4)=1

69
. . WHEN (ICON(I+4).EQ.0.AND.CMX.LE.CON(J+3)*TOL.AND.ITER.LT.ITMXDS*3/4) . . INTICN(I+4)=0
. . . R=0. . ...FIN
. . . X=VAR(L+13)+(VAR(L+15)-VAR(L+13))*CON(J+1) . IF(CMX.LE.CON(J+3)*TOL.AND.ICON(I+4).EQ.1)
. . . VAR(L+13)=X . . IF(ABS((X-VAR(L+15))/CON(J+5)).GT.CON(J+2))
C . . . ICON(I+4)=1 . . . WHEN(INTICN(I+4).EQ.1)
. . ...FIN . . . . RX=CMPLX(0.,VAR(L+15))
. . ELSE . . . . VAR(L+13)=VAR(L+15)
. . . R=0. . . . ...FIN
. . . X=VAR(L+13) . . . ELSE RX=CMPLX(0.,VAR(L+13))
. . ...FIN . . . ICON(I+4)=2
. ...FIN . . . GB(KF)=-1./RX
. ELSE C . . .
. . R=0. . . . WRITE(LPDEV,77) ICKT,ICON(I),ICON(I+1),TIME
. . X=VAR(L+15) C . . .
. ...FIN . . . CALL LOFLSB
. ADDER=(1./RX) + GB(KF) . . . CALL FACT
...FIN . . . CALL RTRNSB
C . . ...FIN
ADDER=(VOLT(II)-VOLT(JJ))*ADDER . ...FIN
IF(ICON(I+3).EQ.1) ...FIN
. IF(INTICN(I+3).EQ.2) C
. . RX=ADDER WHEN (FREQS) ! UNDO INJECTION 'NETFRQ' USED,
. . VAR(L+12)=VAR(L+12)+(ABS(RX)-VAR(L+12))*CON(J) . T1=1. + 0.5*(BSFREQ(II)+BSFREQ(JJ)) ! CALCULATE INJECTION FOR
. . VAR(L+13)=VAR(L+13)+(ATAN2(X,R)-VAR(L+13))*CON(J+1) C . ! CHANGE IN REACTANCE FROM
. . ADDER=VAR(L+12)*CMPLX(COS(VAR(L+13)),SIN(VAR(L+13))) . WHEN (X.GE.0.) X=X*T1 ! WORKING CASE VALUE, AND MAKE
. ...FIN . ELSE X=X/T1 ! IT FREQUENCY SENSITIVE
...FIN C .
. ADDER=1./RX
* ' IS TREATED AS A ZERO IMPEDANCE LINE') CURNT(II)=CURNT(II)-ADDER
147 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7, CURNT(JJ)=CURNT(JJ)+ADDER
* ' LOADFLOW RESISTANCE = ',F12.7,' DESIRED RESISTANCE = 0.',/,1X, IF(ICON(I+3).EQ.0)
* ' CHECK COORDINATION WITH CONTROL SECTIONS OF MODEL') . IF(ICON(I+4).EQ.2)ICON(I+4)=0
247 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7, ...FIN
* ' PHASOR ESTIMATION',/,1X,'COORDINATE ANGLE (THETA-STATE(',I7,')) CORRECTLY INITIALIZED WITH POPULATE-VOLTS-LINECURRENT
DSTATE NE 0.') IF(ICON(I+5).EQ.1)
148 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7, WHEN(ICON(I+3).EQ.0)
* ' LOADFLOW REACTANCE = ',F12.7,' DESIRED REACTANCE = ',F12.7,/,1X, WRITE(LPDEV,9996)ICKT,ICON(I),ICON(I+1),TIME,VAR(L+13),VAR(L+15),VAR(L+4)
* ' CHECK COORDINATION WITH CONTROL SECTIONS OF MODEL') . ELSE WRITE(LPDEV,9997)ICKT,ICON(I),ICON(I+1),TIME,VAR(L+15),VAR(L+4)
149 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7, ...FIN
* ' HAS BEEN INITIALIZED AS BYPASSED (WORKAS=2)') C MINUS CURRENT ON CAPACITOR = VALVE CURRENT
157 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7, RX=RX-(VOLT(II)-VOLT(JJ))/CMPLX(0.,CON(J+5))
* ' IS A TRANSFORMER--MODEL IGNORED') VAR(L+11)=180./PI*ATAN2(X,R)
167 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7, VAR(L+10)=ABS(RX)
* ' MODEL NOT IMPLEMENTED FOR MSTR/MRUN--MODEL IGNORED') C CAPACITOR CURRENT
177 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7,' AT TIME =',F8.3, RX=(VOLT(II)-VOLT(JJ))/CMPLX(0.,CON(J+5))
* ' CAPACITOR BANK BYPASSED') VAR(L+9)=180./PI*ATAN2(X,R)
178 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7,' AT TIME =',F8.3, VAR(L+8)=ABS(RX)
* ' CAPACITOR BANK UNBYPASSED') C CAPACITOR VOLTAGE
217 FORMAT(' ACC#1=',F14.4) RX=VOLT(II)-VOLT(JJ)
218 FORMAT(' ACC#2=',F14.4) VAR(L+7)=180./PI*ATAN2(X,R)
219 FORMAT(' XTHRES=',F14.10) VAR(L+6)=ABS(RX)
220 FORMAT(' CONVTOL=',F14.2) C
221 FORMAT(' LINX=',F14.10) C
222 FORMAT(' XBANK=',F14.10) C

70
224 FORMAT(' MNCAPBST=',F14.2) RETURN
225 FORMAT(' STSBST=',F14.2,' MNCAPBST=',F14.2) $1
223 FORMAT(' MXCAPBST=',F14.2,' STSBST=',F14.2) 7 FORMAT(//13X,'*** CALL ',A,'AINTC(',I6,3(',',I6),') ***')
226 FORMAT(' INDBST=',F14.10) 17 FORMAT(/' ** ',A,'AINTC ** I C O N S C O N S',
507 FORMAT(6X,'0 ''USRMDL'' 0 ''MAINTC'' 8 1 22 25 7 31'/ * 5X,'S T A T E S V A R S'/16X,4(I7,'-',A6))
* 3X,2I13,7X,A6,I13,' 0 0 0 0 0 0 ',I13,' 0 ',I13,3(/7X,3I14),4(/7X,6G13.5),/7X,G13.5'/') 27 FORMAT(/7X,2(4X,'BUS X-- NAME --X BASEKV'),' CKT'/
9996 FORMAT(' CIRCUIT ',A,' FROM',I7,' TO',I7, * 7X,2(I7,1X,A12,1X,A6),A6/
* ' AT TIME =',F8.3,' X=',G15.7,' XOHM=',G15.7,' LCURR=',G15.7) * /12X,'ACC#1 ACC#2 XTHRES CONVTOL LINX XBANK',7X,
9997 FORMAT(' CIRCUIT ',A,' FROM',I7,' TO',I7, * /7X,F10.3,1X,F7.3,1X,F7.4,1X,F7.2,1X,F11.7,1X,F10.7/,
* ' AT TIME =',F8.3,' XOHM=',G15.7,' LCURR=',G15.7) * /14X,'STSBST MNCAPBST MXCAPBST INDBST UMXTCSC TKBYP',7X,
$1 * /12X,2(1X,F7.4),2X,F7.4,1X,3(1X,F7.4),/,
* /15X,' TKCAP MNTBYPSS FRQOSC COAVFRQ COFLFRQ ALPHA',7X,
---------------------------------------- * /13X,2(1X,F7.4),F8.4,2(1X,F7.4),1X,F7.2,/,
* /11X,' KAV KPH OPERAT KDF TDF DFMAX DFMIN',7X,
TO CHECK-FOR-SELECTIVE-DOCU * /9X,2(1X,F7.4),F8.4,1X,F7.4,1X,F7.2,1X,F7.4,1X,F7.3)
C . 37 FORMAT(/7X,' ICON(',I7,') =',I7,' - MWLINE COMPUTED FROM EXTERNAL BRANCH FLOWS')
. IF (IBDOCU.GT.0) ! SELECTIVE DOCU 47 FORMAT(/7X,' ICON(',I7,') =',I7,' - MWLINE COMPUTED FROM SELF-FLOW')
. . IF (ICON(I).NE.IBDOCU .AND. ICON(I+1).NE.IBDOCU) RETURN 48 FORMAT(/7X,' WORKAS = 0 - NEVER IN BYPASS MODE')
. ...FIN 49 FORMAT(/7X,' WORKAS = 1 - MAY TEMPORARILY SWITCH TO BYPASS MODE')
C . 50 FORMAT(/7X,' WORKAS = 2 - ALWAYS IN BYPASS MODE')
...FIN 51 FORMAT(/7X,' ICON(',I7,') =',I7,' - INVALID SETTING OF WORKAS')
77 FORMAT(' NEW FACT BY MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7,
---------------------------------------- * ' AT TIME =',F8.3)
97 FORMAT(//' MAINTC:')
107 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7,' NOT FOUND')
117 FORMAT(' MAINTC BUS',I7,' NOT FOUND--CIRCUIT ',A,' FROM',I7,
* ' TO',I7)
127 FORMAT(' MAINTC INVALID CIRCUIT ID',I7,' FROM',I7,' TO',I7)
137 FORMAT(' MAINTC CIRCUIT ',A,' FROM',I7,' TO',I7,
. INDBST=CON(J+9)
. UMXTCSC=CON(J+10) TO TABULATE-MODEL
. TKBYP=CON(J+11) C .
. TKCAP=CON(J+12) . CALL LINMOD(I,.FALSE.,NEW,*1500)
. MNTBYPSS=CON(J+13) C .
. FRQOSC=CON(J+14) . WRITE(IPRT,7) CORT,I,J,K,L
. COAVFRQ=CON(J+15) C .
. COFLFRQ=CON(J+16) . JJ=J+24
. ALPHA=CON(J+17) . II = 0
. KAV=CON(J+18) . CALL ADINTN (I+21,CB1,II)
. KPH=CON(J+19) . II = 0
. OPERAT=CON(J+20) . CALL ADINTN (JJ,CB2,II)
. KDF=CON(J+21) . II = 0
. TDF=CON(J+22) . CALL ADINTN (K+6,CB3,II)
. DFMAX=CON(J+23) . II = 0
. DFMIN=CON(J+24) . CALL ADINTN (L+30,CB4,II)
. PXBV=CON(J+25) . WRITE(IPRT,17) CORT,I,CB1,J,CB2,K,CB3,L,CB4
. LAMBDA=CON(J+26) ...FIN
. XSIAV=CON(J+27)
. XSIPH=CON(J+28) ----------------------------------------
. XSIAV1=CON(J+29)
. XSIPH1=CON(J+30) TO SET-BUS-NAME
. OSCLIMIT=CON(J+31) . IBUS=ICON(I+KF-1)
...FIN C .
. IF (IBUS.GT.0)
---------------------------------------- . . CALL BSSEQN(IBUS,II,*1200)

71
. . NAME(KF)(1:12)=BUSNAM(II)
TO SET-ICONS . . CALL VLTFR6(NAME(KF)(13:18),BASVLT(II))
C . . . EXITPROC
. ICON(I+3)=STRAT . ...FIN
. ICON(I+6)=PROT C .
. ICON(I+7)=FLGSWG 1200 . NAME(KF)=' '
. ICON(I+8)=OPMODE ...FIN
. ICON(I+9)=MODEOP
. ICON(I+10)=WORKAS ----------------------------------------
. ICON(I+11)=FLGSTART
...FIN TO PRINT-HEADING
. UNLESS (NEW)
---------------------------------------- . . NEW=.TRUE.
. . CALL DOCUHD(*1500)
TO GET-ICONS . . WRITE(IPRT,97)
C . . ...FIN
. STRAT = ICON(I+3) ...FIN
. PROT = ICON(I+6) C
. FLGSWG=ICON(I+7) C
. OPMODE=ICON(I+8)
. MODEOP=ICON(I+9) ----------------------------------------
. WORKAS=ICON(I+10)
. FLGSTART=ICON(I+11) TO MOVE-CONS-INTO-LOCAL-VARIABLES
. MTHDPE=ICON(i+22) C .
...FIN . LINX=CON(J+4)
. XBANK=CON(J+5)
---------------------------------------- . STSBST=CON(J+6)
. MNCAPBST=CON(J+7)
. MXCAPBST=CON(J+8)
. VAR(L+66) = STAGE TO SET-VARS
. VAR(L+67) = STEPTIME C .
. VAR(L+68) = TIMESTAGE4 . VAR(L+4) = ITCSC
. VAR(L+69) = ESTITOREAL . VAR(L+6) = UTCSC
. VAR(L+70) = XIOLD . VAR(L+14) = XREQ
. VAR(L+71) = XEQOLD . VAR(L+15) = XOHM
. VAR(L+72) = LIM . VAR(L+16) = K1GAIN
. VAR(L+73) = REALTM . VAR(L+17) = K2GAIN
. VAR(l+74) = IMAGTM . VAR(L+18) = PHASOR
...FIN . VAR(L+19) = SIGNAL
. VAR(L+20) = NEWSIGNAL
---------------------------------------- . VAR(L+21) = MWLINE
. VAR(L+22) = MWLINETOT
TO GET-VARS . VAR(L+23) = RE_REF
C . . VAR(L+24) = IM_REF
. ITCSC = VAR(L+4) . VAR(L+25) = TSTART
. UTCSC = VAR(L+6) . VAR(L+26) = NEWFRQ
. XREQ = VAR(L+14) . VAR(L+27) = ARGREF
. XOHM = VAR(L+15) . VAR(L+31) = XI
. K1GAIN = VAR(L+16) . VAR(L+32) = XEQ
. K2GAIN = VAR(L+17) . VAR(L+33) = XOLD
. PHASOR = VAR(L+18) . VAR(L+34) = X1
. SIGNAL = VAR(L+19) . VAR(L+35) = XTOT0
. NEWSIGNAL = VAR(L+20) . VAR(L+36) = PTOT0
. MWLINE = VAR(L+21) . VAR(L+37) = DELTAXTOT
. MWLINETOT = VAR(L+22) . VAR(L+38) = PPEAK1

72
. RE_REF = VAR(L+23) . VAR(L+39) = TRIGGERTIME
. IM_REF = VAR(L+24) . VAR(L+40) = PMEAN1
. TSTART = VAR(L+25) . VAR(L+41) = XFINAL
. NEWFRQ = VAR(L+26) . VAR(L+42) = XEQEST
. ARGREF = VAR(L+27) . VAR(l+43) = XIEST
. XI = VAR(L+31) . VAR(L+44) = PMEAN0
. XEQ = VAR(L+32) . VAR(L+45) = PPEAK0
. XOLD = VAR(L+33) . VAR(L+46) = XSTART
. X1 = VAR(L+34) . VAR(L+47) = XD
. XTOT0 = VAR(L+35) . VAR(L+48) = XSTEP1
. PTOT0 = VAR(L+36) . VAR(L+49) = XSTEP2
. DELTAXTOT = VAR(L+37) . VAR(L+50) = ATSTEP
. PPEAK1 = VAR(L+38) . VAR(L+51) = TRIGGERTIME1
. TRIGGERTIME = VAR(L+39) . VAR(L+52) = TRIGGER1
. PMEAN1 = VAR(L+40) . VAR(L+53) = DELTAXBV
. XFINAL = VAR(L+41) . VAR(L+54) = DELTAX
. XEQEST = VAR(L+42) . VAR(L+55) = DELTAX2ND
. XIEST = VAR(L+43) . VAR(L+56) = XHILIM
. PMEAN0 = VAR(L+44) . VAR(L+57) = XLOWLIM
. PPEAK0 = VAR(L+45) . VAR(L+58) = X0
. XSTART = VAR(L+46) . VAR(L+59) = DELTAXBV1
. XD = VAR(L+47) . VAR(L+60) = DXTOTBV1
. XSTEP1 = VAR(L+48) . VAR(L+61) = XTOT0
. XSTEP2 = VAR(L+49) . VAR(L+62) = TRIGGERTIME2
. ATSTEP = VAR(L+50) . VAR(L+63) = TRIGGER2
. TRIGGERTIME1 = VAR(L+51) . VAR(L+64) = FAULTRES
. VAR(L+65) = ISOSC
TO SET-STATES . TRIGGER1 = VAR(L+52)
C . . DELTAXBV = VAR(L+53)
. STATE(K) = XTCSC . DELTAX = VAR(L+54)
. STATE(K+1) = PAV . DELTAX2ND = VAR(L+55)
. STATE(K+2) = REALDP . XHILIM = VAR(L+56)
. STATE(K+3) = IMAGDP . XLOWLIM = VAR(L+57)
. STATE(K+4) = DEL_I . X0 = VAR(L+58)
. STATE(K+5) = TETACS . DELTAXBV1 = VAR(L+59)
. STATE(K+6) = THETA . DXTOTBV1 = VAR(L+60)
. STATE(K+7) = PAV1 . XTOT0 = VAR(L+61)
. STATE(K+8) = REALDP1 . TRIGGERTIME2 = VAR(L+62)
. STATE(K+9) = IMAGDP1 . TRIGGER2=VAR(L+63)
...FIN . FAULTRES=VAR(L+64)
. ISOSC=VAR(L+65)
---------------------------------------- . STAGE = VAR(L+66)
. STEPTIME = VAR(L+67)
TO POPULATE-VOLTS-LINECURRENT . TIMESTAGE4 = VAR(L+68)
C . FROM BUS VOLTAGE . ESTITOREAL = VAR(L+69)
. RX=VOLT(II) . XIOLD = VAR(L+70)
. VAR(L+1)=180./PI*ATAN2(X,R) . XEQOLD = VAR(L+71)
. VAR(L)=ABS(RX) . LIM = VAR(L+72)
C . TO BUS VOLTAGE . REALTM = VAR(L+73)
. RX=VOLT(JJ) . IMAGTM = VAR(L+74)
. VAR(L+3)=180./PI*ATAN2(X,R) ...FIN
. VAR(L+2)=ABS(RX)
C . CURRENT ON BRANCH ----------------------------------------

73
. RX=-1.*(VOLT(II)-VOLT(JJ))*GB(KF)
C . PLUS CURRENT INJECTION = LINE CURRENT TO GET-STATES
. RX=RX+ADDER C .
. VAR(L+5)=180./PI*ATAN2(X,R) . XTCSC = STATE(K)
. VAR(L+4)=ABS(RX) . PAV = STATE(K+1)
...FIN . REALDP = STATE(K+2)
END . IMAGDP = STATE(K+3)
. DEL_I = STATE(K+4)
(FLECS Version 22.60 - PTI) . TETACS = STATE(K+5)
. THETA = STATE(K+6)
---------------------------------------- . PAV1 = STATE(K+7)
. REALDP1 = STATE(K+8)
. IMAGDP1 = STATE(K+9)
...FIN

----------------------------------------

TO SET-DSTATES
C .
. DSTATE(K) = DXTCSC
. DSTATE(K+1) = DPAV
. DSTATE(K+2) = DREALDP
. DSTATE(K+3) = DIMAGDP
. DSTATE(K+4) = DDEL_I
. DSTATE(K+5) = DTETACS
. DSTATE(K+6) = DTHETA
. DSTATE(K+7) = DPAV1
. DSTATE(K+8) = DREALDP1
. DSTATE(K+9) = DIMAGDP1
...FIN
References:
[1] Nicklas P.Johansson, Hans-Peter Nee, Lennart Ängquist, “Adaptive control of
Controlled Series Compensators for Power System Stability Improvement”

[2] Nicklas P.Johansson, Hans-Peter Nee, Lennart Ängquist, “Estimation of Grid


Parameters for the control of Variable Series Reactance FACTS Devices” IEEE PES
General Meeting 18-22 June 2006

[3] Nicklas P.Johansson, Hans-Peter Nee, Lennart Ängquist, “Discrete Open Loop
Control for Power Oscillation Damping Utilizing Variable Series Reactance FACTS
Device”, UPEC2006,September 2006

[4] Nicklas P.Johansson, Hans-Peter Nee, Lennart Ängquist, “An adaptive Model
Predictive Approach to Power Oscillation Damping Utilizing Variable Series
Reactance Facts Devices”

[5] Lennart Ängquist, Carlos Gama “Damping Algorithm based on Phasor


Estimation”

[6] Lennart Ängquist, “TCSC model for POD studies in PSS/E”

[7] “Thyristor controlled Series Compensation”, Technical Description of the TCSC


Technology, ABB Power Technologies AB FACTS.

[8] Kundur, P, “Power System Stability and Control”, McGraw-Hill,1994

[9] PSS/E Operation Manual

74

Вам также может понравиться