You are on page 1of 5

Proceedings of the IEEE

International Conference on Automation and Logistics


August 18 - 21, 2007, Jinan, China

The Application of Immune Genetic Algorithm in PID


Parameter Optimization for Level Control System
Chengwei Li Jiandong Lian
School of Electrical Engineering and Automation School of Electrical Engineering and Automation
Harbin Institute of Technology University Harbin Institute of Technology University
Harbin, Hei longjiang Province, China Harbin, Hei longjiang Province, China
chengweili@hit.edu.cn Jiandong030@163.com

Abstract - This work discusses the use of an Evolvable Genetic Algorithm searches for the controller gains Kp
Proportional-Integral-Derivative (PID) controller that consists of (proportional), TI (integral) and TD (derivative or differential)
an evolvable PID controller hardware whose gains can be set by so that specifications for the closed-loop step response are
Evolutionary Computation techniques, such as Genetic met.
Algorithms in water level control system. Due to PID controllers'
widespread use in industry, tuning procedures for them are In the following section basic concepts and modeling of
always a topic of interest. An evolutionary immune inspired the PID controller and water level control system are
algorithm, named Immune Genetic Algorithm (IGA), is used for presented. Section 3 presents the tuning procedure, based on
tuning the controller so that closed-loop step response the Immune Genetic Algorithm that has been used.
specifications are satisfied. Experiments with different processes
indicate that the gains obtained through Immune Genetic
Experimental results and comparisons with classical
Algorithm (IGA) may provide better responses than those Ziegler-Nichols and ISE (ISTE, IST2E) based tuning methods
obtained by the classical Ziegler-Nichols method. The PID are shown in section 5. Conclusions follow in section 6.
Controller based on IGA is realized by the configuration
software and LabVIEW. The experiment results show that the
water level controlled by the PID controller can response fast and II. EVOLVABLE PID CONTROLLERS AND WATER LEVEL
reach the stable state quickly in comparison with that controlled CONTROL SYSTEM
by the conventional PID controller.
An Evolvable PID Controller (Figure 1) consists of a
Index Terms - PID control, Immune Genetic Algorithms PID controller hardware whose gains KP, TI and TD can be set
(IGA), water level control, cascade control. by Evolutionary Computation techniques. The most common
hardware implementations of PID controllers rely on
I. INTRODUCTION microprocessors, but pure analog implementations also exist.
The interest in the use of Evolutionary Computation In evolvable PID controller an evolutionary algorithm sets the
techniques, such as Evolvable Hardware [1][2][3], Genetic gains to the PID controller hardware so that design
Algorithms [4] and Genetic Programming [5], in the design of requirements are satisfied. This procedure may be used
intelligent and flexible controllers has shown a considerable whatever the form of implementation. An evolutionary
increase lately. In the last decades, PID controllers have been immune inspired algorithm, named Immune Genetic
successfully applied to many different problems in the control Algorithm (IGA), is used for tuning the controller. By using
field and have achieved valuable results [6]. Due to their this procedure, designers need only specify the desired closed
widespread use in industry, especially in water level control loop response. This evolutionary nature entitles the controller
system, tuning procedures for PID controllers are always a to self-adaptations, which are important in applications where
topic of interest [6]. Most level control systems are hysteretic, controllers need to operate for long periods in harsh
inertial and nonlinear. Most traditional tuning methods could environments.
not provide good responses. With the development of the
Hardware and computation techniques, a PID controller
consists of a PID controller hardware whose gains can be set
by Evolutionary Computation techniques is widespread
embedded in industry instruments. Using evolvable algorithm
to optimize the parameter of PID controller has become more
easier than before. The main objective of this work is to
investigate the use of an Immune Genetic Algorithm (IGA) in
the tuning of PID controllers for water level control system.
Immune Genetic Algorithm is inspired in natural
immunological mechanisms. This technique is basically a
procedure of adaptive and parallel search [7], [8]. The Immune
Figure 1. Evolvable PID Controller Diagram

1-4244-1531-4/07/$25.00 © 2007 IEEE. 782


The block diagram shown in Figure 2 illustrates a closed-loop
system with a PID controller in the direct path, which is the
usual connection.

Figure 2. PID control of a plant


Where:
U ( s) K Figure 3. Flow chart of water level control system
GC (s) = = KP + i + Kd s (1)
E (s ) s III. IMMUNE GENETIC ALGORITHM (IGA)
Y ( s) GC ( s)G ( s) The Immune Genetic Algorithm describes the basic
Gg ( s) = = (2)
R( s) 1 + GC ( s)G ( s) features of an adaptive immune response to an antigenic
stimulus and the flow chart is summarized in Figure 4.
The tuning of a PID controller consists of selecting the
Receive the Antigen
appropriate gains KP, TI and TD so that performance
specifications are met. By Ziegler-Nichols's method [9], those
gains are obtained through experiments with the process under Produce the original
Evolve
antibody
control. Memory cell

Water control system is widespread in Process control Compute the fitness value
and diversity value
area; the flow chart of the system is summarized in figure 3.
this system is a double- tanks water level control system Conditions
which is based on Foundation Fieldbus. All the transmitters compare
and controllers are fit FF standard and connect on Foundation
Field bus (FF). All data on Field bus is collected by data
acquisition Card from NI. The logic connection between Whether or not the convergent Y
transmitters, PID controllers is configured by Configuration criterion is satisfied?
Software. In this system, the water in reservoir (E-3) is Output
pumped up to tank E-1 by the water pump. The stream in to N
tank E-2 is controlled by adjustment. The water level in all Produce the antibody
tanks will be real time measured by water level transmitters (crossover,mutation) END
(I-1 and I-2). The main goal is make the water level in tank
E-2 remained stable. In this system, because of the hysteretic Stimulation and suppression
and inertial, it is very difficult for conventional PID controller of antibody
to make the system has a good control effect. In order to
improve the performance of the system, Evolvable PID Update antibody
Controller will used in this system. This system is a double (base on Concentration)
tank system. In order to make the system has a good dynamic
Figure 4 . Immune Genetic Algorithm flow chart
performance; cascade control will be used in this system.
Minor loop in this system will dispel the disturbance which is There are six steps in IGA. If IGA is compared with the
acting on main loop. The water level in tank E-2 is main general searching algorithm for solving optimization
adjust parameter; water level in tank E-1 is auxiliary problems, the antigen and the antibody correspond to the
parameter. object value and the probable solution to the optimization
problems:
Step 1 Inputting the object value and various constraint s of
the particular optimization problem as the antigen in IGA
Step 2 Producing the original antibody in the space of solution
by random method.

783
Step 3 Computing the affinity value of the antibody. Where:
Step 4 Performing crossover and mutation operations. K’Pi, KPi : B cells
Step 5 Using the rule of renovating the group and producing μ (0,1) : Gaussian operator
the next antibody.
The Immune Genetic Algorithm searches for the best
Step 6 If the number of iterations arrives at a given threshold, individual (controller) maximizing the affinity (between 0 and
or the convergence criteria are satisfied, the procedure stops. 1). Desired and actual responses for a given system are shown
Otherwise return to step. in Figure 5.
IV. IGA FOR PID TUNING
The implementation of the tuning procedure of a PID
controller through the Immune Genetic Algorithm starts with
the definition of the antibody representation. The antibody is
formed by three real numbers that characterize the individual
to be evaluated and that correspond to the three gains (Kp, Ti
and Td) to be adjusted in order to achieve a satisfactory
behavior.
Since the objective is to minimize the error between the
set point (desired output) and the plant output (actual output),
In order to make control system stabilize, accuracy, rapid, and Figure 5. Desired and actual responses
have good transient characteristic, the target function and
affinity function have to be defined base on “Integral The observation interval is divided into n samples; the error
absolute-error” (IAE) Rule: for each sample is calculated by (6) and entered into (5). The
maximization of (5), performed by the IGA by adjusting the
1 PID gains, will ensure that the actual output is as close as
affinity = (3)
J+A possible to the desired one.

J = ³ [ w1 e(t ) + w2u 2 (t ) + w4 e(t ) ]dt + w3 ⋅ tu (4) V. EXPERIMENTS
0
Where: In order to verify the performance of IGA, a simulation
was carried out in MATLAB platform. After the simulation in
A: a constant which is bigger than 0 MATLAB, a Monitoring Software was also developed in
LabVIEW platform in order to optimizing the parameters of
1, 2, 3, 4: constants
the PID controllers and monitoring the operation of water
tu: rise time level control system.
In crossover operation, “Two-point Crisscross A. Simulation in MATLAB
Algorithm” will be used in the procedure. At the beginning of The main program of IGA was written in MATLAB 7.1,
the operation, the program will choose a random the gains which provided by IGA and other methods are
number rk ∈ [ 0,1] which is compared with cross operator Pc. simulated in SIMULINK. The block diagram of simulate
control system which is used in SIMULINK is presented in
r <p
If k c , the crossover operation will begin. The operation Figure 6.
will proceed base on the two formulas described by Eq. 5:
X ' = rX + (1 − r )Y
(5)
Y ' = (1 − r ) X + rY
Where:
X, Y: father generation of the B cell
X’, Y’: child generation of the B cell
r: random number (between 0 and 1).
The mutation operation is base on “Gaussian mutation”. The
operation on all B cells will proceed base on the formula Figure 6. The block diagram of simulate control system
described by Eq. 6:
The IGA has been configured as:
K Pi' = K Pi + a affinity ⋅ μ (0,1) (6)

784
Sampling time: 0.2s; B. Experiment in water level control system
After the simulation in MATLAB, the main program of
Generations (max): 100;
IGA was transplanted to LabVIEW platform, a monitoring
Population: 30; software with parameter optimizing function and monitoring
function was developed. The interface of monitoring software
Crossover rate: 0.5
was listed in below:
Hyper mutation rate: 0.05
w1Ј0.999Δw2Ј0.001Δw3Ј2.0Δw4Ј100
The experiment with a second inertia increases delay
system has been performed for the evaluation of the tuning
procedure. In the experiment, results were compared with the
original values obtained through the classical Ziegler-Nichols
(Z-N) method, and through ISE (ISTE, IST2E) method. The
transfer function is described by Eq. 7:
1
G( s) = e − 0.5s (7)
( s + 1) 2
The responses with the application of the IGA are presented in
Figure 7, which also shows results obtained with Z-N, with
Figure 8. Interface of operation monitoring block
the ISE (ISTE, IST2E) technique. In this experiment, Z-N
rules provide initial values for the gains; adjustments to those
gains are performed there after.

Figure 9. Interface of parameter optimizing block

Before parameter optimizing, the transfer function must


be provided for IGA to determine the Fitness function.
Figure 7. Closed-loop step response for G(s) Through system identification, the transfer function of water
level system is described by Eq. 8
It can be seen in Figure 7 that the straight application of Z-N
rules provided gain values which led to a poor behavior. The 2.8
performance of ISE (ISTE, IST2E) is better than Z-N method,
G (s) = e − 24 s (8)
955.1s + 1
but remained poorer than that obtained with the IGA as a gain
tuner. Gain values obtained with each of the techniques for the The gain values obtained with IGA is: KP=89.4428,
control of the plant are shown in Table I. KI=0.3177, KD=3.2649. The results provided by IGA are also
be input into the control system through Configuration
Table I
PID CONTROLLER GAINS FOR G(S) Software. In this experiment, the water level of tank E-2 was
Kp TI TD  Ts(s) set to 15.0 cm. The optimizing result provided by IGA
Z-N 3.3711 2.0846 1.3629 5.65s 44.24% algorithm was input into the PID controller which is
ISE 3.2028 1.2416 1.4650 4.00s 26.48% embedded in water level transmitter I-1. The response of the
ISTE 3.1844 1.0412 1.1145 7.35s 27.28% system is listed in below.
IST2E 2.9842 0.9660 0.8723 8s 26.42%
IGA 2.8270 1.3466 1.5371 5.2s 7.08%

785
Figure 10. Closed-loop step response for G(s)
In Fig. 10 we can see the response of the real water level
control system is in accord with the simulation. The overshoot
in this process is only 2%.

VI. CONCLUSIONS
This work evaluated the performance of an Evolvable
PID controller through a series of experiments, in order to
investigate the applicability of the Immune Genetic Algorithm
to the automatic tuning of PID controllers. Satisfactory
closed-loop step responses were obtained for the plant tested,
comparing favorably to those obtained with the classical Z-N
method. There was no need for further manual adjustments to
the PID gains when automatic tuning was employed. The
automatic procedure was even capable of providing gain
values where the classical method could not be applied.

REFERENCES
[1] Zebulum, R.S., Pacheco, M.A.C., and Vellasco, M.M.B.R, Evolutionary
Electronics: Automatic Design of Electronic Circuits and Systems by
Genetic Algorithms, CRC Press, Florida, 2001.
[2] J.C. Gallagher and J.M. Fiore, “Continuous Time Recurrent Neural
Networks: A Paradigm for Evolvable Analog Controller Circuits”, Proc.
National Aerospace and Electronics Conference, 2000, pp. 299-304.
[3] J.F.M. Amaral, J.L.M. Amaral, C. Santini, R. Tanscheit, M.M.R.
Vellasco, M.A.C. Pacheco and A. Mesquita, “Evolvable Building Blocks
for Analog Fuzzy Logic Controllers”, Proc. 2003 NASA/DoD Conference
on Evolvable Hardware, 2003, pp. 101-107.
[4] J.F.M. Amaral, R. Tanscheit, and M.A.C. Pacheco, “Tuning PID
Controllers through Genetic Algorithms”, in N. Mastorakis, Advances in
Fuzzy Systems and Evolutionary Computation, Part II, World Scientific
Engineering Society Press, ISBN:960-8052-27-0, 2001, pp. 232-235.
[5] J.R. Koza, M.A. Keane, J. Yu, F.H. Bennett III, and W. Mydlowec,
“Automatic Creation of Human-competitive Programs and Controllers by
means of Genetic Programming, in Genetic Programming and Evolvable
Machines, Kluwer Academic Publishers, 2000, pp 121-164.
[6] Astrom, K.J., and T. Hägglund, PID Controller: Theory, Design and
Tuning, Instrument Society of America, 1995.
[7] Castro, L.N., J. Timmis, Artificial Immune System: A New
Computational Intelligence Approach, Springer, 2002.
[8] L.N. Castro, F.J. v. Zuben, Learning and optimization using Clonal
Selection principle, IEEE Trans. Evolutionary Computation, 2001, pp.
239-251
[9] Ogata, K., Modern Control Engineering, Prentice-Hall, Eaglewoof Cliffs,
NJ, 2nd ed., 1990.
[10]Franklin, G.F., J.D. Powell, and A. Emami-Naieni, Feedback Control of
Dynamic Systems, Addison-Wesley, 1988.

786

You might also like