44 Little Cahill Road

Cary, IL  60013

Ph: 847-639-8847

  • Facebook Social Icon

Teaching CNC with the Key Concepts approach - part five

Part five - Key concept number four: You must understand the compensation types

Here are some links that allow you to review other parts of this article:

  • Introduction to compensation

  • Sizing and trial machining

  • Fixture offsets (mc)

  • Tool length compensation (mc)

  • Cutter radius compensation (mc)

  • Geometry offsets (tc)

  • Wear offsets (tc)

  • Tool nose radius compensation (tc)

This key concept is quite lengthy. For this reason, I break it into four segments (lessons), including for machining centers, introduction to compensation, fixture offsets, tool length compensation, and cutter radius compensation.


Introduction to compensation

As with every other key concept, we start in general terms. In this case, we devote an entire lesson to introducing compensation. Just about everything in this lesson is related to the three compensation types.


The marksman analogy

I like to begin with an analogy comparing CNC compensation types to the compensation a marksman needs when firing a rifle. A marksman must compensate for the distance to the target. To do so, they must judge the distance to the target and adjust the sight of the rifle accordingly. If they make a mistake in judging distance, or if they don't allow for other variables (like wind), the first shot won't be perfect. Another sight adjustment will be necessary. The next shot will be closer to the target than the first.


Point out that this is amazingly similar to CNC compensation types. In all cases, the setup person will do their best to perfectly set them. But if they make a mistake, or if they don't allow for some other variable (like tool pressure), the first cut won't be perfect. Depending upon the tolerance to be held, they may have to make a an adjustment. The second time the tool cuts, it will machine the workpiece more accurately.


Explain offsets

Point out that all compensation types use offsets. Offsets are referenced by an offset number and contain numerical values. The actual value doesn't mean anything to the control by itself. The compensation usage (in the program) determines what each offset value represents. You can easily compare CNC offsets to the memories of an electronic calculator (they are referenced by a number, contain numerical values, and don't have any special meaning until they are referenced in a calculation).


Depending upon the control model/s involved, you may want to show the display screen/s of related offset pages. Point out that some offsets contain more than one register (like the tool length and cutter radius compensation offsets for some machining centers and the wear offsets of turning centers).


Explain some of the variables that an offset can be used to represent. With tool length compensation, for example, the offset can represent the length of a tool. With cutter radius compensation, it represents a milling cutter's radius. And with fixture offsets, offsets specify the location of the program zero point.


Finally, explain the general reason why offsets are required. There are many tooling related variables that a programmer won't know as they write the program- the exact length and radius of a milling cutter, for example. All compensation types allow the programmer to ignore exact specifications of tooling (including workholding tooling) while the program is being created. Prior to or during setup, these exact values are measured and entered into the control - into offsets. Again, this separates many setup related tasks from programming.


Introduce sizing and trial machining

Explain that CNC machines are capable of very high accuracy. They can hold very small tolerances. And if tolerances are very small, it is likely that the initial entry for certain offsets will not be precise enough to hold the tolerance. Point out that even if a setup person perfectly measures and enters a counter-boring tool's length, for example, it is no guarantee that the counter-boring tool will machine to the exact depth specified in the program. Again, the setup person could make a mistake while measuring or entering the tool's length, but even if they do not, tool pressure may cause the tool to machine a little too shallow (or deep, depending upon the type of tool being used).


Explain that when a setup person notices a very small tolerance on the blueprint - and if they are at all concerned that the cutting tool will not machine the related dimension to size on its first try, they can use a technique called trial machining to ensure that a little extra material will be left by the tool when it cuts for the first time.


While this may be a little detailed at this stage in your presentation, explain that trial machining involves six steps:

  1. Recognizing a tolerance that may not be held if trial machining is not done.

  2. Making an adjustment (usually to a tool's offset) to ensure that the tool leaves excess stock.

  3. Letting the tool cut (of course it will leave excess stock on the critical surface).

  4. Measuring the dimension to determine its current size.

  5. Readjusting (again usually an offset) based upon the measurement just taken.

  6. Rerunning the tool (this time it will machine the dimension to size).

Make sure students understand that trial machining helps them make the very first workpiece a good one. Once the machine is in production, and depending upon how many workpieces must be machined, it is possible that further adjustments may be necessary as tools wear. Generally speaking, as a tool wears, it leaves more material on the workpiece - it may even have the tendency to "push away" from the workpiece (leaving yet more stock) due to increased tool pressure. Depending upon how small the tolerance is, this workpiece growth may cause dimensions to come close to the limits of the tolerance band. If left to continue, they will run out of tolerance.


We call adjustments made to maintain size as tools wear sizing adjustments. In order to make sizing adjustments, of course, the CNC operator must be able to interpret tolerances, determine the target value for each dimension, calculate the deviation from the target value (along with its polarity), and enter this value into the appropriate offset.


Your most basic goal in this key concept, of course, it to get students to understand how the compensation features are programmed and used. But to be successful programmers, setup people, and operators, they must also understand sizing and trial machining. As you discuss each compensation type, be sure to demonstrate the implications of these two important skills.


Fixture offsets

This feature is introduced in key concept number one. And frankly speaking, you may have said enough about it in key concept number one to ignore it here in key concept number four. But be sure students know that the feature fixture offsets is a compensation type. It allows the programmer to ignore the precise placement of the workholding setup on the machine's table. A command in the program (G54 if only one workholding device is being used) tells the control where to look to find the program zero assignment values. These values are the distances from the spindle (center in X and Y and nose in Z) at the zero return position to the program zero point on the workpiece. These will normally be large negative values - and we show how to measure them in key concept number one.


While this may not be the right time to do so, you'll eventually want to discuss other points about fixture offsets:

  • Fixture offset values can be entered by programmed command (G10). This is helpful with repeated setups to keep from having to remeasure offset values every time.

  • There are at least six of them, meaning multiple program zero points can be assigned.

  • That G54 through G59 are used to invoke the various fixture offsets.

  • That there is a common fixture offset (number zero) that allow the user to shift the origin for fixture offset entry from the zero return position to another location.

Again, you may want to save these presentations until later - after students have a few programs under their belts. We recommend discussing them during key concept number six (special features of programming).


Tool length compensation

Tool length compensation allows the programmer to ignore the precise length of each tool while they are creating the program. In essence, the same program will work regardless of how long or short each tool is.


There are actually two ways to use tool length compensation. Each is programmed essentially the same. And it's pretty easy to explain how tool length compensation is programmed.


Programming considerations

Explain that tool length compensation must be instated during each tool's first approach movement in Z to the workpiece. A G43 word is used to instate tool length compensation. Include in the G43 command is an H word that specifies the offset number to be used with tool length compensation. (I like to help newcomers remember the H word by saying that H stands for the height of each tool.) Tell students to make the value of the H word equal to the tool station number. Tool number one will use offset one (H01). Tool number two will use offset two (H02). And so on. Also within the G43 command is a Z axis departure to the tool's approach position.


Here are the first few commands of a program to stress the points:

  • O0001 (Program number)

  • N005 T01 M06 (Place tool one in spindle)

  • N010 G54 G90 S500 M03 T02 (Select coordinate system, absolute mode, start spindle and get the next tool ready)

  • N015 G00 X1.0 Y1.0 (Rapid to first XY position)

  • N020 G43 H01 Z0.1 (Instate tool length compensation, rapid to Z0.1)

  • N025 M08 (Turn on coolant)

  • N030 G01 Z-0.15 F4.0 (Feed into hole)

  • N035 G00 Z0.1 M09 (Retract from hole, turn off coolant)

  • N040 G91 G28 Z0.1 M19 (Return to tool change position, orient spindle)

  • N045 M01 (Optional stop)

  • N050 T02 M06 (Place tool two in spindle)

  • N055 G54 G90 S500 M03 T02 (Select coordinate system, absolute mode, start spindle and get the next tool ready)

  • N060 G00 X1.0 Y1.0 (Rapid to first XY position)

  • N065 G43 H02 Z0.1 (Instate tool length compensation, rapid to Z0.1)

  • N070 M08 (Turn on coolant)

  • N075 G01 Z-1.2 F6.0 (Feed into hole)

  • N080 G00 Z0.1 M09 (Retract from hole, turn off coolant)

  • N085 G91 G28 Z0.1 M19 (Return to tool change position, orient spindle)

  • N090 M01 (Optional stop)

  • .

  • .

  • .

Be sure to point out that since tool length compensation is instated during each tool's first Z axis approach movement, there is no need to cancel it (though there is a command, G49, that does so).


The two ways to use tool length compensation

Again, there are two ways of using tool length compensation. The program shown above will work for both methods. With one method, the tool's length as used as the tool length compensation value (the value placed into the offset for each tool. This is the method we urge you to teach. It allows the most flexibility during setup. With the second method, the distance from the tip of each tool down to the Z axis program zero surface is the tool length compensation value.


Program zero assignment considerations

If using our recommended method (tool's length is the tool length compensation value, students must understand that the Z axis program zero assignment value (fixture offset Z value) must be set to the distance from the spindle nose as the Z axis zero return position to the program zero surface in Z. To measure this value at the machine (after the workholding setup has been made):

  1. Send the machine to the Z axis zero return position

  2. Set the Z axis position display to zero.

  3. Cautiously bring the spindle nose down to the Z0 surface.

  4. The Z axis display will show the needed fixture offset Z register value (a large negative number).

  5. Enter this value into the appropriate fixture offset Z register.

Point out that in step three, some setup people like to use a gauge block or feeler to keep from having to actually touch the spindle nose to a workpiece.


With the second method of using tool length compensation (offset is the distance from the tool tip down to program zero surface in Z), the Z axis program zero assignment value will be zero.


Offset considerations

Again, with our recommended method, the setup person (or someone) will determine the length of each tool. The tool's length is the distance from the tool tip to the spindle nose of the machine (a positive value). This value can be measured for each tool on the machine or off line. To measure tool lengths on the machine:

  1. Bring the spindle nose to a flat surface.

  2. Zero the Z axis position display.

  3. Retract the Z axis far enough and load the tool to be measured.

  4. Bring the tool tip to the flat surface.

  5. The Z axis display now shows the tool length.

  6. Enter this value into the appropriate tool length compensation offset.

  7. Repeat steps 3-6 for all other tools to be measured.

One important benefit of using our recommended method is that tool lengths can also be measured off line, while getting ready for the next (or some future) job. You don't have to use the machine as an expensive height gauge. Other benefits include:

  • Tools that must be used from setup to setup need not be remeasured

  • Tools shared from one machine to another can be measured in a central location

Trial machining considerations

Explain that tool length compensation allows a setup person to easily trial machine Z surfaces. When they see a Z surface (depth) that has a critical tolerance, they can simply increase the tool length compensation value (by a value of 0.010 inch is usually good enough). This will make the machine think that the tool is longer than it really is - keeping it away from the surface being machined. Once the tool has machined the surface, the program is stopped and the surface is measured. The offset will then be adjusted based upon the findings of the measurement. The tool will then be rerun. The next time it cuts, the surface will be within the tolerance band.


Sizing considerations

Explain that most cutting tools used on machining centers don't machine critical Z surfaces. Center drills, drills, taps and reamers, for example, seldom have critical depth tolerances. But with counter-boring tools and certain milling cutters, it's likely that depth tolerances are more critical. As tools wear, their tendency will be to shorten in length. And again, with most tools, they won't shorten enough during their lives to cause a dimension to go out of tolerance. But for those tools that machine extremely critical depth tolerances, the operator may have to reduce the tool length compensation value before the tool is completely dull.


Cutter radius compensation

Just as tool length compensation allows the programmer to ignore the precise length of each tool, so does cutter radius compensation allow them to ignore the precise size (radius) of certain milling cutters. Point out that, unlike tool length compensation that is used for every tool in every program, cutter radius compensation is only used for milling cutters - and only when milling on the periphery of the cutter, as when contour milling.


There are other subtle advantages to using cutter radius compensation. As with tool length compensation, cutter radius compensation allows sizing and trial machining. If an XY surface is not being machined to size, an offset can be adjusted. Also, cutter radius compensation makes programming easier. Without cutter radius compensation, the programmer must specify all XY coordinates for the contour to be milled based upon the cutter's centerline path - which doubles the needed calculations. With cutter radius compensation, the programmer specifies all XY coordinates on the work surface. In many cases, this means print dimensions can be used in the program.


Programming considerations

Point out right away that cutter radius compensation tends to be one of the more difficult programming features to fully master. Frankly speaking, it is a little difficult to explain this feature. I'll give you a few pointers that have helped me.


There are three steps to programming cutter radius compensation:

  1. Instate it

  2. Machine with it

  3. Cancel it

By far, the most difficult step for you to explain and for students to understand is instating cutter radius compensation. Start by pointing out that there are three G codes used with cutter radius compensation. One of G41 or G42 is used to instate cutter radius compensation. G40 is used to cancel it. I have two ways to explain whether to use G41 or G42. If students have manual milling experience, they understand the difference between climb and conventional milling. Then it's easy:

  • G41: Climb milling

  • G42: Conventional milling

This assumes that they are using a right hand milling cutter (spindle running forward, M03). To help them remember, point out that climb comes before conventional (alphabetically) and 41 comes before 42 (numerically). So if they're going to be climb milling, G41 will be used to instate cutter radius compensation. If they're going to be conventional milling, G42 will be used to instate.


If students don't understand the difference between climb and conventional milling (they probably have had other problems to this point in the class), it be more difficult to explain whether to use G41 or G42. I'll say something like: "Look in the direction the cutter will be moving during its cutting operation. You may have to rotate the print to do so. Looking in this direction, ask yourself which side of the workpiece the cutter is on. If the cutter is on the left, you'll be using G41 to instate cutter radius compensation. If the cutter is on the right, you'll use G42." And to help them remember, again, point out that left comes before right (alphabetically) and 41 comes before 42 (numerically).


Unfortunately, determining whether to use G41 or G42 is just the beginning. Point out that as with tool length compensation, an offset is used with cutter radius compensation - and that most controls use a D word to specify the offset number used with cutter radius compensation. With some controls, there are two registers for each offset - one for the tool's length and the other for its radius. With this kind of control the D word should be made the same as the tool station number (and the tool length compensation number).


But most controls have but one register per offset. With these controls, the offset number that corresponds to the tool station number is already being used to specify the tool length compensation value. So another offset must be chosen. We recommend adding a constant number (that is larger than the number of tools the machine can hold) to the tool station number to come up with the offset to be used with cutter radius compensation. If the machine can hole twenty tools, for example, add thirty to the tool station number to come up with the cutter radius compensation offset number. For tool five, for example, use offset number five to specify the tool's length and offset thirty-five to specify its radius.


There is one more thing related to instating cutter radius compensation - and it tends to be the most difficult thing for students to understand. Explain that before instating cutter radius compensation, the milling cutter must first be positioned to a position that clears the first surface to mill. I call this the prior position.


Say, for example, we intend to use a 1.0 inch diameter cutter for the example above. The X coordinate for point one must be at least X6.5 (this will bring the cutter perfectly flush with the surface to mill. If the setup person enters anything larger than 0.5 in the cutter radius compensation offset, an alarm will be sounded. For this reason, most programmers make the prior position a little further away from the first surface to mill. A position of X6.6 in our example would allow a 1.125 diameter cutter to be used. Actually any cutter up to 1.2 inches in diameter (0.6 radius) can be used before an alarm will sound.


To actually instate, a command including the G41 or G42 (whichever is appropriate), the D word, and a movement in X and/or Y to the first surface to mill will be given. Note that this can be done in a rapid motion (if the cutter is clear of the workpiece) or a straight line motion. Cutter radius compensation cannot be instated during a circular motion. In our case, cutter radius compensation will be instated during a motion from point one to point two.


Once cutter radius compensation is instated, it remains in effect until it is cancelled. It is during these motions under the influence of cutter radius compensation that the contour is milled (in our case only one surface is milled - a movement to point three). In many cases, however, there will be several surfaces to mill. Point out that the control will be constantly looking ahead in the program to determine what's coming up in the next command. Based upon what it sees, it will continue to keep the cutter on the left or right side of all surfaces it sees (based upon whether G41 or G42 is used to instate).


Finally, cutter radius compensation must be cancelled. And again, G40 is used to cancel. We recommend retracting the tool in Z (if possible) prior to cancelling. So after the movement from point two to point three, the tool will be retracted (at rapid) and a G40 will be specified.


Here is an example program that shows the three steps to using cutter radius compensation. Note that we're assuming the control has but one register per offset.

  • O0002 (Program number)

  • N005 T01 M06 (Place 1.0 milling cutter in spindle)

  • N010 G54 G90 S500 M03 T02 (Select coordinate system, absolute mode, start spindle and get the next tool ready)

  • N015 G00 X6.6 Y-0.6 (Rapid to first XY position)

  • N020 G43 H01 Z0.1 (Instate tool length compensation, rapid to Z0.1)

  • N025 G01 Z-1.1 F50.0 (Fast feed to work surface)

  • N030 M08 (Turn on coolant)

  • N035 G42 D31 X6.0 (Instate cutter radius compensation, note conventional milling is being done)

  • N040 Y4.6 F6.0 (Mill right side)

  • N045 G00 Z0.1 (Retract)

  • N050 G40 M09 (Cancel cutter radius compensation, turn off coolant)

  • N055 G91 G28 Z0 M19 (Return to tool change position, orient spindle)

  • N060 M01 (Optional stop)

  • .

  • .

  • .

Trial machining considerations

Explain that cutter radius compensation allows a setup person to easily trial machine XY surfaces. When they see an XY surface that has a critical tolerance, they can simply increase the cutter radius compensation value (by a value of 0.010 inch is usually good enough). This will make the machine think that the cutter is larger in diameter than it really is - and it will keep it away from the surface being machined. Once the tool has machined the surface, the program is stopped and the surface is measured. The offset will then be adjusted based upon the findings of the measurement. The tool will then be rerun. The next time it cuts, the surface will be within the tolerance band.


Sizing considerations

With milling cutters that machine critical XY surfaces it's likely that tool wear will impact the surfaces being machined. As tools wear, their tendency will be to become smaller in diameter. And again, with most tools, they won't shrink enough during their lives to cause a dimension to go out of tolerance. But for those tools that machine extremely critical XY tolerances, the operator may have to reduce the cutter radius compensation value before the tool is completely dull.


What about turning centers?

While our discussions have applied only to machining center compensation types, many of these same points apply to turning center compensation types (geometry offset, wear offsets, and tool nose radius compensation). The entire introduction will apply nicely Geometry offsets are similar to fixture offsets in that they are used to assign program zero. And tool nose radius compensation is quite similar to cutter radius compensation. Rest assured that our Turning Center Curriculum does include appropriate presentations for these features.

cnc reverse logo.jpg
0