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

December 20, 2007

Dear Subscribers,

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

The feature article for this issue is entitled Eliminating calculations for offset entry. It builds on a technique we originally published several years ago. The idea is to have CNC operators enter measured values when sizing adjustments must be done.  They simply enter the size shown on their measuring device.

This eliminates the need for them to calculate the amount and polarity of the adjustment - and eliminates the need to determine the target dimension. It dramatically simplifies the task of making sizing adjustments and requires no changes to your current programs.  It is especially helpful for long-running jobs.

I hope you find it useful. Enjoy!

Mike Lynch

Product Corner: Two operators' Guides to help operators learn to run CNCs
Instructor Note: The most important thing a CNC operator must know
Manager's Insight:  Separating cutting and non-cutting time in a CNC cycle
G Code Primer: Restarting after a broken tap
Macro Maven: Eliminating calculations for offset entry
Parameter Preference: Activating a custom macro from a T word
Safety Note: How well do you maintain your hydraulic chucks?

Product Corner: Two Operators’ Guides to help operators learn to run CNCs

When it comes to sheer numbers, CNC operators make up the greatest percentage of CNC people.  For this reason, the position of CNC operator is the most difficult one to keep fully staffed. Most companies find it difficult to find and hire qualified people – and are training new people from scratch. These two self-study manuals can really help bring new people up to speed.

They are designed to help entry-level CNC people learn what it takes to run CNC the two most popular forms of CNC machine tools. We begin by discussing some of the basic machining practice skills a CNC operator must understand, including blueprint reading, tolerance interpretation, gauging skills, and machining operations. We then present the tasks required to setup and run a CNC machine. We place heavy emphasis on what it takes to hold size during a production run (measuring a workpiece, determining if dimensions are to size, and how to adjust when they’re not).  Learn more about how these guides can help!


Top of page

Instructor Note: The most important thing a CNC operator must know

Most companies expect a lot from their CNC operators. Common tasks include:

  • Loading and unloading workpieces

  • Activating and monitoring the CNC cycle

  • Measuring workpieces and reporting findings to an statistical process

  • control (SPC) system

  • Making adjustments required due to tool wear

  • Replacing dull tools

  • Keeping the machine and work area clean

Every one of these tasks, of course, is very important, and it could probably argued that any one of them is the most important – for without a mastery of each task, a CNC operator will not be successful.

Maybe a better question might be “Which task does an operator tend to struggle with the most – when mistakes can lead to wasted time, scrap parts, and possibly dangerous situation?” Again, several of the related tasks may come to mind. But the one we’d like to stress is Making adjustments due to tool wear.

Since turning centers incorporate many single-point cutting tools, they tend to require the most in the way of workpiece sizing. However, machining centers also require their share of sizing adjustments. In any event, a CNC operator must be able to determine whether a measured attribute is within its tolerance band. Since this is such a basic task, experience, shop people tend to take the related skills for granted – and sometimes assume that everyone (including entry level CNC operators) can do them.


The first related skill an entry level operator must master is accurately measuring workpiece attributes with the gauging tools your company uses. This can take a lot of practice, especially with variable gauges that have Vernier (or similar) scales. For this reason, more and more companies use gauges with dial or (better yet) digital displays.

Measuring accurately requires a certain “feel”. Once a person is taught how to use one of your gauges, they must practice to master it. One way to get started is to use known sizes for measuring. For example, use a set of gauge blocks to simulate workpieces.  If the operator know the thickness of a gauge block is supposed to be 0.500 inch, for example, they’ll be able to experience the feel of the gauge when it displays 0.500 inch. This is mandatory when measuring actual workpiece attributes.

Evaluating measured values

Assuming a CNC operator can accurately measure workpiece attributes, next think about what must be done in order to determine whether a given workpiece attribute is within its tolerance band. Consider a “simple” 2.0 inch turned (external) diameter machined on a turning center. How is the tolerance specified? It could be done in at least three ways:

  • With a plus/minus tolerance specification (2.000 +/- 0.002)

  • With an uneven tolerance specification (2.001 +0.001 -0.003)

  • With the high and low limits (2.002 / 1.998)

Even for this simple example, it can be difficult to get across the point that, in order for the turned diameter to be acceptable, the operator’s measured dimension must fall between 1.998 and 2.002 inches. Again, this may seem elementary to any shop person, but it will be a new concept for most non-manufacturing people. It will take practice to master.

Remember, we’ve shown a pretty simple dimension and tolerance example. Determining the high and low limits is pretty easy in our case. But consider a dimension and tolerance of 1.8324 +0.0004 -0.003. Even experienced shop people may have to think about this one for a bit before they can determine the mean value and high/low limits. A newcomer may have to use a calculator.

As you begin teaching people how to hold size on CNC machines, remember that  this is a task they must be able to perform flawlessly and consistently – based upon the dimensioning and tolerancing methods you use. You can have them practice by giving them problems like this to solve:

  • Dimension is 2.125 +/- 0.004. The workpiece attribute you measure is 2.123.  Is the measured value within the tolerance band?

The target value

Next, CNC operators must understand that when a measured workpiece attribute is not within its tolerance band (and often even when it is), an adjustment must be made. Making an adjustment first requires a person be able to determine the target value. That is, the dimension the operator is shooting for with the adjustment. Many companies have their CNC operators target the mean value of the tolerance band – and this may be just fine in the beginning.

(But remember, when you target the mean value, you’re only working with half the tolerance band – and adjustments will be required twice as often. Based upon the direction of workpiece-attribute growth caused by tool wear, many CNC operators will target a value closer to the high or low limit – whichever provides the longer period of unattended operation. This concept, however, may be a little difficult to relate to entry-level operators. The more important point is that they will have to know the target value before an adjustment can be made.)

Based upon your company’s methods, you must ensure that entry-level operators can accurately and consistently determine the target value. Again, coming up with exercises shouldn’t be too tough:

We target the mean value of all tolerance bands. Based upon the following dimensions, what is the target value?

  • 2.000 +/- 0.002

  • 2.375 +0.001, -0.003

  • 1.4378 / 1.4373

When to make an adjustment

CNC operators must know when adjustments are required. Companies vary with specifics, but the concept remains the same. Of course the operator will make an adjustment when a measured workpiece attribute is not within its tolerance band (and the current workpiece is scrap). They must know not to run any more parts until the adjustment is made (don’t assume they know this).

More commonly, CNC operators will be making adjustments as the growing or shrinking workpiece attribute draws close to a high or low limit. Explain that this growing or shrinking is caused by tool wear - and is especially common with single point tools. As tools wear, more and more material will be left on the surface/s machined by the tool. As more and more material is left on the surface, external surfaces (like turned diameters) will grow and internal surfaces (like bored holes) will shrink.

So a turned diameter that starts out at precisely 2.000 inches in diameter will grow as more and more workpieces are machined. After fifty parts, this dimension may be 2.0003 (it has grown by 0.0003 inch). After fifty more parts, it becomes 2.0007. And so on. Eventually the tool will become completely dull and will require replacement, but a lot of growth (or shrinkage) can occur before this is necessary. In most cases, and especially with tighter (smaller) tolerances, the workpiece attribute will grow or shrink out of its tolerance band long before the tool is dull.  This means several adjustments will often be necessary during a tool's life.

So, exactly when should the adjustment be made? Again companies vary with what they tell operators to do, and of course, you’ll relate your methods to your new CNC operators. Most have a ten or twenty percent rule-of-thumb. When the surface grows to within ten or twenty percent of a tolerance limit, an adjustment will be made. Better stated, when a 2.000 +/- 0.001 tolerance grows to 2.0008 or 2.0009, an adjustment will be made.

How much to adjust

CNC operators must be able to determine the amount and direction for the required adjustment. Explain that the adjustment amount is simply the difference between the measured value and the mean value. If an operator measures a turned diameter with a target dimension of 2.000 inches as 2.002, the adjustment amount will be 0.002. Again, you can easily come up with exercises for determining adjustment amount.

Polarity of adjustment

Explain that in some cases, the adjustment will be positive and in others, it will be negative. Determining polarity requires an understanding of the machine’s axes – as well as their polarity. So be prepared to explain which way is plus and which way is minus for each axis.

Fortunately, many turning center adjustments are very simple: If a turned or bored diameter is too big, the adjustment will be negative. If it is too small, the adjustment will be positive (for most turning centers). Again, be prepared to explain polarity of each kind of adjustment your operators will be making.

And again, develop exercises to confirm entry-level operators understand:

  • We target the mean value for all dimensions. Dimension is 2.000 +/-0.001. Measured value is 2.0008. What is the adjustment amount and polarity?

What must be adjusted?

In rare cases, the cutting tool itself must be adjusted. Consider, for example, a boring bar used on a machining center. A mechanical dial controls the precise diameter that the boring bar will machine. If the measured hole size is too small, the dial will be turned in one direction. If it is too big, the dial will be turned in another. And mechanical linkages precisely move the boring bar insert to make a bigger or smaller diameter.

In most cases, adjustments will be made in offsets – so be ready to explain what they are and how to access them. Explain that offsets are referenced by a number – offset one, offset two, and so on. Also explain if your offsets contain more than one value (length and diameter for a machining center for example – or X and Z for a turning center).

CNC operators must know which offset must be adjusted - and if the offset contains more than one register, which register is involved. Explain that most programmers will make the offset number correspond to the tool station number – so if the operator knows which tool machines a surface, they’ll know the offset number that contains the adjustment values.

(Even this concept is difficult to relate. It can be hard for an entry-level operator to determine which offset must be adjusted. For reason, more and more companies are including offset information in the production run documentation that goes along with the job.)

Unfortunately, practicing this can be more difficult. Take newcomers out to your currently running machines and show them how to determine which tool machines each surface and how to determine the related station numbers and offset numbers. Have them tag along with experienced operators to see it done first hand.


Top of page

Manager's Insight: Separating cutting and non-cutting time in a CNC cycle

Managers often want to know the percentage of time a machine is actually cutting something in a CNC cycle, but trying to calculate cutting versus non-cutting time can be difficult. But by running two CNC cycles (one without a workpiece) there is a relatively quick and definitely easy way to separate cutting time from non-cutting time.

First of all, let’s define cutting time and non-cutting time:

  • Cutting time is time when the machine is in a cutting mode (G01, G02, G03, etc.).

  • Non-cutting time is everything else (rapid [G00] motions, tool changes, indexes, etc.).

Admittedly, some of the time we attribute to cutting time is related to times when the machine is feeding but not cutting (feeding into and out of a cut). The amount of rapid approach distance, of course, affects how much time is taken during these motions.

First of all, run and time the cycle in the normal fashion – with the feedrate override switch at 100%. You can actually run a part during this time. For the formula that we’ll show, we’ll call this normal feedrate run time.

Second, run and time the cycle with the feedrate override switch set to 200%. You cannot, of course, run a workpiece during this cycle. We’ll call this the double feedrate run time.

With the two times available, apply these two simple formulae to determine cutting time and non-cutting time:

  • Cutting time = (normal feedrate run time minus double feedrate run time) times two

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

Here is an example. Say your normal feedrate run time is 17 minutes. The double feedrate run time is 9.5 minutes. (17 minus 9.5) times 2 is 15, meaning fifteen minutes of the cycle is cutting time and two minutes of the cycle (17-15) is non-cutting time.

This works because only the cutting motion feedrate is doubled when you turn the feedrate override switch to 200%. For this reason, the difference between the normal feedrate run time and the double feedrate run time is half the cutting time.


Top of page

G Code Primer: Restarting after breaking a tap

One of the most frustrating problems a CNC operator can have is breaking a tap in the middle of taping many holes. The broken tap, of course, must be removed from the workpiece and the hole repaired (re-tapped), but it is not often feasible or desirable to repair the hole during the CNC cycle. Most companies will leave the broken tap in the hole and will remove it and re-tap the hole by hand after the workpiece comes out of the machine.

But a major problem still exists. How do you tap the rest of the holes that were to be tapped after the tap broke? Consider, for example, having 200 holes to tap. On the 150th hole, the tap breaks. This means, of course, that there are still 50 holes to tap (after replacing the tap).

The operator must have a way to run the tap in these holes. One way is to rerun the entire tapping cycle, but this would mean re-tapping 150 holes. And if the broken tap remains in the hole, what then? Some operators will place a block delete code (slash code) in at the beginning of the command that taps the hole with the broken tap. If only a few holes must be re-tapped, this may not be too bad an idea. But if there are many holes – and especially when the possibility exists that a hole will be cross threaded if the tap reenters each hole (machines without rigid tapping are notorious for cross threading), a better way must be found.

Unfortunately, my suggestion requires a good understanding of manual programming and rerunning tools. In essence, we’re going to be modifying the program in such a way that the tapping cycle will be instated for the first hole, but the first hole will not be tapped. We’ll also ensure that the tap begins at a high enough Z location that the tap will remain over the remnant of the broken tap if it happens to go near it. Finally, we’ll need to confirm that the restart hole (where you want the tap to continue) has both an X and Y coordinate (many of the commands that specify hole locations have only one coordinate), and that the Z surfaces (Z and R) are appropriate.

Here is an example of how the program must be modified:

  • Original program:

  • (3/8-16 TAP)

  • N405 T08 M06

  • N410 G54 G90 S400 M03 T01

  • N415 G00 X2.5 Y1.0

  • N420 G43 H08 Z0.1

  • N425 M08

  • N430 G84 R0 Z-1.0 F25.0

  • N435 Y1.5

  • N440 Y2.0

  • N445 Y2.5

  • N450 Y3.0

  • N455 Y3.5 (Tap breaks here)

  • N460 Y4.0

  • N465 Y4.5

  • N470 Y5.0

  • .

  • .

  • .

  • N555 G80 M09

  • N560 G91 G28 Z0 M19

Admittedly, it’s a simple program – having just a few holes – but it should work nicely to stress the technique. Notice that it’s pretty efficient – the R plane is 0.1 and only the Y coordinates are specified.

Say the tap breaks when tapping the hole commanded by line N455. Here’s the modified program. Again, these modifications would be done “on the fly” after replacing the broken tap. And of course, the tap remains in the hole commanded by N455:

  • (3/8-16 TAP)

  • N405 T08 M06

  • N410 G54 G90 S400 M03 T01

  • N415 G00 X2.5 Y1.0

  • N420 G43 H08 Z2.0

  • N425 M08

  • N430 G84 R0 Z-1.0 F25.0 L0 G98

  • M99 P460

  • N435 Y1.5

  • N440 Y2.0

  • N445 Y2.5

  • N450 Y3.0

  • N455 Y3.5

  • N460 X2.5 Y4.0 R0.1 Z-1.0 L1 G99

  • N465 Y4.5

  • N470 Y5.0

  • .

  • .

  • .

  • N555 G80 M09

  • N560 G91 G28 Z0 M19

Once the tap is replaced and the program is modified (a good operator can modify the program in about a minute), the operator can restart the cycle. Notice that we’ve reset the initial plane in line N420 to Z2.0. This will ensure that if the tap moves over the hole with the broken tap, it will not collide with it. The tapping command in line N430 will instate the tapping cycle but the L0 will keep a hole from actually being tapped. Also, G98 ensures that the tap will retract to the initial plane (Z2.0) at this point.

The “M99 P460” tells the control to jump to line N460. Again, the operator must know which command to restart on.

In line N460, we’ve added the X (though it wasn’t necessary in this example), the R, Z, L1 (to machine a hole for each command from now on), and the G99 to reinstate the R plane as the retract position.

Once the workpiece is finished, of course, the program must be changed back to its initial state.

One last point. We’re assuming that all tapped holes are on one side of the workpiece. If you are tapping holes on several sides of a workpiece – using a rotary device of some kind – you must also confirm that the correct side of the workpiece is facing the spindle as part of the program’s modification.


Top of page

Macro Maven: Eliminating calculations for offset entries

Almost every offset entry your operators make requires some kind of calculation to be done before an offset adjustment can be made. Say, for example, the mean value for a diameter to be turned is 3.2342 and its tolerance is plus or minus 0.001. After machining with the finish turning tool, the operator finds that the diameter being turned is 3.2351.

First of all, the operator must recognize that the diameter is getting dangerously close to its high limit (calculating the high limit for this diameter results in a value of 3.2352).

Second, the operator must know the target value. While most operators are told to shoot for the mean value of the tolerance band (3.2342 in our example), this may not always be the case. When you shoot for the mean value, of course, you’re only working with half the tolerance band – all parts will be at mean or above, never below the mean. For this reason, most manufacturing people would rather shoot for a value that allows a longer period of unattended operation. In this case, it would be a value closer to the low limit – below the mean. (Again, this is a single point turning tool – the external diameter it machines will grow as the tool wears.) Getting operators to understand and buy into this concept can be difficult, and it requires more effort and skill on the operators’ part.

Third, the operator must be able to calculate the deviation. This will be the actual amount of offset change. The value of the deviation can be calculated, of course, by subtracting the measured size (3.2351 in our example) from the target value (3.2342 if shooting for the mean value). In this case, of course, the deviation value will be 0.0009.

Fourth, the operator must be able to determine the polarity of the deviation. For most dimensions, subtracting the measured value from the target value will render the appropriate deviation. For our example, subtracting 3.2451 from 3.2342 renders a negative 0.0009. But of course, this may not always be the case. For turning centers with a reversed X axis (X plus is the direction toward the spindle center), the polarity for offsetting is also reversed. In any event, many entry-level operators struggle when it comes to determining the polarity of offset adjustments.

Wouldn’t it be nice if the operator could simply enter the measured value when they want an offset adjustment to be made? In our example, this value would be 3.2451. They would still have to be able to determine when the dimension is getting close to a tolerance limit, but nothing related to the target dimension, deviation, or polarity. This would dramatically simplify the task of making sizing adjustments – and would minimize the potential for entry mistakes (they would, of course, have to enter the measured value correctly – and in the right place).

How could this be done? Well, custom macro B gives us access to all offsets. It also gives us the ability to make arithmetic calculations. And it gives us the ability to set variables. We can even make tests to determine if entries are appropriate – and generate alarms if they are not. With these tools, we should be able to come up with a way to eliminate the task of making calculations before entering sizing adjustments.

One method of approaching this problem was shown in a CNC Tech Talk column some time ago. But it is somewhat crude, requiring very good communication between the programmer and operator. It is also a bit difficult to determine which workpiece attributes are controlled by each tool. While it does simplify the task of making sizing adjustments, the technique never really caught on.

I want to show it again, however, if for no other reason than to help you understand how the technique works.

Given our previous example, the target diameter to be turned on a turning center is 3.2342 inch. We’ll say that tool station number five holds the turning tool that machines this diameter. After machining – and determining that an adjustment must be made, the operator would normally adjust tool (wear) offset number five to input any discrepancy (by 0.0009 in our previous example).
But instead, our technique will allow the operator to enter the measured value (again, 3.2351) into a secondary offset. To determine the secondary offset number, the operator will add twenty to the tool station number.

The custom macro program will check to see if there is a value in the secondary offset (other than zero). If there is, the operator has just entered the actual size of the workpiece that is deviating from its target size. In this case, the program will calculate the deviation and its polarity, and adjust the primary offset for this tool accordingly (offset number five in our case).

In the main program, you can place this command at the beginning of every tool that requires the technique (note that this command must come before the turret index command). Remember, you only need this technique for tools for which an operator will have to make sizing adjustments. This means single point finishing tools.

  • .

  • N050 G65 P8002 T5. D3.2342 S3.22 B3.245 (Check to see if offset adjustment is necessary)

  • N055 T0505 (Finish turning tool)

  • .

In our example, line N050 will call the custom macro and specify the tool station number being used (with T) and the target value for the dimension that is being measured (with D). Note that our custom macro is even going to test the operator's input data to confirm that it is within allowable limits (maybe they measured the wrong diameter or entered the value incorrectly). If it is not, an alarm will be sounded. S specifies the small limit and B specifies the big limit.

Note that these values are not the tolerance limits. They are limits for allowable entry. The S value will be something smaller than the low limit of the tolerance band – the B value will be something bigger than the high limit.

In the custom macro, T is represented by local variable #20, D by #7, B by #2, and S by #19.

Here is the custom macro program.

  • O8002 (Custom macro to calculate and set offsets)

  • IF [ #[2020 + #20] EQ 0 ] GOTO 99 (If operator has not entered a value, exit)

  • IF [ #[2020 + #20] GT #19] GOTO 5 (If offset value is greater than small limit, go to N5)


  • N5 IF [ #[2020 + #20] LT #2] GOTO 10 (If offset value is less than big limit, go to N10)

  • #3000 = 101 (DIMENSION OFFSET TOO BIG)

  • N10 #[2000 + #20] = #[2000 + #20] + [#7 - #[2020 + #20]] (Adjust primary offset)

  • #[2020 + #20] = 0 (Set secondary offset back to zero)

  • N99 M9

Admittedly, the custom macro requires further explanation. The first IF statement determines whether a measured value has been entered. If there is no value in the secondary offset register (as will normally be the case), the operator does not want to make a sizing adjustment at this time – and the control will skip the rest of this program (going to line N99). Only when a value has been placed in the secondary offset will this first IF statement be false, and the program will move on to the next command.

For Fanuc controls, system variables in the 2000 series represent wear offsets. The current value of #20 (T coming from the call statement) is five. So the result of #[2020+#20] is #2025, which is value in wear offset number twenty-five – the register in which the operator will enter the measured value if an adjustment must be made.

The next two IF statements are testing to confirm that the entered value is within appropriate limits. If it is not, an alarm will be sounded. System variable #3000 is the alarm generator. If it is executed, an alarm will sound. But of course, if the entered value is above the small limit (S) and below the big limit (B), these commands will not be executed – and the control will end up at line N10.

Line N10 performs the deviation calculation (including polarity) and modifies the primary wear offset by the amount of the deviation. Notice that there is no longer a question about the target value (D from the call statement, which is represented by #7 in the custom macro). The target value is now programmed, meaning everyone will be shooting for the same value.

Finally, the command before M99 sets the secondary offset back to zero, so the next time the custom macro is executed, it will not try to make an adjustment.

This technique simply adds to your current abilities. That is, your people can still enter sizing adjustments with wear offsets just as they have always done. Your setup people or more experienced operators may elect to do so. But entry level operators will surely find this method of offset entry easier, faster, and less error prone than your current methods.

This may be all you need, but as stated, it can be a little complicated when more than one or two tools require regular sizing adjustments. Also, there is nothing that marries the workpiece attribute to be sized to the tool station number, meaning there is still plenty of room for making mistakes. And worst of all, incorporating this technique with current programs will require a lot of program editing – the more programs you have, the more programs there will be to modify.

So let’s build on the method just shown. Consider these two programs:

  • O0200 (Setup program – this program tells the control which dimensions are involved)

  • SETVN 501 [DIM A]

  • SETVN 502 [DIM B]

  • SETVN 503 [DIM C]

  • SETVN 504 [DIM D]

  • #521 = 3 (Station related to #501)

  • #522 = 5 (Station related to #502)

  • #523 = 6 (Station related to #503)

  • #524 = 8 (Station related to #504)

  • #531 = 3.25 (Target dimension related to #501)

  • #532 = 1.875 (Target dimension related to #502)

  • #533 = 2.75 (Target dimension related to #503)

  • #534 = 1.227 (Target dimension related to #504)

  • #541 = 0.1 (Entry error tolerance amount)

  • #542 = 4 (Number of dimensions – max is ten)

  • M99


  • O9000 (Macro called by T word)

  • #101 = FIX [#149/100] (Acquire station number)

  • #102 = 1 (Counter for loop - station number)

  • (Determine if tool is related to adjustments)

  • N1 IF [#102 GT #542] GOTO 99 (Test if finished)

  • IF [#101 NE #[520+#102]] GOTO 15 (Test for active tool offset number for adjustment)

  • IF [[#[500+#102] EQ 0 ] GOTO 99 (If operator has not entered a value, exit)

  • IF [#[500+#102] GT [#[530+#102]-#541] ]GOTO 5 (If offset value is greater than small limit, go to N5)


  • N5 IF [ #[500 + #102] LT [#[530+#102]+#541]] GOTO 10 (If offset value is less than big limit, go to N10)


  • N10 #[2000 + #101] = #[2000 + #101] + [#[530+#102] - #[500 + #102]] (Adjust offset)

  • #[500 + #102] = 0 (Set entry variable back to zero)

  • GOTO 99 (Exit)

  • N15 #102 = #102 +1 (Step counter)

  • GOTO 1 (Go back to test)

  • N99 T#149 (Index turret)

  • M99

The first program (O0200) is a setup program. You’ll have a different setup program for each job – and of course, this program is created by the programmer. It must be run once before the job can be run. This program tells the machine which adjustments you will be having operators entering with the new method. The maximum (with this example) is ten total adjustments. The SETVN commands (for set variable name) will place a short message (up to eight characters) next to the related #500 series variables. The operator will now be entering the dimension values into #500 series permanent common variables – and there will be a nice message to tell them which dimensions are involved.

Variables from #521 through #530 specify the tool station related to each dimension (meaning operators won’t even have to know which tools will be machining the given dimensions).

Variable #541 specifies the allowable deviation from the target dimension for entry. If the operator enters too big or too small a value, an alarm will sound. Variable #542 specifies how many dimensions are related to the current job.

The second program (O9000) will be automatically executed whenever a T command is specified in the program. In order for this to work, you must first change a parameter. This parameter is documented in your Fanuc Operator’s Manual in the custom macro section and is described in the next article of this newsletter. Again, once this parameter is set, the control will set common variable #149 to the tool station number (T word) and then execute program O9000. Notice that at the very end of this program a T word is specified to actually index the turret.

This custom macro determines if the current tool station is one that is involved with the critical dimensions specified with #501 through #510. If not, this program does nothing but index the turret. But if the tool station is one that requires entry, it makes the appropriate adjustment. It behaves much like the program shown earlier.

While this example has its limitations (it only works for X offset adjustments – though Z adjustments could be easily added), you should be able to see how this technique can really simplify the task of making offset adjustments for holding size – especially for very long production runs.


Top of page

Parameter Preference: Activating a custom macro from a T word

This is necessary if you want to incorporate the techniques shown in the Macro Maven article of this newsletter.

With custom macro B, you have the ability to activate custom macros in several ways. A G65 command, for example, is one way. When the control executes the command:

  • N040 G65 P9000 A0.5, B3.0

it will first set the values for local variables (#1 and #2 in this case) and then execute program number O9000 (specified by the P word).

Again, this is a handy way to call a custom macro from a program, but it is not the only way. By changing certain control parameters, you can actually have a custom macro executed by a G or M code of your choosing, an S word, or a T word. We’re, of course, interested in the T word.

You must understand that there is one (and one only) program number that is used when T words are used to activate custom macros. It happens to be program number O9000. Once the parameter is changed two things will happen whenever a T word is executed. First the control will store the value of the T word (the station number for most machines) into common variable #149. Second, the control will execute program O9000.

As with all parameters, the parameter number for the T word controlling parameter varies from one Fanuc control model to another. You must reference your Fanuc Operator’s Manual in order to find the related parameter. It will be documented in the custom macro section of the book. For a 16 series control (16T or 16M), it happens to be bit 5 (sixth bit from the right) of parameter number 6001 and is labeled as TCS (for T code with custom macro, presumably). It’s normal setting is zero. If you change this bit to a one (1), the control will execute program O9000 whenever a T word is executed.

Note that, from this point, the T word by itself is no longer going to command a turret rotation or tool change. Somewhere in program O9000, another T word must be specified for this purpose. In our offset setting custom macro, it is close to the end of the custom macro.


M01Top of page

Safety Note: How well do you maintain your hydraulic chucks?

Hydraulic chucks are very common workholding devices – especially on CNC turning centers. They provide a tremendous mechanical advantage. That is, a relatively small amount of input pressure results in a huge amount of clamping pressure at the jaw.

For this reason, it can be difficult to determine with the standard chuck pressure gauge that is equipped on most turning centers to tell just how much force is being exerted on the workpiece. This is because the chuck pressure gauge measures the input pressure going to the chuck – and is not very helpful for determining accurate chucking pressure at the jaw. For this reason, many CNC users tend to crank up the chuck pressure valve just to be sure they have enough pressure, which of course, can place undue wear and tear on the chuck.

This coupled with not following the chuck manufacturer’s recommendations for grease and/or other lubrications can lead to a decrease in chucking pressure. But unfortunately, if you don’t know (accurately) how much pressure you’ve been applying to the jaw, you’ll never know when this pressure drops.

The only way to accurately know is to use a chuck pressure gage that measures pressure at the jaw. These devices are available from tooling or chuck manufacturers and should be part of every setup. Again, if you don’t know how much pressure you’re exerting, you won’t know when wear and tear on the chuck cause it to decrease.  This can lead to a very dangerous situation.


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.