Top Banner
Computer-Aided Design 42 (2010) 231–237 Contents lists available at ScienceDirect Computer-Aided Design journal homepage: www.elsevier.com/locate/cad Machine models and tool motions for simulating five-axis machining Stephen Mann a,* , Sanjeev Bedi b,1 , Gilad Israeli a , Xiaoran (Linda) Zhou a a University of Waterloo, David R. Cheriton School of Computer Science, Waterloo, Ontario, Canada N2L 3G1 b University of Waterloo, Department of Mechanical Engineering, Waterloo, Ontario, Canada N2L 3G1 article info Article history: Received 5 June 2009 Accepted 23 November 2009 Keywords: Five-axis machining Simulation Kinematic chains abstract This paper presents a method of determining the tool motion of a five-axis machine. The method is motivated by the imprint point method, where points on the machined surface are computed based on the tool position and tool motion. While simple linear motion can be used as a coarse approximation to this motion, this paper looks at more accurate models of tool motion based on machine kinematics that can be generalized and applied to any CNC machine with one tool head. A kinematic chain is created by decomposing the linear motion of a machine’s translational and rotational axes into parameterized affine transformations, and a hierarchical model of the machine combines the transformations to provide an accurate model of machine motion. © 2009 Elsevier Ltd. All rights reserved. 1. Introduction Automation of the manufacturing process from the nominal part geometry on a CAD system to the final machined part offers the opportunity for huge gains in productivity and cost savings. The advent of five-axis machining and methods for generating NC tool paths has already offered the opportunity to reduce machining time by up to 85% [1]. However, this added flexibility also brings added complexity. Research efforts have concentrated on generating interference-free NC tool paths that also produce machined parts free from excessive gouging or under-cutting. Central to these ideas is the generation of the swept volume of the tool along its programmed NC tool path, and the ideas of the simulation, verification and correction of NC tool path programs [2]. Errors can be introduced in the process of going from the design surface to the machined part; in particular, the surface is converted from a smooth mathematical surface into discrete tool positions by CAD/CAM software, and this subdivision into tool positions introduces error [3]. However, to verify that the final toolpath will result in a machined surface that accurately represents the mathematical surface, one does not need to consider the sources of these errors. Instead, one can machine the surface and measure it with a coordinate measuring machine (CMM). Since machining and measuring are expensive processes, one would prefer to simulate the machining actions, and measure the error in the computer-generated machined surface. Clearly, this requires * Corresponding author. Tel.: +1 519 888 4567; fax: +1 519 885 1208. E-mail addresses: [email protected] (S. Mann), [email protected] (S. Bedi), [email protected] (G. Israeli), [email protected] (X. Zhou). 1 Tel.: +1 519 888 4567; fax: +1 519 888 6197. that the computer-generated surface be an accurate representation of what would actually be machined. Thus, for verification, there are three surfaces to be considered. First, there is the surface that one wishes to machine, for which there is usually a mathematical model. Second, there is the surface actually produced by the physical machine, which can be measured with CMMs or other devices. And third, there is the computer- generated simulated surface, which can be used before machining to determine if there is gouging, etc., and to give some confidence in the final result. Some care must be taken in generating the simulated surface, since while it is possible to simulate a tool that moves along perfect mathematical tool paths, what is desired is a simulation that accurately reflects the surface that will be physically machined. Since the machine is limited in the tool motions it can execute, care must be taken to ensure that the simulation matches the mechanics of the actual machine. To simulate the surface being machined, we need to compute the surface swept by the tool. To compute the swept surface, one must be able to determine curves on the tool whose imprint will be left on the stock as the tool moves. A grazing point is a point on the surface of the tool whose direction of motion is perpendicular to the surface normal at that point. For machining, these points are significant, because at any other point on the tool surface, the stock either will have already been machined away or will be machined away in the next instance in time (Fig. 1). For any tool position, the grazing points on the tool are the only ones that might also remain as points on the machined stock. As one example of where the direction of motion is used when computing a swept surface, consider a moving cylinder of radius R. For a point P on the axis of a cylinder, if P has a direction of motion d, then we can compute two grazing points on the cylinder by first 0010-4485/$ – see front matter © 2009 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2009.11.005
7

Machine models and tool motions for simulating five-axis machining

Jan 27, 2023

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Machine models and tool motions for simulating five-axis machining

Computer-Aided Design 42 (2010) 231–237

Contents lists available at ScienceDirect

Computer-Aided Design

journal homepage: www.elsevier.com/locate/cad

Machine models and tool motions for simulating five-axis machiningStephen Mann a,∗, Sanjeev Bedi b,1, Gilad Israeli a, Xiaoran (Linda) Zhou aa University of Waterloo, David R. Cheriton School of Computer Science, Waterloo, Ontario, Canada N2L 3G1b University of Waterloo, Department of Mechanical Engineering, Waterloo, Ontario, Canada N2L 3G1

a r t i c l e i n f o

Article history:Received 5 June 2009Accepted 23 November 2009

Keywords:Five-axis machiningSimulationKinematic chains

a b s t r a c t

This paper presents a method of determining the tool motion of a five-axis machine. The method ismotivated by the imprint point method, where points on the machined surface are computed based onthe tool position and tool motion. While simple linear motion can be used as a coarse approximation tothis motion, this paper looks at more accurate models of tool motion based on machine kinematics thatcan be generalized and applied to any CNC machine with one tool head. A kinematic chain is created bydecomposing the linear motion of a machine’s translational and rotational axes into parameterized affinetransformations, and a hierarchical model of the machine combines the transformations to provide anaccurate model of machine motion.

© 2009 Elsevier Ltd. All rights reserved.

1. Introduction

Automation of the manufacturing process from the nominalpart geometry on a CAD system to the final machined part offersthe opportunity for huge gains in productivity and cost savings.The advent of five-axis machining and methods for generatingNC tool paths has already offered the opportunity to reducemachining time by up to 85% [1]. However, this added flexibilityalso brings added complexity. Research efforts have concentratedon generating interference-free NC tool paths that also producemachined parts free from excessive gouging or under-cutting.Central to these ideas is the generation of the swept volumeof the tool along its programmed NC tool path, and the ideasof the simulation, verification and correction of NC tool pathprograms [2].Errors can be introduced in the process of going from the

design surface to the machined part; in particular, the surfaceis converted from a smooth mathematical surface into discretetool positions by CAD/CAM software, and this subdivision intotool positions introduces error [3]. However, to verify that thefinal toolpath will result in a machined surface that accuratelyrepresents themathematical surface, onedoes not need to considerthe sources of these errors. Instead, one can machine the surfaceandmeasure itwith a coordinatemeasuringmachine (CMM). Sincemachining and measuring are expensive processes, one wouldprefer to simulate the machining actions, and measure the errorin the computer-generatedmachined surface. Clearly, this requires

∗ Corresponding author. Tel.: +1 519 888 4567; fax: +1 519 885 1208.E-mail addresses: [email protected] (S. Mann), [email protected]

(S. Bedi), [email protected] (G. Israeli), [email protected] (X. Zhou).1 Tel.: +1 519 888 4567; fax: +1 519 888 6197.

0010-4485/$ – see front matter© 2009 Elsevier Ltd. All rights reserved.doi:10.1016/j.cad.2009.11.005

that the computer-generated surface be an accurate representationof what would actually be machined.Thus, for verification, there are three surfaces to be considered.

First, there is the surface that one wishes to machine, for whichthere is usually a mathematical model. Second, there is the surfaceactually produced by the physicalmachine,which can bemeasuredwith CMMs or other devices. And third, there is the computer-generated simulated surface, which can be used before machiningto determine if there is gouging, etc., and to give some confidencein the final result. Some care must be taken in generating thesimulated surface, since while it is possible to simulate a toolthat moves along perfect mathematical tool paths, what is desiredis a simulation that accurately reflects the surface that will bephysically machined. Since the machine is limited in the toolmotions it can execute, care must be taken to ensure that thesimulation matches the mechanics of the actual machine.To simulate the surface being machined, we need to compute

the surface swept by the tool. To compute the swept surface, onemust be able to determine curves on the tool whose imprint willbe left on the stock as the tool moves. A grazing point is a point onthe surface of the tool whose direction of motion is perpendicularto the surface normal at that point. For machining, these points aresignificant, because at any other point on the tool surface, the stockeither will have already been machined away or will be machinedaway in the next instance in time (Fig. 1). For any tool position, thegrazing points on the tool are the only ones that might also remainas points on the machined stock.As one example of where the direction of motion is used when

computing a swept surface, consider a moving cylinder of radius R.For a point P on the axis of a cylinder, if P has a direction of motiond, then we can compute two grazing points on the cylinder by first

Page 2: Machine models and tool motions for simulating five-axis machining

232 S. Mann et al. / Computer-Aided Design 42 (2010) 231–237

Fig. 1. Points on the tool surface on the direction of motion side of the grazingcurve are about to be machined away; points on other side of the grazing curvehave already been machined away.

computing

v = Rd× a|d× a|

, (1)

where a is the direction of the cylinder’s axis. Then P ± v are twograzing points on the cylinder. By varying P along the cylinder’saxis, we can compute two grazing curves on the cylinder. Forfurther details on this computation and for its generalization toarbitrary surfaces of revolution, see [4,5].

As a second example where the direction of motion is neededwhen computing the swept surface, consider the sweep-envelopedifferential equation (SEDE) method [6]. With the SEDE method,the positions and directions of motions of grazing points are usedto compute the path of the swept grazing points. These are thenextended to the swept surface. Thus, the SEDE method also needsthe direction of motion of points on the tool surface.In earlier papers [4,5], we gave a method to generate the

surface swept by a moving tool in five-axis machining. However,both of those five-axis machining papers assumed a piecewiselinear motion of the tool, with rotations occurring around thetool tip. Such an approximation can at times be grossly wrong.For example, consider the two consecutive tool positions shownon the top left in Fig. 2. In the linear approximation method, thetwo vectors Eti and Eti+1 are blended to create intermediate toolpositions. The actual motion may be very different for some toolpositions on some machines, since the machine parameters arelinearly interpolated between the tool positions. For example, ona rotary table machine (Fig. 3, right), the movement from Eti toEti+1 may cause the tool/workpiece to rotate by an angle θ . Duringthis rotation, the tool may go over unplanned areas and may leavedeep gouges. The difference in cuts between the two motions isillustrated on the bottom of Fig. 2.This type of problem (where themachinemotion differs greatly

from pure linear motion) occurs for example when machining acrest or valley on a curved surface, and is encountered frequentlyin machining of automotive dies. Essentially, these problems

Fig. 2. An apparently simple linear motion of a tool (top left, a side view) may be executed as a rotation on some machines (top right, a top view). On the bottom: thedifference in cuts between the two motions.

RC

RCRA

RA

RA

RB

Z Z Z

X X

X

Y YY

Fig. 3. Left: Table spindle. Middle: Titling table. Right: Tilt/rotary. The ‘+’s indicate the positive direction of motion.

Page 3: Machine models and tool motions for simulating five-axis machining

S. Mann et al. / Computer-Aided Design 42 (2010) 231–237 233

occur around singular points in a particular machine. While goodtoolpath planning and CAM software avoid such tool positions, itis key that a CNC simulator render a machine’s motions (whetherdetermined by CAM software or done manually) correctly,allowing themachinist to spot such errors and correct them beforemachining. In particular, rather than simulating from neutraltoolpath CLdata, simulations should be created from machine-configuration-dependent toolpath data (typically produced by aCAM post-processor). Further, rather than linearly interpolatingthe tool positions of this machine-dependent data, the kinematicsof the machine must be considered in the simulation.In this paper, we show how to create a hierarchical model of

a machine, where each interior node in the hierarchy is a lineartransformation that models some aspect of the machine, and theleaf nodes are solid geometric primitives that represent physicalparts of the machine. Most of these linear transformations arestatic; only the ones representing themachinemotion are variable.By analyzing this hierarchy, we are able to derive an accuratedirection of motion of any point on the tool at any position in thetool path. These formulas may be applied directly to the imprintmethod of the earlier papers to producemore accurate simulationsof the machined surfaces.

1.1. Related work

Other researchers have considered the effects of making apiecewise linear approximation to machine motion. Bohez [7], forexample, analyzes the error introduced by such an approximation,and derivesmatrix equations similar to ours to describe the correctmotion. He uses his results to analyze the error, while the methodwe describe in this paper is used to find the tool motion.Bedi et al. [8] also use transformation matrices for five-axis

machining. In their work, they use these transformations to alignthe tool axis to match curvature constraints, but do not use themto compute motions.Roth et al. [9] have used transformation matrices to trace the

movement of tool cutting tips and to access volume of materialremoved for calculations in five-axis machining. Although theyhave used transformation matrices, their focus has been on forcecalculations.Tutunea-Fatan and Feng [10] created kinematic models of five-

axis machines. Such chains are an application of the kinematicchain method used in robotics (see, for example, [11]) andelsewhere in NC machining [12,13]. Our models of the machinesare essentially the same as thesemodels; in this paper,we computethe tool motion by computing the derivatives of the machinemotions based on these kinematic models (Sections 3 and 4), andwe show how to construct these kinematic models in a systematicway using hierarchical modeling (Section 4).While previous work has presented similar methods for com-

puting kinematic chains, our use of such method for simulation ofCNC machining is new. In the simulation field, researchers haveignored the machine kinematics in light of simpler and easier sim-ulationmethods. This oversight has poor consequences and the so-lution to these problems is rather simple.

2. Computing the tool motion

The various machine simulation methods mentioned in theprevious section require knowing the direction ofmotion points onthe tool. For example, to compute grazing points using themethodof [5], one needs to know the direction of motion of each pointof the tool axis. An earlier paper [5] assumed simple piecewiselinear motion of the tool, and numerically computed the directionof motion by subtracting corresponding points on the tool axis atconsecutive in-between tool positions. Such a motion should givea reasonable approximation to the tool motion, but if details aboutthe machine mechanics are known, then we can compute a more

accurate tool motion. In this section and the next two sections wewill derive such formulas.Note that our interest is in computing the direction of motion

of the tool relative to the machined part. Thus, while a machinemayphysically move the stock, we need to compute the motion as ifthe stock were stationary and the tool were moving relative to thestock.This leads to the three key ideas. The first idea is to

determine the appropriate coordinate frame in which to expressthe equations. Such formulas are usually simplified by placing theorigin at the center of the intersection of the two axes of rotation.This step requires conversion between coordinate frames, a topicdiscussed in any introductory computer graphics text book [14].The second key idea is to decompose the tool motion into

products of parameterized affine transformation matrices. Thissimplifies the equations, and makes taking the derivative simpler.The third key idea is to model the machine as a hierarchical

model [14], which allows us to make accurate models of realmachines. Further, we can render this model on a computer usingstandard techniques from computer graphics, allowing us to createa computer animation of the simulation of the machine as it millsthe stock.In this section, we give the matrices used to compute the

direction of motion; in the next section, we illustrate the first andsecond ideas above on three machine models; the third idea onhierarchical modeling is presented in Section 4. Throughout, wewill assume that the spindle rate is much higher than the feed rate,and that we may treat the tool as a surface of revolution.

2.1. Transformation matrices

Three-dimensional (3D) transformation matrices for transla-tion, rotation, and scale are well known. In addition to these ma-trices, we will use parameterized versions of the translation androtation matrices. Thus, rather than have constant entries in thematrices, we will linearly blend the positions and angles of thesematrices.Wewill use the following parameterizedmatrices (in ad-dition to the standard non-parameterized matrices for translation,rotation, and scale):

Txyz(t) =

1 0 0 (1− t)x0 + tx10 1 0 (1− t)y0 + ty10 0 1 (1− t)z0 + tz10 0 0 1

,

RA(t) =

1 0 0 00 cos((1− t)A0 + tA1) − sin((1− t)A0 + tA1) 00 sin((1− t)A0 + tA1) cos((1− t)A0 + tA1) 00 0 0 1

,

RC (t) =

cos((1− t)C0 + tC1) sin((1− t)C0 + tC1) 0 0− sin((1− t)C0 + tC1) cos((1− t)C0 + tC1) 0 0

0 0 1 00 0 0 1

.Often,wewill omit the parameter t , writingRxyz forRxyz(t). Further,at times we will separate the parameterized translation matrixinto multiple matrices; the subscript to T will indicate whichcoordinate is being parameterized. For example, Tx denotes thematrix

Tx =

1 0 0 (1− t)x0 + tx10 1 0 00 0 1 00 0 0 1

.The above equations assume precise, uniform linear motion

of the machine. In a real machine, this motion is non-lineardue to acceleration, deceleration, and other machining effects.This non-linearity is in the parameterization of the tool motion:the geometry of the motion is still linear. For the purposes

Page 4: Machine models and tool motions for simulating five-axis machining

234 S. Mann et al. / Computer-Aided Design 42 (2010) 231–237

T ′xyz =

0 0 0 −x0 + x10 0 0 −y0 + y10 0 0 −z0 + z10 0 0 0

R′A =

0 0 0 00 −(A1 − A0) sin((1− t)A0 + tA1) −(A1 − A0) cos((1− t)A0 + tA1) 00 (A1 − A0) cos((1− t)A0 + tA1) −(A1 − A0) sin((1− t)A0 + tA1) 00 0 0 0

R′C =

−(C1 − C0) sin((1− t)C0 + tC1) (C1 − C0) cos((1− t)C0 + tC1) 0 0−(C1 − C0) cos((1− t)C0 + tC1) −(C1 − C0) sin((1− t)C0 + tC1) 0 0

0 0 0 00 0 0 0

Box I.

of simulating the machined surface, we are interested in thegeometric motion of the tool, and not in the exact parametricmotion. Thus, for the purposes of computing the surface that getsmachined, we may treat the motion as linear.In addition to the parameterized matrices, we will need the

derivatives of the matrices, which are given in Box I.The derivatives presented in Box I are the key to a generalized

method for finding an accurate direction of motion of thetool relative to the stock for any machine configuration. Somecommonly used configurations are discussed in the next section,and a general method for any machine is described in Section 4.

3. Modeling and motion

Our goal is to find a representation of the transformation fromthe tool to the stock. In its simplest form, this means constructinga kinematic chain of a machine to determine how its mechanicsaffect the relative motion of the tool relative to the stock. Whilewe want to know the position and motion of a grazing point in acoordinate frame that is based on the stock, it is easiest to generatethe grazing curves in a tool-based coordinate frame. Thus, theequations of motion typically will also perform a change of basisfrom the tool coordinate frame into the stock coordinate frame inaddition to specifying the motion itself.Most of this analysis can be done by manually inspecting

the machine. While kinematic chains are well studied for NCmachining, we give an example showing the construction ofa kinematic chain to better illustrate the process. We alsogive formulas for the kinematic chains of two other machineconfigurations to show how different the chains are for differentmachines. The analysis is a bit simplistic, as it does not concernitself with details of the physical proportions of the machine andstock. Those details are more readily handled with a hierarchicalmodel, which we discuss in Section 4.As a first example, consider a table spindle machine, illustrated

in Fig. 3, left. In this model, the rotated tool axis does not alignwith the z-axis. While we could derive equations of motion inthe world coordinate frame, instead we proceed in the mannerof Tutunea-Fatan and Feng [10,15] and simplify the equations byconstructing a local coordinate frame with the origin at the pivotpoint (i.e., the intersection the two axes of rotation in the figure),with the unrotated tool extending in the negative z-direction. Thelocation of the tool expressed in the local frame is

M = T−1xy TzRCRA, (2)

where RA and RC are as described above. The transformation T−1xy isthe xy-translational movement, but note that we use the inverse(negative) of the X and Y translational motions of the machine,since that is how the tool appears to move relative to a fixed point

on the stock (in general, we use the inverse of a transformationthat affects the stock). The Tz matrix is the standard (not inverted)parameterized z-translation matrix.Note that M transforms points on the unrotated tool, in a

coordinate frame whose origin is at the pivot point, into pointson the rotated/translated tool relative to a coordinate system thatis fixed relative to the stock. Details about the stock, such as itsprecise location relative to the unrotated/untranslated tool, wouldstill need to be specified, and it may prove convenient to introducean additional change of basis to a coordinate system that providesa more convenient initial relative location of the stock to the tool,although we will not do that in this section.In the following,wewill conceptually think of the stock as being

fixed and the tool both rotating and translating; although that isnot what happens on the physical machine, it is a convenient wayto determine tool motion relative to the stock.We can compute the direction of motion of each point of the

tool relative to the stock by taking the derivative of Eq. (2):

M ′ = T−1xy′TzRzRx + T−1xy T

zRzRx + T−1xy TzR

zRx + T−1xy TzRzR

x. (3)

Starting with a point P on the unrotated/untranslated tool,applying M ′ to P gives the direction of motion of P relative to afixed stock. Each constituent matrix of Eq. (3) is calculated fromthe matrices given in Section 2.1.To use these equations to compute the grazing points on a

cylindrical tool at a particular point t in time, we sample the axisof the unrotated tool, and at each axis location, multiply byM(t) toget the position Q of the rotated tool relative to the stock (call thisQ̄ ). We then apply M ′ of Eq. (3) to P to determine its direction ofmotion d. Both Q̄ and d are specified relative to the fixed stock. Wecan now use Q̄ and d to compute the grazing points as describedearlier.The tilting table machine is a more problematic tool for which

to derive equations of motions. With this tool, the machined pieceitself rotates and the tool experiences no rotational movement.However, for computing the machined surface, it is best toconstruct a coordinate system on the part to be machined or ata point that is fixed relative to the machine stock, since it isthe motion of the tool relative to the machined piece that is ofinterest. Additional complications arise from needing to invert therotations and some of the translations, since we want the toolmotion relative to the stock. After accounting for these issues, theresulting transformationM is

M = R−1A R−1C T−1xy Tz . (4)

To compute the direction of motion of points on the tool axis,we may assume that the tool starts with its tip at the origin, andtransform the sample points (0, 0, z) for the values of z in whichwe are interested:

[X Y Z 1]t = M[0 0 z 1]t . (5)

Page 5: Machine models and tool motions for simulating five-axis machining

S. Mann et al. / Computer-Aided Design 42 (2010) 231–237 235

Fig. 4. Hierarchical model for a table spindle machine.

Fig. 5. Table spindle machine model.

MultiplyingM−1 and [X Y Z 1]t gives us the location of points onthe tool axis; taking the derivative of M gives us the direction ofmotion of points on the tool axis.A third type of machine is the tilt/rotary five-axis machine

illustrated in Fig. 3, right. While mechanically different from thetilting table machine, the transformations of a tilt/rotary five-axismachine are similar to those of the titling table machine. We canuse the transformation

M = R−1C R−1A T−1y Txz (6)

for the transformation, withM ′ giving us the direction ofmotion ofpoints on the tool (with the motion described relative to the stockframe).There are two things to observe. The first is that the equations

for these three machines (2), (4) and (6) differ significantly.Likewise, the derivatives of these equations will also differ,necessitating a separatemachinemodel for eachmachine to obtainaccurate motion vectors.The second thing to observe is that creating the machine model

as done in this section is a non-trivial task, one that was somewhatad hoc based on the configuration of a particular machine. In thenext section, we present a more systematic approach to creatingthe equation of motion for a machine, as well as computing thederivatives of this equation.

4. Hierarchical modeling

In general, we would like a systematic method to model thetool motion for any machine, and we want exact measurementsof distances in the machine to be part of the model. The simplemodels described in the previous section are too simplistic tomodel these details easily. Further, for simulations that display themachine,wewould like to take themachinemodel used for displayand extract from it the information needed to determine the toolmotion. To achieve this, we borrow the concept of hierarchicalmodeling fromcomputer graphics, and incorporate it to bothmodelthe machine and determine the tool motion.In hierarchical modeling, we model objects out of primitives

such as cubes and cylinders. The primitives can be translated,scaled, and rotated. To facilitate the modeling, we build ahierarchical model in a tree structure, with the primitives as theleaf nodes of the tree and the transformations as the internal nodesof the tree. We build our model from the leaf nodes upward, withthe internal transformation at a node specifying how to locate thesubtree below it relative to its siblings. At the top node, we haveour model relative to a standard world coordinate system. Thecomposition of the transformations along the path from the rootto the leaf is the transformation to apply to the primitive at thatleaf to transform it into the world coordinate system.In Fig. 4 is the hierarchical model for a table spindle

machine (Fig. 5). The leaf nodes are cubes, cylinders, the stock, orthe tool. Internal nodes are labeled with their transformation; ‘T’is translation, ‘S’ is scale, and ‘R’ is rotation. The translation androtation nodes that represent the moving parts of the machine arelabeled with the axis of motion (e.g., ‘Tx’ and ‘Ra’). The model inthis figure was created for illustrative purposes; in the model fora real machine, the translation and scale details would need to bemeasured from the machine being modeled.To draw the machine, we do a depth-first traversal of the tree,

composing the transformations as we go down the hierarchy.Before drawing the primitive at a leaf node, we apply thecomposition of the transformations along the path from the rootto the leaf node to the primitive.To determine the tool motion, recall that we are interested in

the motion of the tool relative to the stock. This motion is given bythe composition of the transformations lying on the path throughthe tree from the stock to the root and from the root to the tool.However, we invert the transformations on the path from the rootto the stock, since, as specified, the transformations take us fromthe stock upward to the root. For example, for the tree in Fig. 4, themotion of the tool relative to the stock (the bold path in Fig. 4) isgiven by the matrix

M = T−10 T−1xy TzT1T2RCT6RAT7. (7)

Page 6: Machine models and tool motions for simulating five-axis machining

236 S. Mann et al. / Computer-Aided Design 42 (2010) 231–237

a b c

Fig. 6. (a), (b) Two views of a comparison between grazing curves created with approximate and our motion vectors; (c) comparison of direction of motion of the centerand a point on the grazing curve.

Table 1Torus maximum error (mm): Comparison of our motion method to the point difference motion method. Density refers to number of height values per mm in each lineardirection.

Density1 2 4 8 16 32 64

Our motion 0.295 0.154 0.0808 0.0426 0.0210 0.0109 0.00533Difference method 0.345 0.170 0.107 0.0517 0.0378 0.0128 0.00719Ratio 0.85 0.90 0.76 0.82 0.55 0.85 0.74

To compute the tool motion, we compute the derivative withrespect to t of the matrix M of Eq. (7). Only the matrices Txy, Tz ,RC and RA are varying with respect to t , and soM ′ is given by

M ′ = T−1T−1′

xy TzTTRCTRAT + T−1T−1xy T

zTTRCTRAT

+ T−1T−1xy TzTTR′

CTRAT + T−1T−1xy TzTTRCTR

AT .

While this equation may look complicated, in a computerimplementation it never gets explicitly expanded. Instead, thematrix products are computedduring a traversal of the hierarchicalmachine model.Using this method, we would start with a point p on the tool

axis or on the tool surface, expressed in a coordinate frame relativeto the tool. The application ofM ′ to pwill produce a motion vectorthat is expressed relative to the coordinate frame of the stock. Sincewe will likely also want the coordinate of p relative to the stockframe, we will also need to apply matrixM of Eq. (7) to p.

5. Simulations and discussion

To demonstrate these ideas, we integrated our tool motioncode in an in-house NC machining simulator and comparedapproximated motion vectors to our mathematically exact motionvectors for a tilt/rotary five-axis machine, and looked at thedifferences when the two methods were used to compute grazingcurves.Fig. 6(a) shows a comparison of the grazing curves computed by

our method (red) and by approximate (green) motion vectors. Thegrazing curves are computed by using a motion vector at a pointon the tool axis to compute a grazing curve on the tool surface.In this example, we see that the differences are quite large. Notethat while our direction ofmotionmay differ significantly from theapproximate direction of motion, the difference in the resultinggrazing curves may vary little (as in the example); the amountof variation will depend on the particular tool path. Further, notethat this was an extreme example (i.e., with large rotation anglesbetween the two adjacent tool positions), and in more typicalusage, the difference between the direction of motions computedusing the two methods is not as big.

Sometimes, we need the direction of motion of a point on thegrazing curve itself. When using piecewise linear approximationsto motion, for all points whose motion we are interested in, wemust store their location at one step in time to reuse at the nextstep in time to approximate the direction of motion. Using themethod described in this paper, we can avoid storing the positionsat multiple steps in time (at least for computing the direction ofmotion of these points).For comparison, another alternative to our method would be

the following: when computing grazing points P ± v as describedin Section 1, we could use d of Eq. (1) as an approximation for theirdirection ofmotion (i.e., we could use the direction ofmotion of thepoint on the tool axis). In Fig. 6(b), we compare using our motionvector of the point on the tool axis to using ourmotion vector of thepoint on the grazing curve. While the former is less expensive tocompute, these vectors are significantly different, and the motionof the point on the tool axis is a poor approximation of the motionof the grazing point itself.We also simulated the motion of table spindle machine with

a spherical tool using a fixed, non-zero RA rotation, and a 360◦motion of the RC axis. The spherical tool was placed halfway inthe stock, so that after the rotation, part of a torus should be cutfrom the stock (Fig. 7). We then ran simulations using both theapproximate motion directions and our motion directions. Table 1shows some of these results. In this table, we also computed theratio of the maximum error for each method on correspondingstock size; a ratio less than one means that our direction ofmotion is more accurate. As we can see in the table, our motionmethod produces improvements in accuracy between 10% and50%. Additional data and details of this experiment can be foundin [16].The improvement for actual machining would depend highly

on the toolpath. These tests only measured the error on thecontinuous area of the surface. In the discontinuous area the errorsfrom the discontinuity dominated and there was no differencebetween the accurate and approximate direction of motion.In our own work, we have made accurate models of several

machines, including a commercial rotary five-axis machine and

Page 7: Machine models and tool motions for simulating five-axis machining

S. Mann et al. / Computer-Aided Design 42 (2010) 231–237 237

Fig. 7. Torus cut by a spherical tool.

three machines of our own design: a milling lathe, a three-axismachine, and a wrist-style five-axis machine. In all cases, themachine model and simulation were accurate to machine andcoordinate-measuring device tolerance (1/10,000 of an inch). Inthe case of the commercial five-axis machine, the simulationsspotted errors in the tool path. And in the models of our custommachines, the simulations helped to spot flaws in themachine andassisted in calibrating the machines.

6. Conclusions

In this paper, we give a simplemethod for computing the direc-tion of motion of an NC tool. The generality of the method allowsus to apply it to many CNC machines using the hierarchical mod-eling approach. Our method uses linear transformation matricesto create a hierarchical model of the machine. The matrices thatrepresent the moving parts of the machine are linearly parameter-ized, allowingus to compute themathematically exact toolmotion.While the composite transformation is non-linear and complex, forthe purposes of computing the tool’s motion, we can decomposethe computation of this motion by traversing the tree and comput-ing the motion during this traversal. Such an approach allows usto essentially compute themotion as the composition of a series oflinear matrices.The advantages of our method are two-fold. First, instead of

a linear approximation to the tool motion, we can compute themathematically exact direction of motion. Second, while code totraverse the hierarchy needs to be written, this code is not toocomplex, and only need be written once. This is far simpler (interms of coding) than using linear approximations to the toolmotion, since multiple sets of grazing points on the tool needto be stored and subtracted, a problem that is difficult becausedetermining correspondence between grazing point betweensuccessive tool positions is non-trivial.

Our model is a mathematical abstraction of a real machine. Inparticular, missing from are model are the notions of deflection,alignment, and vibration, all of which will result in differencesbetween the simulated surface and the machined surface. Withreduced depth of cut, reduced feedrate, and other controllablebenchmarks we can reduce the effect of deflection and vibration.However, the effect of machine kinematics (mechanics) cannot beeliminated or controlled. These effects must be detailed before thetoolpath is executed. The method presented here allows accuratedetermination of tool motion for many machine configurations, amust for any simulator.

7. Role of the funding source

This research was funded in part by the National Sciences andEngineering Research Council of Canada.

References

[1] Sheltami K, Bedi S, Ismail F. Swept volumes of toroidal cutters using generatingcurves. International Journal of Machine Tools and Manufacture 1998;38:855–70.

[2] Jerard RB, Hussaini SZ, Drysdale RL, Schaudt B. Approximate methods forsimulation and verification of numerically controlled machining programs.The Visual Computer 1989;5(6):329–48.

[3] Sarma Radha, Rao Aarthi. Discretizors and interpolators for five-axis CNCmachines. Journal ofManufacturing Science andEngineering 2000;122:191–7.

[4] Roth D, Bedi S, Ismail F, Mann S. Surface swept by a toroidal cutter during 5-axismachining of curved surfaces. Computer-AidedDesign 2001;33(1):57–63.

[5] Mann S, Bedi S. Generalization of the imprint method to general surfaces ofrevolution for NC machining. Computer-Aided Design 2002;34(5):373–8.

[6] Blackmore D, Leu MC, Wang LP. The sweep-envelope differential equationalgorithm and its application to NC machining verification. Computer AidedDesign 1997;29(9):629–37.

[7] Bohez ELJ. Five-axis milling machine tool kinematic chain design and analysis.International Journal of Machine Tools & Manufacture 2002;42(4):505–20.

[8] Bedi S, Gravelle S, Chen YH. Principal curvature alignment techniquefor machining complex surfaces. Journal of Manufacturing Science andEngineering 1997;119(4):756–65.

[9] RothDavid, Ismail Fathy, Bedi Sanjeev.Mechanisticmodelling of 5-axismillingusing an adaptive depth buffer. Computer-Aided Design 2003;35:1287–303.

[10] Remus Tutunea-Fatan O, Feng Hsi-Yung. Configuration analysis of five-axismachine tool using a generic kinematic model. International Journal ofMachine Tools and Manufacture 2004;44:1235–43.

[11] Angeles Jorge. Fundamentals of roboticmechanical systems: Theory,methods,and algorithms. 3rd edition Mechanical engineering series, Springer; 2007.

[12] Stejskal Vladimir, Valasek Michael. Kinematics and dynamics of machinery.Dekker; 1996.

[13] Afzeri, Sujtipto AGE, Muhida R, Konneh M, Darmawan. Remote operationof CNC milling through virtual simulation and remote desktop interface.Proceedings of World Academy of Science, Engineering and Technology 2009;53(May):64–7.

[14] McConnell JewffreyJ. Computer graphics: Theory into practice. Jones andBartlett; 2006.

[15] Remus Tutunea-Fatan O, Feng Hsi-Yung. Determination f geometry-basederrors for interpolated tool paths in five-axis surface machining. JournalManufacturing Science and Engineering 2005;127:60–7.

[16] Israeli Gilad. Software simulation of numerically controlled machining.Master’s thesis. David R. Cheriton School of Computer Science, University ofWaterloo; 2006.