12
Computer-Aided Design 39 (2007) 841–852 www.elsevier.com/locate/cad Automatic generation of gouge-free and angular-velocity-compliant five-axis toolpath Nan Wang, Kai Tang * Department of Mechanical Engineering, Hong Kong University of Science and Technology, Hong Kong, China Received 11 January 2007; accepted 18 April 2007 Abstract Existing works in automatic generation of interference-free five-axis surface machining toolpaths bear a serious drawback — in order to avoid the obstacles, the tool is often required to make drastic change in its orientation between neighboring contact points. Such a quick change in the tool’s orientation can never be made possible in reality due to the stringent physical limit on the speed and acceleration of the rotary motions of the machine tool. The usual ad hoc solution to this problem is to smooth the toolpath in the configuration space, which, however, is prone to special situations of failure and is not able to guarantee the absolute compliance with the given angular velocity limit. In this paper we present an approach to this problem by directly involving the angular velocity limit in the search process. The presented algorithm will automatically generate a five-axis toolpath that not only is interference-free but also guarantees the angular-velocity compliance. Delicate computation and manipulation of visibility maps and their derivative data ensure that the proposed algorithm is computationally feasible with acceptable computing time and memory requirement. Test examples are given to demonstrate the promising use of the proposed solution. c 2007 Elsevier Ltd. All rights reserved. Keywords: 5-axis NC machining; Collision detection; Angular velocity; Visibility map 1. Introduction Five-axis NC machining produces better quality and more accurate sculpture surfaces than traditional three-axis NC machining. However, the required complex control has been limiting its usage. For example, since the tool’s orientation is allowed to change, as compared to the fixed tool orientation in the three-axis case, the detection and treatment of local and global interference become much more difficult. As regards local gouging detection, several techniques [1–5] have been developed that are based on comparing the effective cutting curvature of the tool’s swept surface with the normal curvature of the part surface at the contact point. And others, such as the Rolling Ball Method [6], the Arc-intersection Method [7], the Penetration–elimination Method [8] and the algorithm proposed by Xu [9], are area-based methods. Global interference detection has remained to be a major challenge. Lee [10] used quick feasibility checking and detailed * Corresponding author. Fax: +852 2358 1543. E-mail address: [email protected] (K. Tang). feasibility checking to judge two-dimensional (2D) and three- dimensional (3D) collision between the cutter and parts of the sculpture surface. Morishige [11] used 2D configuration space to describe the relationship between postures of a ball-end tool and their collision with the environment. Vafaeesefa [12] projected infeasible domains to a unit sphere centered at the cutter contact point to find feasible tool orientations. Ho [13] handled the real-time collision detection problem with haptic rendering. Ilushin [14] proposed an approach that uses space subdivision techniques and ray-tracing algorithms to derive a highly accurate polygon/surface–tool intersection algorithm to find better results. To reduce the calculation time, Umehara [15] determined and expanded a group of interference-free tool postures to fill the machined surface before defining the cutter contact points. Besides these, Lauwers [16,17] also considered collisions between the machine and parts or tools. Limited success has been achieved to date in actually computing gouge-free toolpaths in five-axis machining, using the above-mentioned and other interference detection methods. For example, Morishige [18] improved his method in [11] and extended it to 3D configuration space, whose third dimension is defined by the tool’s movement, to describe 0010-4485/$ - see front matter c 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2007.04.003

Automatic generation of gouge-free and angular-velocity-compliant five-axis toolpath

Embed Size (px)

Citation preview

Computer-Aided Design 39 (2007) 841–852www.elsevier.com/locate/cad

Automatic generation of gouge-free and angular-velocity-compliantfive-axis toolpath

Nan Wang, Kai Tang∗

Department of Mechanical Engineering, Hong Kong University of Science and Technology, Hong Kong, China

Received 11 January 2007; accepted 18 April 2007

Abstract

Existing works in automatic generation of interference-free five-axis surface machining toolpaths bear a serious drawback — in order to avoidthe obstacles, the tool is often required to make drastic change in its orientation between neighboring contact points. Such a quick change in thetool’s orientation can never be made possible in reality due to the stringent physical limit on the speed and acceleration of the rotary motionsof the machine tool. The usual ad hoc solution to this problem is to smooth the toolpath in the configuration space, which, however, is prone tospecial situations of failure and is not able to guarantee the absolute compliance with the given angular velocity limit. In this paper we present anapproach to this problem by directly involving the angular velocity limit in the search process. The presented algorithm will automatically generatea five-axis toolpath that not only is interference-free but also guarantees the angular-velocity compliance. Delicate computation and manipulationof visibility maps and their derivative data ensure that the proposed algorithm is computationally feasible with acceptable computing time andmemory requirement. Test examples are given to demonstrate the promising use of the proposed solution.c© 2007 Elsevier Ltd. All rights reserved.

Keywords: 5-axis NC machining; Collision detection; Angular velocity; Visibility map

1. Introduction

Five-axis NC machining produces better quality and moreaccurate sculpture surfaces than traditional three-axis NCmachining. However, the required complex control has beenlimiting its usage. For example, since the tool’s orientation isallowed to change, as compared to the fixed tool orientationin the three-axis case, the detection and treatment of local andglobal interference become much more difficult.

As regards local gouging detection, several techniques [1–5]have been developed that are based on comparing the effectivecutting curvature of the tool’s swept surface with the normalcurvature of the part surface at the contact point. And others,such as the Rolling Ball Method [6], the Arc-intersectionMethod [7], the Penetration–elimination Method [8] andthe algorithm proposed by Xu [9], are area-based methods.Global interference detection has remained to be a majorchallenge. Lee [10] used quick feasibility checking and detailed

∗ Corresponding author. Fax: +852 2358 1543.E-mail address: [email protected] (K. Tang).

0010-4485/$ - see front matter c© 2007 Elsevier Ltd. All rights reserved.doi:10.1016/j.cad.2007.04.003

feasibility checking to judge two-dimensional (2D) and three-dimensional (3D) collision between the cutter and parts of thesculpture surface. Morishige [11] used 2D configuration spaceto describe the relationship between postures of a ball-endtool and their collision with the environment. Vafaeesefa [12]projected infeasible domains to a unit sphere centered at thecutter contact point to find feasible tool orientations. Ho [13]handled the real-time collision detection problem with hapticrendering. Ilushin [14] proposed an approach that uses spacesubdivision techniques and ray-tracing algorithms to derive ahighly accurate polygon/surface–tool intersection algorithm tofind better results. To reduce the calculation time, Umehara[15] determined and expanded a group of interference-free toolpostures to fill the machined surface before defining the cuttercontact points. Besides these, Lauwers [16,17] also consideredcollisions between the machine and parts or tools.

Limited success has been achieved to date in actuallycomputing gouge-free toolpaths in five-axis machining, usingthe above-mentioned and other interference detection methods.For example, Morishige [18] improved his method in [11]and extended it to 3D configuration space, whose thirddimension is defined by the tool’s movement, to describe

842 N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852

the relationship between the ball-end tool postures and theexistence of collision, with the aim of finding a curve C, whichdescribes the tool postures, in the 3D configuration space.Jun et al. [19] proposed a method to find the optimal toolorientations with both local gouging and global interferenceconsidered. In their method, the minimum cusp height is usedas the objective function for determining the tool’s orientations,in addition to the interference-free constraint. Lee [20] triedto obtain the largest feasible machining strip width and theoptimal tool orientation to reduce the machining time andimprove the surface quality by using the machining potentialfield method. Chiou [21] proposed a swept envelope approachto finding optimal tool orientations with the consideration ofgouge and collisions. Balasubramaniam [22] used the conceptof visibility to generate globally collision-free five-axis toolpaths. Gian [23] used open regions and vector fields to generatethe tool orientation in five-axis NC machining of cavity regions.If the orientation of the tool is predefined, the CL surfacedeformation approach introduced by Kim [24] could be used.The cutter orientation is transformed to be parallel to the z-axisfirst. And then three-axis tool path generation methods could beused to generate a five-axis tool path. Finally, the calculated toolpath is transformed to the original space. Hsueh [25] proposed amethod to generate the tool orientation automatically. First, thetilting collision-free angle range in the plane normal to the toolpath is determined. Then, the corresponding collision-free yawangle range is formed by intersecting the neighboring surfacesand the cone generated by the tilt collision-free angle range.Kiswanto [26] introduced a method to eliminate gouging infive-axis milling based on a faceted model.

There are a number of limitations in the work of [18]and [19], and also in most of the others. First, the tool isalmost universally assumed to be of ball-end type. Second, andmore critically, the tool path computed by these algorithmsoften requires a drastic change in tool’s orientation betweenneighboring tool contact points. Such an extreme change inorientation can never be feasible in real machining due tothe physical limit on the angular velocity and accelerationof the rotary motions of the machine tool. As a remedy,Morishige [18] used both forward and backward smoothing tofind two paths. Comparison is then made on them in terms ofthe tool’s total change of angles, and the one with the smallerchange is taken as the final output. Jun et al. [19] tried to definea smoother curve, which describes the tool postures, in the3D configuration space to avoid the extreme angular change.To improve the cutting errors, Ho [27] used the quaternioninterpolation algorithm to smooth the tool orientations. Allof these remedies are, however, prone to special situations offailure and do not offer a systematic optimization solution.

Inspired by the existing works, in this paper, we present afive-axis tool path generation algorithm that seeks to removecertain limitations mentioned above. Specifically, given acontact curve on the part surface and the environment, ouralgorithm generates a tool path that will not only satisfy both thelocal and global interference-free conditions, but also respecta user-specified tool’s angular velocity limit. Our algorithmsupports a general tool, and actually the entire presentation of

Fig. 1. Contact relationship between flat-end tool and S.

the algorithm, and all the illustrative and test examples, aregiven for the case of a flat-end tool.

We point out that the presented work deals with only arestricted five-axis toolpath generation problem — the contactcurve on the part surface is pre-specified. The general andhence much more difficult problem is how to distribute andorder the contact points on the part surface, and determine theirassociated tool orientations, in consideration of all the factorssuch as local and global interference, limit on the tool’s angularvelocity, cusp height, etc. We hope that this work can shed somelight for the final successful solution of this very importantproblem.

2. Preliminaries and system overview

Let S be a smooth G1 surface, and Np represent the normalvector to S at the Cutter Contact (CC) point. Suppose that theflat-end tool contacts S at a CC point, and let T represent theaxis of the tool. Given CC, Np, and T, the tool’s posture isfixed in space, and let Tool(CC, Np, T) denote this fixed tool,shown in Fig. 1.

Assuming that T is not parallel to Np, the Cutter Location(CL) point is expressed in terms of CC, Np and T as

CL = CC + r · (Np − (T · Np) · T)/(1 − (T · Np)2)1/2 (1)

where r is the radius of the tool. Using spherical coordinates,the unit vector T can be uniquely defined by two angles α

and β, as shown in Fig. 2(a). Therefore, for every point CCon surface S, the valid tool axes that respect both local andglobal interference-free constraints can be represented by theircorresponding α and β. And we can use the discretized visibilitymap, VMap(CC), shown in Fig. 2(b), to denote the set of allthose valid orientations in the α–β rectangle [0, π] × [0, 2π ],and refer to it as the freespace of the CC point. Here, theconcept of VMap is similar to the visibility sphere proposedby Balasubramaniam [28]. But the generation algorithm isdifferent because of the different situation. Details of thealgorithm will be given in Section 3.1.

Given the part surface S, the environment E , and an orderedlist of contact points Φ = CC1, CC2, . . . , CCN on S, the toolpath planning task is to find N tool axes Ti ∈ VMap(CCi ), i =

1, 2, . . . , N , such that Ti (α, β) satisfies the angular velocity

N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852 843

Fig. 2. (a) T represented by α and β; (b) the VMap.

limit

|αi+1 − αi | < λ1|βi+1 − βi | < λ2

, i = 1, 2, . . . , N (2)

where λ1 and λ2 are two user-specified numbers.In the processing phase, the VMap at each CC point should

be generated. To avoid local gouging, T must satisfy the localgouging-free constraint.

T · Np > 0. (3)

In addition, to avoid interference between the tool and theenvironment (which includes S itself), the tool must also meetthe global constraint

Tool(CC, Np, T) ∩ E = ∅. (4)

The list of contact points Φ = CC1, CC2, . . . , CCN onS has already been determined, so the relevant VMaps ateach contact point could be generated. The tool’s intermediatemovement between any two contact points CCi and CCi+1is usually assumed to be of linear interpolation [29] – thetool’s reference point moves linearly while its axis also changeslinearly from Ti to Ti+1. The intervals of contact points shouldbe small enough to warrant the above condition, and then wecould assume they are continuous, so the VMaps between twoneighboring CC points could be regarded as continuous too.

Fig. 3 shows a group of VMaps, in terms of (α, β). Weaim to find appropriate tool orientations from each VMap(CC).The tool orientations between two neighbor CC points shouldsatisfy the angular velocity limit in this 3D freespace,while respecting both the local and global interference-freeconstraints.

3. Details of the algorithm

3.1. VMap generation and representation

The VMap is generated in two steps, as given next.Step 1: Local interference treatment.

The α–β rectangle [0, π] × [0, 2π ] corresponds to theGaussian sphere in space. Under the local gouging-freeconstraint, at each CC point the tool axes cover at most ahemisphere, which is determined by the surface normal Np atthe CC point. Therefore, the first step of constructing the VMapis to restrict the tool axes to be within the valid hemisphere. We

Fig. 3. The 3D freespace.

transform this problem into checking the dot product betweenT(α, β) and the surface normal Np.

T(α, β) · Np =

≥ 0 Valid< 0 Invalid.

(5)

In the discretized VMap, the α–β rectangle is represented byuniform sample grids (αi , βi ) : 1 ≤ i ≤ kα, 1 ≤ j ≤ kβ . Thosegrids corresponding to invalid tool axes are labeled “forbidden”,e.g., the shaded region in Fig. 2(b), while the rest are said to be“visible”.Step 2: Global interference treatment.

In the current work, like most other works, the tool ismodeled as a right-cylinder with an infinite long shank.In general, obstacles are represented as meshed polyhedra,apart from those extremely regular ones such as spheres orellipsoids which are then represented analytically. To speedup the computation, the obstacles are pre-processed so thatthey are all convex: concave ones are decomposed into convexparts [30] and hyperbolically shaped obstacles are decomposedand conservatively approximated by convex polyhedra.

A local coordinate system, as shown in Fig. 4(a), isdefined to assist global interference detection. In this new localcoordinate system, Zα–β is parallel to the tool axis Tα–β , andthe bottom of the cutter will be the Xα–β–Yα–β plane. For aparticular (α, β), to judge whether it is forbidden or not, we useefficient algorithms from computational geometry (e.g., [31]) tofirst project an obstacle onto the Xα–β–Yα–β plane, which is aconvex polygon (see Fig. 4(b)), and then calculate its distance tothe local origin (the CL point). If this distance is equal to or lessthan the tool radius r , the (α, β) will be labeled as forbidden.Note that our method is more stringent than the real situation,as an obstacle can lie beneath the cutter’s bottom (when viewedfrom Zα–β ) while still clearing the tool. Such a case, however, isfound to be extremely rare in practice, especially in our context,as abrupt angular changes of the tool usually occur when thissituation is allowed, and that is exactly what we want to avoid.

It is worth mentioning that, since our tool is of flat-endtype, for the same CC point, the CL point moves around whenthe angles (α, β) vary, unlike the simpler case of a ball-end

844 N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852

Fig. 4. (a) Local coordinate system; (b) collision detection in the x–y plane ofthe local coordinate system.

tool in which the center of the cutter (a hemisphere) is alwayschosen to be the CL point that remains stationary for thesame CC point, independent of the tool’s (α, β) angles. Whenprojecting an obstacle (a convex polyhedron), it is always donein an incremental manner from the data of the neighboringgrid in the α–β plane. Specifically, let Ω be the closed chainof silhouette edges on the obstacle that correspond to thecontour of the obstacle’s projection (a convex polygon) in thedirection (αi , β j ). To get the projection at a neighboring grid,say (αi+1, β j ), starting from its original edges, the chain Ωis updated incrementally — if an edge in the current Ω is nolonger a silhouette edge, it is replaced by the edges on one ofits two incident triangles, and all the time Ω remains a simpleand closed chain. Simple as it is, it is found in our experimentsthat this incremental method saves a tremendous amount ofcomputing time.

It is necessary to emphasize that only for the firstVMap(CC1) does the collision check need to be carried outfor all the (sampled) (α, β). However, for all the rest of thecontact points, there is no need to check all the α and β, sincethe contact points are continuous, and so are the VMaps. TheVMap of the next CC point could be built incrementally fromthat of the current CC point by testing only the boundary of thecurrent VMap. The pictorial flow chart in Fig. 5 illustrates thiscomputing process.

First, as shown in Fig. 5(a), the boundary grids of theforbidden area of VMap(CCi ) are identified — we use themethod from [19] for this task. Next, we expand the boundarygrids to their four neighbors; in total this will result in a “band”

made of candidate elements, as shown in Fig. 5(b). Thesecandidate elements are then stored in a queue waiting to bechecked. Meanwhile, we keep a temporary status map that tagswhether an element in the VMap has been queued or not —initially only the elements in the band are tagged. In the nextstep, Fig. 5(c), the first element in the queue will be poppedand checked for global interference, and will be colored either“white” (visible) or “black” (forbidden) in VMap(CCi+1). Ifits color is the same as that in VMap(CCi ), no further actionis taken. Otherwise, we append its untagged neighbors (at mostfour) to the queue and tag them. This process repeats on thefirst element of the queue until the queue becomes empty, andby then VMap(CCi+1) is obtained, as shown in Fig. 5(d).

3.2. Determination of tool orientations

Our main idea is to use VMaps to guide us to automaticallydetermine the tool orientations. To facilitate our task, we firstdefine an offset operation and a new type of map called afeasibility map.

Offset operator ρ

Let R be a closed region in the α–β plane. The offset of R,denoted by ρ(R), is a region in the α–β plane, defined as

ρ(R) = p : q ∈ R and |p − q|α < λ1 and |p − q|β < λ2.(6)

This means that under the angular velocity limit constraint anypoint in region ρ(R) could be reached from some point inregion R.

Feasibility map FMap

At each contact point CCi , in addition to its VMap, wedefine another map called the feasibility map, FMap. The firstfeasibility map at the starting point CC1 is always a single pointin the visible region of VMap(CC1). The FMap for i > 1 is thenrecursively defined by

FMap(CCi ) = VMap(CCi ) ∩ ρ(FMap(CCi−1)). (7)

FMap(CCi ) is a subset of VMap(CCi ), and it could be reachedfrom FMap(CCi−1) under the angular velocity limit constraint.The feasibility maps play a critical role in determining the toolorientation at each CCi . By its very definition, if FMap(CCk) isnot null for all i = 1, 2, . . . , k, then there must exist a partialtool path in the α–β plane π = t1 = FMap(CC1), t2, . . . , tksuch that ti ∈ VMap(CCi ) and |ti − ti−1|α < λ1 and|ti − ti−1|β < λ2, for i = 2, 3, . . . , k. On the other hand, ifFMap(CCi ) becomes empty, such a tool path does not existand a different starting point t1 must be decided. We nextdescribe the two procedures that systematically handle thesetwo situations.

3.2.1. Partial backward retractionSuppose at the current CCi+1, FMap(CCi+1) 6= Null,

and the current partial tool path determined is π = t1 =

N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852 845

Fig. 5. Computing VMap(CCi+1) from VMap(CCi ).

FMap(CC1), t2, . . . , ti . Let ti+1 ∈ FMap(CCi+1) be theclosest point to ti . If ti+1 = ti or |ti − ti+1|α < λ1 and |ti −

ti+1|β < λ2, we move to the next contact point CCi+2. We callthis step the forward advancement. Otherwise, we compute thecomplementary forward feasibility map FMap(CCk) starting atFMap(CCi+1) = ti+1 as

FMap(CCk) = ρ(tk+1) ∩ FMap(CCk),

k = i, i − 1, i − 2, . . . . (8)

This recursive computation terminates at a k = m for somem ≥ 1 such that tm ∈ FMap(CCm). Note that this terminationis guaranteed by the nature of the feasibility maps. We then“repair” the partial path πm = tm+1, tm+2, . . . , ti with theforward advancement operation, starting at tm and using insteadthe FMaps. This will result in a new partial path π∗

m =

t∗m+1, t∗m+2, . . . , t∗i that is guaranteed to meet the angularvelocity limit constraint.

Let us first use a 1D case to illustrate this partial backwardretraction process; here 1D means that angle β is fixed andonly α is allowed to change. Refer to Fig. 6. Fig. 6(a) showsthe relaxed feasibility maps of the first ten steps (up toCC10) w.r.t. the initial point at CC1 (step 1), where “relaxed”means the VMap at every contact point is the entire α–β

plane. Fig. 6(b) shows the VMaps of the ten CC points.Fig. 6(c) depicts the FMaps of the ten CC points, which isthe intersection of Fig. 6(a) and (b). The forward advancement

operation from CC1 would generate a partial path up to CC7as (7, 1), (7, 2), (7, 3), (7, 4), (7, 5), (6, 6), (6, 7) (assumingthat λ1 is equal to the grid length). At CC8, it is found that|t8 − t7|α > λ1, and thus the partial backward retractionoperation is invoked. The backward recursive computation ofFMap stops at CC4, and the subsequent forward advancementoperation would generate a new partial path π∗

m = t∗5 , t∗6 , t∗7 =

(6, 5), (5, 6), (4, 7). The forward advancement will thenresume at CC8.

Fig. 7 shows a real case. There are in total 1000 CC points.The resolution of the VMap is set to be 61 × 120 (one grid =

3 × 3 degrees). And, for simplicity, the angular velocity limitis specified as (1 grid per CC point, 1 grid per CC point).The forward advancement starting at CC1 reaches CC396 witht396 = (0, 0). The closest point to t396 from FMap(CC397) ist397 = (4, 116). Fig. 7(a) depicts the corresponding 397 toolpostures. Obviously, the last two exceeds the angular velocitylimit. So partial backward retraction is necessary. The backwardrecursion is found to stop at CC391, and the subsequent forwardadvancement generates a new sub-path between CC391 andCC397 as given in the third column of Fig. 7(b). The amendedtool postures are displayed in Fig. 7(c).

3.2.2. Full backward retraction and reinitializationIf during the forward advancement an empty FMap(CCi )

is reached, we must choose a new starting point t1. Fig. 8

846 N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852

Fig. 6. 1D illustration of partial backward retraction.

shows an example in one dimension. In Fig. 8(a), the forwardadvancement has to stop at CC16 since FMap(CC16) is Null,which means that from the current initial point we are notable to reach VMap(CC16) and a different initial point inVMap(CC1) has to be found. Another kind of assistant map,the BMap (backward feasible map), will be generated, that willhelp us find the available candidate initial points.

Backward feasibility map, BMapSuppose FMap(CCk) is found to be Null. Then we set

BMap(CCk) = VMap(CCk), and define the rest of the BMapsas

BMap(CCi ) = VMap(CCi ) ∩ ρ(BMap(CCi+1)),

i = k − 1, k − 2, . . . . (9)

Fig. 9 demonstrates the process of how BMaps aregenerated for the 1D example of Fig. 8. According to thedefinition of the BMap, every point in BMap(CCi ) couldreach BMap(CCi+1) under the angular velocity limit, sinceBMap(CCi ) ⊆ ρ(BMap(CCi+1)), as illustrated in Fig. 8.The reverse is, however, untenable because some points inρ(BMap(CCi+1)) may lie outside VMap(CCi ). For instance, inthe example of Fig. 8, from point (1, 16) ∈ BMap(CC16) thereexists no path to reach BMap(CC1). Hence, the BMap has theproperty that every point in it could reach the next CC point,but not necessarily the opposite. The proof of this assertion isgiven next.

Necessary condition. For any point t1 6∈ BMap(CC1), itscorresponding FMap(CCi )(1 < i ≤ k + 1) will have nointersection with BMap(CCi ) (see Fig. 8(a)).

Prove: Let m be the first step such that FMap(CCm) ∩

BMap(CCm) 6= Null, i.e., FMap(CCi ) ∩ BMap(CCi ) = Nullfor i = 1, 2, . . . , m − 1. We would have the following twoconditions:

tm ∈ VMap(CCm), tm ∈ BMap(CCm), tm ∈ FMap(CCm)

and

tm−1 ∈ VMap(CCm−1), tm−1 6∈ BMap(CCm−1),

tm−1 ∈ FMap(CCm−1).

Then,

tm−1 ∈ ρ(tm) ⊆ ρ(BMap(CCm)).

Sincetm−1 ∈ ρ(tm) ⊆ ρ(BMap(CCm))

tm−1 ∈ VMap(CCm−1),

according to the definition of the BMap, we get

tm−1 ∈ BMap(CCm−1).

This is contrary to the assumption.Sufficient condition. For any point t1 ∈ BMap(CC1), the

corresponding FMap(CCi ) has a non-empty intersection withBMap(CCi ), for all 1 < i ≤ k + 1 (see Fig. 8(b)).

Prove: Omitted, based on the definitions of FMap and BMap.In Fig. 8(b), the FMaps based on the new initial point

(15, 1) ∈ BMap(CC1) are composed of two parts — thosethat also belong to the corresponding BMaps and those that do

N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852 847

(a) The original first 397 tool postures. (b) The partial path before and after the retraction.

(c) The amended 397 tool postures. (d) VMap(CC397) and FMap(CC396).

Fig. 7. An example of partial backward retraction.

not. First, we come up with the path in the right which stillruns into the bottle neck at step 16, as in Fig. 8(a). The partialbackward retraction is then invoked. In this case, the retractionterminates at the very beginning step m = 1. The subsequentforward advancement generates the valid path in the left.

As a further illustration, Fig. 10 shows a 3D example.The resolution of the VMap is set to be 181 × 360 (onegrid = 1 × 1 degree). Initially, we use the starting point (0,0) from VMap(CC1), and at CC35 the FMap is found to beNull. Then, starting with BMap(CC35) = VMap(CC35), we

848 N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852

Fig. 8. A 1D example of full backward retraction.

obtain BMap(CC1), shown in Fig. 10(a) (displayed here in half-resolution 91×180). From BMap(CC1), an arbitrary point, (50,0), is taken as the new initial point, and the new FMap(CC35) isshown in Fig. 10(b), which is not empty, as expected. Fig. 10(c)depicts the final tool postures based on the new initial point(50, 0).

4. Implementation issues

As the computation and storage of the VMaps and FMapsdemand huge computer resources, in both time and space,and there are usually thousands of contact points in thelist Φ, the management of the VMaps and FMaps, as wellas other types of assistant maps (e.g., the BMaps), must

N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852 849

Fig. 9. BMaps of the 1D example of Fig. 8.

(a) BMap(CC1), the candidate initial points. (b) FMap(CC35) based on the new initial point (50,0).

(c) Tool postures based on initial points (50, 0) and (0, 0).

Fig. 10. An example of full backward retraction.

be carefully designed and implemented, so as to keep agood balance between the computing time and the memoryrequirement. Otherwise, the proposed algorithm would bevirtually useless, either because of its exhaustive memoryconsumption, or due to the unbearable running time. Tothat end, aside from some commonly used techniques, suchas using bounding boxes, several programming techniquesare also adopted in our implementation, in particularthe dynamic grouping of the VMaps and the dynamicstorage of the projections of the obstacles, as we elucidatenext.

4.1. Dynamic grouping of VMaps

Considering that it is practically impossible to store atonce the VMaps of all the contact points in the list Φ =

CC1, CC2, . . . , CCN , at any time during the running of thealgorithm, only a fixed number m of the contact points in theneighborhood of the current contact point being processed willhave their VMaps kept in the computer memory after they havebeen computed, with m usually at least one order smaller thanN . We use a two-ends stack to store these m points, called theactive points stack (APS). During the forward advancement at

850 N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852

the current point CCi , if point CCi+1 is not in the APS, we(a) compute the VMap of CCi+1 (see Fig. 5) and store it, (2)left-push it into the APS, and (3) if the APS has more thanm elements, right-pop the APS and release the memory of theVMap of the popped element. If CCi+1 is already in the APS,then its VMap is already in the memory and can be directlyused. The treatment for the backward retraction (both partialand full) is similar, except that this time the push operation is atthe right end and the pop at the left. (Note that VMap(CCi ) canbe computed from that of VMap(CCi+1) in exactly the samemanner as the other way around shown in Fig. 5.) The samemechanism is also used for other types of map, such as FMapsand BMaps. In our implementation, the size m of the APS is setto be 50 for both the VMap and BMap, and 25 for the FMap.

4.2. Dynamic storage of the projections

The projection of an obstacle in the direction of (α, β) isstationary — it is independent of the CC and CL points. Itwould be ideal if the projection can be computed just once (atCC1) and then stored for later use. Unfortunately this meanswe would need a memory storage of O(kαkβ V ), where Vis number of triangle faces of all the obstacles, which is tooformidable.

We note that the projection of an obstacle in the directionof a grid (α, β) is required only when the current VMap is notavailable (i.e., it is not in the APS) and one needs to decidethe “color” of that grid in the VMap. Because of the wayour VMaps are constructed, as shown in Fig. 5, this “color”checking is performed always near the boundary of the VMap.Actually, in the extreme case, if a grid is far away from theboundaries of all the VMaps (and there are many of themusually), it will never get checked. To take advantage of this,we only keep the projections of the obstacles for those gridsthat are in the region near the boundary of the current VMap.We call this region the active zone (see Fig. 11). Since theboundary of the VMap changes when moving from one contactpoint to the next, though slowly, the active zone also changesaccordingly, and once a grid moves out of the active zone, itsassociated projections are released, so as to give the space forthe newly added grids in the active zone. The width of the zoneis empirical, and it also depends on the memory capacity ofthe computer at hand. In our implementation it is set to be10 maxλ1, λ2. Our tests constantly show that the use of theactive zone tremendously speeds up the computation, usually50–100 times, as compared to the case without using it.

5. Experiments

The presented algorithm has been implemented on a PC withstandard configuration and tested on a number of test cases; inthe following we show two of them. In the tests, the resolutionof the VMaps is set to be 181 × 360, the number N of the CCpoints is 1000, and the total number V of the triangle faceson the obstacles is in the range 5000–7500. In both tests, theprogram completes in less than one minute.

Fig. 11. Active zone of the VMap.

Example I (Fig. 12)We use this example to demonstrate that the proposed

algorithm works well in the presence of complicated andconcave obstacles. In this case, when the tool runs into aconcave region in the VMap and could not expand its pathfurther, it will jump out automatically – since it can find thenearest point in the current FMap – and use the backwardretraction method to amend the old path until a valid one isfound. For clarity of the display, the tool postures are eachdrawn at an interval of ten contact points.

Example II (Fig. 13)This is a test example of multiple obstacles. The computed

toolpath (blue) satisfies the specified requirements: it avoids allthe obstacles and also satisfies the given angular velocity limitconstraint. However, it is not an “optimal” one in terms of someglobal/integral measures. For instance, the other toolpath shown(pink) also clears the obstacles and satisfies the angular velocitylimit; better yet, its total change of angles

∑Ni=1 |∆αi | + |βi | is

obviously smaller than that of the former. There can be othertypes of meaningful integral optimization objectives besidesthe total change of angles, e.g., to maximize the total volumeof the removed material subject to the cusp-height constraint.Our algorithm thus cannot be used as a general optimizationsolution. However, the principal ideas in our algorithm mayhelp develop a solution that caters to some global optimizationobjectives.

6. Conclusion

In this paper, we have presented an algorithm that, giventhe contact curve on the part surface and the environment,can automatically generate a five-axis machining toolpaththat not only satisfies both local and global interference-freerequirements, but also caps the rate of change of the tool’sorientation under a given limit. The algorithm supports ageneral type of tool, including the flat-end type, and arbitrarycomplicated obstacles. By careful design, representation,management, and use of the visibility maps as well as theirderivative data, the algorithm is able to achieve the toolpathplanning task with acceptable processing time and memoryrequirement. This work fills a gap in the ongoing research ofthe very important problem of automatically generating five-axis toolpaths under various constraints.

N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852 851

(a) Toolpath under a larger angular velocity limit. (b) Toolpath under a smaller angular velocity limit.

Fig. 12. Example I: A concave obstacle.

(a) (b)

Fig. 13. Example II: Multiple obstacles. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)

There are still many unanswered and interesting questionsthat are worth study in the future. In particular, we plan tocontinue to further improve/extend the current work in thefollowing two aspects. First, more algorithmic enhancementand improvement should be made on the computation andmanipulation of VMaps and other maps, so that the requiredprocessing time and space can be further reduced. Second, asalready alluded to by Example II, it is plausible to expandthe scope of the algorithm to cater for certain types ofglobal/integral optimization objectives such as the total changeof angles of the tool.

Finally, it is necessary to recall that our work still depends ona given contact curve. A satisfactory solution to the grandioseproblem of optimally distributing and ordering the contactpoints on the part surface, and determining their associated toolorientations, in consideration of all the factors such as local andglobal interference, limit on the tool’s angular velocity, cuspheight, material removal, etc., is yet to be found.

Acknowledgement

This work is partially supported by Hong Kong researchgrant RGC05/06.EG.620105.

852 N. Wang, K. Tang / Computer-Aided Design 39 (2007) 841–852

References

[1] Lee YS. Admissible tool orientation control of gouging avoidance for5-axis complex surface machining. Computer-Aided Design 1997;29(7):507–21.

[2] Lo CC. Efficient cutter-path planning for five-axis surface machining witha flat-end cutter. Computer-Aided Design 1999;31(9):557–66.

[3] Rao N, Ismail F, Bedi S. Tool path planning for five-axis machining usingthe principle axis method. International Journal of Machine Tools andManufacture 1997;37(7):1025–40.

[4] Rao A, Sarma R. On local gouging in five-axis sculptured surfacemachining using flat-end tools. Computer-Aided Design 2000;32(7):409–20.

[5] Wang Y, Tang X. Five-axis NC machining of sculptured surfaces.International Journal of Advanced Manufacturing Technology 1999;15(1):7–14.

[6] Gray P, Bedi S, Ismail F. Rolling ball method for 5-axis surfacemachining. Computer-Aided Design 2003;35(4):347–57.

[7] Gray P, Bedi S, Ismail F. Arc-intersection method for 5-axis toolpositioning. Computer-Aided Design 2005;37(7):663–74.

[8] Hosseinkhani Y, Akbari J, Vafaeesefat A. Penetration–eliminationmethod for five-axis CNC machining of sculptured surfaces. In-ternational Journal of Machine Tools and Manufacture 2007.doi:10.1016/j.ijmachtools.2006.11.002.

[9] Xu XJ, Bradley C, Zhang YF, Loh HT, Wong YS. Tool-path generationfor five-axis machining of free-form surfaces based on accessibilityanalysis. International Journal of Production Research 2002;40(14):3253–74.

[10] Lee YS, Chang TC. 2-phase approach to global tool interferenceavoidance in 5-axis machining. Computer-Aided Design 1995;27(10):715–29.

[11] Morishige K, Takeuchi Y. 5-axis control rough cutting of an impeller withefficiency and accuracy. In: Proceedings of the 1997 IEEE internationalconference on robotics and automation. 1997. p. 1241–6.

[12] Vafaeesefa A, Elmaraghy H. Accessibility analysis in 5-axis machining ofsculptured surfaces. In: Proceedings, 1998 IEEE international conferenceon robotics and automation, vol. 3. 1998. p. 2464–9.

[13] Ho S, Sarma S, Adachi Y. Real-time interference analysis between a tooland an environment. Computer-Aided Design 2001;33(13):935–47.

[14] Oleg Ilushin, Gershon Elber, Dan Halperin, Ron Wein, Myung SooKim.Precise global collision detection in multi-axis NC-machining. Computer-Aided Design 2005;37(9):909–20.

[15] Umehara T, Teramoto K, Ishida T, Takeuchi Y. Tool posturedetermination for 5-axis control machining by area division method. SMEInternational Journal, Series C: Mechanical Systems, Machine Elementsand Manufacturing 2006;49(1):35–42.

[16] Lauwers B, Kruth JP, Dejonghe P, Vreys R. Efficient NC-programmingof multi-axes milling machines through the integration of tool pathgeneration and NC-simulation. CIRP Annals-Manufacturing Technology2000;49(1):367–70.

[17] Lauwers B, Dejonghe P, Kruth JP. Optimal and collision free tool posturein five-axis machining through the tight integration of tool path generationand machine simulation. Computer-Aided Design 2003;35(2):421–32.

[18] Morishige K, Takeuchi Y, Kase K. Tool path generation using C-Space for5-axis control machine. Journal of manufacturing science and engineering1999;121:144–9.

[19] Jun CS, Cha K, Lee YS. Optimizing tool orientations for 5-axis machiningby configuration-space search method. Computer-Aided Design 2003;35(6):549–66.

[20] Chiou CJ, Lee YS. A machining potential field approach to tool pathgeneration for multi-axis sculptured surface machining. Computer-AidedDesign 2002;34(5):357–71.

[21] Chiou CJ, Lee YS. Optimal tool orientation for five-axis tool-endmachining by swept envelope approach. Journal of ManufacturingScience and Engineering, Transactions of the ASME 2005;127(4):810–8.

[22] Balasubramaniam M, Sarma SE, Marciniak K. Collision-free finishingtoolpaths from visibility data. Computer-Aided Design 2003;35(4):359–74.

[23] Gian R, Lin TW, Lin AC. Planning of tool orientation for five-axis cavitymachining. International Journal of Advanced Manufacturing Technology2003;22(1–2):150–60.

[24] Kim SJ, Lee DY, Kim HC, Lee SG, Yang MY. CL surface deformationapproach for a 5-axis tool path generation. The International Journal ofAdvanced Manufacturing Technology 2006;28(5–6):509–17.

[25] Hsueh YW, Hsueh MH, Lien HC. Automatic selection of cutterorientation for preventing the collision problem on a five-axis machining.International Journal of Advanced Manufacturing Technology 2007;32(1–2):66–77.

[26] Kiswanto G, Lauwers B, Kruth JP. Gouging elimination through toollifting in tool path generation for five-axis milling based on facetedmodels. International Journal of Advanced Manufacturing Technology2007;32(3–4):293–309.

[27] Ho MC, Hwang YR, Hu CH. Five-axis tool orientation smoothing usingquaternion interpolation algorithm. International Journal of MachineTools and Manufacture 2003;43(12):1259–67.

[28] Balasubramaniam M, Laxmiprasad P, Sarma SE, Shaikh Z. Generating5-axis NC roughing paths directly from a tessellated representation.Computer-Aided Design 2000;32(4):261–77.

[29] Li SX, Jeread RB. 5-axis machining of sculptured surfaces with a flat-endcutter. Computer-Aided Design 1994;26(3):165–78.

[30] Gottschalk S, Lin MC, Manocha D. OBBTree: A hierarchical structurefor rapid interference detection. In: International conference on computergraphics and interactive techniques. 1996. p. 171–80.

[31] de Berg M, van Kreveld M, Overmars M, Schwarzkopf O. Computationalgeometry: Algorithms and applications. Springer; c1997.

Nan Wang is currently a Ph.D. student at Hong KongUniversity of Science and Technology (HKUST). Shereceived her B.Eng. and M.Phil. degrees from theMechanical Engineering School of Southeast Univer-sity, Nanjing, China, in 2003 and 2005, respectively.Her research interests include tool path planning formultiaxis NC machining, and motion planning.

Kai Tang is currently a faculty member in theDepartment of Mechanical Engineering at HongKong University of Science and Technology. Beforejoining HKUST in 2001, he had worked for morethan 13 years in the CAD/CAM and IT industries.His research interests concentrate on designingefficient and practical algorithms for solving real-worldcomputational, geometric, and numerical problems.Dr. Tang received Ph.D. in Computer Engineeringfrom the University of Michigan in 1990, M.Sc. in

Information and Control Engineering in 1986, also from the University ofMichigan, and B.Eng. in Mechanical Engineering from Nanjing Institute ofTechnology in China in 1982.