RealTime Curve Interpolators

Embed Size (px)

Citation preview

  • 8/13/2019 RealTime Curve Interpolators

    1/7

    e a l t i m e c u r v e i n t e r p o l a t o r sM S h p i ta l n i, Y K o r e n a n d C C L o

    The a m oun t o f ge ome t r ic in fo rma t ion tha t mus t be t r a nsfe r re dbetween a CAD sys tem and a co mpu ter ized numerica l co ntro lsys tem crea tes a confl ic t be tween part prec is ion on the onehand and feedra te f ide l i ty and communica t ions load on theother . This is the mot iv a t ion for the deve lopm ent of new curveinte rpola t ion a lgori thms for CNC. The in te rpola t ion depends-on the m etho d o f curve representa t ion , i .e . the use o f an impl ici tor a parametr ic form. Accordingly , the paper presents twore a l t ime in t e rpo la t ion a lgo r i thms a nd c ompa re s the m w i thexisting CAD interp olato rs . W ith the new inte rpola tors , theamount of geometr ic informat ion t rans ferred from the CADsys tem to the CNC system is reduced by orders o f magni tude .Mo re ove r , t he c on tou r e r ro r s c a us e d by the ne w in t e rpo la to r sare much smal le r than those caused by convent iona l CADinterpola tors .K e y w o r d s : i n t e r p o l a to r s c o m p u t e r i z e d n u m e r i c a l c o n t r o l c u r v e s

    M o s t c o m p u t e r a i d e d d e s i g n (C AD ) s y s te m s p r o v i d e t h ed e s i g n e r w i th t o o l s f o r d e f i n in g 2 D a n d 3 D c u r v e sa n d s u rf a ce s . I n c o n t r a s t , c o n v e n t i o n a l c o m p u t e r i z e dn u m e r i c a l c o n t r o l ( C N C ) m a c h i n e s g e n e r a l l y s u p p o r to n l y t h e f u n c t i o n s o f s t ra i g h t l i n e a n d c i r c u l a r i n te r -p o l a t i o n s [ se e , f o r e x a m p l e , R e f e r e n c es 1 - 4 ] . T h i s g a pb e t w e e n t h e w e ll d e v e l o p e d t h e o r y o f r e p r e s e n t i n g c u r v e sa n d s u r f a c e s i n CAD s y s t e m s a n d t h e l i m i t e d c a p a b i l i t i e so f f e r e d b y n u m e r i c a l c o n t r o l i n t e r p o l a t o r s i m p o s e s s e v e r ep r o b l e m s i n r e l a t i o n t o t h e r a p i d a n d a c c u r a t e m a c h i n i n ga n d c u t t i n g o f su r f a ce s a n d c u r v e s , i n d i c a t in g a n o b v i o u sn e e d f o r a g e n e r a l c u r v e i n t e r p o l a t o r f o r C N C m a c h i n e s .I n t h i s p a p e r , v a r i o u s p o s s i b i l i t i e s f o r i m p l e m e n t i n gc u r v e i n t e r p o l a t o r s o n C N C m a c h i n e s a r e a n a ly s e d , a n dn e w s c h e m e s a r e o f f er e d . F i r st , t h e m e t h o d c u r r e n t l y u s e df o r m a c h i n i n g c u r v e s i s d i s c u s s e d , a n d t h e d i f f i c u l t i e sa s s o c i a t e d w i t h i t a r e e x p l o r e d . T h e n , t h e n e e d f o r ar e a l t i m e i n t e r p o l a t o r f o r g e n e r a l c u r v e s i s p r e s e n t e d .N e x t , t h e d e p e n d e n c i e s o f i n t e r p o l a t i o n s c h e m e s o n t h em e t h o d s f o r r e p r e s e n t i n g c u r v e s i n a C AD s y s t e m a r ed i s c u s s e d . F i n a l l y , t w o n e w s c h e m e s a r e p r o p o s e d f o rr e a l ti m e i n t e r p o l a t o r s f o r g e n e r a l c u r v e s .Fioure 1 s h o w s t h e c u r r e n t m e t h o d f o r m a c h i n i n g ap a r t . A CAD s y s t e m i s u s e d t o d e f i n e t h e g e o m e t r y o f th ep a r t, a n d t h e C N C m a c h i n e m u s t t h e n d r i v e t h e m a c h i n e

    Faculty o f M echanical Engineering, Technion , Haifa, Israel*Departm ent of M echanical Engineering,Universityof M ichigan, A n nArbor, MI, USAPaper received. 2 May 1993. Revised. 6 October 1993

    t o o l t o m a c h i n e t h i s g e o m e t r y . T h e p a r t g e o m e t r y ist r a n s f e r r e d t o t h e C N C m a c h i n e b y m e a n s o f a p a r tp r o g r a m . T h e m o t i o n c o m m a n d s o f t h e p a r t p r o g r a mm u s t b e p r o c e s s e d i n r e a l t i m e b y t h e C N C i n t e r p o l a t o ri n o r d e r t o g e n e r a t e t h e r e f e r e n c e c o m m a n d s f o r th ec o n t r o l l o o p s f o r e x e c u t i o n ( i.e . th e d r i v i n g o f t h e m a c h i n etoo l ) .T h e m o t i o n c o m m a n d s m u s t f it t he i n t e rp o l a t o r sc a p a b i li t ie s s o t h a t t h e i n t e r p o l a t o r c a n p r o c e s s t h e m i nr e a l ti m e . T h a t i s, a t y p ic a l C N C i n t e r p o l a t o r c a n p r o c e s so n l y s t r a ig h t l i n e a n d c i r c u l a r a r c m o t i o n c o m m a n d s .T h u s , t o d r i v e t h e m a c h i n e t o o l a l o n g a c u r v e , t h e C A Ds y s t e m b r e a k s t h e c u r v e i n t o a s e t o f l i n e se g m e n t s w h i c ha p p r o x i m a t e t h e c u r v e t o a d e s i r e d a c c u r a c y (i .e .t o l e r a n c e ) . E a c h l i n e s e g m e n t , i n t u r n , i s p r o c e s s e d b y t h eC N C s l i n e a r i n t e r p o l a t o r . T h e l i n e ar i n t e r p o l a t o ro p e r a t e s a t s a m p l i n g i n t e r v a l s o f T s . A t e a c h i t e r a t i o n ,t h e t o o l p o s i t i o n c o m m a n d i s i n c r e m e n t e d b y V T m m ,w h e r e V i s t h e d e s i r e d f e e d r a t e i n m i l l i m e t r e s p e r s e c o n d .( I n t e r n a l l y , b a s i c l e n g t h u n i t s ( B L U s ) a r e u s e d i n s t e a d o fm i l l i m e t r e s , a n d u n i t s o f 0 .0 1 m m a n d 0 . 00 1 i n a r ec o m m o n . ) T h u s , i n o r d e r t o m a c h i n e a l i n e o f a l e n g tho f I B L U a t a f e e d r a t e o f V B L U / s , t h e l i n e i s d i v i d e db y t h e C N C i n t e r p o l a t o r i n t o i n c r e m e n t s o f VT B L Ue a c h . ( N o t e t h a t t h e d i v i s i o n i n t o i n c r e m e n t s i s i n h e r e n ti n t h e C N C i n t e r p o l a t i o n m e t h o d , a n d i s i n d e p e n d e n t o ft h e p r o g r a m m e d a c c e l e r a t i o n o r d e c e l e r a t i o n ) .I n t h e g e n e r a l c a s e , h o w e v e r , t h e l e n g t h o f t h e l i ne I i sn o t a n i n t e g e r m u l t i p l i c a t i o n o f VT. T h e r e f o r e , t h e l a s ti n c r e m e n t i s u s u a l l y s h o r t e r t h a n VT B L U . T h i s l a s ti n c r e m e n t i s a l s o m a c h i n e d a t T s , a n d t h i s t h u s r e d u c e st h e o v e r a l l a v e r a g e f e e d r a t e a l o n g t h e l i n e . T h i s e f f e c t i sp r a c t i c a l l y n e g li g i b l e w h e n n o r m a l s t r a i g h t li n e s a r em a c h i n e d . H o w e v e r , i t b e c o m e s s i g n if i ca n t w h e n t h e l i n ei s v e r y s h o r t , a s i s t h e c a s e i n c u r v e s e g m e n t a t i o n . I nt h e s e ca s e s, t h e c o n t r i b u t i o n o f t h e la s t a n d s h o r t e ri n c r e m e n t d o e s s i g n i f i c a n t l y a f f e c t t h e f e e d r a t e a l o n g t h el ine .T h e c u r r e n t m e t h o d f o r m a c h i n i n g c u r v e s c r e at e s ac o n f l ic t in r e l a t i o n t o t h e n u m b e r o f l in e s e g m e n t s i n t ow h i c h a c u r v e s h o u l d b e d i v i d e d b y t h e C AD s y s t e m . O nt h e o n e h a n d , t h e n u m b e r o f s e g m e n t s s h o u l d b em a x i m i z e d , f o r t w o r e a s o n s :

    t o b e t t e r a p p r o x i m a t e t h e c u r v e a n d r e d u c e t h ec o n t o u r e r r o r ,t o m i n i m i z e t h e e f f e c t o f s e g m e n t a t i o n , w h i c h c a u s e sd i s c o n t i n u i t i e s i n t h e f i r s t d e r i v a t i v e s a l o n g t h e p a t h ;t h e s e d i s c o n t i n u i t i e s , i n t u r n , l e a d t o d e t e r i o r a t i o n o ft h e s m o o t h n e s s o f c u rv e s a n d s u r fa c e s, a n d t h i sn e c e s s i t a t e s a d d i t i o n a l t r e a t m e n t ( e . g . p o l i s h i n g ) .

    8 30010 4485194111/0832 07 1994 Bu t terw orth Hein em ann LtdComput e r A i ded Des i gn Vo l ume 26 Number 11 November 1994

  • 8/13/2019 RealTime Curve Interpolators

    2/7

    CAD CNCLine/ArcSegments

    igure 1 Currentmethod for machiningof curves

    On the o ther hand, segmenta tion of the curve into manyline segments causes the following problems: The average tool feedrate does not reach the desiredfeedrate V because of

    the accumulated effect of the reduction in thefeedrate in the last iteration of each line segment,the machining of short lines, during which thetool may never reach the desired feedrate Vbecause of the automatic acceleration anddecleration applied at the beginning and end ofeach segment by the control loops.

    It has been suggested by Vickers and Bradley5, on thebasis of experimental measurements, that owing tothe start/stop (acceleration/deceleration) effects, thefull cutting speed is achieved for only 10% of themachining time. The result is that the feedrate alongthe curve is not constant, which in turn causesdeter iorat ion of the surface finish (during milling) orpart dimension (during laser cutting). I n addit ion, themachining time is increased because the meanfeedrate is less than the desired rate.The CNC machine's memory is very small (and veryexpensive) in relation to the number of segmentsthat must be stored for a part with complex surfaces(recall that the loading of the part program is anoffline procedure).The communications load between the CAD systemand the CNC machine, which may cause errors,should be reduced.

    In practice, because of memory and communicationsconstraints, the approach of minimizing the number ofsegments has been adopted by industry. The minimumnumber of segments is dictated by the permittedtolerance, and it depends on the curvature and length ofthe curve. However, the resulting discontinuities alongthe curve require additional treatment. Note that, evenwith the minimization approach, a huge number ofsegments is still needed in order to mainta in a reasonabletolerance (e.g. 10 m). Thus the current method is notadequate for the machining of curves and surfaces.Consequently, a new method needs to be developedwhich will allow a high and constant feedrate along the

    R e a l t i m e c u r v e i n t e r p o l a to r s M S h p i t a l n i e t a lcurve. This concept is shown in Figur e 2 . The proposedapproach is based on a new interpolator which caninterpolate general curves in realtime, enabling the CADsystem to transfer only information about the curve tothe CNC machine; the CNC machine then interpolatesit using the realtime curve interpolator.Several researchers have developed realtime inter-polators for curve generation. Koren 2 proposed aninterpolator for standard parabolic curves; Sata e t a l . 6developed a realtime interpolator for cubic Brzier curveswhich can, in fact, interpolate any cubic function. Thisinterpolator can, of course, interpolate general paraboliccurves by using only a 2nd-order Brzicr curve. Makino 7'sdeveloped special interpolators for high-speed machines.Stadelmann9 proposed a high-order interpolator forcomplex spatial geometry that requires a given velocityprofile. In this interpolator, the transition between twosuccessive segments is continuous. However, this inter-polator does not guarantee that all interpolated pointslie on the curve. A significant cont ribution has been madeby Chou and Yang z'l 1, who proposed an accurate offlineinterpolator for curves represented in their parametricforms. On the basis of their proposition, a realtimeversion of the interpolator was proposed by Huang andYang 12'13, who solved the parametric interpolat ion (intheir Equa tion 20) in the form of u = g(t) by using theEuler method. The result they obtained is similar toEquation 23 in this paper.In the following sections, two new approaches forrealtime reference-word interpolators are proposed.These interpolators are capable of dealing with generalcurves. We assume that the given curve is the curve alongwhich the centre of the tool must be driven. The proposedschemes are differentiated by the method used torepresent the curve. The first scheme deals with theimplicitly defined curve f(x, y) = 0, and the second schemedeals with the parametric curves r(u)= x(u)i + y(u)j. (Theextension to 3D is also discussed.)The task of the rcaltime interpolator for a general curvecan now be specified. Given (a) a curve r(u) or f(x, y)= 0,(b) the desired feedratc V mm/s along the curve, (c) thesampling time interval T s, and (d) the current referencepoint on the curve Rk Xk, Yk), find the next reference pointto which the tool should be driven in T s (one samplinginterval) while maintaining a constant feedrate V. Thisimplies that (a) the next reference point Rk+ t(Xk+ t, Yk+ 1must lie on the desired curve and must obey[ IRk +l - -Rk l l = VT , and (b) the motion from R k to R k + l

    CAD CNC

    igure 2 Suggestedmethod for machining of curves

    Computer Aided Design Volume 26 Number 11 November 1994 833

  • 8/13/2019 RealTime Curve Interpolators

    3/7

    Real t ime cu rve in terpo la tors : M Shpi ta ln i e t a li s o f a po in t to po in t type and can therefo re be execu tedby the ex i s t ing l inear in te rpo la to rs ava i lab le on CNCmach ines .The case o f impl ic it re p resen ta t ion i s ana lysed f irst ;then , the case o f param et r ic rep resen ta t ion i s p resen teda n d c o m p a re d w i t h t h a t o f t h e c o n v e n t i o n a l i n te rp o l a to r .

    I N T E R P O L T O R F O R IM P L I C IT C U R V ER E P R E S E N T T I O NA 2 D c u rv e a l o n g wh i c h t h e t o o l c e n t r e m u s t b e d r i v e nis f requen t ly g iven impl ic i t ly b y

    f x , y ) = 0 I )Let us examine the poss ib le d i rec t approaches toimplemen t ing a rea l t ime in te rpo la to r fo r genera l cu rvesas d i scussed in the above sec t ion .

    Direct approachesAs s u m e t h a t t h e c u r r e n t r e f e r e nc e p o i n t Rk Xk, Yk) lies onthe cu rve i t se l f . The nex t re fe rence po in t R k + ~ must l ieon the cu rve as wel l , and thus

    t'{xk + 1, Yk+ l) = 0 (2)a n d t h e d i s ta n c e b e t w e e n t h e c u r r e n t r e f e r en c e p o i n t a n dthe nex t one i s spec i f ied , and thus

    (Xk + X - Xk)2 + (Yk+ 1 Y k ) 2 = V T ) 2 (3)C o n s e q u e n t l y , i n o rd e r t o o b t a i n t h e n e x t r e f e re n c e p o i n tRk + l Xk + ~ , Yk + O, tWO s imu l taneous eq uat ions , E quat io ns2 and 3 , mus t be so lved . The so lu t ion o f these twoequat ions , in genera l , mus t be i t e ra t ive . However ,i t e ra t i ve m e t h o d s m a y n e e d a l a rg e a m o u n t o f c o m -p u t a t i o n a l t im e , a n d t h e y a r e t h e re fo re a p p ro p r i a t e o n l yfo r o f f l ine CAD sys tems , bu t no t fo r rea l t ime C N C sys tems .An a l t e rn a t i v e a p p ro a c h m i g h t b e o n e t h a t i s b a s e don ca lcu la t ing the in te rsec t ion po in t be tween the cu rveand a c i rc le o f rad ius V T whose cen t re i s a t R k . I fthe c i rc le i s rep resen ted paramet r ica l ly , the fo l lowinge q u a t i o n s m u s t b e s o l ve d :

    f(Xk+ 1, Yk+ 0 = 0 (4)Xk i = Xk VT c o s k 5)Y k + 1 = Y k + V T sin O (6)

    E q u a t i o n s 5 a n d 6 c a n b e s u b s t i t u t e d i n t o E q u a t i o n 4 ,resu l t ing in a t r igonomet r ic equa t ion in Ok, F(0k)=0 .W h e n Ok i s ob ta ined , i t can be subs t i tu ted in to Equa t ions5 and 6 to ob ta in xk + 1 and Yk + r The so lu t ion o f F(0 ) = 0depends on the specific funct ion F(0), which is , in general ,compl ica ted , and mus t be so lved i t e ra t ive ly . Al thoughi t wil l u sua l ly be eas ie r to so lve th i s equa t ion ra ther thanEquat ions 2 and 3 , the so lu t ion wi l l s t i l l no t be su i tab lefo r rea l t ime in te rpo la t ion .Fo r the genera l imp l ic it rep resen ta t ion f (x , y ) =0 ,a p p ro x i m a t i o n m e t h o d s t h a t f i t r e a l t i m e i n t e rp o l a t i o nm a y b e p ro p o s e d . On e s u c h a p p ro a c h h a s b e e n s u gg e s t edb y L o 14. T h e p ro p o s e d a p p ro a c h a b a n d o n s t h e r e q u i re -

    men t tha t the nex t re fe rence po in t m us t l ie on the cu rve .Instead, i t requires that Rk+l should be in thene ig hbo urho od o f f (x , y ), and tha t the dev ia t ion wi ll beb o u n d e d a n d p re d ic t a b le .

    Proposed interpolation methodLo ' s in te rpo la t ion method fo r impl ic i t func t ions i s basedon approx imat ing the non l inear cu rve to a c i rc le whoserad ius i s equa l to the rad ius o f cu rva tu re P k of the cu rvea t the sampled po in t R k . T h e m e t h o d g e n e ra t es t h e n e x tre ference po in t R k + 1 on the bas i s o f the cu rren t re fe rencep o i n t R k and the geomet r ic in fo rmat ion , as shown inF i g u r e 3 . The mot ion d i sp lacemen t i s sp l i t in to twoc o m p o n e n t s : V T in the t angen t d i rec t ion , and A B . T h em a g n i t u d e V T i s g iven , and the magn i tude o f A B isde te rmined be low, where po in t A i s a po in t a long thetangen t l ine whose d i s tance f rom R k is V T , a n d p o i n t Bis the in te rsec t ion be tween the l ine connec t ing A and C k( the cen t re o f cu rva tu re) a nd the c i rc le whose ce n t re i sat Ck.The geomet r ic re la t ion shown in F i g u r e 3 resul ts inthe fo l lowing equat ions :

    V Ts in c q - - - (7 )p k + A BPkc o s ~ k - - - 8 )p k + A B

    Combin ing Equat ions 7 and 8 y ie lds the fo l lowingequat ion :2 p k A B + A B 2 = V T ) 2 (9)

    S ince the incremen ts V T are small , ~ is also small . This~ l i e s t h a t A B < < p k ( t yp i c al v a lu e s a r e p k = 2 0 m m a n dAB = 0 .0 0 5 m m ) . T h u s , E q u a t i o n 9 c a n b e r e wr i t t e n a s(VT) 2A B - 1 0 )2pk

    In t h e p ro p o s e d i n t e rp o l a t i o n m e t h o d , t h e m a g n i t u d e V Ti s the incremen ta l componen t in the t angen t d i rec t ion tk .T h e m a g n i t u d e A B i s u sed as the incremen ta l componen tin the no rmal d i rec t ion nk . Consequen t ly , we have the

    Circle ]/ i A p p r x i m a t i 7i . . ,/ ~ '- / De siredI / _ "... / I Contour\ / i

    J i ~ R k + l

    Figure 3 Geom etric relation between current and next referencepositions

    834 Computer -A idedDes ign Vo lume 26 Nu m ber 11 N ovem ber 1994

  • 8/13/2019 RealTime Curve Interpolators

    4/7

    fo l lowing equat ion :

    R k t = L Y k l J L Y k J Ltr k --2~ -~kLny--=kw h e re R k a n d R k z are tw o success ive re fe rence pos i t ionsa long the cu rve , tk and nk a re the un i t t angen t and un i tn o rm a l v e c t o r s , a n d Pk i s the rad ius o f the cu rva tuve a tp o i n t Rk. Th e values of tk , nk and Pk c a n b e c a l c u l a t e d a teach s tep us ing the fo l lowing equat ions :

    1

    [ : 2d x

    _[ - ] [ - , ]k = = (13)l y k t x k( 1 + ( d y '~ 2 ~' 5 \ ~ - - / J(14)Pk - dZy

    dx 2

    (12)

    iscussionA c c u ra t e r e a l ti m e i n t e rp o l a t io n o f c u rv es r e p re s e n t e dimpl ic i tly as f(x , y ) = 0 canno t b e guara n teed because , asm e n t i o n e d a b o v e , t h e s o l u t i o n m a y n e e d t o b e i t e ra t iv e .H o w e v e r , i m p li c it s m o o t h fu n c t io n s c a n b e i n t e rp o l a t e din rea l t ime, on the bas i s o f Equ at ion s 11 -14 , whe n thec u rv e s a r e a p p ro x i m a t e d . I n t h i s c a s e , t h e m a x i m u mcon tou r e r ro r a long the cu rv e i s 14 g iven by

    Em.x < ~ ( ~ ji ~ p . ) (15,which i s typ ica l ly o f the o rd er o f 1 /~m. No te , how ever ,tha t the con tour e r ro r i s zero a long s t ra igh t l ines(Pmin = Pmax ~ 00) a n d circles (Pmin ----Pmax)Th e fo l lo w i n g s h o u l d b e n o t e d w h e n i m p l e m e n t i n g t h ep ro p o s e d s c h e m e : The der iva t ive d y / d x c a n b e e v a l u a t e d b y e i t h e rcod ing i t s ana ly t i ca l express ion in the source code ,o r us ing numer ica l p rocedures . Us ing the ana ly t i ca lexpress ion i s advan tageous , and i t shou ld be usedfo r common func t ions such as con ic sec t ions . Th e v a l u e o f d y / d x t ends to in f in ity when the t angen tis vertical.These cases ( in wh ich Xk 1 - -* Xk shou ld be iden t if i ed , andthe un i t t angen t vec to r shou ld be se t to tk = [0 , 1 ] r . Also ,ex tens ion o f the in te rpo la t ion schemes o f impl ic i trep resen ta t ion to 3D i s comp l ica ted , s ince, in the 3D case ,a cu rve i s def ined as the in te rsec t ion be tween two 3Dsurfaces f(x , y , z) = 0 and g(x, y , z) = 0 . Th is is co mp licat edto so lve in the genera l case . To overcome the need fo r

    Real t ime curve in te rpo la to rs : M ShPi ta ln i eta/a p p ro x i m a t i n g t h e c u rv e , t o a l l o w e a s y e x t e n si o n t o 3 D ,and to avo id the d i f f i cu l t i es as soc ia ted wi th ca lcu la t ingd y / d x , p a ra m e t r i c e q u a t i o n s c a n b e u s e d .

    ExampleA p a ra b o l i c c o n t o u r w a s s i m u l a t e d w i t h a f e e d ra t e o f1 / = 2 0 m m / s (47 .2 i n / m i n ) a n d a s a m p l i n g p e r i o d o fT= 0 .0 1 s. Th e p a ra b o l i c e q u a t i o n i s y = 0 . 0 5 x 2 , w h e re xand y a re g iven in mi ll imet res, and the too l m oves f rom(- 20 , 20 ) to (20, 20 ).Th e s i m u l a t i o n w a s p e r fo rm e d u s in g t w o m e t h o d s : t h em e t h o d u s i n g t h e i n t e rp o l a t o r p ro p o s e d a b o v e , a n d t h ec o n v e n t i o n a l m e t h o d i n w h i c h t h e c o n t o u r i s d i v i d e d in t om a n y s m a l l se g m e n ts , t h e n u m b e r o f w h i c h d e p e n d s o nthe des i red to le rance . The s imula t ion resu l t s fo r thep ro p o s e d i n t e rp o l a t o r a r e s h o w n i n Figur e 4 . Th em a x i m u m c o n t o u r e r ro r is g i v e n i n Table 1 .W i t h t h e p ro p o s e d i n t e rp o l a to r , o n l y t h e s ta r t p o i n tand endp o in t o f the parab o la a nd i t s param eters (e .g .0 .05 ) a re t rans fer red f rom the CAD sys tem to the C N Cm a c h i n e. W i t h t h e c o n v e n t i o n a l m e t h o d , a h u g e n u m b e ro f shor t l ine segme n ts i s needed . In ad d i t ion to the l a rgec o m m u n i c a t i o n s a n d s t o r a g e l o a d s , t h e l a rg e n u m b e r o fl ines has ano ther d rawback . The feed ra te a long the cu rvei s no t cons tan t . When 60 l ine segmen ts a re used , fo rexample , the average l eng th o f each segmen t i s 0 .8 mm.Since , a t each sampl ing per iod , the too l t raversesV T = 0 .2 mm, each o f the 60 segmen ts i s com ple ted onaverage du r ing on ly fou r sampl ing per iods . In p rac t i ce ,th i s means tha t the too l never reaches the requ i redfeedra te . In con t ras t , as seen in Figur e 4 , t h e m a x i m u mfeedra te e r ro r wi th the p roposed in te rpo la to r i s on ly0 .005%; in p rac t i ce , there a re no feed ra te dev ia t ions .

    32 .5- ~

    ~ e~ , 1.5

    ~ 20 10 0 10 20~ 1 X - p o s mo n r a m)o u6 ~ o . 5

    -20 -15 -10 -5 0 5 10 15 20X-position (nun)Figure 4 Simulation of proposed interpola tor for parabola[ : contour error, - -- : feedrate error.]

    Table 1 Maximum contour errors for exampleInterpolation method Maximum contour error, #mProposed 0.8Conventional, 30 segments 22.0Conventional, 60 segments 5.5Conve ntional, 160 segmen ts 0.8

    Co m p u te r -A id e d De s ig n Vo lu me 2 6 Nu m b e r 1 1 No ve m b e r 1 9 9 4 8 5

  • 8/13/2019 RealTime Curve Interpolators

    5/7

    Rea l t i me cu rve i n t e rpo l a t o rs : M Shp i t a l n i e t a lI N T E R P O L T O R F O R P R M E T R I CC U R V E R E P R E S E N T A T I O NA n a l t e r n a t i v e w a y o f d e s c r ib i n g c u r v e s w h i c h t r e a t s t h ex a n d y a x e s s y m m e t r i c a l l y i s t h e p a r a m e t r i c f o r m

    x=x u)y=y u) 16)

    whe re u i s an a rb i t r a r y para m eter , an d usua l l y 0 ~< u ~< 1 .M os t CAD/CAMs y s t e m s u s e p a r a m e t r i c f o r m s t o r e p r e s e n tc u r v e s . T h e p a r a m e t r i c f o r m i s v e r y c o n v e n i e n t f o rc o n t r o l l i n g m u l t i a x i s m a c h i n e t o o l s , w h e r e e a c h a x i s i si n d i v id u a l l y d r iv e n . F u r t h e r m o r e , t h e p a r a m e t r i c f o r me n a b l e s x a n d y t o b e d i r e c t l y c a l c u l a t e d a s f u n c t i o n s o fu , a n d t h e e x t e n s i o n f r o m 2 D t o 3 D i s s t r a i g h t f o r w a r d .T h e s t r a i g h t f o r w a r d a p p r o a c h f o r r e a l t im e i n t e r p o l a t o r sm i g h t b e t h e o n e u s e d i n C AD s y s t e m s . I n c r e m e n t t h ep a r a m e t e r u u n i f o r m l y , i. e. in e q u a l s m a l l i n c r e m e n t s A u ,a n d c a l c u l a t e t h e c o r r e s p o n d i n g X k + I = X ( U k + O a n dY k + I = Y ( U k + 1 ) a t e a c h s a m p l i n g p e r i o d T .T h i s a p p r o a c h , h o w e v e r , h a s t w o m a i n d r a w b a c k s : The l eng th o f t he s t eps ASk, w h e r e A s k = x k + 1 Xk) q-

    Y k + l - - y k ) 2 ) 1/2 i s n o t e q u a l , b u t t h e t o o l t r a n s f e r st h e m i n e q u a l t i m e i n t e r v a l s T . C o n s e q u e n t l y , t h ef e e d r a t e a l o n g t h e c u r v e i s n o t c o n s t a n t . T h i s r e s u l t si n s u r f a c e f i n i s h v a r i a t i o n s a n d a n u n n e c e s s a r i l yl o n g e r m a c h i n i n g t i m e . T h e o p t i m a l s iz e o f t h e i n c r e m e n t A u i s n o t k n o w n .I f A u i s t o o s m a l l , th e r e s u l t a n t AS k S a r e t o o s m a l l a sw e l l, a n d t h e s y s t e m s l o w s d o w n . I f A u i s t o o b i g,t h e r e s u l t a n t ASkS a r e t o o b i g , a n d t h e p o s i t i o na c c u r a c y i s n o t m a i n t a i n e d .A s a c o n s e q u e n c e , a re a l t i m e i n t e r p o l a t o r c a n n o t b e b a s e do n a u n i f o r m s e g m e n t a t i o n o f th e c u r v e a c c o r d i n g t o u .T h e k e y i d e a f o r r e a l ti m e i n t e r p o l a t o r s o f c u r v e sr e p r e s e n t e d i n p a r a m e t r i c f o r m i s t h a t t h e s e g m e n t a t i o ns h o u l d b e b a s e d o n c u r v e s e g m e n t s o f e q u a l l e n g t h r a t h e rt h a n e q u a l A u s. A c c o r d i n g ly , t h e p r o p o s e d m e t h o dd e t e r m i n e s s u c c e s s iv e v a l u e s o f u s u c h t h a t t h e c u r v es e g m e n t s A s k ( m a c h i n e d a t e a c h s a m p l i n g p e r i o d T ) a r ec o n s t a n t s , w h i c h , i n t u r n , g u a r a n t e e s a c o n s t a n t f e e d r a t e(i .e. velocity).T h e f e e d r a t e V ( u ) a l o n g t h e c u r v e i s d e f i n e d b y

    (17)

    o rd u Vd t d s / d u (18)

    w h e r eas- - = ( ( x ) 2 + ( y ) 2 ) 1/2 (19)d u

    dxx p _ d uy , = d y

    d u

    S u b s t i t u t i n g E q u a t i o n 1 9 i n t o E q u a t i o n 1 8 y i e ld sd u Vd t - ( x 2 -~ - y,2)1/2 120)

    A s o l u t i o n o f E q u a t i o n 2 0 t h a t i s f o u n d i n a s h o r tc o m p u t a t i o n t i m e i s t h e h e a r t o f a r e a l t im e i n t e r p o l a t o rf o r c u r v e s g i v e n i n p a r a m e t r i c f o r m s . T h e s o l u t i o n o fE q u a t i o n 2 0 f o r a c o n s t a n t V g i v es th e r e q u i r e d u(t ).H o w e v e r , b e c a u s e t h e s o l u t i o n o f E q u a t i o n 2 0 is d if f ic u l ti n t h e g e n e r a l c a se , w e m a y u s e a r e c u r s i v e s o l u t i o n b a s e do n T a y l o r 's e x p a n s i o n a r o u n d t = k T :

    Uk+l=/gk ] T f i k + ( T 2 / 2 ) i i k + h i g h e r ord er t e rm s (21 )w h e r e f i d e n o t e s d u / d t a n d / i d e n o t e s d 2 u / d t 2 .I f T i s v e r y s m a l l a n d t h e c u r v e d o e s n o t h a v e s m a l lr a d i i o f c u r v a t u r e , e v e n a 1 s t - o rd e r a p p r o x i m a t i o n isa d e q u a t e :

    Uk + 1 = Uk + Tf ik (22)S u b s t i t u t i n g E q u a t i o n 2 0 i n t o E q u a t i o n 2 2 y i e l d s t h ee q u a t i o n o f th e p r o p o s e d i n t e rp o l a t o r:

    V TUk+ 1 =Uk-~ (X~, +~,)---2-t/2 (23)

    T h i s e q u a t i o n p r e s c r i b e s h o w t h e v a l u e o f Uk+ X c a n b ec a l c u l a t e d o n t h e b a s i s o f t h e c u r r e n t v a l u e o f Uk a n d t h ed e r i v a t iv e s o f t h e c u r r e n t p o s i t i o n (Xk , Yk) w i t h r e s p e c t t ot h e u s. ( N o t e t h a t x ( u ) a n d y ( u ) are g iven exp l i c i t ly . ) On cet h e n e w v a l u e o f u , U k + l , h a s b e e n o b t a i n e d , i t i ss u b s t i t u t e d i n t o E q u a t i o n 1 6 t o o b t a i n t h e r e f e r e n c e p o i n tXk + 1, Yk + x. T h i s e q u a t i o n h a s b e e n o b t a i n e d i n d e p e n d e n t l yb y H u a n g 13 a n d L o 14.

    DiscussionI n t h i s c a s e , t h e c a l c u l a t e d r e f e r e n c e p o i n t s l i e o n t h ecurve. Th e e xpre ssio n of the der iv at ive s x~, an d y~, ( i.e .( d x / d u ) k a n d ( d y / d U ) k ) s h o u l d a l s o p r e f e r a b l y b e e x p r e s s e da n a l y t i c a l l y i n t h e c o d e . In t h e p a r a m e t r i c i n t e r p o l a t o r ,t he se ns i t i ve case i s when bo th x~, an d y~, a r e zero a t t hes a m e t im e . H o w e v e r , t h i s c a n o n l y h a p p e n i f t h e c u r v eh a s a c u s p a n d i s t h u s n o t s m o o t h , o r w h e n t h ep a r a m e t e r i z a t i o n i s i m p r o p e r 1 5. ( I n s u c h a r a r e c a s e ,r e p a r a m e t e r i z a t i o n w i ll s o l v e t h e p r o b l e m . ) T h i s d o e s n o th a p p e n , f o r i n s t a n c e , w h e n x ( u ) a n d y ( u) a r e p o l y n o m i a l si n u . F o r c a s e s i n w h i c h t h e c u r v a t u r e s a r e e x t r e m e l ys m a l l , E q u a t i o n 2 1 , r a t h e r t h a n E q u a t i o n 2 2 , s h o u l d b eu s e d . W h e n E q u a t i o n 2 2 i s u s e d , t h e c o m p u t a t i o n l o a dr e q u i r e d t o c a l c u l a t e U k+ 1 a c c o r d i n g t o E q u a t i o n 2 3c o n s i s ts o f t w o m u l t i p l ic a t i o n s , t w o a d d i t i o n s , o n ed i v i s i o n a n d o n e s q u a r e r o o t . O n c e t h e n e w Uk+ 1 isc a l c u l a t e d , i t s h o u l d b e s u b s t i t u t e d i n t h e p a r a m e t r i ce q u a t i o n o f th e c u r v e ( E q u a t i o n 1 6 ) , S i n c e t h e r e i s n ol i m i t a t i o n o n E q u a t i o n 1 6, t h e c a l c u l a t i o n o f t h e n e wr e f e r e n c e p o i n t s i s t h e n d e p e n d e n t o n t h e s p e c i f i c c u r v ee q u a t i o n . A n i m p o r t a n t a d v a n t a g e o f t h e p a r a m e t r i cr e p r e s e n t a t i o n i s t h e s t r a i g h t f o r w a r d e x t e n s i o n t o 3 D .

    8 6 Comput e r A i ded Des i gn Vo l ume 26 Number 11 November 1994

  • 8/13/2019 RealTime Curve Interpolators

    6/7

    Y [ m m ]25 .Off22.7020.40-18.10-15.80-13.50-11.20-

    8.90-6.60-4.30-2.005 . 0 0 8 . 0 0

    Figur e 5

    T o e v a l u a t e t h e p ro p o s e d i n t e rp o l a t o r , a 2 D c u b i cp o l y n o m i a l c u rv e wa s s i m u l a t e d a n d c o m p a re d w i t h t h ec o n v e n t i o n a l m e t h o d , wh i c h a p p ro x i m a t e s t h is c u rv e b yl ine segme n ts fo r wh ich Au = cons tan t . The eva lua t ion i sg iven be low.T h e 2 D c u b i c c u rv e V = 1 .2 m m / m i n , T = 0 .0 1 s ) i sg iven by

    x = 11.9u 3 29.8 u 2 + 32.9u + 5.0y = 47.6u 3 -- 41.7u 2 + 16.55U + 2.5 O ~ u ~ l

    T h e c o n t o u r s h a p e o f th i s 2 D c u rv e is s h o wn i n Figure5 . The var ia t ion o f u as a func t ion o f t, wh ich i s theso lu t ion o f Equat io n 23 , i s show n in Fi ure 6. This resu l ti s the bas i s o f the p rop ose d rea l t ime in te rpo la to r . The

    11:2D cub ic po lynomia l cu r ve

    [mm]14'.00 17100 201 110

    xample

    u t )1.1300 . 9 00 .800 .700.60'0 .500 .400 .300 .200 . I 0 t [ S e c ]0.0~.~ 0.'32 0.'64 0:96 1.'28 1.'60

    F igur e 6 Var i a t i on o f pa r amete r u wi th time

    R e a l t i m e c u r v e i n t e r p o l a t o r s : M S h p i t a l n i eta/

    Pos i t ionE r ro r g m9 .o ~ / - ~ C A D8.10~ / ~I nte rpo lat ion7.26.35.44.53 . 62

    \0.90- \ / . . . / / - - '- , I n t e r p o l a t io n0 . 00 . . . . . . - . . . . 7 . . . . . .. .~ . . . . - ,'m --------. .

    0.00 0.20 0.40 0.60 0.80 1.00F igur e 7 Co n tour e r r o r s caused by p r oposed in t e r po la to r and CADin te r po la to r

    Tabl e 2 I n t e r po la t i on o f 2D cub ic cu r veI n t e r po la to r Rea l t ime CAD, 0 segmen t s CAD,10 segmen t s

    .. .. /~m 1.20 8.80 77.00Av erag e V, m m /s 19.98 18.14 19.50

    p ro p o s e d i n t e rp o l a t o r r e s u l t s in v e ry s m a ll c o n t o u r e r ro r scom pare d wi th those o f conve n t iona l CAD in te rpo la to rs ,as shown in Figure 7 a n d Table 2. T h e s e g m e n t a t i o n i nthe conve n t iona l CAD in te rpo la to r , based on sm al l equa lAu e .g . Au =0 .0 33 fo r 30 segmen ts ) , resu l t s in co rre -spond ing ly shor t A s segmen ts e .g . on ave rage o f 1 mm).The shor t segmen ts cause feed ra te e r ro rs . As expec ted ,increas ing the num ber o f segmen ts resu l ts in smal le rcon tour e r ro rs , bu t i t increases the average dev ia t ion f romt h e p ro g ra m m e d V V= 2 0 m m / s i n th i s e x a m p le ) .

    C O N C L U S I O N ST h e a m o u n t o f g e o m e t r i c in fo rm a t i o n t r a n s fe r r e d f ro mthe CAD sys tem to the C N C mach ine m us t be min imized ,bu t i t mus t s ti ll enab le a ny genera l cu rve to be mach ined .These conf l i c t ing requ i remen ts can be sa t i s f ied on ly bythe deve lopm en t o f rea l t ime in te rpo la to rs fo r genera lcu rves . Curves may be p resen ted as e i ther impl ic i tf u n c t i o n s o r p a ra m e t r i c fo rm s . Ac c o rd i n g l y , t wo n e wt y p e s o f C N C i n t e rp o l a t o r w h i c h c a n h a n d l e g e n e ralc u rv e s h a v e b e e n i n tro d u c e d . T h e o n l y a s s u m p t i o n m a d eis tha t the f i r s t der iva t ives ex i s t , as i s the case fo r s mo o thcurves . The perfo rm ances o f these in te rpo la to rs h ave beenevalua ted in t e rms o f p rec i s ion and fee d ra te dev ia t ions .

    A C K N O W L E D G E M E N T ST h i s r e se a rc h wa s p a r t ia l l y s p o n s o re d b y t h e US Na t i o n a lS c i en c e F o u n d a t i o n g ra n t D DM -9 1 1 4 1 3 1 , a n d b y th e

    C o m p u t e r - A i d e d D e s i g n V o l u m e 2 6 N u m b e r 1 1 N o v e m b e r 1 9 94 8 7

  • 8/13/2019 RealTime Curve Interpolators

    7/7

    R e a l t i m e c u r v e i n t e r p o l a t o r s : M S h p i t a l n i e t a lJapan TS Research Fund through the Technion HaifaIsrael Vice President for Research grant 033-0861. Thepaper was written while Y Koren was a Lady DavisVisiting Professor at the Technion Haifa Israel. Theauthors acknowledge the support of the Lady DavisFoundation.

    R E F E R E N E S1 K o re n , Y Computer Control of Manufacturing Systems M c G r a w -Hi l l , USA (1983)2 K o r e n , Y I n t e r p o l a t o r f o r a c o m p u t e r n u m e r i c a l c o n t r o l s y s te mIEEE Trans. Comput. V o l C -2 5 N o 1 (1 97 6 ) p p 3 2 -3 73 K o re n , Y a n d M a so ry , O R e fe re n c e -w o rd c i rc u l a r i n t e rp o l a t o r sf o r C N C s y s t e m s Trans. ASME J. Eng. Indust. Vol 104 (No v1 9 82 ) p p 4 0 0 -4 0 54 Pa p a i o a n n o u , S G In t e rp o l a t i o n a l g o r i t h ms fo r n u me r i c a lc o n t r o l Comput. lndust. Vol 1 (1979) pp 27-405 V i c k e rs, G W a n d B ra d le y , C C u rv e d su rfa c e ma c h i n i n g t h ro u g hc i rc u l a r a rc i n t e rp o l a t i o n Comput. lndust. Vol 19 (1992)pp 329 3376 Sa t a , T , K i m u ra , F , O k a d a , N a n d H o sa k a , M A n e w me t h o d

    o f N C i n t e rp o l a t i o n fo r ma c h i n i n g t h e sc u lp t u re d su r fa c e Ann.CIRP V o l 3 0 N o 1 (19 8 1) p p 3 6 9 -3 7 27 M a k i n g , H C l o t h o i d a l i n t e rp o l a t i o n - - a n e w t o o l fo r h i g h -sp e e dc o n t i n u o u s p a t h c o n t r o l Ann. CIRP Vol 37 N o 1 (1988)8 M a k i n g , H a n d O h d e , T M o t i o n c o n t ro l o f t h e d i re c t d r i v ea c t u a t o r Ann. CIRP V o l 4 0 N o 1 (1 99 1 ) p p 3 7 5 -3 7 89 S t a d e l m a n n , R C o m p u t a t i o n o f n o m i n a l p a t h va l u es t o g e n e r a tev a r i o u s sp e c i a l c u rv e s fo r ma c h i n e Ann. CIRP Vol 38 N o 1 (1989)p p 3 7 3 - 3 7 61 0 C h o u , J J a n d Y a n g , D C H C o mm a n d g e n e ra t i o n fo r t h re e -a x i sC N C m a c h i n i n g Trans. ASME J. Eng. lndust. Vol 113 (Aug1991) pp 305 31011 C h o u , J J a n d Y a n g , D C H O n t h e g e n e ra t i o n o f c o o rd i n a t e dm o t i o n o f f in e - ax i s C N C / C M M m a c h i n e s Trans. AS ME J. Eng.lndust. V o l 1 1 4 (Fe b 1 9 9 2 )p p 1 5 -2 21 2 H u a n g , J T a n d Y a n g , D C H A g e n e ra l i z e d i n t e rp o l a t o r fo rc o m m a n d g e n e r a t i o n o f p a r a m e t r i c c u r v es i n c o m p u t e r c o n t r o l le dm a c h i n e Jap./ USA AS ME Flexible Automation - - Vol 1 (1992)p p 3 9 3 - 3 9 91 3 H u a n g , J T D e s i g n a n d a p p li c a t io n o f a ne w C N C c o m m a n dg e n e r a t o r f o r C A D / C A M i n t e g r a t i o n PhD Thesis U n i v e rs i t y o fC a l i fo rn i a a t Lo s A n g e l e s, U SA (19 9 2)1 4 Lo , C C C ro ss -c o u p l i n g c o n t ro l o f mu l t i - a x i s ma n u fa c t u r i n gPhD Thesis U n i v e rs i t y o f M i c h i g a n , U S A (1 9 92 )1 5 Fa u x , I D a n d Pra t t , M J Computational Geometry for Designand Manufacture El l i s H o rw o o d , U K (1 9 7 9 )

    .....~ ~,~ Moshe Shpitalni received a BSc (1972),an MSc (197.5) and a PhD (1980)in mechanical enoineerin9 from theTechnion-Israel Institute of Technoloyy.In 1983. after two years at RensselaerPolytechnic Institute. USA, he joinedthe ['acuity of the Technion, where he isnow an associate profi, ssor and head o/the Laboratory.[or hueractive ComputerGraphics and CAD. His researchinterests are in the applications c~/~yeometrical modelling and reasoning tomanufacturinq systems, ~Tst, automatic process planning, and CNC.He is partieularly interested in the manuJhcture c~l sheet metalproducts and automatic assembly.

    ~ ~: x~ ~~ ~ i~ ~' ~ ~i

    Yoram Koren received a BSc andan MSc in electrical engineering and aDSc (1970) in mechanical engineerin9from the Technion-lsrael Institute ofTechnology. He is the Paul G GoebelProfessor of Mechanical Engineeringand Applied Mechanics at the Universityof Michigan, USA. He is the author ofmany publications on automated manu-facturin 9, and the inventor o f workcovered by three US patents in robotics.

    Chih-Ching Lo received a BS inpower mechanical engineering fromthe National Tsing-Hua University,Taiwan, in 1984. He received an MS anda PhD in mechanical engineering fromthe University of Michigan, USA, in1989 and 1992, respectively. He laterjoined the staff of the MechanicalEngineering Department, Feng-ChiaUniversity, Taiwan.

    838 Computer Aided Des ign Volum e 26 N u m b e r N o v e m b e r 9 94