This action might not be possible to undo. Are you sure you want to continue?

# PATH PLANNING OPTIMIZATION

OF INDUSTRIAL ROBOTS

USING GENETIC ALGORITHM

Fares Abu-Dakka

*

Francisco Valero

*

Vicente Mata

*

Iyad F. I. Assad

**

*

Polytechnic University of Valencia/Mechanical Engineering and Materials Department, Valencia, Spain

**

Birzeit University /Computer Science Department, Ram-Allah, Palestine

Abstract: This paper presents a new approach of Genetic Algorithm for path planning

problem. The aim of this work is to find an optimal and collision free path for robot

manipulator system from a specific initial position of the end-effector to a specific final

one. The genetic algorithm applied here to search for optimal collision free path. The path

is consisting of a set of adjacent configurations; each is generated by using inverse

kinematics problem. To check the possible collisions between robot's arms and obstacles

in the workspace a collision detection algorithm in each of those configurations has been

applied. As an application example, this algorithm is applied over Puma 560. Some

numerical examples are provided to verify the functionality of the algorithm.

Keywords: Robotics, Genetic Algorithm, Path Planning, Collision Avoidance.

1. INTRODUCTION

A clear difference exists between those algorithms

devoted for the path planning problem and those

devoted for determining the optimal trajectory for

robotic systems. The first ones try, essentially, to

obtain a sequence of robot configurations that fulfils

some conditions, mainly, collision avoidance.

Whereas, the second ones try to obtain a temporal

history of the evolution for robot joint coordinates,

by minimizing aspects, such as; the required time or

the energy consumption. The path planning problem

is a very active research area and there is a vast

literature about it, e.g., (Latombe, 1999; Ahuactzin,

Gupta et al., 1998; Barraquand and Latombe, 1991;

Li and Trabia, 1996; Kavraki, Svestka et al., 1996;

Ladd and Kavraki, 2004).

In path planning problems, the number of feasible

paths between the initial and final position of a robot

are often very large, and the goal is not necessarily to

determine the best solution, but to obtain an

acceptable one according to certain requirements and

certain constraints. Various search methods have

been developed (e.g., calculus-based methods,

enumerative schemes, random search algorithms,

etc.) for the robot path-planning problem. In this

paper; genetic algorithm has been used.

Genetic Algorithm (GA) based search and

optimization techniques have recently found an

increasing use in machine learning, robot motion

planning, scheduling, pattern recognition, image

sensing and many other engineering applications. In

principle, GAs are search algorithms based on

mechanics of natural selection and natural genetics.

They combine survival of the most fitting among the

string structures with randomized yet structured

information exchange to form a search algorithm

with innovative flair of natural evolution.

GAs have proven their robustness and usefulness

over other search techniques because of their unique

procedures that differ from other normal search and

optimization techniques in four distinct ways:

1. GAs work with coding of a parameter set,

not the parameters themselves.

2. GAs search from a population of points, not

a single point.

3. GAs use payoff (objective function)

information, not derivative or other auxiliary

knowledge.

1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 0 0 1 0 1

x

1

x

2

4. GAs use probabilistic transition rules, not

deterministic rules.

In the context of determining a suitable manipulator

trajectory, a number of methods have been proposed

and investigated recently. For example, (Monteiro

and Madrid, 1999) have used GA to plan the stages

of the trajectory of a robot arm called Jeca III. They

have proposed the use of GA to plan a trajectory with

obstacle avoidance and to implement joint space

using classical GA. This is achieved in two stages:

initial positioning, which locates the end-effector of

robot arm in first point of trajectory, and incremental

positioning which moves the end-effector to the next

point of trajectory. (Pires and Machado, 1999) have

used GA to generate collision free trajectories for

robotic manipulators with the objective to minimize

the path length and ripple in time evolution of robot

positions and velocities. They have used direct

kinematics for this purpose and have presented

results for several redundant and non-redundant

robot manipulators.

In the proposed method, generating such path is used

to measure the distance between its initial and final

points. The shortest distance between these points is

a straight line, but with the possibility of the presence

of obstacles in the straight line that passes by the

initial and final points or in any other point in the

workspace. Therefore, any tool should be used to

generate a path that is as short as possible, without

collision with obstacles. The genetic algorithm (GA)

appears here to solve such problem by minimizing

the traveling distance of the end-effector between the

initial and final point avoiding obstacles. The

workspace will be discretized into a prism between

the initial and final points. This algorithm will be

applied on an industrial robot Puma 560 modeled

with six degree of freedom.

2. GENETIC ALGORITHM OVERVIEW

Genetic Algorithms (GA) attempt to mimic the

biological evolution process for discovering good

solutions, and considered as a part of evolutionary

computing, which is a rapidly growing area of

artificial intelligence. They are based on a direct

analogy to Darwinian natural selection and mutations

in biological reproduction. And they belong to a

category of heuristics known as Randomized

Heuristics, that employ randomize choice operators

(crossover and mutation) in there search strategy and

do not depend on complete pre-knowledge of the

features of the domain.

Genetic Algorithms (GAs) are stochastic algorithms

whose search methods imitate some natural

phenomena. All living organisms consist of cells. In

each cell there is the same set of chromosomes.

Chromosomes are strings of DNA and serves as a

model for the whole organism. A chromosome

consists of genes, blocks of DNA. Each gene encodes

a particular protein. Basically can be said, each gene

encodes a trait, for example, color of eyes. Possible

settings for a trait (e.g. blue, brown) are called

alleles. Each gene has its own position in the

chromosome. This position is called locus. A

complete set of genetic material (all chromosomes) is

called genome. A particular set of genome is called

genotype. The genotype is with later development

after birth base for the organism's phenotype, its

physical and mental characteristics, such as eye

color, intelligence etc. During reproduction,

recombination (or crossover) occurs first. Genes

from parents form in a way the whole new

chromosome. The new created offspring can then be

mutated. Mutation means, that the elements of DNA

are changed a bit. So the idea behind genetic

algorithms is to do what nature does.

A genetic algorithm follows a step-by-step

procedure. The most commonly used representation

in GAs is the binary alphabet (0, 1) although other

representations can be used, e.g. ternary, integer,

real-valued etc. For example, as shown in ``Figure 1,

a problem with two variables, x1 and x2, may be

mapped on the chromosome structure in the

following way: where x1 is encoded with 10 bits and

x2 with 15 bits, possibly reflecting the level of

accuracy or range of the individual decision

variables. Examining the chromosome string in

isolation yields no information about the problem we

are trying to solve. It is only with the decoding of the

chromosome into its phenotypic values that any

meaning can be applied to the representation.

Fig. 1. Binary alphabet GA representation.

3. PROBLEM MODELLING

In this problem there are mainly two types of

constraints; kinematic constraints and obstacle

avoidance constraints. Kinematic constraints are

calculated by computing the inverse kinematic

problem for each point before it has been added to

the chromosome. The next step is to check the

validity of that point and obstacle avoidance

constraints for the configuration of robot in that

position. To begin with, an overview should be made

concerning the kinematics of the robot.

4.1 Workspace modelling

The workspace has been modelled in Cartesian

coordinates and descritized into a rectangular prism

with its axis parallel to the Cartesian reference

system. The end points of the diagonal represent the

initial and final position of the robot end-effector, see

(Valero, Mata et al., 2005).

0 0

0 0 0

, , ,

i i

i

O P O O i O P

r r R r = +

4.2 Robot modelling and kinematics

In the constructing process of the chromosome it is

necessary to check the validity of the chosen point in

the chromosome by checking the existence of valid

configuration of the robot with obstacle avoidance.

To do that it is necessary to calculate the joints of

robot using inverse kinematic problem, and then,

check the obstacle avoidance. In this work the

kinematic equations of the Puma 560 will be solved,

see (Craig, 1989).

The robot has been considered as a wired model, see

``Figure 2. This model consists of rigid links joined

together by the corresponding kinematics joints. To

facilitate the collision avoidance formulation, the

robot configuration was expressed as a set of points

which are called significant points ( )

j

i i

q o and

interesting points ( )

j

k i

p q that have been modelled as

function of generalized coordinates and expressed in

Cartesian coordinates.

Fig. 2. All the points needed to determine the

geometry of the robot

The robot kinematics has been modelled in recursive

way based on Denavit-Hartenberg’s notation, where

the local reference frame { } i is attached to link i and

has its origin laying on joint axis i. So the transform

which defines frame{ } i relative to the frame { } 1 i ÷

has been determined. According to Denavit-

Hartenberg; the rotation matrix

1 i

i

R

÷

can be found

(Craig, 1989). After that the vector

1

1

,

i i

i

O O r

÷

÷

between

any consecutive reference frames on the same link

can be determined. The vector ,

i j

i

O O r between the

origins of any reference frame i to another reference

frame j expressed in i, can be determined also. The

significant points and the interesting points can be

found from the following equation

(1)

where

0

0

, O P

r is the vector from the origin of the

reference system attached to the base of the robot to

the significant or interesting point located in link i.

and P is one of the points

1

o ,

2

o ,

3

o ,

4

o

1

P ,

2

P ,

3

P , and

4

P .

4.3 Obstacles modelling

The obstacles contained in the workspace are

modelled in Cartesian coordinates, using a

combination of three basic elements: spheres,

cylinders, and quadrilateral planes since they are

computationally simple. Any type of obstacle can be

modelled using one or set of these elements. The

minimum distance is obtained among these basic

elements and the robot’s links. The three basic

elements of obstacles can be defined in the space as

follows:

Sphere E

k

( Q

ek

, r

ek

)

Q

ek

→ centre

r

ek

→ radius

Cylinder

CL

k

(Q

ck1

,

Q

ck2

, r

ck

)

Q

ck1

→ End 1

Q

ck2

→ End 2

r

ck

→ radius

Quadri-

lateral

plane

PR

k

(Q

pk1

,Q

pk2

,

Q

pk3

,e

pk

)

Q

pk1

→ vertex 1

Q

pk2

→ vertex 2

Q

pk3

→ vertex 3

e

pk

→ height

According to (Lozano-Pérez and Wesley, 1979) the

process of growing obstacles technique has been

used in order to obtain the actual dimensions of the

robot.

Obstacle avoidance can be divided into two main

stages. First, in the chromosome construction

process, it is necessary to check that the next point,

where the end-effector has to go, is not in the space

of any obstacle. Second stage, the algorithm will

calculate the inverse kinematic problem to check if

there is any valid configuration of the robot in that

point. After that the algorithm will select the

configuration that is adjacent to the anterior one,

applying the collision detection algorithm that checks

the collisions between robot’s arms and obstacles in

the workspace.

4. PROBLEM FORMULATION

To apply a genetic algorithm to search for the

optimal value for any problem; in this case the path

between two configurations of robotic manipulator,

firstly, a coding scheme will be needed to encode the

parameters to generate the path. In this work, a

binary presentation has been used.

The workspace has been discritized into segments in

three dimensions consisting rectangular prism

between the initial and final points, see (Valero, Mata

et al., 2005).

The main operators and characteristics in the exposed

GA are:

o

1

o

2

o

3

o

4

p

1

p

2

p

3

p

4

X

Y

Z

O

( ) ( ) ( )

( ) ( ) ( )

( ) ( ) ( )

2 2 2

1 1 1

2 2 2

1 1 1

2 2 2

1 1 1

...

...

i i i i i i

n n n n n n

f f f f f f

x x y y z z

Minimize x x y y z z

x x y y z z

+ + +

+ + +

÷ ÷ ÷

¦ ¹

÷ + ÷ + ÷ + +

¦ ¦

¦ ¦

÷ + ÷ + ÷ + +

´ `

¦ ¦

¦ ¦

÷ + ÷ + ÷

¹ )

- Individual:

The individual or the chromosome is composed of

set of intermediate points (straight line segments)

that include end points which construct a whole path,

where the end-effector moves from the initial to the

final position passing through those points. Each

triplet cells consisting one point (the Cartesian

coordinates of the end-effector) in the chromosome

and considered as a gene, see ``Figure 3.

Fig. 3. GA Chromosome

The first point of each individual is the initial point,

but the second point selected randomly in one of the

next directions; x-direction, y-direction, z, direction,

xy,-direction, xz-direction, yz-direction, and xyz-

direction, and so on for the next point till it reaches

the final position. Note that this definition is based

on the number of intermediate points that consisting

the path.

- Objective function:

The objective of this optimization problem is to find

the optimal path between initial and final positions of

a robot end-effector. Because of the possibility of

existing obstacles, and of not having a valid

configuration of the robot (calculated by the inverse

kinematic problem in some points), the algorithm

will try to find the shortest possible path. The

shortest path will be calculated by minimizing the

sum of the straight line segments from the initial to

the final point. In this case, the objective of GA is to

minimize the following equation:

(2)

- Selection:

The selection operation is made using the roulette-

wheel method. This selection method picks an

individual based on the magnitude of the fitness

score relative to the rest of the population. The

higher the score, the more likely an individual will be

selected. Any individual has a probability p of being

chosen for the crossover operation, where p is equal

to the fitness of the individual divided by the sum of

the fitness of each individual in the population.

- Crossover:

The crossover is made through the exchange of a part

of the path between two paths chosen through the

selection operation mentioned earlier; being that it is

executed only if the probability of the crossover is

satisfied. This is done by searching groups of

individuals that have been selected for crossover, and

then, select two individuals randomly, then search

the points to find a pair of points (one point in each

path) where the step from the selected point in the

first path to the selected point in the second path is

within the accepted step, i.e. given two paths: P

1

, P

2

:

P

1

= p

11

p

12

…. p

1i

… p

1n

. P

2

= p

21

p

22

…. p

2j

… p

2m

We will find p

1i

, p

2j

, such as:

p

2jx

– p

1ix

< maxstep

x

,

p

2jy

– p

1iy

< maxstep

y

, and

p

2jz

– p

1iz

< maxstep

z

If there are no such points, the crossover will be

cancelled. However, if several pairs of points satisfy

these criteria, one pair will be selected randomly for

the crossover process from those points. Path P will

be the result of the crossover, where

P = p

11

p

12

…. p

1i

p

2j

… p

2m

This means that the resulting path will consist of two

parts: a part of the first path (from the initial point

until the selected point p

1i

), and a part of the second

path (from p

2j

until the final point). This process is

illustrated in ``Figure 4:

Fig. 4. Crossover between two robot paths.

- Mutation:

Mutation is done by selecting a point among the

intermediate points in the path randomly (the first

and final points are not considered for mutation). The

point is then compared to the previous and next

points in the path. All the possible changes with

which the path will remain incremental and quantum

are applied to the point. To illustrate, let us consider

the points (0,0,0), (1,0,1), (1,1,2) with a step value of

X1 Y1 Z1 … Xi Yi Zi … Xf Yf Zf

Point 1 Point i Point f

Crossover

Initial

point

Final

point

Initial

point

Final

point

1 in the x, y and z-coordinates. If mutation is to be

applied on the second point (1,0,1), we will consider

how each of the coordinates changed. The x-

coordinate changed from 0 (previous point) to 1 and

remained 1 in the next point. It is clear that changing

the x-coordinate from 1 to 0 will not affect the

validity of the path since the points will become

(0,0,0), (0,0,1), (1,1,2); i.e. x-coordinate changed

from current to next while remained the same when

going from the previous point to the current point.

The same thing can be said about the y-coordinate,

since it has not changed when going from the

previous point to the next while changed when going

to the next point. The mutation will cause the y-

coordinate to change from 0 to 1. Finally, the z-

coordinate can't be modified since it changed from 0

to 1 to 2. If the mutation would change the z-

coordinated to 0 or 2, the step would be greater than

the predefined step. The mutation will not affect the

coordinates that has not changed at all, for example

the x-coordinate in (0,0,0),(0,0,1),(0,1,1) since any

changes will result in the path being invalid. This

process is illustrated in ``Figure 5.

Fig. 5. Mutation.

The control parameter values and terminating

conditions used in the GA were selected based on

several preliminary runs with alternate control

parameters and terminating conditions on different

instances of the problem. These values were then

used for the test problems reported in the

computational results. The final parameter values

used in the computational experiments for the GA

procedure are summarized in Table 1.

Table 1: Parameter values for the genetic algorithm

procedure.

Description Parameter Value

Population size popsize 30

Generation

number

ngen 1000

Crossover rate pcross 0.9

Mutation rate pmut 0.1

Percentage of

solutions

replaced by

new generation

pReplacement 0.25

5. COMPUTATIONAL RESULTS

In order to evaluate the influence of the algorithm in

obtaining the best path between two configurations,

some examples have been solved using a Puma 560

robot in different workspaces.

As showed in the table 2 below, the true distance is

the straight line distance between the initial and final

points of the end-effector of the robot. The other

distances are calculated by GA procedure in different

workspaces. The third column in each case is the

percent of each calculation compared with the real

one to indicate how the results are close to the best

solution.

In appendix A, the evolution of the robot is

demonstrated.´´Figure 6 shows four configurations of

the robot.

Table 2 : The results.

Case 1

The

distance

between

end points

Time of

calculation

(sec)

Optimality

percentage

True

distance

0.8591

without

obstacles

0.9056 55.00 94.9%

with

sphere

1.0473 95.00 82.0%

with two

spheres

0.9899 90.00 86.8%

with

three

spheres

1.0624 114.00 80.9%

with

cylinder

0.9433 64.00 91.1%

with two

cylinder

1.0233 61.00 84.0%

with

plane

0.9056 78.00 94.9%

Mutation

Initial

point

Final

point

Initial

point

Final

point

Case 2

The

distance

between

end points

Time of

calculation

(sec)

Optimality

percentage

True

distance

1.0223

without

obstacles

1.1158 52.00 91.6%

with

sphere

1.1158 53.00 91.6%

with two

spheres

1.1672 107.00 87.6%

with

three

spheres

1.1542 103.00 88.6%

with

cylinder

1.1230 78.00 91.0%

with two

cylinder

1.2305 88.00 83.1%

with

plane

1.1599 93.00 88.1%

6. CONCLUSION

In this work an algorithm had been built to solve path

planning problem, considering the kinematic of robot

in different environments. This algorithm optimizes

the distance between the initial and final points of the

robot end-effector, by building a path between those

points with valid configurations of the robot supplied

by inverse kinematic problem and with obstacle

avoidance. In order to ensure the functionality of the

algorithm many workspaces had been built. For

example, the algorithm had been tested by

calculating the minimum distance between two

opposite corners of regular cubes, and the best result

which is the diagonal of the cube was obtained. After

previous test, the algorithm had been applied to solve

real problem as shown in the results section above.

As shown in the presented results, the GAs could be

used for path planning problems. However, being

different from mathematical and numerical methods,

the GAs are slower because they are tools of

evolution and not for specific optimization. They are

simpler, of easy programming, and demand less

mathematical rigor to describe the process to be

optimized (e.g. no need for derivation neither the

objective function nor the constraints).

7. REFERENCES

Ahuactzin, J. M., K. Gupta, et al. (1998).

"Manipulation Planning for Redundant Robots:

A Practical Approach." International Journal of

Robotics Research 17 (7): 731-747.

Barraquand, J. and J.-C. Latombe (1991). "Robot

Motion Planning: A Distributed Representation

Approach." International Journal of Robotics

Research 10 (6): 628-649.

Craig, J. J. (1989). Introduction to Robotics

Mechanics and Control, Addison-Wesley

Publishing Company.

Kavraki, L. E., P. Svestka, et al. (1996).

"Probabilistic Roadmaps for Planning in High-

Dimensional Configuration Spaces." IEEE

Transactions on Robotics and Automation 12

(4): 566-580.

Ladd, A. M. and L. E. Kavraki (2004). "Measure

Theoretic Analysis of Probabilistic Path

Plannig." IEEE Transactions on Robotics and

Automation 20 (2): 229-242.

Latombe, J.-C. (1999). "Motion Planning: A Journey

of Robots, Molecules, Digital Actors, and Other

Artefacts." International Journal of Robotics

Research 18 (11): 1119-1128.

Li, Z. J. and M. B. Trabia (1996). "Adaptative Path

Planning and Obstacle Avoidance for a Robot

with a Large Degree of Redundancy." Journal of

Robotic Systems 13 (3): 163-176.

Lozano-Pérez, T. and M. A. Wesley (1979). "An

Algorithm for Planning Collision-Free Paths

Among Polyhedral Obstacles." Communications

of ACM 22(10): 560-570.

Monteiro, D. and M. Madrid (1999). "Planning of

Robot Trajectories with Genetic Algorithms."

Proceedings of the First Workshop on Robot

Motion and Control: pp. 223-228.

Pires, E. and J. Machado (1999). "A Trajectory

Planner for Manipulators using Genetic

Algorithms." IEEE International Symposium on

Assembly and Task Planning: pp. 163-168.

Valero, F., V. Mata, et al. (2005). "Trajectory

planning in workspaces with obstacles taking

into account the dynamic robot behaviour."

Mechanism and Machine Theory 41(5): 525-

536.

8. APPENDIX A

Fig. 6. Robot evolution.