You are on page 1of 6

th

6 International Scientific and Expert Conference TEAM 2014


Technique, Education, Agriculture & Management
Kecskemét, November 10-11, 2014

TOOL PATH OPTIMIZATION OF DRILLING SEQUENCE


USING GENETIC ALGORITHM
Tomislav Šarić*, Danijela Pezer, Goran Šimunović and Roberto Lujić
Department of Industrial Engineering, Mechanical Engineering Faculty in Slavonski Brod, J. J. Strossmayer
University of Osijek, Croatia
* Corresponding author e-mail: tsaric@sfsb.hr

Abstract whose elements we call arcs. Distance matrix


This paper presents the approach of searching for satisfies ineguality triangle in case when
the optimal tool path during drilling. The solution is is , for all [1].
obtained using the genetic algorithm where the In the case of plane problems,
drilling sequence optimization problem is reduced
to the Travelling Salesman Problem. The genetic is the Euclidean
algorithm is used in order to minimize the path
distance.
length, i.e. to reduce the total time of the tool path.
The goal is to minimize the total path lenght
The results achieved by the criterion of minimum
tool path ultimately lead to savings of the min (1)
technological time and decrease of the total cost of
production. The solution of the problem was within the constraints:
achieved using the MATLAB software, while the
program code was designed for the selected (2)
technological task of drilling. The achieved
software solution was simulated by the EMCO (3)
WinNC program for the Sinumerik 840D Mill
control unit.

Keywords: Expression (2) ensures that each city has visited


Optimization, Genetic Algorithm (GA), Drilling, only once, and according to the second limitations,
Travelling Salesman Problem (TSP) expression (3), are not allowed subtours, i.e.,
eliminates the possibility that in the solution
1. Introduction appears more than one contour.
Tool path planning, in this case in the process of A binary representation of solutions is not suitable
drilling, is important for the production process for this type of problem, and the solutions are
because it leads to increase of productivity and represented vectorial or matrix. Types of the
production cost savings, especially if the tool that vectorial representation are Adjacency
performs drilling operation must visit a significant Representation, Ordinal Representation, and
number of places. Determination of drilling representation in order of the tour which was used
sequence is similar to the Travelling Salesman in this work. Each tour is possible permutation of
Problem based on finding the shortest path, where 1,2,3,…,n where n is number of cities (in this case
each city is visited only once and when it is known the number of holes), and the number of possible
the distance between each city. Travelling tours is n!, i.e., (n-1)! for assymetric problems, or
Salesman Problem is one of the best known and (n-1)!/2 for symmetric problems when the starting
most extensively studied combinatorial point of departure of the tour are known. The case
optimization problems and it is classified as NP in this paper is n!/2 because it is a symmetrical
(nondeterministic polynomial time) - hard problem and starting point of drilling isn't defined.
problems. His mathematical model is searching for
Hamilton's cycle at least weight in a weighted 2. Optimization methods
graph, and can be defined as a complete Today, we have developed many methods to solve
undirected graph G = (V,E) if it is symmetric, and the Travelling Salesman Problem, which can be
directed graph G = (V,A) if it is asymmetric (edge devided into [2]:
weight, respectively, path lenght has different Exact methods – find an optimal solution, but
values depending on the direction of the tour). The because of its large computational complexity are
set represents a set whose elements limited to minor problems and their largest
we call the vertex, disadvantage is the long runtime.
represents a set whose elements we call edges, Brute Force algorithm searches all possible
while represents a set permutations and remembers the best combination

Tomislav Šarić, Danijela Pezer, Goran Šimunović and Roberto Lujić 393
th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture &Management
Kecskemét, November10-11, 2014

to allways provide an optimal final solution, The best known examples are simulated
however, because of its O(n!) complexity is the annealing, genetic algorithms, and ant colonies
impractical even for the 10 cities. optimization methods.
Linear programming is the optimization method of Solving the Travelling Salesman Problem with
the linear objective function, which is subject to evolutionary algorithms is very common. Although
constrains of linear equalities and inequalities. evolutionary algorithms do not allways find an
Branch and Bound is the general algorithm for optimal solution, their advantage is that they can in
searching the optimal solutions of many real time find a solution that is very close to the
optimization problems. It consist of counting all the optimal. Solving the problem of drilling sequence
potential solutions, where large subsets of inferior was obtained also by using GA.
solutions were rejected.
There are used method of dynamic search, 3. Genetic algorithm (GA) – general model
Backtracking method, and Branch & Cut method. GA is the optimization method based on the
Approximation methods – use the algorithms natural evolution, with the basic idea of survival of
that provides so-called sub-optimal solutions in a the best individuals in the population. Unlike most
relatively short time. The best known of the deterministic algorithms, GA does not start
approximation algorithm is the Christofides' search from the one point of solution, already from
algorithm. a hole range of potential solutions that are usually
Heuristics methods – the methods for solving randomlly generated and represents the inital
problems based on experience. population of the genetic algorithm. Depending on
Solving the Travelling Salesman Problem with the the given problem, capability (goodness) defined in
algorithm of nearest neighbor starts searching from fitness (objective) function, are determinate to the
arbitrary initial city, and every next city is the one initial population. In every generation choosen
which is nearest to the current city without being solution is closer to the optimum in comparison
visited yet. This algorithm usually does not provide with other members of the population, while inferior
an optimal solution, because it doesn't use all of solutions were rejected. Selected solutions are
the available data, for example, some of the city subjected to genetic crossover and mutation
are visited too early which prevents later to finding operators in order to create a new generation. The
a better solution, respectively, the solution procedure is performed iteratively until the
converges to a local minimum. The adventage of stopping criterion is met as a defined by the user.
this algorithm is in its implementation speed with a The basic algorithm structure is shown in Figure 1.
good optimum approximation, and it is used to
compare and testing the other algorithms. Generate initial population P(t)
Except the mentioned, there is used the Greedy Evaluate population P(t)
algorithm, Heuristic of nearest and farthest While stopping criteria not satisfied Repeat
insertion, and Nearest insertion of arbitrary city. Select some elements from P(t) to copy into
Metaheuristics methods – are iterative procedure P(t+1)
of solving combinatorial optimization problems that Crossover of some elements of P(t) and put
may include traditional heuristics such as one step into P(t+1)
of the procedure (e.g. local search). The essential Mutation of some elements of P(t) and put into
characteristic of metaheuristics is to use the P(t+1)
strategy of finding the global optimum. Sometimes Evaluate new population P(t+1)
metaheuristics allows the acceptance of inferior P(t)= P(t+1)
solutions of objective function in order to achieve Figure 1. Standard genetic algorithm [3]
the escape from a local optimum.
The basic terms used in the work of genetic
algorithm [4] are shown in the Figure 2.
gens

genotype 0 1 0 1 1 0 1
0 0 1 1 1 0 0 1 0 1 1 1 0
fenotype 11 9 25 14
chromosome 1 chromosome 2 chromosome 3 chromosome 4
population
Figure 2. Display of the basic terms int the work of the GA

The chromosome consist of the genes, where Each chromosome represents the one individual,
each gen is an one parameter, or variable xi = (i = or a one possible solution of the problem, and the
1,…,n). set of all chromosomes makes the population, i.e.,
X = [chromosome] = [gen1,…,genn] = [x1,…,xn]. the set of all possible solutions. The genetic

394 Tool Path Optimization of Drilling Sequence using Genetic Algorithm


th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture & Management
Kecskemét, November 10-11, 2014

algorithm process consist of the next steps: Reproduction (selection)


encoding of individuals, evaluation of fitness of By the selection (Figure 3), good individuals are
individual, selection, crossover, mutation and chosen and it will participate in reproduction, while
solution decoding. inferior individuals were rejected. Selection
Encoding involves the storage and transfer of good
The choise of solutions representation has a great characteristics (genes) to the next generations of
importance because it can significantly affect at the individuals [4]. Several methods of selection are
efficiency of genetic algorithm, and usually is developed and some of them will bementioned:
represented by string of bits and binary numbers.  Proportional selection in which individuals with
Evaluation the greatest ability (goodness) have the best
Based on the defined chromosome (individual) chanse of being selected, and
randomly formed initial population, i.e., pre-  Tournament selection in which randomly, from
selected sufficiently large number of satisfactory the entire population, selects a certain number
solutions to the problems, and for the each solution of individuals, from which choose the best for
determines the value of the fitness function [5]. the next generation, and the process is repeated
untill the number of offsprings reaches the
population size.
1 1 0 0 1
chromosome 1 REPRODUCTION
1 1 0 0 1
(SELECTION)
0 1 0 1 1 parent
chromosome 2
Figure 3. Selection in GA procedure

Crossover performance, and they are usually performed at a


Genetic crossover operator provides the change of single point (Figure 4) or two crossing point (Figure
the genetic material between individuals 5), whereby the point of crossing randomly chosen.
(chromosomes). After couples of parents were Traditional crossing operation is not applicable in
selected from population, because of selection the case of tool path optimization, because of
process, and with crossing method from them requires that each gene in the chromosome may
offsprings that inherit properties from parent are occure only once, and the ordinal sequence was
created. There are many ways of crossing used [5].
crossover point

parent 1 1 1 0 0 1 1 1 1 1 0 offspring 1
CROSSOVER
parent 2 0 1 1 1 0 0 1 0 0 1 offspring 2
parent' s chromosome offsprings
Figure 4. Crossover in one (single) point
crossover points

parent 1 1 1 0 0 1 1 1 1 1 1 offspring 1
CROSSOVER
parent 2 0 1 1 1 0 0 1 0 0 0 offspring 2
parent' s chromosome offsprings
Figure 5. Crossover in two points

Mutation Although the selection and crossover generates


Mutation is a genetic operator by which the space the new strings, they do not introduce a new
of solutions are searched and exactly mutation information in the population on the bit level.
greatly helps to avoid local optima of the fitness Therefore, a mutation is introduce, which brings
function which we optimize. Applying of mutation the new aspekts in the population, that can arise
the diversity of genetic material is achieved and the new search directions, thereby creating the
searching for new – potentially best solutions are conditions to prevent retention of local extremes.
enabled (e.g. in the case that all the individuals of Mutation (Figure 6) at the level of genotype,
the population have the same gene in a specific randomly entries a new genetic material in the
location in the chromosome, only the crossing chromosomes or individuals [4].
could not change this gene).

Tomislav Šarić, Danijela Pezer, Goran Šimunović and Roberto Lujić 395
th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture &Management
Kecskemét, November10-11, 2014

There are different types of mutations, which operator, and it was used the permutation in which
among the other things, depends of the are two randomly selected genes swich the values
representation of chromosomes. In this paper, it is (Figure 7).
not possible to apply the traditional mutation

parent 1 1 0 0 1 MUTATION 1 1 1 0 1 offspring

random choosen gen mutate gen

Figure 6. Mutation

parent 1 1 0 0 1 PERMUTATION 1 1 0 1 0 offspring

random choosen gen

Figure 7. Permutation
A significant increase of the crossover probability
Decoding reduces preservation of existing solutions, i.e.,
Decoding is the process of converting a binary increases the degree of destruction of individuals
number to a potential solution. with greater capability.
Elitism Termination of the algorithm
The protection of the best individual of the possible The process of creating the new generations is
changes or elimination, applying of genetic repeated until a predefined stopping criterion of
operators during the evolutionary process evolution is not satisfied. Some of the stopping
(selection, crossover or mutation) is called elitism. criteria for the algorithm are reaching predefined
However, although elitism can improve number of generations, satisfying the minimum
performance of genetic algorithm, the protection of criteria or the ending of evolutionary process,
the best individual of each step of evolution can which is reflected in the way that successive
significantly slow down the genetic algorithm. repetitions do not lead to better results.
Genetic algorithm parameters
The tipically algorithm parameters are population 3. Experimental part
size, number of generations (iterations), the For the selected technological task shown in
crossover and mutation probability. Considering Figure 8 on the principle of Travelling Salesman,
the values of the genetic algorithm parameters, the by using genetic algorithm, sequence of drilling
algorithm gives different results, faster or slower was optimized. The task was defined drilling of 25
coming to a better or inferior solutions. holes on the prismatic workpiece, with minimal tool
The population size is parameter that directly path, where the starting point of drilling depends
affects to the quality of the obtained solutions by on the random selection of the genetic algorithm,
reducing the probability of permature convergence and after the last hole drilling the tool is necessary
to a local optimum, while the negative side of return to the starting position. For a given problem
increasing complexity of computing and thus the of the tool path optimization, minimizing the lenght
total running time of the algorithm. Smaller of tool path was realized using the MATLAB
populations provides a better solution for a small software and the achieved software solution was
number of generations, and increasing of the simulated in EMCO WinNC program for Sinumerik
population is necessary to increase the number of 840D Mill control unit.
generations. The algorithm was run multiple times (50 times)
Number of generations is a parameter that directly with different combinations of population size and
affects at the algorithm execution time, as well as stopping conditions, in the aim of experimental
the quality of the obtained solutions. A larger determination of the number of individuals in the
number of generations gives a better solution, but population and the number of generations of
with increasing the runing time, it is necessary to genetic algorithm (for the tool path optimization
determine a number of generations by which the problem) an in order to determine parameters of
algorithm will find a satisfactory solution that may the algorithm that gives the best solution. Initial
not allways be optimal to be satisfying. population of chromosomes was randomly created,
A very important role in the work of GA has a where each chrormosome represents a string of
parameter of mutation probability that allows holes that need to drill, and each gene represents
avoiding of “stacking“ in the local optimum at assigned number of holes.
random algorithm leaps per solutions spase.

396 Tool Path Optimization of Drilling Sequence using Genetic Algorithm


th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture & Management
Kecskemét, November 10-11, 2014

Figure 8. Prismatic workpiece for drilling

According to the Figure 9, there was obtained a The algorithm was tested on a sample with a small
total distance of tool path in the amount of 318,77 number of holes, and the results were compared
mm with manual programming, while the proposed with results obtained by heuristics nearest
genetic algorithm according to the size of the neighbour method. A Genetic algorithm, for the
population and the number of generations (which defined problem with 4 holes, finds an optimal
causes stopping execution of the algorithm), solution already for the 10 generations and 5
finding the optimal solution almost in the all the individuals in the population.
combinations, i.e., the minimal distance of tool Table 1 shows the average values obtained for all
path in the amount of 263,86 mm. 50 times starting of genetic algorithm, from which it
can be concluded that the genetic algorithm gives
quite stable solutions very close to the minimum.
Analyzed the data (Table 1) concluded that a
substantial increase the number of generations
and number of individuals do not give much better
solutions than the case with a smaller number of
generations and smaller number of individuals. For
Start (final) point of tool path a large number of individuals in the population
during performance of the algorithm there is the
possibility to appearance of a large number of
Figure 9. The total distance of tool path during the similar or identical individuals that provide good
manual programming solutions. By choosing these individuals for

Table 1. The average value of the fitness function in multiple algorithm startup
Number of Number of individuals in the population
generations 50 100 300 500 1000
100 292,7529 279,3912 269,0384 268,808 267,3062
300 270,5388 269,6934 267,3176 265,7477 264,4715
500 271,4110 270,0652 265,7013 265,6332 264,1243
1000 268,8153 266,8541 265,1995 264,6979 263,9364

reproduction, diversity of genetic material are Table 2 shows the average runtime of the
reduces and in that way are often obtained the algorithm in seconds, depending on the number of
lower results for the same number of generations generations and population size. Smaller
with a plurality of individuals in relation to a smaller population have a higher chanse to “stuck“ in a
number of individuals for the same number of local optimum, but through the generations iterates
generations. For random generating a first much faster than the larger population, which is
population, the probability of appearance a good more suitable for the complex problems, in this
individual is higher when the population are larger. case for the problem with a large number of holes.

Tomislav Šarić, Danijela Pezer, Goran Šimunović and Roberto Lujić 397
th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture &Management
Kecskemét, November10-11, 2014

The program is performed on a laptop Acer Aspire 5741G, 2.2GHz, 3 GB of RAM.

Table 2. The average time of genetic algorithm performing


Number of Number of individuals in the population
generations 50 100 300 500 1000
100 1,7599 1,7614 2,0619 2,4213 3,2463
300 4,5814 4,7976 5,8271 6,9453 9,6913
500 7,9394 8,5237 10,3454 12,2061 16,4584
1000 16,7594 17,6131 21,1964 24,7049 33,5717

To solve the problem of minimizing tool path and to graphical representation one of possible solutions.
achieve the optimal solution for the proposed From Figure 11 it is evident that the value of
genetic algorithm, it was enough 100 generations fitness function gradually decreases through the
and 100 individuals in the population. generations which is an indicator of optimization
Considering that genetic algorithm is multiple unfolding. In addition to reduce the value of the
started, which generates a new solution, some of fitness function for the best individuals, also is
the obtained results have the same distance but reduced the mean (average) value of the fitness
with another drill path. In Figure 10 is shown a function of the population.

Figure 10. Graphical display of an optimal tool path Figure 11. Fitness function depending on the
number of generations

5. Conclusion References
The paper tried to find the sequence of drilling [1] J. Abu Qudeiri, “Optimization of Operation
operation that provides the shortest path, i.e., Sequence in CNC Machine Tools Using
reduction of the total work time and efficiency Genetic Algorithm“, Journal of Advanced
increase with the assistance of genetic algorithm. Mechanical Design, Systems and
Selection of the genetic operators and parameters Manufacturing, vol.1, no.2, p. 272 – 282,
which determine behaviour of these operators is 2007.
an important for the successful algorithm work. [2] V. Bosancic, A. Golemac, T. Vojkovic, “How to
The algorithm in relatively short time finds the Help a Traveling Salesman“, Osječki
optimal solution and therefore is reliable to use. In matematički list, no.12, p.139 -149, 2012.
order to improve finding solutions, genetic [3] A. Chipperfield, “Genetic Algorithm Toolbox
algorithm is possible to combine with one of the User's Guide, version 1.2“, [Online]. Available:
methods for searching of local optimum, which http://www.pohlheim.com/Papers/tr_gatbx12/
leads to faster convergence of certain individual ChipperfieldFlemingPohlheimFonseca_tr_GA
according to their optimum, which is potentially the Tbx_v12.pdf. [Accessed: 19-Jun-2014].
global. This paper aims to reduce the total path, [4] M. Brezočnik, “Uporaba genetskega
without considering tool wear, and the problem is programiranja v inteligentnih proizvodnih
solved for drilling holes of the same diametar and sistemih“, Fakulteta za strojništvo, Maribor,
depth and the further research could expand in Slovenija, 2000.
that sense. In further research the defined problem [5] N. Mohamad, M.K.A. Ariffin, A. Ali,
could be resolved with another metaheuristic F.Mustapha, I.M. Salleh, “Development of
optimization method (e.g. Particle Swarm genetic algorithm toolboks using MATLAB in
Optimization or Ant Colony Optimization), with the cutting tool path optimization,“ Scientific
possibility of comparing the obtained solution with Research and Essays, vol.8(38), pp. 1848-
the solution achieved with CAM software. 1857, October, 2013.

398 Tool Path Optimization of Drilling Sequence using Genetic Algorithm

You might also like