The Optional Stop newsletter
Home | More Issues | Contact Us
From our website:
On-Line Classes
CD-Rom Courses
CNC Books
CNC Jobs
CNC Schools
CNC Tips
Educator's Page
Tech Talk Forum
Back Issues

March 25, 2013

Dear Subscribers,

Welcome to Issue 93 of The Optional Stop.  I hope you enjoy it.  As usual, we have a range of topics that I hope you find interesting.

If you are interested in learning about CNC, be sure to check out this issue's Product Corner.  We discuss our two approaches to bring people up to speed quickly. 

For instructors, we stress the importance of including parametric programming discussions in your basic CNC classes - and even provide free support material to help you introduce this powerful programming tool. 


Mike Lynch

Product Corner: Two learning approaches to our basic CNC on-line classes
Instructor Note: Include parametric programming discussions in your basic courses
Manager's Insight: Keeping tabs on non-cutting time
G Code Primer: Programmable on/off for block delete switch
Macro Maven: Some thoughts on error trapping
Parameter Preference: Maximum feedrate parameter
Safety First: Three levels of safety

Product Corner: Two learning approaches to our basic CNC on-line classes

We’ve recently updated all of our on-line classes and moved them to a new learning platform. So far, comments from students has been very positive. Everyone likes the new media player and narrated presentations that go along with reading material for each lesson. Thanks to everyone who commented.

There has been some confusion about which basic class is best to start with. We cover the two most common types of metal cutting CNC machines, machining centers (mills) and turning centers (lathes). The first decision to make is based upon which type of machine you want to learn about. If you work in a CNC-using company, just ask a manager which type of machine they’d recommend you start with. If you don’t, or if you’re not sure which is best to begin with, I’d recommend beginning with machining centers since they tend to be a bit more popular than turning centers – and since they are easier to start with (in my opinion).

For each type of machine, we have two approaches, and the second decision must be based upon your current experience level and how far you want to go. If you have no previous shop experience, you’ll probably be starting out as a CNC operator and/or setup person, so we’d recommend starting with one of the Setup and Operation classes (again, one is available for machining center and another for turning centers). These classes begin with two lengthy lessons on basic machining practice topics, like shop safety, shop math, blueprint reading, tolerance interpretation, machining operations, and cutting tools. These topics are prerequisite to learning CNC. Then we go into what it takes to get a machine up and running and complete a production run.

You can follow each of these classes up with the programming class, but frankly speaking, most companies won’t expect you to start programming until you have extensive experience as a CNC operator and setup person.
If you do have shop experience and understand the basic machining practice topics listed above, then we recommend that you take one of the programming, setup, and operation classes (again one for machining centers and another for turning centers). In these classes we begin with G code level (manual) programming. Any time we touch on a topic that has implications about how a machine should be setup or run, we cover it during programming. So by the time we get to the setup and operation portion of the class, many topics have already been covered. This makes a cost- and time-effective way to learn CNC.

To learn more
If you have no previous shop experience:

If you understand basic machining practices:



Top of page

Instructor Note: Include parametric programming discussions in your basic courses

I’m still surprised at how many experienced CNC people I hear from that have had no exposure to parametric programming techniques. The often call or email me with problems that could be easily handled with this very helpful programming tool. I urge you to, at the very least and even in basic CNC classes, explain what parametric programming is and introduce it’s five application categories:

  • Part families
  • User created canned cycles
  • Utilities
  • Complex motions
  • Interfacing with accessory devices (like touch probes)

With this understanding, at least students will be able to recognize applications when they come across them in the future. Our website includes a (free) web page that will allow you to cover this introduction pretty quickly and includes a simple example:

If you want to cover parametric programming in greater detail, we offer curriculum materials and on-line content that can help:


Top of page

Manager's Insight: Keeping tabs on non-cutting time

Within a given program, there is an easy way to determine how much non-cutting time is in the program. Using this technique will help assess whether programs are running efficiently, and it’s relatively simple to do.
Simply run and time the program twice. Once with the feedrate override switch set to 100% (its normal position for running production) and once at 200% (not machining a workpiece, of course). With the two times available, calculating cutting time and non-cutting time is easy.

  • Cutting time = (100% feedrate run time minus 200% feedrate run time) times tw0

  • Non-cutting time = 100% feedrate run time minus cutting time (that you just calculated)

Note that cutting time is equivalent to the time the machine is in a feed mode, G01, G02, G03, etc. Machining efficiency will be poor if you have excessive approach and escape distances, of course.

While knowing the efficiency within a cycle is helpful, it may be a bit deceiving. With most CNC machines, for example, load/unload time is also non-cutting time. The machine cannot be cutting while workpieces are loaded (again, with many machines).

Additionally, if your people cannot keep up with the machines they run, possibly because you have them performing other tasks like cleaning and deburring, inspections, sizing adjustments, and secondary operations, the percentage of time a machine is cutting will drop even further.

The higher your production volumes, the more important it is to reduce non-cutting times. If you find them to be unacceptable, it should be taken as a signal that you must apply cycle time reduction techniques.



Top of page

G Code Primer: Programmable on/off for block delete switch

As you probably know, the block delete function (also called optional block skip) involves an on/off switch mounted on the control panel. With most Fanuc controlled machines, this is a physical switch – often a toggle switch – that is manually activated. In the off position, any time the machine sees a slash code (/) in the program, it will act on the words that are to the right of the slash code. If the block delete switch is off, the machine will ignore what is to the right of the slash code.

Consider this example:

  • N015 G43 H01 Z0.1 /M08

If the block delete switch is turned off, the M08 word will be acted upon and coolant will come on. If the block delete switch is turned on, the M08 word will be ignored and coolant will not be activated.

Again, with most machines block delete is controlled by a physical switch. You may come up with an application, however, in which you want to program whether the switch is on or off.

Unfortunately, if your machine has a physical switch, like a toggle switch, this may not be possible. But if the block delete switch is more “electronic”, like a lighted button, check the machine’s M code list to see if there are M codes to control the condition of the block delete switch. One M code may turn it on while another turns it off.

If you find you the machine doesn’t have the related M codes, note that you can probably handle the application with parametric programming techniques. Consider the coolant example again.

  • O0001#100 = 1 (Flag for condition. 1: coolant on, 2: coolant off)

  • .

  • .

  • .

  • (When the coolant choice must be made in the program:)

  • If [#100 EQ 1.0] GOTO 5 (Test for coolant)

  • M09 (Leave coolant on)

  • GOTO 10

  • N5 M08

  • N10…

  • .

  • .

  • .



Top of page

Macro Maven: Some thoughts on error trapping

When you develop a custom macro that will be used by others, you must give strong consideration to what will happen if they make mistakes when using it. As you know, Fanuc – and other control manufacturers – have developed a series of alarms that will catch mistakes made in G code programs. Consider doing the same with your user created custom macros.

My first suggestion is to consider input data (arguments) that people will use when entering information for your macro. If you’re having them use a G65 command, as would be the case with a user created canned cycle application, you should do one of two things with every argument. Either test it for inclusion (make sure it is set) or create a default value.

Testing for inclusion:

Use vacancy (#0) to test whether an argument is included in the G65 call statement. For example, if X represents the X center of a bolt hole pattern, test #24 (the local variable representation for X) against #0. If #24 is vacant, generate an alarm, like this:

  • IF [#24 NE #0] GOTO 5

  • #3000 = 100 (X IS MISSING IN CALL)

  • N5…

  • .

  • .

  • .

Setting a default value

Maybe C represents whether coolant comes on (C1.0: on, C0.0: off). With this kind of argument, it may be better to set a default value. Maybe your company uses coolant most of the time, but you want your custom macro to handle the possibility that coolant is not being used for a given job.

Note that vacancy is not zero. If C is left out of the call statement, #3 will have no value (again, it is vacant). So if C is left out of the call statement (or set to anything other than zero), you can have your custom macro turn coolant on. If C0.0 is explicitly specified in the call statement, then have your custom macro turn coolant off, like this:

  • IF [#3 EQ 0.0] GOTO 10

  • M08

  • GOTO 12

  • N10 M09

  • N12…

  • .

  • .

  • .

If you have your custom macro consider every argument in the call statement in one of these two ways, you can rest assured that once the function of the macro is begun, the custom macro will have appropriate settings for all input data.

Other potential mistakes

There may be countless things that people can do wrong when using your custom macro, and it may be impossible to catch every potential mistake. But you should at least try to incorporate error trapping for those mistakes people may be most prone to making. And of course, if someone eventually does make a mistake that is not being error trapped, you should modify your custom macro accordingly. Here are a few suggestions:

More about input data

In addition to setting defaults and checking for inclusion, there may be things you know a person could confuse about the input data you have them enter. You may, for example, expect a hole depth to be specified but the person using your custom macro may instead plug in an absolute position along the Z axis instead. Or you may know that a given input variable shouldn’t be over a given amount. Maybe you are having them enter the diameter of an end mill and you know that for the application handled by your custom macro, the end mill can’t be smaller than 0.5 in or larger than 1.5 in. Or maybe your custom macro necks a groove, and your user must enter the tool width and groove width. The necking tool width must, of course, be less than or equal to the groove width. Error trapping for potential mistakes in these regards would be relatively easy.

What else could go wrong?

Given your additional ability to access axis position, certain control panel switches, and offset registers from within a custom macro, you should be able to error trap just about anything else that could go wrong. Did the setup person enter a tool length and/or cutter radius compensation value into the appropriate offset? Is it an acceptable value? Is the position of the machine appropriate to perform the desired function of the custom macro? If it’s critical, will the machine be feeding at 100% during the machining operation (as is required when tapping)?

Again, there are lots of things you can do to ensure that your custom macro will behave appropriately, generating alarms if a mistake is detected that will cause it not to.




Top of page

Parameter Preference: Maximum feedrate parameter

Most machine tool builders publish the rapid rate for the machines they sell. This value is highly touted, since minimizing air cutting time is very important to CNC users.

But maximum feedrate is not nearly as well published. Indeed, it can be quite difficult to determine, and may even require a call or email to your machine tool builder.

Generally speaking, most machine tool builders make the maximum feedrate for a given machine about half it’s rapid rate (but again, this is just a rule of thumb).

One time maximum feedrate will be of importance is when threading. Feedrate must, of course, be synchronized with spindle speed. With free machining and/or small diameter threads, spindle speed in RPM will be quite high. Combine this with a coarse thread, like one start of a multiple start thread, and you better confirm up front that the turning center can feed fast enough to provide the desired thread lead (or pitch).

Note that most machines will not generate an alarm if maximum feedrate is not sufficient. The machine will simply feed as fast as it can and not machine the appropriate lead. This will result, of course, in a scrap workpiece – and a very confused setup person or operator or programmer. Since no alarm is generated, no one will know why the thread isn’t being machined properly.

As with countless machine functions, a parameter controls how fast (in inches or millimeters per minute) the machine can feed in a cutting motion (like G01, G01, or G03). You can find out which parameter controls maximum feedrate in the Fanuc Operator’s Manual in the section related to cutting commands. While you shouldn’t change this parameter without contacting the machine tool builder to determine if there will be any undesirable surprises, at least you’ll be able to determine just how fast the machine can feed.


M01Top of page

Safety First: Three levels of safety

Ensuring a safe working environment involves, in my opinion, three general areas. They are closely related.
First and foremost is personnel safety. You don’t want to adopt practices that will place your people in dangerous situations. When it comes to CNC machine usage, of course, we’re talking about your CNC people (tool setters, gatherers, operators, setup people, programmers, etc.). And again, this should be your first priority – and most companies concentrate on ensuring the safety of their people. Unfortunately, this may be as far as they go.

The second level of safety is machine safety. As with personnel safety, you don’t want to adopt practices that will place your machine tools in dangerous situations. Think of problems, usually mishaps, that can keep your machines from running. Operator mistakes that cause crashes, lack of attention to preventive maintenance, and poor processes may be the three most common causes of unpredictable machine down time (corrective maintenance).

The third level of safety is workpiece safety. You want to make good parts. Think of things that have caused scrap workpieces (operator mistakes, poor processes, variations in raw material, etc.).

These three areas are closely related. An operator mistake that causes a crashed machine may place the operator in danger, damage the machine, and scrap the current workpiece. A poor process, if sufficiently poor enough, could do the same.

As stated, most companies place a high emphasis on personnel safety. But often machine and workpiece safety are overlooked. Or they are not even considered in safety discussions. When you consider the three areas together, you enhance your potential for creating a safer working environment, because when you improve one area, the other two will generally improve as well.

For example, improving a process to make it easier to hold size (possibly with better cutting or workholding tools) will obviously minimize scrap, improving workpiece safety. But when the machine is easier to run, there is less chance of operator mistakes which can lead to damaged machines and injured people as well.



Top of page

Sofware ad
Machining center training materials
Parametric programming ad

The Optional Stop newsletter is published quarterly by CNC Concepts, Inc. and is distributed free of charge to people subscribing to our (email) distribution list and to those downloading it from our website ( Information is aimed at CNC users and instructors teaching live CNC classes. All techniques given in this newsletter are intended to help CNC people. However, CNC Concepts, Inc. can accept no responsibility for the use or misuse of the techniques given.

To subscribe: Simply email us ( and let us know you'd like to be added to our distribution list.

To unsubscribe: Respond to this email, typing REMOVE in the subject. Please accept our apologies if we have disturbed you.