CNC controllers

Having just looked at the physical CNC machine, we’ll next take a look at the unit that supplies all of the power and signals to the motors, switches, etc.

The photos below show the front and back of the control unit for my little CNC machine. Larger CNC machines have controllers inside them, as well as large custom control panels to control every aspect of the machine while it’s running. Smaller systems like this one often use a PC and a control box connected between the computer and the CNC machine. This is a fairly typical setup for DIY and even small commercial CNC machines.

 

cnc-controller-front

cnc-controller-back

Front and back of a typical small CNC controller

You may be surprised to learn that our old friend the parallel port is still alive and well in small CNC machine setups. No doubt this is due to several factors, not the least of which is the fact that it’s got an adequate number of control signals, has been commonly available on computers especially during the era when much of the PC controlled CNC software was evolving, and it’s also well coupled to the computers architecture in terms of being very responsive to commands issued by the computers CPU. Simple, reliable, effective, and still available on many desktop computer systems and/or motherboards you can still buy today. As time goes on, these will continue to disappear, but you can still get a PC with a parallel port if you look around a bit.

On this controller, and many like it, the parallel port signals are connected to the control unit by a simple cable. On the circuit board inside the control unit, these signals are connected to chips that directly control the motors. These have been developed over time to suit the needs of CNC machines, CNC software and general stepper motor control via PC.

A slightly simplified model of how the parallel port controls these stepper motors is as follows. The CNC software determines that one or more of the stepper motors needs to move a step in the desired direction in order to make the tool follow the toolpath, so it sends a short pulse to one of the parallel port pins. For each stepper motor controlled by the CNC software, a dedicated pin on the parallel port is used. There is also pin dedicated to each motor that determines which direction the motor should move. Every single step that each stepper motor makes in the parallel port type of interface has an associated pulsed signal. It may take thousands of steps just to move the motors an inch of travel. It’s a good thing computers are pretty fast! We’ll see how this is set up in the CNC control software in the next article.

Extra credit for those who notice that I replaced the spindle speed control with a toggle switch. I burned out a component on the variable speed control and replaced it with a simple on/off switch. Perhaps a story for another day :)

We’ll have a look at some CNC controller software next.


A closer look at a small CNC machine

Let’s take a look at the main elements of this little desktop CNC machine. Even though the machine is quite small, it still operates using the same principles that larger machines costing hundreds of thousands of dollars use. In fact, even the control code, commonly referred to as g-code, is nearly identical. The differences in the control code are mainly accounted for by capabilities of the machine itself. We’ll touch more on that later.

CNC machines employ the use of motors to move the tool through the toolpath needed to cut material from the stock. The stock material is essentially the block of material you cut your part from. Materials don’t have to be made of blocks though. They could be cylinders, wedges, or even parts that have been cast or molded but just need a little touching up or to have mounting holes drilled in them.

Motors used in CNC machines are generally of 2 basic types; servo motors and stepper motors. Servo motors are normally used in more expensive and accurate machines, where stepper motors are often used in less expensive machines where less speed and accuracy are needed.

stepper-motor

Stepper motor on left attached to ball screw on right

These 2 types of motors, steppers and servos, do the same basic thing though, which is to move the tool with a specific degree of speed and precision while the cutting is taking place. Servos operate in a “closed loop” system where the system has the ability to precisely monitor the positioning of the tool at any time, whereas stepper motors operate by moving in small pre-defined steps starting from a known position, normally called the machines “home” position. This is known as an open loop setup because the machine cannot measure where the tool is, it only assumes that it is where it should be. If something were to happen, such as trying to cut material too quickly, the stepper motors ability to reliably move to the next intended position can be compromised. In other words, it can “skip” over steps, which can result in something as minor as an improperly machined part or as major as damaging the machine or perhaps physical injury. Normally though it results in a damaged work piece that will have to be scrapped.

The photo below shows switches on my CNC machine known as “limit switches” because they are meant to signal to the CNC controller where the physical limits of the machines ability to move to exist. Limit switches are used to find the machines home position and also to stop the machine if it tries to go beyond the boundaries.

limit-switch

Example of a limit switch

Back to the motors. The earlier photo of one of the stepper motors on this CNC machine shows a motor on the left that’s connected to a shaft that looks like a big screw that connects to the platforms that move when the motor turns. Since the stepper motors move in very well defined increments, the number of “steps” to make one complete revolution is known for each motor. That knowledge, combined with the pitch of the screw, let’s us determine precisely how many steps per inch or per millimeter are needed. We’ll see later how this is set up in the CNC control software.

There is one more important type of motor to talk about, and that is the “spindle” motor. This is the motor that drives the tool that does all of the actual cutting. These vary widely, ranging from makeshift drill motor conversions to dremel tools, woodworking routers, roto-zips… you name it and someone has probably used it as a spindle motor. They come in such a wide variety depending on the specific need.  The one in the photo below is fairly light duty, good for machining plastics, some metals (like aluminum), engraving, making circuit boards, and other useful things. It has a fairly small amount of “slop”, so that the precision is pretty good without too much wobbling.

spindle-motor

Spindle motor

The final thing to notice in this blog entry is the work table. This is where the work is secured while the machine does it’s thing. The work may be clamped to the table directly, held in a vise, placed in a fixture or jig, etc. It must be held down very securely for safety reasons as well as to ensure the work does not move while it’s being cut. Work tables may have channels, threaded holes, of other special features that facilitate holding the work down.

work-table

Example of work table with vise secured by clamps

Next up, we’ll take a look at a CNC controller that drives this whole thing.

Getting started with CNC

After 3D printing for awhile now, I got the itch to start playing around with CNC machines. I’ve had things made by CNC shops before, and had a pretty good idea of the process, but there’s nothing quite like jumping right in and doing it yourself. In the next few blog entries, I’ll describe some of the elements of CNC operations.

CNC machines come in a wide variety of forms. Some are meant for engraving, some are meant for woodworking, and still others are designed to machine large parts made of steel and other hard materials.

One thing common among them all is that they all have at least one “axis”, or direction that the work piece or tool can move in. In fact having one axis wouldn’t do you a whole lot of good, though I suppose that a CNC drill press might be an exception.

Most CNC machines are probably of the 3 axis type. That’s about the minimum you need in order to do useful work. A common setup for a 3 axis machine is to have a table where the work is placed, and a mechanism that can move a tool over the table in the X and Y directions, while controlling the height of the tool using the Z axis. A CNC machine to cut a sign from a piece of plywood may well have a woodworking router attached to the Z axis mechanism, allowing different types of cuts to be made using different bits.

Here’s a picture of a small 3 axis CNC machine. This type of arrangement is very popular. There is a flat work table, and a “gantry” mechanism that allows the tool to be positioned precisely over the work. The tool is then raised and lowered under control of the CNC program while also moving in the X and Y directions to cut out your design from the piece of stock material.

If you’ve been 3D printing for awhile, you’ll find yourself spoiled by the ease at which 3D printing can be accomplished compared to CNC machining. With 3D printing, you add layers of material to end up with a part that might need a little cleaning up after removal from the build platform. However as you’ll see, a CNC machined part needs to be set free from the stock material. That is not always an easy task, and you’ll find yourself giving more thought to how you’ll machine each part in order to minimize the amount of time and effort needed to finish your machined part.