Optimizations of PID Controllers by Grey-based Particle Swarm Optimizations Ming-Feng Yeh, Min-Shyang Leu, Kuang-Chiung Chang, Kai-Min Chen Department of Electrical Engineering Lunghwa University of Science and Technology Taoyuan, Taiwan e-mail: {mfyeh,unit484, kcchang}@mail.lhu.edu.tw,
[email protected] particle in the PSO algorithm is regarded as a sequence in grey relational analysis, the relationship among the particles therefore can be found by further analyzing the corresponding grey relational grades. On the other hand, in the PSO algorithm, the determination of the inertia weight and the acceleration coefficients generally do not take the evolutionary state into consideration. Hence, based on grey relational analysis, this study attempts to propose a greybased PSO algorithm to determine the inertia weight and the acceleration coefficients such that those parameters are varying over the generations. In addition, the proposed greybased PSO algorithm is also employed to optimize the PID parameters and then to examine its global search performance.
Abstract—Based on grey relational analysis, this paper attempts to propose a grey-based particle swarm optimization (PSO). The central idea of the proposed approach is that the determination of the algorithm parameters (the inertia weight and the acceleration coefficients) for a particle is depended upon the grey relational grade of that particle. The algorithm parameters are varying over the generations. Also they may differ from different particles. Besides, the grey-based PSO algorithm is also applied to optimize the parameters of the proportional-integral-derivative (PID) controller. Simulation and experiment results are compared with the standard PSO algorithm and genetic algorithm to demonstrate the search performance of the proposed method. Keywords- Grey relational optimization; PID controller;
I.
analysis;
Particle
swarm
II.
INTRODUCTION
PRELIMINARIES
A. Particle Swarm Optimizations and Its Variants In PSO, a swarm of particles are represented as potential solution, and each particle i is associated with two vectors, i.e., the velocity vector Vi = (vi1, vi2, ..., viD) and the position vector Xi = (xi1, xi2, ..., xiD), where D represents the dimensions of the solution space. The velocity and the position of each particle are initialized by random vectors within the corresponding ranges. During the evolutionary process, the trajectory of each individual in the search space is adjusted by dynamically altering the velocity of each particle, according to its own flying experience (pBest) and the flying experience of the other particles (gBest) in the search space. That is, the velocity and position of the ith particle on dimension d are updated as
Particle swarm optimization (PSO), introduced by Kennedy and Eberhart in 1995 [1]-[2], was inspired by the social behavior of bird flocking and fish schooling. The PSO uses a simple mechanism that imitates their swarm behaviors to guide the particles to search for globally optimal solutions. Hence it is also a population-based iterative algorithm. Owing to its simplicity of implementation and ability to quickly converge to a reasonably good solution [3], the PSO has been successfully applied in solving many real-world optimization problems [4]-[6]. Besides, grey system theory, introduced by Deng in 1989 [7], was proposed to solve the system with incomplete (partial known and partial unknown) information. In grey system theory, one of the essential topics is grey relational analysis which can perform as a similarity measure for finite sequences. Studies [8]-[9] have successfully shown that grey relational analysis can be applied to cluster analysis or other applications. Proportional-integral-derivative (PID) controllers have the advantage of simple structure, good stability, and high reliability [6], [10]. Up to now, they are still widely applied in the industrial processes. The key issue for PID controllers is how to accurately and efficiently tune of the parameters. In practical, the controlled plant however may have some features, such as nonlinearity, time-variability, and time delay. Those features could make the tuning of the controller parameters more complex. The PSOs are a kind of optimization algorithm and they have been widely used to tune the PID parameters. Grey relational analysis is a similarity measure for finite sequences with incomplete information [7]. While each
v id
wv id c1 rand 1d ( pBest id x id ) c 2 rand 2 d ( gBest d x id ), xid
xid vid
where w is the inertia weight, c1 and c2 are the acceleration coefficients, and rand1d and rand2d are two uniformly distributed random numbers independently generated within [0, 1] for the dth dimension [3]. In (1), pBesti represents the position with the best fitness found so far for the ith particle, and gBest is the best position discovered by the whole particles. In addition, the second and third parts of (1) are known as the “cognitive” and “social” components, respectively.
___________________________________ 978-1-4673-0089-6/12/$26.00 ©2012 IEEE
¦ >D k r ( x k , y jk )@ n
g ( x, y j )
k 1
where Dk is the weighting factor of grey relational coefficient r(xk, yjk) and ¦nk 1 D k 1. The selection of the weighting factor for a relational coefficient reflects the importance of that datum. In general, we can select it as Dk = 1/n for all k. The best comparative sequence is determined as the one with the largest relational grade.
Figure 1. A PID control system.
Except the original PSO algorithm, Shi and Eberhart in [11] proposed the PSO with a linearly varying inertia weight w over the generations (PSO-LVIW) to improve the performance of PSO. The corresponding mathematical representation is
C. PID Controller Consider a PID control system as shown in Fig. 1, where t r(t) and y(t) are the reference signal and the system output, w wmax ( wmax wmin ) respectively. The continuous form of a PID controller is Tmax described as follows: where t is the current generation number and Tmax is a de(t ) predefined maximum number of generations. Besides, the t , u (t ) K P e(t ) K I ³0 e(t )dt K D maximal and minimal weights wmax and wmin are usually set dt to 0.9 and 0.4, respectively. The PSO algorithm with time-varying acceleration where u(t) is the controlled output, e(t) = r(t) y(t) is the coefficients (PSO-TVAC) is another widely used strategy to error signal, KP, KI and KD represent the proportional, improve the performance of PSO. With a large cognitive integral, and derivate gains, respectively. With a small component (a larger c1) and a small social component (a sampling period 't, (8) could be approximated by the smaller c2) at the beginning, particles are allowed to move following discrete-type PID control law: around the search space, instead of moving toward the population best. On the other hand, a small cognitive k e[k ] e[k 1] component and a large social component allow the particles , u[k ] K P e[k ] K I ¦ e[ j ]'t K D 't j 1 to converge to the global optima in the latter part of the evolutionary process. This modification can be mathematically represented as follows [12] where k represents the time step [13].
c1
(c1 f c1i )
t Tmax
c1i
III.
GREY-BASED PARTICLE SWARM OPTIMIZATIONS
A. Central Idea While the fittest particle gBest is regarded as the t reference sequence and all particles X’s are viewed as the c 2 (c 2 f c 2 i ) c 2i comparative ones, grey relational analysis could be applied Tmax to analyze the similarity between them. Then the values of both inertia weight and acceleration coefficients of a specific where c1i, c1f, c2i, and c2f are constants. particle are determined according to the corresponding B. Grey Relational analysis relational grade. Since the result of grey relational analysis may differ for different generations, the algorithm Grey relational analysis is a similarity measure for finite parameters are varying over the generations. sequences with incomplete information [7]. Assume that the According to (6), grey relational coefficients between the reference sequence is defined as x = (x1, x2, x3,…, xn) and the fittest particle gBest and the ith particle Xi at the dth comparative sequences are given by yj = (yj1, yj2, …, yjn), j = dimension can be rewritten as 1, 2, 3, …, m. The grey relational coefficient between x and yj at the kth datum, k = 1, 2, 3, …, n, is defined as follows: ' min [ ' max rid r ( gBest d , xid ) ' min [ ' max ' id [ ' max r ( x k , y jk ) ' jk [ ' max where 'id = °gBestd xid°, 'max = maximaxd'id, 'min = minimind'id, and [ (0, 1]. Then the corresponding where 'jk = °xk yjk°, 'max = maxjmaxk'jk, 'min = relational grade is given as minjmink'jk, and [ (0, 1], which is a distinguishing coefficient to control the resolution between 'max and 'min. D The corresponding grey relational grade is g g ( gBest , X ) r D i
i
¦
d 1
id
It can be seen from (10) that rid [[/(1+[), 1]. The result further imply that gi [[/(1+[), 1].
vid
B. Grey-based Particle Swarm Optimizations Shi and Eberhart in [11] proposed a linearly varying inertia weight w over the generations to improve the performance of PSO. They had observed that the optimal solution can be improved by varying the value of w from 0.9 at the beginning of the search to 0.4 at the end of the search for most problems. A particle with a smaller relational grade generally represents that it is far away from the fittest particle. That particle therefore can be regarded as being in the exploration state. In this study, such a particle should be assigned a larger inertia weight. On the contrary, a particle with a larger relational grade is treated as being in the exploitation state. Hence that particle is assigned a smaller inertia weight. To sum up, the lager the grey relational grade gi is, the smaller the inertia weight wi is, and vice versa. Owing to gi [[/(1+[), 1] and w [0.4, 0.9], the relationship between gi and wi can be simply represented by the following linear scaling scheme:
wi vid c1i rand1 ( pBestid xid ) c2i rand 2 ( gBest xid ),
which is a modification of (1). Besides, in order to prevent premature convergence, the random numbers rand1 and rand2 are generated by the following scheme.
rand
W 1 , t 0.5Tmax ®W , t t 0.5T max ¯ 2
where W1 and W2 are two uniformly distributed random numbers generated within [1, 1] and [0, 1], respectively, and Tmax is a predefined maximum number of generations. IV.
FITNESS FUNCTION AND SIMULATION RESULTS
A. FitnessFunction In the design of PID controller, the performance criterion or cost function must be firstly designed based on the required specifications such as time-domain specifications, frequency domain specifications and time-integral wi 0.5(1 [ ) g i (0.9 0.5[ ) performance. The commonly used time-integral performance indexes are integral square-error (ISE), integral absoluteerror (IAE), integral-of-time-weighted square-error (ITSE), For example, wi = gi + 1.4 if [ = 1. and integral-of-time-weighted absolute-error (ITAE). To Rather than using the time-varying approach, (4) and (5), simultaneously minimize the IAE, avoid exporting a large this study utilizes the following nonlinear transformation to control value u, hasten the rise time tr, and reduce the determine the acceleration coefficients. overshoot, the cost function is given as
c1i
0.5 cos[ f ( g i )S ] 2
J (t ) f 2 °³0 [ w1 e(t ) w2 u (t )]dt w3 t r , if 'y (t ) t 0, c 2i 4 c1i ®f 2 °¯³0 [ w1 e(t ) w2 u (t ) w4 'y (t ) ]dt w3 t r , if 'y (t ) 0. where f(gi) = 1.5(1+[)gi + 1.5(1[). If [ = 1, (13) becomes c1i = 0.5cos(3Sgi) + 2. The relationship between the grey where 'y(t) = y(t) y(t1) and wi, i = 1, 2, 3, 4, are weight relational grade and the acceleration coefficients for [ = 1 is coefficients [13]. shown in Fig. 2. Eqs. (13) and (14) reveal that c1 + c2 = 4.0 for every particle during the evolutionary process. Besides, while the particle is in the exploration state (i.e., gi d 5/6 in Fig. 1), a particle is assigned the acceleration coefficients of a smaller c2 and a larger c1 to help for exploring local optimums and maintaining the diversity of the swarm. On the other hand, while the particle is in the exploitation or exploitation state (i.e., gi > 5/6), a larger c2 and a smaller c1 could allow that particle to converge to the global optimum. This study utilizes the grey relational grade to determine the inertia weight and the acceleration coefficients. During the evolutionary process, the position of each particle may differ for different generations. It is obvious that the relational grade may also differ for different generations. Hence, both inertia weight and acceleration coefficients are varying over the generations. With the help of the proposed approach, the updating rule for the velocity of the ith particle becomes as Figure 2. Relationship between grey relational grade and acceleration coefficients for [ = 1.
B. Simulation Results In order to demonstrate the search performance of the proposed grey-based PSO algorithm in the tuning of the PID parameters, the following plant is used to verify it.
G( s)
16 >@ s 2 2.584 s 16
TABLE I.
TABLE II.
The system sampling time is 0.05 second and the control value u is limited in the range of [10, 10]. Other relevant system variables are KP [0, 20], KI [0, 20], and KD [0, 10]. The weight coefficients of the cost function are set as w1 = 1.2, w2 = 0.01, w3 = 2.5, and w4 = 100. In the simulations, the step response of PID control system tuned by the proposed grey-based PSO (GPSO) is compared with that tuned by Ziegler-Nichols (Z-N) tuning rule, the standard genetic algorithm (GA) and the standard PSO (PSO). The population sizes of GA, PSO, and GPSO are 50, 40, and 30, respectively, and the corresponding maximum numbers of iterations are 100, 100, and 50, respectively. In addition, the crossover rate for GA is set as 0.60, whereas the mutation rate is 0.10. The optimal parameters of the PID controllers are listed in Table I and the corresponding step responses are given in Fig. 3. Note that the PID parameters obtained by GA are the previous findings given in [13]. The numerical results of system responses obtained by those PID controllers are given in Table II where boldface in the table indicates the best result. It can be seen from Fig. 3 and Table II that the PID controller tuned by GPSO has the minimum overshoot and the smallest settling time. Although PID controllers tuned by PSO and Z-N tuning rule have a smaller rise time, their maximum overshoots are much larger than the overshoot tuned by GPSO. Fig. 4 shows the control inputs for different PID controllers. It also reveals that PID controller tuned by GPSO has the minimum control input. To sum up, with the smallest population size and the least numbers of iterations, the PID controller tuned by the grey-based PSO could perform the best control performance in the simulations. V.
Parameters KP KI KD
PO (%) Peak time Rise time Settling time
PARAMETERS OF DIFFERENT PID CONTROLLERS Z_N 12.453 2.288 0.109
GA 11.702 4.162 6.499
PSO 16.713 2.648 0.165
NUMERICAL RESULTS OF SYSTEM RESPONSES Z_N 32.1492 0.7399 0.3092 5.6439
GA 8.3800 2.7529 1.0042 6.8179
PSO 34.4734 0.6899 0.2912 4.0329
Figure 3. Step responses with different controllers
CONCLUSIONS
A grey-based PSO algorithm has been proposed in this study. In the proposed algorithm, both inertia weight and acceleration coefficients of a particle are varying according to the corresponding grey relational grade. Also those algorithm parameters are varying over the generations. Simulation results demonstrate that the PID controller tuned by GPSO could attain a fast and better response compared with the one tuned by Z-N tuning rule, GA or PSO. ACKNOWLEDGMENT This work was supported by the National Science Council, Taiwan, Republic of China, under Grants NSC 1002221-E-262-002.
Figure 4. Control inputs with different controllers
GPSO 15.086 3.228 2.801
GPSO 4.5287 0.9099 0.4362 1.2179
REFERENCES [1]
[2] [3]
[4]
[5]
[6]
[7] [8] [9] [10]
[11] [12]
[13]
J. Kennedy, R. C. Eberhart, “A new optimizer using particle swarm theory,” in Proc. 6th Int. Symp. Micro Machine Human Sci., Nagoya, Japan, pp. 39-43, 1995. J. Kennedy, R. C. Eberhart, “Particle swarm optimization,” in Proc. IEEE Int. Conf. Neural Netw., Piscataway, NJ, pp.1942-1948, 1995. Z. H. Zhan, J. Z. Zhan, Y. Li & H. S. H. Chung, “Adaptive particle swarm optimization,” IEEE Trans. Syst., Man, Cybern., B., vol. 39, no. 6, pp. 1362- 1381, 2009. M. R. AlRashidi, M. E. El-Hawary, “A survey of particle swarm optimization applications in electric power systems,” IEEE Trans. Evol. Comput., vol. 13, no. 4, pp. 913-918, 2009. C. J. Lin, M. H. Hsieh, “Classification of mental task from EEG data using neural networks based on particle swarm optimization,” Neurocomputing, vol. 72, no. 4-6, pp. 1121-1130, 2009. R. J. Wai, J. D. Lee & K. L. Chuang, “Real-time PID control strategy for maglev transportation system via particle swarm optimization,” IEEE Trans. Ind. Electron., vol. 58, no. 2, pp. 629-646, 2011. J. L. Deng, “Introduction to grey system theory,” The Journal of Grey System, vol. 1, no. 1, pp. 1-24, 1989. M. F. Yeh & M. S. Leu, “ART-type CMAC network classifier,” Neurocomputing, vol. 74, no. 5, pp. 783-791, 2011. M .F. Yeh & M. S. Leu, “Grey adaptive growing CMAC network,” Appl. Soft Comput., vol. 11, no. 8, pp. 5400-5410, 2011. M. W. Iruthayarajan and S. Baskar, “Evolutionary algorithms based design of multivariable PID controllers,” Expert Systems with Applications, vol. 36, pp. 9159-9167, 2009. Y. Shi, R. C. Eberhart, “A modified particle swarm optimizer,” in Proc. IEEE World Congr. Comput. Intell., 1998, pp. 69-73. A. Ratnaweera, S. Halgamuge, H. Watson, “Self-organizing hierarchical particle swarm optimizer with time-varying acceleration coefficients,” IEEE Trans. Evol. Comput., vol. 8, no. 3, pp. 240-255, 2004. J. H. Zhang, J. Zhuang, H. F. Du and S. A. Wang, “Self-organizing genetic algorithm based tuning of PID controllers,” Inform. Sciences, vol. 179, pp. 1007-1017, 2009.