11
Author's personal copy Computer-Aided Design 43 (2011) 1099–1109 Contents lists available at ScienceDirect Computer-Aided Design journal homepage: www.elsevier.com/locate/cad Pocketing toolpath computation using an optimization method Michel Bouard, Vincent Pateloup , Paul Armand Research institut XLIM - UMR CNRS 6172, Limoges, France article info Article history: Received 8 September 2010 Accepted 28 May 2011 Keywords: Toolpath computation Optimization Pocket machining High-speed machining abstract This paper proposes a new method of pocketing toolpath computation based on an optimization problem with constraints. Generally, the calculated toolpath has to minimize the machining time and respect a maximal effort on the tool during machining. Using this point of view, the toolpath can be considered as the result of an optimization in which the objective is to minimize the travel time and the constraints are to check the forces applied to the tool. Thus a method based on this account and using an optimization algorithm is proposed to compute toolpaths for pocket milling. After a review of pocketing toolpath computation methods, the framework of the optimization problem is defined. A modeling of the problem is then proposed and a solving method is presented. Finally, applications and experiments on machine tools are studied to illustrate the advantages of this method. © 2011 Elsevier Ltd. All rights reserved. 1. Introduction This article proposes a new method of toolpath computation us- ing uniform cubic B-spline curves calculated with an optimization algorithm to describe the geometry of the path. The purpose of this methodology is to calculate C 2 -continuous cutting passes adapted to high-speed milling. This method is particularly dedicated to the calculation of pocketing toolpaths for aeronautical parts in alu- minum, where the objective is to machine all the material within boundaries in a minimum time. Whereas all current methods of computation do not use optimization to generate the toolpath, our method proposes considering the calculation of each cutting pass as an optimization problem in which the objective is to minimize the machining time and the constraints consist of checking the cut- ting forces. The aim of pocket machining operations is to remove all the material inside a pre-defined contour between two horizontal planes in a minimal machining time. The only constraint specified by the part geometry is the boundary of the pocket [1]. Using this observation, any computed toolpath can take any shape if the pocket boundary is respected, the cutting conditions related to the tool/material are verified, and the removal of all the material inside the boundary is checked. Therefore, it can be interesting to compute a toolpath that fulfills the specifications quoted before and produces a minimal machining time by using the free form of the shape generated by the pocketing goal. This work is supported by the ‘‘Agence Nationale de la Recherche’’ under the reference ANR-08-JCJC-0038-01. Corresponding author. Tel.: +33 5 55 43 44 17. E-mail addresses: [email protected] (M. Bouard), [email protected] (V. Pateloup), [email protected] (P. Armand). A review of pocket toolpath computation methods is presented by Hatna [1]. Generally, the machining strategy is based on the construction of parallel passes or offset curves at the boundary of the pocket (Fig. 1). If exclusively down-cut or up-cut milling is expected, contour-parallel toolpaths are preferred to direction- parallel toolpaths in order to minimize the machining time [2]. The offset curves are calculated using a Voronoï diagram [3,4], a pair-wise offset algorithm [5], or a pixel-based approach [6]. A recent approach to compute offset curves not depending on the tool geometry has been developed by Molina [7]. It is based on the morphology of the external profile and avoids the main problems of traditional methods such as intersections, discontinuity, and lack of generality. All these methods compute pocket toolpaths using geometrical rules without optimization. Our previous studies [8,9] have improved these methods by us- ing some possibilities offered by the free form of the toolpath inside the boundary. First, a method that increases the curvature radii at each corner of the toolpath was presented [8]. Then, a cubic B- spline interpolation of the cutting passes, based on the interpo- lation of circle arcs and straight lines, was developed to compute C 2 -continuous toolpaths [9]. With these two ‘‘add-ons’’, a classical toolpath can be improved by adding circle arcs at each corner and making it C 2 -continuous. Radii are calculated to check the maxi- mum distance between cutting passes (dp max ), which controls the radial depth of cut of the tool [8]. The B-spline interpolation is done to satisfy a maximum error chosen by the operator. Our approach is built on the fact that a pocket milling is con- sidered as an optimization process of material removal under con- straints. In this case, toolpath computation is not the result of a sequence of geometrical operations but the result of an optimiza- tion problem. This article is structured as follows. Initially, typical toolpath computation methods are analyzed. Our optimization method 0010-4485/$ – see front matter © 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2011.05.008

Pocketing tool path computation using optimization method

Embed Size (px)

Citation preview

Page 1: Pocketing tool path computation using optimization method

Author's personal copy

Computer-Aided Design 43 (2011) 1099–1109

Contents lists available at ScienceDirect

Computer-Aided Design

journal homepage: www.elsevier.com/locate/cad

Pocketing toolpath computation using an optimization method✩

Michel Bouard, Vincent Pateloup ∗, Paul ArmandResearch institut XLIM - UMR CNRS 6172, Limoges, France

a r t i c l e i n f o

Article history:

Received 8 September 2010Accepted 28 May 2011

Keywords:

Toolpath computationOptimizationPocket machiningHigh-speed machining

a b s t r a c t

This paper proposes a newmethod of pocketing toolpath computation based on an optimization problemwith constraints. Generally, the calculated toolpath has to minimize the machining time and respect amaximal effort on the tool during machining. Using this point of view, the toolpath can be considered asthe result of an optimization in which the objective is to minimize the travel time and the constraints areto check the forces applied to the tool. Thus a method based on this account and using an optimizationalgorithm is proposed to compute toolpaths for pocket milling. After a review of pocketing toolpathcomputationmethods, the framework of the optimization problem is defined. Amodeling of the problemis then proposed and a solving method is presented. Finally, applications and experiments on machinetools are studied to illustrate the advantages of this method.

© 2011 Elsevier Ltd. All rights reserved.

1. Introduction

This article proposes a newmethod of toolpath computation us-ing uniform cubic B-spline curves calculated with an optimizationalgorithm to describe the geometry of the path. The purpose of thismethodology is to calculate C

2-continuous cutting passes adaptedto high-speed milling. This method is particularly dedicated to thecalculation of pocketing toolpaths for aeronautical parts in alu-minum, where the objective is to machine all the material withinboundaries in a minimum time. Whereas all current methods ofcomputation do not use optimization to generate the toolpath, ourmethod proposes considering the calculation of each cutting passas an optimization problem in which the objective is to minimizethemachining time and the constraints consist of checking the cut-ting forces.

The aim of pocket machining operations is to remove all thematerial inside a pre-defined contour between two horizontalplanes in a minimal machining time. The only constraint specifiedby the part geometry is the boundary of the pocket [1]. Usingthis observation, any computed toolpath can take any shape if thepocket boundary is respected, the cutting conditions related tothe tool/material are verified, and the removal of all the materialinside the boundary is checked. Therefore, it can be interesting tocompute a toolpath that fulfills the specifications quoted beforeand produces a minimal machining time by using the free form ofthe shape generated by the pocketing goal.

✩ This work is supported by the ‘‘Agence Nationale de la Recherche’’ under thereference ANR-08-JCJC-0038-01.∗ Corresponding author. Tel.: +33 5 55 43 44 17.

E-mail addresses:[email protected] (M. Bouard),[email protected] (V. Pateloup), [email protected] (P. Armand).

A review of pocket toolpath computation methods is presentedby Hatna [1]. Generally, the machining strategy is based on theconstruction of parallel passes or offset curves at the boundaryof the pocket (Fig. 1). If exclusively down-cut or up-cut millingis expected, contour-parallel toolpaths are preferred to direction-parallel toolpaths in order to minimize the machining time [2].The offset curves are calculated using a Voronoï diagram [3,4], apair-wise offset algorithm [5], or a pixel-based approach [6]. Arecent approach to compute offset curves not depending on thetool geometry has been developed by Molina [7]. It is based on themorphology of the external profile and avoids the main problemsof traditional methods such as intersections, discontinuity, andlack of generality. All these methods compute pocket toolpathsusing geometrical rules without optimization.

Our previous studies [8,9] have improved these methods by us-ing somepossibilities offered by the free formof the toolpath insidethe boundary. First, a method that increases the curvature radii ateach corner of the toolpath was presented [8]. Then, a cubic B-spline interpolation of the cutting passes, based on the interpo-lation of circle arcs and straight lines, was developed to computeC2-continuous toolpaths [9]. With these two ‘‘add-ons’’, a classical

toolpath can be improved by adding circle arcs at each corner andmaking it C2-continuous. Radii are calculated to check the maxi-mum distance between cutting passes (dpmax), which controls theradial depth of cut of the tool [8]. The B-spline interpolation is doneto satisfy a maximum error chosen by the operator.

Our approach is built on the fact that a pocket milling is con-sidered as an optimization process of material removal under con-straints. In this case, toolpath computation is not the result of asequence of geometrical operations but the result of an optimiza-tion problem.

This article is structured as follows. Initially, typical toolpathcomputation methods are analyzed. Our optimization method

0010-4485/$ – see front matter© 2011 Elsevier Ltd. All rights reserved.doi:10.1016/j.cad.2011.05.008

Page 2: Pocketing tool path computation using optimization method

Author's personal copy

1100 M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109

Fig. 1. Usual pocket toolpaths.

Fig. 2. Usual pocket toolpaths for high-speed machining.

is then presented and compared to existing works. Exper-imental machine applications are presented to evaluate thebenefits.

2. Definition of the optimization problem for pocketing tool-path computation

To define the framework of the optimization problem, a studyof classical pocketing toolpath computation methods is presentedand analyzed. Then, the optimization problem is presented andcompared to existing works.

2.1. Usual methods for pocketing toolpath computation

A pocket machining can be defined as any machining whichremoves all thematerial located inside a preset boundary betweentwo horizontal planes. The final part is obtained by the movementof the tool, according to the following constraints.

• Cutting constraint: efficient machining conditions have to beused. Down-cutmachining is especially expected formachiningaeronautical parts in aluminum.

• Mechanical constraint: the cutting efforts and cutting powerconsumed must be lower than the possible maximum limits ofthe machine and the tool.

• Geometrical constraint: the machined boundary and the ma-chined plane must respect the required dimensional specifica-tions, shape deviation, and surface roughness.

• Geometrical constraint: the internal area of the pocket must becompletely machined.

To satisfy these constraints, the toolpath is usually calculated usingan algorithm for offset curve computation, whichmakes it possibleto calculate a helical toolpath from the interior to the pocketoutside or vice versa (Fig. 1). In the case of high-speed machining(HSM), Choi defines six stages in order to describe the computationof a pocketing toolpath using parallel contours [6].

• Determination of the boundary curve using the intersection ofa plane perpendicular to the tool axis with the profile of thepocket.

• Computation of the offset curves of the boundary curve using apixel-based approach.

• Detection of the non-machined areas.• Fitting of the various elementary paths: addition of segments to

eliminate the non-machined areas and removal of the loops todecrease the toolpath length.

• Creation of the toolpath linking using segments in order tominimize the toolpath length [10]. A toolpath linking is addedbetween two successive offset curves.

• Corner adaptation using circle arcs to replace right-anglecorners in order to generate a G

1-toolpath.

As a result, the calculated toolpath is illustrated in Fig. 2. Thetoolpath presents a set of discontinuities in curvature at eachcorner and at each toolpath linking. Indeed, a corner adaptationreplaces one discontinuity in tangency by two discontinuities incurvature at the connects between circle arcs and straight lines.

To fulfill the objective of minimizing the machining time, twoways of improvement can be explored. The first is based onthe decrease of the length of the toolpath considering that themachining is realized at constant feedrate if the programmed oneis low (Vf < 1 m/min). It is based on the following:• the choice of the machining direction in ‘‘zigzag’’ mode [11,12],• the detection of the non-machined areas and their reduction in

the case of a machining by contour-parallel offsets [13,14], and• the optimization of the number and position of the connections

between cutting passes [10].

The second considers that the real feedrate is never constant whenthe programmed one is high (Vf > 1 m/min). In this case, the realfeedrate can be improved while respecting the constraints ex-pressed above, by changing the geometry of the toolpath [8,15].The main problem comes from each geometrical discontinuity of atoolpath that generates the following:• a crossing with a high decrease of the feedrate if the toolpath is

discontinuous in tangency [16],• a reduction of the real feedrate of the tool in order to respect

the contour error,• dynamic loads on the machine tool structure during accelera-

tions and decelerations,

Page 3: Pocketing tool path computation using optimization method

Author's personal copy

M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109 1101

• a variation of the cutting conditions because of the variations ofthe feedrate, and

• an increase in machining time due to the feedrate reduction.

Some methods that remove these discontinuities are proposed bycomputer-aided manufacturing (CAM) software. They are basedon the use of circle arcs to remove tangency discontinuities andpolynomial interpolation of the toolpath to remove curvaturediscontinuities.

Hence, we can say that the shape of the computed toolpathdirectly influences the machining time. Thus the pocketingimprovement needs to use new toolpath geometries. Some otherauthors use this approach [17,18]. Held proposes a method thatgenerates a smooth G

1-toolpath. It is based on the placementof growing M-disks on the medial axis of Voronoï diagrams.Approximation can be used to boost the toolpath to C

2-continuity.Toolpaths respecting perfectly maximal radial depth of cut arethen computed to check the cutting forces. However, the toolpathlengths are increased and the machining time is not controlledand minimized. Bieterman also presents a method that computessmooth C

2-toolpaths using the solution of an elliptic partialdifferential equation boundary value problem defined on a pocketregion. As the toolpath length is increased, the author decides toincrease the feedrate when the radial depth of cut is lower thanan upper bound. A variable feedrate optimization procedure isproposed. With this approach, the maximum radial depth of cutis respected and the machining time is decreased, but the feedratecan be locally multiplied by three.

The two previously mentioned methods modify classicaltoolpath geometry satisfying a maximum radial depth of cut andsmoothing it to C

2-continuity. The minimization of the machiningtime is never the aim of these methods. In comparison, ourapproach use an optimization procedure to compute a toolpathwhich attempts to minimize the machining time, among allthe possible toolpaths respecting the various geometrical andmechanical constraints. To summarize, the approaches of Held andBieterman want to compute C

2-continuous helical toolpaths todecrease the machining time and check the cutting forces.

Wang proposed improving a geometrically feasible toolpathusing a cost function combining the path curvature and the cutterengagement [19]. These two criteria are used to minimize theacceleration requirements of the machine tool and to ensure astable cutting process. First, the toolpath is interpolated by cubicBezier spline segments. Each control point is then moved in orderto decrease the cost function locally. This step is repeated untilthe decrease on the cost function becomes too small. A final C1-continuous smoothed toolpath is obtained. Our strategy is basedon the same idea: the smoothing of offset curves into C2-continuityto decrease the machining time while respecting a correct cuttingprocess. The main difference in our work is the comprehensiveapproach to solve the problem by using an optimization problemwith constraints.

2.2. Expression of the process constraints

2.2.1. Design constraints

The geometry of a machined part is directly generated by themovements of the tool during toolpath following. In order to besure that the produced part corresponds to the designed one, allgeometrical specifications quoted on the part have to be respectedon the machined one. Three such constraints are listed below:

• the shape of the pocket,• the geometrical specifications of the position and the orienta-

tion of the boundary and the bottom of the pocket, and• the geometrical specifications of any shape defect and surface

roughness of each face of the pocket.

All these geometrical constraints specify shapes machined duringthe pocketing process. A correct toolpath must take into accountthese geometrical specifications. As its computation is based on thedesigned shapes of the pocket, only tool deflection and machineinaccuracy can produce failed machined pockets. If the tolerancesof the geometrical specifications are too low for the machiningprocess used, a finishing pass, generating low cutting forces, mustbe computed for the boundary and the bottom of the pocket.Hence, the only design constraint thatmust be fulfilled is the shapeof the pocket.

2.2.2. Machining constraints

Machining constraints are imposed by themachine tool. Duringthe toolpath computation, we consider that we have to satisfy thefollowing:

• the maximal power accepted by the spindle and the axes of themachine tool,

• the maximal cutting forces accepted by the tool and the part,and

• the cutting conditions given to ensure a fixed tool life.

All these constraints are described by bounds of forces. During thetoolpath computation, they have to be translated into geometricalconstraints. The cutting forces depend directly on the materialremoval rate and, in our case, the radial depth of cut of the tool [20].Therefore, our toolpath computation has to check the radial depthof cut evolution during the optimization in order to ensure theaverage and maximal cutting power chosen by the user.

As the shape of the toolpath is based on offset curves, twoparameters are used to respect the bounds of the radial depth ofcut in order to satisfy the machining constraints:

• dp: the distance between cutting passes (used in all CAMsoftware), and

• dpmax: the maximal distance between cutting passes (definedin [8]).

A last constraint concerns the description format of the toolpath.It must be directly interpretable by the numerical control unit(NCU) without using a new interpolation method integrated in theNCU. Consequently, the only description format generating a C

2-continuous toolpath and understood by our NCU is B-spline curvesof degree 3.

2.3. Definition of the functions

2.3.1. Constraints function

As presented in Sections 2.1 and 2.2, the framework of ouroptimization is to find a toolpath which tries to minimize themachining time knowing the following:

• the toolpath has to be C2-continuous and as smooth as possible,• the toolpath is based on offset curves, and• the distance between cutting passes has to be close to dp and

lower than dpmax.

To satisfy these two last constraints, an area between two offsetcurves at dp and dpmax clearance from the previous pass canbe considered (Fig. 3). This area is called the control rail, andthe cutting pass must be located inside it to satisfy the processconstraints.

2.4. Objective function

To compute the fastest toolpath inside the control rail, ageometrical criterion, computable during optimization and relatedto machining time evolution, must be considered. Previous works

Page 4: Pocketing tool path computation using optimization method

Author's personal copy

1102 M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109

Boundary of the pocket Routil

External cutting pass generating boundary of the pocket

Control rail for cutting pass N° 1

Control rail for cutting pass N° 2

Control rail for cutting pass N° 3

dp

dpmax

dp

dpmax

dp

dpmax

Offset curve at the center of the control rail

Fig. 3. Control rail illustration for a pocket with three passes.

showed that the mean squared curvature along the toolpathdefined by� 1

0κ(t)2 dt, (1)

where κ is the curvature of the toolpath, is suitable for achievingthis objective [9].

3. Toolpath computation by optimization

As explained in Section 2, the computation of a pocketingtoolpath can be reduced to the computation of a sequence ofcutting passes described by B-spline curves of degree 3. Each curveis determined by the solution of an optimization problem, whoseobjective is to minimize the sum of the squares of the curvatureof the curve, while the constraints are to stay inside a control railgiven by the offset curves of the pocket boundary, defined by theparameters dp and dpmax. The control rail is defined by an offsetcurve of its middle points, which is computed bymeans of Voronoïdiagrams. The width of the control rail is equal to the differencebetween dp and dpmax. Fig. 3 shows an example of a control rail fora typical pocket with three passes.

3.1. Objective function

Let n ≥ 4 be the number of control points. For i from 0 to n− 1,let us denote by Bi : [0, 1] → R the B-spline functions of degree3, determined by the knot sequence u0 = · · · = u3 = 0, 0 ≤ u4 ≤. . . ≤ un−1 ≤ 1 and un = · · · = un+3 = 1. Let (xi, yi) ∈ R2 bethe ith control point for i from 0 to n − 1. The B-spline curve is thefunction B : [0, 1] → R2 defined by

B(t) =n−1�

i=0

Bi(t)(xi, yi). (2)

Whenever the knot sequence is uniform, i.e. ui = i−3n−3 for i from

4 to n − 1, the B-spline curve is entirely determined by thecontrol points. It seems then quite natural to choose those pointsas optimization parameters.

As explained previously, the geometrical criterion used toreflect the machining time is the mean squared curvature. Let usrecall the curvature definition of a parametric curve. Let C : [0, 1]→ R2 be a given regular twice continuously derivable parametriccurve.

Definition 1. The real curvature of C is the function κC : [0, 1] →R, defined by

κC = | det(C �, C��)|

�C ��3 .

By noting that x = (x0, . . . , xn−1)�, y = (y0, . . . , yn−1)

� andtaking a uniform discretization t0, . . . , tm−1 of [0, 1], the objectivefunction is defined by applying the rectangle method to (1), whichgives

fκ(x, y) =m−1�

i=0

κB(ti)2. (3)

Assuming that the B-spline curve B is regular, meaning thatits derivative does not vanish, this function is C

∞. Due to thenonconvexity of fκ , the optimization problem can bemore difficultto solve, and global optimality cannot be guaranteed. We thusintroduce a simpler criterion.

Definition 2. The simplified curvature of C is the function ξC :[0, 1] → R, defined by

ξC = �C���

�C ��2 .

The simplified curvature dominates the real curvature, as shownby the following proposition.

Proposition 1. For all t ∈ [0, 1], we have κC(t) ≤ ξC(t).

Proof. Use the fact that det(u, v) = sin(u, v)�u� �v� for twovectors u and v of R2. �From the simplified curvature, we define a new objective functionby

fξ (x, y) =m−1�

i=0

ξB(ti)2. (4)

Page 5: Pocketing tool path computation using optimization method

Author's personal copy

M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109 1103

Fig. 4. Control rail of some segments.

Proposition 1 shows that, for all (x, y) ∈ R2n,

fκ(x, y) ≤ fξ (x, y). (5)

Despite this simplification, the function fξ is still nonconvex. Acriterion often used in place of the real curvature is the acceleration[21,22].

Definition 3. The acceleration ofC is the function aC : [0, 1] → R,defined by

aC = �C���.

These three criteria are linked by the following property.

Proposition 2. If �C�� = 1, then κC = ξC = aC .

Proof. The assumption on C� trivially implies that ξC = aC . If

C�� = 0, we then have κC = ξC = aC = 0. Assume now that

C�� �= 0. By deriving �C

��2 = 1, we obtain C� · C

�� = 0. Using C� ·

C�� = cos(C �, C

��)�C�� �C

���, we deduce that cos(C �, C��) = 0, and

thus | sin(C �, C��)| = 1. We then get κC = | sin(C �, C

��)| �C��� =

�C���. �

We define the objective function

fa(x, y) =m−1�

i=0

aB(ti)2. (6)

This function enjoys two fundamental properties for optimization.

Proposition 3. The function fa is quadratic and convex.

Proof. Define the vector bi = (B ��0 (ti), . . . , B

��n−1(ti))

� for i ∈{0, . . . ,m − 1}. From (2) and Definition 3, we have

fa(x, y) =m−1�

i=0

(x�bib�ix + y�bib�

iy)

=�xy

�� �B 00 B

� �xy

�,

where B = �m−1i=0 bib�

i. The Hessian matrix of this quadratic form

is clearly positive semi-definite, implying the convexity of fa. �

3.2. Feasible set

Let us nowmodel the control rail. An offset curveO is defined byl + 1 points Oi = (pi, qi) ∈ R2, i ∈ {0, . . . , l}, called offset points.We can describe it by l segments OiOi+1, called offset segments.Let δ be the half-width of the control rail, i.e. δ = (dpmax − dp)/2.For each segment OiOi+1, the rail can be viewed as a rectangle; seeFig. 4. By doing an affine transformation on each segment, we canexpress the corresponding constraints.

Let (O, −→u , −→v ) be a Cartesian coordinated system. For i ∈ L :={0, . . . , l−1}, let us consider the affine transformationαi thatmapsthe segment OiOi+1 to the same length segment OO

αi

i+1 collinear

Fig. 5. Transformation αi of segment OiOi+1.

to vector −→u (see Fig. 5). This transformation can be written αi =

ρi ◦ τi, where τi is a translation and ρi is a rotation defined by

τi :�x

y

��→

�x − pi

y − qi

ρi :�x

y

��→

�cos θi − sin θisin θi cos θi

� �x

y

�,

where θi is the angle between the vectors−−−→OiOi+1 and

−→u (see Fig. 5).

It is straightforward to see that

cos θi = pi+1 − pi

di

and sin θi = qi − qi+1

di

,

where di =�

(pi+1 − pi)2 + (qi+1 − qi)2. Let t ∈ [0, 1], (Bx(t),

By(t)) be a point on the B-spline curve B, and let (Bαi

x (t), Bαi

y (t))be its image by the affine transform αi. The constraints on thecorresponding offset segment OiOi+1 can be written as

0 ≤ Bαi

x (t) ≤ di and − δ ≤ Bαi

y (t) ≤ δ. (7)

In order to obtain amore accuratemodel at each angle of the offsetcurve, the rectangles corresponding to the segments constraintsare lengthened by substracting ei−1 from the lower bound and byadding ei to the upper bound in the first constraint of (7), whereei = δ sinβi and 2βi = π − γi, as shown in Fig. 6. More precisely,γi is the angle (

−−−→OiOi−1,

−−−→OiOi+1). In addition, we put e−1 = el−1

= 0. To use this constraint formulation, we need to subdividethe B-spline curve into a number of offset segments, each partcorresponding to one segment. To do that, we perform a uniformdiscretization r0, . . . , rl−1 of the interval [0, 1], where, for all t ∈[ri, ri+1], B(t) satisfies the constraints. It remains to discretizeeach interval [ri, ri+1] to obtain a finite number of constraints.More precisely, let k ∈ N∗ and let si,0, . . . , si,k−1 be a uniformdiscretization of the interval [ri, ri+1]. The constraints on the offsetsegment OiOi+1 are

−ei−1 ≤ Bαi

x (si,j) ≤ di + ei

and−δ ≤ B

αi

y (si,j) ≤ δ,

(8)

for all j ∈ K := {0, . . . , k − 1}. Further restrictions are applied tothe starting and ending points of the B-spline curve by setting

Bα0x (s0,0) = 0 and B

αl−1x (sl−1,k−1) = dl−1. (9)

Due to the fact that the knot sequence {ui}i=0,...,n+3 and thediscretization {ri}i=0,...,l−1 of the B-spline curve are chosen to beuniform, it seems advisable to take a set of points that are regularly

Page 6: Pocketing tool path computation using optimization method

Author's personal copy

1104 M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109

Fig. 6. Segment extension at angles.

Fig. 7. Matching between B-spline curve and control rail.

spaced for the offset curve. We adopt this strategy during ournumerical experiments. The large straight offset segments are thendivided into smaller pieces to obtain a quasi-uniform distributionof the offset points all along the curve.

Fig. 7 illustrates how the discretization points of the B-splinecurve correspond to the constraints of the control rail. With thisapproximation, we can observe that some areas in the angles,called outer constraints, may be reached by the B-spline curve,despite the fact that they do not belong to the control rail. Thisrelaxation does not present any drawback, because, when thecurvature is minimized, the curve always tries to pass inside theangle, that is, through the angular constraints domain.

3.3. Optimization problem

Depending on the choice of the objective function, we willdefine three optimization problems. The feasible set of eachproblem is defined by (8) and (9), and the objective function ischosen between fa, fξ and fκ defined by (4) and (6) and (3). Ouroptimization problem can be formulated as follows:

minimize f (x, y)subject toB

α0x (s0,0) = 0,

Bαl−1x (sl−1,k−1) = dl−1,

−ei−1 ≤ Bαi

x (si,j) ≤ di + ei, (i, j) ∈ X,

−δ ≤ Bαi

y (si,j) ≤ δ, (i, j) ∈ Y,

(10)

where f is one of the three functions fa, fξ , or fκ , X := L × K , andY := X \ {(0, 0), (l − 1, k − 1)}.

One advantage of our constraint formulation is that thefunctions defining the constraints are affine of (x, y). Indeed, due to(2) and to the affine transform αi, the coordinate functionsB

αi

x (si,j)

and Bαi

y (si,j) are affine maps with respect to x and y.The first optimization problem, which we denote by Pa,

is when the function fa defined by (6) is minimized in (10).Thanks to Proposition 3 and to the constraints set property, Pa

is a quadratic convex minimization problem. This property isparticularly significant because it guarantees the global optimalityof the computed solutions.

The second and third optimization problems, respectivelydenoted by Pξ and Pκ , are when the functions fξ and fκ definedby (3) and (4) are minimized in (10). Both problems are generallynonconvex, meaning that they are more difficult to solve and noguarantee of global optimality of the computed solution. Accordingto [9], themost accuratemodel is Pκ , but this was themost difficultto solve during our experiments.

Proposition 1 shows that the objective fξ is an upper bound onfκ , whereas Proposition 2 says that fa is a rough approximation offξ . The relevance order of the problems is, from less tomore, Pa, Pξ ,and Pκ . Due to nonconvexity, the computed solutions for problemsPκ and Pξ will depend on the choice of control points to start theoptimization process. This choice does not matter for Pa due to itsconvexity. It then seems judicious to solve Pa first, then to solve Pξ

by starting the optimization process from the optimal solution ofPa, and finally solve Pκ by starting from the optimum of Pξ .

3.4. Numerical solution

We now give a brief description of the optimization procedure,knowing that a full mathematical explanation is beyond the scopeof this paper.

Due to the fact that the functions defining the constraints areaffine, the three optimization problems Pa, Pξ , and Pκ can beformulated as follows:minimize f (x)subject to Ax = b

Cx ≥ d,(11)

where x = (x, y) is a vector of length 2n and the objective functionf is one of the functions fa, fξ , or fκ , according to the problem wewant to solve. The matrices A and C and the vectors b and d aredefined such that the equality constraint Ax = b corresponds to(9) and the inequality constraint Cx ≤ d to (8). We then have twoequality constraints and 2(l − 1)k − 2 inequality constraints. Tofind a solution of this problem, we solve the first-order optimalityconditions:

∇f (x) + A�y + C

�z = 0

Ax − b = 0(Cx − d) ◦ z = 0(Cx − d, z) ≥ 0,

(12)

where y and z are Lagrange multipliers and ◦ is the Hadamardproduct. These conditions are necessary and sufficient for globaloptimality for problem Pa, but only necessary for problems Pξ

and Pκ . In these last two cases, the solution of (12) is only astationary point of (11). We are currently developing a nonlinearoptimization method to solve these problems. Our approach isbased on interior point methods [23,24], which are particularlywell adapted for the solution of problems with a large number ofinequalities. Other solvers dedicated to the solution of nonlinearoptimization problems can also be used.

4. Pocket milling application

Our toolpath computationmethod is dedicated to the improve-ment of the machining time of pockets. Therefore, it is interesting

Page 7: Pocketing tool path computation using optimization method

Author's personal copy

M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109 1105

Table 1Characteristics of machine tools.Characteristic KX15 TRIPTEOR

Mechanical architecture Serial kinematic machine Parallel kinematic machineAcceleration (m/s2) 3 2.5Jerk (m/s3) 30 40Numerical control unit SIEMENS SINUMERIK 840D SIEMENS SINUMERIK 840DSoftware version 6.3 6.5

180

90

Fig. 8. Geometry of the first pocket. Dimensions are in mm.

2468282

90

123 41

41

41

Fig. 9. Geometry of the second pocket. Dimensions are in mm.

to evaluate the benefits generated by this method in some cases.In the first, the influence of our computation method is illustratedin the case of a right-angle corner crossing. Machining times andreal feedrates are measured for the three optimization criteria. Inthe second, two pockets are tested (Figs. 8 and 9) on two machinetools. The tool diameter is chosen as large as possible to fulfill thegeometry of the corners of the pocket (diameters equal to 16 mmfor pocket 1 and 10 mm for pocket 2). The distance between cut-ting passes (dp) is fixed to 8 mm for pocket 1 and 6 mm for pocket2. The maximal distance between cutting passes (dpmax) is set to10 mm for pocket 1 and 8 mm for pocket 2.

In each case, the realmachining time and feedrate aremeasuredby the NCU. Characteristics of the two machine tools are listedin Table 1. The programmed feedrate for each test is equal to20 m/min. Three types of description format of the toolpaths areused:• a linear interpolation format composed of straight lines

computed by CAM software (named G1 on tests),• a native polynomial interpolation format composed of B-splines

of degree 3 calculated by CAM software (named NURBS ontests), and

• a polynomial interpolation format composed of curves calcu-lated by the compressor of the NCU (named CD on tests) if thetoolpaths are initially described by straight lines and circle arcs.This interpolation is obtained with the ‘‘COMPCAD R�’’ optionof the NCU and is checked by a tolerance parameter equal to0.02 mm in our tests.

Fig. 10. Theoretical curvature of the computed toolpaths.

4.1. Right-angle corner crossing

Our first test deals with the crossing of a right-angle corner.The offset curve is composed of three points (0, 0), (100, 0), and(100, 100), with a control rail half-width δ = 1 mm. The toolpathis described by a B-spline curve of degree 3 with n = 6 controlpoints. The solutions of the three optimization problems Pa, Pξ ,and Pκ , respectively namedACCEL, SCURVE, and CURVE, are tested.The knot sequence and control points of the three toolpaths arepresented in Table 2.

The value of fκ for each problem (Pa, Pξ , and Pκ ) obtainedwith our optimization method is given in Table 3. As expected,the value decreases successively. This reinforces our resolutionstrategy that consists in solving first Pa, then Pξ , and finally Pκ .The geometries of the three toolpaths being visually identical,the theoretical curvature profiles are presented in Fig. 10. Threeobservations can be made.

• The three curvatures profiles are symmetric. This is coherentwith the geometry of the offset curve.

• At the beginning and the end of the curves, the curvature ofthe ACCEL and CURVE toolpaths is nearly zero. In contrast, thecurvature of the SCURVE toolpath becomes slightly negativebefore t = 0.2 and after t = 0.8. The simplified curvaturecriterion may increase the toolpath length.

• The curvature is always positive between t = 0.2 and t =0.8 for the ACCEL and SCURVE toolpaths whereas it becomesslightly negative near t = 0.35 and t = 0.65 for the CURVEtoolpath. The real curvature criterion may produce oscillationsalong the straight lines.

The real feedrate for each toolpath is now measured (Fig. 11).A comparison is made with the toolpath that describes theright-angle offset curve. Each toolpath computed by optimizationproduces lowermachining time than the one obtainedby followingthe right-angle corner. The benefit goes from 2% to 8% (Table 4).These gains are small because 95% of the toolpath is composed

Page 8: Pocketing tool path computation using optimization method

Author's personal copy

1106 M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109

Table 2Computed control points and knot sequence.

Knot sequence {0, 0, 0, 0, 0.3333, 0.6667, 1, 1, 1, 1}Control points ACCEL SCURVE CURVE

(1, 0) (−0.9999, 0) (0.9999, 0)(0.9288, 32.0968) (2.605, 18.9495) (0.9966, 0.3123)(−1.6905, 100.7650) (−1.7062, 101.7374) (−0.0851, 104.4648)(−0.7650, 101.6905) (−1.7375, 101.7062) (−4.5261, 100.1145)(67.9042, 99.0713) (81.0505, 97.3950) (100.1718, 98.9984)(100, 99) (100, 100.9999) (100, 99.0002)

Fig. 11. Practical right-angle feedrate on the TRIPTEOR machine.

Table 3Value of fκ for each problem.

Pa Pξ Pκ

49.02 48.51 40.69

Table 4Comparison of toolpathmethods for the right angle. The toolpath length inmm, themachining time in ms, the average feedrate in mm/min, and the gain in time overCATIA in % are given for the KX15 and TRIPTEOR machines.

Method Length KX15 TRIPTEORTime Feedrate Gain Time Feedrate Gain

CATIA 200 1004 11,950 936 12,820ACCEL 199 928 12,866 7.6 880 13,568 6.0SCURVE 199 980 12,183 2.4 916 13,034 2.1CURVE 199 920 12,978 8.4 912 13,092 2.6

of two straight lines that generate an equal feedrate whateverthe computation method used. Fig. 11 shows that the benefitcomes from a higher feedrate at the corner crossing. Locally, thisis multiplied by 12 compared to the right angle. In conclusion,consistent toolpaths and lower machining times are generated byour computation method.

4.2. Industrial pocket milling

Experiments were realized on the pockets presented in Figs. 8and 9. As shown in Fig. 3, the pocket toolpath is always composedof the following.

• An external cutting pass that generated the boundary of thepocket. This cannot be optimized to ensure a correct machinedpocket.

Table 5Comparison of toolpath methods for the first pocket. The toolpath length in mm,the machining time in ms, the average feedrate in mm/min, and the gain in timeover CATIA NURBS in % are given for the KX15 and TRIPTEOR machines.

Method Length KX15 TRIPTEORTime Feedrate Gain Time Feedrate Gain

CATIA G1 1609 22,560 4279 23,968 4028CATIAG1CD

1606 22,380 4306 22,248 4330

CATIANURBS

1610 19,032 5076 18,312 5275

OPT ACCEL 1473 10,304 8577 45.9 10,880 8123 40.5OPTSCURVE

1493 10,084 8882 47.0 10,968 8167 40.1

OPT CURVE 1497 10,100 8891 46.9 11,140 8062 39.2

• Several internal cutting passes that can be calculated byoptimization.

In our test, one B-spline curve is calculated for all internalcutting passes and toolpath linking. As our method modifies andoptimizes the internal cutting passes, only toolpaths without anexternal pass are considered and studied. Figs. 12 and 13 showcomputed toolpath by the following.

• The pocket milling application of CATIA R�V5R18 CAM softwarewith the HSM option engaged (named CATIA on tests). Thisintroduces corner adaptation at each corner of the toolpath. Theradius value of the corners is chosen equal to 2 mm because itis the higher corner radius that one can build inside the controlrail.

• Our new method proposed in this article, which generates B-spline curves (namedOPTon tests). For each computedpass, thethree proposed criteria of optimization are tested (acceleration,named ACCEL, simplified curvature, named SCURVE, andcurvature, named CURVE).

For each test case, the computing optimization time is lower than30 s for a computerwith a Intel Centrino 2 processor@ 2, 4 GHz. Forpocket 1, the aircut toolpaths of the CATIA toolpath in Fig. 12 aregenerated by the HSM option of the CAM software. The toolpathof pocket 1 is computed with n = 350 control points and an offsetcurve with l = 369 points for the control rail. The solved optimiza-tion problem consists of 700 variables and 257,600 constraints. Forpocket 2, there are n = 600 control points and an offset curve withl = 582 points for the control rail. It generates an optimizationproblem with 1200 variables and 697,200 constraints.

Global results are presented in Tables 5 and 6. The firstconclusion is that our proposed method of toolpath computationby optimization always generates faster toolpaths. The averagefeedrate with our method is approximately equal to 8 m/min forpocket 1 and 10 m/min for pocket 2, whereas those computed byCATIA are respectively equal to 5.3 and 7.0 m/min. The benefitsbrought by our new method are estimated to be 40% for pocket1 and 30% for pocket 2 in comparison to ‘‘CATIA NURBS’’. Thisdifference can be explained by the longer toolpath computed bythe CAM software due to the HSM option for pocket 1.

Page 9: Pocketing tool path computation using optimization method

Author's personal copy

M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109 1107

Fig. 12. Computed toolpaths for the first pocket.

Fig. 13. Computed toolpaths for the second pocket.

Table 6Comparison of toolpathmethods for the second pocket. The toolpath length inmm,the machining time in ms, the average feedrate in mm/min, and the gain in timeover CATIA NURBS in % are given for the KX15 and TRIPTEOR machines.

Method Length KX15 TRIPTEORTime Feedrate Gain Time Feedrate Gain

CATIA G1 2464 24,724 5980 26,048 5676CATIAG1CD

2452 24,624 5976 23,800 6183

CATIANURBS

2466 21,496 6885 20,512 7215

OPT ACCEL 2418 14,016 10,351 34.8 14,480 10020 29.4OPTSCURVE

2457 14,052 10,490 34.6 15,280 9647 25.5

OPT CURVE 2454 15,184 9696 29.4 16,840 8742 17.9

Concerning the cutting forces study, a simulation of the radialdepth of cut is computed using a two-dimensional (2D) cuttingsimulation, as presented in [6]. Since the results are similar for

pocket 1 and pocket 2, only the results for pocket 1 are presented.As shown in Fig. 14, the evolution is not damaged by ourmethod ofcomputation compared to the toolpath obtained by CAM software.For each toolpath, we can see the following:

• 45% is coveredwith a radial depth of cut equal to the distance dpbetween cutting passes programmed (2 mm ≤ ar < 8.1 mm),

• approximately 20% is covered with a radial depth of cutlower than the maximal distance dpmax between cutting passesprogrammed (8.1 mm ≤ ar < 10.5 mm),

• 30% is covered with a radial depth of cut equal to the tooldiameter (ar ≥ 10.5mm); this part of the toolpath correspondsto the external passe of the pocket which is machined first withfull materiel engagement, and

• the remaining percentage corresponds to a very light load of thetool (ar < 2 mm).The comparison of machining times and average feedrates

from all toolpaths shows that the benefits generated by the three

Page 10: Pocketing tool path computation using optimization method

Author's personal copy

1108 M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109

Fig. 14. Radial depth of cut.

optimization criteria are similar. Consequently, the accelerationcriterion seems to be the more efficient for our problem due to itsconvexity, which implies fast and robust computation.

5. Conclusion

This article presents a new method of toolpath computationusing an optimization method dedicated to the milling of pockets.As the objective of a pocket toolpath is to remove all materialinside a boundary and as the process constraints consist in onlyrespecting geometrical specifications and maximal cutting forces,a free area for each cutting pass can be defined. This is based onan offset curve to the boundary, controlled by two parameters,named dp and dpmax. It is called the control rail, and an infinitenumber of toolpaths inside can be computed to mill the pocket.A method based on an optimization that computes a fast toolpathinside this area is proposed. The optimization is constructed withthe objective of minimizing a geometrical criterion (acceleration,simplified curvature, or real curvature) and generating a minimalmachining time.

Since the input of our optimization problem is the controlrail described by an offset curve and a width, the method canbe extended to the machining of pockets with islands and theroughing of parts. Experiments show that the method is viable,robust, and fast. Benefits are estimated to be between 20% and 40%,depending on the machine and the geometry of the pocket.

Contrary to our expectations, the initial geometrical criterion(the real curvature) does not always generate the fastest toolpathcompared to the other criteria. This can be explained by thecriterion complexity, which creates numerical difficulties forthe optimization process. Moreover, the nonconvexity of thiscriterion implies that the solution obtained is not necessarilythe global optimum. Further work will be done in order to

improve the problem solution with the introduction of a newdedicated criterion and better constraint modeling. Finally, ouroptimization method could be extended to other methods such asthe interpolation of cloud points.

Acknowledgments

The authors gratefully acknowledge the LaMI laboratory ofIFMA for the use of their machines. The authors would alsogive thanks to S. Pateloup for the time taken to perform theexperiments.

References

[1] Hatna A, Grieve RJ, Brommhead P. Automatic cncmilling of pockets: geometricand technological issues. Computer Integrated Manufacturing Systems 1998;11(4):309–30.

[2] Kim BH, Choi BK.Machining efficiency comparison direction-parallel tool pathwith contour-parallel tool path. Computer-Aided Design 2002;34(2):89–95.

[3] Held M. Voronoi diagrams and offset curves of curvilinear polygons.Computer-Aided Design 1998;30(4):287–300. Computational Geometry andComputer-Aided Design and Manufacturing..

[4] KimDS. Polygon offsetting using aVoronoi diagramand two stacks. Computer-Aided Design 1998;30(14):1069–76.

[5] Choi BK, Park SC. A pair-wise offset algorithm for 2d point-sequence curve.Computer-Aided Design 1999;31(12):735–45.

[6] Choi BK, KimBH. Die-cavity pocketing via cutting simulation. Computer-AidedDesign 1997;29(12):837–46.

[7] Molina-Carmona R, Jimeno A, Davia M. Contour pocketing computationusing mathematical morphology. The International Journal of AdvancedManufacturing Technology 2008;36(3):334–42.

[8] Pateloup V, Duc E, Ray P. Corner optimization for pocket machining.International Journal of Machine Tools and Manufacture 2004;44(12–13):1343–53.

[9] Pateloup V, Duc E, Ray P. B-spline approximation of circle arc and straight linefor pocket machining. Computer-Aided Design 2010;42(9):817–27.

[10] Park SC, Chung YC. Offset tool-path linking for pocket machining. Computer-Aided Design 2002;34(4):299–308.

Page 11: Pocketing tool path computation using optimization method

Author's personal copy

M. Bouard et al. / Computer-Aided Design 43 (2011) 1099–1109 1109

[11] Held M. A geometry-based investigation of the tool path generationfor zigzag pocket machining. The Visual Computer 1991;7:296–308.10.1007/BF01905694.

[12] Vosniakos G, Papapanagiotou P. Multiple tool path planning for nc machiningof convex pockets without islands. Robotics and Computer-IntegratedManufacturing 2000;16(6):425–35.

[13] Park SC, Choi BK. Uncut free pocketing tool-paths generation using pair-wiseoffset algorithm. Computer-Aided Design 2001;33(10):739–46.

[14] Wong TN,WongKW.Nc toolpath generation for arbitrary pocketswith islands.The International Journal of Advanced Manufacturing Technology 1996;12:174–9.

[15] Castagnetti C, Duc E, Ray P. The domain of admissible orientation concept:a new method for five-axis tool path optimisation. Computer-Aided Design2008;40(9):938–50.

[16] Bearee R, Barre PJ, Bloch S. Influence of high-speed machine tool controlparameters on the contouring accuracy. Application to linear and circularinterpolation. Journal of Intelligent and Robotic Systems 2004;40(3):321–42.

[17] Held M, Spielberger C. A smooth spiral tool path for high speed machining of2d pockets. Computer-Aided Design 2009;41(7):539–50.

[18] Bieterman MB, Sandstrom DR. A curvilinear tool-path method for pocketmachining. Journal of Manufacturing Science and Engineering 2003;125(4):709–15.

[19] Wang H, Jang P, Stori JA. A metric-based approach to two-dimensional (2D)tool-path optimization for high-speed machining. Journal of ManufacturingScience and Engineering 2005;127(1):33.

[20] Kloypayan J, Lee YS. Material engagement analysis of different endmills foradaptive feedrate control in milling processes. Computers in Industry 2002;47(1):55–76.

[21] Ye J, Qu R. Fairing of parametric cubic splines. Mathematical and ComputerModelling 1999;30(5-6):121–31.

[22] Wolberg G, Alfy I. An energy-minimization framework for monotonic cubicspline interpolation. Journal of Computational andAppliedMathematics 2002;143(2):145–88.

[23] Armand P, Benoist J, OrbanD. Dynamic updates of the barrier parameter in pri-mal–dual methods for nonlinear programming. Computational Optimizationand Applications 2008;41(1):1–25.

[24] Armand P, Benoist J. A local convergence property of primal–dual methodsfor nonlinear programming. Mathematical Programming 2008;115(2, Ser. A):199–222.