In this paper, a real-time interpolation method is presented for parametric NURBS curves.
The interpolation algorithm is based on the second order Taylor’s expansion. This method canA method of real-time NURBS interpolation with confined chord error for CNC systems
657
maintain a small feedrate fluctuation, but the chord error can be large at positions on the curve
which have a high curvature (i.e., has a small radius of curvature). The problem of chord error
can be overcome by monitoring the radius of curvature along the NURBS curve during
interpolation time, and adapting the machining feedrate such that it get properly smaller values
at positions which have a radius of curvature below a critical value, ρc . Simulation results on
the Matlab software shows that, although the feedrate adapting formula is quite simple, it is very
useful in respecting the chord error tolerance.
8 trang |
Chia sẻ: honghp95 | Lượt xem: 563 | Lượt tải: 0
Bạn đang xem nội dung tài liệu A method of real-Time nurbs interpolation with confined chord error for cnc systems, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
Vietnam Journal of Science and Technology 55 (5) (2017) 650-657
DOI: 10.15625/2525-2518/55/5/9206
A METHOD OF REAL-TIME NURBS INTERPOLATION WITH
CONFINED CHORD ERROR FOR CNC SYSTEMS
Nguyen Huu Quang*, Banh Tien Long
Hanoi University of Science and Technology, 1 Dai Co Viet, Hai Ba Trung, Ha Noi, Viet Nam
*Email: quang.nguyenhuu@hust.edu.vn
Received: 8 February 2017; Accepted for publication: 10 April 2017
ABSTRACT
This paper presents a method of real-time CNC interpolation for complex curved profiles
which can be described with NURBS equations. The real-time interpolation algorithm is based
on second order Taylor’s expansion with the principle part being a formula for updating
parametric value u after each sampling period. With the updated value of u, a new interpolated
point is calculated based on the DeBoor’s algorithm. Chord error caused by the interpolation
algorithm depends on two main factors which are machining feedrate and radius of curvature of
the NURBS curve. In this paper, an efficient method of limiting chord error is also presented
with the basic idea of reducing machining feedrate at positions with a radius of curvature smaller
than a critical value. Simulation results on Matlab software verify effectiveness of the proposed
method.
Keywords: CNC interpolation; CAD/CAM; NURBS; DeBoor’s algorithm.
1. INTRODUCTION
Nowadays, parametric curves such as Bezier, B-spline, NURBS, etc. are being widely
applied in well-developed CAD systems to design parts with complex curved profiles. On the
other hand, conventional CNC machines typically only support motion along straight lines (G01)
and circular arcs (G02,G03). To bridge the gap between CAD systems and CNC machines, there
are two main approaches: In the first one, original parametric curves is approximated by a
sequence of short linear segments with the use of CAM softwares; And in another one, a new
parametric interpolator is suggested to be developed for CNC systems, so that it has the ability
of calculating interpolated positions in real-time based on the parametric equations of the curve
[1 – 5].
In the linear approximation method (the currently popular method), contour error depends
on the number of linear segments. In order to achieve the desired tolerance (typically being 10
mµ ), the number of segments is usually very huge and the length of each segment is very short,
leading to the large size of G-code files, the deviation of machining feedrate, as well as the
reduction of machining productivity and parts surface quality, etc. In the real-time method, the
interpolation algorithm takes account of the commanded feedrate in calculations of the tool
A method of real-time NURBS interpolation with confined chord error for CNC systems
651
position for next cycle from the current position. Therefore, the maching feedrate will be more
stable in the real-time method. Additionally, the size of G-code files will be much smaller,
because the geometric parameters of the curves (e.g., control points coordinates, weights, etc.)
will be passed to CNC systems instead of end points coordinates of linear segments [1 – 5].
This paper presents a real-time interpolator for NURBS curves. NURBS (Non-Uniform
Rational B-Spline) are generalizations of non-rational and rational Bezier, as well as non-
rational B-splines curves. They offer one common mathematical form for both standard
analytical shapes (e.g., circular arcs, ellipses, etc.) and free-form ones, with the great flexibility
to design a large variety of geometries through adapting control points, weights and knot values.
Also, they can be evaluated reasonably fast by numerically stable and accurate algorithms. With
many advantages listed above and more, NURBS has been widely used in CAD systems today.
In that trend, real-time NURBS interpolators will promisingly have expansion applications, and
also promote the integration of CAD, CAM and CNC technologies to improve productivity and
quality in mechanical production. In this paper, the problem of chord error appeared in the real-
time interpolation process is also considered, and a simple but efficient formula to adapt
machining feedrate is proposed for the purpose of limiting this kind of error.
2. PARAMETRIC NURBS CURVES
A pth-degree NURBS curve is defined as follows [6]:
,
0
,
0
( ) ( )
( ) ( ) ,
( )( )
n
i p i i
i
n
i p i
i
x u N u w
u y u a u b
N u wz u
=
=
= = ≤ ≤
∑
∑
P
C (1)
where, [ ]{ , , } (0 )Ti i i iX Y Z i n= ≤ ≤P are control points, { }iw are the corresponding weights of
{ }iP . ,{ ( )}i pN u are pth-degree B-spline basis functions defined on the knot vector
1 1
1 1
{ ,..., , ,..., , ,..., }p m p
p p
U a a u u b b+ − −
+ +
= . The pth-degree B-spline basis functions are recursively
defined as follows:
1
,0
1
1 , [ , )( )
0 , [ , )
i i
i
i i
u u u
N u
u u u
+
+
∈
= ∉
(2)
1
, , 1 1, 1
1 1
( ) ( ) ( )i pii p i p i p
i p i i p i
u uu uN u N u N u
u u u u
+ +
− + −
+ + + +
−
−
= +
− −
(3)
One of the most important algorithms for NURBS is the DeBoor’s algorithm [6]. This
algorithm is a generalization of the deCasteljau's algorithm for Bezier curves. It provides a fast
and numerically stable way to find a point on a NURBS curve, given a u value in the domain.
Some important geometric properties of NURBS curves (e.g., tangent, curvature, etc.)
concern high order derivatives of them. The kth derivative of a NURBS curve ( )uC , denoted by
( ) ( )k uC , is defined as following:
[ ](1) ( )( ) ( ), ( ), ( ) Td uu x u y u z u
du
′ ′ ′= =
CC (4)
Nguyen Huu Quang, Banh Tien Long
652
( 1)
( ) ( )( ) , 2
k
k d uu k
du
−
= ≥CC (5)
According to [6], the derivative of a pth degree NURBS curve is a (p-1)th degree NURBS
curve. Therefore, the DeBoor’s algorithm can also be applied to calculate high order derivatives
of NURBS curves.
3. DESIGN OF A REAL-TIME NURBS INTERPOLATOR
Based on input data including: (a) parametric equations of the NURBS path; (b) machining
feedrate sV ; (c) interpolation period T; and (d) the current position of the tool, the real-time
NURBS interpolator designed in this section will calculate the target position of the tool for next
interpolation cycle in consideration of the chord error tolerance.
3.1. A NURBS interpolation algorithm based on the second order Taylor’s expansion
According to differential geometry, the feedrate sV along the NURBS path can be
calculated as following:
(1)( ) ( ) ( )s
d u d u du duV u
dt du dt dt
= = ⋅ = ⋅
C C C (6)
From (6) we can deduce:
(1) ( )
sVdu
dt u
=
C
(1)
and,
2 (1) (2)2
42 (1)
( ), ( )
( )
sV u ud u
dt u
⋅
= −
C C
C
(8)
where, denotes scalar product of two vectors, and denotes magnitude of a vector.
Define ( )ku u kT= , , ( )s k sV V kT= . By using Taylor’s expansion, we have the
approximation up to the second derivative as following:
2 2
1 22k k t kT t kT
du T d u
u u T
dt dt
ε+
= =
= + ⋅ + ⋅ +
(9)
In Equation (9), ε is truncation error which is determined in requirement.
Substituting (7) and (8) into (9) we have the following second order Taylor’s
approximation:
2 2 (1) (2)
,,
1 4(1) (1)
( ), ( )
( ) 2 ( )
s k k ks k
k k
k k
V T u uV T
u u
u u
+
⋅ ⋅
⋅
= + −
⋅
C C
C C
(10)
The Equation (10) has a recursive form and can be used to update the parametric value u
after each interpolation period. With the new value of u, the next target tool position can be
obtained by applying the parametric equations of the NURBS curve and the DeBoor’s algorithm:
A method of real-time NURBS interpolation with confined chord error for CNC systems
653
1 1 1 1( , , ) ( )k k k kx y z u+ + = += C (11)
Equations (10) and (11) form the basis of a NURBS interpolation algorithm. They can be
implemented in real-time by digital signal processing systems.
3.2. Chord error calculation
In an interpolation period, the tool moves linearly on the chord connecting ( )kuC and
1( )ku +C and causes the chord error which is the maximum deviation of the chord from the
corresponding curve segment. To evaluate this kind of error, we consider a circular arc which is
tangent with and has the same radius of curvature as the NURBS curve at ( )kuC , as
demonstrated in Figure 1. If the tool didn’t move along the NURBS curve but the circular arc in
one interpolation period with feedrate sV , then it would reach a position 1( )ku +P instead of
1( )ku +C . Let kρ denote the radius of curvature of the NURBS curve at ( )kuC , and define
1( ) ( )k k ku u+= −P Pℓ . Because the value of ku and 1ku + are very close together, the chord error
in movement along the NURBS path from ( )kuC to 1( )ku +C can be estimated by the chord
error, ke , in movement along the circular path from ( )kuP to 1( )ku +P (with ( ) ( )k ku u≡P C ).
From geometric relationships we can infer:
2
2
2
k
k k ke ρ ρ
= − −
ℓ
(12)
Figure 1. Estimation of chord error.
Additionally, kℓ approximates to the path length which the tool moves in one period T, so:
,k s kV T= ⋅ℓ (13)
From and we deduce:
2 2 2 2 22
, , ,
2 2
,
4 8
4
4
s k s k s k
k k k
k
s k
k k
V T V T VT
e
V T
ρ ρ
ρ
ρ ρ
⋅ ⋅
= − − = ≈ ⋅
⋅
+ −
(14)
Nguyen Huu Quang, Banh Tien Long
654
Equation (14) is an estimation of the chord error. It shows that the chord error is dependent
on two major variable which are the feedrate,
,s kV , and the radius of curvature of the curve, kρ .
The radius of curvature of the NURBS curve, kρ , can be calculated as following [6]:
3(1)
(1) (2)
( )
( ) ( )
k
k
k k
u
u u
ρ =
⊗
C
C C
(15)
where, symbol ⊗ denotes vector product of two vectors.
3.3. Confining the chord error
Let maxe denote the chord error tolerance. We have the following constraint:
2 2
, max
max 2
8s k c
k
k c
V e V
e e
Tρ ρ
⋅
≤ ⇔ ≤ = (16)
In (16), cV is the commanded feedrate and
2 2
max8
c
c
V T
e
ρ ⋅=
⋅
. The method of confining the
chord error is proposed as following:
• If k cρ ρ≥ then the machining feedrate is maintained as commanded feedrate: ,s k cV V= .
• If k cρ ρ< then the machining feedrate in current interpolation cycle is reduced as
below:
,
k
s k c
c
V V ρ
ρ
= ⋅ . (17)
4. SIMULATION AND DISCUSSION
Simulation method is used to evaluate the real-time NURBS interpolation algorithm in two
cases: without and with consideration of the chord error tolerance. The test NURBS curve is
chosen as Figure 2.
Figure 2. The test NURBS curve (solid line).
Dashed line represents its control polygon.
A,B,C mark high curvature zones.
Figure 3. Curvature plot of the test NURBS curve.
A,B,C mark corresponding curvatures of A,B,C
positions on Figurre 2.
As shown in Figure 3, its curvature varies considerably along the curve. In general, this
characteristic make the test curve a difficult toolpath for CNC machining [7, 8]. Geometric
A method of real-time NURBS interpolation with confined chord error for CNC systems
655
parameters of the test NURBS curve are listed in Table 1. The simulation program is developed
on the Matlab software with the interpolation period T chosen as 1 ms.
Table 1. Geometric parameters of the test NURBS curve.
Degree p=3
Knot vector (0,0,0,0,0.25,0.5,0.75,1,1,1,1)
Control points and weights
P0=(10,0,0), w0=1
P1=(20,22,0), w1=1
P2=(12,8,0), w2=1
P3=(10,20,0), w3=1
P4=(8,8,0), w4=1
P5=(0,22,0), w5=1
P6=(10,0,0), w6=1
4.1. Evaluation of the NURBS interpolator without confined chord error
The NURBS interpolation algorithm without confined chord error (Section 3.1) is
simulated with the test NURBS curve. With different feedrates which are 100 mm/s, 60 mm/s
and 30 mm/s, the chord error are shown in Figure 4. It can be seen from Figurre 4 the trend of
increasing chord error when the feedrate get higher value. With the feedrate of 100 mm/s
(6 m/min), the chord error can be larger than 10 µm which is quite large. The chord error
decreases to be lower than 5 µm with the feedrate of 60 mm/s, and continues decreasing to about
1 µm with the feedrate of 30 mm/s. These results confirm the idea of reducing chord error by
reducing machining feedrate.
For another remark, we can see that the range of machining feedrate below 30 mm/s in
which the chord error is about 1 µm, in fact, is suitable with almost normal CNC machining
applications. So, the problem of limiting chord error only get more important in high-speed
machining.
Figure 1. Chord errors caused by NURBS interpolator without confined chord error.
Nguyen Huu Quang, Banh Tien Long
656
4.2. Evaluation of the NURBS interpolator with confined chord error
The NURBS interpolator with confined chord error is simulated with max 1e mµ= . When
the commanded feedrate is set to be 100 mm/s, Figure 5 (a) show that the chord error is reduced
significantly in comparison with the previous simulation results in Figure 4. At several positions,
the chord errors are still larger than 1 µm, because the feedrate adapting formula is only based
on an approximate estimation of the chord error.
Figure 2. Simulation results of the NURBS interpolator with confined chord error:
(a),(b) corresponding to the feedrate of 100 mm/s; (c),(d) corresponding to the feedrate of 200 mm/s.
Figure 5(b) represents the machining feedrate. It can be seen that the feedrate is reduced at
some positions (marked as A,B,C), as a result of the error limiting algorithm. At other positions,
the machining feedrate is maintained almost the same as commanded feedrate.
When the commanded feedrate is doubled to 200 mm/s, the chord error is hardly greater, as
shown in Figure 5(c). This result confirms the effectiveness of the error limiting algorithm.
However, the number of positions with feedrate reduction increase, as shown in Figure 5(d). The
reason is that the critical radius of curvature, cρ , gets larger when the commanded feedrate get
higher, leading to the expansion of the curve segments at which machining feedrate need to
adapt. This effect will decrease the average machining feedrate, as well as increase the
machining time.
5. CONCLUSION
In this paper, a real-time interpolation method is presented for parametric NURBS curves.
The interpolation algorithm is based on the second order Taylor’s expansion. This method can
A method of real-time NURBS interpolation with confined chord error for CNC systems
657
maintain a small feedrate fluctuation, but the chord error can be large at positions on the curve
which have a high curvature (i.e., has a small radius of curvature). The problem of chord error
can be overcome by monitoring the radius of curvature along the NURBS curve during
interpolation time, and adapting the machining feedrate such that it get properly smaller values
at positions which have a radius of curvature below a critical value, cρ . Simulation results on
the Matlab software shows that, although the feedrate adapting formula is quite simple, it is very
useful in respecting the chord error tolerance.
Acknowledgement. This research is funded by the Hanoi University of Science and Technology (HUST)
under project number T2016-PC-061.
REFERENCES
1. Koren Y., Lo C. C., Shpitalni M. - CNC interpolators: algorithms and analysis, Asme
Prod Eng Div Publ Ped, Asme, New York, USA 64 (C) (1993) 83–92.
2. Shpitalni M., Koren Y., Lo C. C. - Realtime curve interpolators, Comput. Des. 26 (11)
(1994) 832–838.
3. Zhiming X., Jincheng C., Zhengjin F. - Performance evaluation of a real-time
interpolation algorithm for NURBS curves, Int. J. Adv. Manuf. Technol. 20 (4) (2002)
270–276.
4. Hong Tzong Yau, Ming Tzong Lin, Meng Shiun Tsai - Real-time NURBS interpolation
using FPGA for high speed motion control, CAD Comput. Aided Des. 38 (10) (2006)
1123–1133.
5. Banh Tien Long, Nguyen Huu Quang - A method of real-time NURBS interpolation for
CNC systems, Journal of Science & Technology Technical Universities 114 (2016) 48–53
(in Vietnamese).
6. Les Piegl, Wayne Tiller, The NURBS book, 2nd ed., Springer, New York, 1996.
7. Banh Tien Long, Bui Ngoc Tuyen - Surface machining theory and application in
mechanical engineering, Vietnam Education Publishing House, Ha Noi, 2012 (in
Vietnamese).
8. Banh Tien Long, Tran The Luc, Nguyen Chi Quang - Theory of cutting tool geometry and
machining, Science and Technics Publishing House, Ha Noi, 2006 (in Vietnamese).
Các file đính kèm theo tài liệu này:
- 9206_39561_1_pb_9278_2061437.pdf