
Citation 
 Permanent Link:
 http://ufdc.ufl.edu/AA00037821/00001
Material Information
 Title:
 A chatterfree pocketing routine for any twoandahalfdimensional pocket with islands
 Creator:
 Cheng, EHsung, 1959
 Publication Date:
 1992
 Language:
 English
 Physical Description:
 vi, 128 leaves : ill., col. photos ; 29 cm.
Subjects
 Subjects / Keywords:
 Automatic picture transmission ( jstor )
Coordinate systems ( jstor ) Cutting tools ( jstor ) Databases ( jstor ) Geometric angles ( jstor ) Line segments ( jstor ) Machine tools ( jstor ) Machinery ( jstor ) Machining ( jstor ) Subroutines ( jstor ) Dissertations, Academic  Mechanical Engineering  UF Mechanical Engineering thesis Ph. D
 Genre:
 bibliography ( marcgt )
nonfiction ( marcgt )
Notes
 Thesis:
 Thesis (Ph. D.)University of Florida, 1992
 Bibliography:
 Includes bibliographical references (leaves 126127)
 General Note:
 Typescript.
 General Note:
 Vita.
 Statement of Responsibility:
 by EHsung Cheng.
Record Information
 Source Institution:
 University of Florida
 Holding Location:
 University of Florida
 Rights Management:
 The University of Florida George A. Smathers Libraries respect the intellectual property rights of others and do not claim any copyright interest in this item. This item may be protected by copyright but is made available here under a claim of fair use (17 U.S.C. Â§107) for nonprofit research and educational purposes. Users of this work have responsibility for determining copyright status prior to reusing, publishing or reproducing this item for purposes other than what is allowed by fair use or other copyright exemptions. Any reuse of this item in excess of fair use or other copyright exemptions requires permission of the copyright holder. The Smathers Libraries would like to learn more about this item and invite individuals or organizations to contact the RDS coordinator (ufdissertations@uflib.ufl.edu) with any additional information they can provide.
 Resource Identifier:
 027851656 ( ALEPH )
26645105 ( OCLC )

Downloads 
This item has the following downloads:

Full Text 
A CHATTERFREE POCKETING ROUTINE FOR ANY
TWOANDAHALFDIMENSIONAL POCKET
WITH ISLANDS
BY
EHSUNG CHENG
A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL
OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT
OF THE REQUIREMENTS FOR THE DEGREE OF
DOCTOR OF PHILOSOPHY
UNIVERSITY OF FLORIDA
1992
UNIVERSITY OF FLORIDA L!'.,S
ACKNOWLEDGEMENTS
The author wishes to express his gratitude to Dr. Jiri Tlusty, his advisor in this project. Without his support and guidance, this study would not have been possible. He would also like to thank Dr. Kevin Smith for his invaluable advice to the project. Appreciation is also extended to his committee members, Dr. John Schueller, Dr. Donald Dareing, and Dr. Senser Yeralan, for reviewing the dissertation. Gratitude is also extended to Mr. Wei Guo Zhang for his assistance in the laboratory work and to Mr. ChunYin Wu for his initial suggestion about the program structure. Finally, the author would like to express his sincere gratitude to his parents, ChauLu and JanJan, and his wife, JawFen Wang, for their encouragement, understanding, and financial support. To them the author offers his heartfelt thanks.
TABLE OF CONTENTS
Page
ACKNOWLEDGEMENTS .............................................. .ii
ABSTRA.CT ............ .... o....... o....oo.................
CHAPTERS
1 INTRODUCTION ........................................ 1
1.1 Introduction to Pocketing Routines ............ 1
1.2 Offsetting Algorithm ........................... 4
1.3 Some Considerations of the New Pocketing
Routine .......................................... 6
1.3.1 Chatter Consideration .................... 7
1.3.2 Corner Consideration ....................12
1.4 Dynamic Spiral Pocketing Routines ............. 12
2 OPTIMIZATION PROCESS ................................ 20
3 PROGRAM STRUCTURE .................................. 27
3.1 Data Representation of a Segment ................ 27
3.2 Linked list Representation .................... 29
3.3 Tree Representation of a Pocket and its
Spiral Tool Paths ................................ 35
3.4 Program Implementation of a Binary Tree ........ 38 3.5 Island Representation ......................... 40
3.6 Tree Traversal ................................. 44
4 SOME SUPPORTING SUBROUTINES ......................... 49
4.1 Classifying InsideOutside Relation of a
Point and a Closed Loop ....................... 49
4.2 Intersection of Two Segments .................. 55
5 FINDING THE TOOL PATH OF A POCKET .................. 62
5.1 Finding Offset Loops of Equal Offset Distance 63
5.1.1 Finding the Offset of Each Segment on
the Original Loop ............................ 63
5.1.2 Linking Pair by Pair the Offset Segments
Whose Original Segments Are Adjacent ...... 65
iii
5.1.2.A Case 1: The Angle Is Greater
Than 1800............................... 65
5.1.2.B Case 2: The Angle Is Lesser
Than 1800............................... 66
5.1.3 Splitting the Gross Offset Loop into
Several Subloops ......................... 68
5.2 Finding Offset Loops of Unequal Offset
Distances ..................................... 73
5.2.1 Finding the Offset of Each Segment on
the Original Loop ......................... 73
5.2.2 Connecting Each Pair of Neighboring
Offsets to Form a Gross Offset Loop ....... 76
5.3 Tool Path of a Pocket with Islands ............ 80
5.4 Loop Termination Conditions .................... 88
5.5 Connection between Larger Loops and their
Subloops .................................... 90
5.5.1 Two Cases of Connection between Loops ..... 91 5.5.2 Retract and Approach ....................... 96
5.5.3 Change the Starting Segments of Loops ..... 97 5.5.4 Connection of Loops While Islands exist ... 98
6 INSTALLATION PROCESSES ........................... 101
6.1 Installation of the New Pocketing Routine
in CATIA ....................................... 101
6.2 APT and Machine Codes ......................... 106
7 EXAMPLES OF TOOL PATHS ............................ 110
8 CONCLUSIONS AND RECOMMENDATIONS .................. 120
APPENDIX
A THE CHARACTERISTIC OF A CUTTING TOOL .............. 123
BIBLIOGRAPHY ............................................ 126
BIOGRAPHICAL SKETCH ..................................... 128
Abstract of Dissertation Presented to the Graduate School Of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy
A CHATTERFREE POCKETING ROUTINE FOR ANY
TWOANDAHALFDIMENSIONAL POCKET WITH ISLANDS
BY
EHSUNG CHENG
MAY 1992
Chairman: Dr. Jiri Tlusty
Major Department: Mechanical Engineering
Chatter has always been a significant problem in high speed, high power machining. For the purpose of chatter avoidance, the primary parameters are the axial and the radial depths of cut which are decisive in the tool path optimization. The acceptable (chatterfree) axial and radial depths of cut change depending on the dynamics of the machine tool, the direction of cut, and the mode of milling (up or down milling). The relationship of the above parameters has been incorporated to form a database by other collaborators in the Machine Tool Laboratory at the University of Florida.
The pockets used in this work may have complex 2 dimensional geometries and may include multiple islands. Two main approaches have been developed to achieve the chatter
free routine. At first the optimum radial and axial immersions would be determined according to the database and the pocket geometries. Secondly, the tool path is arranged using the optimum immersions to achieve the best metal removal rate without the occurrence of chatter. In the optimization process, different radial immersions may be selected for different machining directions. This feature is unique since other pocketing routines can only choose the same immersion for all machining directions. Therefore, the machine would not use all of its power capabilities, since the smallest immersion has to be selected if those routines are used.
This work also outlines a complex general tree data structure, the implementation of geometric modelling techniques into programming, and the method to incorporate the new routine into CATIA, a widely used CAD/CAM package. Finally, a processor is provided to established a link between CATIA and an NC machine.
Several examples are used to illustrate the resulting tool paths from the new routine, and comparisons are made between the actual parts machined by tool paths resulting from the new routine and from the original pocketing routine from CATIA.
This work presents a new type of pocketing routine which would reduce the manufacturing time and increase machining quality and tool life.
CHAPTER 1
INTRODUCTION
1.1 Introduction to Pocketing Routines
A common procedure in a milling operation is to remove the material within a given boundary and to create a cavity, also known as a pocket. The pocket can have any shape along its boundary. Machining aircraft panels and molding dies are two common examples of pocket use. Pocketing routines have been implemented in many numerical control (NC) packages, and may be grouped into three broad categories:
(1) Spiral out: In such a routine, the tool is first sunk in near the center of the pocket, and then traverses a path spirally outward. The last path will create the periphery of the pocket.
(2) ZigZag: The starting point is at a distance of the tool radius plus the finishing cut immersion from a chosen point on the periphery. The tool is first sunk at the starting point, and then traverses back and forth, cutting in both directions across the pocket, and finally finishes on the opposite side of the pocket from the starting point. The final path is the finishing path which is used to create the periphery of the pocket.
(3) Linear: This routine is similar to the zigzag routine, except that the cutting is performed only in one direction, and on the return path the cutter is withdrawn and travels in air. In order to avoid the necessity of sinking at the beginning of each pass, the periphery of the pocket is first machined in a slotting operation, before the linear motion begins.
Among the above three operations, the spiral pocketing operation is the most complicated but also the most efficient
(1)(2], and thus is the primary subject of this research. Although the spiral pocketing routine has been widely used, none of the commercial packages have given any description about their algorithms, and few publications about the pocketing routines are available. These publications have not provided a good way to deal with a pocket with many islands. Furthermore, none of the routines in the commercial NC packages take into account the problems of chatter and internal corners which are crucial in the high speed high power machining operation. These problems will be addressed in detail later in this chapter. This research attempts to solve the above problems and also provide a robust algorithm in dealing with a pocket of complex 2D geometries with or without multiple islands.
Few publications have been presented about pocketing routines. Persson's (3] work describes an efficient twostage procedure for a pocket bounded by line segments and circular
3
arcs. This pocket was machined in a spiral fashion. He first partitioned the entire pocket into several independent subareas each belonging to one pocket side, and then the cutter paths were determined such that each path was found in a subarea at a time. The subarea was partitioned by calculating the curves (lines, circular arcs, ellipses, parabolas, or hyperbolas) equidistant between each pair of adjacent boundaries of the pocket. However, when dealing with unequal radial immersion at each pocket boundary (this will later be shown to be desirable), this kind of partition will not work. Additionally, his pocketing procedure does not permit internal island avoidance. Nevertheless, he mentions that lines and arcs alone are not always sufficient for representing airplane parts. These complex representations include tabcyls, which are curves defined by point sets. He developed a prepocket procedure which approximated tabcyls with arcs and lines, before the normal pocket calculations were started.
Another publication about pocketing routines is the one by Suh and Lee [4]. Their work described the machining of a pocket spirally. The pocket may be bounded by many curves, including lines, arcs, ellipses, and arbitrary free curves. The pocketing routine was capable of island avoidance, but only one island was allowed. Additionally the bottom of the pocket to be machined may be any sculptured surface.
4
Their procedure started from a threedimensional (3D) model generated by a geometric modeler developed in their laboratory, which was a nonuniform rational Bsplinebased boundary representation modeler. Once the shape of the pocket had been modelled, the offset curves and the associated CL data were computed at every offsetting step. At each step, one or more loops would be generated.
However, their routine was useful only for the finishing cut of the pocket which emphasizes the precision and continuity of the tool movements on the sculptured surface, while in a roughing cut, the metal removal rate is a more important issue. Also, in their routine only one island was allowed, which implied that their data structure would need more modification. Furthermore, they did not describe the procedure to connect a loop and its offsetting loops. The connection will become quite complicated in the case of machining a complex pocket enclosing many islands.
As in the commercial pocketing routines, both Persson's and Suh's works were concentrated on the equal distance offset principle, and did not consider the problems associated with internal corners.
1.2 Offsetting Algorithm
An offset is a curve with equal distance to a given curve. The offset technique can be applied in several fields, including NC pocket machining, VLSI circuit design, finite
5
element mesh generation, and robot path planning. In conventional spiral type pocketing routines, tool paths are formed as loops. The subloops are the offset of their corresponding larger loops. The offset technique has been discussed in several papers. Tiller and Hanson [5] discussed the offsets of twodimensional profiles. They used the subdivision method to find the offset of a rational Bspline curve. But their method runs into trouble when the offset curve intersects itself. Pham [6] provided a method to interactively find the offset of a uniform cubic Bspline by using a set of control knots. He discussed only the problem of offsetting a curve, and not a loop, for in a loop the problem is more complicated. Hoschek's work [7] discussed the problems involved in generating the offset of a cubic spline. Coquillart's [8) work discussed the offset of a Bspline in both 3D and 2D. But his work was limited to finding the offset of smooth curves without discontinuities. Moreover, selfloops, which are loops within a larger closed loop, are not allowed in offset curves.
The above papers concentrated their efforts on finding the offsets of splines, either Bsplines or cubic splines. The offset will be a spline of the same kind. These efforts are reasonable, since the spline is a powerful tool for the designer and can be used to approximate any desired curve.
The offset of a line segment is another line segment, and the offset of an arc is another arc. In some cases, a pocket
6
is constructed by not only line segments and arcs, but also by ellipses, hyperbolas, and parabolas. The exact offset of an ellipse (hyperbola, or parabola) is a fourth order curve which can still be found, but finding the exact offset of this fourth order curve becomes very complicated if it even exists. It is easier to use a spline to approximate the offset of this fourth order curve. As a result, it is necessary to have a method to find the offset of splines. In other words, it may be said that if a pocket is bounded by curves beyond line segments and arcs, the above papers might provide a method to solve the offset problems. However, the kind of offset required in this research is not of the equal distance form. The offset distance is variable according to the direction of each pocket edge and is determined by optimization results. None of the above papers has ever mentioned anything about variable distance offsets. The problems involved are of a new nature. Thus, in this research the types of segments defining any pocket boundaries are limited to line segments and circular arcs.
1.3 Some Considerations of the New Pocketing Routine
Assuming that the criteria for a satisfactory cut is the avoidance of chatter, it is necessary to explain the meaning of chatter, and why, for a given axial depth of cut, the radial depth of cut may be different for each direction of machining.
1.3.1 Chatter Consideration
The selfexcited vibration in machining, also known as chatter [9], is an important factor for controlling the quality of the cutting operation. Chatter is recognized by characteristic noise, by chatter marks, and by the undulated or dissected chip. The mechanisms producing chatter are "mode coupling" and "regeneration of waviness." The latter plays a more significant role.
The limit of stability for regenerative chatter for a single degree of freedom system is shown in Figure 1.1. It is obvious that the projection F cos(Ba) of the cutting force excites the mode in the X direction and the projection X cos(a) of the vibration in the Y direction will modulate the chip thickness. The oriented transfer function is [9]
G(w) F(=_) = cos(P4) cos(a) X( ) = p Gd, (1.1)
where A = cos(Ba)cos(a) is the directional factor, and Gd represents the direct transfer function. In the preceding pass, the vibration is given by yo = Y. sin (at) (1.2) and, in the current pass, the vibration is
y = Y sin (wt + 2nN + e) = Y sin (wt + (1.3) The cutting force f is
f = 4fm + f (1.4)
where fm is the mean cutting force, and fv is the variable
Y  direction normal to cut X  Direction of freedom for mode
Figure 1.1
Mechnism of "regeneration of waviness"
Block diagram of chatter mechnism
Figure 1. 2
component. Their values are
f,= k, b h, (1.5) fv =k b (yo  y), (1.6)
where Ks is the cutting force coefficient, and b, the depth of cut, is a positive real number.
The above equations can be represented by a block diagram in Figure 1.2. At the limit of stability, any vibration would remain constant without decaying or increasing. Thus, the absolute values of amplitudes for two subsequent vibrations are equal.
I Y I = I Y I (1.7)
According to the Nyquist criterion, the limit happens when the openloop transfer function of Figure 1.2 has the value 1
Ks blim G(,)) (1  e ,) =
blim =  (1.8)
K, G(w) (I  esince bHi, is always real and Ks is chosen to be positive real.
The above equation can be justified only if G(1  e"') is real. This condition can be satisfied if
G (1  eE) = 2 Re(G) (1.9) Thus,
b = 1 1 (1.10)
blm 2 K, Re(G(w)) 2 I KO Re(Gd)
The single degree of freedom system can only be used to
10
explain the mechanism of chatter vibration, and is not suitable for the real machining process. For a two degree of freedom system, the equation for bti, becomes
b1 (1.11)
m 2 Ks (ji, Re(G) + Vy Re(Gy)) min
where
Re(Gx): real part of the transfer function measured in the X direction of the feed motion,
Re(Gy): real part of the transfer function measured in the Y direction perpendicular to the feed motion,
Ax: directional orientation factor for the X dynamics, AY : directional orientation factor for the Y dynamics. If only the tool were involved in determining the transfer function at the tool tip position, then the transfer functions Gx and G in the X and Y directions would be the same. However, in most practical cases the machine structure must be considered, and thus the transfer functions Gx and Gy may be significantly different. The method of determining Ax and gy was explained by Tlusty (9]. It is known that the values of ix and jy are determined by the machining direction and the mode of milling which is either up or down milling, and can be quite different. Adding the factors of changeable gx and Ay. and of the difference between Gx and Gy, the minimum value of /xRe(Gx) + ARe(Gy) may be considerably different for different cutting conditions. Accordingly, from Equation 1.11, the value of bHim will be different depending on whether it is up
or down milling and on the machining direction.
None of the commercial NC packages have offered the option of selecting different radial immersions for different cutting directions. All that is available is a constant immersion for all directions. Therefore, to ensure a stable milling operation, it is necessary to choose an immersion based on the worst direction and immersion. Thus, in cutting in the more stable directions the machine does not use its full capability. Even if a pocketing routine offers the user the option to change the radial immersion according to the direction and the mode of milling, in the existing routines there is no guideline for selecting the parameters. The programmer is left to his own experience to select the radial and axial immersions which will yield an acceptable quality.
A database of quality parameters, which is the prework of this research, is proposed. The database, developed by experiments or a time domain simulation program in the Machine Tool Laboratory at the University of Florida, will include a representative selection of tools. Thus, while a shape of the pocket, and the tool used to machine it are determined, the new pocketing routine will first determine the axial depth of cut and the radial immersion for each side of the pocket by an optimization technique such that the best metal removal rate is achieved. The method of optimization is the topic of Chapter 2.
1.3.2 Corner Consideration
Another problem neglected by the commercial spiralout pocketing routines is the corner consideration. As the tool approaches an internal corner, the radial immersion starts to increase until it is on the corner, and then the immersion returns to normal.
Figure 1.3 shows an example of a half immersion cutting operation. At point 1 and point 3, the immersion is half, and the cutting angle, which is the angle of engagement between the work piece and the cutter, is 900. But at point 2 there is a slotting operation and the cutting angle is 1800. As is shown above the radial immersion has a strong affect on the stability of the operation. The increase in immersion at the corner may be sufficient to cause chatter.
Tsai and Takata [10] tried to add additional tool path segments (arcs) for machining corners so as to keep the engagement angle below a certain value. However, their method was complex and the machining became inefficient.
1.4 Dynamic Spiralin Pocketing Routine
Kshonze [1) and Tlusty [2] have provided a guideline for the dynamic routine which had the following two stages:
1. Performing the slotting around the inside perimeter of the pocket;
2. Spirally cutting from the periphery of the pocket toward the center.
pocket boundary
finishing cut area
angles of cut
/2
area cut by lost
round tool path 3
previous round
tool ath
lost round tool path
Figure 1.3 Spiralout tool path at an inside corner
For the slotting of the periphery, the axial depth of cut was chosen according to the worst direction from the data base. Since the other directions were allowed to cut deeper than that, the slotting was stable. The slotting might be done by several layers according to the depth of the pocket and the maximum allowable axial depth of cut. For the remainder of the pocket, the radial and axial depths of cut would be determined by using an optimization process to achieve the best metal removal rate. Using the optimization process is the first advantage of the dynamic spiralin pocketing routine.
Such a tool path is shown in Figure 1.4 for a simple square pocket. First the initial slotting is done in two stable axial passes (2,3,4,5,2 and 6,7,8,9,6). After that, assuming the X direction of feed to be the less stable option,
Figure 1.4 The dynamic spiralin tool path for a square
pocket
15
for a full axial depth of cut, a 1/5 radial immersion is chosen. In the Y direction of feed, a 2/5 radial immersion is chosen. The remaining pocket is machined in one pass at full depth from point 10 in a spiral motion toward the center of the pocket.
The second advantage of the dynamic spiralin routine is typical for spiralin routines for they avoid the increase of the cutting angle at the inside corners (refer to Section 1.3.2). Figure 1.5 shows that after the initial slotting, less material is cut at the inside corner area than at the noncorner areas.
However, a pocket may also include outside corners, although in a closed area (pocket) the number of outside corners is always less than the number of inside corners. For outside corners, the tool path proposed is to cut around it during the initial slotting using an arc whose radius is the same as the tool radius. After the first slot, there will be no outside corners left. In Figure 1.6, half immersion is used after the initial slot operation. At the corner portion, the second loop tool path cuts along an arc whose radius is equal to the tool diameter, and the third loop tool path cuts along another arc whose radius is 1.5 times the tool diameter. As shown in Figure 1.6, the cutting angles are 900, 104.470, and 99.590 at points 1, 2, and 3 separately. When an outside corner is involved, the cutting angle is greater while cutting along the arcs than along the lines, but not by much.
next round tool oath
Figure 1.5
Spiralin tool path at an inside corner
Spiralin tool path at an outside corner
Figure 1. 6
17
However, as the tool cuts deeper inside, the curvature of the arc will decrease and so will the increment of the cutting angle.
The third advantage of the dynamic spiralin routine is: the tool path generated by the routine is a true spiral while the tool paths generated by the commercially available spiralin pocketing routines are not. They contain several loops and linkages to join them. Figure 1.7 shows the difference between dynamic and conventional spiralin routines. Notice that the cutting angle may increase when the tool is moving through the linkages on the conventional tool path. Additionally, the true spiral is more efficient in terms of machining distance (time).
Kshonze [1] and Tlusty [2] have compared the spiral in, dynamic spiral in, dynamic linear, and dynamic zigzag pocketing routines. They found out that the dynamic spiralin routine is by far the most efficient in terms of time required to complete a 4.5 x 4.5 x 1.125 inch square pocket. Table 1.1 shows the results of their comparison.
(G\
Figure 1.7 Comparison of (a) conventional and (b) true
spiralin routines
Table 1.1
Comparison of different kinds of pocketing routines for a 4.5x4.5xl.125 inch pocket
Software Type of Cutting Air MRR # of Package Pocket Time Travel (cm**3 Holes (Min) (Min) /min)
Spiral in 5.07 0.0 73.58 1
Dynamic spiral 3.62 0.0 103.07 1
in
Dynamic linear 4.83 0.44 70.79 1 Proposed without finish
New
Routines Dynamic linear 5.65 0.47 60.96 1
with finish
Dynamic zigzag 4.20 0.08 87.18 1
without finish
dynamic zigzag 5.02 0.08 73.25 1
with finish
CHAPTER 2
OPTIMIZATION PROCESS
As mentioned in Section 1.3.1, the critical depths of cut for each tool were calculated for various cutting situations through a computer simulation program developed in the Machine Tool Laboratory (MTL). This information for many useful tools forms a database. Figure 2.1 represents the results of a simulation for a 4flute high speed steel (HSS) end mill cutter with spindle speed at 3800 rpm and feed rate at 1900 mm/min on the WhiteSundstrand milling machine at MTL. The dimension of the end mill is 25mm by 100mm. The X axis represents the radial immersion in terms of a fraction of the cutter diameter. The Y axis represents the axial immersion in millimeters. Several different cutting scenarios were created by varying the radial immersion from one fifth to full in four feed directions, +X, +X+Y, +Y, and +XY, for both up and down milling. Each curve splits the whole region into two subareas. The upper one is the unstable zone, while the lower one is the stable zone. From the figure, it is clear that the axial and radial depths of cut are strongly affected by the direction of cut as well as by the mode of milling (up or down milling). Table 2.1 lists all the data shown on Figure 2.1.
0.4
0.2
x
0 *X dir.
0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.9 0.8 0.7 0.6 0.5
Radial Immersion (fraction of cutter diameter)
+ ,x y cIr,
0 +y dir.
0.4 0.3 0.2 a xty dIr,
Figure 2.1
Computed permissible depths of cut for a 25mm by 100mm 4flute HSS end mill cutter on the WhiteSundstrand milling michine
Table 2.1 Permissible Depths of Cut for a 25mm by 100mm
4Flute HSS End Mill Cutter on WhiteSundstrand
Machine
Axial Immersion for Four Cutting Dir. (mm) +X +X+Y +Y X+Y
0.2
1.4
1.3
2.25
1.7
0.3 0.9 1.05 1.7 1.5 0.4 0.7 0.75 1.1 0.9 0.5 0.6 0.6 0.7 0.7
0.6 0.5 0.5 0.6 0.55 0.7 0.4 0.45 0.4 0.45 0.8 0.35 0.35 0.35 0.35
0.9 0.3 0.3 0.3 0.3
1.0
1.0
0.25
0.25
0.25
0.25
0.25
4 .1. 1
0.25
0.25
0.25
0.9 0.3 0.3 0.3 0.3
0.8 0.35 0.35 0.35 0.35
0.7 0.4 0.4 0.44 0.4
0.6 0.5 0.5 0.48 0.45 0.5 0.7 0.65 0.55 0.55
0.4 1.0 0.7 0.65 0.7 0.3 1.2 1.0 0.9 1.1
0.2
1.6
1.8
1.3
2.1
I _________ I _________
23
To demonstrate the use of Figure 2.1, three typical examples are presented in Table 2.2, in which the cutting directions and the axial immersions are given. In all of the examples, linear interpolation has been used. In case 1, the cutting direction is 00, which is equivalent to +X direction, and the axial immersion is 0.65mm. The two intersections of +X curve and the horizontal line at an axial immersion equal to 0.65mm are in 0.45 in the up milling region and at 0.525 in the down milling region. These two intersections are the optimum radial immersions. In the second case, the cutting direction is 900 or +Y, and the axial immersion is 0.2mm. No intersection exists between the +Y curve and the horizontal line of axial immersion equal to 0.2mm. The situation means that there is no restriction in choosing the radial immersion. Hence the optimum radial immersion is full immersion. In case 3, the cutting direction of 22.50 is between 00 (+X) and 450 (+X+Y). Linear interpolation is used to obtain the curve for this specific cutting direction from the +X and +X+Y curves. From the new curve, the optimum radial immersions to match an axial immersion of 0.8mm are obtained by the method used in cases 1, and 2.
The objective of the optimization is to find the best combination of axial and radial immersions in machining a specific pocket to obtain the maximum metal removal rate (MRR). Two assumptions are made:
24
Table 2.2 Examples of finding optimum radial immersions from
the given cutting directions and axial immersions
Cutting Axial Opti. Radial Immersion (% of Tool Dia.)
Direction Immersion
(Degree) (mm) Up milling Down Milling
0 0.65 0.45 0.525
90 0.2 1.0 1.0
22.5 0.8 0.37 0.429
1) The pocket will be machined in several layers with the same thickness between two adjacent layers; 2) At each layer, the axial depth of cut remains constant. The method of optimization is explained below.
when the number of layers, say NL, is determined, the axial depth of cut, b, will be
b = Dckt / NL (2.1)
where Dpcket is the depth of the pocket. As shown in Table 2.2, if the axial depth of cut, b, is given, then the corresponding optimum radial immersions for any cutting directions can be obtained. Since the machining time required to finish a layer, TL, is proportional to
TL 1 (2.2)
(a1p1 + a2P2 + .. + anPn)
where n is the number of pocket edges,
a,, a2, ..., an are the corresponding optimum radial immersions of the pocket edges for the
specific axial immersion, b,
P1I P2 ..., Pn are the corresponding percentages of the edge lengths in total pocket boundary length. They are constants.
The machining time for the whole pocket, TP is
STL NL NL(2.3)
(a1p1 + a2P2 + ... + a1p)
Since MRR is proportional to I/TP, it is
1*R 0 1 cc (alp, + a2P2 + "'. + anpn) (2.4)
TP NL
The optimization process will search through a range of NL. From each NL, the axial depth of cut, b, and the corresponding optimum radial depths of cut for this b are determined. Thus, the value of Equation 2.4 can be obtained. The NL, that produces the largest value from Equation 2.4, will be the optimum number of layers. The corresponding b, and al to an are the optimum axial and radial depths of cut.
For example, if the maximum and minimum allowable radial immersions are 0.7 and 0.2 separately, from Table 2.1, the range of b will thus be determined as between 0.4 mm and 1.3 mm for both down and up milling cases. For using values of b greater than 1.3 mm, the tool may chatter in some cutting directions. For using values of b smaller than 0.4 mm, the machining may not achieve the desired efficiency. If the depth of the pocket, Dpket, is 20 mm, then the number of
26
layers, NL, needed to machine the pocket is in the range of 16 to 50 (20mm/l.3mm and 20mm/0.4mm). For each NL, the corresponding axial depth of cut, b, is determined by Equation 2.1, and then the optimum a, to an for this b can be obtained by the method shown in Table 2.2. After that, the value of Equation 2.4 is calculated. The optimum NL and its corresponding b and al to an will produce the largest value.
In spiral pocketing, the tool paths are determined from pocket boundaries by successively shrinking the periphery of the pocket segmentwise by the permissible radial depth of cut for that segment. The result of each such successive offset is a subloop of the previous loop. Although the ratio of an edge in total length of a certain loop may not be the same as the ratio of the corresponding edge in total length of its subloop, the difference will not be much. Since in a pocketing operation, a few outer loops would cut most of the material, and thus they count the most, it is reasonable to assume that the ratios are the same in these few loops. Therefore, although the optimization process is a simplified method, and may not obtain the true optimum solution, it certainly would achieve one of the better results.
CHAPTER 3
PROGRAM STRUCTURE
While developing a program with a vast amount of entangled data, a method has to be developed to keep track of all data so that nothing is neglected. That is why a data structure is necessary. Standard data structures include stack, array, linked list, tree, etc. However, frequently in a program these types are used jointly. For example, the node of a linked list might be an array, or the node of a tree structure might be a linked list. A distinct data structure should be developed for each program to serve its own purpose. All the example codes in this chapter are written in C programming language or pseudo codes which are sometimes easier to understand.
3.1 Data Representation of a Segment
Each segment, a line or an arc, can be represented by a set of geometric data.
An array storing the coordinates of the starting and the ending points are enough to represent a line. In this case an array of four elements is adequate. The first and the second element of the array will keep the X and Y coordinates of the
28
starting point, while the third and the fourth elements store the coordinates of the ending point.
For an arc, an array of five elements is required, where the first and the second elements are used for holding the arc center coordinate, the third element representing the arc radius, and the fourth and the fifth elements storing the starting and the ending angle with respect to the x axis.
Since it is simpler to use the same scheme to represent all kinds of segments, an array of five is used to hold the geometric data for both a line and an arc, although the last element of the array is idle when representing a line.
Another variable, called TYPE, is required. Its value is used to distinguish the type of segment. If the value of the variable TYPE is 2, then the segment is a line. Variable TYPE with a value of 5 represents a counterclockwise (CCW) arc, and
4 represents a clockwise (CW) arc.
A line segment with (0.0,1.0) and (10.0,11.0) as the starting and ending coordinates is represented as follows:
type = 2, (a line segment)
dt[O] = 0.0, dt[1] = 1.0,
dt[2] = 10.0, dt[3] = 11.0.
An clockwise arc with center coordinate (1.0 1.0), radius 2.0, starting angle r, and ending angle v/2, is represented as follows:
type = 4, (a CW arc)
dt[0] = 1.0, dt[l] = 1.0, dt[2] = 2.0,
dt[3] = v,
dt[4] =/2.
3.2 Linked List Representation
A linked list is a sequence of zero or more nodes, together with a set of operations. Each node contains two fields, an ITEM field that holds information and a NEXT field that holds a pointer to the next node in the list. The fact that each node contains a specification of where the next node is, makes it a linked list. The name of the linkedlist is simply an indication of where the first node may be found; all other nodes must be obtained by following the chain of links [11].
The conventional way to portray a linked list is with a boxandarrow diagram. Each node is shown as a box with an ITEM part on the left and a NEXT part on the right. An arrow leads from the NEXT part to the next node and the last node in the list is shown as a box in which a diagonal line is drawn through the NEXT part to indicate that there isn't any next node. Note that the arrow runs in only one direction. This is a singlylinked list [11].
AList  Ite, A Itm tem C[7
Figure 3.1 A symbolic sketch of singlylinked list
In many applications it is convenient to be able to move through a list in either direction. The answer is to put two link fields in each node, one pointing to the successor and one to the predecessor of the node. The representation is called a doublylinked list. Each node of a doublylinked list contains three fields. Besides the ITEM and NEXT, a PREVIOUS field is added which holds a pointer to the previous node in the list. This convenience is not free. Besides the memory space required for the extra links, more links need to be rearranged and extra complexity is added while manipulating the doublylinked list.
Another variation is that the link in the last node, instead of containing an indication that it is the last node, can point back to the head of the list. This is called a circularlylinked list.
Since a closed loop consists of many segments with one trailing the other, it is ideal to use a circularlydoublylinked list to represent a closed loop.
Figure 3.2 A symbolic sketch of a circularlydoublylinked list
In programming languages, there are two ways to implement a linked list. The older one is called array implementation, and the newer and better one, is called pointer implementation since it relaxes the restriction of prespecifying the sizes of arrays. The Fortran language only allows the former one.
In C programming language, the box of the circularlydoublylinked list is a structure variable which is defined by a customized structure template. The syntax of defining a structure template, called "segment", is shown as follows: typedef struct asegment
{ int type;
double dt[5];
struct asegment *next;
strut asegment *prev;
struct asegment *origin;
) segment
32
This structure template contains an integer variable "type", an array "dt" of five doubleprecision real numbers, and three pointer variables named "next", "prev", and "origin" separately. Among the variables, "type" and "dt" are the "ITEM" part of the linked list, their purpose being already stated in Section 3.1.
The statement that causes a structure variable "aseg" to be created according to the above structure template is segment *aseg;
Also the following statement is needed that will allocate a memory block and will assign the address of the memory block to the structure variable "a_seg". aseg = (segment *) calloc (1, sizeof(segment)); After that, "a_seg" is a structure variable which holds the address of the newly allocated memory block. In other words, the structure variable "a seg" is a pointer pointing to the memory block.
A memory block occupies many continuous memory locations, 24 continuous memory locations at 48 bytes in this case, and its address is also the address of the first memory location. The pointer variables next, prev, and origin will hold the addresses of the other memory blocks.
The access of a structure member is through the structure member operator ">". For example, to assign a value of 2 to the integer variable "type" of the structure variable "aseg", the C language syntax is
a_seg>type = 2;
Assume that the three vertices of a clockwise triangle are denoted as (0,0), (0,1), and (1,1) separately, and the line segment from (0,0) to (0,1) is the starting segment of the triangle. After proper assignment of this data to the appropriate memory locations in three memory blocks, in Table 3.1, three charts in double lines show how the memory blocks hold data. The variables in each memory block include those needed to represent a line segment which are variables "dt" and "type" (refer to Section 3.1), and variables "next", "prev", and "origin". Notice how variables "next" and "prev" save the addresses of the next and previous memory blocks. For example, the value in variable "next" of the first memory block is 509976 which is also the address of the second memory block. The value in variable "prev" of the first memory block is 476542 which is also the address of the last memory block. By following the same rule, it is easy to find out how the memory blocks interact with each other. In Table 3.1, the single lines show some examples of interaction between addresses and values. Each time when the memory allocation statement is invoked, the computer will allocate the available memory blocks. Hence the addresses are pseudo numbers in Table 3.1. Note that the name of the structure variable, which points to the first memory block, is the header whose value is the first memory address of the block. From this particular address, all data are retrievable.
Table 3.1
An example of data storage in a circularlydoublylinked list
HEADER
type > 5080LE a dt[O] 541ii 0.0
r
i dt[l] "'"770.
a
* dt[3] "' U 1.
* dt[4] "" I m next ...[61
e
s prev . 476542 origin LIZZE
* u : unassigned.
addrs vlu 509976l 509977L0.0 z..z1.0
...L 1.
...I1EE
o J j U
...11W
zzzesii:lo
EXle ZIIIJEl2
IZI43JEIK.
3.3 Tree Representation of a Pocket and its Spiral Tool Paths
A pocket profile and its tool paths are a number of closed loops constituted by several segments (line segments or arcs). The outer loop is called the parent and it inner loops are the children. A parent can have several children, but any child can only have one parent. All loops can have no intersection between each other.
Figure 3.3a shows a topological representation of a pocket and its spiral tool paths. In the figure the outermost loop, loop A, symbolizes the pocket profile. The other loops represent the tool paths. Loop A has one child, which is loop B, loop B has three children, called loop C, loop D, and loop E respectively, and etc. It is immediately recognizable that a general tree representation will perfectly match Figure 3.3a. Figure 3.3b is the equivalent general tree representation of Figure 3.3a. In Figure 3.3b, node A has one child, called node B, node B has three children which are node C, node D, and node E respectively, and etc.
To explain the "general tree" better, the idea of a "binary tree" has to be mentioned first. The definition of a binary tree is: a binary tree is a set of nodes that is either empty, or consists of a root and two disjoint binary trees called the left subtree and the right subtree. A node contains information, the nature of which depends on the application. [11]
36
The difference between a "general tree" and "binary tree" is that the general tree relaxes the requirement that each tree node has exactly two children. Instead, the general tree can simply have zero or more children.
Binary trees can be easily used to represent general trees. The basic idea of representation is to order the children of a general tree node, say, from left to right. Now in the binary tree representation, each has two link fields, which are called FIRST and NEXT, rather than LEFT and RIGHT. The FIRST field of a node points to the first (leftmost) son of the general tree node. And the NEXT field points to the next sibling node. The correspondence between these two tree representations is illustrated by Figure 3.3b and 3.3c. Figure 3.3c is the equivalent binary tree for Figure 3.3b. Here in Figure 3.3c, the first child of node A is node B, and the first child of node B is node C. Both node A and node B have no siblings. But node C has two branches, one pointing to its first child, node F, and the other to its next sibling, node D. Node D, which is the same as node C, is also a child of node B, and etc.
There are several advantages in using the binary tree data structure in representing tool paths. For example, the tree traversal by using the recursive method, which will be mentioned in Section 3.6, can be used to create the tool path for any exotic pocket with as many islands as desired.
G
A
(b) C D
A
C
(c) D .1 G=
Figure 3.3 Representing tool path as a tree
(a) topological representation of a pocket
and its tool paths
(b) the equivalent general tree
(c) the equivalent binary tree
3.4 Program Implementation of a Binary Tree
Like a linked list, there are two ways to implement the binary tree representation, one called the array implementation, the other known as a pointer variable implementation. Here the latter one is chosen.
First a particular structure template named "node" for the tree node is defined as follows: typedef struct nd
{ int ndtype;
int ndindex;
struct nd *first;
struct nd *next;
struct nd *parent;
struct seg *start;
) node;
If a structure variable "anode" is designated according to template "node", the statement is node *anode;
The next statement will allocate a memory block and then will assign its address to the variable "anode". The syntax is anode = (node *) calloc (1, sizeof(node)); After that, "anode" is a pointer pointing to the newly allocated memory block.
The pointer variable "first" of the structure holds the address of a structure representing its first child, and "next" holds the address of another structure representing its
39
next sibling. These two pointer linkages of each node make the connection among general tree nodes.
The other pointer variables include "start" and "parent". The pointer variable "parent" of the structure points to the memory block representing the parent node. This variable is useful in finding the passages between loops.
The pointer variable "start" of the structure is the header of a circularlydoublylinked list (refer to Section 3.2). In other words, "start" holds the address of the first memory block of the circularlydoublylinked list. The linked list holds all the data representing a closed loop. From pointer "start", any data at any segment on the closed loop is retrievable. For example, if variable "aninteger" is assigned the value of variable "type" at the second segment of the closed loop, the following statement will do the work: aninteger = anode>start>next>type; Here, the second segment is interpreted as the one next to the starting segment. The value of variable "type" of the third segment will be obtained by the following statement: a_node>start>next>next>type; The value of "type" of the last segment will be obtained by: a_node>start>prev>type;
Here, the last segment is the one previous to the starting segment. Usually a dowhile loop in the computer program is used to reach all segments in a loop.
40
Two integer variables ndtype and ndindex of the template will indicate the validity of the tree node.
The relationship of the tree nodes and the doublylinked list is shown by Figure 3.4. Figure 3.4a illustrates the tool paths for a pocket and Figure 3.4b depicts the matching tree and linked lists. The figure shows the following relations: Loop A  first = Loop B; Loop A > next = NULL; Loop A > start = Segment 1; Loop B > first = Loop C; Loop B > next = NULL; Loop B > start = Segment 9; Loop C > first = NULL; Loop C  next = Loop D; Loop C > start = Segment 19; Loop D > first = NULL; Loop D > next = NULL; Loop D > start = Segment 24; Segment I > next = Segment 2; Segment I > prev = Segment 8; Segment 2 > next = Segment 3; .... etc.
3.5 Island Representation
The islands are a string of independent closed loops within the pocket boundary and without any intersection among
Loop A (POCKET BOUNDARY)
Figure 3.4 A example of tool paths for a pocket and its
matching tree and linked lists
42
them. The islands are represented by another linked list. Each node of the linked list represents an island profile.
In the programming language, the node of the linked list is a pointer variable which points to a memory block or in other words holds the value of the address of the memory block. The memory block will contain two pointer variables, "next" and "start". Pointer variable "next" points to the next island. Pointer variable "start" points to the starting segment of the island profile. All segments of an island profile will form a circularlydoublylinked list.
Instead of defining another structure template for island representation, the same structure template, used to represent the tree nodes, is used in representing the nodes of the linked list for islands. The trick is that all other pointer variables, which are useless for island representation, are given a value of NULL.
In the beginning, using the same structure template in representing both islands and tree nodes may waste a few unnecessary memory spaces. But overall the program will be shorter and simpler because there are fewer cases to distinguish, and thus the executable file is smaller and computational time is saved.
Figure 3.5a demonstrates a pocket with four islands, and Figure 3.5b shows the representation of those island profiles. Note that the left side of Figure 3.5b is a linked list. Island 1 points to Island 2, Island 2 points to Island 3, and
Figure 3.5 An example of pocket containing islands and the
linked list representation of the islands
44
so on. The last island, Island 4 will point to NULL. The right side of Figure 3.5b contains four circularlydoublylinked lists. The relationship of those nodes can be written by the following expressions:
Island 1 > next = Island 2, Island 2 > next = island 3,
oooooo
Island 4 > next = NULL. Also,
Island 1.> start = Segment A, Island 2 > start = Segment E,
Island 4 > start = Segment M.
3.6 Tree Traversal
The tree traversal means "visiting" all the nodes of a tree. Here visiting a node may mean cutting along a loop in the pocket. The traversal of a binary tree is approached through the recursive definition. There are three generally used tree traversals:
(a) preorder traversal:
1. Visit the root.
2. Traverse the left subtree.
3. Traverse the right subtree.
(b) Inorder traversal:
1. Traverse the left subtree.
2. Visit the root.
3. Traverse the right subtree.
(c) Postorder traversal:
1. Traverse the left subtree.
2. Traverse the right subtree.
3. Visit the root.
But in the general tree representation, first and next are used instead of left and right. Consider the tree of Figure
3.3b, The three traversals are:
(a) Preorder traversal: A B C F J G H D E I.
(b) Inorder traversal: J F G H C I E D B A.
(c) Postorder traversal: J H G F I E D C B A.
While the representative tree is completely constructed, moving through a tree node may mean cutting around a closed loop. In this case, the preorder traversal can be treated as the cutter moving from outside in, while the inorder traversal is the cutter moving from inside out. The postorder traversal is meaningless in this tree representation.
Since the preferred tool path is from outside to inside, only the programming implementation of preorder traversal is mentioned here. The first step is to create a procedure named "cutaroundloop", which will direct the cutter moving along a closed loop. After that the procedure, named "cutinto", will complete the cutter movement as desired. Procedure "cutinto" is listed as follows: cutinto (root_node)
node *rootnode;
( if (rootnode I= NULL) /* rootnode not equal to NULL */
4 cut aroundloop (rootnode);
outinto (rootnode>first);
/* procedure cutinto calls itself */ cutinto (rootnode>next);
/* procedure cutinto calls itself */
)
Notice that a recursive method is used here. Recursion, as a programming technique, comes into play any time a procedure calls itself. Recursion makes a program easier to write and to understand than its nonrecursive counterparts.
The other usage of preorder traversal is in constructing a tree map. First a subroutine, called "findchildren", is needed. The purposes of the subroutine are to obtain all the subloops from a larger loop and to construct pointer linkages between this loop and the resulting subloops. Preorder traversal technique provides a way to reach every node, and then the subroutine "findchildren" can be used to find all of its offsprings. Preorder traversal will again treat those offsprings as larger loops and "findchildren" would find their offsprings. By continuing this process the tree map will be fully constructed. The following subroutine, called "constructtree", is designed to perform the process mentioned above.
constructtree (rootnode)
node *rootnode;
{ if (rootnode != NULL) /* rootnode not equal to NULL */
( findchildren (rootnode);
constructtree (rootnode>first); constructtree (rootnode>next);
)
Again, a recursion technique is used here. When the above subroutine is invoked, Figure 3.6 shows the sequence of constructing a tree from the outermost loop to obtain a tree map of Figure 3.3c. The above two programs have been simplified to explain the concept of using preorder traversal, although the real ones have more details to consider. Another place that the preorder traversal method is used is in finding the passages between closed loops described in Section 5.5.
48
0=
Figure 3.6 The tree construction sequence by subroutine
"constructtree's
CHAPTER 4
SOME SUPPORTING SUBROUTINES
4.1 Classifying InsideOutside Relation of a Point and a Closed Loop
The winding number [12) reveals the relationship between a closed loop and an arbitrary point. Three cases are possible as shown in Figure 4.1. The winding number equals 1 in the first case. It happens when a point p0 is inside the closed loop and the loop is CCW. The second case is one in which the point p0 is inside the loop and the loop is CW. Under this circumstance, the winding number is equal to 1. The third case is when p0 is outside the loop. Then no matter what the direction of the loop, the winding number equals 0. The winding number of a closed loop is denoted as follows.
n
w WI, (4.1)
where n is the number of segments which construct the closed loop. And
I (XI ((t) P,) yj/ t)  (Y1 (t) P,) xJ. (t~d 42
W tdt (4.2)
2 (xif(t)Wp")2 I+ (y1(t)py)2
where (Px,Py) is the coordinate of point p0, (xi(t),yi(t))
(2) PO
(3)
PO
Figure 4.1 Three cases of winding number
(a) winding number = +1 (b) winding number = 1 (c) winding number = 0
51
represents the coordinate of any point along the i'th segment
of the loop, and x' I(t) and y' I(t) are the first derivatives of x,(t) and y1(t) respectively with respect to t.
If the i'th segment is a line segment which has (al,bl) and (a2,b2) as the starting and ending point, then it is represented as:
x1(t) = a, + t (a2al)
yi(t) = b, + t (b2bl), for 0 t 1 (4.3) If the segment is an arc, it is represented as:
xi = x, + r cos(t),
Y(t) = y, + r sin(t), 01 ) t < (2 for CCW arc (44) el k t k 02 for CW arc
where (xc,yc) is the arc center coordinate, r is the arc radius, e1 is the starting angle, and e2 is the ending angle. For example, if the arc is counterclockwise spanning from 0 to
0.5r, then
81 = 0, 62 = 0.5 ,
or if it is a clockwise arc spanning from 0.5v to 1.5r, then
01 = (0.5 + 2) x = 2.5 u, 02 = 1.5 n.
The exact solution of W, for the i'th segment can be obtained by integral if the segment is an arc or a line segment. But if other kinds of curves are involved, numerical integration may have to be applied. The computational results of the winding number Wi are shown as follows:
(A) For line segment
Let constants c1, c2, and c3 be
c, = (a,  p,) (b2  bl)  (b,  py) (a2  a),
c2 = (a2  al)2 + (b2  b, )2,
c3 = 2(b2  bl) (b,  py) + 2(a2  a,) (a,  p,)ï¿½ The winding number Wi will be
Wi = 0,
for ci = 0
SCI [ tan1 2c2 + c3  tan1
2 % 2c11 2tCn 1
(B) For arc Let constants
CI = Xc  Px C2 = Yc  Py,
C3 = r2 + c 2 + c 2,
c4 = 2 r (ci2 + c22)0.5,
83 = tan"1 (cl/C2)
83 = tan"1 (ci/c2) + 7r
83 = 0.57r 83 = 0.5r
The winding number W, will be
for c, i 0
(4.5)
(4.6)
when c2 > 0, or when c2 < 0, or when c2 = 0 and c1 > 0, or when c2 = 0 and c1 < 0.
if (r2_C1c2) = 0
Wi=(02 4 a 1)
(4.7)
(2  n1) if C = C = 0 (4.8) Otherwise
S0201 r2c 2 C c3 tan(0.5m) + qm02+83
, 2 + 1 tan' (4.9)
4 n r 2_c _C 22 r  C4 C22 2*e
Notice that, because of the limitation of the function tan, the range of m should always be between w and r. Thus, in the case of m ranging from 0 to 1.57, it is necessary to change its range to from 0 to r plus from w to 0.5r. Additionally, it has to be kept in mind that the value of the tan"1 part of the Equation 4.9
tan c3 tan(0.5m) + 4  ifm =n,
r2 C C 2
= if M= 7c
2
Notice that since the exact solution instead of the numerical approximation is used, the result is very accurate even if the chosen point is very close to the loop. The error usually is between ï¿½ 0.001.
The winding number is used to classify the direction of a closed loop as well as to distinguish the insideoutside relationship between a certain point and a loop.
The reason to check the orientation of a loop is that the validity of a loop is determined by its direction. While obtaining the subloop from a previous loop, the geometry may cause a crossing between offsets. In such a case, one outer loop generates two or more subloops. If a pocket consists of
54
islands, they are included by successively expanding their boundaries segmentwise. Again intersections may cause multiple subloops. In both cases, only those subloops with the same orientations as its larger loop are valid. Those with different orientation are eliminated and it is not necessary to find their subloops in the next path generation process.
Since a point is needed while calculating the winding number, in order to find out the orientation of a loop, an appropriate point has to be chosen. If the calculated winding number can not be used to determine the orientation, it is necessary to try another point. The procedure of classifying the orientation is:
(1) Find the midpoint of the first segment of the loop boundary.
(2) Find the point which is at a distance of +0.05 times the segment length from the midpoint and on the line perpendicular to the segment at the midpoint.
(3) Find the winding number. If it is between +1.001 and +0.999, the loop is CCW and the program is terminated. If it is between 1.001 and 0.999, the loop is CW and the program is terminated. If neither is the case, the procedure needs to be continued.
(4) Repeat step 2 except the distance is 0.05 times the segment length, and then perform step 3 for the new point.
(5) Find the midpoint of the next segment until all the
segments are reached, and then repeat step 2 to step 4.
(6) If the orientation still can not be determined, it can be claimed that the loop is too small to be a valid loop.
The following case is another example of using the winding number. If a subloop, obtained from continuously shrinking pocket boundaries, is inside the expanded loop of an island boundary, then this loop is invalid. The situation of a closed loop inside another closed loop should satisfy the condition that each segment in the first loop is inside the second loop. The condition of a segment being inside a closed loop can be checked by the following two conditions:
(1) No intersection exists between the segment and the loop, or if intersections did exist, they are at the end points or at the tangent.
(2) An appropriate point on the segment is inside the loop. The winding number calculation comes in handy to verify the second condition.
4.2 Intersection of Two Segments
Three kinds of intersection are expected which are intersection of two line segments, of a line segment and an arc, and of two arcs.
The procedure to find the intersection between two line segments involves the following three steps:
(1) Find the unlimited lines which contain the line segments.
(2) Find the intersection between these two unlimited lines.
56
(3) Check the found point to verify whether it belongs to both line segments.
The procedure to find the intersection between a line segment and an arc involves the following steps:
(1) Find the unlimited line which contains the line segment, and the circle which encloses the arc.
(2) Find the intersection(s) between the unlimited line and the circle.
(3) Check the found point(s) to verify whether it belongs to both the line segment and the arc.
The procedure to find the intersection between two arcs is arranged by the following steps:
(1) Find the intersection(s) between two circles which have the same center coordinates and radii as the two arcs.
(2) Verify whether the found point(s) is on both arcs.
Several supporting subroutines are needed for the above three procedures. Their names are: "linedir", "point on linesegment", "pointonarc", "line 2_points", "intersection_2_lines", "intersection line circle", and "intersection 2 circles".
The purpose of subroutine "line dir" is to obtain the direction angle of a line segment with (x,y,) and (x2,y2) as the coordinates of the starting and ending points.
Subroutine "point online segment" has the arguments xl, Y1, x2, Y2, x3, and y3. The line segment is denoted by two end points with coordinates (x2, y2) and (x3, y3). If point (xj,
57
Yl) is on the line segment, the subroutine returns TRUE, and otherwise FALSE. Note that even if the point is not on the line segment, but with a distance of less than 0.00005 inch, then the subroutine will return TRUE, since in most NC milling machines the accuracy is only up to 104 inch. The clearance of 0.00005 inch also applies to the subroutine "pointonarc".
Subroutine "line_2yoints" will return the coefficients a, b, and c of the line equation
ax + by + c = 0.
The input arguments are the coordinates of two end points, (Xl, yj) , and (x2, Y2)"
Subroutine "intersection_2_lines" will return the coordinate of the intersection point. The input arguments are a,, b,, ci, a2, b2, and c2 which represent two unlimited lines
alx + bly + ci = 0,
and
a2x + b2y + c2 = 0.
Subroutine "intersectionline circle" will return the number of intersecting points (0, 1, or 2) and their coordinates if the intersection exists. The input arguments are a, b, c, x, y, and r. Arguments a, b, and c are the coefficients of a line equation representing an unlimited line, and (x, y) and r represent the center coordinate and radius of a circle.
The subroutine "intersection 2 circles" will return the number of intersecting points (zero, one, or two) and their
58
coordinates if the intersection exists. The input arguments are the center coordinates and radii of these two circles.
The algorithms of the above two subroutines are built by the geometric relation between segments rather than by solving the roots of two equations. The method of finding the intersection of a line and a circle is listed as follows: Given: the coefficients a, b, and c of equation ax+by+c=O
which represents Line A, the center coordinate (x0, Y0),
and the radius r0 of the circle. All notations are
defined in Fig. 4.2.
Solution:
(1) Find d, the distance between (x0, y0) and Line A,
I ax0 + by0 + c
(a2 + b2)0.5
(2) If d > r0 + 0.00005, no intersection exists.
Else if r0  0.00005 d < r0 + 0.00005, n = 1. Here n
is the number of intersection point.
Else n = 2.
(3) Assume that Line B is the line which passes through
(x0,Y0) and is perpendicular to Line A. The equation of
Line B is
bx + ay + (bx0  ay0) = 0.
Find the intersection, point (xl,Yl), of Lines A and B.
(4) If n = 1, the coordinate of the intersecting point
between Line A and the circle is (xl, y1)" Else if n=2,
then
Figure 4.2 Linecircle intersection
FIgure 4.3 Circlecircle intersection
(i) find 91, the direction angle of ax + by + c = 0;
(ii) the intersection points (x2, y2) and (x3, Y3) are
x2, x3 = xï¿½ ï¿½ (ro2  d2)0.5 cos (1)
Y2, Y3 = Yï¿½ ï¿½ (ro2  d2)0. sin (91)
The method of finding the intersection of two circles is listed as follows: Given: (xa, ya) and ra, the center coordinate and radius of
Circle A, and (xb, Yb) and rb, the center coordinate and
radius of Circle B. All notations are defined in
Figure 4.3.
Solution
(1) Find the distance between two centers,
d = ((xb  xe)2 + (Yb  y,)2)0..
(2) If d > (ra + rb + 0.00005), then n = 0. Here n is the
number of intersection points.
Else if (ra + rb .00005) < d < (ra + rb + .00005), then
n = 1.
Else if d < (Ira  rbl  .00005), then n = 0.
Else if (Ira  rbl  .00005) < d < (Jr.  rbl + 0.00005),
then n = 1.
Else n = 2.
(3) Find el, the direction angle of the vector from (X,, y)
to (Xb, Yb)"
(4) If n = 1, 82 = 0.
re2 + d2  rb2
Else if n = 2, then e = cos'r( ).
2 red
61
The coordinates (x0, y0) and (xl, yl) of the intersection points are
X0, xI = xa + r, cos (e1 ï¿½ 8) Y0, Y =Y. + ra sin (E1 ï¿½ 8)
CHAPTER 5
FINDING THE TOOL PATH OF A POCKET
The tool path for a pocketing operation can be divided into two portions: One is the initial slotting pass around the pocket profile as well as around the island profiles, if islands exist. The other is the spiral machining pass from the outside in. The tool path of the slotting pass is the shrunk offset loop from the pocket boundary with the distance being expressed as a sum of the tool radius plus the desired finishing immersion. On the contrary, the expanded offset loops from island profiles are the slotting tool path for islands. Thus, the tool passes for slotting are found by using equal offset distance. For the spiralin tool path, the optimization process, mentioned in Chapter 2, can be used to determine the radial immersions. Each machining direction will use an immersion which may be different from that of the other machining directions. These optimized immersions are the offset distances for finding the continuous shrunk offset loops from the slotting pass loop. These offset loops, found by using unequal offset distances, become the spiralin tool passes.
5.1 Finding Offset Loops of Equal Offset Distance
The process of finding an offset loop from a closed loop is comprised of three steps as follows:
1. finding the offset of each segment on the original loop.
2. linking pair by pair the offset segments whose original segments are adjacent thus resulting in a gross offset loop.
3. splitting the gross offset loop into several subloops. These steps are explained in detailed below.
5.1.1 Finding the Offset of Each Segment on the Original Loop
The offset of a line segment is a parallel line segment at an offset distance. Figure 5.1 shows the relationship of a line segment LI and its two offset segments, 01 and 02. Segment LI starts from (a, b) and ends at (c, d). The offset distance is D. The starting points of 01 and 02 are
1start = ( ï¿½ D(bd) ï¿½ D(ca) ) (5.1)
02,start (ca)2+(db)2 " I(ca)2+d)2
The ending points of 01 and 02 are
01,end = ( ï¿½ D(bd) +ca , ï¿½ D(ca) +db )(5.2)
02,end V (ca) 2+ (db) 2 (ca) 2+ (db) 2
Since, in Section 3.1, it has been defined that the coordinates of the starting and ending points are used to represent a line segment, offset segments 01 and 02 are determined by the above expressions.
Figure 5.1 The relationship of a line segment, Lj,
and its offset segments, 01 and 02
A Clockwlse Cosed Loop
Figure 5.2 Adding extra arc to connect two offsets
65
The offset segment of an arc is another arc of the same orientation, either CW or CCW. As defined in Section 3.1, geometrically an arc is represented by its center point coordinates, its radius, and the starting and the ending angle with respect to the X axis, and topologically an arc is "type" 4 if CcW and "type" 5 if CW. The "type" of the offset arc will remain the same as its original arc. Geometrically, the offset arc will be represented by the same center point coordinates, starting angle, and ending angle as the original arc. However, the radius of the offset arc is an offset distance greater or smaller than the original arc. There are cases when the radius of the original arc is smaller than the desired offset distance. In this circumstance, the arc has no inner offset arc.
5.1.2 Linking the Offset Segments Whose Original Segments Are Adiacent
The linking process between two offset segments can be separated into two cases. These two cases are distinguished by the angle between the neighboring parent segments on the original closed loop, this angle being greater or lesser than 180.
5.1.2.A Case 1: the Angle Is Greater Than 1800
As shown in Figure 5.2, since e is greater than 1800, an extra offset arc is added to connect these two offset
66
segments. The radius of the added arc is the offset distance. The center of the added arc is the common end point of the two original segments. The starting and the ending angle of the added offset arc are related to the leading and the trailing offset segment separately. In the case of a CW closed loop, if the leading (or the trailing) segment is a line segment, the ending (or the starting) angle of the added offset arc is 900 lesser than the direction angle of the line segment. If the leading (or the trailing) segment is a CW arc, the ending (or the starting) angle of the added offset arc is 1800 greater than the starting (or the ending) angle of the CW arc. If the leading (or the trailing) segment is a CCW arc, the ending (or the starting) angle of the added offset arc is the same as the ending (or the starting) angle of the CCW arc. Similar method can be applied if a CCW closed loop is involved.
5.1.2.B Case 2: the Angle Is Lesser Than 1800
First, the intersection between a pair of neighboring offset segments needs to be found. As shown in Figure 5.3, if an intersection exists, the intersection point will be assigned as the end point of this pair of offset segments. The assignment means that the data representing the offset segments need to be updated depending on the types of offset segment (line segment, CW arc, or CCW arc) and on the coordinate of the intersection point.
/eegmet A
SSegmen B
41
Figure 5.3 Connection of the intersecting offsets
Segment A
Segment B
Offset of Sonn Segment B
Auxilary Lne
Figure 5.4 Adding auxiliary line while e < 1800 and no
intersection exists between two offsets
68
If no intersection exists between the pair of neighboring offset segments, as shown in Figure 5.4, an auxiliary line segment is added to connect the ending point of the trailing offset segment and the starting point of the leading offset segment. This auxiliary segment is marked with a different status from the ordinary offset segments. Later, the purpose of the auxiliary segment will be explained.
5.1.3 Splitting the Gross Offset Loop into Several Subloops
In many cases, the offset loop may result in the situation as shown in Figure 5.5 where the offset loop consists of five subloops. The subloops 1, 3, and 5 have the same orientation (CW) as the original loop, but not subloops 2 and 4 (CCW). The criteria of determining the validness of a subloop is by its orientation. When the subloops are in the opposite direction to their original loop, they are invalid. On the other hand, they are valid when they are in the same direction. Therefore, subloops 2 and 4 are discarded while subloops 1, 3, and 5 are kept. Notice that the computer is not capable of identifying whether a offset loop is a combination of many offset subloops or not. Thus, a procedure called "split" is created to divide the offset loop into several subloops if necessary. After that, the winding number calculation mentioned in Section 4.1 is used to determine the orientation of each subloop. The algorithm of "split" is as follows:
(a) U I I I (b)3
Figure 5.5 An example of using procedure "split" to
result in multiple subloops
1. Initialize Loop L as the original offset loop.
2. Initialize Segment A as the starting segment of Loop L. 3. Initialize Segment B as the next segment of Segment A.
4. Find the intersection of Segment A and B. If no intersection exists, or only one exists while Segment A and B are two adjacent segments, update Segment B to its next segment.
If one or more intersecting points are found between Segment A and Segment B, a sibling of Loop L, say Loop L', is created by dividing Loop L into two loops at the intersecting point nearest to the starting point of Segment A.
The splitting procedure after the intersection point is found is shown in Figure 5.6. First, Segment A and B are divided into two segments from the intersecting point separately, say Segment A and A', and Segment B and B'. Memory blocks have to be allocated to save the data representing Segment A', Segment B', and Loop L'. Care must be taken to see if the intersecting point coincides with the ending points of Segment A (or B). In such case, no memory allocation is needed for Segment A' (or B'), and the next segment of Segment A (or B) is assigned as Segment A' (or B'). The second step is to reconstruct the linkages between segments and between loops. They are
Segment B'> previous = Segment B > previous;
Segment B' > next = Segment A';
Segment A' > next = Segment A > next;
Loop L Segment Ae
SegMent B' > prevAous = Segment B > previous
Segment B' > next = Segment A'
Segment A' > next = Segment A >next
Segment A' > previous = Segment B'
Segment A > next = Segment B
Segment B > previous = Segment A Loop L' > next = Loop L > next
Loop L > next = Loop L'
Loop L' > start = Segment B'
Figure 5.6 The "split" procedure after intersection
point found
Segment A' > previous = Segment B';
Segment A > next = Segment B;
Segment B > previous = Segment A;
Loop L' > next = Loop L >next;
Loop L > next = Loop L';
Loop L' > start = Segment B'.
Notice that the sequence of the above statements does matter. They are not allowed to switch randomly.
5. If Segment B is not the starting segment of Loop L, return to step 4.
6. Update Segment A to its next segment. If Segment A is not the previous segment of the starting segment of Loop L, go to step 4.
7. Update Loop L to its next sibling. If Loop L is not NULL, go to step 2.
8. Starting from the first subloop, every segment on each loop is checked for the existence of an auxiliary line segment. If one or more auxiliary line segments are on a subloop, this subloop is invalid. If the subloop contains no auxiliary line segments, the orientation of the subloop is verified. If the orientation is not the same as the original loop, the subloop is invalid too.
In term of programming techniques, each subloop is represented by a string of data which occupies an allocated memory block. When a subloop is declared invalid, this memory block has to be freed up so that it can be used again.
73
Otherwise, the memory block becomes an unused area in the system. For a pocket of complex geometry, while calculating the tool path, a lot of invalid subloops are created. Too many unfreed memory blocks may result in the system running out of memory and the calculations being terminated. Notice that before a subloop is abandoned, the linkages between its previous and its next siblings have to be set up.
5.2 Finding Offset Loops of Unequal Offset Distances
The process of finding the offset loops of unequal offset distances consists of three steps as follows:
1. finding the offset segment of each segment on the original loop, and then
2. connecting each pair of neighboring offsets to form a gross offset loop, and then
3. using the subroutine "split" of Section 5.1.3 to divide the gross offset loop into several subloops, and then using the "winding number" algorithm to check the legitimacy of each subloop.
The third step is the same as that used in finding the offset loops of equal offset distance. Since the procedure has been mentioned in Section 5.1, there is no need to explain it repeatedly. The first two steps are explained in more detail below.
74
5.2.1 Finding the Offset of Each Segment on the Original Loop
It has been explained in Section 1.2 that, when unequal offset distances are used, the offset segment of an arc will not be an arc. Therefore, a simple and preferred way of finding the offset of an arc is by using a series of line segments to approximate this arc, finding the offset of each line segment, and then connecting these offset line segments which become the offset of the arc. The criteria of approximating an arc by line segments is:
1. If the radius of the arc to be approximated is so small that an user specified allowable difference is greater than it, the arc is replaced by a line segment. Otherwise, the second and the third rule will be applied.
2. The interval of arc span for each line segment is no more
than 200.
3. The maximum difference between the arc and its approximated
line segments can be no more than the allowable difference.
Figure 5.7 shows an example of the conversion. In the figure, D represents the user specified allowable difference, S the span of the arc, and R the radius of the arc. D, S, and R combined will determine the number of line segments, N, needed to approximate the arc. N, which is an integer, can be calculated by the following equation.
N = INTR( S ) + 1
2 cos1 ( RD ) (5.3) Rj D
75
As soon as N is found, the coordinates, (Px,iPy, j) in Figure 5.7, of the end points of the line segments will be
(P, i,P, i)=(R cos(8+ ' ),R sin(O+ I )) for i=0, ..,N (5.4) N N
where 8 is the starting angle of the arc. In order to save the data representing these line segments, memory allocation and linkage construction are needed.
(P.oPYo)
(P4,Py4)
Figure 5.7 Approximation of arc by line segments
After every arc has been converted to a string of line segments, the only type of segment left on the original loop will be line segments. In addition, after the initial slotting, there are no outside corners left. Therefore, it is not necessary to add an extra arc between two offset segments. As a result, there will only be line segments involved in finding the offset loop of unequal offset distances.
76
5.2.2 Connecting Each Pair of Neighboring Offsets to Form a Gross Offset Loop
There are three cases which arise during the process of connecting the offsets of two neighboring line segments if unequal offset distances are used. The first case of connection occurs when the two offset segments intersect. In this situation, the connection is formed after the intersection point is set to be both the ending point of the preceding offset and the starting point of the trailing offset.
The offset segments do not cross each other in the second and the third case. These two cases can be distinguished mathematically by the following equation.
0 = 61 + 02  83 (5.5) In this equation, 91 is the angle between the offset of the leading segment and an imaginary segment which connects the ending point of the leading offset segment and the starting point of the trailing offset segment. 02 is the angle between the imaginary segment and the trailing segment. 03 is the angle between the two original line segments. In the second case, the result of 0 in Equation 5.5 will be r, and will be 3v in the third case.
The three cases are better demonstrated by Figure 5.8. Figure 5.8a is a closed loop formed by five line segments which are Segment A to Segment E. And Figure 5.8b shows the closed loop and the five offset segments, Segment A' to E', of
Segment A
Segment E
(a)
Offset of Segment E
(b)
\Segment B Segment C
Circle 1
Offset of
Circle 4
(C) Ciircle 3 auxiliary
Figure 5.8 A example of finding offset loop of unequal
offset distances
(a) The outer loop
(b) 5 offset segments found
(c) The gross offset loop found
78
Segment A to E separately. Since Segment E' intersects Segment A', the connection between these two offsets belongs to case 1. So are the connection between Segment D' and E', and between C' and D' as well. However, no intersection exists between Segment A' and Segment B', nor is there any between B' and C'. Figure 5.9 is a closeup look at circle 1 of Figure 5.8b. It shows the three angles, 01, e2, and e3, of Equation 5.5 between Segments A, B, and their offsets, A' and B'. Since the resulting 0 is 37r, the connection between Segment A' and Segment B' is case 3. Figure 5.10 demonstrates the same angles between Segments B, C and their offsets at circle 2 of Figure 5.8b. The connection between B' and C' is case 2 since the resulting e of Equation 5.5 is r.
The obvious solution for connection in the second case is shown in circle 3 of Figure 5.8c between the offset of Segment B and the offset of Segment C. The result can be achieved by 1. Finding the unlimited lines containing Segment B' and C'. 2. Finding the intersection point of these two unlimited lines.
3. reassigning the intersection point as the ending point of Segment B' and the starting point of Segment C'.
The right connection for the third case, shown in circle 4 of Figure 5.8c between the offset of Segment A and that of Segment B, is by appending an auxiliary line. The extra loop with the auxiliary line will be discarded later by executing the subroutine "split" mentioned in Section 5.1.3.
Offset of Segment B
Figure 5.9 Case 3
92
ient A
Segment B fset of gment A connection: 0 = e2 +
Offset of
Segment B
93  81 = 5400
Offset of Segment
Segment B
;egment C
Figure 5.10 Case 2 connection: 0 = e2 + 83  e1 = 1800
80
Notice that in the situation as shown in Figure 5.11, the connection between the offsets of Segment A and B is a case 1 since they intersect with each other. However, since the offset of Segment B does not cross the offset of Segment C, the offset connection belongs to case 2 or case 3. By further calculation, e of Equation 5.5 is 3r. It is thus categorized as a case 3 situation. An auxiliary line is needed to connect the two offsets of segments B and C. However, adding an auxiliary line directly as shown in Figure 5.11c would not achieve the desired outcome as shown in Figure 5.11e. As a result, in order to accommodate this kind of situation, if the offset finding is a case 3, before appending the auxiliary line, the preceding offset is extended backwards a certain distance, and the trailing offset forward the same distance. This certain distance is set to be the tool radius. The undesired loop, shown in the upper left part of Figure 5.11d, will be discarded later by executing "split" of Section 5.1.3.
5.3 Tool Path of a Pocket with Islands
When islands are present within the pocket boundary, the tool path finding procedure is more complicated than without islands. From the linked list depicting the island profiles (see Section 3.5 of island representation), another two linked lists with the same representation as that of the island profiles are created using the offsetting algorithm. Each node of the first created linked list represents the first
g S e g m en C
Segment B
Line
// \ Auxitiary Line
Segment A
Figure 5.11 Another example of connecting offsets
(a) 3 segments on an outer loop
(b) 3 offset segments before connection
(c) Adding auxiliary line without extending
the offsets of B and C
(d) Adding auxiliary line after extending
the offsets of B and C
(e) The desired outcome
82
outer offset loop of an island profile. The offset distance is the same for all directions and is equal to the tool radius plus the radial depth of cut for finishing. Therefore, each node of the first linked list represents the slotting (contouring) path of an island profile and thus this linked list represents the slotting path of all of the island profiles. The nodes of the second linked list represent the outer offset loops of the contour tool path around the islands. The offset distances are the result of the optimization process (see Chapter 2) and may vary. The purpose of the second linked list, say "List outisland", is explained below.
After finding all subloops from a closed loop which is a descendent of the pocket profile, these subloops are checked to see if they are within, or intersect with any of the loops represented by the nodes of "List outisland". In other words, intersecting inspection is done between every segment on every subloop and each segment on the second expanded loop of every island profile. The fact that one or more intersection points exist between two segments proves that the two loops which the segments are on intersect with each other. The occurrence of an intersection point will trigger a simplified set Boolean operation: difference.
The difference operation is to find the outcome of area A minus area B, or A  B. The result is areas which are inside A, but outside B.
83
Figure 5.12 gives a better look at a situation when the difference operation is used. Beginning from the second shrunk loop of the pocket boundary, intersection is checked between the shrunk loop and the second expanded loop of the island profile. If no intersection exists, the shrinking process continues. As shown in Figure 5.12a, the process does not stop until an intersection is found between the fourth shrunk loop and the second expanded loop of the island profile. The desired outcome, shown in Figure 5.12c and 5.12d, is two closed loops. It is clear that if an area is represented by a closed loop, the difference between the two areas in Figure 5.12b will result in the two areas in Figure 5.12c. Although the concept of difference of areas has nothing to do with tool path generation, the results are found to match very well. Therefore, it is necessary to understand how the difference operation is functioning. Figure 5.13 shows a more detailed description of the above operation. In Figure 5.13a, Loop La and Loop i, are the same as those in Figure 5.12b. The detection of the first intersecting point, Point P, will trigger the difference operation. First, the orientation of Loop 1., is reversed. After that, Segment C and Segment D which intersect at Point P are divided into two segments separately. Segment C becomes Segment C and C', and D becomes D and D'. The linkages are then reassigned as follows:
Segment C' > next = Segment D;
zI (b)
Iv>
KZI (C)
Figure 5.12 Resolution of crossing tool path resulting
from a single loop by set operation
difference
/Loop L a
Loop Lb
Segment D
Segment C Point P
Loop L 4
 Segment D
Segment C'
Figure 5.13
Detail of difference operation
(a) First intersection point, Point P, found
(b) Using the algorithm of "split" to perform
difference operation
(a)
(b)
Segment D > previous = Segment C';
Segment D' > next = Segment C;
Segment C > previous = Segment D'.
Assuming Point P is not an intersection point (which can be done by adding several "if" statements in a computer program), what is seen, instead of two intersecting closed loops, is a string of closed loops: Loop L1, L2, L , and L4 as shown in Figure 5.13b. The algorithm of "split" mentioned in Section 5.1.3 will be used to sever these subloops. After that, the winding number (which indicates the orientation of a loop) of each subloop is calculated. Loops L2 and L4 are kept since their orientation is the same as Loop L. which is the shrunk loop from the pocket boundary. On the other hand, Loops LI and L3 are discarded.
Even if no intersection occurs, each subloop is investigated to find if it is within one of the loops which are the second expansion from the island profiles. The condition of a closed loop inside another closed loop has been explained in Section 4.1 of the winding number. If the condition is met, this subloop will be one of the innermost loops and will have no offset of its own. In other words, the tree node, representing this subloop, will be the last on the tree branch to which this tree node belongs. Figure 5.14 depicts the tool path of a pocket with a rectangular island. The second expanded loop from the island is portrayed as the dashed line loop. When the fifth shrunk loop from the pocket
Figure 5.14 One case of loop termination when the shrunk
loop from the pocket boundary profile is inside the second expanded loop of the island profile
88
profile is within the dashed line loop, this dashed line loop would be discarded, and the fifth shrunk loop would become the last of the spiralin loops.
5.4 Loop Termination Conditions
Since the tool passes are closed loops obtained by continuously shrinking the pocket boundary, an important task is to determine when to terminate the shrinking process, or in other words, to determine which closed loops are the last ones. The last closed loop is either
1. a loop which can find no legal subloops, or
2. a loop which is inside the second expanded offset loop of an island profile.
The second condition has been demonstrated in Figure 5.14. As for a "legal subloop", it must satisfy both of the following conditions: a "legal subloop" must be
1. a closed loop which is in the same orientation as its original loop, and
2. a closed loop consisting of no auxiliary segments.
Figure 5.15 demonstrates two circumstances in which a loop terminates. In Figure 5.15a, the original loop is a clockwise triangle constructed by Segments A, B, and C. The offset loop is made by relimiting three offset segments of Segments A, B, and C. It results in a triangle of Segments A', B', and C'. Notice that, contrary to the original loop, the offset loop is CCW, and thus is not a "legal subloop". As shown in Figure
89
A
B'
(a) B
B' Auxiliary line
A
Auxilia C line
(b) > Auxiliary line
Figure 5.15 Loop termination conditions
90
5.15b, offset segments A', B' and C' do not intersect with each other. The further checking of 8's of Equation 5.5 verifies that the connections between A' and B', between B' and C', and between C' and A' are all case 3 scenarios. As a result, auxiliary lines are offered to form a link between the ending point of A' to the starting point of B', the ending point of B' to the starting point of C', and the ending point of C' to the starting point of A'. The "split" procedure will then result in four subloops. Since all of them contain at least one auxiliary line, they are void. Offset loop finding is terminated at the closed loop formed by Segments A, B, and C.
5.5 Connection between Larger Loops and Their Subloops
As mentioned in Section 3.3, the relationships between a pocket boundary and its tool pass loops form a general tree data structure in which each loop is a tree node. After each valid offset loop is found, the linkages with its outer loop and its sibling loop have to be constructed accordingly. The node representing the newly found loop is thus placed in the appropriate place in the tree. In the tree structure, the pocket boundary is the root node which is the highest rank tree node, and the outer tool pass loops are ranked ascendingly higher among the tree nodes. Those tool pass loops are the continuous offset loops from the pocket boundary obtained by using either equal or unequal offset distances.
91
After all the offset loops have been established, they need to be organized to become an integrated tool path. In other words, connection is essential between each larger loop and its subloops.
5.5.1 Two Cases of Connection between Loops
The way of linking is better demonstrated by Figure 5.16. Figure 5.16a displays a simple square pocket and its offset loops. Starting from the innermost loop, which is Loop 8 of Figure 5.16a, until the second successive offset loop of the pocket boundary, which is Loop 3, the starting segment of each loop is extended backward until this segment intersects with a segment on its outer loop. After that, the intersection point is assigned to be the starting point of the starting segment on the inner loop as well as to be the ending point of the intersected segment on the outer loop. Furthermore, this intersected segment is given a flag to symbolize it being the last segment of the outer loop. The result, shown in Figure 5.16c, becomes a true spiral tool path which is more efficient in terms of total distance of tool path compared to the conventional spiral tool path presented in Figure 1.7.
Topologically, the pocket boundary and its tool passes of the above case can be represented by a group of loops with the outermost loop symbolizing the pocket boundary as shown in Figure 5.17a. In the figure, Point 1 and Point 2 are the starting points of Loop C and Loop D separately. In figure
((a)
(c)
Figure 5.16 A simple case of connection of loops
(a) a square pocket and its tool pass loops (b) starting segments are extended backward
(c) the intersected segments are trimmed
(0a)
(b)
(c)
Figure 5.17
Topological view of connection of loops
(a) a group of loops
(b) loops are extended
(c) loops are trimmed to hinder the connection
94
5.17b, Loop C is extended backward from point 1 until it intersects Loop B at Point 3. So is Loop D from Point 2 until it intersects Loop C at point 4. The portion of Loop C between Point 1 and Point 4 is then trimmed as shown in Figure 5.17c. The outcome is that: C starts at Point 3 and ends at Point 4. It no longer resembles a closed loop. The same technique is used for Loops D, E, F, and G. Therefore, Loops C, D, E, F, and G are said to be "extended and trimmed". As for the innermost loop, Loop H, it is extended backward but not trimmed. Thus, it is said to be "extended only". Additionally, Point 3 is assigned as the starting point of Loop B.
The above case is too simplified to represent a general case, for each tree node, except the lowest rank one, has exactly one child. In more complicated cases, say the one shown in Figure 3.3, it is necessary to consider the loop connection in a more detailed fashion. In this case, the pocket boundary and its tool pass loops form a general tree as demonstrated by Figure 3.3b. Topologically these loops are represented by circles as in Figure 3.3a. To cross reference more conveniently, Figure 3.3b is moved to Figure 5.18a. The desired connection is demonstrated in Figure 5.18b. In the figure, the slotting pass starts from Point 1, around Loop B, and then back to Point 1. The spiralin tool passes, starting at Point 1 right after the slotting is done, will follow the preorder tree traversal whose sequence, as mentioned in

Full Text 
PAGE 1
A CHATTERFREE POCKETING ROUTINE FOR ANY TWOANDAHALFDIMENSIONAL POCKET WITH ISLANDS BY EHSUNG CHENG A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY UNIVERSITY OF FLORIDA 1992 UNIVERSITY OF FLORIDA LIBRARIES
PAGE 2
ACKNOWLEDGEMENTS The author wishes to express his gratitude to Dr. Jiri Tlusty, his advisor in this project. Without his support and guidance, this study would not have been possible. He would also like to thank Dr. Kevin Smith for his invaluable advice to the project. Appreciation is also extended to his committee members, Dr. John Schueller, Dr. Donald Dareing, and Dr. Senser Yeralan, for reviewing the dissertation. Gratitude is also extended to Mr. Wei Guo Zhang for his assistance in the laboratory work and to Mr. ChunYin Wu for his initial suggestion about the program structure. Finally, the author would like to express his sincere gratitude to his parents, ChauLu and JanJan, and his wife, JawFen Wang, for their encouragement, understanding, and financial support. To them the author offers his heartfelt thanks. ii
PAGE 3
TABLE OF CONTENTS page ACKNOWLEDGEMENTS ii ABSTRACT V CHAPTERS 1 INTRODUCTION 1 1.1 Introduction to Pocketing Routines 1 1.2 Offsetting Algorithm 4 1.3 Some Considerations of the New Pocketing Routine 6 1.3.1 Chatter Consideration 7 1.3.2 Corner Consideration 12 1.4 Dynamic Spiral Pocketing Routines 12 2 OPTIMIZATION PROCESS 20 3 PROGRAM STRUCTURE 27 3.1 Data Representation of a Segment 27 3.2 Linked list Representation 29 3 . 3 Tree Representation of a Pocket and its Spiral Tool Paths 35 3.4 Program Implementation of a Binary Tree 38 3.5 Island Representation 40 3.6 Tree Traversal 44 4 SOME SUPPORTING SUBROUTINES 49 4.1 Classifying InsideOutside Relation of a Point and a Closed Loop 49 4.2 Intersection of Two Segments 55 5 FINDING THE TOOL PATH OF A POCKET 62 5.1 Finding Offset Loops of Equal Offset Distance 63 5.1.1 Finding the Offset of Each Segment on the Original Loop 63 5.1.2 Linking Pair by Pair the Offset Segments Whose Original Segments Are Adjacent 65 iii
PAGE 4
5. 1.2. A Case 1: The Angle Is Greater Than 180Â° 65 5.1.2.B Case 2: The Angle Is Lesser Than 180Â° 66 5.1.3 Splitting the Gross Offset Loop into Several Subloops 68 5.2 Finding Offset Loops of Unequal Offset Distances 73 5.2.1 Finding the Offset of Each Segment on the Original Loop 73 5.2.2 Connecting Each Pair of Neighboring Offsets to Form a Gross Offset Loop 76 5.3 Tool Path of a Pocket with Islands 80 5.4 Loop Termination Conditions 88 5.5 Connection between Larger Loops and their Subloops 90 5.5.1 Two Cases of Connection between Loops 91 5.5.2 Retract and Approach 96 5.5.3 Change the Starting Segments of Loops 97 5.5.4 Connection of Loops While Islands exist ... 98 6 INSTALLATION PROCESSES 101 6.1 Installation of the New Pocketing Routine in CATIA 101 6.2 APT and Machine Codes 106 7 EXAMPLES OF TOOL PATHS 110 8 CONCLUSIONS AND RECOMMENDATIONS 120 APPENDIX A THE CHARACTERISTIC OF A CUTTING TOOL 12 3 BIBLIOGRAPHY 126 BIOGRAPHICAL SKETCH 128 iv
PAGE 5
Abstract of Dissertation Presented to the Graduate School Of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy A CHATTERFREE POCKETING ROUTINE FOR ANY TWOANDAHALFDIMENSIONAL POCKET WITH ISLANDS BY EHSUNG CHENG MAY 1992 Chairman: Dr. Jiri Tlusty Major Department: Mechanical Engineering Chatter has always been a significant problem in high speed, high power machining. For the purpose of chatter avoidance, the primary parameters are the axial and the radial depths of cut which are decisive in the tool path optimization. The acceptable (chatterfree) axial and radial depths of cut change depending on the dynamics of the machine tool, the direction of cut, and the mode of milling (up or down milling) . The relationship of the above parameters has been incorporated to form a database by other collaborators in the Machine Tool Laboratory at the University of Florida. The pockets used in this work may have complex 2 \dimensional geometries and may include multiple islands. Two main approaches have been developed to achieve the chatterv
PAGE 6
free routine. At first the optimum radial and axial immersions would be determined according to the database and the pocket geometries. Secondly, the tool path is arranged using the optimum immersions to achieve the best metal removal rate without the occurrence of chatter. In the optimization process, different radial immersions may be selected for different machining directions. This feature is unique since other pocketing routines can only choose the same immersion for all machining directions. Therefore, the machine would not use all of its power capabilities, since the smallest immersion has to be selected if those routines are used. This work also outlines a complex general tree data structure, the implementation of geometric modelling techniques into programming, and the method to incorporate the new routine into CATIA, a widely used CAD/CAM package. Finally, a processor is provided to established a link between CATIA and an NC machine. Several examples are used to illustrate the resulting tool paths from the new routine, and comparisons are made between the actual parts machined by tool paths resulting from the new routine and from the original pocketing routine from CATIA. This work presents a new type of pocketing routine which would reduce the manufacturing time and increase machining quality and tool life. vi
PAGE 7
CHAPTER 1 INTRODUCTION 1.1 Introduction to Pocketing Routines A common procedure in a milling operation is to remove the material within a given boundary and to create a cavity, also known as a pocket. The pocket can have any shape along its boundary. Machining aircraft panels and molding dies are two common examples of pocket use. Pocketing routines have been implemented in many numerical control (NC) packages, and may be grouped into three broad categories: (1) Spiral out: In such a routine, the tool is first sunk in near the center of the pocket, and then traverses a path spirally outward. The last path will create the periphery of the pocket. (2) ZigZag: The starting point is at a distance of the tool radius plus the finishing cut immersion from a chosen point on the periphery. The tool is first sunk at the starting point, and then traverses back and forth, cutting in both directions across the pocket, and finally finishes on the opposite side of the pocket from the starting point. The final path is the finishing path which is used to create the periphery of the pocket. 1
PAGE 8
2 (3) Linear: This routine is similar to the zigzag routine, except that the cutting is performed only in one direction, and on the return path the cutter is withdrawn and travels in air. In order to avoid the necessity of sinking at the beginning of each pass, the periphery of the pocket is first machined in a slotting operation, before the linear motion begins. Among the above three operations, the spiral pocketing operation is the most complicated but also the most efficient [ 1] [ 2 ] , and thus is the primary subject of this research. Although the spiral pocketing routine has been widely used, none of the commercial packages have given any description about their algorithms, and few publications about the pocketing routines are available. These publications have not provided a good way to deal with a pocket with many islands. Furthermore, none of the routines in the commercial NC packages take into account the problems of chatter and internal corners which are crucial in the high speed high power machining operation. These problems will be addressed in detail later in this chapter. This research attempts to solve the above problems and also provide a robust algorithm in dealing with a pocket of complex 2D geometries with or without multiple islands. Few publications have been presented about pocketing routines. Persson's [3] work describes an efficient twostage procedure for a pocket bounded by line segments and circular
PAGE 9
3 arcs. This pocket was machined in a spiral fashion. He first partitioned the entire pocket into several independent subareas each belonging to one pocket side, and then the cutter paths were determined such that each path was found in a subarea at a time. The subarea was partitioned by calculating the curves (lines, circular arcs, ellipses, parabolas, or hyperbolas) equidistant between each pair of adjacent boundaries of the pocket. However, when dealing with unequal radial immersion at each pocket boundary (this will later be shown to be desirable) , this kind of partition will not work. Additionally, his pocketing procedure does not permit internal island avoidance. Nevertheless, he mentions that lines and arcs alone are not always sufficient for representing airplane parts. These complex representations include tabcyls, which are curves defined by point sets. He developed a prepocket procedure which approximated tabcyls with arcs and lines, before the normal pocket calculations were started. Another publication about pocketing routines is the one by Suh and Lee [4], Their work described the machining of a pocket spirally. The pocket may be bounded by many curves, including lines, arcs, ellipses, and arbitrary free curves. The pocketing routine was capable of island avoidance, but only one island was allowed. Additionally the bottom of the pocket to be machined may be any sculptured surface.
PAGE 10
4 Their procedure started from a threedimensional (3D) model generated by a geometric modeler developed in their laboratory, which was a nonuniform rational Bsplinebased boundary representation modeler. Once the shape of the pocket had been modelled, the offset curves and the associated CL data were computed at every offsetting step. At each step, one or more loops would be generated. However, their routine was useful only for the finishing cut of the pocket which emphasizes the precision and continuity of the tool movements on the sculptured surface, while in a roughing cut, the metal removal rate is a more important issue. Also, in their routine only one island was allowed, which implied that their data structure would need more modification. Furthermore, they did not describe the procedure to connect a loop and its offsetting loops. The connection will become guite complicated in the case of machining a complex pocket enclosing many islands. As in the commercial pocketing routines, both Persson's and Suh's works were concentrated on the egual distance offset principle, and did not consider the problems associated with internal corners. 1.2 Offsetting Algorithm An offset is a curve with equal distance to a given curve. The offset technique can be applied in several fields, including NC pocket machining, VLSI circuit design, finite
PAGE 11
5 element mesh generation, and robot path planning. In conventional spiral type pocketing routines, tool paths are formed as loops. The subloops are the offset of their corresponding larger loops. The offset technique has been discussed in several papers. Tiller and Hanson [5] discussed the offsets of twodimensional profiles. They used the subdivision method to find the offset of a rational Bspline curve. But their method runs into trouble when the offset curve intersects itself. Pham [6] provided a method to interactively find the offset of a uniform cubic Bspline by using a set of control knots. He discussed only the problem of offsetting a curve, and not a loop, for in a loop the problem is more complicated. Hoschek's work [7] discussed the problems involved in generating the offset of a cubic spline. Coquillart's [8] work discussed the offset of a Bspline in both 3D and 2D. But his work was limited to finding the offset of smooth curves without discontinuities. Moreover, selfloops, which are loops within a larger closed loop, are not allowed in offset curves. The above papers concentrated their efforts on finding the offsets of splines, either Bsplines or cubic splines. The offset will be a spline of the same kind. These efforts are reasonable, since the spline is a powerful tool for the designer and can be used to approximate any desired curve. The offset of a line segment is another line segment, and the offset of an arc is another arc. In some cases, a pocket
PAGE 12
6 is constructed by not only line segments and arcs, but also by ellipses, hyperbolas, and parabolas. The exact offset of an ellipse (hyperbola, or parabola) is a fourth order curve which can still be found, but finding the exact offset of this fourth order curve becomes very complicated if it even exists. It is easier to use a spline to approximate the offset of this fourth order curve. As a result, it is necessary to have a method to find the offset of splines. In other words, it may be said that if a pocket is bounded by curves beyond line segments and arcs, the above papers might provide a method to solve the offset problems. However, the kind of offset required in this research is not of the equal distance form. The offset distance is variable according to the direction of each pocket edge and is determined by optimization results. None of the above papers has ever mentioned anything about variable distance offsets. The problems involved are of a new nature. Thus, in this research the types of segments defining any pocket boundaries are limited to line segments and circular arcs. 1.3 Some Considerations of the New Pocketing Routine Assuming that the criteria for a satisfactory cut is the avoidance of chatter, it is necessary to explain the meaning of chatter, and why, for a given axial depth of cut, the radial depth of cut may be different for each direction of machining.
PAGE 13
7 1.3.1 Chatter Consideration The selfexcited vibration in machining, also known as chatter [9], is an important factor for controlling the quality of the cutting operation. Chatter is recognized by characteristic noise, by chatter marks, and by the undulated or dissected chip. The mechanisms producing chatter are "mode coupling" and "regeneration of waviness." The latter plays a more significant role. The limit of stability for regenerative chatter for a single degree of freedom system is shown in Figure 1.1. It is obvious that the projection F cos(Ba) of the cutting force excites the mode in the X direction and the projection X cos (a) of the vibration in the Y direction will modulate the chip thickness. The oriented transfer function is [9] where n = cos (6a) cos (a) is the directional factor, and G d represents the direct transfer function. In the preceding pass, the vibration is given by ( 1 . 1 ) y 0 = Y 0 sin ( G> t) ( 1 . 2 ) and, in the current pass, the vibration is y = Y sin (wt + 2nN + e) = Y sin (tot + e) (1.3) The cutting force f is (1.4) where f m is the mean cutting force, and f y is the variable
PAGE 14
8 Y direction normal to cut X Direction of freedom for mode Figure l.l Mechnism of "regeneration of waviness" Figure 1.2 Block diagram of chatter mechnism
PAGE 15
9 component. Their values are = *s b K(1.5) f v = k s b (y 0 y) , (1.6) where K s is the cutting force coefficient, and b, the depth of cut, is a positive real number. The above equations can be represented by a block diagram in Figure 1.2. At the limit of stability, any vibration would remain constant without decaying or increasing. Thus, the absolute values of amplitudes for two subsequent vibrations are equal. I Y  =  Y 0  (1.7) According to the Nyquist criterion, the limit happens when the openloop transfer function of Figure 1.2 has the value 1 K s jb lin G( o>) (l e' jÂ€ ) = 1, ^lim 1 K a G( g>) (l e" 1 e ) ( 1 . 8 ) since b Um is always real and K s is chosen to be positive real. The above equation can be justified only if G(1 e' Jt ) is real. This condition can be satisfied if G (1 e~ Je ) = 2 Re(G) Thus, ^lim ^1 2 K s Re(G((x>) ) 1 2 \l K s Re(G d ) (1.9) ( 1 . 10 ) The single degree of freedom system can only be used to
PAGE 16
10 explain the mechanism of chatter vibration, and is not suitable for the real machining process. For a two degree of freedom system, the equation for b ljm becomes ^lim ^1 2 K s ( Re( G x ) + \i y Re(G y )) m . n ( 1 . 11 ) where Re(G x ): real part of the transfer function measured in the X direction of the feed motion, Re(G y ): real part of the transfer function measured in the Y direction perpendicular to the feed motion, directional orientation factor for the X dynamics, /i y : directional orientation factor for the Y dynamics. If only the tool were involved in determining the transfer function at the tool tip position, then the transfer functions GÂ„ and G in the X and Y directions would be the same. However, in most practical cases the machine structure must be considered, and thus the transfer functions G y and G v may be x y significantly different. The method of determining and u x y was explained by Tlusty [9]. It is known that the values of M x and jLt y are determined by the machining direction and the mode of milling which is either up or down milling, and can be quite different. Adding the factors of changeable u and u , x y and of the difference between GÂ„ and G u , the minimum value of x y /i x Re(G x ) + /Lt y Re(G y ) may be considerably different for different cutting conditions. Accordingly, from Equation 1.11, the value of b ljm will be different depending on whether it is up
PAGE 17
11 or down milling and on the machining direction. None of the commercial NC packages have offered the option of selecting different radial immersions for different cutting directions. All that is available is a constant immersion for all directions. Therefore, to ensure a stable milling operation, it is necessary to choose an immersion based on the worst direction and immersion. Thus, in cutting in the more stable directions the machine does not use its full capability. Even if a pocketing routine offers the user the option to change the radial immersion according to the direction and the mode of milling, in the existing routines there is no guideline for selecting the parameters. The programmer is left to his own experience to select the radial and axial immersions which will yield an acceptable quality. A database of quality parameters, which is the prework of this research, is proposed. The database, developed by experiments or a time domain simulation program in the Machine Tool Laboratory at the University of Florida, will include a representative selection of tools. Thus, while a shape of the pocket, and the tool used to machine it are determined, the new pocketing routine will first determine the axial depth of cut and the radial immersion for each side of the pocket by an optimization technique such that the best metal removal rate is achieved. The method of optimization is the topic of Chapter 2 .
PAGE 18
12 1.3.2 Corner Consideration Another problem neglected by the commercial spiralout pocketing routines is the corner consideration. As the tool approaches an internal corner, the radial immersion starts to increase until it is on the corner, and then the immersion returns to normal. Figure 1.3 shows an example of a half immersion cutting operation. At point 1 and point 3, the immersion is half, and the cutting angle, which is the angle of engagement between the work piece and the cutter, is 90Â°. But at point 2 there is a slotting operation and the cutting angle is 180Â°. As is shown above the radial immersion has a strong affect on the stability of the operation. The increase in immersion at the corner may be sufficient to cause chatter. Tsai and Takata [10] tried to add additional tool path segments (arcs) for machining corners so as to keep the engagement angle below a certain value. However, their method was complex and the machining became inefficient. 1.4 Dynamic Spiralin Pocketing Routine Kshonze [1] and Tlusty [2] have provided a guideline for the dynamic routine which had the following two stages: 1. Performing the slotting around the inside perimeter of the pocket ; 2. Spirally cutting from the periphery of the pocket toward the center.
PAGE 19
13 pocket boundary Figure 1.3 Spiralout tool path at an inside corner For the slotting of the periphery, the axial depth of cut was chosen according to the worst direction from the data base. Since the other directions were allowed to cut deeper than that, the slotting was stable. The slotting might be done by several layers according to the depth of the pocket and the maximum allowable axial depth of cut. For the remainder of the pocket, the radial and axial depths of cut would be determined by using an optimization process to achieve the best metal removal rate. Using the optimization process is the first advantage of the dynamic spiralin pocketing routine. Such a tool path is shown in Figure 1.4 for a simple square pocket. First the initial slotting is done in two stable axial passes (2, 3, 4, 5, 2 and 6, 7, 8, 9, 6). After that, assuming the X direction of feed to be the less stable option,
PAGE 20
14 Figure 1.4 The dynamic spiralin tool path for a square pocket
PAGE 21
15 for a full axial depth of cut, a 1/5 radial immersion is chosen. In the Y direction of feed, a 2/5 radial immersion is chosen. The remaining pocket is machined in one pass at full depth from point 10 in a spiral motion toward the center of the pocket. The second advantage of the dynamic spiralin routine is typical for spiralin routines for they avoid the increase of the cutting angle at the inside corners (refer to Section 1.3.2). Figure 1.5 shows that after the initial slotting, less material is cut at the inside corner area than at the noncorner areas. However, a pocket may also include outside corners, although in a closed area (pocket) the number of outside corners is always less than the number of inside corners. For outside corners, the tool path proposed is to cut around it during the initial slotting using an arc whose radius is the same as the tool radius. After the first slot, there will be no outside corners left. In Figure 1.6, half immersion is used after the initial slot operation. At the corner portion, the second loop tool path cuts along an arc whose radius is equal to the tool diameter, and the third loop tool path cuts along another arc whose radius is 1.5 times the tool diameter. As shown in Figure 1.6, the cutting angles are 90Â°, 104.47Â°, and 99.59Â° at points 1, 2, and 3 separately. When an outside corner is involved, the cutting angle is greater while cutting along the arcs than along the lines, but not by much.
PAGE 22
16 next round tool path Figure 1.5 Spiralin tool path at an inside corner third round tool poth Figure 1.6 Spiralin tool path at an outside corner
PAGE 23
17 However, as the tool cuts deeper inside, the curvature of the arc will decrease and so will the increment of the cutting angle. The third advantage of the dynamic spiralin routine is: the tool path generated by the routine is a true spiral while the tool paths generated by the commercially available spiralin pocketing routines are not. They contain several loops and linkages to join them. Figure 1.7 shows the difference between dynamic and conventional spiralin routines. Notice that the cutting angle may increase when the tool is moving through the linkages on the conventional tool path. Additionally, the true spiral is more efficient in terms of machining distance (time) . Kshonze [1] and Tlusty [2] have compared the spiral in, dynamic spiral in, dynamic linear, and dynamic zigzag pocketing routines. They found out that the dynamic spiralin routine is by far the most efficient in terms of time required to complete a 4.5 x 4.5 x 1.125 inch square pocket. Table 1.1 shows the results of their comparison.
PAGE 24
18 (a) Figure 1.7 Comparison of (a) conventional and (b) true spiralin routines
PAGE 25
19 Table 1.1 Comparison of different kinds of pocketing routines for a 4.5x4.5x1.125 inch pocket Software Package Type of Pocket Cutting Time (Min) Air Travel (Min) MRR (cm**3 /min) # of Holes Spiral in 5.07 0.0 73.58 1 Dynamic spiral in 3.62 0.0 103.07 1 Proposed New Routines Dynamic linear without finish 4.83 0.44 70.79 1 Dynamic linear with finish 5.65 0.47 60.96 1 Dynamic zigzag without finish 4.20 0.08 87.18 1 dynamic zigzag with finish 5.02 0.08 73.25 1
PAGE 26
CHAPTER 2 OPTIMIZATION PROCESS As mentioned in Section 1.3.1, the critical depths of cut for each tool were calculated for various cutting situations through a computer simulation program developed in the Machine Tool Laboratory (MTL) . This information for many useful tools forms a database. Figure 2.1 represents the results of a simulation for a 4flute high speed steel (HSS) end mill cutter with spindle speed at 3800 rpm and feed rate at 1900 mm/min on the WhiteSundstrand milling machine at MTL. The dimension of the end mill is 25mm by 100mm. The X axis represents the radial immersion in terms of a fraction of the cutter diameter. The Y axis represents the axial immersion in millimeters. Several different cutting scenarios were created by varying the radial immersion from one fifth to full in four feed directions, +X, +X+Y, +Y, and +XY, for both up and down milling. Each curve splits the whole region into two subareas. The upper one is the unstable zone, while the lower one is the stable zone. From the figure, it is clear that the axial and radial depths of cut are strongly affected by the direction of cut as well as by the mode of milling (up or down milling). Table 2.1 lists all the data shown on Figure 2.1. 20
PAGE 27
Axial immersion bltm CiwtT) 21 Radial Immersion (fraction of cutter diameter) a o< dtr. + Â»xÂ»y dir. o +y dir. A xÂ»y dir. Figure 2.1 Computed permissible depths of cut for a 25mm by 100mm 4flute HSS end mill cutter on the WhiteSundstrand milling michine
PAGE 28
22 Table 2.1 Permissible Depths of Cut for a 25mm by 100mm 4Flute HSS End Mill Cutter on WhiteSundstrand Machine Axial Immersion for Four Cutting Dir. (mm) +X +X+Y +Y X+Y 0.2 1.4 1.3 2.25 1.7 TT 0.3 0.9 1.05 1.7 1.5 U P 0.4 0.7 0.75 1.1 0.9 M i 0.5 0.6 0.6 0.7 0.7 R a 0.6 0.5 0.5 0.6 0.55 Â± 1 i n 0.7 0.4 0.45 0.4 0.45 i 0.8 0.35 0.35 0.35 0.35 1 y 0.9 0.3 0.3 0.3 0.3 1.0 0.25 0.25 0.25 0.25 I 1.0 0.25 0.25 0.25 0.25 m D 0.9 0.3 0.3 0.3 0.3 r w 0.8 0.35 0.35 0.35 0.35 i o n 0.7 0.4 0.4 0.44 0.4 M i 1 0.6 0.5 0.5 0.48 0.45 0.5 0.7 0.65 0.55 0.55 i 0.4 1.0 0.7 0.65 0.7 g 0.3 1.2 1.0 0.9 1.1 0.2 1.6 1.8 1.3 2.1
PAGE 29
23 To demonstrate the use of Figure 2.1, three typical examples are presented in Table 2.2, in which the cutting directions and the axial immersions are given. In all of the examples, linear interpolation has been used. In case 1, the cutting direction is 0Â°, which is equivalent to +X direction, and the axial immersion is 0.65mm. The two intersections of +X curve and the horizontal line at an axial immersion equal to 0.65mm are in 0.45 in the up milling region and at 0.525 in the down milling region. These two intersections are the optimum radial immersions. In the second case, the cutting direction is 90Â° or +Y, and the axial immersion is 0.2mm. No intersection exists between the +Y curve and the horizontal line of axial immersion equal to 0.2mm. The situation means that there is no restriction in choosing the radial immersion. Hence the optimum radial immersion is full immersion. In case 3, the cutting direction of 22.5Â° is between 0Â° (+X) and 45Â° (+X+Y) . Linear interpolation is used to obtain the curve for this specific cutting direction from the +X and +X+Y curves. From the new curve, the optimum radial immersions to match an axial immersion of 0.8mm are obtained by the method used in cases 1, and 2. The objective of the optimization is to find the best combination of axial and radial immersions in machining a specific pocket to obtain the maximum metal removal rate (MRR) . Two assumptions are made:
PAGE 30
24 Table 2.2 Examples of finding optimum radial immersions from the given cutting directions and axial immersions Cutting Direction (Degree) Axial Immersion (mm) Opti. Radial Immersion (% of Tool Dia.) Up milling Down Milling 0 0.65 0.45 0.525 90 0.2 1.0 1.0 22.5 0.8 0.37 0.429 1) The pocket will be machined in several layers with the same thickness between two adjacent layers; 2) At each layer, the axial depth of cut remains constant. The method of optimization is explained below. when the number of layers, say N L , is determined, the axial depth of cut, b, will be * = Dpocket / N l (2.1) where D pocket is the depth of the pocket. As shown in Table 2.2, if the axial depth of cut, b, is given, then the corresponding optimum radial immersions for any cutting directions can be obtained. Since the machining time required to finish a layer, T L , is proportional to T l Â« (2.2) (a lPl + a 2 p 2 + . . . + aÂ„p n ) where n is the number of pocket edges, a^ a 2 , ..., a n are the corresponding optimum radial immersions of the pocket edges for the
PAGE 31
25 specific axial immersion, b, p,, p 2 , . . . , p n are the corresponding percentages of the edge lengths in total pocket boundary length. They are constants. The machining time for the whole pocket, T p is T p " T l N l Â« {a x p x + a 2 p 2 + a rPn > (2.3) Since MRR is proportional to 1/T p , it is MRR Â“ teiPi + a 2 p 2 + a rPn ) (2.4) The optimization process will search through a range of N l . From each N L , the axial depth of cut, b, and the corresponding optimum radial depths of cut for this b are determined. Thus, the value of Equation 2.4 can be obtained. The N l , that produces the largest value from Equation 2.4, will be the optimum number of layers. The corresponding b, and a, to a n are the optimum axial and radial depths of cut. For example, if the maximum and minimum allowable radial immersions are 0.7 and 0.2 separately, from Table 2.1, the range of b will thus be determined as between 0.4 mm and 1.3 mm for both down and up milling cases. For using values of b greater than 1.3 mm, the tool may chatter in some cutting directions. For using values of b smaller than 0.4 mm, the machining may not achieve the desired efficiency. If the depth of the pocket, D pocket , is 20 mm, then the number of
PAGE 32
26 layers, N L , needed to machine the pocket is in the range of 16 to 50 (20mm/l. 3mm and 20mm/0.4mm). For each N L , the corresponding axial depth of cut, b, is determined by Equation 2.1, and then the optimum a 1 to a n for this b can be obtained by the method shown in Table 2.2. After that, the value of Equation 2.4 is calculated. The optimum N L and its corresponding b and a 1 to a n will produce the largest value. In spiral pocketing, the tool paths are determined from pocket boundaries by successively shrinking the periphery of the pocket segmentwise by the permissible radial depth of cut for that segment. The result of each such successive offset is a subloop of the previous loop. Although the ratio of an edge in total length of a certain loop may not be the same as the ratio of the corresponding edge in total length of its subloop, the difference will not be much. Since in a pocketing operation, a few outer loops would cut most of the material, and thus they count the most, it is reasonable to assume that the ratios are the same in these few loops. Therefore, although the optimization process is a simplified method, and may not obtain the true optimum solution, it certainly would achieve one of the better results.
PAGE 33
CHAPTER 3 PROGRAM STRUCTURE While developing a program with a vast amount of entangled data, a method has to be developed to keep track of all data so that nothing is neglected. That is why a data structure is necessary. Standard data structures include stack, array, linked list, tree, etc. However, frequently in a program these types are used jointly. For example, the node of a linked list might be an array, or the node of a tree structure might be a linked list. A distinct data structure should be developed for each program to serve its own purpose. All the example codes in this chapter are written in C programming language or pseudo codes which are sometimes easier to understand . 3 . 1 Data Representation of a Segment Each segment, a line or an arc, can be represented by a set of geometric data. An array storing the coordinates of the starting and the ending points are enough to represent a line. In this case an array of four elements is adequate. The first and the second element of the array will keep the X and Y coordinates of the 27
PAGE 34
28 starting point, while the third and the fourth elements store the coordinates of the ending point. For an arc, an array of five elements is required, where the first and the second elements are used for holding the arc center coordinate, the third element representing the arc radius, and the fourth and the fifth elements storing the starting and the ending angle with respect to the x axis. Since it is simpler to use the same scheme to represent all kinds of segments, an array of five is used to hold the geometric data for both a line and an arc, although the last element of the array is idle when representing a line. Another variable, called TYPE, is required. Its value is used to distinguish the type of segment. If the value of the variable TYPE is 2, then the segment is a line. Variable TYPE with a value of 5 represents a counterclockwise (CCW) arc, and 4 represents a clockwise (CW) arc. A line segment with (0.0, 1.0) and (10.0,11.0) as the starting and ending coordinates is represented as follows: type =2, (a line segment) dt [0] = 0.0, dt [1] = 1.0, dt [2 ] = 10.0, dt [3] = 11.0. An clockwise arc with center coordinate (1.0 1.0), radius 2.0, starting angle n , and ending angle tt/ 2, is represented as follows:
PAGE 35
29 type =4, (a CW arc) dt [0] = 1.0, dt [1] = 1.0, dt [2] = 2.0, dt [3] = it, dt [4] = IT/2. 3.2 Linked List Representation A linked list is a sequence of zero or more nodes, together with a set of operations. Each node contains two fields, an ITEM field that holds information and a NEXT field that holds a pointer to the next node in the list. The fact that each node contains a specification of where the next node is, makes it a linked list. The name of the linkedlist is simply an indication of where the first node may be found; all other nodes must be obtained by following the chain of links [ 11 ]. The conventional way to portray a linked list is with a boxandarrow diagram. Each node is shown as a box with an ITEM part on the left and a NEXT part on the right. An arrow leads from the NEXT part to the next node and the last node in the list is shown as a box in which a diagonal line is drawn through the NEXT part to indicate that there isn't any next node. Note that the arrow runs in only one direction. This is a singlylinked list [11].
PAGE 36
30 A List Figure 3.1 A symbolic sketch of singlylinked list In many applications it is convenient to be able to move through a list in either direction. The answer is to put two link fields in each node, one pointing to the successor and one to the predecessor of the node. The representation is called a doublylinked list. Each node of a doublylinked list contains three fields. Besides the ITEM and NEXT, a PREVIOUS field is added which holds a pointer to the previous node in the list. This convenience is not free. Besides the memory space required for the extra links, more links need to be rearranged and extra complexity is added while manipulating the doublylinked list. Another variation is that the link in the last node, instead of containing an indication that it is the last node, can point back to the head of the list. This is called a circularlylinked list. Since a closed loop consists of many segments with one trailing the other, it is ideal to use a circularlydoublylinked list to represent a closed loop. T
PAGE 37
31 Figure 3.2 A symbolic sketch of a circularlydoublylinked list In programming languages, there are two ways to implement a linked list. The older one is called array implementation, and the newer and better one, is called pointer implementation since it relaxes the restriction of prespecifying the sizes of arrays. The Fortran language only allows the former one. In C programming language, the box of the circularlydoublylinked list is a structure variable which is defined by a customized structure template. The syntax of defining a structure template, called "segment", is shown as follows: typedef struct asegment { int type; double dt[5]; struct a_segment *next; struct asegment *prev; struct asegment Â‘origin? } segment
PAGE 38
32 This structure template contains an integer variable "type", an array "dt" of five doubleprecision real numbers, and three pointer variables named "next", "prev", and "origin" separately. Among the variables, "type" and "dt" are the "ITEM" part of the linked list, their purpose being already stated in Section 3.1. The statement that causes a structure variable "a_seg" to be created according to the above structure template is segment *a_seg; Also the following statement is needed that will allocate a memory block and will assign the address of the memory block to the structure variable "a_seg". aseg = (segment *) calloc (1, sizeof (segment) ) ? After that, "a_seg" is a structure variable which holds the address of the newly allocated memory block. In other words, the structure variable "a_seg" is a pointer pointing to the memory block. A memory block occupies many continuous memory locations, 24 continuous memory locations at 48 bytes in this case, and its address is also the address of the first memory location. The pointer variables next, prev, and origin will hold the addresses of the other memory blocks. The access of a structure member is through the structure member operator ">". For example, to assign a value of 2 to the integer variable "type" of the structure variable "a_seg", the C language syntax is
PAGE 39
33 a_seg>type = 2; Assume that the three vertices of a clockwise triangle are denoted as (0,0), (0,1), and (1,1) separately, and the line segment from (0,0) to (0,1) is the starting segment of the triangle. After proper assignment of this data to the appropriate memory locations in three memory blocks, in Table 3.1, three charts in double lines show how the memory blocks hold data. The variables in each memory block include those needed to represent a line segment which are variables "dt" and "type" (refer to Section 3.1), and variables "next", "prev", and "origin". Notice how variables "next" and "prev" save the addresses of the next and previous memory blocks. For example, the value in variable "next" of the first memory block is 509976 which is also the address of the second memory block. The value in variable "prev" of the first memory block is 476542 which is also the address of the last memory block. By following the same rule, it is easy to find out how the memory blocks interact with each other. In Table 3.1, the single lines show some examples of interaction between addresses and values. Each time when the memory allocation statement is invoked, the computer will allocate the available memory blocks. Hence the addresses are pseudo numbers in Table 3.1. Note that the name of the structure variable, which points to the first memory block, is the header whose value is the first memory address of the block. From this particular address, all data are retrievable.
PAGE 40
34 Table 3.1 An example of data storage in a circularlydoublylinked list HEADER address value 737200 504810 type L > v a dt [ 0 ] r i dt[l] a b dt [ 2 ] 1 e dt [ 3 ] n dt[4] a m next e s prev origin address value 504810 2 504811 o Â• o Â• Â• Â• o Â• o Â• Â• Â• o Â• o Â• Â• Â• 1.0 Â• Â• Â• u Â• Â• Â• 509976 Â• Â• Â• 476542 Â• Â• Â• u address value 509976 2 509977 o Â• o . . . 1.0 . . . 1.0 Â• Â• Â• 1.0 Â• Â• Â• u Â• Â• Â• 476542 Â• Â• Â• 504810 Â• Â• Â• u address value 476542 2 476543 1.0 Â• Â• Â• 1.0 Â• Â• Â• 0.0 Â• Â• Â• 0.0 Â• Â• Â• U Â• Â• Â• 504810 Â• Â• Â• 509976 Â• Â• Â• u * u : unassigned
PAGE 41
35 3 . 3 Tree Representation of a Pocket and its Spiral Tool Paths A pocket profile and its tool paths are a number of closed loops constituted by several segments (line segments or arcs) . The outer loop is called the parent and it inner loops are the children. A parent can have several children, but any child can only have one parent. All loops can have no intersection between each other. Figure 3.3a shows a topological representation of a pocket and its spiral tool paths. In the figure the outermost loop, loop A, symbolizes the pocket profile. The other loops represent the tool paths. Loop A has one child, which is loop B, loop B has three children, called loop C, loop D, and loop E respectively, and etc. It is immediately recognizable that a general tree representation will perfectly match Figure 3.3a. Figure 3.3b is the equivalent general tree representation of Figure 3.3a. In Figure 3.3b, node A has one child, called node B, node B has three children which are node C, node D, and node E respectively, and etc. To explain the "general tree" better, the idea of a "binary tree" has to be mentioned first. The definition of a binary tree is: a binary tree is a set of nodes that is either empty, or consists of a root and two disjoint binary trees called the left subtree and the right subtree. A node contains information, the nature of which depends on the application. [11]
PAGE 42
36 The difference between a "general tree" and "binary tree" is that the general tree relaxes the requirement that each tree node has exactly two children. Instead, the general tree can simply have zero or more children. Binary trees can be easily used to represent general trees. The basic idea of representation is to order the children of a general tree node, say, from left to right. Now in the binary tree representation, each has two link fields, which are called FIRST and NEXT, rather than LEFT and RIGHT. The FIRST field of a node points to the first (leftmost) son of the general tree node. And the NEXT field points to the next sibling node. The correspondence between these two tree representations is illustrated by Figure 3.3b and 3.3c. Figure 3.3c is the equivalent binary tree for Figure 3.3b. Here in Figure 3.3c, the first child of node A is node B, and the first child of node B is node C. Both node A and node B have no siblings. But node C has two branches, one pointing to its first child, node F, and the other to its next sibling, node D. Node D, which is the same as node C, is also a child of node B, and etc. There are several advantages in using the binary tree data structure in representing tool paths. For example, the tree traversal by using the recursive method, which will be mentioned in Section 3.6, can be used to create the tool path for any exotic pocket with as many islands as desired.
PAGE 43
37 Figure 3.3 Representing tool path as a tree (a) topological representation of a pocket and its tool paths (b) the equivalent general tree (c) the equivalent binary tree
PAGE 44
38 3.4 Program Implementation of a Binary Tree Like a linked list, there are two ways to implement the binary tree representation, one called the array implementation, the other known as a pointer variable implementation. Here the latter one is chosen. First a particular structure template named "node" for the tree node is defined as follows: typedef struct nd { int nd_type; int ndindex struct nd first; struct nd next; struct nd parent; struct seg start; } node; If a structure variable "a_node" is designated according to template "node", the statement is node *a_node; The next statement will allocate a memory block and then will assign its address to the variable "a_node" . The syntax is anode = (node *) calloc (1, sizeof (node) ) ; After that, "a_node" is a pointer pointing to the newly allocated memory block. The pointer variable "first" of the structure holds the address of a structure representing its first child, and "next" holds the address of another structure representing its
PAGE 45
39 next sibling. These two pointer linkages of each node make the connection among general tree nodes. The other pointer variables include "start" and "parent". The pointer variable "parent" of the structure points to the memory block representing the parent node. This variable is useful in finding the passages between loops. The pointer variable "start" of the structure is the header of a circularlydoublylinked list (refer to Section 3.2). In other words, "start" holds the address of the first memory block of the circularlydoublylinked list. The linked list holds all the data representing a closed loop. From pointer "start", any data at any segment on the closed loop is retrievable. For example, if variable "an_integer" is assigned the value of variable "type" at the second segment of the closed loop, the following statement will do the work: an_integer = a_node>start>next>type; Here, the second segment is interpreted as the one next to the starting segment. The value of variable "type" of the third segment will be obtained by the following statement: a_node>start>next>next>type; The value of "type" of the last segment will be obtained by: a_node>start>prev>type; Here, the last segment is the one previous to the starting segment. Usually a dowhile loop in the computer program is used to reach all segments in a loop.
PAGE 46
40 Two integer variables nd_type and nd_index of the template will indicate the validity of the tree node. The relationship of the tree nodes and the doublylinked list is shown by Figure 3.4. Figure 3.4a illustrates the tool paths for a pocket and Figure 3 . 4b depicts the matching tree and linked lists. The figure shows the following relations: Loop A > first = Loop B; Loop A > next = NULL; Loop A > start = Segment 1; Loop B > first = Loop C; Loop B > next = : NULL; Loop B > start = Segment 9; Loop C > first = NULL; Loop C > next = Loop D; Loop C > start = Segment 19; Loop D > first = NULL; Loop D > next = : NULL; Loop D > start = Segment 24; Segment 1 > next = Segment 2 Segment 1 > prev = Segment 8 Segment 2 > next = Segment 3 Â• Â• Â• Â• etc Â• 3.5 Island Representation The islands are a string of independent closed loops within the pocket boundary and without any intersection among
PAGE 47
41 Figure 3.4 A example of tool paths for a pocket and its matching tree and linked lists
PAGE 48
42 them. The islands are represented by another linked list. Each node of the linked list represents an island profile. In the programming language, the node of the linked list is a pointer variable which points to a memory block or in other words holds the value of the address of the memory block. The memory block will contain two pointer variables, "nextÂ” and "start". Pointer variable "next" points to the next island. Pointer variable "start" points to the starting segment of the island profile. All segments of an island profile will form a circularlydoublylinked list. Instead of defining another structure template for island representation, the same structure template, used to represent the tree nodes, is used in representing the nodes of the linked list for islands. The trick is that all other pointer variables, which are useless for island representation, are given a value of NULL. In the beginning, using the same structure template in representing both islands and tree nodes may waste a few unnecessary memory spaces. But overall the program will be shorter and simpler because there are fewer cases to distinguish, and thus the executable file is smaller and computational time is saved. Figure 3.5a demonstrates a pocket with four islands, and Figure 3.5b shows the representation of those island profiles. Note that the left side of Figure 3.5b is a linked list. Island 1 points to Island 2, Island 2 points to Island 3, and
PAGE 49
Figure 3.5 An example of pocket containing islands and the linked list representation of the islands
PAGE 50
44 so on. The last island, Island 4 will point to NULL. The right side of Figure 3.5b contains four circularlydoublylinked lists. The relationship of those nodes can be written by the following expressions: Island 1 > next = Island 2, Island 2 > next = island 3, Island 4 > next = NULL. Also, Island l > start = Segment A, Island 2 > start = Segment E, Island 4 > start = Segment M. 3 . 6 Tree Traversal The tree traversal means "visiting" all the nodes of a tree. Here visiting a node may mean cutting along a loop in the pocket. The traversal of a binary tree is approached through the recursive definition. There are three generally used tree traversals: (a) preorder traversal: 1. Visit the root. 2. Traverse the left subtree. 3. Traverse the right subtree. (b) Inorder traversal: 1. Traverse the left subtree.
PAGE 51
45 2. Visit the root. 3. Traverse the right subtree. (c) Postorder traversal: 1. Traverse the left subtree. 2. Traverse the right subtree. 3. Visit the root. But in the general tree representation, first and next are used instead of left and right. Consider the tree of Figure 3.3b, The three traversals are: (a) Preorder traversal: ABCFJGHDEI. (b) Inorder traversal: JFGHCIEDBA. (c) Postorder traversal: JHGFIEDCBA. While the representative tree is completely constructed, moving through a tree node may mean cutting around a closed loop. In this case, the preorder traversal can be treated as the cutter moving from outside in, while the inorder traversal is the cutter moving from inside out. The postorder traversal is meaningless in this tree representation. Since the preferred tool path is from outside to inside, only the programming implementation of preorder traversal is mentioned here. The first step is to create a procedure named "cut_around_loop" , which will direct the cutter moving along a closed loop. After that the procedure, named "cut_into", will complete the cutter movement as desired. Procedure "cut^nto" is listed as follows: cut_into (root node)
PAGE 52
46 node *root_node; { if (root_node != NULL) /* root node not equal to NULL */ { cut_around_loop (root_node) ; cut_into (root_node>first) ; /* procedure cut_into calls itself */ cut_into (root_node>next) ; /* procedure cut_into calls itself */ } } Notice that a recursive method is used here. Recursion, as a programming technique, comes into play any time a procedure calls itself. Recursion makes a program easier to write and to understand than its nonrecursive counterparts. The other usage of preorder traversal is in constructing a tree map. First a subroutine, called "f ind_children" , is needed. The purposes of the subroutine are to obtain all the subloops from a larger loop and to construct pointer linkages between this loop and the resulting subloops. Preorder traversal technique provides a way to reach every node, and then the subroutine "f ind_children" can be used to find all of its offsprings. Preorder traversal will again treat those offsprings as larger loops and "f ind_children" would find their offsprings. By continuing this process the tree map will be fully constructed. The following subroutine, called "construct_tree" , is designed to perform the process mentioned above .
PAGE 53
47 construct_tree (rootnode) node *root_node; { if (root_node != NULL) /* root_node not equal to NULL */ { findchildren (root_node) ; construct_tree (root_node>first) ; construct_tree (root_node>next) ; } ) Again, a recursion technique is used here. When the above subroutine is invoked, Figure 3.6 shows the sequence of constructing a tree from the outermost loop to obtain a tree map of Figure 3.3c. The above two programs have been simplified to explain the concept of using preorder traversal, although the real ones have more details to consider. Another place that the preorder traversal method is used is in finding the passages between closed loops described in Section 5.5.
PAGE 54
48 Figure 3.6 The tree construction sequence by subroutine "construct tree"
PAGE 55
CHAPTER 4 SOME SUPPORTING SUBROUTINES 4.1 Classifying InsideOutside Relation of a Point and a The winding number [12] reveals the relationship between a closed loop and an arbitrary point. Three cases are possible as shown in Figure 4.1. The winding number equals 1 in the first case. It happens when a point p 0 is inside the closed loop and the loop is CCW. The second case is one in which the point p 0 is inside the loop and the loop is CW. Under this circumstance, the winding number is equal to 1. The third case is when p 0 is outside the loop. Then no matter what the direction of the loop, the winding number equals 0. The winding number of a closed loop is denoted as follows. where n is the number of segments which construct the closed loop. And where (p x ,p y ) is the coordinate of point p 0 , (x i (t) ,y i (t) ) Closed Loop n v=Y,w i , i*l i1 (4.1) (4.2) 49
PAGE 56
Figure 4.1 Three cases of winding number (a) winding number = +1 (b) winding number = 1 (c) winding number = 0
PAGE 57
51 represents the coordinate of any point along the i'th segment of the loop, and x t . ' (t) and y^ft) are the first derivatives of Xj(t) and y f (t) respectively with respect to t. If the i'th segment is a line segment which has (a^b,) and (a 2 ,b 2 ) as the starting and ending point, then it is represented as: x 1 (t) = a x + t (a 2 a x ) , y i ( t) = b 1 + t (Â£> 3 2 ^) , for 0 Â£ t s 1 (4.3) If the segment is an arc, it is represented as: x t = x c + r cos ( t) , y 1 (t) = y c + r sin ( t) , 0 X <. t <> 0 2 for CCW arc . . 0 X ^ t ^ 0 2 for CW arc ' Â’ ' where (x c ,y c ) is the arc center coordinate, r is the arc radius, 0 1 is the starting angle, and Â© 2 is the ending angle. For example, if the arc is counterclockwise spanning from 0 to 0 . 5n , then 0 X = 0, 0 2 = 0.5 7i, or if it is a clockwise arc spanning from 0.5 n to 1.5 tt, then 0 X = (0.5 + 2) 71 = 2.5 7i, 0 2 = 1.5 t; . The exact solution of for the i'th segment can be obtained by integral if the segment is an arc or a line segment. But if other kinds of curves are involved, numerical integration may have to be applied. The computational results of the winding number W i are shown as follows:
PAGE 58
52 (A) For line segment Let constants c 1 , c 2 , and c 3 be c x = (a x p x ) (b 2 b x ) (b x p y ) (a 2 a x ) , c 2 = (a 2 a x ) 2 + (b 2 b x ) 2 , c 3 = 2 (i3 2 b x ) (b x p y ) +2 (a 2 a x ) (a x p x ) . The winding number W. will be W 1 = 0, for c x = 0 (4.5) [ tan ' l 2 ^kr ' tairl wrr 1 for Ci ' 0 (4 6> (B) For arc Let constants C 1 = X c Px' C 2 = y c Py' C 3 = r 2 + c, 2 + C 2 2 , C 4 = 2 r ( c, 2 + C 2 2 ) 0 5 , 0 3 = tan' 1 (C,/C 2 ) when C 2 > 0 , or 0 3 tan' 1 (C,/C 2 ) + 7T when C 2 < 0 , or 0 3 " 0 . 5tt when C 2 = 0 and c 1 > 0, or 0 3 = 0 . 5tt when C 2 = 0 and c 1 < 0. The winding number W s will be Wi = (9z .~ 9l) if (r 2 Ci cf ) =0 (4.7) 4 71 or
PAGE 59
53 (0 2 0i ) W< = Â— Â— if C Â± = C 2 = 0 2 Tt (4.8) Otherwise 0 ,0 , i 2 cl~cl , c, tan (0.5m) + c, Â“Â‘V 6 * W< = Â— i + Â— Â— tan' 1 Â— 4 71 \x 2 ~cl~cl\ o 2 2 r 2 cl~c 2 m=6 1 +0 3 (4.9) Notice that, because of the limitation of the function tan' 1 , the range of m should always be between n and tt. Thus, in the case of m ranging from 0 to 1.57T, it is necessary to change its range to from 0 to tt plus from n to 0.57T. Additionally, it has to be kept in mind that the value of the tan' 1 part of the Eguation 4.9 tan' , c, tan (0.5m) + c. n = Â— if m = 7i, 2 2 2 r 2 c 1 c 2 =Â— if m = 7i Notice that since the exact solution instead of the numerical approximation is used, the result is very accurate even if the chosen point is very close to the loop. The error usually is between Â± 0.001. The winding number is used to classify the direction of a closed loop as well as to distinguish the insideoutside relationship between a certain point and a loop. The reason to check the orientation of a loop is that the validity of a loop is determined by its direction. While obtaining the subloop from a previous loop, the geometry may cause a crossing between offsets. In such a case, one outer loop generates two or more subloops. If a pocket consists of
PAGE 60
54 islands, they are included by successively expanding their boundaries segmentwise. Again intersections may cause multiple subloops. In both cases, only those subloops with the same orientations as its larger loop are valid. Those with different orientation are eliminated and it is not necessary to find their subloops in the next path generation process. Since a point is needed while calculating the winding number, in order to find out the orientation of a loop, an appropriate point has to be chosen. If the calculated winding number can not be used to determine the orientation, it is necessary to try another point. The procedure of classifying the orientation is: (1) Find the midpoint of the first segment of the loop boundary. (2) Find the point which is at a distance of +0.05 times the segment length from the midpoint and on the line perpendicular to the segment at the midpoint. (3) Find the winding number. If it is between +1.001 and +0.999, the loop is CCW and the program is terminated. If it is between 1.001 and 0.999, the loop is CW and the program is terminated. If neither is the case, the procedure needs to be continued. (4) Repeat step 2 except the distance is 0.05 times the segment length, and then perform step 3 for the new point. (5) Find the midpoint of the next segment until all the
PAGE 61
55 segments are reached, and then repeat step 2 to step 4. (6) If the orientation still can not be determined, it can be claimed that the loop is too small to be a valid loop. The following case is another example of using the winding number. If a subloop, obtained from continuously shrinking pocket boundaries, is inside the expanded loop of an island boundary, then this loop is invalid. The situation of a closed loop inside another closed loop should satisfy the condition that each segment in the first loop is inside the second loop. The condition of a segment being inside a closed loop can be checked by the following two conditions: (1) No intersection exists between the segment and the loop, or if intersections did exist, they are at the end points or at the tangent. (2) An appropriate point on the segment is inside the loop. The winding number calculation comes in handy to verify the second condition. 4.2 Intersection of Two Segments Three kinds of intersection are expected which are intersection of two line segments, of a line segment and an arc, and of two arcs. The procedure to find the intersection between two line segments involves the following three steps: (1) Find the unlimited lines which contain the line segments. (2) Find the intersection between these two unlimited lines.
PAGE 62
56 (3) Check the found point to verify whether it belongs to both line segments. The procedure to find the intersection between a line segment and an arc involves the following steps: (1) Find the unlimited line which contains the line segment, and the circle which encloses the arc. (2) Find the intersection (s) between the unlimited line and the circle. (3) Check the found point (s) to verify whether it belongs to both the line segment and the arc. The procedure to find the intersection between two arcs is arranged by the following steps: (1) Find the intersection (s) between two circles which have the same center coordinates and radii as the two arcs. (2) Verify whether the found point (s) is on both arcs. Several supporting subroutines are needed for the above three procedures. Their names are: "line_dir" , ,, point_on_line_segment H , "point_on_arc" , "line_2_points" , "intersection_2_lines ,, , "intersection_line_circle" , and "intersection_2_circles" . The purpose of subroutine "line_dir" is to obtain the direction angle of a line segment with (x^y,) and (x 2 ,y 2 ) as the coordinates of the starting and ending points. Subroutine "point_on_line_segment" has the arguments x 1 , Yi' x 2 ' ^ 2 ' X 3 > and Yz* The line segment is denoted by two end points with coordinates (x 2 , y 2 ) and (x 3 , y 3 ) . If point (x,,
PAGE 63
57 y.,) is on the line segment, the subroutine returns TRUE, and otherwise FALSE. Note that even if the point is not on the line segment, but with a distance of less than 0.00005 inch, then the subroutine will return TRUE, since in most NC milling machines the accuracy is only up to 10' 4 inch. The clearance of 0.00005 inch also applies to the subroutine "point_on_arc ,, . Subroutine "line_2_points" will return the coefficients a, b, and c of the line equation ax + by + c = 0. The input arguments are the coordinates of two end points, (x,, y,), and (x 2 , y 2 ) . Subroutine "intersection_2_lines" will return the coordinate of the intersection point. The input arguments are a.,, b,, c.,, a 2 , b 2 , and c 2 which represent two unlimited lines a.,x + b,y + c 1 = 0, and a 2 x + b 2 y + c 2 = 0. Subroutine " intersect ion_line_circle" will return the number of intersecting points (0, 1, or 2) and their coordinates if the intersection exists. The input arguments are a, b, c, x, y, and r. Arguments a, b, and c are the coefficients of a line equation representing an unlimited line, and (x, y) and r represent the center coordinate and radius of a circle. The subroutine "intersection_2_circles" will return the number of intersecting points (zero, one, or two) and their
PAGE 64
58 coordinates if the intersection exists. The input arguments are the center coordinates and radii of these two circles. The algorithms of the above two subroutines are built by the geometric relation between segments rather than by solving the roots of two equations. The method of finding the intersection of a line and a circle is listed as follows: Given: the coefficients a, b, and c of equation ax+by+c=0 which represents Line A, the center coordinate (x Q , y 0 ) , and the radius r 0 of the circle. All notations are defined in Fig. 4.2. Solution: (1) Find d, the distance between (x Q , y 0 ) and Line A, I ax o + b y 0 + c I (a 2 + b 2 ) 0 5 (2) If d > r 0 + 0.00005, no intersection exists. Else if r Q 0.00005 < d < r Q + 0.00005, n = 1. Here n is the number of intersection point. Else n = 2. (3) Assume that Line B is the line which passes through (x Q ,y 0 ) and is perpendicular to Line A. The equation of Line B is bx + ay + (bx 0 ay 0 ) = 0. Find the intersection, point (x^y,), of Lines A and B. (4) If n = 1, the coordinate of the intersecting point between Line A and the circle is (x,, y^ . Else if n=2, then
PAGE 65
59 Figure 4.2 Linecircle intersection Figure 4.3 Circlecircle intersection
PAGE 66
60 (i) find 0 1 , the direction angle of ax + by + c = 0; (ii) the intersection points (x 2 , y 2 ) and (x 3 , y 3 ) are x 2 , x 3 = x, Â± (r 0 2 d 2 ) 0 5 cos (Â© 1 ) / y 2 / y 3 = y, Â± (r 0 2 d 2 ) 0 5 sin (Â©,) , The method of finding the intersection of two circles is listed as follows: Given: (x a , y a ) and r g/ the center coordinate and radius of Circle A, and (x b , y b ) and r b , the center coordinate and radius of Circle B. All notations are defined in Figure 4.3. Solution (1) Find the distance between two centers, d = ((x b x a ) 2 + (y b y a ) 2 ) 0 * 5 . (2) If d > (r a + r b + 0.00005), then n = 0. Here n is the number of intersection points. Else if (r a + r b .00005) < d < (r a + r b + .00005), then n = 1. Else if d < (r a rj .00005), then n = 0. Else if (  r a r b  .00005) < d < (r a r b  + 0.00005), then n = 1. Else n = 2. (3) Find 0 1f the direction angle of the vector from (x a , y ) to (x b , y b ) . (4) If n = 1, 0 2 = 0. r a 2 + d 2 r b 2 Else if n = 2, then 0 2 = cos' 1 ( ). 2 r d a
PAGE 67
61 The coordinates (x Q , y 0 ) and (x.,, y.,) of the intersection points are x 0 , x 1 = x a + r a cos (0 1 Â± 0 2 ) , y 0 / Yi = y a + r a sin ( 0 i Â± e 2) Â•
PAGE 68
CHAPTER 5 FINDING THE TOOL PATH OF A POCKET The tool path for a pocketing operation can be divided into two portions: One is the initial slotting pass around the pocket profile as well as around the island profiles, if islands exist. The other is the spiral machining pass from the outside in. The tool path of the slotting pass is the shrunk offset loop from the pocket boundary with the distance being expressed as a sum of the tool radius plus the desired finishing immersion. On the contrary, the expanded offset loops from island profiles are the slotting tool path for islands. Thus, the tool passes for slotting are found by using equal offset distance. For the spiralin tool path, the optimization process, mentioned in Chapter 2, can be used to determine the radial immersions. Each machining direction will use an immersion which may be different from that of the other machining directions. These optimized immersions are the offset distances for finding the continuous shrunk offset loops from the slotting pass loop. These offset loops, found by using unequal offset distances, become the spiralin tool passes. 62
PAGE 69
63 5.1 Finding Offset Loops of Equal Offset Distance The process of finding an offset loop from a closed loop is comprised of three steps as follows: 1. finding the offset of each segment on the original loop. 2. linking pair by pair the offset segments whose original segments are adjacent thus resulting in a gross offset loop. 3. splitting the gross offset loop into several subloops. These steps are explained in detailed below. 5.1.1 Finding the Offset of Each Segment on the Original Loop The offset of a line segment is a parallel line segment at an offset distance. Figure 5.1 shows the relationship of a line segment L 1 and its two offset segments, 0 1 and 0 2 . Segment L 1 starts from (a, b) and ends at (c, d) . The offset distance is D. The starting points of 0 1 and 0 2 are Â°l .start _ ( Â± D(bd) Â± D(ca) ^ (5 ^ The ending points of 0 1 and 0 2 are o'* = ( t D(bd) tc _ a _ Â± Dica) +d _ b , 2,end \J (ca) 2 + ( db ) 2 y/Tc^aY^rid^bT 2 Since, in Section 3.1, it has been defined that the coordinates of the starting and ending points are used to represent a line segment, offset segments 0 1 and 0 2 are determined by the above expressions.
PAGE 70
64 Figure . 1 The relationship of a line segment, L., and its offset segments, 0 1 and 0 2 Figure 5.2 Adding extra arc to connect two offsets
PAGE 71
65 The offset segment of an arc is another arc of the same orientation, either CW or CCW. As defined in Section 3.1, geometrically an arc is represented by its center point coordinates, its radius, and the starting and the ending angle with respect to the X axis, and topologically an arc is "type" 4 if CCW and "type" 5 if CW. The "type" of the offset arc will remain the same as its original arc. Geometrically, the offset arc will be represented by the same center point coordinates, starting angle, and ending angle as the original arc. However, the radius of the offset arc is an offset distance greater or smaller than the original arc. There are cases when the radius of the original arc is smaller than the desired offset distance. In this circumstance, the arc has no inner offset arc. 5.1.2 Linking the Offset Segments Whose Original Segments Are Adjacent The linking process between two offset segments can be separated into two cases. These two cases are distinguished by the angle between the neighboring parent segments on the original closed loop, this angle being greater or lesser than 180Â°. 5. 1.2. A Case 1: the Angle Is Greater Than 180Â° As shown in Figure 5.2, since 0 is greater than 180Â°, an extra offset arc is added to connect these two offset
PAGE 72
66 segments. The radius of the added arc is the offset distance. The center of the added arc is the common end point of the two original segments. The starting and the ending angle of the added offset arc are related to the leading and the trailing offset segment separately. In the case of a CW closed loop, if the leading (or the trailing) segment is a line segment, the ending (or the starting) angle of the added offset arc is 90Â° lesser than the direction angle of the line segment. If the leading (or the trailing) segment is a CW arc, the ending (or the starting) angle of the added offset arc is 180Â° greater than the starting (or the ending) angle of the CW arc. If the leading (or the trailing) segment is a CCW arc, the ending (or the starting) angle of the added offset arc is the same as the ending (or the starting) angle of the CCW arc. Similar method can be applied if a CCW closed loop is involved. 5.1.2.B Case 2: the Angle Is Lesser Than 180Â° First, the intersection between a pair of neighboring offset segments needs to be found. As shown in Figure 5.3, if an intersection exists, the intersection point will be assigned as the end point of this pair of offset segments. The assignment means that the data representing the offset segments need to be updated depending on the types of offset segment (line segment, CW arc, or CCW arc) and on the coordinate of the intersection point.
PAGE 73
67 Figure 5 Figure 5.4 0 .3 Connection of the intersecting offsets Adding auxiliary line while 9 < 180Â° and no intersection exists between two offsets
PAGE 74
68 If no intersection exists between the pair of neighboring offset segments, as shown in Figure 5.4, an auxiliary line segment is added to connect the ending point of the trailing offset segment and the starting point of the leading offset segment. This auxiliary segment is marked with a different status from the ordinary offset segments. Later, the purpose of the auxiliary segment will be explained. 5.1.3 Splitting the Gross Offset Loop into Several Subloops In many cases, the offset loop may result in the situation as shown in Figure 5.5 where the offset loop consists of five subloops. The subloops 1, 3, and 5 have the same orientation (CW) as the original loop, but not subloops 2 and 4 (CCW) . The criteria of determining the validness of a subloop is by its orientation. When the subloops are in the opposite direction to their original loop, they are invalid. On the other hand, they are valid when they are in the same direction. Therefore, subloops 2 and 4 are discarded while subloops 1, 3, and 5 are kept. Notice that the computer is not capable of identifying whether a offset loop is a combination of many offset subloops or not. Thus, a procedure called "split" is created to divide the offset loop into several subloops if necessary. After that, the winding number calculation mentioned in Section 4.1 is used to determine the orientation of each subloop. The algorithm of "split" is as follows:
PAGE 75
69 (a) (b) (c) Figure 5.5 An example of using procedure "split" to result in multiple subloops
PAGE 76
70 1. Initialize Loop L as the original offset loop. 2. Initialize Segment A as the starting segment of Loop L. 3. Initialize Segment B as the next segment of Segment A. 4. Find the intersection of Segment A and B. If no intersection exists, or only one exists while Segment A and B are two adjacent segments, update Segment B to its next segment. If one or more intersecting points are found between Segment A and Segment B, a sibling of Loop L, say Loop L' , is created by dividing Loop L into two loops at the intersecting point nearest to the starting point of Segment A. The splitting procedure after the intersection point is found is shown in Figure 5.6. First, Segment A and B are divided into two segments from the intersecting point separately, say Segment A and A', and Segment B and B' . Memory blocks have to be allocated to save the data representing Segment A', Segment B', and Loop L' . Care must be taken to see if the intersecting point coincides with the ending points of Segment A (or B) . In such case, no memory allocation is needed for Segment A' (or B'), and the next segment of Segment A (or B) is assigned as Segment A' (or B * ) . The second step is to reconstruct the linkages between segments and between loops. They are Segment B'> previous = Segment B > previous; Segment B' > next = Segment A'; Segment A' > next = Segment A > next;
PAGE 77
71 Segment B' > previous = Segment B > previous Segment B' > next = Segment A' Segment A' > next = Segment A >next Segment A' > previous = Segment B' Segment A > next = Segment B Segment B > previous = Segment A Loop L' > next = Loop L > next Loop L > next = Loop L' Loop L' > start = Segment B' Figure 5.6 The "split" procedure after intersection point found
PAGE 78
72 Segment A' > previous = Segment B'; Segment A > next = Segment B; Segment B > previous = Segment A; Loop L' > next = Loop L >next; Loop L > next = Loop L' ; Loop L' > start = Segment B 1 . Notice that the sequence of the above statements does matter. They are not allowed to switch randomly. 5. If Segment B is not the starting segment of Loop L, return to step 4 . 6. Update Segment A to its next segment. If Segment A is not the previous segment of the starting segment of Loop L, go to step 4 . 7. Update Loop L to its next sibling. If Loop L is not NULL, go to step 2 . 8. Starting from the first subloop, every segment on each loop is checked for the existence of an auxiliary line segment. If one or more auxiliary line segments are on a subloop, this subloop is invalid. If the subloop contains no auxiliary line segments, the orientation of the subloop is verified. If the orientation is not the same as the original loop, the subloop is invalid too. In term of programming techniques, each subloop is represented by a string of data which occupies an allocated memory block. When a subloop is declared invalid, this memory block has to be freed up so that it can be used again.
PAGE 79
73 Otherwise, the memory block becomes an unused area in the system. For a pocket of complex geometry, while calculating the tool path, a lot of invalid subloops are created. Too many unfreed memory blocks may result in the system running out of memory and the calculations being terminated. Notice that before a subloop is abandoned, the linkages between its previous and its next siblings have to be set up. 5.2 Finding Offset Loops of Unequal Offset Distances The process of finding the offset loops of unequal offset distances consists of three steps as follows: 1. finding the offset segment of each segment on the original loop, and then 2. connecting each pair of neighboring offsets to form a gross offset loop, and then 3. using the subroutine "split" of Section 5.1.3 to divide the gross offset loop into several subloops, and then using the "winding number" algorithm to check the legitimacy of each subloop. The third step is the same as that used in finding the offset loops of equal offset distance. Since the procedure has been mentioned in Section 5.1, there is no need to explain it repeatedly. The first two steps are explained in more detail below.
PAGE 80
74 5.2.1 Finding the Offset of Each Segment on the Original Loop It has been explained in Section 1.2 that, when unequal offset distances are used, the offset segment of an arc will not be an arc. Therefore, a simple and preferred way of finding the offset of an arc is by using a series of line segments to approximate this arc, finding the offset of each line segment, and then connecting these offset line segments which become the offset of the arc. The criteria of approximating an arc by line segments is: 1. If the radius of the arc to be approximated is so small that an user specified allowable difference is greater than it, the arc is replaced by a line segment. Otherwise, the second and the third rule will be applied. 2. The interval of arc span for each line segment is no more than 20Â°. 3. The maximum difference between the arc and its approximated line segments can be no more than the allowable difference. Figure 5.7 shows an example of the conversion. In the figure, D represents the user specified allowable difference, S the span of the arc, and R the radius of the arc. D, S, and R combined will determine the number of line segments, N, needed to approximate the arc. N, which is an integer, can be calculated by the following equation. N INTR ( ) + 1 2 cos' 1 ( Â— Â— ) RD (5.3)
PAGE 81
75 As soon as N is found, the coordinates, (P, S ,P U j) in A # 1 7 $ Â• Figure 5.7, of the end points of the line segments will be where Â© is the starting angle of the arc. In order to save the data representing these line segments, memory allocation and linkage construction are needed. Figure 5.7 Approximation of arc by line segments After every arc has been converted to a string of line segments, the only type of segment left on the original loop will be line segments. In addition, after the initial slotting, there are no outside corners left. Therefore, it is not necessary to add an extra arc between two offset segments. As a result, there will only be line segments involved in finding the offset loop of unequal offset distances. / Â• Â• / N (5.4)
PAGE 82
76 5.2.2 Connecting Each Pair of Neighboring Offsets to Form a Gross Offset Loop There are three cases which arise during the process of connecting the offsets of two neighboring line segments if unequal offset distances are used. The first case of connection occurs when the two offset segments intersect. In this situation, the connection is formed after the intersection point is set to be both the ending point of the preceding offset and the starting point of the trailing offset. The offset segments do not cross each other in the second and the third case. These two cases can be distinguished mathematically by the following equation. 0 = 0 X + 0 2 0 3 (5.5) In this equation, is the angle between the offset of the leading segment and an imaginary segment which connects the ending point of the leading offset segment and the starting point of the trailing offset segment. Â© 2 is the angle between the imaginary segment and the trailing segment. 0 3 is the angle between the two original line segments. In the second case, the result of 0 in Equation 5.5 will be n, and will be 3n in the third case. The three cases are better demonstrated by Figure 5.8. Figure 5.8a is a closed loop formed by five line segments which are Segment A to Segment E. And Figure 5.8b shows the closed loop and the five offset segments. Segment A' to E', of
PAGE 83
77 Figure 5.8 A example of finding offset loop of unequal offset distances (a) The outer loop (b) 5 offset segments found (c) The gross offset loop found
PAGE 84
78 Segment A to E separately. Since Segment E' intersects Segment A', the connection between these two offsets belongs to case 1. So are the connection between Segment D' and E', and between C' and D' as well. However, no intersection exists between Segment A' and Segment B', nor is there any between B' and C'. Figure 5.9 is a closeup look at circle 1 of Figure 5.8b. It shows the three angles, 0, , Â© 2 , and 0 3 , of Equation 5.5 between Segments A, B, and their offsets, A' and B'. Since the resulting 0 is 3n , the connection between Segment A' and Segment B' is case 3. Figure 5.10 demonstrates the same angles between Segments B, C and their offsets at circle 2 of Figure 5.8b. The connection between B' and C' is case 2 since the resulting 0 of Equation 5.5 is 7r. The obvious solution for connection in the second case is shown in circle 3 of Figure 5.8c between the offset of Segment B and the offset of Segment C. The result can be achieved by 1. Finding the unlimited lines containing Segment B' and C'. 2. Finding the intersection point of these two unlimited lines. 3. reassigning the intersection point as the ending point of Segment B' and the starting point of Segment C'. The right connection for the third case, shown in circle 4 of Figure 5.8c between the offset of Segment A and that of Segment B, is by appending an auxiliary line. The extra loop with the auxiliary line will be discarded later by executing the subroutine "split" mentioned in Section 5.1.3.
PAGE 85
79 Offset of Figure 5.10 Case 2 connection: 9 = 0 2 + 0 3 0 1 = 540Â° 0, = 180Â°
PAGE 86
80 Notice that in the situation as shown in Figure 5.11, the connection between the offsets of Segment A and B is a case 1 since they intersect with each other. However, since the offset of Segment B does not cross the offset of Segment C, the offset connection belongs to case 2 or case 3. By further calculation, 0 of Equation 5.5 is 3?r. It is thus categorized as a case 3 situation. An auxiliary line is needed to connect the two offsets of segments B and C. However, adding an auxiliary line directly as shown in Figure 5.11c would not achieve the desired outcome as shown in Figure 5. lie. As a result, in order to accommodate this kind of situation, if the offset finding is a case 3, before appending the auxiliary line, the preceding offset is extended backwards a certain distance, and the trailing offset forward the same distance. This certain distance is set to be the tool radius. The undesired loop, shown in the upper left part of Figure 5. lid, will be discarded later by executing "split" of Section 5.1.3. 5.3 Tool Path of a Pocket with Islands When islands are present within the pocket boundary, the tool path finding procedure is more complicated than without islands. From the linked list depicting the island profiles (see Section 3 . 5 of island representation) , another two linked lists with the same representation as that of the island profiles are created using the offsetting algorithm. Each node of the first created linked list represents the first
PAGE 87
81 Figure 5.11 Another example of connecting offsets (a) 3 segments on an outer loop (b) 3 offset segments before connection (c) Adding auxiliary line without extending the offsets of B and C (d) Adding auxiliary line after extending the offsets of B and C (e) The desired outcome
PAGE 88
82 outer offset loop of an island profile. The offset distance is the same for all directions and is equal to the tool radius plus the radial depth of cut for finishing. Therefore, each node of the first linked list represents the slotting (contouring) path of an island profile and thus this linked list represents the slotting path of all of the island profiles. The nodes of the second linked list represent the outer offset loops of the contour tool path around the islands. The offset distances are the result of the optimization process (see Chapter 2) and may vary. The purpose of the second linked list, say "List outisland" , is explained below. After finding all subloops from a closed loop which is a descendent of the pocket profile, these subloops are checked to see if they are within, or intersect with any of the loops represented by the nodes of "List outisland". In other words, intersecting inspection is done between every segment on every subloop and each segment on the second expanded loop of every island profile. The fact that one or more intersection points exist between two segments proves that the two loops which the segments are on intersect with each other. The occurrence of an intersection point will trigger a simplified set Boolean operation: difference. The difference operation is to find the outcome of area A minus area B, or A B. The result is areas which are inside A, but outside B.
PAGE 89
83 Figure 5.12 gives a better look at a situation when the difference operation is used. Beginning from the second shrunk loop of the pocket boundary, intersection is checked between the shrunk loop and the second expanded loop of the island profile. If no intersection exists, the shrinking process continues. As shown in Figure 5.12a, the process does not stop until an intersection is found between the fourth shrunk loop and the second expanded loop of the island profile. The desired outcome, shown in Figure 5.12c and 5.12d, is two closed loops. It is clear that if an area is represented by a closed loop, the difference between the two areas in Figure 5.12b will result in the two areas in Figure 5.12c. Although the concept of difference of areas has nothing to do with tool path generation, the results are found to match very well. Therefore, it is necessary to understand how the difference operation is functioning. Figure 5.13 shows a more detailed description of the above operation. In Figure 5.13a, Loop L a and Loop 1^, are the same as those in Figure 5.12b. The detection of the first intersecting point, Point P, will trigger the difference operation. First, the orientation of Loop 1^ is reversed. After that, Segment C and Segment D which intersect at Point P are divided into two segments separately. Segment C becomes Segment C and C', and D becomes D and D'. The linkages are then reassigned as follows: Segment C' > next = Segment D;
PAGE 90
84 Figure 5.12 Resolution of crossing tool path resulting from a single loop by set operation difference
PAGE 91
85 L a Segment D \ / V Figure 5.13 Detail of difference operation (a) First intersection point, Point P, found (b) Using the algorithm of "split" to perform difference operation
PAGE 92
86 Segment D > previous = Segment C'; Segment D' > next = Segment C; Segment C > previous = Segment D' . Assuming Point P is not an intersection point (which can be done by adding several "if" statements in a computer program) , what is seen, instead of two intersecting closed loops, is a string of closed loops: Loop L u L 2 , Lj, and L 4 as shown in Figure 5.13b. The algorithm of "split" mentioned in Section 5.1.3 will be used to sever these subloops. After that, the winding number (which indicates the orientation of a loop) of each subloop is calculated. Loops L 2 and L 4 are kept since their orientation is the same as Loop L a which is the shrunk loop from the pocket boundary. On the other hand, Loops L, and Lj are discarded. Even if no intersection occurs, each subloop is investigated to find if it is within one of the loops which are the second expansion from the island profiles. The condition of a closed loop inside another closed loop has been explained in Section 4.1 of the winding number. If the condition is met, this subloop will be one of the innermost loops and will have no offset of its own. In other words, the tree node, representing this subloop, will be the last on the tree branch to which this tree node belongs. Figure 5.14 depicts the tool path of a pocket with a rectangular island. The second expanded loop from the island is portrayed as the dashed line loop. When the fifth shrunk loop from the pocket
PAGE 93
87 Figure 5.14 One case of loop termination when the shrunk loop from the pocket boundary profile is inside the second expanded loop of the island profile
PAGE 94
88 profile is within the dashed line loop, this dashed line loop would be discarded, and the fifth shrunk loop would become the last of the spiralin loops. 5 . 4 Loop Termination Conditions Since the tool passes are closed loops obtained by continuously shrinking the pocket boundary, an important task is to determine when to terminate the shrinking process, or in other words, to determine which closed loops are the last ones. The last closed loop is either 1. a loop which can find no legal subloops, or 2. a loop which is inside the second expanded offset loop of an island profile. The second condition has been demonstrated in Figure 5.14. As for a "legal subloop", it must satisfy both of the following conditions: a "legal subloop" must be 1. a closed loop which is in the same orientation as its original loop, and 2. a closed loop consisting of no auxiliary segments. Figure 5.15 demonstrates two circumstances in which a loop terminates. In Figure 5.15a, the original loop is a clockwise triangle constructed by Segments A, B, and C. The offset loop is made by relimiting three offset segments of Segments A, B, and C. It results in a triangle of Segments A', B', and C'. Notice that, contrary to the original loop, the offset loop is CCW, and thus is not a "legal subloop". As shown in Figure
PAGE 95
89 Figure 5.15 Loop termination conditions
PAGE 96
90 5.15b, offset segments A', B' and C' do not intersect with each other. The further checking of 9's of Equation 5.5 verifies that the connections between A' and B', between B' and C', and between C' and A' are all case 3 scenarios. As a result, auxiliary lines are offered to form a link between the ending point of A' to the starting point of B', the ending point of B' to the starting point of C', and the ending point of C' to the starting point of A'. The "split" procedure will then result in four subloops. Since all of them contain at least one auxiliary line, they are void. Offset loop finding is terminated at the closed loop formed by Segments A, B, and C. 5.5 Connection between Larger Loops and Their Subloops As mentioned in Section 3.3, the relationships between a pocket boundary and its tool pass loops form a general tree data structure in which each loop is a tree node. After each valid offset loop is found, the linkages with its outer loop and its sibling loop have to be constructed accordingly. The node representing the newly found loop is thus placed in the appropriate place in the tree. In the tree structure, the pocket boundary is the root node which is the highest rank tree node, and the outer tool pass loops are ranked ascendingly higher among the tree nodes. Those tool pass loops are the continuous offset loops from the pocket boundary obtained by using either equal or unequal offset distances.
PAGE 97
91 After all the offset loops have been established, they need to be organized to become an integrated tool path. In other words, connection is essential between each larger loop and its subloops. 5.5.1 Two Cases of Connection between Loops The way of linking is better demonstrated by Figure 5.16. Figure 5.16a displays a simple square pocket and its offset loops. Starting from the innermost loop, which is Loop 8 of Figure 5.16a, until the second successive offset loop of the pocket boundary, which is Loop 3, the starting segment of each loop is extended backward until this segment intersects with a segment on its outer loop. After that, the intersection point is assigned to be the starting point of the starting segment on the inner loop as well as to be the ending point of the intersected segment on the outer loop. Furthermore, this intersected segment is given a flag to symbolize it being the last segment of the outer loop. The result, shown in Figure 5.16c, becomes a true spiral tool path which is more efficient in terms of total distance of tool path compared to the conventional spiral tool path presented in Figure 1.7. Topologically, the pocket boundary and its tool passes of the above case can be represented by a group of loops with the outermost loop symbolizing the pocket boundary as shown in Figure 5.17a. In the figure. Point 1 and Point 2 are the starting points of Loop C and Loop D separately. In figure
PAGE 98
92 (a) (c) Figure 5.16 A simple case of connection of loops (a) a square pocket and its tool pass loops (b) starting segments are extended backward (c) the intersected segments are trimmed
PAGE 99
93 (a) (b) (c) Figure 5.17 Topological view of connection of loops (a) a group of loops (b) loops are extended (c) loops are trimmed to hinder the connection
PAGE 100
94 5.17b, Loop C is extended backward from point 1 until it intersects Loop B at Point 3 . So is Loop D from Point 2 until it intersects Loop C at point 4 . The portion of Loop C between Point 1 and Point 4 is then trimmed as shown in Figure 5.17c. The outcome is that: C starts at Point 3 and ends at Point 4. It no longer resembles a closed loop. The same technique is used for Loops D, E, F, and G. Therefore, Loops C, D, E, F, and G are said to be "extended and trimmed". As for the innermost loop, Loop H, it is extended backward but not trimmed. Thus, it is said to be "extended only". Additionally, Point 3 is assigned as the starting point of Loop B. The above case is too simplified to represent a general case, for each tree node, except the lowest rank one, has exactly one child. In more complicated cases, say the one shown in Figure 3.3, it is necessary to consider the loop connection in a more detailed fashion. In this case, the pocket boundary and its tool pass loops form a general tree as demonstrated by Figure 3.3b. Topologically these loops are represented by circles as in Figure 3.3a. To cross reference more conveniently, Figure 3.3b is moved to Figure 5.18a. The desired connection is demonstrated in Figure 5.18b. In the figure, the slotting pass starts from Point 1, around Loop B, and then back to Point 1. The spiralin tool passes, starting at Point 1 right after the slotting is done, will follow the preorder tree traversal whose sequence, as mentioned in
PAGE 101
95 Figure 5.18 Loop connection on a more complicated case (a) General tree representation of loops (b) Connection finished
PAGE 102
96 Section 3.6, isB*C*F*JÂ»GtH'D*E*I. Notice that before the connection is achieved, each node represents a closed loop. After this connection, the closed loops will be either "extended and trimmed" or "extended only" according to the following rules: 1. The loops which enclose subloops are "extended and trimmed". Loops C, F, and E belong to this group in this case. 2. Those innermost loops are "extended only", such as Loops J, G, H, D, and I in this case. The innermost loop can be distinguished if the tree node, representing the loop, has a FIRST field which is null (see tree representation) . 5.5.2 Retract and Approach When traversing through a node which is not the first child of its parent, the cutter needs to be "retracted and approached" before entering the loop represented by this node. The meaning of "retract and approach" is: 1. moving the cutter in +Z direction a certain distance until it is above the top surface of the pocket, then 2. moving the cutter in XY plane to the starting position of the loop, and then 3. moving the cutter in Z direction to the part surface. If the following condition stands, A node is not the first child of its parent node. a_node>parent>first != a_node,
PAGE 103
97 where, != means not equal. For example, in the case of Figure 5.18, if a_node is Node G, it parent is Node C. The first child of Node C is Node F. Therefore, the left side is equal to Node F, which is not the same as the right side, Node G. Additionally, Node H, D, and E are not the first children of their parent nodes. In the case of Figure 5.18, the procedure of "retract and approach" is required while entering the loops represented by Nodes G, H, D, and E. 5.5.3 Change the Starting Segments of Loops Since the connection of tool pass loops is made by extending backward the starting segment of each loop, it is necessary to ensure that the starting segment, say Segment A, of the loop which is the first child loop of its parent, is parallel to the starting segment, say Segment B, of its parent loop. In other words, Segment A should be originated from Segment B, or Segment A is the offset segment of Segment B. Each offset segment contains a field called "origin". In the initial stages of finding offset loops, for each offset segment created, the field "origin" will be given the addresses of its original segment so that it is possible to trace back the origin of this segment later. In the case shown by Figure 5.18, Node J is the first child of Node F, which is the first child of Node C. Therefore, the loops, represented by Nodes C, F, and J, should have parallel starting segments, and so do those tool pass
PAGE 104
98 loops represented by Nodes E and I. Every segment of an offset loop can trace its origin to the larger loop of this offset loop. However, not every segment on the larger loop has a descendent on its offset loop. If the starting segment, say Segment S, of a first child loop is not the offset of the starting segment of its parent loop, it is necessary to reassign the starting segment of the parent loop to be the origin of Segment S since this origin of S is always on the parent loop. Take the example of Figure 5.18, the starting segment of Loop F should be the origin of the starting segment of Loop J. If not, the starting segment of Loop F should be reassigned. The same procedure applies to Loop F and Loop C, and Loop I and Loop E. For Loop G, H, D, and E, since they are not the first children of their parent loops, the above procedure does not apply to them. Since the redefinition of the starting segments of loops begins from the end of each tree branch, the preorder tree traversal, mentioned at Section 3.6, is used again to reach every node to determine whether it is the end of a tree branch. 5.5.4 Connection of Loops While Islands Exist When islands exist inside the pocket boundary, the procedure of connection will be the same in most cases except that when all segments of any innermost loop can not trace
PAGE 105
99 their origins back to the pocket boundary, but only to one of the island boundaries. Figure 5.19 shows an example of such a case. The pocket geometry and those tool passes before connection being made are shown in Figure 5.19a, and the corresponding binary tree representation is displayed in Figure 5.19b. Although Loop F is the first child of Loop E, all segments on Loop F are not originated from Loop E, but from the island loop. In this case, Loop E is considered as an innermost loop, although it is not. Loop C and D are "extended and trim, while Loop E is "extended only". The process of converting to a true spiral tool path will stop at Loop E. And then the passage from Loop E to Loop F is made possible by using the "retract and approach" method from Point 2 to Point 3. The final spiral starts at Loop F and ends at Loop G. The complete tool path is shown in Figure 5.19c where Point 1 is the starting position for both the slotting and spiralin path.
PAGE 106
100 (b) Figure 5.19 A case of loop connection when an island exists inside pocket boundary (a) Tool pass loops before connection (b) Tree representation of the tool pass loops (c) Tool pass loops connected
PAGE 107
CHAPTER 6 INSTALLATION PROCESSES 6,1 Installation of the New Pocketing Routine in CATIA CATIA [13] by Dessault is installed on an IBM RT10 workstation in the Machine Tool Laboratory at the University of Florida. One of the advantages of CATIA is the fact that it is a 3dimensional CAD/CAM system while most other CAD/CAM commercial packages are either 2dimensional or 2 \dimensional. Additionally, CATIA is a widely used package which provides complete access from the stage of designing to APT codes or CL data generation (explained in Section 6.2). Thus, it is by far more practical than some CAD/ CAM softwares developed by most other researchers. CATIA is capable of providing a utility that allows user written functions to be executed within the CATIA environment through the Interactive User Access (IUA) interpreted language. The IUA language provides several useful capabilities (options) : 1) Select model elements using a digitizer to extract useful geometric data from the user designed model. 2) Access to the model's geometry for creation, modification, and deletion of geometric elements or NC operations (e.g. tool 101
PAGE 108
102 paths generation) of the model. 3) Execution of subroutines developed in the FORTRAN language. The IUA language is not suitable for complex numerical calculations. Thus, a better way to incorporate the new pocketing routine will be to use option 1 of the IUA to select desired elements from a drawing (such as the boundary and the bottom surface of a pocket) , and then use option 2 to extract desired geometric data of these elements. The next step is to use option 3 to execute several FORTRAN subroutines which manipulate these data and generate data representing the tool paths. After that, option 2 is used again to define the NC tool paths according to these generated data. Notice that the main subroutines that will be incorporated with the IUA should be written in the FORTRAN language, but the supporting subroutines which are called by the main subroutines can be in either FORTRAN or C language. An IUA procedure consists of three parts. The beginning of each part is indicated by a keyword. The first two parts are used to declare variables that the procedure will use. All variables that are required for the procedure execution must be declared. The first part begins with the keyword INTERNAL. This part is used to declare the internal variables of the procedure and must exist even if the procedure uses no internal variables.
PAGE 109
103 The second part beginning with the keyword EXTERNAL is used to declare external variables. Any variables authorized by means of the INPUT qualifier are external variables. The third part begins with the keyword PROC and ends with the keyword END. This part consists of the executable part of the IUA procedure which is a sequence of executable instructions. The following is an example of a CATIA IUA program which shows how the above three capabilities are used in IUA program. INTERNAL CHAR* 40 MSG INIT 'SELECT LINE OR FUNCTION KEY 'NO* TO EXIT' REAL XCOORD, YCOORD, ZCOORD EXTERNAL LN LN1 INPUT PROC SELECT MSG LN1, NO IF (KODE EQ NO) EXIT HIGHLT LN1 LOAD EXTRACT LN1, XCOORD, YCOORD, ZCOORD LOAD MOVETO XCOORD, YCOORD, ZCOORD END The first part of the procedure initializes the string variable MSG as 'SELECT LINE OR PRESS FUNCTION KEY NO TO EXIT', and declares variables XCOORD, YCOORD and ZCOORD as REAL. The second part declares variable LN1 as a geometric
PAGE 110
104 entity LN (line) . The first statement of the third part will display the string variable MSG on the bottom section of the monitor screen, and will prompt the user to make a decision whether to select a line on the screen by the digitizer or to press the function key NO. If a line is selected, its address is stored in variable LN1 . On the other hand, if the function key NO is pressed, the value representing NO is stored in the implicit variable KODE. The second statement checks the value of variable KODE. If its value is NO, then the procedure is interrupted by the EXIT instruction. The third statement will display the line which was selected by the digitizer in a highlighted mode. The fourth and fifth statements execute two FORTRAN subroutines named EXTRACT and MOVETO. Subroutine EXTRACT has arguments LN1 , XCOORD, YCOORD, and ZCOORD. Its purpose is to extract the starting point coordinate from the selected line. Subroutine MOVETO, when invoked, will direct the cutting tool from the current position to the position defined by variables XCOORD, YCOORD, and ZCOORD. The above procedure is a simple example. However, by using the same rules, it can be expanded such that all the geometric entities required to define a pocket are extracted and then manipulated to obtain desired geometric data, and then the cutter is directed by these data. The above approach is the principle of the new pocketing routine called "NEWPCKT" . Figure 6.1 shows interactions between "NEWPCKT" and CATIA .
PAGE 111
105 CATIA EXTERNAL Interaction between CATIA and the new pocketing routine Figure 6 . 1
PAGE 112
106 6.2 APT and Machine Codes APT (Automatically Programmed Tool) is a high level NC language that was designed to solve the following problems: 1. Defining the geometric entities used to specify a cutter path ; 2. Calculating the cutter positions (coordinates) or path; 3. Defining the machining specifications needed for completing the machining process; 4. Outputing the cutter path and machining specifications in machineunderstandable language (i.e., NC codes). [14] The fourth task, however, requires an APT processor and a postprocessor . Programming in APT depends, to a great extent, on the knowledge and experience of the programmer and on his spatial visualization of the part. [14] CAD/ CAM systems, widely used in industry for over 20 years to design, draw, store, and modify parts, ease the burden of defining machining process directly by APT codes. Most of those CAD/CAM systems use the geometric data of a CAD model to automatically generate a source machining program (e.g., in APT) and then use an existing NC processor and a suitable postprocessor to decode this APT program into machineunderstandable NC code. CATIA is one of those systems that generates an APT part machining program from the geometric model . After the new chatterfree pocketing routine has been run in CATIA, an APT program defining the cutter path for
PAGE 113
107 machining the pocket can be generated. However, there is no APT program processor and postprocessor available in the Machine Tool Laboratory to decode the APT code generated by CATIA. An APT processor is therefore written although it can only accept limited APT commands which are used for the purpose of pocket machining. Those commands are FEDRAT: define feed rate LOADTL: load a cutter FROM : define the starting position of cutter GODLTA : move the cutter a distance of (dx, dy, dz) GOTO : move the cutter to coordinate (x, y, z) SPINDL: define the speed and the direction of rotation of the spindle FINI : symbolize the end of the program The method that the APT processor uses involves identifying the above commands and then generating corresponding NC codes. For NC codes, the word address format is the one used in modern CNC controller systems. Each word in a statement consists of a character identifying the meaning of the word and a number representing its content [14]. For example, the word specifying a tool position of Y = 1.50 is Y1.50. Some characters in the NC codes and their meaning are listed below: N : statement label
PAGE 114
108 S : spindle speed X, Y, Z : coordinates in X, Y, and Z directions M : operation of machine tool G : code defining motion T : cutter number F : feed rate Table 6.1 lists some examples of decoding APT codes into NC codes. In the table, some of the NC codes and their functions are explained below: G90 : programming in absolute coordinates G91 : programming in incremental coordinates MO 6 : cutter change M03 : spindle start clockwise M04 : spindle start counterclockwise M02 : end of program Table 6.1 Examples of APT codes and their corresponding NC codes APT CODES NC codes LOADTL / 1 N0001 M06 T01 SPINDL / 2000, CLW N0006 M03 S2000 FEDRAT / 500.0 FROM / 0.0, 0.0, 0.0 N0011 G90 XO.O YO.O ZO.O F500.0 GOTO / 1.0, 1.0, 1.0 N0016 G90 XI. 0 Y1.0 Z1.0 GODLTA /1.0, 2.5 1.1 N0021 G91 XI. 0 Y2.5 Zl.l FINI N0026 M02
PAGE 115
109 According to the method introduced above, a program called READAPT. C has been written to translate the APT program, which is generated by executing the chatterfree pocketing routine through CATIA, into an NC machine understandable program.
PAGE 116
CHAPTER 7 EXAMPLES OF TOOL PATHS Figure 7 . 1 shows the drawing of a rectangular pocket with two islands. The dimensions of the pocket are 450mm by 300mm by 2.286mm deep. To make a suitable comparison, two work pieces were machined by utilizing the tool paths from two different routines to produce the above pocket. One routine is the new chatterfree pocketing routine, and the other is the original routine from CATIA. The tool used to machine this pocket was a 25.4mm by 107.0mm 4flute HSS end mill mounted in a setscrew type tool holder on the WhiteSundstrand machining center in the Machine Tool Laboratory. According to the database, shown in Table A. 2 of Appendix A, the spindle speed was set at 2720 rpm, and the feed rate at 1360 mm/min. When the chatterfree routine was used, the optimization process, mentioned in Chapter 2, determined that 5 layers were needed for the initial slotting and 2 layers were needed for the spiralin machining to reach the entire depth of the pocket. Therefore, the optimum axial depth of cut for the initial slotting was 0.4572mm and that for spiralin machining was 1.143mm. The optimum radial immersions for spiralin were 110
PAGE 117
Ill Figure 7 . 1 The drawing of the sample pocket
PAGE 118
112 then determined from the database and the optimum axial immersion. Figure 7.2 shows the tool path generated by this routine. In the figure, the first inner offset loop from the pocket boundary and the first outer offset loops from the island boundaries mark the tool passes for slotting. The dashed lines in the figure represent the passes when the tool travels in air. All other lines in the figure represent the spiralin tool passes. The total machining time was 20.30 minutes. Figure 7 . 3 shows the tool path generated by the original pocketing routine from CATIA to machine the same pocket using the same tool. The tool path was a spiralout starting at Point 1. The maximum radial immersion, required to run this routine, was set at 70%. From Table A. 2 of Appendix A, the corresponding maximum allowable axial immersion is 0.78mm for the radial immersion of 70%. Therefore, to achieve the depth of 2.286mm, 3 layers were required, with each layer being 0.762mm deep. Since the machining time was calculated as 9.10 minutes for each layer, the total machining time for the 3 layers was 27.30 minutes. The tool path from the original routine in CATIA was a spiralout, starting as a slotting pass at the middle portion of the pocket and then machining outward. Therefore, although the maximum radial immersion was set to be 70%, at the slotting portion and at corners which were inevitable for the spiralout option, the radial immersion exceeded 70% which
PAGE 119
113 Figure 7 . 2 The tool path generated from the new chatterfree routine Figure 7.3 The tool path generated from the original routine of CATIA
PAGE 120
114 caused chatter. Figure 7.4 shows the sound signal when chatter occurred during the machining of the sample pocket using the routine from CATIA. Figure 7.5 shows the spectrum of the signal. The chatter frequency is 1210 Hz. Figure 7.6 shows the sound signal taken when machining the sample pocket using the chatterfree routine. Figure 7.7 shows the spectrum of the sound signal. It is obvious that the magnitude is small compared to the signal of Figure 7.5. Comparing the machining times between the new chatterfree routine and the original routine from CATIA, it is seen that the former one is 34% more efficient than the latter one. Additionally, to generate a chatterfree tool path from the original routine, the axial immersion is forced to be reduced from 0.762mm to 0.4572mm, the maximum allowable axial immersion for full radial immersion (refer to Table A. 2 of Appendix A) . The machining time becomes 45.5 minutes which is 2.24 times longer than the machining time encountered when using the tool path resulting from the new chatterfree routine. Figures 7.8 and 7.9 show the photographs of the finished parts produced by both the original routine from CATIA and the chatterfree routine. Notice that the chatter marks are very distinct in Figure 7.8. On the contrary, only feed marks are visible in Figure 7.9. Figures 7.10 and 7.11 show two more examples of tool paths for exotic pockets that the new routine is capable of generating.
PAGE 121
115 RT Ch.O 0.00 0.07 0.13 0.20 0.26 0.33 Time (sec) Figure 7.4 Sound signal taken when chatter occurred during the machining of the sample pocket using the routine provided by CATIA 0.20 0.15 0.10 0.05 0.00 SPEC Ch.O 400 800 1200 Freq (Hz) 1600 2000 Figure 7.5 The spectrum of the above sound signal
PAGE 122
116 0.6 0.3 0.0 0.3 0.6 0.00 0.07 0.13 0.20 0.26 0.33 Time (sec) Figure 7.6 Sound signal taken when machining the sample pocket using the chatterfree routine 0.20 0.15 0.10 0.05 0.00 0 <100 800 1200 1600 2000 Freq (Hz) SPEC Ch.O RT Ch.O Figure 7.7 The spectrum of the above sound signal
PAGE 123
117 Figure 7.8 (a) The finished part machined by the tool path from the original pocketing routine from CATIA (b) A closeup look at the chatter marks
PAGE 124
118 Figure 7.9 (a) The finished part machined by the tool path from the new chatterfree pocketing routine (b) A closeup look at the feed marks
PAGE 125
Figure 7.10 An example of tool path Figure 7.11 An example of tool path
PAGE 126
CHAPTER 8 CONCLUSIONS AND RECOMMENDATIONS The study described in this dissertation concerns the development of a new pocketing routine in the field of NC tool path generation. This new routine would meet certain quality criteria by using appropriate axial and radial depths of cut selected from a database of acceptable cuts which has been filled either through simulation or through experimentation. While the criteria in this case is the avoidance of chatter, the required database can also be prepared using any other criterion such as surface finish, accuracy, cutting force, etc, or using a combination of criteria. The optimum chatterfree pocket machining is achieved by the combination of the following strategies: 1. An optimization process, which utilized the database in association with the geometry of the pocket, is used to automatically determine the optimum radial and axial immersions for the pocket machining in terms of minimizing the production time. The optimized radial immersions might vary for different machining directions. As a result, the routine is capable of allowing the radial immersion to vary. 2. Tool paths are designed spirally from outside in and are 120
PAGE 127
121 designed to follow the arc shapes around the outside corners. The strategy is to avoid abrupt cutting angle increases at the corner positions which may cause chatter. The pocketing routine has been significantly improved by including the possibility of multiple islands and by using true spiral tool paths. The basic implementation has been in CATIA. Additionally, a processor for APT programs was developed to generate NC machine codes. Work pieces have been cut using the tool paths generated by the new pocketing routine as well as by the original routine of CATIA. The former tool path showed about 34% higher metal removal rate than the latter one. It should be noted that this was under the assumption that the programmer using the conventional software (either CATIA or others) was aware of the dynamic capabilities of the NC machines (which is not generally the case now) and therefore the time for verification cuts and rewriting, typically needed during the programming stage was not included in evaluating the improvement. By comparison to common practice now, the saving achieved by using the new routines would be dramatically larger. Although the new routine provides a better way for machining the pocket, it is limited in the design of tool paths for pockets with flat bottom surfaces. A good expansion to the new routine will be: using the same strategies mentioned above to create better tool paths for pockets with
PAGE 128
122 3D sculptured surface than those created by the original routine of CATIA. Another approach that can make further improvement to the routine in terms of machining time will be by using the geometry modeling techniques to verify the tool paths. The tool paths are designed to achieve chatterfree machining which means that the cutting angles would be equal to the angles implied by the radial immersions. However, in many places along the tool paths such as around inside corners or narrow necks of the pockets, especially with pockets of complex geometry, the cutting angles are actually lesser or even zero. In such occasions, a higher feed rate than the specified one is feasible. The geometry modeling techniques provide such an instrument to obtain the cutting angles at any location along the tool paths. This data could then be used to determine an increment ratio of the feed rate. As a result, the machining time could be reduced.
PAGE 129
APPENDIX A THE CHARACTERISTIC OF A CUTTING TOOL ACCEL3845/Hf=IMMER4566 Figure A.l The X direction transfer function for a 25mm by 107mm 4flute HSS end mill cutter on WhiteSundstrand machining center 123
PAGE 130
124 0.0 LIN FREQ(HZ) 2048 ACCEL3845/HAMMER4566 Figure A. 2 The Y direction transfer function for a 25mm by 107mm 4flute HSS end mill cutter on WhiteSundstrand machining center Table A. 1 Parameters of a 25mm by 107mm 4flute HSS end mill cutter on WhiteSundstrand machining center Mode Natural Freq (HZ) Stiffness (N/m) Mass (kg) Damping ratio X 1 910 5. 149e6 0.157 0.039 d 2 1093 2 . 160e7 0.38 0.021 r 3 1160 1 . 790e7 0.34 0.031 Y 1 900 4 . 980e6 0.156 0.041 d 2 1061 1 . 240e7 0.279 0.031 r 3 1190 3 . 100e7 0.55 0.023
PAGE 131
125 Table A. 2 Permissible depths of cut for a 25mm by 107mm 4flute HSS end mill cutter on WhiteSundstrand machining center Axial Immersion for Four Cutting Dir. (mm) +X +X+Y +Y X+Y R a d i a 1 I m m e r s i o n U P M i 1 1 i n g 0.2 1.423 1.642 1.511 1.435 0.3 1.317 1.552 1.432 1.326 0.4 1.142 1.383 1.201 1.179 0.5 1.037 0.9886 1.168 1.0395 0.6 0.965 0.8668 0.946 0.931 0.7 0.882 0.747 0.793 0.8505 0.8 0.756 0.693 0.747 0.819 0.9 0.630 0.567 0.567 0.6615 1.0 0.4725 0.504 0.504 0.4725 D 0 w n M 1 1 1 i n g 1.0 0.4725 0.504 0.504 0.4725 0.9 0.630 0.567 0.567 0.6615 0.8 0.756 0.693 0.7875 0.819 0.7 0.882 0.7875 0.882 0.8505 0.6 1.071 1.008 1.0395 0.945 0.5 1.134 1.071 1.071 1.0395 0.4 1.260 1.2915 1.26 1.197 0.3 1.2915 1.575 1.2915 1.3545 0.2 1.512 1.827 1.3545 1.512 * Spindle speed at 2720 rpm, and feed rate at 1360 mm/min.
PAGE 132
BIBLIOGRAPHY 1. Kshonze, S., "Dynamic Pocketing Routines for NC Machining," Master's Thesis, University of Florida, 1989. 2. Tlusty, J., Smith, K. S., and Zamudio, C. A., "New NC Routines for Quality in Milling," Annals of the CIRP, Vol. 39, pp 517521, 1990. 3. Persson, H., "NC Machining of Arbitrarily Shaped Pockets," ComputerAided Design, Vol. 10, No 3, pp 169174, 1978. 4. Suh, Y. S. and Lee, K. , "NC Milling Tool Path Generation for Arbitrary Pockets Defined by Sculptured Surface," ComputerAided Design, Vol. 22, No 5, pp 273284, 1990. 5. Tiller, W. and Hanson E. G. , "Offsets of TwoDimensional Profiles," ComputerAided Design, Vol. 4, No 9, pp 3646, 1984. 6. Pham, B., "Offset Approximation of Uniform BSpline," ComputerAided Design, Vol. 20, No 8, pp 471474, 1988. 7. Hoschek, J., "Offset Curves in the Plane," ComputerAided Design, Vol. 17, No 2, pp 7782, 1985. 8. Coquillart, S., "Computing Offsets of BSpline Curves," ComputerAided Design, Vol. 19, No 6, pp 305309, 1987. 9. Tlusty, J. , "Machine Dynamics," Handbook of High Speed Machining Technology . King, R. I., editor, Chapman and Hall, New York, 1985. 10. Tsai, M. D. , Takata, S., and Inui, M. , "Operation Planning Based on Cutting Process Models," Annals of the CIRP, Vol. 40, pp 9598, 1991. 11. McCracken, D. D. , and Salmon, W. I., A Second Course in Computer Science with MODULA2 . John Wiley, New York, 1987. 126
PAGE 133
127 12. Apostol, T. M. , Calculus II . Blaisdell Pub. Co., Waltham, Mass . , 1967 . 13. CATIA User's Manual . IBM Corp. , Kingston, New York, 1988. 14. Chang, C. H. , and Melkanoff, M. A., NC Machine Programming and Software Design . Prentice Hall, New york, 1989.
PAGE 134
BIOGRAPHICAL SKETCH EHsung Cheng was born in Taipei, Taiwan on January 7, 1959. He earned his Bachelor of Science degree in Mechanical Engineering from National Taiwan University in June 1981. In May 1987, he was granted a Master of Science degree from the University of Florida. In August of 1987 he entered the Ph.D program in the Department of Mechanical Engineering of the University of Florida, and has been conducting research under the direction of Dr. Jiri Tlusty since January of 1988. 128
PAGE 135
I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. A Jir^ Tlusty, Chair Graduate Research Professor of Mechanical Engineering I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. Donald W. Darefng Professor of Mechanical Engineering I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. Senser Yeralan Associate Professor of Industrial and Systems Engineering I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation 3nd is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. Associate Professor of Mechanical Engineering
PAGE 136
I certify that I have read this study and that in my opinion it conforms to acceptable standards of scholarly presentation and is fully adequate, in scope and quality, as a dissertation for the degree of Doctor of Philosophy. ^ ^ 'Kevin Scott Smith Assistant Professor of Mechanical Engineering This dissertation was submitted to the Graduate Faculty of the College of Engineering and to the Graduate School and was accepted as partial fulfillment of the requirements for the degree of Doctor of Philosophy. MAY, 1992 iLJjluJ' g 6. 'MM* Winfred M. Phillips Dean, College of Engineering Madelyn M. Lockhart Dean, Graduate School
xml version 1.0 encoding UTF8
REPORT xmlns http:www.fcla.edudlsmddaitss xmlns:xsi http:www.w3.org2001XMLSchemainstance xsi:schemaLocation http:www.fcla.edudlsmddaitssdaitssReport.xsd
INGEST IEID ERZZFVVT0_MJVQK7 INGEST_TIME 20151215T18:02:24Z PACKAGE AA00037821_00001
AGREEMENT_INFO ACCOUNT UF PROJECT UFDC
FILES

