CNC machines are like stubborn teenagers, they have to be told everything and they never remember so you have to tell them again. Well, canned cycles are like little to-do lists for CNC controls that remind them what to do so you don’t have to reprogram every detail every time. Using canned cycles saves a lot of time and effort when programming a CNC machine.
As useful as canned cycles are, many CAD/CAM programmers refuse to use them. The reason for this varies and is beyond the scope of this article, but if you are running a machine programmed by someone else using CAD/CAM software, don’t be surprised if you rarely see canned cycles.
Interestingly, canned cycles were not developed to assist programmers. They were originally developed to save memory. Early CNC machines had very limited and very expensive memory and canned cycles provided a very efficient way to do complex repetitive actions with the least amount of memory.
Code: G81 (brief example used in this article, others to be discussed in future article)
ANSI Std: YES
Requirements: X, Y, location to drill, Z depth, Feed Rate
Options: R (rapid return plane, Feed rate, G98 / G99 Rapid plane selection, G17/G18/G19
Conflicting G Codes G00, G02, G03, G04, G80 Any other G code in Groups 00, 01 or 09
The Power Of Canned Cycles
A powerful and common option available on most CNC machines is the ability to perform canned cycles. Canned cycles give the programmer the option to do some routine functions with a simple G-code instead of writing many lines of information.
For example, if the programmer wanted to drill a hole 3″ deep and clear the chip every .300. Without using a canned cycle drill, there would be more than 20 or 30 lines of program information per hole. With a canned drill cycle, the programmer need only specify the correct G-code for the operation to be performed, add a couple of variables, then call out coordinate points for the holes. The machine will drill the desired hole at every program point.
Canned cycles are very flexible. Any of the variables/parameters that follow the original G-code can be changed at any time. If you have ten holes to drill all at different depths, feedrates or conditions you can change the data at any time in the canned cycle.
Just One Example, the G81
The G81 canned cycle for mills and routers is a very simple drilling cycle and has just a couple variables that need to be set. G81 commands the machine to drill a hole at every subsequent X/Y location, to a depth (Z), rapid traverse to a point R), and feed to depth at the feedrate (F).
G81 Sample Code:
G81X3.Y1.5Z-2.R.1F3 (Drill at X3. Y1.5 Return to .1 Above the R Plane, At 3.0 IPM)
X2.Y1.5 (move to X2.Y1.5, drill another hole)
X1.Y7. F5 (move to X1.Y7., drill another hole at higher feed rate of 5.0 IPM)
There are many canned cycles available for both lathes and mills. A complete discussion of the cycles and how to use them will be the subject of future articles.
When using canned cycles, it is necessary to cancel the canned cycle when you no longer need to use it. If you fail to cancel the canned cycle, the program will continue to perform the cycle when you make the next positioning move.
G80 is the code for canceling canned cycles.
When should you use a G81?
The G81 is best used when you want to drill a hole in one pass with no pecking to remove chips. It is also very useful for plunge milling, particularly if you want to plunge mill to remove a lot of stock quickly prior to rough and finish countour milling.
While just one example of G81 drilling was shown here, there are dozens of time saving canned cycles used for drilling, taping, boring, counter boring etc. on milling machines and routers. Lathes have their own set of canned cycles that make possible to very quickly rough and finish turn, thread, bore and contour parts.
Canned cycles are tremendous time savers when manual programming and when you need to edit the program at the machine.
Watch for future articles discussing the various mill and lathe canned cycles.
For a complete introduction to the fundamentals of CNC programming, take a look at 7 Easy Steps to CNC Programming . . . A Beginner’s Guide or 7 Easy Steps to CNC Programming . . . A Beginner’s Guide, the Ebook