CNC is an acronym for Computer Numeric Control. It is defined as “automation of machine tools by means of computers executing pre-programmed sequences of machine control commands.” The computer part is obvious, the machine is controlled by a computer. Numeric means simply that the control program is a series of numbers, describing a tool path, or the path the tool will follow to produce a result. And finally, control is just as you would assume, the computer uses numbers to control the position of a tool. Pretty simple so far.
What this means to you, is that you can come up with a design, draw it out, convert the drawing to machine instructions, and execute it on a CNC machine to produce a final product. It can cut out shapes, make complex designs, and do repetitive tasks much more precisely and accurately than any human.
A CNC router uses what is known as a “Subtractive” manufacturing technique, which means it makes things by removing material from a blank. This is different from an “Additive” manufacturing technique where material is added to a bed to form the object desired. An example of this would be a 3D printer that builds up melted plastic to form an object. Either type of construction can use a CNC machine to perform the function.
CNC machines can be just about any type of machine designed to cut, drill, lathe, or carve some material. There are CNC lathes, drilling machines, saws, routers, mills, plasma and gas cutting machines, component placement machines, lasers, welders, the list is very long.
The Cartesian Co-ordinate System and G-Code
Most CNC machines use what is known as the Cartesian Co-ordinate System. It was conceived in the 17th century by René Descartes. You’ve probably forgotten all your high school math, but the co-ordinate system describes any location in a 3 dimensional space by using a series of numbers. Each direction is known as an Axis, and the 3 Axes are all perpendicular to each other.
There are typically 3 axes used in machining, but there can be 4, 5, or even 6 axes. We will concern ourselves with the more common 3 axis system. These axes are typically labelled X, Y, and Z. The X axis is the transverse or left to right axis. The Y axis is front to back, and Z is up and down. Some types of machines and software reverse the roles of X and Y, but the above is the usual convention. Milling or routing machines use X and Y axes to describe the location on a plane, and Z to indicate the height of the cutter.
Any point within the workspace of the machine can be described by a 3 number co-ordinate. For basic CNC operations, the user doesn’t usually need to know what these co-ordinates are; you can just let the machine take care of the math.
The CNC machine is programmed through the use of a type of software called G-Code. G-code is a plain text set of instructions that controls the movement of the machine by telling it what co-ordinates to move to. Each line of G-code is a single move instruction, that tells the motors where to move, how fast to move, and what path to follow. Each instruction generally consists of a capital G, followed by a numeric code describing the operation. G0 is a fast move (sometimes called a “Rapid”) where the Z axis is above the surface and not cutting. G1 is a straight line cut, and G2 and G3 describe left and right hand arcs. Then, there are X, Y, and Z co-ordinates telling the machine where to go next. If the machine is only moving in one or two directions, there may be only one or two co-ordinates instead of all 3. If a co-ordinate is missing, that just means it isn’t being moved. See Here for detailed information on G-code:
https://www.cnccookbook.com/g-code-m-code-reference-list-cnc-mills/
There are also some additional codes that are meant for general machine function control. These are called M codes. They can be inserted into the g-code stream to perform machine related functions such as turning the spindle motor on and off, applying coolant to the bit (not used in wood routing), or turning on and off a dust collection system.
Finally, there are a couple of special codes like S followed by a number, which sets the spindle RPM in machines that have this feature available, and F followed by a number which is the feed speed (how fast the machine moves during a cut)
Although it is not strictly necessary to know how G-code works in order to use a CNC machine, a basic understanding of G-code is very useful in troubleshooting your programs, and general operation of the machine.
The CNC Router – Construction
A typical CNC router consists of a collection of assemblies:
- The bed, a structure which supports the machine, usually covered in a wood sheet sometimes called a “Spoil board”
- The Rails, which are tracks that the gantry and the other axes move upon
- The Carriages, which have a low friction sliding or rolling mechanism to facilitate linear movement of the carriages
- The Carriages, collectively, are sometimes known as the “Gantry”
- A Motor for each axis, which drives the carriage by some mechanical means such as a belt or screw
- Usually, the drive motors are what is known as “Stepper” motors, which move in discrete steps, allowing for precise digital positioning
- Drive can also be done with “Servo” motors, which are usually faster and more precise
- The Electronics, which consist of a motion controller, motor drivers, and power supply to run the machine.
- The Spindle, or Router, which is the cutting tool mounted on the Z axis that does the actual work.
- A computer, usually a Laptop, which runs software to control the machine, display the status, and feed G-Code to the motion controller. Commercial machines usually have this computer built in.
CNC Workflow
Work flow for CNC routing can follow a few different paths, depending on what software packages you use. Here are a few examples of common work flow:
CAD Program > CAM Program > G-Code Sender > Machine
Definitions:
- CAD – Computer Aided Drawing
- CAM – Computer Aided Manufacturing
- G-Code Sender – A program which controls the machine and feeds it G-code from a file
For example:
SketchUp > SketchUCam > GRBL Panel > Machine Or,
AutoCAD Fusion 360 > Internal CAM > GRBLControl > Machine
The CAD program is used to draw a representation of your part in 1:1 scale. The CAD program is a program of your choice, and usually depends on the type of CAD user interface that you are used to. I would suggest AutoCAD Fusion 360 for users that are familiar with AutoCAD’s user interface or SketchUp for beginners with 3D CAD. These programs are both powerful and free. 3D CAD is not strictly necessary; most things can be drawn in 2D cad and then use the CAM program to add the depth information after. This is usually referred to as 2.5D CAD. Any CAD program can be used to generate a DXF or DWG file which can then be processed by the CAM program.
There are other programs that can be used to generate drawings. Programs such as Corel Draw, Adobe Illustrator, Inkscape, and so on can be used to generate a SVG drawing file (Scalable Vector Graphics), which can then be imported into a Cam Program such as JSCut to generate g-code. The possibilities for software combinations are many, and you can spend nothing or thousands of dollars on software tools.
The CAM program then uses this representation to calculate a Tool Path which is the G-Code that the machine uses to move. CAM programs can usually take common drawing formats and load them up for processing. The user then specifies things like internal machining (pocket) or external machining (outline), holes, and other features by selecting the functions from the menu and applying them to the drawing features. The user also specifies such things as tool sizes, hole and pocket depths, feed speeds, and other parameters. The CAM program will then generate a g-code file that can be sent down the chain.
The G-Code Sender program runs on the computer that controls the machine, and is able to load the G-Code and send it out to the machine using a communications interface such as USB. The G-Code sender also provides machine control function such as Jog, Position Display, Zeroing, Macros, Machine Setup, and a host of other functions. It is the main interface between you and your machine.
There are other types of workflow that can also be used:
Photo > Engraving Program > G-Code Sender > Machine
Photo Engraving can be done with a very fine bit on a hard surface such as metal or in some cases, Wood. It cuts at a very shallow depth and creates a fine image on the surface. It can also be done by the CNC machine equipped with a Laser Engraving Head.
High Contrast Image (cartoon) > V-Carving Program > G-Code Sender > Machine
V-Carving uses a V-shaped bit in the router to do images like ink drawings and cartoon type images which have low detail and high contrast. The depth of the router determines the width of the lines; the deeper the router goes the wider the line. These can provide great images and text for things like signs and logos.
Canned STL Image (purchased) > Carving Program > G-Code Sender > Machine
One can purchase STL (Stereo Lithography) images from many sources online, and while these are best known as source files for 3D Printers, they can also easily be converted to G-Code by most CAM programs. This allows you to resize, scale and manipulate the image to carve into whatever you are making, be it wooden boxes or cabinet doors.
Text (Paint or Word) > Carving Program > G-Code Sender > Machine
Any word processing program like Word, Corel Draw, or even the lowly Windows Paint program can be used to create text that can be carved into a surface. Simply choose the font, enter the text and other features, save the file as a monochrome bitmap image, and use a CAM program like V-Carve or F-Engrave to generate a toolpath.
Loading G-Code
Load your G-Code using the program load facility of whatever G-Code sender program you use. It is strongly suggested that you do a dry run of your code in a G-Code plotter program like Camotics before you try to machine it just to make sure it is doing what you think it is going to do. After doing this, do a dry run on the router with the Z axis raised and no bit in the router (router off) to make sure the program stays within the machinable area, and doesn’t hit any of the work hold downs. Be ready to hit the E-stop.
Only then install the bit, set the Z axis zero, fire up the router, and proceed to run your program.
If the program does not run or produces an error, check for illegal G-Codes that GRBL does not recognize. Usually an error message will show up in the error text box giving at least some clue as to what went wrong. If you try to run code generated for another machine, it may have codes in it that GRBL does not recognize. If you are running g-code generated for another machine, also make sure that the units on your machine are set to the same units used to generate the g-code, i.e. inches/inches or mm/mm.
It’s always a good idea to put notes about the g-code program into the header of any g-code file that you create. Things like zero position, units, etc. will make it much easier to set up the machine if you run g-code at a later date when you may not remember these details. G-Code is just plain text and can be read or edited using any plain text editor such as Notepad. Do not try to edit g-code with a full blown word processor such as Word since it may insert non-text characters into the file that will cause problems when executing the g-code.
That’s it for this intro. Next we’ll get into setting up your machine and work in preparation for doing a job.