Monday, November 11, 2013

CNC Router - Typical Machining Workflow

This posts discusses the concepts and setup steps necessary for machining parts on a CNC router.

The process involves generating a 3D model of the piece to make. Then extracting from the 3D model the geometry to drive the machine tool. Then loading that geometry file into Computer Aided Manufacturing (CAM) software.

In our work at Taubman College the modeling is usually done in Rhino. The Rhino file is loaded into the CAM software, Mastercam. From within Mastercam you define the machine to be used. Then you define the stock - which you can think of as the virtual workpiece. This lets you visualize the limits of the material which will be machined away to create the piece. Next you set up the tools - which cutters will actually machine the parts. You set their size and speed of rotation and motion. Next, you set up what are known as toolpaths which define each operation to remove material. You simulate the operations to verify they are cutting the material as expected. Finally you generate the instructions to control the router.

To get into this deeper let's start with some basics terms.


This section lists defines some common terms used in CNC routing. 
  • Machine: Refers to the specific type of equipment that parts will be created on, for example a Onsrud 3-axis router. 
  • Toolpath: Refers to the way the tool is moved along a curve or surface to remove material from a part.
  • Stepover: The distance that separates adjacent cuts in the horizontal (XY) plane on a surface toolpath.
  • Stepdown: The distance that separates adjacent cuts in the vertical (Z) axis on a toolpath. 
  • Stock: The stock defines the extent of the material to be machined.
  • Tool: The cutter which actually machines the part.
  • Holder: Used to support the cutting tool. The holder is mounted directly into the machine.
  • Spindle: The mechanism that rotates the tool (mill toolpaths) or part (lathe toolpaths) during machining.
  • Chain: Selection of one or more curves (lines, arcs, and/or splines) that have adjoining endpoints and often form boundaries; chains may be open or closed.
  • Lead-In / Lead Out: The lead-in to the cut moves the tool into the cutting position to begin the actual toolpath cutting. The lead-out happens when the cut is over. It moves the tool free from the cut and out of the stock. 
  • Linking: Linking parameters are used to define how the tool moves from the end of one cutting pass to the beginning of the next. Use the linking parameters to minimize retract distances and create smooth transitions between cuts, appropriate for high-speed machining.
  • Simulation: Allows you to visualize and verify a toolpath as well as the resulting part. The simulation can run for a single toolpath or the entire machining of the part.
  • G-Code: The name for the most widely used numerical control (NC) programming language. In fundamental terms, G-code is a language which tells machine tools where to move and how fast to go.

To start we'll look at the basic machining operations.

Machining Operations

Moving the tools over the curves and surfaces is what shapes the part. This section lists the most common ways of removing material from a part.


Contour toolpaths remove material along a path defined by a chain of curves. Contour toolpaths only follow a chain; they do not clean out an enclosed area.

In this example a guitar body is cut from a blank of wood. The stock is shown in green.

The cut is made in several depth passes (stepdown). That is the tool goes around the guitar body several times, each one going deeper than the last. Attempting to cut the full depth in one pass would break the tool. Normally, using a depth no deeper than twice the width of the tool is considered safe.

Contour cuts can also follow a 3D toolpath. In the example below a grid is cut into the fixture. 

Here's the Mastercam toolpath for it. They are simple curves projected onto the curved surface. You can see the tool retracts at the ends of each cut and traverses to the next cut. 


A pocket toolpath is used to clean out material from an enclosed boundary.

In this case a pocket for the pickup of a guitar is cut into the stock.

In this case the shallow pocket can be cut at full depth. However the full width of the pocket is cut using a horizontal stepover. Note also the lead-in / lead-out. There's a helix down into the stock to lead-in. At the end of the cut the tool can simply retract vertically.


This one is obvious - use drill toolpaths to drill holes in your parts. Just as when you drill holes by hand you need to clear the chips form the bit occasionally. By hand you pull the bit out, clear the chips, then plunge back in and continue the drilling. In CNC machining this is referred to as Peck Drilling.

Drilled holes are the same size as the drill bit size. To create holes larger than the drilling tool use a Boring toolpath.


Boring is a toolpath used to create or enlarge a hole. Normally this is used for creating holes to precise dimension or when a drill bit is not of the precise diameter required.

This is a helix bore. Note how the lead-in/lead-out are inside the hole. The toolpath is a helix into and out of the hole. This is used to create a hole for a dowel that is slightly larger than the typical 1/4". So a standard 3/4" drill bit would not result in the correct diameter. When boring any diameter can be specified.

Smaller helix bores - same pattern. These are used for slightly larger than 1/4" holes.

The following video shows a guitar being cut (from Fourteen More Guitars). It includes pocketing, drilling, and contouring operations: 

Surface Roughing

Surface roughing toolpaths typically use larger tools, multiple stepovers, and multiple step downs to quickly remove larger volumes of stock and leave an even amount of stock for finishing. The roughing toolpaths you choose for your part depend on the shape of the part, shape of the stock, and machining situation.

In the case below (from Wolff Sleigh Bed) a form is being machined from layers of MDF. You can see that quite a bit of material is removed with each pass, but the stepover is small. A zigzag toolpath is used to clear stock down to a uniform 1/4" of remaining material.

Here's the toolpath shown in Mastercam. 

Zoomed into one corner you can see the distance between passes: 

Surface Finishing

Surface finishing toolpaths typically finish a part down to the final surface (or to the stock to leave amount if one is specified). In the example below the stepover is small (0.07") and the pattern is in the opposite direction to the roughing pass. Only the final 1/4" of material is being removed. 

Here's the form after the finishing pass:

In Mastercam you can see the small stepover - note how close we are zoomed in to see the individual lines: 

Here's a video showing some finishing with a 1" ball tool: 

Swarf Milling

A swarf cut follows two curves or a surface. These are often used on 5-axis routers to cut surfaces at an angle. In the case below a table to is being cut. The edges of the table are sloped. There is also a chamfer along the edge of the table top. 

Here the chamfer is cut: 

Here's the edge cut:

Here's the finished part:

Here's a video showing some swarf milling (from Hexagonal Table): 


Use a facing toolpath to quickly clean the stock from the top of a part, qualify the top of the part, and create an even surface for future operations. You can base the toolpath on either chained geometry or on the current stock model.

When facing the stock, it is important to have the tool overlap the edges of the part by at least 50% of its diameter to prevent leaving little scallops of material at the edges of the stock.

Preparing Rhino Geometry for use in CAM Software

When you model in Rhino you are generating 3D surfaces and solids. What you frequently need for CAM toolpath programming are 2D or 3D curves. Or sub-surfaces of solid models. There are a number of Rhino commands which are very useful in generating or extracting geometry from your models.

Rotate3D: Takes a 3D object and rotates it along an axis. This is useful for laying a part flat onto the construction plane so you can use other commands to extract the geometry. 

DupFaceBorder: This command will make a copy of all the edges of the face of a solid. This is extremely useful in quickly getting the geometry you need. 

DupEdge: This command will make a copy of the selected edge of the geometry. 

Make2D: This command lets you take 3D surfaces and create 2D geometry. Often there are duplicate lines. You can use the command SelDup to select any duplicates and then press the Delete key to remove them. If any odd short segments are generated you can use the SelShortCrv command to select and remove them.

ProjectToCPlane: This command takes geometry and projects it flat onto the current viewport's construction plane. 

Project: This can be used to project objects onto a surface. Unlike ProjectToCPlane this command creates the curves on the surface of another object. 

ExtendSrf: This is used when you have a surface you wish to machine but you want to extend the edges of the that surface so you can machine slightly beyond the border. 

Once you have the geometry created in Rhino you need to import that file into Mastercam. Fourtunately Mastercam can read Rhino .3dm files directly.
From the Mastercam File menu choose Merge/Pattern... and select the 3dm file.

Tools, Feeds and Speeds

The next step involves choosing which tools will be used to cut the part. So you choose the type (straight cutter, ball end, drill bit, facing tool, etc). You then define how fast the tool moves during the cut, into and out of the cut, and between cuts. You also specify the spindle speed - that is how fast the tool spins. The Taubman FabLab has a tool library set up for use. You can pick tools based on the size you need and the material you care cutting. These tools are already set up with the correct feeds and speeds appropriate for their size and the hardness of the material.

Stock Setup 

You need to specify the dimension of the material to be machined. You do that by clicking Stock setup in the tree as shown below:

In the Stock Setup dialog enter the dimensions of the stock and the origin:

Once established you'll see a red dashed line in the viewport which defines the extents of the stock. 

The stock also appears as the solid green block in simulations. If a rectangular boundary does not describe the stock then you can specify an STL file which can be of any shape. Create the stock geometry in Rhino and then export it to STL. 


It's very important to be able to visualize how your part will be cut before you actually machine your valuable material. There are several ways to simulate the effect of the operations on your stock. Controls to do so are at the top of the Operations Manager.

The "Backplot" features ( ) lets you see a wireframe drawing of the selected operations. You may scrub the slider back and forth to see the sequence.
The "Verify Selected Operations" () lets you see a solid model of the selected operations. This model can also be exported to an STL file for checking in another program (like Rhino).

Cut File Creation

You can generate the G-Code for the selected operations using the "Post Selected Operations" () feature. You'll be prompted for a file to save to. This file is the copied onto the router to execute.

No comments:

Post a Comment