A Non-Delay Error Compensation Method for Dual-Driving Gantry-Type Machine Tool

The drive at the center of gravity (DCG) principle has been adopted in computer numerical control (CNC) machines and industrial robots that require heavy-duty and quick feeds. Using this principle requires accurate corrections of positioning errors. Conventional error compensation methods may cause vibrations and unstable control performances due to the delay between compensation and motor motion. This paper proposes a new method to reduce the positioning errors of the dual-driving gantry-type machine tool (DDGTMT), namely, a typical DCG-principle-based machine tool. An error prediction method is proposed to characterize errors online. An algorithm is proposed to quickly and accurately compensate the errors of the DDGTMT. Experiment results verify that the non-delay error compensation method proposed in this paper can effectively improve the accuracy of the DDGTMT.


Introduction
The positioning accuracy of computer numerical control (CNC) machine tools is influenced by thermal errors, geometric errors, servo errors, etc. Geometric errors (i.e., errors in the geometry of mechanical components) accounting for 45-65% of total errors are a major source of positioning errors [1]. Geometric errors are different from an application case to another (due to differences in load, speed, and direction), and may change over long-term usage. Therefore, they are difficult to be measured and compensated.
Because of the large thrust, small inertia, large transmission stiffness, and large control bandwidth of dual-driving structure, dual-driving feed system has high precision and stability, so it is widely used in gantry-type machine tools and rectangular coordinate robots [2]. However, the different servo and mechanical characteristics between the dual axes result in the non-synchronous errors of the two axes, which does harm to the positioning accuracy and machining stability [3,4]. Therefore, it is a key problem to be solved to improve the accuracy of the dual-driving feed mechanism. Usually, a high-precision synchronous control strategy is used to improve the accuracy of the dual-driving feed mechanism. The synchronization control strategies include the master-slave synchronization control strategy [5], cross-coupled synchronization control strategy [6], and virtual electronic shaft Error prediction plays an important role in improving the operation accuracy and reducing the cost of CNC equipment. Error prediction can reduce the time of error measurement and reflect the error of CNC equipment under different operating conditions [17]. Error prediction can be online or offline. There are examples of using online prediction to calculate machining errors [18,19]. Yang et al. proposed an offline tool path generation and an online contour error estimation method to reduce the errors of a four-axis machine by 50% [20]. Using geometrical information of a reference trajectory, Li et al. proposed a high accuracy contour error estimation method for five-axis machine tools. Error estimation methods can reduce tracking and contour errors as well as filtering control signal [21]. Li et al. proposed a real-time prediction method to estimate thermal errors of a screw system considering various operating conditions [22]. Yang et al. proposed a generalized method to control a five-axis machine and estimate its contouring errors. Experiments showed that the error prediction and compensation method can greatly improve the accuracy of machine tools [23]. However, most of the error predictions are based on overall statistical results or empirical knowledge. Specifically, no attention is paid to the analytical approach in the error predictions of CNC machines, i.e., predicting the overall errors by assessing the source of errors in all axes. In addition, because of the particularity of dual-driving structure, i.e., coupled between axes in a single direction, the effect of these methods in dual-driving CNC machine tools has not been proved by experiments. According to the characteristics of the dual-driving structure, this research addresses the analytical approach with the aim to build a more complete and accurate prediction model, particularly considering errors caused by all motion axes.
The error compensation is one of the most effective methods to improve the machining accuracy. Error compensation methods can be either hardware-based or software-based. Hardware compensation relies on adjusting the structure of CNC equipment or using compensation devices. Cui et al. constructed Processes 2020, 8,748 3 of 25 an error compensation software system to realize error compensation via numerical control program reconstruction [24]. Dumanli et al. presented a dynamic error compensation approach and a novel data-based closed-loop tuning scheme to enhance the tracking accuracy of machine tool feed-drives by modifying a reference trajectory [25]. Xiang et al. proposed a method to measure, model, and compensate both volumetric errors of the five-axis, using the NC program based on the kinematic model [26]. Chen et al. analyzed measured data and modified the NC codes to compensate systematic errors [27]. Wang et al. adopted a closed-form iteration combined with a weighting method to deal with anisotropic situations which may reduce registration accuracy. The proposed methods provided an effective approach for machine tool volume positioning error calibration and compensation [28]. Zhong et al. established a recursive software-based method to compensate the geometric error of a large five-axis machining center prototype [29]. Software compensation methods include modifying system parameters (such as acceleration and velocity), modifying the NC program, closed iteration combined weighting method, zero offset method, and reverse compensation method. However, applying the above error compensation methods to DCG machines can be difficult due to the existence of non-synchronization errors in a DCG machine. For example, a dual-driving machine is equipped with dual motors and dual ball screws in a single feed direction. This mechanical structure involves complex mechanical coupling i.e., different servo characteristics, unbalanced forces, and synchronization problems that conventional compensation methods cannot deal with. Therefore, dual-driving machines require more effective error compensation methods. Besides, most error compensation methods are passive error compensation methods, which will cause the chattering of machine tools. The non-delay error compensation proposed in this paper refers to the prediction method based on the real-time measurement data to predict the errors produced by the machine tool, and the predicted errors are used to modify the position instructions before the machine tool moves to compensate in advance to achieve the non-delay compensation effect.
This paper introduces the non-delay error compensation method for the DDGTMT. The core of non-delay error compensation in this paper is using predictive errors to enable predictive compensation in order to reflect the time-varying characteristics of errors and improve the accuracy of error compensation instead of compensating errors through measured data directly. Meanwhile, error compensation and the motion instruction are completed in the same period, in that way, compensation will not be behind motor movements, and the aim is to improve the accuracy and speed of error compensation to achieve the effect of non-delay. The traditional error compensation method (closed-loop compensation method) and proposed error compensation method are used in this research with their criteria of measuring the positioning accuracy and volumetric positioning accuracy of the tool center to verify the effectiveness of the proposed error compensation method.
The structure of the paper is as follows: In Section 2, according to the characteristics of the dualdriving structure, the error transformation matrix of the machine tool is derived using HTM, and then the comprehensive error model of the tool center is established. In Section 3, the error elements of machine tools are measured by measurement equipment (optical scales or laser interferometer). Then the errors of axes are predicted by the Grey-Markov method according to error data, and the predicted error data are fitted by the orthogonal polynomial regression method. In Section 4, an error compensation algorithm is designed, and the virtual axis-electronic cam compensation method is adopted. After compensation, the laser interferometer is used to measure the tool center errors to verify the performance of the proposed compensation method. In Section 5, the experimental results are discussed. In Section 6, the conclusions about the most important achievements of the paper are summarized.

Error model of the DDGTMT
This research aims to improve the feeding accuracy of DDGTMT, proposing a non-delay error compensation method that consists of the following three parts: error model, error prediction, and error compensation. The error model aims to depict the errors between the tool and the workpiece of the machine tool, providing the theoretical basis for compensation. Generally, the error compensation is directly using the last error data to compensate the next motor motion, but this compensation method ignores the real-time variation of the errors, making the error compensation effect is not optimal. Figure 1 reflects that when the motion instructions/ideal position commands are sent to the motion controller, the actual position commands are calculated by the non-delay error compensation method in the motion controller and then are sent to the servo driver to execute the position commands.

Error model of the DDGTMT
This research aims to improve the feeding accuracy of DDGTMT, proposing a non-delay error compensation method that consists of the following three parts: error model, error prediction, and error compensation. The error model aims to depict the errors between the tool and the workpiece of the machine tool, providing the theoretical basis for compensation. Generally, the error compensation is directly using the last error data to compensate the next motor motion, but this compensation method ignores the real-time variation of the errors, making the error compensation effect is not optimal. Figure 1 reflects that when the motion instructions/ideal position commands are sent to the motion controller, the actual position commands are calculated by the non-delay error compensation method in the motion controller and then are sent to the servo driver to execute the position commands.  Figure 2 shows the process of the non-delay error compensation method. The error model of DDGTMT is based on HTM. According to the real-time error data, the predicted errors are calculated by adopting the Grey-Markov method [30,31]. The accuracy of the prediction is assessed via the precision threshold. By the virtual axis-electronic cam compensation strategy, using the predicted data to modify position commands, so that errors are compensated ahead of execution position commands to achieve non-delay error compensation. The structure of the DDGTMT is shown in Figure 3; it has three feed directions-X-direction, Ydirection, and Z-direction. X-direction adopts DCG-principle to design a dual-driving structure,  Figure 2 shows the process of the non-delay error compensation method. The error model of DDGTMT is based on HTM. According to the real-time error data, the predicted errors are calculated by adopting the Grey-Markov method [30,31]. The accuracy of the prediction is assessed via the precision threshold. By the virtual axis-electronic cam compensation strategy, using the predicted data to modify position commands, so that errors are compensated ahead of execution position commands to achieve non-delay error compensation.

Error model of the DDGTMT
This research aims to improve the feeding accuracy of DDGTMT, proposing a non-delay error compensation method that consists of the following three parts: error model, error prediction, and error compensation. The error model aims to depict the errors between the tool and the workpiece of the machine tool, providing the theoretical basis for compensation. Generally, the error compensation is directly using the last error data to compensate the next motor motion, but this compensation method ignores the real-time variation of the errors, making the error compensation effect is not optimal. Figure 1 reflects that when the motion instructions/ideal position commands are sent to the motion controller, the actual position commands are calculated by the non-delay error compensation method in the motion controller and then are sent to the servo driver to execute the position commands.  Figure 2 shows the process of the non-delay error compensation method. The error model of DDGTMT is based on HTM. According to the real-time error data, the predicted errors are calculated by adopting the Grey-Markov method [30,31]. The accuracy of the prediction is assessed via the precision threshold. By the virtual axis-electronic cam compensation strategy, using the predicted data to modify position commands, so that errors are compensated ahead of execution position commands to achieve non-delay error compensation. The structure of the DDGTMT is shown in Figure 3; it has three feed directions-X-direction, Ydirection, and Z-direction. X-direction adopts DCG-principle to design a dual-driving structure, The structure of the DDGTMT is shown in Figure 3; it has three feed directions-X-direction, Y-direction, and Z-direction. X-direction adopts DCG-principle to design a dual-driving structure, which can improve transmission stiffness of the feeding system. The typical dual-driving structure contains dual-servo motor, dual-ball screw, dual-linear guide, and bearings. The machine's crossbeam moves along the X-direction. The movement of the saddle is along the Y-direction, using a singular motor and ball screw. The movement of the headstock is along the Z-direction, adopting a single-driving structure. Parameters of the machine are given in Table 2.
which can improve transmission stiffness of the feeding system. The typical dual-driving structure contains dual-servo motor, dual-ball screw, dual-linear guide, and bearings. The machine's crossbeam moves along the X-direction. The movement of the saddle is along the Y-direction, using a singular motor and ball screw. The movement of the headstock is along the Z-direction, adopting a single-driving structure. Parameters of the machine are given in Table 2.

Parameter
Magnitude X-direction stroke 2000 mm Y-direction stroke 1000 mm Z-direction stroke Maximum velocity in Z-direction 30 mm 3000 mm/min Maximum velocity in X-direction and Y-direction 10,000 mm/min Geometric errors usually include positioning errors, straightness errors, angle errors and squareness errors [32]. As shown in Figure 4, O1, O2, and O3 represent base coordinate, ideal coordinate, and actual coordinate; namely, there are six error elements when the moving parts move on the guide rail, including three linear errors-positioning errors, two straightness errors, and three angle errors-roll errors, yaw errors, and pitch errors [33].  three squareness errors of x-axis, y-axis, and z-axis, where the subscript represents the squareness errors between two axes. All these geometric errors are shown in Table 3. x, y, and z represent x-axis, y-axis, and z-axis, respectively, and they also represent the direction of motion.  Geometric errors usually include positioning errors, straightness errors, angle errors and squareness errors [32]. As shown in Figure 4, O 1 , O 2 , and O 3 represent base coordinate, ideal coordinate, and actual coordinate; namely, there are six error elements when the moving parts move on the guide rail, including three linear errors-positioning errors, two straightness errors, and three angle errors-roll errors, yaw errors, and pitch errors [33]. ∆X, ∆Y, and ∆Z represent the linear errors, where the subscript represents the error directions. θX, θY, and θZ represent the angular errors, where the subscript represents the rotation axes of angular errors. S xz , S yz , and S xy represent three squareness errors of x-axis, y-axis, and z-axis, where the subscript represents the squareness errors between two axes. All these geometric errors are shown in Table 3. x, y, and z represent x-axis, y-axis, and z-axis, respectively, and they also represent the direction of motion.

Axis
Error Components Errors-∆Y occur after the coordinate system O 1 translates along the y-axis to the coordinate system O 2 , and the translation transformation matrix can be represented as Similarly, the translation transformation matrices Trans(x) and Trans(z) translate along the x-axis and z-axis to coordinate system O 2 with errors-∆X and ∆Z, respectively. They can be represented as Similarly, the rotation transformation matrices Rot(θX), Rot(θY) and Rot(θZ) of coordinate system O 1 rotate around x-axis, y-axis and z-axis to coordinate system O 2 with errors-θX, θY, and θZ, respectively. They can be represented as In the homogeneous coordinate transformation of the coordinate system, if coordinate system O 1 translates along x-axis, y-axis and z-axis by ∆X, ∆Y, and ∆Z, respectively, and then rotates around x-axis, y-axis and z-axis by θX, θY, and θZ to coordinate system O 2 , respectively, the homogeneous coordinate transformation matrix between O 1 and O 2 is sin θX sin θY cos θZ + cos θX sin θZ − sin θX sin θY sin θZ + cos θX cos θZ − sin θX cos θY ∆Y − cos θZ sin θY cos θZ + sin θX sin θZ cos θX sin θY sin θZ + sin θX cos θZ cos θX cos θY ∆Z When the rotational angles-θX, θY, and θZ are small, based on the theory of small-angle approximation, the second-order and high-order minuteness can be ignored. Therefore, Equation (7) can be represented as Figure 5 is the coordinate system setting of the DDGTMT. The reference coordinate system-R is created on the machine tool bed, and the local coordinate systems-X, Y, Z, S, T, and W are created on the crossbeam, saddle, headstock, spindle, tool and workpiece, respectively. The kinematic chain of If the tool center moves along x-axis, y-axis and z-axis, the homogeneous transformation matrix from workpiece coordinate system-W to tool center coordinate system-T is If the tool center moves along x-axis, y-axis and z-axis, the homogeneous transformation matrix from workpiece coordinate system-W to tool center coordinate system-T is where R X T, X Y T, and Y Z T are represented in Equations (10)-(12) Processes 2020, 8, 748 where x, y, and z are the position commands of x-axis, y-axis, and z-axis, respectively; ∆X x1 , ∆X x2 , ∆Y y , and ∆Z z represent the positioning errors of x 1 -axis, x 2 -axis, y-axis, and z-axis, respectively; θX x , θY x and θZ x are three directional angular errors caused by motion along x-axis; θX y , θY y and θZ y are three directional angle errors caused by motion along y-axis; θX z , θY z and θZ z are three directional angle errors caused by motion along z-axis; ∆Y x and ∆Z x are straightness errors caused by motion along x-axis; ∆X y and ∆Z y are straightness errors caused by motion along y-axis; ∆Y z and ∆X z are straightness errors caused motion by along z-axis; S xz , S yz , and S xy are the squareness errors between x-axis and z-axis, y-axis and z-axis, and x-axis and y-axis, respectively. Because there is no relative movement between the spindle and headstock, the homogeneous transformation matrix from the coordinate system-Z to spindle coordinate system-S is the unit matrix that is Z S T = I 4×4 . The tool center is connected with the spindle, so the homogeneous transformation matrix from the spindle coordinate system-S to the tool center coordinate system-T is the unit matrix, that is S T T = I 4×4 . There is no relative movement between the workpiece and the machine tool bed, so the homogeneous transformation matrix from the workpiece coordinate system-W to the reference coordinate system-R is the unit matrix, that is W R T = I 4×4 . Therefore, the transformation matrix from the workpiece coordinate system-W to the tool center coordinate system-T is and the error model of tool center for the DDGTMT is

Error prediction of the DDGTMT
The x-axis, y-axis and z-axis positioning errors are measured by the optical scales, and the straightness errors and angular errors are measured by an Agilent 5519 dual-frequency laser interferometer (Agilent Technologies, Inc. United States). In the light of the ISO230-3 standard [34], measuring the positioning errors of the machine tool should be carried out at the standard environment temperature used in the experiment. The measurement strokes in X-direction, Y-direction, and Z-direction are 2000 mm, 1000 mm, and 30 mm, with the measurement interval being 200 mm, 100 mm, and 3 mm accordingly. The straightness errors are measured in the same condition. The starting point of the measurement is set to the coordinate origin of the feed system. The model of the optical scales is GVS608, which have a resolution of 0.1 µm.
The hardware integration diagram is shown in Figure 6. The control system of the machine tool adopts a BECKHOFF system, in which the drivers and motors adopt AX5000 series drivers (Wales, Germany) and AM8500 series AC servo motor (Beckhoff Automation GmbH & Co. KG, Verl, Germany), I/O modules adopt EtherCAT bus terminal module, mainly using EK1100 series, EL1800 series (Beckhoff Automation GmbH & Co. KG), EL2800 series, and EL5000 series components. The control program is based on TwinCAT3 software (Beckhoff Automation GmbH & Co. KG). The hardware integration diagram is shown in Figure 6. The control system of the machine tool adopts a BECKHOFF system, in which the drivers and motors adopt AX5000 series drivers (Wales, Germany) and AM8500 series AC servo motor (Beckhoff Automation GmbH & Co. KG, Verl, Germany), I/O modules adopt EtherCAT bus terminal module, mainly using EK1100 series, EL1800 series (Beckhoff Automation GmbH & Co. KG), EL2800 series, and EL5000 series components. The control program is based on TwinCAT3 software (Beckhoff Automation GmbH & Co. KG).   Figure 7 shows using an optical scale to measure positioning errors. The scale is fixed on the machine tool and the transducer is on the moving block. The signal wire of the transducer is connected to the EL5000 series terminal. EL5000 series terminal communicates with the motion controller through EtherCAT so that the positioning errors can be obtained in real-time. Figure 8 shows that using a laser interferometer to measure the straightness errors and angle errors. Figure 8a shows the measurement principle of straightness errors and angle errors. Figure 8b,c shows the experimental setup of straightness error measurement. The measurement of angle errors is similar to the measurement of straightness errors only by changing the corresponding measuring mirrors. shows using an optical scale to measure positioning errors. The scale is fixed on the machine tool and the transducer is on the moving block. The signal wire of the transducer is connected to the EL5000 series terminal. EL5000 series terminal communicates with the motion controller through EtherCAT so that the positioning errors can be obtained in real-time. Figure 8 shows that using a laser interferometer to measure the straightness errors and angle errors. Figure 8a shows the measurement principle of straightness errors and angle errors. Figure 8b,c shows the experimental setup of straightness error measurement. The measurement of angle errors is similar to the measurement of straightness errors only by changing the corresponding measuring mirrors.  The velocity range of motors in the X-direction, Y-direction is 1000 mm/min to 6000 mm/min, respectively, with the Z-direction ranging from 500 mm/min to 3000 mm/min. The results error curves are shown in Figures 9-11. Figure 9a,b shows x 1 -axis positioning error curves and x 2 -axis positioning error curves, respectively. Figure 10a,b shows y-axis positioning error curves and z-axis positioning error curves, respectively. Figure 11a,b presents ∆Y x and ∆X y , respectively.  The velocity range of motors in the X-direction, Y-direction is 1000 mm/min to 6000 mm/min, respectively, with the Z-direction ranging from 500 mm/min to 3000 mm/min. The results error curves are shown in Figures 9-11. Figure 9a,b shows x1-axis positioning error curves and x2-axis positioning error curves, respectively. Figure 10a,b shows y-axis positioning error curves and z-axis positioning error curves, respectively. Figure 11a        It can be seen from Figure 9 that the larger the velocities are, the larger the positioning errors of X-direction are. For example, at the position of 2000 mm, the x1-axis positioning errors of the velocity at 1000 mm/min and 6000 mm/min are −95.3 μm and −118.9 μm, namely. At the same velocity, the positioning errors of x2-axis are greater than that of x1-axis. Due to the dual-driving structuremechanical relation between the x1-axis and the x2-axis, there is a coupling relationship between the two axes. Because of the differences in the structural parameters and servo performance of the two axes, the loads and disturbances borne by the two axes are not identical, causing different forces on the two axes, and resulting in different positioning errors and between the two axes, then causing It can be seen from Figure 9 that the larger the velocities are, the larger the positioning errors of X-direction are. For example, at the position of 2000 mm, the x 1 -axis positioning errors of the velocity at 1000 mm/min and 6000 mm/min are −95.3 µm and −118.9 µm, namely. At the same velocity, the positioning errors of x 2 -axis are greater than that of x 1 -axis. Due to the dual-driving structure-mechanical relation between the x 1 -axis and the x 2 -axis, there is a coupling relationship between the two axes. Because of the differences in the structural parameters and servo performance of the two axes, the loads and disturbances borne by the two axes are not identical, causing different forces on the two axes, and resulting in different positioning errors and between the two axes, then causing non-synchronization errors. The positioning errors of the x 1 -axis and x 2 -axis increase nonlinearly with the increasing of position commands, but trends of positioning errors of the y-axis are going up first and then down nonlinearly. As shown in Figure 9a,b and Figure 10a that the velocity will affect the positioning errors of the x-axis and y-axis. However, the overall change trends of straightness errors and positioning errors are different. If the errors shown in the figures are greater than zero, it means that actual position displacement is larger than the ideal position command. In the process of the tool center moving along the y-axis as shown in Figure 10a, the positioning errors increase first and then decrease, and the actual displacements of the tool center are greater than the ideal position commands. Figure 10b shows that the fluctuation of Z-direction positioning errors is not obvious at different velocities. The straightness errors are little affected by the velocities. The straightness errors change with the enhancement of position command, but the range of straightness errors ∆Y x and straightness errors ∆X y are −11.5 µm to +13.7 µm and −16.4 µm to +21.2 µm, respectively. In addition, using the least square method, fit the straightness errors ∆Y x and straightness errors ∆X y in Figure 11a,b, and their slopes are k ∆Y x = −0.0427 µm/mm and k ∆X y = 0.1256 µm/mm, respectively. S xy = 0.0825 µm/mm can be obtained from the identification method of squareness errors as well as S yz = 0.0413 µm/mm and S xz = 0.0319 µm/mm. The angle errors of the machine tool are shown in Table 4. The error prediction data is obtained by using the Grey-Markov prediction method. Grey model is an important part of Grey theory, which can get the forecast result simply and quickly with a small amount of data. It has a great advantage when compared with the traditional forecast method, but the model is relatively rough as well [30,31]. Markov method is introduced to optimize the prediction results of the Grey model. Observing the trend of error curves, the polynomial regression method might be suitable for fitting prediction error data. The orthogonal polynomial regression method uses a set of polynomials with orthogonal properties to solve various non-linear equations. It can solve the regression problem that the relationship between variables is not clear [35]. Meanwhile, adopting the orthogonal polynomials regression method is very useful and easy to program [14].
Take the x 1 -axis positioning errors as an example in the condition of x = 800 and v = 2000 mm/min to introduce how to predict errors. The five groups of positioning error prediction data are got by using 10 groups of error data and the error prediction formula [30,36]. The prediction results are shown in Table 5. It can be found that high prediction accuracy can be obtained by this prediction method. The appendix shows detailed Grey-Markov method formula. The predicted positioning errors-σ i in the x 1 -axis are given as an example to introduce how to fit prediction errors. When the velocity is 2000 mm/min, the results are shown in Table 6 (the orthogonal polynomial component number n = 11; the calculation expressions of the value of Tables 6 and 7 can be found in reference [35] or Appendix A Formulas (A15)-(A21).  Because of F 0.1 (1, 5) = 4.06, F 0.05 (1, 5) = 6.608, and F 0.01 (1, 5) = 16.3, it can be seen from Table 7 that the first order is dominant; the second, third, and fourth order are significant, but the fifth order is insignificant. Eliminating the fifth order to revise the regression equation yields Equation (15).
Substituting x = (x + 200)/200 into Equation (16) yields Figure 12 shows the fitting curve of x 1 -axis prediction positioning errors. It can be seen from the residual of the fitting curve that the residual interval is (−0.96, 0.91) which indicates a high fitting accuracy.  Using the same method, the fitting curves of x2-axis and y-axis prediction positioning errors can be calculated as The expression of predicted straightness errors can be obtained by the same principle, as follows.    Using the same method, the fitting curves of x 2 -axis and y-axis prediction positioning errors can be calculated as ∆Y y = −7.667 × 10 −10 y 4 + 1.367 × 10 −6 y 3 − 0.7583 × 10 −3 y 2 + 0.197y + 0.65 The expression of predicted straightness errors can be obtained by the same principle, as follows.

Error Compensation of the DDGTMT
To validate the validity and efficiency of the proposed method, error compensation experiments contain the traditional error compensation method and the method proposed in this paper. The traditional error compensation method refers to full/semi closed-loop error compensation method that uses detection equipment, i.e., motor encoder or optical scale to obtain the position feedback signal, compares the error signal with the position signal according to the error compensation algorithm in the controller and then adjusts the position of the moving parts by the controller [37,38]. In this article, the traditional error compensation method is full closed-loop error compensation, which is to use the displacement signal measured by the optic scale as the feedback signal of the position loop, and process it in the controller to get the error compensation value and send it to the motors. For the DDGTMT, the accuracy of dual-driving axes has a heavy effect on the volumetric positioning accuracy of the tool center. Therefore, the positioning accuracy and volumetric positioning accuracy are used to measure the effectiveness of the error compensation method proposed in this paper [39,40]. Two kinds of error compensation experiments are carried out. The first is the error compensation of the tool center movement along X-direction and Y-direction respectively, and the second is the error compensation of the tool center space motion along the X-direction, Y-direction and Z-direction. As seen in Section 3, the velocity will affect the positioning error of the machine tool; therefore, two kinds of error compensation experiments are carried out at different velocities, whose purpose is to test that the error compensation method proposed in the paper can improve the positioning accuracy and volume accuracy of the DDGTMT at different velocities. The virtual axis-electronic cam method is used for compensation. The principle of the virtual axis-electronic cam error compensation method is shown in Figure 13. The measurement error data are acquired by measuring equipment such as positioning errors coming from the optical scale real-time feedback, angle errors, and straightness errors coming from the measurement of laser interferometer and the squareness errors coming from identification. The error compensation curves are obtained based on the method described above. The principle is to store the error fitting curve in the form of an electronic cam table in the motion controller so that the motion controller will calculate the modified position commands of the motors automatically by using an electronic cam table. Then, the motors execute the modified position commands to complete the error compensation. positioning accuracy are used to measure the effectiveness of the error compensation method proposed in this paper [39,40]. Two kinds of error compensation experiments are carried out. The first is the error compensation of the tool center movement along X-direction and Y-direction respectively, and the second is the error compensation of the tool center space motion along the Xdirection, Y-direction and Z-direction. As seen in Section 3, the velocity will affect the positioning error of the machine tool; therefore, two kinds of error compensation experiments are carried out at different velocities, whose purpose is to test that the error compensation method proposed in the paper can improve the positioning accuracy and volume accuracy of the DDGTMT at different velocities. The virtual axis-electronic cam method is used for compensation. The principle of the virtual axis-electronic cam error compensation method is shown in Figure 13. The measurement error data are acquired by measuring equipment such as positioning errors coming from the optical scale real-time feedback, angle errors, and straightness errors coming from the measurement of laser interferometer and the squareness errors coming from identification. The error compensation curves are obtained based on the method described above. The principle is to store the error fitting curve in the form of an electronic cam table in the motion controller so that the motion controller will calculate the modified position commands of the motors automatically by using an electronic cam table. Then, the motors execute the modified position commands to complete the error compensation. As shown in Figure 14, according to the principle of virtual axis-electronic cam error compensation, the electronic cam master axis-Master X, Master Y, and Master Z, electronic cam slave axis-Slave X1, Slave X2, Slave Y, and Slave Z are established. Draw the electronic cam table in the controller, couple the virtual axis with Master X, Master Y, and Master Z, couple the Slave X1 with the motor X1, couple the Slave X2 with the motor X2, couple the Slave Y with the motor Y, and couple the Slave Z with the motor Z. In the experiment, the TwinCAT3 software based on the windows platform coming with the control systems is used for real-time control. The software is integrated with Visual Studio and supports the mixed programming of PLC and C++ language conforming to the IEC61131 standard. The servo modules communicate via the high-performance BECKHOFF EtherCAT bus (Beckhoff Automation GmbH & Co. KG). First set up the virtual axis and create the master electronic cam axis. Then, create the slave electronic cam axis and draw the electronic cam table. The error data of optical scales is stored in the PLC variable through the I/O module. Based on the Visual Studio platform, the error compensation algorithm is written in C++ language in software TwinCAT 3 (Beckhoff Automation GmbH & Co. KG) to get the error compensation curve and input it into the cam table through ADS communication [41]. The resulting cam table is shown in Figure 14.
In the experiment process, the servo parameters of x1-axis and x2-axis motors are shown in Table  8. The positioning errors of the tool center are measured by the laser interferometer to verify the efficiency of the non-delay error compensation. In the first experiment, the tool center moves along X-direction and Y-direction, respectively, so z = 0, then substitute into Equation (14), yield Figure 15a shows the experimental schematic diagram, and Figure 15b,c shows error compensation when the tool center moves along Y-direction and X-direction, respectively. In the error compensation of tool center space motion along the X-direction, Y-direction and Zdirection, the feeding velocities are 1000 mm/min, 2000 mm/min and 3000 min/min, respectively, to test the error compensation method usefulness at different velocities. The tool center moves from the starting position X0 Y0 Z0 to the position X2000 Y1000 Z30, and the end-point error results are recorded with optical scales in directions of X, Y, and Z. The Figure 16 shows space motion error compensation, and the data fed back by optical scales directly outputs the error value through PLC programming. Figure 17 shows that uncompensated error results of the tool center can be derived by using a dual-frequency laser interferometer under different velocities. Figures 18 and 19 are the positioning error results of tool center compensation after using the traditional method and nondelay method at different velocities, respectively. Table 9 shows the space motion error compensation results of the traditional compensation method and the non-delay error compensation method proposed in this paper. In the experiment, the TwinCAT3 software based on the windows platform coming with the control systems is used for real-time control. The software is integrated with Visual Studio and supports the mixed programming of PLC and C++ language conforming to the IEC61131 standard. The servo modules communicate via the high-performance BECKHOFF EtherCAT bus (Beckhoff Automation GmbH & Co. KG). First set up the virtual axis and create the master electronic cam axis. Then, create the slave electronic cam axis and draw the electronic cam table. The error data of optical scales is stored in the PLC variable through the I/O module. Based on the Visual Studio platform, the error compensation algorithm is written in C++ language in software TwinCAT 3 (Beckhoff Automation GmbH & Co. KG) to get the error compensation curve and input it into the cam table through ADS communication [41]. The resulting cam table is shown in Figure 14.
In the experiment process, the servo parameters of x 1 -axis and x 2 -axis motors are shown in Table 8. The positioning errors of the tool center are measured by the laser interferometer to verify the efficiency of the non-delay error compensation. In the first experiment, the tool center moves along X-direction and Y-direction, respectively, so z = 0, then substitute into Equation (14), yield σ X = (∆X x1 + ∆X x2 )/2 + ∆X y + ∆X z and σ Y = ∆Y y + ∆Y x + ∆Y z . Figure 15a shows the experimental schematic diagram, and Figure 15b,c shows error compensation when the tool center moves along Y-direction and X-direction, respectively. Table 8. Servo parameters of x 1 -axis and x 2 -axis motors.

Control Loops
Servo Motors   In the error compensation of tool center space motion along the X-direction, Y-direction and Z-direction, the feeding velocities are 1000 mm/min, 2000 mm/min and 3000 min/min, respectively, to test the error compensation method usefulness at different velocities. The tool center moves from the starting position X0 Y0 Z0 to the position X2000 Y1000 Z30, and the end-point error results are recorded with optical scales in directions of X, Y, and Z. The Figure 16 shows space motion error compensation, and the data fed back by optical scales directly outputs the error value through PLC programming. Figure 17 shows that uncompensated error results of the tool center can be derived by using a dual-frequency laser interferometer under different velocities. Figures 18 and 19 are the positioning error results of tool center compensation after using the traditional method and non-delay method at different velocities, respectively. Table 9 shows the space motion error compensation results of the traditional compensation method and the non-delay error compensation method proposed in this paper.

Discussion
Figures 17 and 10a are the uncompensated error results of the tool center moving along X-direction and Y-direction at velocities from 1000 mm/min to 6000 mm/min, respectively. It can be seen from Figure 17 that the errors of the tool center along the X-direction increase nonlinearly with the position commands, and the tendency is similar to that of the positioning errors of x 1 -axis and x 2 -axis. In general, the greater the velocities are, the greater the errors are. Under the same velocities and position commands, the errors of the tool center are within the range of the x 1 -axis and x 2 -axis positioning errors. Figure 18a,b shows the error compensation results of the traditional method of error compensation when the tool center moves at speeds from 1000 mm/min to 6000 mm/min in the X-direction and Y-direction, respectively. Figure 19a,b shows the error compensation results of the tool center moving from 1000 mm/min to 6000 mm/min in the X-direction and Y-direction, respectively, using non-delayed error compensation method. From Figures 18 and 19, it can be seen that the errors decrease significantly after the compensation of both methods. For example, the comparison between Figures 19a and 17 shows that when the tool center moves along X-direction, the tool center positioning errors are reduced significantly from more than 100 µm to less than 3 µm. In addition, the comparison between Figures 19b and 10a shows that the tool center positioning errors decrease from (0 µm, 80 µm] to (−2 µm, 2 µm] when tool center moves along the y-axis, and the positioning errors do not increase first and then decrease after compensation. As Figures 18 and 19 show that the influence of velocities on positioning errors reduces after compensation. However, when adopting the traditional error compensation method, the compensation result is not ideal due to the delay of error compensation. Moreover, the linear optical scale in the traditional method can only measure the positioning error but not straightness and angle errors [38]. Besides, the compensation fluctuates obviously, ranging from −1 µm to 6 µm, whose range is about twice that of the method proposed, so the compensation effect is unsatisfactory. As shown in Table 9 that the effect of space motion error compensation is worse than that of single-axis movement error compensation, because space motion requires the x-axis, y-axis, and z-axis to be coupled with each other and produces complex error factors. However, the effect of non-delay error compensation is better than that of the traditional error compensation method, and the maximum improvement of error compensation can reach 44.0%. The space motion experiment results suggest that the non-delay error compensation method can improve the volumetric positioning accuracy of machine tools preferably. Hence, it can be found that the non-delay error compensation method greatly improves DDGTMT feed accuracy.

Conclusions
This research proposes an error compensation method for machine tools aiming to improve accuracy. A non-delay error compensation method is proposed for the DDGTMT. The essence of non-delay error compensation is using the predicted error data to modify the position command in the motion controller, so that the error compensation is completed before executing the position command. Firstly, the geometric error model of the DDGTMT is obtained by using the HTM. Based on the measurement data, the error prediction data is obtained by using the Grey-Markov method. Then, the orthogonal polynomial regression method is used to fit the error prediction data. Finally, the virtual axis-electronic cam compensation method is employed to compensate the geometric errors. The advantages and efficiency of the non-delay error compensation method proposed are verified by experiments.
In the paper, the error prediction and compensation algorithm of the DDGTMT are developed, and the error compensation of the dual-axis improves the synchronization performance of dual-driving equipment. Experimental results show that the prediction and compensation of geometric errors are realized, and the positioning accuracy of the DDGTMT is significantly improved from within 100 µm to within 3 µm at different velocity. Simultaneously, whether the machine tool moves in a single direction or space, the effect of non-delay error compensation is better than that of the traditional error compensation method in the aspect of improving volumetric positioning accuracy of dual-driving machine tools.
A differential equation can be established as follows where a g and u g are the parameters to be identified. Assuming thatâ = (a g , u g ) T is an estimated vector.â = (a g , u g ) The a g and u g are calculated by the Formulas (A5)-(A7) and substituted into Formula (A4) to obtain The Grey prediction results of the error data obtained from Formula (A8) are In order to ensure the validity of the Markov method and the correct Markov prediction process, it is necessary to test the Grey prediction results. If the results are correct, thex (0) (n i ) will be divided into several state intervals, and the state transition probability matrix will be constructed, then the middle value of the state interval will be taken, and the high-precision prediction value will be obtained.
The residual of the Grey error prediction value and the error actual value are divided into several intervals to form the corresponding state intervals, and any state interval is expressed as where A im and B im are the state interval width, whose value depends on the data.
The state transition matrix P (km) can be solved by the Formula (A11) im,jm is the transition probability from state Q im to state Q jm for km-steps. M im,jm (km) is the number of original data of state Q im transferred from the state Q jm for km-steps. M im is the number of original data in Q im .
The state transition probability matrix of km-steps is as follows . . . . . . · · · . . . P im,1 (km) P im,2 (km) · · · P im,jm If the initial vector of the initial state Q im is V (0) , after km-steps transformation, the state vector According to the above probability transition matrix, when the state of the current moment is known, the state of the next moment can be estimated. After the state Q d of the next moment is determined, the change interval [Q 1d , Q 2d ] of the relative predictive value of the next moment is determined. Then, the middle value of the interval is taken to modify the Gray prediction result, that is, the modified prediction value is Y(n i ) = (Q 1d + Q 2d )/2 =x (0) (n i ) + (A im + B im )/2 (A14) The residual value of predicted modified value and the measured value is compared with the non-modified residual value. If the residual value is small, the predicted modified value meets the requirements. Figure A1 shows the flow chart of the Grey-Markov method error prediction.
The state transition probability matrix of km-steps is as follows of the relative predictive value of the next moment is determined. Then, the middle value of the interval is taken to modify the Gray prediction result, that is, the modified prediction value is The residual value of predicted modified value and the measured value is compared with the non-modified residual value. If the residual value is small, the predicted modified value meets the requirements. Figure A1 shows the flow chart of the Grey-Markov method error prediction.

Orthogonal Polynomial Regression Method Formula
According to the orthogonal polynomial regression method, errors compensation can be obtained

Orthogonal Polynomial Regression Method Formula
According to the orthogonal polynomial regression method, errors compensation can be obtained σ r = β 0 + β 1 X + β 2 X 2 + · · · + β j X j ( j = 1, 2, 3, . . .) where σ r represents errors corresponding to motor position commands-X, j is the order of the polynomial, β 0 represents regression constant, β 1 · · · β j are the regression coefficient, and their calculation formula can be found in the Formula (A21). For the convenience of subsequent calculation, let X = φ 1 (x), X 2 = φ 2 (x) and X j = φ j (x), then Equation (A15) becomes σ r = β 0 + β 1 φ 1 (x) + β 2 φ 2 (x) + · · · + β j φ j (x) (A16) φ j (x) can be calculated by the Formula (A17) where n is the number of measurement points, x = (1 + 2 + 3 + · · · + n)/n, p = 1, 2, 3 · · · . As can be seen from above, there is orthogonality between the variables, then then the normal equations are The regression coefficient is From the above formulas, the regression equation between the motor position commands and the geometric errors can be established, then the significance of the regression equation and the regression coefficient can be tested. The test method can be based on the formulas in Table A1 of the orthogonal polynomial regression variance analysis. If the higher-order items are not significant, they can be eliminated. If the accuracy of the regression equation is not satisfactory enough, the higher-order terms can be added, and the regression coefficients that have been calculated need not be recalculated.
Sum l yy = σ 2 r − 1 n ( σ r ) 2 [35] n − 1 In Table A1, l yy represents the sum of the squares of the total deviation, S R represents the sum of the squares of the regression differences.