Swarm intelligence based system identification and

0 downloads 0 Views 408KB Size Report
Reference to this paper should be made as follows: Valarmathi, K., .... where q–1 is the backward shift operator and A, B, C are polynomials and are defined by.
Int. J. Computer Aided Engineering and Technology, Vol. 3, Nos. 5/6, 2011

Swarm intelligence based system identification and controller tuning K. Valarmathi* and J. Kanmani Department of Instrumentation and Control Engineering, Kalasalingam University, Krishnankoil, Tamilnadu, India E-mail: [email protected] E-mail: [email protected] *Corresponding author

D. Devaraj Department of Electrical and Electronics Engineering, Kalasalingam University, Krishnankoil, Tamilnadu, India E-mail: [email protected]

T.K. Radhakrishnan Department of Chemical Engineering, National Institute of Technology, Trichy, Tamilnadu, India E-mail: [email protected] Abstract: This paper presents an application of particle swarm optimisation (PSO) for system identification and tuning of the proportional integral (PI) controller in pH process. Two independent swarms are used sequentially for system identification and PI controller tuning. The proposed PSO utilises self tuning regulator to search for the changes in system parameters and to calculate the corresponding controller parameters. The self tuning regulator has a parameter identification function and requires neither prior knowledge nor training data for learning. Once the process parameters are identified, another PSO is applied to find the optimal controller setting. The performance of the proposed PSO approach is compared with the traditional Ziegler Nichols tuning and internal model control for various set point and trajectory response of the pH process. The simulation results show that the cascaded PSOs are very effective to adapt the controller to dynamic plant characteristic changes in pH process. Keywords: PI controller; system identification; particle swarm optimisation; PSO; pH process; Ziegler Nichols tuning; internal model control; IMC. Reference to this paper should be made as follows: Valarmathi, K., Kanmani, J., Devaraj, D. and Radhakrishnan, T.K. (2011) ‘Swarm intelligence based system identification and controller tuning’, Int. J. Computer Aided Engineering and Technology, Vol. 3, Nos. 5/6, pp.443–457.

Copyright © 2011 Inderscience Enterprises Ltd.

443

444

K. Valarmathi et al. Biographical notes: K. Valarmathi is Associate Professor at Kalasalingam University, Krishnan koil, Tamilnadu. She received her PhD in Intelligent Techniques for system identification and controller tuning from Anna University, Chennai. Her research areas of interest include intelligent control, process control. She has published in journals such as the Elsevier and Brazilian Journal of Chemical Engineering. J. Kanmani is Senior Lecturer at Kalasalingam University, Krishnan koil. She received her MTech in Control and Instrumentation and her areas of interest are controller tuning and system identification. D. Devaraj is Professor and Project Director at TIFAC CORE, Kalasalingam University, Krishnan koil. He received his PhD in Power System Security from IIT, Chennai. His current research focuses on intelligent system and power system automation. He has published in journals such as the Elsevier, Inderscience and IEE proceeding. T.K. Radhakrishnan is Professor of National Institute of Technology, Trichy, Tamilnadu. He received his PhD in Process Control from Bharathidasan University, Trichy. His current research focuses on intelligent control and advanced process control. He has published in journals such as the Taylor and Francis, Chemical Engineering and Technology. This paper is a revised and expanded version of a paper presented at the International Conference on Advanced Manufacturing and Automation held at Kalasalingam University (Kalasalingam Academy of Research and Education), Anand Nagar, Krishnankoil, Tamilnadu, India on 26–28 March 2009.

1

Introduction

The regulation and control of pH process is a typical problem found in a variety of industries including pharmaceuticals, biotechnology and chemical processing. The high performance and robust pH control is often difficult to achieve due to its nonlinear characteristics. For many years PID controllers have been used for the control of pH process. Tuning of PID controllers is needed to obtain the satisfactory performance. There are many methods for tuning PID gains namely Ziegler-Nichols (ZN), Cohen and Coon, internal model control (IMC) and performance criteria optimisation. Ziegler-Nichols tuning (Astrom and Hagglund, 2001) is one of the most widely used method to tune the PID controllers. Tuning the controller by Ziegler-Nichols method does not provide optimum system response since they are dependent on the exact mathematical model of a process. Cohen and Coon method (Shinskey, 1996) requires limited process knowledge but it offers low damping and high sensitivity to the system. Internal model control (Yamada and Watanabe, 1996) is easy to shape sensitivity function but for unstable plants it cannot be applied. Recently evolutionary computation techniques like genetic algorithm (Varsek et al., 1993) have been applied to obtain the optimal controller setting. The general weakness of the above methods is that the transient response will be worse if the plant dynamics change. It must be noticed that a number of plants has its dynamics changed by external factors. To assure an environmentally independent good performance, the controller must have the ability to adapt to plant dynamic characteristics changes. This is achieved through adaptive control methods.

Swarm intelligence based system identification and controller tuning

445

The most used adaptive control schemes (Lin and Brandt, 2000) are gain scheduling, model reference adaptive control (MRAC), dual control and self-tuning regulator (STR). The gain scheduling and the MRAC are direct methods, as the adjustment mechanism makes the controller parameters adjusts directly. The dual control uses the nonlinear stochastic control theory for a non-heuristic adaptive control approach. As this technique is too complicated it has not been used for practical problems. Self tuning regulator estimates the process parameters to adapt the controller to its dynamic changes. The problem with this approach is that small model error can lead to large parameter changes, which oscillate the process variables (Astrom and Wittenmark, 1995). Alternatively, optimisation techniques can be used for process parameter estimation and the controller adjustment mechanism present in self tuning schemes. In recent years, there have been several applications of genetic algorithm (GA) to identification and control of dynamical systems. GA (Man and Tang, 1996) is a parallel, global search technique based on the concept of natural selection. This technique has the capability to solve nonlinear and complex optimisation problems. Kristinsson and Dumont (1992) proposed GA to identify plants with either minimum phase or non-minimum phase characteristic and unmodelled dynamics. Zibo and Naghdt (1995) applied genetic algorithm to identify the parameters of the single input and single output (SISO) and multi input and multi output (MIMO) system that is assumed to have an auto regressive with moving average exogenous (ARMAX) structure. Lee et al. (2003) presented the peak magnitude ratio tuning method to MIMO system. Zhang et al. (2006) proposed self-tuning PID based on adaptive GA to activated sludge aeration process. Kim et al. (2001) presented the application of GA for system identification for PET synthesis. Yeo and Kwon (2004) proposed PID control strategy based on the genetic algorithm coupled with cubic spline interpolation method for the control of pH process. Pereira and Pinto (2005) has demonstrated the application of GA for system model identification and the PID controller tuning for the first order plant. Generally, simple GA concept lead to premature convergence and also it takes a long time to reach the solution. Kennedy and Eberhart (1995) proposed PSO as a simulation of social behaviour, and it is introduced as an optimisation method. This PSO can be easily implemented and it is computationally inexpensive, since its memory and CPU speed requirements are low. Moreover, it does not require gradient information of the objective function under consideration, but only its values. It uses only primitive mathematical operators. In this paper PSO based optimisation algorithm is applied for carrying out the identification and control tasks of STR in a pH process. The PSO are applied sequentially to estimate the changes in the parameters of the system and tuning the controller parameters. The effectiveness of the proposed approach is examined through offline simulation of a pH process.

2

System identification and controller tuning in pH process

The pH process is very important in many industrial applications. In the pH process acetic acid is fed to the reactor with constant flow rate and sodium hydroxide is introduced to the reactor as shown in Figure 1. Base flow rate is a manipulated variable and the pH value is the process variable. A general strategy for designing the self tuning schemes is to estimate the process parameters and then adjust the controller settings based on current parameter estimates. This involves the following stages.

446

K. Valarmathi et al.



predicting the process model



estimating the model parameters



controller tuning.

Figure 1

pH process

2.1 Process predictive model The process identification is to infer the model and estimate the model parameters in pH process. From the data linearisation of process model is a generally accepted procedure in control theory and that have been the basis of most adaptive control algorithms. A general ARMAX model is given by A(q −1 ) y (t ) = B (q −1 )u (t − k − 1) + C (q −1 )Ω(t ) + d (t )

(1)

where q–1 is the backward shift operator and A, B, C are polynomials and are defined by A(q −1 ) = 1 +

n

∑a q i

−i

, B (q −1 ) =

i =1

m

∑b q i

i =0

−i

, C (q −1 ) =

n

∑c q i

−i

(2)

i =0

The above linear difference equations are referred to as stochastic, discrete time models and its coefficients are assumed to be time varying parameters.

2.2 Parameter estimation Parameter estimation is the process to find the unknown parameters of the pH process model by minimising the loss function n

J=

∑ ( y(t ) − yˆ (t ))

2

(3)

t =1

where yˆ(t ) is the predicted value of output based on unknown parameters and y(t) is the actual output. Generally the parameter estimation is done using the recursive least square (RLS) technique. This RLS estimator looks for the optimum by using a gradient technique. It often fails to arrive at the global minimum for nonlinear system and the

Swarm intelligence based system identification and controller tuning

447

sudden changes in operating point lead to parameter drift. In this work PSO is applied to estimate the system parameters.

2.3 Controller tuning For the pH process controlled by the PI controller, the controlled output is given by C (t ) = K c e(t ) +

Kc

τi

∫ e(t )dt

(4)

where Kc the proportional gain and τ i is the integral time constant. Generally the PI controller parameters are determined by using Ziegler-Nichols and IMC methods. The controller parameters identified by the ZN method and IMC method are not satisfactory for pH process, and sensitive to load disturbances. For this reason the PSO is applied to identify the parameters of the PI controllers based on the identification of pH process.

3

Proposed system identification and controller tuning scheme

The proposed method for system identification and controller tuning in the pH process is based on particle swarm optimisation. PSO (Parsopoulos and Vrahatis, 2002) belongs to the broad class of stochastic optimisation algorithms. The PSO are inspired by the social behaviour of flocking organisms, namely swarms of birds and fish schools. It has been observed that the behaviour of the individuals that comprise a flock adheres to fundamental rules like nearest-neighbour velocity matching and acceleration by distance. PSO is a population-based algorithm that exploits a population of individuals to probe promising regions of the search space. In this context, the population is called a swarm and the individuals are called particles. Each particle moves with an adaptable velocity within the search space, and retains in its memory the best position it ever encountered. In the global variant of PSO the best position ever attained by all individuals of the swarm is communicated to all the particles. In the local variant, each particle is assigned to a neighbourhood consisting of a pre specified number of particles. In this case, the best position ever attained by the particles that comprise the neighbourhood is communicated among them. The most important issues in the genetic evolution are the effective rearrangement of the genotype information. In simple GA cross over is the main genetic operator for the exploitation of information while mutation brings new nonexistent bit structures. At this point the primitive mathematical operator with minimum computation time of PSO is introduced (Kennedy and Eberhart, 2001). PSO optimises an objective function by undertaking a population-based search. The population consists of potential solutions, named particles, which are a metaphor of birds in flocks. These particles are randomly initialised and freely fly across the multidimensional search space. During flight, each particle updates its own velocity and position based on the best experience of its own and the entire population. The updating policy drives the particle swarm to move toward the region with the higher objective function value, and eventually all particles will gather around the point with the highest objective value. The detailed operational flow chart of PSO is given in Figure 2.

448 Figure 2

K. Valarmathi et al. Flowchart of PSO

Figure 3 shows the block diagram representation of the proposed approach for system identification and PI tuning. PSO is used to identify the system model and adapt to system dynamic changes. This is the first step of a STR adaptive scheme. Initially the parameters of the PI controller and the pH process are randomly identified. The pH model transfer function is derived from the ARMAX model structure. For the system identification task, a step reference command signal is applied to the process and the transient response is observed. The identified parameters (a1, a2, a3, b0, b1, b2) are determined through the integral squared error (ISE) minimisation between the measured

Swarm intelligence based system identification and controller tuning

449

transient response and the interior PSO transient response. As the plant model is identified periodically, the changes in its dynamic characteristics can be observed. If the settling time or the overshoot becomes too large another process of identification and PI tuning is fired. For this task, knowledge of the physical system model is essential. For this reason the identification process need to be done before. Every time a controller tuning is requested, PSO will re identify the plant model and then tune the controller. Figure 3

Block diagram representation of proposed system identification and PI tuning PI tune

System identification

R

e PI

4

Ph Process

Y

PSO implementation in pH process

When applying PSO to solve an optimisation problem in pH process, the following issues must be addressed: •

problem representation



formation of the fitness function.

4.1 Problem representation During the system identification process, the individuals represent the model parameters and while tuning the controller parameters the individuals represent the parameters of the PI controller. A total of six variables are represented for model input and output parameters (a1, a2, a3, b0, b1, b2) and two variables are represented for controller parameters (Kp and Ki).

4.2 Formation of the fitness function The next important consideration is the choice of fitness function. Evaluation of the individual is accomplished by calculating the objective function value for the problem using the parameter set. The result of the objective function calculation is used to calculate the fitness function of the individuals. During the system identification the fitness function is to minimise the error between actual parameters to the generated parameters and while tuning the controller the fitness function is to minimise the error

450

K. Valarmathi et al.

between desired pH values to the process output. The equation of ISE is mathematically represented as n

f =



(ea1 ) 2 +

t =1

n



(ea 2 ) 2 +

t =1

n

∑ t =1

(ea 3 ) 2 +

n

∑ t =1

(eb 0 ) 2 +

n

∑ t =1

(eb1 ) 2 +

n

∑ (e

b2 )

2

(5)

t =1

During the controller tuning process ISE, settling time and over shoot are taken as performance indices. Hence the objective function is given by minimising f = f ISE + fos + fst

(6)

The minimisation objective function given by (6) is transformed to fitness function as Fitness =

k 1+ f

(7)

where k is a constant. In the denominator a value of 1 is added with f in order to avoid division by zero. From the selection process the fittest individuals are chosen. The selected individuals are used to produce the next population, and the process is then repeated until the design requirements are met.

5

Simulation results

This section presents the details of the simulation work carried out on a pH process for system identification and controller tuning. The mathematical model of the pH neutralisation process proposed by McAvoy and Hsu (1972) and is reproduced below is used in this work to simulate the pH process. V

dxa = Fa Ca − ( Fa + Fb ) X a dt

(8)

V

dxb = Fb Cb − ( Fa + Fb ) X b dt

(9)

[ H + ]3 + [ H + ]2 {K a + X b } + [ H + ]{K a ( X b − X a ) − K w } − K w K a = 0

(10)

pH = − log10 [ H + ]

(11)

The pH variables used in the simulation study are volume of the continuous stirred tank reactor (CSTR), base flow rate of the pH process and concentration of the acid and base streams. The descriptions of the pH process variables with corresponding symbols and its values are given in Table 1. The pH process is simulated in MATLAB simulink and is given in Figure 4. To identify the suitable model, for a set of randomly generated base flow rate the output pH values are generated. From the simulated input and output data the ISE is calculated for different order of the ARX model. The order having the minimum ISE value is assigned as the suitable ARX model and the same procedure is adopted for the ARMAX and OE model also.

Swarm intelligence based system identification and controller tuning Table 1

Description of the pH process

Symbols

Description

Value

V

Volume of the continuous stirred tank reactor

7.4 lit

Fa

Flow rate of the influent stream

0.24 l min–1

Fb

Flow rate of the titrating stream

0–0.8 l min–1

Ca

Concentration of the influent stream

0.2 g mol l–1

Cb

Concentration of the titrating stream

0.1 g mol l–1

Figure 4

451

pH process simulink model

The best model structures of ARX, ARMAX and OE are shown in Figure 5, Figure 6 and Figure 7, respectively. The comparison of ISE values for ARX, ARMAX and OE models are given in Table 2. From the table, it is found that the ARMAX model structure has minimum error of 0.000435 and is chosen for prediction model. Figure 5

ARX model (see online version for colours)

452

K. Valarmathi et al.

Figure 6

ARMAX model (see online version for colours)

Figure 7

OE model (see online version for colours)

Next, proposed PSO is applied for parameter estimation. The input-output variables a1, a2, a3, b0, b1, b2 were taken as the optimisation variables. The weighting factors c1 and c2 was selected in between the range of 1 to 2. The best results of the PSO were obtained with the following parameters.

Swarm intelligence based system identification and controller tuning

453

Number of generations = 20 Population size = 10 Wmin = 0.1 and Wmax = 1 C1 = 1 and C2 = 2. Table 2

Comparison of the models

Models

na

nb

nc

nf

nk

ISE

ARX

1

1

-

-

1

0.0004624

2

4

-

-

1

0.0004573

3

3

-

-

1

0.0004400

1

1

2

-

1

0.0004739

2

3

2

-

1

0.0004637

3

3

5

-

1

0.0004350

-

6

1

1

-

0.0050390

-

6

6

1

-

0.0041390

-

3

10

1

-

0.0045800

ARMAX

Output error

Figure 10 and Figure 11 show the estimation of parameters with load disturbance generated by using PSO. It shows that the proposed PSO can identify the process to converge at the desired value within acceptable time. The objective function in this case is minimisation of ISE. For comparison the input and output parameters were obtained by RLS estimator also. The estimated values are shown in Figure 8 and Figure 9, respectively. It is found that the algorithm took long period for settling and has a parameter drift due to sudden changes. Figure 8

Identification of b0, b1 and b2 parameters using RLS estimator (see online version for colours)

454 Figure 9

K. Valarmathi et al. Identification of a0, a1 and a2 parameters using RLS estimator

Figure 10 Identification of b0, b1 and b2 parameters variation tuned by proposed PSO

After system identification PSO is applied for controller tuning. The objective function in this case is minimisation of error. The initial population is randomly generated between the variables lower and upper limits. The PSO took 10 s to complete the 20 generations. After 20 generations it is found that all the individuals have reached almost the same fitness value. This shows that PSO has reached the optimal solution. Figure 12 shows the convergence of proposed PSO algorithm and it is observed that the fitness value increases rapidly in the first two generations of the PSO. During this stage, the PSO concentrates mainly on finding feasible solutions to the problem. Then the value increases slowly, and

Swarm intelligence based system identification and controller tuning

455

settles down near the optimum value with most of the individuals in the population reached the point. Figure 11 Identification of a0, a1 and a2 parameters variation tuned by proposed PSO

Figure 12 Convergence of proposed PSO algorithm

Figure 13 represents the response of the pH process and it is found that the pH response has minimum settling time and minimum peak overshoot. The performance of the controller using Ziegler Nichols and IMC tuning is shown in Figure 14. It shows that the controller tuned using ZN and IMC has oscillatory response and the peak overshoot and rise time is high at the set point 9. Over all the performance of the controller is found to be good when it is tuned with proposed PSO.

456

K. Valarmathi et al.

Figure 13 Tracking performance of proposed PSO and GA

Figure 14 Tracking performance of IMC and ZN

6

Conclusions

The pH control is quite difficult due to nonlinearity of the neutralisation process. This process requires good control to overcome the load disturbances. This paper has presented PSO based algorithm to carry out system identification and controller tuning

Swarm intelligence based system identification and controller tuning

457

tasks in a pH process. The simulation results show the capability of the PSO for system identification and adapt the controller to dynamic plant characteristic changes. Also it is found that the algorithm is able to tune the controller quickly and reduce the tracking error to zero.

References Astrom, K.J. and Hagglund, T. (2001) ‘The future of PID control, control engineering practice’, pp.1163–1175. Astrom, K.J. and Wittenmark, B. (1995) Adaptive Control, 2nd ed., Addison Wesley. Kennedy, J. and Eberhart, R.C. (1995) ‘Particle swarm optimization’, Proc. IEEE International Conference on Neural Networks, IEEE Service Center, pp.1942–1948. Kennedy, J., and Eberhart, R.C. (2001) Swarm Intelligence, Morgan Kaufman Publishers. Kim, J.Y., Kim, H.Y. and Yeo, Y.K. (2001) ‘Identification of kinetics of direct esterification reactions for PET synthesis based on a genetic algorithm’, Korean J. Chem. Eng., No. 18, p.432. Kristinsson, K. and Dumont, G.A. (1992) ‘System identification and control using genetic algorithms’, IEEE Trans. System, Man and Cybernetics, Vol. 22, No. 5, pp.1033–1046. Lee, D.Y., Lee, M. and Park, S. (2003) ‘Mp criterion based multiloop PID controllers tuning for desired closed loop responses’, Korean J. Chem. Eng., Vol. 20, No. 1, pp.5–13. Lin, F. and Brandt, R.D. (2000) ‘Self-tuning of PID controllers by adaptive interaction’, Proceedings of the American Control Conference, Chicago, pp.3676–3681. Man, K.F. and Tang, K.S. (1996) ‘Genetic algorithms: concepts and applications’, IEEE Trans. Ind Electron., Vol. 43, No. 5, pp.519–534. McAvoy, T.J. and Hsu, E. (1972) ‘Dynamics of pH in controlled stirred tank reactor’, Ind. Eng. Chem. Process Des. Dev., Vol. 1, No. 68. Parsopoulos, K.E. and Vrahatis, M.N. (2002) ‘Recent approaches to global optimization problems through particle swarm optimization’, Natural Computing, pp.235–306. Pereira, D.S. and Pinto, J.O. (2005) ‘Genetic algorithm based system identification and PID tuning for optimum adaptive control’, International Conference on Advanced Intelligent Mechatronics, California, USA, pp.801–806. Shinskey, F.G. (1996) Process Control System: Application, Design and Tuning, 4th ed., McGraw-Hill. Varsek, A., Urbancic, V. and Filipic, B. (1993) ‘Genetic algorithms in controller design and tuning’, IEEE Trans. Control Systems Man and Cybernetics, Vol. 23, No. 5, pp.1330–1339. Yamada, K. and Watanabe, K. (1996) ‘A state space design method of stable filtered inverse systems and its application to H2 suboptimal internal model control’, Proc. IFAC96, pp.379–382. Yeo, Y-K. and Kwon, T-I. (2004) ‘Control of pH processes based on the genetic algorithm’, Korean J. Chem. Eng., Vol. 21, No. 1, pp.6–13. Zhang, P., Yuan, M.Z. and Wang, H. (2006) ‘Self-tuning PID based on adaptive genetic algorithms with the application of activated sludge aeration process’, Proc. of the 6th World Congress on Intelligent Control and Automation, pp.9327–9330. Zibo, Z. and Naghdt, F. (1995) ‘Application of genetic algorithms to system identification’, IEEE Inter. Conf. on Evolutionary Computation, No. 2, pp.777–782.