Professional Documents
Culture Documents
Computer-Aided Design
journal homepage: www.elsevier.com/locate/cad
article
Article history:
Received 8 July 2009
Accepted 4 July 2010
Keywords:
CNC interpolators
STEP-NC
Canonical equations
Curvature
Torsion
info
abstract
We use the canonical equations (CE) of differential geometry, a local Taylor series representation of any
smooth curve with parameter the arc length, as a unifying framework for the development of new CNC
algorithms, capable of interpolating 2D and 3D curves, represented parametrically, implicitly or as surface
intersections, with accurate feedrate control. We use a truncated form of the CE to compute a preliminary
point, at an arc distance from the last interpolation point selected to achieve a desired feedrate profile.
The next interpolation point is derived by projecting the preliminary point on the curve. The coefficients
in the CE involve the curves curvature, torsion and their arc length derivatives. We provide computing
procedures for them for common Cartesian representations, demonstrating the generality of the proposed
method. In addition, our algorithms admit corrections, which render them more accurate in terms of the
programmed feedrate, compared to existing parametric algorithms of the same order.
2010 Elsevier Ltd. All rights reserved.
1. Introduction
Recent work on interpolation algorithms for CNC [18] has been
motivated by theoretical considerations and the need to address
the following practical requirements:
(a) Increase the capability of CNC systems for machining
complex geometries. This is currently limited to straight line and
circular cuts. Extending it to more complex geometries requires
interpolation algorithms for general curves and surfaces.
(b) Improve the CAD/CAM interface. This is presently characterized by gross inefficiency. Complex geometries to be machined,
arising in CAD, are approximated in a CAM system by numerous
short straight line cutter moves, to accommodate present CNC capabilities as described in (a). The resulting transmission of a large
volume of short move data from CAM to the CNC machine, with
tangent discontinuities between adjacent moves, degrades the cutting conditions and the quality of the machined surfaces [4].
(c) Improve cutting conditions in high-speed machining, by
allowing for variable time, arc length and curvature dependent
feedrates [7,9].
To overcome these and other shortcomings, the international
STEP-NC program is currently underway [1,2]. Being an offshoot of
STEP (STandard for the Exchange of Product model data), STEP-NC
aims at transmitting original CAD curve and surface data to the
CNC in a portable neutral format, together with machining process
and tool path planning or explicit tool movement information
generated by CAM. A first STEP-NC standard, compatible with
Corresponding author. Tel.: +30 2610 433592; fax: +30 2610 997744.
E-mail address: papaioan@mech.upatras.gr (S.G. Papaioannou).
0010-4485/$ see front matter 2010 Elsevier Ltd. All rights reserved.
doi:10.1016/j.cad.2010.07.007
22
Fig. 1. Locating the next interpolation point Pi+1 : (a) Without correction. (b) Using a corrected arc distance d in the CE.
k
2
k2
6
s2 +
k
6
s3
k
6
s3 +
kk
8
s3 +
s4 + O (s5 )
k k 2 k3
2k k
24
24
s4 + O (s5 )
s4 + O (s5 )
(1)
Pg = [Pi ] + [T]l Pl
(2)
p p
where Pl , Pg are the local and global coordinate vectors of
p
g
Pi+1 , [Pi ] is the global coordinate vector of Pi and [T]l is the
transformation matrix from the local to the global system.
Recursive expressions for the computation of k, , k , , k , T,
N, B at Pi , for curves, represented parametrically by r = [x(u),
y(u), z (u)]T are provided in Appendix A.1. The curvature k, torsion
and their arc length derivatives are required to apply the
CE, while T, N, B are used to form the transformation
p matrix
g
[T]l in Eq. (2). Once the global coordinate vector Pg of the
p
preliminary point Pi+1 is obtained, the projection point Pi+1
is computed numerically using Newtons method. Apart from
Pi+1 , the projection computation also provides the corresponding
value of u, which we need to compute k, and their arc length
derivatives at Pi+1 , to start the next iteration.
Parametric representations of 3D curves arise in the isoparametric machining of surface patches represented by r = [x(u, ),
y(u, ), z (u, )]T , 0 u, 1. The cutter is directed to move in
zig-zag or unidirectional fashion along a path consisting of a family
of n closely spaced isoparametric lines, covering the entire patch.
23
s =
y y
s
s =
y2 + y y s2
s
y
y 3ks2 s
k = 3 ,
k =
,
s
s4
3 s 6ks s2 3ks2 s
y 7ks
k =
s5
[
T=
1 y
s
]T
y 1
N= ,
s s
]T
(3)
(4)
(5)
24
T=
2f x fy fxy
fx2
fx2 fyy
fy2 fxx
fy2 3/2
3f x fy2 fxxy
(fx2 + fy2 )2
3(2f x fy fxy fx2 fyy fy2 fxx )[fx fy (fxx fyy ) fxy (fx2 fy2 )]
(fx2 + fy2 )3
1
fx2
fy2 1/2
f y , f x
N=
fx2
fy2 1/2
fx , fy
(6)
(7)
Eqs. (6)(7) allow the use of up to third order CE. The fourth order
but obtaining a numerically robust expression for it
CE requires k,
is cumbersome.
In CNC practice, the above equations and the CE can be used to
direct an end milling cutter in the 2 21 D peripheral machining of a
part, whose boundary is an implicitly defined plane curve [17].
4. Extension to surface intersections
A 3D curve may also be defined as the intersection of two surfaces, each of which may be represented implicitly or parametrically. This gives rise to three possible curve representations, of
which computationally simpler is the hybrid case, where one of the
intersecting surfaces is expressed implicitly as f (x, y, z ) = 0 and
the other parametrically as x = x(u, v), y = y(u, v), z = z (u, v).
The curve representation then reduces to a single implicit equation
f (x(u, v), y(u, v), z (u, v)) = 0 in the parametric u v domain.
In the pure implicit case, both surfaces are expressed implicitly as
f (x, y, z ) = 0, g (x, y, z ) = 0. The intersection curve is then represented by the system of these two equations in the three position
variables x, y, z. In the pure parametric case, the intersecting surfaces are represented by x = c (u, v), y = d(u, v), z = e(u, v) and
x = f (r , t ), y = g (r , t ), z = h(r , t ) and the curve by the three
equations c (u, v) = f (r , t ), d(u, v) = g (r , t ), e(u, v) = h(r , t ), in
the four parameter variables u, v, r , t.
To extend the CE algorithms to surface intersections, it is
convenient to compute k from the first of Eq. (A.1.4) as a positive
quantity
k =
r r
s3
[(x y x y )2 + (y z y z )2 + (z x z x )2 ]1/2
s3
(8)
1/2
[XYZ ]T
,
N = B T,
( + Y 2 + Z 2 )1/2
[(fx cg gx cf )(fy cg gy cf )(fz cg gz cf )]T
B=
(X 2 + Y 2 + Z 2 )3/2 k
T=
X2
(9)
(10)
=
2
dx
dt
xu
du
dt
zu
dt
dv
dz
dv
dt
+ yu
dt
+ zv
dt
+ xv
du
dy
du
dt
+ yv
dv
dt
dt
(11a)
= fu
du
dt
+ fv
dv
dt
=0
=
=
du
dt
du
dt
dv
(11b)
dt
(fu2 + fv2 ) 2
.
(xu fv xv fu )2 + (yu fv yv fu )2 + (zu fv zv fu )2
(12)
= 0.
(13)
Newtons iteration is
(14)
fy h fhy
fx hy fy hx
ui
du = 1t
(18)
yj+1 = yj +
fhx fx h
f x hy f y hx
(16)
(i+1)1t
i1t
dt
(19)
(15)
6. Variable feedrate
s = s(ui+1 ) s(ui ) =
uj+1 = uj
25
s = 1t +
1 d
1 d2
(1t )3 + .
(20)
2 dt
6 dt 2
If is a function of arc length, its derivatives are obtained by
d
applying the operator dt
= dsd . Thus,
d
(1t )2 +
d2
+ 2
(17)
dt
dt
ds
d
dk
+ 2
dt 2
d2
k ,
d2
dk2
dt 2
k 2 + 2
ds
d
dk
dt
d
dk
ds
d2
ds2
d
dt
. (21)
d
= dk
k
k 2
k .
(22)
26
Table 1
p
Corrected arc lengths d(s) for computing Pi+1 from the nth order CE, n = 1, 2, 3.
Order of CE algorithm
d (s )
First
s+
k2 s3
3
4
23kks
24
s+
k2 s3
3
Second
k2 s3
6
4
7kks
24
k2 s3
6
4
kks
8
4
kks
Third
Pr(d, s) = Pi+1 (d)P4i+1 (s) is the projection vector and T(s) is the
tangent vector at P4i+1 . To form the condition F (d, s) = 0, we first
write T(s) as a fourth order Taylor approximation
T(s) = T(0) + T (0)s + T (0)
= 1
k s
s3
...
+ T (0)
s4
24
24
T(0)
(k k 2 k3 )s3
24
k s2
....
+ T (0)
2
6
...
2
( k 3k 3k 6k2 k )s4
ks
+ ks +
3
3kks
2 2
s2
N(0)
(2k + k )s3
(3k + 3k + k k 3 k3 )s
24
B(0)
(23)
...
by
.... using the FrenetSerret relations to express T(0), T(0), T (0),
T (0) in terms of T(0), N(0), B(0) and inserting these expressions
into the Taylor series. Then, for the second order CE algorithm with
correction, for example, from Eq. (1) we obtain
p
Pr(d, s) =
P4i+1
[
+
+
(s)
ks2
2
kd2
k s3
6
N(0)
p
Pi+1
3
ks
(d) = s
+
k2 s3
k k 2 k3
24
kk
8
24
2k k
s d T(0)
4
kd2
2
(24)
N(0)
s4 B(0).
sp se
100%,
e=
...
+ d (0)
....
+ d (0)
(25)
2
6
24
The derivative values were obtained by using Mathematica to
differentiate the normality condition F (d, s) = 0 symbolically with
respect to s and setting in the resulting expression F (d, s) = 0, s =
0, d(0) = 0 to obtain d (0) = 1, then differentiating F (d, s) = 0
and setting in F (d, s) = 0, s = 0, d(0) = 0, d (0) = 1 to obtain
d (0) = 0 and so forth for the remaining derivatives. The results
are summarized in Table 1 and are valid for both plane and space
curves.
Corrections are the terms beyond s, that is the quantities d(s) s
which, when divided by 1t, can be regarded as general estimates
of the step feedrate error, when no correction is used. The CE
algorithms with correction proceed as before, except that d(s)
p
rather than s is inserted in the chosen order of the CE to obtain Pi+1 .
8. Computational results
o
1 + k(d /2)
(27)
a = 5, b = 6 (28)
(29)
27
Fig. 2. (a)(b) Generated cardioid and oval of Cassini. (c)(f) Cardioid test results.
coordinate system types is possible, but was not pursued here. Our
computer results so far indicate that, when corrections are used,
the proposed algorithms are more accurate in terms of feedrate
compared to established parametric algorithms of the same order.
They are also less efficient, but the difference in computer times is
modest, not enough to compromise their suitability for high-speed
machining.
Questions open to further research are the expression of
the differential quantities k, , k , , k , T, N, B of the CL points
trajectory, in terms of corresponding quantities of the trajectory
of the cutters CC point, on a given base surface. Such expressions
would make it possible to interpolate the trajectory of the CL point
directly, using the CE. A more challenging problem is the 3D finish
28
30
k =
(k )
s
k =
k =
(A.1.2)
(A.1.3)
r = (s s3 k2 )T + (3s s k + s k )N + s3 k B
r r = s kB,
r (r r ) = s k
(r r ) B
s 3
r
T = ,
s
B=
=
r r
|r r |
6 2
(A.1.4)
r (r r )
r r
s3 k
N = B T.
(A.1.6)
r r
s
s =
r2 + r r s2
s
. (A.1.7)
Then,
k
1
k = =
s
s
(r r ) B
s 3
=
=
(r r ) B 3s2 s k
r r s s 2s3 s k2
s5 k
7s s k s k
s 5
s (r r ) s (r r ) s3 (3s2 + 4s s )k2
s7 k
6s s kk s k (k + 2 )
7 2
s7 k
(A.1.10)
s
s kr (r r ) (6s k + 2s2 k )r (r r )
s 8 k 3
(A.1.11)
[
. (A.1.8)
(A.1.9)
k=
s 4
s5
5
(A.1.5)
s6 k2
s2
((r r ) + (r r )) B 3s (2s2 + s s )k
2
r = s T + ks N,
r = s T ,
k s k
s3
= N
B
k=
= kT + B
N
T = kN
T=
x y
s
]T
k =
x y x y 3s2 s k
s 4
[ ]T
y x
N= ,
.
s
,
(A.1.12)
dy
=
=
+
=
+ y
dx
x y dx
x y
d
(A.2.1)
y =
fz g x fx g z
fy gz fz gy
fx = fxx + fxy y ,
fx
y =
fy
fx fy fx fy
(A.2.3)
fy2
(A.2.4)
z =
fy4
fy gz fz gy
Z
X
g (x, y, z ) = cg (y , z ) + gy y + gz z = 0
cf = fxx + fyy y2 + fzz z 2 + 2(fxy y + fxz z + fyz y z )
to obtain
y =
fz cg gz cf
X
z =
gy cf fy cg
(A.3.4)
fz cg gz cf
z =
gy cf fy cg
X
X
cf = fxxx + fyyy y3 + fzzz z 3 + 3(fxxy y + fxxz z + fxyy y2
+ 3(gxxy y + gxxz z
. (A.2.5)
(A.3.6)
y = du + dv v ,
z = eu + ev v .
fr r ft t = 0
duu + 2duv v gur r grr r 2 gut t gtt t 2 + dv v
gr r gt t = 0
euu + 2euv v hur r hrr r 2 hut t htt t 2 + ev v
(A.3.5)
(A.3.3)
(A.3.2)
f (x, y, z ) = cf (y , z ) + fy y + fz z = 0
e u + e v v hr r ht t = 0
fy4
fx gy fy gx
cu + cv v fr r ft t = 0,
(fx fy + fx fy fx fy fx fy )fy2
fy = fxy + fyy y ,
y =
(A.3.1)
g (x, y, z ) = gx + gy y + gz z = 0
fx
f = fx + fy y = 0 y =
fy
29
(A.3.7)
hr r ht t = 0
(A.3.8)
30
y = duu + 2duv v + dv v ,
z = euu + 2euv v + ev v ,
(A.3.9)
etc.
A.4. Convergence of Newtons method
To derive a convergence condition of Newtons iterations in the
point projection problem, we assume a plane parametric curve,
express the normality condition (Eq. (13)) in the local Frenet frame
p
k 2 s3
yl =
ks2
2
3
ks
6
(A.4.2)
p
xl
p
xl
p
yl
p
yl
= (
h (s) = (
x)x + (
...
x) x + (
y)y 1
(A.4.3)
...
y) y .
...
...
The values of x , x , x , y , y , y at the origin are obtained by applying
the FrenetSerret relations (Eq. (A.1.2)) at Pi , as follows
T = [x, y ]T = [1, 0]T x = 1, y = 0
T = [x, y ]T = kN = k[0, 1]T x = 0, y = k
(A.4.4)
... ...
T = [ x , y ]T
...
k2 T = k [0, 1]T k2 [1, 0]T ...
x = k2 , y = k .
= kN
Writing (A.4.3) at the origin and introducing in them the values
(A.4.4) and the expressions (A.4.2), we obtain
p
h(0) = xl = s
k2
s3
6
k2 2
kk 3
p
h (0) = kyl 1 =
s +
s 1
2
6
4
2
p
pl = k2 s + kk s2 + k + k s3 .
h (0) = k2 xl + ky
2
6
s < 0.707rk
(A.4.6)
(A.4.1)
The convergence condition |h(0)h (0)| < h (0)2 , after some manipulation
and dropping of the higher order terms, yields s <
2/(2k) or
(A.4.5)
References
[1] Suh SH, Cho JH, Hong HD. On the architecture of intelligent STEP-compliant
CNC. Int J Comput Integer Manuf 2002;15(2):16877.
[2] Hardwick M, Loffredo D. Lessons learned implementing STEP-NC AP-238. Int
J Comput Integer Manuf 2006;19(6):52332.
[3] Yang DCH, Kong T. Parametric interpolator versus linear interpolator for
precision CNC machining. Comput Aided Des 1994;26(3):22533.
[4] Spithalni M, Koren Y, Lo CC. Realtime curve interpolators. Comput Aided Des
1994;26(11):8328.
[5] Farouki RT, Shah S. Real-time CNC interpolators for Pythagorean-hodograph
curves. Comput Aided Geom Design 1996;13:583600.
[6] Farouki RT, Tsai Y-F, Yuan G-F. Contour machining of free-form surfaces with
real-time PH curve CNC interpolators. Comput Aided Geom Design 1998;16:
6176.
[7] Farouki RT, Manjunathaiah J, Nicholas D, Yuan G-F, Jee S. Variable-feedrate
CNC interpolators for constant material removal rates along Pythagoreanhodograph curves. Computer Aided Des 1998;30(8):63140.
[8] Farouki RT, Manjunathaiah J, Yuan G-F. G Codes for the specification of
Pythagorean-hodograph tool paths and associated feedrate functions on
open-architecture CNC machines. Int J Mach Tools Manuf 1999;39:12342.
[9] Farouki RT, Tsai YF. Exact Taylor series coefficients for variable-feedrate CNC
curve interpolators. Comput Aided Des 2001;33(2):15565.
[10] Farouki RT. Pythagorean-hodograph curves, algebra and geometry inseparable. Springer; 2008.
[11] Willmore TJ. Differential geometry. Oxford Univ. Press; 1959.
[12] Lipschutz MM. Theory and problems of differential geometry. Schaums
Outline Series, McGraw Hill; 1969.
[13] Hartmann E. G2 interpolation and blending on surfaces. Vis Comput 1996;
12(4):18192.
[14] Ye X, Maekawa T. Differential geometry of intersection curves of two surfaces.
Comput Aided Geom Design 1999;16(8):76788.
[15] Goldman R. Curvature formulas for implicit curves and surfaces. Comput
Aided Geom Design 2005;22:63258.
[16] Patrikalakis NM, Maekawa T. Shape interrogation for computer aided design
and manufacturing. Springer; 2002.
[17] Choi BK, Jerard RB. Sculptured surface machining. Kluwer Acad Publ.; 1998.
[18] Lin RS, Koren Y. Efficient tool-path planning for machining free-form surfaces.
Trans ASME, J Eng Ind 1996;118:208.
[19] Choi YK, Banerjie A. Tool path generation and tolerance analysis for free-form
surfaces. Int J Mach Tools Manuf 2007;47:68996.
[20] Pratt MJ. Geometric methods for CAD. In: Piegl LA, editor. Fundamental
developments of computer-aided geometric modeling. Acad Press; 1993.
[21] Farouki R, Tsai YF, Yuan GF. Contour machining free-form surfaces with
real-time PH curve CNC interpolators. Comput Aided Geom Design 1999;16:
6176.
[22] Tam HY, Xu H, Zhou Z. Iso-planar interpolation for the machining of implicit
surfaces. Comput Aided Des 2002;34:12536.
[23] Pratt MJ, Geisow AD. Surface/surface intersection problems. In: Gregory JA,
editor. The mathematics of surfaces. Oxford Univ. Press; 1986.
[24] Lawrence JD. A catalog of special plane curves. Dover; 1972.
[25] Scarborough JB. Numerical mathematical analysis. Johns Hopkins Press;
1966.