1、Cutter Path Simulation and Product Visualization Using AutoCAD SAMUEL H. HUANG, KAPIL R. BHURA, GE WANG Intelligent CAM Systems Laboratory, Department of Mechanical, Industrial accepted 24 April 2000 ABSTRACT: In this paper, a software tool for NC (numerical control) cutter path simulation and produ
2、ct visualization, 3D-Sim, is presented. 3D-Sim utilizes a commercial computer-aided design (CAD) software tool, AutoCAD, to perform virtual NC verication. An NC program is interpreted and transformed into an AutoLISP program, which once loaded in AutoCAD allows the user to visualize the virtual mach
3、ining operations and obtain a 3D solid model of the nal part. Incorporating NC verication capability into CAD software tools not only reduces software cost but also shortens user training time. The resulting 3D solid model allows the user to visualize the nal product as well as perform more detailed
4、 analysis such as measuring the dimensions. 3D-Sim has been used in the senior/graduate level computer-aided manufacturing (CAM) course and was well-received by the student. This work is part of a long- term research effort to establish an integrated manufacturing environment where students can rece
5、ive rigorous training and gain hands-on experience in collaborative manufacturing through the use of integrated computerized systems. 2000 John Wiley numerical control cutter path; simulation; product visualization; solid model INTRODUCTION Technical Background Nowadays, NC machines are commonly use
6、d in modern manufacturing environment to produce parts. However, programs used by NC machines are not error free, and have to be veried before they can be condently released to production. The possibility of errors in an NC program increases with the complex- ity of the part to be machined. Manually
7、 written programs tend to have more errors than those generated by software tools. These errors can be extremely costly since they often result in crashed machines, ruined parts, damaged xtures, broken tools, and inaccurate part geometry. Because of the possibility of error, regardless of whether th
8、e NC codes are produced with a CAD/CAM system, at the machine, or somewhere in between, the resulting program has to be veried before it can be condently released to production 1. Before the 1990s, US manufactures spent more than $ 2 billion a year on Correspondence to S. H. Huang (shuangeng.utoledo
9、. edu). 2000 John Wiley & Sons, Inc. 113machining polyurethane or aluminum prototypes to test NC programs 2. Recently, the technology for NC verication has evolved from physical verication to virtual verica- tion. Virtual NC verication technology allows the programmer to watch a high-quality display
10、 of a cutter moving through its specied path on the computer screen. As the cutter moves, it removes material from the stock model and the designed part emerges, as it would on a machine. Virtual NC verication technol- ogy reduces the time and cost involved in conven- tional NC verication methods 3.
11、 Current research trends in NC verication technology focus on determining the machinability of parts 47 and efciently developing 3D images of the machined parts 8,9. Research from the past two decades has inuenced the development of commercially available NC verication software tools, such as VERICU
12、T, Super VERIFY, NCSentry, dCADE, FASTPlot, etc. These software tools play very important roles in manufacturing processes planning. Traditionally man- ual prove-outs of NC-code programs could now be completely eliminated. As a result, money savings in proong time, proong materials, scheduling time,
13、 and machine time are considerable. In spite of their advantages, however, most of the commercial NC verication software tools in the market still need improvement, especially in the following three areas. First, the development of a 3D solid model of the nal part should be incorporated into the sof
14、tware tools. Second, the capability of showing machining simulation for parts with multiple setups should also be included to more realistically reect the actual machining operations. Third, the integration of NC verication with the existing and widely used CAD software tools should be considered to
15、 reduce the software costs and the costs to train users to check parts geometrically and dimensionally. Educational Background The work presented in this paper is inspired by the NC verication technology development, and, more importantly, motivated by the national concern of improving college educa
16、tion in science, mathematics, engineering, and technology (SME&T). According to the Advisory Committee to the National Science Foundation (under the auspices of the Education and Human Resources Directorate), although the United States basic research in SME&T is world-class, its education is not 10.
17、 Harvard Universitys Professor Emeritus (Physics) Gerald Holton pointed out that although SME&T education in the United States is still producing some highly qualied graduates, the majority of the students are left homeless in the universe. 11. This is because the majority of students regard SME&T b
18、ased courses as highly abstract and thus are unable to develop interest in these courses. There are several surveys based on student-focus groups that emphasize a common complaint that the lack of hands-on exercise is one of the primary factors leading them to dislike SME&T based courses. Underlinin
19、g the importance of hands-on practice in the framework of learning, the Wingspread Group on Higher Education stated that classroom learning must be accompanied by knowledge derived from rst- hand experience. 12. Seymour and Hewitt 13 also noted that too much dull lecturing and inadequate laboratory
20、facilities are the major reasons for under- qualied and under-employed graduates. The impor- tance of hands-on experience in the manufacturing education is highlighted by SME in 1997 14. Based on the investigation of 1997, the Industry Updates Competency Gaps Among Newly Hired Engineering Graduates
21、for 1999 was presented by SME and SME Education Foundation 15. Hands-on, practical, real- world application of theoretical knowledge was specially pointed out to top the least prepared top-of-mind list. New graduating manufacturing engineers should process a good understanding of (a) the importance
22、and nature of manufacturing, (b) its translation into practice and (c) how to solve the manufacturing process problems they are certain to encounter. With respect to NC programming and machining in manufacturing education, the best way for students to gain hands-on experience is to let them work wit
23、h NC machines. Hence, NC verication becomes an impor- tant issue. Since students are generally well-versed in Windows-based CAD software tools such as Auto- CAD, a cost-effective way for NC verication would be to allow them to realize NC cutter path simulation in such a CAD software tool and be able
24、 to visualize the nal product. A software tool, 3D-Sim, has been developed to achieve this objective. 3D-SIM NC VERIFICATION SOFTWARE TOOL Through a graphical user interface, 3D-Sim decodes an NC program and the user input for stock and tool setup into an AutoLISP program le, which produces machinin
25、g simulation and generates the machined part in solid geometry once executed in AutoCAD. After the 3D solid model of the part is generated, AutoCAD environment allows the user to manipulate 114 HUANG, BHURA, AND WANGthe part, to verify the part dimensionally, to view the part from all sides, and to
26、verify and analyze the cutting tool paths. 3D-Sim detects the errors in the NC program and noties the user via an error detection le. It also has a unique feature that enables the user to visualize the machining simulation and generation of the nal 3D solid model for parts with multiple setups. It c
27、an deal with most of the commonly used NC codes. Functional Specication and System Architecture The system architecture of 3D-Sim is shown in Figure 1. Its functions are specied as follows: * Accept stock and tool setup information from the user. * Interpret NC codes in the NC program le. * Detect t
28、he NC programming errors and print it in the error detection le, which contains informa- tion about the NC program including syntax error and unrecognized codes. * Translate the NC program le, and the stock and tool setup information into an AutoLISP program. * Realize virtual machining simulation a
29、nd gen- eration of 3D product model of the nal part by interpreting the AutoLISP program le in the AutoCAD environment. Software Development The initial lines of codes in the AutoLISP program le are utilized to dene the simulation environment. 3D-Sim uses the erase and the vports commands to activat
30、e a single window in the drawing le for cutter path simulation, and enables the user to run the AutoLISP program in the same drawing le for more than one time. 3D-Sim uses four view-ports to visualize the cutter path simulation. It designates different viewing directions for each view-port. Five dif
31、ferent color layers are created for use during machining simulation. These layers represent (a) the nal 3D solid model, (b) the cutting tool(s) used, (c) the materials removed, (d) the rapid motions, and (e) the feed motions, respectively. Once view-ports and layers are set, the user is asked to ent
32、er the desired speed of the cutter path simulation to visualize the machining operation in the AutoCAD environment. The NC program to be veried is then interpreted line by line, meanwhile an AutoLISP program le and an error detection le are generated, respectively. When reading cutter compensation c
33、odes, 3D-Sim will read two lines of NC codes before translating the NC program into the Figure 1 System architecture of 3D-Sim. PRODUCT VISUALIZATION BY CUTTER PATH SIMULATION 115AutoLISP program. This is consistent with an actual NC machines read ahead behavior when encoun- tering cutter compensati
34、on codes. 3D-Sim has been developed to verify NC programs to be executed by machines using Bandit 4 controllers. To keep the paper concise, the following discussion omits detailed mathematical developments. Readers who are interested in the equations used to nd cutting tools sweep area (including in
35、 cutter compensation mode) should refer to 16. Linear Motion. The NC commands for linear motion are G00 (rapid motion) and G01 (feed motion). Material is removed in the feed motion mode but not in the rapid motion mode. The user can check both rapid motions and feed motions during and after cutting
36、simulation in the AutoCAD environment. A cutting operation (feed motion) is simulated by creating a 3D block for the volume covered by the cutting tool for that particular move and then subtracting the 3D block from the stock. Specically, when 3D-Sim comes across a block of NC code for feed motion,
37、it calculates the extreme points covered by the cutting tool. With the help of these calculated coordinates and the to coordinates of the cutting tool motion, 3D-Sim draws a set of lines and a circle to enclose the tool extreme area (Figure 2). The circle is drawn by using the circle command, with t
38、he to point of the cutting tool path as its center point and the tool radius as its radius. The region command is then used to create a region object by uniting the lines enclosing the tool extreme area. Next, 3D-Sim extrudes the objects that represent the tool extreme area with the help of the extr
39、ude command. The extrude command creates unique solid primitives by extruding existing two-dimen- sional objects. These extruded objects will have a height equal to the previous z-distance covered by the cutting tool. The objects then form two 3D blocks enclosing the volume covered by the cutting to
40、ol. 3D- Sim now joins the extruded 3D blocks together with the help of the union command, which creates a composite region or solid by addition as shown in Figure 3. This 3D-block is removed from the stock by using the subtract command. The previous treatment is for a at end mill. When the cutting t
41、ool is a ball end mill, the treatment is different. After the cutting tool path is drawn, the active plane is changed with the help of the ucs (user coordinate system) command to draw a circle perpendicular to the cutting plane. The circle is then extruded in the direction of the cutting tool path.
42、In the meantime, a sphere is created with the to coordinates of the cutting tool path as its center and the tool radius as its radius. The extruded block and the sphere are then joined together as shown in Figure 4. Then, the 3D block representing the tool swept volume is subtracted from the stock.
43、Circular Motion. The NC commands for circular motion are G02 (clockwise motion) and G03 (counter- clockwise motion). When a circular motion occurs, Figure 2 Enveloping cutting tool sweep area. Figure 3 3D solid representing material to be removed by a linear feed motion with a at end mill. Figure 4
44、3D solid representing material to be removed by a linear feed motion with a ball end mill. 116 HUANG, BHURA, AND WANGonly the feed motion mode is active, and thus, material will be removed. 3D-Sim checks the x, y, and z coordinates to nd the start and the end points of the arc and the i and j coordi
45、nates to nd the center point of the arc. The command used to show the cutting tool path in case of circular motion is arc, which draws an arc by specifying three points. The coordinates of the extreme points are calcu- lated to form the 3D block representing the tool swept volume. With the help of t
46、he calculated coordinates, 3D-Sim draws the lines and also draws a circle with the to point of the circular motion as the center point and the radius of the cutting tool as the radius. It forms a composite region of the lines drawn. 3D-Sim then extrudes both the composite region and the circle with
47、the height equals to previous z-distance covered by the cutting tool. The 3D solid blocks are jointed to form a single 3D block representing the volume covered by that cutting tool motion. Then, the 3D block is subtracted from the stock. In special situations, when NC codes are pro- grammed for mach
48、ining a circular part (tool path is a circle, i.e., the from and the to point of the circular move are the same), 3D-Sim uses a circle command instead of an arc command to form the cutting tool path, since it is not possible to draw a circle with an arc command in AutoCAD. It draws two circles outsi
49、de and inside the cutting tool path circle by a distance equal to the radius of the tool. Then, it extrudes both circles to form two cylinders, and subtracts the smaller cylinder from the larger one to form a 3D block, which envelopes the volume swept by the cutting tool. This 3D block is then subtracted from the stock. Cutter Compensation. Cutter compensation is the most complicated command incorpo