0% found this document useful (0 votes)
16 views16 pages

A CNC Direct Interpolation Algorithm Based On NURB

Uploaded by

Mehmet Unutkan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views16 pages

A CNC Direct Interpolation Algorithm Based On NURB

Uploaded by

Mehmet Unutkan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

A CNC Direct Interpolation Algorithm based on

NURBS and its Error Analysis


Shengli WEI (  [email protected] )
Anyang Institute of Technology https://orcid.org/0000-0003-3992-0296
Kai ZHAO
Anyang Institute of Technology

Research Article

Keywords: Direct Interpolation, NURBS, CNC, Chord Error

Posted Date: February 24th, 2022

DOI: https://doi.org/10.21203/rs.3.rs-1378144/v1

License:   This work is licensed under a Creative Commons Attribution 4.0 International License.
Read Full License
Title Page
Title: A CNC Direct Interpolation Algorithm based on NURBS and its Error Analysis

Authors:
1. WEI Shengli, School of Computer Science and Information Engineering, Anyang Institute of
Technology, Anyang, Henan Province, China. Zip code: 455000, E-mail:
[email protected]. Corresponding author.
2. ZHAO Kai, School of Computer Science and Information Engineering, Anyang Institute of
Technology, Anyang, Henan Province, China. Zip code: 455000

Abstract: For free-form surfaces or curves, it is not the best choice to use traditional G01 or G02
interpolation to generate the reference motion trajectory. Direct interpolation method is a better
choice. Direct interpolation is more useful in a free-curve/surface dedicated Computer Numerical
Control (CNC) system. A free-curve/surface dedicated CNC system just needs curve/surface
information as input, not as a conventional CNC system uses G code as its input. NURBS (Non-
Uniform Rational B-spline) is a powerful expression method for free-form curves and surfaces, and
so a direct interpolation algorithm based on NURBS curves is studied. In order to realize high speed,
high accuracy and stable interpolation, an adaptive prediction-correction with constraint chord
error method is presented to define the NURBS curve parameter. S velocity planning is used to make
tool move more smoothly. As NURBS curves are piece-wise curves, NURBS direct interpolation
must be computed with the parameter within its corresponding sections, and a section transition
method is proposed to guarantee computing validity. Also, three reference trajectory generation
methods, i.e. position interpolation, velocity interpolation and acceleration interpolation are
presented, and their advantages and disadvantages are discussed. The calculation and simulation
show that the position interpolation method is more stable and the error is the smallest. The error of
velocity interpolation is about 4 times that of position interpolation.

Keywords: Direct Interpolation; NURBS; CNC; Chord Error


A CNC Direct Interpolation Algorithm based on NURBS and its Error Analysis
1. Introduction
High speed, high precision and smooth machining is the primary task of CNC (Computer
Numerical Control) systems. The realization of this goal depends on an efficient and stable
interpolation algorithm. The interpolation algorithm with high precision, high speed and small feed
fluctuation is the unremitting pursuit of scientific researchers. G01 interpolation method is usually
used in conventional CNC systems. For the contour shape designed by CAD (Computer-Aided
Design), it needs to be discretized into short lines (also called as G01 code) through CAM
(Computer-Aided Manufacturing) to form a reference motion trajectory, and the G01 code
(representing a large number of short lines) are input into a conventional CNC system for machining.
The essence of this method is to use a series of short lines to approximate the contour curve, as
shown in Figure 1. The conventional CNC system performs motion control according to these short
lines. There are three problems with this interpolation method:
1. There is an obvious chord error which will have bad impact on machining accuracy. The greater
the curvature of the curve, the longer the discrete short line, and the greater the chord error.
2. Because there is a sharp corner between two adjacent line segments, in order to avoid shock and
vibration caused by sudden change of speed when turning from one straight line to another, it is
necessary to set the speed to zero at the end of the current line, and then accelerate from zero at the
beginning of the next line. This will cause feed fluctuation, which is not conducive to high-speed
and smooth machining.
3. Discretizing the contour shape into a large number of short lines requires a large amount of G
code, which puts forward greater requirements for the storage space of the CNC system, or requires
high-speed transmission bus.
4. The CNC system only receives G code passively, and the information generated in the CNC
system can’t be fed back to the CAM or CAD part. In this situation, the CNC system becomes an
information island.
chord error

the contour curve

sharp corner

G01reference motion trajectory

Fig. 1 G01 interpolation


In order to solve the above problems, researchers put forward many methods to improve this
situation to a certain extent. In order to control the chord error, researchers adopt adaptive feed speed
with a constraint chord error [1-2]. These methods can only control the error within a limited range,
and can’t fundamentally reduce the error. At the same time, it will also bring feed fluctuation. In
order to reduce the fluctuation and improve the stability of feed speed, some scholars have
introduced the method of corner smoothing, as shown in Figure 2. Burak sencer et al. use quintic
spline curves for transition to realize G2 continuity [3]. Shingo Tajima et al. use the filtering method
to filter the reference motion trajectory to realize the non-stop feed motion [4]. They also propose a
real-time interpolation algorithm, which does not use spline curves to locally modify the geometry
of the corner point, but according to an acceleration schematic with finite jerk and within a given
chord error and kinetic limit use direct fuse of velocity of adjacent two segments to generate the
corner trajectory [5]. Li Dongdong et al. propose a smooth transition method based on corner
contour error control [6]. Du Jinfeng et al. use jumping degree to constrain the acceleration curve,
and with speed acceleration and displacement boundary conditions, combining the maximum
contour error and the driver kinematic constraints, deduce the optimal transfer speed at the corner
and the maximum feed speed of the short line path, so as to realize the smooth transfer of feed axis
velocity and acceleration [7]. The above researches effectively improve the smoothness of tool
movement and reduces the impact of shock and fluctuation. At the same time, the filtering method
is used to filter the acceleration and deceleration, remove the high-frequency part, ensure the smooth
operation and reduce the high-frequency vibration. However, this method can not eliminate the
chord error, even introduce new errors because of application of corner smoothing, and the
smoothing filtering algorithm will also introduce delay.

corner smoothing

Fig. 2 Corner Smoothing


For free-form curve machining, the most ideal method to realize high-speed, high-precision
and stable feed is direct interpolation algorithm. A direct interpolation algorithm skips over the
rough interpolation stage of CAM, directly inputs the designed contour shape information into the
CNC system for interpolation calculation. The CNC system calculates out interpolation position,
velocity and acceleration according to the contour shape information which are control points, nodes
and weight factors for a Non-Uniform Rational B-Spline (NURBS) curve. It can provide the
smoothest machining effect. It uses much shorter straight lines than those of G01 interpolation to
approach the contour curve, which can improve the accuracy and reduce the sharp change at corners,
so it can be more flexible in acceleration and deceleration control. Another advantage of direct
interpolation is that it can directly input the curve information into the CNC system without CAM
conversion which generates a large number of CNC codes and transmit a large number of line
segment information into the CNC system.
The main work of this paper is to present a direct interpolation algorithm based on cubic
NURBS curves. The direct interpolation algorithm is suitable for a dedicated free-curve/surface
CNC system which is different from nowadays conventional CNC systems. The dedicated free-
curve/surface CNC system needs contour information such as control points of NURBS curves or
surfaces other than G code usually generated by CAM as input. An adaptive prediction-correction
with constraint chord error method is presented to define the NURBS curve parameter. The method
first uses Taylor expansion to predict a value of the parameter, then correct the value to prevent
accumulation of truncation error. This method is discussed in part 2. NURBS curves are piece-wise
curves, NURBS direct interpolation must be computed with the parameter within its corresponding
sections, but the predicted and the corrected value of the parameter may fall into different sections,
so a section transition method is proposed to solve the problem. The section transition method is
detailed in part 3. Velocity planning is also discussed in part 3, and an S velocity planning is put
forward to support the direct interpolation algorithm. In part 4, three reference motion trajectory
generation methods of position interpolation, velocity interpolation and acceleration interpolation
are proposed and their respective advantages and disadvantages are analyzed. The results show that
the position interpolation method is more stable and the error is the smallest. The error of velocity
interpolation is about 4 times that of position interpolation. Part 5 draws the conclusion of the paper.
2. NURBS Curve Parameter Determination
Because of its excellent characteristics, NURBS is widely used in modeling design, and
gradually applied to CNC interpolation methods. However, in most CNC systems, NURBS based
interpolation is only a supplement to G01 and G02 interpolation methods, which is embedded in the
closed CNC system. For example, FANUC15-MB/16-MC, Toshiba TOSNUC888 and Siemens
provide built-in NURBS interpolation method [8]. But we argue it is more valuable to apply NURBS
interpolation in a direct interpolation way, which is especially useful for open structure CNC
systems or free-curve/surface dedicated CNC systems. Direct interpolation needs to calculate the
position, velocity and acceleration of each interpolation point to form a reference motion trajectory.
Therefore, let’s first introduce the solution of position, velocity and acceleration of NURBS curves.
2.1 Solution of NURBS Position and Derivative
NURBS curves are defined as follows [9]:
(1)
n

B i ,k (u )Wi Vi
P (u )  i 0
n

B
i 0
i ,k (u )Wi

Where Vi is the control point vertex matrix, Wi is the weight factor vector, and Bi ,k (u) is the

B-spline basis function. The basis function is defined as follows:


 1, u i  u  u i 1
 Bi , 0 (u )  
 0, 其它
(2)

 u  ui u u
 Bi ,k (u )  Bi ,k 1 (u )  i  k 1 Bi 1,k 1 (u ), k  1
 u ik  u i u i  k 1  u i 1
 0 0
 0

U  u 0 , u1 ,  , u m  is the node vector of B-spline function and u is the parameter of the

NURBS curve.
Let
i n
(3)
M(u) 
VW B
i 0
i i i ,k (u )

N (u ) 
i n
(4)
W B
i 0
i i,k (u )

Then a NURBS curve can be rewritten as


n

B i ,k (u )Wi Vi
M (u ) (5)
P(u )  i 0
n

B
N (u )
i ,k (u )Wi
i 0

i n
(u ) and N (u)  can be calculated with deboor-Cox algorithm.
i n
M(u )  VW B
i 0
i i i ,k W B
i 0
i i ,k (u )

The first derivative of a NURBS curve is:


'
 M(u )  M ' (u )  N ' (u )P(u ) (6)
P ' (u )    
 N (u )  N (u )
The Second derivative of a NURBS curve is:
'
 M ' (u )  N ' (u )P(u )  M '' (u )  N '' (u )P(u )  2 N ' (u )P ' (u ) (7)
P '' (u )    
 N (u )  N (u )

2.2 Prediction-correction method


Direct interpolation needs to find the next interpolation point, feed velocity and acceleration
in each interpolation cycle. While NURBS is a parameter curve, interpolation point, feed velocity
and acceleration need to be calculated in accordance with the curve parameter. Therefore, the
important problem of using direct interpolation algorithm is how to determine the value of
parameter u . The easiest way is to increase it evenly, that is:

u i 1  u i  u (8)

Where u is a constant. However, this method is completely based on parameter control and
does not contain step control information. Uniform increase of u cannot ensure consistent step
length, which will cause speed change, and is not conducive to maintaining the stability of
interpolation. In machining process, we hope to keep step length other than u invariant. Many
literatures use a consistent step length method which is guaranteed by the Taylor expansion method.
In practical application, the first-order or second-order Taylor expansion can be used to determine
parameter u according to the accuracy requirements, as shown in the following formula.

ui1  ui  Tui  o(T ) (9)

ui 1  ui  Tui  (T 2 / 2)ui  o(T 2 ) (10)

Where, u i and u i 1 respectively represent the current value and the next required value of

u , T is the interpolation cycle, ui and u


i
respectively represent the first-order and second-

order derivatives, o(T ) and o (T 2 ) represent the first-order and second-order infinitesimal.
To convert the above formula to parameter space, there are
l (11)
u i 1  u i  '
P (u )

u i 1  u i 
l
 l 2 P ' (u )P '' (u )  (12)
'
P (u ) ' 4
2 P (u )

Where l is the step length of interpolation, P ' (u ) and P '' (u ) are the first and second

derivatives of the NURBS curve in the parameter space. Usually l is predetermined before
machining according to the required global machining speed. As long as the chord error satisfies the
required accuracy, we hope step length keep invariant all the time.
To keep step length consistent by control NURBS curve parameter u is very difficult. Using

formula 11 and 12 reverse computing u i 1 exists truncation error. And more seriously, truncation

error will accumulate step by step. An improved method is the prediction-correction method.
Literatures [10-11] discuss this method, but they don’t take section transition and velocity planning
into consideration. The prediction-correction method first uses the Taylor expansion to predict the
value of u , and the predicted step length is calculated with the predicted value of u .

lˆ  Pˆ i 1 P i (13)

Use formula 14 to verify the predicted step length. If the predicted step length satisfies
requirement (say δ < 0.1%), the predicted value of u and the predicted step length are adopted.
Otherwise, correct u according to formula 15.
|𝑙−𝑙̂|
δ= ∗ 100% (14)
𝑙

lˆ lˆ (15)
u i 1  uˆ i 1  (1  )u i
l l
2.3 Adaptive Prediction-correction with Constraint Chord Error Method
Prediction-correction method can ensure step length consistent, but it does nothing with chord
error control. If the curvature is large, still using initiative step length will result in excessive chord
error which will deteriorate machining accuracy. So, an adaptive prediction-correction with
constraint chord error method is presented to ensure machining accuracy. In each interpolation cycle,
firstly, formula 16 is used to verify if the chord error satisfies accuracy requirement [12].
𝑙2
ε=
8𝜌

(16)
Where ε is the chord error when step length is l , and 𝜌 is the smaller of curvature radius and
torsion radius. If ε satisfies accuracy requirement, l is OK to be used as step length. Otherwise,
re-compute l according the acceptable chord error which will be set up before machining. Fig. 3
shows how the adaptive prediction-correction with constraint chord error method control step
length and chord error. Fig. 3(a) shows that step length will decrease where the curve change
dramatically, and Fig. 3(b) shows that the chord error is controlled under 0.01 by decreasing step
length where the curve change dramatically.

(a) Step length decreases to (b) Chord error is controlled by


control chord error decreasing step length
Fig. 3 Adaptive prediction-correction with constraint chord error method
control step length and chord error
3 Velocity Planning and Section Transition
3.1 Velocity Planning
In traditional G01 interpolation, each segment needs velocity planning to reduce vibration and
guarantee smooth machining. The velocity must be accelerated from zero at the beginning of each
segment, and be decelerated to zero at the end. Or some corner smoothing technique are adopt just
as some researcher do. For direct interpolation, the segment is short enough to neglect the velocity
change between two adjacent segments. That is, it is not necessary to execute velocity planning in
each segment. But velocity planning is needed for a whole NURBS curve trajectory. In this paper,
an S velocity planning is used. S velocity planning can give a smooth acceleration and deceleration
for the NURBS curve trajectory.
S velocity planning has three stages. Since the deceleration process is symmetrical to the
acceleration process, we only discuss the acceleration process. In the first stage, there are:
a  Kt (17)

v   adt   Ktdt  ( K / 2)t 2 (18)

s   vdt   ( K / 2)t 2 dt  ( K / 6)t 3 (19)

In this stage, the acceleration will reach its maximum, amax . The maximum acceleration can

be set in advance to satisfy the dynamics requirement. In the second stage, we have:

a  a max (20)

v  v01   a max dt  v01  a max t (21)

s  s 01   vdt  s 01  v01t  (a max / 2)t 2 (22)

In this stage, acceleration a remains invariant. v01 and s01 is the velocity and

replacement individually at the end of the first stage. In the last stage, there are:

a  a max  Kt (23)

v  v02   adt  v02  a maxt  ( K / 2)t 2 (24)

s  s 02   vdt  s 02  v02t  (a max / 2)t 2  ( K / 6)t 3 (25)

Generally, interpolation cycle is a fixed period of time, for example 50μs. In this situation,
velocity is proportional to step length l . There are:
𝑙 = v ∗T (26)
Where T is the interpolation cycle. Velocity planning equals to step length planning. So, S
velocity planning is realized by the control of the step length l . If step length l is set according to
the law stipulated by formula 18, 21, 24, and the parameter u is determined just as presented in
part 2 of the paper, S velocity planning will be obtained. Fig. 4 shows velocity planning of a NURBS
curve trajectory. It is difficult to predict where to begin the deceleration process, especially chord
error is taken to consideration. This problem will be studied in the future research.
Fig. 4 S velocity planning of motion trajectory
3.2 Section Transition
Since a NURBS curve is a piecewise curve, its position and derivative must be calculated with
parameter u in the corresponding section. According to formula 1 and 2, it is easy to know that

𝐵𝑖,𝑘 (𝑢), Vi and 𝑊𝑖 vary in different sections. So, we must be careful, and know exactly which

section the parameter u belongs to. Because of the introduction of the adaptive prediction-
correction with constraint chord error method, this problem become more difficult which has not
been discussed in other literatures. Here, a section transition method is put forward, and the section
transition process is illustrated in Fig. 5. First, the step length l should be set, and it can come
from the global step length, or come from formula 16 to satisfy acceptable chord error, or come
from formula 26 to comply with velocity planning. Second, parameter u is predicted in accordance
with step length l according to formula 11 or 12. Then, predicted u is verified if it still belongs
to current section or it already enters next section. If it still belongs to current section, the position
and derivative are directly calculated in current section. If it enters next section, the position and
derivative must be calculated using next section expression, and set Flag to 1. Then, the predicted
step length can be computed with this point and the last point. If the difference between the predicted
step length and l is very small, for example, δ < 0.1% according to formula 14, correction is not
needed, and the predicted step length is used. Otherwise, parameter u is corrected according to
formula 15. Because the predicted parameter and the corrected parameter may be in different
sections, we must be careful in this situation. There are four combinations:
(1) Both the predicted and the corrected parameter are in current section, Flag=0;
(2) Both the predicted and the corrected parameter are in next section, Flag=1;
(3) The predicted parameter is in current section, the corrected one is in next section, Flag=0;
(4) The predicted parameter is in next section, the corrected one is in current section, Flag=1.
For combinations (2) and (4), Flag=1, because the predicted parameter enters next section, next
section becomes current section.
After the parameter is corrected, predicted step length must be re-computed according to one
of the four combinations.
Begin

Setting step
length

Predicting
parameter

Yes Is u in current No
section?

Computing in Computing in next


current section section, Flag=1

No
Correction needed?

Yes
Re-computing
parameter

Yes Flag=1? No

Is u in current No Is u in current No
section? section?

Yes Yes
Computing in Computing in Computing in Computing in
last section current section current section next section

Flag=0

end

Fig. 5 Section transition diagram


4. Reference Trajectory Generation
Direct interpolation means that the CNC system directly calculates the position, velocity and
acceleration of each interpolation point in each interpolation cycle according to the parameter of the
curve, so as to form a reference motion trajectory, which can approach the design contour shape as
much as possible. Direct interpolation is the most accurate interpolation method for free-form curve
and surface machining theoretically. NURBS is the most powerful tool to describe free-form curves
and surfaces. It is of great significance to study the direct interpolation algorithm based on NURBS.
Decades ago, because of the limited CPU capacity, NURBS direct interpolation algorithm was a
great burden for a CNC system. But at present, the computing power of CPU has been greatly
improved, and it can’t be a problem for using NURBS direct interpolation algorithm to a CNC
system. Our previous research shows that when the NURBS direct interpolation algorithm is run
on Celeron 1.8G CPU, the interpolation cycle can reach 35μs. If the interpolation feed velocity is
limited to 100 mm/s, the interpolation step length can be shortened to 3.6μm and the chord error can
reach 0.03nm. Even if the feed velocity increases to 1m/s, the interpolation step length can be
controlled at 36μm, and the chord error can be close to the nanometer level. In this case, the corner
between two adjacent interpolated short lines is basically close to a straight line. The velocity change
at the corner will be slight and negligible in most case. So the deceleration and acceleration near the
corner are to some extent not needed which can further improve the stability and efficiency of
interpolation.
There are three methods to generate reference motion trajectory for implementing direct
interpolation algorithm. One is the position interpolation, which calculates the interpolation points
of each interpolation cycle, and connects each interpolation point with a short straight line to form
a reference motion trajectory. This method looks like what CAM system does, but they are different
in essence. CAM discretize a design contour curve to a large amount of short lines and these lines
will be sent to a CNC system in the form of G code. In the direct interpolation algorithm, the
information (such as control point matrix, weight factor vector and node vector) of the curve are
input into the CNC system and interpolated by the CNC system. Because the interpolation cycle of
the CNC system is very short, it generates more dense points and shorter lines compared to those of
CAM, so it has higher accuracy, smoother corners and lower acceleration and deceleration
requirements. The other two methods are velocity interpolation and acceleration interpolation. The
velocity or acceleration is calculated out in each interpolation cycle, and the reference motion
trajectory is formed by one or two order integrals.
3.1 Position, Velocity and Acceleration Interpolation
The main work of position interpolation is to determine the curve parameter u as discussed in
section 2.2 and then calculate the position of the curve in each interpolation cycle. The reference
motion trajectory can be generated by connecting these interpolation points with short straight lines,
which will not be discussed here. Now we focuses on velocity interpolation and acceleration
interpolation.
3.1.1 Velocity Interpolation
According to kinematics, there are:
x = ∫ 𝑣𝑑𝑡 (26)
Where x is the position and 𝑣 is the velocity. In each interpolation cycle, the interpolation
position is obtained by integrating with the velocity. We can simplify formula 26 as the following
formula:

xi 1  xi  xi ' t (27)

In the parameter space, there are:


p = ∫ 𝑝′(𝑢)𝑑𝑢 (28)
′ (𝑢)
Where p is the position and 𝑝 is the first-order derivative of NURBS curve of parameter
u . In each interpolation cycle, the interpolation position is obtained by integrating with the first-
order derivative which can be calculated with formula 6 in the interpolation cycle. We can simplify
formula 28 as the following formula:

pi1  pi  pi ' u (29)

3.1.2 Acceleration Interpolation


According to kinematics, there are:
x = ∬ 𝑎𝑑𝑡 (30)
Where x is the position and 𝑎 is the acceleration. In each interpolation cycle, the
interpolation position is obtained by quadratic integrating with the acceleration. We can simplify
formula 30 as the following formula:

xi1  xi  xi ' ti  0.5xi ' ' t 2 (31)

In the parameter space, there are:


p = ∬ 𝑝′′(𝑢) 𝑑𝑢 (32)
Where p is the position and 𝑝′′(𝑢) is the second-order derivative of NURBS curve of the
parameter u . In each interpolation cycle, the interpolation position is obtained by quadratic
integrating with the second-order derivative which can be calculated with formula 7 in the
interpolation cycle. We can simplify formula 32 as the following formula:

pi1  pi  pi ' u  0.5 pi ' ' u 2 (33)

3.2 Comparison of Three trajectory generation methods


For the reference motion trajectory being generated by position interpolation method, each
interpolation position is on the designed contour curve. There is only calculation error on the
interpolation point, and the largest error is chord error. But this method doesn’t give any velocity
and acceleration information. On the contrary, velocity interpolation and acceleration interpolation
methods have stronger motion control ability, but it is easy to cause error accumulation, and the
reference motion trajectory is easy to deviate from the designed contour curve.
Fig. 6 shows the comparison of the reference motion trajectory generated by the three
trajectory generation methods. When the interpolation accuracy is set to be lower (the feed step
length is large), the velocity interpolation and acceleration interpolation will deviate from the
designed contour curve to a certain extent, and the deviation of velocity interpolation is greater.
When the interpolation step length is set as 2.5mm, the trajectory generated by velocity interpolation
obviously deviates from the designed contour curve, and there is an obvious lag for velocity
interpolation and acceleration interpolation, as Fig. 6(a) shows. As the step length is set shorter, the
deviation and gap become smaller, as Fig. 6(b) shows. If the step length is set as 0.12mm, the three
trajectories coincide well, as Fig. 6(c) shows. As mentioned above, for the NURBS direct
interpolation, step length can be short as 0.01mm, so the three interpolation methods all can be used
to generate reference motion trajectory.

(a) Step length 2.5mm (b) Step length 0.6mm (c) Step length 0.12mm
Fig. 6 Comparison of the three trajectories
In order to further illustrate the problem, a butterfly contour curve is used for simulation. The
results also show that when the interpolation step length is long, the trajectory generated by velocity
interpolation or acceleration interpolation will deviate from the contour curve, and when the
interpolation step length is short, three trajectories will coincide the contour curve, as shown in Fig.
7.
(a) Step length 0.6mm (b) Step length 0.12mm
Fig. 7 Comparison of three butterfly trajectories
3.3 Error Analysis
Three trajectory generation methods can all be used to generate reference motion trajectory,
and when the step length is short enough, trajectories generated by them will coincide together. But,
do they have the same error? Let’s deeply look into it. Position interpolation and velocity
interpolation are taken as example to compare their error. The error of position interpolation is
mainly chord error, which is l  8r 1 [12]. Where r is the radius of curvature,  1 is the chord
error, and l is the step length. It can be seen from Fig. 8 that the chord error is as follows:
2

1  r  r 2   
l (34)
2
Formula 34 can be rewritten as:

l  4 12r   1  8r 1 (35)

Then we have:

l2
1  (36)
8r
From Fig. 8, we also see the relationship between velocity interpolation error and step length,
that is:

l  2r 2 (37)
Rewrite formula 37 as 38.
l2
2 
2r (38)
From formula 36 and 38, we know:

 2  41 (39)
According to formula 36 and 38, the position interpolation error and velocity interpolation
error are directly proportional to the square of the step length. From formula 39, the velocity
interpolation error is 4 times that of the position interpolation.
Calculation results and simulation also prove that the velocity interpolation error is about 4
times the position interpolation error, which are shown in Fig. 9. In Fig. 9(a), “high” represents the
chord error, and “speeder” represents the velocity interpolation error. Fig. 9(b) shows that whatever
the step length is, the velocity interpolation error is about 4 times the position interpolation error.
Position
Interpolation Error
Velocity
Interpolation Error

Radius of
Curvature r

Fig. 8 Chord error and velocity interpolation error

(a) Values of chord error and (b) Diagram of chord error and
velocity interpolation error velocity interpolation error
Fig. 9 Comparison of chord error and velocity interpolation error
5. Conclusion
Traditional CNC systems only receive G01 linear interpolation and G02 circular interpolation,
and a few advanced CNC systems support spline or NURBS interpolation. This is mainly caused by
historical reasons, because the traditional CNC machining mainly needs linear or circular motion.
CAM systems solves the incompatibility between CAD systems and CNC systems. The cooperation
of CAD, CAM and CNC can well complete the design and manufacturing problems in most cases.
However, for the machining of free-form surfaces or curves, it is not the best choice to continue to
use this method. The use of direct interpolation algorithm can bring faster, higher precision and
more stable machining. With rapid development of the computing capacity of CPU, it is not a
problem for the CNC system to undertake the function of direct interpolation. Developing a free-
curve/surface dedicated CNC system using direct interpolation algorithm only for machining free-
form curves and surfaces can become a choice.
A direct interpolation algorithm based on NURBS curves is elaborated in this paper. Adaptive
prediction-correction with constraint chord error method, S velocity planning, and section transition
method support the direct interpolation algorithm work well to provide high speed, high accuracy
and stable motion control. Three motion reference trajectory methods of position interpolation,
velocity interpolation and acceleration interpolation demonstrate that they can all generate
reference motion trajectory when the step length is short enough. Calculation results and simulation
shows that whatever the step length is, the velocity interpolation error is about 4 times the position
interpolation error. Position interpolation mainly produces chord error, but in the three trajectory
generation methods, it still has more stable performance and smaller error. However, only position
interpolation cannot give velocity and acceleration information. In CNC system, not only position
information, but also velocity and acceleration information are needed to achieve better results. In
direct interpolation, position interpolation is used to control position and accuracy, velocity and
acceleration interpolation is used for motion control, which can achieve greater accuracy and
smoother effect. In NURBS direct interpolation process, position, velocity and acceleration all
involve recursive iterative operations, and their calculations can be conveniently completed at the
same time.
In traditional CNC systems, most motion are linear motion and circular motion, but for the
machining of free-form curves and surfaces, the direct interpolation algorithm is more appropriate.
In this way, the CAM stage can be skipped over, which can not only improve the smoothness and
accuracy of machining, but also provide the possibility for the two-way flow of information, and
provide conditions for the introduction of intelligent manufacturing technologies such as digital
twins into CNC systems.
Reference
[1] Syh-Shiuh Yeh, Pau-Lo Hsu. Adaptive-Feedrate Interpolation for Parametric Curves with a
Confined Chord Error[J]. Computer-Aided Design, March 2002, Volume 34, Issue 3:229-237.
[2]Tsehaw Yong, Ranga Narayanaswami. A Parametric Interpolator with Confined Chord Errors,
Acceleration and Deceleration for NC Machining[J]. Computer-Aided Design, November 2003,
Volume 35, Issue 13:1249-1259.
[3] Burak Sencer, Kosuke Ishizaki, Eiji Shamoto. A curvature optimal sharp corner smoothing
algorithm for high-speed feed motion generation of NC systems along linear tool paths[J]. Int J Adv
Manuf Technol (2015) 76:1977–1992.
[4] Shingo Tajima, Burak Sencer, Eiji Shamoto. Accurate interpolation of machining tool-paths
based on FIR filtering[J]. Precision Engineering 52 (2018) 332–344.
[5] Shingo Tajima, Burak Sencer. Global tool-path smoothing for CNC machine tools with
uninterrupted acceleration[J]. International Journal of Machine Tools & Manufacture 121 (2017)
81–95.
[6] Li Dongdong, Zhang Liqiang, Yang Le Accurate interpolation algorithm of corner contour error
based on FIR filter[J]. Computer integrated manufacturing system, January 2021.
[7] Du Jinfeng, Zhang Liqiang, Gao Tian. Kinematic smoothing algorithm for high speed machining
of continuous short segments based on jump constraint [J]. Computer integrated manufacturing
system, September 2018.
[8] Liu Chunyan. Research on motion controller for open CNC[D]. Fuzhou, Fuzhou University,
2003
[9] Zhu Xinxiong. Free form curve and surface modeling technology[M]. Beijing: Science Press,
2000.
[10]Syh-Shiuh Yeh, Pau-Lo Hsu. Adaptive-Feedrate Interpolation for Parametric Curves with a
Confined Chord Error[J]. Computer-Aided Design, March 2002, Volume 34, Issue 3:229-237.
[11] You Youpeng, Wang Min, Zhu Jianying. Adaptive interpolation algorithm for parametric
curves[J]. Journal of Nanjing University of Aeronautics and Astronautics, December 2000: 667-671.
[12]Tianmiao Wang, Yunan Cao, Youdong Chen, etc. A new feedrate adaptation control NURBS
interpolation based on de Boor algorithm in CNC systems[J]. Proceedings of the American Control
Conference, July 2008. DOI: 10.1109/ACC.2008.4587131.
Statements and Declarations
Funding:
This work was supported by Key scientific research projects of colleges and universities in Henan
Province (Grant numbers [20B520001])

Competing Interests:
The authors have no relevant financial or non-financial interests to disclose.

Author Contributions:
Both authors contributed to the study conception and design. The manuscript was mainly written by
Shengli WEI. Both authors commented on previous versions of the manuscript. Both authors read
and approved the final manuscript.

You might also like