Article
Article
B. Nagaraj, P. Vijayakumar
42 Articles
Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 5, N° 2 2011
0.1433
G(S) = (5) sover and mutation to arrive at the best solution [1]. By
5.2e - 007 s2 + 0.000217 s + 2.265
starting at several independent points and searching in pa-
The purpose of this paper is to investigate an optimal rallel, the algorithm avoids local minima and converging
controller design using the evolutionary Programming, to sub optimal solutions.
Genetic Algorithm, Particle Swarm Optimization and Ant
Colony Optimization. The block diagram of a control sys- A. Objective Function of the Genetic Algorithm
tem with unity feedback employing soft computing PID This is the most challenging part of creating a genetic
control action is shown in Figure 1[7]. algorithm is writing the the objective function. In this pro-
The general equation of PID controller is, ject, the objective function is required to evaluate the best
t PID controller for the system. An objective function could
d(e)
Y(t) = [kpe(t) + Kd + Ki e(t)d(t)] (6) be created to find a PID controller that gives the smallest
d(t)
0 overshoot, fastest rise time or quickest settling time. How-
ever in order to combine all of these objectives it was deci-
ded to design an objective function that will minimize the
performance indices of the controlled system instead [2].
Fitness Function
Each chromosome in the population is passed into the ob-
jective function one at a time. The chromosome is then
EP/GA/PS/ACO v evaluated and assigned a number to represent its fitness,
the bigger its number the better its fitness [3]. The genetic
e
U Y algorithm uses the chromosomes fitness value to create
PID PROCESSS a new population consisting of the fittest members. Each
YSP chromosome consists of three separate strings constitu-
Measured y
SENSOR ting a P, I and D term, as defined by the 3-row bounds de-
claration when creating the population [3]. When the
Fig 1. Block diagram of Intelligent PID controller. chromosome enters the evaluation function, it is split up
into its three Terms. The newly formed PID controller is
The initial values of PID gain are calculated using con- placed in a unity feedback loop with the system transfer
ventional Z – N method. Being hybrid approach, optimum function. This will result in a reduce of the compilation ti-
value of gain are obtained using heuristic algorithm. me of the program. The system transfer function is defined
The advantages of using heuristic techniques for PID in another file and imported as a global variable. The
are listed below, controlled system is then given a step input and the error is
i. Heuristic Techniques can be applied for higher order assessed using an error performance criterion such as
systems without model reduction [7]. Integral square error or in short ISE.
ii. These methods can also optimize the design criteria
such as gain margin, Phase margin, Closed Loop Band ¥
Width (CLBW) when the system is subjected to step & ISE = e2(t)dt (7)
load change [7]. 0
Heuristic techniques like Genetic Algorithm (GA),
Evolutionary Programming (EP), Particle Swarm Optimi- The chromosome is assigned an overall fitness value
zation (PSO) and Ant Colony Optimization (ACO) me- according to the magnitude of the error, smaller the error
thods have proved their excellence in giving better results larger the fitness value. Initializing the values of the para-
by improving the steady state characteristics and perfor- meters is as per Table 2. The flowchart of the GA control
mance indices. system is shown in Figure 2.
Articles 43
Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 5, N° 2 2011
Initializing the values of the parameters is as per Table Vi = (Vi,1, Vi,2,..., Vi,d) (9)
2. The flowchart of the EP control system is shown in Fig. 3.
The modified velocity and position of each particle
can be calculated using the current velocity and distance
Initialize by random
from Pbesti,d to gbestd as shown in the following formulas
Fitness Evaluation
(t+1)
Vi,m = W×Vi,m
(t)
+ c1*rand()*(Pbesti,m - xi,m
(t)
)+
+ c2*Rand()*(gbestm - xi,m)
(t)
(10)
Mutation (t+1)
xi,d (t)
= xi,m + vi,m
(t+1)
i = 1,2,...,n; m = 1,2,...,d (11)
where
Competition
and selection n - number of particles in the group
d - dimension
t - pointer of iterations (generations)
(t+1)
Vi,m - velocity of particle I at iteration t
Terminati on
W - inertia weight factor
criteria reached
c1, c2 - acceleration constant
rand(n) - random number between 0 and 1
(t)
xi,d - current position of particle i at iterations
End Pbesti,m - best previous position of the ith particle
gbestm - best particle among all the particles in the
Fig. 3. Flow Chart of EP. population
44 Articles
Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 5, N° 2 2011
In the proposed PSO method each particle contains the ants do not communicate directly but indirectly by ad-
three members P, I and D. It means that the search space ding pheromone to the environment. Based on the specific
has three dimension and particles must ‘fly’ in a three di- problem an ant is given a starting state and moves through
mensional space. Initializing the values of the parameters a sequence of neighboring states trying to find the shortest
is as per Table 2. The flowchart of the PSO – PID control path. It moves based on a stochastic local search policy
system is shown in Fig. 4. directed by its internal state, the pheromone trails, and
local information encoded in the environment. Ants use
this private and public information inorder to decide when
START
and where to deposit pheromone. In most application the
amount of pheromone deposited is proportional to the
Generate Initial Population quality of the move an ant has made. Thus the more phero-
mone, the better the solution found. After an ant has found
a solution, it dies; i.e.it is deleted from the system [13].
Run The Process Model
ACO uses a pheromone matrix t={tij} for the construc-
tion of potential good solutions. The initial values of t are
Calculate the Parameter Kp, Ki, Kd at PID controller
Maximum Iteration 1
number reacted
where hij = , j = [p,i,d]:
NO kj
representing heuristic functions.
YES
a and b are constants that determine the relative influence
STOP
of the pheromone values and the heuristic values on the
decision of the ant.
TA: is the path effectuated by the ant A at a given time.
Fig. 4. Flowchart of PSO. The quantity of pheromone DtijA on each path may be
defined as
5. ACO based tuning of the controller
ACO’s are especially suited for finding solutions to Lmin
different optimization problems.Acolony of artificial ants Dt = LA
A
ij if i, j ÎTA (13)
cooperates to find good solutions, which are an emergent 0
property of the ant’s co-operative interaction. Based on else
their similarities with ant colonies in nature, ant algo-
rithms are adaptive and robust and can be applied to dif- where:
ferent versions of the same problem as well as to different LA - is the value of the objective function found by the
optimization problems [23]. The main traits of artificial ant A.
ants are taken from their natural model. These main traits Lmin - is the best solution carried out by the set of the ants
are (1) artificial ants exist in colonies of cooperating until the current iteration.
individuals, (2) they communicate indirectly by deposi-
ting pheromone (3) they use a sequence of local moves to The pheromone evaporation is a way to avoid unlimi-
find the shortest path from a starting position, to a destina- ted increase of pheromone trails. Also it allows the forget-
tion point they apply a stochastic decision policy using fulness of the bad choices.
NA
local information only to find the best solution. If neces- tij(t) = ptij(t-1) + å DtijA (t)
A=1
sary in order to solve a particular optimization problem, (14)
artificial ants have been enriched with some additional
capabilities not present in real ants [16]. where:
An ant searches collectively foe a good solution to NA - number of ants
a given optimization problem. Each individual ant can P - the evaporation rate. 0 < p < =1.
find a solution or at least part of a solution to the optimi-
zation problem on its own but only when many ants work A. Implementation algorithm
together they can find the optimal solution [4]. Since the Step 1
optimal solution can only be found through the global co- Initialize randomly a potential solutions of the para-
operation of all the ants in a colony, it is an emergent result meters (Kp, Ki, Kd) by using uniform distribution. Initialize
of such this cooperation. While searching for a solution the pheromone trail and the heuristic value.
Articles 45
Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 5, N° 2 2011
46 Articles
Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 5, N° 2 2011
Step Response
Amplitude
Time (sec)
Articles 47
Journal of Automation, Mobile Robotics & Intelligent Systems VOLUME 5, N° 2 2011
48 Articles