Ant Colony Optimization in PID Tuning
Ant Colony Optimization in PID Tuning
ABSTRACT function properly, the PID loop must be properly tuned. Standard
Automatic control has played a vital role in the advancement of methods for tuning include Ziegler-Nichols Ultimate-cycle tuning
engineering and science. It is also essential in such industrial [5], Astrom and Hagglund [6], Cohen-Coon‟s method [7], and
operations as controlling pressure, temperature, humidity, many other traditional techniques. Although new methods are
viscosity and flow in the process industries. Proportional Integral proposed for tuning the PID controller, their usage is limited due
Differential (PID) controllers marked its place in many of the to the complexities arising at the time of implementation and their
industrial processes. Tuning a controller is the adjustment of its incompetence towards nonlinear systems.
control parameters. Computational Intelligence (CI) an off shoot However, despite decades of development work,
of Artificial Intelligence relies on heuristic algorithms mainly surveys indicating the state of the art of control industrial practice
evolutionary computation. Swarm intelligence (SI) a derivative of report sobering results. For example, Ender (1993) states that, in
CI, describes the collective behaviour of decentralized, self- his testing of thousands of control loops in hundreds of plants, it
organized systems. Ant behaviour was the inspiration for the Meta has been found that more than 30% of installed controllers are
heuristic optimization technique. This paper presents an operating in manual mode and 65% of loops operating in
application of an Ant Colony Optimization (ACO) algorithm to automatic mode poorly tuned. The Handbook of PI and PID
optimize the parameters in the design of a (PID) controller for a controller Tuning Rules by Aidan O.Dwyer has recorded 408
highly nonlinear conical tank system. The proposed work separate sources of tuning rules since the first such rule which was
discusses in detail, the ACO, a CI technique, and its application published by Callender et al. in 1935. In a striking statistic, 293
over the parameter tuning of a PI controller in a real time process. sources of tuning rules have been recorded since 1992 reflecting
The designed controller‟s ability in tracking a given set point is the upsurge of interest in the use of the PID controller recently.
compared with an Internal Model Control (IMC) tuned controller. Although these many tuning rules are available in literature, most
of the rules are applicable only for a first order system with a time
Keywords: PID controllers, Computational Intelligence, Ants delay. So clearly they are not meant to be applied for higher order
Colony Optimization, Internal Modal Control, Meta heuristic
nonlinear systems. In order to apply them we may go for
optimization.
approximating the system to a FOPTD (first order with time
1. INTRODUCTION delay).This can primarily be done either using Taylor‟s
The widely used PID industrial controller uses a combination of approximation or Skogestad‟s approximation. But the word
proportional, integral and derivative action on the control error to approximation itself suggests that the parameters obtained using
regulate its output. Owing to its simple structure, easy tuning and the application of these traditional tuning rules on the
effectiveness, this technology has been a mainstay for long among approximated system will also be a very big compromise. The
practicing engineers [1]. PID control is a generic feedback control intensity of compromise depends on the magnitude of degree
technology and it makes up 90% of automatic controllers in diminution. This approximation could itself fail if the higher order
industrial control systems. The PID control was first placed in the system has a complex time constant where it will be a tedious
market in 1939 and has remained the most widely used controller process and sometimes impossible.Certain methods are available
in process control until today. The basic function of the controller in applying over specific systems. And hence reduces the
is to execute an algorithm based on the control engineer‟s input acceptance of the method.
and hence to maintain the output at or around the set point [2]. Tuning a PID controller means setting the proportional, integral
The popularity of PID controllers is due to their functional and derivative constant to get the best possible control for a
simplicity, reliability and cost effectiveness. They provide robust particular process. Adjusting the controller gains, to satisfy the
and reliable performance for most systems and the PID parameters performance specifications like margin of stability, transient
i.e. the proportional, integral and differential constants are tuned response and bandwidth, improves the system robustness. The
to ensure a satisfactory closed loop performance [3]. A PID performance of the tuned controller can be represented as a
controller improves the transient response of a system by reducing function of error for quantitative analysis. The commonly
the overshoot, and by shortening the settling time of a system [4]. employed performance indices are Integral Absolute Error,
The PID control algorithm is used to control almost all loops in Integral Squared Error, Integral of time multiplied by absolute
process industries and is also the cornerstone for many advance value of error and Integral of time multiplied by squared error.
control algorithms and strategies [2]. For this control loop to
34
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
35
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
Eq(2.1)
36
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
d = delay time
The maximum inflow rate to the tank is maintained at 5.467 lpm.
The comparative response curves between the real time and
simulated model, with reference to the range 0-15 cm .The model
was estimated as
G(s)model 1 Eq(2.2)
G(s)model 2 Eq(2.3)
Figure 5: Comparison of real time and simulated responses of
model 2
For the region 27-36 cm the mathematical model and the
validation curves are given below . .
G(s)model 3 Eq(2.4)
G(s)model 4 Eq(2.5)
The validation curves for the four models are given in Figures 4-
7. The so framed model is simulated for a step input for the set
points whose graphs are presented in the figures. The system is
then subjected to a step input for all the four set points and the
corresponding real time graphs are presented comparing with the
simulated graphs.
37
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
Where τc=τd as per Skogestad, and integral time constant Ti is Ants Colony algorithm can be applied for the
continuous function optimization problems. Here, the domain has
given as, Ti = , and hence, we have Ki=Kp/Ki. Applying the to be divided into a specific number of R randomly distributed
technique for both the models, we get the IMC tuning parameters regions. These regions are indeed the trial solutions and act as
as in Table 2. local stations for the ants to move and explore. The fitness of
Table 2: Control parameters for PID controller for the four these regions are first evaluated and sorted on the basis of fitness.
models by conventional design technique When an algorithm designed for combinatorial optimization is
used to tackle a continuous problem, the simplest approach would
PARAMETERS Model1 Model 2 Model 3 Model 4
be to divide the domain of each variable into a set of intervals.
Kp 0.0727 0.1453 0.2456 0.3011 However, when the domain of the variables is large and the
required accuracy is high, this approach is not viable. For this
Ki 0.0171 0.0163 0.0201 0.0193 reason, ACO algorithms have been developed, which are
specifically designed for continuous and mixed continuous-
discrete variable [19-20] Totally a population of ants explores
these regions; the updating of the regions is done locally and
4. ANTS COLONY ALGORITHM globally with the local search and global search mechanism
respectively. The distribution of local and global ants is illustrated
The Ant System is a new kind of co-operative search
in Figure 9 and the flowchart of the Ants Colony algorithm is
algorithm inspired by the behavior of colonies of real ants. The
presented in Figure 10.
ants colony algorithm was applied to travelling salesman problem
[15-17] The blind ants are able to find astonishing good solutions
to shortest path problems between food sources and their home 4.2 Global Search
colony. The medium used to communicate information among The global search creates G new regions by replacing
individuals regarding paths, and decide where to go, was the the weaker portions of the existing domain. In the ACO random
pheromone trails. A moving ant lays some pheromone on the path walk and trial diffusion are utilized for global search. By random
they move, thus marking the path by the substance. While an walk procedure, the ants move in new directions in search of
isolated ant moves essentially at random, it can encounter a newer and richer stocks of food source. In the ACO simulation
previously laid trail and decide with high probability to follow it, such a global search in the entire domain is done by process
and also reinforcing the trail with its own pheromone. The equivalent to crossover operation and mutation operations in G.A.
collective behavior that emerges in a form of autocatalytic Adding or subtracting with a probability proportional to the
behavior where the more the ants following a trail, the more mutation probability carries out the mutation step in ACO. The
attractive that trail becomes for being followed. mutation step is reduced as per the relation.
4.1 The Path of Ants
There is a path along which ants are walking from nest Where „r‟ is a random number from [0, 1] „R‟ is the maximum
to the food source and vice versa. In the forties and fifties of the step size. „T‟ is the ratio of the current iteration number to that of
twentieth century, the French entomologist Pierre-Paul Grass´e the total number of iterations; „b‟ is a positive parameter
[18] observed that some species of termites react to what he called controlling the degree of nonlinearity.
“significant stimuli”. If a sudden obstacle appears and the path is
cut off, the choice is influenced by the intensity of the The mutation radius is nonlinearly reduced with increasing
pheromone trails left by proceeding ants. On the shorter path iterations. The scaling down enables enhanced probability of
more pheromone is laid down. The Figure 8 details the behavior locating maximum by concentrated search procedure called trial
of ants when faced with an obstacle in its search path. diffusion. The trial diffusion is quite similar to arithmetic cross
over. In this step two parents are selected at random from the
parent population space. The elements of the child‟s vector can
have either (1) The corresponding element from the first parent,
38
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
(2) The corresponding element from the second parent and (3) A parameter in the ACO algorithm. The size of the ant movement in
combination arrived from a weighted average of the above. i.e. If the local search depends on the current age.
the random number is less than 0.5 •Initially all the regions are assigned with the pheromone value of
1.0
X ( child ) Xi parent1 1 Xi parent 2
•It better results are obtained the pheromone of region i is
where α is a uniform random number in the range (0 –1). modified by
39
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
Learning constant,c1 2
Learning constant,c2 2
IIAE =
The IAE weights the error with time and hence emphasizes the
error values over a range of 0 to T, where T is the expected
settling time.
4.4.3 Termination Criteria
Genetic Algorithm termination can take place either
when the maximum numbers of iterations are performed, or when
a satisfactory fitness value is attained. The fitness value is the
reciprocal of the error, since we consider for a minimization of Figure 14: Ki distribution for model2
objective function. In this work, the termination criterion is
considered to be the maximum number of iterations. The
distribution of the values for the first iteration for Kp and Ki are
given below for all the models as shown in Figures 11 - 18. It is
clearly seen that the values are well distributed.
40
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
41
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
42
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
Table 4: Control parameters for PI controller for the four IAE 305.2351 270.119
models got from global best by ACO technique ISE 290.908 268.5775
PARAMETERS Model1 Model 2 Model 3 Model 4 MSE 0.0969 0.0895
Kp 0.21805 0.31813 0.4797 0.5502 ITAE 9469.1 6135.9
Ki 0.02606 0.02278 0.0264 0.0252
43
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
G1(s)model 1 Eq(5.1)
G1(s)model 2 Eq(5.2)
G1(s)model 3 Eq(5.3)
G1(s)model 4 Eq(5.4)
Figure 32: Real time response for a set point of 22 cm. Table 9: Comparison of performance index for 15% change in
Model 1
44
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
Table 12: Comparison of performance index for 15% change system for a plant of a first-order system with a time delay and
in Model 4 deriving the possible results.
Table 13: Comparison of time domain specifications for 12cm [3] Kim Dong Hwa and Park Jin Ill: Intelligent PID Controller
Tuning of AVR system using GA and PSO: Springer-Verlag
Berlin Heidelberg: ICIC 2005, Part II, LNCS 3645, pp 366-
Height IMC ACO 375.(2005).
Over shoot 1.81 1.81 [4] Ziegler, G. and Nichols, N. B, 1942.Optimum settings for
Raise Time 41.3339 37.2207 automatic controllers, Trans. ASME, 64,759-768.
Delay Time 9 7 [5] K.J.Astrom, T.Hagglund, The future of PIDcontrol, Control
Eng.Pract.9(11)(2001)1163–1175.
Table 14: Comparison of time domain specifications for 22cm [6] Astrom, K J.;. Hagglund .T,1984, Automatic tuning of simple
regulators with specifications on phase and amplitude
margins, Automatica, 20,645-651.
Height IMC ACO
[7] G.H Cohen and G.A Coon: Theoretical Consideration of
Over shoot 3.91 2.91 Retarded Control , Trans ASME 75,pp.827/834,(1953)
Raise Time 18.4013 15.9150 [8] Haber , Rodolf., Toro1, Raúl M. and. Alique, José R, ‟ Using
Delay Time 9 7 Simulated Annealing for Optimal Tuning of a PID Controller
for Time-Delay Systems. An Application to a High-
Performance Drilling Process‟, Springer.
6. CONCLUSION [9] Colorni A. Dorigo M, Maniezzo V. Distributed optimization
The developed controller tuning for various set points can be by ant colonics. Proceedings of the First European
suitably tracked by providing a program which can allow the Conference on Artjficial Life.Elsevier Publishing, paris.
system to choose that value based on the set point selected. The 1992, 134-142.
ACO tuning for model 1 will be used for set points between 0-15 [10] Bonabeau E. Dorig M, Theraulaz G. Inspiration for
cm, model 2 for set points between 15-27 cm, model 3 for set optimization from social insect behavior. Nature, 2000, 406.
points between 27-36 cm and model 4 for set points between 36
and 43 cm. The servo response of the system shows its stability [11] Katja V, Ann N. Colonies of learning automata. IEEE
over continuous change in set points at regular intervals. Transactions on Systems, Man, and Cybernetics-Part B,
2002,32,772-780.
The various results presented prove the betterness of the
ACO tuned PI settings than the IMC tuned ones. The simulation [12] Dorigo M, Gambardella L M. Ant colony system: A
responses for the models validated reflect the effectiveness of the cooperative learning approach to the traveling salesman
GA based controller in terms of performance index. The problem. IEEE Transactions on Evolutionary
performance index under the various error criteria for the Computation,1997,1,53-66.
proposed controller is always less than the IMC tuned controller.
Above all, the real time responses confirm the validity of the [13] James M, Marcus R. Anti-pheromone as a tool for better
proposed ACO based tuning for the conical tank. exploration of search space. Proceedings of the 3rd
International Workshop ANTS, Brussels, 2002, 100-1 10.
ACO presents multiple advantages to a designer by
operating with a reduced number of design methods to establish [14] Sundaresan, K. R., Krishnaswamy, R. R., Estimation of time
the type of the controller, giving a possibility of configuring the delay, time constant parameters in Time, Frequency and
dynamic behaviour of the control system with ease, starting the Laplace Domains, Journal of Chemical Engineering., 56,
design with a reduced amount of information about the controller 1978, p. 257.
(type and allowable range of the parameters), but keeping sight of [15] Dorigo M, Maniezzo V, Colomi A. Ant system: Optimization
the behaviour of the control system. These features are illustrated by a colony of cooperating agents. IEEE Transactionson
in this work by considering the problem of designing a control Systems, Man, and Cybernetics-Part B, 1996,26,29-41
45
International Journal of Computer Applications (0975 – 8887)
Volume 3 – No.8, June 2010
[16] Duan H B, Wang D B. A novel improved ant colony [19] K. Socha, “ACO for continuous and mixed-variable
algorithm with fast global optimization and its optimization,” in Ant Colony Optimization and Swarm
simulation.Information and Control, 2004,33,241-244, (in Intelligence, 4th International Workshop, ANTS 2004, ser.
Chinese). LNCS, M. Dorigo et al., Eds., vol. 3172. Springer Verlag,
2004, pp. 25–36.
[17] Duan H B, Wang D B, Zhu J Q, Huang X H. Development
on ant colony algorithm theory and its application. Control [20] K. Socha and M. Dorigo, “Ant colony optimization for
and Decision, 2004, 19, 1321-1326, 1340, (in Chinese). continuous domains,” European Journal of Operational
Research, 2006,
[18] P. P. Grass´e, Les Insectes Dans Leur Univers. Paris, France:
Ed. Du Palais de la d´ecouverte, 1946.
46