1 Lab 8. Introduction to MasterCAM version X mr2 CNC machines use a special programming language called GN-code (technical name: RS274). MasterCAM is a software that allows users to create GN-code programs that can be used to cut different geometric shapes on CNC machines. Here we study MasterCAM for CNC Milling machines. The main functions are: (i) Describe the geometry of the part to be machined. (ii) Create a tool database this DB carries information about the available milling tools. (iii) Create the GN-code program to cut the part. (iv) Simulate the machining of the part (for visual verification of the program). (v) Upload the program to the CNC machine controller. Step 1. Describe the geometry of the part to be machined You can create the geometry in one of two ways: (a) by using the graphical design interface provided by MasterCAM (b) by making the design in a CAD software, e.g. CATIA, Pro/Engineer, SolidWorks, and saving it in a format that MasterCAM can import (safest format to use: IGES; other formats include STL, STEP) Method (a) is useful if you want to cut a simple shape; although MasterCAM provides some functions to generate 3D curved surfaces, defining the geometry in this environment is not convenient. So: if you want to make a part where the entire shape is defined using volumes made by sweeping 2D profiles normal to the plane of the geometry, use method (a). If you have access to any CAD system, use method (b). Method (b) Here, we will assume that we have designed the following part using a CAD system, and saved it as in the IGES format. [0] Design the part (in, e.g. CATIA or SolidWorks). It is best if you already create the part such that the surfaces to machine are in the correct orientation and position for the machine. That is, the machining surfaces should be accessible from Z direction, and the part should be located such that the covering, rectangular stock should be in the positive octant of the coordinate frame, with the corner at the origin.
2 [i] Import the part into MasterCAM File Open in the file browser, set the input file type (in our case, IGES), then use the file browser to locate the file (e.g UST.IGS), and click open [ ]. The part will display in the main window; if you can t see it, fit it into the screen by clicking the Screen fit [ ] icon. To rotate the part: Press and drag Middle Mouse Button (the scroll wheel) To zoom in or zoom out: View Zoom In/Out Left-Mouse press and drag up/down To zoom in or out (alternative method): Middle mouse button scroll [ii] ONLY IF Step 0 did not locate the part properly:
3 Our example part (UST.IGS) is already located in the proper location to plan the machining of the part: namely, the bottom surface of our part is lying on the XY-plane, while the top surface (where the tool will approach on the vertical milling machine) is facing upwards along the +Z axis. To check if the part is in correct location Analyze Analyze position (in main window) click at the left bottom corner point of the part The location should be [0, 0, 0]. If you think the orientation or location of the part has to be changed, use the following: To move the part: Xform Xform translate use the mouse to drag a rectangle around the entire part in main window; the selected part is displayed in different color click on Green circle icon [ ] the Translate dialog box pops up, (i) select Move enter displacement distances as Delta X, Y, and Z values. To rotate the part: The part is rotated with respect to a plane; for example, if your Construction plane is set as XY plane, the part will be rotated about the Z-axis. You can specify the point on XY-plane around which the part must be rotated, and the angle by which to rotate. Xform Xform rotate use the mouse to drag a rectangle around the entire part in main window; the selected part is displayed in different color click on Green circle icon [ ] the Rotate dialog box pops up, (i) select Move enter the rotation angle (after selecting the rotation point if required, default is [0, 0]). Step 2. Begin the CNC path planning [i] Select the machine type We use a vertical milling machine; select the following machine type: Mill 3-axis VMC-MM-MMD Machine type Mill select the machine type (as indicated above)
4 In the left side frame of the main window, a Machining group is created. Expand [+] the Properties item, where the details of the stock and tool are stored. Step 3. Working with the Tool Database The tool database describes the geometry of tools available for use in the workshop. The path that a tool travels in order to cut a shape depends on the size of the tool; some other information about the tool is also important for example, the length of the cutting teeth on a drill or an end mill constraints the depth of the hole these can cut. MasterCAM has a preset database of commonly used cutting tools; you can also define your own tools and ad to the database. For now, we shall only use an existing tool. [i] Look for an existing tool that you may want to use Toolpaths Tool Manager in the Tool manager dialog box, all available tools are displayed. You can search for a particular type by scrolling down the list, or by using the Filter button and entering the search criterion. Select a Flat end mill, with Diameter = 5mm (or less) since our example part has some regions where larger tools cannot enter click on the selected tool click on the Up arrow to add this tool to the Machining Group for your part Green arrow (OK).
5 [ii] If you cannot find the tool you will use for machining (i.e. the tool is in your machine shop, but not in the Database) then you can add the tool to the Database by Right click on the Tool Manager Add new tool, followed by adding the details of the tool. Step 4. Creating GN code (machining plan) for the part There are many options in MasterCAM to generate different types of tool paths for different cutting requirements. Here, we will not go into the details. However, note that the two most common methods for cutting pockets is by making the tool move in a Zigzag pattern, or an offset-contour pattern. [Hint: for this part, it will be easier to display the part in Shaded view click on the icon [ ]
6 [i] Create the tool path Toolpaths Surface Rough Rough Pocket Toolpath In the NC file name dialog box, enter filename (use UST), and click Green OK button now you need to select the tool drive surfaces; there are two ways to do so: manual or automatic: Manual method: repeatedly click on the side wall faces of each pocket that you wish to machine on the part. Each selection changes the color of the face (yellow in the figure below). Make sure that all the side-wall faces of a pocket have been selected, to form a closed loop click Green OK button. Automatic method: click on the top face of the part, and on the bottom face of the pocket (it is sufficient to select any one face at the bottom in our example) click Green OK button. [Drive surface is the surface that defines the boundary of the pocket that we wish to machine]. In the figure above, some of the drive faces have been selected; you can rotate the part to keep selecting
7 The Toolpath/surface selection dialog box will pop up Click the Green OK button The Surface Rough Pocket dialog box will pop up now you need to define the cutting conditions: Notice that this dialog box has four tabs on the top (a) In the Toolpath parameters tab: make sure that the 5mm flat end mill tool is selected; set the federate at the desired value (use default for now), and spindle speed = 2000 rpm. To change the feed and cutting parameters (not required for this lab) Right-click above Feed rate Feed speed calculator (this can be used to modify the calculations of feed rate and speed for different combination of tools and part materials. (b) In the Surface Parameters tab set the retract level to 5mm (this forces the curter to not drag on the surface that is already machined). (c) In the Rough Parameters tab set the maximum stepdown to 1 mm
8 [Stepdown sets the depth that the tool will cut in each layer; when cutting brittle plastic, e.g. acrylic, large value of stepdown, e.g. 2mm, causes the plastic to crack and poor surface finish] (d) In the Pocket parameters tab select the Zigzag pattern for rough cutting set the step-over distance = 50% (or 75%) of tool diameter set Finish to ON [Stepover: in zigzag, the stepover = 50% means each zig-zag line is separated by 50% of tool diameter; for contour-offset, stepover = 50% means offset contours are separated by 50% of diameter]. [Finish = ON asks the software to create a finish cutting pass; after most of the pocket is cleared, the tool will be moved smoothly along the drive surface, cutting very small thickness, to make a smooth surface] Keep all other settings at default values for now. Click the Green OK button. The toolpath is generated and displayed (see figure below) Step 5. Verify the cutting process You can see a 3D animation of the cutting process by using the Verify selected operations icon [ ] on the Toolpaths tab on the left frame the Verify dialog box pops up click on the Machine button [ ].
9 Step 6. Save the GN-code file The tool path generated by MasterCAM has all information required to control a CNC machine tool to cut the part. However, different CNC machines use slightly different versions of GN-code. The conversion of the machining data to the GN-code specific for a particular CNC machine is called Post-Processing. The exact format of the GN-code is stored in different post-processing files, and the system will use whichever post-processing format you select. From the left panel, in the Toolpaths tab select the G1 icon (post selected operations) the Post processing dialog box pops up select the option for NC file set the Edit = ON click the green OK button. Once the GN code is generated, the editor will allow you to see the GN code file, and modify if required. Note: our lab CNC machine does not recognize G21 code, so please delete the first line in the file (highlighted in figure below).
10 Step 7. Upload the program to the CNC machine controller You can directly upload your program to a CNC machine whose controller has internet access. In our case, we will save the file and manually upload to the PC that is connected to our machine later.