A Novel Error Compensation Method of Five-axis Flank Milling of Ruled Surface by Modifying Tool Path

Five-axis flank milling is widely used in the aerospace and automotive industry. However, diverse sources of errors prevent the improvement of machining accuracy. This paper proposes a novel error compensation method for five-axis flank milling of ruled surface by modifying the original tool path according to the error distribution model. The method contains three steps: First, the errors at the middle of the straight generatrix on the machined surface are calculated according to error distribution, and the corresponding normal vectors are obtained by geometric calculation. Second, multi-peaks Gaussian fitting method is utilized to make connections between parameters in the original tool path and error distribution. Finally, the new tool path is generated by adjusting original tool path. Machining experiments are performed to test the effectiveness of the proposed error compensation method. The error distribution after compensation shows that the average error decreases 74%, and the maximum error (contains overcutting and undercutting) decreases 26%. Results show that the proposed error compensation method is effective to improve the accuracy for five-axis flank milling.


Introduction
Five-axis flank milling plays a significant role in aerospace and transportation industry with the advantages of high accuracy and high efficiency. The increasing demands require different characteristic of the parts. While, it is a trend to achieve higher accuracy for the practical applications, and it is of importance to reduce errors for the manufacturing industry.
There are two main categories of error compensation in recent studies. The first type is based on prediction. These studies focus on the diverse sources of errors during the machining process, analyzing the mechanism of error production, and compensating the sources of errors. Single source of error is considered such as cutting force [1,2], tool deflection [3], dynamic error [4]. Jia and Ma [5] reviewed the mechanism of the formation of the contour error and corresponding methods of compensation. Zhu et al. [6] considered the machine tool as a rigid multi-body system and proposed a model of a geometric error, and the geometric error was compensated by identifying the error sources in the model. Hu et al. [7] proposed an error prediction method considering tool rotation error, machine geometric error, and tool deformation error. The influence of the above three kinds of errors on the geometric error of parts was analyzed by experiments. These models between the errors and sources of errors are analytical or semi-empirical, which need to be calibrated in a laboratory or factory before actual machining. Besides, the sources of errors are tightly coupled to each other, so it is of no accuracy to build a model even if varieties of sources of errors are considered. The other type is based on the actual error distribution. These studies focus on analyzing the characteristic of original errors, and propose some methods to remanufacture at the same part or compensate the errors at the next part. Lo and Hsiao [8,9] proposed error compensation methods firstly, with the beginning of 3-axis end milling for a square block. Cho et al. [10] proposed a method of machining-errors identification, combining the neural networks algorithm and OMM (On Machine Measurement) technology.
Poniatowska and Malgorzata [11] obtained the systematic errors by machining a number of surface in the same condition, and compensated systematic errors by modifying the tool path. Chen et al. [12,13] proposed a spatial statistical algorithm and an EMD (Empirical Mode Decomposition) algorithm to decompose systematic and random errors based on OMM measuring data, and compensated the systematic errors by modifying NC codes. Jung et al. [14] enhanced the machining accuracy by compensating the volumetric errors of the machine tool. Ma [15] presented an error compensation method for five-axis ball-end milling by reconstructing the CAD model using on-machine-measurement data. Zhu [16] proposed an error compensation method for robotic flanking by globally fitting the cutter envelope.
This paper proposes an error compensation method based on analyzing actual error distribution, and the compensation process is carried out by modifying the original tool path, combining the ideology of single-point offset (SPO) algorithm, which is detailed introduced in Ref [17].
The remainder of this paper is organized as follows. In Section 2, the definition and mathematical expression of ruled surface are presented, and the flow of the proposed method is illustrated. In Section 3, the detailed process of error compensation for five-axis flank milling is proposed. In Section 4, a machining experiment is carried out to validate the proposed method, and the results of the experiment are shown and discussed. Section 5 gives the conclusions of this paper.

Mathematical expression of ruled surface
Ruled surface can be defined as a surface formed by a straight generatrix sweeping along the baseline in 3D space. The mathematical expression of ruled surface by upper and lower alignments is expressed as: s, r , c c (2) where   The norm vector at P is calculated as: Typically, the norm vector represents unit norm vector, and the unit norm vector is calculated as:

Global flows of proposed method
Step 1 Step 2 Step 3 Step 1

The error compensation method
This paper proposed an improved error compensation method, which can be applied in five-axis flank milling of ruled surface.  The tool path is generated by varieties of methods based on the cutting contact curve. In ideal conditions, the cutting contact curve of the cutter is closed to the straight generatrix of the surface infinitely. However, the actual machining process is complicated, and the formation of geometric error is controlled by varieties of conditions. In this paper, the model between error sources and actual error distribution is regarded as a black box, it is assumed that the error distribution is constant under the same conditions. On the one hand, the tool deformation accounts for a small proportion among all error sources [7]. On the other hand, the errors caused by cutting force is a small proportion of the machine centers [18] and the tool deformation can be neglected because of the slight material removal and low cutting force in the finish machining process. Therefore, the error distribution is nearly linear in the v direction. Further, the variation of cutter location hardly influences the black box. However, the cutter orientation affects the kinematics characteristics of the machine tool significantly, which will change the form of error distribution. So, the cutter orientation stays constant in this paper. As shown in Fig.2

Calculation of normal offset value and normal vector of the tool path
It is fundamental to acquire actual error distribution of the machined surface before error compensation. Error distribution is obtained by calculating the deviation between the theoretical points and the measured points.
The point-to-surface distance is replaced by error in the paper. Error is the basis of ,, ,, . As shown in Fig.3, 00 , uv e at (u0,v0) is calculated as value. In addition, both the tool path and ,0.5 e u must be projected in a plane and the cartesian coordinates of ,0.5 e u must be offset a radius of cutter before fitting.
where   The objective equation of multi-peaks Gaussian fitting is expressed as: where Y and X are variables of the fitting equation, K is the number of peaks of the data, q a , q b , and q c are coefficients of the fitting equation.

Tool path generation
Generally, the tool path containing cutter locations and cutter orientations is generated by CAM software, and then the post-processor converts the tool path into a NC program which can be recognized by a certain machine tool. The tool path regeneration is realized by modifying cutter locations.
Assuming the former tool path MM , the optimized tool path can be calculated as: x y z is the coordinate of the Lth cutter location,   ,,  As shown in Fig.4, S1 and S2 are the completely same ruled surfaces in geometry, and S2 is an offset surface of S1 in X direction. P1 is the tool path of S1 and generated by The machining process is shown in Fig. 5. Fig. 5 The machining process of the part.
The offline measurement experiment is carried out on a Daisy CMM (coordinate measuring machine, MPEE=2.0+L/300μm), which was equipped with a touch probe with a diameter of 4mm.
Surface S1 was machined firstly, and then it is transferred to the CMM after finishing process. 100×10 iso-parametric measurement points are distributed in surface S1. The machining error distribution was shown in Fig. 6 (a).

Result of experiment
Surface S2 is also measured on the Daisy CMM. The error distribution before and after optimization by the proposed error compensation method are presented in Fig. 8. The histograms of the 1000 errors of the surface S1 and the surface S2 are shown in Fig. 9 (10) where e denotes all the errors in the surface. The range of the errors is 0.4376 mm before compensation, and it changes to 0.4481mm after compensation, which indicates that the range of the errors maintains during the compensation is constant, what's more, illustrates the correctness of the proposed method in Fig. 2.

Conclusions
In this paper, a method of error compensation for the ruled surface is presented to increase the machining quality by modified the tool path based on the error data of the machined part. At first, the errors at the middle of the straight generatrix on the Despite the improvements in the work, there are also some shortcomings during the process. Although the measurement data of CMM is much precise than that of OMM, the errors of inspecting could not be eliminated completely. Moreover, the random error is over-compensated in this method unless measuring massive parts machined in the same conditions.
In future work, the tool orientation will be considered and improved in the tool path regeneration by analyzing the data deeply.

a. Funding
This study is supported by the National Natural Science Foundation of China (No.51675378).

b. Conflicts of interest/Competing interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to affect the work reported in the paper.

c. Availability of data and material
The errors and cutter locations before and after error compensation are available in Supplementary Material.

d. Code availability
Not applicable.

e. Ethics approval
Not applicable.

f. Consent to participate
All the authors, namely Gaiyun He, Chenglin Yao, Yicun Sang, and Yichen Yan have contented to participate in the paper and agreed to submit the manuscript.

g. Consent for publication
All the authors, namely Gaiyun He, Chenglin Yao, Yicun Sang, and Yichen Yan have contented to publish the manuscript after peer review.