Interpolator For A Computer Numerical Control Syst
Interpolator For A Computer Numerical Control Syst
net/publication/224483290
CITATIONS READS
60 10,007
1 author:
Yoram Koren
University of Michigan
276 PUBLICATIONS 26,307 CITATIONS
SEE PROFILE
All content following this page was uploaded by Yoram Koren on 28 December 2014.
Abstract-A software interpolator which is comprised of linear vanccd as a n•sult of t lw rapidly improving c·apabilities
and circular interpolations is compared with its hardware counterpart and falling pric<'H of small computers, which makP it sud-
and with other circular interpolation methods. The software inter-
polator and the feed-rate control are contained in the numerical
denly attractive to Ufoie standard eomputers as part of the
control (NC) program of a computer numerical control (CNC) system ~C systpms. Therd'on•. it is l><'eoming increasingly evi-
and enable a contouring control of the machine tool in any required dent t hat the cost of a CNC unit will be actually lmn•r
feed-rate. t han its equivalent conventional ~C countPrparts.
~Iany functions of the conv<•ntional NC eont roll<'r are
Index Terms-Adaptive control (AC), analog-to-digital processor
(ADP), computer numerical control (CNC), digital differential rPplaced in a CNC system by a eomput<•r program ut•noted
analyzer (DDA), numerical control (NC), point-to-point (PTP), time as the NC program. Naturally, t he data proeessing, fPed-
base generator (TBG ). rate calculations, and tht• intt•rpolating between two data
points arc p<•rformed by software, while the controller
contains only t he position and v<'locity control loops.
INTRODUCTION
A fped-rate control and an interpolator based on a simu-
THE computer numerical control (CNC) concept <'Ill-
ploys a digital com puter, usually a minicomputer, for
lation of digital differential analyzer (DDA ) int<•grators
arc discussed in this papt•r. Although the principles of a
on-line control of t he nunwrical control (~C) rna<·hinc hardware DDA integrator an• \n·ll knmm [1]- [:n, they
tool and eliminating, as far as possibh·, additional hard- arc ~mmmariz ed at the outset since \YC found it tlw simpk.'t
ware circuits in t he controller cabinet. The change from way to represent t he notations used in t his paper. The
the use of a controller unit to CNC may b<• n•garded as t he interpolator is capable of ii1war and circular interpolat ion
most important advance in the philosophy of the dPsign in accordance with inHtructions from the data tap<'. The
of NC systems that oc<"urred during the first years of tlw hardware circuit is comparcd with its soft,m re count<•r-
seventies. The development of CNC systems has ad- part. The latter is a part of a CKC systcm for a :~-axis
milling maehi1w whieh \\·as developed at ~l c.!\ J a:;tcr Uni-
V<'rsity, H amilton, Ont., Canada.
Manuscript received June 15, 1974; revised December 15 1974. The blo<"k diagram of t he system is shown in Fig. 1. It
The author is with the Engineering Experiment Station 'univer-
sity of Wisconsin-Madison, Madison, WI 53706. ' includes five major components: a milling machim•, a
KOREN: INTERPOLATOR FOR CNC SYSTEM 33
Interrupts w
MINI - COMPUTER c T
by
computer.bthi theNCab
ouslyonbth the Nn the Co
theAC program simultane-
progrn. Normal prescribes relatively
otion of athe requirement of the with
small distance high feed-rate
high a frequency wo.
the computer runs on the AC program, but whenever an Hee, the frequen an be decreased by increasing
interrupt occurs the computer starts to execute the NC the efficiency of the interpolator. In computer software,
this canonebeaseasily done by using a variable q rather than a
control returns to the AC program and continues to per- fixed in a hardware interpolator, thus increasing
form it from the point of interruption. the efficiene to 1.
Fig. 4 shows the flowcharts of the feed calculator, the Y
linear interpolator, and the circular interpolator. Simpler Te v f at bc
DDA's with Ay = 0 are used in the simulation of the feed g
calculator and the linear interpolator, wrhile full software For linear motion q = L.
DDA's are used for the circular interpolator. Notice that
q and qo represent in a hardware DDA the maximum con-
tent of the registers of the interpolator and the feed cal- L is given in (10) while R = (i2 + j2) 1/2. The initial values
culator, respectively. of i and j are known since they are used as the initial
A simple calculation in the previous section had proved conditions for the y registers of the interpolator. By using
that the frequency of the external clock in the hardware the variable q, (11), (13), and (19) reduce to
interpolator is in the range of megahertz. Howe(ver, since V= wloJ/o. (20)
the cycle time of a mninicomputer iS about 1 ,us (and an
execution time of one inlstruction is 2 ,us), it is impoSssible Since wo is a constant, the termn f/qo represents the ratio
to use such a high frequency for the interrupt pulses. This betw een the required feed-rate and the maximum allowv-
leads to another definition for q, and therefore the soft- able one. But as this ratio is equal to V/wo, the clock fre-
ware interpolator is slightly different from a direct simula- quency mu0 is the maximum allowable velocity measured
tion of a hardware one. in pulses per second. B3y this method, much lower clock
In order to obtain the required feed-rate V in linear frequencies are obtained. In the described .systemn, a maxi-
motion, the condition which was prescribed by (11) must mum feed-rate of 30 in/mmn and a BLU of 0.0001 in were
36 IEEE TRANSACTIONS ON COMPUTERS, JANUARY 1976
chosen. For these data, the frequency of the interrupt in [11] as an example to trapezoidal integration, and in
pulses is 5000 pps. Such a frequency allows time intervals [12]. The precalculation of A and B is relatively sinmple,
of 200 ,us for the execution of the NTC program. In fact, the and if T is sufficiently small this approximation provides
maximum execution time of the NC program is 170 ,us accurate results. It can be shown that the radius trunca-
(2 Ms/instruction) which always permits enough time for tion error resulting in this case decreases linearly with T4
the execution of the AC program. [9], [12].
Another advantage of a software interpolator which A similar method is the Tustin method [8] which yields
uses q = L or q = R (depending on the interpolation the same equations as (24) but with the following defini-
type) is in calculating the feed-rate number f. Instead of tions for A and B:
using the inverse time mnethod, the feed-rate number is
programmed directly in inches per minute and multiplied A = - (wT/2)2 B T 25)
by a constant depending on the required resolution. In the 1 + (wT/2 )2 1 + (coT '/2)2
described system, a resolution of 0.01 in/rnin- was chosen, The truncation error is of the same order of magnitude
and since the maximum feed-rate is 30 in/min the value as in the previous one, but since the constants A and B are
of qo is 3000 and f is calculated according to the formula more complicated, the round-off error can be slightly
f = lOOVo, (21) greater.
A more accurate result can be achieved by using the
where Vo is the required feed-rate in inches per minute. * Runge-K(utta mnethod.Aesoltion
Runge-Kutame A solution usingbthis
using this methodgfor
method for
COM'IPARISON WITH OTHER M\1ETHODS our case can be found in [8] and [9]. The truncation error
in this case decreases with T6. The Runge-Kutta method
The circular interpolator wshich was presented applies a requires an enormous number of calculations and there-
method of solving a second-order differential equation by fore cannot
fore
an eonirds
an on
be consid'ered as an
c ont method.
on-line control method.
converting it to a set of two difference equations. It might The approach presented in [4]-[6] using hardware
be interesting to compare the proposed algorithm with DDA's is equivalent, to using Euler's method. Euler's
other known methods from the literature. Two errors method as applied to the given problem is discussed in
might appear in any solution: the truncation error which [8]-[10]. The differential equations are given in (12);
can be determined analytically, and the round-off error the corresponding difference equations are as in (24) with
which has a nonlinear effect on the solution. When dealing the following definitions for A and B:
with difference equations, it is convenient to signify the
time interval (or step size) by T rather than dt. The radius A = 1 B = coT. (26)
of the circle is assumed to be one in the following discussion. The Euler method yields a truncation error which de-
An algorithm which is not affected by truncation error creases linearly with a decrease of T [9].
is the state-transition method [8]. In this method, the n dif- Now leanlyzeith
~~Now
easof
let us analyze the software ieo rpps
interpolator proposal
ference equations to be solved are in this paper. Considerinig
the flowchart in Fig. 4, one sees
Cos co((n + 1) T = cos coT cos conT - sin cT sin conT that for calculating the sine in the nth step the new value
of the cosine is used, which means
sin co(n + 1) T = cos coT sin conT + sin coT cos cnT.
cos w(n + 1) T = coswnT -coT sin cnT
(22)
Since the initial conditions are known, (22) generates the
sin co((n + 1) T = sin conT + coT cos co(n + 1)T
sequence of points which approximate a circle. Notice that = (1- co2T2) sin conT + coT cos cnT.
the values of cos cT and sin wT must be precalculated for (27)
each co by a Taylor's series expansion. The accuracy of the
solution depends upon the accuracy to which the series Thus, anotable improvement overthehardware method
expansion was computed. is achieved. The approximation of cos 0T is not 1 as for
Consider a case in which the following expansion is the hardwNvare interpolator but is 1 in the first equation and
taken: (1 -co2T2) in the second equation, with an average of
1 -w2T2 2 as in (23). Thus the radius truncation error
cos uT = 1 - (coT)2 2 = A decreased w-ith T4 rather than with T2 as for the hardware
sin co = XoT =B. (23) DA
To summarize the discussion up to this point, four types
Equation (22) becomes of mlethods. have been presented.
1) Euler method, wrhich is a first-order approximation
COS co(n + 1) T = A cos conT1- B sin on>T mnethod and is used in hardw-are DDA's.
sin co(n -+ 1) T = A sin conT + B cos conT. (24) 2) Second-order approximation methods, wthich include
t.he Tustin met.hod, the Adams or Heun method, and the
Equation (24) was analyzed in [9] as an example of proposed softwsare interpolator mzethod. All produce trun-
Heun's method, in [10] as an example of Adam's method, cation errors of the same order of magnitude.
KOREN: INTERPOLATOR FOR CNC SYSTEM 37
TABLE I using the other methods constants such as (23) or (25)
NUMERICAL RESULTS OF FOUR METHODS AT HALF PERIOD OF
A CIRCLE must be accurately computed.
The main disadvantage of the method is the limitation
T Runge- State- of the maximum feed-rate. In the described system, the
(seconds) Euler Tustin Kutta Transition maximum feed-rate is 30 in/min, which is enough for
1 _ 9460 9795 10000 metal-cutting applications. However, if a higher feed-rate
0.1 - 9996 10000 10000 is required, a method wvhich permits a larger step size
0.01 10160 10000 10000 10000
0.001 10020 10000 10000 10000 [like the one prescribed by (24)1 must be chosen.
0.0001 10000 9997 9998 9996
0.00001 9982 9963 9982 9945 REFERENCES
[1] F. V. Mayorov, Electronic Digital Integrating Computers-
Digital Differential Analyzers. London, England: Iliffe Books,
3) Runge--Kutta method. 1964.
[2] T. R. Sizer, The Digital Differential Analyzer. London, Eng-
4)4) State-transltlon
State-transition method.
metnoa.land: Chapman and Hall, 1968.
The four methods were numerically compared in [8]. [3] G. A. Korn and T. Korn, Electronic Analog and Hybrid Corn-
The actual ctua raii
The radii otaied a th
obtained at hal perod
the half period off a irce
a circle
[4 puters. New York:
G.G. Ertell, Control. 1964,
McGraw-Hill,
Numerical 11. Wiley-Inter-
Newch.York:
wvith radius R = 10 000 and w = 1 rad/s are given in science, 1969.
Table I. [5] Y. Koren, A. Shani, and J. Ben Uri, "Numerical control of a
lathe," IEEE Trans. Ind. Gen. Appl., vol. IGA-6, pp. 175-
For large values of T, the truncation error is large in the 179, Mar. 1970.
Euler, Tustin, and Runge-Kutta methods; methods* truncation*
truncatin
system," 5th
Ben Uri, "Digital control of multiaxial-motion
[6] Y. Koren inand J. Int. Fed. Automat. Contr. World Congr., Paper
error is 0 in the state transition method. On the other 375, Paris, June 12-17, 1972.
hand, when is to
handTNvhn too the rond-of
small te
T s smll error becomes
round-off eror ecoies tethe and[7] turing
Interchangeable Perforated Tape Variable Block Format for Con-
and Contouring/Positioning NC Machine Tools, Elec-
significant factor in the accuracy of the solution. For T = tron. Industries Ass., May 1967.
th resutsidicae
0.000,results
0.0001, the indicate no rrorfor
no error he Euer
for the mthod Contl[5
E:uler method J. A. Cadzow and H. R. Martens, Discrete-Time and Computer
Control Systems. Englewood Cliffs, N. J.: Prentice-Hall, 1970,
vhile the other three methods are beginning to show the [ p. 376-394.
of round-off.
effects effects of round-off.] E. G. Gilbert "Dynamic error analysis of digital and combined
analog digitaf computer systems," Simulation, vol. 6, pp. 241-
In a DDA interpolator, the number of pulses required 10 257, Apr. 1966.
R. B. McGhee and R. N. Nilsen, "The extended resolution
to comiiplete a half-circle is irR, supplied during 7r/(.o seconds. digital differential analyzer: A new computing structure for
Thus, the step size is 1/.cR, or 0.0001 s for the above solving differential equations," IEEE Trans. Comput., vol.
numerical example. It is interesting that in this particular
example, when using the hardware interpolator, T is auto-
I19] D1anilsson,
p. E. "Incremental curve generation," IEEE Trans.
Comput., vol. C-19, pp. 783-793, Sept. 1970.
. C. Bergren, "A simple algorithm for circular interpolation."
h [12] Control
matlall
matically chsen
chosen too bbe at its atltsoptimal value sota
v
total error due to both round-off and truncation is min-
that the Eng., vol. 18, pp. 57-5'3, Sept. 1971.
imized. The software interpolator was checked for the
same data and a step size of 0.0001 s. The actual radius pro-
duced at half period of a circle was 10 001 BLU's, wvhich
means an error of 1 unit due to round-off. Yoram Koren received the B.Sc., M.Sc.
CONCLUSIONS and D.Sc. degrees, all in electrical engineering,
from the Technion-Israel Institute of Tech-
A software interpolator which uses the DDA technique nology, Haifa, Israel, in 1965, 1968 and
wvas presented and compared with its hardware counter- In respectively.
1971,
part on the one hand and with other softwvare methods on gineer by Elbit Control Inc., Haifa. During
the other hand. In NC applications, the higher order 1971 through 1973, he was a Lecturer at the
Technion and at the B.G. University of
methods will not improve the result since the round-off Beer-Sheva. He later joined the Metal-
error dominates truncation error at small step sizes and Working IResearch Group of McMaster
its influence increases with the complexity of the method. A University, Hamilton, Ont., Canada, where he conducted the devel-
afprtheralculanta
further advantageofofthecsonstwantseis
the software DDA interpolaore, is that
interpolatoris °Inpml97n4opment
1vh974,
In ofhethe computer
joined
numerical control milling machine project.
the Staff of the Engineering Experiment Station,
a precalculation of constants is not required, while when University of Wisconsin-Madison, Madison.