Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Application of Particle Swarm Optimisation for the

tuning of PID Controller in AVR System


C.Ismayil, Jisma M, and Suresh K. Damodaran
Department of Electrical and Electronics Engineering
Govt. Engineering College, Thrissur
Kerala, India
( ismayilc@gmail.com)

Abstract— This paper describes the application of particle GA performance. Moreover, the premature convergence of
swarm optimisation technique for tuning the gains of PID GA degrades its performance and it reduces its search
controller in AVR system. A novel design to determine the capability [1].
performance criterion in the time domain is proposed for Particle swarm optimization (PSO) is an evolutionary
evaluating the PID controller. The PSO technique can generate computation technique developed by Kennedy and Eberhart
high quality solutions in shorter calculation time and stable in 1995.It was developed through the simulation of a
convergence characteristic than other methods. simplified social system, and has been found robust in
solving the continuous nonlinear optimization
Keywords— Particle Swarm Optimisation, AVR system, PID problems[1].There are many common characteristics
Controller. between PSO and GA. First, they are flexible optimization
I. INTRODUCTION technologies. Second, they all have strong universal property
independent of any gradient information. However, PSO is
Nowadays, the quality and reliability of supply became much simpler than GA, and its operation is more convenient,
prime importance while feeding customer loads. The supply without selection, copy, and crossover [7].
should be in specified stability limits even in the varying In this paper, Particle Swarm Optimization Technique is
load conditions. Many industrial plants are heavily used for the tuning of optimal PID controller parameters of
influenced by the disturbances occurring in the power system. an AVR system. A simple performance criterion in time
An Automatic Voltage Regulator (AVR) is used to provide domain is proposed for evaluating the performance of a
constant terminal voltage at generator during normal small PSO-PID controller that was applied to the complex control
and slow changes in the load. system. The performance measure to be minimized contains
In literature various methods have been proposed to the maximum overshoot, rise time, settling time and the
control the AVR system [1] – [5]. But the classical steady state error.
proportional-integral-derivative controller remain the
controllers of choice to due to its simple construction and
robust performance for wide range of operating II. AVR SYSTEM MODELLING
conditions.[5] Thus in a typical AVR system the voltage The basic role of the AVR is to provide constancy of the
control loop is realised using a PID controller .The most generator terminal voltage during normal small and slow
critical step in the application of PID controller is the changes in the load. A linearized model of an AVR system
parameter tuning. In a PID controller, each mode with PID controller is shown in Fig.1.It consists of a
(proportional, integral and derivative mode) has a gain to be comparator, PID controller, amplifier, exciter, generator and
tuned, giving as a result three variables involved in the a sensor. The generator excitation system maintains
tuning process. generator voltage and controls the reactive power flow using
There have been a lot of approaches to search the a automatic voltage regulator[1].
parameters of PID controllers [1], [6]-[10].The earlier
method used the classical tuning rules proposed by Ziegler
and Nichols. In general, it is often hard to determine optimal Vref Ve ki VR KA VF KE Vg KG Vt
k p + + kd s
or near optimal parameters with the Ziegler-Nichols formula s 1 + TA s 1 + TE s 1 + TG s
in many industrial plants [1]. + -
Many Artificial Intelligence (AI) techniques like neural Vt PID Controller Amplifier Exciter Generator
network, fuzzy logic systems have been used widely for
tuning the parameters [1], [6]. In any classical PID control
KA
problem, the required controller parameters should be
1 + TA s
optimally designed. These parameters can be optimally
obtained via Particle swarm Optimization (PSO) and Genetic
Algorithm (GA) [7]. Sensor
The GA method is faster and hence it has received great
attention in control systems such as the search of optimum Fig.1.Block diagram of AVR system with PID controller
PID controller parameters. Though the GA methods have
been employed successfully to solve complex optimization The linearized mathematical modelling of all these
problems recent research has identified some deficiencies in components are:
A. PID controller III. PROBLEM FORMULATION
The PID controller is used to improve the dynamic The determination of tuning parameters of PID controller
response as well as to reduce or eliminate the steady state in an AVR system is formulated as an optimisation problem.
error. The PID controller transfer function is The performance measure to be minimized contains the
ki following objectives of PID controller,
C (s) = kp + + kd s 1. Minimize steady state error, the difference between the
s (1)
input and output of the system in the limit as time goes to
infinity
where 2. Minimize the rise time ,the time required for the system
k p =proportional gain constant response to rise from: 10% to 90%(over damped);5% to
95%;0% to 100%(under damped) of the final steady state
ki =integral gain constant value of the desired response.
3. Minimize the maximum overshoot, maximum overshoot
k d =derivative gain constant
is the maximum peak value of the response curve
measured from the desired response of the system.
B. Amplifier
4. Minimize the settling time, time required for the
The transfer function of amplifier can be represented by response to reach and stay within 2% of final value
gain KA and time constant TA as
In this paper, a simple performance criterion is used for
VR ( s ) KA evaluating the tuning parameters of PID controller. The
= (2)
Ve ( s ) 1 + TA s
performance measure can be formulated as:
−
Min W ( K ) = (1 − e )( M p + Ess ) + e −  (ts − tr )
where
K A = gain constant of amplifier where (6)
K:= [ k p , ki , kd ]
TA =time constant of amplifier
M p is the maximum overshoot
C. Exciter
Ess is the steady state error
The transfer function of exciter can be represented by gain
KE and time constant TE as ts is the settling time
VF ( s ) KE t r is the rise time and
= (3)
VR ( s ) 1 + TE s  is the weighting factor.
where In this paper  is set in the range 0.8 to 1.5.
KE = gain constant of exciter
IV. A BRIEF DESCRIPTION ABOUT PARTICLE SWARM
TE =time constant of exciter OPTIMISATION(PSO)
Particle swarm optimization (PSO) is an evolutionary
D. Generator computation optimization technique (a search method based
The transfer function relating the generator terminal on a natural system) developed by Kennedy and Eberhart. In
voltage to its field voltage can be represented by gain KG a PSO system, the particles fly around in a multi-dimensional
and time constant TG as search space. During flight, each particle adjusts its position
Vt ( s ) KG according to its own flying experience, and the experience of
= (4) neighbouring particles, making use of the best position
VF ( s ) 1 + TG s encountered by itself and its neighbours. The swarm
where direction of a particle is defined by the set of particles
KG = gain constant of generator nighbouring the particle and its history experience.
Let x and v denote a particle coordinates (position) and its
TG =time constant of generator corresponding flight speed (velocity) in a search space,
respectively. Therefore, the j-th particle is represented as
E. Sensor x j = ( x j ,1 , x j ,2 ,....x j , g ) in the g-dimensional space. The
The sensor is modelled by a simple first order transfer
best previous position of the j-th particle is recorded and
function give by,
represented as pbest j = ( pbest j ,1 , pbest j ,2 ,.... pbest j , g )
Vs ( s ) KR
= (5) .The index of the best particle among all the particles in the
Vt ( s ) 1 + TR s group is represented by gbest g . The rate of the velocity for
where
particle j is represented as v j = (v j ,1 , v j ,2 ,....v j , g ) .The
KR = gain constant of sensor
modified velocity and position of each particle can be
TR =time constant of sensor
calculated using the current velocity and the distance from Smaller the value of W ( K ) higher the evaluation
pbest j , g to gbest g as shown in the following formulas: function.

v (jt, +g1) = w.v (jt, )g + c1rand () *( pbest j , g − x (jt, )g ) C. Proposed PSO-PID Controller
+c2 Rand () *( gbest g − x ) (t )
j,g (7) This paper presents a PSO-PID controller for searching
the optimal or near optimal controller parameters
( t +1) ( t +1)
x j,g =x (t )
j,g +v j,g k p , ki , k d with the PSO algorithm.
j = 1, 2,......n The searching procedures of the proposed PSO-PID
controller were described as below.
g = 1, 2,.....m Step1: Specify the lower and upper bounds
of k p , ki , k d as shown in Table.I. and particles
where
n number of particles in a group are generated between these limits.
m number of members in a particle Step2: Initialize randomly the velocities of particles,
t pointer of iterations(generations) pbest and gbest. The limits of velocity are:
0  Vk p  Vkmax max max
v (jt, )g Velocity of particle j at iteration t, p
; where Vk p = k p /2

Vgmin  v (jt, )g  Vgmax 0  Vki  Vkmax max max


i
; where Vki = ki /2

0  Vkd  Vkmax
w inertia weight factor max max
d
; where Vkd = kd /2
c1,c2 acceleration constant
rand(),Rand() random number between 0 and 1
Step2: For each individual K employ Routh Hurwitz
x (jt, )g current position of particle j at iteration t criterion to test the closed loop system stability
pbest j pbest of particle j and calculate the four performance
M E t t
criteria p , ss , s , r in time domain.
gbest g gbest of the group
Step3: Evaluate the performance criterion using
The constants c1 and c2 represent the weighting of the (6).Then calculate the fitness value of each
stochastic acceleration terms that pull each particle toward individual in the population using the
pbest and gbest positions and were often set to be 2.0.The evaluation function (9).
inertia weight w provides a balance between global and local Step4: Compare each individual’s evaluation function
explorations and is set according to the following equation: with its pbest.The best evaluation among the
wmax − wmin
w = wmax − * iter (8)
pbest is denoted as gbest.
itermax Step5: Modify the member velocity v of each particle K
according to
where itermax is the maximum number of iterations and
iter is the current number of iterations.
v (jt, +g1) = w.v (jt, )g + c1rand () *( pbest j , g − k (j t, g) )

V. FORMULATION OF PSO-PID CONTROLLER


+c2 Rand () *( gbest g − k (j t, g) )
In this paper, PID controller is developed using PSO j = 1, 2,......n
algorithm which is called as a PSO-PID controller. This g = 1, 2,3
approach uses the controller parameters k p , ki , k d as the where w is set using (8).
particles of PSO. when g is 1 v j ,1 represents the velocity of k p
A. Individual String Definition when g is2 v j ,2 represents the velocity of ki
Define three controller parameters k p , ki , k d to compose when g is 3 v j ,3 represents the velocity of k d
an individual K by K: = [ k p , ki , kd ] ; hence there are three
members in an individual. ( t +1) )
Step6: If v j , g  V max then v (t +1) = V max
g j,g g
( t +1) min ( t +1) min
B. Evaluation Function Definition If v j , g < Vg then v j , g = Vg
Define an evaluation function f of the form where g=1,2,3.

1 Step7: Modify the member position of each


f = (9)
individual K according to
W (K )
as the evaluation value of each individual in population. k (j t, g+1) = k (j t, g) + v (jt,+g1) ,
The evaluation function f is the reciprocal of performance
criterion W ( K ) .
k gmin  k (j t, g+1)  k gmax
min max
Where k g and k g represents the lower and
After the simulation we found that maximum peak
upper bounds of member g of individual K overshoot as 1.5065, steady state error as 0.1748,rise time as
0.3s and settling time as=1s.
Step8: If number of iterations reaches the maximum The PSO parameters used for verifying the performance
then goto step 9.Otherwise goto step 2. of the PSO-PID controller in searching the PID controller
parameters are shown in Table.III.
Step9: The individual that generates the latest gbest will
be the optimal controller parameter.
TABLE IIII
PSO PARAMETERS
VI. COMPUTED RESULTS
Dedicated software is developed in MATLAB Population size 50
programming language to implement the controller design 0.9
based on PSO.A practical higher order system shown in wmax
Fig.1. was tested. The AVR system parameters used were wmin 0.4
tabulated in Table 1.
Acceleration constant,
TABLE I c1 2
AVR SYSTEM PARAMETERS
c2 2
Parameters value Iterations 200
Amplifier gain, KA 10 The PID controller in Fig.1. is then replaced with the
PSO-PID controller with the parameters obtained from the
Amplifier time constant, TA 0.1s
PSO algorithm. The step response of the system while using
1 a PSO-PID and conventional PID controller is compared in
Exciter gain, KE
Figure.3.
Exciter time constant, TE 0.4s

Generator gain, KG 1

Generator time constant, TG 1s

Sensor gain, KR 1

Sensor time constant, TR 0.01s

The lower and upper bounds of the three controller


parameters were as shown in Table II.
TABLE II
RANGE OF THREE CONTROLLER PARAMETERS

Controller Min value Max value


parameters Fig.3.Step response of an AVR system with PSO-PID
kp 0 1.50 controller and conventional PID controller
ki 0 1.0
kd 0 1.0 It is evident from the Fig.3 that there is an improvement
The block diagram shown in Fig.1. is then modelled in in the performance of the system. A noticeable reduction is
MATLAB Simulink. observed in the maximum overshoot and settling time.
The Fig.2. shows the original terminal voltage step
response of AVR system without a PID controller.
VII. CONCLUSION
A simple and viable procedure is developed in this paper
for the determination of the PID controller parameters for an
AVR system. The determination of tuning parameters is
framed as an optimisation problem and is solved using
Particle Swarm Optimisation. A performance criterion in the
time domain is proposed for evaluating the PID controller. It
includes the overshoot M p , rise time t r , settling time t s ,
and steady-state error Ess . According to the simulation
results, it is seen that the PSO-PID performs better than the
conventional PID controller in settling time and maximum
overshoot.
Fig.2.Step Response of an AVR system without PID
controller.
VIII. REFERENCES
[1] Zwe-Lee Gaing, “A Particle Swarm Optimization Approach for
Optimum Design of PID Controller in AVR System”,IEEE
Transactions on Energy Conversion,vol.19,No.2,June 2004 .
[2] C S Hoong, S Taib, K S Rao and I Daut”Development of
Automatic Voltage Regulator for Synchronous Generator”,
National Power and Energy Conference 2004 Proceedings Kuala
Lumpur,Malaysia.
[3] B.H.Kwon,J.H.Youm,J.H.Choi”Automatic voltage regulator
with fast dynamic speed”, IEE Proceedings,1999
[4]Saiful Jamaan, Md Shah Majid Mohd Wazir Mustaffa, Hasimah
aaaaaabdul Rahman”A omparative Study of PI and Fuzzy Logic
Automatic Voltage Regulator of a Micro-Alternator System”,
National Power and Energy Conference 2004 Proceedings Kuala
Lumpur,Malaysia.
[5] D.Devaraj,B.Selvabala”Real-coded genetic algorithm and fuzzy
logic approach for real time tuning of proportional-integral-
derivative controller in automatic voltage regulator system”, IET
generation,Transmission & Distribution
[6] T. L. Seng, M. B. Khalid, and R. Yusof, “Tuning of a neuro-
fuzzy controller by genetic algorithm,” IEEE Trans. Syst., Man,
Cybern. B, vol. 29, pp. 226–236, Apr. 1999.
[7] You-Bo-Wang,Xin Peng,ben Sheng Wei, “A New Particle
Swarm Optimization Based Auto Tuning of PID Controller”,Proc.
Of Inter National conf on Machine Learning and cybernatics,July
2008,p.p.no:1818-1822.
[8] Adel.A.A.El-Gammal,.Adel.A.El-Samahy,”A Modified Design
of PID controller for DC Motor Drives Using Particle Swarm
Optimisation.”, Power Engg ,2009.pp.419-422.
[9] Nelendran Pillay,Poobalan Govinder,”A Particle Swarm
Optimisation for Model Independent tuning of PID Control loops.”
[10] Renato O Krohling.Joost P Ray,”Design Of Optimal
Disturbance Rejection using PID Controllers for Genetic
Algorithm”,IEEE Trans of evolutionary
Computation,vol.5,No.1,Feb 2001.
[11] J.Bastin Solai Nazaran,P.S.Kannan, “Particle Swarm
Optimization based fuzzy controller design for SVC to enhance
power system damping”,Indian Institute of Technology Madras
[12] C.S.HoongS Taib SIEEE,K.S Rao and I Daut,”Development of
Automatic Voltage Regulator for Synchronous
generation.”,National Power and Energy Conference,2004 Proc.
[13] K. Sundareswaran and Merugu Vasu “Genetic Tuning of PI
Controller for speed control of DC motor Drive.”, Proceeding of
IEEE International conference on Industrial technology 2000
Volume 1 of 2,p-p 521-525
[14] N.Subrahmanyam,Suresh K Damodaran “Particle Swarm
Optimisation for combined emission and economic dispatch
problem”,

You might also like