Genetic algorithms applied in online autotuning PID ... - CiteSeerX

16 downloads 146 Views 652KB Size Report
Transactions of the Institute of Measurement and Control. T. K. Teng ... and usefulness for online tuning PID parameters via this evolution process. Key words: ...
Transactions of the Institute of Measurement and Control http://tim.sagepub.com

Genetic algorithms applied in online autotuning PID parameters of a liquid-level control system T. K. Teng, J. S. Shieh and C. S. Chen Transactions of the Institute of Measurement and Control 2003; 25; 433 DOI: 10.1191/0142331203tm0098oa The online version of this article can be found at: http://tim.sagepub.com/cgi/content/abstract/25/5/433

Published by: http://www.sagepublications.com

On behalf of:

The Institute of Measurement and Control

Additional services and information for Transactions of the Institute of Measurement and Control can be found at: Email Alerts: http://tim.sagepub.com/cgi/alerts Subscriptions: http://tim.sagepub.com/subscriptions Reprints: http://www.sagepub.com/journalsReprints.nav Permissions: http://www.sagepub.com/journalsPermissions.nav

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Transactions of the Institute of Measurement and Control 25,5 (2003) pp. 433–450

Genetic algorithms applied in online autotuning PID parameters of a liquid-level control system T.K. Teng , J.S. Shieh and C.S. Chen Department of Mechanical Engineering, Yuan Ze University, 135 Yuan-Tung Rd, Chung-Li, Tao Yuan, 320, Taiwan

In this paper, a simple genetic algorithm (GA) method has been applied in a real-time experiment on a liquid-level control system for online autotuning proportional-integral-derivative (PID) parameters. Our proposed method can automatically choose the best PID parameters for each generation. Then, using the reproduction, crossover and mutation to create the new population for other PID parameters, it can continuously control the liquid-level system until the preset iteration number is reached. Finally, the best PID parameters can be obtained. Furthermore, two selection methods, roulette wheel and tournament, have been compared in realtime experiments. Real-time experimental results are given to demonstrate the effectiveness and usefulness for online tuning PID parameters via this evolution process. Key words: crossover; evolution; genetic algorithms; mutation; proportional-integral-derivative (ID) controller; reproduction; roulette wheel selection; tournament selection

1.

Introduction

Most industrial processes are controlled by proportional-integral-derivative (PID) controllers. The popularity of PID controllers is due to their simplicity both from design and parameter tuning points of view. Almost all control problems can be solved by these controllers and they are found in large numbers in all process industries. They have survived many changes in technology, from early controllers

Address for correspondence: Jiann-Shing Shieh, Department of Mechanical Engineering, Yuan Ze University, 135 Yuan-Tung Rd, Chung-Li, Tao Yuan, 320, Taiwan. E-mail: [email protected]

Ó 2003 The Institute of Measurement and Control Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV10.1191/0142331203tm0098oa on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

434

Online autotuning PID parameters

based on relays and pneumatic systems to being lately replaced by electronic circuits and microprocessors. The PID controllers perform several important functions, two very important ones being the elimination of steady-state offset and anticipation of deviation and generation of adequate corrective signals through the derivative action. Together with combinational logic, sequential machines and simple function blocks, these PID controllers are increasingly being used to build automation systems for industries. In the early development of automatic control, PID control generated much interest, but for a long time, researchers paid very little attention to it. The main reason behind this was the practical difŽculty in tuning the three parameters by trial and error. After the widespread application of microprocessors, there has been a resurgence of interest in PID control. Even though these PID controllers are very common and well known, they are often not tuned properly, resulting in poor control quality. Since almost all PID controllers are now implemented in software, there is ample scope to incorporate complex algorithms in these controllers. Autotuning is one such feature now being extensively used in commercially available PID controllers (Hoopes et al., 1983; Kraus and Myron, 1984). Although the process reaction curve (PRC) method can be used to obtain the Žrst-order plus time-delay model, the adjustable parameters can then be obtained with the usual tuning rules for PID controllers, such as the integral of time-weighted absolute value of the error, Cohen-Coon and Ziegler–Nichols (Z-N) (1942) methods. Also, the continuous cycling identiŽcation method identiŽes the ultimate gain and frequency, and then the Z-N tuning rule can be used to tune the PID controller. However, the above-mentioned identiŽcation methods cannot be done in an online manner and require tedious procedures. Moreover, identiŽcation performances are poor frequently due to the effects of measurement noises or disturbances. Therefore, many online process identiŽcation methods for automatic tuning of the PID controller have been proposed to overcome these disadvantages (Yuwana, 1982; Schei, 1992; Zhuang and Atherton, 1993; Sung et al., 1998; Tan et al., 2001). However, the identiŽed frequency region by previous methods is too narrow compared to the wide operating frequency region of the controller, so satisfactory control performances cannot be achieved frequently. Also, too much complicated mathematics to let them implement to industrial processes is impossible. To enhance the capabilities of traditional PID tuning techniques and perform the online process identiŽcation without complicated mathematics, several new methods from an artiŽcial intelligent approach, such as genetic algorithms (GAs) (Wang and Kwok, 1994), fuzzy logic controllers (Tzafestas and Papanikolopoulos, 1990; Zhao et al., 1993), and hybrid method for a fuzzy-genetic approach (Wu and Huang, 1997; Bandyopadhyay et al., 2001) have been developed recently to tune the parameters of PID controllers. Since Holland’s work (1975), the applications of GAs have expanded into various Želds (Goldberg, 1989a). With the abilities for global optimization and good robustness, and without knowing anything about the underlying mathematics, GAs are expected to overcome the weakness of traditional PID tuning techniques and to be more acceptable for industrial practice. In the work of Wang and Kwok (1994), it has been shown that GAs give a better performance in tuning the parameters of PID controllers than the Z-N Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 435

method does. However, since the PID parameters generated by GAs are Žxed, PID controllers cannot always effectively control systems with changing parameters. To cope with the above problems, the GAs proposed in this paper are for online autotuning the parameters of PID controllers. In this method, GAs are used to search for the optimal PID parameters that will minimize the integral absolute error (IAE) value when the process in steady state. Since no human expertise is needed in the tuning procedure and since the PID parameters are online adaptive, good control performance can be expected in the proposed method. Also, a realtime experiment on a coupled-tank liquid-level control system designed to mimic an industrial process is provided to illustrate the applicability of the proposed approach under realistic practical conditions. 2. 2.1

Parameter tuning of PID controllers PID controllers

In general, a classical PID control system can be depicted as shown in Figure 1, in which the input–output relation of the PID controller is expressed as u = Kce +

1 t e0 edt + Tde· Ti

(1)

where u is the control signal, e is the error signal, and Kc, Ti and Td denote the proportional gain, the integral gain and derivative gain, respectively. The basic equation of a PID controller in discrete domain is given by (Porter, 1989) mn = Kc

F

en +

T Ti

O n

ek +

k=0

Td (e - e ) T n n-1

G

+ m0

(2)

where m is the manipulated variable, the controller output; e,Kc,Ti and Td are the same as in Equation (1); T is the sampling time and the sufŽxes denote the sampling instants. At the (n-1)th, Equation (2) is modiŽed as mn-1 = Kc

F

en-1 +

T Ti

O n-1

k=0

ek +

Td (e - en-2 ) T n-1

G

+ m0

(3)

Subtracting Equation (3) from Equation (2), the velocity form algorithm of the PID controller is derived:

Figure 1

Block diagram of a classical PID control system

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

436

Online autotuning PID parameters

mn - mn-1 = Kc

F

(en - en-1 ) +

T Td (e - 2en-1 + en-2 ) e + Ti n T n

G

(4)

The right-hand side of Equation (4) is to be evaluated to obtain the new values of Kc, Ti and Td. All the quantities in the above equation, except mn, are known at the (n-1)th sampling instant. If different values of Kc, Ti and Td are chosen, then it is obvious that various responses of the plant will be obtained. Therefore, the parameter tuning problem of a PID controller can be considered by selecting the three parameters Kc, Ti and Td such that the response of the plant will be as desired. For online autotuning the PID parameters, a GA method will be introduced in the following section. 2.2

GAs

GAs and searching algorithms imitate some of the processes of natural evolution. The searching process is similar to the natural evolution of biological creatures, in which successive generations of organisms are born and raised until they themselves are able to breed. Indeed, users are free to utilize those features that are useful and eliminate aspects that seem unimportant in their applications. In such algorithms, the Žttest among a group of artiŽcial creatures can survive and form a new generation. The creatures in the new generation are produced through the structure that includes randomized information or gene exchange. In every new generation, the new creatures (offspring) are produced by using bits and pieces of the Žttest of the older generation in terms of some extended performance criteria. Since normal evolution processes are quite slow, better reproduction based on an aggressive ‘survival of the Žttest’ philosophy is used to speed up the evaluation process, e.g., tournament selection is computationally more efŽcient than the other selection methods (Mitchell, 1998). In order to understand more details about how to use GAs in our work, a brief description of this method is given below. 2.2.1 Encoding: Binary encodings (i.e., bit strings) are the most common encodings for a number of reasons. In their earlier work, Holland and his students concentrated on such encodings and GAs practice has tended to follow this lead. Much of the existing GA theory is based on the assumption of Žxed-length, Žxedorder binary encodings. Much of that theory can be extended to apply to nonbinary encodings, but such extensions are not as well developed as the original theory. In addition, heuristic about appropriate parameter settings (e.g., for crossover and mutation rates) have generally been developed in the context of binary encodings. In spite of these advantages, binary encodings are unnatural and unwieldy for many problems (e.g., evolving weights for neural networks), and they are prone to rather arbitrary orderings. For many applications, it is natural to use an alphabet of many characters or real numbers to form chromosomes. Several empirical comparisons between binary encodings and multiple-character or real-valued encodings have shown better performance for the latter (Wright, 1991; Yang and Kao, 1996; Bessaou and Siarry, 2001), but the performance depends Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 437

very much on the problem and the details of the GA being used, and at present there are no rigorous guidelines for predicting which encodings will work best. 2.2.2 Initialization and population size: The initial population for a GA is a set of solutions to the optimization problem. Good initial populations facilitate a GA’s convergence to good solutions, whereas poor initial populations can hinder GA convergence. There are a variety of approaches for generating initial populations. A common method of population generation is random generation. The initial population is Žlled with individuals that are generally created at random. This approach is efŽcient and provides a population covering the feasible region, but the entire initial population may be unfeasible. An alternative approach is to use information about the problem structure to arrive at better probability values for building initial populations randomly. Therefore, individuals in the initial population are the solutions found by some method determined by the problem domain and knowledge. In this case, the scope of the GA is to obtain more accurate solutions (Hill, 1999; Renner and Ekart, 2003). Although it has been recognized by the GA community that population size plays an important role in the success of the problem-solving process, there is still limited understanding of the effects and merits of dynamically adapting this parameter. In an early paper, DeJong (1975) studied, among other GA aspects, the optimal population size for a set of numerical functions, experimenting with values ranging from 50 to 100. Grefenstette (1986) used a meta-level GA to control the parameters of another GA, Žnding population size values between 30 and 80, but his results were only slightly better than DeJong’s. Goldberg (1989b) stated that a small initial population size can lead to premature convergence, since there are few schemata to process in the initial population. On the other hand, a large population results in a long computational time to gain improvements, imposing a large computational cost per generation. Also, Goldberg’s paper suggests that small population sizes should be selected for serial GA implementation and large population sizes for perfectly parallel GA implementations. Recently, a brief survey of previous work on population size parameter control is proposed in Costa et al. (1999), covering both static and dynamical methods. The paper results indicate that, when no previous information exists, choosing a dynamic random variation control strategy for the population size is a reasonable choice. 2.2.3 Fitness function: In GAs, the Žtness is the quantity that determines the quality of a chromosome, from which a determination can be made as to whether it is better or worse than other chromosomes in the gene pool. The Žtness is evaluated by a Žtness function that must be established for each speciŽc problem. The Žtness function is chosen so that its maximum value is the desired value of the quantity to be optimized. Its importance cannot be overemphasized, because it is the only connection between the GA and the problem in the real world. A Žtness function must reward the desired behaviour; otherwise the GA may solve the wrong problem. Fitness functions should be informative and have regularities. However, they need not be low-dimensional, continuous, differentiable or unimodal (Tsoukalas and Uhrig, 1997). 2.2.4

Selection methods:

The purpose of selection is to emphasize the Žtter indi-

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

438

Online autotuning PID parameters

viduals in the population in hopes that their offspring will in turn have even higher Žtness. Selection has to be balanced with variation from crossover and mutation: too strong a selection means that suboptimal highly Žt individuals will take over the population, reducing the diversity needed for further change and progress; too weak a selection will result in too slow an evolution. The two most common methods are proportional selection (i.e., the roulette wheel) and rankbased selection. In proportional selection, the number of times the gene can be reproduced is proportional to its Žtness function. This technique, which was used by Holland, involves selecting the top performers and allowing multiple reproductions of the best performers. A sampling algorithm is usually used to allocate the number of reproductions to the various genes. The proportional method sometimes tends to give undue emphasis to superior performing chromosomes whose Žtness functions may be 10 times the average Žtness function. If such a super chromosome is reproduced 10 times in a pool of 50 genes, it would clearly distort the gene pool. In the rank-based selection process, each gene is typically reproduced only once, although there are variations of this algorithm that allow multiple reproduction of a single gene. Rank-based selection tends to converge slowly with less premature convergence and better diversity of the gene pool. However, the proportional method requires the computation of the mean Žtness and the expected value of each individual through the population at each generation. Rank scaling requires sorting the entire population by rank. Hence, these two methods have a potentially time-consuming procedure. Tournament selection is similar to rank selection in terms of selection pressure, but it is computationally more efŽcient and more amenable to parallel implementation. Two individuals are chosen at random from the population. A random number r is then chosen between 0 and 1. If r < k (where k is a parameter, for example 0.75), the Žtter of the two individuals is selected to be a parent; otherwise the less Žt individual is selected. The two are then returned to the original population and can be selected again. For more technical comparisons of different selection methods, see Mitchell (1998) and Osyczka et al. (1999). Recently, several papers to modify the tournament selection method have been proposed to improve the population diversity (Matsui, 1999) and optimize the multicriteria problems (Osyczka and Krenich, 2000). 2.2.5 Genetic operators: In each generation, the genetic operators are applied to 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 employed. By using different probabilities for applying these operators, the speed of convergence can be controlled. Crossover and mutation operators must be carefully designed, since their choice highly contributes to the performance of the whole genetic algorithm. 1) Reproduction: A part of the new population can be created by simply copying without change selected individuals from the present population. This gives the possibility of survival for already developed Žt solutions. 2) Crossover: New individuals are generally created as offspring of two parents (i.e., crossover being a binary operator). One or more so-called crossover points Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 439

are selected (usually at random) within the chromosome of each parent, at the same place in each. The parts delimited by the crossover points are then interchanged between the parents. The individuals resulting in this way are the offspring. Beyond one point and multiple point crossover, there exist some crossover types. The so-called arithmetic crossover generates an offspring as a component-wise linear combination of the parents (Yalcinoz, 2002; Lee and Mohamed, 2002; Mondal and Maiti, 2002). In later phases of evolution it is more desirable to keep Žt individuals intact, so it is a good idea to use an adaptively changing crossover rate: higher rates in early phases and a lower rate at the end of the GA (Dagli and Schierholt, 1997). Sometimes it is also helpful to use several different types of crossover at different stages of evolution (Hong and Wang, 1998). 3) Mutation: A new individual is created by making modiŽcations to one selected individual. The modiŽcations can consist of changing one or more values in the representation or adding/deleting parts of the representation. In GAs, mutation is a source of variability and too great a mutation rate results in less efŽcient evolution, except in the case of particularly simple problems. Hence, mutation should be used sparingly because it is a random search operator; otherwise, with high mutation rates, the algorithm will become little more than a random search (Lin and Lee, 1999). Moreover, at different stages, one may use different mutation operators. At the beginning, mutation operators resulting in bigger jumps in the search space might be preferred. Later on, when the solution is close by, a mutation operator leading to slighter shifts in the search space could be favoured (Smith and Fogarty, 1996).

3.

A liquid-level control system

A laboratory-scale coupled-tank system, developed by the authors, is used as a test bed for the proposed method. It consists of two tower-type tanks with an internal pipe in between, as shown in Figure 2. Water from a reservoir ows into the second tank via the Žrst tank through an internal pipe and subsequently back to the reservoir through a drainage pipe. To measure the level of the liquid in the second tank, it relies on the change of liquid’s level which makes oating ball pop up and down. When the oating ball changes its position, the belt which ascends or descends will rotate the sensor (i.e., potentiometer) to generate 0–5 voltage. The whole system is connected to a PC via an AD and DA card (i.e., PCL-8125PG made in Advantech Co., Taiwan). Therefore, the continuous data of the liquid level (i.e., 0–5 voltage) will be sampled by AD card and turned into discrete signals that will be dealt with by computer. After digital signal processing, the computer can send an analogue signal (i.e., 0–10 voltage) to control the pump via DA card. The control objective is to control the water level in the second tank to a prespeciŽed level. The simple block diagram of a closed-loop digital control system is shown in Figure 3. Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

440

Online autotuning PID parameters

Figure 2

Figure 3

3.1.

A liquid-level control system

Block diagram of a digital control system

The transfer function of the system

The transfer function of this liquid-level system was obtained from the most popular of the empirical tuning methods, known as the PCR method, developed by Cohen-Coon (Stephanopoulos, 1984). Cohen-Coon observed that the response of most processing units to an input change had a sigmoid shape, which can be adequately approximated by the response of a Žrst-order system with dead time: G(s) =

Ke-tds

ts + 1

(5)

where K is the process static gain, td is the process dead time and t is the process time constant. From the approximate response of the reaction curve in the liquid-level system, it is easy to estimate the values of these three parameters and the transfer function of this system can be obtained as shown: G(s) =

0.68e-4 s 118s + 1

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

(6)

Teng et al. 441

Then, according to the Cohen-Coon method, it is easy to obtain the three PID controller parameters (i.e., Kc = 5.82, Ti = 9.7 s, and Td = 1.5 s) in Equation (1). 3.2

Genetic tuning methodology

In this method, the GAs is used to search for the optimal PID parameters that will minimize the IAE value when the process is in steady state. Therefore, the parameter tuning problem of a PID controller using GAs can be considered by selecting the three parameters Kc,Ti and Td such that the response of the plant will be as desired as shown in Figure 4. The details of the GAs used in this paper are given in the following. The encoding used real numbers to form chromosomes. The population size used here is eight tribes. The tribe is composed of three PID parameters, which used to describe the liquid-level control system. Because we do not know what PID value is the best value for the system, we gave the system many tribes, composed of random PID values around the values obtained from the Cohen-Coon method in the beginning. The Žtness function is calculated from the IAE, which will minimize the IAE value when the process is in steady state as shown: Fitness function = et0 ueudt

(7)

The selection method chosen has been the roulette wheel and tournament selection methods, in order to compare the speed of search and the controller performance. Regarding the genetic operators, there are 20% of the Žttest individuals unaltered into the next generation to ensure that the best organism will not disappear in each generation. The crossover operation conducts the most creative kind of search, which is why we use it to produce around 76% of the offspring in each generation. Finally, about 4% of the mutation rate in this case undergoes mutation, in the hope that a random modiŽcation of the relatively Žt individuals will lead to improvement (Koza et al., 2003). Therefore, the GAs work in this paper as follows (i.e., also shown in Figure 5): 1) The eight initial population tribes are Žlled with individuals that are generally created at random. Sometimes, the individuals in the initial population are the solutions found by some method determined by the problem domain. In this

Figure 4 Block diagram of the proposed GA method for parameter tuning of PID controllers Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

442

Online autotuning PID parameters

Figure 5

2) 3) 4) 5) 6)

Flowchart of the GAs in a liquid-level control system

paper, we gave random values to these initial populations but limited their ranges around the values obtained from the Cohen-Coon method because PID parameters too large or too small result in a long search time. Although the ranges of PID values are rationally chosen by arbitrary and it is true that the limitation will inuence the results of the GA search, it is intended to obtain more stable, efŽcient and accurate solutions. Every generation is applied in liquid-level control system, which was described by PID parameters and produced a group of errors that calculated the IAE value from transient to steady state. Each individual in the current population is evaluated using the Žtness function. If the termination criterion [i.e., the generation number > preset number (20 or 40)] is met, the best solution (i.e., PID parameters) is returned. From the current population, individuals are selected based on the previously computed Žtness values. A new population is formed by applying the genetic operators (i.e., reproduction, crossover, and mutation) to these individuals. Actions starting from step (2) are repeated until the termination criterion is satisŽed. An iteration is called a generation. Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 443

4.

Real-time experimental results

The proposed GA method has been applied in the real-time experiment on a liquid-level control system for online autotuning PID parameters. In each realtime experiment, we make the liquid-level control system run for 150 s for a group of PID parameters. There are eight tribes in every generation and every tribe has 150 s (from the bottom to a set level of the liquid control system) to accumulate their errors. Better PID parameters obtain smaller IAE values. Hence, our proposed method can automatically choose the best PID parameters for each generation. Then, using the GAs to create the new population for another eight tribes of PID parameters, it can continuously control the liquid-level system until the preset iteration number reached. Finally, the best PID parameters can be obtained. Two selection methods have been compared in this paper. The Žrst one was using the roulette wheel selection. In every generation, we compare every Žtness value, and better Žtness values included in larger sector of a circle can be obtained than worse ones. The area of the sector equals to the percentage of opportunity that is chosen for crossover. In other words, the better Žtness values get the larger chance to ‘survive’. As described before, we determine the best PID parameters by the smallest errors (i.e., IAE), which generate the PID control formula and applied these parameters in the liquid control system. Figure 6 demonstrates the errors compared at different numbers of generations. In Figure 7, we can observe the response of the liquid-level control system. The upper curve is the response of plant (i.e., the height of the liquid level) and the lower curve is the output of

Figure 6 Twenty generations of accumulated errors (i.e., IAE values) from the roulette wheel selection method [the abscissa indicates the number of generation and each generation has eight tribes (i.e., eight groups of PID)] Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

444

Online autotuning PID parameters

Figure 7 The best PID parameters to control the liquid-level system from 20 generations using the roulette wheel selection method (the dotted line indicates the set point level; controller output is the voltage of pump’s output and the control height is the liquid level; the Kc,Ti and Td are the three PID parameters)

the controller (i.e., the pump output). The dotted line is the set-point level. Obviously, when the system is in a steady-state response, the upper curve is not really good at following the set-point level. The second method is the tournament selection, which is very different from the roulette wheel selection in that it can Žlter out the worse Žtness values directly and keep the better ones. Because tournament selection has this kind of property it can avoid sophisticated algebraic calculation. The speed of the search is much faster than in roulette wheel selection. Figure 8 describes the errors compared at different numbers of generations just like Figure 6. For ease of comparison, the conditions (i.e., generation number) of these two experiments are the same. It is obvious that the errors decrease faster and more smoothly than that in roulette wheel selection. Figure 9, the same as Figure 7, shows the response of the liquidlevel control system. The upper curve is a little bit better than Figure 7 in following the set-point level and the lower curve is more stable than Figure 7 from a controller output point of view. This result shows that tournament selection can search for optimal PID parameters more rapidly than that of roulette wheel selection. However, good PID parameters should have a short rising time and smaller steady-state errors. Proportional gain, integral time constant and derivative time constant can affect the liquid-level control system separately. These three parameters are a group of PID parameters and should operate in co-ordination. Hence, we need more generations of evolution. In previous experiments, we just ran 20 generations. In order to obtain more accurate parameters, we prolong the generation; in other words, we increase the generations of the evolution. Figure 10 is Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 445

Figure 8 Twenty generations of accumulated errors (i.e., IAE values) from the tournament selection method (the notation in the Žgure is the same as in Figure 6)

Figure 9 The best PID parameters to control the liquid-level system from the 20-generation tournament selection method (the notation in the Žgure is the same as in Figure 7)

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

446

Online autotuning PID parameters

Figure 10 Forty generations of accumulated errors (i.e., IAE values) from the roulette wheel selection method (the notation in the Žgure is the same as in Figure 6)

an experiment that has 40 generations. Obviously, the accumulated errors are much smaller than the experiments with 20 generations. According to Figure 10, we know that GAs can obtain more accurate results by more evolutions. This is just like Darwinian principles of evolution and natural selection. Figure 11 is the response of the liquid-level control system and shows a better response than do Figures 7 and 9. We also performed the experiment using tournament selection with 40 generations in comparison with roulette wheel selection. In Figure 12, the accumulated errors as before decrease faster and more smoothly than in roulette wheel selection. Also, in Figure 13 we can Žnd that the rising time is shorter than in roulette wheel selection and the static error is also smaller. Rising time determines the transient response and a short rising time makes a small accumulated error. Furthermore, the oscillation of the steady-state response is smaller and demonstrates that it is a stable liquid-level control system. This result proves that more generations produce better offspring. 5.

Conclusions and future work

In this paper, a simple GA method has been applied in the real-time experiment of a liquid-level control system for online autotuning PID parameters. Our proposed method can automatically choose the best PID parameters for each generation, and we use a real liquid-level control system to evaluate the chromosomes (individual of the population) by measuring the error signal. This means that each evaluation of a chromosome needs a trial run of the liquid-level control system. Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 447

Figure 11 The best PID parameters to control the liquid-level system from 40 generations using the roulette wheel selection method (the notation in the Žgure is the same as in Figure 7)

Figure 12 Forty generations of accumulated errors (i.e., IAE values) from the tournament selection method (the notation in the Žgure is the same as in Figure 6) Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

448

Online autotuning PID parameters

Figure 13 The best PID parameters to control the liquid-level system from the 40-generation tournament selection method (the notation in the Žgure is the same as in Figure 7)

However, if we apply the proposed PID-parameter tuning method to control of a real process, those random PID parameters (in the GA’s initial stage) may cause the system to become unstable. Hence, in this paper, the initial parameters of the PID (i.e., Kc = 58.2, Ti = 9.7 s and Td = 1.5 s) were derived from the Cohen-Coon method (not from random values) in order to make sure that the real system can converge in the stable condition. Moreover, the Žnal best PID parameters (i.e., Kc = 17.3, Ti = 6.8 s and Td = 1.7 s) in Figure 13 are not very far away from the initial parameters. This means that the individuals in the initial population found by some method determined by the problem domain and knowledge are easy and can obtain more accurate solutions faster and more easily. However, according to the GAs, the size of the tribes, rate of crossover and rate of mutation could affect the result of GAs’ searching and may cause the system to become divergent. Hence, in the next stage, the simulation in the plant model is needed to test the different GA parameters combination in order to obtain the best PID parameters. Then, such parameters can be initialized as the initial population to ensure that such trial runs of a real process are stable and convergent. Fuzzy logic, neural networks and GAs are three popular artiŽcial intelligence techniques widely used in many applications. Because of their distinct properties and advantages, they are currently being investigated and integrated to form models or strategies in areas of system control. In control engineering, the fusion of fuzzy logic, neural networks and GAs is steadily growing (Wu and Huang, 1997; Lian et al., 1998; Bandyopadhyay et al., 2001; Koza et al., 2003). Therefore, using the hybrid intelligent approach for autotuning a PID controller may provide more suitable PID parameters. Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Teng et al. 449

Acknowledgements The authors wish to thank the National Science Council (NSC) in Taiwan (Grant Number: NSC90-2212-E-155-002) for supporting this research. References Bandyopadhyay, R., Chakraborty, U.K. and Patranabis, D. 2001: Autotuning a PID controller: A fuzzy-genetic approach. Journal of Systems Architecture 47, 663–73. Bessaou, M. and Siarry, P. 2001: A genetic algorithm with real-value coding to optimize multimodal continuous functions. Structure and Multidisciplinary Optimization 23, 63–74. Costa, J.C., Tavares, R. and Rosa, A. 1999: An experimental study on dynamic random variation of population size. Proceedings of IEEE SMC’99 Conference on Systems, Man, and Cybernetics, Vol. 1, Tokyo, Japan, 607–12. Dagli, C.H. and Schierholt, K. 1997: Evaluating the performance of the genetic neuro scheduler using constant as well as changing crossover and mutation rates. Computers in Industry and Engineering 33, 253–56. DeJong, K.A. 1975: An analysis of the behavior of a class of genetic adaptive systems. PhD thesis, University of Michigan, Ann Arbor, Michigan. Goldberg, D.E. 1989a: Genetic algorithms in search, optimization and machine learning. Reading, Massachusetts: Addison-Wesley, 122–24. Goldberg, D.E. 1989b: Sizing populations for serial and parallel genetic algorithms. Proceedings of the Third International Conference on Genetic Algorithms and Their Applications. San Mateo, California, Morgan Kaufmann, 70– 79. Grefenstette, J.J. 1986: Optimization of control parameters for genetic algorithms, IEEE Transactions on Systems, Man and Cybernetics, SMC-16, 122–28. Hill, R.R. 1999: A Monte Carlo study of genetic algorithm initial population generation methods. Proceedings of the 1999 Winter Simulation Conference, Vol. 1, Phoenix, Arizona, 543–47. Holland, J. 1975: Adaptation in natural and artiŽcial systems. Ann Arbor, Michigan: University of Michigan Press. Hong, T.P. and Wang, H.S. 1998: Automatically adjusting crossover ratios of mul-

tiple crossover operators. Journal of Information Science and Engineering 14, 369–90. Hoopes, H.S., Hawk, W.M. and Lewis Jr, R.C. 1983: A self-tuning controller. ISA Transactions 22, 49–58. Koza, J.R., Keane, M.A. and Streeter , M.J. 2003: Evolving inventions. ScientiŽc American, 40–47. Kraus, T.W. and Myron, T.J. 1984: Self-tuning PID controller uses pattern recognition approach. Control Engineering. 106–11. Lee, K.Y. and Mohamed, P.S. 2002: A realcoded genetic algorithm involving a hybrid crossover method for power plant control system design. Proceedings of the 2002 Congress on Evolutionary Computation, Vol. 2, 1069–74. Lian, S.T., Marzuki, K. and Rubiyah, Y. 1998: Tuning of a neuro-fuzzy controller by genetic algorithms with an application to a couple-tank liquid-level control system. Engineering Applications of ArtiŽcial Intelligence, 11, 517–29. Lin, C.T. and Lee, C.S.G. 1999: Neural fuzzy systems – a neuro-fuzzy synergism to intelligent systems. Singapore: Prentice Hall International. Matsui, K. 1999: New selection method to improve the population diversity in genetic algorithms. IEEE International Conference on Systems, Man, and Cybernetics 1, 625–30. Mitchell, M. 1998: An introduction to genetic algorithms. Cambridge, Massachusetts. The MIT Press. Mondal, S. and Maiti, M. 2002: Multi-item fuzzy EOQ models using genetic algorithm. Computers & Industrial Engineering 44, 105– 17. Osyczka, A. and Krenich, S. 2000: A new constraint tournament selection method for multicriteria optimization using genetic algorithm. Proceedings of the 2000 Congress on Evolutionary Computation, California, 501–08. Osyczka, A., Krenich, S. and Kundu, S. 1999: Proportional and tournament selections for constrained optimization problems using

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

450

Online autotuning PID parameters

genetic algorithms. Evolutionary Optimization 1, 89–92. Porter, B. 1989: Issues in the design of intelligent control systems. IEEE Control Systems Magazine, 97–99. Renner, G. and Ekart, A. 2003: Genetic algorithms in computer aided design. Computeraided Design 35, 709–26. Schei, T.S. 1992: A method for closed loop automatic tuning of PID controllers. Automatica 28, 587–91. Smith, J. and Fogarty, T.C. 1996: Self adaptation of mutation rates in a steady state genetic algorithm. Proceedings of the IEEE Conference Evolutionary Computation, Nagoya, Japan, 318–23. Stephanopoulos, G. 1984: Chemical process control – an introduction to theory and practice. Englewood Cliffs, New Jersey: Prentice-Hall. Sung, S.W., Lee, I.B. and Lee, J. 1998: New process identiŽcation method for automatic design of PID controllers. Automatica 34, 513–20. Tan, K.K., Lee, T.H. and Jiang, X. 2001: Online relay identiŽcation, assessment and tuning of PID controller. Journal of Process Control 11, 483–96. Tsoukalas, L.H. and Uhrig, R.E. 1997: Fuzzy and neural approaches in engineering. New York: John Wiley & Sons. Tzafestas, S. and Papanikolopoulos, N.P. 1990: Incremental fuzzy expert PID control. IEEE Transactions on Industrial Electronics 37, 365–71.

Wang, P. and Kwok, D.P. 1994: Optimal design of PID process controllers based on genetic algorithms. Control Engineering Practice 2, 641–48. Wright, A.H. 1991: Genetic algorithm for real parameter optimization. Proceedings of Foundations of Genetic Algorithms’91. San Mateo, California: Morgan Kaufman, 205– 18. Wu, C.J. and Huang, C.H. 1997: A hybrid method for parameter tuning of PID controllers. Journal of the Franklin Institute 334B, 547–62. Yalcinoz, Y. and Altun, H. 2002: Environmentally constrained economic dispatch via a genetic algorithm with arithmetic crossover. IEEE AFRICON Conference, Vol. 2, 923–28. Yang, J.M. and Kao, C.Y. 1996: A combined evolutionary algorithm for real parameters optimization. In: Proceedings of IEEE International Conference on Evolutionary Computation, Nagoya, Japan, 732–37. Yuwana, S. 1982: A new method for on-line controller tuning. AIChE Journal 28, 434–40. Zhao, Z.Y., Tomizuka, M. and Isaka, S. 1993: Fuzzy gain scheduling of PID controllers. IEEE Transactions on Systems, Man, and Cybernetics 23, 1392–98. Zhuang, M. and Atherton, D.P. 1993: Automatic tuning of optimum PID controllers. IEE Proceedings Part D 140, 216–24. Ziegler, J.G. and Nichols, N.B. 1942: Optimum settings for automatic controllers. Transactions of the ASME 65, 433–44.

Downloaded from http://tim.sagepub.com at PENNSYLVANIA STATE UNIV on April 17, 2008 © 2003 SAGE Publications. All rights reserved. Not for commercial use or unauthorized distribution.

Suggest Documents