a new pid tuning technique using ant algorithm

6
Proceeding of the 2004 American Contr ol Co nferen ce Boston, Massachusetts June 30 ~July .2004 ThA06.5 A New PID Tuning Technique Using Ant Algorithm Huseyin Atakan Varol Department of Mechatronics Engineering Sabanci University Orhanli, Tuzla, Istanbul, 34956, Turkey [email protected] Abstract n this paper, ant algorithm (AA) which is a new nature-inspired optimization technique, was used to tune a PID controller. I n the tuning process, the following cost functions were employe d: i) Integral Absolute Error (IAE), ii) Integral Squared Error ISE), iii) a new proposed cost function called reference based error with minimum control effort (RBEMCE). The results obtained from ant algorithm tuning process were also compared with the results of Ziegler-Nichols (ZN), Internal Model Control IMC) and Iterative Feedback Tuning IFT) methods. The PID controllers optimized with ant algorithm and the new proposed cost function gives a performance that is at least as good as that of the PID tuning methods mentioned above. With our method, a faster settling time, less or no overshoot and higher robustness were achieved. Moreover, the new tunin g process is successful in the presence of high noise. I. The PID controllers are the best known controllers for industrial control processes since they have a simple structure and their performance is quite robust for a wide range of operating conditions. After the three parameters have been tuned or chosen in a certain way, control parameters of a standard PID are kept fixed during control process. There are many tuning techniq ues based on several methods. These methods can be classified as: i) empirical methods such as the Ziegler-Nichols (ZN) method [I] and the Internal Model Control (IMC) [I], ii) analytical methods such as root locus based techniques [l], iii) methods based on optimization such as the iterative feedback tuning (IFT) [2] and genetic algorithm tuning technique A fundamental closed-loop control system shown in Fig. 1 contains a controller and a plant. In this paper, the PID controller was used as controller. It is comprised of three components: a proportional part, a derivative part and an integral part . The PID controller uses the following control equation. Zafer Bingul Department of Mechatronics Engineering Kocaeli University Kocaeli, Turkey [email protected] of a PID controller, these three constants must be selected in such a way that, the closed loop system has to give desired response. The desired response should have minimal settling time with a small or no overshoot in the step response of the closed loop system. Y Fig.  I Closed-Loop System In this work an t algorithm (AA) was applied to optimize the constants of the PID controller. To show the effectiveness of our method, the step responses of closed loop system were compared with that of the existing methods ZN, IMC and IFT). Next, the method was tested for the robustness to model errors. In the robustness test, the used model is slightly changed by adding delay to the model, varying the steady state gain and changing a pole. At last, the ant algorithm was used to tune the PID controller in the presence ofno ise with differ ent variances. II. ANT ALGORlTHM Ant algorithm i s a new nature-inspired optimization technique used especially in combinatorial optimization problems (COP). In ant algorithm, there is an iterative process in which a population of simple agents (ants) repeatedly creates candidate solutions of the given problem. There are two mechanisms in probabilistically guided solution creation process of AA. These are heuristic information on the given problem and memory containing experience gathered by ants in the previous iterations (the pheromone trails). The communication between the ants is mediated by the depos ition ofph eromone to the elements of good solutions. Then the elements with a higher auantitv of . iheromone become more attractive for the other ants. -The quantity of pheromone deposited on each element is a function of the quality of the solution. The algorithm was applied to the traveling salesman problem (TSP) and as TSP, an artificial ant is considered as an agent that moves I ) k- S C(S) k , +I+kds where the kp is the proportional constant, k integral well several quadratic assignment problems QAP) 4,5]. In constant and the kd is the derivative constant. In the design 0-7803-8335-4/041 17.00 02004 AACC 21 54

Upload: carlos-manoel

Post on 14-Apr-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

7/27/2019 A New PID Tuning Technique Using Ant Algorithm

http://slidepdf.com/reader/full/a-new-pid-tuning-technique-using-ant-algorithm 1/6

Proceeding of th e 2004 American Control ConferenceBoston, Massachusetts Jun e 30 ~ J u l y .2004

ThA06.5

A New PID Tuning Technique Using Ant Algorithm

Huseyin Atakan Varol

Department of Mechatronics EngineeringSabanci University

Orhanli, Tuzla, Istanbul, 34956, [email protected]

Abstract - n th is paper, a n t algorithm (AA) which is a new

nature-inspired optimization technique, was used to tune a

PID controller. I n th e tuning process, the following costfunctions were employed: i) Integral Absolute Error (IAE), ii)

Integral Squared Error (ISE), iii) a new proposed costfunction called reference based error with min imum controleffort (RBEMCE). The results obtained from ant algorithmPID tuning process were also compared with the results ofZiegler-Nichols (ZN), Internal Model Control (IMC) a n dIterative Feedback Tuning (IFT) methods. The PI Dcontrollers optimized with a n t algorithm and the newproposed cost function gives a performance that is at least asgood as that of t h e PI D tuning methods mentioned above.With our method, a faster settling time, less or no overshootand higher robustness were achieved. Moreover, th e newtuning process is successful in the presence of high noise.

I. INTRODUCTION

The PID controllers are the best known controllers forindustrial control processes since they have a simplestructure and their performance is quite robust for a wide

range of operating conditions. After the three parametershave been tuned or chosen in a certain way, controlparameters of a standard PID are kept fixed during controlprocess. There are many tuning techniq ues based on severalmethods. These methods can be classified as: i) empiricalmethods such as the Ziegler-Nichols (ZN) method [I ] andthe Internal Model Control (IMC) [ I ] , ii) analyticalmethods such as root locus based techniques [l], iii)methods based on optimization such as the iterative

feedback tuning (IFT) [2] and genetic algorithm tuningtechnique [3].

A fundamental closed-loop control system shown in Fig.1 contains a controller and a plant. In this paper, the PIDcontroller was used as controller. It is comprised of three

components: a proportional part, a derivative part and anintegral part. The P ID controller uses the following controlequation.

Zafer Bingul

Department of Mechatronics EngineeringKocaeli University

Kocaeli, [email protected]

of a PID controller, these three constants must be selectedin such a way that, the closed loop system has to givedesired response. The desired response should haveminimal settling time with a small or no overshoot in thestep response of the closed loop system.

Y

Fig.  I Closed-Loop System

In this work ant algorithm (AA) was applied to optimizethe constants of the PID controller. To show theeffectiveness of our method, the step responses of closedloop system were compared with that of the existingmethods (ZN, IMC and IFT). Next, the method was testedfor the robustness to model errors. In the robustness test,

the used model is slightly changed by adding delay to the

model, varying the steady state gain and changing a pole.At last, the ant algorithm was used to tune the PIDcontroller in the presence ofn ois e with different variances.

I I . ANT ALGORlTHM

Ant algorithm is a new nature-inspired optimizationtechnique used especially in combinatorial optimizationproblems (COP). In ant algorithm, there is an iterative

process in which a population of simple agents (ants)repeatedly creates candidate solutions of the given problem.There are two mechanisms in probabilistically guidedsolution creation process of AA. These are heuristicinformation on the given problem and memory containingexperience gathered by ants in the previous iterations (thepheromone trails). The communication between the ants ismediated by the deposition ofph erom one to the elements ofgood solutions. Then the elements with a higher auantitv of.iheromone become more attractive for the other ants. -Thequantity of pheromone deposited on each element is afunction of the quality of the solution. The algorithm wasapplied to the traveling salesman problem (TSP) and as

TSP, an artificial ant is considered as an agent that moves

( I )k -

SC ( S ) k , + I + k d s

where the kp is the proportional constant, k, integral well seve ral quadratic assignment problems (QAP) 4,5]. Inconstant and the kd is the derivative constant. In the design

0-7803-8335-4/041$17.0002004 A A C C 21 54

7/27/2019 A New PID Tuning Technique Using Ant Algorithm

http://slidepdf.com/reader/full/a-new-pid-tuning-technique-using-ant-algorithm 2/6

kom city to city on a TSP graph. The agents travelingstrategy is based on a probabilistic function that considerstwo facts. Firstly, it counts the edges it has traveledaccumulating their lengths and secondly it senses the trail(pheromone) left by other agents (ants). Ants select the next

city ; mong a candidate list based on the followingtransition rule [4 ] :

arg max,,,.,; { k i u ( d k q i u ~ 1 ' i f q5 qo

J i f s2 40

;=(

(2)

(3)

Where is the pheromone, q is the inverse of the distancebetween the two cities, q is a random variable uniformly

distributed over [0, I], qo is a tunable parameter in theinterval [0, I] , and J belongs to the candidate list and isselected based on the above probabilistic rule as in (3).Each ant modifies the environment in two different ways:

i) Local trail updating: As the agent moves between cities itupdates the amount of pheromone on the edge by thefollowing equation:

where p is the evaporation constant. The value r0 is theinitial value of pheromone trails and can be calculated

as r0 = (nL,,,,)-' ,where n is the number of cities and Lnn s

the length of the tour produced by one of the constructionheuristics.

ii) Global trail updating: When all agents h ave completed atour the agent that fmds the shortest route updates the edgesin its path using the following equation:

ry(t) (1- p) . ry t- )+--.

where L is the length of the best tour generated by one ofthe agents.

A. Application of Ant Algorithm to PI D Tuning

r g ( t )=(l-p).rg(t-l)+p.rV (4)

( 5 )P

L+

In order to optimize the parameters of a PID controllerwith ant algorithm, the PID tuning has to be transformed

into a COP problem. Firstly, the maximum and minimumvalues for the PID parameters are chosen in such a way thatthe search space of optimization is not too large. In ourwork, the search space is divided into 100 values for eachPID param eter ranging from 0 to 1.5 times that of the ZN

method. However, if short computation time is not a must,a wider search space can be selected. Al l of the values foreach parameter are placed in three different vectors. Inorder to create a graph representation of the problem (Fig.Z), these three vectors and the values in these vectors can be

considered as three caves and the paths between the caves,respectively. In the tour, the ant must visit all three cavesby choosing one path between the each cave. The objectiveof optimization in ant algorithm is to fmd the best tour withthe lowest cost function among the three caves. The ants

deposit pheromone to the beginning of each path. Thepheromones in our ant algorithm were updated in tw oways: Local pheromone updating and global pheromoneupdating. I

CR . C"S

P IIFig 2Graphical representation of AA In PID tuningprocess

In local pheromone updating (6), ach ant updates thepheromones deposited to the paths it followed aftercompleting one tour.

(6)0.01a

r,,(t)=r,,(t-I)+-

where a is the general pheromone updating coefficient, n isthe number of paths and caves, C is the calculated costfunction for the tour traveled by the ant.

In global pheromone updating, there are positive (7) andnegative (8) pheromone updating. The pheromones of thepaths belonging to the best tour and worst tour of the antcolony are updated as given in the following equations:

cm

besr wors t

where r and r are the pheromones of the paths

followed by the ant in the tour with the lowest cost value(Cb,J and with the highest cost value (C,,,,*J in oneiteration, respectively. The pheromones of the pathsbelonging to the best tour of the colony are increasedconsiderably, whereas those of the paths belonging to theworst tour of the iteration are decreased. After eachiteration some of the pheromones evaporate. Pheromoneevaporation (9) allows the ant algorithm to forget its pasthistory, so that A A can direct its search towards new

directions without being trapped in som e local minima.rg( t )=ry( t ) A

where h is the evaporation constant and A is the sum of the(7) and (8).

The three cost functions for PID tuning optimized withant algorithm in our study are: i) Integral Absolute Error(IAE), ii) Integral Squared Error (ISE), iii) reference basederror with minimum control effort (RBEMCE ). In referencebased error with minimum control effort, a desired response

(9)a

2155

7/27/2019 A New PID Tuning Technique Using Ant Algorithm

http://slidepdf.com/reader/full/a-new-pid-tuning-technique-using-ant-algorithm 3/6

is approximated as an exponential function (first ordersystem response) (10).

(10)

where I/ c can be taken as the time constant of the system.The system is forced to trace this desired response using

minimum control effort. Based on this assumption, the costfunction used in our optimization has the form as follows:

yd ( t )= 1 e-''

where N is the number of data points, k is the weight of

minimal control effort and p i s a vector.conhining the PID

parameters. . ,

111. RESULT S AN D D ISCUS SION

A. Analysis of the Cost Functions in AA

In order to illustrate the differences between the PIDtuning process with AA and the other methods (ZN, IM Cand IFT), the following model (12) is taken from [ 6 ] .

(1-5s)

(1+1OS)(1+2OS)G(s)=

Using three different cost f;nctions (IAE, ISE andRBEMCE ), tuning process with an t algorithm is applied tothe m odel (12). Because of the probabilistic nature of theant algorithm, ant algorithm was mn five times with 5 antsand 1000 iterations. Among five runs for each costfunction, the best result with the lowest cost for step input

is shown in Fig. 3.  The com spon ding control signals are

illustrated in Fig 4. As can be seen from Fig. 3  and Fig 4,RBEMCE outperforms the other two cost functions. InRBEMCE cost function, the desired response defmed bythe user is traced with the use of minimum control effort.For comparison, the maximum overshoot (OS%), rise time(T,) and %2 settling time (C) of the controllers which wereoptimized with respect to three different cost functions aresummarized in Table 1, However, the rise time of RBMCEmethod is higher than the other methods. It has almost the

same settling time with H E method and has no overshoot.The other two methods, IAE and ISE, have higherovershoots.

TABLE I

Pln PARAMETERS FOR DIFFERENT COST FUNCTIONS AN D

THEIR CONTROL CHARACTERISTICSI A n t - I A E I A n t - I S E I An t

-0.40

~ ~

- ANT-ISE

i

I50 100 150 200

time (s)

Fi g 3 Step responses for the closed-loop systems wi th G(s) and the PIDcontro llers tuned with the three d ifferent cost functions.

',I1 ~ ANT-IAE I

2/L , ,0 .'

0 50 100 15 0

l ime ( 5 )

0

I-ig 4 Conespondind C O ~ U U ~~gnala ur the cl.xed-lsop s)slcms \\ ith G(SJand th e HI) w n ~ u l l c r ~uned u i t h the three dif icrenl cos1 funrli.mc

R. Comparison with Other Tuning Methods

I n this section, the PID controller tuned with antalgorithm using RBEMCE cost function is compared with

that of ZN, MC and ItT methods. The results arc given in

Table II.

TABLE I 1~ ~~~~ ~~

PID PARAMETERS FOR DIFFERENT METHODS AND THE IR

CONTROL CHARACTERISTICS.IM C I IFT I Ant 1

21 56

7/27/2019 A New PID Tuning Technique Using Ant Algorithm

http://slidepdf.com/reader/full/a-new-pid-tuning-technique-using-ant-algorithm 4/6

From Table 11, the best settling time is obtained by IFTmethod with a small overshoot and ANT-RBEMCE hasnearly sam e settling time with no overshoot. Fig. 5  and Fig.6 show the step responses and the corresponding controlsignals for closed-loop systems with the PID controllers

tuned with four different methods, respectively. From Fig.5, IFT and ANT-RBEMCE methods have the best outputcharacteristics (lower overshoot and faster settling time),which are almost indistinguishable. The control signalcharacteristics of IFT and A NT-RBEMCE methods behavealso in a similar fashion.

1 - NT-RBEMCE

14.5; 50 100 4 5 0 200

time (s)Fi g 5 Step responses for the closed-loop systems with G(s) and the PID

contmllen tuned with different melhods.

Fu g 6 Cunerpondmg control signals fdr the closed-loup s) demr M ~ t h

G ( r ) und Ih c Pl D conlrollers tuned r i t h differem mcthodr

C. Robustness lo Model Errors

A controller tuning method should be robust to modelerrors. To test the robustness of th e methods, controllerstuned with methods mentioned abote were applied to amodel that i s slightly different from the model (12) . Th ethree slightly different mode ls used are g iven as follows:

(1-5s)

(1+10s)(1+2Ss)b (S) =

(1-5s) e-I.5s

Gc ( s )= (1 +IOs)(l + 20s )

In order to evaluate the robustness of the PID controllertuned with ant algorithm and to compare it with the othertuning methods, the same PID parameters in Table 11 wereemployed, Firstly, the responses to the model (13), inwhich the steady state gain of (12) is increased by SO%, areshown in Fig. 7.  Secondly, one pole o f (12) is changed (14)

and its result is shown in Fig. 8.  Thirdly, a delay of 1.5

seconds has been added to G(s) (15). The responses areshown in Fig. 9.

e0 . 5 -0

0-

-0.5b 50 100 150time (s)

Fig 7 Step respanses for the closed-lwp sys tem with G& ) and the

PID controllen tuned with different methods

- NT-RBEMCE

50 100 150

lime fs )

-0.2: IO

. .

Fig 8 Step responses fo r the closed-loop systems with G& ) and the PIDconlrollers Nned with different methods

1.5(1-5s)

G @) (1+ 1Os)(l+20s)

2157

7/27/2019 A New PID Tuning Technique Using Ant Algorithm

http://slidepdf.com/reader/full/a-new-pid-tuning-technique-using-ant-algorithm 5/6

1.2r

K.KiI<d

-~ IMC- NT-RBEMCE

I . 5 ~

a2=0.0025 d= 0.0 25 $=0.252.6555 2.97 0.7650.1575 0.153 0.1575

17.55 19.8 4.5

I I

0 50 100 150 200time (s)

Fig. 9 Step responses or the closed-loop systemswith G,(s) and the PIDconaollers hlned with different methods

All of the four controllers are robust to these modeling

errors except for the system with th e delay, which causes anincrease in settling time. However, ANT-REiEMCE showsthe best result with the lowest overshoot and settling timein all cases.

D. ystem with G aussian White Noise

In order to test the PID tuning with ant algorithm in thepresence of noise, ANT-RBEMCE is used to control theplant defmed below

y(t)=G2(s)u(t)+ H(s)e(t),with (16)

where e(t) is the gaussian white noise. The above system istested for three different variances $=0.0025 $=0.025,d=0.25. Ant algorithm was run 5 times with 5 ants and1000 iterations due to the probabilistic nature of AA andnoise. The PID parameters are from 0 to 4.5 for kp, 0 to0.45 for k, and 0 to 22.5 for kd. General pheromoneupdating coefficient a is taken as 0.06 and evaporationparameter L is taken as 0.95. The closed loop responseswith the lowest cost function for different variances ofgaussian white noise are illustrated in Fig. 10, 11 and 12.The corresponding PID parameters are presented in Table3. The control parameters obtained by ANT-RBEMCEtake into account the presence of the noise and thecontroller shows very good noise rejection feature. Even inthe presence of very high noise, the system is able to trace

the desired response.

TABLE Ill

PID PARAMETERS OF GdS) WITH DIFFERENT GAUSSIAN WHITE

. .

Fig. IO Th e step response for $=0.0025

1.2

50 ti&&) IS0 200

Fig.I The

step response for$=0.025

1.2 I

I50 100 IS 0 2w

time (5)

Fig. 12 Th e step response for d=0.25

2158

7/27/2019 A New PID Tuning Technique Using Ant Algorithm

http://slidepdf.com/reader/full/a-new-pid-tuning-technique-using-ant-algorithm 6/6

IV . CONCLUSIONS

In this study, a new PID tuning process based on antalgorithm was developed. Since ant algorithm is a powerfuloptimization technique, it is applied to PID tuning problem.

Firstly, AA with different cost functions was used to tunePID parameters. According to this, the proposed costfunction (RBEMCE) gives a performance such that it hasthe optimum settling time with no overshoot. Secondly, AAusing this cost function is compared with ZN, IMC and IFTmethods. Based on this comparison, IFT and ANT-RBEMCE showed almost same optimal behavior (noovershoot and less settling time). Thirdly, the performanceof this optimal tuning method for the tuning of PIDcontrollers was tested in different situations (changing apole of the system, adding time delay and varying thesteady state gain). The controller tuned with ANT-RBEM CE show ed high robustness in all cases compared tothe other methods (ZN, IMC, IFT). Finally, the ANT-

RBEMCE is applied to a model with noise. Even in thepresence of very high noise, ANT-RBEMCE showed goodcontrol behavior.

There are two big advantages of ANT-RBEMCE PIDtuning process: having no overshoot even if the system isp e w b e d in several ways and having noise rejection even ifvery high noise variance exists. Especially, these featuresare important in robotic control applications. The off-linetuning procees used in this work can be also extented to on-line tuning process.

V. REFERENCES

[ I ] K.J. Astr6m and T. Htigglund, PID Controllers:

Theory, Design, and Tuning,. The Inshumentation,Systems, and Automation Society, 1995.

[2 ] H. Hjalmarsson, M. Gevers, S . Gunnarsson, 0.

Lequin, “Iterative feedback tuning: Theory andapplications”, IEEE Control Systems Magazine, vol.18, 1998, pp 26-41.

J.M. Herrero, X. Blasco, M. Martinez, J.V: Salcedo,“Optimal PID Tuning with Genetic Algorithms forNon-Linear Process Models”, in IFAC 15’ TriennialWorld Congress, Barcelona, Spain, 2002.

M. Dorigo, L.M. Gambardella; “Ant colony system: acooperative leaming approach to the travelingsalesman problem”, IEEE Transactions on

Evolutionary Computation, vol. I , 1997, pp 53-66

[SI L.M. Gambardella, E.D. Taillard, M. Dorigo, “Ant

colonies for the quadratic assignment problem”,Journal ofthe Operational Research Society, 1999, pp

[3]

[4]

167-1 76.

[6] 0. Lequin, M. Gevers, M. Mossberg, E. Bosmans, L.Triest, “Iterative feedback tuning of PID parameters:comparison with classical tuning rules”, ControlEngineering Practice, vol. 11, 2003, 1023-1033.

2159