Equation 3.33 shows that it ispossible to calculate successive interpolated points by using the current interpolatedpoint,X i + 1 = AXi − BYi Y i + 1 = AYi + BXi 3.33Reference word inter
Trang 1X (i + 1) = R(i)cosθ(i + 1) Y (i + 1) = R(i)sinθ(i + 1) (3.32)From Eq 3.30 and Eq 3.32, Eq 3.33 is derived Equation 3.33 shows that it ispossible to calculate successive interpolated points by using the current interpolatedpoint,
X (i + 1) = AX(i) − BY(i) Y (i + 1) = AY(i) + BX(i) (3.33)Reference word interpolation algorithms that are introduced in this book depend
on the above equations and the differences between algorithms are the methods used
to determine angleαand how to approximate A and B from Eq 3.33.
If angleαis determined regardless of the type of algorithm, the following polation routine is executed every iteration The start position and the velocity areprovided by a part program
inter-Using Eq 3.33 and an initial interpolated point(X(i),Y (i)) the next interpolated
point(X(i + 1),Y (i + 1)) can be computed The length of the line segment is
com-puted using Eq 3.34 and Eq 3.35 gives the velocities
DX (i) = X(i + 1) − X(i) = (A − 1)X(i) − BY(i) (3.34)
DY (i) = Y(i + 1) −Y(i) = (A − 1)Y(i) + BX(i)
V x (i) = V DX DS (i)
(i)
where DS (i) =DX2(i) + DY2(i)
DX (i) and DY (i) are, respectively, the increments along the X- and Y- axes V x (i) and V y (i) are the velocities, called reference words, for the X- and Y-axes respec-
tively These values are transmitted to the acceleration/deceleration control routinevia a ring buffer Using these, the interpolation routine updates the current interpo-lated point(X(i),Y (i)).
3.3.2.3 Radial Error and Chord Height Error
Two kinds of an error occur when a circle is approximated by line segments, as
shown in Fig 3.16; radial error (ER) and chord height error (EH).
If the radius of a circle is R, the radial error, ER, is computed using Eq 3.36.
ER (i) = R(i) − R =X2(i) +Y2(i) − R (3.36)
Trang 2Fig 3.16 Radial and chord height errors
ER is an error from a truncation effect ER can be approximated by coefficients
A and B and this error is accumulated with iteration At the ith iteration, ER can be
computed approximately using Eq 3.37
Based on the above,α should be determined such that the value of ER or EH
does not exceed a value equivalent to 1 BLU
In the following sections, various reference word interpolation algorithms based
on the above-mentioned basic idea will be addressed
Trang 33.3.2.4 Euler Algorithm
In the Euler algorithm, cosαand sinαare approximated by first-order Taylor series
expansion A and B in Eq 3.31 are written as in Eq 3.41.
Since the series expansion is truncated, a radial error ER influences the accuracy
of the algorithm The maximum error of this algorithm is calculated using Eq 3.42and, ifαis small, the maximum error can be approximated using Eq 3.43
ER max = (π/2α)(1+α2− 1)R (3.42)
ER max ∼= (π/4)αR (for smallα) (3.43)
If a quarter circle is interpolated using this algorithm, angleα is computed from
Eq 3.44 and for interpolating a quarter circle, Eq 3.45 gives the number of iterationsteps
3.3.2.5 Improved Euler Algorithm
The Improved Euler algorithm is similar to the Euler algorithm but differs in that
X (i + 1) is used for calculating Y (i + 1) instead of X(i) In the Improved Euler rithm, Eq 3.46 is used instead of Eq 3.33 The average of coefficient A is approxi-
algo-mated using Eq 3.47 and is close to cosα
X (i + 1) = AX(i) − BY(i) = X(i) −αY (i) (3.46)
Y (i + 1) = AY(i) + BX(i + 1) = (1 −α2)Y (i) +αX (i)
A=12 (1+ (1 −α2)) = 1 −12α2 (3.47)
The radial error ER of the Improved Euler algorithm is maximized atθ=π/4 or
the iteration where Eq 3.48 is satisfied
When using the Improved Euler algorithm, angleα is computed as in Eq 3.49and for interpolating a quarter circle, Eq 3.50 gives the number of iteration steps
Trang 43.3 Software Interpolator 93Equation 3.50 shows that the Improved Euler algorithm is more efficient than theEuler algorithm.
By applying Eq 3.51, a maximum radial error is derived as shown in Eq 3.52 and
the chord height error EH is derived as in Eq 3.53.
In this algorithm, the chord height error EH is maximized at R(i) = R, the first
iteration The maximum chord height error is calculated using Eq 3.54
Equation 3.52 and Eq 3.54 lead to Eq 3.55
ER max=πα
From Eq 3.55 we know that if angleαis smaller than 2/π, the chord height error
(EH) is larger than the radial error ER In general, becauseα< 2/πis satisfied if R
is larger than 20 BLUs, this condition is practical
Also, if the chord height error (EH) is set to 1 BLU, thenαcan be determined by
Trang 5If coefficients A and B, as shown in Eq 3.59, are applied to Eq 3.34 and Eq 3.35,
then Eq 3.60 and Eq 3.61 are derived
Because the radial error ER is always zero, angleα is determined based on the
chord height error EH If R (i) = R, EH is determined using Eq 3.63 If angleα is
very small, EH is determined using Eq 3.64 Angleα is calculated using Eq 3.65
R − 1 ∼
8
When using angleα from Eq 3.65 for interpolating a quarter circle, Eq 3.66gives the number of iteration steps
Trang 63.3 Software Interpolator 95
N=π4
3.3.2.8 Improved Tustin Algorithm
In the Tustin algorithm, the radial error ER is set to 0 However, from a practical point of view, ER can be set to 1 BLU Doing this, it is possible to increase angle
α and the efficiency of the algorithm increases Based on this idea, the Improved
Tustin algorithm was proposed Figure 3.17 shows the radial error ER, the chord height error EH is set to 1 BLU from which a new algorithm including Eq 3.67
through 3.70 can be derived
Y
X
(X i , Y i )
α2
1+ A=
1+α2
√
Trang 7As shown in Eq 3.69, the angleαincreases√
2 times that in the Tustin algorithm.Also, the number of iteration steps for interpolating a quarter circle decreases, as
indicated in Eq 3.70 In the improved Tustin algorithm the radial error ER and the chord height error EH are not necessarily set to 1 BLU; i.e., Eq 3.71 can be derived for the general case when ER and EH are set toβ BLU
Ri = R +βcosα
Table 3.8 Sampled data interpolation method characteristics
Trang 8acceler-3.4 Fine Interpolation 97the pulse train for every 4 ms is stored in the main CPU, which is fine-interpolatedfor every 1 ms by the CPU in charge of motion control.
There are methods for fine interpolation, the linear method where pulse train of 4
ms is divided into 1 ms, and the moving-average method where the moving average
of pulse train is used for fine interpolation Figure 3.18 shows a linear interpolationmethod, where pulse train of 4 ms is linearly divided into that of 1 ms
Formally, Eq 3.72 can be used for linear methods In Eq 3.72, a( j) denotes the number of pulses from fine interpolation at arbitrary time j, and p(i) is the number
of the pulses from rough interpolation and Acc/Dec control at time i t ipo is the
it-eration time of rough interpolation and N is the ratio of the itit-eration time of rough
interpolation and the iteration time of position control
a ( j) = p N , (i) i ≤ j < i +tipo (3.72)The second method is the moving average method The equation used for themoving average can be represented by an iterative equation as shown in Eq 3.73 In
Eq 3.72, a ( j) is from linear interpolation, and b ( j) and b ( j) are further
interpo-lation for the moving average Table 3.9 illustrates the computing procedure for themoving average
6 7 8 9
10 4
4
6
2 4
a(j)
Mcmd(n)
0 29 30
Fig 3.18 Linear fine interpolation
Figure 3.19 shows the moving average of the pulse train shown in Fig 3.18 andTable 3.9 gives the values from Fig 3.19
Trang 9Table 3.9 Example of computing procedure for moving average
func-an accurate approximation of the curve the approximating line or circle is generallyvery short These short segments result in inconsistency of feedrate and this inconsis-tency of feedrate reduces the surface quality In addition, many blocks are required
to define these short paths and the size of the part program increases dramatically Toovercome this drawback, NURBS interpolation was developed In NURBS interpo-
Trang 103.5 NURBS Interpolation 99
6 7 8 9
10 4
Fig 3.19 Pulse train moving average
lation, the CNC itself directly converts NURBS curve data from the part program intosmall line segments, using positions calculated from the NURBS curve data In thisway it is possible to reduce the size of the part program and it is possible to increasethe machining speed because the command feedrate depends on the interpolation
3.5.1 NURBS Equation Form
There are various mathematical models such as cubic-spline, Bezier, B-spline, andNURBS to represent free-form curves Among these, NURBS is the most generalmodel covering others as special cases With NURBS geometry it is possible to de-fine free-form curves with complex shapes by using less data and to represent variousgeometric shapes by changing parameters Nowadays, NURBS geometry is gener-ally used in CAD/CAM systems
The mathematical form of a NURBS curve is shown in Eq 3.74
P (u) =∑n i=0N i,p (u)w i P i
Trang 11In the above equation, the values u iare termed “knots” and the NURBS curve has an
associated ‘knot vector’, U The knot vector U is defined as Eq 3.76 and each value
u i in the knot vector is greater than or equal to the previous value, u i−1
U = u0, ,u p,up+1, ,um−p−1,um−p, ,um (3.76)
a = u0= = u p (k multiplicity)
b = u m−p = = u m
m = n + p + 1
P denotes the degree of the B-spline basis function, P i denotes control point i, and
w i stands for the ‘weight’ of P i
3.5.2 NURBS Geometric Characteristics
The characteristic of NURBS curves depends on that of the underlying B-spline basisfunction and can be summarized as follows:
• If u /∈ [ui,ui +p+1 ), N i,p (u) = 0
• If p and u are valid, Ni,p ≥ 0
• P(a) = P0, P(b) = P n; the NURBS curve passes through the first control point andthe last control point
• P(u) can be infinitely differentiated within defined parameter space and if u is ui and multiplicity of knot u i is k, P (u) can be differentiated as many as p − k times.
• The movement of control point P i or the change of weight w iaffects the portion
of the curve where the parameter u ∈ [ui,ui +p+1]
• By adjusting the weight, the control point, and the knot vector of a NURBS curve
it is possible to represent curves with various shapes
In CAD systems, NURBS curves with degree 3 are mainly used Also, multiplicity
of the knot vector is usually 1 and the curve satisfies at least C2 continuity Thesetwo characteristics result in good geometric properties In modern CAD systemsfree-form shapes are represented using NURBS geometry
The shape of a NURBS curve is defined based on control points, knots, andweights Control points define the basic position of the curve Weights decide theimportance of individual control points Knots decide the tangents of curves Fig-ure 3.20 shows the partial modification characteristics of a NURBS curve Fig-ure 3.20b shows the modified curve when control point V4 is moved From Fig 3.20b,the partial modification of curve is shown Figure 3.20c shows the curve when theweight of control point V6 is changed
Figure 3.21 shows the graphs that define a half-circle and a line by using aNURBS model To represent the half circle shown in Fig 3.21a, five control points(0,0), (0,5), (5,5), (10,5), (10,0) are used There are five weights, one for each control
Trang 12X - axis
2 3 4 5 6 7
2 3 4 5 6
7
0 0 (b)
1 1
X - axis
2 3 4 5 6 7 2
3 4 5 6
7
0 0 (c)
Fig 3.20 NURBS curves
point(1, √1
2,1, √1
2,1), and the knot vector (0,0,0,0.5,0.5,0.5,1,1,1) is used The three
0s at the beginning and the three 1s at the one mean that the NURBS curve passesthrough the first and last control points To represent a line shown in Fig 3.21b, thefollowing data are used:
Seven control points: (0,0), (1,1.5), (2,3), (3,4.5), (4,6), (5,7.5), (6,9)
weights for the control points:(1,1,1,1,1,1,1)
X-axis
023456
(b)
Fig 3.21 NURBS line and circle
3.5.3 NURBS Interpolation Algorithm
The NURBS interpolation algorithm introduced in this section is suitable for theSampled-Data interpolation method This algorithm consists of 2 stages; In the firststage, successive interpolated points are obtained with a maximum allowable inter-
Trang 13polation error In the second stage, the interpolated point obtained from the first stage
is checked to determine whether it exceeds the allowable acceleration If necessary,
a new interpolated point is calculated that satisfies the allowable acceleration In thefollowing sections, the detailed algorithms will be addressed
3.5.3.1 NURBS Interpolation Errors
In the Sampled-Data interpolation method, the interpolation frequency is fixed andthe speed is decided by the length of the interpolated line segment The interpola-
tion error varies according to the curvature of curve The interpolation error h for a
free-form curve is calculated as illustrated in Fig 3.22 The center point of the linefrom the interpolated point(x i,yi ) and the successive interpolated point (x i+1,yi+1) iscompared with the midpoint of the curve between the points(x i,yi ) and (x i+1,yi+1),denoted(x c,yc ) If the interpolation error, h, is greater than the maximum allowable
interpolation error(εmax) this means that the curvature is too high to satisfy the imum allowable interpolation error, the next interpolated point moves closer to thecurrent interpolated point(x i,yi ) The new interpolated point (x
max-i+1,y
i+1) is closer tothe interpolated point(x i,yi)
h
c i(x , y )c i
c i(x , y )c i
X Y
Fig 3.22 Adapting step length to curvature
Figure 3.23 represents the definition of the curvature at a particular point on a free
curve and Eq 3.77 shows the curvature k and radius R.
Trang 143.5 NURBS Interpolation 103
κ ≡ lim Δs→0
Δφ
Δs ,
where κ: is the curvature
R : is the radius of curvature
Δφ: angle at the circumference
Δs : the length of the partial curve
1
Fig 3.23 Curvature definition
A curve PQ is regarded as the part of a circle with radius R and curvatureκ If
we define P and Q as two successive interpolated points and the distance betweenthe line and the circle as an interpolation error, the relationship betweenΔφ, h, and
k can be summarized as Eq 3.78 based on Eq 3.77.
h=κ1−
1
κ× cos
Δφ2
If the length of the partial curveΔs is approximated by the length of the line PQ,
the curvature is summarized as Eq 3.80 based on Eq 3.77 and Eq 3.79
Trang 15From Eq 3.81, the approximated relationship between the command feed-rate F,
the iteration time for an interpolation(ΔT), curvatureκ, and interpolation error h
can be summarized as in Eq 3.82
h ∼=κ× PQ
2
8 =κ× (F ×ΔT)2
where F : is the feedrate
ΔT : is the interpolation iteration time
PQ : F ×ΔT
Equation 3.82 says that the interpolation error(h) is proportional to the curvature
κ If interpolated points are calculated with constant feedrate, an interpolation errorgrows on curve parts with large curvature Therefore, it is necessary to reduce theinterpolation error with a reduction of feedrate on the highly curved path portions.From Eq 3.82, in order to compute the feedrate at which the interpolation error
h falls within the maximum allowable interpolation errorεmax , the curvature k of the
partial curve that connects a current interpolated point and a successive interpolatedpoint should be computed
Set the current interpolated point to P(u i) by Eq 3.74 and the next interpolated
point to P(u i+1) To calculate the speed to P(u i+1) from P(u i), it should be assumed
that the previous interpolated points P(u i−2 ), P(u i−1 ), and P(u i) are located on thesame circle
It is assumed that the successive interpolated point P(u i+1) is located on the same
circle Based on these assumptions, the curvature of the partial circle from P(u i)
and P(u i+1) is extrapolated from the curvature of the circle defined from P(u i−2),
P (u i−1 ), and P(u i)
Using the maximum allowable interpolation errorεmax, the iteration time for an
interpolation T , and the approximated curvature κ, the speed between P (u i) and
Fε: allowable feedrate speed
Trang 163.5 NURBS Interpolation 105
It is necessary to define the relationship between the parameter variable u of the NURBS geometry and the feedrate Fε(t) The linear length between the current in-
terpolated point and the next interpolated point,ΔL, can be computed using Eq 3.84.
We assume that the linear length from Eq 3.84 is identical to the length of partialcurve Noting thatΔL in Eq 3.84 is defined in a time domain, we need to find its
equivalent value in the parametric domain to find the next interpolation point on the
NURBS curve Let P(u) be the current point and we would like to find the next point
P (u+Δu) Then, using the property ofΔL in Eq 3.84 and assuming the three points
in Cartesian space are close enough, we can approximateΔL as shown in Eq 3.85.
3.5.3.2 Acceleration Control keeping Axis-Velocity Limit
In the previous section we determined the next interpolation point based on the imum error allowed for interpolation In the case that the rate of velocity is changedsharply to beyond the acceleration for the joint abrupt motion will be caused, re-sulting in machine damage and machining operation failure To avoid such a prob-lem, the distance of the next point to be interpolated should be shortened based on
max-Eq 3.87.ΔL computed in this way should be applied to Eq 3.84 and Eq 3.85.
ΔY
ΔT i+1
2
Trang 17in-A DDin-A interpolator is a typical hardware interpolator and was used for a longtime, but is not much used in today’s CNC systems In modern CNC systems, a soft-ware DDA interpolator is used, where the algorithm of the hardware DDA interpo-lator is implemented in software A software interpolation method can be classifiedinto a reference pulse method and a sampled-data interpolation method A reference-pulse method is suitable for high-accuracy machining and a sampled-data interpola-tion method is suitable for high-speed machining Due to the demand for high-speedmachining, the sampled-data interpolation method is typically used in today’s CNCsystem.
In this chapter, various algorithms for the reference-pulse interpolation methodare explained, including, the software-DDA interpolation algorithm, Stairs Approxi-mation Interpolation algorithm, Direct Search interpolation algorithm, Sampled-datainterpolation method, Tustin interpolation algorithm, improved Tustin interpolationalgorithm, Euler interpolation algorithm, improved Euler interpolation algorithm,and Taylor interpolation algorithm These algorithms need to be developed as mod-ules so that the appropriate algorithm can be selected based on the application of theCNC system
Interpolation algorithms for free-form curves are important for solving problemsexisting in CNC systems where the free-form curve is approximated by a number
of infinitesimal linear segments Via the NURBS interpolation method, still underinvestigation, problems such as speed reduction, poor surface quality and poor ma-chining accuracy have been solved