Application of Genetic Programming for Fine Tuning PID Controller ...

1 downloads 0 Views 316KB Size Report
Tuning PID Controller Parameters Designed through Ziegler-Nichols Technique. Gustavo Maia de Almeida1, Valceres Vieira Rocha e Silva1, Erivelton Geraldo.
Application of Genetic Programming for Fine Tuning PID Controller Parameters Designed through Ziegler-Nichols Technique Gustavo Maia de Almeida1 , Valceres Vieira Rocha e Silva1 , Erivelton Geraldo Nepomuceno1 and Ryuichi Yokoyama2 1 Laborat´ orio de Sistemas e Sinais Departamento de Engenharia El´etrica Universidade Federal de S˜ ao Jo˜ ao del-Rei P¸ca. Frei Orlando, 170 36307-352 - S˜ ao Jo˜ ao del-Rei, MG, Brazil 2 Tokyo Metropolitan University Electrical Engineering 1-2 Minami-Osawa Hachioji - Tokyo 193.0397 Japan

Abstract. PID optimal parameters selection have been extensively studied, in order to improve some strict performance requirements for complex systems. Ziegler-Nichols methods give estimated values for these parameters based on the system’s transient response. Therefore, a fine tuning of these parameters is required to improve the system’s behavior. In this work, genetic programming is used to optimize the three parameters Kp , Ti and Td , after been tuned by Ziegler-Nichols method, to control a high-order process, a large time delay plant and a highly non-minimum phase process. The results were compared to some other tuning methods, and showed to be promising.

1

Introduction

Most industrial processes are controlled by proportional-integral-derivative (PID) controllers [2] and [13]. The popularity of PID controllers is due to their simplicity both from the design and parameter tuning points of view. To implement such a controller, three parameters, namely the proportional gain Kp , the integral time Ti , and the derivative time Td must be determined in order to make the system operation more efficient. Ziegler and Nichols (1942) proposed a method to determine the values of Kp , Ti and Td , based on the transient response characteristics of a process to be controlled. When the PID controller parameters are tuned by ZN, the closed loop system’s response can present an overshoot up to 25%. Therefore, a fine adjustment is needed to improve the transient response. This fine adjustment can be made by various ways [3], but usually it is done by trial-and-error, what demands experience and certain time.

The approach presented here aims to minimize this problem, by applying GP to optimize the solutions obtained for the PID controllers through ZN method, in order to enhance system’s performance and stability. Since GP has shown to be a valuable and robust technique in assisting the engineers to solve complex engineering problems [1], [6], [7] and [8], we propose the use of this tool for a control tuning purpose, applying a GP algorithm to fine tuning the PID parameters, previously adjusted through the ZN tuning method. This paper is organized as follows: Section 2 describes ZN tuning. Section 3 gives an overview of GP. Section 4 explains the methodology used. Section 5 presents the results obtained and finally, in Section 6, the conclusions reached on the use of PG applied with ZN are presented.

2

Tuning with Ziegler Nichols method

The Ziegler-Nichols methods to determine the values of the proportional gain K p , the integral time Ti and the derivative time Td , are based on the characteristics of the transient response of a process to be controlled, and is implemented by taking account the experiments with the process. For both methods proposed, the aim is to achieve an overshoot below 25%, for a step input response. For the purpose of this work, the critical period method was used, once this method is suitable to solve the problem of tunning the PID parameters for the plant in question. The critical period method consists of determining the point where the Nyquist plot of the open-loop system intersects the negative real axis. This point obtained by connecting a purely proportional controller to the system, and by increasing the controller gain until the closed-loop system reaches the stability limit, at which oscillations occur. The oscillation period is denoted by T c and the corresponding critical gain by Kc . The ZN choice for the three PID parameters according to Table 1, Tc and Kc parameters were applied in the Equation 1. P ID = Kp (1 +

1 + Td s), Ti s

(1)

However, this needs fine adjustments so that its transient response can present Table 1. PID controller parameters tuning by ZN method Type of Controller Kp Ti Td P 0.5Kc Tc PI 0.45Kc 1.2 Kc Tc Tc PID 1.7 2 8

satisfactory characteristics, since the ZN tuning, often gives a high overshoot what is not desirable.

3

Genetic Programming

The GP is part of the evolutionary computation [10] and [12] that uses the concepts of the natural selection of Darwin and the genetics of Mendel in the computation environment. In such algorithms, the fittest among a group of artificial creatures can survive and constitute a new generation. In every new generation, a new offspring is created using features of the fittest individuals of the current population. Even a simple GP can give satisfactory results in a large variety of engineering optimization problems [6], [5], [8]. GP main operators are: reproduction, crossover and mutation. Given an optimization problem, GP run iteratively using the three operators in a random way but based on the fitness function to perform evaluation. Fitness is a numeric value assigned to each member of a population to provide a measure of the appropriateness of a solution to the problem in question. Fitness functions are generally based upon the error between the actual and predicted solutions. However, error based measures decrease for better solutions. The overall operation of a GP can be better explained through the flowchart shown in Figure 1, where i refers to an individual in the population of size M . The “Generation” gives the number of the current generation. The flowchart can be divided in three parts: 1. creation of an initial population of random functions and terminals; 2. iteratively perform of the following sub-steps until the termination criterion has been achieved: a) simulation of the algorithm for each individual in the population and assign a fitness value according to how well it behaves; b) creation of a new population of computer programs by, (i) copying existing computer programs into the new population; (ii) creating new computer programs by genetically recombining randomly chosen parts of two existing programs; (iii) creating a new computer program introducing random changes. This operation is applied to the chosen computer program(s) with a probability based on their fitness in the population structure; 3. the best computer program that appeared in any generation, is designated as the result of genetic programming simulation. This result may be a solution (or an approximate solution) to the problem.

4

Genetic programming and Ziegler-Nichols for PID controller design

The GP was applied to fine adjust the three parameters of a PID controller, tuned through ZN, for the closed-loop system shown in Figure 2, where “Plant” is a system to be controlled and “Controller”, is a PID strategy controller, described by the transfer function in Equation (1).

Firstly, ZN is applied for determining the three parameters of the controllers. After, the values Kp , Ti and Td determined by ZN will constitute the set of terminals, having its values varying from 0 to 10 times the values previously determined. In this way, one of the biggest problem of evolutionary computation, of determining the search interval is decided. Whereas, if ZN was not used as initial condition to generate the initial population for the PG, the simulation could have been much higher. Thus GP algorithm starts by creating a population of 500 individuals that will be evolved for 30 generations, randomly combining elements from the problem specific function sets and terminal sets. Each individual program (controllers) of the initial population is then assessed for its fitness. This is usually accomplished by simulating each one of them in a set of predefined input data called fitness cases, and by assigning a numerical fitness value for each individual according to some numerical combination. Genetic operations, including reproduction, crossover, and mutation, are then performed based on each individual fitness value. Individuals are randomly selected to undergo the genetic operations. The selection function is biased towards the highly fit programs and the objectives and constraints to be optimized for these functions are: – steady-state error (ess ) less than 1%; – overshoot (Mp ) not exceeding 5%; – the smallest settling time ts . The transfer functions used to evaluate the performance of GP are a highorder process G1 (s), a process with a larger time delay G2 (s), and a highly non-minimum-phase process G3 (s). These systems are shown respectively by Equations (2)-(4). GP applied together with ZN tuning was compared to some other tuning methods based on the step responses: the Magnitude Optimum Multiple Integrations (MOMI)[11], the Ziegler Nichols (ZN) [14], Chien-HronesReswick (CHR) [4] and Refined Ziegler Nichols (RZN) [3]. G1 (s) =

1 (1 + s)8

(2)

e−5s (3) (1 + s)2 (1 − 10s) G3 (s) = (4) (1 + s)3 The parameters Kp , Ti and Td used for tuning the controller PID through MOMI, ZN, CHR, RZN have been shown in Vrancic et al., (1998). G2 (s) =

5 5.1

Results Case 1 - High-order process

The PID parameters determined by the five different tuning methods, the constraints and objective values are given in Table 2.

The closed-loop step responses obtained for the four PID tuning methods for the system G1 are shown in Fig. 3. The settling time for the GP tuning method is shorter than the achieved for the three other schemes, and the overshoot is smaller either. In this case, for the ZN tuning method, the system is unstable. Table 2. PID parameters, constraints and objective values obtained simulating G1 (s). Parameters and variables Kp Ti Td β ess (%) Mp (%) ts (s)

5.2

GP 0.68 4.63 1.47 0.00 4.40 10.02

MOMI 0.75 4.80 1.37 0.00 8.17 16.74

ZN 2.34 10.77 1.72 -

RZN 0.35 4.53 1.14 0.88 0.00 0.00 30.04

CHR 1.48 9.06 2.02 0.00 48.54 23.22

Case 2 - Large time delay plant

The PID parameters determined by the five different tuning methods, the constraints and objectives values are given in Table 3. The closed-loop step responses obtained for the five PID tuning methods for the system G2 are shown in Fig. 4. The responses for the GP controller and the MOMI controller are almost indistinguishable, but superior than for the ZN, RZN, and CHR regulators. The system responses for the GP and MOMI controllers exhibits almost no overshoot. Table 3. PID parameters, constraints and objective values obtained simulating G2 (s). Parameters and variables Kp Ti Td β ess (%) Mp (%) Ts (s)

5.3

GP 0.49 3.56 0.99 0.00 3.41 9.90

MOMI 0.52 3.58 1.05 0.00 6.60 15.21

ZN 0.77 13.20 2.11 0.004 7.60 59.11

RZN 0.15 2.02 0.38 2.10 0.00 0.00 23.85

CHR 0.49 3.67 2.48 0.00 4.35 16.31

Case 3 - A highly non-minimum-phase process

The PID parameters determined by the five different tuning methods, the constraints and objective values are given in Table 4.

The closed-loop step responses obtained for the five PID tuning methods for the system G3 are shown in Fig. 5. It can be observed that the response for the MOMI controller has the smallest overshoot but for the GP controller the rise time and settling time are smaller than for the others. The system is unstable for the ZN and CHR tuning methods. Table 4. PID parameters, constraints and objective values obtained simulating G3 (s). Parameters and variables Kp Ti Td β ess (%) Mp (%) Ts (s)

6

GP 0.14 2.31 0.006 0.00 2.32 24.65

MOMI 0.13 2.62 0.71 0.00 0.00 38.14

ZN 0.26 9.36 2.34 -

RZN 0.15 1.91 0.37 1.98 0.01 118.34 43.73

CHR 0.20 1.36 2.20 -

Discussion and Conclusion

The individuals (controllers) of the first generation had very poor fitness, which presented a high overshoot, a high settling time and a small steady-state error. As the simulation carried out, and the genetic operations being performed, the parameters started to have fitness values converged around the ideal, what can be seen in Fig. 6, where the best individuals of the first generations do not present a good result, but with elapsing of the generations, could be noticed, they approach to an optimal response. During the simulation, good individuals were preserved, but many of them were lost. The GP algorithm undertook some modifications such that, less good individuals could be rejected. Then, the GP algorithm started to give better individuals in elapsing of the generations until the best individual, with good characteristics is achieved, and for which, fitness is in accordance with the presented in Section 4. This work presented a novel optimal-tuning technique for the classical PID controllers based on the GP applied to ZN fine tuning. The design, implementation and testing of this approach were discussed and compared with traditional tuning methods. An overview of genetic programming has been offered. Three cases were studied: a high-order process, a process with a larger time delay, and a highly non-minimum-phase process. GP applied to ZN fine tuning platform revealed to be a simple and efficient tool to controller parameters tuning, showing a great purpose to minimize the settling time of the system with a minimum overshoot, and also with null steady state error. This performance was shown through the simulation of three examples, for five different PID tuning methods. The approach presented here

performed better than ZN, RZN, CHR, and MOMI. Comparing the systems responses to a unity step input, the GP method generally gives very small overshoot, little oscillations, and better or comparable settling time, even for the large plant, what suggests to be viable the application of GP to controller parameters tuning. GP combined with ZN method demonstrated to have an important characteristic of starting the parameters optimization search in a pre-defined interval. Therefore, minimizing the evolutionary computation problem of determining the accurate search interval, which choice has actually been made by trial and error, increasing the computational time of these algorithms simulations. It is important to stand out also that in systems where ZN is not applied, only GP can be used. However, the search interval must be defined by attempt and error, what will demand higher computation time to reach satisfactory results. But GP can still be applied to any type of system.

References 1. Almeida, G. M., Silva, V. V. R., Nepomuceno, E. G.: Programa¸ca ˜o Gen´etica em Matlab, Uma aplica¸ca ˜o na aproxima¸ca ˜o de fun¸co ˜es matem´ aticas. Anais do Congresso Brasileiro de Autom´ atica. (2004) (in portuguese) 2. Astrom, K. J., Hagglund, T.: PID Controllers: Theory, Design, and Tuning. Instruments Society of America. 2 edn (1995) 3. Astrom, K. J., Hagglund, T., Hang, C. C., Ho, W. K.: Automatic tuning and adaptation for PID controller - a survey. Control Engineering Practice 4 (1993) 699–714 4. Chien, Hrones, Reswick: On the automatic tuning of generalized passive systems. Transactions ASME 74 (1952) 175–185 5. Grosman, B., Hagglund, Lewin, D. R.: Automated nonlinear model predictive control using genetic programming. Computers and Chemical Engineering 26 (2002) 631–640 6. Hinchliffe, M. P., Willis, M. J.: Dynamic systems modelling using genetic programming. Computers and Chemical Engineering 27 (2003) 1841–1854 7. Koza, J. R.: Genetic Programming: On the Programming of Computers by Natural Selection. MIT Press, Cambridge, MA (1992) 8. Koza,J. R., Bennett III, F.H., Andre, D., Keane, M. A.: A Synthesis of topology and sizing of analog electrical circuits by means of genetic programming. Computer Methods in Applied Mechanics and Engineering 186 (2000) 459–482 9. Luyben, W. L.: Process modelling simulation and control for chemical engineers . Mc Graw Hill 2 edn (1990) 10. Tan, K.C., Lim, M.H., Yao, X., Wang L.P. (Eds.): Recent Advances in Simulated Evolution And Learning. World Scientific, Singapore (2004) 11. Vrancic, D., Peng, Y., Strmenik, S.: A new PID controller tuning method based on multiple integrations. Control Engineering Practice 7 (1998) 623–633 12. Yao, X.: Evolutionary Computation: Theory and Applications. World Scientific, Singapore (1999) 13. Yu, C. C.: Auto-tuning of PID Controllers. Berlin: Springer 7 edn (1999) 14. Ziegler, J. G., Nichols, N. B.: Optimum settings for automatic controllers. Transactions ASME 62 (1942) 759–768

Fig. 1. Flowchart of a generic GP algorithm.

Fig. 2. Closed-loop system

1.4 GP MOMI CHR RZN

1.2

1

0.8

0.6

0.4

0.2

0 0

10

20

30 Time (s)

40

50

60

Fig. 3. Step responses of the closed-loop system for G1 (s).

1.2

1

0.8 GP MOMI ZN CHR RZN

0.6

0.4

0.2

0

−0.2 0

10

20

30 Time (s)

40

50

Fig. 4. Step responses of the closed-loop system for G2 (s).

60

2.5 GP MOMI RZN

2 1.5 1 0.5 0 −0.5 −1 −1.5 −2 0

10

20

30 Time (s)

40

50

60

Fig. 5. Step responses of the closed-loop system for G3 (s).

1.5 1 G (s)

0.5 0 0 2

1

10

20

30 Time (s)

40

50

60

50

60

50

60

1 G2(s)

0 −1 0 2

10

20

30 Time (s)

40

0 G (s) 3

−2 0

10

20

30 Time (s)

40

Fig. 6. The best individual of each generation.