Regionalized compensation method for nonlinear error control

Although the five-axis machine tool presents excellent advantages of high-speed, -efficiency, and -precision machining of complex curved surface parts (impeller and blade), its actual motion demonstrates nonlinear principle error due to the participation of the rotating axis. Traditional methods, such as linear interpolation, rotation tool center point (RTCP), and tool point optimization, can effectively control nonlinear errors despite their limitations. A regional compensation optimization method is proposed in this study to solve nonlinear error problems effectively in five-axis machining of complex curved surface parts. First, feature points of the complex free-form surface are identified, and regions are divided to distinguish the compensation optimization algorithm of each interval. Second, JAVA language is applied to develop a special postprocessor with nonlinear error partition compensation module. Finally, the BV100 machine tool is used as the experimental platform, and a turbine blade is utilized as the specimen for simulation and cutting experiments. Results showed that the surface quality and contour accuracy of machined parts improved when the nonlinear error regional compensation optimization algorithm is used.


Introduction
Five-axis machine tools are widely used in aviation, aerospace, and automotive fields and other industries due to their advantages of high flexibility, degree of freedom, and precision and significant effect on the processing of highprecision curved surfaces [1][2][3][4]. However, compared with that of traditional three-axis machine tools, the increase of two rotational degrees of freedom of five-axis machine tools results in many technical issues in practice because it increases not only the flexibility of tool processing but also the complexity of the machine tool structure and difficulty of machine tool kinematics analysis [5][6][7]. Tool center trajectory will deviate from the theoretical trajectory and result in nonlinear errors, which will reduce surface precision of complex curved surface parts, due to the participation of two rotation axes. Many studies have primarily focused on the following fields to solve the problem of nonlinear error compensation of five-axis machine tools: First is linear interpolation. The nonlinear error is weakened by controlling the tool step length. However, a large increase in the number of programs due to an excessive reduction of the step length affects the NC system by prolonging the processing time and is not conducive to commercial economic benefits.
Second is rotary tool center point (RTCP) method. This method reduces the nonlinear error by controlling the tool center to be in the planned path. Nonlinear error studies based on the RTCP method have been successfully used [8][9][10]. For example, Zhang et al. [11] verified the effectiveness of the RTCP method through MATLAB simulation to analyze the kinematics of a double-swing five-axis machine tool. Shi et al. [12] implemented real-time interpolation planning for five-axis maximum feed speed based on RTCP algorithm, and the experimental results showed that this method can effectively improve the surface quality of parts. Although the RTCP algorithm can effectively control nonlinear error, its implementation method is very expensive because it involves an advanced NC system. Third is tool point position optimization method. This method reduces the nonlinear error by controlling the tool point trajectory [13][14][15][16]. Zhang et al. [17] proposed the SSALI method to avoid tool positioning beyond the theoretical programming plane. Li et al. [18] put forward a cubic spline interpolation and data density-integrated tool path optimization method to avoid overcutting phenomenon. Wu et al. [19] used harmonic function to construct a nonlinear error model and error compensation mechanism and verified its effectiveness through MATLAB simulation analysis. Although these methods can effectively reduce the nonlinear error, they can easily cause the phenomenon of corner or round corner overcutting because only the compensation of tool tip position is considered and whether the change of tool attitude meets the optimal cutting conditions is ignored.
Fourth is tool swing amplitude optimization method. This method controls the nonlinear error by adjusting the swing amplitude of adjacent points of the tool tip [20][21][22][23]. Fan et al. [24,25] proposed an optimization algorithm for cutter axis vector plane interpolation. Hong et al. [26] put forward a tool direction generation method based on surface triangular mesh. Although these methods can effectively prevent overcutting and improve the surface quality of parts when the tool rotation angle changes remarkably, they ineffectively compensate for nonlinear errors when adjacent tool axis vectors are in linear ratio or the tool feed direction is on the vertical plane.
To sum up, existing studies have mainly focused on nonlinear error compensation under a single factor constraint. However, a single nonlinear error processing method is unable to solve nonlinear error problems in the manufacturing process of complex curved surfaces effectively. A regional compensation optimization algorithm is proposed in this study to solve these problems. This manuscript contains the following research contents: First, compensation optimization algorithms for slow and sudden changes of the tool axis vector direction are established. Second, the recognition algorithm model is proposed to recognize the feature region on the tool path of complex curved surface while selecting different trajectory optimization algorithms according to the set recognition parameters. Finally, the BV100 machine tool and a turbine blade are used as the experimental platform and specimen, respectively. The experimental results showed that the proposed nonlinear error regional compensation method can improve the surface accuracy of machined parts in processing complex curved surfaces through simulation and actual cutting experiments.

Mechanism of nonlinear error
Although many types of five-axis CNC machine tools based on different kinematic configurations are available, nonlinear errors caused by the rotating axis are consistent in the mechanism. The BV100, a five-axis machine tool with a typical double-swing table structure, is used as the experimental platform in this study to examine the mechanism of nonlinear error. Figure 1 shows the local coordinate system of the BV100 machine tool. Mathematical expressions of each motion axis of BV100 according to the preliminary research results [9] are presented as follows: where X, Y, Z, A, and C are expressions of the drive value of each axis of the machine tool; (x t ,y t ,z t ) and (i, j, k) are the position and direction vector of the tool point in the workpiece coordinate system, respectively; and n x, n y , and n z are structural parameters of the machine tool.
The five-axis machine tool processing aims to recognize the movement instruction through data in the tool position file using the postprocessing software and execute actual machining. As shown in Fig. 2, the solid line that connects two blue circles represents the ideal trajectory of the machine tool coordinate system and the solid line with red asterisks represents the actual trajectory of the machine tool coordinate system. The actual machining process of the machine tool clearly showed that the actual trajectory is a spatial curve form due to the linear interpolation method of each axis and the deviation from the ideal linear trajectory produces nonlinear errors. The vertical projection distance of the solid line with red asterisks to the solid line that connects two blue circles is the nonlinear error value. (1)

Harmonic function algorithm
Wu et al. [19] proposed a nonlinear error prediction and compensation principle based on an analytic model for slow cutter axis vector transformation. The proposed principle is divided into a prediction model and a compensation mechanism that represent the prediction of nonlinear error value and the establishment of the compensation mechanism on the basis of the predicted value, respectively. The specific mathematical expressions is expressed as follows: where A i and B i are amplitudes of the harmonic function and n is the order of the polynomial. The first-order polynomial harmonic function n = 1 is used to improve the computational efficiency and predict the nonlinear error. is the , nonlinear error value matrix, A i is the maximum nonlinear error between two adjacent points, B i is equal to zero, and k is the relative position of interpolation points on the whole path in Eq. (3). Meanwhile, is the position point after compensation in Eq. (4).
Tool point data are applied to verify the Harmonic function algorithm as follows: Figure 3 illustrates the nonlinear error prediction model. The similar prediction and actual error values verified the validity and accuracy of the error function expression.
The prediction error is used as the actual error compensation value, and the nonlinear error compensation mechanism is constructed to reduce the nonlinear error value. A section of the five-axis tool position file was used for the comparison of uncompensated and compensated tool trajectories. The comparison results are presented in Fig. 4 a. The star-point curve represents the compensated tool trajectory, which approximates the ideal tool trajectory, while the curve with circles represents the uncompensated tool trajectory, which deviates significantly from the ideal trajectory.

Local path tool profile optimization algorithm
Wang et al. [21] proposed a local path tool attitude optimization algorithm to address the phenomenon of overcutting caused by the sharp change of the cutter axis vector when the machining surface is located at the circular corner. The transformation matrix O w X w Y w Z w of the workpiece coordinate system shown in Fig. 5 is established. The specific steps are referred to in Reference [21].
where and + are the starting and ending tool axis vectors, respectively; is the original tool axis vector; x , y , and z are the X 0 , Y 0, and Z 0 axes of the new coordinate system O w X 0 Y 0 Z 0 respectively; is the new tool axis vector; and E is the transformation matrix from the artifact coordinate system to the new coordinate system. Figure 6 shows the diagram of the tool axis vector planning optimization algorithm, where (u) is the planning vector of adjacent points in the new coordinate system and i (u) is the angle between the planning vector and the initial vector i . The function expressions of vectors (u) and j (u) given that the parameter u ranges from 0 to 1 are expressed as follows:  where is the unit vector attached to axis Y 0 of the newly created transformation coordinate system and perpendicular to i . (u) will reach the vector position j+1 when u = 1.
Thus, satisfies the following equation: The following formula can be obtained when Eqs. (6) and (9) are combined: According to Eq. (10), the tool axis vector planned in the new coordinate system is expressed as where the subscript number of (u) represents the column number of the vector. The optimized complement vector between adjacent tool axis vectors can be obtained by substituting Eq. (11) into Eq. (5).
The tool axis vector after linear interpolation deviates from the ideal position when an optimization measure is absent between two adjacent tool axis vectors. The tool axis vector is in an ideal state without any mutation phenomenon and generation of tool attitude error after applying the vector optimization algorithm. The results of comparative experiments are illustrated in Fig. 7. The experimental results showed that tool attitude optimization with local path can effectively compensate the abrupt change of tool axis vector direction or curvature radius.

The influence of tool swing angle amplitude on nonlinear error
The division of surface processing area depends on properties of surface feature points and is mainly judged by the variation of the tool axis vector. According to Eq. (1), the change of the tool axis vector will lead to the change of rotation axis angle, that is, the amplitude of the tool swing angle. The amplitude of tool swing angle is regarded as the planning condition of surface feature points to simplify the calculation.
The relationship between the nonlinear error value and the angle of the rotating axis A and C are obtained according to the method used in Reference [16] to verify the correlation between the variation of the amplitude of the tool swing angle and the nonlinear error value as follows: where A j+1 and A j are adjacent angles to the X-axis, C j+1 and C j are adjacent angles to the Z-axis.
Equations (12) and (14) are simplified by setting A j = 0 to obtain: Figure 8 shows the relationship between nonlinear error values and the amplitude of the tool swing angle. The nonlinear error value is equal to zero and clearly belongs to triaxial machining when the amplitude of the tool swing angle is zero. A large amplitude of the tool swing angle corresponds to a large nonlinear error value when the swing angle of the two rotation axes changes from − ∕2 to ∕2 . The blue area represents the nonlinear error below 0.1 mm, and the two black dots represent the minimum swing angle radians of axis A and B at the boundary of the blue area, which are 0.4712 and 0.2827, respectively, and the corresponding angles are 27 and 16°. Therefore, avoiding excessive amplitudes of the adjacent tool swing angle is necessary to improve the machining quality.

Executing strategy
As shown in Sect. 3.1, the change of tool axis vector can be judged according to the angle difference between adjacent rotation axes after transformation. The nonlinear error compensation and optimization measures for complex curved surfaces are shown in Fig. 9. The following boundary conditions of partition feature points are presented:

The difference between adjacent rotation angles is the same
The interpolation mode between two points is a linear motion without nonlinear error when angles of adjacent rotation axes are equal. Hence, the compensation optimization algorithm is unnecessary. The following judgment formula is used to simplify the calculation:

The difference between adjacent rotation angles is different
The boundary difference (set value is R) must be compared when the angle difference between adjacent rotation axes is set. If Eq. (17) is met, then the harmonic function method is adopted. If Eq. (18) is satisfied, then the local path tool pose optimization algorithm is adopted.

Data simulation verification
The tool path of the blade cross section is examined to verify the effectiveness of the proposed method. Figure 10 shows the diagram of the tool trajectory optimization plane for the blade part. The red curve is the original trajectory, and the dotted line is the compensation trajectory of the regional optimization algorithm. According to the execution strategy proposed in Sect. 4.2, the minimum swing value of axis A and B at the boundary of the blue area in Fig. 8 was taken as the selection criterion of parameter R which is 16, and the angle difference of the rotation axis of adjacent tool points on the blade trajectory was identified and assessed to obtain the four red-circle feature points in the figure. The blade trajectory was divided into four regions using feature points. Areas A and B in Fig. 10 are used as an example to analyses and the analysis of the rest regions are same as before. The angle difference between adjacent rotation axes at the corner of blade A satisfies Eq. (17). If the harmonic function algorithm is used to compensate, then the nonlinear error can be reduced to a certain extent. However, the overcutting problem may occur because whether or not the tool attitude is in a favorable cutting position is ignored. Therefore, the tool attitude optimization compensation algorithm is the ideal choice. Compensation diagram as shown in Fig. 11 for comparison of tool attitude optimization. The local amplification figure in Fig. 11 a clearly showed that the blue cutter axis vector deviates from the ideal vector, and using local tool posture optimization algorithm the red cutter axis vector is in ideal plane, which can effectively correct the cutter axis vector processing mutation status, avoiding the phenomenon such as overcutting during the processing and Fig. 11 b shows the compensation of the nonlinear error values close to zero. Figure 10 shows that the angle interpolation of adjacent tool points on the back arc of blade B satisfies Eq. (16). If the tool attitude optimization algorithm is adopted, then the calculation amount of the program increases to a certain extent. Hence, the harmonic function compensation algorithm is adopted to achieve the optimal compensation effect. The compensation diagram is shown in Fig. 12 for tool trajectory comparison. Figure 12 a demonstrated that the compensation trajectory is close to the original trajectory when applying the harmonic function compensation mechanism and Fig. 12 b shows the theoretical blue nonlinear error value after compensation is significantly less than 5 × 10 −3 mm . Therefore, the nonlinear error regional compensation optimization algorithm can effectively identify feature points of the complex curved surface and the appropriate compensation algorithm is adopted to achieve a satisfactory compensation effect.

Experimental platform and specimen
The five-axis machine tool BV100 with double-swing table is used as the experimental platform in this study. According to the established kinematics model and the proposed nonlinear error regional compensation optimization algorithm, a special postprocessing software for BV100 five-axis machine tool is written in JAVA language. The software can directly transform the tool location source file into a part-processing program that can be The feature of the tool location can be judged in the postprocessing method, and the nonlinear error compensation can be automatically carried out according to the set decision boundary conditions. The operating interface of the postprocessing software is presented in Fig. 13. The turbine blade is used as a specimen in this study to demonstrate the nonlinear error compensation experiment given the typical complex curved surface of the turbine blade body. The selected blade profile is formed by fitting multiple sections, of which the theoretical size of section B is 0.65 mm for the inlet edge, 0.25 mm for the outlet edge, and 3.8 mm for the maximum thickness of the blade. The blade blank model adopts a cylindrical blank of 80 × 220 (actual cutting involves 600 series aluminum alloy 6061, with a composition of Mg1%, Si0.6%, Cu0.3%), and three kinds of cutting tools are used for processing. The following process route planning of the blade profile is established using the UG11.0 software platform: Step 1 (blade roughing). The rough shape of the model was milled with a three-axis linkage.  Step 2 (semifinishing of blades). The blade profile is semifinished via five-axis radial spiral milling while leaving a finishing margin of 0.5 mm. 3.
Step 3 (blade finishing). The blades were finished using five-axis radial spiral milling and milling in place according to the theoretical size of the model.

Virtual simulation
Cutting simulation can master the possible collision and interference phenomena in actual machining in advance.
VERICUT simulation software developed by CGTech is used in this study for virtual machining. The VERICUT simulation software with functions of overcutting, interference inspection, program verification, and model measurement and analysis can accurately simulate the cutting of the tool and the movement of each axis of the machine tool in machining. The steps of simulation are as follows: First, establish of virtual machine. Machine model, control system, tool library, processing coordinate system, and other modules are set according to the characteristics of the BV100 machine tool. Second, processing preparation. A blank and NC program code are added and imported, respectively. Finally, start simulation process in the computer. The simulated cutting process is shown in Fig. 14. The absence of overcutting interference in the simulated cutting process indicated that the developed postprocessing software is effective and reliable.
Postprocessing of the program was carried out under the following conditions to verify the effectiveness of the proposed regional optimization strategy further during the blade finishing process in Sect. 4: (1) linear interpolation and (2) regional compensation optimization modes. The two NC codes after processing were simulated in VERICUT. The results are illustrated in Fig. 15.
A public area with high identification of the blade, including the inner arc, back arc, and inlet and outlet steam edges of the blade, is selected in this study to compare the algorithms efficiently. The effects of the two processing methods were compared in terms of the number of point of out of tolerance (residual number), in which critical values of the residual height and overcutting were set to 0 mm. The distribution area of green residual and red overcut points on the virtual blade specimen picture evidently demonstrated that the optimization effect of regional compensation is better than that without compensation. The four evaluation criteria for the correlation of nonlinear errors after blade processing under different algorithms, namely, overcut number, maximum overcut value, residual number, and maximum residual value, are presented in Table 1. The four evaluation criteria reach the maximum value in the NC code without compensation. The overcutting phenomenon of inlet and outlet steam edges can be effectively eliminated when the regional optimization compensation algorithm is used. The simulation results proved the rationality and effectiveness of the proposed algorithm. Therefore, the developed BV100 special postprocessing software can be used in practical projects.

Cutting experiment
The processed NC code was verified using VERICUT simulation processing, and the correct NC code is imported into the BV100 five-axis CNC machine tool for experimental verification. The tool path is smooth without alarm, interference, or collision in the whole process of blade machining. However, machined parts must be measured to verify whether the process requirements are met. The process parameters are listed in Table 2, and the processing and results are illustrated in Fig. 16. The overall appearance of the blade contour before and after processing indicated a minimal difference. The local magnified contrast picture shown in Fig. 17 was obtained by magnifying and comparing the local position of the blade corner to analyze the difference in detail. The local comparison picture demonstrated that overcutting is present in the blade corner processed by the linear interpolation algorithm but absent in the blade processed via the regional optimization algorithm. Therefore, the blade profile processed with the compensation algorithm is clearly better than that without compensation.

Measurement and analysis
Coordinate measuring machine (CMM) was used to measure the cross section of processed blades to verify the effectiveness of the nonlinear error regional compensation optimization algorithm. The results are shown in Fig. 18. The precision of several main features of the machined blade, such as maximum thickness, contour, inlet edge contour, and outlet edge contour, was measured.
The horizontal section A-A at the same place was measured using CMM to compare the processing results of linear interpolation and regional compensation optimization algorithm. The results are presented in Fig. 16. The profile of inlet and outlet edges of the blade without compensation machining is overcut. However, the regional compensation optimization algorithm can effectively eliminate the  16 Actual blade processing. a Machine process. b Linear interpolation. c Regional optimization overcutting problem of the inlet and outlet edge profile and meet the design requirements of the blade. The analysis of data in Table 3 demonstrated that the maximum thickness, contour, and contour accuracy of inlet and outlet steam edges of the processed specimen significantly improved after the blade adopts the regional compensation optimization algorithm. The deviation in the maximum thickness accuracy reduces by 0.0376 mm relative to the linear interpolation method only when the contour accuracy deviation is similar. Compared with those of the linear interpolation method, the upper deviation value reduces by 0.0054 and 0.0062 mm and the lower deviation value reduces by 0.2254 and 0.1107 mm, respectively. The simulation and actual milling of the blades specimen verified that the regional compensation optimization algorithm is more effective than the linear interpolation method in solving the nonlinear error problem of complex curved surface parts.

Conclusion
A regional compensation optimization algorithm was proposed in this study to solve the nonlinear error problem in the machining of complex curved surface parts globally. The BV100 five-axis machine tool and turbine blade were used as the experimental platform and specimen, respectively, to verify the effectiveness of the algorithm. The following conclusions can be drawn from the experimental results: 1. The surface can be divided into different compensation methods according to characteristic discrimination conditions of the complex curved surface to compensate for nonlinear errors. 2. The curved surface can be divided into different feature areas and various compensation algorithms can be applied on the basis of the variation condition of the tool axis vector.