Modeling and Prediction Method for CNC Machine Tools’ Errors Based on Spatial Feature Points

In order to improve the precision of CNC machine tools effectively, a method for modeling and predicting their spatial errors based on spatial feature points was proposed. Taking three-axis vertical CNC machine tools as the research object, we think that the whole space formed by machine tools’ working can be seen as the combination of a number of cubes, whose vertices are considered to be feature points, and others in the cubes are called nonfeature points. So, each nonfeature point’s errors can be predicted by the cube’s eight vertices’ errors. Based on the above ideas, an approach including the installing instrument for measuring any spatial feature point’s errors was put forward. In this way, all data of the feature points’ errors could be obtained. Moreover, according to these error data, the prediction model of nonfeature points’ errors was established by using the internal division ratio method. ,e method has the advantages of small interpolation operation, easy integration in the numerical control system, and high compensation precision. Finally, an example was used to prove its effectiveness and feasibility.


Introduction
With the rapid development of modern industry, CNC manufacturing technology is developing rapidly towards the direction of high precision and ultraprecision. As the main processing tool of precision manufacturing, CNC machine tools have a direct impact on the development of the whole manufacturing industry with their precision index [1]. Geometric errors and thermal errors are the two major errors of CNC machine tools [2,3]. e geometrical errors of CNC machine tools are a large part of the overall errors of machine tools. At present, the research on the measurement and modeling of spatial geometric errors of machine tools has been going on for a long time. In particular, the measurement and modeling of spatial geometric errors of multiaxis machine tools has become a hot and difficult issue in recent years. In 2004, He et al. [4] used a laser interferometer together with a rotary encoder to measure roundness error and locate precision. is method can effectively solve the problem that the measuring range of the ballbar is limited by the length of the bar. In 2005, Schwenke et al. [5] put forward the error measurement method for machine tools and CMM by using the single-light laser tracking interferometer. In 2009, Schwenke et al. [6] studied the measurement method of continuous tracking of the laser tracker in the air and identified six error elements of the rotation axis and then analyzed the uncertainty of measurement. Li et al. [7] proposed a 13-line method to identify the geometric errors of machine tools. In 2012, Zhu et al. [8] established a spatial error model of TTTRR five-axis machine tools based on multibody system theory. In 2016, He et al. [9] used a laser interferometer to measure the errors of X, Y, and Z axes, as well as the diagonal of four individuals. Based on the nonuniform rational B-spline, an adaptive mathematical expression model was established to describe the spatial errors of machine tools. El Bechir et al. [10] suggested a simulation methodology for errors caused by the interpolations B-spline and C-spline in high-speed machining of warped shapes and developed analytical models expressing the basic paths of the interpolations. In 2017, Chen et al. [11] attempted to establish an error model of 12 terms of polynomial in total for the triaxial linkage of machine tools based on the error measurement data of the whole working space of machine tools and preliminarily discussed the error prediction method for the points at different spatial locations of machine tools. In 2018, Cao and Sun [12] offered the principle of the photodynamic laser Doppler measurement system by analyzing the geometric errors of triaxial machine tools, introduced the method of the space error test path, and compensated with the space error compensation function of i5 system. Based on the research in 2016, El Bechir et al. [13] developed a method of compensating for these errors based on the insertion of the nodes, while respecting the predefined tolerance. To do this, they modeled and simulated machining errors before and after compensation for each type of interpolation. In 2019, Zuo and Li [14] proposed a method to change the trajectory of the ballbar in its working space and carried out spatial error modeling based on this method, which could accurately solve the rotation error elements of the cutter coordinate system and the workbench coordinate system.
Nowadays, taking average three-axis machine tools for an example in the research of CNC machine tool geometric error compensation [15][16][17], most of the researchers use the laser interferometer or other measuring instruments to measure geometric errors including perpendicularity errors at several points on three axes separately [18,19], without considering the coupling effects between axes [20][21][22]. en, according to the measured geometric error data of these points, they used all kinds of mathematical methods to calculate the machine tool error of the whole working space points. Obviously, the spatial error data obtained by this method are not accurate enough to represent the spatial errors of machine tools truly. In this paper, starting from the consideration of the three-axis combined superposition effect of machine tools, the error measurement model of a machine tools' coordinate position and spatial feature points is established.
is measurement method can realize the measurement of laser beam's arbitrary movement in the whole working space of machine tools, so as to measure the position errors of each point on the predetermined spatial lattice. ese data are used to set up a prediction model with the minimum interpolation algorithm and predict the spatial nonfeature points' errors.

Modeling Idea Based on Spatial Feature Points.
e whole working space of three-axis vertical CNC machine tools can be seen as the combination of a number of cubes. All the vertices are considered to be feature points whose errors will be measured, and others are called nonfeature points. In fact, these measurement positions in the whole working space of machine tools are precisely the feature points. e physical model of the spatial structure and grids formed by these feature points are shown in Figure 1.
All measurement points can be viewed from a vertical view, and the measurement lattices formed in the space can be seen from Figure 2. ese lattices form the feature points of machine tools in the whole working space, which represent the basic attribute of machine tools' spatial errors. ese feature points have fixed spatial position coordinates in the machine tools' spatial coordinate system, which can be described with a three-dimensional matrix ( Figure 3). e coordinate information of these feature points can be conveniently expressed by (x, y, z) and stored in the numerical control system. Among these feature points, eight adjacent points form a cube. Each vertex, namely, feature point, obtains the corresponding error vectors through a certain measuring method.
ese vectors contain six errors, but only three position errors' data are actually needed for the research.
In addition to the measurement feature points, the rest of machine tools' spatial points are the nonfeature points. Any nonfeature point is included in the corresponding cube. Every spatial error of any nonfeature point can be seen as a function of the eight vertices in its cube. According to the data of feature points' spatial errors, a prediction model of any nonfeature point can be established, which makes it possible to predict any point's error in the whole working space. e prediction model established by this method has the advantages of higher reliability and precision than those based on the data of uniaxial errors.

Installation Method.
According to the principle of laser measurement, through analyzing the laser interferometer installation method, machine tools' spatial errors can

Measuring Process
Step 1 (planning measurement paths). According to the X-, Y-, Z-axis' motion routes of machine tools, the requirements of the number of spatial points' errors to be measured and the compensation accuracy and the distance between measurement points can be set. In addition, the number of measurement points can also be set according to the measurement interval. Moreover, the measurement paths can be planned according to the measurement sequence from points, lines, and planes to the space. As shown in Figure 5, the whole working space of machine tools was divided into 10 planes. In fact, it can be divided into more planes according to the needs of compensation precision.
Step 2 (measuring all points' errors on the first surface). Firstly, to measure three errors at each point of X-axis, Z-axis is required to move to the vertical direction by one measuring distance of ΔL. Secondly, to get the three errors of each point at Z � ΔL, the head of the laser interferometer is required to move from the X-axis' zero point towards its positive direction. irdly, to measure the 3 errors at each point at Z � 2ΔL by using the laser interferometer head, move Z-axis to another measuring distance of ΔL towards the positive direction. At last, what should be done is to repeat the above processes to complete measuring all points' errors in the plane X 0 O 0 Z 0 .
Step 3 (measuring all points' errors on other surfaces). In the same way, moving Y-axis one measuring interval ΔL can get a new plane X 1 O 1 Z 1 . Meanwhile, we make the Z-axis move to the zero coordinate point. Next, the same measurement process can be used to complete measuring all positions' errors in the X 1 O 1 Z 1 plane. Secondly, moving Yaxis one measurement distance of ΔL gets a new plane X 2 O 2 Z 2 , and the spindle runs again to the zero coordinate point again. Next, we use the same steps to complete measuring all positions' errors in the plane X 2 O 2 Z 2 . e optical path of the measurement process is shown in Figure 6.
Repeating the above processes can complete measuring all points' error in all the planes in the whole working space of machine tools. In this way, the deviation data of feature points' error at the three directions of X, Y, and Z in the whole working space of machine tools are obtained.

Modeling and Prediction Method for Nonfeature Points'
Errors. All the measuring lines in the lattice divide the whole working space into many small cubes. All errors in the cubes are local, and the farther away from the center the point is, the less affected by the center it is. erefore, it is necessary Advances in Materials Science and Engineering to divide the whole cube into small parts and to perform interpolation in the local part. Interpolation inside the small cubes maintains the continuity of the boundary. erefore, it becomes possible to implement interpolation operations and establish a compensation prediction model in the whole working space. For a small cube, as shown in Figure 7, there are eight vertices, represented by P 1 (P 1x , P 1y , P 1z ), P 2 (P 2x , P 2y , P 2z ), . . ., P 8 (P 8x , P 8y , P 8z ), respectively, in which (P nx , P ny , P nz ) (n � 1, 2, . . . . . ., 8) represents the three coordinates of the nth vertex. e coordinate of any internal point is expressed as P (P x , P y , P z ), and its spatial errors are expressed as (C x , C y , C z ). In Figure 7, (C nx , C ny , C nz ) represents the three errors of the cube's nth vertex. e most direct interpolation algorithm is linear interpolation. Based on linear interpolation, the values of C x , C y , and C z show the 3 errors of each vertex, which can be determined by all distances from point P to the 8 vertices. After calculating all these distances, their weights can be determined. e internal ratios of the X-axis, Y-axis, and Z-axis are defined as x, y, and z, respectively. As can be seen in Figure 7, they can be expressed as Next, the point P's compensation prediction values C x , C y , and C z can be obtained, which are expressed as    Advances in Materials Science and Engineering After getting these values, C x , C y , and C z , all points' errors inside the small cube, including those points on the cube's plane or line, have certain compensation predicted values. On each plane, the errors' interpolation depends only on the four vertices on the plane, which are in coplanar with the neighboring cube. So, the interpolation is continuous on the neighboring cube's plane. On each edge line, its points' error interpolation only depends on the two endpoints, which are collinear with the four surrounding cubes. erefore, for adjacent cubes, they are continuous on the edge line.
is is especially true for vertices. It can be concluded that this interpolation method is continuous in the whole working space of machine tools.

Basic Information.
e research object of this paper is the XHK715 triaxial vertical machining center produced by Hubei Jiangshan Huake Digital Equipment Technology Co., Ltd. e CNC machining center adopts the HNC-818b/M bus central NC system, and the temperature sensors are installed on the bearing seat, nut seat, and spindle bearing seat of each feed shaft to detect the temperature change of the machine tools. Vibration sensors are also installed in the machine bed and spindle box to detect vibration frequency; the feed shaft of machine tools is equipped with the grating ruler, which can realize full closed-loop control. e feature dimensions of the overall structure of the machining center are as follows: the stokes of X-axis, Y-axis, and Z-axis are 800 mm, 500 mm, and 550 mm, respectively, and the size of the worktable (length × width) is 500 mm × 1,050 mm.

Data Acquisition of Feature Points' Errors.
Considering the rationality of the experiment, in case of noncollision, the triaxial strokes are selected as follows: Xaxis (−600, −250), Y-axis (−290, 60), and Z-axis (−120, −470), and their strokes are all 350 mm. Under the condition of meeting the relevant national requirements, the measurement interval is selected as 70 mm, and the X-axis, Yaxis, and Z-axis are all divided into 5 segments. us, there are 4 feature points inserted in the middle strokes. A large number of previous experiments proved that reading tended to be more stable after stopping the movement for 9 seconds. So, the measurement interval is selected as 9 seconds. According to the measurement method of lateral translation and the single-axis mode, each line with a point is measured in the order of x-y-z, y-z-x, and z-x-y. e location of the 18 Advances in Materials Science and Engineering measurement points selected in the space is shown in Figure 8. e 6D sensor of the laser interferometer communicates with the laser head, which transmits data to the computer through Internet. Supporting software provided by API is used to collect data. After these measurement parameters are set, the interferometer will automatically sample, and the data will be automatically saved. e measurement partial data in our experiments are shown in Table 1. e data of these 18 measurement points' errors can also be shown in Figure 9.

Establishment of the Prediction Model for Nonfeature Points' Errors.
e nonfeature points' errors in cubes are predicted by the method of internal ratio. Suppose that the errors' data of all cubes' eight vertices are all collected. In fact, every vertex has 6 errors, which can be expressed as (C nx , C ny , C nz , C na , C nb , C nc ); here, n � 1, 2, . . ., 8. is paper only needs to study the first three errors.
In this paper, the length of the smallest cube in the measured lattice is 70 mm. In this section, for the convenience of calculation, it is assumed that the length is 1. Set up a rectangular coordinate system, and suppose P1 is located at the origin, and the lines from P1 to P2, P1 to P4, and P1 to P5 are in the positive direction of the X-axis, Y-axis, and Z-axis, respectively. In this way, their internal ratios can be completely calculated according to equation (1). us, the P point's internal fraction is equal to the P point's coordinate. e starting point and the ending point of interpolation are x 0 � 0, x 1 � 1, y 0 � 0, y 1 � 0, z 0 � 0, z 1 � 1, respectively. When the P point is at the center of the cube, the P point's error values C x , C y , and C z of the X-axis, Y-axis, and Z-axis can be obtained and expressed as

Advances in Materials Science and Engineering
For the convenience of research, we chose a 3 × 3 × 3 lattice with a total of 27 points, which are, respectively, located in the center of the 27 smallest cubes. ese 27 points are both nonfeature points and verification points, which are used to verify the effectiveness of the prediction method. e starting and ending coordinates of the lattice are (−600, −290, −120) and (−250, 60, −470), respectively, and the measurement step is 70 mm. In fact, the starting and ending coordinates of the measurement lattice are (−565, −255, −155) and (−285, 25, −435), respectively.
Based on the above model and algorithm, we calculated the prediction values of these 27 points' errors. e calculated results are shown in Table 2.

Verification of the Prediction Model.
To compare the difference between the prediction value and the actual value of the 27 points' errors, we readjusted and installed the laser interferometer based on the method of measuring the whole working space points' errors proposed in this paper. We measured directly the 27 verification points' actual errors. ese symbols of D x , D y , and D z represent the 27 verification points' errors of the X-axis, Y-axis, and Z-axis, respectively. e result can be seen from Table 3. From Tables 2 and 3, we can get the comparison between the predicted value and the measured value of the 27 points' errors. Its prediction accuracy reaches within ±1 μm, as it can be seen in Figure 10. Tables 2 and 3   Advances in Materials Science and Engineering 7 and the measurement actual value. e formula is expressed as

Evaluation of Verification Effect. In
e values of Δx, Δy, and Δz reflect the accuracy of the prediction model. e residual value is shown in Table 4. e comparison diagram between the prediction value and the measurement actual value of the 27 verification points' errors is shown in Figure 11. e empirical analysis shows that the prediction accuracy of this method is only within 0.001 mm.

Conclusions
e current research on error modeling of machine tools ignores the problem that multiaxis linkage, coupling, and superposition will cause the spatial errors. A modeling and prediction method for CNC machine tools' spatial errors was proposed based on feature points, which effectively overcomes the above shortcomings.
In this method, through measuring the feature points' errors to obtain the modeling data, the prediction model of nonfeature points' errors was established by using the internal division ratio method. us, we can use this model to predict the compensation value of any point's error in the whole space. e method has the advantages of small interpolation operation, easy integration in the numerical control system, and high compensation precision. Research results show that the smaller the cube is defined, the higher the prediction accuracy is. e example also proved this well, and its prediction accuracy reached within ±1 μm, which shows this method is effective and feasible. e three key technologies to improve the spatial accuracy of machine tools are measurement, modeling, and compensation, respectively. In this paper, we solved the first. In fact, the study of compensation technology will be valuable and more complex. How to deeply integrate the error compensation model established in this paper with the CNC system will be challenging. We leave it as our further study.

Data Availability
e experimental data for the measuring point error and verification point error used to support the findings of this study are currently under embargo, while the research findings are commercialized. Requests for data, 12 months after publication of this article, will be considered by the corresponding author (zjjll123456@126.com).

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.  10 Advances in Materials Science and Engineering