Tag Archives: cnc programming

Cutter Compensation – A Programmers Best Friend

In this post … we would like to touch on some of the points regarding cutter compensation … when turning angles and radii … on Fanuc based CNC controls.

Many programmers shy away from cutter compensation … primarily because they have never taken the time to fully understand both it’s power nor how to use it properly. But the reality is that cutter comp is one of a programmers best friends. The most common reason goes something like this “It’s just as easy to have the CAD/CAM system compensate for the TNR ( tool nose radius ) and out put the hard numbers.” That is true … but life on the shop floor makes this a bad practice. A couple of reasons why :

  1. The “numbers” in the G code don’t match the “numbers” on the part … because they are taking into account the TNR. If manual edits need to be made … even simple edits … this makes it much harder because the part dimensions don’t match the G code numbers.
  2. Say after cutting … the conditions warrant either a bigger or smaller TNR for better cutting conditions. If cutter comp is used … it’s a simple offset change. If not … it’s a trudge back to the CAD/CAM guy or system to re-post and make a new G code program for the revised tool and it’s TNR.
  3. In milling … let’s say I broke my last perfect .250R end mill … but I have a re-ground one that is .245R.. Again, if cutter comp is used … it’s a simple offset change. If not … it’s another trudge back to the CAD/CAM guy or system to re-post and make a new G code program for the revised tool radius.


But here we are going to stick with turning here … and here are a couple of simple rules for when to use and when not to use cutter compensation.

  • Whenever angles or radii are involved … you must use TNR compensation or the angles and radii will be off. Because the programmed point of the cutting tool, an imaginary sharp point, does not coincide with the actual point of the cutting tool which always has some corner radius. For this reason, when machining close tolerance angle or radius cuts, inaccurate workpieces will be produced. The amount of error is proportional to the amount of the tool nose radius.
  • Only worry about using it for finishing … It’s really not worth the effort to use it roughing … the amount you leave for finish allowance will probably “hide” the mismatch due to the TNR.
  • You must start cutter comp with a “start up block”. This block is usually the move as you approach the part … the move distance must be greater than the radius in the TNR offset. So if your tool has a radius of .032 … make a move at least .035 … preferably more.
  • Make sure that your TNR is less than any radius on the part … don’t try to jam an .032 tool into a .020 radius … alarms will greet you somewhere along the way.
  • We’ll cover some additional thoughts at the end of the post.

The Details :

The CNC control has the capability to automatically compensate for the tool nose radius thru the CUTTER COMPENSATION codes of G41 and G42. G41 is called cutter compensation left. The left side is explained as the side of the workpiece the cutting tool is on when viewed in the direction of cutter movement or the cutter is moving on the left side of the programmed path. Once commanded, G41 or G42 are modal commands and remain active until the G40 or cancel condition is obtained.

In Fanuc controls, in addition to commanding G41 or G42 direction, the programmer must also tell the control two other aspects of the cutting tool which are : (a) the amount of the tool nose radius and (b) the imaginary tool tip location. Both these values are entered in the tools geometry or wear offset table. In the offset table, the R value is the amount of the tools nose radius. If the program called T0101 in the tool command, in offset table #1, under the R column, the nose radius of the tool would be entered. The T column in the offset tables holds the imaginary tool tip location.

Cutter compensation must be programmed using what is commonly referred to as a start up block. This block, which must be a G01 type block, is used to activate the cutter compensation before the cutting tool actual contacts the workpiece. The movement amount in the start up block must always be greater than the nose radius of the tool stored in the R column of the offset table. Circular commands using G02 or G03 are not allowed on start up blocks.

G40 is used to cancel the automatic compensation of the tool nose radius. G40 should always be commanded on a G00 block as the tool moves away from the workpiece with the tool in a clearance position.

More Rules and Thoughts :

Many rules apply in the use of cutter compensation as the control is always checking the tool position so it can calculate for the tool nose radius. Three rules of thumb apply and should keep you free of the controls cutter compensation alarms :

(1) Always command a start up block before contacting the workpiece and move in the G01 mode with a move greater than the nose radius of the tool.

(2) Use cutter compensation primarily in the finishing cut and try to eliminate it in the roughing passes. The more moves made with G41 or G42 modal, the more likely for a problem. To finish the part, use the start up block, finish cut the part and command G40 when done. Ifadditional cuts are required, use another start up block and cancel the cutter comp each time as soon as the profile cut is finished.

(3) Always cancel G41 or G42 using the G40 command. The best place to command G40 is on a G00 block, at a clearance point or moving to a clearance point. Because cutter compensation causes the control to perform some powerful calculations and is a complex command, you should also consult your controls instruction manual for further info on G41 or G42.

Happy Chip Making !!
Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
…. and MORE !!!

Canned Cycle Drilling & R Plane Tricks

Wasting time drilling air when “drilling” holes in a part with multiple levels is not uncommon for the novice programmer. In this post … we would like to discuss the always important R plane and how you can easily control it in your G code program.

First … the FACTS :

There are two planes that the programmer needs to be concerned with :

INITIAL PLANE … this is the plane used for rapiding around the workpiece. This plane should always be set high enough to avoid the workpiece as well as any clamps or other fixture related objects that can be struck by the tool as it moves around the part.

  • On  Fanuc controlled or Haas machine … the initial plane is defined as the last Z position before the canned cycle is called. So in the sample code below :

G00 G90 Z1.000
G98 G81 Z-.500 R.050 F1.0

  • Z1.00 would be considered the INITIAL PLANE … because it is the last Z position prior to the the G81 canned cycle command.
  • In an Okuma machine … the user can set the INITIAL PLANE by commanding a G71 Z— line prior to the canned cycle command line. So … imitating the above Fanuc line … we would program :

G71 Z1.000
G81 Z-.500 R.050 F1.0

R PLANE : The R plane is defined as the plane at which the drilling operation begins. So basically the tool rapids from the Initial Plane to the R plane … and then starts the drilling operation. The R plane is defined in the canned cycle command line. So in the above examples … R.050 is defined as the R plane … the point where the drilling operation would begin. In the above programs … the tool would rapid from the Z1.00 initial plane to the Z.050 R plane.

After drilling … we can tell the tool where to return by using the G98 ( initial plane return ) or G99 ( R plane return ) … for Fanuc / Haas … in the canned cycle command line. Once commanded … G98 / G99 becomes modal … which means the machine will remember where it is supposed to return … until told differently. When programming for Okuma … we can use the M53 ( like G98 ) / M54  ( like G99 ) commands.


Did you know that you can very easily change the R plane when drilling on uneven surfaces?

Did you know that you can very easily change the return point between the INITIAL and R planes?

As mentioned above … once G98 or G99 is set … the control remembers where to go. Also … once the R plane is set in the canned cycle command … it remembers where the R plane is. But you can change either very easy … just command it !! Like this :

(1)G00 G90 Z1.000
(2)G98 G81 Z-.500 R.050 F1.0
(3)X1.00 Y1.00
(4)G99 X2.00 Y2.00
(5)X3.00 Y3.00 R-.100
(6)G98 X4.00 Y4.00 R.050

(1) – Sets the Initial Plane as Z1.00
(2) – Sets the R plane as Z.050 … return to the Z1.00 after drilling this hole
(3) – Drill this hole … R plane is .050 and return to Z1.00 … these were modal from (2)
(4) – After drilling this hole … return to R plane … still set to Z.050
(5) – Drill this hole but start at the new R plane of Z-.100 … return to Z-.100 after drilling … G99 is modal.
(6) – Drill this hole but start at the new R plane of Z.050 … return to Z1.00 after drilling this hole G99.
(7) – Cancel the canned cycle … all modal canned cycle information is cleared.


On an Okuma machine … users can set and re-set the Initial Plane through the G71 command. For example, the command :
… would set the Z plane of 1.00 as the Initial Plane … and this can be changed at any time but just commanding a new G71 line.

On a Fanuc / Haas control … this is not so easy. You would have to cancel the current canned cycle with a G80 … move the Z axis to the desired Initial Plane … then re-command a new canned cycle to set a new Initial Plane.

So … as we illustrated here … it’s fairly easy to efficiently and effectively machine holes on uneven surfaces using a combination of the return plane commands G98 / G99 / M53 / M54 and R plane settings and through the Initial Plane selection.

Happy Chip Making !!

Check out our Real World World machine shop software at www.KentechInc.com

Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
…. and MORE !!!

Move That Vise !!

MOVE THAT VISE !!! … It could mean more years for your machine tool.

It seems the simpler, often overlooked things can be the downfall of most shop equipment. Focusing on a few simple ideas can avoid those big repair bills and keep machine tools running like new much longer.

When most setups are done on a VMC, the workholding fixture is neatly mounted right in the middle of the table. Although it looks good, this is actually one of the worst “habits” for the machine. Locating the vise or fixture in the same place has the following harmful effects on the life of the machine:

  • Table wear, resulting in dip or sag in one spot.
  • Boxway or guideway wear on or around the spot, causing loose surface and gib contact, and shuck in the ways.
  • Ball screw wear, resulting in excessive backlash in that one area of the screw, which cannot be repaired through CNC compensation.

Of course you’re going to clean the table completely before installing the vise.

Then are you going to place the vise so it looks nice and neat in the center of the table?

NO !!!

Placing the vise or fixture in or around the same area of the machine table will cause all of the above, with the most common symptom over time being backlash of the screw. When trying to compensate and set the backlash, the person making the repair will often find different backlash values when checking along the length of the axis stroke. This most often results in the need to replace the whole ball screw. Because most CNC machine controls only permit one backlash compensation value to be set in the parameters, compensating for the backlash cannot be effectively performed through the control.


You also may find that the gibs need to be adjusted in that area of the boxway, because the axis has some side-toside movement to it when moving. Squareness in that area will disintegrate; and, in the worst case, this shucking can be heard when the axis changes direction. The most common remedy of adjusting the gib in that area causes the axis to bind when it reveals to the other areas, because the boxway wear is different along the stroke. In this repair, the machine’s boxways may need to be reground, rescraped or both. In either of these cases, the repair bill will be huge.

The remedy is to make sure to move the vise or fixture location around on the tabletop whenever possible. You will see a more consistent wear pattern for the machine, and any backlash that occurs can be taken up correctly through the control. You will not be able to stop machine wear, but you can distribute it more evenly along the machine, which provides a longer life for all the components involved.

 Happy Chip Making !!

Check out our Real World World machine shop software at www.KentechInc.com