CNC Machining Path Planning Optimization for Circular Hole Patterns via a Hybrid Ant Colony Optimization Approach

This paper presents a path-planning optimization study for a Computer Numerical Control (CNC) machining center tasked with machining jobs involving a large number of holes to drill that are mostly arranged in concentric circular patterns. Benefits of this research may contribute to shortening the machining time in certain components used in heat exchangers, boilers, condensers, trammel screens and food separators. Optimization of tool travel distance and machining cost are typically overlooked aspects when generating tool paths and CNC codes from commercially available CAD software packages. Tool path travel distance minimization can be modelled Travelling Salesman Problem (TSP). Optimization algorithms have been heavily applied in the literature to the TSP with varying levels of success. Ant Colony Optimization (ACO) is one of the most prominent approaches that mimics the natural behavior of ant colonies. The research in this paper proposes a hybrid ACO that has a biasing mechanic designed to take advantage of the geometric hole-pattern arrangement, as well as a local search. Simulation examples show the proposed approach exhibiting superior performance compared to the classic ACO approach, a genetic algorithm (GA) approach, as well as the simple spiral path generated via commercial CAD software. The proposed approach is then applied to the drilling path planning of a two-thousand-hole food-industry separator plate.


Introduction
Total machining time and cost of production in Computer Numerical Control (CNC) drilling operations of large number of holes arrangements is of a significant concern to manufacturing companies. Associated time investment in process optimization is often well justified. The fraction of machining time spent on drilling holes can vary from an average of 40% for a typical product (Shunmugam et al., 2000) to more than 80% for products that incorporate dense matrices of holes such as heat exchangers, food-processing separators (Figure 1), as well as drum and trammel screens. And as such, cost optimization of CNC drilling operations has been an important field of study in the literature (Ke et al., 2006;Zhu & Zhang, 2008;Satishkumar & Asokan, 2008). Along with the opportunity of reducing the production via small improvements in the cutting conditions, the total travelled distance of the tool between drilling locations can be reduced through optimum path planning. Such reduction can account for up to 20% of the total machining time of the part, which in turn can have a significant impact on cost.

Figure 1. Food-industry processing separators
This paper extends the approach in (Abbas et al., 2011) with a focus on the optimization of a CNC drilling tool path between holes lying in concentric circular patterns. Simple examples studies as well as a full-scale industrial application of a food processing separator screen are tested. Results of the studies show better performance of the modified ACO algorithm compared to the classic ACO, the modified version in (Abbas et al., 2011), a typical genetic algorithm, as well as establish the scalability to large problems.
The paper starts with a brief introduction and a review of relevant work reported in the literature that highlights the motivation to carry out this research. The formulation of the optimization problem with details of the classic ACO algorithm and the proposed modifications is then presented. Example studies and an industrial application are then presented to demonstrate the algorithms' performance. The paper then concludes with a brief discussion and prospective future extensions.

Problem Formulation
Tool path planning for the CNC drilling tool is modelled as a TSP when ignoring the tool dynamics (which is a reasonable assumption when the tool has to dwell a reasonable amount of time in each visited location to be drilled). TSP can be formulated as an integer linear program (Padberg & Sung, 1991) as follows: Subject to: , k = 1, …, n-l+1, l = 1, …, n-1 n h is the total number of holes n is the total number of visited location by the drilling tool, which is equal to the number of holes to be drilled, plus the home position of the tool D ij is the travel distance from location i to location j X ij ∈ {0, 1} are the design variables used to describe the tool path. X ij = 1 means that the tool will travel from location i to location j as part of the path that loops on all the holes in the matrix. Otherwise, X ij = 0 means that the path from location i to location j is not a part of the tool path.
The objective function is formulated as the summation of all the distances, between holes, travelled by the tool in the chosen path (Equation (1)). A minimization procedure is ran on this objective until an optimized path is selected. The set of constraints described in Eqn.
(2), ensure that each hole j is only visited once in the path described by Xij, while the set of constraints described in Equation (3), ensure that the path coming out of every hole i goes to one other hole j. Further discussion of the integer linear programming formulation of TSP may be found in (Padberg & Sung, 1991) .Elements of the distance matrix Dij are calculated as the in-plane distance between the node centers as: where: x i is the coordinate position of location i along the X-axis y i is the coordinate position of location i along the y-axis x j is the coordinate position of location j along the X-axis y j is the coordinate position of location j along the y-axis 3. Path Planning Algorithms CNC drilling tool path planning in this paper is formulated as a TSP in section 2 of this paper. Of the popular algorithms for solving TSP, Ant colony optimization was reported in the literature (Dorigo, 1996;Stutzle & Dorigo, 2002;Dorigo & Stutzle, 2004; as exhibiting superior performance in discovering globally optimal (or close to globally optimal) solutions within reasonable computational time. The work in this paper also introduces a modification to the basic ACO in order to take advantage of the geometrical arrangement of the holes to be drilled. Another popular algorithm used in several continuous and discrete optimization problems (TSP included) is genetic algorithm (GA) Goldberg (1989); Michalewiz (1992); Anand et al. (1999). This section explains the details of the algorithms tested in this paper.

Basic Ant Colony Optimization Algorithm
The classic Ant-Colony Optimization (ACO)  technique is naturally inspired from ants driven strategy to always find the shortest route from among multiple possible paths between their nest and food location. The basic mechanics behind the achievement of such path is realized through the following steps: -Different ants start by trying different paths.
-As the ants travel through different paths they deposit a chemical compound known as pheromone along each path.
-Subsequent ants traveling along each of those paths have the ability to smell the pheromone and to make decisions on which path to take -Ants choosing between two paths are more likely to follow the one with more pheromone deposit (with some randomness to this decision) -Deposited pheromone tends to evaporate over time. Eventually the best path will be the most travelled one, and thus richest in pheromone It should be noted that ACO (and GA, which is later considered in this paper) formulate the design variables X as permutation of a sequence of numbers between 1 and n (corresponding to the order of visiting the path nodes, which implicitly satisfies the constraints in Eqns. 2-4), rather than integer formulation. Main steps of a basic ACO algorithm   Ant-Colony-TSP(n, D ij ) Initial pheromone distribution is uniform (equally likely for an ant at any location to choose to go to any other location) 2 X * ← Generate-Path(n, P) An initial solution is recorded AntPaths ← AntPaths ∪ Generate-Path(n, P) 13 return X * where: P is the n×n Pheromone probability matrix, for path choices to be made by ants. P ij is an indicator of the probability that an ant currently located at i will choose to go to location j next Termination-Condition() is chosen as a fixed number of iterations, after which, the algorithm returns its best discovered path. Alternative termination criteria are used by other approaches such as the examination of the pheromone matrix P to invoke termination of the search when only one path becomes predominant in its pheromone content. This can only be applicable for problems with no local optima as the termination condition may never be met.
Generate-Path() is a sub-function in the ACO algorithm that generates a randomized path that visits all the target locations, with probability to select a path according to the distribution of the pheromone matrix P. Without loss of generality in the interpretation of the TSP path, the path always starts at the node corresponding to the tool home point. The probability of going from node i to node j is equal to: Update-Pheromone() is a sub-function in the ACO algorithm that updates the pheromone matrix P. This incorporates that only ants that discovered the few best-paths will be the ones allowed to deposit pheromone on these paths, hence making it more likely for other ants to follow similar path choices.
The main steps of the function Generate-Path()for generating randomized paths are described as: www.ccsenet.org/mer Mechanical Engineering Research Vol. 4, No. 2;2014 Generate-Path(n, P) Selects a random integer between 1 to n (uniform distribution)

The function
Update-Pheromone()updates the pheromone matrix by calling a Simple-Update-Pheromone() sub-function several times but with different values of pheromone deposition of the few current best known paths. The Simple-Update-Pheromone() sub-function is used to update the current pheromone matrix via a path X and a deposited pheromone value of σ as follows: for i = 1 to n normalizing P and diminishing the older pheromone values It should be noted that the basic ACO  includes an explicit step for evaporation of existing pheromone before new pheromone is deposited. In this implementation however, the pheromone evaporation happens implicitly via the re-normalization of the pheromone matrix after the new pheromone is deposited.

Modified Ant Colony Optimization Algorithm
The basic ACO algorithm described in section 3.1 uses a uniform distribution for the initialization of the pheromone matrix P. At the start of the algorithm, an ant at some location i is equally likely to choose to visit any of the other locations j. Taking into consideration the special holes layout (holes with certain geometrical patterns such as concentric circles), it may not make much sense for an ant to travel from one end of a circle to its diametric opposite. As such, a modified initialization of the pheromone matrix (line #1 in the basic ACO algorithm discussed in section 3.1) follows along approaches that use heuristics to bias the probability of the choices made by the ants (Dorigo & Stutzle, 2004). The modification seeks to reduce the probability of selecting a step to the next hole if there are other closer choices: where: p is an exponent for tuning the effect of the distance between the locations to be visited on the probability that ants make the choice to travel between them P ij N is an un-normalized pheromone value that is designed to have higher values when the locations to be travelled between are close to one another. Normalization of P ij N via Eqn. 9 gives the pheromone value to be used in the ACO algorithm It is noted that the proposed modification is generalization of both the basic ACO and the approach in (Abbas et al., 2011). Setting the exponent p in Eqn. 8 to zero causes the initial pheromone matrix to have equal values for travel between any locations (basic ACO), and setting p to a very large number (ACO would only consider immediate neighbors) equates to the approach in (Abbas et al., 2011). In some perspective, instead of using a heuristic matrix to influence the decision making of the ants as in (Dorigo & Stutzle, 2004), the perception that near neighbors are likely better choices is directly implemented in the initial pheromone matrix. As such, the proposed approach is perceived to have the following advantages: a) No a-priori knowledge of a good path is required b) Better computational efficiency (fewer terms to compute in the calculation of the probability of choosing a node) c) Heuristic perception of good pathing automatically fades in favor of learned pathing as the search progresses (with pheromone updating) without the new for an additional tunable control parameter

Genetic Algorithm
The genetic algorithm tested in this paper is based on one of the implementations specific to TSP described in (Michalewiz, 1992 Steps 2-4 are repeated for a prescribed number of generations, then the best encountered solution is returned Different implementations of GA will assure the maintenance of the overall algorithm structure, but will differ in the way a solution is represented, or the way new solutions are generated via selection, crossover and mutation.
The setting for the GA tested in this paper is as follows:

Solution Representation: Path Representation
As in (Michalewiz, 1992, Chapter 10), the chromosome is encoded as an ordered string of integers that represent the sequence by which the nodes are visited in the TSP. For example, a parent chromosome P1: {1 2 3 4 5 6 7 8 9} means the start is at node 1, then node 2 is visited next, then node 3… until the last node, then a return from node 9 to node 1.

Selection: Binary Tournament
Selection of solutions from existing population to generate new solutions via crossover and mutation depends on the "fitness" of current solutions. In binary tournament selection (Michalewiz, 1992), two solutions are randomly picked from the current population, then the one that has better fitness (less travel distance in TSP) "wins the www.ccsenet.org/mer Vol. 4, No. 2;2014 tournament" and becomes a candidate parent. Another tournament is conducted to select a second parent, and then two child solutions are generated via crossover and mutation from the parent chromosomes.

Crossover: Order of Appearance
Crossover is the main operator that GA uses to generate new solutions from existing ones. The Order of Appearance Crossover (Michalewiz, 1992, Chapter 10) uses a randomly located (with uniform distribution) sub-segment of the chromosome of one parent, and then fills the rest of the newly generated chromosome via nodes chosen from another parent according to their order of appearance.

Mutation: Reciprocal Exchange
Newly generated child chromosomes have small probabilities of a mutation occurring. In reciprocal exchange (Michalewiz, 1992, Chapter 10), mutation randomly selects (with uniform distribution) two nodes in the chromosome and exchanges their spots.

Hybridization with Local Search
A known drawback of basic ACO and GA is that the later stages of convergence to an optimum (after a quasi-optimum solution is discovered) may take a long time. One approach discussed in the literature is to conduct local search within the global optimization (Bonabeau et al., 1999), however, in earlier experimentation with study problems, premature convergence of the global search was a concern. Alternatively, another common approach was adopted, which is to perform a local optimization search after ACO or GA is done, while using the solution returned by ACO/GA as a starting point for the location search.. A popular local search for TSP is based on Greedy search. The version adopted in (Abbas et al., 2011) is explained as: Local-Search-TSP(n, X G , D ij ) 1 X * ← X G Initialize best solution with the optimized solution returned from ACO or GA 2 for i = 1 to n 3 for j = i + 1 to n Where X G , X * , X t are respectively the initial path, final path and a temporary test path. The function Swap-Order() in line 4 simply swaps the order of two node locations i and j on the travel path. If the swap is beneficial (less overall travel distance), the swap is retained, otherwise, the swap is discarded.

Problem # 1: Three Complete Circular Patterns
A simple case study of a three concentric circular patterns (Figure 2) is investigated to evaluate the performance of the proposed algorithm. In the upcoming studies, tool velocity transients are not considered, thus the shortest distance tool path is also the one having the minim machining time. In all tests, a local search (as described in section 3.4) is conducted after the completion of each run of the tested algorithm. Comparison is conducted between 10 runs of each of: i) basic ACO (p = 0), ii) modified ACO with various settings of the exponent p, and iii) genetic algorithm. The results from various algorithms are also compared verses the typical spiral path (Figure 3) that is generated by most CAD software. www.

Proble
Similar nu machining separator s right side s

Results and Discussion
Details of the holes geometrical layout for test problems 1 and 2 are listed in Table 1. Tuning parameters for the ACO and GA (based on general recommendations in (Michalewiz, 1992;) are listed in Tables  2 and 3 respectively. While in general, an optimization problem with larger search space requires a larger GA population, it was found in earlier experimentation with problem #2 that using a population size of 100 with 60 generations was producing better results for GA than 120×50, so 100×60 was the chosen setting in order to present the best obtained results from GA. Results of 10 runs of the tested algorithms are plotted in Figure 5 and Figure 6 for problems #1 and #2 respectively. Numerical values of the results are also listed in Tables 4 and 5. Travel paths for one of the best obtained solutions for each problem are plotted in Figure 7. A general observation was GA did not exhibit very good performance and was not able to discover better paths than the simple spiral path. This may be due to the size of the TSP problems considered in the example studies; problem #1 has 61 nodes and problem #2 has 87 nodes. Such relatively large number of nodes often makes it difficult for GA to discover the optimum path, even when local search is invoked after the GA runs.  Performance of the basic ACO was observed to be better than GA in both problems #1 and #2, however neither algorithm were capable of discovering paths with shorter travel distance than the simple spiral that would be generated via a typical CAD system ( Figure 5, 6). On the other hand, the modified ACO with p ≥ 5 was consistently capable of discovering paths that were better than the simple spiral. The best performance for the modified ACO was realized at p = 20, where the consistency in solution quality was very good (small value for standard deviation amongst the conducted runs) and the discovered paths ( Figure 7) are deemed among the best-known for the problem. The fact that large values of p produce favorable results implies that "nearest neighbor" strategies are indeed favorable for this type of problem. However, due to the layout of the holes (many holes have comparable neighbor distances), favoring nearest-neighbor isn't realized except at larger values of p. It may be also worth noting the problems do have multiple equally-good solutions, but there is no mechanism to control which solution the ACO converges to. Plots in Figure 7 are simply those first discovered in the 10 runs. It is also w distance c proposed a of the geom being opti most bene

Applica
A full-scal the propos geometrica nodes in th ACO gene conducted Matlab (M

Conclusion
This paper presented a study on optimum path planning for drilling operation for products with large number of holes arranged in concentric circular patterns. The path planning is formulated as a traveling salesman problem.
Solution of the TSP is tested via basic ant colony optimization and genetic algorithm, as well as a modified ACO where initialization of the pheromone matrix is biased towards traveling between nearby locations via a penalty function on the travel distance. Numerical simulations of example studies showed superior performance of the modified ACO algorithm compared to genetic algorithm and the basic ACO, with up to 15% reduction in total travel distance from the default spiral path in complex hole layouts. A model of a full-scale food separator screen with 2100 holes was used to demonstrate the scalability of the proposed approach.
Future extensions of this research may include application of the modified ACO approach to path planning in three-dimensional CNC tool-paths with axes re-orientation and/or tool changes.