High-precision modeling of CNCs’ spatial errors based on screw theory

A method for establishing machine tool’s spatial error model is put forward based on screw theory, which is different from the traditional error modeling method. By analyzing the position relationship between the ideal coordinate vector and the actual coordinate vector jointly affected by linear errors and angular errors, a single-axis screw conversion matrix error expression is brought up based on screw theory. Meanwhile, the comprehensive spatial error model of the CNC machine tool is derived by considering the influence of the workpiece motion chain and the tool motion chain on the model. Further, to compensating spatial errors of CNCs, such screw theory-based model is embedded in the error compensation system by means of integration of a few specific application examples. And in order to evaluate the compensation effects, an integrated evaluation method of quantitative spatial diagonal calculation and MATLAB simulation is proposed. Application results show that the screw theory-based spatial error model of tool has a very substantial compensation effect, which makes the position error of the machine tool decreased by about 80%. The highlight of the study reported here is threefold: Firstly, a high-precision spatial error model of the machine tool is derived by means of the screw theory. Secondly, a precision evaluation method of the machine tool combining qualitative and quantitative spatial error of the machine tool is proposed. Thirdly, through example verification, the high-precision spatial error model has a good compensation effect, which has great significance to the precision machining of the machine tool.


Introduction
With the rapid development of modern industry, CNC processing is focusing on high even ultra high precision. As a kind of primary precision processing tools, CNCs directly affect development of the entire manufacturing industry [1][2][3]. Geometric and thermal errors dominate CNCs [4,5]. The former dominates the overall error of a tool. Study of modeling and compensation of spatial geometric errors has a history of ages. Especially, modeling and compensation of spatial geometric errors of multi-axis CNCs are becoming more popular and challenging recently [6][7][8][9]. The tool error modeling theory is also based on spatial errors. The more representative modeling methods are based on the rigid body dynamics [10,11] and homogeneous coordinate transformation method [12,13]. Ferreira et al. applied the rigid body kinematics in 1986 to establish the parameterized relationship between the working point error vector and coordinates in the working space of a 3-axis CNC. Their work laid the foundation for study of space errors [14]. Okafor also applied the rigid body kinematics in 2000 to model a homogeneous transformation matrix of uniaxial geometric errors and derived a homogeneous transformation matrix of spatial errors between the tool and the workpiece under the assumption of small angular errors. The space error vector of the tool was calculated out finally by means of the inverse kinematics solution [15]. Jung et al. identified the elements in the error model based on measurement of the diagonal positioning errors and then established a mathematical model of spatial errors with 21 error elements by means of a homogeneous transformation matrix to verify its validity by machining hemispherical workpieces [16]. Yang Jianguo et al. derived geometric and thermal error models of a turning machining center based on a homogeneous coordinate transformation matrix and achieved real-time compensation [17]. Zhang Hu et al. deduced the error model of a CNC based on the rigid kinematics and homogeneous coordinate transformation and proposed a compensation method by modifying G codes. They experimentally achieved a good error compensation on a 3-axis CNC [18]. Xia Xiaojun applied the theory of multiple rigid body kinematics, the homogeneous transformation matrix and its differentiation to study the comprehensive arbitrary structure of a machine geometric error transformation matrix, and established a high-grade CNC of arbitrary structure by means of integration of the multi rigid-body kinematic model of geometric errors. He proposed error separation (identification) method for the original error terms [19]. Zhang Yueming established the error-free motion equations between adjacent bodies by means of the multi-body theory. The adjacent body kinematics theory was applied to establish a topological structure relationship of each moving part and the low-order body array, and model errors of a tool grinding system to predict the machining accuracy [20]. Zhao et al. established an error compensation model based on application of the single-axis error data and the combined interpolation algorithm of the motion shape function. With reference to the position and posture of the driving motor, its prediction errors were compensated based on correction of the motion command to achieve high-precision machining error compensation [21]. Xia et al. established a spatial error model of the grinder based on the homogeneous transformation matrix, the kinematic chain and measurements of the single-axis motion errors. Moreover, they put forward an actual compensation method based on IKM to compensate the position-related geometric errors of the worktable [22]. Huang analyzed the homogeneous transformation matrix method by means of modeling tool spatial errors and found that the measured point error data are not directly related to the tool point errors in terms of the generalized homogeneous transformation theory. The famous Abbe principle and the Bryan principle were applied based on the above analysis to derive the error terms in the parallel and perpendicular directions of motion, respectively. On this basis, a high-precision error model was established [23].
Study of error detection, modeling and compensation of 3-axis CNCs [24][25][26] is relatively comprehensive while some problems remain challenging so far. As those error modeling methods were based on the multi-body theory and homogeneous coordinate transformation, the measurement points were constrained but the positional relationship between the measurement and compensation points and effects of angular errors on the spatial errors were not taken into account in actual measurement. The homogeneous coordinate transformation requires establishment of multiple local coordinate systems, which is a tedious process. Most of compensation methods adopt the modification of G-codes [27], or external mounted compensators [28]. The compensation process is tedious or poor in real time but also the accuracy is not good at the same time. Based on the screw theory, the single-axis motion errors of a laser interferometer measurement point are expressed as a motion screw matrix. Also, the topology of the 3-axis CNC is coupled to analyze the kinematic chain. Finally, the tool containing the measurement point position and angular and spatial errors of the tool tip point in the working space is modeled. A comprehensive compensation module for spatial errors is developed based on the open CNC system (HNC818) and the compensation effect is evaluated in view of spatial error simulation and spatial diagonal error measurement.
The purpose of the study reported here is twofold: (1) To compensate for the machine tool error, a new modeling method for the machine tool spatial error is established based on the screw theory for improving the accuracy of the machine tool. (2) A method combining quantitative evaluation of the machine tool diagonal and the spatial error simulation is proposed, which is more accurate and intuitive compared with the traditional accuracy evaluation method of the whole machine tool. In Sect. 2, the method of model establishing is described. Section 3 discusses the compensation effect of the model based on the examples. Finally, conclusions are given in Sect. 4. head on the working platform, instead of that of the tool point. Due to the inevitable occurrence of angular errors, there is a certain difference between measurements and tool point errors. Thus, it is more reasonable to set up the spatial error model of tools in accordance with the rigid body and screw theory.

Modeling of uniaxial motion errors
As shown in Fig. 1, the tool point shall be ideally positioned at in Reference Coordinate System XYZ while it is actually positioned at p. The ideal angular velocity is , and the actual angular velocity is θ e at a certain angle from . Its ideal and actual screws of motion can be expressed as: There are position and angular errors (d and θ e ) between the ideal and actual positions. Thus, errors can be regarded as results of the screw motion with a moving screw of ξ e . The which is expressed as: In Eq. (1): "d" represents the position error between the ideal and the actual position of the tool tip; "ve" represents the instantaneous motion velocity of the tool tip; and "he" represents the screw distance of the tool tip.

Modeling of position errors
It can be shown in Fig. 2, as the research object the measuring point of a laser interferometer is focused in Global Reference Coordinate System O 1 X 1 Y 1 Z 1 where after the operation of the workbench its ideal coordinate vector becomes = X O1 Y O1 Z O1 Actually, its coordinate vector is = X O2 Y O2 Z O2 due to the positioning error of δ x (x) . At this point, the error screw can be expressed as: The corresponding rigid body transformation matrix due to the positioning error is calculated out as follows: where δ x (x) indicates the positioning error of the measuring point, which is our research object.
Similarly, when linearity errors in Directions Y and Z only exist during the movement of the table along Axis X, the error screw can be expressed as 0 1 0 0 T and 0 0 1 0 T , respectively. The rigid body transformation matrix can be calculated as follows: where δ y (x) and δ z (x) represent the errors of Y and Z straightnesses of the measuring point.

Modeling of angular errors
In the light of the above equations, when an angular error only exists, the error screw can be expressed as: where indicates the direction of error rotation, which is used to describe the angular error in the motion error of the bed axis of a CNC and often refers to the direction of the motion axis.
As shown in Fig. 3, the measurement point of a laser interferometer is taken as our research object in O 1 X 1 Y 1 Z 1 . While the workbench moves a certain distance in Direction x and g only has angular error around Axis Y, ε y (x) can be written as: On this basis, when the table moves along Axis X, the rigid body transformation matrix is expressed as: where ε y (x) represents the pitch angular error measured by the laser interferometer at Command Position x.
Similarly, if there is an angular error around Axis X orZ while the table moves along Axis X-axis, the error screws can be expressed as: where ε x (x) and ε z (x) represent the measured roll angle and yaw angular errors at Commanded Position X of the measuring point; ê ε y (x) represents the attitude change of the workbench in case that there is an angular error around Axis Y, which indicates the change of position error due to the angular error in the fourth column vectors ( −Z O 2 ε y (x) and X O 2 ε y (x)) .

Comprehensive modeling of single-axis motion errors
While a machine tool uniaxially moving, the existed 6-motion errors can be regarded as 6 differential rotating motions around Axes X, Y and Z. Thus, such 6 motion errors can be multiplied in turn to represent the screw transformation matrix of the uniaxial motion errors; namely, the rigid body transformation matrix is as follows ( Fig. 4):

Spatial error modeling based on the error screw matrix
As per requirements of ISO 10791-6, the kinematic chain of Tool XYTZ can describe the composition of the tool and workpiece kinematic chains. Its kinematic chain is analyzed here (Fig. 5). Its tool kinematic chain is made up of z-axis, spindle tool and connecting parts while its workpiece kinematic chain contains Axes X and Y, worktable, workpiece and connecting parts. Their coordinated movement achieves the movement of the tool in the workspace relative to the worktable.

Modeling of workpiece movement chains
The kinematic chain of the workpiece includes Axes X and Y. As per the theory of screw, its transformation matrix of the kinematic chain in relation to Reference Coordinate System is ideally expressed as: where ̂Y ⋅ y and ̂X ⋅ x are ideal motion screws along Motion Axes x and y; and g a bw (0) is the initial position and attitude matrix of the measurement point; namely, the installation position of a laser interferometer relative to Reference Coordinate System is expressed as: Because there are 6 motion errors in the straight spool of a 3-axis tool, the error motion screw is now added to the motion transformation matrix. The actual transformation matrix of the tool point position relative to Reference Coordinate System on the workbench can be expressed as: where ̂Y a and ̂X a are the actual screw of motion; ya and xa are the directions of the actual axis of motion; ê Y e and ê X e are the Y-and X-axis error screw transformation matrices, respectively; and g a bw (0) = g i bw (0) is the rigid body transformation matrix of the actual measurement point relative to Reference Coordinate System.
For a linear axis, its motion screw and screw motion can be deduced from Eq. (14), which are expressed as: where represents the unit vector in the direction of the moving axis; for example, = 1 0 0 ,andθ i = x exist for Axis X.
In this respect, the position and angular errors of the workpiece movement chain can be expressed as the difference between the actual and ideal positions and attitudes of the tool point: where Δ represents the error of the tool point in Reference Coordinate System, and = X tw Y tw Z tw represents the coordinates of the tool point in Local Coordinate System where the measuring point is taken as the origin.

Kinematic error modeling of a tool kinematic chain
A tool chain is composed of z-axis and the tool. Ideally, its pose transformation matrix relative to Reference Coordinate System is expressed as: Similarly, the error motion screw is introduced due to the existence of motion errors of the straight spool. The actual transformation matrix of the tool point position on the workbench relative to Reference Coordinate System can be expressed as: where ̂Z a is the actual screw of motion; za is the direction of the actual axis of motion; ê Z e is the z-axis error screw transformation matrix; and g a bw (0) is the actual rigid body transformation matrix relative to Reference Coordinate System.
Given all this, the position and angular error of the workpiece kinematic chain can be expressed as the difference between the actual and ideal positions and postures of the tool point: where Δ represents the error of the tool point in the workpiece coordinate system; and = X tt Y tt Z tt represents the coordinates of the tool point in the coordinate system where the measuring point is taken as the origin.
Equations (9), (10) and (11) are solved simultaneously, and the error of the tool movement chain relative to Reference Coordinate System is written as:

Modeling of spatial errors
As per analysis of the motion error of the tool and workpiece kinematic chains of the CNC, the motion errors of the entire kinematic chain relative to the fixed coordinate system are obtained. The error function of position in directions x, y and z of the uniaxial direction can be obtained by analyzing the uniaxial motion. The spatial error of the tool point is based on interaction effects of both tool chains. Thus, the spatial error model of the CNC is expressed as:
A laser interferometer (Renishaw XM-60) is used in our example verification, of which linear error resolution is 1 nm, and the angular error resolution is 0.03 microradians. A laser head is equipped at the workbench. A 6-D sensor is equipped at the tool spindle. As per the principle of dimming, the laser head and the 6-D sensor are aligned to establish their communication. The measurement starting point, spacing, interval time and other parameters are set in the measurement software and the tool table moves in parallel to measure the tool geometric errors in Axes X, Y and Z (Fig. 7).

Machine error data acquisition
In case of non-collision and considering the rationality of the experiment, the travels of Axes X, Y and Z are selected as follows: 0-1300 mm, − 650 to 0 mm, and − 650 to 0 mm. In case of meeting the national relevant measurement requirements, the measurement spacing is taken as 100 mm, 50 mm and 50 mm. Axes X, Y and Z are divided into 13 segments, respectively. Six geometric errors of Axes X, Y and Z are measured with the laser interferometer successively. The measurements are shown in Figs. 8, 9 and 10. Figure 8 indicates that the measured travel of Axis X and distance are [0, 1300] mm and 100 mm, respectively.

Simulation evaluation
The MATLAB simulation method is applied here. The measurements and the error model and the single-axis error measurement file are imported into the spatial error measurement software for calculation. The spatial errors (ε x , ε y and ε z ) of feature points in the spatial error field are obtained. The color separation diagram of the error field is obtained by means of the Matlab simulation tool (Fig. 11). This method can be applied to qualitatively evaluate the overall spatial accuracy of the tool.

Evaluation of the body diagonal accuracy
Evaluation of the spatial accuracy of a tool is usually based on the diagonal precision index so far. In a 3-axis CNC space, there are 4 body diagonals which can reflect the overall spatial accuracy of the tool. The 4 body diagonal lines of the machine tool are indicated by PPP, NPP, NPN and PPN, respectively. In general, its accuracy can only be shown while the diagonal accuracy indexes of its 4 bodies are simultaneously high. There is no international standard for the body diagonal accuracy as of now. Our study shows that the accuracy indexes of 4 body diagonal accuracy of a CNC can be controlled within 20 μm at the same time but also the accuracy of the tool is very high. For evaluating the spatial accuracy of a tool, a laser doppler instrument and a step-step diagonal measuring mirror group are utilized to measure its whole travel space (Fig. 12).
Sizes of the working space of our tool for measuring the diagonal of the laser step-step body are 1300 × 650 × 650 mm, and the total length of the diagonal of each body is 1592.16 mm which are divided into 13 grids. X, Y and Z are measured step by step in each lattice. The corresponding moving vectors of each step are (100, 0, 0), (0, 50, 0) and (0, 0, 50). The measurements of the diagonal errors of the positive and negative bodies are shown in Fig. 13. Figure 13 shows the positioning error curves of Diagonals PPP, NPP, PNP and NNP of the spatial body of 3-axis CNC (Fig. 10). The maximum positioning errors of Diagonals PPP, PNP and NNP are − 58.2 μm, − 51.5 μm, 57.5 μm and − 7.3 μm, respectively.

Development of our compensation software
After obtaining the compensation data of the tool execution end, an error compensation module was developed on the Huazhong 8-CNC system platform based on the tool space error model. This error module contains functions such as basic measurement interval, grid spacing, grid point setting and compensation file reading. The interface of our compensation module is shown in Fig. 14.

Precision evaluation after performance of compensation
Firstly, the machine tool spatial error compensation model established is input into the system compensation software (Sect. 3.3.1), which can calculates out the trip point error compensation value (E x , E y and E z ) according to the travel position point coordinates (x,y,z) of the machine tool. Then, the machine tool control system stores the error compensation value into the compensation list within the system. Lastly, when the machine tool runs to a specific travel position, the system obtains the corresponding error compensation value in the compensation list to implement the real-time error compensation of the machine tool. Then the tool spatial errors are compensated by means of our system compensation software. The tool space error field is simulated. The tool spatial error field is shown in the Fig. 15.   Figure 15a presents ε x of the tool in the whole space after compensation of the system. The space errors of X (0-1300) mm, Y (− 150 to 0) mm and Z (− 550 to 0) mm are within 5 μm. The errors of X (0-1300) mm, Y (− 650 to 150) mm and Z (− 650 to 50) mm space are among 5-10 μm. They are rarely above 10 μm. Figure 15b shows ε y in the entire space after compensation of the system. The space errors of X (500-1200) mm, Y (− 650 to 0) mm and Z (− 200 to 0) mm are below 5 μm. The space errors of X (400-1100) mm, Y (− 650 to 0) mm and Z (− 650 to 450) mm are among 10-20 μm. Only a few errors fall in 5-10 μm. Figure 15c shows ε z in the entire space after compensation of the system. The space errors of X (0-1200) mm, Y (− 650 to 0) mm and Z (− 400 to 0) mm are among 10-20 μm. The space errors of X (600-1200) mm, Y (− 650 to − 200) mm and Z (− 650 to 0) mm are above 25 μm. Few space errors are less than 10 μm.
After the tool errors are compensated by means of our compensation software, the tool diagonal errors are measured. The measurements are shown in Fig. 16. Figure 16 shows that the maximum positioning errors of PPP, NPP, PNP and NNP are − 11.9 μm, − 11.4 μm, 11.8 μm and 1.5 μm, respectively. Their diagonal accuracies in the tool space meet the requirements of high precision and our compensation effects are remarkable.
Based on comparison of our space simulation and spatial diagonal quantitative evaluation before and after performance of compensation, the specific compensation effects are shown in Table 1.
In terms of the qualitative evaluation of simulated tool spatial errors, Axis-X, Y and Z errors without compensation are among 0 to − 60 μm, 40 to − 55 μm and 0 to − 100 μm, respectively. In contrast, Axis-X, Y and Z errors are among 1 to − 13 μm, 20 to − 23 μm and − 2 to − 29 μm after performance of compensation. Comparison of simulated tool space errors indicates that the overall tool space errors fall greatly.
In terms of quantitative evaluation of the body diagonal errors, the compensated maximum errors of NPP, PNP, NPP and PPP are up to 58.2 μm, 51.5 μm, 57.5 μm and 7.3 μm, respectively. Their errors peak up to 11.9 μm, 11.4 μm, 11.8 μm and 1.5 μm, respectively. Comparison of the diagonal error data indicates that their diagonal accuracies can meet the high-precision requirements after performance of compensation. Thus, our compensation effects are significant.

Discussion
In our previous published article [29], a comprehensive error model of the machine tool based on the spatial feature point is proposed, but it does not take into account for the distance of the motion direction between the compensation point (tool point) and the measurement point, so that the compensation effect is not ideal. Therefore, our author considers the machine tool error change as the motion screw of the machine arm from the perspective of robotics to establish a machine tool spatial error model based on the screw theory which effectively circumvents the deficiencies in previous studies. Comparison with the comprehensive error model of the machine tool proposed in the previous paper, the proposed method greatly improves the compensation effect, which provides new ideas for the spatial error modeling of machine tool.

Conclusions
The errors of the measuring points are utilized to perform tool error compensation currently. Because of effects of the angular errors and measuring positions, the measured point errors cannot represent the position errors of the actual compensation points (tool points) so that the compensation system may be mostly unable to achieve real-time comprehensive compensation. For overcoming the above shortcomings, the spatial error fields are modeled based on the travel theory to simulate the workpiece and tool motion chains. In accordance with our model, a quantitative precision evaluation method is put forward here for the tool diagonals. The precision of a body diagonal represents the partial precision of the spatial area of a tool due to the multi-axis coupling effects. Thus, the error status of all spatial positions of a tool cannot be fully reflected. In this regard, a simulation method of the whole spatial error field of a tool is presented here by means of the Matlab analysis method, which can be utilized to qualitatively evaluate the spatial accuracy of the whole tools. In addition, a spatial error compensation system where there are functions of original error analysis, high-precision modeling, diagonal error calculation and error field simulation is specially developed here to verify the compensation effects. An empirical analysis is introduced to verify the effectiveness of our error compensation model and accuracy evaluation method. For a 3-axis tool, its 3-axis positional accuracies are compensated to 19.4 μm, 18.2 μm and − 27.6 μm, respectively; and their four-bar diagonal errors are 58.2 μm, 51.5 μm, 57.5 μm and 7.3 μm, respectively. After performance of our compensation, its 3-axis positional accuracies fall to 3.9 μm, 3.1 μm and − 5.8 μm, respectively; and its four-bar diagonal errors are 11.9 μm, 11.4 μm, 11.8 μm and 1.5 μm, respectively. Our compensation effects are comparatively clear. Such achievements show that our high precision compensation method is feasible and effective. To improve the tool's | https://doi.org/10.1007/s42452-021-04929-2 accuracy, ensuring the quality of parts and reducing wasteful spending, the current method may be further researched. In fact, the real-time compensation techniques of tooling spatial errors will be more complicated and difficult. How to interpolate real-time error data into a CNC system to achieve real-time dynamic compensation will be much more difficult and challenging. This will be our next focus of the study.
Acknowledgements The authors would like to thank Lin Zhang, Chao Wang, Hua Xiang, Guangqing Tong and Dianzhang Zhao for their contributions in writing and also are grateful to the support of the Fund.
Author's contributions GC: conceptualization, methodology, formal analysis and writing; LZ: methodology, software, investigation and preparation of writing-original draft; CW: software and visualization; HX: software and methodology; GT: investigation; and DZ: investigation.

Data availability
The experimental data for the measured point errors that will be used to support the findings of this study in future are currently embargo, while the research findings are commercialized. Request for data, 12 months after publication of this study, will be considered by the corresponding author (zjjll123456@126.com).

Conflict of interest
The authors declare that they have no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.