Offsetting surface boundaries and 3-axis gouge-free surface machining

Report 3 Downloads 54 Views
Computer-Aided

TFRWORTH EINEMANN

Design, Vol. 27, No. 12, pp. 915+27, 1995 Copyright Q 1995 Elsevier Science Ltd Printed in Great Britain. All rights reselved 0010-l495/95 $10.00 + 0.00

Offsetting surface boundaries and 3-axis gouge-free surface machining Kai Tang, Charles C Cheng and Yakove Dayan

A key issue in the creation of error-free tool path for numerically controlled (NC) surface machining is gouging (over-cut> prevention. In the case of solid-based machining, where the creation of tool paths across several surfaces in a single pass is imperative, the major sources for gouging are the tangent discontinuity (C’ discontinuity) and the surface gap (Co discontinuity) occurred in the constituent surfaces of the part model. C1 discontinuity is naturally identified in solid modeling as ‘edges’ and ‘vertices’. Co discontinuity occurs, however, in the free edges of surfaces or from errors in surface definition. In this paper, a system based on the offset/upper envelope concept is proposed for solving the Co and C’ discontinuity in 3-axis multi-surface NC machining. Essentially, in addition to offsets of surfaces themselves, offsets are also defined for the boundary curves of these surfaces. By incorporating the upper enveloping operation on the intersection curves between the drive planes and the offsets, it is shown that the resulting tool paths have pleasant features of gouge free, smoothness, and minimal uncut area. In addition, a detailed algorithmic description of the intersection between a drive plane and the offset of surface boundaries is also presented. Keywords: NC machining, gouging, offset, envelope, swept volume

INTRODUCTION Recent advances in computer-aided design (CAD) systems have had a significant impact on many aspects of computer based manufacturing processes. With the latest development of modelling and sculptured surface mathematics, the geometrical and topological information of a part can be completely captured in a CAD system. By integration with the CAD systems, it is thought that an ideal CAM (computer-aided manufac-

Inc., 4251 Plymouth Rd, PO Box 986, Ann Arbor, MI 48106-0986,USA Paper receiwd: 9 Februmy 1994. Retied 20 March 1995

Applicon

turing) system should automatically figure out the necessary machining operations, tool paths, and the optimal manufacturing plan when information about the part, the work piece, the available machine tools, and related manufacturing constraints are given. While this dream of ‘automatic manufacturing’ may be realized in the future, there are, however, many problems remained to be solved at this moment. Among them, a fundamental task is to be able to generate NC tool paths in an efficient and reliable manner across the constituent surfaces of the solids representing the part model. This paper addresses the general issues involving the creation of reliable, i.e. error-free, tool paths. In general, two types of cutting errors may occur in NC tool path generation: over-cut (gouging) or undercut as shown in Figure 1. Among them, undercut is a relatively less difficult problem since it can always be resolved by a smaller cutting tool with extra cutting passes. Gouging is, however, a difficult problem which frequently occurs in the solid-based multiple surface machining environment. In multiple surface machining, gouging is due mostly to two error sources: tangent discontinuity (C’ discontinuity or the more general G’ discontinuity) and surface gap (Co discontinuity). Tangent discontinuity occurs naturally at the junction of the constituent surfaces of a part. The terms ‘edges’ and ‘vertices’ in solid modelling in fact immediately identify the existence of the tangent discontinuity. Figure 2u shows a gouging example of the tangent discontinuity near the transition area of two surfaces. The tool path is generated according to the geometry of surface A and cuts correctly (gouge free) at the end point p as surface A is concerned. However, the same tool position gouges surface B. A surface gap may exist near the free edges of the part surfaces, or can be introduced from errors in surface definitions or numerical approximations. Figure 2b shows an example of gouging from a surface gap where the tool position corresponding to 4, the end of surface A, gouges surface B. Since mid-1980s, there have been several reports on dealing with the gouging problem in multi-surface NC machining. In his attempt to generate tool paths from CSG solid representation, Bobrow’ addressed the tan-

Computer-Aided Design Volume 27 Number 12 December 1995

915

Offsetting surface boundaries and gouge-free machining: K Tang et a/.

tool tool

path part surface

\ v

path I

I

part

overcut

* Figure

1

Overcut

and undercut

in NC machining

gent discontinuity problem. The solution he proposed is based on the APT normal distance approach’. As a result, it inherits the drawbacks of the normal distance calculation: extensive numerical iterations and no guarantee of convergence. In another paper, Choi et al.” discussed the problems of concave and convex interference in compound surface machining, and provide a reliable and efficient solution. Their method is based on the Cartesian NC approach where tool paths are generated by intersecting the surfaces with a series of vertical rays coming from a set of grid points in the x-y plane. A concern about this approach is that the accuracy and efficiency will be rather sensitive to the density (or the spacing) of the grid points. In a similar approach, Duncan and Mair4 approximated the sculptured surfaces of a part model by a set of polyhedral faces. Tool paths are then obtained from the highest intersection points of the tool with these polyhedral faces. Gouging is detected by calculating the distance between the tool centre and these linear faces. Like the approach of Choi et al., it is robust and reliable, but becomes awkard as its data size and computational time degrade rapidly when high resolution of surface approximation is desired. In this paper, a different approach is provided for solving the gouging problem in multi-surface machining. The scheme proposed is based on the offset surface approach and its scope is limited to 34s NC machining. The heart of the scheme is the offsetting of surface boundary curves. Conceptually, the offset of a 3D curve can be regarded as the envelope of the swept volume generated by moving the inverted tool along the curve. By introducing the offset surfaces around the surface boundaries and incoporate them with the upper envelope operation, we are able to show that the resulting tool paths of the offset surface approach are gouge free.

OFFSET OF A SURFACE Offset sugace approach is an attractive method for 3-axis NC tool path generation. It has the distinctive advantages of providing better tool control and planning5. And, unlike the Cartesian’ or polyhedron6 methods, which are based on surface approximation, the offset surface approach generates tool paths directly from the original surface definition. In this approach, a single tool path is generated by intersecting the offset surfaces of the part surfaces with a drive surface. An introduction of this approach for a ball-end cutter is presented by Faux and Pratt 2. In the following, we will focus mainly on its incapability in handling the C’ and Co surface discontinuities.

Definition of offset surfaces Let S = S (u, v) be a C’ continuous surface, p be a point on it, and rp be the tangent plane of S at p. The offset of p, denoted as ofifp), is defined to be the location of the tool control point such that the tool surface contains the point p and the tool is entirely in the half-space of rp defined by the outward normal of S at p. The tool control point can be either the centre point or the tip point of the tool. In our scheme, we choose the tool tip point as the control point, with the intention of conforming to the cutter location (CL) data specification of APT. Figure 3 shows the definition of ofllp) for the three most common types of tools: ball-end, bull-nosed and flat-end. The offset surface off(S) of a surface S is then defined as the collection of all ofXfp)s due to all the points p on S. In general, the offset surface of@) can be represented as of@9 = S(u, U>+ F&b, ZJ),Taxis,Tgeom),

tool position correspondingto q

tool position correspondingto p

=+r=

gouging

wwW (b)

(4 Figure

916

2

(a) Tangent

discontinuity

gouging,

and (b) surface

surface

gap gouging

Computer-Aided Design Volume 27 Number 12 December 1995

Offsetting surface boundaries and gouge-free machining: K Tang et al.

ball-end tool Figure 3

Definition of

bull-nosed tool -

otE(p)for three most common types of tools

where F is a function of the unit surface normal S,, unit tool axis vector. Taxis, and tool shape Ts,,,. In the case of 3-axis machmmg, the tool axis is fixed, and F becomes a function of S, and T,,,, only. In addition, by choosing a particular tool, the dependency on the tool geometry can usually be explicitly expressed in terms of its radius and/or its corner radius, which are constants throughout the machining process. As a result, off@) can be regarded as a function of two parameters u and u under these circumstances. For example, the ofl@) for the three tools shown in Figure 3 are given by the following three expressions: Ball-end tool: off(S) (UT U) = S (U, U>+R X (S,(U, u) -Taxis) Bull-nosed tool:

(UT

V> + r X

(S, (U, U) - Taxis) + CR - ~1

x Snxy(U, v> = (

: if Sn(u, v) and Taxisare not parallel the disc of radius R - r centred at S (u, u) : if S, (u , u) and Taxisare parallel

Flat-end tool: off(S) (24, u) Sk

u)+RXS,&, : if S,(u,

= il

u>

u) and T,, are not parallel

the disc of radius R centred at S(u, u> : if S”(u, u) and Taxisare parallel

where Snxy (u, u) stands for the normalized (unit length) projection of S,,(u, u> on the plane orthogonal

Figure 4

to the Taxis(i.e. the x-y plane, assuming Taxiscoincides with the z-axis). Figure 4 shows a 2D example of of@Xu, u), for a bull-nosed tool. It should be noticed that an offset surface may not always be unique for a pair of (u, u), as revealed by the last two expressions above. This happens only if the surface of the tool contains a flat portion which is parallel to the tangent plane at S(u, u), see Figure 4. This non-uniqueness however causes very puzzling singularity problems when the offset surface is intersected with the drive plane, since numerical iterations (such as the Newton-Raphson method) will never converge at the questioned area. Later we will provide an account of intersection algorithms that deal with the nonuniqueness of an offset surface.

Problems of offset surface approach

o&S) (u, v) ‘S

flat-end tool

Offset surface for a bull-nosed tool

Given a part consisting of multiple surfaces, the offset surface approach for finding the tool path restricted in a drive plane takes two steps: (1) find the intersection curves between the drive plane and individual offset surfaces; and (2) compute the upper envelope of the intersection curves found in (1). Assuming the drive plane to be the X-Z plane, the upper envelope of the intersection curves is defined to be a monotone function z =f(x> such that f(x) is the maximum of all the intersection curves at X. A 2D example of this approach is shown in Figure 5, where a flat-end tool is used. The inherent deficiencies of the offset surface approach are due to the tangent discontinuity and surface gaps existing in the part model. Referring to Figure 6a, which consists of two planar faces S, and S, meeting at an edge E, a gap exists between the two offset surfaces of@,) and ofK@,) which are created with respect to a ball-end tool. If the drive surface, a plane, is perpendicular to E, its intersection with the two offset surfaces would be two straight line segments, and there will be a gap between them as illustrated in Figure 6. As the tool path must be a continuous motion, the gap has to be filled. A simple straight motion will apparently cause the tool to gouge the edge E. Often, an arc of tool radius R is inserted to blend the two broken segments7, as shown in the same figure. This remedy, however, fails if the width of the gap is greater than the tool diameter, which can be easily produced by letting the drive plane be almost parallel with E. More seriously, such an articifical arc motion might still cause the tool to gouge the surface if the tool shape is not spherical and the junction edge is sharp, as demonstrated in Figure 7a.

Computer-Aided Design Volume 27 Number 12 December 1995

917

Offsetting surface boundaries

and gouge-free

machining:

K Tang et al.

icpper-envelope

flT&/

(tool path)

..

0Jfsets of p&t srirfaces

Figure 5

Upper

enveloping

the offset surface

to create

% ‘part srcrfaces

the tool path

Because of these drawbacks of arc filling, an alternative solution, the linear retraction, is often used. In this approach, the tool will be raised to a predetermined safety height to across the gap, as shown by the dotted line in Figure 7b. This will, however, break the smoothness of the tool path and introduce a substantial amount of unnecessary tool motion and uncut area. While the linear retraction may be able to resolve the gap in Figure 6, it is useless in the next problem, which we call the free edge problem because it may occur to any surface with a free edge, i.e. a surface boundary edge which is not shared by any other surfaces. Notice that the free edge problem can be regarded as a variant of the surface gap problem shown in Figure 2b. In the example shown in Figure 8~2, the tool axis is the +z direction and S, and S, are two planar surfaces where S, lies in the x-y plane and S, is above S, but tilted at 15” from the fz axis. The tool is cutting along a drive plane, which is perpendicular to the +y axis and is very close to an edge of S?. The resultant tool path is a line segment without any gap at all. This tool path, however, will gouge S, as shown in Figure 8b. Due to the fact that the parts we are dealing with are all of finite size, the free edge problem will always occur.

OFFSETTING THE BOUNDARY, THE CONCEPT

daries are insufficiently protected by the offset surfaces. Under the normal circumstance that a surface S is C’ continuous and the tool is convex, it is elementary to verify that if the surface of the tool contains a point p on S and the tool does not gouge S, the corresponding tip point of the tool must be in off(p). This protection, however, works only when the surface normal at p is subject to a single interpretation and is uniquely defined. This is true for all the interior points of a surface, but fails on its boundary. In general, for a boundary point p of a surface S there exist an infinite number of tool positions for the tool to contact p while still clearing all other points of S, as illustrated in Figure 9. As a result, the mere oflfp) becomes insufficient in the gouge protection if p is on the boundary. A remedy therefore must be found to resolve this insufficiency. Our solution is to associate the boundary curves of a part surface S with some kind of ‘shielding’ surfaces such that they will protect S from all the possible surface normal interpretations. To begin with, the concept of a guard surjiice is described below first. Let us explicitize the definition of the offset function oflIp) by adding another parameter n, i.e. off(p, n), where n is the unit normal vector of the tangent plane T (refer to Figure 3). Geometrically, off(p, n) defines t6e control point(s) of the tool whose surface contains the point p with n being its normal vector at p. Let S* stand for the unit upper hemisphere centred at the origin, i.e. S2 = {(x, y, z): z 2 0 and x2 +y2 = 1). The guard surface of a point p in the 3D is defined as: grd(p)

A close examination of the problems of the tangent discontinuity in Figure 6 and the free edge in Figure 8 indicates that errors occur only at the boundaries of the surfaces. This is due to the fact that these boun-

= {off(p,

n): n E S’).

Figure IO shows an example

of grd(p) in 2D. The figure reveals, and it is easy to verify that grd(p) is exactly the inverse of the tool with its control point

filling arc

(4 Figure 6 Gaps

918

OII

offset surfaces

Computer-Aided

due to tangent

(b) discontinuity;

(a) two disconnected

Design Volume 27 Number 12 December

1995

offset surfaces,

(b) filling the gap with an arc

Offsetting surface boundaries and gouge-free machining: K Tang et al.

on the both can now be described as follows: (i) compute the offset surfaces of the part surfaces sis (ii> compute the offset otp(C) for every boundary curve of sis (iii) intersect the offsets obtained in 6) and (ii> with the drive plane (iv) compute the upper envelope of the intersection curves from (iii). (a)

(b)

Figure 7 (a) Failure of arc filling due to a non-spherical tool, (b) the alternative linear retraction method

coincident at p * . Now let C be a G1 continuous curve in 3D, the offset of C is defined to be the envelope surface of the set of all the points Igrd(p): p E Cl, i.e.

off(C) = (grd(p): p E C>‘, where the superscript symbol ‘B’ stands for the boundary operation on a 3D point set. Geometrically, the set {grd(p): p E C} is equivalent to the volume obtained via translationally sweeping the inverse tool along C, with the control point of the inverse tool always kept on C. This is a general sweep with C as the seed curve and the inverse tool as the generator. Figure II shows two simple examples for the bull-noted and flat-end tool, where the seed curve C in Figure Ilb lies on a plane orthogonal to the tool axis. Notice that (grd(p): p E Cl’ can be identical to {grd(p): p E C}, as happened in Figure Ilb, in which case {grd(p): p E C) degenerates to a planar surface with zero volume. Based on the definition of grd(p) and gryperties of the boundary surface of a general sweep ’ , it is not hard to verify the following observation: if an instance of the tool touches the curve C but does not contain any point of C in its interior, its control point must be on ofRC>. By incorporating this curve protection with the traditional offset methods described in the previous section, a reliable tool path generation method based

* The inverse of the tool is defined as the image of the tool mirrored against a plane orthogonal to the tool axis.

Figure 12 illustrates how the prescribed approach successfully solves the gouging problem shown in Figure 7a.

ENVELOPING THE BOUNDARY, IMPLEMENTATION

THE

While the guard surface concept offers a correct and general approach for the generation of smooth and gouge-free tool paths, it nevertheless cannot be implemented directly. This is because the swept volume computation {grd(p): p E C) is an integral operation, whose boundary surface usually has self intersections which is in general undefinable by either a parametric or a procedural form, even though the guard surface grd(p) and curve C themselves are parametrically expressed. Our solution is to replace the surface {g&p): p E W’ with three surfaces: g&p,), g&p,), and E(C), where p1 and p2 are the two end points of C, and E(C) is to be defined as the envelope of curve C with respect to the tool. The condition for such a replacement is that: (1) E(C) must be parametrically or procedurally definable, and (2) the upper envelope of grd(pl>, grd(p,), and E(C) must be equal to that of {gdp): p E 0’. The first requirement ensures that E(C) can be at least procedurally evaluated and hence its intersection with a drive plane can be implemented by a computer program. The second requirement guarantees the same gouge protection as provided by {gdp): p E CK Let p be a point on C and rp be the unit tangent vector of C at p. We define the normal semicircle of p, denoted as Jy(p), to be the intersection between the

drive nlane

(a) Figure

@I

8 A gouging path due to a free edge; (a) offset surfaces and tool path, (b) side view of (a) with exaggerated tool Computer-Aided Design Volume 27 Number 12 December 1995

919

Offsetting surface boundaries

and gouge-free

machining:

K Tang et al.

{grd(p): p E C} that meet the envelope criterion. This means E(C) plus the two guard surface grd(C(0)) and grd(C(l)) constitute a super set of {grd(p): p E CY”. Consequently, their upper envelope must be identical to that of {grd(p): p E Cl”. As an example, for a bull-nosed tool shown in Figure 3, the following procedure Eval-E evaluates the envelope E(u, u) ofa curve C(u).

Figure 9

Numerous tool positions for gouge-free touching of a boundary point

hemisphere S* and the plane that contains the origin and is orthogonal to TV.Specifically,

procedure Eva1 _ E (C, u, I!, R, r) /* Given a C’ continuous parametric C(u) and the two radius R and r bull-nosed tool, evaluate the envelope at parameter pair (u, c). Assume the to be the tool axis T.&J

curve of a E(C) z-axis

I p = C(u);

7, = d(u)/ll&dll; TaxisX ‘p ” = l/T,,, X ~~11 ’

H(p) can be easily expressed in the following parametric form:

Ap)

= Np,

u>= (cos(u))vI(p)

Tpxv,

+ (sin(u)h,(p)

where 0 I u I 7~ and v,(p) = TaxisX Tp/IITaxisX TJ, v,(p) = 7Px vl/l(~ x vl((, which are two unit basis vectors in the norma! plane of C at p and are mutually orthogonal, as illustrated in Figure 13. With .&p), the guard surface grd(p) of a point p on curve C is now redefined as:

n = (cos( u>h, + (sin( u))v,; if(n is not parallel to the z-axis){ n = the projection of n on the x-y p&e; n =n /IIn II; r:t!urn ;hYepc?nt p + r X (n - Taxi,) + (R -r) X nxy;

grd,(p) = {off(p, d: n E Ap)}

1

It is not hard to note that grd,(p) is the silhouette of grd(p) along the tangent direction of C at p. Or in other words, grd,(p) satisfies the envelope criterion of the swept volume {grd(p): p E C15, ‘. The surface E(C) is then defined as the set of grd,(p) for all the points p on C, i.e. E(C) = {grd,(p): p E C}. Assuming C to be a C’ parametric curve C(u): 0 I u I 1, E(C) can then be parametrically expressed as: E(C) = E(C(u))

= E(u, U) = grd,(C(u))

off(C(u),~(C(u),

=

u)>,

O<uslandO be the x- and y-components of E&, v>. The ray tracing is then equivalent to simultaneously solving the following two nonlinear equations on u and U:

A robust and fast algorithm for finding the intersection between an E(C) and a drive plane is indispensable in

tool path

(a)

Like in the first routine, a general purpose Newton-Raphson method is adopted. Notice that, ex-

(b)

Figure 12 (a) A guard surface and two offset surfaces of a part, (b) the tool path obtained after the upper-envelope operation

Figure 13

Definitions of basis vectors v1 and v2

Computer-Aided Design Volume 27 Number 12 December 1995

921

Offsetting surface boundaries and gouge-free machining: K Tang et al.

(a)

(cl Fire

14 Envelopes of a B-spline with respect to three different tools; (a) ball-nose tool, (b) bull-nose tool with a flat-bottom, (c) flat-end tool

cept for some possible isolated pairs of u and u values. E(u, v> and its partial derivatives are continuous in its entire parameter domain*. This guarantees the feasibility of the iterations of the Newton-Raphson method. An approximation of Ecu, ZJ)is first constructed, called

*The first and second partial derivatives of Efu, u) against u and u at any given values of u and L’can be derived from the parametric expression of E(u, u) using the chain rule; refer to any elementary calculus book.

the lattice. This is a structure containing a rectangular lattice of points on Ecu, U) spaced evenly in the u and u directions in the domain of E(u, u>. The number of points chosen depends on the curvature of the surface. To approximate the offset surface away from the lattice points, bilinear interpolation is used. For example, suppose over an Ecu, U>we have a lattice with three points in the u direction and four points in the u direction-call this array L. L contains the 12 points on ECU, u) with u-parameters 0, i, or 1, and v-parameters

upper envelope of the intersection curve T

:

.- - __ 4. *.’

Fcmve

: .* ..‘.

,T’

Figure 15 Upper enveloping an intersection curve

922

Computer-Aided Design Volume 27 Number 12 December 1995

Offsetting surface boundaries and gouge-free machining: K Tang et al.

0, f, g, or 1. (Assume the domain is normalized to [O, 11X 10, 11.) For example, L(2, 2) = E(i, f>. To find the approximation of E(i, i>, we would do bilinear interpolation with the four points E(i, i), EC;, $>, E(1, i), E(1, $). We call the piece of the approximation gotten by interpolating these four points a bilinear tile, or just a tile. These tiles serve as a way of getting initial points for one of two numerical methods which find the true intersection points. If a ray intersects one of the tiles, this gives us a pair of parameter values to use as an initial guess for the intersection. We first try to converge on this intersection with the Newton-Raphson method, and if this fails a recursive guadrasection on the tile is performed until we find the ray intersects with a tile which is small enough to be an accurate approximation. The intersection algorithm is carried out in two stages. At the first stage, the x-z plane (the drive plane) is intersected with the four boundary curves of an E(u, u), i.e. HO, u), E(1, v> E(u, O), and E(u, 1). An intersection point is categorized as being either tangent or transverse. It is a tangent point if the boundary of E(u, U) has a small neighbourhood at the point which is entirely within one side of the X-Z plane, such as q’ and q” shown in Figure 16; otherwise it is a transverse point, e.g. points ql, q2, q3, q4 in Figure 16. Because the boundary of Ecu, v) is closed, the number of the transverse points must be even. Let {LX,, z,>, (x2, zz), * a., (XZrn, zzm)} be the set of transverse points, sorted in the +x direction. Conceivably, every odd numbered interval [xzi_ i, xzi] (1 5 i I m) is completely covered by the projection of the intersection curve on the x-axis, and every even numbered interval (xZi, xZi+ r> (1 I i <m - 1) disjoints the projection. x1 and xZm must be the two extrema of the projection of the intersection curve on the x-axis, for otherwise Ecu, U) would have an interior point where the surface normal is parallel to the x-y plane, which is against the definition of the normal semicircle Jy(p>. At the second stage, a bisection ray tracing intersection is recursively performed on the interval [xZi_ r, xZi] (1 5 i I m). It proceeds as follows: starting with the interval [xzi_ r, xZi], the vertical line lx = (xZi_, + x,)/2, y = 0) is intersected with Ecu, v), resulting in a new intersection point (x’, z’). (In case of multiple intersection points, only the one with the largest z-coordinate will be taken, due to the upper envelope operation.) The intersection then recurs on the two half-intervals [xZi_i, x’] and [x’, xZi], and on and on, until the stop criteria are reached. In our implementation, an interval [x’, x” ] is stopped from further division if any of the following two stop criteria is met: (1) the 3D distance between the two intersection points p’ and p’, at x’ and x’, is small enough; (2) The radii of curvatures of E(u, v) at p’, say r’, and at p” say r”, are identical or almost identical, and the ratio of r’ over the 3D distance between p’ and p” is greater than some predetermined number 6. The first criterion ensures that the generated points are close enough to accurately represent the intersection curve. The second criterion, on the other hand, helps reduce the generation of unnecessary or redundant intersection points. In many occasions, the portion on the true intersection curve between p’ and p” can

projection of Ecu,@ on tire x-y plane /I

Figure 16 Intersecting the boundary of E(u, u) with the x-z plane

be exactly or closely represented by an arc or a line. The threshold number S is empirical, and in our implementation it is set to 5.0. In general, the larger 6 is, the more points will be generated. We now must resolve the non-uniqueness of Ecu, U) in the intersection. Given an interval [x’, x” 1, further recursions on it crucially depend on the successful intersection between Ecu, v> and the middle vertical ray at X=(X’ +x”)/2. If Ecu, U>has a ‘disc’, e.g. in Figure 14b or 14c, and the ray happens to pass through the ‘disc’, the Newton-Raphson or the quadrasection method are both doomed to fail in finding the intersection, as Ecu, U) is ill defined near the ‘disc’. Our solution is to back up the intersection by a further recursion in the parametric domain. Refer to Figure 17 for an illustrative example. Suppose the initial interval is [x’, x”], and the two intersection points are E(0.3, 0) and E(0.31, 1). After failing to intersect the vertical ray at x = (x’ + x” )/2 which shoots at the disc, we choose a v-value between that of the two end points, i.e. 0.49 in the example, and intersect the iso-parametric curve Ecu, 0.49) with the x-z plane. Because of the continuity of Ecu, u), there must be at least one such intersection point whose x-coordinate, x1 in the example, must be between x’ and x”. We then proceed to process the two new intervals [x’, x,] and [x1, x”], using both ray tracing method and the backup remedy of the u--u domain recursion in case the ray tracing fails, until either the stop criteria are reached or the U--U parameters of the two end points of the current interval are too close to each other. In general, given an interval between E(u’, u’) and Ecu”, v”), either a u-curve or a v-curve of Ecu, U) can be used for finding an intermediate intersection point. In our implementation, we choose the u-curve E (u, U’ + Y/2) if 1v” V’I > Id - u’l, and the v-curve E (u’ + u”/2, v) otherwise. The only exception is the special u-curve E&, 0.5) (assuming v is normalized). Referring to the definition of Jy(p, v> in the previous section, one can see that if an Ap, v) is parallel to the tool axis Taxis, v must be 0.5. To insure the intersection, the u-curve E&OS) should be avoided, e.g. in Figure 17 the u-curve Ecu, 0.49) is chosen over E(u, 0.5). Finally, it is helpful to point that, in order to ensure the smoothness of the tool path, it is essential that (the upper envelope of) the intersection curve between an E(u, v) and the drive plane must be accurately computed. An intersection based on the direct polyhedralization of E&, v), i.e. approximation of E(u, v) by a polyhedron which is then intersected with the drive plane, should not be recommended. This is because no matter how densely E(u, U) is sampled, it is still very hard to avoid vertical gaps between the approximated

Computer-Aided Design Volume 27 Number 12 December 1995

923

Offsetting surface boundaries

and gouge-free

machining:

K Tang et al.

x-axis 1)

Figure 17

Intersecting

the .x-i plane with an intermediate

iso-parametric

Ecu, c) and its adjacent offset surfaces, as manifested in Figure 28. Our testing results have consistently shown that the intersection algorithm described in this section generates the correct intersection curve of an Ecu, L:) that smoothly connects to its adjacent offset surfaces.

curve

lation has verified that during the entire tool cutting operation the tool constantly touches the part.

CONCLUSION The traditional offset surface approach in 3-axis NC machining is unable to generate correct tool paths, if the group of surfaces to be machined have tangent discontinuity or surface gaps among them. This failure is due to the fact that the points on the boundary edges of a G’ continuous surface are not sufficiently protected by the offset of the surface. This paper describes a practical system for solving the problem: offsetting the boundary curves of the surfaces and performing the upper-envelope operation on their intersections with the drive plane. Although there have been reports on the proposed approach”, 12, they only apply to spherical tools. Our system allows a tool to be of arbitrary shape, as long as it is convex and G” continuous. To cope with the singularity or nonuniqueness on an offset of a boundary curve introduced by a general tool, such as fillet-end, a two step bisection recursion algorithm is proposed for intersectiong a bisecting vertical ray with the offset. If this numerical intersecting process fails, because the intersection point is on or near the singular area (the ‘disc’), a second step backup intersection is invoked, which seeks the intersection between the drive plane and an intermediate iso-parametric curve on the offset between the two end points of the current interval.

RESULT The offset algorithm has been successfully implemented, and the result is very encouraging. The following two examples are selected to demonstrate the result of tool path generation based on the method described in the previous sections. In F@re 19, the part consists of three half-cylinders, two hemispheres, and a base plane which is orthogonal to the tool axis. The tool is a bull-nosed type with a flat bottom. The size of the tool is deliberately made comparable to that of the cylinders, so that the effectiveness and correctness of the enveloping can be easily verified. As clearly manifested in the figure, the motions of the tool near the sharp edges of the cylinders are curved, due to the effect of boundary offsetting, and successfully pass through without gouging the cylinders. A dynamic simulation of the cutting operation also indicates that the tool constantly touches these edges during these motions. The part shown in Figure 20 is made of several cubic B-spline surfaces. The tool is a ball-end type and its diameter is much smaller than the part dimension. Notice those transitional motions of the tool path near the sharp edge of the partial cylinder. Again, the simu-

E(u,v)

/-Yroo’path uppa-enveloping -

Figure

924

18

Vertical

gaps due to inaccurate

Computer-Aided

approximation

/

of Ecu, I’)

Design Volume 27 Number 12 December

1995

\

Offsetting surface boundaries and gouge-free machining: K Tang et al.

(a)

(b) Fi@w 19 Example 1: bull-nosed tool with a flat bottom; (a) part surface, (b) tool path Testing results of the implementation have shown that our system is robust, reasonably fast, and generates accurate tool paths that satisfy three desired criteria: (i) gouge free, (ii) smoothness, and (iii) minimal uncut area. On future improvements, it remains to see if a better intersection algorithm can be adopted. While our tests show that the robustness of the Z-buffer alike intersection algorithm presented in this paper is acceptable, its computational efficiency should be examined. It also applies to a planar drive surface only, and not a cylindrical one arising in pocketing surface machining. A number of intersection algorithms available in the literature have been investigated for suitability, in particular the imrlicitization method13, 14, the loop detection approach , and the tracing the intersection curve paradigm 15-17. They nevertheless were found in one way or other, to be unsuitable in our case. For instance, the implicitization method requires that one of the two

intersection surfaces be represented implicitly and the other one parametrically. While a plane is obviously implicit, an envelope surface Ecu, u) can only be evaluated procedurally, e.g. via the procedure Eval-E. Above all, in all the algorithms mentioned above, it is requisite that the two intersection surfaces be unique functions (parametrically) and at least C’ continuous. This is not true for an Ecu, U) with a ‘disc’, where the tracing can easily stray near the edge of the ‘disc’. On the other hand, however, if E&, u) is known in advance to have no ‘discs’, such as in the case of a ball-end tool, it should be asked if these algorithms can help speed up the intersection process. In particular, we believe, by augmenting our intersection algorithm with the well-known tracing the intersection curve approach, more efficient results may be obtained. From a theoretical point of view, the enveloping method provides an attractive approach for describing swept volumes. It is shown in this paper that the

Computer-Aided Design Volume 27 Number 12 December 1995

925

Offsetting surface boundaries

and gouge-free

machining:

K Tang et al.

8 9

10 I1 12 13 14 15

(a) 16

17

1X I9

20

for computer-aided manufacturing’ PhD Dissertation University of Southern California (1989) Sambandan, K ‘Geometry generated by sweeps of polygons and polyedra’ PhD dissertation Cornell University (1990) Wang, W P and Wang, K K ‘Geometric modeling for swept volume of moving solids’ IEEE Comput. Graph. Appl. Vol 6 No 12 (1986) pp 8-17 Press, W, Flannery, B, Teukplsky, S and Vetterling, W Numerica/ Recipes in C Cambridge University Press, New York (1990) Higashi, M ‘High-quality solid-modeling systems with free-form surfaces’ Computer-Aided Des. Vol 25 No 3 (1993) pp 172- 183 Rossignac, J and Requicha, A ‘Offsetting operation in solid modeling’ Computer-Aided Geom. Des. Vol 3 (1986) pp 120-148 Manocha, D and Canny, J ‘A new approach for surface intersection’ ACM Comput. Graph. September (1991) pp 209-219 Sederberg, T W, Anderson, D C and Goldman, R N ‘Implicit representation of parametric curves and surfaces’ Comput. vis. Graph. Image Proc. Vol 28 (1984) pp 72-84 Bajaj, C L, Hoffmann, C M, Lynch, R E and Hopcroft, J E ‘Tracing surface intersections’ Computer Aided Geom. Des. Vol5 (1988) pp 2855307 Barnhill, R E and Kersey, S N ‘A marching method for parametric surface/surface intersection’ Computer Aided Geom. Des. Vol 7 (1990) pp 2577280 Pratt. M J ‘Surface/surface intersection problems’ in Gregory, J A (Ed.) The Mathemutics of Surfaces Clarendon Press, Oxford (1986) pp 1188142 Fdrouki, R T ‘Exact offset procedures for simple solids‘ Compurer Aided Geom. Des. Vol 2 (1985) pp 2577279 Jerard, R B and Drysdale, R L ‘Methods for detecting errors in numerically controlled machining of sculptured surfaces’ IEEE Comput. Graph. Appl Vol 9 No 1 (1989) pp 26-39 Jerard, R B and Drysdale, R L ‘Methods for geometric modeling, simulation and spatial verification of NC machining programs’ in Turner, J, Pegna, J and Wozny, M (Eds.) IFIP TCS/ WCS.2 Working Conference on Product Modelingfor Comput-Aided Design and Manufacturing Rensselaerville, USA (1990) pp 39-52

21 Loney, G C and Ozsoy, T M ‘NC machining of free form surfaces’ Computer-Aided Des. Vol 19 No 2 (1987) pp 85-90 22 Marciniak, K Geomettic Modeling for Numerically Controlled Machining Oxford University Press (1991)

(b) Figure 20

Example 2: bull-end tool; (a) part surfaces, fh) tool path

envelope of a curve has the identical upper envelope as that of the cylinder from sweep. This sheds light on precise verification of 3-axis NC surface machining, as the actual surface cut is the lower envelope of the envelope of the tool paths. This issue is currently being investigated.

REFERENCES Bobrow, J E ‘NC machine tool path generation from CSG part representation’ Computer-Aided Des. Vol 17 No 2 (1985) pp 69-76

Faux, 1 D and Pratt, M J Computational Geometry for Design and Manufacture Ellis Horwood, Chichester (1979) Choi, B K and Jun, C S ‘Ball-end cutter interference avoidance in NC machining of sculptured surfaces’ Computer-Aided Des. Vol20 No 5 (1989) pp 371-378 Duncan, J P and Mair, S G Sculptured Surfaces in Engineering and Medicine Cambridge University Press, Cambridge, UK (1983) Boltyanskii, V G Emelopes MacMillian, New York (1964) Choi, B K, Lee, C S, Hwang, J S and Jun, C S ‘Compound surface modeling and machining’ Computer-Aided Des. Vol 20 No 3 (1988) pp 127-136 Hansen, A B ‘Tool positioning and path generation algorithm

926

Computer-Aided

Design Volume 27 Number 12 December

Kai Tang receiued a PhD in computer science from the University of Michigan, USA, in 1990. He also has a BSE in mechanical engineering. Since 1991, he has been with Applicon (formerly Schlumberger CAD /CAM) as a software specialist. His research interests include geometric algorithms in CAD/CAM, ejticient tool-path generation and wrification complex sculptured for surfaces in numerical-control machining, domain decomposition and partitioning in solid modelling, and spherical algotithms. His most recent interest is in the efficient computation of swept t&r nes under uarious geomebic constraints.

Charles C Cheng has been with Applicon, Ann Arbor, MI for more than six years. Prior to that, he was with GM Technical Center at Warren, Michigan and IBM Scientific Lab. at Los Angeles, CA. He has been inwolwd with rarious CAD /CAM projects: non-gouging NC tool path generation, data management, solid modelling etc. In addition, he has experience in the design and implementation of language and knowledgebased systems. His recent interest is to protide an intelligent and knowledgeable framework for the design environment. He receiued his undergraduate education in physics from National Taiwan Uniwrsity Taipei, Taiwan, and postgraduate studies in computer science from Rensselaer Polytechnical Institute, Troy, NY, and Uniter@ of Michigan, Ann Arbor, Ml.

1995

Offsetting surface boundaries and gouge-free machining: K Tang et al.

Yakow Dayan received a Bsc in mechanical engineeringin 1982 from BenGurion Uniwrsity, Israel, and an MSc in mechanical engineering from the Uniuersity of Michigan, USA, 1990. In the past 13 years he worked for sewral sojiware companies primarily in research and development of W/ CAM applications. Currently he is with Applicon as a senior software specialist.

Computer-Aided Design Volume 27 Number 12 December 1995

927