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

March 21, 2008

Dear Subscribers,

Welcome to issue seventy-five of The Optional Stop newsletter. We appreciate your continued interest and hope you find this information to be helpful.

We've included a variety of articles in this issue.  There should be something of interest to everyone.

We've recently introduced a new product called Fixture Offset Calculator.  We feel that it is a must-have for any horizontal machining center user.  This is the subject of the Product Corner segment.

Also, we have reduced pricing for one of our most popular software products, NCPlot, for the month of April.  If you've been thinking about purchasing NCPlot, now is the time to buy!  Details are also in the Product Corner segment.

I hope you find this information useful.  Enjoy!

Mike Lynch

Product Corner: Fixture Offset Calculator - and price reduction for NCPlot
Instructor Note: Explaining tool length compensation
Manager's Insight:  Do you provide production run documentation?
G Code Primer: Programming with appropriate structure
Macro Maven: The SETVN command
Parameter Preference: Protecting #500 series permanent common variables
Safety Note: How machine maintenance affects safety

Product Corner: Fixture Offset Calculator

Horizontal machining center users! Here’s a product you’ve got to learn more about!

Most horizontal machining centers incorporate a rotary device (indexer or rotary axis) into the machine’s table. This provides the ability to rotate the workpiece being machined. The primary advantage of this rotary action is, of course, that different workpiece surfaces can be exposed to the spindle for machining.

Once horizontal machining centers are up and running production, they are very efficient. For multiple surface machining applications, they much more efficient than vertical machining centers that require a separate setup for each surface to be machined.

However, setting up a horizontal machining center is often more difficult and time-consuming than setting up a vertical machining center – and for the very same reason: multiple workpiece surfaces can be exposed to the spindle for machining.

One tedious and time-consuming setup related task has to do with program zero assignment. Traditionally, the programmer will choose the program zero location in a way that simplifies programming. This makes coming up with coordinates needed in the program quite logical and easy. But what simplifies things for the programmer often complicates things for the setup person.

During workpiece rotation, for instance, the location of the program zero point will change. That is, a program zero assignment that is correct for one surface will not be appropriate for another (after rotation). For this reason, a programmer will often use a different fixture offset for each surface to be machined. This means, of course, that before the job can be run, the (three) values for each fixture offset must be determined and entered. Depending upon how these values are determined, program zero assignment at the machine during setup can be a tedious, time-consuming, and error-prone task.

Fixture Offset Calculator will dramatically simplify this task. It allows the values for all fixture offsets to be calculated, possibly during programming, and before the job even hits the machine. There is a lengthy article that describes the reasoning behind this method on our website, so we won’t repeat it here. To see the article, click the link below:

Programming a Horizontal Machining Center from a Central Origin

Fixture Offset Calculator is an Microsoft Excel spreadsheet that can help you significantly reduce setup time for horizontal machining centers. And priced at just $199.00, it will likely pay for itself within the first few times you use it! To learn more, click the link below:

Fixture Offset Calculator description page

NCPlot Special April pricing!

NCPlot is a very helpful tool path plotting system for G code programs and custom macros. It also converts .dxf files to G code, creates G code from text, and much more.

Our supplier for this product has announce reduced pricing for the month of April, 2008. Special pricing will be as follows:

Single license price

  • Regular price: $299.00 (by download)

  • April price: $199.00

Additional license price

  • Regular price; $149.00

  • April price: $99.00

Student license price

  • Regular price: $99.00

  • April price: $69.00

Learn more about NCPlot and purchase here:


Top of page

Instructor Note: Explaining tool length compensation

As you know, tool length compensation is a very important CNC function that is used for every tool in a machining center program. It’s mandatory that CNC students understand it. What they must understand, of course, depends upon the students eventual job responsibilities (programmer, setup person, or operator). In this article, I’ll be describing one way to explain tool length compensation – a way that has worked well for me over the years.

I begin by describing compensation in general – and these concepts can be applied to any kind of compensation. I relate CNC-related compensation to compensation in everyday life – that with any kind of compensation we’re allowing for some unpredictable or changing variable. I present a marksman analogy (the subject of a previous Instructor Note), explaining that before firing a shot, the marksman must adjust the sight on the rifle to compensate for the distance to the target. So the unpredictable or changing variable is the distance to the target.

They make the sight adjustment by first estimating the distance to the target. But this initial adjustment may not be perfect. Once a shot is fired, they may determine that the sight adjustment is not perfect (the bullet did not strike the target center). Possibly they misjudged the distance to the target. Or possibly some other variable (like wind) has affected the quality of their adjustment. In any case, another sight adjustment is required – and the second shot will be much closer to the target center than the first shot.

Point out that with tool length compensation, the unpredictable or changing variable is the length of each cutting tool. Explain that tool length compensation allows the programmer to ignore the exact length of each tool as a program is written. A command in the program (G43) tells the machine to find the length of the cutting tool in a tool offset, and that an H word specifies the offset number. The tool length compensation instating command is included in each tool’s first Z axis approach to the workpiece.

During setup, someone (setup person or tool setter) will measure the length of each tool. With my recommended method, the tool length value is the distance from the tool tip to the spindle nose, and will be specified in the offset as a positive value. The tool length value can be measured at the machine or off line using some kind of tool length measuring device.

But point out that while the person will do their best to perfectly measure each tool’s length, the actual tool length could be (slightly) different that the actual tool length. That is, mistakes could be made during this measurement. This means that when the cutting tool machine’s Z surfaces, the location of these surfaces may not be perfect. As with the marksman analogy, a second adjustment may be necessary.

How much to adjust?

These questions tend to be the most difficult for newcomers to answer. Be ready to spend some time here. When it comes to the amount of adjustment (how much), students must know the target value for the Z surface being machined. That is, they must know what they’re shooting for. In many companies, the target value is the mean value of the tolerance band. So for a 0.500 +/- 0.002 dimension, the target value will be 0.500.

The adjustment amount will be the difference between the measured value (what they’ve machined on the part) and the target value. For the 0.500 target dimension, if they measure the value to be 0.497, the adjustment amount will be 0.003.

This is a pretty important point. All setup people and operators must be able to make sizing adjustments – during setups and during production runs. One misconception I commonly find is that some students don’t understand what they’re shooting for. In the scenario above (a dimension and tolerance of 0.500 +/- 0.002 and a measured value of 0.497), they will make an adjustment of only 0.001 or so. This may bring the dimension back to size (barely), but it will still be dangerously close to an out-of-tolerance condition. Be sure your students know that whenever an adjustment is made, it must bring the dimension back to its target value.

Be sure students understand that the target value may not be the mean value of the tolerance band (some companies have their people shoot for a value that will allow a longer period of unattended operation between adjustments – allowing tools to wear for a longer period of time. For an external surface, for example, they may shoot for a value closer to the low limit. As the tool wears, the surface will grow. If shooting for the mean value, more adjustments will be require than if shooting for a value that is closer to the low limit.

Admittedly, this may be a tough concept for entry-level CNC people to understand – and at first, you may want to stick with using the mean value as the target value. But as your class goes on, and as you review this topic, you may want to provide a more complete explanation of target values.

Which way to adjust

Explain that all sizing adjustments have a polarity – plus or minus. You can give a pretty simple rule-of-thumb for adjustment polarity on machining centers. It will apply not only to tool length compensation sizing adjustments but also to cutter radius compensation adjustments as well.

When more material needs to be machined, the adjustment polarity will be negative.

This means that when a tool must go deeper (in Z) – say into a pocket – the adjustment will be negative. If a tool is already going too deep, the adjustment will be positive. This is a pretty easy rule-of-thumb to remember.

While the rule-of-thumb is nice, you may want to give your students a better understanding. Point out that the value that is in the tool length compensation offset is the tool’s length – again, the distance from the tool tip to the spindle nose. This, of course, is the value that is going to be modified when a sizing adjustment is made. Ask students what they think would happen if they forget to enter a tool length compensation value for a given tool (and the value in the offset is zero). What would the machine think? And what would happen?

The machine would think the tool had a length of zero. It would think the nose of the spindle is the tool’s cutting edge.

If the program were allowed to run, the machine would bring the spindle nose down to each Z work surface (causing a crash, if left unchecked). This should make it abundantly clear that when the value in the offset is zero, the tool would cut much deeper that desired – and should help students remember the polarity for making sizing adjustments.

What about tight tolerances?

Explain that during setup, setup people will strive to adjust all cutting tools in such a way that every surface being machined is at its target value when the production run begins. This means that even when a cutting tool machines a surface within its tolerance band, an adjustment will still be made to bring the dimension to its target. Again, this will allow for a long period of unattended operation for the tool during the production run.

But make sure that students understand that some dimensions have very tight (small) tolerances. And when tolerances are tight, there will be no way to know whether the initial tool length compensation offset entry will cause the surface to be machined within its tolerance band. So tolerances have a lot to do with what CNC setup people must do when running a cutting tool for the first time.
Consider a drill that machines a through-hole. There’s nothing critical at all. All that matters is that the hole will break through. In this case, the setup person will likely allow the tool to run without concern for whether or not the tool will machine Z surfaces properly.

On the other hand consider a 0.500 inch deep pocket having a +/- 0.0005 tolerance. The setup person cannot be sure in this case that the initial entry for the tool length compensation offset value is accurate enough to machine the pocket within its tolerance band on its first attempt. The pocket could be machined too shallow or too deep.

I like to quiz students at this point about whether the workpiece is salvageable in each case. This gives me a way to introduce trial machining. I ask students if there would be any way to easily salvage the workpiece if the pocket is too shallow. Most students will quickly answer that, yes – reducing the offset value will easily allow the pocket to be machined deeper. But what if the pocket were machined too deep? Most students understand that the workpiece would be scrap in this case. (Admittedly, there are exceptions, but this works nicely to get the point across).

I quiz them further. Knowing this, would there be any way when machining tight tolerances to ensure that the workpiece won’t be scrapped the first time a tool cuts? Most students get it right away – answering that yes, if the offset is increased before the tool machines for the first time, additional stock will be left on Z surfaces machined by the tool. Now they get the concept of trial machining.

Point out that whenever a setup person is worried about whether or not the cutting tool will machine a surface within its tolerance band on its first try, they will have the tool trial machine. They will increase the offset slightly (0.010 is usually a good value to use), let the tool machine, and then measure what the tool has done. The Z surface, of course will have some excess stock. Measuring the surface will tell the setup person exactly how much more stock must be machined. They’ll adjust the offset accordingly and rerun the tool. This time the surface will surely be within its tolerance band – if not precisely at the target value.

Though setup people vary, most would agree that a tolerance under about 0.002 (overall) for Z surfaces would be worrisome – and they would likely use trial machining techniques.

There are quite a few important concepts students must understand about tool length compensation. And it’s unlikely that newcomers will understand them the very first time you present them. This is a very important topic that must be reviewed often – until students thoroughly understand the concepts.


Top of page

Manager's Insight: Do you provide production run documentation?

Most companies have developed setup documentation to help setup people get CNC machines ready to run production. Information about the work holding setup, cutting tools, program zero assignment, and program location are included to simplify the task of setup and make it possible to gather needed components prior to the time when the machine goes down.

While it is not unusual for companies to go to great lengths to document setup-related tasks, it is also not unusual for companies to minimize what they do to help operators complete production runs.

In some companies, production run documentation may not be necessary. If the person that sets up the machine is also the person that completes the production run (one person sets up and runs production), this person will learn enough during setup to complete the production run without needing much more help.

But in companies that have one person set up a CNC machine and another run out the job (the CNC operator), at least as much effort should go into developing production run documentation as goes into developing setup documentation. Simply consider the skill levels for the people involved. Generally speaking, a CNC operator does not possess the skill of a CNC setup person – and will need more help to understand their responsibilities.

I’m always amazed by how little help CNC operators are given. Many companies expect the setup person to relate the important points about running a job to the CNC operator as the production run begins. But this “blow through” often leaves many questions unanswered – and can lead to wasted time during the production run while the operator tries to figure things out. And consider a company that has two or more shifts. Who explains the job to the second or third shift operator?

Obvious production run- related things that should be documented include part loading procedures (especially when something special is required during loading), tool life expectancies (for dull tool replacing), target values for all dimensions (not just critical dimensions), offset relationships to cutting tools, and instructions for any other tasks operators are expected to perform during the production run (deburring, SPC reporting, secondary operations, etc.).

Many companies consider many of the related tasks to be “self-explanatory” to experienced operators, which is probably the reason why production run documentation is not provided. But without it, there will likely be times when machines sit idle waiting for the CNC operator to figure something out.

One classic example has to do with sizing adjustments. Even the setup sheet will not make it clear as to which tool machines a given surface. Said another way, there is no documentation that specifies which offset is controlling each machined surface on the workpiece. The setup person simply knows that the offset number for each tool corresponds to the tool station number. If tool number five machines a given surface, offset number four will be used to make sizing adjustments for the surface.

Again, the setup person becomes pretty intimate with the job as they make the setup. They eventually figure out which tool machines each surface. But when the job is turned over to an operator, it can be very difficult for the operator to know how to make sizing adjustments.

Simple documentation can solve this problem. A marked up print can be prepared to describe the offset number that controls each machined surface. A color code can be easily developed – each color representing a different offset number. This will make it immediately clear to the operator when an adjustment must be made.

Watch your CNC operators during production runs. Not just for the length of time it takes them to complete a cycle or two, but for enough time to see what they really do during all facets of the production run. It’s likely you’ll find many examples of times when the machine sits idle, waiting for them to figure something out – something that could have been easily clarified with production run documentation.


Top of page

G Code Primer: Programming with the appropriate structure

In past issues of The Optional Stop, we’ve stressed the importance of maintaining a good structure in your programs. The primary reason has to do with gaining the ability to rerun cutting tools.

All machining centers and turning centers can handle multiple cutting tools. Tool change commands in the program, of course, cause the tool changes during the CNC cycle. Almost all machining centers and stationary-headstock turning centers (not Swiss type machines) allow the ability to rerun tools. This is often necessary during setup when verifying programs and during production runs when trial machining after dull tool replacement.

In order to be able to rerun tools, the program must be appropriately formatted. Certain CNC words must be repeated at the beginning of each tool even though their inclusion may be considered to be a bit redundant. Consider, for example the spindle start word (M03) on a CNC turning center. During a tool change (turret index), it is not necessary to stop the spindle. Doing so would be a waste of time. But in order to gain the ability to rerun tools on a turning center, the spindle start command must be included at the beginning of each tool.

This is but one example of the many “redundant” CNC words that must be restated at the beginning of each tool.

Appropriate program structure goes beyond simply having the ability to rerun tools. There are several things a programmer can do in the program to streamline the way CNC programs are used on the shop floor.


Almost all CNC control provide the ability to include messages in the program. Many use parentheses () in which messages can be included. At the very least, messages should be included at the beginning of the program to specify what the program is used for. Part number, revision number, programmer’s name, date of last revision, and program run time are among the things we recommend documenting in this manner.

It is also wise to include a documenting message at the beginning of each tool, naming the tool and specifying anything special or unusual about how the tool runs.

If a program stop (M00) is included in a program for any reason, a message should explain why the machine has been stopped and what the operator is supposed to do.

While it’s possible to get a little carried away with messages, and messages do take up memory space in the machine, most programmers could stand to include more clarification messages in their programs.

Trial machining

If a setup person can recognize the need for trial machining (a workpiece surface having a tight tolerance), so should the programmer. And knowing certain workpiece attributes require trial machining, a programmer can include special commands in the program to simplify the process for the setup person and operator. Trial machining incorporates the use of block delete – the slash code (/) – and has been the topic of several past articles in The Optional Stop newsletter. We won’t repeat them here. To learn more visit our website’s CNC Tips page.

Program mean values

This should go without saying. If all coordinates in all programs are specified as mean values of their tolerance bands, a setup person can go from one job to the next without having to modify offsets (or trial machine) for cutting tools that remain in the machine from a previous job.

Never make sizing adjustments with program changes

Doing so breaks the rule just given (program mean values). As soon as your setup people or operators start making program changes to deal with a sizing problem, they will no longer have the ability to go from one job to the next without considering offsets for every tool in the job.

There is always a way to handle sizing problems – even the most difficult ones – with offsets. And again, this has been the topic of previous articles in The Optional Stop newsletter and our CNC tips page.


Top of page

Macro Maven: The SETVN command

In custom macro B, SETVN stands for Set Variable Name. It allows you to place a short message – up to eight characters long – next to some of the permanent common variable (#500 series variables). Doing so allows you to document the use of some of the permanent common variables. So when the control’s display screen is set to show the permanent common variables page, messages will display next to the permanent common variables.

Note that controls vary when it comes to how many permanent common variables you can document in this fashion. With many controls you are limited to the first ten (#500 through #509). Other controls allow you to document the first fifty (#500 through #549), assuming the control has this many permanent common variables. You must reference the custom macro section of the Operators Manual in order to determine how many variables you can document with SETVN.

The format for the SETVN command is:


The number next to the SETVN word is the variable number being set. The message in brackets will be displayed next to the #500 series variable. The message must be in upper case characters (capital letters).

With the previous example, the message STYLUS D will appear next to (to the left of) permanent common variable #500.

If you have an application that uses permanent common variables, it’s not a bad idea to document them. This will let everyone know which permanent common variables to avoid using in new custom macro programs and will explain the meaning of each. For example, maybe you have set three two system constants – one for rapid approach distance (using #500), one for the M code number corresponding to low spindle range (using #501), and one for the M code number corresponding to high spindle range (using #502).

This program will nicely document the three permanent common variables:

  • O0001


  • SETVN 501 [LOW RNG]

  • SETVN 502 [HIGH RNG]

  • M30

Once this program is executed, the messages will appear next to the three permanent common variables.

You may be wondering how to remove the message next. Simply specify a SETVN command with eight spaces in the brackets. This program will remove the messages from permanent common variables #500 through #509:

  • O0002

  • #101 = 500 (Counter)

  • N1 IF [#101 GT 509] GOTO 99 (Test if finished)

  • SETVN #[#101] [ ] (Eight spaces in the brackets)

  • #101 = #101 +1 (Step counter)

  • GOTO 1 (Go back to the test)

  • N99 M99 (End of program)


Top of page

Parameter Preference: Protecting #500 series permanent common variables

Many applications for custom macro B require the use of permanent common variables. These variables range in the #500 series and, of course, will not be lost when the machine’s power is turned off. So permanent common variables will remain until they are changed – much like tool offsets.

In some cases, the values of permanent common variables will seldom or never change. For example, probe manufacturers commonly use a series of permanent common variables to represent the calibration values for the probe.

Variables from #501 to #512, for example, may be used to represent overshoot-and-droop values and the probe’s stylus diameter. These variables, of course, are extremely important for probing. If they are mistakenly overwritten – possibly when someone unwittingly uses them in their own application, the results for probing will be disastrous.

A group of permanent common variables can be protected, much like programs in the O9000 series can be protected. If, after protecting some permanent common variables, someone tries to change one, an alarm will be sounded. This ensures that unchanging permanent common variables remain intact.

You must reference you Fanuc Operators manual to find the related parameters. It should be documented in the custom macro B section, near the description of permanent common variables. One parameter represents the value of the first permanent common variable to protect (setting this parameter to 500 will protect from #500). The other parameter specifies the value of the last permanent common variable to protect (setting this parameter to 512 will protect through #512). The value of the first parameter must, of course be less than or equal to the value of the second.


M01Top of page

Safety Note: How machine maintenance affects safety

The primary reason companies perform preventive maintenance on their production equipment is to minimize, if not eliminate, unpredicted downtime. If a potential problem is corrected before it causes a component on the machine to fail, of course, the component will not fail. Most manufacturing people would agree that if you’re doing your preventive maintenance properly, your machines should never go down for corrective maintenance – at least not due to a component failure.

There is a second, safety-related benefit to properly maintaining your machines. Well maintained machines are safe machines to run. Keeping machines properly maintained provides a safe environment for your setup people and operators.

An obvious comparison can be made to operating an automobile. Think of all the components in a car that are related to safety. You wouldn’t drive a car if you suspected problems with the brakes, would you? Yet I’ve seen companies that allow machines to continue running even with safety-related maintenance issues. Here are a few examples:

Failed indicator lights – Most CNC machines have several indicator lights. Many are related to the control panel buttons and switches. When a button is pressed, a light comes on (or goes off) to indicate the condition of the function that the button is used to activate. If the light is burnt out, of course, the operator won’t be able to tell whether or not the function is activated.

Failed (or disabled) safety interfaces – Almost all CNC machines have built in safety interfaces to ensure that the machine will not run when something is wrong. The most common is the door interlock. The machine will not run when the door is open. I’ve seen companies that disengage this interlock – sometimes temporarily – so the setup person can see inside the machine’s work area more clearly. This places operators in a dangerous situation if the door interlock isn’t engaged once the setup is completed.

Running with known problems – Many companies continue using machines even when they know something is wrong. The intention is to eventually fix the problem, but the current job is very hot so they feel the machine cannot be stopped – or the needed component isn’t available yet. This may be acceptable if there are no safety-related issues, and if there is no possibility of further damaging the machine. But I’ve seen very questionable decisions in this regard. In one company I know of, the tool changer mechanism was intermittently dropping tools from its magazine. A person was actually assigned to stand under the magazine to try to catch falling tools in a padded box – a very dangerous assignment indeed.

Failure to perform preventive maintenance – If any needed preventive maintenance task isn’t done, something on the machine will eventually fail. Consider the safety-related implications of random failing components. People will be in a constant state of danger. Again, compare this to driving a car. If you never perform maintenance on the car (fluids, filters, tires, brakes, etc.), something will eventually fail. Would you want to be the one driving the car when it does? While you’d never consider treating a car in this manner, I’m amazed at how many companies have a “run it ‘till it breaks” attitude about their CNC machines.


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.