You are on page 1of 4

International Journal of S cientific Research Engineering & Technology (I JSRET), ISSN 2278 0882

Volume 3, Issue 2, May 2014

Modifications done in

Ant Colony Algorithm for its ap plication to PID

225

Contr oller Parameters Optimization

Samarth Singh 1 , R. Mitra 2

1 Department of Electronics and C ommunication Engineering, Indian Institute of Techn ology, Roorkee, India

2 Department of Electronics and C ommunication Engineering, Indian Institute of Techn ology, Roorkee, India

ABSTRACT

Ant Colony Algorithm is an algorithm u sed for obtaining

optimized cost solutions for graphical

paper deals with modifications done i n this algorithm

and uses it for finding optimal values o f PID controller parameters. These modifications ar e actually the solutions to the problems that were en countered while

implementing this algorithm on Modifications done to this algorithm results as compared to the simplified algorithm, in terms of lesser number of

to reach optimal solution, along with im provement in the

response obtained. The results have b een obtained by making use of MATLAB simulations.

problems. This

PID controller. provided better version of the iterations taken

Keywords: Ant Colony Algorithm, mo difications, PID controller, iterations, MATLAB.

I. INTRODUCTION

Ants are creatures which as individuals are quite simple, but collectively they are known for thei r complex social

behavior in terms of gathering food. Due

ants are able to find the shortest path f rom their nest to

the food source. Studies were conducted in the early 90's on their food gathering mechanisms a nd the result of these studies was the Ant Colony Algori thm [1]. Since then it has been applied in nu merous fields for

optimization purposes. It is basically

technique used for finding shortest pa th in graphs. A number of artificial ants build solutio ns for a certain optimization problem and exchange in formation about

the quality of these solutions making communication systems of the real exchange of information is done by

chemical known as pheromone, toward s which ants are

highly responsive [1] [2].

to this behavior

a probabilistic

allusion to the ants [1]. This the means of a

II. FOOD GATHERING BEHA VIOR OF

ANTS IN BRIEF

Fig 1. Shows sequentially how ants gather food in a simplified manner. Starting from the top of the figure we can say that six ants are about to leave the ant nest for

gathering food. It is clear from the figu re that there are two paths available towards the food s ource, one is the

shorter one the other is the longer one.

Now ants release

the chemical pheromone as they travel, a long with this

they have higher tendency ( or probability) to follow that path which has higher depos ition of pheromone.

follow that path which has higher depos ition of pheromone. Fig 1. Food gatherin g mechanism

Fig 1. Food gatherin g mechanism of ants.

deposition of pheromone on

any of the paths, so there a nts have 50-50 probability to follow any of the two paths. However ants on the shorter path will reach the food sou rce first and also return back to the nest fast, hence pher omone deposition on shorter path would be higher as co mpared to the longer path. At

So initially as there is no

www.ijsret.org

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882

Volume 3, Issue 2, May 2014

this point of time, Any other ant ready to gather food would thus have higher tendency to follow shorter path as compared to the longer path . Pheromone also decays with time. After a long period of time almost all the ants would follow the shorter path, thereby optimizing their path from the nest towards the food source.

III. ANT COLONY ALGORITHM

1. Define objective function as:

. III. ANT COLONY ALGORITHM 1. Define objective function as: where Q is a constant and

where Q is a constant and ISE is Integral Square of Error.

2. Discritize all the parameters that are to be optimized.

3. Decide the maximum number of iterations, number of ants in the nest, path tables for each ant, pheromone tables and optimal path table.

4. Set a counter equal to 0 and begin algorithm.

5. For each ant find the transitional probability to each node as it travel along a particular path.

to each node as it travel along a particular path. where P to destination node d.

where

P

to destination node d.

along a particular path. where P to destination node d. 6. After probabilities found out let

6. After probabilities found out let ants travel and store their path in respective path tables. From this find objective function value for each ant.

7. At the end of iteration update the pheromone deposition at each node from the following:

the pheromone deposition at each node from the following: Along with this increment the counter 8.

Along with this increment the counter 8. End the algorithm if either all the ants start to follow a single path or the counter achieves maximum value of iterations. Else go to step 5. Algorithm has been developed using [1] [2][3][4][5]

IV. MODIFICATIONS DONE IN ANT

COLONY ALGORITHM AND RESULTS

A. Deposition of pheromone on optimal nodes

It is known that the pheromone deposition on each node is proportional to the value of objective function obtained at the end of iteration for each path ants have travelled for this iteration. The objective function is in fact inversely proportional to ISE (Integral Square of Error) [4][5]. Suppose the most optimal path was found

during the second or higher iteration, then the ants would not settle to the new found optimal path because the optimal path obtained from previous iterations will have significant deposition of pheromone on it. From simulation results it was seen that, although we did found out the most optimal path but it took significant number or in most cases maximum number of iterations for all the ants to settle on it. We know that at the end of every iteration ,the pheromone deposition on every node gets updated. Based on the ISE value, obtained for a particular path, this update takes place [4][5]. So in order to save time what we can do is that at the end of each iteration we can increment the pheromone deposition by certain factor on

:Probability of kth ant going from source node s the nodes of the most optimal path. Along with this we

need to define a pre optimal path, which we can say that it was the optimal path in the previous iterations, at the end of each iteration reduce its pheromone contents by certain large factor so that the probability of ants following that path decrease or in other words we are increasing the probability of rejecting this pre optimal path and increasing the probability of settling of all the ants on the optimal path. At the end of iteration let

the ants on the optimal path. At the end of iteration let The figure 2, figure
the ants on the optimal path. At the end of iteration let The figure 2, figure

The figure 2, figure 3 and figure 4 shows values of pheromone at various nodes for the three controller parameters at the termination of the algorithm, whose optimal values are being found out. We see that significant and considerable deposition on several nodes other than the optimal nodes( optimal nodes in above case are Kp=2.5, Ki=1.2, Kd=2.9) in case of Kp, nodes other than optimal one have more pheromone deposition , thus this can cause the algorithm to not converge immediately to optimal solution.

www.ijsret.org

226

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882

Volume 3, Issue 2, May 2014

After making use of the offered solution the result that we got can be seen from fig 5, fig 6 and fig 7. the optimal nodes here are Kp=2.5 ,Ki=1.1 ,Kd=3. From the above figures we can say that the deposition on optimal nodes is significantly high as compared to other nodes. Greater the deposition of pheromone on a path, greater will be the ants probability to follow that path. So the ants can easily converge to the optimal solution. This can also be seen from table 1.

to the optimal solution. This can also be seen from table 1. Fig 2. Pheromone deposition

Fig 2. Pheromone deposition on each Ki node (without modification)

Pheromone deposition on each Ki node (without modification) Fig 3. Pheromone deposition on each Kp node

Fig 3. Pheromone deposition on each Kp node (without modification)

Pheromone deposition on each Kp node (without modification) Fig 4. Pheromone deposition for each Kd node

Fig 4. Pheromone deposition for each Kd node (without modification)

Pheromone deposition for each Kd node (without modification) Fig 5. Pheromone deposition on each Ki node

Fig 5. Pheromone deposition on each Ki node (after modification)

5. Pheromone deposition on each Ki node (after modification) Fig 6. Pheromone deposition on each Kp

Fig 6. Pheromone deposition on each Kp node (after modification)

6. Pheromone deposition on each Kp node (after modification) Fig 7. Pheromone deposition on each Kd

Fig 7. Pheromone deposition on each Kd node (after modification)

For the same system, the Ant Colony Algorithm was run 10 times for original algorithm and 10 times after modification to see whether the algorithm is terminating or not with modification. The above results also conform that the solution proposed is giving us an early termination to the algorithm.

www.ijsret.org

227

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882

Volume 3, Issue 2, May 2014

TABLE 1: Showing number of iterations taken using with and without modification to find optimal solution.

S.no

Original

After

modification

1

6

5

2

10(max)

8

3

10(max)

10(max)

4

10(max)

4

5

10(max)

6

6

10(max)

5

7

10(max)

4

8

10(max)

5

9

9

5

10

10(max)

4

B. MODIFICATION IN OBJECTIVE FUNCTION

For any path to be accepted or rejected for being the most optimal one, depends on the objective function(inversely proportional to ISE) value obtained for that path, The logic of this algorithm allows that path to be chosen which has the least ISE value[4][5]. To obtain the desired response, it sometimes becomes necessary to make modifications in the objective function. One of the major problems that was encountered was when the offline tuning of scaling factors of Fuzzy supervised PID for a third order system was done through the algorithm. The response obtained

is of fashion as shown in figure.

The initial oscillations in the response are undesirable as can be seen from the figure 8, although best possible ISE has been obtained for this response. The undesirability is

due to the fact that such sudden and large oscillations can damage the actuator. To reduce these oscillations we need to modify the objective function so that such tuned values can completely be rejected while the algorithm is being proceeded. In the algorithm we are actually storing the values of the error at each sampling instant in an array. Here modification done was that for each sampling instant and

a future sampling instant (+1 sec and +2 sec) was taken

into consideration, the difference between the values of output for both of these time instants must be less than 0.2(taking into assumption a value less than or equal to 0.2 is desirable). If this condition is not true the algorithm immediately rejects that path. This is done by putting ISE value for that path very large forcefully. The reason the future sampling instant was taken at +1 and +2 sec is that the time difference in occurrence of crest and trough was around 1 to 2 seconds which can be seen from the response. This resulted in getting a response with significantly less oscillatory behavior in the transient section of the

response as can be seen from fig 9. Thus giving us desirable response.

1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 2000 4000 6000 8000 10000 12000
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0
2000
4000
6000
8000
10000
12000
Response

Time(.003 secs)

Fig 8. Response for without modified objective function

1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 2000 4000 6000 8000 10000 12000
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0
2000
4000
6000
8000
10000
12000
Response

Time(.003sec)

Fig 9. Response with modification in objective function

VI.

CONCLUSION

In this paper it can be said that the problems were encountered while implementation of Ant Colony Algorithm, in the form of large number of iterations and improper response, so suitable modifications were done in the algorithm so as to get proper results.

REFERENCES

[1] Marco Dorigo, Thomas Stu¨tzle," Ant Colony Optimization", A Bradford Book The MIT Press Cambridge, Massachusetts London, England 2004. [2] Marco Dorigo, Luca Maria Gambardella, "Ant Colony System: A Cooperative Learning Approach to the Travelling Salesman Problem" ,Accepted for publication in the IEEE Transactions on Evolutionary Computation, Vol.1, No.1, 1997.PP 1-21. [3] Oscar Castillo, Witold Pedrycz, and Janusz Kacprzyk ,"Evolutionary Design of Intelligent Systems in Modelling, Simulation and Control", Springer-Verlag Berlin Heidelberg 2009. pp.3-16. [4] R. Mitra, Samarth Singh, "Optimal Fuzzy Supervised PID Controller using Ant Colony Optimization Algorithm" , published in International Journal of Advance in Electronic and Electric Engineering, Research India Publication, vol 3, No.5. pp.543-550. [5] Yongsheng Zhao, Baoying Li "A New Method for Optimizing Fuzzy Membership Function", Proceedings of the 2007 IEEE International Conference on Mechatronics and Automation, 2007, Harbin, China. pp. 674-678.

www.ijsret.org

228