You are on page 1of 6

First Joint Congress on Fuzzy and Intelligent Systems Ferdowsi University of Mashhad, Iran 29-31 Aug 2007

Intelligent Systems Scientific Society of Iran

Designing an optimal PID controller using Imperialist Competitive Algorithm


Esmaeil Atashpaz-Gargari & Caro Lucas e.atashpaz@ece.ut.ac.ir & lucas@ipm.ir

Abstract in this paper we use a new search heuristic called Imperialist Competitive Algorithm to design a optimal PID controller for a sample system. The PID controller is designed in such a way that it minimizes the sum of settling time, rise time, maximum overshoot and integral absolute error. A comparison among Imperialist Competitive Algorithm and Genetic Algorithm is made through designing the controller.

I. I. INTRODUCTION
roportional-integral-derivative controller (PID controller) is a generic control loop feedback mechanism widely used in industrial control systems. A PID controller attempts to correct the error between a measured process variable and a desired set point by calculating and then outputting a corrective action that can adjust the process accordingly, based upon three parameters: proportional gain ( K p ), integral time constant ( K i ), and derivative time constant ( K d ). Traditionally, the problem has been handled by a trial and error approach. In the past decade more systematic methods have been introduced [1]. Ziegler-Nichols tuning formula is one of the best known tuning methods [2]. PID controllers are the subject to many researches in the area of control engineering and some other methods are proposed for tuning a PID controller [3] - [5]. Some papers use evolutionary methods to design a PID controller. [6] uses a multi objective genetic algorithm to tune a PID controller. In [7] a fuzzygenetic approach is used for autotuning a PID controller. This paper illustrates an application of Imperialist Competitive Algorithm (ICA) [8], by designing a PID controller for a given system such that the output has the desired properties. At first In Section II, we briefly describe the Imperialist Competitive Algorithm. Then in Section III, we formulate the problem by introducing the PID controller and defining some of the most important characteristics of the system output. In section IV we apply a GA and ICA to the problem of designing a PID controller. Finally in Section V, we present our conclusions.

II. A BRIEF DESCRIPTION OF IMPERIALIST COMPETITIVE ALGORITHM


Imperialism is the policy of extending the power and rule of a government beyond its own boundaries. A country may attempt to dominate others by direct rule or by less obvious means such as a control of markets for goods or raw materials. The latter is often called neocolonialism [9]. Imperialist Competitive Algorithm (ICA) [8] is a novel global search heuristic that uses imperialism and imperialistic competition process as a source of inspiration. Figure 1 shows the pseudo code for this algorithm. Like other evolutionary ones, this algorithm starts with an initial population. In this algorithm any individual of the population is called a country. Some of the best countries in the population are selected to be the imperialist states and all the other countries form the colonies of these imperialists. All the colonies of initial population

9-7 6831

are divided among the mentioned imperialists based on their power which are inversely proportional to their cost. After dividing all colonies among imperialists and creating the initial empires, these colonies start moving toward their relevant imperialist country. This movement is a simple model of assimilation policy that was perused by some imperialist states [10]. Figure 2 shows the movement of a colony towards the imperialist. In this movement, and x are random numbers with uniform distribution and d is the distance between colony and the imperialist.

and are arbitrary numbers that modify the area that colonies randomly search around the imperialist. In our implementation and are 2 and /4 (Rad) respectively.
1) Select some random points on the function and initialize the empires. 2) Move the colonies toward their relevant imperialist (Assimilating). 3) If there is a colony in an empire which has lower cost than that of imperialist, exchange the positions of that colony and the imperialist. 4) Compute the total cost of all empires (Related to the power of both imperialist and its colonies). 5) Pick the weakest colony (colonies) from the weakest empire and give it (them) to the empire that has the most likelihood to possess it (Imperialistic competition). 6) Eliminate the powerless empires. 7) If there is just one empire, stop, if not go to 2.
Fig. 1. Pseudo code for the proposed algorithm.

power of imperialist state plus a percentage of the mean power of its colonies. Any empire that is not able to succeed in imperialist competition and can not increase its power (or at least prevent decreasing its power) will be eliminated. The imperialistic competition will gradually result in an increase in the power of great empires and a decrease in the power of weaker ones. Weak empires will lose their power gradually and ultimately they will collapse. The movement of colonies toward their relevant imperialists along with competition among empires and also collapse mechanism will hopefully cause all the countries to converge to a state in which there exist just one empire in the world and all the other countries are its colonies. In this ideal new world colonies have the same position and power as the imperialist.

III. PID CONTROLLER


We consider the system shown in figure 3. In this figure, C ( s ) is the controller and P( s) is the plant to be controlled. The goal is to design a controller so that the output of the system has some defined characteristics. u (t ) r (t ) e(t ) y (t )

C (s)

P( s)

Fig. 3. Block diagram of control system

We use a PID controller to control the plant. For a PID controller, C ( s) is defined as
C ( s) = K p + Ki + Kd s s

where K p , K i , and K d are the proportional, integral and derivative gains respectively. The output of the system will be

u (t ) = K p e(t ) + K i e(t )dt + K d e(t )


0
x
d

For a given plant, the problem of designing a PD controller is to adjust the parameters K p , K i , and

K d for getting a desired performance of the


considered system. The output of the system has some important characteristics. We use four of the most important ones to design our controller. These characteristics are:

Fig2. Motion of colonies toward their relevant imperialist.

The total power of an empire depends on both the power of the imperialist country and the power of its colonies. In this algorithm, this fact is modeled by defining the total power of an empire by the

9-7 6831

A. Rise Time The rise time, is defined as the time required for the step response to rise from 10 to 90 percent of its final value. B. Settling time: The settling time, is defined as the time required for the step response to stay within 2 percentage of its final value. C. Max overshoot: If y max denotes the maximum value of y and y ss , represent the steady-state value of it, the maximum overshoot will be defined as MaxOvershoot = y max - y ss D. Integral Absolute error (IAE): The integral of the absolute error (IAE) is defined as

overshoot, rise time, settling time and integral absolute error respectively. Figure 5 depicts the flowchart of the ICA used to design the optimal controller. As in [1], the transfer function of the system G p ( s) is defined as
P( s) = 4.228 ( s + o.5)( s + 1.64s + 8.456)
2

The proposed algorithm is applied to this problem by 80 initial countries and 8 initial imperialist countries. The resulting PID controller is
C( s ) = 3.5273 + 2.1671 + 4.1560s s

IAE = e(t )dt


0

In our implementation we calculate the integral up to (3* settling time) which is an acceptable approximation of the real value of IAE. All the above characteristics are shown in figure 4 4.

Fig. 4. Rise time, Settling time and Max over shoot.

IV. DESIGNING AN OPTIMAL PID CONTROLLER USING ICA


In this section, the proposed algorithm is applied to the problem of designing an optimal PID controller for a system. As used in [1], to design an optimal PID controller and making a comparison, we use the total cost function
fTotal = f MO + f RT + f ST + f IAE . f MO , f RT , f ST
Fig. 5. Flowchart of the ICA applied to the problem of designing a PID controller.

and

f IAE

are the maximum

To have a better view of competition process, the initial population of 60 countries is shown in Figure 6a. 6 of the best countries of initial countries are chosen to form the imperialists and take possession

9-7 6831

of other 52 ones. The imperialists are shown by star mark in different colors and the colonies of each imperialist are shown by in the same color as the imperialist. The more colonies an imperialist possess, the bigger is its relevant star mark. Figures 6b and 6c show the empires at iterations 30 and 50. It is easily observable that at iteration 30, two of the weak empires are collapsed and only 4 are remained and are able to compete. At iteration 50, only two of the empires are alive and they are strongly competing up until iteration 73 (convergence of the algorithm), when one of them defeat the other one and controls the entire world. The competition process can be reviewed in figure 7, where the mean and minimum cost of all imperialists versus iteration are depicted.

Fig. 7. Mean and minimum cost of all imperialists versus iteration

Fig. 6a. Initial empires for designing a PID controller.

Also a continuous genetic algorithm with initial population of 80 and the mutation rate of 0.2 is applied to this problem. Figure 8 shows the minimum cost versus iteration for the continuous GA. In Table I, all four controllers resulting from Zeigler Nichols method and Ant Colony Optimization [1], continuous GA and the Imperialist Competitive Algorithm are listed and are compared. The results indicate that the ICA yields the lowest total cost. Also except for f MO , for all of the three other characteristics, ICA has resulted in the best performance. For f MO , the controller resulting from ACO is the best controller. The comparison shows that the continuous GA has resulted in a controller that is close to that of the ICA. The similarity between the results of continuous GA and the ICA is easily observable in figure 9 where the step responses of the system for all four controllers are shown. Table I, compares all the controllers.

Fig. 6b. Empires at iteration 30

Fig. 6c. Empires at iteration 50

Fig. 8. Minimum cost versus iteration for continuous GA

9-7 6831

REFERENCES
[1] Y. T. Hsiao, C. L. Chuang and C. C. Chien, Ant Colony Optimization for Designing of PID Controllers, 2004 IEEE International Symposium on Computer Aided Control Systems Design, September 24, 2004, Taipei, Taiwan J. G. Ziegler and N. B. Nichols, "Optimum Settling for automatic Controllers", Trans. On ASME, vol 64, 1942, pp 759-768 M. Chidambaram, R. P. Sree, A simple method of tuning PID controllers for integrator/dead-time processes, Computers and Chemical Engineering 27 (2003) 211_/215 K. C. Lee, S. Lee, H. H. Lee, Implementation and PID tuning of network-based control systems via Profibus polling network, Computer Standards & Interfaces 26 (2004) 229240 J. C. Shen, New tuning method for PID controller, ISA Transactions 41 ~2002! 473484 A. Herreros, E. Baeyens, J. R. Peran, Design of PID-type controllers using multiobjective genetic algorithms, ISA Transactions 41 ~2002! 457472 R. Bandyopadhyay, U. K. Chakraborty, D. Patranabis, Autotuning a PID controller: A fuzzy-genetic approach, Journal of System Architecture 47 (2001) 663-673 E. Atashpaz-Gargari, C. Lucas, "Imperialist Competitive Algorithm: An Algorithm for Optimization Inspires by Imperialistic Competition", 2007 IEEE Congress on Evolutionary Computation, Sigapore, 2007 The Hutchinson Dictionary of World History, Oxford: Helicon Publishing, 1999 R. R. Palmer, A History of the Modern World, New York: Alfred A. Knopf, 1964, 1956. C. V. Findley & J. A. M. Rothney ,Twentieth century world, 3rd edition, Boston: Houghton Mifflin Company, 1986 R. L. Haupt and S. E. Haupt, Practical Genetic Algorithms, Second Edition, New Jersey: John Wiley & Sons, 2004 M. Dorigo and C. Blum, Ant colony optimization theory: A survey, Theoretical Computer Science, 344 (2005) 243 278

[2] [3] [4] [5] Fig. 9. step response of the system for all four controllers. TABLE I THE PARAMETERS OF THE CONTROLLERS AND THEIR RELATED CHARACTERISTICS OF STEP RESPONSES Method and Controller ICA KP = 3.445 KI = 2.166 KD = 4.233 Continuous GA KP = 3.369 KI = 2.125 KD = 4.204 ACO KP = 2.517 KI = 2.219 KD = 1.151 Zeigler Nichols KP = 2.19 KI = 2.126 KD = 0.565 0.165 0.73 5.37 0.9595 7.2242 0.156 0.62 4.99 0.8861 6.6525 0.1762 0.31 2.86 0.8669 4.2131 0.1818 0.3 2.85 0.8614 4.1932 [9] [10] [11] [12] [13] [6] [7] [8]

f MO

f RT

f ST

f IAE

fTotal

V. CONCLUSIONS
We used a GA and a new search heuristic called Imperialist Competitive Algorithm to design a optimal PID controller for a system. The PID controller is designed in such a way that it minimizes the sum of settling time, rise time, maximum overshoot and integral absolute error. Comparison among Imperialist Competitive Algorithm and Genetic Algorithm and Ant colony optimization show that the IAE is a successful technique for optimization and for designing PID controllers.

9-7 6831

9-7 6831

You might also like