Upload
matthias-mueller
View
214
Download
1
Embed Size (px)
Citation preview
High accuracy spline interpolation for 5-axis machining
Matthias Mullera, Gabor Erdosb, Paul Xirouchakisa,*
aInstitute of Production and Robotics, EPF Lausanne CH-1015, SwitzerlandbComputer and Automation Research Institute, H-1518 Budapest, Kende u. 13-17, Hungary
Received 10 October 2003; received in revised form 7 January 2004; accepted 19 February 2004
Abstract
This article presents a new algorithm for simultaneous 5-axis spline interpolation. The algorithm basically merges two concepts: (1) the
interpolation of the toolpath with Pythagorean Hodograph (PH) curves and (2) the analytic solution of the inverse kinematic problem using
the template equation method. The first method allows one to obtain a analytic relation between the arclength and the parameter of the
toolpath curve. This one enables one to control the velocity of the tool on the workpiece. The second method allows one to determine the
analytic solution of the parameterized inverse kinematic problem that permits us to introduce arbitrary number of geometric parameters. A
natural selection of the possible parameters can be the parameters of tool geometry and the workpiece placement. This way, the off-line
generated inverse solutions—that transform the cutter contact curve into axis values—can be online compensated, as soon as the exact
parameter values are become known. Based on these two approaches, a robust and fast method for the simultaneous 5-axis spline
interpolation is developed. The result of this new algorithm is time-dependent axis splines which represent the given toolpath with high
accuracy.
q 2004 Elsevier Ltd. All rights reserved.
Keywords: Spline interpolation; Inverse kinematics; Template equation
1. Introduction
In this article a new spline interpolation algorithm for
simultaneous 5-axis machining is presented. Two concepts
are basically merged in the algorithm: (1) the representation
of the toolpath with PH curves and (2) the analytic solution
of the inverse kinematic problem obtained using the
template equation method.
Output of the proposed method is high accuracy and
time-dependent axis splines which results in a tool move-
ment with constant velocity in the cutter contact point. The
constant velocity is obtained by calculating the arclenght of
the cutter contact curve by using a 3D PH curve
interpolation. Using the desired constant feedrate, the
obtained arclength values can be transformed directly to
the corresponding time values, which are used as knot
sequence for the cubic spline interpolation on each axis.
To transform the cutter contact curve to the axis space of the
machine the analytic solutions of the inverse kinematic
problem is used. This transformation is calculated using the
template equation method, which allows one to use the
complete transformation between the cutter contact values
and the axis values containing the tool correction and the
workpiece placement as parameters. The fact that this
transformation given analytically is used to not only
calculate the axis values but also the derivative at each
axis values using the Jacobian matrix. This finally results in
high accuracy of the obtained axis splines.
2. Literature review
In this section the relevant research areas are reviewed
which relate to the 5-axis spline interpolation
problem. In the first part, the current state in the area
of NC spline interpolation is discussed. In the second part
an overview of the methods used to solve the inverse
kinematic problem of 5-axis machines using the template
equation method is given.
0010-4485/$ - see front matter q 2004 Elsevier Ltd. All rights reserved.
doi:10.1016/j.cad.2004.02.007
Computer-Aided Design 36 (2004) 1379–1393
www.elsevier.com/locate/cad
* Corresponding author. Tel.: þ41-021-693-2915; fax: þ41-021-693-
3553.
E-mail addresses: [email protected] (P. Xirouchakis), matthias.
[email protected] (M. Muller), [email protected]
(G. Erdos).
2.1. PH curves
Real time interpolation is mainly concerned with the
control of the movements of the machine axes based on the
calculation of a sequence of points, that the tool must follow
at a given feedrate. Even in today’s NC controllers the
commonly employed interpolation technique is the linear
interpolation. This technique was introduced early by Koren
[20]. In his article he presented a software interpolator and
compared it to the hardware interpolators more often used at
this time.
In sculptured surface machining the toolpaths are in
general freeform curves. If the NC controller uses linear
interpolation these curved toolpaths have to be approxi-
mated by polylines. This process is generally refereed as
discretisation (see Rao and Sarma [29]). As stated by
Shpitalni et al. [21], and Kong and Yang [33] the linear
interpolation suffers from the following limitations, if it is
used for curved toolpaths: the discontinuities of the velocity
at the junctions of the linear segments result in high
acceleration, poor surface finish, low-surface accuracy and
long machining time. A lot of publications appeared in the
literature discussing the replacement of linear interpolation
techniques in NC control for sculptured surface machining.
One first approach to overcome the problem of linear
interpolation was based on replacing the linear segments
with circular arcs. A recent overview of this technique was
given by Li et al. [26]. This method applies only to 2D
curves.
As a more promising replacement for linear
interpolation, polynomial splines has been used to represent
curved toolpaths. Early publications like Morlec et al. [1],
Quan and Bedi [2,3], Shpitalni et al. [21] and Maekawa et al.
[22] used third order splines in Bezier form to represent
freeform toolpaths. Although this technique turns out to be
very powerful in representing any kind of smooth curve
shape, one major problem still remained: obtaining the
desired feedrate along the curve.
In the controller the interpolation points are generated
with a constant frequency, the sampling rate of the
controller loop. As a consequence, the time between two
consecutive points is constant during the interpolation.
Therefore, the feedrate has to be controlled depending on
the arclength distance between two consecutive points.
The calculation of the arclength distance is not
analytically solvable for general spline curves. The methods
developed to solve this problem can be divided into two
general approaches: (1) numerical calculation of the
arclength for a spline or (2) interpolation with special kind
of splines which have a relation between the arclength and
the curve parameter.
In the following publications the first approach is
discussed. Lo et al. [30] proposed a numerical method
based on a truncated Taylor series expansion to estimate
in real-time the next point along the spline for a given
feedrate. Yang and Chou applied the same approach for
3-axis [4] and for 5-axis machining [5,34] (Chou and
Yang) by adding analytical studies for the velocity,
acceleration and jerk control. Hsu and Yeh [35] applied
truncated Taylor expansion with an error minimisation
algorithm.
Yang and Wang [32], Wright and Wang [31] and Altintas
and Erkorkmaz [7] used the second approach to solve the
feedrate control problem. In their publications they
introduced splines with near-arclength parametrization. In
this technique the exact arclength parameterized spline is
approximated with a spline, which has at some points of the
spline the chord length as parameter. Although this
approach eliminates the drawback of the normal spline
interpolation, it implies still considerable off-line computing
effort. For example to generate the boundary conditions the
method uses a normal cubic spline interpolation as pre-
processing step. Another disadvantage of this approach is
that it uses the chord-length to parameterize the curve. This
method results only for curves with small curvature changes
in a near-arclength parameterization which is close to the
exact arclength parameterization.
Farouki [13,14] introduced the Pythagorean–Hodo-
graph (PH) curves to solve the problem of feedrate
control. This type of curves has the attractive property
that their arclength can be expressed as polynomial
function of the curve parameter. Farouki used these PH
curves to express toolpaths for sculptured surface
machining. He proposed in Ref. [12] a 2D Hermite
interpolation with Pythagorean–Hodograph (PH) and in a
series of articles [9–11,15,16] he discussed issues around
the use of PH curves for NC spline interpolation.
Farouki’s work in NC interpolation with PH curves
concentrated on 3-axis machining. This article extends
this work to NC spline interpolation algorithms for 5-axis
machines using 3D PH curves.
Spence and Fleisig [17] discussed the problem of spline
interpolation for 5-axis machining. They used the near-
arclength approach for the spline interpolation. In this
article PH-curves are used for the 5-axis spline interpolation
problem.
2.2. Template equation method
The inverse kinematics problem (in the following:
IKP) has been widely studied in robotics. From the
kinematic structure point of view the traditional industrial
robots (sometimes called manipulators) have open
kinematic chains. Since the kinematic structure of the
traditional 5-axis milling machines is very similar to the
manipulators, the same solution techniques can be used
in both cases.
The first solution of the IKP using template equations
was proposed by Paul [24,25]. He formulated the IKP of
some common industrial robot and also defined an
algorithm for the template-based solution. The template-
based solution technique has been used henceforth by
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931380
many authors, who also introduced several new template
equations for different types of industrial robots [19,27,28].
By the evolution of the programming languages and
especially by the appearance of the symbolic manipulator
languages, new program packages have been developed,
that are capable of solving the IKP problems automatically
such as the ISG package of Halperin [18], the SRAST–
INKAS program of Herrera-Bendezu et al. [19], the SKIP
package of Rieseler, Schrake [27] and the Mathematica
based solver of Erdos [6]. In Ref. [23] the template
equation method was applied to obtain the transformation
presenting the inverse kinematics of general 5-axis
machines. This thesis shows how to obtain all the analytic
solutions of the inverse kinematic problem of 5-axis
machines.
One of the strengths of the template equation method
is its insensitivity on the number of parameters of the
IKP. This implies, that arbitrary number of parameters
can be introduced into the kinematic model of the 5-axis
machine, and the solution of the IKP can be automatically
obtained. Even if theoretically the IKP of 5-axis milling
machines are always solvable (this follows from the fact,
that the positioning and the orientation equations are
always decoupled), in practice usually hand solutions are
used, that are valid for a family of 5-axis milling
machine. To introduce new parameters into these
solutions is a tedious and error prone procedure. In this
article, the tool geometry and the workpiece placement of
the milling machine are parameterized, and the Mathe-
matica based solver developed by ErdHos is used to solve
the resulted IKP.
3. 5-Axis spline interpolation
In this section the 5-axis interpolation algorithm is
presented in detail.
3.1. 5-axis toolpath definition
For the calculation of the axis displacement based on a
kinematic model containing the tool geometry as parameter
(see Ref. [23]), a toolpath has to contain the following
information
�pccðtÞ cutter contact curve
�dðtÞ tool direction function
�nðtÞ surface normal function along the toolpath
ð1Þ
In general these three entities can be obtained as parametric
functions of a parameter t: This is always true if the
workpiece is described by parametric surfaces and the
toolpaths are generated with parameter curves on these
surfaces
S¼�fsðu;vÞ ¼
fsxðu;vÞ
fsyðu;vÞ
fszðu;vÞ
0BB@
1CCA parametric surface
u¼ guðtÞ; v¼ gvðtÞ parameter functions
�pccðtÞ ¼
�fsðguðtÞ; gvðtÞÞ toolpath on s along parameter curve
ð2Þ
The surface normal function can be obtained directly from
the parametric surface using the parameter functions
snðu;vÞ ¼du�fs £ dv
�fs
kdu�fs £ dv
�fsk
¼�fsnðu;vÞ general surface normal
with : dx�f ¼
d�f
dx
�nðtÞ ¼
�fsnðguðtÞ;gvðtÞÞ surface normal along the toolpath
ð3Þ
To get the tool direction the unit tangent vector tan along the
toolpath is needed. This vector is very often referred as feed
direction.
tanðtÞ ¼
d�pccðtÞ
dtd�pccðtÞ
dt
��� ��� ð4Þ
The tool direction can be expressed as a function of the
normal and tangent vector and two angles: the roll angle ðuÞ
and the tilt angle ðvÞ; see Fig. 1. The roll angle specifies the
inclination of the tool in the feed direction (between surface
normal and tangent vector). The tilt angle specifies the
direction of the tool perpendicular to the feed direction.
The tool direction can be calculated as follows
�dðtÞ ¼ sin
p
22v
� sin
p
22 u
� �nðtÞ þ cos
p
22 u
� tanðtÞ
�
þ cosp
22v
� �nðtÞ£ tanðtÞ
k�nðtÞ£ tanðtÞk
ð5Þ
Using the Inverse kinematics solution with tool correction
the 5-axis toolpaths ð�pcc;
�n;
�dÞ described in Ref. [23] can be
transformed directly to curves on each axis by replacing
the driving parameters in the equations of the IKP with
Fig. 1. Tilt and roll angle.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1381
the parametric expressions for�pcc;
�n and
�d: This will yield
analytic, parametric expressions for the curves on each axis.
Two problems arise from that approach:
† The parametric expression for the curves on each axis are
very large and not suitable for online calculations.
† The parameter t of the expressions has no relation to the
length of the curve, so the feedrate of the tool on the
workpiece cannot be controlled with the general
parameter t:
In order to control the feedrate along the tool path, the
length of the curve has to be calculated with respect to
the general parameter t: This represents the main issue for
the general CNC interpolation. The goal of the conventional
CNC interpolation is to generate a sequence of points on
each axis at the motion controller loop closing frequency
(controller sampling frequency). The tool should have
thereby a constant feedrate at the cutter contact point ð�pðtÞÞ
in order to minimize cutting force variations, to avoid
chatter and to produce a smoother surface finish. The actual
state of CNC interpolation is discussed in the literature
review of this article. In this article a new way of CNC
interpolation for 5-axis toolpaths is proposed. The goal of
that method is the following:
Goal of the new CNC 5-axis interpolation. The goal is to
generate on each axis of the 5-axis machine a spline
function which represents the given toolpath with high
accuracy and which is parameterized exactly with the
arclength of the toolpath (cutter contact curve).
The trajectory representation as a spline function is
chosen to allow the online calculation of the interpolation
points and to obtain small volumes for the data
exchanged towards the 5-axis machine controller. If
these splines are given with the arclength s of the cutter
contact curve as parameter, the speed of the tool can be
controlled very easily. This result is new compared to the
actual state of CNC interpolation. In general the
arclength parameterized spline curves can be derived
with respect to s; which will allow to calculate the
velocities and accelerations on each axis for a given
feedrate on the toolpath. If these values are exceeding
the maximal velocities or maximal accelerations on any
axis, the feedrate can be directly adapted by changing the
parameterization of the spline curves.
In the following it will be discussed how to reach the goal
defined above. As discussed before it is possible in general
to obtain for all necessary, not constant input data of the
inverse kinematics (in general the driving parameters�p;
�n;
�d)
an analytic, parametric expression with respect to the
general parameter t: It will be considered first how to
transform these expressions to a parametric form with the
arclength s as the parameter.
3.2. Transformation to PH curves
Consider that the analytic expressions for�pccðtÞ;
�nðtÞ and
�dðtÞ are given with t as general parameter without any
meaning. The goal is to represent these data in a parametric
form with the parameter s: the arclength of�pcc (the cutter
contact curve). Assume that the parameter t has values from
0 to T : For this interval a very coarse discretisation is chosen
disðt0; t1;…; tnÞ
0 # ti # T ; i [ ½0; n� dis ¼ ðt0; t1;…; tnÞ [ ½0; T�
t0 ¼ 0; tn ¼ T ; t0 , t1 , · · · , tn
ð6Þ
Compared to a linear approximation the approximation dis
consists of a considerable less amount of points. For each of
these parameters the cutter contact point, the unit normal
vector and the unit tangent vector can be calculated
�p0 ¼
�pccðt0Þ;
�p1 ¼
�pccðt1Þ;…ð
�p0;
�p1;…;
�pnÞ;
�n0 ¼
�nðt0Þ;
�n1 ¼
�nðt1Þ;…ð
�n0;
�n1;…;
�nnÞ;
tan0 ¼ tanðt0Þ; tan1 ¼ tanðt1Þ;…ðtan0; tan1;…; tannÞ;
ð7Þ
Between each neighboring pair of cutter contact points�pi
and�piþ1 a PH Hermite interpolation using the unit tangent
vectors tani and taniþ1 can be realized. This yields for each
segment between�pi and
�piþ1 a quintic PH spline ^
�piðtÞ with
the corresponding arclength function siðtÞ (see Ref. [12]).
^�p0ðtÞ; ^
�p1ðtÞ;…; ^
�pn21ðtÞ;
s0ðtÞ; s1ðtÞ;…; sn21ðtÞ with : t [ ½0; 1Þ
ð8Þ
The new parameter t can be considered as a local parameter
which goes from 0 to 1 in the interval between�pi and
�piþ1:
With the piecewise arclength function the arclength for each
parameter ti can be calculated
si ¼ sið0Þ; and sn ¼ sn21ð1Þ ðs0; s1;…; snÞ ð9Þ
The following discretisation of the tool path can be
calculated
ðs0; s1;…; snÞ ð�p0;
�p1;…;
�pnÞ;
ð�n0;
�n1;…;
�nnÞ; ð
�d0;
�d1;…;
�dnÞ;
ð10Þ
The discretisation given in Eq. (10) corresponds to the exact
discretisation of a toolpath which was given with respect to
the arclength (natural parametrization: unit tangent vector,
see Eq. (4)). For each of these points the corresponding axis
values can be calculated using the equations of the IKP with
tool correction (see Ref. [23]). This will yield a series of
points on each axis. Knowing the arclength of the
corresponding cutter contact points, one could try to make
a cubic spline interpolation on each axis using the arclength
values as knot sequence. This approach suffers from two
problems: (1) for a cubic spline interpolation not enough
data are available (start and end tangent on each axis have
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931382
to be estimated); (2) the accuracy of the cubic spline is not
very high due to the coarse discretisation. To overcome
these problems the Jacobian matrix of the inverse
kinematics is used.
3.3. Jacobian matrix
In Ref. [23] the analytic equations for the inverse
kinematic problem containing the tool correction are
derived. In the following these equations are presented as
a function of the time-dependent input data (in general these
are the driving parameters)
q1 ¼ f1ðpx; py; pz; nx; ny; nz; dx; dy; dzÞ
q2 ¼ f2ðpx; py; pz; nx; ny; nz; dx; dy; dzÞ
q3 ¼ f3ðpx; py; pz; nx; ny; nz; dx; dy; dzÞ
q4 ¼ f4ðpx; py; pz; nx; ny; nz; dx; dy; dzÞ
q5 ¼ f5ðpx; py; pz; nx; ny; nz; dx; dy; dzÞ
ð11Þ
where q1; q2; q3 are the translational and q4; q5 are the
rotational axis values.
It is true in general that these analytic functions can be
partially derived with respect to the driving parameters
px; py; pz; nx; ny; nz; dx; dy; dz; which will result in the Jaco-
bian matrix for the inverse kinematics
MiJac ¼
df1dpx
df1
dpy
df1
dpz
df1dnx
df1
dny
df1dnz
df1
ddx
df1ddy
df1ddz
df2dpx
df2
dpy
df2
dpz
df2dnx
df2
dny
df2dnz
df2
ddx
df2ddy
df2ddz
df3dpx
df3
dpy
df3
dpz
df3dnx
df3
dny
df3dnz
df3
ddx
df3ddy
df3ddz
df4dpx
df4
dpy
df4
dpz
df4dnx
df4
dny
df4dnz
df4
ddx
df4ddy
df4ddz
df5dpx
df5
dpy
df5
dpz
df5dnx
df5
dny
df5dnz
df5
ddx
df5ddy
df5ddz
0BBBBBBBBBBBBBBBBBBBBB@
1CCCCCCCCCCCCCCCCCCCCCA
ð12Þ
Eq. (11) can be considered as a multi-arameter vector
function. The derivation of this function is actually a linear
combination of partial derivatives for each parameter. This
yields the Jacobian matrix (see Eq. (12)). The Jacobian
matrix maps the derivative of the driving parameters to the
corresponding derivatives of the axis values
q10
q20
q30
q40
q50
0BBBBBBBBB@
1CCCCCCCCCA¼MiJac
�p0
�n0
�d0
0BB@
1CCA ð13Þ
Due to the fact that the inverse kinematics solution is given
analytically the Jacobian matrix can be calculated exactly.
This offers the possibility to not only calculate the axis
values q1 to q5 for the given discretisation but also the
derivatives of the axis values assuming the derivatives of the
driving parameters are known. This will open the opportu-
nity to make a spline interpolation on each axis based on
position and tangent data. The question is now how to get
the derivatives of the driving parameters. Due to the fact that
the spline on the axes should be given as a function of the
parameter s (arclength of cutter contact curve), the
derivative must also be expressed with respect to s: Section
3.4 discusses how to get the exact derivatives of the driving
parameters with respect to s:
3.4. Calculation of the derivatives
In previous sections the parametric expressions for the
driving parameters�pccðtÞ;
�nðtÞ and
�dðtÞ are generated (see
Eqs. (2), (3) and (5)). These expressions can be derived in
general with respect to t: Consider that the reparameteriza-
tion with respect to s is given
t ¼ tðsÞ ð14Þ
With this equation the function for�pccðtÞ can be repar-
ameterized
�pccðtðsÞÞ ¼
�pðsÞ ð15Þ
The derivative of this function with respect to t can be
obtained using the chain rule
d�pccðtðsÞÞ
ds¼
d�pccðtðsÞÞ
dt
dt
ds¼
d�pccðtÞ
dtdsdt
ð16Þ
The arclength function ðs ¼ sðtÞÞ can be considered as
known (see Section 4.7). This means that the exact
derivative of the cutter contact curve with respect to the
arclength s can be calculated using Eq. (16). Due to the fact
that the other driving parameters are also given as general
functions of t the same approach can be applied to calculate
the derivatives with respect to s
d�pcc
ds¼
d�pccðtÞ
dtdsdt
d�n
ds¼
d�nðtÞdtdsdt
d�d
ds¼
d�dðtÞdtdsdt
ð17Þ
These equations can be used to calculate the values of the
derivatives for the given discretisation dis:
d�pcc
ds
� i¼
d�pccðtÞ
dtdsi
dt
; t ¼ 0; t ¼ ti
d�pcc
ds
� n¼
d�pccðtÞ
dtdsn21
dt
; t ¼ 1; t ¼ T
ð18Þ
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1383
d�n
ds
� i¼
d�nðtÞdtdsi
dt
; t ¼ 0; t ¼ ti
d�n
ds
� n¼
d�nðtÞdt
dsn21
dt
; t ¼ 1; t ¼ T
ð19Þ
d�d
ds
� i¼
d�dðtÞdtdsi
dt
; t ¼ 0; t ¼ ti
d�d
ds
� n¼
d�dðtÞdt
dsn21
dt
; t ¼ 1; t ¼ T
ð20Þ
With these equations the following toolpath discretisation
can be calculated
ðs0; s1;…; snÞ; ð�p0;
�p1;…;
�pnÞ; ð
�p0
0;�p0
1;…;�p0
nÞ;
ð�n0;
�n1;…;
�nnÞ; ð
�n0
0;�n0
1;…;�n0
nÞ;
ð�d0;
�d1;…;
�dnÞ; ð
�d0
0;�d0
1;…;�d0
nÞ; with : f 0 ¼df
ds
ð21Þ
Using the inverse kinematics solution (Eq. (11)) and the
Jacobian of the inverse kinematics (Eq. (12)), the joint
values and their derivatives can be calculated for the given
discretisation with respect to the arclength s: The result will
be
ðs0; s1;…; snÞ; ð�q0;
�q1;…;
�qnÞ; ð
�q0
0;�q0
1;…;�q0
nÞ;
with : f 0 ¼df
ds;�q ¼ ðq1; q2; q3; q4; q5Þ
ð22Þ
3.5. Cubic spline interpolation
On the data derived in Section 4 a simple C1 piecewise
Cubic Hermite interpolation is applied (see Ref. [8]). This
interpolation yields a spline on each axis which represents
with reasonable accuracy the arclength parameterized joint
value function.
4. Example
4.1. Workpiece definition
In general free form surfaces are represented in
commercial CAD and CAM systems using parametric
surface patches. In this example the method presented in
Section 3.5 is applied to a simplified parametric surface
given by Eq. (23). Nevertheless the method will work in
the same way for the general case of a NURBS surface.
Sðu; vÞ ¼
200u
200v
150ð3 2 1:3ð20:5 þ uÞ2 þ 1:3ð20:5 þ vÞ3Þ
0BB@
1CCAð23Þ
For the interval u [ ½0; 1� and v [ ½0; 1� the surface S is
plotted in Fig. 2.
4.2. Discretisation of the toolpath
In this example the toolpath is discretised with 11 points
with a parameter-distance of 0.1 (see Eq. (6)).
disD0:1 ¼ {0:0; 0:1; 0:2;…; 0:9; 1:0} ð24Þ
4.3. Toolpath definition
On the surface S a toolpath is generated using the
following parameter function
uðtÞ
vðtÞ
!¼
t
t2
!ð25Þ
The expression for the cutter contact curve�pðtÞ is
�pðtÞ¼
200t
200t2
150ð321:3ð20:5þ tÞ2þ1:3ð20:5þ t2Þ3Þ
0BB@
1CCA ð26Þ
Fig. 2. Workpiece surface.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931384
4.4. Normal vector function on the toolpath
The parametric equation for the surface normal along the
toolpath can be obtained from Eq. (3)
�nðtÞ¼
1ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffið4£109þtð26£10928£108tþ2£1010t321£1010t5ÞÞ
p
�
24£104þ8£104t
21£105ð20:5þt2Þ2
4£104
0BBBBB@
1CCCCCA ð27Þ
In Fig. 3 the surface normal vectors are plotted over the
toolpath. In this figure the unit surface normal vectors are
multiplied with a constant factor (50) to obtain a better
visual presentation.
4.5. Tangent vector
The parametric Eq. (28) for the tangent vector is
calculated based on Eq. (4). In Fig. 4 the unit tangent vectors
of the toolpath are plotted on the surface (also scaled for
visualization).
4.6. Tooldirection vector on the toolpath
The tool direction is calculated using Eq. (5). For this
example the following constant tool direction angles are
chosen
u ¼ 158 v ¼ 08 ð29Þ
4.7. Piecewise PH Hermite interpolation
Using the discretisation DD0:1 (see Eq. (24)) a set of cutter
contact points and of tangent vectors can be calculated using
Eqs. (26) and (28). These two data sets can be used to
calculate between each pair of neighboring discretisation
points a PH curve. The result will be a set of local PH curves
which can be used to generate a piecewise PH curve for the
entire toolpath which has C1 continuity, since the same
tangent vectors are used in the junction points for the
Hermite interpolation. In Fig. 5 the resulting piecewise PH
curve is shown.
In Fig. 5 it can be seen that the generated piecewise PH
curve seems to be identical in shape with the original toolpath
curve shown in Fig. 3. But it should be emphasized that the
piecewise PH curve is from a mathematical point of view
only an approximation of the original toolpath. In the
following the difference between the original toolpath and
the piecewise PH curve is analyzed quantitatively. The
original toolpath (Eq. (26)) and the piecewise PH curve are
general space curves. To compare both curves quantitatively
Fig. 3. Normal vectors.
tanðtÞ ¼
200ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi40; 000 þ 160; 000t2 þ 22; 500ð22:6ð20:5 þ tÞ þ 7:8tð20:5 þ t2Þ2Þ2
p400tffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
40; 000 þ 160; 000t2 þ 22; 500ð22:6ð20:5 þ tÞ þ 7:8tð20:5 þ t2Þ2Þ2p
150ð22:6ð20:5 þ tÞ þ 7:8tð20:5 þ t2Þ2Þffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi40; 000 þ 160; 000t2 þ 22; 500ð22:6ð20:5 þ tÞ þ 7:8tð20:5 þ t2Þ2Þ2
p
0BBBBBBBBBB@
1CCCCCCCCCCA
ð28Þ
Fig. 4. Tangent vectors.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1385
the curves are projected to the x–z plane and to the y–z plane,
respectively, as shown in Fig. 6.
The projected curves are given, like the original curves,
also in parametric form. For the exact curve the parametric
form can be transformed analytically to the explicit form
(for the x–z plane z ¼ f ðxÞ or for the y–z plane z ¼ f ðyÞ).
The projections of the piecewise PH curve are
transformed numerically to explicit form using Newton
iteration for a given resolution. In each plane the z-values
of the projections of the piecewise PH curve are subtracted
from the z-values of the projections of the original
toolpath. This difference is referred in the following as z
Error: In Fig. 7 the z errors for both planes are plotted over x
and y:.
In the following the maximum error for the given
example is estimated. The calculated error in xðzErrorxÞ is
perpendicular to the error in yðzErroryÞ: The error in space
can be calculated with
Error ¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffizError2
x þ zError2y
qð30Þ
If the maximum values for zErrorx and zErrory are used
to estimate the distance in space between the original
toolpath and the piecewise PH curve then in the worst
case a 0.026 mm maximum error results for an
interpolation length of about 23 mm (interpolation length
is the estimated average length of one interpolation
segment). This interpolation error seems to be reason-
able. The benefit of this interpolation is that the toolpath
is now represented with a piecewise PH curve where the
arclength can be calculated analytically from the
parameter.
The error introduced by the PH Hermite Spline
interpolation does not apply to the shape precision of the
trajectories, since the original cutter contact curve�pcc is
used to generate them. The PH Spline curve is only used for
the analytic arclength calculation and derivation. The
original curve and the PH Spline curve are very close (see
error discussion above). For this reason the error in the
arclength can be considered as negligible.
With Eq. (9) the arclength of each point of the
discretisation can be calculated, using the arclength function
of each segment obtained from the piecewise PH Hermite
interpolation.
ðs0;s1;…;s10Þ ¼ð0;27:67;55:01;82:14;109:24;137;
166:81;200:07;237:3;277:65;320:83Þ ð31Þ
4.8. Inverse kinematics
In previous sections the driving parameter set for
the inverse kinematics was calculated. As an example
the Ferrari A15 5-axis milling machine discussed in
Fig. 7. Error in z for (a) over x and for (b) over y:
Fig. 6. Projection of the toolpath to the x–z and y–z planes.
Fig. 5. Toolpath: piecewise PH curve.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931386
Ref. [23] is used for the actual machining. In Fig. 8 the
position of the workpiece on the machine is illustrated.
In Fig. 9 the points on each axis are connected with line
segments (linear approximation). These figures represent a
linear interpolation of the axis values with respect to
the arclength of the toolpath. To evaluate the following
steps quantitatively a reference curve on each axis is
generated. This reference curve is based on the discretisa-
tion of 1000 points on the given toolpath. For all these points
the driving parameters and the corresponding arclength is
calculated. Then for each point the corresponding axis
values are calculated. If these axis values are plotted as a
polyline over the arclength values a quasi-exact represen-
tation of the axis values over the arclength is obtained. The
calculation of these reference curves took on the Mathe-
matica kernel about 10 min.
In Fig. 10 it is shown that the linear polyline based on the
normal discretisation is not sufficient for a precise machin-
ing of the workpiece surface.
In practical use the polyline on each axis is very often
smoothed by fitting a spline curve through the points of the
polyline. In general a cubic Spline interpolation is used to
realize a curve on each axis. In the following this approach
is tested and compared to the reference curve. For the cubic
Spline interpolation two things beside the interpolation
points are needed: (1) a knot sequence and (2) the start and
end tangent of the Spline curve. For the knot sequence the
already calculated arclength values are used. In practical
applications this should be calculated numerically. Here the
exact values obtained from the piecewise PH Spline Curve
are used. To get the start and the end tangent the reference
curves are used. For both cases, knot sequence and tangents,
the quality of the data values used for the evaluation of
Fig. 9. Linear approximation of the curves on each axis.
Fig. 8. Workpiece on Ferrari machine.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1387
the cubic spline curves is higher compared to practical
applications.
In Fig. 11 the cubic spline curves obtained from the
discretisation points are compared with the reference curve.
The plotted error curves shown under the axis curves are the
difference between the reference curve and the cubic Spline
curve. If the maximal errors in these curves are normalized
with the corresponding axis value range a maximal relative
error of about 10% is obtained.
The derivatives of the driving parameters are calculated
using Eqs. (18)–(20) and the arclength functions obtained
from the piecewise PH Spline. In Fig. 12 the tangents are
plotted on the reference curve for the first axis.
On each axis the axis positions and their derivatives are
used for a C1 Piecewise cubic Hermite interpolation using
the arclengths as knot sequence (see Ref. [8]). This yields a
Spline curve on each axis with arclength parameterization.
In Fig. 13 these splines are compared to the reference
curve. It can be observed that these spline curves have an
error, which is on average approximately five times smaller
than the error of the cubic spline curves, which do not use
the tangent. Another point which could be observed is that
a relative large error amplitude occurs at an arclength of
about 123 mm. The value 123 mm is estimated by
analyzing the local maxima and minima on the error
curves. This relatively high error comes from the interplay
between the local curvature of the Spline curves and the
discretisation of the toolpath. In Fig. 14 this effect is shown
for q2. The local maximum on this curve happens to be at
an arclength value of 123 mm. This point is approximately
in the middle of a toolpath section (see discretisation points
in Fig. 14). For the high curvature in that section a cubic
Spline is not able to interpolate the original shape with
enough accuracy.
An interesting question is, where does the high curvature
at 123 mm comes from, considering that on almost all axes
maximal curvatures are occuring at that point? It can be
considered that at this point the toolpath passes near
a singular point of the machine. A study of singularities of
5-axis machines can be considered as a future research
topic, which can be based on the analytic solution of the IKP
derived in this article.
To overcome this problem an additional discretisation
point is introduced at an arclength of 123 mm. After
repeating all the necessary calculations for the new
discretisation a new set of cubic sline curves on each axis
is generated. This set and the corresponding errors are
shown in Fig. 15. Compared to the initial tangent based
Spline curves, it can be seen that in general the error is small
and that the disproportional high error amplitudes at
123 mm arclength could be smoothed.
This example shows that the accuracy of the new Spline
interpolation depends on the distribution of the discretisa-
tion points on the toolpath. A more detailed investigation of
that topic is outside the scope of this paper and will remain
open for future research work.
Fig. 10. Comparison between reference curve and normal discretisation.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931388
5. Conclusion
In this article a new algortihm is presented for 5-axis
spline interpolation. This method offers a higher geometric
accuracy due to the fact that not only toolpath position are
translated to axis values but also derivatives of the toolpath.
The result obtained from this method is time-dependent axis
splines with a higher accuracy compared to conventional
spline interpolation methods. The adapting of the inter-
polation spline to technological factors like maximal
Fig. 11. Comparison between reference curve and cubic Spline interpolation based on normal discretisation.
Fig. 12. Derivatives for q1:
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1389
allowed velocities and accelerations on each axis or altering
material removal rates are not discussed in this article.
The algorithm turned out to be very robust if the
following assumptions are true: (1) the given surface is
smooth (no geometric discontinuities); (2) the position and
tangent values can be calculated on the given surface and (3)
a reasonable discretisation is given. Point (1) and (2) seems
to be trivial but it turned out in practical applications that
the surfaces obtained from commercial CAD or CAM
systems do not always correspond to what was aspected
from visualization. The problem of finding a optimal
discretisation was excluded from the scope of this article
although the issue is important for the robustness of the
algorithm in a practical application.
Fig. 13. Comparison between tangent-based cubic Splines and reference curves.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931390
In the area of grinding of complex 3D surfaces the
proposed method contains a great potential for practical
applications. In the Swiss watch industry over 90% of the
grinding of middle and high valuable watches a still done
manually. In this area of application the grinding operations
can be described geometrically only be 3D curves. The
position accuracy of the grinding operation is crucial
although only the visual aspect of the final part is important.
This results from the fact, that only a very small amount of
material is removed during one grinding path. If the
interpolation spline curve is smooth but slightly deformedFig. 14. Interplay between Error and discretisation on q2:
Fig. 15. Comparison between improved tangent-based cubic Splines and reference curves.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1391
compared to the real surface, the first grinding path will
not touch the pre-finished surface at each place. To have
a contact of the grinding tool at each place of the surface
several paths have to be done before the real grinding
process can start. Due to the small amount of
removed material this can result in a considerable
augmentation of the machining time, which is
definitely not desired. A preliminary implementation of
the method—discussed in this article—on a PC based
controller, showed to be very promising for the grinding
application. The implementation showed also that the
accuracy of the velocities on each axis is not crucial. To
obtain the desired result the velocity profiles should be only
smooth. Due to the fact that we use cubic spline curves on
each axis this condition is full filled.
Acknowledgements
This research was partially funded by the following
contracts between the Swiss Federal Office of Education and
Science and EPFL: the ESPRIT project 29708 STEP-NC
(STEP-Compliant Data Interface for Numeric Controls) and
the IMS STEP-NC project 01.222-1.This support is grate-
fully acknowledged.
References
[1] Andre P, Haddad MC, Morlec C. Application of uniform cubic
b-spline curves to machine-tool control. J Intell Robot Syst 1991;4.
[2] Bedi S, Ali I, Quan N. Advanced interpolation techniques for n.c.
machines. J Engng Ind 1993;115.
[3] Bedi S, Quan N. Spline interpolation technique for nc machines.
Comput Ind 1992;18.
[4] Chou JJ, Yang DCH. Command generation for three-axis cnc
machines. ASME J Engng Ind 1991;113.
[5] Chou JJ, Yang DCH. On the command generation of coordinated
motion of five-axis cnc/cmm machines. ASME J Engng Ind
1992;114.
[6] Gabor Erdos, A new symbolic approach for the geometric, kinematic
and dynamic modeling of industrial robots (in hungarian). PhD
Thesis, Technical University of Budapest; 2000.
[7] Erkorkmaz K, Altintas Y. High speed cnc system design. Part i: jerk
limited trajectory generation and quintic spline interpolation. Int J
Mach Tools Manuf 2001;41.
[8] Farin G. Curves and surfaces for CAGD. London: Acadamic Press;
1996.
[9] Farouki RT, Shah S. Real-time cnc interpolators for pythagorean
hodograph curves. Comput Aided Geom Des 1996;.
[10] Farouki RT, Manjunathaiah J, Nicholas D, Yuan G-F, Jee S.
Variable-feedrate cnc interpolators for constant material removal
rates along pythagorean–hodograph curves. Comput-Aided Des
1999;30(8).
[11] 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;.
[12] Farouki RT, Neff CA. Hermite interpolation by pythagorean
hodograph quintics. Math Comput 1995;.
[13] Farouki RT, Sakkalis T. Pythagorean hodographs. IBM J Res Dev
1990;.
[14] Farouki RT, Sakkalis T. pythagorean–hodograph space curves. Adv
Comput Math 1994;.
[15] Farouki RT, Tsai YF, Wilson CS. Physical constrains on feedrates and
feed acceleration along curved tool paths. Comput Aided Geom Des
2000;17.
[16] Farouki RT, Tsai YF, Yuan G-F. Contour machining of free-form
surfaces with real-time ph curve cnc interpolators. Comput Aided
Geom Des 1999;.
[17] Fleisig RV, Spence AD. A constant feed and reduced angular
acceleration interpolation algorithm for multi-axis machining.
Comput-Aided Des 2001;33.
[18] Halperin D. Automatic kinematic modelling of robot manipulators
and symbolic generation of their inverse kinematics solution.
In: Stifter S, LenarcWicW J, editors. Advances in robot kinematics,
Wien: Springer; 1991. p. 310–7.
[19] Herrera-Bendezu LG, Mu E, Cain JT. Symbolic computation of robot
manipulator kinematics. Proc IEEE Int Conf Robot Automat 1988;2:
993–8.
[20] Koren Y. Interpolator for a computer numerical control system. IEEE
Trans Comput 1974;25(1).
[21] Koren Y, Lo CC, Shpitalni M. Cnc interpolators: algorithms and
analysis. Manuf Sci Engng 1993;64.
[22] Lartigue C, Thiebaut F, Maekawa T. Cnc tool path in terms of b-spline
curves. Comput-Aided Des 2001;33(3):xxxx.
[23] Matthias Muller, A new approach for trajoctory generation in 5-axis
machining. PhD thesis, Fcole Polytechnique Federal de Lausanne;
2001.
[24] Paul RP. Robot manipulators: mathematics programming and cont-
roll. Cambridge, MA: The MIT press; 1981.
[25] Paul RP, Shimano B, Mayer G. Kinematic control equations for
simple manipulators. IEEE Trans Syst, Man Cybernet 1981;11(6):
449–55.
[26] Qiu H, Cheng K, Li Y. Optimal circular arc interpolation for nc tool
path generation in curve contour manufacturing. Comput-Aided Des
1997;29(11).
[27] Riesler H, Schrake H, Wahl FM. Symbolic computation of closed
form solution with prototype equations. In: Stifter S, LenarcWicW J,
editors. Advances in robot kinematics. Wien: Springer; 1991.
p. 343–51.
[28] Riesler H, Wahl F. Fast symbolic computation of the inverse
kinematics of robots. In: Proceedings of IEEE International
Conference on Robotics and Automation, Cincinatti, vol. 1.; 1990.
p. 462–67.
[29] Sarma R, Rao A. Discretizors and interpolators for five-axis cnc
machines. Proceedings of the ASME Dynamic Systems and Control
Division, 64; 1998.
[30] Shpitalni M, Koren Y, Lo CC. Realtime curve interpolators. Comput-
Aided Des 1994;26(11):ccccc.
[31] Wang FC, Wright PK. Open architecture controllers for machine
tools, part 2: a real time quintic spline interpolator. J Manuf Sci Engng
1998;120.
[32] Wang FC, Yang DCH. Nearly arc-length parametrized quintic-spline
interpolation for precision machining. Comput-Aided Des 1993;
25(5).
[33] Yang CH, Kong T. Parametric interpolator versus linear
interpolator for precision cnc machining. Comput-Aided Des
1994;26(3).
[34] Yang DCH, Chou JJ. Automatic generation of piecewise constant
speed motion with smooth transition for multi-axis machines. J Mech
Des 1994;116.
[35] Yeh SS, Hsu PL. The speed-controlled interpolator for machining
parametric curves. Comput-Aided Des 1999;31.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–13931392
Matthias Muller was born in Germany in
1974. In 1997, he recieved a diploma in
mechanical engineering from the Technical
University of Braunschweig, Germany. In
1992 he finished his PhD thesis at the
CAD/CAM Laboratory of the Swiss Fed-
eral Institute of Technology at Lausanne,
Switzerland. Currently he is working as
project manager at the SmartKinematics
Company. In his current position he is
responsible for software development pro-
jects is the area of CAD/CAM.
Professor Paul Xirouchakis is directing
the computer-aided design and computer-
aided manufacturing (CAD/CAM) labora-
tory, institute of production and robotics at
the Swiss Federal Institute of Technology
in Lausanne, Switzerland. His research
interests are in the areas of (i) product
modeling and reasoning for manufacture/
assembly/remanufacture (ii) manufacturing
information systems and (iii) informatics
for planning and scheduling for manufac-
ture/assembly/remanufacture. Current project activities include: CAD
tools for conceptual design of mechanical assemblies, geometrically
intelligent NC-controllers built on feature-based post-processors and
planning and scheduling of remanufacturing systems. Professor Xirou-
chakis has industrial experience with CAD industries in the USA where he
directed computer-aided simulation-based design projects. He has been a
professor at the National Technical University of Athens and the
Massachusetts Institute of Technology in the area of Structural
Mechanics. He obtained his Ph.D. in Structural Mechanics in 1978
from Massachusetts Institute of Technology.
Gabor Erdos is a Senior Research
Associate at the Computer and Automation
Research Institute. He received his MS and
PhD degrees in mechanical engineering
from Budapest University of Technology
and Economics. He also holds an MS
degree in mechanical and aerospace engin-
eering from SUNY Buffalo. Dr Gabor
Erdos was a post-doc assistant for five
years at Institute of Production and
Robotics at EPF Lausanne. His main
research interests include computer aided mechanism modeling, data
exchange between CAD-CAM-CNC and machining simulation.
M. Muller et al. / Computer-Aided Design 36 (2004) 1379–1393 1393