Geometric simulation of locally optimal tool paths in three-axis milling

Márta Szilvási-Nagy, Gyula Mátyási, Szilvia Béla

Department of Geometry,

Budapest University of Technology and Economics

email: szilvasi@math.bme.hu

Department of Manufacturing Science and Technology,

Budapest University of Technology and Economics

email: matyasi@manuf.bme.hu

Department of Geometry,

Budapest University of Technology and Economics

email: belus@math.bme.hu

Abstract. The most important aim in tool path generation methods is to increase the machining efficiency by minimizing the total length of tool paths while the error is kept under a prescribed tolerance. This can be achieved by determining the moving direction of the cutting tool such that the machined stripe is the widest. From a technical point of view it is recommended that the angle between the tool axis and the surface normal does not change too much along the tool path in order to ensure even abrasion of the tool. In this paper a mathematical method for tool path generation in 3-axis milling is presented, which considers these requirements by combining the features of isophotic curves and principal curvatures. It calculates the proposed moving direction of the tool at each point of the surface. The proposed direction depends on the measurement of the tool and on the curvature values of the surface. For triangulated surfaces a new local offset computation method is presented, which is suitable also for detecting tool collision with the target surface and self intersection in the offset mesh.

Key Words: tool path simulation, isophotes, offset, triangular mesh

65D17, 68U20

## 1 Introduction

This paper deals with three-axis milling, and presents computations on triangulated and analytical surfaces for determining the optimal moving direction of the tool at a given point of the surface. Basic requirements, such as the tool does not remove material from the target surface and the error remains under a prescribed tolerance, can be fulfilled by keeping the processed surface between the target (part) surface and its outer parallel (offset) surface at distance of a given tolerance. In the focus of this investigations are two problems of tool path planning; how to compute the offset of the mesh in a neighborhood of the actual point, and how to determine the optimal moving direction at any point of the surface represented by a triangular mesh.

In a short survey mathematical approaches are mentioned dealing with geometrical factors in surface milling. The most frequently used tool path generation methods cut the surface by parallel driving planes in equal intervals or extract isoparametric curves in equally spaced parametric steps. If the surface has regions of different curvatures, both methods lead to uneven distances between tool paths, consequently, to fluctuating errors. The machining error on the processed surface is measured by the height of the cusps (scallops) left between two adjacent tool paths (Fig. 1). Constant scallop height tool path generation methods for ball-end milling of analytical surfaces are described in [29], [8] and [13], however, the required computations are expensive, and some technical questions (i.e. self-intersections) are not solved in all cases. For triangular meshes a constant scallop height method is presented in [15] for computing the distances between slicing planes in three-axis milling with a ball-end cutter.

Improvements of the frequently used isoparametric tool path generation method is suggested by including additional parameter curves in regions where the error is large [7], or by reparametrizing the surface in order to generate boundary-conform tool paths [19]. The boundary is followed by means of proximity maps in [11]. The application of two different tool path generation methods (using parallel driving planes or z-level contour parallel curves) is suggested by splitting the surface into “flat” and “steep” regions according to the angle between the tool axis and the surface normal in [6].

A method for approximating the processed part of the surface around a contact point, for generating the widest stripe along a tool path and for investigating local and global millability with a given cutting tool is presented in [9] and [26]. The condition for collision-free manufacturing is expressed in terms of the curvature indicatrices of the part surface and the tool surface at their touching point. This local millability can be extended to global millability along an isophotic line. The angle between a given direction (the tool axis) and the surface normal does not change along an isophote, consequently the area of the contact surface of the tool is constant, and the abrasion of the tool is even. Isophotes are applied to partition the surface into regions, in which a generic side step (the distance between two neighboring tool paths) can be computed from the prescribed maximal scallop height [5]. Such regions are computed for detection of interference between the surface and the tool (called usually gouging) in [28]. Isophote based tool path generation is proposed in [27] and an application to NC-machining in [10]. A numerical method for computation of isophotic curves on an analytical surface is presented in [17]. Despite of the mentioned advantageous properties of isophotes these curves are not suitable milling paths due to their uneven density causing uncontrollable scallop heights. In general, each set of surface curves fulfills only some conditions for tool paths, but not all at the same time.

Investigation of surface curvatures at the touching point of the target surface and the cutting tool concludes that the most efficient tool feed direction in three-axis milling, which can minimize the total length of necessary tool paths, is the principal direction of the maximal normal curvature [2], [3], [26]. Namely, this “steepest ascending” tool path leaves the widest track (processed stripe) on the machined surface, as also shown in [26]. The same conclusion is formulated in [1], where a torodial shaped cutter is investigated on a four and five axis machine. Vector fields are constructed for the optimal moving direction of the tool in [18]. A more flexible strategy for parallel plane milling considering the surface roughness is presented in [21] by introducing a fitness function proportional to the feed rate and transversal step. Then the acceptable machining directions are computed by optimizing the fitness function.

In surface offsetting algorithms a difficult problem is to detect and to remove self-intersections. For triangulated surfaces different offsetting methods have been published. Faces, edges and vertices are offset using half cylinders and spheres, then gaps are filled with blending methods and overlaps are removed. By slicing this corrected offset triangular mesh with a series of planes three-axis tool paths are calculated [16]. By a local offsetting scheme facets are translated in the normal direction, convex edges to trimmed cylinders and convex vertices to trimmed spheres. Concave edges are removed from offsetting. Then in tool path generation the intersection with a driving plane results in circle arcs and line segments which are sorted and linked, overlapping portions are removed in order to generate a compound curve for cutting path [12], [14]. In a z-level contour tool path generation algorithm the triangulated surface is sectioned by a horizontal drive plane, then at each vertex of the section polygon an offset vector is created. A tool path is generated sequentially along the section polygon while checking and removing intersections and using line fillets to connect offset segments [4]. Each triangle is offset in [20], the sliced segments in the drive plane are swept and chained into monotone polygonal tool paths. A different offsetting method is presented in this paper in Section 2.

In Section 3 tool paths on triangulated surfaces are simulated by moving the tool in principal directions. In Section 4 proposals for optimal moving direction at a given point and its computation on analytical surfaces are presented.

## 2 Mesh offsetting and computing the processed part of the surface at a point

The result of the milling process with ball-end or toroidal tools is an approximation to the target surfaces, where the shape shows scallops (cusps). The maximal height of these scallops has to be kept within a given tolerance, i.e. the machined surface must lie between the target (part) surface and its offset by the given tolerance (Fig. 1). The piece of the tool surface lying in this region will be named contact surface of the tool. The curve of intersection of the tool surface and the offset surface is the boundary of this contact surface. The processed patch around a given touching point of the tool and the target surface is bounded by the projection of this boundary curve onto the part surface. The set of all processed patches should cover the entire part surface. In Fig. 2 a smooth surface, its offset, a touching ball-end tool and the processed patch on the surface are shown.

In order to compute the processed patch at a given point, first the offset surface has to be generated.

In the case, when the surface is represented by a triangular mesh, the offset will be computed in normal planes. Each normal plane passes through the touching point of the tool, through the normal vector of the actual triangle facet containing this point and an arbitrary direction in the plane of the triangle. The offsetting is carried out on the segments intersected by the normal plane from the triangle mesh (Fig. 4). If the th plane intersects the th triangle in the segment , its offset is . Here is the given tolerance, is the normal vector of the th triangle and ( is the inclination angle between the normal vector of the intersected th facet and the th section plane. is shown by a thick segment and is denoted by one arc in Fig. 4). The position vector of a point is denoted by the corresponding boldface letter. In a convex region gaps arise between the offset segments, but in a concave region the adjacent segments intersect. Filling the gaps and removing self-intersections of the offset mesh are carried out by two-dimensional methods in each section plane. The obtained polygonal line intersects the normal section of the tool end in two points, and which are lying on the boundary curve of the contact surface of the tool and the offset mesh (Fig. 4). The projections of and onto the mesh give the endpoints of a diameter of the processed patch. This computation in the normal planes () results in points lying on the boundary curve of the processed patch. In Fig. 5 the part of the offset surface within the ball-end of the tool is shown by 24 diameters above the base triangle. The boundary of the processed patch is drawn by a polygonal line on the mesh. Additional section planes can be included easily, if necessary.

This local offsetting method is novel in the literature. It has the advantage that only two dimensional algorithms are necessary in the computation. Self intersection in the offset mesh and tool collision with the target surface can be detected by simple computation. Moreover, registering the directions of the normal planes, where such problems arise, a method for partitioning the surface could be developed for different milling tools and strategies. The applied edge-oriented polyhedral data structure defined on the mesh is very effective in determining plane sections of the mesh [22].

## 3 Moving the tool in principal direction

First, the requirement is considered that the machined stripe along a tool path is the widest. Such tool paths will usually minimize the total length of milling paths [2], [3]. The processed patch by the tool around the touching point is determined by its diameters lying on the surface. Now the tool will be moved in the direction perpendicular to the largest diameter. The next touching point of the tool will be chosen in this direction on the boundary of the processed patch. The suggested moving direction is similar in [26] in a different computational approach using Dupin-indicatrices.

In Fig. 6 two tool paths on a quadratic saddle surface are shown with moving directions producing the widest stripe. The side step of the tool is chosen in such a way that the series of the processed patches overlap.

Tool paths of the widest machined stripe are shown on a cylindrical surface in Fig. 7 and 8 A floating patch above one base triangle is also shown which is the part of the offset mesh within the ball-end of the tool. The moving directions are shown by straight line segments. Each is emanating from the touching point on the actual triangle. The diameters of the processed patches are the shortest in the directions perpendicular to the generators in the case, when the tool touches the cylinder on the convex side, and they are parallel to the generators, when the tool is on the concave side of the surface. In the case of these “synthetic” meshes of a cylindrical surface the largest and shortest diameters of a processed patch are perpendicular to each other, and they are practically the principal directions. Investigations have been made on different synthetic meshes which have shown that the direction of the widest processed patch is very close to the principal direction of the largest curvature computed in a sufficiently large region around the contact point. For the estimation of the principal directions at a point of the triangulated surface a method is described in [23] and [24] by lying a circular disc onto the mesh and computing the minimal and maximal chord lengths between the end points of its curved diagonals. In this concept the curvature values are ordered to the triangle facets of the mesh, and approximated surface normals are replaced by facet normals.

The applied normal curvature estimation method constructed for triangular meshes is suitable for the computation on meshes also in such cases, where the known vertex oriented computations do not work. Namely, in the mesh of the shown cylinder all the vertices are situated on the surface boundary. To the contrary, frequently used vertex oriented methods require good vertices in the inside of the actual region.

Even if the total tool path computed in the widest stripe direction can be the shortest, this kind of curves are not always appropriate tool paths due to technical reasons. Namely, the angle between the tool axis and the surface normal changes to much on a curved surface, which leads to uneven abrasion of the tool. The computed moving direction could be combined with other tool path generation algorithms as suggested also in [26].

## 4 Locally optimal moving direction and its computation on analytical surfaces

Now a technical requirement will be considered that the abrasion of the tool is even during the milling process. This requirement is fulfilled, if the angle between the tool axis and the surface normal is constant along a tool path. Such curves are the isophotes on smooth surfaces. (The investigation of other material and kinematical factors is not the object of this paper.)

As the isophotes are not suitable tool paths, a compromise will be suggested, and the tool will be moved from the contact point neither in the direction of the widest processed patch, nor along an isophote. A first idea was to choose the bisector of these two directions. The computation has been made on an analytical surface given by the function , assuming that the piece of the surface to be machined is visible from the tool axis (i.e. the -axis) direction [25]. In such cases the -projection method can be applied, when the processed patch is computed by projecting the boundary of the contact surface parallel to the -direction, and the step size is given in the -plane [4]. For the points of the boundary curve of the contact surface the equation

yield, where is the radius, is the center point of the ball-end of the tool, and is the offset distance. denotes the dot product. The points of the isophote passing through the point satisfy the equation

where is the unit vector of the tool axis direction. In the specific coordinate system, where , this equation is equivalent to

Both equations can be solved numerically resulting in a finite number of points lying on the required surface curves, i.e. on the boundary of the processed patch and on the isophote, respectively.

Fig. 9 shows on a cubic surface how the processed patch around a contact point and the isophote through this point are situated. From the two common points of the curves two bisector directions can be determined (Fig. 10). One of them (which doesn’t lead to a zig-zag curve) has been chosen for tool path direction. Few points of three generated tool paths with the processed patches are shown in Fig. 11 The step size is constant. The problem of varying distances between the tool paths occurs here as well, as also in the frequently used methods ([5], [7]).

A more reasonable idea for finding the optimal direction at any point of the surface is to consider the change of the angle between the tool axis and the surface normal (i.e. the inclination angle of the isophote passing through the actual point) while the tool is moving into a next position. This will determine the correction factor of the declination from the widest stripe direction. If the surface has small curvature, the surface normal doesn’t change very much while moving in the principal direction of the maximal curvature. Therefore, the tool can be kept on this surface curve, because the abrasion will be even. In the case of larger curvature values the tool should be moved rather towards the corresponding isophote direction.

In a generic case the suggested moving direction will be determined between the widest stripe direction and the direction pointing to the isophote point on the boundary of the processed patch in such a way that it divides the arc between these two directions in the ratio . denotes the difference of the inclination angles of the surface normals to the tool axis at the two corresponding points on the processed patch boundary. In Fig. 12 the vector is pointing into the direction of the widest stripe and is pointing to the point of the isophote passing through the contact point . The boundary is represented by points which are the projections of the points lying on the boundary of the contact surface denoted by and in Fig. 4 ( is the number of the section planes). The isophote point on can be approximated by one of the points , in which for the angles

yields, computing from the condition

where is the normal vector of the triangle containing the point . That means, the direction of should fit on the cone determined by the isophote’s angle of (denoted by single arc in Fig. LABEL:11). The vectors , , and are unit vectors.

Let denote the difference of the angles which are formed by the surface normals and to the axis direction .

The proposed new moving direction is determined by the arc length of the processed patch boundary between and :

Consequently, a zero, or a very small does not change the moving direction . This depends also on the radius of the ball-end. The bigger the tool, the bigger is the processed patch. Therefore, the change of the inclination angle of the normals is larger. We remark that the factors included in the fitness function introduced in [21] have the same effect on the moving strategy.

This path correction does not influence the abrasion of a ball-end tool, it has importance in milling with other cutters. The computation for a toroidal cutter does not differ from the presented computation above, but the demonstrating figures have been made with ball-end tools.

Fig. 13 shows a tool path computed by the suggested method. The path in the widest stripe direction (practically a parallel circle of the cylinder) is shown with the processed patches around the computed contact points. The corrected tool path situated lower shows a declination. The radius of the ball-end of the tool is in this case eight times the average size of the triangles. The declination of the new path is less with a smaller radius. In the case, when the radius is only four times the average size of the triangles, the tool will move approximately along the path of the widest stripe. The tolerance was one third of the tool radius in this case, which is the distance of the floating piece of the offset and the part surface (see on the left-hand side in the figure). Note that the tool paths computed on a cylinder surface in a completely different way in [21] show a similar shape.

The next examples are computed on parametric surfaces. Though the surface is presented by a vector function , , which is at least twice differentiable in a sufficiently large neighborhood of , the computation is carried out in normal planes producing points of the surface curve bounding the processed patch. In this way, the time consuming and unstable process of computing the projection of a point onto the surface will be replaced by a very effective method.

Let’s say, the actual tangent direction vector is , . The normal plain containing the required point is determined by the vectors and the surface normal . The decomposition of in the tangent plane is

Let the point to be projected onto the surface be lying in this normal plane. First, and are computed as solutions of the system of linear equations from the decomposition of . Then series of points are generated in the parameter domain with an appropriate , which are

The corresponding points on the surface are determined by the vectors . The required point is determined by the parameter values for which the distance of the surface point to is minimal .

Numerical tests have shown that the results of the presented approximation of the projection onto the surface are satisfying compared to the ”real” projections computed by the program package Mathematica by searching for a nearest surface point to the one to be projected without any constraints. The difference between the results of the two methods is within the error bounds of the computation in other procedures of the complete task.

In the Figures 14 and 15 the results of this computation on a torus are shown. The smaller patches are generated with a smaller tool radius. Here the tool path deviates little from the parameter curve of the meridian circle, which is the path of widest stripe with tangents in the principal directions of the greater principal curvatures. The isophotic curves are the parallel circles. A larger tool radius shows a significantly bigger deviation from the steepest moving directions.

The next surface in Figures 16, 17 and 18 is described by a trigonometric function. The steepest ascending direction crosses the bump (not shown), and an isophotic curve is shown in Figure 16. The computed tool path goes between them, and Figure 17, 18 show that the computed moving directions are stable also in more curved regions.

The results in the examples correspond to expected ones, the direction choice optimizes the tool inclination angle for maximal material removal rate in each cutter contact point. The suggested locally optimal moving direction is depending as well on the surface curvatures at the actual point, as on the tool’s size.

The analysis of the variation of the angle between the tool axis and the surface normal shows the following values. On the torus with Gaussian curvature between and the change of this angle of the axis of the smaller tool (Fig. 14) along the path in the maximal curvature direction would be between and , while along the path in the proposed direction between and . The width of the processed patches has decreased by . (Remember that this angle does not change when the tool is moving in the isophotic direction, but the change is maximal in the maximal normal curvature direction.) By our method in the case of the bigger tool (Fig. 15) the variation of the angle of the axis to the surface normal has been reduced to the interval , and the width of the processed stripe has been reduced a bit more, by . On the trigonometric surface with Gaussian curvature between and the variation of the observed angle along the steepest direction would be between and , while along the proposed path between and (Fig. 17, 18). The width’s decrease on the processed patches is in this case .

## 5 Conclusions

Geometric considerations about generating milling tool paths have been presented. Local moving direction of the tool has been computed, when the processed stripe is the widest, and the change of the inclination angle of the tool axis is minimal. A correction factor to the steepest ascending direction has been determined from the change of the isophotic angle of the surface normal with respect to the tool axis while moving the tool from a given point into the next position. This strategy provides to develop a new milling strategy with possible wide processed stripes and small variation of the angle between the tool axis and the surface normals. The presented new local offsetting method for triangular meshes solves basic problems, as computing the processed patch boundary and detecting self intersection or gauging. For the solution of different other technical problems further investigations are necessary.

On analytical surfaces the computations and the figures have been made by the symbolic algebraic program package Mathematica. The program developed by the author for the presented computations on discrete surfaces is not for professional applications. A lot of numerical problems may arise in the computation with real triangular meshes. The solution of such problems was not the task of this work.

## 6 Acknowledgements

The work was supported by a joint project between the TU Berlin and the BUTE.

## References

- [1] S. Bedi, S. Gravelle, Y.H. Chen: Principal curvature alignment technique for machining complex surfaces. Transactions of the ASME 119/Nov. (1997) 756-765.
- [2] Z.C. Chen, Z. Dong, G.W. Vickers: Most efficient tool feed direction in three-axis CNC machining. Integrated Manufacturing Systems 14/7 (2003) 554-566.
- [3] Z.C. Chen, G.W. Vickers, Z. Dong: A new principle of CNC tool path planning for three-axis sculptured part machining – a steepest-ascending tool path. Journal of Manufacturing Science and Engineering 126 (2004) 515-523.
- [4] C.M. Chuang, H.T. Yan: A new approach to z-level contour machining of triangulated surface models using fillet endmills. Computer-Aided Design 37 (2005) 1039-1051.
- [5] S. Ding, M.A. Mannan, A.N. Poo, D.C.H. Yang, Z. Han: Adaptive iso-planar tool path generation for machining of free-form surfaces. Computer-Aided Design 35 (2003) 141-153.
- [6] J. Dong, J.H. Kao, J.M. Pinilla, Y.C. Chang, F.B. Princ: Automated planning for material shaping operations in additive/subtractive solid free form fabrication. in: Proc. Solid Freeform Fabrication Symposium, University of Texas at Austin, Texas, 1999, pp. 121-128.
- [7] G. Elber, E. Cohen: Tool path generation for freeform surface models. in: 2nd ACM Solid Modelling ’93, Montreal, Canada, 1993, pp. 419-427.
- [8] H.Y. Feng, H. Li: Constant scallop-height tool path generation for three-axis sculptured surface machining. Computer-Aided Design 34 (2002) 647-654.
- [9] G. Glaeser, J. Wallner, H. Pottman: Collision-free 3-axis milling and selection of cutting tools. Computer-Aided Design 31 (1999) 225-232.
- [10] Z. Han, D.C.H. Yang, J.J. Chuang: Isophote-based ruled surface approximation of free-form surfaces and its application in NC machining. International Journal of Production Research 39 (2001) 1911-1930.
- [11] M. Held, G. Lukács, L. Andor: Pocket machining based on contour-parallel tool paths generated by means of proximity maps. Computer-Aided Design 26 (1994) 189-203.
- [12] C.S. Jun, D.S. Kim, S. Park: A new curve-based approach to polyhedral machining. Computer-Aided Design 34 (2002) 379-389.
- [13] T. Kim: Constant cusp height tool paths as geodesic parallels on an abstract Riemannian manifold. Computer-Aided Design 39 (2007) 477-489.
- [14] D.S. Kim, C.S. Jun, S. Park: Tool path generation for clean-up machining by a curve-based approach. Computer-Aided Design 37 (2005) 967-973.
- [15] S.J. Kim, M.Y. Yang: A CL surface deformation approach for constant scallop height tool path generation from triangular mesh. Int. J. Adv. Manuf. Technol. 28 (2006) 314-320.
- [16] S.J. Kim, M.Y. Yang: Incomplete mesh offset for NC machining. Journal of Materials Processing Technology 194 (2007) 110-120.
- [17] J. Lang: Zur Konstruktion von Isophoten im Computer Aided Design. CAD-Computergraphik und Konstruktion, Wien 34 (1984) 1-7.
- [18] S.S. Makhanovn: Optimization and correction of the tool path of the five-axis milling machine: Part 1. Spatial optimization. Mathematics and Computers in Simulation 75 (2007) 210-230.
- [19] T.H. Oulee, D.C.H. Yang, J.J. Chuang: Boundary conformed tool path generation via Laplace based parametric redistribution method. ASME J. Manuf. Sci. Eng. 126 (2004) 345-354.
- [20] S.C. Park: Sculptured surface machining using triangular mesh slicing. Computer-Aided Design 36 (2004) 279-288.
- [21] Y. Quinsat, L. Sabourin: Optimal selection of machining direction for three-axis milling of sculptured parts. Int. J. Adv. Manuf. Technol. 27 (2006) 1132-1139.
- [22] M. Szilvási-Nagy, Gy. Mátyási: Analysis of STL files. Mathematical and Computer Modelling 38 (2003) 945-960.
- [23] M. Szilvási-Nagy: About curvatures on triangle meshes. KoG 10 (2006) 13-18.
- [24] M. Szilvási-Nagy: Face-based estimations of curvatures on triangle meshes. Journal for Geometry and Graphics 12/1 (2008) 63-73.
- [25] M. Szilvási-Nagy, Sz. Béla, Gy. Mátyási: About the geometry of milling paths. Annales Mathematicae et Informaticae 35 (2008) 135-146.
- [26] J. Wallner, G. Glaeser, H. Pottman: Geometric contributions to 3-axis milling of sculptured surfaces. in: G. Olling, B. Choi and R. Jerard (Eds.), Machining Impossible Shapes, Kluwer Academic Publ., Boston, 1999, pp. 33-41.
- [27] H.Y. Xu, H.Y. Tam, J.J. Zhang: Isophote interpolation. Computer-Aided Design 35 (2003) 1337-1344.
- [28] D.C.H. Yang, Z. Han: Interference detection and optimal tool selection in 3-axis NC milling of free-form surfaces. Computer-aided design 31 (1999) 303-315.
- [29] J.H. Yoon: Fast tool path generation by the iso-scallop height method for ball-end milling of sculptured surfaces. International Journal of Production Research 43 (2005) 4989-4998.

Received