Beginner’s Guide to CNC Routers

Beginner’s Guide to CNC Routers

By Roger Secura    View In Digital Edition  


DISCLAIMER: The author and publisher of this article are not to be held libel for any physical injuries or property damage stemming from the information in this article. CNC machines, like all power tools, can be extremely dangerous — especially in the hands of someone who is inexperienced with the setup and operation of a CNC router. It’s the responsibility of the CNC machine operator to know his/her machine and practice all safety procedures.

After moving into a larger house and basement, I finally decided to design and build a desktop CNC router. I spent a lot of time researching CNC routers online. As everyone knows, working online late at night can suck the life out of a human faster than a vampire. Nevertheless, I survived and finally finished building my desktop CNC router.

If you’ve been mulling over the idea of building a CNC router, I should warn you the learning curve is quite steep. This article is my attempt to flatten out a very small part of that learning curve by describing the basic hardware and software requirements for building a CNC router. Later in this article, I will try to demystify some of the concepts, terms, and operating procedures associated with CNC routers.

Although I’ll be referring to the Mach 3 CNC program throughout this article, the concepts and procedures presented here are general enough to be applicable to some of the more popular CNC programs.

What is a CNC Machine?

A quote I saw on the Internet states, “CNC machining is a process used in the manufacturing sector that involves the use of computers to control machine tools. Tools that can be controlled in this manner include lathes, mills, routers, and grinders. The CNC in CNC Machining stands for Computer Numerical Control.” Other machine tools that fall under the CNC category are plasma/laser/water cutters, 3D printers, welders, pick and place machines, etc.

In the Beginning, There Were Hand and Power Tools

What makes a CNC router so different from other tools? First, it can perform many of the same jobs that hand and power tools do — routing, drilling, sawing, planing, boring, tapping, engraving, etc.

Secondly, CNC routers are well known for their accuracy and repeatability. The accuracy of a CNC router can fall within a few ‘thousandths’ of an inch. The repeatability factor allows you to make 100 pieces of the same part and have each one come out an exact copy of the first one.

Imagine how tiring, tedious, and time-consuming that would be using simple hand and/or power tools.

Where Do I Begin?

On the software side, you’ll need three programs: CAD (Computer Aided Design), CAM (Computer Aided Manufacturing), and CNC. Refer to Figure 1a.

Figure 1.


The process of designing a part for your CNC router begins with a CAD program. Whether it’s a few wooden gears needed to build a mechanical wall clock, robot, or an anemometer, a CAD program can help you create just about any size gear pattern.

Once the gear drawing is finished, you “Export” or save the 2D drawing as a “.dxf” file (ASCII text file, NOT a binary file). Other file extensions can be used, but .dxf has become more of a standard file format for exchanging 2D drawing files between CAD and CAM software.

The next step is to open the CAM program and import the .dxf file. The CAM software will take the file (gear pattern) and create what is known in the CNC machining industry as a “toolpath.” A toolpath is just a series of X, Y, and Z movements the router’s cutting tool must follow to make a part.

The next operation for the CAM software to perform is to generate a “G-code” program file based on the toolpath of the gear pattern. A G-code program is a list of the X, Y, and Z toolpath coordinates the CNC software (Mach 3) uses to cut out a part. G-code programs are saved as an “.nc” or “.tap” file, and can be opened and edited in Notepad.

Unfortunately, not all CNC machines (routers) can use the generic G-code instructions put out by the CAM software. So, before any final G-code files are created, you need a “post-processor” program to optimize (configure) and then generate a G-code program specific for your CNC machine. Most CAM software packages include a post-processor.

Tip #1: It’s important that you stick to one unit of measurement (mm or inches) throughout the whole CAD/CAM/CNC process.

The last piece of software you’ll need to acquire and learn is a CNC program. The CNC software (Mach 3, for example) takes the G-code program (.nc or .tap file) from the CAM software and converts the code into motor control instructions. These instructions are transferred to a “controller board” via a USB or ETHERNET cable (see Figure 1b).

The controller board, in turn, sends individual instructions to each one of the three motor “driver” circuits. The driver circuits control the motion of the X, Y, and Z stepper motors mounted on the CNC router (see Figure 1c).

So, on the hardware side, you’ll need a laptop or desktop computer (Windows PC); a controller board with motor driver circuity on board or three individual driver boards; three stepper motors; and one 12 or 24 volt power supply for the controller board and motors.

If you’re planning on using a laptop to control your CNC router, a USB or Ethernet compatible controller board will be required.

Tip #2: Laptop computer users should turn off all automatic updates, antivirus programs, screensavers, power management settings, and any other “background” programs which can cause an interruption of the router during its operation. If possible, use that old Win 7 laptop you have sitting in the closet as the dedicated CNC computer.

In the next section of this article, I will try to clear up some of the confusing terminology surrounding CNC routers and, if possible, save you from the Internet vampire. It’s going to get a little bumpy, so put on your seatbelt.

Down the Rabbit Hole

Okay, you’ve got an idea of what parts are required to build a CNC router. Now, let’s move on to some of the more challenging stuff. This includes some of the terms you’ll need to know like: “Part Zero,” “Program Zero,” “Work Offset,” “Machine Zero,” “Hardware Limit Switches,” “Software Limit Switches,” and “Homing Switches.” As you will learn, all these things work together in the setup and safe operation of your CNC router.

Take a Look

What I’d like you to do now is look at Figure 2 for a minute to get yourself acquainted with the layout of a typical homebuilt CNC router.

Figure 2.


What you are looking at in Figure 2 is a top (aerial) view of the router. In other words, you’re looking down at the CNC router table from the Z axis.

Part Zero and Program Zero

Normally, when designing a part (a wooden gear, for example) in a CAD program, the designer will designate a point on the drawing where the X, Y, and Z coordinates are set to 0, 0, and 0. This reference point is commonly referred to as Part Zero. In other words, all features on the part drawing are referenced (i.e., measured) from a single point: Part Zero (X = 0, Y = 0, Z = 0).

The Part Zero location is not only important to the CAD drawing as the part’s origin, but it’s a key piece of information for both the CAM and CNC software.

The CAM software needs the Part Zero reference point to generate a toolpath program (G-code) for the gear pattern. The CAM software gives you the option of using the Part Zero coordinates to create a toolpath program, or you can specify a new origin point. Either way, once the toolpath program is generated, the origin of the part is generally referred to as Program Zero.

The CNC software (Mach 3), on the other hand, needs the Program Zero coordinates to position the gear pattern onto the workpiece. In other words, the Program Zero point can be positioned at the center or one of the four corners of the workpiece.

Regardless of where Program Zero is stationed, its main function is to “tell” the CNC software where on the workpiece (wood, for example) the cutting process should start.

Work Offset and Machine Zero

To position your workpiece (wood) at a specific location on the router table, you have to set up something called a Work Offset. A Work Offset can be any random location on the router table where you’ve clamped down a sacrificial piece of wood. Normally, the lower left-hand corner of the workpiece is designated the Work Offset location (refer again to Figure 2).

In turn, the CNC software will use this Work Offset location (corner) as the part’s Program Zero origin point (X = 0, Y = 0, Z = 0). This is the location where it will execute the gear program (G-code) and begin the process of cutting out the gear pattern.

There’s just one problem. Since you have the option of placing the workpiece anywhere on the router table, how will the CNC program (Mach 3) “know” what location you chose? The answer is rather simple. All CNC machines have a Machine Zero point (a.k.a., “Home” position) on the table from which all other X, Y, and Z coordinates are referenced — including Work Offsets.

Unlike huge and expensive industrial CNC milling machines that have a permanent Machine Zero location constructed into the machine, homebuilt CNC routers and kits usually have a user defined Machine Zero point somewhere on the router table.

Look at Figure 2 one more time and you’ll notice the Work Offset location (X = 4.00”, Y = 3.00”, Z = -0.75”) is referenced (measured) from the Machine Zero coordinates.

Now, don’t confuse Machine Zero with Part/Program Zero. Machine Zero (Home) is a permanent reference point on the router table. Part Zero, on the other hand, is the part origin as specified on the gear drawing by the CAD designer. Program Zero is the toolpath origin as designated by the CAM software or a G-code programmer.

Look at Figure 3 to see how the CAD and CAM zero origins line up with the lower left-hand corner of the workpiece.

Figure 3.


Also notice in Figure 3 how the Work Offset (X, Y) — which is measured from Machine Zero — determines where on the router table the lower left-hand corner of the workpiece is positioned.

Setting Up Your “Home”

Since every X, Y, and Z position on a CNC router table is reference from Machine Zero, it’s always a good idea to set up a Machine Zero location on your table before doing anything else.

All you need to do is pick a point on the router table where you want Machine Zero to be located. As mentioned, this point is stationed in the lower left-hand corner of your table some distance away from your workpiece. It’s perfectly acceptable to choose a different location on the router table, but it will be more confusing to the beginner at this point in the learning curve.

Next, using the keyboard arrow and page up/page down keys, slowly “jog” the X and Y axes so the center of your cutting tool is directly over the location you’ve chosen for Machine Zero. Now, jog the Z axis upwards to a point you’d like to call Machine Zero for the Z axis.

Once the center of the cutting tool and the X, Y, and Z axes have reached their Machine Zero destinations, watch the main screen in Mach 3 and you’ll see some numbers on the Digital Read-Out (DRO) display. Verify that the Machine Coordinates button is turned on (lit red).

At this point, you “zero-out” (clear) the X, Y, and Z coordinates by hitting the “Ref All Home” button on the DRO display so it reads 0, 0, and 0. In turn, Mach 3 will recognize and remember the X, Y, and Z locations you’ve chosen on the router table as Machine Zero.

Now, when you run the gear pattern program (G-code) and it calls out a “G28” command (go to the Home position), all three axes will automatically move to your new Machine Zero coordinates (X = 0, Y = 0, Z = 0).

You can also enter the G-code command G28 into the Manual Data Input (MDI) screen in Mach 3 and it will automatically send all three axes to the Machine Zero position on your table.

I’m a Little “Offset”

You can set up a Work Offset in Mach 3 by clamping down a piece of wood at a random location on your CNC router table. Then, using the Machine Zero position as a starting point, jog the center of the cutting tool to the lower left-hand corner of the workpiece.

Starting at the top of the Z axis (Machine Zero), SLOWLY move the Z axis downward so that the center of the cutting tool barely touches the top surface (corner) of the workpiece.

Again, looking at the DRO display on the main screen in your software, mark down on a piece of paper the X, Y, and Z coordinates for future reference.

At this point, you zero-out (clear) the X, Y, and Z coordinate buttons (not the Ref All Home button) next to each DRO so it reads X = 0, Y = 0, Z = 0. This tells the CNC program where the first Work Offset (i.e., “G54”) is located on the table in reference to Machine Zero.

Now when the G-code program (gear pattern) is run, Mach 3 will look up the first Work Offset location (G54) and — starting at Machine Zero — move the cutting tool to the first Work Offset coordinates (Program Zero location). This is where Mach 3 will run the G-code program and begin cutting out the gear pattern.

Remember, as long as your CAD software specifies Part Zero on the drawing and your CAM software or G-code programmer designates a Program Zero origin, you can place the workpiece (wood, for example) anywhere on the CNC router table just by setting up a Work Offset in your CNC software.

In Mach 3 and most CNC programs, the first six Work Offsets are G54-G59. That means you can set up six pieces of wood anywhere on the table and Mach 3 will know where each one is located.

For example, let’s say you wanted to make six different sized wooden gears. First, you’d clamp down six different sized pieces of wood at six random locations on the router table (see Figure 4).

Figure 4.


For Mach 3 to find each piece of wood on the table, you would set up six Work Offset locations.

First, starting from Machine Zero, you would manually jog (keyboard) the X, Y, and Z axes to the lower left-hand corner of the first piece of wood. Next, you would clear (zero out) the X, Y, and Z DRO display by hitting the X, Y, and Z buttons. This sets up the first Work Offset G54.

Finally, you would return all three axes to the Machine Zero point on the table, click the next Work Offset button (G55, on the Offsets screen in Mach 3), and then repeat the above process for the other Work Offsets (G56-G59).

After you’re done, the six Work Offset settings might look like the following — depending on the size of your table.

G54: X = 4 Y = 3 Z = -0.75
G55: X = 4 Y = 6 Z = -0.75
G56: X = 4 Y = 10 Z = -0.75
G57: X = 10 Y = 3 Z = -0.75
G58: X = 10 Y = 6 Z = -0.75
G59: X = 10 Y = 10 Z = -0.75

We’re assuming in this example that the workpiece size varies (length/width), but the thickness of each piece of wood is the same (also see Figure 4a).

Figure 4a.


To test that all six Work Offsets are functioning correctly, go to the main screen in Mach 3. Now, assuming your CNC machine is starting at Machine Zero (X = 0, Y = 0, Z = 0), the router table is clear of any workpiece or clamps, and you have selected the G54 Work Offset button in the Offsets screen, hit the ‘Go to Zero’ button.

[Author’s note: The label on this button is misleading. It should be labeled Go to W.O. (Work Offset). Users will incorrectly think they are going to Machine Zero when the button is really sending you to a Work Offset location.]

This will send your X, Y, and Z axes to the G54 Work Offset coordinates (X = 4.00”, Y = 3.00”, Z = -0.75”). Now, select the next Work Offset (G55) and hit the Go to Zero button. This time, your router will move from the G54 coordinates to the G55 coordinates.

You can return to the Home position (Machine Zero) at any time by returning to the MDI screen and entering the G28 command into the text box and hitting the enter key.

Remember, the Work Offset coordinates shown in Figure 4a are the X, Y, and Z locations of the lower left-hand corner of each piece of wood. Also, don’t forget that Work Offsets are always referenced (measured) from Machine Zero (Home position).

So, when you move the Z axis (i.e., cutting tool) downward towards the top surface of the workpiece, it should start its descent from the Machine Zero position (top of the Z axis: Z = 0). The DRO in Mach 3 should display negative numbers as you lower the Z axis towards the lower left-hand corner of the workpiece. The Z = -0.75” in Figure 4a is the distance the bottom edge of the cutting tool would have to travel downwards to reach the top surface (corner) of the workpiece.

WARNING! Failure to allow for workpiece thickness or the length of the cutting tool could damage your router or worse: cause you physical injury.

If you change the thickness of the workpiece(s), and/or change the cutting tool, you MUST redo the Work Offset setup procedure for the Z axis.

That means you send the Z axis back to its Machine Zero location at the top of the Z axis. Slowly move (jog) the bottom edge of the cutting tool downward towards the top surface (corner) of the new workpiece. Make a note of the negative Z value displayed on the DRO.

Finally, you zero-out (i.e., clear: Z = 0) the Z axis on the main screen in Mach 3. Now, if you go to the Work Offset screen, you’ll see the new negative Z value for Work Offset G54. Just make sure to copy the new G54 Work Offset number (Z = -0.75”, for example) to Work Offsets G55, G56, G57, G58, and G59 — assuming all boards are the same thickness.

Limit Switches

One of main reasons you need limit switches is to protect your machine from physical damage. Whether it’s you or a G-code program moving the X, Y, and Z axes across a CNC table, crashing into the machine’s framework is easily done unless you set up some travel boundaries.

There are three types of switches you can set up on a CNC router: hardware limit switches; software limit switches; and homing switches.

Hardware Limit Switches

As mentioned, the purpose of hardware limit switches is to stop the X, Y, and Z axes from accidently crashing into the router’s framework. Hardware limit switches used on CNC routers are just simple single-pole-double-throw (SPDT) normally open (N.O.) / normally closed (N.C.) snap action switches (see Figure 5).

Figure 5.


The minimum number for a CNC router is six switches. Normally, you would put all six switches in series and configure each one as normally closed. Two switches go on the Y axis, a short distanced from the opposite edges of the table (refer back to Figure 2). Two more switches are mounted at both ends of the X axis. The last two switches are attached to the top and bottom of the Z axis framework.

Once installed, the limit switches can stop the router from moving anytime any one of the X, Y, or Z axes travels beyond a set boundary. In other words, the hardware limit switches set those boundaries.

Software Limit Switches

As a second “wall-of-defense” to the hardware limit switches, we employ a different set of switches: software limit switches. They do exactly what hardware limit switches do, except they are set up inside a CNC program (Mach 3).

Notice back in Figure 2 that the Soft Limit line (dotted line boundary) is positioned in front of all the SPDT hardware limit switches. If any one of the three axes crosses a Soft Limit boundary line, it will trip a “switch” in Mach 3, forcing it to stop the router in its tracks. This setup helps to protect your router from damage should you or a G-code program accidently move any one of the three axes too close to the hardware limit switches.

In other words, soft limit switches act like a buffer to the hardware versions. The soft switches also “tell” Mach 3 what you think should be the safe limits of your router table (typically within an inch or so from the edges of the table).

You can set up the Software Limits in Mach 3 by entering the minimum and maximum travel limits for each one of the X, Y, Z axes. Mach 3 will treat the ‘min’ and ‘max’ Software Limits for each axis as just another set of SPDT N.O. hardware limit switches.

It’s important to remember that Software Limits are always referenced (i.e., measured) from Machine Zero (Home position). That means the min and max numbers can have a positive or negative value depending on where the Software Limits are in relationship to the Machine Zero position.

Tip #3: Always verify that the Soft Limits button in Mach 3 is turned on (lit green) before you start any cutting operation. Put this on your “Pre-Flight” checklist. This will help protect you and your CNC router.

Homing Switches

Finally, we come to Homing Switches. These too are SPDT mechanical switches. They are mounted onto the router’s frame not to set a boundary for any X, Y, and Z axis movement, but to consistently and accurately find one particular location on the table: Machine Zero (i.e., Home position).

Some CNC operators prefer a more consistent and accurate way of finding Machine Zero. They set up their homing switches on the CNC router by picking a spot somewhere on the router table and designating it Machine Zero (Figure 2). Next, they jog all three of the router’s axes to the chosen location. This is where they mount three SPDT switches (X, Y, and Z) onto the router’s framework.

It should be noted here that homing switches are not a mandatory requirement in order to operate a CNC router. However, since all X, Y, and Z coordinates are referenced from Machine Zero, it might be important to you to have a more permanent Machine Zero location on your table.

Danger, Will Robinson!

I feel obligated to warn all the beginners out there who plan to build or purchase a CNC router. It is imperative that you DO NOT insert any cutting tool (bit) into your new CNC router UNTIL you are completely satisfied you understand how to set up and operate your machine. Your inexperience with CNC routers can damage your machine and/or cause you physical harm.

Here are three steps I suggest you follow for your own safety:

  • To be safe, take a toothpick and use it as a substitute for a cutting tool. Just twist the toothpick into one end of a new pencil eraser as shown in Figure 6 and Figure 7. This will allow you to “play” with your X, Y, and Z axes and see if you really know what you are doing without damaging your machine or injuring yourself. The sharp end of the toothpick will also help to pinpoint all the important locations on your table (Machine Zero, Work Offsets, etc.).
  • Run a CAM Simulator program that employs animation to show you how the gear will be routed on your CNC router. This will give you a chance to see on a computer screen if the gear program (G-code) has any routing problems. Some CAM programs have this feature. Mach 3 also has a rudimentary toolpath simulation feature.
  • Run your gear program (G-code) in Mach 3 without anything inserted into the collet (chuck). In other words, turn off your spindle motor and let your router do a dry run (i.e., “cut air”). As the gear program runs, watch the collet and see if it looks like it’s following the gear pattern as it moves through the air above your workpiece (wood).

Figure 6.


Figure 7.


Stop It!

All CNC machines (mills, routers, lathes, etc.) come equipped with a big red emergency stop button (E-Stop). So should yours! Remember, if this is your first experience with CNC routers, ALWAYS keep a finger on the E-Stop button when your CNC router is in operation, just in case something unexpected happens.

Tip #4: SET STEPS PER UNIT! It’s extremely important that you calibrate your router so that when Mach 3 “says” it moved the X axis one inch on the DRO display, it has actually physically moved the X axis one inch on the router table.

All you need is a ruler (1/32”) to calibrate your machine. One axis at a time, you position (jog) the X, Y, and Z axes to the edge of the ruler. If you go to the Settings tab in Mach 3, you’ll find the ‘Set Steps per Unit’ button. Just follow the prompts and Mach 3 will guide you through the process.

The Finish Line

I barely scratched the surface of what you need to know about CNC routers. I hope you learned something in this article that you can use with your new CNC router.

Stay safe!  SV




Article Comments