21,59 €
Until recently, Computer Numerical Control (CNC) machines belonged to the realm of heavy industry, but as technology becomes cheaper and smaller, these machines now can be used in home workshops. It’s not easy to get started, though, but thanks to this guide, you’ll be ready to take on a variety of projects in no time.
A Tinkerer’s Guide to CNC Basics contains everything you need to get set up at home with computer-controlled machining and fabrication. Sparing you the theory, this project-laden guide helps you learn by doing.
Once you’ve got to grips with the principles of CNC and installed the 3018 Pro CNC machine, you’ll gradually move from simple projects such as basic engraving to more complex milling and machining techniques. You’ll even learn how to upgrade your machine to accomplish more sophisticated designs. The plethora of projects in this book will keep you busy and give you the practice you need to get started with your computerized workshop.
By the end of the book, your computerized home workshop will be one step closer to realization, and your machining skills will be taken to the next level.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 247
Veröffentlichungsjahr: 2024
Master the fundamentals of CNC machining, G-Code, 2D Laser machining and fabrication techniques
Samer Najia
BIRMINGHAM—MUMBAI
Copyright © 2024 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Rohit Rajkumar
Publishing Product Manager: Vaideeshwari Muralikrishnan
Book Project Manager: Aishwarya Mohan
Senior Editor: Rakhi Patel
Technical Editor: Simran Udasi
Copy Editor: Safis Editing
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Production Designer: Alishon Mendonca
DevRel Marketing Coordinators: Namita Velgekar and Nivedita Pandey
First published: February 2024
Production reference: 1040124
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK
ISBN 978-1-80324-749-6
www.packtpub.com
To my wife, Sanja, for lovingly and patiently putting up with my projects and incessant desire to build things. To my children, Hanna and Jordan, for inspiring my creativity.
– Samer Najia
Samer Najia has always enjoyed building things and often has multiple projects in the air. While by day he is in the IT field, at all other times he is often putting bits of things together in the garage or on his desk. When the sky beckons, Samer likes to fly and work on airplanes.
Atif Tajul, born in Kuala Lumpur, Malaysia, is a mechanical engineer who graduated from the University of Southampton, United Kingdom. He indulges himself in anything hands-on and enjoys tinkering. He is a very practical person when solving problems and providing solutions. He has experience of working on cars as an apprentice mechanic, and the skills and knowledge he gains from that are used for the benefit of his family. Atif 3D prints personal designs with his own machine in the pursuit of becoming a master at prototyping and fabrication. He keeps himself in shape by playing football as he is a massive fan of the sport.
A Tinkerer’s Guide to CNC Basics will suit anyone who enjoys shop work and tinkering through the process of automating the fabrication of parts of various materials, including cutting and engraving with milling machines and lasers. If you have a desire to make things out of wood, metal, plastic, foam, fiberglass, or other materials, and maybe have to make several parts repeatedly, this book is for you. If you need to prototype your designs and want to be able to do so fast so you don’t have to hand fabricate everything and learn how to leverage Computer-Aided Design (CAD), you will benefit from this book.
The book starts with an overview of what CNC is and progresses toward acquiring, building, and customizing a commonly used CNC machine before delving into various projects. These projects include upgrades to this machine, building larger and more complex machines, and fabricating parts for specific applications. You will learn how to operate and service a desktop CNC machine, use CAD to design or modify parts that your machine can then fabricate, and finally learn how to scale up your efforts with bigger and more complex systems.
By the time you are finished with this book, you will know how to fabricate using a basic CNC machine, cut with a laser, use a fourth axis to cut parts as they rotate on your work table, and operate multiple software applications to achieve your desired outcomes. You will also become familiar with a number of techniques to transfer drawings from paper to electronic formats suitable for fabrication by your CNC mill.
Anyone who enjoys working in their home shop or garage or likes to tinker and build things from scratch out of many materials will enjoy this book. Tinkerers will grow their skills and add automation to their repertoire of tools to fabricate just about anything.
Chapter 1, The What and Why of CNC: This chapter introduces CNC, discusses the mechanics of how it works, and provides some initial considerations for safety.
Chapter 2, Setting Up and Configuring the 3018 CNC Machine: This chapter’s focus is on the build-or-buy decision and getting your first CNC machine up and running.
Chapter 3, Understanding Material Properties before Making the First Cut: Here, we take a look at what is needed for various materials as far as the CNC machine is concerned, such as how to select an endmill for a particular application.
Chapter 4, Making the First Cut: With this chapter, we’ll put the 3018 to work and start cutting materials.
Chapter 5, Full CNC Workflow with Different Materials: Building on the previous chapter, we begin looking at how to go from design to finished product, including the transfer of paper drawings to an electronic format suitable for subsequent processing with our 3018 machines.
Chapter 6, Upgrading Your CNC Machine: We’ll add components to the machine we have to be more precise, start with a discussion on a fourth axis, and add the ability for our machine to become a plotter and a drag knife.
Chapter 7, Enclosures: CNC machines produce debris, and if using a laser, there could be fumes that might need ventilation. This chapter discusses some simple enclosures that can be built to keep your work area neat.
Chapter 8, Project: Building a CNC Laser Cutter and Plotter: Taking everything we have learned so far, we’ll build limited-purpose CNC machines: one to generate and scale drawings and another to cut using a laser.
Chapter 9, Project: Building Your Own 4th Axis: In this chapter, we build on Chapter 6 and build a fourth axis add-on using our 3018 and some off-the-shelf parts.
Chapter 10, Adding a Laser to the 3018: We’ll add a laser toolhead to our original desktop CNC mill to make it a 2-in-1 machine.
Chapter 11, Building a More Capable CNC Machine: Once we outgrow the 3018 machine, we will want something bigger and stronger with a larger workspace. This chapter steps through the process of scaling up.
Chapter 12, Future Projects and Going Bigger and Better: We’ll look at even bigger machines for our shop including stepping out of the hobbyist arena and seeing what industrial CNC machines can do. We also have a quick look at five-axis CNC machines.
You will need some basic tools to assemble your machines, including drills, drill bits, screwdrivers, hex keys, rulers, and tape measures, some scrap material to use when test cutting with your CNC machine, and a suitable work area. Safety gear is also highly recommended, including eye protection, and when using the laser, special eye protection is mandatory.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, select your book, click on the Errata Submission Form link, and enter the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.
Once you’ve read A Tinker’s Guide to CNC Basics, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.
Thanks for purchasing this book!
Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?
Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.
Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.
The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily
Follow these simple steps to get the benefits:
Scan the QR code or visit the link belowhttps://packt.link/free-ebook/9781803247496
Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directlyComputer numerical control (CNC) is a software-based method of moving tools and machinery. This method has traditionally been under the purview of factories and manufacturing facilities and well beyond the reach of a garage tinkerer. CNC machines have arms and carriages that can hold mills, grinders, lasers, and other cutting tools that move in multiple axes to shape an object via preprogrammed movement commands.
Our objective in this chapter is to provide a basic understanding of CNC from a hobbyist’s/tinkerer’s perspective as we prepare to take a deep dive into obtaining, operating, and customizing our own machine.
In this chapter, we will cover the following topics:
Branches of CNC machiningDiffering approaches to motion in CNC machinesHow CNC works and when to use itA brief overview of G-code, the commands used to operate a CNC machineSafety considerations for CNC and lasersCNC manufacturing can be traced back to the 1940s, when the first numerical control (NC) machines started to appear (https://en.wikipedia.org/wiki/History_of_numerical_control), and methods to automate handcrafted fabrication can be traced to three centuries ago. I’m sure you’ve seen videos of these machines perhaps fabricating the engine block for a car or cutting and shaping sheet metal. For all intents and purposes, a CNC machine is a type of robot. It takes stock material (a sheet of wood, a block of aluminum) and turns it into a product ready to be assembled or finished very quickly, very accurately, and, most importantly, repeatedly. CNC machining made fabrication at scale possible.
With the advent of desktop computing, more commonly accessible materials, and smaller, more powerful components, it also became possible to bring CNC machining to the home workshop. Now, anyone with a good guide can put together a robust desk or bench-top CNC machine and get to cutting, engraving, and milling themselves. Such machining is not limited to metal, wood, foam, and other materials; there are multiple branches of CNC machining:
PCB milling: Where holes are drilled in the right places and the circuit board is cut and shaped for whatever they are going into.Rotary engraving: Where the movement is around an axis instead of along it. Imagine engraving a bottle, glass, or vase.Multi-axis machining: Where the machine does not just operate in X, Y, and Z, but also rotates the object being worked on to shape all of its sides (this is a typical use case for machining a car’s engine block). For an example of this, look at this video: https://www.youtube.com/watch?v=tO6AGOjBoGo.Figure 1.1 – Example of the three main axes in a CNC machine (X, Y, and Z) and the rotary axis around Y
In the preceding diagram, we have the three basic axes common to most CNC machines we will deal with. Horizontally, we have X and Y (lasers, for example, typically cut through, so they do not shape material vertically). The Z axis is for cutting into the material vertically (e.g., when engraving or drilling holes) and when the object being worked on is rotated, we have a rotary axis (here portrayed by turning the object around the Y axis). For the other two axes (X and Z), you could also have the part rotated around those axes, but we will not be doing this as the machine complexity increases tremendously. However, we will briefly discuss five-axis machines, which rotate around X and Y and travel along X, Y, and Z, in Chapter 12, Future Projects and Going Bigger and Better.
By moving and changing toolheads (a toolhead is the cutting/engraving assembly mounted on the X-carriage of the CNC machine) through automation, the process of crafting complex components is accurate, repeatable, and very scalable. By making design adjustments in software, it also becomes possible to quickly fabricate prototypes before putting the processinto production.
Depending on the nature of the machine itself, the motion system can vary based on the rigidity requirements of the toolhead. Very frequently, a compromise is struck between speed and rigidity (or stiffness) so that cheaper or more readily available components may be used. The most common of these tradeoffs is allowing X- and Y-axis motion to be driven by belts while the Z-axis motion operates using a leadscrew. Other designs use leadscrews throughout.
The following figure shows one of my four 3018 machines:
Figure 1.2 – A 3018 machine (see Figure 2.1 for an annotated close-up picture)
In the preceding figure, note the controller on the right. This picture was taken just prior to calibration. This is a machine that can be purchased online as a kit. It is made from some off-the-shelf parts (8020 aluminum extrusions, 8-mm steel rods, stepper motors (which are used for motion), leadscrews, and an engraving or cutting motor, also known as the spindle motor) and some vendor-provided components, such as the plastic parts and the controller board. This design is open source and almost everything can be purchased from various vendors online.
The following figure is of Bumblebee (so-called because I 3D-printed parts in yellow plastic and had black anodized aluminum extrusions in my parts bin to make it from):
Figure 1.3 – Bumblebee with its dual Y-leadscrews and 2-in-1 toolhead (spindle and laser)
Bumblebee is an example of a motion system that uses Delrin wheels and the extrusions themselves as rails (versus metal rods). This structure is larger than the 3018 machine and so had to be more rigid, which is more difficult when using smooth rods and linear bearings (rods can flex and would need to be thick and heavy).
The CNC machine’s toolhead is essentially a motor turning an end-mill or similar bit against a piece of material. That bit is going to experience some resistance and, of course, the more rigid the machine, the higher the likelihood of it being able to handle hard materials. Belts, for example, can stretch under load, which can make the cut less accurate or require multiple passes to handle certain materials. Using belts is typically best when the toolhead is relatively light or will be cutting light materials and is acceptable for lasers since the head only moves above the workpiece.
As an example of a belt-driven system, here is a picture of a laser cutter I built some time ago:
Figure 1.4 – Custom-built 10W laser
The preceding unit is a modification of a kit I had built for a friend, but which proved too underpowered for him. I ended up replacing all the acrylic parts with 3D-printed equivalents, replaced the 500-mW laser with a 10-W blue laser, and installed the entire assembly in a custom aluminum enclosure.
Figure 1.5 – Closeup of the X-axis belt on 10-W laser
In the preceding figure, the black line at the end of the red arrows is the belt (recessed into the metal extrusion). This is the gantry that moves in the X axis. There is a similar arrangement for the Y axis.
The reason I put this laser in a metal enclosure is because its previous incarnation jammed on a workpiece that became dislodged and the laser then ignited the workpiece. The flames consumed some of the gantry’s plastic parts and wheels. Consequently, I prefer large lasers to be fully enclosed in something that can contain any flames.
As you now have seen, a typical desktop CNC machine essentially moves a toolhead along a cartesian coordinate system (X, Y, Z). However, it is possible to engrave or cut into a workpiece along a rotary axis. In the desktop world, this is commonly achieved by adding a roller onto the work area that rotates the object being worked on in one axis. More often than not, this is in the Y axis. Imagine taking a sheet of paper and rolling it up into a cylinder. Rather than have the gantry move along the length of the paper, we are moving the rolled-up cylinder about its longitudinal centerline as the toolhead cuts into it. Here are some examples of this type of machine that you can make yourself:
Figure 1.6 – An example of a roller axis compatible with desktop laser machines (Source: Laser Rotary Attachment [https://www.thingiverse.com/thing:5349022]; created by and used with permission from Sean Mullen [zaphod101])
It’s not fully apparent in the preceding image, but the horizontal orientation of the cylinder in the pictured example can be adjusted by raising or lowering one side so that the cylinder surface is level. This tactic allows the laser to hit the surface directly overhead and accommodate objects with varying diameters.
The same can be done with a CNC spindle, that is, cutting into an object much like a lathe. Here is another DIY example that we will also explore in Chapter 6, Upgrading Your CNC Machine.
Figure 1.7 – A CNC rotary axis (source: Poor Man’s 4th Axis cnc [https://www.thingiverse.com/thing:2344975]; created by and used with permission from Daniel Gross [ZenziWerken])
Have a look at the accompanying video located at https://youtu.be/WfRF8FE9Qgc to see how the preceding axis is being used to cut treads into a wheel.
It’s also important to note that CNC machines typically have very limited motion in the Z (vertical) axis. For most desktop machines, the workpiece is not very tall, and in any case the end-mill or bit would snap from the strain applied to it if it were too long.
The CNC machine is operated by an onboard controller that runs three or more stepper motors and the toolhead. Stepper motors have a lot more torque and can be controlled with greater precision than ordinary electric motors. Motor control is measured in fractions of revolutions, which allows for excellent precision in movement. Using precision leadscrews (or pulley/belt systems), the motors move a gantry along the Y axis while the toolhead moves left and right on the gantry (the X axis). The Z axis is nothing more than a small gantry that moves the toolhead up and down, typically with a leadscrew.
The commands being passed to the controller on the CNC machine are called G-code. The commands passed to the controller (either via the onboard software or a computer passing G-code to the controller) move the toolhead to various locations in all three axes and runs the spindle motor so that the milling end can then cut into the material as desired. The same milling end will also drill all required holes to the desired depths. Of course, if the workpiece is to be separated from some stock material, it has to be secured to the worktable or surface so that it doesn’t move while it is being worked on.
Some machines include a control console (a screen with some buttons or knobs, or a touchscreen) to allow operation as a standalone unit. However, the controllers cannot typically generate G-code, only a computer running suitable software can. This software reads a design file and translates it into motion commands that the controller can understand.
One of the most common motion control software for the CNC controller is GRBL. GRBL is open source firmware that can be installed on the controller that then receives the G-code from the computer or reads it from a file. Various vendors also have their own versions of GRBL tuned specifically to their controllers or machines, although most common desktop machines will run non-proprietary GRBL just fine.
GRBL is not the only option, however. Marlin and Smoothieware (most commonly used for 3D printing) can also be used, which allow 3D printer frames to function as CNC and even laser engravers. Some vendors even have proprietary machines that are 2-in-1 (3D printer and laser) or 3-in-1 (3D printer, laser, and CNC machine) that either have a second toolhead on the X gantry or support swappable toolheads depending on the desired operation. Anycubic produced a 2-in-1 3D printer and laser combination, and SnapMaker is famous for making a 3-in-1 unit.
Here is a picture of the microcontroller and touchscreen controller for Bumblebee:
Figure 1.8 – An MKS DLC32 controller with a TFT screen attached
The MKS DLC32 board in the preceding figure is easily available on Amazon. The blue enclosure was 3D printed. The software (commonly called firmware) that configures the controller and touchscreen for CNC/laser has been loaded from sources made available by the manufacturer.
Ideally, the best case for a CNC machine is where repeatability and/or high precision are required at speed. CNC machines can make our object a lot more quickly than we can by hand, and the more complex the design the better the reason to use a CNC machine. Simple designs (for example, a rectangular panel with four holes) that only need to be made once are not an effective use of a CNC machine. However, parts that must fit together with high tolerance, perfectly rounded edges, and precisely rendered patterns and holes/fixtures are perfect uses for a CNC machine. For example, in Chapter 5, Full CNC Workflow with Different Materials, we will need to make several parts for a model airplane. Cutting several of these manually with a knife is tedious, but a CNC machine will make fast work of them, and they will all be cut exactly per the drawing we started with.
G-code is nothing more than motion commands that the CNC machine’s controller interprets to move the toolhead. Of course, those commands are passed on to the motor as the number of turns the motors‘ shafts have to make in one direction or the other. In addition to motion commands, there are commands to start and stop the spindle motor. All these commands are generated when software running on a computer interprets a design as a series of movements. There are many applications like this available, some free and others that can be purchased. Some design applications are also capable of generating G-code (for example, Fusion 360), which can then be passed on to the sender application, which in turn passes it on to the CNC controller. Some sender applications also generate G-code, such as LightBurn (for lasers), Mach 3, and Easel. For the purposes of our projects, we will focus on freely available firmware and sender software.
A note on laser machines
Since laser machines are mostly 2D machines (operating in X and Y only), G-code can be derived from simply an image (such as a JPG file) loaded into the sender software, which in turn converts it to G-code. Unlike in a spindle-based machine, the laser power can be controlled in G-code to also create shades so that various textures can be rendered on a surface.
G-code typically looks like this:
G01 X232.114456 Y13.456700 Z-1.5 F200.000000G01 means move in a straight line to a specific position (here defined by the X, Y, and Z coordinates). F# defines the feed rate, or how fast the toolhead moves (in mm/minute).
As an additional note, I also want to tell you that while most 3D printers will run fine from G-code stored on removable media that is inserted into the machine’s controller, not all commercially available controllers support this, and a PC will be needed to control the machine. This is not always the case. For example, appropriate firmware loaded on certain boards (such as the MKS DLC32 and later boards), or boards that accept a touchscreen with its own removable media slot, allow the CNC machine to be entirely standalone.
CNC machining involves the removal of material using a hardened metal bit that can fling fragments of your workpiece all over your shop. It should be needless to say that you should always have hand and eye protection on whenever you are working with and on your machine. This is especially true with lasers. The blue, green, or red laser on your machine can destroy your eyesight in an instant, so whenever the laser is on, you should have appropriate glasses on to filter out any harmful reflected laser light. Never operate a laser without those special glasses. Every laser unit I have ever purchased came with a suitable set of adjustable glasses (a green lens for a blue laser, for example). If your CNC bit shatters, you do not want metal fragments in your eyes or on your hands, and if your laser hits a reflective surface, you do not want to blind anyone looking over your shoulder or elsewhere in the shop with you. Do not allow pets anywhere near an active laser as they too could be blinded.
We now have learned some of the basics of CNC revolving around what it is, how it works, and what drives the design of various machines (for example, when to use belts instead of leadscrews). We also looked at how we might machine not just flat stock material, but also curved surfaces (with the rotary axis). All these are important concepts to grasp because they lay the groundwork we need to select, assemble, configure, and customize our own machines.
In the next chapter, we will look at setting up our own desktop CNC machine and get underway with fabricating some basic parts and shapes.