+ All Categories
Home > Documents > BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC...

BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC...

Date post: 30-Apr-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
80
A FUZZY LOGIC BASED AUTOMATIC VOLTAGE REGULATOR FOR ALTERNATOR TERMINAL VOLTAGE AND REACTIVE POWER CONTROL A PROJECT WORK PRESENTED IN PARTIAL FULFILMENT FOR THE AWARD OF MASTER OF ENGINEERING (M. Eng) DEGREE IN ELECTRICAL ENGINEERING BY OKOZI, SAMUEL OKECHUKWU B. Eng (Hons), FUTO PG/M.ENG/06/40693 DEPARTMENT OF ELECTRICAL ENGINEERING UNIVERSITY OF NIGERIA, NSUKKA. MARCH, 2009
Transcript
Page 1: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

A FUZZY LOGIC BASED AUTOMATIC VOLTAGE

REGULATOR FOR ALTERNATOR TERMINAL

VOLTAGE AND REACTIVE POWER CONTROL

A PROJECT WORK PRESENTED IN PARTIAL FULFILMENT

FOR THE AWARD OF MASTER OF ENGINEERING (M. Eng)

DEGREE IN ELECTRICAL ENGINEERING

BY

OKOZI, SAMUEL OKECHUKWU

B. Eng (Hons), FUTO

PG/M.ENG/06/40693

DEPARTMENT OF ELECTRICAL ENGINEERING

UNIVERSITY OF NIGERIA, NSUKKA.

MARCH, 2009

Page 2: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

A FUZZY LOGIC BASED AUTOMATIC VOLTAGE

REGULATOR FOR ALTERNATOR TERMINAL

VOLTAGE AND REACTIVE POWER CONTROL

A PROJECT WORK PRESENTED IN PARTIAL FULFILMENT

FOR THE AWARD OF MASTER OF ENGINEERING (M. Eng)

DEGREE IN ELECTRICAL ENGINEERING

BY

OKOZI, SAMUEL OKECHUKWU

B. Eng (Hons), FUTO

PG/M.ENG/06/40693

DEPARTMENT OF ELECTRICAL ENGINEERING

UNIVERSITY OF NIGERIA, NSUKKA.

SUPERVISOR: VEN. ENGR. PROF. T.C MADUEME

MARCH, 2009

Page 3: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

A FUZZY LOGIC BASED AUTOMATIC VOLTAGE REGULATOR FOR ALTERNATOR TERMINAL VOLTAGE AND REACTIVE POWER CONTROL

A PROJECT WORK PRESENTED IN PARTIAL FULFILMENT FOR THE

AWARD OF MASTER OF ENGINEERING DEGREE IN ELECTRICAL

ENGINEERING

BY: OKOZI, SAMUEL OKECHUKWU

B. Eng (Hons), FUTO

PG/M.ENG/06/40693

DEPARTMENT OF ELECTRICAL ENGINEERING UNIVERSITY OF NIGERIA, NSUKKA.

MARCH, 2009

AUTHOR: --------------------------------------------- OKOZI, SAMUEL OKECHUKWU SUPERVISOR: --------------------------------------------- VEN. ENGR. PROF. T.C. MADUEME HEAD OF DEPARTMENT: ------------------------------------------ ENGR. PROF. M.U. AGU EXTERNAL EXAMINER: ------------------------------------------- ENGR. PROF. J.C. EKE

Page 4: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

DECLARATION I, Okozi, Samuel Okechukwu, a postgraduate student in the Department of

Electrical Engineering, with Registration number PG/M.ENG/06/40693

humbly declare that this is my work and it has not been submitted in part or full

for any other Diploma or Degree of this university to the best of my knowledge.

------------------------------------ Okozi, Samuel Okechukwu

Page 5: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CERTIFICATION

OKOZI, Samuel Okechukwu, a postgraduate student in the Department

of Electrical Engineering, with Registration number PG/M.ENG/06/40693, has

satisfactorily completed the requirements for course and research work for the

Degree of Master of Engineering (M. Eng) in the department of Electrical

Engineering University of Nigeria, Nsukka.

The work embodied in the Dissertation is original and has not been

submitted in part or full for any other Diploma or Degree of this university to

the best of my knowledge.

--------------------------------------- ------------------------------ Ven. Engr. Prof. T.C. Madueme Engr. Prof. M.U. Agu SUPERVISOR HEAD OF DEPT.

Page 6: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

DEDICATION

This work is dedicated to the Almighty God who made it possible for my dream to come true, and to the memory of my dear mother, Late Mrs. Rosaline Okozi.

Page 7: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

ACKNOWLEDGEMENT I wish to express my profound gratitude to my supervisor , Ven. Engr. Prof T.C.

Madueme who has been like a father throughout the cause of this work. I thank

the Head of the Department, Engr. Prof. M.U. Agu for his immense help and

open door policy even on a short notice.

I am also grateful to Engr. Dr. L.U. Anih whose encouraging words I shall

always remember and also very grateful to Engr. Dr. E. S. Obe for providing me

with lots of journals on fuzzy logic from far away Germany.

In a special way, I thank Engr. Dr. S.N. Ndubisi of Electrical/Electronic

Engineering Department, Enugu State University of Technology (ESUT) for

giving me the foundation of what fuzzy logic is all about.

. I also remain grateful to the following lecturers in this Department for their

encouragements Engr. B.O Nnadi, Engr. C. Odeh and Engr.S.O. Oti.

Also not left out in my train of appreciation were my colleagues, Mbadiwe,

Cosmas, Umor, Nelson, Ben and N.D for our cooperation cannot be forgotten in

a hurry. Also included are my friends, Cornelius, Jude, Naze and Eniola of

Power Holding Company of Nigeria (PHCN), New Haven work centre, Enugu.

Finally, I must not forget my family members for the support and understanding

throughout this programme.

To all of you and the Almighty God, I remain grateful.

Samuel Okechukwu Okozi

Page 8: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

ABSTRACT

The frequency of a power system is affected by changes in real power while the

terminal voltage magnitude is affected by changes in reactive power. The load

frequency control loop (LFC) controls the real power and frequency while the

Automatic voltage regulator (AVR) controls the reactive power and voltage

magnitude of an alternator.

The role of the AVR is to hold the terminal voltage magnitude of a synchronous

generator at a specified level. As the reactive load of the consumers increases

beyond the rated value of the generator, the result will be a decrease in the

terminal voltage of the generator. Most of the appliances therefore cannot be

powered hence the need to bring the voltage level back to the specified level.

The conventional control approach to the terminal voltage and reactive power

regulation involves the development of the linear equations of the AVR models

and then using the appropriate control theory to develop the controller.

This conventional modeling and control approach has been seen to perform

poorly when the system operating conditions change (or vary). This is due to the

fixed parameters and the linearized models of the system. This and other

reasons have led to the use of fuzzy logic control and programming in the

control of the terminal voltage and reactive power of AVR of an alternator.

Page 9: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Conventional modeling and control approach is highlighted, fuzzy dynamic

programming approach is used extensively and the results were simulated using

MATLAB software packages.

Page 10: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

DEFINITION OF TERMS Rise time: The time for a system to respond to a step input and attains a

response equal to the magnitude of the input. Peak time: The time for a system to respond to a step input and rise to a

peak response. Overshoot: The amount the system output response proceeds beyond the

desired response. Settling time: The time required for the system output to settle within a

certain percentage of the input amplitude. PID controller: A controller with three terms in which the output of the

controller is the sum of a proportional term, an integrating term, and a differentiating term, with an adjustable gain for each term.

Steady-state error: The error when the time period is large and when the transient response has decayed, leaving the continuous response.

Page 11: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

LIST OF SYMBOLS AND ABBREVATIONS

KR Sensor gain KA Amplifier gain KE Exciter gain KG Generator gain

Rτ Sensor time constant Aτ Amplifier time constant Eτ Exciter time constant Gτ Generator time constant

Vtss Steady-state response of the AVR Vs(s) Output voltage of the sensor Vref Reference voltage Vt Generator terminal voltage VR Input voltage to the exciter VF Field voltage PID Proportional Integral Derivative PI Proportional Integral

refV Reference/specified voltage to generator

tV Terminal voltage of the generator 1V Voltage error (Vref - Vt )

eV∫ Integral of the error, ∫ Ve

)(te Error Int. e Integral of the error e U Output of the fuzzy rules (input to the plant)

1g Scaling gain for tuning of the membership functions for e (t)

2g Scaling gain for tuning of the membership functions for “int. e” 0g Scaling gain for tuning of the membership functions for u

d(t) Power angle of the generator in radian w(t) Rotor speed of the generator in rad/sec. D Damping coefficient of the generator H Inertia coefficient of the generator w0 Speed of the generator at the operating point

mP Motor mechanical power in p.u. )(tPe Active electrical power delivered by the generator in p.u. )(tE f Equivalent EMF in the excitation coil in p.u.

)(, tfE Transient EMF in the generator coil in p.u.

)(, tdE Transient direct axis EMF of the generator

Page 12: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

)(, tqE Transient EMF of the generator in the quadrature axis

dX Direct axis reactance of the generator

dX , Transient direct axis reactance of the generator )(, tX q Transient reactance in the quadrature axis in the generator in p.u.

dI Direct axis current of the generator qI Quadrature axis current of the generator

fI Excitation field current

sV Infinite bus voltage in p.u. fU Output of the PI fuzzy controller

dsX Stator reactance in the direct axis

SMIB Single Machine Infinite Bus LFC Load frequency control AVR Automatic Voltage Regulator MATLAB Matrix Laboratory PSS Power system stabilization VAR Volt Ampere Reactive FLC Fuzzy Logic Control PT Potential Transformer NV Negative Very NL Negative Large NB Negative Big NM Negative Medium NS Negative Small Z Zero PS Positive Small PM Positive Medium PB Positive Big PL Positive Large PV Positive Very FIS Fuzzy inference System D/A Digital/Analogue FLPSS Fuzzy Logic Power System Stabilizer FPI-AVR Fuzzy Proportional Integral-Automatic Voltage Regulator CAVR Conventional Automatic Voltage Regulator G Generator CB Circuit Breaker

Page 13: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

LIST OF TABLES Table 3.1 34

Page 14: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

LIST OF FIGURES AND DIAGRAMS Figure 1.1 Conventional control design 5 Figure 1.2 Fuzzy control design 6 Figure2.1 Schematic diagram of LFC and AVR of a

synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure 2.3 Block diagram of a simple AVR 12 Figure 2.4 Root locus plot for equation 2.13 15 Figure 2.5 Terminal voltage response 17 Figure 2.6 Simulink model for figure 2.5 18 Figure 2.7 Block diagram of a simple AVR

compensated with a stabilizer 19 Figure 2.8 Terminal voltage step response of CAVR

with stabilizer 20 Figure 2.9 Simulink model for figure 2.7 21 Figure 2.10 An AVR compensated with PID controller 22 Figure 2.11 Simulink model for figure 2.10 23 Figure 2.12 Terminal voltage step response with PID 24 Figure 3.1 Fuzzy controller architecture 27 Figure 3.2 Fuzzy control system 28 Figure 3.3a Membership functions for the error 32 Figure 3.3b Membership functions for eV∫ 32 Figure 3.3c Membership function for the terminal voltage 33 Figure 3.4 FIS Editor 36 Figure 3.5 The Rule Editor 37 Figure 3.6 The Rule Viewer 38 Figure 3.7 Schematic diagram for fuzzy AVR operation 40 Figure 3.8 Fuzzy-AVR control loop 40 Figure 3.9 Terminal and desired voltage step response

with FPI-AVR 42 Figure 3.10 Fuzzy input voltage to the generator 42 Figure 3.11 A Simple machine infinite bus power system 44 Figure 3.12a Step response of FPI-AVR to three phase fault 47 Figure 3.12b Fuzzy input voltage to the generator 47 Figure 4.1 Terminal voltage response 49 Figure 4.2 Terminal voltage step response of CAVR

with stabilizer 50 Figure 4.3 Terminal voltage step response with PID 51 Figure 4.4a Terminal and desired voltage step response

with FPI-AVR 52 Figure 4.4b Fuzzy input voltage to the generator 52 Figure 4.5a Step response of FPI-AVR to three phase fault 53 Figure 4.5b Fuzzy input voltage to the generator 53

Page 15: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CONTENTS Title page

Declaration

Certification

Dedication:

Acknowledgement:

Abstract: i

Definition of terms iii

List of symbols and abbreviation iv

List of tables vi

List of figures and Diagrams vii

Contents: viii

Chapter 1 Introduction: 1

Chapter 2 Conventional Control Approach 9

2.1 Sensor Model 11

2.2 Amplifier Model 11

2.3 Exciter Model 11

2.4 Generator Model 12

2.5 Test for stability 14

2.6 Test for Controllability 16

2.7 AVR Excitation with stabilizer 18

2.8 AVR Excitation with PID controller 22

Page 16: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

2.9 Overview of fuzzy logic 24

Chapter 3 Fuzzy Logic Control Approach 27

3.1 Fuzzy Logic Controller Design 27

3.2 Fuzzification 29

3.3 Formulation of the rule base and the membership

function definition 29

3.4 The inference mechanism 33

3.5 Defuzzification 38

3.6 Mechanical equations of a SMIB 44

3.7 Electrical generator dynamics 44

3.8 Electrical equations of a SMIB 44

3.9 Linear model of SMIB 45

Chapter 4 Simulation Results 48

Chapter 5 Conclusions 54

References 55

Appendices 57

Page 17: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CHAPTER ONE

INTRODUCTION

The main objectives of the control strategy in power system is to generate and

deliver power in an interconnected system as economically and reliably as

possible while maintaining the voltage and frequency in the steady-state within

permissible limit [1].

A reliable, continuous supply of electric energy is essential for the functioning

of today’s complex societies. Due to a combination of increasing energy

consumption and impediments of various kinds concerning the extension of

existing electric transmission networks, these power systems are operated closer

and closer to their limits.

Deregulatory efforts will tighten the economical constraints under which

utilities have to operate their own network or allow or prevent competitors from

using it. This in turn will require more precise power flow control which is

made possible by phase angle controllers being developed using new power

electronic equipment. However, it is to be expected that these highly non-linear

components will introduce harmonics and require non-linear control in order to

prevent system destabilization.

This situation requires a significantly less conservative power system

operation regime which, in turn, is possible only by monitoring and controlling

the system state in much more detail than was necessary previously.

Page 18: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

In electric power systems, [2], there are three different control levels:

Generating Unit Controls which consist of prime mover control and excitation

control with automatic voltage Regulator (AVR) and power system stabilization

(PSS). The first controls generator speed deviation and energy supply system

variable like boiler pressure or water flow. Excitation control aims at

maintaining the generator terminal voltage and reactive power output within its

machine-dependent limits.

System Generation Control which determines active power output such that

the overall system generation meets the system load. It further controls the

frequency and the tie line flows between different power system areas.

Transmission Control monitors power and voltage control devices like tap-

changing transformers, synchronous condensers and static VAR compensators.

From the view point of system automation, [3], Generating Unit Control

is a complete closed-loop system and in the past a lot of effort has been

dedicated to improve the performance of the controllers. The main problem for

example with excitation control is that the control law is based on a linearized

machine model and the control parameters are tuned to some nominal operating

conditions. In case of a large disturbance, the system conditions will change in a

highly non-linear manner and the controller parameters are no longer valid. In

this case the controller may even add a destabilizing effect to the disturbance by

for example adding negative damping.

Page 19: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

These problems provide an important motivation to explore other modern

control techniques like fuzzy logic control.

The system frequency is affected by changes in real power while changes in

reactive power affect the voltage magnitude. While the Load Frequency Control

(LFC) controls the real power and frequency, the Automatic Voltage Regulator

(AVR) controls the reactive power and terminal voltage magnitude. Because the

excitation time constant is much smaller than the prime mover time constant, its

transient decays much faster. For this reason, the cross-coupling between the

LFC loop and AVR loop is negligible and hence the load frequency and

excitation voltage control can be analyzed independently.

In modern large power system interconnected networks, manual regulation is

not feasible and therefore automatic generation and voltage regulation

equipment are installed on each generator.

The increasing technological demands and performance requirements call for

complex production and manufacturing systems that in turn requires

sophisticated control systems. To satisfy the product quality requirement in a

flexible production environment, an advanced control techniques that can deal

with uncertainty and non-linear ties need to be introduced. Hence the need for

fuzzy logic control which can handle both linear and non-linear system. Fuzzy

logic is a paradigm for an alternative design methodology which can be applied

in developing both linear and non-linear systems [4].

Page 20: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Ndubisi and Agu [5] puts it thus, Fuzzy logic concept incorporates an

alternative way which allows one to design a controller using a higher level of

abstraction without knowing the plant model.

Conventional modeling and control approaches based on differential equations

are often insufficient, mainly due to the lack of precise formal knowledge about

the process to be controlled. Unlike the conventional control, if the

mathematical model of the process is unknown we can design fuzzy controllers

in a manner that guarantees certain key performance criteria.

Lee et al [6] states that while the conventional control starts with a mathematical

model of the process and controllers are designed based on the model, fuzzy

logic control on the other hand starts with heuristics and human expertise

knowledge (in terms of fuzzy IF-THEN rules) and controllers are designed by

synthesizing these rules. An important source of information to the fuzzy design

is the knowledge of the plant operators, control engineers and process designers.

Fuzzy logic control (FLC) reduces the time and complexity in analyzing the

differential equations involved in the conventional control and hence in the

overall design development cycle as depicted in Figures 1.1 and 1.2

respectively.

Page 21: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Conventional Design Methodology

Fig 1.1: Conventional control design

Understand physical system and control requirements

Develop a Linear Model of Plant, Sensors and Actuators

Develop an algorithm for the controller

Determine a simplified controller from control theory

Simulate, Debug, and Implement the Design

Page 22: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fuzzy based Design Methodology

Fig.1.2: Fuzzy control design

Using the conventional approach, our first step is to understand the physical

system and its control requirements. Based on this understanding, our second

step is to develop a model which includes the plant, sensors and actuators. The

third step is to use linear control theory in order to determine a simplified

version of the controller, such as the parameters of a PID, PI controllers. The

Understand physical system and control requirements

Design the controller using fuzzy rules

Simulate, Debug and implement the design

Page 23: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

fourth step is to develop an algorithm for the simplified controller. The last step

is to simulate the design including the effects of non-linearity, noise, and

parameter variations. If the performance is not satisfactory we need to modify

our system modeling, re-design the controller, re-write the algorithm and re-try.

With fuzzy logic the first step is to understand and characterize the system

behavior by using our knowledge and experience. The second step is to directly

design the control algorithm using fuzzy rules, which describe the principles of

the controller’s regulation in terms of the relationship between its inputs and

outputs. The last step is to simulate and debug the design. If the performance is

not satisfactory we only need to modify some fuzzy rules and re-try.

Although the two design methodologies are similar, the fuzzy based

methodology substantially simplifies the design loop. This results in some

significant benefits, such as reduced development time and simpler design.

As reported in [7], seven fuzzy subsets were employed to develop software

written in C++ in the design of a fuzzy AVR of a controller for a synchronous

generator.

Fuzzy experts like Lofti Zadeh proved that the greater the number of fuzzy

subsets, the better the performance of the controller. The cumbersome nature of

the C++ language was reduced by the use of the MATLAB software.

In this work, a rule based fuzzy logic controller is developed for controlling the

terminal voltage and reactive power of a synchronous generator. Eleven fuzzy

subsets were utilized to enhance the performance of the fuzzy controller. The

Page 24: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

work is arranged in this order; first the conventional control approach is

discussed, followed by the fuzzy logic control approach. A comparison is made

between the results of the two control approaches. All the simulations are

carried out using MATLAB software package. The results show reduction in

percent overshoot, rise time, peak time, settling time and overall responses

when fuzzy logic approach is applied.

Page 25: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CHAPTER TWO

CONVENTIONAL CONTROL APPROACH

A typical arrangement of a simple AVR block with the different models is as

shown in figure 2.1.

Gen. field

Steam

∆PG, ∆QG

tiePΔ

CPΔ

Fig. 2.1: The schematic diagram of LFC and AVR of a synchronous

generator

As mentioned earlier, a change in reactive power affects mainly the magnitude

of the terminal voltage. The excitation system maintains generator voltage and

controls reactive power flow. The role of the Automatic Voltage Regulator

(AVR) is to hold the terminal voltage magnitude of a synchronous generator at a

Frequency Sensor

Automatic voltage Regulator (AVR)

Excitation System

Voltage sensor

Valve control Mechanism

Load frequency Control (LFC)

G Turbine

∆PV

Page 26: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

specified level. An increase in the reactive power load of the generator leads to

a drop in the magnitude of the terminal voltage. This drop in the magnitude of

the terminal voltage is sensed through a potential transformer (PT), this voltage

is rectified and compared to the d.c set point signal. The compared voltage

(error signal) is then amplified and sent to the exciter which controls the exciter

field, and increases the exciter terminal voltage which results in the increase of

the generator e.m.f.

The simple schematic diagram of a simple AVR only can be then drawn from

the figure 2.1 as shown in figure 2.2

Exciter + + VR fV _ _ _ Vs P.T

Fig. 2.2: A simple diagram of an AVR

The transfer function of each model of the AVR is developed as follows;

2.1 SENSOR MODEL

In this model, the potential transformer here senses the terminal voltage of the

generator and then rectifies the output at this end through a bridge rectifier. This

Σ

Rectifier

Amplifier

Stabilizer

G EV refV

_

Page 27: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

model has a gain of KR and a time constant of Rτ . The transfer function of this

model is therefore given by;

)()(

sVsV

t

s = s

K

R

R

τ+1 2.1

2.2 AMPLIFIER MODEL

The terminal voltage of the generator at any time is compared with the reference

voltage and the error, EV = (Vref – Vs) is then amplified in this model. This model

has a gain KA and a time constant of Eτ . The transfer function of this model is

represented by;

)()(

sVsV

E

R = s

K

A

A

τ+1 2.2

2.3 EXCITER MODEL

This model which can be a solid state device has a single time constant Eτ and a

gain EK . The voltage of an exciter has no simple relationship with the terminal

voltage because of the saturation effect in the magnetic circuit. Modern exciter

ignores the saturation effects and other nonlinearities. The transfer function of

this model is as written below;

)()(

sVsV

R

F = s

K

E

E

τ+1 2.3

2.4 GENERATOR MODEL

The terminal voltage of the synchronous generator is dependent on the generator

load. The e.m.f generated by the synchronous generator is a function of the

Page 28: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

magnetization curve. The Generator model has a time constant and a gain

constant of Gτ and GK respectively. The transfer function relating the terminal

voltage of the generator to the generator field voltage is given by;

)()(

sVsV

F

t =s

K

G

G

τ+1 2.4

The block diagram of the AVR can now be drawn in the figure 2.3

by utilizing the model equations 2.1, 2.2, 2.3.

)(sRV )(sFV VF(s)

_ Vs(s) Amplifier Exciter Generator

Sensor Fig 2.3: Block diagram of a simple AVR.

The block diagram of an isolated generator with a dc automatic voltage

regulator is shown in figure 2.3. The first block represents the gain and time

constant of an electronic amplifier, the second block is the time constant of the

dc generator field winding, and the third block represents the a.c generator field

time constant. The voltage transducer (Sensor) time constant is in the negative

feedback path. From the above block diagram, the transfer function relating the

Σ sK

A

A

τ+1

sK

R

Rτ+1

sK

G

G

τ+1

sK

E

E

τ+1

)(stV )(sEV refV

Page 29: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

generator terminal voltage Vt (s) to the reference voltage Vref (s) using Mason’s

gain rule [8] is;

)(

)(sV

sV

ref

t =RGEARGEA

RRGEA

KKKKsssssKKKK+++++

+)1)(1)(1)(1(

)1(τττττ 2.5

The open-loop transfer function of the block diagram is written as

KG(s) H(s) =)1)(1)(1)(1( ssss

KKKK

RGEA

RGEA

ττττ ++++ 2.6

Also using Ackermann’s formula [9], the state equations of this excitation

system in equation 2.5 are

x1 Aτ1− 0

A

Kτ− 0 x1

A

x2 Eτ1

Eτ1− 0 0 x2 0

dtd x3 = 0 0

Rτ1−

Rτ1 x3 + 0 Vref

Vt 0 Gτ1 0

Gτ1− Vt 0

tV = [0 0 0 1]⎥⎥⎥⎥

⎢⎢⎢⎢

tvxxx

3

2

1

2.9

With the AVR system of generator having the following parameters,

KE=KG=KR=1, Aτ =0.1, Eτ =0.4, Gτ =1.0 and Rτ =0.05, 2.10

The characteristic equation then becomes

1+ KG(s) H(s) = 1+0.05s)s)(10.4s)(10.1s)(1(1

)1)(1)(1(AK++++

Page 30: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

= 1+)20)(1)(5.2)(10(

500++++ ssss

AK

= 50077525.30735.334

500

++++ ssssAK 2.11

Also the steady-state response of the system is

Vtss= 0

lim→s

sVt(s) = A

A

KK+1

2.12

The characteristic polynomial equation becomes

s4+33.5s3+307.5s2+775s+500+500KA = 0 2.13

2.5 TEST FOR STABILITY

For control stability, the range of KA is found using the Routh-Hurwitz array;

s4 1 307.5 500+500KA

s3 33.5 775 0

s2 284.365 500+500KA 0

s1 58.9KA – 716.1 0 0

s0 500+500KA

From the table for absolute stability,

58.9KA – 716. 1≤ 0

∴KA<12.16

The root-locus plot as K varies from 0 to 12.16 is shown in figure 2.4 and

obtained using the MATLAB commands shown in appendix I.

Page 31: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 2.4: Root locus plot for equation 2.13

The result shows that the loci intercept the imaginary axis ( ωj ) at s = ±j4.81 for

KA = 12.16 which shows that the system is marginally stable for KA = 12.16.

If the amplifier gain is set at KA = 10, the state-space equation becomes;

-1.0 1.0 0

A = 0 -2.5 2.5 2.15

0 0 -10

0

B = 0 2.16

0

Page 32: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

2.6 TESTING FOR CONTROLLABILITY

0 0 2.5

Pc = [B AB A2B] = 0 25 -312.5 2.17

100 -100 1000

The determinant of Pc = -6250 and ≠ 0.

Therefore the system is controllable.

The steady-state response is

101

10+

=tssV = 0.909

The steady-state error, essV = 1.0 – 0.909

= 0.091

Using equation 2.7 with KA= 10, the terminal voltage response of the system is

obtained using the following MATLAB commands shown in appendix II or the

Simulink model shown in figure 2.6. The result is as shown in figure 2.5

Page 33: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 2.5: Terminal Voltage Response

From the terminal voltage step response, it is seen that the system has a large

percent overshoot and a long settling time with an oscillatory response, and a

steady-state error of more than 9 percent.

The time-domain performances specifications of the system are as follows;

Rise time = 0.247

Peak time = 0.791

Settling time = 19.04

Percent overshoot = 82.46

Page 34: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

The Simulink model for the block diagram in figure 2.3 is shown in

figure 2.6. The simulation result shows that the same voltage response as in

figure 2.5 was obtained.

Fig. 2.6: Simulink model for figure 2.5

2.7 AVR EXCITATION WITH STABILIZER

The basic function of a power system stabilizer is to add damping to the

generator power oscillations by controlling its excitation using an

auxiliary stabilizing signal [10]. From the analysis above, the AVR step

response was not satisfactory even with a small amplifier gain of

Vref

Vt

Step

1

0.05s+1

Sensor

Scope

1

s+1

Generator

1

0.4s+1

Exciter

Clock

0.1s+1

10

Amplifier

Page 35: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

KA = 10. It is therefore necessary to increase the relative stability by

introducing a controller that can add a zero to the AVR open-loop transfer

function. A possible way of doing this is by adding a stabilizer feedback

to the control as shown in figure 2.7.

Vref(s) Ve(s) VR(s) VF(s) Vt(s) _

SV _ Amplifier Exciter Generator

Stabilizer

Sensor Fig 2.7: Block diagram of a simple AVR Compensated with a Stabilizer

An improved or satisfactory response of the AVR can be obtained by proper

adjustment of the stabilizer gain KF and time constant Fτ . For a stabilizer with

gain KF =2 and Fτ =0.04sec, the closed-loop transfer function becomes

1375002748755.270962136455.58)50045(250

)()(

2345

2

+++++++

=sssss

sssV

sV

ref

t

The steady-state response of the system becomes

Vtss= 0

lim→s

sVt(s) = 909.0137500

)500)(250(=

And the steady-state error becomes

sK

A

A

τ+1

sK

R

R

τ+1

sK

G

G

τ+1

sK

E

E

τ+1

sK

F

F

τ+1

Page 36: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Vess= 1-0.909

=0.091

By adjusting KF and Fτ properly, the terminal voltage step response can

be obtained using the MATLAB commands shown in appendix III.

Fig. 2.8: Terminal Voltage step Response of CAVR with stabilizer

From the voltage step response, the time-domain specifications are as follows;

Rise time = 2.95

Peak time = 7.08

Settling time = 8.08

Page 37: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Percent overshoot = 4.13

The Simulink model for the block diagram in figure 2.7 is shown in figure 2.9.

Figure 2.9: Simulink model for fig. 2.7

2.8 AVR EXCITATION WITH PID CONTROLLER

In order to reduce the steady-state error and improve the dynamic response, a

proportional integral derivative (PID) controller is added. The transfer function

of the PID controller is

cG (s) = PK + S

K I + sKD 2.18

Page 38: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

With the addition of the PID controller, the block diagram of the AVR is then

drawn as shown in figure 2.10.

Vref(s) EV RV FV

)(sVt _ PID Amplifier Exciter Gen.

Sensor Fig. 2.10: An AVR compensated with Proportional Integral Derivative

(PID) controller.

Also applying Mason’s gain rule [8], to the block diagram of the figure 2.10, the

closed loop transfer function becomes; )(

)(sV

sV

ref

t =

))()(1)(1)(1)(1())((2

2

GERADIPRGEA

GEADIP

KKKKKsKsKsTsTsTsTsKKKKsKsK++++++

++ 2.19

The steady-state response is

Vtss = 0

lim→s

sVt(s) =RGEAI

GEAI

KKKKKKKKK 2.20

When the parameters of the AVR in equation 2.7 with KP=1.00, KI=0.25,

KD=0.28 are substituted in equations 2.12 and 2.13 respectively;

)()(sV

sV

ref

t =1250550021755.3075.33

)25.6257(2002345

2

+++++++

sssssss 2.21

And the steady-state response of the system becomes

sK

R

R

τ+1

sK

A

A

τ+1

Ks

KK DI

P ++ sK

E

E

τ+1 sK

G

G

τ+1

Σ tV

Page 39: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Vtss = 0

lim→s

sVt(s) =1250

)25.6)(200(

= 1.00 2.22

The steady-state error = 1- Vtss

=1-1.00

=0.00

The results show that the addition of the PID controller brings the steady-state

error to zero. This is common for all integral control. The simulink model of the

block diagram in figure 2.10 is as shown in figure 2.11

Fig.2.11: Simulink model for PID control.

Vref

Vt

Step

1

0.05s+1

Sensor

Scope

1

s+1

Generator

1

0.4s+1

Exciter

PID

DiscretePID Controller

Clock

10

0.1s+1

Amplifier

Page 40: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Using the simulink model shown in figure 2.11, the step response obtained is

shown in figure 2.12.

Fig. 2.12: Terminal voltage step response with PID

The result shows that the system has a very negligible overshoot with a settling

time of about 1.5 seconds.

2.9 OVERVIEW OF FUZZY LOGIC

In control engineering, the primary objective is to distill and apply knowledge

about how to control a process so that the resulting control system will reliably

and safely achieve high-performance operations. When the operating conditions

of the generator changes like the presence of a fault, the conventional control

Page 41: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

approach becomes ineffective. This therefore requires an alternative control

strategy. Fuzzy logic control is a better alternative. Fuzzy logic provides a

methodology for representing and implementing our knowledge about how best

to control a process.

Fuzzy logic is a system conceived by Lofti Zadeh in 1965 in his paper titled

“none other than fuzzy” as a method of dealing with the imprecision of practical

systems [2]. Fuzzy logic implements human experiences and preferences via

membership functions and fuzzy rules. Fuzzy control provides a formal

methodology for representing, manipulating, and implementing a human’s

heuristic knowledge about how to control a system.

Fuzzy logic is basically a multivalued logic that allows intermediate values to

be defined between conventional evaluations like yes/no, true/false, black/white,

etc.

In fuzzy systems, values are indicated by a number (called a truth value) in the

range from 0 to 1, where 0.0 represents absolute falseness and 1.0 represents

absolute truth. The ordinary Boolean operators that are used to combine sets

will no longer apply, we know that in Boolean operations, 1 and 1 is 1, but what

is 0.7 and 0.3? This will be covered in the fuzzy operations. As was seen in the

conventional control approach, if the mathematical equations of say the PID

Controller or the machine models were unknown, it would have been very

difficult to adjust their parameters in order to obtain the voltage step response. It

is therefore said that while differential equations are the languages of the

Page 42: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

conventional control, rules are the languages of the fuzzy logic. Fuzzy Control

Systems are model-free estimators [11]. In other words the designers do not

need to state how the outputs depend mathematically on the inputs i.e. a well

defined mathematical model of the system is not required for the fuzzy

controller design.

When fuzzy logic or systems are used to model a process and controllers are

designed based on this model, then the resulting controllers are called Fuzzy

Logic Controllers [12].

According to [5], fuzzy logic controller (FLC) is a special kind of a state

variable controller governed by a family of rules and a fuzzy inference

mechanism.

The Fuzzy Logic Controller (FLC) algorithm uses heuristic strategies, defined

by linguistically described statements. The fuzzy logic control algorithm reflects

the mechanism of control implemented by people, without using any formalized

knowledge about the controlled plant in the form of mathematical models, and

without an analytical description of the control algorithm.

Page 43: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CHAPTER THREE

FUZZY LOGIC CONTROL APPROACH

3.1 FUZZY LOGIC CONTROLLER DESIGN

Fuzzy Logic Controller design is a three-stage process [13]. It comprises of

fuzzification, inference mechanism and defuzzification stages. To design the

controller, firstly, membership functions for the input variables (error, and

integral of error must be specified). Secondly, the fuzzy inference system must

be defined which consists of a series of “If…..then…..” linguistic rules. Then

finally, the membership functions for the output must be selected. A structure of

a fuzzy logic controller is shown in figure 3.1.

Ref. signal e _ y(t)

u (t) -

To plant Feedback Signal

Fig. 3.1: Fuzzy controller architecture

From the diagram, the plants outputs are denoted by y (t), its input is denoted by

u (t), and the reference input to the fuzzy controller is denoted by r (t). The

fuzzy logic controller has three main components:

1. The inference mechanism incorporates the rule base which holds the

knowledge in the form of a set of rules of how best to control the system,

Fuzzifier

Rule Base

Inference Engine

Defuzzifier ∑

e∫

Page 44: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

and evaluates which of the control rules are relevant at the current time

and then decides what the input to the plant should be.

2. The fuzzification interface that simply modifies the inputs so that they

can be interpreted and compared to the rules in the rule base.

3. The defuzzification interface that converts the conclusion reached by the

interference mechanism into the inputs to the plant.

For the terminal voltage and reactive power control for the automatic voltage

regulator (AVR), the plant output is the terminal voltage Vt(s) while the input to

the plant is the Vf(s), and the reference input to the fuzzy controller is the

Vref(s).

With these nomenclatures, the fuzzy control system can be shown in figure 3.2.

r + e u y

-

Fig 3.2: Fuzzy Control System

3.2 CHOOSING THE FUZZY LOGIC AVR CONTROLLER

INPUTS AND OUTPUTS

In designing a fuzzy controller, variables which can represent the dynamic

performance of the plant to be controlled are chosen as the inputs to the

Σ Fuzzy Controller

Plant

Page 45: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

controller [6]. The error (e) and the integral of the error are the inputs to the

controller.

For the fuzzy logic AVR control, the error between the reference voltage Vref

and the terminal voltage Vt i.e. Ve and the integral of the error V1 which is the

difference between the immediate and previous voltage error values are

considered as the inputs to the fuzzy controller while the output is the specified

output voltage of the alternator Vt

3.3 FUZZIFICATION

In fuzzy logic, linguistic variables are used as opposed to numeric variables

[14]. The input variables above are measured based on the expert knowledge or

the knowledge of the plant operator and quantified linguistically. In this

controller, eleven fuzzy subsets are chosen. These are:

“Negative Very large” (NV)

“Negative Large” (NL)

“Negative Big” (NB)

“Negative Medium” (NM)

“Negative Small” (NS)

“Zero” (Z)

“Positive Small” (PS)

“Positive Medium” (PM)

Page 46: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

“Positive Big” (PB)

“Positive Large” (PL)

“Positive Very large” (PV)

These input variables are assigned numerical values as (-1, -0.8, -0.6, -0.4, -0.2,

0, 0.2, 0.4, 0.6, 0.8 and 1) which stands for Negative Very large, Negative

Large, Negative Big, Negative Medium, Negative Small, Zero, Positive Small,

Positive Medium, Positive Big, Positive Large and Positive Very large

respectively. The use of numbers for linguistic descriptions simply quantifies

the sign of the error and indicates the size in relation to the other linguistic

values. However, it does not represent any particular value of voltage error. In

the real world, measured quantities are real numbers (crisp). The process of

converting a numerical variable (real number) into a linguistic variable (fuzzy

number) is called fuzzification. Figure 3.3 shows the membership functions for

the input and output functions. Membership function is a plot of a function μ

versus e (t) that takes on special meaning. The function μ quantifies the

certainty that e (t) can be classified linguistically as “positive small” or

“Positive medium” and so on as the case may be.

As [14] puts it, the membership function quantifies in a continuous manner,

whether values of e (t) belong to (are members of) the set of values that are

“positive small”, and hence it quantifies the meaning of the linguistic statement

“error is positive small”.

Page 47: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

There are several definitions of membership function which includes; bell-

shaped function, trapezoidal function, B-spline function, triangular function,

Gaussian function. The choice of any function however, depends on the type of

fuzzy approach and the designer’s choice. For our Fuzzy-AVR control,

triangular membership function is suitable and therefore used.

The inputs are mapped into membership functions, and a degree of membership

shows to what degree each input belongs to a particular linguistic label. The

membership can take on values between 0 and 1 for each of the linguistic labels.

Once the membership functions for the inputs are made, an intelligent decision

rules are then made on what the output will be. This process of decision making

is called the inference mechanism.

Figure 3.3a: Membership functions for the error

Page 48: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Figure 3.3b: Membership functions for the Integral of error

Page 49: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Figure 3.3c: Membership function for the terminal voltage

3.4 The inference mechanism

There are control laws that govern the operation of the controller in the design

of a conventional controller. In the design of fuzzy logic controller, there are

linguistic rules that allow the operator to develop a control decision in a more

familiar human environment.

With the two inputs for this FLC, an (11x11) decision table is constructed as

shown in Table 3.1. Every entity in the table represents a rule. The antecedent of

each rule conjuncts Ve and V1 fuzzy set values. A combination of experience

and common sense is used in obtaining the entries for the matrix [12]. For

Page 50: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

instance, if the voltage does not change, then Int_error = Zero. An example of

the thi rule is: If Ve is PM and V1 is NS then U is PS. This means that if the

voltage error is positive medium and the integral of the voltage error is negative

small then the output of the controller should be positive small. If the error is

positive small and the integral of the error is Negative Small, then the output of

the controller should be Zero.

Table 3.1: Decision table of 121 rules for the Fuzzy-AVR controller

Ve U NV NL NB NM NS Z PS PM PB PL PV NV NV NV NV NV NV NV NL NB NM NS Z NL NV NV NV NV NV NL NB NM NS Z PS NB NV NV NV NV NL NB NM NS Z PS PM NM NV NV NV NL NB NM NS Z PS PM PB

eV∫ NS NV NV NL NB NM NS Z PS PM PB PL Z NV NL NB NM NS Z PS PM PB PL PV PS NL NB NM NS Z PS PM PB PL PV PV PM NB NM NS Z PS PM PB PL PV PV PV PB NM NS Z PS PM PB PL PV PV PV PV PL NS Z PS PM PB PL PV PV PV PV PV PV Z PS PM PB PL PV PV PV PV PV PV

The inference mechanism evaluates which of the control rules are relevant at the

current time and then decides what the input to the plant or the output of the

fuzzy should be.

As [14] puts it, the inference mechanism is a way of determining the

applicability of each rule called “matching”. Hence, the inference mechanism

seeks to determine which rules are on to find out which rules are relevant to the

current situation. The inference mechanism will seek to combine the

Page 51: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

recommendations of all the rules to come up with a single conclusion. There are

two types of fuzzy inference systems in the Fuzzy MATLAB toolbox:

Mamdani-type and Sugeno-type. The most commonly used method for inferring

the rule output is the Mamdani method because of its wide acceptance. The

processes involved in the Mamdani method includes; Fuzzy Inference

System(FIS), Membership Function Editor, Rule Editor, Rule Viewer, Surface

Viewer. The FIS handles the high-level issues for the system which includes the

number and names of the inputs and outputs. The defuzzification technique is

also set at the FIS.

The membership function editor is used to define the shapes of all the

membership functions associated with each variable as shown in figure 3.4.

Fig. 3.4: FIS Editor

Page 52: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

The Rule Editor is for editing the list of rules that defines the behavior of the

system. The 121 rules in the rule table of table 3.1 are encoded in the fuzzy

controller through the Rule Editor.

Figure 3.5: The Rule Editor

The Rule Viewer and the Surface Viewer are used for looking at, as opposed to

editing, the FIS. They are strictly read-only tools. The Rule Viewer is a

MATLAB technical computing environment based display of the fuzzy

inference diagram as shown in figure 3.6. They are used as a diagnostic; it can

show (for example) which rules are active, or how individual membership

function shapes are influencing the results. The Surface Viewer is used to

Page 53: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

display the dependency of one of the outputs on any one or two of the inputs—

that is, it generates and plots an output surface map for the system.

Figure 3.6: The Rule Viewer

3.6 Defuzzification

As mentioned earlier, defuzzification converts the conclusion reached by the

interference mechanism into the inputs to the plant. Defuzzification operates on

Page 54: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

the implied fuzzy sets produced by the inference mechanism and combines their

effects to provide the most certain controller output which is the output of the

plant. According to some experts, defuzzification is referred to as the

“decoding” the fuzzy set information produced by the inference mechanism or

process into numeric fuzzy controller outputs. In this work, centre of area

method (centroid) is used for defuzzification according to the membership

function of the output shown in figure 3.3c.

In a real-life analysis, the output of the designed controller is fed into a

compatible computer as shown in Fig. 3.7. The computer is connected to the

field winding of the alternator through a digital/analogue (D/A) converter and a

field exciter circuit. For further research, disturbances will be added to a rated

generator system by changing the length of the transmission line between the

generator and the commercial point to see the effectiveness of the FUZZY

LOGIC POWER SYSTEM STABILIZER (FLPSS). A real-time monitoring

system to check the effectiveness of the FLPSS will be available.

For this work, the performance of the fuzzy controller using proportional

integral-Automatic Voltage Controller (FPI-AVR) is examined through the

simulation developed based on the exciter and generator models of figure 3.8

shown below using MATLAB software packages.

Page 55: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Driving Motor

Mechanical Coupling

A

B

C

Fig. 3.7: General Schematic diagram for Fuzzy AVR operation

eV

u Vf

b

Fig.3.8: Fuzzy-AVR control loop

From figure 3.8,

Fuzzy Controler φ

Exciter

SK

E

E

τ+1

Gen.

SK

E

G

τ+1

g1

g2

go

∫Ve

Load

Computer

Filter/ Divider

A/D

D/A Field Exciter

Voltage sensor

2F 2F

1F

125 V DC

Page 56: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Let ),()( 1 tXtV = ),()( 2 tXtV f = )(3 tXb = 3.1

F

t

VV =

SK

G

G

τ+1 or

dtdV = -

G

tVτ

)( + FG

G VKτ

or dtdV = -

G

1 + 2XK

G

G

τ 3.2

also u

VF = S

K

E

F

τ+1

or dt

dVF = -E

FVτ

+ uK

E

E

τ=

E

2 + uK

E

E

τ 3.3

eV∫ = b = )( 1VVd −∫ = 1V

or 1XVVVdtdb

dtd ==−= 3.4

When equations 3.1, 3.2, 3.3 and 3.4 are combined together, equation 3.5 is

obtained as follows;

Gτ1

− G

GKτ

0

F = ⎥⎥⎥

⎢⎢⎢

)(tbVV

dtd

F

t

= ⎥⎥⎥

⎢⎢⎢

3

2

1

XXX

dtd = 0 u

K

E

E

E ττ+−

1 0 ⎥⎥⎥

⎢⎢⎢

3

2

1

XXX

+ ⎥⎥⎥

⎢⎢⎢

100

dV 3.5

1− 0 0

F = 1221 ;1;1 XVuK

XXK

X dE

E

EG

G

G

−+−+−ττττ

3.6

The value of the voltage response is tuned using Runge-Kutta method as in the

program of Appendix IV. The results are shown in figure 3.10.

Page 57: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 3.9: Terminal and desired voltage step response with FPI-AVR

Fig. 3.10: Fuzzy input voltage to the generator.

Page 58: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

It is observed that the overshoot, settling time and rise time are highly reduced

which is an improvement to the CAVR.

From the rule base in table 3.1, the voltage error, Ve = Vref – Vt is negative large

depicts a situation where the terminal voltage is much higher than the reference

or the specified voltage. In power systems, this is termed over voltage. A

decrease in the value of the reactive power of a generator cannot result to an

increase of the terminal voltage beyond the rated value. Instead the presence of

fault can result to an over-voltage, it is therefore necessary to analyze the

performance of the AVR for a simple machine infinite bus power system when

there is a fault and it was cleared.

In this work, simplified dynamic model of a simple machine infinite bus power

system is considered [1]. The model consists of a single synchronous machine

connected through a parallel transmission line to a very large network

approximated by an infinite bus. The classical third order single-axis dynamic

model of the simple machine infinite bus power system is shown in figure 3.1

CB1 CB2 Vs

Generator

Transformer CB3 CB4

Fault

Fig 3.11: A simple machine infinite bus power system

G

Page 59: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

3.5 Mechanical equations

0)( ωωδ−= t

dtd 3.7

))((2

))(( 00 me PtP

Ht

HD

dtd

−−−=ω

ωωω 3.8

In this analysis, the mechanical input power Pm is assumed to be constant in the

excitation of the controller design. This implies that the governor action is slow

enough not to have any significant impact on the machine dynamics.

3.6 Electrical generator dynamics

))()((1)( '' tEtE

TtE qf

doq −= 3.9

3.7 Electrical equations (assumed X'd = Xq)

)()()( )( '' tIXXtEtE dddqq −+= 3.10

ds

e Xt

tP 'sd )(sin(t)VE'

)(δ

= 3.11

ds

sqd X

tVtEtI '

' )(cos)()(

δ−= 3.12

ds

q Xt

tI 's )(sinV

)(δ

= 3.13

ds

s

ds XV

Xt

tQ '

2

'sq )(cos(t)VE'

)( −=δ

3.14

)()(' tIKtE fad= 3.15

21

22'' ]))(())()([()( tIXtIXtEtV ddddqt +−= 3.16

Page 60: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

3.8 Linear model of Single Machine Infinite Bus (SMIB)

By linearizing the above equations about the operating point, the variable model

of a single machine to infinite bus (SMIB) is obtained as follows;

BuAxX +=.

3.17

Cxy = 3.18

Where the state variable x is defined by

],,[ 'qEX ΔΔΔ= ωδ 3.19

From the matrix above, A, B, C are represented by

⎢⎢⎢⎢⎢⎢⎢⎢

−−

−=

''

'

'

'0

sin).(

cos.

2

0

ds

s

do

dd

ds

qs

XV

TXX

XEV

HA

δ

δω

02

1

HD

0''

'

'

'0

1.)(

.1

sin.

2

0

⎥⎥⎥⎥⎥⎥⎥⎥

−−

dodo

dd

do

ds

s

XTXX

T

XV

Hδω

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

=

'

00

do

c

TK

B

⎢⎢⎣

⎡+

−−= δ

δcos).(

)(sin)(.

)('

2'

'

''

ds

s

t

dd

ds

sd

t

ddq

XV

VIX

XVX

VIXE

C 0 0

'

'''

)1()(

⎥⎥⎦

⎤−

ds

d

t

ddq

XX

VIXE

The sub index 0 shows that matrices are operated at operating point.

When a delay of 2 seconds was applied to the system and cleared in 4 seconds,

it represents a three phase fault which was cleared within 4 seconds. The

response was as shown in figure 3.12.

Page 61: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 3.1

12: (a) Step (b) Fuz

p responsezzy input v

e of FPI-Avoltage to

AVR to thrthe gener

ree phase rator

fault.

Page 62: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CHAPTER FOUR

SIMULATION RESULTS

Simulations were carried out using MATLAB software package to examine the

performance of the fuzzy proportional-AVR (FPI-AVR). Seven results were

obtained under two set of tests as follows;

A. Sudden terminal voltage variation.

The terminal voltages of the generator under sudden variation of load were

examined at four different conditions, namely

1. With Conventional AVR (CAVR)

The parameters defined on page iv,

KE=KG=KR=1, Aτ =0.1, Eτ =0.4, Gτ =1.0 and Rτ =0.05, the response is shown in

figure 4.1

Page 63: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 4.1: Terminal Voltage Response

The response has the following time-domain performance specifications; rise

time = 0.247, peak time = 0.791, settling time = 19.04 and percent overshoot =

82.46.

The system was not satisfactory due to high settling time and percent overshoot

hence the need for an improvement.

2. With a stabilizer connected between the exciter output and the input, the

transfer function of the stabilizer is 104.0

2+s

s . The response is as shown in

figure 4.2

Page 64: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 4.2: Terminal Voltage step Response of CAVR with stabilizer.

The time-domain performance specifications are as follows;

Rise time = 2.95, Peak time = 6.08, Settling time = 8.08 and percent overshoot

= 4.13. Since the steady-state error, settling time and percent overshoot is still

high, there is need for improvement in the terminal voltage step response hence

the use of PID to improve the dynamic response and lower or remove the

steady-state error.

3. With a PID in series with the amplifier

The parameters for the PID are KP = 1.00, KI = 0.25, KD = 0.28, the

response is as shown in Figure 4.3.

Page 65: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig. 4.3: Terminal voltage step response with PI

The response has a negligible over-shoot and settling time of about 1.28

seconds.

4. With a FPI-AVR

The system percent overshoot was reduced to minimal. This tends to

smooth out operations and improve overall efficiency. The terminal

voltage step response is shown in figure 4.4.

Page 66: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

Fig.4.4a: Terminal and desired voltage step response with FPI-AVR

Fig. 4.4b: Fuzzy input voltage to the generator.

Page 67: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

B. A th

Fig. 4.5

hree phase

the

5: (a) Step (b) Fuz

e fault was

response o

response zzy input v

applied af

of the FPI-A

of FPI-AVvoltage to

fter 2 secon

AVR is sh

VR to threthe gener

nds and cle

hown in fig

ee phase farator

eared after

gure 4.5.

ault.

4 seconds;

Page 68: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

CHAPTER FIVE

CONCLUSIONS

It has been shown that fuzzy logic control can effectively be applied to the

regulation of voltage for a synchronous generator. The results show that the

FPI-AVR performance is very high when compared to conventional AVR

(CAVR). The resulting system was both computationally efficient and had

settling time, overshoot and rise time reduced. The arrangement of the structure

results in a computationally less intensive control algorithm. Another significant

advantage of fuzzy logic is that it can easily accommodate additional input

signals. Therefore integrating controllers becomes much simpler with resultant

performance enhancement.

Fuzzy Logic Control provides a convenient means to develop the controller

which can accommodate the non-linear nature of the exciter-generator system.

Fuzzy logic on the other hand is not without any set back, the set back is

observed on the steady-state error which can be cleared by tuning the gains g0,

g1 and g2 to achieve the required result.

Page 69: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

References [1] H.Sadaat, Power systems analysis, Tata McGraw-Hill series publishing

company Limited New Delhi, India 2002. [2] M.Y. Chow and K.Tomsovic, “Tutorial on fuzzy logic applications in

power systems”. IEES-PES winter meeting in Singapore, January, 2000 [3] O.P Malik, D.Niebur and T.Hiyama, “Tutorial on fuzzy logic applications

in power systems”. IEES-PES winter meeting in Singapore, January, 2000

[4] FIDE: why use fuzzy logic? Aptronix Inc, 1996-2000 [5] S.N Ndubisi and M.U.Agu, “A rule-based fuzzy proportional integral

type automatic voltage regulator for turbo generators”. European Journal of Scientific research, Vol. 20, No 4 May 2008 pp 924-933.

[6] K.Y. Lee, “fuzzy logic applications in power systems”. IEES-PES winter

meeting in Singapore, vol.4 January, 2000 [7] A.R.Hassan, T.R. Martis and A.H.M Sadrul Ula “Design and

Implementation of a Fuzzy Controller Based Automatic Voltage Regulator for a Synchronous Generator” IEEE Transactions on Energy Conversion, Vol. 9, No 3, September 1994 pp 550-557.

[8] M.Gopal, Modern Control System theory, Wiley Eastern Limited 1989 [9] R.C. Dorf and R.H.Bishop, Modern Control Systems, Pearson Education

(Singapore) ptc Ltd Pataparganj, India 2004 [10] G. Rogers, Power system oscillations, kluwer Academic publishers,

Nurwell USA 2000 [11] M.G.McArdle, D.J Morrow, P.A.J.Calvert and O.Cadel “A Hybrid PI and

PID Type Fuzzy Logic Controller for Automatic Voltage Regulation of the Small Alternator” IEEE Transactions on Energy Conversion, Vol 9, No 17, September 2001.pp 103-108.

[12] F. Lu and Y.Hsu, “Fuzzy Dynamic programming approach to reactive

/voltage control in a distribution substation”. IEE transactions on power systems vol. 12 No 2, May, 1997.

pp 681-688.

Page 70: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

[13] B. J.LaMeres, M.H.Nehrir “Fuzzy Logic Based Voltage Controller for a

synchronous Generator” IEEE Transactions on Computer Applications in Power System, vol 9, No 4, April 1999

[14] K.M. Passino and S. Yurkovich., Fuzzy Control Addison Wesley

Longman, Inc 1998

Page 71: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

APPENDICES

APPENDIX 1: (Program for the Root-locus plot of fig. 2.3) %program for the root locus plot of figure 2.3 numc=500; denuc = [1 33.5 307.5 775 500]; grid on; xlabel (real axis) ylabel (imaginary axis) title ('root locus plot for equation 10.') figure (23), rlocus (numc, denuc); APPENDIX II: (Program for the terminal voltage response for figure 2.4) %program for the terminal voltage plot of figure 2.4 numc= [250 5000]; denuc= [1 33.5 307.5 775 5500]; t=0:0.05:20; c=step (numc, denuc, t); xlabel ('t [sec]'); ylabel (‘c [volts]’) grid on; title ('Terminal voltage response'); plot(t, c); grid on; end

Page 72: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

APPENDIX III: (Program for the terminal voltage response for fig. 2.6)

%program for the terminal voltage plot of figure 2.6

numc=[250 11250 125000];

denuc= [1 58.5 13645 274875 137500];

t=0:0.05:20;

c=step(numc, denuc, t);

xlabel ('t [sec]');

ylabel('c[volts]');

grid on;

title ('Terminal voltage step response for CAVR with stabilizer');

plot(t, c);

grid on;

end

APPENDIX IV: (Program for the terminal voltage response for fig. 2.9)

%program for the terminal voltage plot of figure 2.9

numc=[1400 5000 1250];

denuc= [1 33.5 307.5 2175 5500 1250];

t=0:0.05:20;

c=step(numc, denuc, t);

xlabel ('t [sec]');

ylabel('c[volts]');

grid on;

title ('Terminal voltage step response for CAVR with PID');

plot(t, c);

grid on;

end

Page 73: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

APPENDIX IV: (Program for the FPI-AVR) % This program is used to simulate the PI fuzzy controller. % The variable names are chosen accordingly. % Initialize controller parameters KA=10; % Gain of the amplifier KG =1.0; % Gain of the Generator KE =1.0; % Gain of the Exciter KR=1.0; % Gain of the sensor % Initialize parameters for the fuzzy controller nume=11; % Number of input membership functions for the e universe of discourse numie=11; % Number of input membership functions for the integral of e universe of discourse g1=1;,g2=.01;,g0=10; % Scaling gains for tuning membership functions for

% universes of discourse for e, integral of e %(what we sometimes call "int e" below), and u %respectively

we=0.2*(1/g1); % we is half the width of the triangular input %membership function bases. wie=0.2*(1/g2); base=0.4*g0; %Base width of output membership fuctions % of the fuzzy controller e=[-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]*(1/g1); % Centers of input membership functions for the int e %universe of discourse of fuzzy controller (a vector of %centers) cie=[-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]*(1/g2);

Page 74: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

rules=[-1 -1 -1 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0; -1 -1 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2; -1 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4; -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6; -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8; -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1; -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1; -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1 1; -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1 1 1; -0.2 0 0.2 0.4 0.6 0.8 1 1 1 1 1; 0 0.2 0.4 0.6 0.8 1 1 1 1 1 1]*g0; % Next, we initialize the simulation: t=0; % Reset time to zero index=1; % This is time's index (not time, its index). tstop=30; % Stopping time for the simulation (in seconds) %tstop=60; % Stopping time for the simulation (in seconds), step=0.01; % Integration step size x=[1;0.5;0.1]; % Initial condition on state of the % controller % Next, we start the simulation of the system. while t <= tstop v(index)=x(1); % Output of the controller if t<=.2, vd(index)=.2; end % First, define "test input 1" if t>.2, vd(index)=1; end

Page 75: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

%if t<=10, vd(index)=18; end % This is "test input 2" (ramp) %if t>10, vd(index)=vd(index-1)+(4/1500); end % Ramp up 4 in 15 sec. %if t>25, vd(index)=22; end % Fuzzy controller calculations: % First, for the given fuzzy controller inputs we determine % the extent at which the error membership functions % of the fuzzy controller are on (this is the fuzzification part). ie_count=0;,e_count=0; % These are used to count the number of non-zero mf certainities of e and int e e(index)=vd(index)-v(index); % Calculates the error input for the fuzzy controller b(index)=x(3); % Sets the value of the integral of e if e(index)<=ce(1) % Takes care of saturation of the left-most membership function mfe=[1 0 0 0 0 0 0 0 0 0 0]; % i.e., the only one on is the left-most one e_count=e_count+1;,e_int=1; % One mf on, it is the left-most one. elseif e(index)>=ce(nume) % Takes care of saturation % of the right-most mf mfe=[0 0 0 0 0 0 0 0 0 0 1]; e_count=e_count+1;,e_int=nume; % One mf on, it is the % right-most one else % In this case the input is on the middle part of the % universe of discourse for e % Next, we are going to cycle through the mfs to % find all that are on for i=1:nume

Page 76: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

if e(index)<=ce(i) mfe(i)=max([0 1+(e(index)-ce(i))/we]); % In this case the input is to the % left of the center ce(i) and we compute % the value of the mf centered at ce(i) % for this input e if mfe(i)~=0 % If the certainty is not equal to zero then say % that have one mf on by incrementing our count e_count=e_count+1; e_int=i; % This term holds the index last entry % with a non-zero term end else mfe(i)=max([0,1+(ce(i)-e(index))/we]); % In this case the input is to the % right of the center ce(i) if mfe(i)~=0 e_count=e_count+1; e_int=i; % This term holds the index of the % last entry with a non-zero term end end end end % The following if-then structure fills the vector mfie %with the % certainty of each membership function of the integral %of e % for its current value (to understand this part of the code see the above % similar code for computing mfe). Clearly, it could %be more efficient to

Page 77: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

% make a subroutine that performs these computations %for each of the fuzzy system inputs. if b(index)<=cie(1) % Takes care of saturation of %left-most mf mfie=[1 0 0 0 0 0 0 0 0 0 0]; ie_count=ie_count+1; ie_int=1; elseif b(index)>=cie(numie) % Takes care of saturation of the %right-most mf mfie=[0 0 0 0 0 0 0 0 0 0 1]; ie_count=ie_count+1; ie_int=numie; else for i=1:numie if b(index)<=cie(i) mfie(i)=max([0,1+(b(index)-cie(i))/wie]); if mfie(i)~=0 ie_count=ie_count+1; ie_int=i; % This term holds last entry % with a non-zero term end else mfie(i)=max([0,1+(cie(i)-b(index))/wie]); if mfie(i)~=0 ie_count=ie_count+1; ie_int=i; % This term holds last entry % with a non-zero term end end end end % The next loops calculate the crisp output using only %the non-zero premise of error,e, and integral of the %error e. %This cuts down computation time since we will only %compute the contribution from the rules that are on %(i.e., a maximum of four rules for our case). Minimum %is used for the premise and implication.

Page 78: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

num=0; den=0; for k=(e_int-e_count+1):e_int % Scan over e indices of mfs that are on for l=(ie_int-ie_count+1):ie_int % Scan over int e indices of mfs that are on prem=min([mfe(k) mfie(l)]); % Value of premise membership function % This next calculation of num adds up the numerator %for the defuzzification formula. rules(k,l) is the %output center for the rule. base*(prem-(prem)^2/2 is the area of a symmetric % triangle with base width "base" and that is chopped %off at a height of prem (since we use minimum to %represent %the implication). Computation of den is %similar but %without rules(k,l) num=num+rules(k,l)*base*(prem-(prem)^2/2); den=den+base*(prem-(prem)^2/2); end end u(index)=num/den; % Crisp output of fuzzy controller that is %the input to the controller. % Next, the Runge-Kutta equations are used to find the next state. % Clearly, it would be better to use a Matlab "function" for % F (but here we do not so we can have only one program). % This does not implement the exact equations in the %work but if you think about the problem a bit you will %see that these really should be accurate enough. Here, %we are not calculating several intermediate values of %the controller output, only % one per integration step; we do this simply to save % some computations.

Page 79: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

time(index)=t; F=[(-x(1) + x(2)) ; (-2.5*x(2) +2.5*u(index)) ; (vd(index)-x(1)) ]; k1=step*F; xnew=x+k1/2; F=[(-xnew(1) + xnew(2)) ; (-2.5*xnew(2) + 2.5*u(index)) ; (vd(index)-xnew(1)) ]; k2=step*F; xnew=x+k2/2; F=[ (-xnew(1) + xnew(2)) ; (-2.5*xnew(2) + 2.5*u(index)) ; (vd(index)-xnew(1))]; k3=step*F; xnew=x+k3; F=[(-xnew(1) + xnew(2)) ; (-2.5*xnew(2) + 2.5*u(index)) ; (vd(index)-xnew(1))]; k4=step*F; x=x+(1/6)*(k1+2*k2+2*k3+k4); % Calculated next state t=t+step; % Increments time index=index+1; % Increments the indexing term % index=1 corresponds to time t=0. end % This end statement goes with the first "while" %statement in the program % Next, we provide plots of the input and output of the % controller along with the reference voltage that we %want to maintain. % It is also easy to plot the two inputs to the fuzzy % controller, % the integral of e (b(t)) and e(t) if you would like %since these values are also saved by the program. subplot(211) plot(time,v,'-',time,vd,'--')

Page 80: BY OKOZI, SAMUEL OKECHUKWU PG/M.ENG/06/40693 SAMUEL OKECHU… · Figure2.1 Schematic diagram of LFC and AVR of a synchronous generator 9 Figure 2.2 A simple diagram of an AVR 10 Figure

grid on xlabel('Time (sec)') title('Terminal voltage (solid) and desired voltage %(dashed)') subplot(212) plot(time,u) grid on xlabel('Time (sec)') title('Output of fuzzy controller (input to the %Generator)') % End of program


Recommended