WHAT IS CAD, CAM AND G-CODE?
In the world of CNC (Computer Numerical Control), there are three software elements needed to go from idea to part: CAD, CAM, and G-code. Even though there are some software companies that provide combinations of these, they each serve specific roles when working with CNC.
THE BASICS OF CNC
Computer Numerical Control is defined as the automated control of machine tools (such as drills, boring bars, lathes, mills, etc.) by means of a computer. By definition, any machine tool can be CNC, but more often the term is relegated to machines doing subtractive manufacturing.
Before computers were readily available, machines were programmed with punch cards (AKA numerical control), which provided the specific commands that the tool would follow. These commands were based on coordinates and provided the machine an exact pattern of movement, which resulted in repeatable parts.
CNC is that same process of providing coordinates and commands through a controller, which moves the machine in various ways and results in precise, repeatable parts.
With modern CNC, we can not only control the movements of the machine, but also the spindle speed, feed rate, tool changes, program pauses, coolant systems, and any number of other commands that make our machining more efficient.
So, let’s go from art to part with CNC.
START WITH CAD
Computer Aided Design (CAD) is software that provides the ability to develop and design parts digitally. Essentially, you can create the digital version of a part, with specific dimensions and features (like chamfers, finishes, etc.) and use that blueprint to aid in creating a real part.
Many CAD programs also have other features that provide design insight, like simulation and analysis. This provides a designer or engineer with the ability to edit a part before it is ever made… theoretically, providing a more efficient route to better parts and components.
The predecessor to CAD was drafting. Drafting was used to provide a machinist with specific details to create the part the designer was after. While the process of using 3D design to create parts has evolved, CAD programs still have the ability to provide old-school design prints.
More contemporary use of CAD is to design parts for machining. Because CAD is done in the digital world, there has to be a way to move from the design to manufacturing.
Enter Computer Aided Manufacturing (CAM).
WHY DO WE NEED CAM?
Computer Aided Manufacturing, or CAM, is software that takes your digital CAD design and creates toolpaths for manufacturing it.
The challenge with subtractive manufacturing is that you need multiple tools and specific paths for those tools to take in order to create specific features. For instance, a drill is great at making holes, but if you need a much larger hole (also known as a pocket), you’re probably better off using an end mill.
Tool choices also vary based on the needed precision and speed of the operation. To that end, your tool paths are going to vary based on the tools you choose.
This is where CAM is helpful.
Using your digital CAD file, CAM software (which can be integrated with CAD) helps to create the toolpaths that your machine will follow to make parts. There is a bit of an art to optimizing tool paths and making them as efficient as possible, but the basics of CAM can get your digital file closer to being machined.
CAM has the ability to create G-code (among other machine tool code) for your machine tool to follow. You can think of CAM as part of the bridge from the world of digital manufacturing to the world of physical manufacturing.
The other part of the bridge is G-code.
G-CODE: THE LANGUAGE OF THE MACHINE
The earliest CNC machines were actually NC (numerical control) machines, using those punch cards for direction. G-code brings that idea into the modern era.
G-code is the coding that tells your machine what to do. CAM software, with the help of a post-processor [LINK], converts the tool paths that you create into a language that the machine can understand. A running set of commands and coordinates that moves your CNC machine while also managing other elements of the process, like tool changes, coolant, and spindle speeds.
While G-code is certainly the second half to that bridge from CAD to machine, some machinists prefer to manually type up their own G-code. So, rather than going through a CAD/CAM process, they simply look at a print and develop the coordinates for the machine to follow by hand.
Regardless if you manually create your G-code or use a CAM program, it’s a necessary component to making your CNC machine run.
EVERY PIECE OF THE CNC PUZZLE
There are a million different ways to use CNC to create a part. You can change the type of machine you’re using or the CAD program or CAM or even a different post-processor and get results from your CNC machine. The key is to evaluate priorities when choosing all of these components.
Some CAM software doesn’t handle a 4th axis very well, some thrives on writing toolpaths for robots, and some is perfect for 2-axis machining. Figuring out what CNC processes you need will provide the answer to the best combination of CAD and CAM.
Finding the right tools for the job you are doing is important when choosing hardware, but it is just as important when choosing software because CAD, CAM, and G-code are all vital to making a CNC machine work.