# Eliminating Calculations For Offset Entries

Almost every offset entry requires some kind of calculation to be made before the offset value can be entered. Say, for example, the target diameter for a turning tool is 3.

#### Share

Almost every offset entry requires some kind of calculation to be made before the offset value can be entered. Say, for example, the target diameter for a turning tool is 3.2342 inches and its tolerance is plus or minus 0.002 inch. After machining with the finish turning tool, the operator finds that the diameter being turned is 3.2351 inches. Though the workpiece is still within its tolerance band, the operator will eventually want to adjust the offset to bring the workpiece on size. In order to do so, the operator must subtract the target dimension from the actual dimension (3.2351 minus 3.2342) to come up with the amount of offset change (0.0009).

Though our example just involves subtraction, even simple calculations do take time and open the door to making mistakes. And offset adjustments of this nature are made countless times during a production run, especially on finishing tools. So eliminating the need to manually calculate offset adjustments can be a real enhancement to a turning process.

Any time you see your operators using a calculator before they enter an offset value, that is a signal that you can do something to help them and minimize offset setting time.

Most versions of parametric programming allow you to access your offsets from within your program. Also, you can make calculations to determine the value by which an offset must be adjusted. Then you can change an offset value by the appropriate amount based upon the result of a calculation. (By the way, probing systems commonly do this automatically when used for in-process gaging.)

Given our previous example, the target diameter to be turned is 3.2342 inches. Say this diameter is turned by tool number five. After machining, the operator would normally adjust tool offset number five to input any discrepancy. But instead of forcing the operator to calculate the deviating amount, wouldn't it be easier for the operator to just enter the current machined diameter?

This technique will allow the operator to do just that, eliminating the calculation prior to offset entry: Instead of making the adjustment in offset number five, we'll pick a secondary offset number in which to enter this value. Since most turrets can hold no more than twelve tools, we'll simply add 20 to the toolstation number to come up with the secondary offset number. For tool number five, we'll use offset 25.

The custom macro program will check to see if there is any value in the secondary offset other than zero. If there is, the program will automatically make the calculation to determine the offset adjustment value (just as the operator is currently doing manually) and adjust the primary offset accordingly.

If you wish to use this technique for all tools which require frequent offset adjustments—commonly your finish turning tools, threading tools, and grooving tools—you will have quite a few redundant commands in your main program to perform the secondary offset testing and calculations. For high volume work, this may be just fine. But the more programs you need to run, the more inconvenient it will be to incorporate these redundant commands right in your main program. To minimize the number of required commands, our technique uses a separate program (the custom macro) for this purpose.

In the main program, place this command at the beginning of every tool (note that this command must come before the turret index command):

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

N055 T0505 (Finish turning tool)

In line N050, we 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. 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, then

go to N5.)

#3000 = 100 (Dimension offset too small)

N5 IF [ #[2020 + #20] LT #2] GOTO 10 (If offset value is less than big limit, then 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 M99

Note that this technique simply builds upon your current methods. If you wish to enter offsets in the same manner you always have, you can of course do so. But your entry level operators will surely find this method of offset entry easier, faster and less error-prone than your current methods.

### RELATED CONTENT

• #### 5 Things New CNC Operators Must Know

These subjects are the building blocks of training newcomers on a specific CNC machine tool.

• #### Modern CNC Control Systems for High Speed Machining

All around the world, companies that machine molds and dies face numerous challenges as well as numerous opportunities. How these companies are responding are influencing the entire metalworking industry.

• #### Key CNC Concept #4—The Forms Of Compensation

Though applied for different reasons on different machine types, all forms of compensation allow the CNC user to allow for unpredictable conditions related to tooling.