A new approach to generating arc length ...

11 downloads 0 Views 3MB Size Report
gouge-and-interference free, arc length parameterized. NURBS CL paths and its advantages over a major CAD/. CAM software, CATIA V5, the new approach is ...
Int J Adv Manuf Technol DOI 10.1007/s00170-013-5411-1

ORIGINAL ARTICLE

A new approach to generating arc length parameterized NURBS tool paths for efficient three-axis machining of smooth, accurate sculptured surfaces Zezhong C. Chen & Maqsood A. Khan

Received: 24 April 2013 / Accepted: 4 October 2013 # Springer-Verlag London 2013

Abstract With the development of a new function of computer numerical control controllers, nonuniform rational Bspline (NURBS) interpolation, NURBS tool path generation for sculptured surface machining is under extensive research. The common procedures of the current NURBS tool path planning methods are as follows: first, to find a group of cutter contact points on a sculptured surface; second, to calculate their corresponding cutter locations (CLs); then, to fit a NURBS tool path to the CLs within a prescribed tolerance; and finally, to inspect the tool path for possible gouge by the tool and delete the invalid path segments, if any. However, the NURBS tool path has the following problems: (a) although it passes through the discrete CLs of the theoretical CL path, the deviation along the two paths could be larger than the tolerance; (b) its parameter is not the arc length of the path; and (c) it is difficult to detect gouge along the NURBS path and to remove the invalid segments from it. Consequently, NURBS tool paths generated with the current methods of commercial computer-aided design/computer-aided manufacturing (CAD/ CAM) software cannot be used to make smooth and accurate surfaces. To address these problems, this work proposes a new approach to generating arc length parameterized NURBS tool paths with high accuracy in terms of the theoretical CL paths and without gouge and interference. Two practical examples in this work clearly demonstrate the feasibility of this approach and the advantages of the generated NURBS tool paths. Therefore, this approach can be implemented into the

Z. C. Chen (*) Department of Mechanical and Industrial Engineering, Concordia University, Montreal, QC H3G 1M8, Canada e-mail: [email protected] M. A. Khan Department of Industrial and Manufacturing Engineering, NED University of Engineering and Technology, Karachi 75270, Pakistan

CAD/CAM software to promote NURBS machining in industry. Keywords NURBS machining . NURBS tool path generation . Sculptured surface machining . Accurate, smooth surface machining

1 Introduction Nonuniform rational B-spline (NURBS) tool paths have already been accepted in industry for machining sculptured surfaces of complicated parts. Compared to conventional linear and circular tool paths, NURBS tool paths [1, 2] have the following advantages: (a) the machined surfaces are smoother, (b) the cutter can move faster with better kinematics, and (c) the numerical control programs are smaller in size. To ensure these advantages, high-quality NURBS tool paths are essential, which should be accurate with deviation from the theoretical cutter location (CL) paths globally bound, be parameterized with the arc length of the paths [3–5], and be free of gouge and interference. However, people often regard that NURBS tool path generation simply is to fit a NURBS curve to a group of discrete CLs. This prevailing opinion is wrong and hinders research on high-quality NURBS tool path generation. Unfortunately, current methods and commercial computer-aided design/computer-aided manufacturing (CAD/CAM) software cannot generate high-quality NURBS tool paths; as a result, NURBS machining is not widely used in industry. Technically, these methods are in a similar procedure: (1) finding a group of cutter contact (CC) points on a sculptured surface according to a tool path planning strategy, (2) calculating their corresponding CLs, (3) fitting a NURBS tool path to the locations within a prescribed tolerance, and (4) inspecting the path for possible gouge and delete the invalid path segments. However, the NURBS path has three major

Int J Adv Manuf Technol

drawbacks: (a) it could largely deviate from the theoretical CL path between the discrete CLs, (b) it is not parameterized with the arc length of the path, and (c) it is difficult to detect gouge along the path and remove the invalid segments from the NURBS path. To find a solution, this study is conducted to review literature on technical articles about NURBS path generation and curve fitting. In the past 10 years, a dozen articles about NURBS CL path generation were published. Lartigue et al. [6] presented a method of generating planar cubic B-spline tool paths for three-axis ball end milling of a smooth free-form surface. Yau and Kuo [7] proposed a post-processing approach to converting G1 tool paths to NURBS tool paths for high-speed contour machining. Langeron et al. [8] developed an approach to generating five-axis NURBS tool paths in the part coordinate system. Zhu et al. [9] provided a method of generating composite B-spline cutter paths on free-form surfaces based on discrete points. Chen and Yang [10, 11] improved a fitting method through rough and fine fitting to a group of sample CLs. Bey et al. [12] generated NURBS tool paths with the minimum number of control points. Lin et al. [13] converted G1/G2 paths to NURBS paths in two steps: (1) dividing the sample CLs according to their geometric shape into several groups and (2) fitting a NURBS tool path to each group of CLs within the prescribed tolerances. Similarly, Li et al. [14] designed a NURBS pre-interpolator to convert G1/G2 tool paths into NURBS tool paths. Shih and Chuang [15] constructed a one-sided polygon to approximate a 2-D NURBS of a part profile, offset the polygon to establish a unilateral tolerance zone, and generated a C1-continuous and interference-free planar NURBS tool path. Lai [16] planned NURBS tool paths by optimizing the offsets of planar NURBS curves. In all, these methods cannot generate high-quality 3-D NURBS tool paths. Now, it is important to emphases that NURBS tool paths are not ordinary NURBS curves; NURBS CL paths should be arc length parameterized NURBS curves that are free of gouge and interference and approximate the entire theoretical CL paths within a prescribed tolerance. The NURBS fitting technique is useful to NURBS tool path generation. A number of articles about this topic are reviewed. Rogers and Fog [17] developed a technique of fitting a constrained B-spline by iteratively modifying the parameter values of a group of given points. Ma and Kruth [18] presented a simple method to assign parameter values to randomly measured points, which are fit with a B-spline curve. Park et al. [19] proposed a method of repetitively fitting B-splines with the same knot vector for an evenly transited Bspline. Borges and Pastva [20] applied Gauss–Newton’s method to minimize the error in fitting a single Bezier segment to a set of ordered points. Park and Lee [21] selected the dominant points among a group of given points, determined the knots with the parameters of the dominant points, and fit a B-spline to the given points. Brujic et al. [22] defined a sparse structure

for the measured points in reverse engineering to reduce computation time and storage in NURBS fitting. These methods are not able to plan NURBS tool paths, but the fitting technique can be adopted in the NURBS path generation. To address the aforementioned problems, a new approach is proposed in this work to generate high-quality NURBS tool paths for high precision and smooth sculptured surfaces in three-axis NURBS machining. Compared to the current methods, this approach is improved in three aspects: (1) gouge-and-interference detection is carried out before computing NURBS paths, (2) NURBS paths are accurately parameterized with the arc length, and (3) NURBS paths are in good agreement with the theoretical CL paths everywhere. In this paper, first, the arc length parameterized NURBS tool paths are introduced in Section 2. Second, the theoretical CL path is defined and sample CLs and their arc lengths are computed in Section 3. Third, gouge-and-interference detection is applied to the discrete CLs to eliminate the invalid CLs in Section 4. Then, a NURBS curve is fit to the sample CLs with the parameterization and path errors globally bounded in Section 5. Finally, two practical examples are provided to demonstrate the advantages of this approach in Section 6.

2 Properties of arc length parameterized NURBS CL paths 2.1 Arc length parameter The main objective of the NURBS interpolator in computer numerical control (CNC) controllers is to machine smooth and accurate curved surfaces. To carry out NURBS machining, NURBS tool paths represented in a simple equation, including control points and their weights, a knot vector, and the basis function order, are fed into the CNC controllers. Figure 1 shows an end mill cutting a sculptured surface along a

Fig. 1 Illustration of a NURBS CL path and a CC path in a sculptured surface machining

Int J Adv Manuf Technol

NURBS CL path; its control points and some CC points of the CC path are plotted in this diagram. Then, the NURBS interpolator calculates instantaneous tool locations in real time to ensure that the tool trajectory follows the NURBS path with high accuracy and drives the tool to move in the prescribed velocity (or feed rate). It is well known that, if a NURBS tool path is parameterized with its arc length, the existing NURBS interpolator can easily generate a tool trajectory in good agreement with the NURBS tool path and ensure good tool kinematics in high-speed machining. Although many researchers are developing advanced NUBRS interpolation algorithms to handle non-arc length parameterized NURBS tool paths, we focus on planning arc length parameterized NURBS tool paths, which is an effective solution to the existing problems of the NURBS interpolation. 2.2 Accurate approximation to theoretical CL paths The arc length parameterized NURBS CL paths generated with our approach are essentially different from the conventional non-arc length parameterized NURBS paths generated with the current methods. A conventional NURBS path is attained by fitting a group of CLs sampled from the theoretical CL path, in which the deviation between the path and the CLs is minimized. However, the overall differences between the path and the theoretical CL path cannot be warranted to be less than the tolerance. In this work, for an arc length parameterized NURBS CL path, the maximum deviation between this path and the theoretical CL path should be within the prescribed tolerance. Therefore, it is accurate approximation to the theoretical CL path. Unfortunately, the existent methods of generating NURBS paths cannot be used to calculate arc length parameterized NURBS CL paths.

Fig. 2 Illustration of a conventional linear (G1) CL path for milling a sculptured surface

kinematics along a NURBS CL path is better than that along a linear CL path. To attain valid tool paths, gouge-and-interference detection should be conducted; for linear paths, it is conducted after the paths are computed, while for NURBS paths, it should be conducted before the paths are generated. However, the current methods generate NURBS paths before the detection or without detection. This is a main drawback of the methods. Our work generates a NURBS CL path in the following four steps. First, a group of CC points on the surface are calculated, according to a tool path planning strategy (see Fig. 2). Second, based on the CC points, the corresponding CLs are computed. Third, gouge-and-interference detection is carried out at the CLs and the invalid CLs are deleted. Fourth, an arc length parameterized NURBS path is fit to the valid CLs. However, if the third and fourth steps are switched over, the calculated NURBS path could cause gouge or interference in some segments, and it is difficult to remove the invalid segments from the NURBS path. Therefore, this new procedure of generating NURBS paths is a contribution of this work.

2.3 Smooth paths without gouge and interference It is evident that the arc length parameterized NURBS CL paths are better than the conventional linear CL paths in cutting free-form curves and surfaces. A linear CL path is represented with the polygon of sampled CLs (see Fig. 2). Due to frequent change of the tool feed direction along a linear CL path, the tool feed rate cannot reach very high. In comparison, NURBS CL paths are smoother and the tool

3 Theoretical CL paths and arc length calculation 3.1 Theoretical cutter contact paths NURBS surface is a major CAD model to represent sculptured parts, and its simple form is the B-spline surface, which is defined [16] as:

2

3 Mv Mu X xS ðu; vÞ X   Sðu; vÞ ¼ 4 yS ðu; vÞ 5 :¼ Ni;K ðuÞ⋅N j;L ðvÞ⋅Pi; j ; u∈½umin ; umax ; v∈½vmin ; vmax ; i¼0 j¼0 zS ðu; vÞ

where P i ,j is the control point, u and v are parameters, a n d Ni;K ðuÞ a n d N j;L ðvÞ a r e b l e n d i n g f u n c t i o n s

ð1Þ

with orders of K and L, respectively. The first derivatives of the surface in terms of u and v are

Int J Adv Manuf Technol

T ∂xS ðu; vÞ ∂yS ðu; vÞ ∂zS ðu; vÞ a n d ∂Sðu;vÞ ¼ ∂u ∂u ∂u ∂v  T ∂xS ðu; vÞ ∂yS ðu; vÞ ∂zS ðu; vÞ , respectively. The second ∂v ∂v ∂v

∂Sðu;vÞ ∂u



¼

a

2

Þ derivatives of the surface in terms of u and v are ∂ S∂uðu;v ¼ 2  2  T 2 2 2 ∂ xS ðu; vÞ ∂ yS ðu; vÞ ∂ zS ðu; vÞ Þ a n d ∂ S∂vðu;v ¼ 2 2 2 2 ∂u ∂u ∂u  T ∂2 xS ðu; vÞ ∂2 yS ðu; vÞ ∂2 zS ðu; vÞ , respectively. Ac∂v2 ∂v2 ∂v2 cording to the differential geometry theory about surfaces [23], the components of the first fundamental matrix of the h iT h i ðu;vÞ ðu;vÞ surface are defined as E :¼ ∂S∂u ⋅ ∂S∂u , F :¼ h iT h i h iT h i ∂Sðu;vÞ ðu;vÞ ðu;vÞ ðu;vÞ ⋅ ∂S∂v ⋅ ∂S∂v , and G :¼ ∂S∂v . Thus, the ∂u

b

first derivatives of E, F, and G in terms of u are:     ∂E ∂Sðu; vÞ T ∂2 Sðu; vÞ ¼ 2⋅ ⋅ ; ∂u ∂u ∂u2

ð2Þ

        ∂F ∂Sðu; vÞ T ∂2 Sðu; vÞ ∂Sðu; vÞ T ∂2 Sðu; vÞ ¼ ; ð3Þ ⋅ ⋅ þ ∂u ∂v ∂u2 ∂u ∂u⋅∂v

and     ∂G ∂Sðu; vÞ T ∂2 Sðu; vÞ ¼ 2⋅ ⋅ ; ∂u ∂v ∂u⋅∂v

ð4Þ

respectively. The first derivatives of E, F, and G in terms of v are:     ∂E ∂Sðu; vÞ T ∂2 Sðu; vÞ ¼ 2⋅ ⋅ ; ∂v ∂u ∂u⋅∂v

ð5Þ

        ∂F ∂Sðu; vÞ T ∂2 Sðu; vÞ ∂Sðu; vÞ T ∂2 Sðu; vÞ ¼ þ ⋅ ⋅ ; ð6Þ ∂v ∂v ∂u⋅∂v ∂u ∂v2

and     ∂G ∂Sðu; vÞ T ∂2 Sðu; vÞ ¼ 2⋅ ⋅ ; ∂v ∂v ∂v2

Fig. 3 a A group of CC points determined with a machining strategy and a theoretical CC path on the sculptured surface, b the points in the parametric space corresponding to the CC points and a curve fit to these points

respectively. By using the least squares method, a polynomial with a parametric t, e.g., a cubic B-spline curve, is fit to the points and can be found as: 

ð7Þ

respectively. By applying a tool path planning strategy, a number MCC of CC points, CC 1, CC 2, …, and CCMCC , on the surface can be calculated for a tool path as: CC1 :¼ Sðu1 ; v1 Þ; CC2 :¼ Sðu2 ; v2 Þ; …; and SMCC :¼ SðuM CC ; vM CC Þ:

The CC path is the polygon connecting the CC points, and the theoretical CC path CC (t ) is a smooth curve with a parameter t, passing through the CC points and on the surface (see Fig. 3a). Given the CC points, the theoretical CC path can be easily found. First, the CC points are mapped to points in the parametric space u–v of the surface (see Fig. 3b). The coordinates of these points CC1 , CC2 , …, CCMCC are [u 1,   v 1], [u 2, v 2], …, uMCC ; vMCC in the parametric space,

CCðtÞ :¼

 uðtÞ ; t∈½tmin ; tmax : vð t Þ

ðtÞ The first derivative of this curve is dCC dt ¼

ð8Þ

h

duðtÞ dvðtÞ dt ; dt

iT

.

By substituting Eq. 8 into Eq. 1, the theoretical CC path is formulated as: 2

3 2 3 xCC ðtÞ xS ðuðtÞ; vðtÞÞ CCðtÞ ¼ 4 yCC ðtÞ 5 ¼ 4 yS ðuðtÞ; vðtÞÞ 5; t∈½tmin ; tmax : ð9Þ zCC ðtÞ zS ðuðtÞ; vðtÞÞ

3.2 Formula of the theoretical CL paths for fillet end mills Since the fillet (or bullnose) end mill is the generic shape of end mills, the theoretical CL path and its arc length equations

Int J Adv Manuf Technol

are derived here for this type of cutter, which can also be applied to ball and flat end mills directly. According to Eq. 9 of the theoretical CC path CC (t ), its corresponding theoretical CL path for a fillet end mill is formulated, and some equations are prepared for calculating the arc length of this CL path afterward. In this work, the end mill’s radius is denoted as RT and its fillet (or corner) radius as R F . Based on the sculptured

surface equation, Eq. 1, its unit normal vector is represented as: 2

3   xn ðu; vÞ  − 1 ∂Sðu; vÞ ∂Sðu; vÞ 4  : ð10Þ nðu; vÞ ¼ yn ðu; vÞ 5 ¼ E⋅G− F2 2 ⋅ ∂u ∂v zn ðu; vÞ

Then, the equations of the first derivatives of the unit normal vector in terms of u and v are:

  − 1 ∂2 Sðu; vÞ ∂Sðu; vÞ ∂Sðu; vÞ ∂2 Sðu; vÞ ∂nðu; vÞ  ¼ E⋅G−F2 2 ⋅ þ   − ∂u ∂u2 ∂v ∂u ∂u⋅∂v  − 3    E⋅G−F2 2 ∂E ∂G ∂F ∂Sðu; vÞ ∂Sðu; vÞ  ⋅ G⋅ þ E⋅ −2⋅ F⋅ ⋅ ∂u ∂u ∂u ∂u ∂v 2

ð11Þ

and    1 2 ∂nðu; vÞ  ∂Sðu; vÞ ∂Sðu; vÞ ∂2 Sðu; vÞ 2 − 2 ∂ Sðu; vÞ ¼ E⋅G−F  þ  ⋅ − ∂v ∂u⋅∂v ∂v ∂u ∂v2 3      − E⋅G−F2 2 ∂E ∂G ∂F ∂Sðu; vÞ ∂Sðu; vÞ  ⋅ G⋅ þ E⋅ −2⋅ F⋅ ⋅ ; ∂v ∂v ∂v ∂u ∂v 2

respectively. It is evident that the unit vector of the tool axis a 1 is a1 :¼ ½ 0 0 1 T . Besides, a constant matrix a 2 is set as: 2

1 a2 :¼ 4 0 0

0 1 0

3 0 0 5; 0

2

3 xCL ðu; vÞ 4 CLðu; vÞ ¼ yCL ðu; vÞ 5 :¼ CCðu; vÞ þ R F ⋅½nðu; vÞ−a1  þ ðRT −R F Þ⋅bðu; vÞ: zCL ðu; vÞ

ð16Þ Meanwhile, the equations of the first derivatives of CL (u, v) in terms of u and v are found as

and a vector b (u, v) used to compute the CL point is defined as: 3 xb ðu; vÞ  − 1 bðu; vÞ ¼ 4 yb ðu; vÞ 5 :¼ nT ⋅a2 ⋅n 2 ⋅ða2 ⋅nÞ: zb ðu; vÞ

ð12Þ

2

∂CLðu; vÞ ∂Sðu; vÞ ∂nðu; vÞ ∂bðu; vÞ ¼ þ R F⋅ þ ðRT −R F Þ⋅ ∂u ∂u ∂u ∂u

ð17Þ

and ð13Þ

The first derivatives of b(u, v) in terms of u and v can be formulated as   − 1 − 3 ∂bðu; vÞ  T ∂n  T ∂n ¼ n ⋅a2 ⋅n 2 ⋅ a2 ⋅ − n ⋅a2 ⋅n 2 nT ⋅a2 ⋅ ⋅ða2 ⋅nÞ ∂u ∂u ∂u

ð14Þ

∂CLðu; vÞ ∂Sðu; vÞ ∂nðu; vÞ ∂bðu; vÞ ¼ þ R F⋅ þ ðRT −R F Þ⋅ ; ∂v ∂v ∂v ∂v

ð18Þ

respectively. According to Eqs. 8 and 16, the formula of the theoretical CL path is attained as: 2

3 xCL ðuðtÞ; vðtÞÞ CLðtÞ :¼ 4 yCL ðuðtÞ; vðtÞÞ 5; zCL ðuðtÞ; vðtÞÞ

t∈½tmin ; tmax :

ð19Þ

and   − 1 − 3 ∂bðu; vÞ  T ∂n  T ∂n ¼ n ⋅a2 ⋅n 2 ⋅ a2 ⋅ − n ⋅a2 ⋅n 2 nT ⋅a2 ⋅ ⋅ða2 ⋅nÞ ∂v ∂v ∂v

ð15Þ respectively. Therefore, the equation for calculating CLs for the fillet end mill is derived as:

Figure 4 exemplifies a theoretical CL path and its relevant theoretical CC path. Eqs. 11, 12, 14, 15, 17, and 18 will be used to calculate the arc length of any point on the theoretical CL path in the next section. This path is a critical reference for generating its NURBS representation because the overall differences between the NURBS path and the reference can be controlled within the tolerance. Unfortunately, what people

Int J Adv Manuf Technol

where

∂CLðu;vÞ and ∂CL∂vðu;vÞ have been found in Eqs. 17 and ∂u duðtÞ dvðtÞ dt and dt have been found in Eq. 8. Hence, the arc

18 and length of a CL with parameter t can be calculated as:

Zt

dCLðtÞ



lðtÞ :¼

dt ⋅dt;

t∈½tmin ; tmax :

ð20Þ

tmin

To calculate the true arc lengths of the sample CLs, the adaptive Simpson’s quadrature method is applied to Eq. 20. After the sample CLs and their arc lengths are computed,

Fig. 4 A theoretical CL path determined with a theoretical CC path on a sculptured surface

a

are currently doing is to calculate a group of discrete CLs and fit a NURBS path to them. In this way, the NURBS path is close to the theoretical CL path at these CLs; however, it could deviate from the theoretical path between the CLs and could be larger than the prescribed tolerance. 3.3 CLs sampling and their arc lengths calculation In this work, by using Eq. 19, the number MCL of CLs can be sampled along the theoretical CL path, CL 1:=CL (u (t 1), v (t )), CL : = CL (u (t 2 ), v (t 2 )), …, and CLMCL :¼ CL  1  2  (see Fig. 5). In order to generate an arc u tMCL ; v tMCL length parameterized path, it is necessary to calculate the true arc lengths of the sample CLs. Thus, the equation of the first derivative of the theoretical CL path in Eq. 19 in terms of t has to be found as follows: dCLðtÞ ∂CLðu; vÞ duðtÞ ∂CLðu; vÞ dvðtÞ ¼ ⋅ þ ⋅ ; dt ∂u dt ∂v dt

ð19Þ

Fig. 5 Sampling a group of CLs of the theoretical CL path and calculating their arc lengths

b

Fig. 6 a The tool locally gouges the part surface while cutting it at a CC point, b the tool globally interferes with the part

Int J Adv Manuf Technol

gouge-and-interference detection should be conducted at these CLs in order to eliminate defective CLs and regroup sample CLs before an initial NURBS CL path is fit to each group of valid sample CLs.

4 Gouge-and-interference detection for valid sample CLs In sculptured surface machining, cutters are prone to gouge and interfere with the surfaces due to their complex geometric shape. Figure 6a, b shows a tool gouging and interfering with a part, respectively. Thus, it is important to detect the tool’s potential gouging and interfering with the part in NURBS tool path planning. If an end mill could overcut a surface while moving along a NURBS path, the gouging path segments are invalid. Then, the NURBS path has to be split between the gouging and the non-gouging segments, and the gouging segment should be removed, which is illustrated in Fig. 7. However, splitting the NURBS path is difficult, and the current NURBS path generation methods cannot solve this problem well. To address this problem, a new approach is proposed in this work. A number of CC points of the theoretical CC path are sampled, and their corresponding CL points are calculated. Then, gouge and interference are checked at these CLs; the defective CLs are eliminated, and the valid consecutive CLs are grouped. Finally, each group of CLs is fit with a NURBS path, which is free of gouge and interference.

current CAD/CAM software. Although they are continuously improved by taking advantage of the latest computer graphics techniques, their methodology is mainly based on simple, arduous geometric operations, such as Boolean operations and polygon intersection. With the industrial demand for higher part precision, the perceivable and common weakness of the methods is that it often takes a long time to detect the defects and the methods could cause memory overflow, freezing the computer. To find an effective solution, a new and comprehensive optimization model of gouge-andinterference detection is established in this section; the detection is more precise and efficient. Specifically, in this comprehensive model, the geometry of the whole tooling system and the part geometry are considered. The tooling system includes the automatically programmed tool (APT) cutter’s cutting edges, its shank, and the tool holder, and the part includes the sculptured surface and its surroundings. Thus, the profile of the tooling system is constructed with six segments, A–B (the bottom cutting edge), B–C (the fillet), C–D (a side cutting edge), D–E (a side cutting edge and the shank), E–F (the tool holder), and F–G (the tool holder). In Fig. 8, the profile with the parameters as α ,

4.1 A comprehensive optimization model of gouge-and-interference detection To detect the cutter’s gouging and interference with the part’s surfaces, including the sculptured surface and its surroundings, computer graphics methods dominate in

Fig. 7 A NURBS CL path with a segment where the tool gouges the sculptured surface

Fig. 8 The profile of the tooling system including the APT cutter and the tool holder

Int J Adv Manuf Technol

β , γ , RF, RT, RH, LT, LS, and LH are defined in the cutter coordinate system r−O−h . Ball, flat, and fillet end mills are special cases of the APT cutter. For ball end mills, α =β =0 and R F ¼ RT ; for flat end mills, α =β =0 and R F ¼ 0 ; and for fillet end mills, α =β =0 and 0 < R F < RT . For a general APT cutter, α ≠β ≠0; thus, AB and CD can be found as: AB ¼

1 ⋅½R F ⋅sinðα þ β Þ þ RT ⋅cosβ−R F −LT ⋅sinβ þ LS ⋅sinβ  cosðα þ β Þ

and CD ¼

respectively. The heights of the turning points of the profile can be found accordingly as follows: HB ¼ AB⋅sinα , HC ¼ LT −LS −CD⋅cosβ , HD ¼ LT −LS , HE ¼ LT , H −RT H F ¼ HE þ Rtanγ , and HG ¼ LT þ LH . The relationship between the height and the radius of the profile point is represented as:

8 0; > > > h > > ; > > > tanα qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi > > > > < AB⋅cosα−R F ⋅sinα þ R2F −ðR F ⋅cosα−h þ AB⋅sinαÞ2 ; rðhÞ ¼ RT − ðLT −LS −hÞ ⋅ tan β ; > > > RT ; > > > > RT þðh−LT Þ ⋅ tan γ ; > > > > > : RH ; RH ;

This relationship is used to check whether or not the surface point under inspection is within the tooling system when the tool is at a CL of the NURBS path. Geometrically, when the cutter gouges or collides with the part surfaces at a CL, at least one point on the part is within the revolving surface of the cutting system profile (see Fig. 8). In the other words, the distance between this point and the cutter axis is less than the profile radius at the height of the point. Figure 6 demonstrates the geometric relationship between the cutter and the part for the cutter gouging and interfering the part. Thus, the corresponding optimization objective is to minimize the difference between the distance to the cutter axis and the cutting system profile radius of all part points. Suppose the tip A of the APT cutter is at a CL in three-axis milling and the coordinate of the CL point is ½xCL ; yCL ; zCL T . For any point ½x; y; zT on the part surfaces {S, S 1, ⋯, S i , ⋯}, the distance between the point and the cutter axis is ðx−xCL Þ2 þ ðy−yCL Þ2 . Thus, the objective function is represented as: Minimize f ¼ ðx−xCL Þ2 þ ðy−yCL Þ2 −½rðz−zCL Þ2 ;

ð22Þ

and Subject to : ½x; y; zT ∈fS; S1 ; ⋯; Si ; ⋯g and Eq. 21. If the minimum of f is >0, the surface is not within the volume of the tooling system, so the tool will not gouge and interfere with the part. However, if the minimum is negative, the cutter will overcut the part and damage the part. Since this is a global optimization problem, solving it using the conventional method takes a long time. In this work, the hybrid optimization method is employed, and the result is very satisfactory.

1 ⋅½R F ⋅sinðα þ β Þ−RT ⋅sinα−R F þ LT ⋅cosα−LS ⋅cosα; cosðα þ βÞ

ð h < 0Þ ð0 ≤ h < HB Þ ðH B ≤ h < H C Þ ðH C ≤ h < H D Þ : ðHD ≤ h < HE Þ ðHE ≤h < H F Þ ðH F ≤ h≤ HG Þ ð H G < hÞ

ð21Þ

4.2 Hybrid optimization method To solve global optimization problems, genetic algorithm, simulate annealing, ant colony, differential evolution, and particle swarm optimization (PSO) are often used. Among them, the PSO method is more popular due to its simple implementation and quick convergence within good accuracy. However, it can take a long time for the PSO to pinpoint the global optimum, if the required accuracy is very high. On the contrary, Newton’s gradient method, a local optimization solver, is able to quickly find the local optimum solution, but is unable to find the global solution. To increase computing efficiency, Chen and Liu [25] proposed the hybrid optimization method that adopts the PSO in the rough search stage and Newton’s gradient method in the fine search stage, in order to take the advantages of the global and local optimization methods. In this work, this method is further improved by using the discrete PSO method. To improve the hybrid optimization method, in the rough search stage, the continuous problem domain is discretized, and the discrete PSO method is then applied. Compared to searching in the continuous domain, the solver can find the pseudo optimum in the discrete domain more efficiently. With the pseudo optimum as the initial point, Newton’s gradient method can accurately pinpoint the solution in a fraction of a second. The details of this method are introduced in our other paper. Figure 9 shows an example of using the improved hybrid optimization method. In this example, a NURBS surface with several local maximums is used. Both the new and

Int J Adv Manuf Technol

the invalid CLs is calculated as well. Then, the invalid CLs are deleted, and the valid CL points are regrouped for generating piecewise NURBS tool paths in the next section.

5 Fitting with error globally bounded for arc length parameterized NURBS CL paths

Fig. 9 Estimation of the global maximum for a NURBS surface with several local maximum

For the valid CLs, by using the least squares method [24], a NURBS path is fit to the CLs, which is simply represented as: 2 3 x ðlÞ nl CL 6 7 X   y ðlÞ 7 ¼ CLðlÞ ¼ 6 Ni;k ðlÞ⋅Pi ; l∈½lmin ; lmax ; ð23Þ 4 CL 5 i¼0 z ðlÞ CL

the PSO methods are applied to find the global maximum value of the surface, and the results are listed in Table 1. The PSO method is used in test 1, and it takes 5.25 s to converge to the solution with an accuracy of 10−4. The new method is used in tests 2 and 3; the discrete PSO method is used in the first step and the gradient method in the second. In test 2, it takes 3.70 s for the discrete PSO method to converge to a solution with an accuracy of 10−2 in the first step and 0.19 s for the gradient method to converge to the solution with an accuracy of 10−4 in the second step. In test 3, it takes 1.65 s for the discrete PSO method to converge to a solution with an accuracy of 10−1 in the first step and 0.39 s for the gradient method to converge to the solution with an accuracy of 10−4 in the second step. It is evident that the improved hybrid method is much more efficient in solving this problem with the same accuracy, compared to the PSO method. Therefore, the improved hybrid method is employed to the optimization model of gouge-and-interference detection. To generate a theoretical CL path, a group of discrete CLs are calculated. By applying the new method of detecting gouge and interference at these CLs, the CLs are inspected for validity. Meanwhile, the critical CL between the valid and Table 1 Comparison between the improved hybrid optimization and the PSO methods PSO Improved hybrid optimization method

Accuracy Iteration no. Time (s) Total time (s) Improvement

Test Test 2 1 Discrete Gradient PSO method method

Test 3

10−4 109 5.25 5.25

10−1 34 1.6509 2.0501 60.96 %

10−2 77 3.70 3.89 25.78 %

10−4 2 0.19

Discrete Gradient PSO method method 10−4 4 0.3991

where parameter l is the arc length. In the fitting process, the overall deviation between the NURBS CL path and the theoretical CL path should be less than a prescribed tolerance εpath . As a feature of arc length parameterized NURBS paths, the first derivative of the path in terms of the arc length parameter should be unity. Hence, the difference between the magnitude of the first derivative and one should be reduced within a prescribed tolerance tpara in the iterative fitting. Ideally, it is necessary to ensure that the paths deviation and the first derivative non-unity at every point of the paths are less than the tolerances, which means the errors are globally bounded. In this work, an effective way of generating a CL path with the errors globally bounded is to find the maximum errors using the hybrid global optimization method and reduce them within the tolerances. 5.1 NURBS path generation with the parameterization error globally bounded In theory, a genuine arc length parameterized NURBS CL path is characterized with the unity of the first derivative in terms of the arc length parameter, which is represented as: d CLðlÞ ¼ 1: ð24Þ dl However, the NURBS path cannot meet this characteristic equation at the beginning of fitting the CLs with the initial number of control points and the base function order. The control points can be set as 100 and the base function order as 4. The deviation between the first derivative and one is called the parameterization error, which is formulated as: d Δpara ¼ CLðlÞ ð25Þ −1: dl In the iterative fitting process, the NURBS path is modified by changing the number of control points and/or the base

Int J Adv Manuf Technol

function order in order to reduce the parameterization error [24], until it is less than a prescribed tolerance εpara . So, this criterion is represented as: d ≤ 1 þ εpara : CL ð l Þ ð26Þ 1−εpara ≤ dl After an arc length parameterized CL path is generated, all CLs should be checked against the criterion. If all of them are qualified, this CL path is well parameterized with the arc length. Otherwise, the path is improved in a new round of fitting. However, it is not practical to check all CLs on the path. For this purpose, the hybrid optimization method is used to find the maximum parameterization error along the path, which should be less than the tolerance εpara .

intersection between the path and the plane, so the point should meet Eq. 27.  The distance between points  T and ½xCL ðt0 Þ; yCL ðt0 Þ; zCL ðt0 ÞT xCL ðl0 Þ; yCL ðl0 Þ; zCL ðl0 Þ is the error of path CLðlÞ with reference to path CL(t) (see Fig. 10). Upon all CLs of the theoretical path CL (t ), the maximum error of path CLðlÞ can be found in the following optimization model: s ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2  2  2ffi Maximize fðt; lÞ ¼ xCL ðtÞ−x ðlÞ þ yCL ðtÞ−y ðlÞ þ zCL ðtÞ−z ðlÞ ; CL

CL

ð28Þ

5.2 Path error bounded in NURBS path generation For an arc length parameterized NURBS CL path CLðlÞ generated previously, the deviation of the path CLðlÞ compared to the theoretical CL path CL(t) is defined as the path error, and it is mandatory that the path error is within a prescribed tolerance εpath . Mathematically, the path error is defined here. At a point ½xCL ðt0 Þ; yCL ðt0 Þ; zCL ðt0 ÞT of the theoretical NURBS path CL(t), the tangent vector of the path is ½dxCL ðt0 Þ=dt; dyCL ðt0 Þ=dt; dzCL ðt0 Þ=dtT . The equation of a plane perpendicular to the tangent vector and passing through the point is 2

½x y

3 dxCL ðt0 Þ 6 7 dt 6 7 6 dy ðt Þ 7 z :6 CL 0 7 ¼ ½ xCL ðt0 Þ 6 7 4 dz dtðt Þ 5 CL

dt

0

2

yCL ðt0 Þ

3 dxCL ðt0 Þ 6 7 dt 6 7 6 dy ðt Þ 7 zCL ðt0 Þ :6 CL 0 7; 6 7 4 dz dtðt Þ 5 CL

0

dt

ð27Þ where the coordinates ½x; y; zT refer to any point of the plane.  T The point xCL ðl0 Þ; yCL ðl0 Þ; zCL ðl0 Þ on path CLðlÞ is the

Fig. 10 The definition of the NURBS CL path error in terms of the theoretical CL path

CL

Fig. 11 The flowchart of the approach procedure

Int J Adv Manuf Technol

6 The approach procedure With the innovative key techniques for generating NURBS CL paths, the new approach can be easily implemented, and its procedure is clearly shown in the flowchart in Fig. 11.

a

Fig. 12 A sculptured surface with four by four control points

Subject to: t ∊[t min, t max], l ∊[l min, l max], and 3 dxCL ðtÞ 7 6 i 6 dt 7 dyCL ðtÞ 7 z ðlÞ :6 7 ¼ ½ xCL ðtÞ 6 CL 6 dt 7 4 dz ðtÞ 5 2

h

x ðlÞ CL

y ð lÞ CL

CL

3 dxCL ðtÞ 6 dt 7 7 6 6 dy ðtÞ 7 yCL ðtÞ zCL ðtÞ :6 CL 7: 6 dt 7 4 dz ðtÞ 5

dt

2

CL

dt

b

As a criterion of the error-bounded fitting, the maximum path error f max(t *, l *) should be less than the tolerance εpath . So the criterion is represented as:   fmax t* ; l* < εpath :

ð29Þ

Similarly, the hybrid optimization method is used to solve the previously discussed optimization problem for the maximum path error. In the fitting iteration, when the path CLðlÞ meets the criteria of the path and the parameterization errors, the path is a qualified NURBS CL path with the arc length parameter. The path can be fed into the controller of a CNC machine tool to cut the sculptured surface.

c

Arc-length NURBS CL paths

Sculptured surface

Fig. 13 The arc length NURBS CL paths generated with the proposed method

Fig. 14 a An arc length NURBS CL path with five control points, b the path error plot of the path, and c the parameterization error plot of the path

Int J Adv Manuf Technol

Fig. 15 a The NURBS CL paths generated by CATIA, b the nonsmooth NURBS CL paths

7 Applications To demonstrate its effectiveness in generating accurate, gouge-and-interference free, arc length parameterized NURBS CL paths and its advantages over a major CAD/ CAM software, CATIA V5, the new approach is applied to two sculptured surfaces to generate the paths, and then CATIA is used to generate its NURBS CL paths for finish machining of the surfaces. The parts of the two examples are machined on an OKUMA five-axis CNC milling center to verify the surface quality cut with our and CATIA NURBS paths. In the first example, a sculptured surface to be machined is a NURBS surface with four by four control points shown in Fig. 12. A ball end mill of half an inch diameter is used in

Fig. 16 a The sculptured surface cut with our NURBS CL paths, b the sculptured surface cut with the CATIA NURBS CL paths

Fig. 17 A sculptured surface with four by four control points

finish machining. The surface tolerance is 0.01 in. In this approach, the tolerances of the path and the parameterization errors are prescribed as 0.002 in. and 0.01, respectively. Using this new approach, 30 NURBS CL paths are generated for finish machining and are plotted in Fig. 13. These paths are smooth and free of gouge and interference. Their path and parameterization errors are within the tolerances. Among the arc length NURBS CL paths previously generated, a path in the middle is selected and plotted in Fig. 14a. It is evident that the path is smooth. The curves of its path and

Int J Adv Manuf Technol

Fig. 18 Arc length NURBS CL paths generated with our approach

Fig. 20 The NURBS CL paths generated with CATIA

parameterization errors are plotted in Fig. 14b, c. It is clear that all the path errors are