Auto Tuning PID Controller Based On Improved Genetic Algorithm For Reverse Osmosis Plant
Auto Tuning PID Controller Based On Improved Genetic Algorithm For Reverse Osmosis Plant
384
World Academy of Science, Engineering and Technology 47 2008
A. Proportional Control
The proportional controller output uses a ‘proportion’ of the
system error to control the system. However, this introduces an
offset error into the system.
B. Integral control
The integral controller output is proportional to the amount
of time there is an error present in the system. The integral
action removes the offset introduced by the proportional
control but introduces a phase lag into the system.
C. Derivative control
The derivative controller output is proportional to the rate of
change of the error. Derivative control is used to Fig. 2 flow chart of the general genetic algorithm
reduce/eliminate overshoot and introduces a phase lead action
that removes the phase lag introduced by the integral action. GA has been successfully applied to many different
problems, such as: traveling salesman, graph partitioning
d (ERROR.) problem, filters design, power electronics, etc. It has also been
Dterm KI u (3) applied to machine learning, dynamic control system using
dt learning rules and adaptive control. The combination of GA
with other Artificial Intelligence techniques, like Fuzzy Sets
D. Continuous PID control and Artificial Neural Network, in hybrid system has been the
The three types of control are combined together to form a solution for a great amount of problems. Success of GA solving
PID controller with the transfer function [8]. high dimensional problem has been reported in the literature
too. An illustrative flowchart of the GA algorithm
implementation is presented in Figure 2. In the beginning an
initial chromosome population is randomly generated. The
385
World Academy of Science, Engineering and Technology 47 2008
chromosomes are candidate solutions to the problem. Than, the there exist some crossover types. The so called arithmetic
fitness values of all chromosomes are evaluated by calculating crossover generates an offspring as a component wise linear
the objective function in a decoded form. So, based on the combination of the parents in later phases of evolution it is
fitness of each individual, a group of the best chromosomes is more desirable to keep individuals intact, so it is a good idea to
selected through the selection process. The genetic operators, use an adaptively changing crossover rate: higher rates in early
crossover and mutation, are applied to this “surviving” phases and a lower rate at the end of the GA. Sometimes it is
population in order to improve the next generation solution. also helpful to use several different types of crossover at
Crossover is a recombination operator that combines subparts different stages of evolution
of two parent chromosomes to produce offspring. This operator
C. Mutation
extracts common features from different chromosomes in order
to achieve even better solutions. Mutation is an operator that A new individual is created by making modifications to one
introduces variations into the chromosome. This operation selected individual. The modifications can consist of changing
occurs occasionally with a small probability. It randomly alters one or more values in the representation or adding/deleting
the value of a bit, in case of binary coding. In real coding it parts of the representation. In GA, mutation is a source of
changes the entire value of a chromosome. Through the variability and too great a mutation rate results in less efficient
mutation operator the search space is explored by looking for evolution, except in the case of particularly simple problems.
better points. The process continues until the population Hence, mutation should be used sparingly because it is a
converges to the global maximum or another stop criterion is random search operator; otherwise, with high mutation rates,
reached [9]. the algorithm will become little more than a random search.
Moreover, at different stages, one may use different mutation
operators. At the beginning, mutation operators resulting in
IV. GENETIC OPERATOR bigger jumps in the search space might be preferred. Later on,
when the solution is close by a mutation operator leading to
In each generation, the genetic operators are applied to
slighter shifts in the search space could be favored [10][18].
selected individuals from the current population in order to
create a new population. Generally, the three main genetic
operators of reproduction, crossover and mutation are V. EVALUATE THE PROCESS USING FITNESS
employed. By using different probabilities for applying these FUNCTION
operators, the speed of convergence can be controlled.
Crossover and mutation operators must be carefully designed, A. Objective function
since their choice highly contributes to the performance of the The most crucial step in applying GA is to choose the
whole genetic algorithm. objective functions that are used to evaluate fitness of each
A. Reproduction chromosome. Some works use performance indices as the
A part of the new population can be created by simply objective functions. The objective functions are Mean of the
copying without change selected individuals from the present Squared Error (MSE), Integral of Time multiplied by Absolute
population. Also new population has the possibility of selection Error (ITAE), Integral of Absolute Magnitude of the Error
by already developed solutions. (IAE), and Integral of the Squared Error (ISE)[8][11].
There are a number of other selection methods available and
W W
it is up to the user to select the appropriate one for each process. 1
(e(t))2dt ITAE
t ³0 ³ t e(t)dt
MSE
All selection methods are based on the same principal i.e. 0 (5)
giving fitter chromosomes a larger probability of selection. W W
2 2
Four common methods for selection are: ISE ³ e(t) dt
0
ITSE ³ te(t) dt
0
1. Roulette Wheel selection
2. Stochastic Universal sampling B. The fitness values
3. Normalized geometric selection The PID controller is used to minimize the error signals, or
4. Tournament selection we can define more rigorously, in the term of error criteria: to
And author uses Roulette Wheel selection. minimize the value of performance indices mentioned above.
B. Crossover And because the smaller the value of performance indices of
New individuals are generally created as offspring of two the corresponding chromosomes the fitter the chromosomes
parents (i.e., crossover being a binary operator). One or more so will be, and vice versa, we define the fitness of the
called crossover points are selected (usually at random) within chromosomes as (6) [11][18].
the chromosome of each parent, at the same place in each. The
parts delimited by the crossover points are then interchanged 1 (6)
Fitness value
between the parents. The individuals resulting in this way are Performanc
e index
the offspring. Beyond one point and multiple point crossover,
386
World Academy of Science, Engineering and Technology 47 2008
kD
condition satisfies. As a result, the output value is improved
random number.
(ญ) Return the final value to GA.
The newly designed random number generator gives more
Fig. 3 schematic of auto tuning PID controller based on improved GA reliable random generator than normally using conventionally
one.
function.
B. New objective function
A. New random generation In control engineering, Mean of the Squared Error (MSE),
Integral of Time multiplied by Absolute Error (ITAE), Integral
of Absolute Magnitude of the Error (IAE), and Integral of the
Squared Error (ISE) are used as objective function of GA
universally. However in the study use of new objective
function is attempted for RO plant, which is Root Mean Square
Error (RMSE) represented as in (9).
W
1
(e(t ))2 dt
t ³0
R MSE (9)
F ( p, x0 , J ) x 0 J tan[ S ( p 0 . 5 )] (7)
p is random value between 0 and 1, x 0 is the location
parameter, specifying the location of the peak of the
distribution and J is the scale parameter which specifies the
half width at half maximum. Set as x 0 =0, J =1 generally and it
is called ‘standard Cauchy distribution’ [15]. In this paper set
these values as random from 0 to 1. So probability density
function always changes when GA program is called for
random generator function. The output from Cauchy
Fig. 5 flow chart of the improved Genetic Algorithm
distribution is the expanded value between 0 and 1 and the
387
World Academy of Science, Engineering and Technology 47 2008
the individuals in the initial population are the solutions found 1.2
Amplitude
0.8
their ranges limited around the values. The ranges of PID 0.6
values are rationally chosen by arbitrary and it is true that the
0.4
limitation will influence the results of the GA search; it is
intended to obtain more stable, efficient and accurate solutions. 0.2
that calculated the RMSE value from transient to steady state. Fig. 7 step response of improved GA tuned controller vs. Ziegler
(ฌ) Each individual in the current population is evaluated Nichols tuned controller
using the objective function.
GAs converged to final values
(ญ) If the termination standard [i.e., the generation 15
Improved GA
Conventional GA
number > preset number] is met, the best solution (i.e., PID
Kp
10
gain parameters) is returned.
(ฎ) From the current population, individuals are selected 5
0 50 100 150 200 250
these individuals. 0
0 50 100 150 200 250
(ฏ) Actions starting from step (ซ) are repeated until the 25
generation.[18] 15
10
0 50 100 150 200 250
Generations
VII. SIMULATION RESULTS
Recently the most widely used RO plant has its control Fig. 8 response trends upon improved GA converging through generation
system utilizing empirically determined parameters. The
simulation concept is shown in Fig. 4, where the GA and PID confirm the effectiveness of the proposed method. Parameters
are set for GAs in the study is as in Table1.
control action are implemented in the MATLAB Item Improved GA GA Ziegler Nichols
environment[12][13]. Peak amplitude 1.19 1.5 1.58
In this section, numerical simulation is conducted to Overshoot (%) 19 49.9 58.1
TABLE I Rising time (sec) 0.966 0.755 1.29
GAS PARAMETER SETTING
Settling time (sec) 5.12 6.92 14.9
Parameter Value Final value 1 1 1
Selection method Roulette wheel P gain 6.71275 10.73984 6
Population size 80
I gain 0.0172 3.2230 1.91
Generation size 220
Crossover probability 65% D gain 11.48921 14.36576 4.74
Mutation probability 0.1%
Ranges of PID gain -1000~1000
values and Ziegler Nichols method are made as shown in Table 2.
388
World Academy of Science, Engineering and Technology 47 2008
[16] Stephen K. Park and Keith W. Miller. Random number generators: Good
ones are hard to find. CACM, 31(10):1192–1201, 1988.
[17] Donald E. Knuth. “Deciphering a linear congruential encryption,”. IEEE
VIII. CONCLUSION Transactions on Information Theory, IT-31(1):49–52, January 1985.
[18] T. K. Teng, J. S. Shieh and C. S. Chen, “Genetic algorithms applied in
This paper demonstrated how an improved GA can be used
online autotuning PID parameters of a liquid-level control system,”
for the optimal control of RO plant via computer simulation. A Transaction of the Institute of Measurement and control 25, 5 (2003),
new GA method based on hybrid concept of Cauchy pp.433~450
distribution, linear congruential generator and simultaneous
using of RMSE type objective function to design a controller
for RO plant is presented. Much more improved performance
of proposed GA tuned controller than the conventional ones
has been revealed in terms of overshoot and settling time etc.
Real time implementation of the proposed method is under way.
Also at the same time implementation of micro controller based
on the new method in commercially low cost is being sought.
Although GA needs lot of computation, its real time realization
of the idea will be performed via physical experiment.
ACKNOWLEDGMENT
This research was supported by a grant (C106A152000106A
085700200) from Plant Technology Advancement Program
funded by Ministry of Construction & Transportation of
Korean government
REFERENCES
[1] UNESCO (2004, may 11). Water for - water for life – the united nations
world water development report. [Online]. Available:
http://www.unesco.org/water/wwap/wwdr/ex_summary/
[2] M.S. Mohsen, 0.R AI-Jayyousi, “Brackish water desalination: an
alternative for water supply enhancement in Jordan’’, Desalination,
vol.124, p~163-174, Nov.1999
[3] A. Maurel, “Desalination of sea Water and brackish water,” in Proc. Of
seminar on water managemen6 strategies in Mediterranean countries
[4] F. G. Shinskey, Process Control System: Application, Design and Tuning.
McGraw-Hill, 4th ed, 1996
[5] K. J. Astrom and B. Wittenmark, Adaptive Control. Addison Wesley, 2nd
ed., 1995.
[6] A. Visioli, “Tuning of PID controllers with fuzzy logic,” Proc. Inst. Elect.
Eng. Contr. Theory Applicat., vol. 148, no. 1, pp. 1–8, Jan. 2001.
[7] R. A. Krohling and J. P. Rey, “Design of optimal disturbance rejection
PID controllers using genetic algorithm,” IEEE Trans. Evol. Comput., vol.
5, pp. 78–82, Feb. 2001.
[8] 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, pp.384~391, 2004.
[9] Dionisio S. Pereira, “Genetic Algorithm Based System Identification and
PID Tuning for Optimum Adaptive Control,” International Conference
on Advanced Intelligent Mechatronics, Monterey, California, USA, 24-28
July, pp.801~806, 2005
[10] Ian Griffin, “On-line PID Controller Tuning using Genetic Algorithms,”
Dublin City University, 2003
[11] T O.Mahony, C J Downing and K Fatla, “Genetic Algorithm for PID
Parameter Optimization: Minimizing Error Criteria,” Process Control and
Instrumentation 2000 26-28 July 2000, University of Stracthclyde,
pp.148~153
[12] C. R. Houck, J. Joines. and M.Kay, “A genetic algorithm for function
optimization: A Matlab implementation,” ACM Transactions on
Mathematical Software, 1996.
[13] Chipperfield, A. J., Fleming, P. J., Pohlheim, H. and Fonseca, C. M., A
“Genetic Algorithm Toolbox for MATLAB,” Proc. International
Conference on Systems Engineering, Coventry, UK, 6-8 September, 1994
[14] D. E. Goldberg, “Genetic Algorithms in Search, Optimization, and
Machine Learning,” Addison-Wesley Publishing Co., Inc., 1989
[15] Wikipedia, http://en.wikipedia.org/wiki/Cauchy_distribution
389