Cross-coupled control based on real-time Double Circle contour error estimation for biaxial motion system

In contour machining, contour error is a major factor affecting machining quality. In order to improve the performance of contour following, many control techniques based on real-time contour error estimation have been developed. In this paper, a Double Circle contour error estimation method is proposed. First, based on the kinematic information of the reference point on the command trajectory, five interpolation points closest to the actual point are obtained. Then the approximate contour error is obtained by employing the Double Circle approximation method. Compared with the common contour error approximation methods, the proposed method can achieve high precision approximation. In addition, according to the proposed contour error approximation method, the cross-coupled control strategy is improved. Experiments prove the effectiveness of the proposed estimation method and control strategy.


Introduction
Attaining high machining accuracy is a key aspect of CNC (Computerized Numerical Control) machining. Contour error, defined as the shortest distance from the actual position to the desired trajectory, is an essential indicator to measure the product quality. In a CNC machine, contour error is inevitable as a result of various factors, such as unmatched dynamics between different axes, nonlinearities, 1 servo lag, 2 and disturbances. 3 Due to these factors, improving the tracking performance of individual axes is minimal effectiveness in reducing contour error.
To complete a satisfactory contour following the task, it is necessary to calculate and compensate the real-time contour error in the CNC motion controller. The calculation of the contour error is usually complicated. Limited by the real-time computation ability of CNC, computing the exact contour error on each sampling cycle is sometimes difficult. In fact, estimated contour error is widely applied instead of the actual contour error.
Because high precision contour estimation plays an important role in contouring control, it has been a major topic of research during the past 40 years. Crosscoupled control (CCC), first proposed by Koren 4 in 1980, offered an effective way of contour control. This model approximated the linear combination of tracking errors as estimated contour error and compensates for the servo controller in each axis. Inspired by CCC, more approximate methods of contour curve are proposed. The vector from the actual point to the perpendicular on the tangent passing through the nearest reference point is a tangent-line based contour error estimation proposed by SS Yeh et al., 5 K. Srinivasan et al. 6 and CC Lo et al. 7 Cheng and Lee 8 modified the tangent-line-based estimation by replacing the tangentline of command point with the synthetic velocity vector at the reference point and the actual position to determine the delayed point. In recent years, the approximate accuracy of this method has been improved. 9 Koren et al. 10 proposed that contour error is proportional to tracking error in biaxial machining and the gains of the CCC are variable. Although they 4-10 can obtain high estimation accuracy for straight line and small curvature trajectory in line interpolation or curve interpolation form, these methods have little effect in the case of large curvature trajectory and high-speed feeding. To address this problem, it has been studied by many researchers using different means. In 2007, Chen and Wu 11 presented a novel equivalent error consisting of equivalent contour errors and tangential error for multi-axis motion system. Chiu and Tomizuka 12 proposed a contour error model in which the axes coordinate system is transformed into Tangential-Normal-Bidirectional task frame. In Altintas and Khoshdarregi 13 and Yang and Altintas, 14 contour error is approximated by the normal component of the tracking error in the Frenet Frame. Moreover, Altintas and Sencer 15 presented a novel contour error estimation model which is consisted of tool axis orientation errors and tooltip position in Frenet Frame. For curve path command, circular approximation with a moving TDN frame is proposed by Yang and Li. 16 Zhao et al. 17 defined the estimated contour as a circle determined by three interpolation dots closest to the actual position, so the estimated contour error is the shortest distance between the actual position and the circle. In the approaches proposed in Zhu et al., 18 Hu et al., 19 Wang et al., 20 Zhao et al., 21 and Shi and Lou, 22 real-time contour error estimation based on Taylor expansion approximation employed a point-to-curve distance function to calculate directly. However, due to the characteristics of Taylor expansion approximation, these methods can achieve good results only when the actual point and the desired point are close enough. In Pi et al., 23 Ferguson curve is employed to estimated contour error. In repetitive machining process, iterative based methods were also applied to compensate the contour error. 24,25 By adjusting the weight coefficient in the prediction model, the weighted average value in the observation area is minimized, and then the contour error is precompensated. 26 In addition, some researches based on the global task coordinate framework (GTCF) also achieve a high accuracy approximation of the contour error. [27][28][29] To have good parameter adaptability and disturbance robustness, a LARC contouring control scheme was developed by Hu et al. 28 Within the framework of GTCF, 31-33 researched on contouring control and synchronized control for dual-linear-motor-driven gantry by integrating both motion coordination of multi-axes and synchronization of redundant actuators.
Generally, approaches of contour error estimation are focused on three types: employing the tracking error and some motion information, for example, the velocity of the reference point and actual position; simplifying the calculation of contour error by transforming the axis coordination into task coordination; estimating the vector of contour error by iterative approximation. Despite the significant performance of the aforementioned approaches, considerable motion information and parameter-based reference trajectory are required in these models.
Depending on the experiments in Chen et al., 9 the performance of the Three-Points Circle approximation approach proposed in Zhao et al. 17 is remarkable.
Moreover, Ming Yang et al. 30 extended this method to five-axis contour error control. However, as the actual position moves, the Three-Point Circle changes as the nearest interpolation point changes. This results in a mutation of the estimated contour error. Motivated by Zhao et al., 17 a novel approximated model to estimate the contour error in real-time for the middle and lowgrade CNC system is proposed in this paper. Since the contour error of long linear trajectory and long circular trajectory can be accurately calculated and decoupled to each axis for compensation, 16 this paper focuses on the contour error approximation and compensation for continuous free-form trajectory.
In this paper, the Double Circle approximation method is proposed on the basis of the Three-Point Circle method. Two circles are constructed by five nearest interpolation points, and the shortest vectors from the actual position to the two circles are calculated respectively. Usually, the two closest points from the actual position to the two circles are distributed on both sides of the command trajectory. The average vector of the two shortest vectors is used to approximate the actual contour error, which theoretically has higher approximation accuracy than the Three-Point Circle method. The Double Circle method avoids the problem of low approximation accuracy when the actual point is far away from the nearest interpolation point, that is, near the midpoint of the two interpolation points. It also alleviates the abrupt change problem of approximate contour error caused by the change of nearest interpolation point in the Three-Point Circle method. Then, the calculation process of the contour error of the Double Circle estimation is derived. According to the form of estimated contour error, the typical CCC control strategy is optimized. Figure 1 illustrates the flowchart of the presented contour error compensation. First, the interpolator generates the interpolating points of the reference trajectory. Then the interpolation points are cached in the buffer; the relationship between the sampling period and the interpolation period is confirmed; the closest interpolation point in the buffer is calculated according to the actual point position of the current sampling period; then the four interpolation points are obtained according to the approximate model of Double Circle estimation, and the approximate contour error is calculated; then the gains of cross-coupled controller are calculated. Finally, input to the proposed CCC controller. This paper is organized as follows. Section 2 introduces the proposed contour error approximation model of the biaxial machine tool feed drive. Section 3 describes the calculation process of the estimated contour error in detail. In section 4, the optimized crosscoupled control scheme based on the proposed approximate model is given. Experiment results for Ellipse trajectory, Lemniscate trajectory, and Dolphin trajectory are illustrated in section 5 to verify the effectiveness of the proposed contour control strategy.

Proposed estimated model of contour error
As shown in Figure 2,R is the reference trajectory of the contour following task and R kÀ1 , R k and R k + 1 are the interpolation points. Due to servo hysteresis in a general CNC machine motion system, the nearest interpolation point to the actual position P is usually one of the interpolation points before the current reference point R r . After calculating the value of R rÀ1 P ! , i = 0, 1, ., n, the smallest one R k P ! can be found. Then R k is the nearest interpolated point to P.
Suppose the two adjacent interpolation points from R k be R k-1 and R k + 1 , and the center of the circle C k through R k21 , R k , and R k + 1 be the point O k . R Tk is the nearest point to the circle C k . So, the shortest distance e k from P to the circle C k can be calculated The e k is the Three-Points circular approximation. To improve the approximate accuracy and adaptability when the closest interpolation point R k changed, the third nearest interpolation point from P, R k22 or R k + 2 is introduced in Figure 3. Comparing R kÀ2 P ! and R k + 2 P ! , when R k + 2 P ! 4 R kÀ2 P ! , R k + 2 is more near to P than R k-2 . At this time, the effect of command trajectory from R k + 1 to R k + 2 on the following motion is greater than that of the trajectory from R k22 to R k-1 . So R k + 2 is employed to the model; otherwise, R k22 if the circle C k + 1 through R k , R k + 1 , and R k + 2 can be uniquely determined. Then the shortest distance e k + 1 from P to the circle C k + 1 can be easily calculated, also based on the three-points approach mentioned above. According to (1), Define R E be the midpoint of R Tk R Tk + 1 ! , and

FIFO buffer of interpolator
In the presented approach, the efficiency of the estimated model is determined by finding the four   interpolation points and the calculation of the e k and e k + 1 mostly. In order to seek the nearest four points faster, a FIFO (first-in, first-out) buffer of the interpolation points is designed for the interpolator in the CNC system. The position information of the interpolation points is stored in the buffer and the volume of the buffer, m, depends on the response speed of the feeding system. The buffer updates in each interpolating cycle as the program proceeding. First of all, it is necessary to search for the closest interpolation point R k to P. Owing to the hysteresis of the feeding system, R k is lag behind the current reference interpolation point R r usually. Store R r and m21 points after R r in the buffer. Assume that D:(d 1 , d 2 ,., d m ) be the distance between P and the points Starting from i = 1, compare d i and d i + 1 one by one, until d i 4d i + 1 . In this case, i = u. Then the d u is the shortest in D:(d 1 , d 2 , ., d m ), and the R r-u + 1 is the closest point R k in buffer RM:(R r , R r21 , ., R r2m + 1 ). As d i 4d i + 1 is equivalent to d 2 i 4d 2 i + 1 , M 1 40 is the terminating condition of comparison, assuming M 1 can be expressed as follow, Generally speaking, the sampling cycle T of the position loop and velocity loop of the servo system is shorter than the interpolation cycle t s of CNC system and t s = n Ã T, n 2 N Ã , that is to say, the controller executes n times in an interpolation cycle. During the interpolation cycle, the reference interpolation point is R r , the buffer is RM:(R r , R r21 , ., R r-m + 1 ) and the nearest point R k to P(t) is found by M 1 . If the new sampling cycle t + T is still in the current interpolation cycle, as shown in Figure 4, the buffer remains unchanged. In the case of stable control, the tracking error will be reduced. Furthermore, the actual position P(t + T) in new sampling cycle will be closer to R r than P(t), and the nearest interpolation point to P(t + T) will be closer to R k than R r . Under the circumstances, the interpolation points (R k , R k21 , ., R r2m + 1 ) before R k in buffer do not need to be compared. The comparison can be started from R k to R r . Assume that S:(s 1 , s 2 , ., s r2k + 1 ) be the distance between P(t + T) and the interpolation points (R k , R k + 1 , ., R r ), and the terminating condition of comparison be M 2 40 similarly, If the t + T sampling cycle is in the new interpolation cycle, as shown in Figure 5, the current reference interpolation point R r is replaced by R r + 1 and the buffer will change with R r2m + 1 in and R r + 1 out. In this case, t is the last sampling cycle in the past interpolation cycle. According to R k and R r , the lag time of the feeding system can be estimated by lt s , in which l = r À k. Define T t as the hysteresis tolerance time constant. If lt s 5T t , it means that the servo lag of the system is serious. Even if the t + T sampling cycle steps into a new interpolation cycle, the closest point to P(t + T) in buffer is close to R k , so M 2 40 should be employed; if lt s 4T t , it indicates the high response ability and tracking performance of feeding system, so M 1 40 should be employed, contrarily.
In the event of external disturbance or other circumstances, P(t + T) may be farther away than P(t) to the reference point, and the tracking error may increase significantly. The calculated closest point R k for P(t) has no reference significance in the t + T sampling cycle. Apparently, M 1 40 is more appropriate in this case.

Calculation process of the proposed contour error approximation algorithm
After the nearest interpolation point R k to P has been found in the Buffer of the interpolator, the fourth point can be obtained by comparing R kÀ2 P ! and R k + 2 P ! .
Þof the circle C k and C k + 1 can be calculated by, in which r k and r k + 1 is the radius of C k and C k + 1 .
Assuming that O k x O k , y O k ð Þand r k can be expressed as Then (1) can be rewritten as According to the previous definition of R E , the contour error vector PR E !
Assuming u k be the angle between PR Tk ! and the Xaxis. Because O k P ! are already calculated, u k can be obtained as Then one can have So, the estimated contour error e E can be computed by In the case of R kÀ2 P ! . R k + 2 P ! , the computation of estimated contour error e E is illustrated in the Figure 6.  When Þas the fourth point. C k + 1 , O k + 1 and R Tk + 1 will be replaced by C kÀ1 , O kÀ1 and R TkÀ1 , respectively. R E should be the midpoint of R TkÀ1 R Tk ! and the proposed contour error vector PR E ! can be calculated by Proposed motion control scheme Figure 7 shows the typical cross-coupled control strategy for a biaxial motion system. P cx , P cy À Á and P x , P y À Á represent the reference position and the actual position, C px s ð Þ, C py s ð Þ À Á and C vx s ð Þ, C vy s ð Þ À Á are the position loop and the velocity loop controllers, G x s ð Þ, G y s ð Þ À Á denote the controlled plant of X and Y table. C x s ð Þ and C y s ð Þ are the cross-coupled controllers.
In the typical CCC scheme for contour error, the estimated contour error should be calculated based on the tracking error of each axis, and then the estimated contour error should be input into the CCC controller. Finally, the control variables for contour error are decoupled and compensated to each axis respectively. In general, three steps need to be taken: (1) calculate the estimated contour error; (2) input it into the CCC controller; (3) decouple the control variables and compensated to each axis.
According to (12), PR E ! : X PR E , Y PR E ð Þis Assuming E : e k e k + 1 ½ and F : 1 2 cos u k sin u k cos u k + 1 sin u k + 1 ! , the contour error vector Þcan be expressed as Therefore, reducing the estimated contour error equivalent to reducing E, and can be decoupled by F to X2Y coordinate system. The proposed control strategy is shown in Figure 8. The optimized CCC scheme in this paper has the same process as the typical one. The difference is that the approximate method of contour error is the proposed Double Circle method, and e k and e k + 1 in E are controlled by CCC controllers respectively. C c1 s ð Þ and C c2 s ð Þ are the I-type controllers for E : ½e k e k + 1 . They are both designed to be C ci = l i zÀ1 , i = 1, 2, in which l i are the control gains to be adjusted. The corresponding decoupling matrix F is also different from the typical one.
By applying the CCC controller C c to the motion control system, the transfer function of contour error is Let and Then, the relationship between e E and e E0 is According to Yang and Li, 16 the function 1=(1 + QC c ) can be defined as the contour error transfer function (CETF). It is clear that, the stability of the position loop and velocity loop of individual axis, the CCC controller C c and the CETF determine the stability of the contouring control system.C p s ð Þ and C v s ð Þ can be well-tuned by pole-placement method to make individual axes stable. For CETF and C c , the design and check procedure in Yang and Li 16 and Zhao et al. 21 can be employed to ensure their stability. The following is a brief summary of the operation process.
Step 1: Identify the transfer functions of the individual axis G x s ð Þ and G y s ð Þ.
Step 2: Without CCC controller, a stable controller C p s ð Þ and C v s ð Þ are well-tuned by pole-placement method.
Step 3: A I-type cross-coupled controller C c is designed.
Step 4: Check the stability of the CETF.
Step 5: Finish if Step 4 are satisfied, otherwise return to Step 3 and tune the gains of C c .
Under different operating conditions, the adjusted C c may not be suitable for the current condition. If the adjustment is needed, the adjusted C c can be use as the initial value in Step 3.

Experimental setup
The experiments are carried out on a three-axis CNC machine tool, TSIM-VMA8050, as shown in Figure 9. This system is a semi-closed loop system and the position sensing is provided by the encoder of each servo motor. The machine tool is equipped with TSNC-SX-A1 CNC system, which is developed by our laboratory. The interpolation cycle and the sampling cycle of the NC system are both set to 2 ms throughout the experiments. In order to avoid the impact of shock and vibration, the S-type acceleration and deceleration strategy is imposed by the look-ahead feedrate planning module embedded in the interpolator. In the motion system, the velocity and position loops of each single-axis are enabled and PID controllers are also tuned.

Comparative experiments of approximate approaches
In this part, the estimation performance of the proposed method in this paper is compared with four common estimation methods, which are Tangent-Line-Based estimation, 5 Circular approximation, 16 Average Velocity estimation, 9 and Three-Points-Circle estimation. 17 Ellipse trajectory and Lemniscate trajectory are executed to assess the performance of different approximation approaches. In these experiments, the estimated contour error with the estimation methods is calculated in real-time, and there is no contour compensation mechanism in the motion system. In addition, the actual contour error is calculated offline. The experimental results are shown in Figures 11 and 13.  The command trajectories and actual contour of Ellipse and Lemniscate are shown in Figures 10 and 12. Figures 11 and 13 depict the estimated errors in the approximation methods mentioned above and actual contour errors. The corresponding contour error statistics are presented in Tables 1 and 2. The performance index ''Max'' represents the maximum absolute contour error, ''IAE'' the integral of the absolute contour error and ''MSE'' the mean squared error of contour error.
As can be seen from Tables 1 and 2 that in the two experiments, the maximum of approximate contour error estimated by Double Circle method is 0.0261 mm and 0.0292 mm, which is 27.45% and 0.34% deviation compared with the maximum actual contour error of 0.0282 mm and 0.0291 mm. In the Ellipse trajectory experiment, compared with other approximation methods, the improvement is about 3% at least; in the Lemniscate trajectory experiment, except that the   maximum contour error of Three Points Circle method is the almost same as the one of Double Circle method, it improves at least about 27% compared with other approximation methods. In the two experiments, the IAE of Double Circle method is 11.6139 mm and 25.3829 mm, which is the closest to the IAE of actual contour error 11.5441 mm and 25.3907 mm, and the deviations are 0.60% and 20.03%, respectively. The MSE of Double Circle method is 0.0041 mm and 0.0154 mm, which also has the smallest deviation from the MSE of actual contour error. Generally, the contour error estimated by the proposed approach can estimate the actual contour error more accurately.
In order to prove the efficiency of the proposed Double Circle estimation method, the execution time of different contour error approximation algorithms is compared offline in MATLAB after the motion is finished. They are executed on a personal computer with 1.9 GHz CPU.
It can be seen from Table 3 that Three Points Circle method has the highest algorithm efficiency; Double Circle method takes the second place; Average Velocity method is close to Double Circle method; Circular approximation and Tagent-Line method have the lowest efficiency. Because the Double Circle method is calculated on the basis of Three Points Circle method, the time is about 15.43% longer than that of Three Points

The contrast experiments on contour error compensation
In this section, the Dolphin trajectory is conducted on the CNC machine to verify the effectiveness of the CCC proposed above. The trajectory in Figure 14 is carried out without CCC, circular approximation based typical CCC, and proposed double circle estimation based CCC respectively. Figure 15 shows the machining result with proposed Double Circle estimation based CCC. Figure 16 presents the tracking error of each axis and the contour errors are given in Figure 17. The contour error indices are listed in Table 4. It is seen from Figure 17 and Table 4 that the maximum contour error is 0.2137 mm without CCC contour control mechanism. In the case of typical CCC with Circular approximation enabled, the maximum contour error is 0.0691 mm, which is 67.66% lower than that without CCC. The typical CCC with Circular approximation achieves the effect of contouring control. When the proposed CCC with Double Circle method enabled, the maximum contour error is 0.0223 mm, which is only 10.44% of that without CCC. The IAE of the proposed CCC is 14.8897 mm, which is reduced by 93.71% compared with the IAE without CCC and 70.04% compared with the IAE with typical CCC. The MSE of the proposed CCC is 0.0029mm, which is 92.51% lower than the MSE without CCC and 74.11% lower than that with typical CCC. Besides, the contour error is well controlled with the proposed CCC in the whole process of contouring motion. Therefore, the control strategy proposed in this paper has a significant effect on contour error control.

Conclusion
Contour tracking control is a necessary control method when the machine tool completes the contour machining task. The accuracy of contour error estimation will directly affect the error compensation effect of machine tools, and ultimately affect the machining quality of parts. In this paper, a Double Circle contour error estimation method is proposed based on the Three-Point Circle method. Firstly, according to the kinematic information of the reference point and the actual position, four interpolation points closest to the actual point are obtained and two circles are constructed. Then, the average vector of the shortest vector from the   actual position to the two circles is used to approximate the actual contour error. Subsequently, the calculation process of contour error is given. Considering the characteristics of contour error, an optimized CCC is proposed and the design process of controller C c is also provided to ensure the control system stability. In the simulation and experimental section, by comparing the performance of Ellipse trajectory and Lemniscate trajectory, it can be seen that the Double Circle method proposed in this paper is closer to the actual contour error than other methods. The execution time of different algorithms is compared by simulation to verify the efficiency of the algorithm. Compared with Three Points Circle method, the efficiency of the algorithm is lower by 15.43%, but the approximation accuracy of maximum contour error is improved by at least 3%. Moreover, the IAE and MSE of Double Circle method are closer to actual contour error than other methods. In addition, in the Dolphin trajectory experiments, compared with the contour error without CCC, the MAX, IAE and MSE of contour error with proposed CCC decreased by 89.56%, 93.71% and 92.51% respectively. Compared with that of typical CCC, 67.73%, 70.04% and 74.11% are reduced respectively. It is verified that the proposed contour control mechanism with Double Circle approximation method is more effective than the typical CCC with Circular approximation method.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This project is supported by National Natural Science Foundation of China (Grant No. 51975402).