Abstract
Aiming at the problem of large number of points and complex calculation of NURBS pre-interpolation, this paper puts forward a look-ahead interpolation with offline feedrate optimization. The NURBS interpolator is divided into two stages: pre-interpolation and real-time interpolation. The pre-interpolation preprocesses the curve segment by segment according to the curvature characteristics, at the same time the exponential function method is adopted during the pre-interpolation in the look-ahead module. This method makes the step increment of interpolation parameters change exponentially in the area with gentle curvature, and greatly reduces the number of pre-interpolation points, which reduces the amount of calculation and improves the real-time performance. The real-time interpolation stage adopts the bidirectional adaptive acceleration and deceleration control method to realize speed smoothing without needing to calculate the deceleration point. The simulation results show that the real-time performance of the algorithm is greatly improved.
Introduction
A nonuniform rational B-spline (NURBS) curve unifies analytic graphics and free shape with a general mathematical expression and is determined as the only expression form of free parts and products by the ISO. In fact, it has become the standard of industrial CAD geometric modeling. NURBS curve interpolation technology has many obvious advantages, such as small data storage, complete information, and smooth speed. High-speed and high-precision machining is easily realized [1, 2] and has been widely used to describe and machine complex parts in modern CNC systems [3, 4].
NURBS interpolation is a research hotspot of CNC in recent years. Shpitalni et al. [5] used the Taylor series expansion algorithm for parametric curve interpolator with a constant feedrate. However, this method has large contour error at sharp corners and is not practical. Yeh and Hsu [6] developed an adaptive feedrate interpolation which adjusted the feedrate based on curvatures and confined chord errors. Tikhon et al. [7] considered the constant material removal rate to improve machining accuracy and proposed an improved adaptive interpolation method, the performance of adaptive interpolation method is further improved. Park et al. [8] developed a real-time NURBS interpolation based on the two-stage method which can make good use of the geometric characteristics of NURBS. Tsai et al. [9] presented an acceleration/deceleration method before interpolation, thus the interpolation accuracy is improved. In order to improve the interpolation performance, some interpolation algorithms combined with the dynamic characteristics of machine tools are proposed. Yong and Narayanaswami [10] developed an interpolation by detecting sharp corners based on chord error information in offline. Sencer et al. [11] proposed an optimization method of feed speed considering axis constraints. However, frequent acceleration and deceleration changes may cause jerk out of tolerance. Nam and Annoni [12, 13] considered the influence of Jerk and proposed the Jerk-limited feedrate planning. Beudaert et al. [14] Considered the 5-axis NURBS jerk constraints and proposed 5-axis feedrate NURBS interpolation. Nam and Yang [15] developed a generalized parametric interpolator with real-time jerk-limited acceleration. Jahanpour and Alizadeh [16] proposed a novel acc-jerk-limited NURBS interpolation enhanced with an optimized S-shaped quintic feedrate scheduling scheme. Wei et al. [17] developed a NURBS interpolator which maintains constant speed at federate sensitive regions considering drive and contour-error constraints. Liu et al. [18] presented an adaptive feedrate planning with geometric and kinematic constraints, effectively improved the accuracy of interpolation.
In addition, due to the continuous influence of NURBS curve curvature, feedrate planning has always been the key problem of NURBS interpolation. Erkorkmaz et al. [19] proposed a federate optimization based on linear programming and windowing. Wang et al. [20] developed an adaptive smooth feedrate scheduling to solve the problem of feedrate fluctuation. Chen and Sun [21] presented a contour error-bounded parametric interpolator for five-axis CNC machine tools with minimum feedrate fluctuation. Zhong et al. [22] proposed a new real-time interpolator, which adjusted the look-ahead length dynamically to minimize the calculation load and kept the feed rate as high as possible with minimum fluctuation. Zhang et al. [23] developed adaptive feedrate planning with an iterative method that considered the error and higher-order kinematic constraints, but the real time could not be guaranteed. Ni et al [24] proposed a jerk-continuous NURBS interpolation using the polynomial and trigonometric functions to construct the jerk-continuous ACC/DEC profile, improved the flexibility of feedrate control.
The above NURBS interpolation methods are usually based on a single processor. The shorter the interpolation time of NURBS curve, the smaller the interpolation point distance and the higher the machining accuracy. A high-speed and high-precision interpolation cycle generally must be controlled at the millisecond level, which imposes higher requirements for the real-time performance of the interpolator. Considering the mechanical, electrical and system performance factors in the actual processing process, the feed speed cannot always be kept constant, so flexible acceleration and deceleration control is needed. However, because the NURBS curve is constructed by the B-spline basis function, no exact mathematical relationship holds between arc length and parameters in the interpolation process of the NURBS curve, so accurate control of the acceleration and deceleration is difficult. Therefore, more functional modules must be added to realize smooth interpolation, which makes the system load grow exponentially.
In order to improve the real-time performance of pre-interpolation and the interpolation accuracy, this paper proposes a real-time NURBS interpolation method based on a two-level interpolation mechanism. The NURBS interpolator is divided into two stages: pre-interpolation and real-time interpolation. The first stage of pre-interpolation preprocesses the curve segment by segment according to the curvature characteristics and obtains the initial and final parameter vector, feed speed, and length of the curve segment. The second stage of real-time interpolation adopts a two-way speed planning method, which improves the performance of the acceleration and deceleration modules and improves the accuracy of deceleration point positioning as much as possible. According to the de Boor recursive algorithm, the interpolation points are generated in real time. In the pre-interpolation stage, the exponential function is used to control the increment of step size, which greatly reduces the number of interpolation points, thus effectively reducing the computational complexity of preprocessing. At the same time, the speed planning method can well control the speed fluctuation of interpolation, effectively improve the accuracy of interpolation and realize the purpose of high-speed and high-precision machining.
The concept of interpolation of the NURBS curve
A
where the index
NURBS curve interpolation indicates that in each interpolation cycle, the spatial position points that should be reached in the next cycle are calculated. Therefore, the key requirement is the corresponding parameter
The first-order approximate expression of parameter u as a function of t can be obtained by transforming Eq. (3):
Then, the second-order approximate expression of parameter
The parameters of the next interpolation point can be calculated using the parameters and feedrate of the current interpolation point according to Eqs (2), (4) and (5). Then, the interpolation point coordinates can be calculated using the de Boor fast algorithm.
The increment of the parameter step can be obtained by the difference between parameters of adjacent interpolation points as follows:
Structure of the NURBS curve interpolator.
The NURBS interpolator proposed in this paper is shown in Fig. 1. The interpolation is divided into two stages: pre-interpolation and real-time interpolation. The pre-interpolation mainly performs the preprocessing of interpolation, while the real-time interpolation completes the real-time interpolation. The first-level pre-interpolation transfers data to the second-level real-time interpolation through first in first out (FIFO) queue. Preprocessing and real-time interpolation are independent, and the two stages can run on the hardware platform with a master-slave structure, such as PC-FPGA and ARM-FPGA. Pre-interpolation is performed on the master CPU, and real-time interpolation is performed on the slave motion control chip to achieve load balancing.
In the first stage of pre-interpolation, the CNC interpreter reads in the program block, analyzes the NC code file and extracts the workpiece information described by the NURBS curve; the fast pre-interpolation module makes the parameter increment increase rapidly according to the binary index in the flat curvature section, to realize the fast pre-interpolation of the NURBS curve; in the curvature mutation area, the Taylor expansion method is used to calculate the parameters and pre-interpolate at the normal speed; the speed is sensitive The sensing area scanning module judges the starting point and end point of the speed-sensitive point according to the basic information of the fast pre-interpolation point, to form the sensitive area information; the curve segment boundary point calculation module obtains the segmented boundary point approximately according to the reference interval of the speed-extreme point and the curvature extreme point of the feedrate sensitive area; finally, the segmented curve information is saved, including the boundary point parameter vector, feed speed, curve segment length, etc. It is put into the FIFO queue for the second level real-time interpolation.
In the second stage of real-time interpolation, the information of the curve segment to be processed is read from FIFO queue to obtain the starting point parameters, feedrate, and length of the curve segment; the speed planning module interpolates the curve segment from the positive and reverse directions to constrain the feed speed at the same time, the forward interpolation is output to the servo system in real time, and the reverse interpolation buffers the interpolation data points to the FIFO queue; and the forward and reverse interpolation is implemented. After arriving at the convergence area, calculate the transition point and adjust its feed speed to make the acceleration of positive and negative interpolation at the transition point zero; when the positive interpolation reaches the transition point, output the interpolation point from the LIFO queue to the servo system to drive the machine tool to feed.
Because of the limitations of machine tool mechanical characteristics, processing requirements, electrical response frequency and other factors, the feedrate cannot always remain constant. Without losing generality, it is assumed that the processing speed curve is continuous, and the speed change is from low to high and then to low. Before moving to the minimum speed, we must slow down; before moving to the maximum speed, to improve the processing efficiency, we should accelerate as much as possible. To reduce the velocity fluctuation, each curve segment consists of only one acceleration phase and one deceleration phase (the middle segment may contain a constant speed phase).
Based on the above analysis, the NURBS curve can be segmented according to the corresponding relationship between velocity and curvature, which is the main task of first-level pre-interpolation. The first-level pre-interpolation and the second-level real-time interpolation should transmit data through FIFO queue. The former interpolation must ensure that FIFO queue has data to avoid starvation.
Fast pre-interpolation
The basic idea of fast pre-interpolation is that the parameter step increment adapts to the changes in the geometric characteristics of the curve. In the flat curvature, because it can meet various constraints, the parameter vector can be quickly discretized with a larger step increment. Here we choose the exponential function (binary) is used to make the parameter step increment rapidly increase, and at the sudden change of curvature to meet the constraints such as contour error in real time, the geometric information of the curve is obtained with a small step increment.
The curve of NURBS can be roughly divided into a large curvature region and a small curvature region. The influence of curvature on chord error is as follows:
where
where
Equations (7) and (8) show that the chord error is smaller in the large curvature area and larger in the small curvature area of the NURBS curve. The idea of fast pre-interpolation is that different calculation methods are used for interpolation point parameter vectors according to different curvature regions of the NURBS curve. In the large curvature region, because the chord error can meet the limitation of the maximum chord error, the adjacent interpolation points can be far away; that is, the parameter increment can be larger, so the parameter vector of the interpolation points can be calculated by increasing the parameter increment in a binary exponential way. In the small curvature region, because the chord error may exceed the limit of the maximum chord error, the distance between adjacent points should be small; that is, the parameter increment can be small. The first-order Taylor expansion approximation method is used to directly calculate the parameters of the vector. The specific flow of the algorithm is shown in Fig. 2.
Flow chart of fast pre-interpolation.
When the increment of the parameter step is a binary exponential increment, its growth rate is very fast. If it is not controlled, the distance between adjacent pre-interpolation points will be too long, and some feedrate sensitive areas of the curve may be skipped. Therefore, the maximum order of the binary exponent must be limited.
In addition, when the new interpolation point is calculated according to the parameter vector and parameter step increment of the current pre-interpolation point, its chord error is out of tolerance. At this time, it is not clear that the interpolation has entered the abrupt curvature region from the large curvature region. Perhaps the parameter step increment is larger, and the subsequent part of the large curvature region is skipped, so the parameter step increment must be readjusted. The adjustment rule is as follows: from this point forward, the increment of each calculated parameter step should be reduced to half of the original value until the parameter step increment is reduced to the initial setting value. If the chord error of the new interpolation point calculated by the increment of the initial parameter step remains out of the limit, then the point is the starting point of the curvature mutation region, and then the parameter vector is calculated using the first-order Taylor expansion method
The chord error is determined by the curvature radius and feed speed. When the radius of curvature is large, the chord error may exceed the limit. To meet the requirement of chord error, the feed speed should be adjusted.
Therefore, in order to adapt to the change of curvature, the interpolation feed rate cannot always keep at the command speed, and these interpolation points lower than the command speed are called speed sensitive points. Consider a second-order continuous NURBS curve whose curvature is continuous and the speed sensitive points form the federate sensitive area. When scanning the federate sensitive area, the fast pre-interpolation method is used to offline the entire parameter range from 0 to 1 to judge the curvature mutation area on the curve, and then the speed-sensitive points are extracted according to the size of the contour error of the pre-interpolation points. Finally, the feedrate sensitive area is composed of the pre-interpolation points at the beginning and end of the speed-sensitive points.
From Eq. (9), when the maximum chord error is certain, the curvature extreme point is also the velocity extreme point. When the sections are divided according to the law of acceleration, uniform speed and deceleration, the transition point between segments is the minimum point of the speed. Because pre-interpolation is a discrete process of a curve, the minimum velocity point and the minimum point of the speed in the sensitive area do not necessarily coincide. The minimum velocity point of the sensitive area and its adjacent interpolation point parameter interval can be used to approximate the minimum velocity point, which is considered the boundary point of the segment.
The specific steps are as follows:
initialization, calculates the initial parameters of the first two points obtain the parameter Adjust the feedrate Get the boundary point. According to the minimum velocity point
Considering the influence of mechanical, electrical and system performance in actual processing, the interpolation speed is constrained by the maximum allowable speed, maximum acceleration, maximum acceleration and maximum normal acceleration of the machine tool, and the change in feed speed and acceleration may be nonlinear.
Traditional acceleration and deceleration methods generally judge the deceleration point according to the relationship between the residual distance and the minimum deceleration distance. This method has the following problems: because the calculation of curve arc length is affected by the iteration termination conditions, accurately predicting the deceleration point is not easy, and the more accurate the deceleration point is, the higher the iteration accuracy is, and the longer the iteration time is, which is not conducive to realizing real-time interpolation; because the feed speed is constrained by a variety of conditions, the feed speed and acceleration changes in the interpolation process are not necessarily identical to the selected acceleration. The results show that the deceleration planning mode is consistent, and the deviation between the theoretical deceleration point and the estimated deceleration point is large.
Therefore, a two-way speed planning method is used to control the acceleration and deceleration of curve segments in the real-time interpolation stage. The basic idea is as follows: the forward interpolation is real-time interpolation, and the reverse interpolation is pre-interpolation; the forward interpolation points are transmitted to the servo system in real time according to the interpolation cycle, and the reverse pre-interpolation points are saved to the Filo buffer; the two-way interpolation is performed at the constrained feed speed until it reaches the interpolation convergence area; the speed is adjusted in the interpolation convergence area. Adjust the transition point to make its acceleration zero; output the pre-interpolation point of the Filo cache to realize the speed smooth control.
The bidirectional speed planning is shown in Fig. 3. The forward interpolation is defined as interpolate from
where
After reaching the confluence area of interpolation, the current acceleration at the end point of forward interpolation should be adjusted so that the speed of forward and reverse interpolation at the confluence point is equal and the acceleration is zero. The adjustment rules are as follows:
The parameters of NURBS curve
The parameters of NURBS curve
Schematic diagram of bidirectional preinterpolation.
To verify the effectiveness of the presented NURBS interpolation method, simulations are conducted on an Intel Core i7-8565U 1.8 GHz personal computer, and MATLAB 7.0 and 1.8 GHz dualcore CPU computers are used for the simulation. The experiment is divided into two groups: 1). a fast pre-interpolation experiment (FPIM) that we proposed, with maximum binary exponential orders of 5, 8, 10, 12 and 15 for five comparative experiments and 2). a bidirectional acceleration and deceleration experiment using the S-shaped acceleration and deceleration method to implement speed planning for a curve segment The adaptive feedrate interpolation (AFI) is adopted for comparison [24]. In the simulation, the interpolation period
An 8-shaped NURBS curve.
Curvature of the 8-shaped NURBS curve.
Table 2 compares fast pre-interpolation of different orders. At the same time, the first-order Taylor expansion approximation method is used as the reference. The table shows that the larger the order is, the fewer the number of interpolation points that will be generated; in contrast, the smaller the order is, the greater the number of feedrate sensitive areas that will be missed. For example, when the order value is 5, the effect is not as good as that of the first-order Taylor expansion approximation; when the value is 15, two feedrate sensitive areas will be missed.
From the perspective of effectiveness, the first-order Taylor expansion method, FPMI (order 5, 8, 10, 12) is valid, shown as T in the Table 2, while FPMI (order 15) is invalid, shown in the Table 2 is F because two velocity-sensitive regions are omitted. It can be seen from this that the choice of order is the key to FPMI, and optimization algorithms such as ant colony algorithm and simulated annealing can be used to optimize this value, which will not be repeated here due to space limitations.The interpolation points produced by fast pre-interpolation are significantly reduced compared with that of the first-order Taylor expansion approximation when the appropriate order value is used, and the real-time performance of our method is substantially improved compared with that of the first-order Taylor approximation.
Comparison of different orders using fast pre-interpolation methods (FPIM)
Feedrate profile of the eight-shaped NURBS curve by AFI.
Feedrate profile of the eight-shaped NURBS curve by 
ACC profile of the eight-shaped NURBS curve by AFI. 
The feedrate profiles of the eight-shaped NURBS curve by the two methods are shown in Figs 6 and 7, and the corresponding acceleration and jerk profiles are presented in Figs 8–11, respectively. As shown in Fig. 6, the initial speed of the feedrate profile begins and ends with the maximum command speed, which leads to a large vibration and severely affects the processing quality. During the feedrate adaptive adjustment, the feedrate limit is only based on the maximum chord error in the AFI method. As a result, the tangential acceleration of the AFI method, as shown in Fig. 8, exceeds the maximum allowable range and cannot meet the limit conditions. The same is true for the tangential acceleration, as shown in Fig. 10. The maximum absolute value of the tangential acceleration is 0.004383 mm/s
ACC profile of the eight-shaped NURBS curve by 
Jerk profile of the eight-shaped NURBS curve by AFI.
Compared with the AFI method, the FPIM method has more advantages. As shown in Fig. 7, the initial speed of the feedrate profile begins and ends at zero, which is consistent with the characteristics of the S-type acceleration and deceleration method. The
Comparison of the simulation results of the two methods
Jerk profile of the eight-shaped NURBS curve by FPIM.
According to the simulation results, the advantages of the proposed method compared with the traditional method are list as follows: 1) The proposed method can reduce the number of pre-interpolation points by 80–90% compared with the first-order Taylor expansion method. 2) The proposed method can always meet the tolerance requirements at the maximum acceleration and maximum jerk, while the maximum acceleration fluctuation and maximum jerk fluctuation of the traditional AFI method reach 438% and 2051%, respectively. Therefore, the proposed method has a great improvement, which can achieve high-speed and high-precision interpolation.
In this paper, a look-ahead interpolation method is proposed based on an exponential function with offline feedrate optimization. According to the simulation results, the proposed method has better performance than the traditional method in terms of the number of pre-interpolation points and speed stability. The next step will continue to study the optimization method for step size parameter selection, implementing fast NURBS interpolation techniques.
Footnotes
Acknowledgments
This work is supported by the Natural Science Foundation of Hunan Province under Grant No. 2021JJ30574 and is partly supported by the Research Foundation of Education Bureau of Hunan Province under Grant No. 21B0424.
