You are on page 1of 13

INDIAN CHEMICAL ENGINEER Copyright 2008 Indian Institute of Chemical Engineers Vol. 50 No. 3 July-September 2008, pp.

214-226

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor


S.M. Giriraj Kumar,1* R. Jain,1 N. Anantharaman,3 V. Dharmalingam2 and K.M.M. Sheriffa Begum3
1Department

of Electronics and Instrumentation Engineering, 2Department of Electrical and Electronics Engineering, School of Electrical and Electronics Engineering SASTRA University, Thanjavur - 613 402, India 3Department of Chemical Engineering, National Institute of Technology Tiruchirappalli - 620 015, India

Abstract: Proportional-integral-derivative (PID) control schemes continue to provide the simplest and yet effective solutions to most of the control engineering applications today. A number of processes in the chemical industries are controlled using PID controllers. However, most of the processes are complex and nonlinear in nature resulting into their poor performance when controlled by traditional tuned PID controllers. The need for improved performance of the process has led to the development of optimal controllers. Genetic algorithm (GA) is an evolutionary algorithm that is widely used in this respect. Determination or tuning of the PID parameters continues to be important as these parameters have a great influence on the stability and performance of the control system. In this paper GA is proposed to improve the performance of a bioreactor. The methodology and efficiency of the proposed method are compared with that of traditional methods. The results obtained reflect that use of GA based controllers improves the performance of the process in terms of time domain specifications, setpoint tracking, regulatory changes and also provides an optimum stability. Keywords: Controller, PID tuning, GA, Bioreactor.

Introduction
The PID controller is the most common form of feedback in use today. According to an estimate nearly 90% of the controllers used in industries are PID controllers. The family of PID controllers is rightly known as the building blocks of control theory owing to their simplicity and ease of implementation [1].
*Author for Correspondence. E-mail: smgirirajkumar@gmail.com Paper received: 18/01/2007; Revised paper accepted: 23/10/2007

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor

215

Designing and tuning a PID controller appears to be conceptually intuitive, but can be hard in practice, if multiple (and often conflicting) objectives are to be achieved. A conventional PID controller with fixed parameters may usually derive poor control performance when it comes to system complexities [2, 3]. Since the gain and the time constants of the system change with the operating conditions the conventional PID controllers result in sub-optimal corrective actions and, hence, require frequent tuning adjustments. This stimulates the development of tools that can assist engineers to achieve the best overall PID control for the entire operating envelope of a given process. In the past few decades, neural networks have been used to meet system complexities like nonlinearities [4, 5], but their real time implementation is quite difficult. Optimisation algorithms have also received increasing attention by the research community and industry [6-8]. The advantage of optimisation algorithms over neural controllers is that the former can be incorporated in PID tuning with ease and simplicity. Control design is called optimal control when a pre-defined criterion is optimised. Optimality is just with respect to the criterion at hand and the real performance depends on the suitability of the chosen criterion. Genetic algorithms (GA) belonging to the family of evolutionary computational algorithms have been widely used in many control engineering applications. They are powerful optimisation algorithms that work on a set of potential solutions, which is called population. GA finds the optimal solution through cooperation and competition among the potential solutions. These algorithms are highly relevant for industrial applications, because they are capable of handling problems with nonlinear constraints, multiple objectives, and dynamic components properties that frequently appear in real-world problems [9]. The concept of GA comes from the Darwinian idea of natural selection and survival of fittest [10]. GA is composed of two main elements, which are strongly related to the problem being solved the encoding scheme and the evaluation function [11]. The encoding scheme is used to represent the possible solutions to the problem. Individuals can be encoded in some alphabets, like binary strings, real numbers, and vectors. While applying GA practically, a population pool of chromosomes is installed and, initially, they are set to a random value. In each cycle of genetic evolution, a subsequent generation is created from the chromosome in the current population. The cycle of evolution is repeated until a termination criterion is reached [12]. The number of evolution cycles, or a predefined fitness value can be set as the termination criterion. The widespread application of bioreactors has led to the development of control schemes that can improve their performances. In this paper, GA is proposed to improve the performance of a model bioreactor. Tuning or training the controller to achieve good closed-loop performance is imperative. However, the effectiveness of the designed controller in terms of system requirements is greatly governed by the accuracy of the system model. Hence, it is desirable to model the dynamics of the processes near the operating point by simpler models such as first order process with time delay (FOPDT) for the purpose of controller design and also for process analysis. A mathematical model of the bioreactor is proposed. The PID controller is designed based on traditional tuning techniques and

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

216

GIRIRAJ KUMAR

ET AL

an introduction of GA is discussed in detail along with the implementation of the proposed GA algorithm. The simulation results are presented and justification given of the alternate PID controller based on time domain analysis and robustness.

Bioreactor Model
Biochemical reactors are cylindrical culture vessels used for the fermentation process in which anaerobic breakdown of complex organic materials by the action of anaerobic microorganism or free enzymes takes place. Materials such as carbon, nitrogen, oxygen, which are called substrate, and other nutrients are brought with the cell into the culture vessel (bioreactor) and converted within the cell via hundreds of reactions to the various constituents of the cell as well as to biochemical product. Bioreactors provide a controlled environment that is necessary to bring the better growth of microbes, and also maintain constant temperature according to the need of microbes. During the breakdown process the microbes produce large number of intermediate and final products, including pharmaceuticals, food, and beverages. The reaction taking place inside the bioreactor is Substrate + Cell ......... extracellular products + more cells S + X ......... P + nX From the above equation the rate of growth is directly related to cell concentration and cellular reproduction. So it is necessary to maintain the cell concentration, i.e. the goal is to achieve the growth of these cells (biomass) in a bioreactor by manipulating the dilution rate, which is the flow rate per volume of the reactor. A typical control and instrumentation diagram of the bioreactor used in this paper for analysis [13], with biomass concentration as the measured output, is shown in Fig. 1.

Manipulated variable Dilution rate CC

Biomass concentration setpoint Biomass concentration

CM

Fig. 1. Simplified PI diagram for a biochemical reactor.

Model equation of the bioreactor is


dx1 = ( D ) x1 dt

(1) (2)

x dx2 = D( x2f x2 ) 1 dt y

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor

217

where the state variables are biomass (cell) concentration x1 = mass of cells/volume; and substrate concentration x2 = mass of substrate/volume. The manipulated input is D = dilution rate = F/V = volumetric flow rate/reactor volume The disturbance input is x2f , which is the substrate feed concentration
= max x2
2 K m + X 2 + K1 X 2

(3)

where Km is substrate saturation constant and K1 is substrate inhibition constant. In the present control study the parameters used for a substrate inhibition model are max = 0.53 h1, km = 0.12 g/l, k1 = 0.4545 l/g, Y = 0.4, x2fs = 4.0 g/l, Ds = 0.3 h1 For a dilution rate of 0.3 h1 the nonlinear process has three steady state solutions. In this paper we consider the control of the bioreactor at the stable nontrivial point. Specifications at this point are: (a) Biomass concentration x1s = 1.530163 (b) Substrate concentration x2s = 0.174593 After linearising and substituting the initial conditions, least square method is used to obtain the transfer function of the system. The transfer function relating the dilution rate to the biomass concentration is
Gp ( s) = 1.5302s 0.4590 s 2 + 2.564 s + 0.6792 0.6758 0.4417 s + 1

(4)

After pole-zero cancellation the transfer function can be represented as


Gp ( s) =

(5)

For stability reasons a dead time is considered resulting to the final transfer function as
G ( s) = 0.6758e 1s 0.4417 s + 1

(6)

Control Algorithm
The system considered as mathematical model is to be analysed as a closed-loop system. In the closed-loop system it is considered with unity feedback and a PID controller is placed in series (Fig. 2). The basic representation of a PID controller is given as
C (s ) = K p + Ki + Kd s s

(7)

where Kp is the proportional gain, Ki the integral gain and Kd the derivative gain. Over the last 50 years, numerous methods have been developed for setting the parameters of INDIAN CHEMICAL ENGINEER Vol. 50 No. 3 July-September 2008

218

GIRIRAJ KUMAR

ET AL

a PID controller. In this paper the controller r + u y C (s) G ( s) tuning is done with traditional tuning methodology viz., Zeigler Nichols (ZN) ultimate Controller Plant gain method (1942), Skogestads modification of internal model controller (IMC) rule (2003), and with a non-traditional tuning method Fig. 2. Feedback control system. based on GA. The performances of the controllers thus tuned are compared later on various perspectives of steady state conditions, setpoint changes, disturbance rejection and robustness. In Fig. 2, r is the command signal, y the output of the plant G(s) given by Eq. (6). Traditional Technique for PID Controller Tuning The traditional tuning technique employed here is the most widely used ZN tuning method [14] and the Skogestad method [15].

G ( s) =

0.6758e 1s 0.4417 s + 1

For the bioreactor model the value of ultimate gain Ku obtained through Routh Hurwitz criterion results in sustained continuous oscillations. The related oscillating period Pu is the ultimate period. Thus, we have Ku = 2.7870 and Pu = 1.8. Considering these two parameters the PID parameters are estimated based upon the following formulae Kp = 0.6 Ku, Ti = Pu/2, Td = Pu/8 Based on the application of ZN PID tuning method we get the PID tuning parameters as Kp = 1.6722 Ki = 1.8580 Kd = 0.3762 where Ki = Kp/Ti and Kd = Kp Td. Skogestad rule states that for a FOPTD process of the form G (s ) = Kp = /K(c + ) Ti = Td = /2 Comparing with the available FOPTD model of bioreactor we have Kp = 0.3268 Ki = 0.3268 Kd = 0.1634 With these values of PID tuned controller the system is subjected to various analyses which are discussed in detail later.

Ke s we have (1 + s)

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor

219

Genetic Algorithm Genetic algorithm is a powerful search algorithm that performs an exploration of the search space that evolves in analogy to the evolution in nature [2]. GAs use probabilistic transition rules instead of deterministic rules, and handle a population of potential solutions known as individuals or chromosomes that evolve iteratively. Each iteration of the algorithm is termed as a generation. The evolution of solutions is simulated through a fitness function and genetic operators such as reproduction, crossover and mutation [16]. The fittest individual will survive generation after generation, while also reproducing and generating offsprings that might be stronger. At the same time, the weakest individuals disappear from each generation. A genetic algorithm (Fig. 3) is typically initialised with a random population consisting of between 20 and 100 individuals. This population (mating pool) is usually represented by a real-valued number or a binary string called a chromosome. How well an individual performs a task is measured and assessed by the objective function, which assigns each individual a corresponding number called its fitness. The fitness of each chromosome is assessed and a survival of the fittest strategy is applied. In this paper, the magnitude of the error is used to assess the fitness of each chromosome. There are three main operators for a genetic algorithm reproduction, crossover and mutation.
Initialise population

Measure fitness

Selection

Mutation

Crossover Not optimum solutions Optimum solutions Fig. 3. Flowchart of GA programming.

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

220

GIRIRAJ KUMAR

ET AL

Reproduction During the reproduction phase the fitness value of each chromosome is assessed. This value is used in the selection process to provide bias towards fitter individuals. Just like in natural evolution, a fit chromosome has a higher probability of being selected for reproduction. The probability of an individual being selected is, thus, related to its fitness, ensuring that fitter individuals are more likely to leave offspring. Crossover Once the selection process is complete, the crossover algorithm is initiated. The crossover operations swap certain parts of the two selected strings in a bid to capture the good parts of old chromosomes and create better new ones. The crossover probability indicates how often crossover is performed. The simplest crossover technique is the Single Point Crossover. Example: If the strings 100110 and 101001 are selected for crossover and the value of k is randomly set to 2 then the newly created strings will be 100110 and 101010 as shown below
1001 10 1001 01 1010 01 1010 10

Mutation Mutation is the occasional random alteration of a value of a string position. It is considered a background operator in the GA. The probability of mutation is normally low because a high mutation rate would destroy fit strings and degenerate the GA into a random search. Once a string is selected for mutation, a randomly chosen element of the string is changed or mutated. For example, if the GA chooses bit position 3 for mutation in the binary string 100101, the resulting string is 100001 as the third bit in the string is flipped
100101 100001

GA Based Tuning of the Controller


The optimal value of the PID controller parameters Kp, Ki, Kd is to be found using GA. All possible sets of controller parameter values are particles whose values are adjusted to minimise the objective function, which in this case is the error criterion, and it is discussed in detail. For the PID controller design, it is ensured the controller settings estimated results in a stable closed-loop system. Initialisation of Parameters To start with GA, certain parameters need to be defined. These include population size, bit length of chromosome, number of iterations, selection, crossover and mutation types etc. Selection of these parameters decides, to a great extent, the ability of the designed controller [17, 18]. The range of the tuning parameters is considered between 0 and 10. Initialising the values of the parameters for this paper is as follows: INDIAN CHEMICAL ENGINEER Vol. 50 No. 3 July-September 2008

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor Population size: 100 Bit length of the considered chromosome: 6 Number of generations: 100 Selection method: Maximum geometric selection Crossover type: Single point crossover Crossover probability: 0.8 Mutation type: Uniform mutation Mutation probability: 0.05

221

Objective Function for the GA The objective functions considered are based on the error criterion. A number of such criteria are available. In this paper controllers performance is evaluated in terms of integral time absolute error (ITAE) error criteria. The error criterion is given as a measure of performance index given by the equation for integral of time multiplied by absolute error (ITAE)

I ITAE = t e(t ) dt
0

In this paper we consider the limits for the equation from time, t = 0 to t = Ts, where Ts is the settling of the system to reach steady state condition for a unit step input. Here the value of Ts = 6 h. Termination Criteria Termination of optimisation algorithm can take place either when the maximum number of iterations gets over or with the attainment of satisfactory fitness value. Fitness value, in this case is nothing but reciprocal of the magnitude of the objective function, since we consider for a minimisation of the objective function. Here the termination criteria is considered to be the attainment of satisfactory fitness value, which occurs with the maximum number of iterations as 100. Application of the GA with ITAE error criterion for 100 iterations gives us the variation of the PID parameters. For each iteration the best of the 100 particles were chosen and plotted on a graph. The variation of the PID parameters Kp, Ki and Kd is shown, respectively, in Figs. 4 to 6.
1.232 1.234 0 1.236 1.238 1.240 1.242 1.244 1.246 20 40 60 80 100

Kp

Number of iterations

Fig. 4. Best solutions of Kp for 100 iterations.

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

222

GIRIRAJ KUMAR

ET AL

1.390 0 1.392 1.394 1.396 1.398 1.400

20

40

60

80

100

Ki

Number of iterations

Fig. 5. Best solutions of Ki for 100 iterations. 0.230 0.235 0 0.240 0.245 0.250 0.255 0.260 0.265 0.270 20 40 60 80 100

Kd

Number of iterations

Fig. 6. Best solutions of Kd for 100 iterations.

The PID controllers were formed based upon the respective parameters for 100 iterations, and the best solution out of these iterations was selected for the set of parameters, which had the minimum error. It is seen very clearly from the results of the 100 iterations that the best particles have an excellent convergence. A sketch of the error based on ITAE criterion for all the 100 iterations is shown in Fig. 7.
5.8 5.7 5.6 5.5 5.4 5.3

Error

20

40 60 80 Number of iterations

100

Fig. 7. Error based on ITAE criterion for 100 iterations.

From the application of PID tuning based on GA we get the PID tuning parameters as Kp = 1.244 Ki = 1.398 Kd = 0.2427

Results and Discussion


The PID values obtained by the GA are compared with those of the results derived from ZN and Skogestad methods in various perspectives, viz. robustness and steady state performances. All the simulations were implemented using MATLAB. INDIAN CHEMICAL ENGINEER Vol. 50 No. 3 July-September 2008

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor

223

Performance Related to Steady State Conditions A reference input of unit step was given to the closed-loop system as shown in Fig. 2. This procedure was implemented for the controller for which the PID values were tuned by ZN and Skogestad methods, as well as GA. The response curves obtained are shown in Fig. 8. A comparison of time domain specifications, peak overshoot, undershoot and settling time are tabulated (Table 1). It is found very clearly that for the GA based controller overshoot is decreased and undershoot also decreases drastically without any change in settling time. Henceforth, the proposed technique outperforms the traditionally tuned controller with ZN and Skogestad methods.
1.25 1.00 0.75
Amplitude

0.50 0.25 0 0.25 0.50 0 5 10 Time (h) 15

ZN GA Skogestad

20

Fig. 8. Unit step response with the considered controllers. Table 1. Comparison of time domain specifications Type of controller Peak overshoot (%) Undershoot (%) Settling time ZN 11 55 4 h 36 min GA 5 33 4 h 36 min Skogestad 0 6 20 h

Performance for Servo Effects The considered model of the system was subjected to a servo change from a unit step input up to 20 h, followed by a change from 1 to 1.5 units from 20 to 40 h and then to 0.5 units from 40 to 60 h. It was observed that the controller tuned by GA based tuning resulted in better tracking than the others (Fig. 9). Performance for Regulatory Effects The closed system was allowed to reach steady state condition. At a time of t = 20 h and at t = 40 h a disturbance of + 1 and + 0.5 unit was provided to the process. These changes were made to verify the system performance for regulatory effect and it was clearly found the proposed controller yielded a better result (Fig. 10).

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

224

GIRIRAJ KUMAR

ET AL

2.5 2.0
Amplitude

1.5 1.0 0.5 0 0.5 0 10 20 30 40 Time (h)

ZN GA Skogestad

50

60

Fig. 9. Servo changes for the considered controllers. 2.5 2.0 1.5 1.0 0.5 0 0 0.5 ZN GA Skogestad

Amplitude

10

20

30 40 Time (h)

50

60

Fig. 10. Regulatory effects for the considered controllers.

Robustness Investigation The PID controllers tuned by the GA based method should not be compared only with their time domain specifications but along with gain margin (GM) and phase margin (PM), which is a measure of robustness. The results are given in Table 2. From the results we find that the stability is very good for the Skogestad based controller, but the stability achieved is at the cost of sluggishness. Thus, the GA designed controller can be appreciated for simplicity, robustness and stability.
Table 2. Robustness analysis of the bioreactor with the considered controllers ZN GM PM 1.2808 36.9446 GA 1.6923 53.4125 Skogestad 4.1126 84.5336

Conclusion
The use of GA provides optimal PID settings. Hence, the accuracy and efficiency of the system performance can be maintained. The ease of implementation further adds to its attraction. The present paper successfully discussed the designing of GA controller for a bioreactor model. It was seen that the GA-tuned PID controllers outperformed the ZN and Skogestad tuned controller in terms of overshoot, undershoot as well as disturbance rejection and setpoint tracking. The gain margin and phase margin of the process is also increased, thus, adding to its increased stability. Therefore, it is concluded that the INDIAN CHEMICAL ENGINEER Vol. 50 No. 3 July-September 2008

Genetic Algorithm Based PID Controller Tuning for a Model Bioreactor

225

performance of the bioreactor is greatly improved in terms of steady state response as well as stability. Henceforth, GA tuning can be regarded as a better control methodology for attaining improved performance of a process. Further, an improvement of the work can be made by designing an online adaptive controller based on GA. References
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Sung, S.W., Lee, I.-B. and Lee, J., Modified Proportional-Integral-Derivative (PID) Controller and a New Tuning Method for the PID Controller, Ind. Eng. Chem. Res., 34, pp. 4127-4132 (1995). Salami, M. and Cain, G., An Adaptive PID Controller Based on Genetic Algorithm Processor, Genetic Algorithms in Engineering Systems: Innovations and Applications, 12-14 September, Conference Publication No. 414, IEE (1995). Asriel, U.L. and Narendra, K.S., Control of Non-linear Dynamical Systems using Neural Networks-Part II: Observability, Identification and Control, IEEE Transactions on Neural Networks, Vol. 7, No. 1, January (1996). Mistry, S.I., Chang, S.-L. and Nair, S.S., Indirect Control of a Class of Non-linear Dynamic Systems, IEEE Transactions on Neural Networks, Vol. 7, No. 4, July (1996). Fabri, S. and Kadirkamanathan, V., Dynamic Structure Neural Networks for Stable Adaptive Control of Non-linear Systems, IEEE Transactions on Neural Networks, Vol. 7, No. 5, September (1996). Kolonko, M. and Tran, M.T., Convergence of Simulated Annealing with Feedback Temperature Schedules, Prob. in Engineering and Informational Sciences, 11, pp. 279-304 (1997). Wah, B. and Chen, Y., Constrained Genetic Algorithms and their Applications in Non-linear Constrained Optimization, Proceedings of International Conference on Tools with Artificial Intelligence, IEEE, November, pp. 286-293 (2000). Parsopoulos, K.E. and Vrahatis, M.N., Particle Swarm Optimizer in Noisy and Continuously Changing Environments, In Artificial Intelligence and Soft Computing, M.H. Hamza (Ed.), IASTED/ACTA Press, pp. 289-294 (2001). Jan, J.A. and Sulc, B., Evolutionary Computing Methods for Optimizing Virtual Reality Process Models, International Carpathian Control Conference ICCC 2002, Malenovice, Czech Republic, May 27-30 (2002). Sadasivarao, M.V. and Chidambaram, M., PID Controller Tuning of Cascade Control Systems Using Genetic Algorithm, Journal of Indian Institute of Science, 86, July-August, pp. 343354 (2006). Shin, G.-W., Song, Y.-J., Lee, T.-B. and Choi, H.-K., Genetic Algorithm for Identification of Time Delay Systems from Step Responses, International Journal of Control, Automation and Systems, Vol. 5, No. 1, February, pp. 79-85 (2007). Rathikarani, D., Sivakumar, D. and Mary, S.A.J., Genetic Algorithm based Optimization of Controller Tuning for Processes with Dead Time, Proceedings of the International Conference on Advances in Control and Optimization of Dynamical Systems (ACDOS) (2007). Agarwal, P. and Lim, H.C. Analyses of Various Control Schemes for Continuous Bioreactors, Adv. Biochem. Engg. Biotechnol., 30, pp. 61-70 (1984). Ziegler, J.G. and Nichols, N.B., Optimum Settings for Automatic Controllers, Trans. Amer. Soc. Mech. Eng., Vol. 64, pp. 759-768 (1942). Skogestad, S., Simple Analytic Rules for Model Reduction and PID Controller Tuning, Journal of Process Control, 13(2003), pp. 291-309 (2003).

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008

226

GIRIRAJ KUMAR

ET AL

16. Man, K.F., Tang, K.S. and Kwong, S., Genetic Algorithms: Concepts and Applications, IEEE Transactions on Industrial Electronics, 43(5), pp. 519-534 (1996). 17. Kim, D.H. and Park, J. III, Intelligent PID Controller Tuning of AVR System Using GA and PSO, Lecture Notes in Computer Science, www.springerlink.com, 375, September (2005). 18. Gundogdu, O., Optimal-tuning of PID Controller Gains Using Genetic Algorithms, Journal of Engineering Sciences, 11(1), pp. 131-135 (2005).

INDIAN CHEMICAL ENGINEER

Vol. 50 No. 3 July-September 2008