There are more and more hobbyists building their own CNC machines. In this series I'm going to try to explain the various parts of a CNC machine, how it might relate to the hobbyist trying to build their own, and give examples and pictures where I can. This is going to be a constantly growing article - so check back often for updates and additions!
Oh boy, X, Y, and Z coordinates? You remember back in math class when you worked on X and Y coordinates, right? Well if not, basically, THAT world is laid out on a grid of numbers with zero being the very center and the X Axis going east and west and the Y axis going north and south. Going to the east would take your X numbers increasing in the positive, while going to the west would make them decrease going in the negative direction. the same goes for the Y axis, north is positive, and south is negative.
OK, what about this "Z" business? The Z axis represents up and down in our world. with up being positive and down being negative and below the zero.
What does all that mean for CNC? Well that's the basis of it all really! The computer "tells" the machine to go to a certain X, Y and Z position! It's as simple as that! We will get to calibrating a machine and making sure it knows where all the coordinates are, but basically if a computer tells a machine to go to X1.250, or in other words "go 1.250 inches in positive direction of the x axis", then the machine will do just that. How does it do that? you ask? we'll get to that, trust me :)
Continuing our discussion on the basic understanding of CNCs, the next logical topic would be a CNC program. While you could stand at your machine and type individual commands for it to go to a certain XYZ position and do something, and then type another command to have it go somewhere else, this is generally handled by a "program" that you (or some CAM software) would write. Don't worry, we'll get to what CAM is shortly.
A CNC program is nothing more than a list of XYZ coordinates, or moves, that the machine executes line by line. These programs are also called G-Code. G-Code is a standard of instructions that was developed for controlling CNC machines, and there's a lot to learn about G-Code, and you can do a lot more than simple XYZ movements with G-Code. We will get to G-Code as well, but for this simple example, we don't need it yet.
Ok so a simple CNC program might look like this, for this example lets assume we have a CNC router, and that router is above a board we are going to cut, and the TOP of the board is at Z0 (Z Zero) and the board is 1/2" thick
Lets examine this simple program line by line...
G1Z.5 - This line tells the machine to go to the position where .5 or 1/2 inch is in the positive Z axis... what will happen is, if the machine is positioned currently BELOW Z.5 then it will raise the Z axis until it reaches .5" and if it is ABOVE .5 then it will come down. You will normally see a Z movement as the first movement because you'd want to make sure you move at a height ABOVE your workpiece so that you don't make cuts that you're not intending to.
G1X2.5Y3.6 - This line tells the machine to go to the position of 2.5 inches in X and 3.6 inches in Y
G1Z-.5 - This line tells the machine to plunge down into your workpiece 1/2 inch, basically going all the way through it
G1Y0 - This line tells the machine to move to Y0, and what the machine will do, since it's still 1/2" into the piece is rout a line from Y3.6 to Y0
G1X0 - This line tells the machine to move to X0, routing a line from X2.5 to X0
G1Y3.6 - This line tells the machine to move to Y3.6 again, so now we should have a U shape routed out so far
G1X2.5 - This line completes the box by taking the machine back to X2.5, so the machine is now at X2.5Y3.6 basically back where we started
G1Z.5 - This line takes the Z axis back up to a "safe" spot above the workpiece at .5 inches
Ok so basically what this little program has given us is a 1/2" part that is 2.5" wide and 3.6" long - pretty simple, right?
OK I realize that the last example was really simple, but understanding those basics are crucial to understanding the other more complex parts of a CNC machine.
To sit down and write your own complex program would be difficult, and take a lot of time. So what can we do? We turn to CAD/CAM applications to help us out!
CAD is "Computer Aided Design" and in a CAD application, such as Autocad or BobCad, or a hundred other options, you will DESIGN the part you want to make using lines and arcs, circles, squares, etc... Then you would load that design into a CAM, or "Computer Aided manufacturing" program where it would look at your design and, taking into consideration your router bit size and materials, it will generate the G-Code program for you. All you have to do after that is load that program into your CNC machine and cut away!
There are many CAD applications and there are just as many CAM applications, there are even some that do both the design and g-code generation, such as Mastercam. There are also many FREE CAD/CAM applications that you can use - it all depends on your budget and what you are trying to accomplish. Some programs are geared around making simple 2 dimensional parts, some are mainly for making signs or doing engraving, and some can make full 3D G-Code programs that mill out a 3D shape - of course HOW you cut that out on your machine is another topic that we will discuss when we get to the various types of CNC machines in the next few sections.
OK so we've talked about HOW a CNC machine works with g-code and what "numerically controlled" is, but just how does the machine work - physically?
In this section I'll try to explain the various parts of a basic CNC machine, and a few of the various CNC machine types there are. There are many options for all of the various parts, and we will cover each topic, but this is just a quick overview of the parts.
The basic parts of a CNC machine are:
- Computer - The computer tells the motors how far to turn, you also need a certain software to interpret the G-Code program and send signals to the Motor Controller
- Motor Controller - The motor controller interfaces with the computer and the motors, and basically takes the small signals from the computer and turns it into bigger signals to drive the motors
- Motors - You need a motor for each axis. Most people (at least in the hobby world) use a "stepper motor" because they can be accurately tuned to turn to an exact position
- Lead Screws - Lead screws are screws attached to the motor via some coupling and when the motor turns, it turns the screw
- Lead Screw Nut - a Lead screw nut would be attached to whatever you wanted to move, say the X Axis, and when the lead screw turns it pushed the nut, essentially pushing the axis
- Linear bearings - a linear bearing, or linear motion, is what the axis' will move on, there will be a whole section on linear bearings and the various types
- Axis - Each axis serves to move the spindle or the table, when the lead screw turns ir pushes the nut that is attached to the axis, so the whole axis moves
- Spindle - the spindle is like a router, and can even be as simple as a router, that is used to actually mill the workpiece
In the next sections we will go over each item in more detail, but the list above are the basic parts that go into every CNC machine.
Computer and Software
Your computer can be nearly anything, some people use regular desktop computers, some use laptops, and some have even written programs for micro controllers (such as the Arduino) that run G-Code, Basically you need something that can convert the G-Code into "steps" to send to the motor controller.
Most people will end up using an older computer that no longer functions as a decent desktop, just about any old "hand-me-down" will do. After that you need some software that will convert and drive the machine.
There are a few options:
- Mach3 - probably the most popular because it is fairly cheap and fully featured
- EMC2 - Open source and runs on Linux - this one is also very popular because it's free
- Hobby CNC - An all in one board that you assemble, this is a great product if you don't mind soldering and want to save money in this category.
- Gecko Drive - A great and very popular choice - the Gecko boards come ready to go out of the box with no soldering or assembly required.
- There are a lot of various controllers on EBay and your mileage will vary with them
- Making your own - There are many schematics for stepper motor controllers out there - if you are handy at electronics, this may be the way to go
- Stepper Motors - Stepper motors are wound in such a way so that they can be controlled in "steps", the controller board sends a "step" to the motors and it's supposed to turn an exact degree. I say "supposed to turn" because there are cases when the motor does not turn and it stalls, and, in my experience, is the biggest problem using stepper motors. Basically, if you try to push your machine too hard or too fast it could stall and ruin your workpiece. Stepper motor systems are cheaper and easier to set up and configure in the long run, which is probably why they are the most popular among the hobbyists. Stepper motors have a speed to torque ratio that looses torque at higher speeds.
- Servo Motors - Servo motors are more like a standard motor with an encoder that feeds back information to the computer about it's position. If the controller tells the motor to turn a certain distance, it can tell the computer that it's actually gone that distance, so there is less ruining of workpieces. Servos have a more consistent torque at all speeds, but they are more expensive and the setup and controlling systems are more expensive, essentially putting them out of the price range of most hobbyists.
- Standard threaded rod and standard nuts - you can get these at your local hardware store, you can get threaded rod in various thicknesses and lengths, it's cheap and quick, but has a high potential for backlash.
- Acme Threaded Rod and Acme Nuts - Acme threaded rod has a slightly different profile than standard threaded rod, it's flatter and doesn't come to a point like it's cheaper counterpart - it's also manufactured to a slightly higher standard, which means there's generally less backlash.
- Ball screws - Ball screws are a system in where there are ball bearings in the "nut" that ride along the ball screw track - basically giving you a much less backlash system - but also more expensive and harder to set up.
- Rack and Pinion - While not a "screw and nut" technically, these are also used to drive a machine back and forth. In this set up a gear is attached to the motor shaft that turns and mates with a toothed rail.
- Belt and Chain Drives - Again, not technically a screw and nut, but another way to drive the axis of a machine. In this scenario the motor has a sprocket or timing pulley that mates with a chain or belt and drives the axis back and forth.
- Roller Bearing - There are many styles of roller bearing, from the home made skate bearings riding on aluminum angle, to V bearings riding on a steel rail
- Ball Bearing - Ball bearing linear bearings have small ball bearings in the linear bearing that ride in a groove on the rail, these are very accurate, but more expensive for the bearing and the rail
- Friction Bearings - Friction bearings are just two materials sliding together. Some are made of self lubricating materials such as Delrin or Acetal, but some are also made from steel and cast iron and need some lubricating grease to slide smoothly.