by Mike Lynch, CNC Concepts, Inc.
Download this article at http://www.cncci.com/resources/articles/CNC%20basics.htm
In order to better understand the problems involved with using your Rhino data successfully for a CNC-controlled machining or cutting type operation, you need to understand the CNC process and how it works. Hopefully, this little primer will help in this regard.
CNC – Computer Numerical Control – refers to the use of a computer to control and monitor the movements of a machine. The machine could be a milling machine, lathe, router, welder, grinder, laser or waterjet cutter, sheet metal stamping machine, robot or many other types of machines. The computer is generally an on-board dedicated controller in the case of the larger industrial machines, but could be an external PC in the case of smaller, more hobbyist types of machines or with some retrofits. The CNC controller works together with a series of motors and drive components to move the machine axes in a controlled way, executing the programmed motions. On the industrial machines there is usually a sophisticated feedback system, constantly monitoring and adjusting the speed and position of the cutter.
Desktop CNC – there are many smaller "modelmaker-hobbyist" style desktop CNC machines. In general these are lighter in weight, less rigid, less precise, slower and less expensive than their industrial counterparts, but can do well for machining objects out of softer materials such as plastics, foam and wax. Some desktop machines may be run a lot like a printer, others have their own "closed" command system and perhaps even dedicated CAM software. A few will also accept standard G-code as input. There do exist some “industrial standard” desktop machines with dedicated controllers for doing highly precise small work.
CAM – Computer Aided Machining or Manufacturing – refers to the use of various software packages to create toolpaths and NC code to run a CNC controlled machine, based on 3D computer model (CAD) data. When the two are used together, this is generally referred to as CAD/CAM.
It is important to note that CAM does not actually run the CNC machine, but just creates code for it to follow. It is also not an automatic operation that imports your CAD model and spits out the correct NC code. CAM programming, like 3D modeling, requires knowledge and experience in running the program, developing machining strategies, knowing what tools and operations to use in each situation to get the best results. While there are simple programs that allow the inexperienced user to get started without too much difficulty, for more sophisticated models it will take an investment in time and money to become proficient.
NC code – A special relatively simple computer language that a CNC machine can understand and execute. These languages were originally developed to program parts directly at the machine keyboard without the aid of a CAM program. They tell the machine what moves to execute one by one, as well as controlling other machine functions such as spindle and feed speeds, coolant, etc. The most common language is G-code or ISO code, a simple alphanumeric programming language developed for the earliest CNC machines in the 70’s.
Postprocessor - While G-code is considered pretty much “standard”, each manufacturer does have the liberty to modify certain parts such as auxiliary functions; thus creating a situation that G-code made for one machine may not necessarily work for another. There are also many machine manufacturers that have developed their own programming languages, such as Heidenhain or Mazak/Mazatrol. Therefore, to translate the CAM software’s internally calculated paths into specific NC code the CNC machine can understand, there is a “bridge” piece of software called a postprocessor. The postprocessor, once configured correctly, outputs the appropriate code for the chosen machine, so that in theory at least, any CAM system can output code for any machine. Postprocessors may be free with the CAM system or added cost extras.
CNC machines can have any number of axes of movement, and these movements can be either linear or rotary. Many machines have both types. Cutout machines like lasers or waterjets generally have just two linear axes, X and Y. Milling machines usually have at least three, X, Y, and Z, and can have additional rotary axes as well. A five axis milling machine is one that has three linear axes and two rotary, allowing the cutter to operate in a full 180º hemisphere and sometimes more. Five axis lasers exist as well. A robot arm might have more than five axes.
Depending on their age and sophistication, CNC machines can be limited as to what their control and drive systems are capable of. Most CNC controllers only understand straight line movements and circular arcs. In many machines, the arcs are restricted to the principal XYZ planes as well. Rotary axis movements can be considered like linear movements, just degrees instead of distance. In order to create arc movements or linear movements that are at an angle to the principal axes, two or more axes must "interpolate" (move precisely in a synchronized manner) together. Linear and rotary axes can also interpolate simultaneously. In the case of five axis machines, all five must be perfectly synchronized, no easy task.
The speed at which the machine controller can receive and process the incoming data, transmit commands to the drive system and monitor the machine’s speed and position is critical in all this. Older and less expensive machines are obviously less capable in this regard, much in the same way that an older computer will work less well and more slowly (if at all) on demanding tasks than a newer one.
A typical problem is how to set up your files and do your CAM programming so that the machine that will execute your parts will be able to work smoothly and efficiently with the data. Since most CNC controls only understand arcs and lines, any form that is not describable with these entities needs to be converted into (read "approximated by") something usable. Typical things that need converting are “Splines” i.e. general NURBS curves that are not arcs or lines, and 3D surfaces. Some desktop machine systems are not able to understand circular arcs either, thus everything must be converted into polylines.
Splines can be broken up into a series of line segments, a series of tangent arcs, or a combination of both. You can imagine the first option as a series of chords on your spline, touching the spline on each end and having a certain deviation in the middle. Another way to look at it is your spline is converted into a polyline. The fewer segments you use, the coarser the approximation will be, and the more “facetted” will be the result. Going finer will increase the smoothness of the approximation, but also increase the number of segments dramatically. You can imagine that a series of arcs "might" be able to approximate your spline within tolerance with fewer, longer pieces. This is the main reason for preferring arc conversion over simple polyline conversion, especially if you working with older machines. With newer ones, there is less of a problem.
Surfaces can be imagined as the same kind of spline approximation, just multiplied many times in the "across" direction with a space in between (usually called the "stepover"). In general, surfaces are done using all line segments, but there are situations where arcs or a combination of lines and arcs can also be used.
The size and number of segments will be determined by the accuracy required and the method chosen, and will directly influence the execution. Too many short segments will “choke” some older machines, and too few will make for a facetted part. The CAM system is usually where this approximation is done, and with a skilled operator who knows what the user needs and the machine can handle, it is usually no problem. However, some CAM systems may not handle splines or certain types of surfaces, hence, you might need to convert the entities in the CAD software first (Rhino) before going into CAM. The translation process from CAD to CAM (via a neutral format such as IGES, DXF, etc.) may also occasionally cause problems, depending on the quality of the import/export functions of the respective programs.
Your project can be considered:
2 Axis if all the cutting takes place in the same plane. In this case, the cutter does not have any capability of movement in the Z (vertical) plane. In general the X and Y axes can "interpolate" together simultaneously to create angled lines and circular arcs.
2.5 Axis if all the cutting takes place entirely in planes parallel to the principal plane but not necessarily at the same height or depth. In this case, the cutter can move in the Z (vertical) plane to change levels, but not simultaneously with the X,Y movements. An exception might be that the cutter can interpolate helically, that is do a circle in X.Y while moving simultaneously in Z to form a helix (for example in thread milling).
A subset of the above is that the machine can interpolate any 2 axes together simultaneously, but not 3. This does make a limited number of 3D objects possible, by cutting in the XZ or YZ planes, for example, but is much more limited than full 3 axis interpolation.
3 Axis if your cutting requires simultaneous controlled movement of the X,Y,Z axes, which is required for most free-form surfaces.
4 axis if it includes the above plus 1 rotary axis movement. There are two possibilities - 4 axis simultaneous interpolation (otherwise known as true 4th axis) or just 4th axis positioning, whereby the 4th axis can reposition the part between 3 axis operations, but does not actually move during the machining.
5 axis if it includes the above plus 2 rotary axis movements. In addition to "true 5 axis machining" (5 axes moving simultaneously while machining), you also commonly have "3 plus 2" or 3 axis machining + 2 separate axes positioning only, as well as in rarer cases "4 plus 1" or continuous 4 axis machining + a single 5th axis positioning only. Complicated, isn't it...
To be continued... --MSH 28.10.07