Open Source CNC

The open—and sometimes free—world of Computer Aided Design and Manufacture and Computer Numerical Controlled machines.

Computer Aided Design, the use of software to build prototypes and the specifications of parts virtually, and Computer Aided Manufacturing, the use of software and computercontrolled machinery to automate a manufacturing process, has become increasingly important in all industries. Fortunately for gunsmiths in even the smallest shops, the cost of entry has gotten more affordable.

Any manufacturing process needs three components for a CAM system to function: Software that tells a machine how to make an item by generating toolpaths, machinery that can turn convert software instructions in machine steps to transform raw material into a finished product, and post processing converts toolpaths into a language machines can understand. CAD focuses on the design of parts and products while CAM converts the design into steps toward construction.

History Machine-controlled manufacture is older than many realize. In 1839 French weaver Michel- Marie Carquillat wove a 2×3’ silk portrait of Joseph-Marie Jacquard. Done by hand, this large and detailed image would have taken several workers many months to complete. Instead, the image with caption and Carquillat’s name was woven on a Jacquard machine, an automated loom using 24,000 Jacquard cards, each of which had over 1,000 hole positions.

Once all the programming was completed, the process of weaving the image with the punched cards could be done in about eight hours with a single weaver operating the Jacquard loom. The Jacquard loom did no computation, unlike digital machines that would be created over a century later, however, storing and using information via punched holes in a card was an important conceptual step in the history of computing.

Charles Babbage used the same idea for data and program input and output and storage in his general purpose programmable computer, the Analytical Engine described in 1837 and programmed by Countess Ada Lovelace, widely considered the world’s first programmer in the modern sense. In the late 1800s, German inventor Herman Hollerith made use of punch cards in his Hollerith Electric Tabulating System, marketed by the Tabulating Machine Company.

Hollerith would reorganize under a holding company called the Computing-Tabulating- Recording Company. In 1924, the Computing-Tabulating-Recording Company was renamed International Business Machines. Stacks of punch cards were programs in the modern sense of the word, though the word "program" did not have that meaning until after the development of electronic computers after World War II.

John Parsons first introduced Computer Numeric Controlled machining in the 1950s using punch cards to program and automate machinery. In 1949 the United States Air Force funded Parsons to build an automated machine that could outperform manual machines. With some help from Massachusetts Institute of Technology, Parsons developed the first prototype. Between the mid-1940s and 1950s, various developments were made in computer software.

Some of these developments include servo-motors controlled by generated pulse, a digital computer with built-in operations to compute and coordinate radar-related vectors, and the graphic mathematical process of forming a shape with a digital machine. In 1953, MIT researcher Douglas Ross saw the interactive display equipment being used at SAGE (Semi-Automatic Ground Environment) radar stations. Ross and his MIT Lincoln Laboratory colleagues started using it on workstations to provide instant display of data.

This helped programmers to use and debug software in real time rather that via a batch-processed stack of cards or print out. Ross coined the term "Computer Aided Design" in 1959. The invention of the 3D CAD/ CAM is attributed to French engineer Pierre Bézier at Renault. Between 1966 and 1968, based on his mathematical work with computing surfaces, Bézier developed UNISURF, a pioneering surface CAD/CAM system to assist with car body design and tooling.

UNI- SURF became the working base for the following generations of CAD software. Those of you familiar with computer graphics recognize his namesake Bézier curve, the use of Bernstein polynomials in vector graphics. CAD implementations have evolved dramatically since this early development. In the 1970s, CAD with three dimensions was

S. Air Force and programmed with punch cards. CNC has gotten much smaller, cheaper, and easier since then. typically limited to producing drawings similar to hand-drafted drawings. Advances in programming and computer hardware in the 1980s saw solid modeling, allowing more versatile applications of computers in design activities. In 1981, solid modeling packages such as Romulus (Shape Data) and Uni- Solid (Unigraphics) were offered.

Autodesk, Inc. was founded in 1982 by John Walker who coauthored the two-dimensional design system Auto CAD which is widely used by architects, engineers, and structural designers to design, draft, and model buildings and other structures. Auto CAD as a commercial software product is also noteworthy for being a desktop app running on microcomputers with internal graphics controllers.

Prior to Autodesk, most commercial CAD programs ran on expensive mainframe computers or minicomputers with each CAD user working at a separate graphics terminal. Through the 1980s and 1990s CAD/CAM was increasingly available on personal computers as PCs using inexpensive commodity hardware affordable for individuals became powerful enough to run design software and control machines, completely revolutionizing how manufacturing is approached.

The earliest CAD and CAM jobs were reserved for expensive automotive and aerospace applications, often with government funding, but the cost of the software and hardware to run it has gotten much cheaper. CAD/CAM Process Since its inception, CAM has delivered many improvements to manufacturing. This include improved machine capabilities with CAM systems taking advantage of 5-axis machinery to make more sophisticated parts. This improves machine efficiency and improved material usage.

Additive manufacturing ("printing" additive layers rather than cutting away) can produce more complex geometries with minimal waste and lower costs. Using CAD, a designer makes a 2D or 3D drawing, which could be a gun part or receiver, engine crankshaft, kitchen faucet, or anything else. Any CAD design is a model containing a set of physical properties that will be used by a CAM system.

With a model design completed in CAD, it is then be loaded into a compatible CAM machine, directing it to prepare for machining, which is the controlled process of transforming raw material into a defined shape through actions like cutting, drilling, or boring. CAM software does this with several actions. First, the model is checked for geometry errors that will impact the manufacturing process.

Toolpaths (sets of coordinates the machine follows during machining) are computed, setting required machine parameters, such as cutting speed, voltage, cut/pierce height, etc. The CAM system can also determine the best orientation for apart to maximize machining efficiency. CNC Machines Modern manufacturing machines run various Computer Numerical Control machines to produce parts. Prior to CNC, machining manufacturing centers were all operated manually by machinists.

We’ll start with CNC routers, machines that cut parts and carve shapes with high-speed spinning tools. CNC routers for woodworking can route out a stock blank and create decorative engraving with appropriate tooling, CNC routers have 3-axis cutting capabilities, which allows them to move along the X, Y, and Zaxes. Milling machines automate milling metal, wood, composites, and the like, removing material from a raw block. They are extremely versatile with a large variety of tools.

Likewise, lathes spin the work piece to be cut with a stationary tool. The primary difference from their manual counterparts is the ability for the machine-controlled tools and vice to programmatically make changes on its own. With the workpiece set, the CNC machine takes over, essentially working as a journeyman/apprentice for you based on your design. G-Code G-code is the generic name for the most widely used CNC program-

ming language. Developed by the Electronic Industries Alliance in the early 1960s, a final revision was approved in February 1980 as Recommended Standard #274 (RS-274). G-code is a plain-text language, meaning that it can be read in a standard text editor and be interpreted by CNC machines. Gcodes control the movements of a machine, dictating how and where a machine should move to fabricate apart. M-code controls miscellaneous machine functions, including starting and stopping specific actions or programs.

G-code’s programming environments have evolved in parallel with those of general programming. Raw G-code is similar to programming in Assembly, where each instruction explicitly directs a single, specific operation. The first CNC programs required writing a program with a pencil and then typing it into a tape puncher. As CAD improved, G-code editors became increasingly automated where specific steps are abstracted from visual designs. Modern desktop CAD software now generates G-code based on your design.

While a G-code file is plain text, it’s not designed to be human readable, although it’s easy to look through the file to see what it is doing. G-codes tell the controller what sort of motion is desired. An example: G01 X1 Y1 F20 T01 S500. G01 indicates a linear move, based on coordinates X1 and Y1. F20 sets a feed rate, which is the distance the machine travels in one spindle revolution. T01 tells the machine to use Tool 1, and S500 sets the spindle speed.

Open Source Open source software is software with source code that anyone can inspect, modify, and enhance. Source code is the part of software that most computer users don’t ever see; it’s the code computer programmers can manipulate to change howa piece of software—a program or application—works.

Open source is derived from the free software movement where programmers share the goal of obtaining and guaranteeing certain freedoms for software users, such as the ability to run, read, modify, and share software freely, without restrictions. "Free" here primary refers to freedom, not necessarily price, although most open source and free software can be had at no cost. The common example is free speech, not free beer.

A large successful example of this is the GNU Project ("GNU’s Not Unix!") which developed a complete Unixlike operating system commonly paired with the Linux kernel for the operating system core. GNU/ Linux systems power most of the Internet, the majority of current supercomputers, as well as Android mobile devices (smart phones and tablets) and many small, embedded devices. Commercial, closed-source, non-free software sells with an initial base price of several hundred to several thousand dollars.

Often, this price is a license that has to be repurchased every 1-3 years. For example, the base Auto- CAD software costs $1,690 per year for single license. The availability of free and open-source CAD software provides options for small shops and hobbyists. BRL-CAD (BRLCAD.org) is a constructive solid geometry (CSG) solid modeling CAD system that features an interactive geometry editor, ray tracing for graphics rendering and geometric analysis, scripting, image-processing and signal-processing tools.

The entire package is distributed as a readyto-run program or as source code to compile on your local machine. In 1979, the U. S. Army Ballistic Research Laboratory (BRL, now the United States Army Research Laboratory) needed tools to assist with computer simulation and engineering analysis. With no adequate CAD program available at the time, BRL software developers created their own. The software utilities could interactively display and edit geometric models.

This suite of utilities was packaged as BRL- CAD and publicly released in 1984. The BRL-CAD programmers were allowed to release it as an opensource project in 2004. The BRL-CAD source code repository is the oldest known public version-controlled codebase in the world that’s still under active development, dating back to 1983. It runs on all POSIX and Unix-like operating systems, including mac OS (previously Max OS X) and GNU/ Linux. Libre CAD (LibreCAD.org) is Far

an open source 2D-CAD program started as a project to build CAM capabilities into the community version of QCad for use with a Mechmate CNC router. Libre CAD is a free, open source CAD application for Windows, Apple, and GNU/ Linux with support and documentation free from a large community of users and developers. Most of the interface and handle concepts are analogous to Autodesk’s Auto CAD.

Libre CAD uses the Auto CAD DXF file format internally for import and save files, as well as allowing export to other file formats. Free CAD (FreeCADweb.org) a free, open source, general-purpose parametric 3D CAD modeler and a building information modeling (BIM) software with finite element method (FEM) support. Free CAD is intended for mechanical engineering product design but also expands to a wider range of uses around engineering, such as architecture or electrical engineering.

Functionality can be extended using the Python programming language. It is intended to be a feature-based parametric modeler with a modu- As with many modern 3D CAD modelers, Free CAD has a 2D component to facilitate 3D-to-2D drawing conversion. Under its current state, direct 2D drawing (like Auto CAD) is not the focus for this software, nor is animation or 3D model manipulation. However, the modular nature of Free CAD allows it to be adapted for such environments.

In addition to its own main file format (FCStd), Free CAD also works with DXF, SVG, and a host of other common CAD file formats. JScut (JScut.org) is unique as it is Web-based CAM software written in Java Script that runs in a web browser. No need to install anything; just visit the website and your browser is automatically running CAD software. JScut converts SVG image files to CNC cutting paths. Written by Todd Fleming, the user interface uses Bootstrap, a popular front-end framework library for web development.

It provides a 3D G-code simulation view, Vcutter support, and G-code output in inches or millimeters. Firefox, Chrome, and Safari browsers are supported and files can be saved in Google Drive. Far Py – (Py CAM. Source- Forge. net) is a toolpath generator for 3-axis CNC machining. Available for Mac, Windows, and Linux, Py CAM is a Python-based CAM loading 3D models in STL files or 2D contour models from DXF or SVG files.

The resulting G-Code can be used with Linux CNC or any other machine controller. lar software architecture, which makes it easy to provide additional functionality without modifying the core system. The basic workflow is preparing the model/design, defining operations (specify tool, define milling process, specify the bounding box), then generate and examine the toolpaths for the job. When satisfied, the results are exported as G-code. Design software has open source options and so do CNC machine controllers.

Linux CNC controls CNC machines and can drive milling machines, lathes, 3D printers, laser cutters, plasma cutters, robot arms, hexapods, and more. This controller supports machines with up to 9 axes. As the name implies, it runs a computer using some version of Linux, with Debian or Ubuntu preferred. Linux CNC accepts G-code input, using it to control a CNC machine’s response.

Linux CNC provides several graphical user interfaces, G-code (RS-274) interpreter, realtime motion planning system with lookahead, operation of low-level machine electronics such as sensors and motor drives, and a breadboard layer for quickly creating machine configuration for your machine. Linux CNC is not CAD, so you’ll have to use a different program to create the initial design.

DIY CNC Given the no-cost options for CAD/ CAM and CNC software, what about Do It Yourself hardware? Is it possible to obtain low-cost CNC machines? How about building your own? American Gunsmith has reviewed Tormach CNC machines, which is one company offering low cost commercial CNC machines using their proprietary Path Pilot software.

CNC has gone from complicated multi-million dollar installations to commercial grade Hass machines in the tens of thousands range to Tormach and other CNC machines at the $1,000-$10,000 price point. CNC programming has gone from punch cards to Assembly to desktop visual tools to web-based options, such as Path- Pilot and JScut. Grbl (github.com/gnea/grbl) is a high performance, low cost alternative to parallel-port-based motion control for CNC milling.

This version of Grbl runs on an Arduino with a ATmega328P microcontroller, such as the Uno, Duemilanove, Nano, or Micro. These units can be had in the $20-$30 range. Written by Simen Svale Skogsrud (Norway) and Dr. Sungeun Jeon, Grbl uses cheap AVR-chips to achieve precise timing and asynchronous operation. It is able to maintain up to 30k Hz of stable, jitter free control pulses. It accepts standards-compliant G-code and has been tested with the output of several CAM tools with no problems.

Arcs, circles and helical motion are fully supported, as well as, all other primary G-code commands. Macro functions, variables, and most canned cycles are not supported, but the authors feel a Graphical User Interface can do a much better job at translating them into straight G-code. Grbl includes full acceleration management with look ahead. That means the controller will look up to 16 motions into the future and plan its velocities ahead to deliver smooth acceleration and jerk-free cornering.

To be clear, the free and open source Grbl software combined with a $30 Arduino can form the basis of an entry-level CNC machine you can build yourself. Nikodem Bartnik designed and built a CNC machine using a Dremel tool, LMU12 bearings, Nema17 motors, Arduino microcontroller, aluminum profiles, and free software. The purchase price of the all the needed components is around $300. The entire project instructions and parts list is on the Instructables.com website under "DIY 3D Printed Dremel CNC". Gunsmith CAD/CAM?

Manual machine tools as well as hand tools remain vitally important for many tasks, especially in gunsmithing. For custom, one-off jobs, manual machining and hand tool work is often still best. Consider Carquillat and the Jacquard loom. A silk tapestry that would have taken several weavers months to complete was completed in one day by Carquillat but this was after programming the 24,000 cards of information in set up.

This makes sense given Jacquard wanted multiple silk tapestries made as well as a means to show off his automated loom. Thankfully, CAD software is much easier to design with. With modern CAM machines using a well-designed model, the only human intervention required for running a CNC machine is loading a program, inserting raw material, and then unloading a finished product. But this only works after creating a successful model. Is CAD/CAM a good idea for you? As with almost everything, it depends.

Even for a small shop, consider the types of jobs and guns worked on most often, especially if it involves difficult-to-find parts. CAD software can help model apart even if it’s a one-off job to be finished manually. However, with a design already made, it could just as easily be handled with a CAM CNC machine. Given that the cost of affordable CNC machines are now within the range of hobby gunsmiths and that opensource designs allow building your own, this is realistic.

Regardless, the design can be saved indefinitely and cheaply as a computer file. The time and cost savings if that job ever crops up in the future is big. The real win is that this is nowa realistic option for individual gunsmiths and hobbyists. In the 1950s, using a CNC machine required a Ph D in Engineering and millions of dollars from a huge corporation or government entity. Today, kids are downloading instructions and software for free and building basic CNC machines for around $300 in parts and supplies. AG

Continue reading

More from the archive

More from this issue

Free Gunsmith Videos

By July 2021

A number of gunsmiths have free instructional videos on YouTube.com. Search for these channels and check them out before someone decides these videos “violate community standards.” 45 Alfa Charlie Papa Also posting as The Old Singing Gunsmith, American Gunsmith contributor Paul Mazan…

More from this author

FFL Software

By June 2022

Tools to help keep your firearm retail business in compliance with the Bureau of Alcohol, Tobacco, Firearms, and Explosives.

Related workshop reading

Digital edition

July 2021

Opening…
MFGAxis Discussion Reader conversation for this Gunsmith Magazine piece Like, save, or comment using the InnoNet-powered reader system. Saves stay in your Gunsmith Magazine library.
Be the first to engage.

MFGAxis Discussion

Be the first to engage.
Save & notes

MFGAxis

Reading tools

Continue with MFGAxis to save articles, notes, and reading lists.