Automatic Tool Path Generation for Parametric Surfaces

- A tool path generation algorithm has been proposed and implemented in the presented work. The aim of the development of tool path algorithm is to machine parametric surface with a given tolerance and scallop height. The algorithm proposes dividing the desired parametric surface to several linear segments depending on the desired accuracy of the parametric surface. The B-spline technique has been used to generate the required data of the parametric surface. After generating the tool path, the cutter movement has been simulated allowing to reduce the cutting time and cost. The tool path is verified on the C-TEK CNC milling machine by machining six models. Various tool path strategies are also discussed and compared with the developed algorithm. The machining performance includes machining time; dimensional accuracy and surface roughness were measured for result evaluation. A measuring method has been proposed and implemented to measure the accuracy of the final 3D models. A Digital 3D-Touch Probe was used. The statistical method of error assessment and similarity factor has been implemented in this work to show the efficiency of the proposed works. The results showed that the similarity factor of the proposed works were (87.6%) for one model, and (85.9%), (89.6%) for other models. Matlab (v.7.1), UG-NX8.5, and VERCUT software have been used in this work for implementation. A comparison between the proposed method and UG-NX8 has been done to present the flexibility of the proposed method.


Introduction
Sliding movements in a CNC machine are controlled by motors using a computer program, Allowing editing the part program and storing it in computer memory [1].Cutter path is a critical task in milling parametric surfaces.During the creation of the cutter path, the contact points (CC) that follow the parametric surface are achieved.In the cutter path layout of the tool, surface topology and tool path parameters to be considered.Surface topology is defined as the pattern followed by the cutter to mill the surface.There are two main parameters that must be taken into account in the path generating in the parametric surface milling, which is side step and steps forward.The topologies of the cutter path in CNC machining can be classified as: I. 1.Parallel Direction II.2.Parallel Contour The parallel direction cutter path is usually linear and can be achieved in different patterns as, zig pattern and zig-zag pattern.Figure 2, illustrates the two different patterns of parallel direction cutter paths [4].During the zig-zag pattern, the tool cut the material in bi-directional path which allows reducing the non-cutting time during machining [4].In parallel contour pattern, a successive offset patterns entire pocket is machined.One method of connecting the subsequent contours is shown in Figure 3. Are generated then the tool will follow these offset patterns until the overall shape is machined, Figure 3 illustrate the parallel contour pattern [5].

Literature Review
The most research related to this work is reviewed by following researcher [6], proposed a procedure in CNC machining that allows keeping the cutting force constant during the cutting and this can be achieved in semifinishing milling.Also [7] focused on developing a procedure for cutter path generation for machining parametric surfaces depending on the desired accuracy.The surfaces were represented by multi curves considering two parameters, which forward step and sidestep.[8] Presented a method of pocketing cutter path computation.Generally, the calculated cutter path has to minimize the machining time.Thus based on this algorithm, they proposed to compute cutter paths for pocket milling.Modeling of the problem is then proposed and a solving method is presented [9].Proposed a CAD/CAM concept for designing and machining of parametric surfaces, the concept of the design phase was based on dividing the surface into a set of straight lines whose numbers depend on the precision required for machining the desired surface.[10] Proposed a developed algorithm to determine the optimum length of the line segments in forwarding and side directions.
Bezier technique was used in applying the developed algorithm where the cutter radius, desired tolerance, and scallop height have been considered.

Surface Representation
The surface representation in mathematical form can be either parametric surface representation or non-parametric representation, the general mathematical equation of the surface [11]:  = (, ) (1) This mathematical equation form is the relationship between the points themselves that determine the resulting shapes of a curve or surface fit through a set of points, not the relationship between these points and some arbitrary coordinate system.In the implicit nonparametric form, the surface takes the general form [12]: To ease of programming, computability each point is represented as a function of a parameter that acts as a local coordinator for points on the surface.The preferred way to represent shapes in geometric modeling is with parametric equations.The preferred way to represent surfaces in geometric modeling is with parametric equations, where the position on the represented surface is given according to the following equation [13]:

Parametric Surface Representation
Parametric surface representation is used widely in surface modeling, where the surface can be represented by Hermit, Bezier, or B-spline [14].Interpolation method and approximation method are the main methods in representing parametric curves and surfaces.In the interpolation method, the curve or surface is forced to pass through the control points, which lead to reduce the deviation between the curve or surface and the polygon contained in.While an approximation method, the curve or the surface passes through the corners of the control point's grid [15].

The Proposed Algorithm
In this section we will explain the proposed algorithm that used to generate tool paths, the algorithm steps are shown in Figure 4.

Geometric Modeling of 3D
In this section, B-Spline surfaces have been used to represent 3D surfaces.The B-Spline consists of one or more polynomial curves glued together, and it is said to be the piecewise polynomial curve.The degree of the curves that generates B-Spline surface is independent of the total number of the control points [13].B-Spline curves, in general, can represent according to the blending function as [16][17]: Where (Pi) is the set of control points and (Ni, k) represents the appropriate basis function for B-Spline representation.For the B-Spline curve, a parameter (k) controls the degree of basis polynomials, and it's usually independent of the number of control points [13].The basis function (Ni, k) is defined by following recursive equation [18]: and [17]: The (ti) are knot values, and a set of knot values comprises a knot vector (T).Determining the degree of the polynomials, net points, and knot according to [18]: The knot vector has a significant influence on the blending function Ni, k (t) and theory on the B-Spline curve itself.These knot vectors can be classified as periodic and non-periodic knots.

B-Spline Surfaces
B-Spline surface is a direct extension of a B-Spline curve.The definition of B-Spline surface is the locus of the curve that is moving through space and changing its shape.The B-Spline surface can be represented by [19]:

Cause Study: Remote Shaped Surface Model
A non-uniform B-Spline surface of the single patch with the 4 th degree was suggested and implemented to reconstruct and represent a surface model like a remote shape.The suggested input control points are listed in the Table 1 while Figure 5 illustrates the represented surface.

Proposed Tool Path Algorithm
An algorithm has been developed and implemented to generate tool path for machining 3D surfaces based on the coordinate of the interior data points (Xi, Yi, and Zi) of the desired 3D surfaces.The represented surface was segmented into parametric curves.The proposed algorithm starts with the linear interpolation of point located at the first point of the 1 st curve, after finding the desired incremental parameter u, the parameter of the next Pi+1 point is set as Pi+1 = Pi + u and a new searching iteration continues until the 1 st curve is covered and until all of the parametric curves that represent the 3D surface are covered, Each of these points is considered as a cutter contact point (CC).In the proposed algorithm a cutter contact based method has been used to convert each CC point to cutter location (CL) point for next processing.The previous algorithm has been invested to generate the tool path for the three proposed 3D surfaces and the output of the algorithm is illustrated in Figure 6.

Tool paths generation using UG-NX8 software
The surface is modeled using MATLAB and then converted to the UGS-NX8-through TXT data-exchanges file to view the desired shape.
After the reconstruction the 3D model using B-Spline the desired surface subdivision into a series of parametric curves.The data of each curve has been represented and saved in a single matrix.Each matrix is saved as (txt) file and exported to the UG-NX program.

Tool Path Generation and Simulation
Using UGI NX8.5 Software for generating cavity tool path, the cutting conditions in a cavity roughing for three models are illustrated in table (2) the generated cutter path for models using UGNX is illustrated in Figures 7.While the second stage is finishing which achieved using ball end mill of (12mm) diameter, it is appropriate to the geometry of the sculpture surface.The value of the side step in the finishing is much smaller than those in roughing where the cutter is ball end mill as illustrated in Figure 8.

G-Code Generation
According to the segmentation of the generated cutter path into appropriate linear segments, the cutter will move along these segments by (G01) preparatory function.The Cartesian coordinates of the start point and end point of each linear segment can be determined to generate the required part program.

Tool Path Verification
The verification process has been done for the generated a tool path using VERICUT software to detect the errors of NC program before loading the program on the CNC machine.Gcode files imported to VERICUT software and a virtual machine has been designed to verify the tool path, and checking the machining pitfalls, as shown in Figure 9.

Workpiece Material
The milling process in this work has been achieved with two stages of rough milling and finish milling.The work piece material used for this sample was (plastic material, Poly tetra fluoroethylene type) with the primary dimension of 100× 150× 50 mm.Figure (11) shows the roughing and finishing process for the machined part.
Figure11: Remote shape model

Measuring
The accuracy of the 3D surface and models are mainly measured by 3D coordinate measuring machine (CMM) which is nationally not available.To overcome this problem in this work, a measuring method is developed and implemented to measure the accuracy of the 3D models that have been created without the need of (CMM).Figure (12) illustrate the measuring the accuracy process of the model.

Surface Roughness
Measuring the roughness of surfaces models by using Pocket Surf, although the material of three models that machined are poly tetra fluoroethylene, a surface roughness (Ra) was implemented to compare the roughness of the models that machined using the proposed algorithm with those that machined using UG-NX software the result of this test is illustrated in the table (4) while Figure (13) shows the measuring roughness method.

Statistical Analysis of Computed Error
The results of implementation presented are interpreted.The statistical theory gives a good idea about the surfaces reconstruction.When surfaces are generated, the error should be represented to change the data into meaningful Information and to understand the error, by using Statistical analysis like the maximum error, the average of error, standard deviation, error percentage, and similarity factor.These values of statistical analysis are tabulated in the Table 5 for the remote control model.

Figure 4 :
Figure 4: Block diagram of the main steps for general work Pi, j are points and of the control net.Ni, k (u): Nj, l (w) are the basic functions, where u and w are independent variables.The tensor product of the B-Spline surface can represent mathematically by [20].Ps, t (u, w) = U MS P MS T W T (9)

Figure 5 :
Figure 5: Surface Model Remote shape using MATLAB software

Figure 6 :
Figure 6: Finishing tool path by Matlab for Remote

Figure 7 :
Figure 7: Roughing tool path generation for the model.

Figure 9 :
Figure 9: Tool path simulation using VERICUT 14. Experimental Work CNC Milling Machining the present work the following machines, which are available in the Workshops and Training Center in the University of Technology were used to perform the experimental work.Figure (10) illustrates the C-TEK CNC milling machine model KM80D.

Figure 12 :
Figure 12: measuring accuracy of the remote shaped model.

Figure 13 :
Figure 13: surface roughness measurement of a remote control shaped model18.ResultsFour types of tool paths have been selected for roughing process and four types for finishing process.Then the selected tool path strategies were used with different angles for the machining operation.The tool path has been achieved via simulation using UG-NX.Then the tool path that has the lowest simulation time has been selected for real machining by the vertical CNC milling machine for three models.The comparison of the simulation time for roughing and finishing of remote control shaped model for four strategies of the tool path, the results of rough milling and finish milling are shown in Figure(14 a, and b)it shows the relationship between simulation time and direction angle.

Figure 14 a: simulation time for roughing operation of a remote shaped modelFigure 14 .
Figure 14 a: simulation time for roughing operation of a remote shaped model