All position-independent and position-dependent geometric error measurement and identification of the precision of a horizontal boring machine tool

Geometric error is the main obstacle that affects the quasi-static accuracy of horizontal boring machine tools. To improve quasi-static performance, the error terms of all position-independent geometric errors (PIGEs) and position-dependent geometric errors (PDGEs) must be measured and identified precisely. This study proposes a novel method for measuring and identifying the above two types of geometric errors based on double ballbar for the rotary axis. The error terms of the linear axis are identified from the measurement model based on the exponential product method and a preset measure trajectory, and the measure coordinate system is combined with the reference coordinate to lower the uncertainty in the identification accuracy. Then, the elastic net method and improved weight function IGG3-LTS method are established to identify the PIGEs and PDGEs of the rotary and linear axes, respectively. This method has the advantage that measurement with the built-in sensor method synchronously does not interfere with the running state of the machine tool, and neither the inaccuracy of reference-frame misalignment nor installation error of the measuring instrument affects the geometric error identification results of the linear axis. Moreover, all PIGEs and PDGEs, particular to the rotary axis of the horizontal boring machine tool, are determined accurately. The measurement and identification strategy is demonstrated by experimental comparison on a four-axis precision horizontal boring machine tool. The minimum compensation rate of each precision index of the test specimen is 40.0%, the average compensation rate is 52.7%, and the maximum compensation rate is 62.5%.


Introduction
Complex case parts are the basic components of the machine tool headstock, gearbox, cylinder blocks and base, cylinder of the auto air-conditioner compressor, and other products, which are in great demand and have high precision requirements. Case parts are characterized by a complex shape and uneven wall thickness. There are not only holes with high position and shape accuracy requirements but also planes with high dimension accuracy requirements. Therefore, horizontal boring machine tools, machining equipment used for typical case parts, should have high and repeated positioning accuracy, as well as high-speed and efficient processing performance [1,2].
Geometric accuracy is an important indicator to evaluate the performance of horizontal boring machine tools [3,4], and geometric error is a direct reflection of the geometric accuracy of machine tools, which account for 40% of the main factors that affect the machining accuracy of computer numerical control (CNC) machine tools [5]. The implementation of error compensation technology is an effective method in addition to the design of machine tools to address deviations and accuracy degeneration caused by assembly, manufacturing, and operation of machine tools [6,7]. The broad definition of error compensation technology includes error modeling, error measurement and identification, and error compensation [8]. To improve the geometric accuracy of machine tools, geometric errors are eliminated via kinematics modeling, measurement, and identification.
The mapping model of geometric error and error vector can characterize the error terms and spatial accuracy, and in-depth studies have been performed to establish a volumetric error model [9,10]. Regarding the positiondependent geometric error, the algebraic values of the error terms correspond with the position of the motion axis. Because the measured value of motion error is discrete, it must be processed to establish the error element model. A position-dependent geometric error (PDGE) is related to the position of the motion axis and unrelated to the others axes; it can be expressed as a function of the feed of the corresponding motion axis, and polynomial fitting of error data via least squares is common [11]. According to the properties of the basic geometric error term of the rotary axis, Lee et al. [12] adopted the C 1 continuous function to express PDGEs and then identified the parameters with a model by means of error measurement. However, the fitting accuracy must be discussed, and the degree of the polynomial should be further studied. In view of the above problems, Fan et al. [13] established a unified model of four types of three-axis machining centers based on the singular function and orthogonal polynomial model of geometric error terms, and Abbe's error was expressed as a function of the angular error and offset of the linear axis. Li et al. [14] adopted moving least squares to overcome local overfitting of high-order polynomials when modeling the basic geometric error terms. Tang et al. [15] established compensation values by means of the Jacobian matrix via an instantaneous ideal contact point model of geometric errors of the multi-axis machine tool. Ngoc et al. [16] proposed a model to predict thermally induced geometric errors with deep learning LSTM, in which the input and output parameters are the powers of the rotary axes and the thermally induced geometric error terms of the five-axis machine tool, respectively. Huang et al. [17] proposed a novel geometric error model for a three-axis machine tool based on the Abbe and Bryan principles, and the defects of hole-transporting materials (HTMs) in serial-type machine tool structures were analyzed. Ridge regression and a polynomial model were used by Tian et al. [18] to describe the source of the geometric error of the machine tool, and linear mapping between the error parameters to be identified, and the double ballbar (DBB) rod length was established. The comprehensive effect of each geometric error term on the workspace of the machine tool was characterized by the comprehensive geometric error model; that is, the comprehensive error model of the machine tool contains all the PDGEs and position-independent geometric errors (PIGEs). The current geometric error modeling technology of CNC machine tools is based on the theory of multibody systems. HTMs of each component are established, and matrix manipulation is performed according to the topological structure of machine tools [19,20]. In addition to the common homogeneous transformation modeling methods, scholars have proposed various geometric error modeling methods for machine tools. Chen et al. [21] regarded the geometric error of the moving axis as differential motion and introduced a differential transformation into the geometric error modeling of CNC machine tools. Tang et al. [22] adopted error flow theory to model the geometric error of a multi-axis system and revealed the error transfer mechanism of the multi-axis system. Screw theory has also been applied to model the kinematic error of series mechanisms [23,24]. A general kinematics model of the five-axis NC machine tool based on the global coordinate system was established by Yang et al. based on screw theory [25], the general Jacobian matrix of position error was derived, and the approximate linear relationship between the tool position and the motion axes was established. Xiang and Altintas [26] established a five-axis machine tool space error unified model based on screw theory by introducing the error screw; then, each error term was modeled effectively. The above method has the advantage of clearly expressing the quantitative mapping relationship between geometric error terms and error vectors; however, all the existing well-defined comprehensive models can be improved by considering the PIGEs and PDGEs specific to the rotary axis of the horizontal boring machine tool when modeling the geometric error.
Several measuring methods and devices have been developed to measure geometric error. Xing et al. and Ibaraki reviewed the measurement methodologies of multi-axis machine tools to identify the value of geometric error [27,28]. Based on these studies, geometric error is characterized by several measuring methods, such as the laser interferometer measurement [29], plane grating [11], machine visual inspection [30], artifact standard [31], R-test measurement [32], laser tracker measurement [33], double ballbar (DBB) [34], and machining test [35] methods. However, some of these approaches, such as the DBB and plane grating methods, are susceptible to a range of measurements. The machining method test for the identification of geometric errors of the rotary axes is easily coupled with dynamic errors and cutting force-induced errors. The touch-trigger probe method is inevitably influenced by the friction of the contact surface and the vibration of the trigger, and it cannot be sampled continuously under a high sample rate. Realtime measurements cannot be achieved via the laser interferometer and laser tracker measurement methods. Existing methods to measure the geometric error of the rotary axis for horizontal boring machine tools are not applicable in terms of precision detection and maintenance, and built-in sensors are typically used for condition monitoring of machine tools. However, these sensors are not used in geometric error measurement and identification.
Because PIGEs are caused mainly by the deviations in the assembly of moving components of machine tools and are approximately treated as constants that deviate from ideal coordinates of the motion axis [28,35], the mapping relationship between the spatial error vector and the PIGEs and PDGEs can be quantified via the POE modeling, HTM, differential motion matrix, and Abbe and Bryan methods.
Clear differences exist in the number, intrinsic nature, and spatial distribution of PIGEs between the structure of different machine tools and the constraint relationship of components [36]; for instance, three-axis machine tool with 3 PIGEs (three squareness errors), a four-axis horizontal boring machine with 6 PIGEs, a tilting rotary table type (RRTTT type), and a rotary spindle head type (TTTRR type) five-axis machine tool with 11 PIGEs, and 13 PIGEs are particular to five-axis machine tool with a tilting head and rotary table (RTTTR type) [36]. The PIGE numbers of common multi-axis machine tools are shown in Table 1.
The six PDGEs of the linear and rotary axes can be determined through an indirect method with a single multipledegree-of-freedom measurement system (Renishaw XL 80) or a direct measurement method with multiple degrees of freedom (Renishaw XM 60, API 6D). However, the geometric error of the rotary axis is difficult to measure directly [39]. According to the conclusions reported in Kvrgic et al. [39] and Geng et al. [40] to the best of the authors' knowledge, there are no reports on recommended measuring instruments to determine the PIGEs of rotary axes via direct measurement methods, especially in the stage of accuracy maintenance and detection. Currently, the development of a PIGE measurement and identification method to compensate for geometric errors is a hot research topic.
The basis of multibody system theory, the homogeneous coordinate transformation method, and screw theory used rigid body system theory and the small-angle approximation hypothesis [15,35,41]. The above methods have produced good results in modeling machine tool geometric and thermal error [25,26]. The servo errors of the axis drives are important from the perspective of the measurement accuracy and the accuracy of the machine tool and feed system [42]. In the process of geometric accuracy modeling of the linear axis, the following assumptions and guarantee conditions are made: (1) The moving part of a multi-axis machine tool is a rigid body, and elastic and thermal deformations are negligibly small compared to the geometric error [43]. Other error sources, such as thermal, control, and force-induced errors, are ignored after rational accuracy allocation [44]. (2) For the measurement accuracy of the built-in sensor of the NC machine tool feed system, each axis of motion should be give priority to the closed-loop measuring system, including the assembly deviation of linear encoders and encoders of the servo motor, which can be guaranteed by using precision parts and signal processing and strictly controlling assembly deviation [45,46].
Previous studies have focused on geometric error measurements of three-or five-axis machine tools with off-line identification; however, obvious differences, including the number and characteristics, exist among various types of machine tools. Furthermore, measurement and identification methods developed for one configuration machine tool cannot be directly applied to other tools. The most notable case is the measurement and identification method for the geometric error of four-axis horizontal boring machine tools, which lacks systematic research. Nevertheless, the configuration with a rotary table of horizontal boring machine tool has been paid little attention. Only Cheng et al. [29,38] proposed geometric error identifications method with dial indicator and inspection plate for horizontal machining center with a rotary table. From another perspective, the offline measurement and identification of method of geometric error increases the complexity of the measurement and reduces the identification accuracy of geometric error. The advantages of the method considered in this paper are as follows. First, an online method for measuring and identifying linear axis geometric errors is proposed on the basis of built-in sensors in a multi-axis machine tool, and the identification accuracy is improved based on the IGG3 method. Second, all the PDGEs and PIGEs specific to the rotary axis of the precision horizontal boring machine tool are measured via DBB.
The structure of this paper is as follows: In Sect. 2, comprehensive geometric error modeling of multi-axis machine tools is presented, and the mapping between the geometric Table 1 The PIGE numbers of common multi-axis machine tools Type of machine tool PIGEs number Du et al. [11] Three-axis machine tool 3 Wang et al. [33] Four-axis machine tool (horizontal machine tool) 2 Zhong et al. [37] Four-axis machine tool (horizontal machine tool) 3 Cheng et al. [38] Four-axis machine tool (horizontal machine tool) 6 Ibaraki S et al. [28] Five-axis machine tool (RRTTT type) 11 ISO 23-1. [36] Five-axis machine tool (TTTRR type) 11 Guo et al. [7] Five-axis machine tool (RTTTR type) 13 error terms and the spatial error vector is derived. In Sect. 3, a DBB measurement method for rotary and geometric error measurements based on built-in sensors for linear axes is proposed, and the measurement and identification of the geometric errors of precision horizontal boring machine tools is elaborated in detail. In Sect. 4, experiments are conducted on a precision horizontal boring machine tool to validate the effectiveness of the proposed measurement and identification method and geometric error compensation. Finally, conclusions are drawn in Sect. 5.

Screw theory and POE modeling
A screw is a line vector containing screw torque and is a sub-algebra of the Lie algebra se (3). According to Chasles' theory, the motion of a rigid body in Euclidean space is equivalent to rotary motion around an axis and spiral motion along the axis [47]. Because single-parameter kinematic joints are easily driven, machine tools are composed of revolute joints and translation joints. The screw of the ith kinematic joint in the mechanism is ̂ i , and the expression of the six-dimensional vector ξ i is i i T , which can be defined as the screw coordinates. ̂i can be mapped to ξ i with operator ^, and ξ i can be mapped to ̂i with operator ˅. For revolute joints, the screw coordinates are: where ω i ∈ R 3 is the direction of the rotary axis and q i ∈ R 3 is an arbitrary point on the rotary axis. For the rotary axes of a machine tool, ξ i can be defined as the screw unit that satisfies both of the following criteria: The homogeneous coordinate representation ∧ i is: The motion of the rotary joint is η i when the command value is θ.
where For translation joints, the screw matrix is: where v i ∈ R 3 is the direction of the linear axis. For the linear axes of a machine tool, ξ i can be defined as the screw unit that satisfies the criterion ‖ i ‖ = 1.
The motion of the translation joint is η li when the command value is m The screw, including the rotary movement and translation relative to the motion axis, is where n i is the screw torque of the spiral motion.
The forward kinematics formula of the n-DOF series mechanism is: The established POE screw theory model can be used to express the forward kinematics of multi-DOF serial robots in addition to multi-axis machine tools.

Geometric error modeling for multi-axis machine tools
Multi-axis serial machine tools are composed of a workpiece kinematic chain and tool kinematic chain. The workpiece kinematic chain is composed of linear axes, worktable, and workpiece, and the tool kinematic chain is composed of the cutting tool, spindle, linear and rotary axes, and bed of a machine tool. According to the forward kinematic model of multiaxis machine tools, the screw matrix of the workpiece coordinate system relative to the machine tool coordinate system is: The screw matrix of the cutting tool coordinate system relative to the machine tool coordinate system is: According to Eqs. (1) and (2), the screw matrix of the tool coordinate system relative to the workpiece coordinate system is: where Equation (12) is equivalent to: On the basis of the unit vector of the translation axis and rotary axis, the basic spatial topological relationship, and each axis under the local reference coordinate system of the machine tool, the comprehensive forward kinematics model can be determined directly and then used to calculate the position and orientation of the tool and measurement coordinate system relative to the workpiece.
Taking the geometric error modeling of a horizontal boring machine tool as an example, the horizontal boring machine tool is shown in Fig. 1. The reference coordinate system is established on the machine bed: the direction of each local coordinate system is the same as that of the machine coordinate system. The workpiece coordinate system, spindle coordinate system, and tool coordinate system are connected to the worktable, Z-axis, and spindle, respectively.
Each axis of motion contains three linear errors and three angular errors. The three angular errors (link errors) among the three linear axes represent the squareness error, and the three angular errors among the rotary axis and linear axes represent the angle and position deviations. The 30 geometric errors of a four-axis machine tool are listed in Table 2.
According to the formulas of the kinematics model Eqs. (9) and (10), the space position vector of the four-axis machine tool is: The transformation of these error screws of the multi-axis machine tool can be expressed in exponential matrix form as follows: The above kinematics model can be used to identify and predict geometric error. In contrast to the general geometric error model, the one expressed in Eqs. (14) and (15) includes all the geometric errors of four-axis CNC machine tools. The measurement coordinate system is unified with the reference coordinate system of the machine tool according to the constraint relation between the workpiece chain and cutter chain, which increases the flexibility of the error measurement and identification.

Measurement path and identification scheme of the rotary axis
No available equipment can measure all the PIGEs and PDGEs of the rotary axis directly. Thus, this paper proposes an identification method based on the motion measurement of the DBB to measure and identify these geometric error terms. Two precision balls are installed on the worktable and the tool chuck through the center seat and tool cup, respectively. The magnetic ball installed on the tool side is the tool ball, and the magnetic ball installed on the worktable side is the workpiece ball. The spatial relationship among the magnetic balls under the influence of the geometric error of the rotary axis can be directly derived by constructing a measurement scheme that satisfies the identification conditions. The measurement patterns for the geometric error of the rotary axis with the DBB are shown in Fig. 2.

Measurement modeling of the motion error of the rotary axis
According to matrix theory, matrix operations do not obey the commutative law. In addition, based on the theory of mechanism analysis, matrix multiplication from left to right represents the motion of the rigid body relative to the reference coordinate system; matrix multiplication from right to left represents the motion of the rigid body relative to the motion coordinate system. This definition is applicable to the mechanism of machine tools and robots [48].
In the measurement modeling of the geometric error of the rotary axis, the reference coordinate system and geometric representative of a typical body (motion coordinate system of the B-axis) and its low-order body (reference coordinate system) under actual conditions are shown in Fig. 3.
As shown in Fig. 3, the PIGEs are defined in the reference coordinate system, and the PDGEs are defined in the motion coordinate system of the B-axis. B k of the rotation axis (B-axis) is placed on the linear axis (Y-axis) of the machine tool, and the relative position between them is expressed via the transformation vector P kl . Because a position error P ke exists, i.e., PIGEs between the rotary and linear axes, the actual position relationship is P k . When B k of the B-axis rotates relative to B j , the ideal displacement of the B-axis relative to O kl is expressed by the transformation vector S ki . In addition, due to the position and attitude errors S ke , i.e., PDGEs in the movement process, the actual displacement can be expressed as [49]: where T jkp (B) is unit matrix I, which is the constant positional relation matrix of transformation vector P kl , △T jkp (B) is the position error matrix consisting of PIGEs, T jks (B) is the rotation angle of the B-axis, and △T jks (B) is the position and attitude error matrix consisting of six PDGEs. The three rotary PIGEs consist of a static position error transformation matrix, a homogeneous transformation matrix with the B-axis angle composed of an ideal transformation matrix without translational motion errors, and six PDGEs constituting a translational motion error-induced transformation matrix.
The actual position of the magnetic ball at the end of the workbench in the reference coordinate system can be   In the process of B-axis movement of the machine tool, the workpiece ball rotates with the B-axis, and the ideal position of the tool ball in the process of B-axis movement is (w 1 , w 2 , w 3 ). The tool ball is connected to the machine tool through the tool spindle; the X-, Y-, and Z-axes are kept stationary; and no geometric error exists at the end of the tool ball.
Ideally, the position of the magnetic ball at the end of the worktable is: In practice, the position of the magnetic ball is: The space error vector of the workpiece ball can be obtained by calculating the difference between the ideal and actual spherical center coordinates, as follows: To identify all the geometric errors of the rotary axis, the identified method uses the proposed geometric error measurement patterns of the DBB, as shown in Fig. 2.
The initial positions of magnetic balls O 1 and O 2 for the nine patterns can be determined on the basis of the structural parameters of the DBB and other fixtures.
The nominal length of the DBB is R 1 in measurement pattern 1 (P1), the installation coordinates of the tool ball are (0,0,h), the installation coordinates of the workpiece ball are (x t1 ,0,h), and R 1 = (x t1 ) 2 + h 2 . According to the deviation between the ideal position and the actual position of the Similarly, in measurement pattern 2 (P2), the nominal length of the DBB is R 2 , the installation coordinates of the tool ball are (0,0,h), the installation coordinates of the workpiece ball are (x t2 ,0,h), and R 2 = (x t2 ) 2 + h 2 . According to the deviation between the ideal and actual position of the workpiece ball in the coordinate system of the machine tool, the variation in the length of the ball bar is: In measurement pattern 3 (P3), the nominal length of the DBB is R 3 , the installation coordinates of the tool ball are (0,0,h), the installation coordinates of the workpiece ball are (− x t1 ,0,h), and R 3 = (− x t1 ) 2 + h 2 . According to the deviation between the ideal and actual position of the workpiece ball in the coordinate system of the machine tool, the variation in the length of the ball bar is: In measurement pattern 4 (P4), the nominal length of the DBB is R 4 , the installation coordinates of the tool ball are (0,0,h), the installation coordinates of the workpiece ball are (− x t2 ,0,h), and R 4 = (− x t2 ) 2 + h 2 . According to the deviation between the ideal and actual position of the workpiece ball in the coordinate system of the machine tool, the variation in the length of the ball bar is: In measurement pattern 5 (P5), the nominal length of the DBB is R 5 , the installation coordinates of the tool ball are (0,0,h), the installation coordinates of the workpiece ball are (0,y t5 ,h), and R 5 = (y t5 ) 2 + h 2 . According to the deviation between the ideal and actual position of the workpiece ball in the coordinate system of the machine tool, the variation in the length of the ball bar is: Similarly, in measurement pattern 6 (P6), the nominal length of the DBB is R 6 , the installation coordinates of the tool ball are (0,0,h), and the installation coordinates of the workpiece ball are (0,y t5 ,h). The variation in the length of the ball bar is: In measurement pattern 7 (P7), the nominal length of the DBB is R 7 , the installation coordinates of the tool ball are (0,y t7 ,h + l), the installation coordinates of the workpiece ball are (0,y t7 ,h), and R 7 = (y t7 ) 2 + h 2 . According to the deviation between the ideal and actual position of the workpiece ball in the coordinate system of the machine tool, the variation in the length of the ball bar is: Similarly, in measurement pattern 8 (P8), the nominal length of the DBB is R 8 , the installation coordinates of the tool ball are (0,y t7 ,h + l), and the installation coordinates of the workpiece ball are (0,y t7 ,h). The variation in the length of the ball bar is: In measurement pattern 9 (P9), the nominal length of the DBB is R 9 , the installation coordinates of the tool ball are (30,y t9 ,h + 40), and the installation coordinates of the (25) workpiece ball are (0,y t9 ,h). The variation in the length of the ball bar is: Equations (21), (22), (23), (24), (25), (26), (27), (28) and (29) can be used to obtain the expression of the error identification matrix, as shown in Eq. (30).
where After the structural of machine tool and installation parameters of DBB are substituted to the above formula Eq. (30), the geometric error of the rotary axis can be identified. In particular, when the machine model and the position of the rotary axis are changed, distribution of PIGEs changes with the variation of configuration of machine tool [28,36]. Hence, identification matrix established especially for one configuration cannot be used on other ones directly. Specific structures and parameters should be involved to construct identification equations and measurement modes.
Equation (30) shows the linear mapping model between the error parameters to be identified and the DBB rod length error: where e i is the error element vector to be identified, which contains all the geometric errors of the rotary axis, and M i is   The least squares method can be used to calculate the geometric error of the rotary axis; however, for the mapping matrix M i , one eigenvalue is much smaller with respect to the order of magnitude than the others such that small fluctuations in the mapping matrix can cause considerable changes in identification accuracy. To address this issue, the elastic net method is adopted to identify the algebraic value of the geometric error terms; the regression criterion of the elastic net is: The estimated penalty coefficient of the elastic net can be determined by minimizing the fluctuation of the regression criterion, and the penalty coefficient λ 1 , which is related to λ 2 , is defined as follows: In this case, the solution of the penalty coefficient is equivalent to the following optimization problem: The elastic net can be solved by via the Lasso solution according to the following method. The data array (△r i * ,M i * ) is defined based on the given data (△r i ,M i ) and penalty coefficients (λ 1 ,λ 2 ).
Moreover, by defining = 1 √ 1+ 2 and e j * = √ 1 + 2 e j , the regression criterion of the elastic net in Eq. (33) is: (32) indicates that the dimensionality of the data array (△r i , M i ) is n + p, and the rank of M* is p. Furthermore, the regression coefficients are compressed and the variables are selected; then, geometric errors are identified.

Measurement principle of a built-in sensor for linear errors
The acquisition method of the position signal of the builtin sensor is determined on the basis of the signal type of the measuring device of the servo feed system of the CNC machine tool. The position feedback signal format is generally obtain in a sinusoidal (1vpp), square-wave pulse, or EnDat signal format. The feedback signals of the grating ruler, encoder, and other built-in sensors can be obtained via full closed-loop control: the grating ruler provides the position feedback signal and the encoder provides the speed feedback signal [46,50,51]. The principles of this approach are shown in Fig. 4. To avoid interrupting the normal operation of CNC machine tools in the process of signal acquisition, three-way sampling is adopted via a three-way interface parallel input signal to acquire position information [52]. The theoretical relationship between the position feedback signal P f and the speed feedback signal θ v under the influence of geometric error is as follows: where k is the ratio of the lead of the ball screw to the reduction ratio. The built-in signal is sampled based on a time series; position information can be obtained simultaneously, and it is possible to resample the signal based on position [53].
Time series sampling is implemented with the built-in sensor of the acquisition instrument, and effective data are obtained with different sampling accuracies. Data analysis and processing methods in the position domain are proposed according to the characteristics of the sampled signals of CNC machine tools. Moreover, the position signal must be resampled before analyzing and processing the position domain.
The characteristic signal of the CNC machine tool is converted into a discrete digital signal by sampling equipment, and the signal must be refit before position resampling. The resampling steps are as follows: 1. The position signal is fitted by cubic spline.
2. The sampling interval is selected according to the signal characteristics. The servo feed system of the CNC machine tool has two types of motion, namely, along the rotary axis and linear axis, and the sampling interval of the linear axis is: The following position sampling function can then be obtained: The sampling accuracy of position resampling is related to the motor parameters: the lead screw of the linear axis is 16 mm, and the number of poles of the servo motor is 8.
Positioning error of the motion axis arises due to the manufacturing error of parts and wear caused by the force of the machine tool, which can be reflected in the space position vector of the machine tool. The positioning error can be directly mapped to the end of the kinematic chain, and measurement and identification are the foundation for establishing kinematics models; however, as only the positioning error can be determined directly, the measurement path should be planned to identify other geometric error terms.

Measurement path and identification scheme of linear errors
The measurement trajectory is established in the Cartesian coordinate system, as shown in Fig. 5.
Because the measurement paths are straight lines that are distributed in three planes, the proposed method is called the line-surface method, and the measurement trajectory is A I → B I → D I → C I → B I → D I → A I in plane I. A similar measurement trajectory A II → B II → D II → C II → B II → D II → A II is applied to plane II, and A III → B III → D III → C III → B III → D III → A III is applied to measurement plane III.
The measurement datum can be defined as A i , and each measurement plane is analyzed with respect to the reference point. The measurement method based on the built-in sensor signal does not involve the installation error of the special measuring device; therefore, the installation error is not introduced into the forward kinematics model of the machine tool.
A flowchart of the measurement identification based on the line-surface method is shown in Fig. 6.
The process of geometric error identification can be divided into four steps: Measurement and identification of position deviation Step 1 Measurement and identification of position deviation The rotary axis remains stationary when measuring the geometric error of the linear axis; thus, the influence of the PIGEs and PDGEs of the rotary axis can be eliminated effectively, and the geometry error model of the machine tool, which does not include the rotary axis, as shown in Fig. 2, is as follows: The positioning error of each measuring point can be determined based on the theoretical coordinate value and the measured value, and the coordinate deviation along the X-axis can be obtained on path L 10 : The coordinate deviation along the Y-direction within the X-axis is as follows: The coordinate deviation within the Y-axis can be obtained on path L 14 : The coordinate deviation along the X-direction within the Y-axis can be obtained as follows: The coordinate deviation along L 12 and L 13 within the X-and Y-axes can be obtained, respectively, as follows: Step 2: Measurement and identification of pitch error and yaw error The pitch error εz(x) can be determined on the basis of the relationship between the deviation and geometric error on path L 12 and path L 10 in plane I: Similarly, the yaw error εz(y) of the Y-axis along path L 13 and path L 14 in plane I is: Step 3: Identification of positioning error and straightness error The positioning error δx(x), straightness error δy(x), and straightness error δx(y) of the X-direction of the Y-axis are obtained as follows: Step 4: Measurement and identification of the squareness error The geometric relationship of the squareness error S xy and straightness error in plane I is shown in Fig. 7.
L 10 and L 13 are reference lines in Fig. 5, and S xy is the squareness error. The angle between the trend line of the measured and ideal trajectory can be mapped to the squareness error. According to the measured values of multiple measuring points, the trend lines of measured paths L 0y = a 0 x + b 0 of L 10 and L 4x = a 4 x + b 4 of L 13 are calculated via linear regression.
For a multivariate linear model with one variable y t and k independent variables, assuming that the total number of samples of least trimmed squares regression (LTSR) is n, the independent variable n ∈ R n×k and y t ∈ R n , the linear regression model can be expressed as: where β is the regression coefficient, and ε is the error term and ε ∈ R n .
The sum of squares of residuals corresponding to each regression coefficient β can be expressed as: where y i is the measured value. The sum of squares of residuals are then arranged in ascending order as follows: The objective function β LTS is expressed as: where h is the truncation constant, h = int[(n + k + 1)/2], k is the number of independent variables, and int represents the integral function.
Sampling is repeated S n times, and the estimated value of LTSR is determined according to the coefficient of the curve corresponding to the minimum value of the sum of squares of residuals S n .
Different weights can be assigned to each residual to control its contribution to the sum of squares, and the standardized residual is more reasonable statistically than is the residual as the parameter of the weight function. The formula of the standardized residual is: where ω i is the standardized residual; r i is the residual; g ii is the normalization factor, whose value is the main diagonal element of the residual cofactor matrix Q vv ; and σ 0 is the unit weight mean square error.
The IGG3 weight function is typically adopted for the function matrix, as follows: where k 0 and k 1 are the harmonic coefficients; ṽ j is the standardized residual of the correction number v j ; σ 0 is the variance factor of unit weight; and median (·) represents the median function.
The harmonic coefficients k 0 and k 1 of the weight function are selected according to the ratio of the area of the standard deviation of the normal distribution to the total area, and k 0 and k 1 are 1.5 and 2.5, respectively.
Because the first-order derivative of the weight function is discontinuous at point k 0 , the numerical points near k 0 cannot be calculated via robust estimation. Therefore, an improved weight function, IGG3, is established to divide the residual data into 4 segments to avoid discontinuities [41]. The improved weight function IGG3 is expressed as: where the range of the harmonic coefficient k 0 in the improved IGG is 1.0 to 1.5, the range of k 1 is 2.5 to 3.0, f is the number of kinematic parameters, and According to the value of p * j , the improved weight function can divide the residual data of straightness into four segments: effective information, front segment of available information, back segment of available information, and harmful information. Different robust weight function formulas are used to calculate the fitting coefficient, and the original weight is maintained for the effective information segment. The available information segment is partitioned to ensure that the weight function is continuous and differentiable. Weight reduction processing is applied to the valuable information segment data; then, a small weight is assigned to observation values with large error and a large weight is assigned to observations with small error such that the large gross-error data occupy a smaller proportion in the overall sum of squares of residuals.
The flow of the calibration algorithm of the trend line of the straightness error based on the improved weight function of LTS is as follows: 1. The initial LTS value of the equation coefficient of the trend line of the straightness error is calculated. The residual error r(1) and number of iterations are determined, and the initial unit weight mean square errors are obtained. 2. Standardized residuals ω are calculated, and the weight is determined according to the IGG3 weight function array P. 3. Iteration is conducted as i = i + 1 to calculate the weighted least squares estimate p (i) p and residuals r (i) . 4. The formula for calculating the estimate of the mean square error 0 = √ r T Pr n (i) −p of the unit weight is derived, where r is the residual matrix, n (i) is the number of points after excluding the observations with zero weight, and p is the number to be determined.
The best estimates of the coefficients of the trend line of the straightness error are output when the iteration satisfies the criterion The inclination angle α x , α y ∈ [0, π] can be calculated using the slope of the trend line of the two measuring paths; then, the squareness error between the two axes can be obtained as follows: Similarly, the squareness error S yz can be identified along the trajectory in planes II and III. Furthermore, the pitch angle error εx(z), yaw angle error εx(y), straightness error δz(y), δy(z) and positioning error δy(y) in plane II can be identified, and the angle errors εy(x), εy(z), straightness error δz(x), δx(z), and positioning errors δz(z) can be identified in plane III.
Step 5: Roll error and setup error identification Six geometric errors are identified, in addition to the rolling error, after the above measurements and identification are performed. According to the established machine tool space geometric error model, the functional relationship between △x I and △y I and the related geometric errors in measurement plane I can be determined, and the deviation in the Z-direction is zero, as follows:

Case study
In this paper, the TGK 46,100 precision horizontal boring machine tool with a Siemens 840D CNC system is used as an example to model and measure the geometric error, and the machine structure is consistent with the schematic diagram shown in Fig. 2 in Sect. 2.
Based on previous research [46,[53][54][55][56] and the academic research idea of reasonably controlling variables, The dynamic error induced by the machine tool servo feed system is improved by optimizing the dynamic characteristics. Active thermal balance design and thermal error compensation are performed in the precision allocation and maintenance stages, respectively, and assembly deviation of the feed system is prevented. Due to space constraints, the relevant research on the dynamic characteristics of machine tools through precision distribution, analysis of assembly error, and friction error compensation is not covered here. The main parameters of the precision horizontal boring machine tool are listed in Table 3.
The ambient temperature was controlled at 20 ± 2 °C with an air conditioning device to minimize the influence of the environment on the measurement results, and the relative humidity was maintained at 60 ± 5% RH. To verify the proposed measurement method based on the built-in sensor method, experiments are performed on a precision horizontal boring machine tool, and the experimental setup is shown in Fig. 8.
The linear encoder plays a vital role in the built-in sensor measurement system used to acquire the position data of the machine tool, which is necessary to calculate the positioning error. Hence, high-accuracy sensors are selected to construct the measurement system to minimize the original error of the encoders. The Magnescale type SQ47 is selected to collect position data: its accuracy is ± (1.5 + 1.5 L/1000) µm, its resolution is 0.01 µm, and L is the effective length. An angle encoder with 2048 output wavenumbers per revolution and an accuracy of ± 2.5″ at 20 °C is used as the built-in servomotor. Circular trajectory measurement with DBB is an effective method to assess detection accuracy that is recommended by ISO 230-1. To verify the face line method based on the built-in sensor, a Renishaw QC20-W DBB is adopted to perform the circular trajectory measurement, and the results are compared with those of the face  line method. The measurement radius is 50 mm, the feed speed is 200 mm/min, and the measurement system was developed by our research team [46,[53][54][55][56]. The circular trajectories in three planes are shown in Fig. 9.
As shown in Fig. 9, in measurement planes I, II, and III, the roundness deviation based on the built-in measurement method is 4.0 μm, 2.7 μm, and 2.1 μm, respectively. Based on the DBB measurement method, the roundness deviation in measurement planes I, II, and III is 4.3 μm, 2.8 μm, and 2.4 μm, respectively. The sphericity error obtained by the built-in signal and the spatial DBB test method is 108.7 μm and 101.5 μm, respectively. The relative error of the spatial sphericity error obtained by the built-in position signal test method is 7.1%, and the relative error of the roundness error is in the range of 3.6 to 12.5%.     To verify the measurement accuracy of the plane-line method based on built-in sensors, the identification value and comprehensive error model are used to determine the comprehensive error vector within the measurement range. The compensation method was developed based on the Siemens 840D CNC system by our research team. The corresponding parameters of each axis in the numerical control unit must be modified to add the error compensation values of each motion axis on the position command of the servo system in real time, and the identified values of geometric error and the kinematic model established in Sect. 2.2 are substituted into the compensation calculation. Variable reading, domain servicing, and program calling can be realized through the NCDDE server, and real-time compensation can be realized by calling the program block in each compensation cycle. A flowchart of the algorithm of the main program block for calculating the compensation value of spatial error is shown in Fig. 14.
The compensation signal is added to the original command value via algebraic operation. Then, the command values in the position loop of the CNC system are updated, and compensation values of the geometric error are created to counteract the original error. To further verify the effectiveness of the error measurement method, actual processing and comparison of the dimensional accuracy of the specimens before and after the geometric error compensation are conducted. The specimens are designed with the CAD/CAM software UG, as shown in Fig. 15.
A boring cutter with a diameter of 32 mm is used to process all the outer surfaces of the specimens. The cutting speed, feed per tooth, and radial cutting depth are 40 mm/ min, 0.05 mm, and 0.15 mm, respectively. The case part is machined, and geometric error compensation is performed in area I; in contrast, the geometric error for area II has not been compensated or corrected. The specimen is measured on a Hexagon Global classic SR 575 coordinate measuring machine after machining, and the precision index of the specimen is listed in Table 4.
As Table 4 shows, the minimum compensation rate on each item is 40.0%, the average compensation rate is 52.7%, and the maximum compensation rate of the machined part is 62.5%. Therefore, the spatial accuracy of the machine tool is improved by error compensation via the proposed measurement and identification method.

Conclusion
A novel method is proposed for measuring and identifying the geometric error of a precision horizontal boring machine tool. The greatest advantage of this method is the identification of all the geometric errors of linear axes of the horizontal boring machine tool with an on-line measurement method, whereas other methodologies can only achieve offline identification, and PIGEs and PDGEs of rotary axes specific to the horizontal boring machine tool are be identified with high accuracy. The following conclusions are obtained: 1. A comprehensive model based on screw theory is established to map the geometric error terms to the space  vector of the machine tool, and all the geometric errors, including 6 PDGEs and 3 PIGEs specific to the rotary axis of a four-axis precision horizontal boring machine tool, are identified in its own coordinate system. Based on the preset nine measured trajectories, the elastic net method is adopted to identify the algebraic value of the geometric error terms, thereby improving the measurement and identification accuracy. 2. A novel measurement trajectory is proposed for the 21 geometric errors of the linear axes of a four-axis precision horizontal boring machine tool based on the lineface measurement with built-in sensors method without interfering with the running state of the machine tool. An improved weight function IGG3-LTS method is established to identify geometric errors terms, and the identification accuracy is improved by means of iterative identification based on the corrected squareness error. 3. Geometric error compensation is performed based on the measurement and identification method. The experimental results indicate that the average compensation rate is 52.7%, and the maximum compensation rate of the machined part is 62.5%, indicating an effective reduction in the geometric error and improvement in the spatial accuracy of the machine tool.
The modeling and measurement PIGEs and PDGEs of a precision horizontal boring machine tool are the focus of this research. However, the original error encoder and the grating ruler unavoidably affect the measurement and identification accuracy of the machine tool, simply relying on the manufacturing accuracy of the sensor to ensure the identification precision is not appropriate for machine tool accuracy detection and maintenance. Therefore, factors such as machine dynamics, feature reconstruction of error signals, and assembly accuracy of the closed-loop measuring system of the machine tool can be considered in subsequent research to analyze the influence of various errors on the final machining accuracy. Data availability The datasets used or analyzed during the current study are available from the corresponding author upon reasonable request.
Code availability The code generated or used during the current study is available from the corresponding author upon reasonable request.

Declarations
Ethics approval This paper is compliant with all ethical standards.
Consent to participate All the participants provided informed consent.

Consent for publication
Informed consent for publication was obtained from all participants.

Competing interests
The authors declare no competing interests.