Abstract
Geometric deviation, defined as the distance between the designed surface and the machined surface, is an important component of machining errors in five-axis flank milling of the S-shaped test piece. Since the interpolated toolpath in practical machining process is the approximation of the theoretical toolpath, the geometric deviation caused by the interpolated toolpath appears. To overcome this problem, a novel geometric deviation reduction method is suggested in this study. First, the features of the S-shaped test piece are analyzed. Second, the theoretical toolpath is generated according to the designed surface and the cutter location data is obtained by discretizing the theoretical toolpath. The linear interpolation of the cutter location data is carried out to obtain the interpolated toolpath. Then, the geometric deviation is modeled by calculating the Hausdorff distance between the tool axis trajectory surface based on the interpolated toolpath and the offset surface of the designed surface. Finally, the geometric deviation is reduced by optimizing the cutter location data without inserting more cutter location points. The machining experiment is conducted to verify the effectiveness of the proposed method. The experimental results agree with the simulation results, and both of them indicate the geometric deviation on the machined surface reduces after optimization.
Keywords
Introduction
The S-shaped test piece is a standard test piece for accuracy detection of five-axis machine tools. The toolpath of cutter motion has an important effect on the machining error in five-axis flank milling of theS-shaped test piece.1,2 The theoretical toolpath (TTP) is a continuous curve offsetting a distance of cutter radius from the designed surface. 3 However, since current machine tools cannot follow the TTP continuously, the TTP is discretized as cutter location (CL) data. The practical interpolated toolpath (PITP) is the result of linear interpolation of the CL data. 4 The approximation of TTP by the CL data causes the misalignment between the TTP and PITP, which can be called as geometric deviation.5,6
Many works have been done to reduce the machining error between the TTP and PITP. In these works, different interpolation algorithms for interpolated toolpath were proposed. 7 Zhang et al. 8 presented a parametrical cubic spline curve transitional approach for the interpolation of continuous short line segments. The trajectory error of the transitional curve is deduced according to the constraints of control points. Li et al. 9 proposed a real-time and look-ahead interpolation algorithm for machining of micro-line segments under the chord error and drive axes constraints. Tajima and Sencer 10 controlled the contouring errors at sharp corner of the linear segmented toolpath by interpolating axis velocity and accelerations accurately from the start to the end of the corner. However, their works focus on the toolpath in two-dimensional space. For the complex toolpath in three-dimensional space, the interpolation algorithms are more complex. Shi et al. 11 proposed a pair of quantic Pythagorean-hodograph (PH) curves to round the corners of five-axis toolpath, and those two rounded curves are synchronized linearly in interpolation according to the accuracy requirements of the tool tip and tool orientation tolerances. Bi et al. 12 used one cubic Bezier curve to interpolate the segments junction of the line toolpath for the tool tip points and the other one cubic Bezier curve to interpolate the segments junction of the rotational toolpath for the tool orientations. However, the aforementioned interpolation algorithms are for the micro-line segments at the corners of the toolpath. The derivatives of the toolpath at these junctions are discontinuous. On the contrary, the S-shaped test piece is constructed by the spline curves that have continuous derivative. Therefore, the interpolation algorithms for fitting the toolpath whose derivatives are discontinuous are not suitable for the toolpath of the S-shaped test piece.
The machining error induced by misalignment between the differentiable spatial curve and the PITP is investigated in recent works. 13 Tajima and Sencer 14 proposed a novel real-time trajectory generation technique for accurate tool tip interpolation of discrete five-axis machining toolpath with the control of tool tip and tool orientation errors. Wang et al. 15 converted B-spline to piecewise power basis functions to establish formulas for computing interpolation points explicitly without calculating the chord error. To reduce the chord error, CL data densification is an effective method. Msaddek et al. 16 suggested a simulation methodology for chord error caused by the B-spline interpolation and C-spline interpolation. Then, they compensated the machining errors between the spline trajectories and the theoretical trajectory by using insertion of the control nodes. 17 Zhu et al. 18 developed a method for correcting the numerical control codes to compensate for the geometric deviation of the toolpath. Li et al. 19 densified the CL data to reduce the non-linear error at the connection points of line segments. The tool tip center (TTC) points are computed by the cubic spine interpolation, and the tool posture vectors are obtained via linear interpolation. However, the aforementioned works are concerned with the toolpath of the end milling freeform surface, and the machining error caused by the flank side of the tool is not considered. Besides, the data densification makes the toolpath planning complicated. To deal with these problems, the geometric deviation distributed in the three-dimensional space in five-axis flank milling of the S-shaped test piece is studied in this article.
In this study, the geometric deviation caused by the PITP in five-axis flank milling of the S-shaped test piece is considered directly when the tool feeds from one CL to the next consecutive CL. A new geometric deviation estimation model is proposed; subsequently, the geometric deviation is reduced directly by optimizing the CL data without inserting more CL points. The CL data are optimized by modifying the TTC point and the tool end center (TEC) point of intermediate tool axis of three consecutive tool axes. The remaining of this study is organized as follows: the features of the S-shaped test piece are analyzed in section “Features of the S-shaped test piece.” The geometric deviation estimation model is proposed in section “Geometric deviation estimation model.” Section “Geometric deviation reduction method” shows the geometric deviation reduction method. Simulation and experimental validations are provided in section “Simulation and experiment,” with the conclusions presented in section “Conclusion.”
Features of the S-shaped test piece
The side surfaces of the S-shaped test piece are two undevelopable ruled surfaces. They are named surface S1 and surface S2 in this study, respectively, as shown in Figure 1. Two regions with the maximum curvature on each ruled surface are termed region R1 and region R2. The equation of undevelopable ruled surface is defined as

The S-shaped test piece and regions R1 and R2.
where S(u, v) represents any point on the ruled surface and it is decided by parameters u and v; C1(u) and C2(u) are two quasi-uniform cubic rational B-splines of each ruled surface, that is, two boundary curves of the ruled surface.
The equation of the B-spline is defined as
where Pi (i = 0, 1,…, k) denotes the control points of the B-spline; 1 Ni,n(u) represent the basis functions referring to the De Boor–Cox method, and n is the order of the B-spline.
The ruled surface can be seen as a straight line moves along the boundary curves. The straight line is called the ruled line, and the boundary curves are called the guiding curves, corresponding to parameters u and v, respectively. Therefore, the parameter equations of the ruled surface can be expressed as
where u(t) and v(t) are continuously differentiable functions.
For any point Q(u0, v0) on the ruled surface S(u, v), the unit normal vector is expressed as
where
The parameter equation of the normal line passing through point Q(u0, v0) is expressed as
where t is the parameter of any point on the normal line.
Geometric deviation estimation model
Toolpath generation
The double points offset (DPO) method is adopted in this study to obtain the TTP, as illustrated in Figure 2. The basic idea is offsetting a distance of cutter radius r from two cutter contract (CC) points Q1 and Q2 on the guiding curves C1(u) and C2(u) in the direction of the unit normal vectors passing through the CC points. Supposing the TTC point corresponds to the guiding curve C2(u), the tool axis unit vector

Toolpath generation using the DPO method.
where r
The CL data are obtained by discretizing the TTP. The TTC points and the TEC points can be transformed into the TTC points and the corresponding tool axis vectors.
Estimation of the geometric deviation
When the CL data are obtained from the TTP, the computer numerical control (CNC) system drives the machine by reading the CL data. If the cutter moves in the two-dimensional plane, the TTP To(u) is the offset curve

Two-dimensional geometric deviation on the projection of the cutter cross section.
The chord error is expanded to the three-dimensional space to estimate the geometric deviation in the flank milling. Any three consecutive CLs are taken to derive the three-dimensional geometric deviation, as shown in Figure 4. Pti, Pti+1 and Pti+2 are three consecutive CC points on curve C2(u), and Pei, Pei+1 and Pei+2 the CC points on curve C1(u). Tti, Tti+1 and Tti+2 are three consecutive TTC points on the tool axis trajectory surface St(u, v), and Tei, Tei+1 and Tei+2 are TEC points. The equation of the offset surface So(u, v) of the designed surface is expressed as
The tool axis trajectory surface St(u, v) is the shape when the cutter moves along the PITP. When the CNC system reads the CL data, regardless of which interpolation method the CNC system adopts, the tool feeds along the micro-lines after interpolation. Because the interpolation process employs tiny straight segments to approximate the curve. The tool axis trajectory surface St(u, v) involves line segments

The geometric deviation in flank milling between two consecutive tool axes
The geometric deviation between two consecutive CLs influences the machining accuracy directly. The maximum geometric deviation is calculated using the Hansdorff distance. The Hausdorff distance from point set
where m and n are points in sets
The calculation of the geometric deviation includes three steps as follows. The first step is to define the sets
The second step is calculating the Euclidean distance between sets
where
Substituting equation (12) into equation. (10), the Hausdorff distance between two consecutive CLs with a specific parameter vz is obtained. If the tool axis trajectory surface locates between the offset surface and the designed surface, the workpiece is overcut by the cutter; otherwise, the workpiece is undercut.
The third step is repeating the aforementioned steps for parameter
Geometric deviation reduction method
This section proposes a CL data optimization method to reduce the three-dimensional geometric deviation in flank milling.
For any three consecutive CLs shown in Figure 5, the original TTC points and the tool axis vectors before optimization are described in section “Geometric deviation estimation model.” Since tool axis vectors

Optimization of the CL data by modifying the intermediate tool axis vector
The tool axis vector
Supposing that the TTC point and TEC point changes in the direction or the inverse direction of the unit normal vector of the CC points Pti+1 and Pei+1. The ratios of the movement length lt and ld to the cutter radius r are defined as st and se pertaining to the TTC point and TEC point, respectively
When the TTC point and the TEC point change, the new tool axis becomes vector
where
Substituting equation (14) into equation (10) and repeating three steps described in section “Estimation of the geometric deviation,” the new geometric deviation on the machined surface between two consecutive CLs is obtained.
The basic idea of reducing the geometric deviation is to find the minimum of epn by modifying the TTC point and the TEC point. The relationship between the maximum geometric deviation and parameters st and se is analyzed here. If the absolute values of parameters st and se are zero, the tool axis has no changes, and the tool axis is still the original tool axis. If the absolute values of st and se are very large, the tool axis changes a lot, which means the new PITP will deviate from the TTP obviously, causing the geometric deviation very large simultaneously. Therefore, the solutions of parameters st and se to make geometric deviation minimum exist. The bisection method is adopted to search the solution of parameters st and se. The solution of parameter st is searched first. Specifically, set parameter se and adjust parameter st. When the maximum geometric deviation is minimum, the solution of parameter st is obtained. The solution of parameter se is found in the same way. Thus, a solution of parameters st and se is obtained.
Simulation and experiment
Numerical simulation
The simulation parameters are the same as those in experiment. The height of the S-shaped test piece is 30 mm. The milling width ae is 10 mm in the practical flank milling process. So, it is divided into three cutting layers. The radius r of the cylindrical cutter is 10 mm. The simulation results of the geometric deviation are described subsequently.
The three-dimensional geometric deviation between the offset surface and the tool axis trajectory surface on ruled surfaces S1 and S2 is simulated in MATLAB. The distributions of the geometric deviation before optimization on ruled surfaces S1 and S2 are shown in Figure 6. Figure 6(a) shows that the maximum overcut in region R1 is 0.0313 mm, and the maximum undercut in region R2 is −0.0230 mm on the ruled surface S1. Figure 6(b) shows that the maximum overcut in region R2 is 0.0239 mm, and the maximum undercut in region R1 is −0.0123 mm on the ruled surface S2.

Distributions of three-dimensional geometric deviation in simulation on: (a) ruled surface S1 and (b) ruled surface S2 before optimization.
The CL data are optimized using the proposed TTC points and TEC points modification method. For the flank milling of ruled surface S1, parameters st and se are 0.070 and 0.072 that can make geometric deviation minimum. For the flank milling of ruled surface S2, they are 0.075 and 0.070. The distributions of the geometric deviation on ruled surfaces S1 and S2 are shown in Figure 7.

Distributions of three-dimensional geometric deviation in simulation on: (a) ruled surfaces S1 and (b) ruled surface S2 after optimization.
Figure 7(a) shows that the maximum overcut in region R1 is 0.0203 mm, and the maximum undercut in region R2 is −0.0153 mm on ruled surface S1 after optimization. The maximum overcut and undercut on ruled surface S1 reduce 35.1% and 37.8%, respectively. Figure 7(b) shows that the maximum undercut in region R1 is −0.0079 mm, and the maximum overcut in region R2 is 0.0152 mm on ruled surface S2 after optimization. The maximum overcut and undercut on ruled surface S2 reduce 36.0% and 33.9%, respectively. The simulation results are summarized in Table 1.
The maximum overcut, undercut before and after optimization in regions R1 and R2.
To compare the geometric deviation before and after optimization more clearly, the geometric deviation in regions R1 and R2 is discussed in detail. The parameter v equals to 0.8333 of the ruled line is selected to analyze the geometric deviation. It corresponds to the height z = 25 mm of the ruled surface in the workpiece coordinate frame. The distributions of the geometric deviation along the guiding line in regions R1 and R2 are shown in Figure 8.

Distributions of geometric deviation with z = 25 mm in regions: (a) R1 and (b) R2.
The geometric deviation on ruled surfaces S1 and S2 reaches maximum in regions R1 and R2, respectively. The peak geometric deviation is about 0.03 mm. It is so large for two reasons. One is that the curvature in these regions is the largest. The other reason is that the practical tool motion is along the micro-line. The bigger the curvature is, the bigger the geometric deviation is. They are the main sources of the peak geometric deviation. Figure 7 shows that the geometric deviation is smaller than 0.01 mm on most regions of the ruled surface. Next, the geometric deviation in regions R1 and R2 is verified in the cutting experiment.
Experiment
Experimental conditions
The proposed CL data optimization method is experimentally verified on an A/C table-tilting five-axis CNC machining tool VMC 0656, as shown in Figure 9(a). The machined surfaces are measured on the coordinate measurement machine (CMM) ZEISS CONGURA G2, as shown in Figure 9(b). The material of the S-shaped test piece is Al-7075-T7451 aluminum alloy. The machining deformation in the machining process is excluded here. The machining deformation error is about 0.008 mm in regions R1 and R2 when the thickness of the S-shaped test piece is 4 mm. 20 To eliminate the effect of workpiece deformation, the thickness of the S-shaped test piece is designed as 10 mm in this study. The cylindrical cutter with two teeth is a straight-end high speed steel milling cutter. The tool cutting edge length is 75 mm. The cutting parameters include a feed rate of 300 mm/min and a spindle speed of 6000 r/min. The heights of three machining layers are 20, 10 and 0 mm in the workpiece coordinate frame.

(a) Machining process on the five-axis CNC machine tool and (b) measurement on the CMM.
The geometric deviation in this study is described and measured in the workpiece coordinate frame. The CL data include the TTC points P = [Px Py Pz]T and the tool axis vectors O = [Oi Oj Ok]T in the workpiece coordinate frame. However, the five-axis machine tool motion commands q = [x, y, z, θa, θc]T, including three translational axes and two rotary axes, are described in the machine coordinate system. Therefore, the CL data need to be transformed into the motion commands. Three translational motion commands are transformed using TTC points directly. Considering forward kinematics, two rotary motion commands corresponding to the tool axis vectors are obtained using the following transformation formula
where Sa = sin(θa), Ca = cos(θa), Sc = sin(θc) and Cc = cos(θc).
The displacements of rotary axes A and C are obtained from the inverse kinematics solved from equation (15) and are expressed as
Two rotary motion commands of the table-tilting table when machining first layer of ruled surface S2 are shown in Figure 10, which are similar to that of the other layers.

Motion commands for (a) A axis and (b) C axis when machining first layer of ruled surface S2.
Experiment results and discussions
Two S-shaped test pieces before and after the CL data optimization are cut. The geometric deviation of the machined surface with z = 25 mm is measured, as shown in Figure 11. The measurement results of geometric deviation in regions R1 and R2 before and after optimization are shown in Figure 12.

The measurement height z = 25 mm in region R1 on the machined surface S1.

Geometric deviation on the machined surface: (a) in region R1 and (b) in region R2.
The measurement results of the machining experiment show that the practical geometric deviation on the machined ruled surfaces S1 and S2 have a trend similar to that of the simulated geometric deviation. Furthermore, the maximum geometric deviation on the machined surface in region R1 before and after optimization is 0.0320 and 0.0239 mm, respectively, indicating a reduction of 25.3%. It is 0.0292 and 0.0173 mm in region R2, respectively, indicating a reduction of 40.8%.
A comparison of the simulation results and the experimental results of the maximum geometric deviation in regions R1 and R2 is presented in Table 2. The effectiveness of the proposed geometric deviation reduction method by modifying the practical CL data is verified by both simulation results and the experimental results.
Comparison of the simulation and experimental results of the maximum geometric deviation.
Conclusion
A new geometric deviation estimation model and reduction approach for five-axis flank milling of the S-shaped test piece is proposed in this article. The geometric deviation is caused by the fact that the machine tools cannot synchronize the practical cutter motion and the TTP. Actually, The CL data are used in the practical machining process. This study focuses on the geometric deviation based on the PITP to improve the motion accuracy when tool feeds from one CL to the next consecutive CL. The CL data are optimized to reduce the geometric deviation. Several distinct features of the proposed method are presented as follows.
The geometric deviation on the ruled surface between two consecutive CLs is studied directly. It is estimated by calculating the distance between the offset surface of the designed surface and the tool axis trajectory surface.
The geometric deviation is reduced by modifying the TTC point and TEC point to optimize the CL data. The proposed method is verified in simulation and machining experiment. The experimental results of geometric deviation meet that of the simulation results. Both results indicate that the geometric deviation reduces significantly by using the proposed method. Thus, the validity of the proposed method is verified.
This study provides an off-line CL data optimization method for improving the accuracy in five-axis flank milling of the S-shaped test piece. The proposed method is robust and effective. It leads to several potential topics in future work, such as feed rate control and the deformation of workpiece in the flank milling of the thin-walled parts.
Footnotes
Appendix 1
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Major national science and technology projects of China under grant no. 2017ZX04002001 and the National Natural Science Foundation of China under grant no. 51975319.
