tesis-flecs-psse

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

Upload: gabiiteamo

Post on 22-Jun-2015

100 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: tesis-FLECS-PSSE

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

Page 2: tesis-FLECS-PSSE

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

Page 3: tesis-FLECS-PSSE

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

Page 4: tesis-FLECS-PSSE

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

Page 5: tesis-FLECS-PSSE

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

Page 6: tesis-FLECS-PSSE

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

Page 7: tesis-FLECS-PSSE

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

Page 8: tesis-FLECS-PSSE

( )( )

( )(1 212sint

tL C

U UPX X

θ= ⋅−

)t (1.1)

By using CSC to insert a proper value of CX , 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

Page 9: tesis-FLECS-PSSE

1.1.5 Outline of the Adaptive Controller

Phasor Estimation (RLS)

Oscillation Detector

System Parameter Estimation

Power Flow & Damping Controller

CSC Line Power

Reactance on CSC Line

Pxbv

Figure 1.2 Simplified block diagram of the adaptive controller

CSC Line Power Measurement

Input signal of the controller, used in the phasor estimation, Local active power measurement

Phasor Estimation(RLS)

Extracts a phasor that represents the power swing with an expected oscillation frequency. Also the average power on the line is estimated.

Oscillation Detector

Detects the oscillation in the transmission system, and triggers the reaction of the adaptive controller

System ParameterEstimation

Performs the estimation of the series reactance Xi and the 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 & Damping Controller

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

Reactance on CSC Line

Output signal of the adaptive controller. The reactance value to be added by the CSC facility.

Table 1.1 Overview of the parts of the adaptive controller

4

Page 10: tesis-FLECS-PSSE

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

Page 11: tesis-FLECS-PSSE

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

Page 12: tesis-FLECS-PSSE

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.

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

5 6 7 8 9 10 11

G2

2

G4

4

G1

1

G3

3

12

25km10km

150km 150km

150km

10km25km

C7 C9

L7 L9C8

Area 2 Area 1

Power Flow

13L13 1km

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

Page 13: tesis-FLECS-PSSE

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.

STABK 1

sTwsTw+

1

2

11

sTsT

++

3

4

11

sTsT

++

11

A

B

sTsT

++

11 RsT+

AK∑

rωΔ Power system stabilizer

ExciterTGR

refV

tE

Vs

fdE

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

Page 14: tesis-FLECS-PSSE

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,

(2.1) 0

20

' / 0' ( / 0)

P P U UQ Q U U= ⋅

= ⋅where are initial values of power, is initial voltage, and U is current voltage.

0' , 'P Q 0 0U

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

Page 15: tesis-FLECS-PSSE

Figure 2.2 Response file for load flow calculation

MENU,OFF /* FORCE MENU TO CORRECT STATUS optn 11 60.00 0 BAT_Read 0 "C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2.raw" BAT_FDNS, 0, 0, 0, 1, 1, 0, 99, 0 ; BAT_SAVE "C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2.sav" OPEN 2 0 1 C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2_LF.dat BAT_POUT 0 1 CLOS BAT_CONG 0 CONL all 100.00 0.00 0.00 100.00 1 SAVE C:\Program Files\PTI\PSSE29\EXAMPLE\new model4\Studysys2.cnv ECHO @END

Pick up case

Solution method selected

Generation and Load Conversion

Case save for Dynamic Simulation

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

Page 16: tesis-FLECS-PSSE

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 machine

P[MW] (PSS/E)

P[MW] (SIMPOW)

Q[Mvar](PSS/E)

Q[Mvar] (SIMPOW)

tE [p.u.] (PSS/E)

[p.u.] tE(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 50.0 Mvar

-395.8 Mvar

250.1 MW 50.5 Mvar

591.6 MW

-1558.8 MW 295.5 Mvar

IN SIMPOW 717.0 MW 50.0 Mvar

-396.1 Mvar

250.1 MW 50.5 Mvar

591.6 MW -1558.8 MW 297.1 Mvar

BUS 9 To Load To Shunt To Bus 8 To Bus 10 To Bus 12 IN PSS/E

1967.0 MW 100.0 Mvar

-388.8 Mvar

-370.6 MW 62.0 Mvar

-1409.9 MW 195.5Mvar

-186.5 MW 31.5 Mvar

IN SIMPOW 1967.0 MW 100.0 Mvar

-389.3 Mvar

-371.6 MW 61.6 Mvar

-1409.4 MW 197.7Mvar

-185.9 MW 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

Page 17: tesis-FLECS-PSSE

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

Initialization

Optional disturbance

Network Solution

Time Derivative Calculation

Numerial Integration

Advance Time

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

Page 18: tesis-FLECS-PSSE

Excitation System

Generator Model

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

Page 19: tesis-FLECS-PSSE

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

Page 20: tesis-FLECS-PSSE

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

Page 21: tesis-FLECS-PSSE

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

Page 22: tesis-FLECS-PSSE

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

Page 23: tesis-FLECS-PSSE

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.

0 2 4 6 8 10 12 14 16 18 20300

400

500

600

700

800

900

1000Generator power [MW]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 2059.9

60

60.1

60.2

60.3

60.4

60.5

60.6

60.7Generator Speed [HZ]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 200

500

1000

1500

2000

2500

3000Generator Ang [DEGREE]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 20-50

0

50

100

150

200

250

300

350

400

450TCSC Line Power [MW]

Time [s]

SIMPOWPSS/E

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

Page 24: tesis-FLECS-PSSE

0 5 10 15400

450

500

550

600

650

700

750

800

850

900Load Characteristic of Active Power [MW] at Node 7

Time [s]

SIMPOWPSS/E

0 5 10 1510

20

30

40

50

60

70

80Load Characteristic of Reactive Power [VAr] at Node 7

Time [s]

SIMPOWPSS/E

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

Page 25: tesis-FLECS-PSSE

0 2 4 6 8 10 12 14 16 18 20300

400

500

600

700

800

900Generator power [MW]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 2059

60

61

62

63

64

65

66Generator Speed [HZ]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18

2x 104

200

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

Generator Ang [DEGREE]

Time [s]

SIMPOW1.8 PSS/E

0 2 4 6 8 10 12 14 16 18 20-50

0

50

100

150

200

250

300TCSC Line Power [MW]

Time [s]

SIMPOWPSS/E

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

Page 26: tesis-FLECS-PSSE

0 2 4 6 8 10 12 14 16 18 20300

400

500

600

700

800

900

1000Generator power [MW]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 20-50

0

50

100

150

200

250

300

350

400

450TCSC Line Power [MW]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 20750

760

770

780

790

800

810Generator Mech Torque [MW]

Time [s]

SIMPOWPSS/E

0 2 4 6 8 10 12 14 16 18 2059.95

60

60.05

60.1

60.15

60.2

60.25

60.3

60.35

60.4

60.45Generator Speed [HZ]

Time [s]

SIMPOWPSS/E

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

Page 27: tesis-FLECS-PSSE

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:

0 2.5 5 7.5 10 12.5 15-50

0

50

100

150

200

250

300

350

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

0 2.5 5 7.5 10 12.5 150

50

100

150

200

250

300

350

400

450

500

Four-machine system, 3-ph SC for 200ms, TCSC line power transfer, Comparison between PSS/E and Simpow

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

Case A Case B

22

Page 28: tesis-FLECS-PSSE

0 2.5 5 7.5 10 12.5 15-50

0

50

100

150

200

250

300

Four-machine system, 3-ph SC for 200ms, High Power Case disconnection one of the N7-N8 lines, TCSC line power transfer without controller, Comparison between PSS/E and Simpow

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

0 2.5 5 7.5 10 12.5 15-20

0

20

40

60

80

100

120

140

Four-machine system, 3-ph SC for 200ms, Low Power Case without line disconnectioTCSC line power transfer, comparison between PSS/E and Simpow

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

0 2.5 5 7.5 10 12.5 15-20

0

20

40

60

80

100

120

140

160

180

Four-machine system, 3-ph SC for 200ms, Low Power Case disconnection one of the N8-N9 liTCSC line power transfer, comparison between PSS/E and Simpow

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

0 2.5 5 7.5 10 12.5 15-20

0

20

40

60

80

100

120

140

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

Case A Case C Case D

Case F Case E

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

Page 29: tesis-FLECS-PSSE

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 iX which includes the inner reactance of each machine and the reactance in the grid outside the loop, one reactance eqX 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. is the total active power transfer between two areas. The power flow though the reactance controlled line is denoted by .

totPlineP

1 1,U θ 2 2,U θ 1iX

eqX

2iXX

1 2i i iX X X= +totP lineP

Figure 3.1 Reduced model diagram

24

Page 30: tesis-FLECS-PSSE

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,

0 5 10 150

100

200

300

400

500

Act

ive

Pow

er (M

W)

Reduced Grid Parameter Estimation

Time [s]0 5 10 15

P´xs ta te

P´xPxs ta te

Px

-0.05

0

Ser

ies

reac

tanc

e (p

.u.)

0T

X´X

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 , line reactance is changed from the value0T 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,

xstateP Average power on the line before the step xstateP′ Average power on the line after the step

xP Instantaneous power on the line before the step xP′ Instantaneous power on the line after the step

25

Page 31: tesis-FLECS-PSSE

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 xstateP and xstateP′ using the below expression.

1

Xstate

Xstateeq

Xstate

Xstate

PX XPX P

P

′′−

= ′−

(3.1)

The derivation of expression 3.1 and the expression for the new grid parameter iX 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 iX is derived from equations 3.2, 3.3 and 3.4,

.eq eqtot

eq eq

X X XXXX X X X

′Δ = −

′ + + (3.2)

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

.( ) 1( )

tottot

X eq

X eq

XX P X XP X X

Δ=

+−

′ ′ +

(3.3)

totX is the total reactance between areas. Finally, iX is calculated as

.eqi tot

eq

X XX XX X⋅

= −+

(3.4)

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

Page 32: tesis-FLECS-PSSE

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 { }( ) Re j tP t Pav Pe Ω= + Δ . (3.5)

Here is the average power and avP 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 oscillation occur. In these situations, { }Im 0j tPe ΩΔ = .

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 is sensitive to the filter’s bandwidth in the phasor estimation algorithm. In order to measure the average active power

avPxstateP′ after

every step with a response time that is less that half the oscillation cycle, a fast response of the 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 value. Furthermore, resetting the RLS causes the phasor signal

avP

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

Page 33: tesis-FLECS-PSSE

RLS Estimation with High Bandwidth

RLS Estimation with Low Bandwidth

Frequency Correction

avP & PΔ signals for controller

Corrected FrequencyMeasured Line Power

Figure 3.3 Double RLS Estimation Diagram In the figure 3.3, two RLS estimation modules are used. One module is using low 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 control step or fault. Hence the output signal avP & 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.

0 5 10 15

0

50

100

150

200

250

300

350

400

450Double RLS estimation Output PAV Signal

Time [s]

Act

ive

Pow

er (M

W)

MWLINERLS with High Bandwidth & ResetRLS with Low Bandwidth

28

Page 34: tesis-FLECS-PSSE

0 5 10 15

-100

0

100

200

300

400

500Double RLS estimation Outout Phasor Signal

Time [s]

Act

ive

Pow

er (M

W)

MWLINERLS with High Bandwidth & ResetRLS with Low Bandwidth

Figure 3.4 Double RLS Estimation Results of avP & 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

Page 35: tesis-FLECS-PSSE

21 0 1 2 1 2

121

22 0 1 2 2 1

222

sin( )2

sin( )2

mtot

mtot

d U UPdt H Xd U UPdt H X

θ ω θ θ

θ ω θ

−⎛ ⎞= −⎜ ⎟⎝

−⎛ ⎞= −⎜ ⎟⎝ ⎠

θ⎠ (3.6)

Here are the inertia constants of each lumped machine representation, 1, 2H 1, 2θ are the electrical angles relative to the rotating frame of each machine. is the mechanical power for each machine which assumed to be constant. are the voltages at the lumped machine terminals which are assumed to be well controlled and constant.

1, 2mP1, 2U

totX 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 totX 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,

1 2 1 2sin( )tot

tot

U UPXθ θ−

= (3.7)

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

1 2 0(0... )

min ( ( ), ( ), ( ))tot tot totXtot N

P N N X N Pθ θ −

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

0totP

3.3.3 Open loop Damping Controller with Power Set-Point If the total reactance totX 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. and are well controlled 1U 2U

30

Page 36: tesis-FLECS-PSSE

and constant. Then, equation 3.7 is valid both before and after the reactance change, and it can be extended to equation 3.9: 0 0 1 1p tot p totP X P X= (3.9) Here, and separately denote the total active power transmitted directly before and directly after the step.

0pP 1pP0totX denotes the initial total reactance between areas

and 1totX 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 and

are used here since the parameter estimation only can be performed after these two-steps execution.

0.01Xi =0.35Xeq =

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

Page 37: tesis-FLECS-PSSE

0 2.5 5 7.5 10 12.5 150

100

200

300

400

500

Act

ive

Pow

er (M

W)

0 5 10 15

Two step power oscillation damping from PSS/E

-0.06

-0.04

-0.02

0

Ser

ies

reac

tanc

e (p

.u.)CSC L ine Power

First Step

Second Step

CSC Series Reactance

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 ,i eqX X 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

Page 38: tesis-FLECS-PSSE

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

0 5 10 150

50

100

150

200

250

300

350

400

450

500

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0.1

-0.075

-0.05

-0.025

0

0.025

0.05

0.075

0.1

0.125

0.15

Ser

ies

reac

tanc

e (p

.u.)

TC SC En g a g e d

TC SC D is e n g a g e d

TC SC R e a c ta n ce

0 2.5 5 7.5 10 12.5 150

0.04

0.08

0.12

0.16

0.2

0.24

0.28

0.32

0.36

0.4

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

Rea

ctan

ce X

I(p.u

.)

XI

XEQ

Figure 3.6 Closed Loop Control Results from PSS/E Top Diagram: FACTS Line Power &Reactance Bottom Diagram: Updated Grid Parameter Estimation

33

Page 39: tesis-FLECS-PSSE

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

Page 40: tesis-FLECS-PSSE

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

Page 41: tesis-FLECS-PSSE

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

Page 42: tesis-FLECS-PSSE

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

Page 43: tesis-FLECS-PSSE

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.

0 5 10 150

25

50

75

100

125

150

175

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0,1

0

0,1

Ser

ies

reac

tanc

e (p

.u.)

s tage 1 ,2 ,3

s tage 4

s tage 1,2,3s tage 4

Figure 4.1 Stages Distribution in PSS/E simulation Stage 1 Measure xstateP′ , X ′ , update Xi & Xeq as described in 3.1 Stage 2 Measure xstateP , xP and X Stage 3 Calculate the necessary reactance step XΔ Stage 4 Measure P′

xstateP Average power on the line before the step xstateP′ Average power on the line after the step

xP Instantaneous power on the line before the step xP′ 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

Page 44: tesis-FLECS-PSSE

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

Page 45: tesis-FLECS-PSSE

0 2.5 5 7.5 10 12.5 15-100

-50

0

50

100

150

200

250

300

350

400A

ctiv

e P

ower

(MW

)

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

Time [s]0 5 10 15

-0.1

-0.075

-0.05

-0.025

0

0.025

0.05

0.075

0.1

0.125

0.15

Ser

ies

reac

tanc

e (p

.u.)

TC SC En g a g e d

TC S C D is e n g a g e d

TC SC R e a c ta n ce

0 2.5 5 7.5 10 12.5 150

200

400

600

800

1000

1200

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

Time [s]

Act

ive

Pow

er[M

W]

TC SC D is e n g a g e d

TC SC En g a g e d

40

Page 46: tesis-FLECS-PSSE

0 2.5 5 7.5 10 12.5 150

0.04

0.08

0.12

0.16

0.2

0.24

0.28

0.32

0.36

0.4R

eact

ance

Xeq

(p.u

.)

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

Time [s]0 5 10 15

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

Rea

ctan

ce X

I(p.u

.)

XI

XEQ

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

Page 47: tesis-FLECS-PSSE

more effective. It can be seen from the figure that the parameters Xi & Xeq start from the safe value at 0.10 . .Xi p= u and 0.35 . .Xeq p u= , and stabilize close to 0.175 . .Xi p= u and 0.085 . .Xeq 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

0 5 10 150

0.05

0.1

0.15

0.2

0.25

0.3

0.35Forgetting Factor Influence on XEQ estimation

Time [s]

Rea

ctan

ce X

eq(p

.u.)

Updated valueEstimated value

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

Page 48: tesis-FLECS-PSSE

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

Page 49: tesis-FLECS-PSSE

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

Page 50: tesis-FLECS-PSSE

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 , and the frequency correction limits are . 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.

Hz 0.15Hz±

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 (MW); the damping exponent with the damping controller disengaged is denoted

ppOsciσ . The inter-area mode oscillation frequency if 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 . The necessary number of reactance steps for complete damping is denoted as Steps. The power flow set point is defined as and is the final active power flow on the FACTS line after simulation. The value of the original parameters

csc( )T s

Pxbv cscP,i ifσ and are quoted from reference [3]. iT

45

Page 51: tesis-FLECS-PSSE

CASE A

0.650.001

3700250

i

i

i

f

TPxbv

σ== −=

=

CASE B 0.55

0.04582

300

i

i

i

f

TPxbv

σ== −=

=

CASE C 0.54

0.05956

200

i

i

i

f

TPxbv

σ== −=

=

600MW

N7-N9 From PSS/E

csc

2607.2

7csc 250

ppOSCTStepsP

====

csc

2407.1

5csc 300

ppOSCTStepsP

====

csc

1408.9

8csc 200

ppOSCTStepsP

====

600MW

N7-N9 From SIMPOW

csc

2607.2

7csc 250

ppOSCTStepsP

====

csc

2508.0

6csc 300

ppOSCTStepsP

====

csc

1808.8

8csc 200

ppOSCTStepsP

====

CASE D

0.720.12

2660

i

i

i

f

TPxbv

σ== −=

=

CASE E

0.680.097

3690

i

i

i

f

TPxbv

σ== −=

=

CASE F

0.680.1

3270

i

i

i

f

TPxbv

σ== −=

=

180MW

N7-N9 From PSS/E

csc

1005.9

6csc 60

ppOSCTStepsP

====

csc

1204.2

4csc 90

ppOSCTStepsP

====

csc

1005.4

5csc 70

ppOSCTStepsP

====

180MW N7-N9 From SIMPOW

csc

906.0

5csc 60

ppOSCTStepsP

====

csc

1204.2

4csc 90

ppOSCTStepsP

====

csc

1005.5

5csc 70

ppOSCTStepsP

====

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

Page 52: tesis-FLECS-PSSE

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

0 2.5 5 7.5 10 12.5 150

50

100

150

200

250

300

350

400

450

500

Four-machine system, 3-ph SC for 200ms, TCSC line power transfer, Comparison between PSS/E and Simpow

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

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

Page 53: tesis-FLECS-PSSE

0 2.5 5 7.5 10 12.5 150

50

100

150

200

250

300

350

400

450

500

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0.1

-0.075

-0.05

-0.025

0

0.025

0.05

0.075

0.1

0.125

0.15

Ser

ies

reac

tanc

e (p

.u.)

0 5 10

SIMPOWPSS/E

FACTS Line Power

Series Reac tanc ed

15

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.

0 2.5 5 7.5 10 12.5 15 0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0.03

0.06

0.09

0.12

0.15

0.18

0.21

0.24

Rea

ctan

ce X

I(p.u

.)

0 5 10

PSS/E

SIMPOW

XI

XEQ

15

Fig 5.2 Grid Parameter Estimation Comparison in PSS/E & SIMPOW

48

Page 54: tesis-FLECS-PSSE

0 2.5 5 7.5 10 12.5 15

0.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

0.8

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

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

Page 55: tesis-FLECS-PSSE

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

Page 56: tesis-FLECS-PSSE

CASE A

0 2.5 5 7.5 10 12.5 15-100

-50

0

50

100

150

200

250

300

350

400

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0,1

-0,06

-0,02

0,02

0,06

0,1

Ser

ies

reac

tanc

e (p

.u.)

0 5 10

SIMPOWPSS/E

15

0 2.5 5 7.5 10 12.5 150

0,05

0,1

0,15

0,2

0,25

0,3

0,35

0,4

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0,1

0,2

0,3

0,4

Rea

ctan

ce X

I(p.u

.)

0 5 10

SIMPOWPSS/E

XI

XEQ

15

0 2.5 5 7.5 10 12.5 150.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

0.8

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

51

Page 57: tesis-FLECS-PSSE

CASE C

0 2.5 5 7.5 10 12.5 15-100

-50

0

50

100

150

200

250

300

350

400

Act

ive

Pow

er (M

W)

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

Time [s]0 2.5 5 7.5 10 12.5 15

-0,1

-0,06

-0,02

0,02

0,06

0,1

Ser

ies

reac

tanc

e (p

.u.)

0 2.5 5 7.5 10 12.5

SIMPOWPSS/E

15

0 2.5 5 7.5 10 12.5 150

0.04

0.08

0.12

0.16

0.2

0.24

0.28

0.32

0.36

0.4

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0.04

0.08

0.12

0.16

0.2

0.24

0.28

0.32

0.36

0.4

Rea

ctan

ce X

I(p.u

.)

0 5 10

SIMPOWPSS/E

15

0 2.5 5 7.5 10 12.5 150.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

0.8

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

52

Page 58: tesis-FLECS-PSSE

CASE D

0 2.5 5 7.5 10 12.5 15-50

-25

0

25

50

75

100

125

150

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0.1

-0.05

0

0.05

0.1

Ser

ies

reac

tanc

e (p

.u.)

0 5 10

SIMPOWPSS/E

15

0 2.5 5 7.5 10 12.5 150

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0.05

0.1

0.15

0.2

Rea

ctan

ce X

I(p.u

.)

0 5 10

SIMPOWPSS/E

XI

XEQ

15

0 2.5 5 7.5 10 12.5 150.5

0.55

0.6

0.65

0.7

0.75

0.8

0.85

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

53

Page 59: tesis-FLECS-PSSE

CASE E

0 2.5 5 7.5 10 12.5 15-50

-25

0

25

50

75

100

125

150

175

200

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0,1

-0,06

-0,02

0,02

0,06

0,1

Ser

ies

reac

tanc

e (p

.u.)

0 5 10

SIMPOWPSS/E

15

0 2.5 5 7.5 10 12.5 150

0,12

0,24

0,36

0,48

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0.05

0.1

0.15

0.2

Rea

ctan

ce X

I(p.u

.)

0 5 10

SIMPOWPSS/E

XI

XEQ

15

0 2.5 5 7.5 10 12.5 150.5

0.55

0.6

0.65

0.7

0.75

0.8

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

54

Page 60: tesis-FLECS-PSSE

CASE F

0 2.5 5 7.5 10 12.5 15-50

-25

0

25

50

75

100

125

150

Act

ive

Pow

er (M

W)

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

Time [s]0 5 10 15

-0,1

-0,05

0

0,05

0,1

Ser

ies

reac

tanc

e (p

.u.)

0 5 10

SIMPOWPSS/E

15

0 2.5 5 7.5 10 12.5 150

0,08

0,16

0,24

0,32

0,4

Rea

ctan

ce X

eq(p

.u.)

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

Time [s]0 5 10 15

0

0.04

0.08

0.12

0.16

0.2

Rea

ctan

ce X

I(p.u

.)

0 5 10

SIMPOWPSS/E

XI

XEQ

15

0 2.5 5 7.5 10 12.5 150.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

0.8

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

Time [s]

Act

ive

Pow

er[M

W]

PSS/ESIMPOW

55

Page 61: tesis-FLECS-PSSE

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

Page 62: tesis-FLECS-PSSE

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

Page 63: tesis-FLECS-PSSE

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

Page 64: tesis-FLECS-PSSE

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

Page 65: tesis-FLECS-PSSE

Appendix B Flecs Code for the Controller in PSS/E This flecs code may contain some information relates to another damping controller which developed previously. Those codes will not influence the implementation of the current studied controller.

C[M

AIN

TC]

C

SUB

RO

UTI

NE

MA

INTC

(I,J,

K,L

) C

C

C

C

S

UB

RO

UTI

NE

MA

INTC

/TA

INTC

C

TCSC

MA

IN C

IRC

UIT

MO

DEL

C

C

I

= S

TAR

TIN

G 'I

CO

N' I

ND

EX [

USE

S IC

ON

(I) T

HR

OU

GH

ICO

N(I

+22)

] C

J

= S

TAR

TIN

G 'C

ON

' IN

DEX

[ U

SES

CO

N(J

) TH

RO

UG

H C

ON

(J+2

4) ]

C

K =

STA

RTI

NG

'STA

TE' I

ND

EX [

USE

S ST

ATE

(K) T

HR

OU

GH

STA

TE(K

+6) ]

C

L

= S

TAR

TIN

G 'V

AR

' IN

DEX

[ U

SES

VA

R(L

) TH

RO

UG

H V

AR

(L+3

0) ]

C

C

IN

TIC

N(I

) =

FR

OM

BU

S SE

QU

ENC

E N

UM

BER

C

I

NTI

CN

(I+1

) = T

O B

US

SEQ

UEN

CE

NU

MB

ER

C

IN

TIC

N(I

+2) =

BR

AN

CH

SIN

GLE

EN

TRY

LIS

T IN

DEX

$1

C

U

SE D

YN

AM

ICS,

ON

LY:

CO

N,

V

AR

,

ICO

N,

IN

TIC

N,

*

CH

RIC

N,

*

STO

RM

T, S

TATE

, D

STA

TE,

STO

RE,

*

B

SFR

EQ

USE

PSS

CM

4,

O

NLY

: B

ASV

LT,

BU

SNA

M,

V

OLT

,

*

I

CO

M,

*

GB

,

*

T

APN

O,

*

ZER

NU

M

USE

LFS

OLN

_MO

DU

LE, O

NLY

: C

UR

NT

INC

LUD

E 'K

EYPT

I.IN

S'

INC

LUD

E 'S

YSD

EP.IN

S'

INC

LUD

E 'P

ERM

4.IN

S'

INC

LUD

E 'H

EAD

R4.

INS'

IN

CLU

DE

'DSC

OM

4.IN

S'

C

INTE

GER

I,

J

,

K,

L

C

IN

TRIN

SIC

AB

S, C

MPL

X, R

EAL,

AIM

AG

, ATA

N2

C

EX

TER

NA

L A

DIN

TN, B

SSEQ

N, C

KTI

DS,

CO

NIN

T, D

OC

UH

D, F

AC

T, -

brin

g ba

ck w

hen

prin

t hea

ding

is e

nabl

ed

EXTE

RN

AL

AD

INTN

, BSS

EQN

, CK

TID

S, C

ON

INT,

FA

CT,

*

FN

DK

F1, L

INM

OD

, LO

FLSB

, RTR

NSB

, VLT

FR6

C

INTE

GER

II

,

JJ,

IB

US,

K

F, S

TRA

T, M

THD

PE

REA

L

R,

X

,

RX

R(2

), T

1,

T2,

MA

G, L

INX

C

OM

PLEX

A

DD

ER,

RX

LO

GIC

AL

NEW

,SK

IP

CH

AR

AC

TER

CB

1*6,

CB

2*6,

CB

3*6,

CB

4*6,

NA

ME(

2)*1

8

C

HA

RA

CTE

R IV

EC(1

)*2,

CO

RT*

1, IC

KT*

2, C

BU

F(1)

*6

C

VA

RIA

BLE

S FO

R D

SL C

OD

E

R

EAL

UTC

SC,IT

CSC

,MIN

TCSC

,MN

CA

PBST

,IND

BST

,UM

XTC

SC,U

HY

ST

REA

L X

INS,

IND

TCSC

, XB

AN

K, T

KB

YP,

TK

CA

P, X

TCSC

, DX

TCSC

, XR

EQ, X

OH

M

REA

L ST

SBST

, K1G

AIN

, K2G

AIN

, PH

ASO

R, S

IGN

AL,

MW

LIN

E, N

EWSI

GN

AL,

B

YPS

STIM

E, M

NTB

YPS

S,M

XC

APB

ST

REA

L PA

V, R

EALD

P, IM

AG

DP,

DPA

V, D

REA

LDP,

DIM

AG

DP,

PI,

FR

QO

SC, W

REF

, TH

ETA

, D

THET

A, R

EALR

F, IM

AG

RF

REA

L R

EALT

M, I

MA

GTM

, REA

LAU

, IM

AG

AU

, CO

AV

FRQ

, CO

FLFR

Q, A

LPH

A, K

AV

, KPH

, R

E_R

EF, I

M_R

EF, T

STA

RT,

DEL

_I,D

DEL

_I

REA

L O

PER

AT,

TET

AC

S, D

TETA

CS,

PH

REA

L, P

HIM

AG

, NEW

FRQ

, AR

GR

EF, X

DIF

, YD

IF,

AN

GD

IF, K

DF,

TD

F, D

ELFR

Q

REA

L D

FMA

X, D

FMIN

, STO

REK

P6

REA

L TK

R

EAL

XSI

AV

, XSI

PH, K

APP

AA

V, K

APP

AC

S, K

APP

ASN

, MW

HA

T, IN

NO

V

REA

L X

1

REA

L X

I XD

XEQ

XIN

IT

REA

L X

OLD

XTO

T0 P

TOT0

PO

SC

REA

L D

ELTA

XTO

T A

1

R

EAL

TRIG

GER

TIM

E PP

EAK

1

R

EAL

PMEA

N1

XST

AR

T X

FIN

AL

PMEA

N0

PPEA

K0

REA

L X

EQES

T X

TOTI

NIT

XIE

ST D

ELTA

XTO

T1 X

IOLD

XEQ

OLD

R

EAL

DEL

TAX

BV

PX

BV

DEL

TAX

BV

1 X

TOT2

BV

XTO

T1B

V

REA

L D

XTO

TBV

1 D

XTO

TBV

2 X

STEP

1 X

DB

V1

XST

EP2

R

EAL

XH

ILIM

, XLO

WLI

M, D

ELTA

X, D

ELTA

X2N

D

REA

L FA

ULT

TIM

E FA

ULT

DEL

AY

FA

ULT

DEL

AY

2 ST

EPTI

ME

TIM

ESTA

GE4

R

EAL

MW

LIN

ETO

T

R

EAL

PAV

1, R

EALD

P1, I

MA

GD

P1, D

PAV

1, D

REA

LDP1

, DIM

AG

DP1

R

EAL

XSI

AV

1, X

SIPH

1, K

APP

AA

V1,

KA

PPA

CS1

, KA

PPA

SN1,

MW

HA

T1, I

NN

OV

1, la

mbd

a,

Osc

Lim

it

IN

TEG

ER A

TSTE

P

IN

TEG

ER P

RO

T,FL

GSW

G,O

PMO

DE,

MO

DEO

P, W

OR

KA

S, F

LGST

AR

T ST

AG

E

LO

GIC

AL

TRIG

GER

1 TR

IGG

ERTI

ME1

TR

IGG

ERTI

ME2

X0

TRIG

GER

2

LO

GIC

AL

FAU

LTIN

HIB

IT F

AU

LTR

ES IS

OSC

EST

ITO

REA

L LI

M

SAV

E ST

OR

EKP6

C

EQ

UIV

ALE

NC

E (R

X,R

XR

,R),

(R

XR

(2),X

),

*

(C

OR

T,IC

KT,

CB

UF)

, (

AD

DER

,T2)

C

D

ATA

IVEC

/'AB

'/

D

ATA

PI/3

.141

5926

54/

C

IF

(MO

DE.

GT.

4) G

O T

O 1

000

$1

C

MO

VE-

CO

NS-

INTO

-LO

CA

L-V

AR

IAB

LES

C

C

VA

RIA

BLE

DEF

INIT

ION

S A

S IN

CTR

LTC

SC.D

SL

C

MIN

TCSC

=XB

AN

K*M

NC

APB

ST

UH

YST

=UM

XTC

SC*0

.1

IND

TCSC

=XB

AN

K*I

ND

BST

C

60

Page 66: tesis-FLECS-PSSE

NEW

=MO

DE.

EQ.4

C

IF

(NEW

.OR

. (M

OD

E.EQ

.3 .A

ND

. KPA

USE

.EQ

.2) )

.

ICK

T=C

HR

ICN

(I+2

) C

.

.

IF (I

CK

T.EQ

.'$$'

)

.

. K

F=IC

ON

(I+2

) C

.

.

. .

IF (K

F.LT

.0 .O

R. K

F.G

T.99

)

.

. .

WR

ITE(

LPD

EV,1

27) K

F,IC

ON

(I),I

CO

N(I

+1)

. .

. G

O T

O 9

00

. .

...FI

N

C

. .

.

. W

HEN

(KF.

LE.9

) WR

ITE(

ICK

T,'(I

1,1X

)') K

F

.

. EL

SE

WR

ITE(

ICK

T,'(I

2)')

KF

C

. .

.

. C

HR

ICN

(I+2

)=IC

KT

. ...

FIN

C

.

.

IBU

S=IC

ON

(I)

C

.

. IF

(IB

US.

LE.0

) GO

TO

900

C

.

.

CA

LL B

SSEQ

N(I

BU

S,II

,*80

0)

C

.

. IB

US=

ICO

N(I

+1)

. C

ALL

BSS

EQN

(IB

US,

JJ,*

800)

C

.

.

CA

LL F

ND

KF1

(II,J

J,IC

KT,

KF)

C

.

.

IF (K

F.EQ

.0)

. .

WR

ITE(

LPD

EV,1

07) I

CK

T,IC

ON

(I),I

CO

N(I

+1)

. .

GO

TO

900

.

...FI

N

C

.

. IF

(TA

PNO

(KF)

.NE.

0)

. .

WR

ITE(

LPD

EV,1

57) I

CK

T,IC

ON

(I),I

CO

N(I

+1)

. .

GO

TO

900

.

...FI

N

C

.

. IF

(IC

OM

(KF)

.LE.

0) G

O T

O 9

00

C

.

C

. M

OD

EL N

OT

IMPL

EMEN

TED

FO

R M

STR

/MR

UN

.

IF (M

IDTR

M)

. .

WR

ITE(

LPD

EV,1

67) I

CK

T,IC

ON

(I),I

CO

N(I

+1)

. .

GO

TO

900

.

...FI

N

C

.

. IN

TIC

N(I

)=I

I

.

INTI

CN

(I+1

)=JJ

.

INTI

CN

(I+2

)=K

F C

.

. IF

(ZER

NU

M(K

F).G

T.0)

WR

ITE(

LPD

EV,1

37) I

CK

T,IC

ON

(I),I

CO

N(I

+1)

C

.

. IF

(NEW

)

! MO

DE

= 4-

-SET

NIN

TEG

.

. IF

( (K

+9).G

T.N

INTE

G )

NIN

TEG

=K+9

.

. R

ETU

RN

.

...FI

N

C

.

...FI

N

$1

IF (I

NTI

CN

(I).E

Q.0

) RET

UR

N

C

IF (M

OD

E.EQ

.2)

! C

ALC

ULA

TE D

ERIV

ATI

VES

.

GET

-IC

ON

S

.

GET

-VA

RS

. G

ET-S

TATE

S C

.

SET

STO

RE

VA

LUE

CA

LCU

LATE

D IN

MO

DE

1

.

IF(T

IME

.LE.

-2.*

DEL

T)

. .

STO

RE(

K+6

)=ST

OR

EKP6

.

...FI

N

C

.

C S

TAR

T O

F C

OD

E FR

OM

MW

POW

ER.D

SL

C

.

. M

WLI

NE=

VA

R(L

)*C

OS(

VA

R(L

+1)*

PI/1

80.)*

VA

R(L

+4)*

CO

S(V

AR

(L+5

)*PI

/180

.)

.

MW

LIN

E=M

WLI

NE+

VA

R(L

)*SI

N(V

AR

(L+1

)*PI

/180

.)*V

AR

(L+4

)*SI

N(V

AR

(L+5

)*PI

/180

.)

.

MW

LIN

ETO

T=(V

AR

(L+2

8)+V

AR

(L+2

9)+V

AR

(L+3

0))/S

BA

SE

C

.

C

STA

RT

OF

CO

DE

REP

LAC

ING

PH

SEST

.DSL

C

.

C

REF

EREN

CE

PHA

SOR

GEN

ERA

TOR

C

.

C

FO

LLO

WIN

G L

INE

REP

LAC

ED O

N A

CC

OU

NT

OF

FREQ

UEN

CY

CO

RR

ECTI

ON

C

.

.

WR

EF=2

.*PI

*FR

QO

SC

C

.

. W

REF

=2.*

PI*N

EWFR

Q

. D

THET

A=W

REF

.

REA

LRF=

CO

S(TH

ETA

)

.

IMA

GR

F=SI

N(T

HET

A)

C

.

C P

HA

SOR

EST

IMA

TIO

N U

SIN

G L

OW

PASS

FIL

TER

MET

HO

D

. W

HEN

(MTH

DPE

.EQ

.0)

C F

OR

A P

ERFE

CT

WR

EF H

Z IN

PUT

OSC

ILLA

TIO

N R

EALD

P A

ND

IMA

GD

P A

RE

CO

NST

AN

TS -

I.E. D

P IS

A

VEC

TOR

(NO

T A

PH

ASO

R)

C T

EMP

IS P

RO

DU

CT

OF

NEG

ATI

VE

REF

EREN

CE

PHA

SOR

TIM

ES C

ON

JUG

ATE

OF

DP

. .

REA

LTM

=REA

LDP*

REA

LRF-

IMA

GD

P*IM

AG

RF

. .

IMA

GTM

=-1.

*(R

EALD

P*IM

AG

RF+

IMA

GD

P*R

EALR

F)

C D

ERIV

ATI

VE

OF

AV

ERA

GE

CA

LCU

LATO

R

. .

REA

LAU

=MW

LIN

E-R

EALT

M

. .

DPA

V=(

REA

LAU

-PA

V)*

CO

AV

FRQ

*2.*

PI

61

Page 67: tesis-FLECS-PSSE

C S

UB

TRA

CT

TEM

P FR

OM

TW

O T

IMES

(IN

PUT

SIG

NA

L - A

VER

AG

E)

. .

REA

LAU

=2.*

(MW

LIN

E-PA

V)-

REA

LTM

.

. IM

AG

AU

=-IM

AG

TM

C M

ULT

IPLY

BY

NEG

ATI

VE

REF

EREN

CE

PHA

SOR

- TH

ESE

AR

E TH

E IN

PUTS

TO

TH

E D

P TI

ME

CO

NST

AN

TS

. .

REA

LTM

=REA

LAU

*REA

LRF+

IMA

GA

U*I

MA

GR

F

.

. IM

AG

TM=R

EALR

F*IM

AG

AU

-IM

AG

RF*

REA

LAU

C

DER

IVA

TIV

ES O

F R

EAL

AN

D IM

AG

INA

RY

PA

RTS

OF

DP

. .

DR

EALD

P=(R

EALT

M-R

EALD

P)*C

OFL

FRQ

*2.*

PI

. .

DIM

AG

DP=

(IM

AG

TM-I

MA

GD

P)*C

OFL

FRQ

*2.*

PI

. ...

FIN

C

.

C

PH

ASO

R E

STIM

ATI

ON

USI

NG

RLS

FIL

TER

MET

HO

D

. EL

SE

. .

KA

PPA

AV

=XSI

AV

*(1+

XSI

AV

*XSI

AV

)

.

. K

APP

AC

S=X

SIPH

*(2-

XSI

PH*X

SIPH

)

.

. K

APP

ASN

=3*X

SIPH

*XSI

PH

. .

MW

HA

T=PA

V+R

EALD

P

.

. IN

NO

V=M

WLI

NE-

MW

HA

T

.

. W

HEN

((TR

IGG

ER2.

EQ.1

).OR

.FA

ULT

RES

.EQ

.1)

. .

. M

WH

AT=

0.

. .

. IN

NO

V=0

.

.

. .

DPA

V=0

.

.

. .

STA

TE(K

+1)=

MW

LIN

E

.

. .

STO

RE(

K+1

)=M

WLI

NE

. .

. ST

ATE

(K+2

)=0.

001

. .

. ST

OR

E(K

+2)=

0.00

1

.

. .

STA

TE(K

+3)=

0.00

1

.

. .

STO

RE(

K+3

)=0.

001

. .

. D

REA

LDP=

0.

. .

. D

IMA

GD

P=0.

.

. ...

FIN

.

. EL

SE

. .

. D

PAV

=WR

EF*K

APP

AA

V*I

NN

OV

.

. .

DR

EALD

P=W

REF

*(K

APP

AC

S*IN

NO

V-I

MA

GD

P)

. .

. D

IMA

GD

P=W

REF

*(-K

APP

ASN

*IN

NO

V+R

EALD

P)

. .

...FI

N

. .

KA

PPA

AV

1=X

SIA

V1*

(1+X

SIA

V1*

XSI

AV

1)

. .

KA

PPA

CS1

=XSI

PH1*

(2-X

SIPH

1*X

SIPH

1)

. .

KA

PPA

SN1=

3*X

SIPH

1*X

SIPH

1

.

. M

WH

AT1

=PA

V1+

REA

LDP1

.

. IN

NO

V1=

MW

LIN

E-M

WH

AT1

.

. D

PAV

1=W

REF

*KA

PPA

AV

1*IN

NO

V1

. .

DR

EALD

P1=W

REF

*(K

APP

AC

S1*I

NN

OV

1-IM

AG

DP1

)

.

. D

IMA

GD

P1=W

REF

*(-K

APP

ASN

1*IN

NO

V1+

REA

LDP1

)

.

...FI

N

C

.

C T

IMES

REF

EREN

CE

PHA

SOR

.

REA

LTM

=REA

LDP

. IM

AG

TM=I

MA

GD

P C

.

C S

TOR

E O

SCIL

LATO

RY

CO

MPO

NEN

T FO

R IN

PUT

TO F

RQ

CO

RR

.DSL

C

.

.

RE_

REF

=REA

LDP1

.

IM_R

EF=I

MA

GD

P1

C T

IMES

E T

O T

HE

J TIM

ES A

LPH

A

. R

EALA

U=R

EALT

M*C

OS(

ALP

HA

*PI/1

80.)-

IMA

GTM

*SIN

(ALP

HA

*PI/1

80.)

C

.

C P

HA

SOR

IS A

LIN

EAR

CO

MB

INA

TIO

N O

F A

VER

AG

E A

ND

OSC

ILLA

TOR

Y P

OW

ER

C

.

. PH

ASO

R=K

AV

*PA

V+K

PH*R

EALA

U

C

.

C S

TAR

T O

F C

OD

E FR

OM

FR

QC

OR

R.D

SL

C

.

. W

HEN

(SQ

RT(

IM_R

EF**

2+R

E_R

EF**

2).G

E.O

PER

AT)

.

. IF

(TST

AR

T.G

T.10

0000

.) TS

TAR

T=TI

ME

. .

WH

EN((

TIM

E-TS

TAR

T).G

T.2.

)

.

. .

DTE

TAC

S=2.

*PI*

NEW

FRQ

.

. .

PHR

EAL=

RE_

REF

*CO

S(TE

TAC

S)+I

M_R

EF*S

IN(T

ETA

CS)

.

. .

PHIM

AG

=IM

_REF

*CO

S(TE

TAC

S)-R

E_R

EF*S

IN(T

ETA

CS)

.

. .

IF (F

LGST

AR

T.EQ

.0)

. .

. .

AR

GR

EF=A

TAN

2(PH

IMA

G,P

HR

EAL)

.

. .

. FL

GST

AR

T=1

. .

. ...

FIN

.

. .

XD

IF=P

HR

EAL*

CO

S(A

RG

REF

)+PH

IMA

G*S

IN(A

RG

REF

)

.

. .

YD

IF=P

HIM

AG

*CO

S(A

RG

REF

)-PH

REA

L*SI

N(A

RG

REF

)

.

. .

WH

EN((

XD

IF.E

Q.0

.).A

ND

.(YD

IF.E

Q.0

.)) A

NG

DIF

=0.

. .

. EL

SE A

NG

DIF

=ATA

N2(

YD

IF,X

DIF

)

.

. .

DD

EL_I

=KD

F*A

NG

DIF

/TD

F

.

. .

DEL

FRQ

=DEL

_I+K

DF*

AN

GD

IF

. .

. W

HEN

(DEL

FRQ

.GT.

DFM

AX

)

.

. .

. D

ELFR

Q=D

FMA

X

. .

. .

AR

GR

EF=A

TAN

2(PH

IMA

G,P

HR

EAL)

.

. .

. ST

ATE

(K+4

)=D

FMA

X

. .

. .

STO

RE(

K+4

)=ST

ATE

(K+4

)

.

. .

. D

DEL

_I=0

.

.

. .

...FI

N

. .

. EL

SE

. .

. .

IF(D

ELFR

Q.L

T.D

FMIN

)

.

. .

. .

DEL

FRQ

=DFM

IN

. .

. .

. A

RG

REF

=ATA

N2(

PHIM

AG

,PH

REA

L)

. .

. .

. ST

ATE

(K+4

)=D

FMIN

.

. .

. .

STO

RE(

K+4

)=ST

ATE

(K+4

)

.

. .

. .

DD

EL_I

=0.

. .

. .

...FI

N

. .

. ...

FIN

.

. .

NEW

FRQ

=FR

QO

SC+D

ELFR

Q

. .

...FI

N

.

. E

LSE

. .

. A

RG

REF

=0.

. .

. D

ELFR

Q=0

.

.

. .

STA

TE(K

+4)=

0.

62

Page 68: tesis-FLECS-PSSE

. .

. S

TOR

E(K

+4)=

0.

. .

. D

DEL

_I=0

.

.

. .

STA

TE(K

+5)=

0.

. .

. ST

OR

E(K

+5)=

0.

. .

. D

TETA

CS=

0.

. .

...FI

N

. ...

FIN

.

ELSE

.

. TS

TAR

T=99

9999

.

.

. FL

GST

AR

T=0

. .

AR

GR

EF=0

.

.

. D

ELFR

Q=0

.

.

. ST

ATE

(K+4

)=0.

.

. ST

OR

E(K

+4)=

0.

. .

DD

EL_I

=0.

. .

STA

TE(K

+5)=

0.

. .

STO

RE(

K+5

)=0.

.

. D

TETA

CS=

0.

. ...

FIN

C

.

C

STA

RT

OF

CO

DE

FRO

M X

REQ

UIR

ED.D

SL

C

.

. W

HEN

(WO

RK

AS.

EQ.2

)

.

. M

OD

EOP=

1

.

. X

REQ

=IN

DB

ST*X

BA

NK

.

...FI

N

. EL

SE

. .

SIG

NA

L=K

1GA

IN*K

2GA

IN*P

HA

SOR

.

. W

HEN

(MW

LIN

E.LT

.0.)

NEW

SIG

NA

L=-1

.*SI

GN

AL

. .

ELSE

NEW

SIG

NA

L=SI

GN

AL

. .

XR

EQ=S

TSB

ST*X

BA

NK

+NEW

SIG

NA

L

.

. IF

(XR

EQ.L

T.(M

XC

APB

ST*X

BA

NK

)) X

REQ

=MX

CA

PBST

*XB

AN

K

. .

WH

EN (W

OR

KA

S.EQ

.1)

. .

. W

HEN

(XR

EQ.G

T.(0

.5*(

MN

CA

PBST

+IN

DB

ST)*

XB

AN

K))

.

. .

. IF

(MO

DEO

P.EQ

.0)

. .

. .

. B

YPS

STIM

E=TI

ME

. .

. .

. W

RIT

E(LP

DEV

,177

) IC

KT,

ICO

N(I

),IC

ON

(I+1

),TIM

E

.

. .

. ...

FIN

.

. .

. M

OD

EOP=

1

.

. .

...FI

N

. .

. EL

SE

. .

. .

IF(T

IME.

GT.

(BY

PSST

IME+

MN

TBY

PSS)

)

.

. .

. .

IF (M

OD

EOP.

EQ.1

)

.

. .

. .

. W

RIT

E(LP

DEV

,178

) IC

KT,

ICO

N(I

),IC

ON

(I+1

),TIM

E

.

. .

. .

...FI

N

. .

. .

. M

OD

EOP=

0

.

. .

. .

BY

PSST

IME=

9999

99.

. .

. .

...FI

N

. .

. ...

FIN

.

. ...

FIN

.

. EL

SE M

OD

EOP=

0

.

. W

HEN

(MO

DEO

P.EQ

.0) I

F(X

REQ

.GT.

(MN

CA

PBST

*XB

AN

K))

XR

EQ=M

NC

APB

ST*X

BA

NK

.

. EL

SE X

REQ

=IN

DB

ST*X

BA

NK

.

...FI

N

C

.

C S

TAR

T O

F C

OD

E FR

OM

CTR

LTC

SC.D

SL

C

.

. W

HEN

((M

INTC

SC*I

TCSC

+UM

XTC

SC).L

T.0.

)

.

. IF

(PR

OT.

EQ.0

) WR

ITE(

LPD

EV,1

77) I

CK

T,IC

ON

(I),I

CO

N(I

+1),T

IME

. .

PRO

T=1

. ...

FIN

.

ELSE

.

. IF

((M

INTC

SC*I

TCSC

+UM

XTC

SC).G

T.U

HY

ST)

. .

. IF

(PR

OT.

EQ.1

) WR

ITE(

LPD

EV,1

78) I

CK

T,IC

ON

(I),I

CO

N(I

+1),T

IME

. .

. PR

OT=

0

.

. ...

FIN

.

...FI

N

. W

HEN

(FLG

SWG

.GT.

0)

. .

XIN

S=X

BA

NK

*3.

. .

OPM

OD

E=0

. ...

FIN

.

ELSE

.

. X

INS=

XR

EQ

. .

OPM

OD

E=M

OD

EOP

. ...

FIN

.

WH

EN (X

TCSC

.GT.

MIN

TCSC

) TK

=TK

BY

P

.

ELSE

TK

=TK

CA

P

.

WH

EN((

PRO

T+O

PMO

DE)

.GT.

0)

. .

WH

EN (T

K.G

T.2.

*DEL

T) D

XTC

SC=(

IND

TCSC

-XTC

SC)/T

K

. .

ELSE

.

. .

XTC

SC=I

ND

TCSC

.

. .

STA

TE(K

)=X

TCSC

.

. .

STO

RE(

K)=

XTC

SC

. .

. D

XTC

SC=0

.

.

. ...

FIN

.

...FI

N

. EL

SE

. .

WH

EN (T

K.G

T.2.

*DEL

T) D

XTC

SC=(

XIN

S-X

TCSC

)/TK

.

. EL

SE

. .

. X

TCSC

=XIN

S

.

. .

STA

TE(K

)=X

TCSC

.

. .

STO

RE(

K)=

XTC

SC

. .

. D

XTC

SC=0

.

.

. ...

FIN

.

...FI

N

. SE

T-D

STA

TES

. SE

T-IC

ON

S

.

SET-

VA

RS

C

.

. R

ETU

RN

...

FIN

$1

63

Page 69: tesis-FLECS-PSSE

IF (M

OD

E.EQ

.3)

C

.

. K

F=IN

TIC

N(I

+2)

. IC

KT=

CH

RIC

N(I

+2)

. W

HEN

(IC

ON

(I+3

).EQ

.0)

. .

RX

=-1.

/GB

(KF)

C

.

.

C

CH

AN

GE

NET

WO

RK

IMPE

DA

NC

E IF

DEV

IATI

ON

TO

O L

AR

GE

OR

TA

KIN

G T

OO

MA

NY

IT

ERA

TIO

NS

TO C

ON

VER

GE

. .

IF((

ITM

XD

S-IT

ER).L

T.5.

OR

.AB

S((X

-VA

R(L

+15)

)/CO

N(J

+5))

.GT.

CO

N(J

+2))

.

. .

RX

=CM

PLX

(0.,V

AR

(L+1

5))

. .

. G

B(K

F)=-

1./R

X

C

. .

.

. .

. W

RIT

E(LP

DEV

,77)

ICK

T,IC

ON

(I),I

CO

N(I

+1),T

IME

C

. .

.

. .

. C

ALL

LO

FLSB

.

. .

CA

LL F

AC

T

.

. .

CA

LL R

TRN

SB

. .

...FI

N

C

. .

.

. IC

ON

(I+4

)=1

. .

INTI

CN

(I+4

)=1

. ...

FIN

.

ELSE

.

. W

HEN

(IN

TIC

N(I

+3).E

Q.0

)IN

TIC

N(I

+3)=

1

.

. EL

SE

. .

. R

X=-

1./G

B(K

F)

. .

. W

HEN

(WO

RK

AS.

NE.

2)

. .

. .

IF(A

BS(

(X-C

ON

(J+4

))/C

ON

(J+5

)).G

T.C

ON

(J+2

))

. .

. .

. R

X=C

MPL

X(0

.,CO

N(J

+4))

.

. .

. .

GB

(KF)

=-1.

/RX

C

.

. .

. .

.

. .

. .

WR

ITE(

LPD

EV,7

7) IC

KT,

ICO

N(I

),IC

ON

(I+1

),TIM

E C

.

. .

. .

.

. .

. .

CA

LL L

OFL

SB

. .

. .

. C

ALL

FA

CT

. .

. .

. C

ALL

RTR

NSB

.

. .

. .

INTI

CN

(I+3

)=2

. .

. .

...FI

N

. .

. ...

FIN

.

. .

ELSE

.

. .

. IF

(AB

S((X

-CO

N(J

+5)*

CO

N(J

+9))

/CO

N(J

+5))

.GT.

CO

N(J

+2))

.

. .

. .

RX

=CM

PLX

(0.,C

ON

(J+5

)*C

ON

(J+9

))

. .

. .

. G

B(K

F)=-

1./R

X

C

. .

. .

.

. .

. .

. W

RIT

E(LP

DEV

,77)

ICK

T,IC

ON

(I),I

CO

N(I

+1),T

IME

C

. .

. .

.

. .

. .

. C

ALL

LO

FLSB

.

. .

. .

CA

LL F

AC

T

.

. .

. .

CA

LL R

TRN

SB

. .

. .

. IN

TIC

N(I

+3)=

2

.

. .

. ...

FIN

.

. .

...FI

N

. .

...FI

N

. ...

FIN

.

RET

UR

N

...FI

N

IF

(MO

DE.

EQ.1

)

! IN

ITIA

LIZA

TIO

N

. K

F=IN

TIC

N(I

+2)

. R

X=-

1./G

B(K

F)

C

.

C

. I

NIT

IALI

ZE A

CC

ELER

ATI

ON

AU

XIL

IAR

Y V

AR

IAB

LES

WIT

H L

OA

DFL

OW

MA

GN

ITU

DES

C

.

.

IF(I

CO

N(I

+3).E

Q.0

)

.

. V

AR

(L+1

3)=X

.

...FI

N

. X

TCSC

=X

C

.

C

. I

NIT

IALI

ZATI

ON

OF

PHES

T.D

SL

C

.

. G

ET-S

TATE

S

.

GET

-VA

RS

. PA

V=M

WLI

NE

. R

EALD

P=0.

.

IMA

GD

P=0.

.

PAV

1=M

WLI

NE

. R

EALD

P1=0

.

.

IMA

GD

P1=0

.

.

DPA

V1=

0

.

DR

EALD

P1=0

.

.

DIM

AG

DP1

=0.

. TH

ETA

=0.

C

.

C

NO

TE: S

TOR

E(TI

ME=

-2*D

ELT)

=STA

TE(T

IME=

-DEL

T)- D

STA

TE(T

IME=

-2*D

ELT)

*DEL

T*3.

/2.

C

.

. N

EWFR

Q=F

RQ

OSC

.

WR

EF=2

.*PI

*NEW

FRQ

.

DTH

ETA

=WR

EF

. ST

OR

EKP6

=TH

ETA

+DTH

ETA

*DEL

T-D

THET

A*D

ELT*

1.5

. W

RIT

E(LP

DEV

,247

) CH

RIC

N(I

+2),I

CO

N(I

),IC

ON

(I+1

),K+6

C

.

.

GET

-IC

ON

S C

.

C

.

IN

ITIA

LIZA

TIO

N O

F X

REQ

UIR

ED.D

SL

C

.

. W

HEN

(WO

RK

AS.

NE.

2)

. .

MO

DEO

P=0

. .

XR

EQ=S

TSB

ST*X

BA

NK

.

...FI

N

. EL

SE

. .

MO

DEO

P=1

. .

XR

EQ=I

ND

BST

*XB

AN

K

. .

WR

ITE(

LPD

EV,1

49) C

HR

ICN

(I+2

),IC

ON

(I),I

CO

N(I

+1)

. ...

FIN

.

K1G

AIN

=1.

. K

2GA

IN=1

.

.

BY

PSST

IME=

9999

99.

64

Page 70: tesis-FLECS-PSSE

C

. M

OR

E IN

ITIA

LIZA

TIO

N O

F C

TRLT

CSC

.DSL

C

.

C

.

.

PRO

T=0

. FL

GSW

G=0

.

XO

HM

=XR

EQ

C

.

C

. I

NIT

IALI

ZATI

ON

OF

FRQ

CO

RR

.DSL

C

.

C

.

.

DEL

_I=0

.

.

FLG

STA

RT=

0

.

TSTA

RT=

9999

99.

. TE

TAC

S=0.

C

.

C

.

IN

ITIA

LIZA

TIO

N O

F A

DD

CO

DE

. X

I=0.

01

. X

EQ=0

.35

. X

INIT

=0.1

5

.

X1=

0.

. A

1=0.

.

TRIG

GER

TIM

E=99

99.

. TR

IGG

ERTI

ME1

=999

9.

. TR

IGG

ERTI

ME2

=999

9.

. PP

EAK

1=0.

.

PMEA

N1=

0.

. TR

IGG

ER1=

1

.

ATS

TEP=

0

.

XH

ILIM

=0.0

75

. X

LOW

LIM

=-0.

075

. X

0=-0

.000

1

.

TRIG

GER

2=0

. FA

ULT

TIM

E=1.

0

.

FAU

LTD

ELA

Y=0

.35

. FA

ULT

DEL

AY

2=1.

2

.

FAU

LTIN

HIB

IT=0

.

FAU

LTR

ES=0

.

ISO

SC=0

.

STA

GE=

0

.

STEP

TIM

E=99

9.

. TI

MES

TAG

E4=9

99.

. ES

TITO

REA

L=1

. X

IOLD

=XI

. X

EQO

LD=X

EQ

. LI

M=0

C

.

C

.

.

SET-

ICO

NS

. SE

T-V

AR

S

.

SET-

STA

TES

C

C

. C

HEC

K F

OR

DIS

CR

EPA

NC

IES

BET

WEE

N C

ON

TRO

L SE

CTI

ON

S A

ND

LO

AD

FLO

W

C

.

. IF

(AB

S(R

).GT.

0.00

01)

. .

WR

ITE(

LPD

EV,1

47) C

HR

ICN

(I+2

),IC

ON

(I),I

CO

N(I

+1),R

.

...FI

N

C

.

C

.

. IF

(AB

S(X

-VA

R(L

+15)

).GT.

0.00

01)

. .

WR

ITE(

LPD

EV,1

48) C

HR

ICN

(I+2

),IC

ON

(I),I

CO

N(I

+1),X

,XO

HM

.

...FI

N

C

.

C

. P

REP

AR

E FO

R A

LTER

NA

TIV

E C

ON

VER

GEN

CE

STR

ATE

GY

C

.

.

IF(I

CO

N(I

+3).E

Q.1

)

.

. IN

TIC

N(I

+3)=

0

.

. V

AR

(L+1

2)=0

.

.

. V

AR

(L+1

3)=0

.

.

...FI

N

C

.

. R

ETU

RN

...

FIN

C

C

BU

S IB

US

NO

T FO

UN

D

C

800

WR

ITE(

LPD

EV,1

17) I

BU

S,IC

KT,

ICO

N(I

),IC

ON

(I+1

) C

C

MO

DEL

IGN

OR

ED

C

900

IN

TIC

N(I

)=0

DO

(II=

1,28

) VA

R(L

+II-

1)=0

.

D

O (I

I=1,

10)

. ST

ATE

(K+I

I-1)

=0.

. ST

OR

E(K

+II-

1)=0

.

.

DST

ATE

(K+I

I-1)

=0.

...FI

N

RET

UR

N

$1

C M

OD

E >

4 (M

AIN

CR

) C

1

000

IF (M

OD

E.EQ

.6) G

O T

O 2

000

C

C M

OD

E =

5 O

R 7

--A

CTI

VIT

Y D

OC

U

C

CH

ECK

-FO

R-S

ELEC

TIV

E-D

OC

U

C

IF (M

OD

E.EQ

.7)

! D

ATA

CH

ECK

ING

MO

DE

. N

EW=.

FALS

E.

C

.

C

.

65

Page 71: tesis-FLECS-PSSE

. U

NLE

SS (C

ON

(J).G

E.0.

.AN

D. C

ON

(J).L

E.1.

0)

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

217)

CO

N(J

)

.

...FI

N

. U

NLE

SS (C

ON

(J+1

).GE.

0. .A

ND

. CO

N(J

+1).L

E.1.

0)

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

218)

CO

N(J

+1)

. ...

FIN

.

UN

LESS

(CO

N(J

+2).G

T.0.

0)

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

219)

CO

N(J

+2)

. ...

FIN

.

UN

LESS

(CO

N(J

+3).G

T.1.

)

.

. PR

INT-

HEA

DIN

G

. .

WR

ITE(

IPR

T,22

0) C

ON

(J+3

)

.

...FI

N

. U

NLE

SS (C

ON

(J+4

).GT.

0.)

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

221)

CO

N(J

+4)

. ...

FIN

.

UN

LESS

(CO

N(J

+5).L

T.0.

)

.

. PR

INT-

HEA

DIN

G

. .

WR

ITE(

IPR

T,22

2) C

ON

(J+5

)

.

...FI

N

. U

NLE

SS (C

ON

(J+7

).GT.

1.)

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

224)

CO

N(J

+7)

. ...

FIN

.

UN

LESS

(CO

N(J

+6).G

T.C

ON

(J+7

))

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

225)

CO

N(J

+6),

CO

N(J

+7)

. ...

FIN

.

UN

LESS

(CO

N(J

+8).G

T.C

ON

(J+6

))

. .

PRIN

T-H

EAD

ING

.

. W

RIT

E(IP

RT,

223)

CO

N(J

+8),

CO

N(J

+6)

. ...

FIN

.

UN

LESS

(CO

N(J

+9).L

T.0.

)

.

. PR

INT-

HEA

DIN

G

. .

WR

ITE(

IPR

T,22

6) C

ON

(J+9

)

.

...FI

N

...FI

N

C

CO

RT=

'M'

TAB

ULA

TE-M

OD

EL

C

KF=

1

SE

T-B

US-

NA

ME

C

KF=

2

SE

T-B

US-

NA

ME

C

CA

LL C

KTI

DS(

I,1,C

BU

F)

WR

ITE(

IPR

T,27

) IC

ON

(I )

,NA

ME(

1)(1

:12)

,NA

ME(

1)(1

3:18

),

*

ICO

N(I

+1),N

AM

E(2)

(1:1

2),N

AM

E(2)

(13:

18),C

BU

F,

*

(C

ON

(II)

,II=J

,JJ)

WH

EN((

ICO

N(I

+12)

.GT.

0).A

ND

.(IC

ON

(I+1

2).L

T.4)

) WR

ITE(

IPR

T,37

) I+1

2,IC

ON

(I+1

2)

ELSE

WR

ITE(

IPR

T,47

) I+1

2,IC

ON

(I+1

2)

CO

ND

ITIO

NA

L

. (I

CO

N(I

+10)

.EQ

.0) W

RIT

E(IP

RT,

48)

. (I

CO

N(I

+10)

.EQ

.1) W

RIT

E(IP

RT,

49)

. (I

CO

N(I

+10)

.EQ

.2) W

RIT

E(IP

RT,

50)

. (O

THER

WIS

E) W

RIT

E(IP

RT,

51) I

+1,IC

ON

(I+1

)

...

FIN

1

500

RET

UR

N

$1

C M

OD

E =

6--A

CTI

VIT

Y D

YD

A

C

200

0 IF

(IB

DO

CU

.GT.

0 .A

ND

. IC

ON

(I).N

E.IB

DO

CU

) RET

UR

N

C

CA

LL C

ON

INT(

IVEC

,1,JJ

)

IF

(JJ.N

E.0)

RET

UR

N

C

CA

LL C

KTI

DS(

I,1,C

BU

F)

C

WR

ITE(

IPR

T,50

7) IC

ON

(I),I

CO

N(I

+1),C

BU

F,IC

ON

(I+3

),IC

ON

(I+1

0),(I

CO

N(I

I),II

=I+1

2,I+

21),(

CO

N(J

J),JJ

=J,J+

24)

RET

UR

N

C

C M

OD

E >

4 (T

AIN

CR

) C

4

000

IF (M

OD

E.G

T.5)

RET

UR

N

C

C A

CTI

VIT

Y D

OC

U R

EPO

RTI

NG

MO

DE

C

CH

ECK

-FO

R-S

ELEC

TIV

E-D

OC

U

C

CO

RT=

'T'

TAB

ULA

TE-M

OD

EL

C

RET

UR

N

$1

66

Page 72: tesis-FLECS-PSSE

C[T

AIN

TC]

! C

ALL

ED F

RO

M 'C

ON

ET'

C

ENTR

Y T

AIN

TC (I

,J,K

,L)

C

IF (M

OD

E.G

T.4)

GO

TO

400

0 C

II

=IN

TIC

N(I

)

IF

(II.E

Q.0

) RET

UR

N

JJ=I

NTI

CN

(I+1

)

K

F=IN

TIC

N(I

+2)

ICK

T=C

HR

ICN

(I+2

)

M

OV

E-C

ON

S-IN

TO-L

OC

AL-

VA

RIA

BLE

S

G

ET-S

TATE

S

G

ET-V

AR

S

IF

(IFL

AG

.AN

D.((

ICO

N(I

+12)

.GT.

0).A

ND

.(IC

ON

(I+1

2).L

T.4)

))

. C

ALL

FLO

W1(

I+13

,L+2

8,0,

0)

. C

ALL

FLO

W1(

I+16

,L+2

9,0,

0)

. C

ALL

FLO

W1(

I+19

,L+3

0,0,

0)

...FI

N

C

C

MO

DE

1 C

ALL

REQ

UIR

ED T

O IN

ITIA

LIZE

PH

ASO

R

C

MEA

SUR

EMEN

T O

F TH

E LI

NEP

OW

ER

IF (M

OD

E.EQ

.1)

. IF

(IFL

AG

)

.

. A

DD

ER=C

MPL

X(0

.,0.)

. .

POPU

LATE

-VO

LTS-

LIN

ECU

RR

ENT

. .

MW

LIN

E=V

AR

(L)*

CO

S(V

AR

(L+1

)*PI

/180

.)*V

AR

(L+4

)*C

OS(

VA

R(L

+5)*

PI/1

80.)

. .

MW

LIN

E=M

WLI

NE+

VA

R(L

)*SI

N(V

AR

(L+1

)*PI

/180

.)*V

AR

(L+4

)*SI

N(V

AR

(L+5

)*PI

/180

.)

.

. M

WLI

NET

OT=

(VA

R(L

+28)

+VA

R(L

+29)

+VA

R(L

+30)

)/SB

ASE

.

. SE

T-V

AR

S

.

...FI

N

. R

ETU

RN

...

FIN

C

.

C

CO

DE

Of C

ON

TRO

L SI

GN

AL

C

W

HEN

((TI

ME.

GT.

FAU

LTTI

ME)

.AN

D.(T

IME.

LE.(F

AU

LTTI

ME+

FAU

LTD

ELA

Y2)

)) F

AU

LTIN

HIB

IT=1

EL

SE

. FA

ULT

INH

IBIT

=0

...FI

N

WH

EN((

TIM

E.G

T.FA

ULT

TIM

E).A

ND

.(TIM

E.LE

.(FA

ULT

TIM

E+FA

ULT

DEL

AY

))) F

AU

LTR

ES=1

EL

SE

. FA

ULT

RES

=0

...FI

N

C

C

C

OD

E of

det

erm

ines

if th

ere

is a

n os

cilla

tion

WH

EN((

REA

LTM

.GT.

Osc

Lim

it).O

R.(R

EALT

M.L

T.-O

scLi

mit)

) ISO

SC=1

EL

SE

. IS

OSC

=0

...FI

N

C

IF

THER

E IS

AN

OSC

ILLA

TIO

N, S

TAR

T C

ON

TRO

L

IF(I

SOSC

.EQ

.1)

. IF

(FA

ULT

INH

IBIT

.EQ

.0)

. .

IF(S

TAG

E.EQ

.0.A

ND

.IMA

GTM

.GT.

-0.0

2.A

ND

.IMA

GTM

.LT.

0.02

)

.

. .

STA

GE=

1

.

. ...

FIN

.

...FI

N

...FI

N

C

STA

GE1

MEA

SUR

E P'

XST

ATE

, X';

UPD

ATE

XI A

ND

XEQ

IF

(STA

GE.

EQ.1

)

.

XFI

NA

L=X

INIT

+XO

HM

.

PMEA

N1=

PAV

.

IF(P

MEA

N0.

NE.

0)

. .

WH

EN(P

MEA

N1.

NE.

PMEA

N0)

.

. .

WH

EN((

PPEA

K0*

((X

STA

RT+

XEQ

)/(X

FIN

AL+

XEQ

))/P

PEA

K1)

.NE.

1)

. .

. .

WH

EN((

(PPE

AK

1/PP

EAK

0).G

E.1.

05).O

R.((

PPEA

K1/

PPEA

K0)

.LT.

0.95

))

. .

. .

. W

HEN

(((P

MEA

N1/

PMEA

N0)

.GE.

1.05

).OR

.((PM

EAN

1/PM

EAN

0).L

T.0.

95))

.

. .

. .

. X

EQES

T=(X

STA

RT-

PMEA

N1/

PMEA

N0*

XFI

NA

L)/(P

MEA

N1/

PMEA

N0-

1)

. .

. .

. .

DEL

TAX

TOT1

=XFI

NA

L*X

EQES

T/(X

FIN

AL+

XEQ

EST)

-XST

AR

T*X

EQES

T/(X

STA

RT+

XEQ

EST)

.

. .

. .

. X

TOTI

NIT

=DEL

TAX

TOT1

/(PPE

AK

0*((

XST

AR

T+X

EQES

T)/(X

FIN

AL+

XEQ

EST)

)/PPE

AK

1-1)

.

. .

. .

. X

IEST

=XTO

TIN

IT-X

STA

RT*

XEQ

EST/

(XST

AR

T+X

EQES

T)

. .

. .

. ...

FIN

.

. .

. .

ELSE

.

. .

. .

. X

EQES

T=X

EQ

. .

. .

. .

XIE

ST=X

I

.

. .

. .

...FI

N

. .

. .

...FI

N

. .

. .

ELSE

.

. .

. .

XEQ

EST=

XEQ

.

. .

. .

XIE

ST=X

I

.

. .

. ...

FIN

.

. .

...FI

N

. .

. EL

SE

. .

. .

XEQ

EST=

XEQ

.

. .

. X

IEST

=XI

. .

. ...

FIN

.

. ...

FIN

.

. EL

SE

. .

. X

EQES

T=X

EQ

. .

. X

IEST

=XI

. .

...FI

N

. .

IF(X

IEST

.GT.

0.A

ND

.XEQ

EST.

GT.

0.)

. .

. X

I=(X

IEST

+XIO

LD*l

ambd

a)/(1

+lam

bda)

.

. .

XEQ

=(X

EQES

T+X

EQO

LD*l

ambd

a)/(1

+lam

bda)

.

. ...

FIN

.

...FI

N

. X

IOLD

=XI

. X

EQO

LD=X

EQ

. ST

AG

E=2

...FI

N

67

Page 73: tesis-FLECS-PSSE

C

STA

GE2

MEA

SUR

E PX

STA

TE P

X A

ND

X

IF(S

TAG

E.EQ

.2)

. PM

EAN

0=PA

V

. PP

EAK

0=M

WLI

NE

. X

STA

RT=

XO

HM

+XIN

IT

. ST

AG

E=3

...FI

N

C

STA

GE3

CA

LCU

LATE

TH

E N

ECES

SAR

Y R

EAC

TAN

CE

STEP

IF

(STA

GE.

EQ.3

)

.

IF(A

TSTE

P.EQ

.0.A

ND

.EST

ITO

REA

L.EQ

.1)

. .

XD

=XIN

IT+X

OH

M

. .

POSC

=PA

V+R

EALT

M

. .

XTO

T0=X

I+X

D*X

EQ/(X

D+X

EQ)

. .

PTO

T0=(

XD

+XEQ

)/XEQ

*PA

V

. .

PMEA

N0=

PAV

. .

DEL

TAX

BV

=(X

D+X

EQ)/(

PXB

V/P

MEA

N0)

-XEQ

-XD

.

. W

HEN

((X

OH

M+D

ELTA

XB

V).G

T.X

HIL

IM)

DEL

TAX

BV

1=X

HIL

IM-X

OH

M+0

.000

1

.

. EL

SE

. .

. W

HEN

((X

OH

M+D

ELTA

XB

V).L

T.X

LOW

LIM

) D

ELTA

XB

V1=

XLO

WLI

M-X

OH

M+0

.000

1

.

. .

ELSE

DEL

TAX

BV

1=D

ELTA

XB

V

. .

...FI

N

.

. X

TOT2

BV

=XI+

(XD

+DEL

TAX

BV

1)*X

EQ/(X

D+D

ELTA

XB

V1+

XEQ

)

.

. X

TOT1

BV

=(X

TOT2

BV

+PO

SC/P

TOT0

*(X

D+X

EQ)/X

EQ*1

*XTO

T0)/(

1+1)

.

. D

XTO

TBV

1=X

TOT1

BV

-XTO

T0

. .

DX

TOTB

V2=

XTO

T2B

V-X

TOT1

BV

.

. W

HEN

((X

TOT0

+DX

TOTB

V1)

.GE.

(XI+

XEQ

))

. .

. X

STEP

1=X

HIL

IM-X

OH

M

. .

. X

STEP

2=-X

STEP

1

.

. ...

FIN

.

. EL

SE

. .

. W

HEN

((X

TOT0

+DX

TOTB

V1)

.LE.

XI)

.

. .

. X

STEP

1=X

LOW

LIM

-XO

HM

+0.0

001

. .

. .

XST

EP2=

-XST

EP1

. .

. ...

FIN

.

. .

ELSE

.

. .

. X

STEP

1=-D

XTO

TBV

1*(X

D*X

D+2

*XD

*XEQ

+XEQ

*XEQ

)/(-

XEQ

*XEQ

+DX

TOTB

V1*

XD

+DX

TOTB

V1*

XEQ

)

.

. .

. X

DB

V1=

XD

+XST

EP1

. .

. .

XST

EP2=

-DX

TOTB

V2*

(XD

BV

1*X

DB

V1+

2*X

DB

V1*

XEQ

+XEQ

*XEQ

)/(-

XEQ

*XEQ

+DX

TOTB

V2*

XD

BV

1+D

XTO

TBV

2*X

EQ)

. .

. ...

FIN

.

. ...

FIN

.

. ES

TITO

REA

L=0

. .

WH

EN((

XO

HM

+XST

EP1)

.GT.

XH

ILIM

)

.

. .

DEL

TAX

=XH

ILIM

-XO

HM

.

. .

DEL

TAX

2ND

=-X

HIL

IM+0

.000

1

.

. .

LIM

=1

. .

...FI

N

. .

ELSE

.

. .

WH

EN((

XO

HM

+XST

EP1)

.LT.

XLO

WLI

M)

. .

. .

DEL

TAX

=XLO

WLI

M-X

OH

M

. .

. .

DEL

TAX

2ND

=-X

LOW

LIM

+0.0

001

. .

. .

LIM

=1

. .

. ...

FIN

. .

. E

LSE

. .

. .

DEL

TAX

=XST

EP1

. .

. .

DEL

TAX

2ND

=XST

EP2

. .

. ...

FIN

.

. ...

FIN

.

. X

OH

M=X

OH

M+D

ELTA

X

. .

ATS

TEP=

2

.

. ST

AG

E=4

. .

TRIG

GER

TIM

E1=T

IME

. .

STEP

TIM

E=TI

ME

. ...

FIN

.

IF((

ATS

TEP.

EQ.2

).AN

D.T

RIG

GER

TIM

E2.G

T.99

9.A

ND

.TR

IGG

ER2.

EQ.0

.AN

D.(T

IME.

GT.

STEP

TIM

E+0.

3))

. .

IF(D

ELTA

X2N

D*R

EALT

M.G

T.0)

XO

HM

=XO

HM

+DEL

TAX

2ND

.

. TR

IGG

ERTI

ME2

=TIM

E

.

. ST

EPTI

ME=

TIM

E

.

. ES

TITO

REA

L=1

. .

STA

GE=

4

.

. A

TSTE

P=0

. ...

FIN

...FI

N

C

STA

GE4

CA

LCU

LATE

PX

' Ins

tant

aneo

us p

ower

on

the

line

afte

r the

step

IF

(STA

GE.

EQ.4

)

.

IF(T

IME.

GT.

(STE

PTIM

E+0.

02).A

ND

.TIM

E.LT

.(STE

PTIM

E+0.

03))

.

. PP

EAK

1=M

WLI

NE

. .

TIM

ESTA

GE4

=TIM

E

.

. W

HEN

(ATS

TEP.

EQ.0

) STA

GE=

0

.

. EL

SE

. .

. W

HEN

(LIM

.EQ

.1)

. .

. .

LIM

=0

. .

. .

STA

GE=

0

.

. .

. ES

TITO

REA

L=1

. .

. .

ATS

TEP=

0

.

. .

...FI

N

. .

. EL

SE S

TAG

E=5

. .

...FI

N

. ...

FIN

...

FIN

IF

(STA

GE.

EQ.5

)

.

IF(T

IME.

GT.

(TIM

ESTA

GE4

+0.5

))

. .

IF(I

MA

GTM

.GT.

-0.0

1.A

ND

.IMA

GTM

.LT.

0.01

)

.

. .

STA

GE=

1

.

. ...

FIN

.

...FI

N

...FI

N

C

SIG

NA

L FO

R R

LS R

ESET

TIN

G

IF

(TIM

E.G

T.(T

RIG

GER

TIM

E1+0

.05)

.AN

D.T

IME.

LT.(T

RIG

GER

TIM

E1+0

.06)

)

.

TRIG

GER

2=1

...FI

N

68

Page 74: tesis-FLECS-PSSE

IF(T

IME.

GT.

(TR

IGG

ERTI

ME1

+0.0

6).A

ND

.TIM

E.LT

.(TR

IGG

ERTI

ME1

+0.0

7))

. TR

IGG

ER2=

0

.

TRIG

GER

TIM

E1=9

999.

...

FIN

IF

(TIM

E.G

T.(T

RIG

GER

TIM

E2+0

.05)

.AN

D.T

IME.

LT.(T

RIG

GER

TIM

E2+0

.06)

)

.

TRIG

GER

2=1

...FI

N

IF(T

IME.

GT.

(TR

IGG

ERTI

ME2

+0.0

6).A

ND

.TIM

E.LT

.TR

IGG

ERTI

ME2

+0.0

7)

. TR

IGG

ER2=

0

.

TRIG

GER

TIM

E2=9

999.

...

FIN

SET-

VA

RS

C

C

IF(I

CO

N(I

+3).E

Q.0

)

.

RX

=-1.

/GB

(KF)

.

IF(I

TER

.GT.

ITM

XD

S/4.

AN

D.IN

TIC

N(I

+4).E

Q.1

)

.

. IC

ON

(I+4

)=1

. .

INTI

CN

(I+4

)=2

. ...

FIN

.

IF(I

TER

.GT.

ITM

XD

S/2.

AN

D.IN

TIC

N(I

+4).E

Q.2

)

.

. IC

ON

(I+4

)=1

. .

INTI

CN

(I+4

)=0

. ...

FIN

.

IF(C

MX

.LE.

CO

N(J

+3)*

TOL.

AN

D.IC

ON

(I+4

).EQ

.1)

. .

IF(A

BS(

(X-V

AR

(L+1

5))/C

ON

(J+5

)).G

T.C

ON

(J+2

))

. .

. W

HEN

(IN

TIC

N(I

+4).E

Q.1

)

.

. .

. R

X=C

MPL

X(0

.,VA

R(L

+15)

)

.

. .

. V

AR

(L+1

3)=V

AR

(L+1

5)

. .

. ...

FIN

.

. .

ELSE

RX

=CM

PLX

(0.,V

AR

(L+1

3))

. .

. IC

ON

(I+4

)=2

. .

. G

B(K

F)=-

1./R

X

C

. .

.

. .

. W

RIT

E(LP

DEV

,77)

ICK

T,IC

ON

(I),I

CO

N(I

+1),T

IME

C

. .

.

. .

. C

ALL

LO

FLSB

.

. .

CA

LL F

AC

T

.

. .

CA

LL R

TRN

SB

. .

...FI

N

. ...

FIN

...

FIN

C

W

HEN

(FR

EQS)

! U

ND

O IN

JEC

TIO

N 'N

ETFR

Q' U

SED

,

.

T1=1

. + 0

.5*(

BSF

REQ

(II)

+BSF

REQ

(JJ)

)

! CA

LCU

LATE

INJE

CTI

ON

FO

R

C

.

! C

HA

NG

E IN

REA

CTA

NC

E FR

OM

.

WH

EN (X

.GE.

0.) X

=X*T

1

! W

OR

KIN

G C

ASE

VA

LUE,

AN

D M

AK

E

.

ELSE

X

=X/T

1

! I

T FR

EQU

ENC

Y S

ENSI

TIV

E C

.

.

AD

DER

=1./R

X

. W

HEN

(IC

ON

(I+3

).EQ

.0)

C

. .

DEC

ELER

ATE

D D

ESIR

ED M

AG

NIT

UD

ES

. .

WH

EN (I

CO

N(I

+4).E

Q.0

.AN

D.C

MX

.LE.

CO

N(J

+3)*

TOL.

AN

D.IT

ER.L

T.IT

MX

DS*

3/4)

.

. .

R=0

.

.

. .

X=V

AR

(L+1

3)+(

VA

R(L

+15)

-VA

R(L

+13)

)*C

ON

(J+1

)

.

. .

VA

R(L

+13)

=X

C

. .

.

ICO

N(I

+4)=

1

.

. ...

FIN

.

. EL

SE

. .

. R

=0.

. .

. X

=VA

R(L

+13)

.

. ...

FIN

.

...FI

N

. EL

SE

. .

R=0

.

.

. X

=VA

R(L

+15)

.

...FI

N

C

.

. W

HEN

(X.G

E.0.

) X=X

*T1

. EL

SE

X=X

/T1

C

.

. A

DD

ER=

(1./R

X) -

AD

DER

...

FIN

EL

SE

. W

HEN

(IC

ON

(I+3

).EQ

.0)

C

. .

DEC

ELER

ATE

D D

ESIR

ED M

AG

NIT

UD

ES

. .

WH

EN (I

CO

N(I

+4).E

Q.0

.AN

D.C

MX

.LE.

CO

N(J

+3)*

TOL.

AN

D.IT

ER.L

T.IT

MX

DS*

3/4)

.

. .

R=0

.

.

. .

X=V

AR

(L+1

3)+(

VA

R(L

+15)

-VA

R(L

+13)

)*C

ON

(J+1

)

.

. .

VA

R(L

+13)

=X

C

. .

.

ICO

N(I

+4)=

1

.

. ...

FIN

.

. EL

SE

. .

. R

=0.

. .

. X

=VA

R(L

+13)

.

. ...

FIN

.

...FI

N

. EL

SE

. .

R=0

.

.

. X

=VA

R(L

+15)

.

...FI

N

. A

DD

ER=(

1./R

X) +

GB

(KF)

...

FIN

C

A

DD

ER=(

VO

LT(I

I)-V

OLT

(JJ)

)*A

DD

ER

IF(I

CO

N(I

+3).E

Q.1

)

.

IF(I

NTI

CN

(I+3

).EQ

.2)

. .

RX

=AD

DER

.

. V

AR

(L+1

2)=V

AR

(L+1

2)+(

AB

S(R

X)-

VA

R(L

+12)

)*C

ON

(J)

. .

VA

R(L

+13)

=VA

R(L

+13)

+(A

TAN

2(X

,R)-

VA

R(L

+13)

)*C

ON

(J+1

)

.

. A

DD

ER=V

AR

(L+1

2)*C

MPL

X(C

OS(

VA

R(L

+13)

),SIN

(VA

R(L

+13)

))

. ...

FIN

...

FIN

69

Page 75: tesis-FLECS-PSSE

CU

RN

T(II

)=C

UR

NT(

II)-

AD

DER

C

UR

NT(

JJ)=

CU

RN

T(JJ

)+A

DD

ER

IF(I

CO

N(I

+3).E

Q.0

)

.

IF(I

CO

N(I

+4).E

Q.2

)IC

ON

(I+4

)=0

...FI

N

POPU

LATE

-VO

LTS-

LIN

ECU

RR

ENT

IF(I

CO

N(I

+5).E

Q.1

)

W

HEN

(IC

ON

(I+3

).EQ

.0)

WR

ITE(

LPD

EV,9

996)

ICK

T,IC

ON

(I),I

CO

N(I

+1),T

IME,

VA

R(L

+13)

,VA

R(L

+15)

,VA

R(L

+4)

. EL

SE W

RIT

E(LP

DEV

,999

7)IC

KT,

ICO

N(I

),IC

ON

(I+1

),TIM

E,V

AR

(L+1

5),V

AR

(L+4

)

...

FIN

C

M

INU

S C

UR

REN

T O

N C

APA

CIT

OR

= V

ALV

E C

UR

REN

T

R

X=R

X-(

VO

LT(I

I)-V

OLT

(JJ)

)/CM

PLX

(0.,C

ON

(J+5

))

VA

R(L

+11)

=180

./PI*

ATA

N2(

X,R

)

V

AR

(L+1

0)=A

BS(

RX

) C

C

APA

CIT

OR

CU

RR

ENT

RX

=(V

OLT

(II)

-VO

LT(J

J))/C

MPL

X(0

.,CO

N(J

+5))

V

AR

(L+9

)=18

0./P

I*A

TAN

2(X

,R)

VA

R(L

+8)=

AB

S(R

X)

C

CA

PAC

ITO

R V

OLT

AG

E

R

X=V

OLT

(II)

-VO

LT(J

J)

VA

R(L

+7)=

180.

/PI*

ATA

N2(

X,R

)

V

AR

(L+6

)=A

BS(

RX

) C

C

C

R

ETU

RN

$1

7

F

OR

MA

T(//1

3X,'*

** C

ALL

',A

,'AIN

TC(',

I6,3

(',',I

6),')

***

') 1

7 F

OR

MA

T(/'

*

* ',A

,'AIN

TC *

* I

C O

N S

C O

N S

',

*

5

X,'S

T A

T E

S

V A

R S

'/16X

,4(I

7,'-'

,A6)

) 2

7 F

OR

MA

T(/7

X,2

(4X

,'BU

S X

-- N

AM

E --

X B

ASE

KV

'),'

CK

T'/

*

7X

,2(I

7,1X

,A12

,1X

,A6)

,A6/

*

/1

2X,'A

CC

#1

AC

C#2

XTH

RES

CO

NV

TOL

L

INX

XB

AN

K',7

X,

*

/7X

,F10

.3,1

X,F

7.3,

1X,F

7.4,

1X,F

7.2,

1X,F

11.7

,1X

,F10

.7/,

*

/14X

,'STS

BST

MN

CA

PBST

MX

CA

PBST

IN

DB

ST U

MX

TCSC

TK

BY

P',7

X,

*

/12X

,2(1

X,F

7.4)

,2X

,F7.

4,1X

,3(1

X,F

7.4)

,/,

*

/15X

,' TK

CA

P M

NTB

YPS

S FR

QO

SC C

OA

VFR

Q C

OFL

FRQ

A

LPH

A',7

X,

*

/13X

,2(1

X,F

7.4)

,F8.

4,2(

1X,F

7.4)

,1X

,F7.

2,/,

*

/11X

,' K

AV

K

PH

OPE

RA

T

KD

F

TD

F

DFM

AX

D

FMIN

',7X

,

*

/9

X,2

(1X

,F7.

4),F

8.4,

1X,F

7.4,

1X,F

7.2,

1X,F

7.4,

1X,F

7.3)

3

7 F

OR

MA

T(/7

X,'

ICO

N(',

I7,')

=',I

7,' -

MW

LIN

E C

OM

PUTE

D F

RO

M E

XTE

RN

AL

BR

AN

CH

FLO

WS'

) 4

7 F

OR

MA

T(/7

X,'

ICO

N(',

I7,')

=',I

7,' -

MW

LIN

E C

OM

PUTE

D F

RO

M S

ELF-

FLO

W')

48

FO

RM

AT(

/7X

,' W

OR

KA

S =

0 - N

EVER

IN B

YPA

SS M

OD

E')

49

FO

RM

AT(

/7X

,' W

OR

KA

S =

1 - M

AY

TEM

POR

AR

ILY

SW

ITC

H T

O B

YPA

SS M

OD

E')

50

FO

RM

AT(

/7X

,' W

OR

KA

S =

2 - A

LWA

YS

IN B

YPA

SS M

OD

E')

51

FO

RM

AT(

/7X

,' IC

ON

(',I7

,') =

',I7,

' - IN

VA

LID

SET

TIN

G O

F W

OR

KA

S')

77

FO

RM

AT(

' NEW

FA

CT

BY

MA

INTC

CIR

CU

IT ',

A,'

FRO

M',I

7,' T

O',I

7,

*

' A

T TI

ME

=',F

8.3)

9

7 F

OR

MA

T(//'

MA

INTC

:')

107

FO

RM

AT(

' MA

INTC

CIR

CU

IT ',

A,'

FRO

M',I

7,' T

O',I

7,' N

OT

FOU

ND

') 1

17 F

OR

MA

T(' M

AIN

TC B

US'

,I7,'

NO

T FO

UN

D--

CIR

CU

IT ',

A,'

FRO

M',I

7,

*

' TO

',I7)

1

27 F

OR

MA

T(' M

AIN

TC IN

VA

LID

CIR

CU

IT ID

',I7,

' FR

OM

',I7,

' TO

',I7)

1

37 F

OR

MA

T(' M

AIN

TC C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

' IS

TR

EATE

D A

S A

ZER

O IM

PED

AN

CE

LIN

E')

147

FO

RM

AT(

' MA

INTC

CIR

CU

IT ',

A,'

FRO

M',I

7,' T

O',I

7,

*

' LO

AD

FLO

W R

ESIS

TAN

CE

= ',F

12.7

,' D

ESIR

ED R

ESIS

TAN

CE

= 0.

',/,1

X,

*

' C

HEC

K C

OO

RD

INA

TIO

N W

ITH

CO

NTR

OL

SEC

TIO

NS

OF

MO

DEL

') 2

47 F

OR

MA

T(' M

AIN

TC C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

'

PHA

SOR

EST

IMA

TIO

N',/

,1X

,'CO

OR

DIN

ATE

AN

GLE

(TH

ETA

-STA

TE(',

I7,')

) CO

RR

ECTL

Y IN

ITIA

LIZE

D W

ITH

D

STA

TE N

E 0.

') 1

48 F

OR

MA

T(' M

AIN

TC C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

'

LOA

DFL

OW

REA

CTA

NC

E =

',F12

.7,'

DES

IRED

REA

CTA

NC

E =

',F12

.7,/,

1X,

*

' C

HEC

K C

OO

RD

INA

TIO

N W

ITH

CO

NTR

OL

SEC

TIO

NS

OF

MO

DEL

') 1

49 F

OR

MA

T(' M

AIN

TC C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

'

HA

S B

EEN

INIT

IALI

ZED

AS

BY

PASS

ED (W

OR

KA

S=2)

') 1

57 F

OR

MA

T(' M

AIN

TC C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

'

IS A

TR

AN

SFO

RM

ER--

MO

DEL

IGN

OR

ED')

167

FO

RM

AT(

' MA

INTC

CIR

CU

IT ',

A,'

FRO

M',I

7,' T

O',I

7,

*

' M

OD

EL N

OT

IMPL

EMEN

TED

FO

R M

STR

/MR

UN

--M

OD

EL IG

NO

RED

') 1

77 F

OR

MA

T(' M

AIN

TC C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

' AT

TIM

E ='

,F8.

3,

*

' C

APA

CIT

OR

BA

NK

BY

PASS

ED')

178

FO

RM

AT(

' MA

INTC

CIR

CU

IT ',

A,'

FRO

M',I

7,' T

O',I

7,' A

T TI

ME

=',F

8.3,

*

'

CA

PAC

ITO

R B

AN

K U

NB

YPA

SSED

') 2

17 F

OR

MA

T(' A

CC

#1='

,F14

.4)

218

FO

RM

AT(

' AC

C#2

=',F

14.4

) 2

19 F

OR

MA

T(' X

THR

ES='

,F14

.10)

2

20 F

OR

MA

T(' C

ON

VTO

L=',F

14.2

) 2

21 F

OR

MA

T(' L

INX

=',F

14.1

0)

222

FO

RM

AT(

' XB

AN

K='

,F14

.10)

2

24 F

OR

MA

T(' M

NC

APB

ST='

,F14

.2)

225

FO

RM

AT(

' STS

BST

=',F

14.2

,' M

NC

APB

ST='

,F14

.2)

223

FO

RM

AT(

' MX

CA

PBST

=',F

14.2

,' ST

SBST

=',F

14.2

) 2

26 F

OR

MA

T(' I

ND

BST

=',F

14.1

0)

507

FO

RM

AT(

6X,'0

''USR

MD

L''

0 ''M

AIN

TC''

8 1

22 2

5 7

31'/

*

3X

,2I1

3,7X

,A6,

I13,

' 0 0

0 0

0 0

',I1

3,' 0

',I1

3,3(

/7X

,3I1

4),4

(/7X

,6G

13.5

),/7X

,G13

.5'/')

99

96 F

OR

MA

T(' C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

'

AT

TIM

E ='

,F8.

3,' X

=',G

15.7

,' X

OH

M='

,G15

.7,'

LCU

RR

=',G

15.7

) 99

97 F

OR

MA

T(' C

IRC

UIT

',A

,' FR

OM

',I7,

' TO

',I7,

*

'

AT

TIM

E ='

,F8.

3,' X

OH

M='

,G15

.7,'

LCU

RR

=',G

15.7

) $1

--

----

----

----

----

----

----

----

----

----

--

TO C

HEC

K-F

OR

-SEL

ECTI

VE-

DO

CU

C

.

.

IF (I

BD

OC

U.G

T.0)

! SEL

ECTI

VE

DO

CU

.

. IF

(IC

ON

(I).N

E.IB

DO

CU

.AN

D. I

CO

N(I

+1).N

E.IB

DO

CU

) RET

UR

N

. ...

FIN

C

.

...

FIN

--

----

----

----

----

----

----

----

----

----

--

70

Page 76: tesis-FLECS-PSSE

TO T

AB

ULA

TE-M

OD

EL

C

.

. C

ALL

LIN

MO

D(I

,.FA

LSE.

,NEW

,*15

00)

C

.

. W

RIT

E(IP

RT,

7) C

OR

T,I,J

,K,L

C

.

.

JJ=J

+24

. II

= 0

.

CA

LL A

DIN

TN (I

+21,

CB

1,II

)

.

II =

0

. C

ALL

AD

INTN

(JJ,C

B2,

II)

. II

= 0

.

CA

LL A

DIN

TN (K

+6,C

B3,

II)

. II

= 0

.

CA

LL A

DIN

TN (L

+30,

CB

4,II

)

.

WR

ITE(

IPR

T,17

) CO

RT,

I,CB

1,J,C

B2,

K,C

B3,

L,C

B4

...FI

N

----

----

----

----

----

----

----

----

----

----

TO

SET

-BU

S-N

AM

E

.

IBU

S=IC

ON

(I+K

F-1)

C

.

.

IF (I

BU

S.G

T.0)

.

. C

ALL

BSS

EQN

(IB

US,

II,*

1200

)

.

. N

AM

E(K

F)(1

:12)

=BU

SNA

M(I

I)

. .

CA

LL V

LTFR

6(N

AM

E(K

F)(1

3:18

),BA

SVLT

(II)

)

.

. EX

ITPR

OC

.

...FI

N

C

.

120

0 .

NA

ME(

KF)

=' '

...FI

N

----

----

----

----

----

----

----

----

----

----

TO

PR

INT-

HEA

DIN

G

. U

NLE

SS (N

EW)

. .

NEW

=.TR

UE.

.

. C

ALL

DO

CU

HD

(*15

00)

. .

WR

ITE(

IPR

T,97

)

.

...FI

N

...FI

N

C

C

----

----

----

----

----

----

----

----

----

----

T

O M

OV

E-C

ON

S-IN

TO-L

OC

AL-

VA

RIA

BLE

S C

.

.

LIN

X=C

ON

(J+4

)

.

XB

AN

K=C

ON

(J+5

)

.

STSB

ST=C

ON

(J+6

)

.

MN

CA

PBST

=CO

N(J

+7)

. M

XC

APB

ST=C

ON

(J+8

)

.

IND

BST

=CO

N(J

+9)

. U

MX

TCSC

=CO

N(J

+10)

.

TKB

YP=

CO

N(J

+11)

.

TKC

AP=

CO

N(J

+12)

.

MN

TBY

PSS=

CO

N(J

+13)

.

FRQ

OSC

=CO

N(J

+14)

.

CO

AV

FRQ

=CO

N(J

+15)

.

CO

FLFR

Q=C

ON

(J+1

6)

. A

LPH

A=C

ON

(J+1

7)

. K

AV

=CO

N(J

+18)

.

KPH

=CO

N(J

+19)

.

OPE

RA

T=C

ON

(J+2

0)

. K

DF=

CO

N(J

+21)

.

TDF=

CO

N(J

+22)

.

DFM

AX

=CO

N(J

+23)

.

DFM

IN=C

ON

(J+2

4)

. PX

BV

=CO

N(J

+25)

.

LAM

BD

A=C

ON

(J+2

6)

. X

SIA

V=C

ON

(J+2

7)

. X

SIPH

=CO

N(J

+28)

.

XSI

AV

1=C

ON

(J+2

9)

. X

SIPH

1=C

ON

(J+3

0)

. O

SCLI

MIT

=CO

N(J

+31)

...

FIN

--

----

----

----

----

----

----

----

----

----

--

TO S

ET-I

CO

NS

C

.

. IC

ON

(I+3

)=ST

RA

T

.

ICO

N(I

+6)=

PRO

T

.

ICO

N(I

+7)=

FLG

SWG

.

ICO

N(I

+8)=

OPM

OD

E

.

ICO

N(I

+9)=

MO

DEO

P

.

ICO

N(I

+10)

=WO

RK

AS

. IC

ON

(I+1

1)=F

LGST

AR

T

...

FIN

--

----

----

----

----

----

----

----

----

----

--

TO G

ET-I

CO

NS

C

.

. ST

RA

T =

ICO

N(I

+3)

. PR

OT

= IC

ON

(I+6

)

.

FLG

SWG

=IC

ON

(I+7

)

.

OPM

OD

E=IC

ON

(I+8

)

.

MO

DEO

P=IC

ON

(I+9

)

.

WO

RK

AS=

ICO

N(I

+10)

.

FLG

STA

RT=

ICO

N(I

+11)

.

MTH

DPE

=IC

ON

(i+22

)

...

FIN

--

----

----

----

----

----

----

----

----

----

--

71

Page 77: tesis-FLECS-PSSE

T

O S

ET-V

AR

S C

.

.

VA

R(L

+4) =

ITC

SC

. V

AR

(L+6

) = U

TCSC

.

VA

R(L

+14)

= X

REQ

.

VA

R(L

+15)

= X

OH

M

. V

AR

(L+1

6) =

K1G

AIN

.

VA

R(L

+17)

= K

2GA

IN

. V

AR

(L+1

8) =

PH

ASO

R

. V

AR

(L+1

9) =

SIG

NA

L

.

VA

R(L

+20)

= N

EWSI

GN

AL

. V

AR

(L+2

1) =

MW

LIN

E

.

VA

R(L

+22)

= M

WLI

NET

OT

. V

AR

(L+2

3) =

RE_

REF

.

VA

R(L

+24)

= IM

_REF

.

VA

R(L

+25)

= T

STA

RT

. V

AR

(L+2

6) =

NEW

FRQ

.

VA

R(L

+27)

= A

RG

REF

.

VA

R(L

+31)

= X

I

.

VA

R(L

+32)

= X

EQ

. V

AR

(L+3

3) =

XO

LD

. V

AR

(L+3

4) =

X1

. V

AR

(L+3

5) =

XTO

T0

. V

AR

(L+3

6) =

PTO

T0

. V

AR

(L+3

7) =

DEL

TAX

TOT

. V

AR

(L+3

8) =

PPE

AK

1

.

VA

R(L

+39)

= T

RIG

GER

TIM

E

.

VA

R(L

+40)

= P

MEA

N1

. V

AR

(L+4

1) =

XFI

NA

L

.

VA

R(L

+42)

= X

EQES

T

. V

AR

(l+43

) = X

IEST

.

VA

R(L

+44)

= P

MEA

N0

.

VA

R(L

+45)

= P

PEA

K0

. V

AR

(L+4

6) =

XST

AR

T

. V

AR

(L+4

7) =

XD

.

VA

R(L

+48)

= X

STEP

1

. V

AR

(L+4

9) =

XST

EP2

. V

AR

(L+5

0) =

ATS

TEP

. V

AR

(L+5

1) =

TR

IGG

ERTI

ME1

.

VA

R(L

+52)

= T

RIG

GER

1

.

VA

R(L

+53)

= D

ELTA

XB

V

. V

AR

(L+5

4) =

DEL

TAX

.

VA

R(L

+55)

= D

ELTA

X2N

D

. V

AR

(L+5

6) =

XH

ILIM

.

VA

R(L

+57)

= X

LOW

LIM

.

VA

R(L

+58)

= X

0

.

VA

R(L

+59)

= D

ELTA

XB

V1

. V

AR

(L+6

0) =

DX

TOTB

V1

. V

AR

(L+6

1) =

XTO

T0

. V

AR

(L+6

2) =

TR

IGG

ERTI

ME2

.

VA

R(L

+63)

= T

RIG

GER

2

.

VA

R(L

+64)

= F

AU

LTR

ES

. V

AR

(L+6

5) =

ISO

SC

. V

AR

(L+6

6) =

STA

GE

. V

AR

(L+6

7) =

STE

PTIM

E

.

VA

R(L

+68)

= T

IMES

TAG

E4

. V

AR

(L+6

9) =

EST

ITO

REA

L

.

VA

R(L

+70)

= X

IOLD

.

VA

R(L

+71)

= X

EQO

LD

. V

AR

(L+7

2) =

LIM

.

VA

R(L

+73)

= R

EALT

M

. V

AR

(l+74

) = IM

AG

TM

...FI

N

----

----

----

----

----

----

----

----

----

----

TO

GET

-VA

RS

C

.

. IT

CSC

= V

AR

(L+4

)

.

UTC

SC =

VA

R(L

+6)

. X

REQ

= V

AR

(L+1

4)

. X

OH

M =

VA

R(L

+15)

.

K1G

AIN

= V

AR

(L+1

6)

. K

2GA

IN =

VA

R(L

+17)

.

PHA

SOR

= V

AR

(L+1

8)

. SI

GN

AL

= V

AR

(L+1

9)

. N

EWSI

GN

AL

= V

AR

(L+2

0)

. M

WLI

NE

= V

AR

(L+2

1)

. M

WLI

NET

OT

= V

AR

(L+2

2)

. R

E_R

EF =

VA

R(L

+23)

.

IM_R

EF =

VA

R(L

+24)

.

TSTA

RT

= V

AR

(L+2

5)

. N

EWFR

Q =

VA

R(L

+26)

.

AR

GR

EF =

VA

R(L

+27)

.

XI =

VA

R(L

+31)

.

XEQ

= V

AR

(L+3

2)

. X

OLD

= V

AR

(L+3

3)

. X

1 =

VA

R(L

+34)

.

XTO

T0 =

VA

R(L

+35)

.

PTO

T0 =

VA

R(L

+36)

.

DEL

TAX

TOT

= V

AR

(L+3

7)

. PP

EAK

1 =

VA

R(L

+38)

.

TRIG

GER

TIM

E =

VA

R(L

+39)

.

PMEA

N1

= V

AR

(L+4

0)

. X

FIN

AL

= V

AR

(L+4

1)

. X

EQES

T =

VA

R(L

+42)

.

XIE

ST =

VA

R(L

+43)

.

PMEA

N0

= V

AR

(L+4

4)

. PP

EAK

0 =

VA

R(L

+45)

.

XST

AR

T =

VA

R(L

+46)

.

XD

= V

AR

(L+4

7)

. X

STEP

1 =

VA

R(L

+48)

.

XST

EP2

= V

AR

(L+4

9)

. A

TSTE

P =

VA

R(L

+50)

.

TRIG

GER

TIM

E1 =

VA

R(L

+51)

72

Page 78: tesis-FLECS-PSSE

.

TRIG

GER

1 =

VA

R(L

+52)

.

DEL

TAX

BV

= V

AR

(L+5

3)

. D

ELTA

X =

VA

R(L

+54)

.

DEL

TAX

2ND

= V

AR

(L+5

5)

. X

HIL

IM =

VA

R(L

+56)

.

XLO

WLI

M =

VA

R(L

+57)

.

X0

= V

AR

(L+5

8)

. D

ELTA

XB

V1

= V

AR

(L+5

9)

. D

XTO

TBV

1 =

VA

R(L

+60)

.

XTO

T0 =

VA

R(L

+61)

.

TRIG

GER

TIM

E2 =

VA

R(L

+62)

.

TRIG

GER

2=V

AR

(L+6

3)

. FA

ULT

RES

=VA

R(L

+64)

.

ISO

SC=V

AR

(L+6

5)

. ST

AG

E =

VA

R(L

+66)

.

STEP

TIM

E =

VA

R(L

+67)

.

TIM

ESTA

GE4

= V

AR

(L+6

8)

. ES

TITO

REA

L =

VA

R(L

+69)

.

XIO

LD =

VA

R(L

+70)

.

XEQ

OLD

= V

AR

(L+7

1)

. LI

M =

VA

R(L

+72)

.

REA

LTM

= V

AR

(L+7

3)

. IM

AG

TM =

VA

R(L

+74)

...

FIN

--

----

----

----

----

----

----

----

----

----

--

TO G

ET-S

TATE

S C

.

.

XTC

SC =

STA

TE(K

)

.

PAV

= S

TATE

(K+1

)

.

REA

LDP

= ST

ATE

(K+2

)

.

IMA

GD

P =

STA

TE(K

+3)

. D

EL_I

= S

TATE

(K+4

)

.

TETA

CS

= ST

ATE

(K+5

)

.

THET

A =

STA

TE(K

+6)

. PA

V1

= ST

ATE

(K+7

)

.

REA

LDP1

= S

TATE

(K+8

)

.

IMA

GD

P1 =

STA

TE(K

+9)

...FI

N

----

----

----

----

----

----

----

----

----

----

TO

SET

-DST

ATE

S C

.

.

DST

ATE

(K) =

DX

TCSC

.

DST

ATE

(K+1

) = D

PAV

.

DST

ATE

(K+2

) = D

REA

LDP

. D

STA

TE(K

+3) =

DIM

AG

DP

. D

STA

TE(K

+4) =

DD

EL_I

.

DST

ATE

(K+5

) = D

TETA

CS

. D

STA

TE(K

+6) =

DTH

ETA

.

DST

ATE

(K+7

) = D

PAV

1

.

DST

ATE

(K+8

) = D

REA

LDP1

.

DST

ATE

(K+9

) = D

IMA

GD

P1

...FI

N

TO

SET

-STA

TES

C

.

. ST

ATE

(K) =

XTC

SC

. ST

ATE

(K+1

) = P

AV

.

STA

TE(K

+2) =

REA

LDP

. ST

ATE

(K+3

) = IM

AG

DP

. ST

ATE

(K+4

) = D

EL_I

.

STA

TE(K

+5) =

TET

AC

S

.

STA

TE(K

+6) =

TH

ETA

.

STA

TE(K

+7) =

PA

V1

. ST

ATE

(K+8

) = R

EALD

P1

. ST

ATE

(K+9

) = IM

AG

DP1

...

FIN

--

----

----

----

----

----

----

----

----

----

--

TO P

OPU

LATE

-VO

LTS-

LIN

ECU

RR

ENT

C

. F

RO

M B

US

VO

LTA

GE

. R

X=V

OLT

(II)

.

VA

R(L

+1)=

180.

/PI*

ATA

N2(

X,R

)

.

VA

R(L

)=A

BS(

RX

) C

.

TO

BU

S V

OLT

AG

E

.

RX

=VO

LT(J

J)

. V

AR

(L+3

)=18

0./P

I*A

TAN

2(X

,R)

. V

AR

(L+2

)=A

BS(

RX

) C

.

CU

RR

ENT

ON

BR

AN

CH

.

RX

=-1.

*(V

OLT

(II)

-VO

LT(J

J))*

GB

(KF)

C

.

PLU

S C

UR

REN

T IN

JEC

TIO

N =

LIN

E C

UR

REN

T

.

RX

=RX

+AD

DER

.

VA

R(L

+5)=

180.

/PI*

ATA

N2(

X,R

)

.

VA

R(L

+4)=

AB

S(R

X)

...FI

N

END

(F

LEC

S V

ersi

on 2

2.60

- PT

I)

----

----

----

----

----

----

----

----

----

----

73

Page 79: tesis-FLECS-PSSE

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