How to use

G41 and G42 cutter compensation

When programming a CNC machine we have to take into consideration the diameter of the cutter or the part will be undersize by the radius of that tool. Using G41 and G42 cutter compensation will enable the machine to calculate this so we can program to the dimensions of the drawing.

An Example of G41 and G42


Offsetting the cutter left or right

We can use two different G-Codes to apply cutter compensation depending on the direction of the cut.

G41 is left compensation and G42 is right compensation.

On a CNC machine, it is usually recommended to use climb milling, this needs to be taken into consideration when writing our programs and deciding which direction to apply cutter compensation.

When we wish to cancel the compensation, G40 is used to turn it off. It is a good working practice is to end each section of the program with G40 so if we need to jump back to re-run a tool we won't have G41 or G42 applied unless it is called upon after the tool change.



Different ways to apply cutter comp

ways to apply G41 and G42

There are three different ways that cutter compensation can be applied

G42 P5.0;

By using a 'P' value we can tell the machine that we wish to offset the cutter by a defined amount, in this case, 5mms.

This technique is usually used on desktop routers and small CNC machines without a built-in tool table

G42 X5.0;

Another way we can write this is by using an 'X' value, it means the same thing.

G42;

On machines with a built-in tool table within their control system, we normally see cutter compensation just applied using a simple G42 (or G41) command

Larger industrial machinery normally uses this style of defining the radius of the tool as the tooling information is entered into the tool table during the set up of the machine. During the tool call line of our program, the machine pulls all the tooling information into its memory and G42 is used to let the machine know that we wish to use cutter compensation. No other information is needed.

An Example

An Example of G41 and G42

Let's take a look at the G41 command from this part program

T0101 (10MM ENDMILL);
M06;
G21 G90;
S800 M03;
G41 P5.0;
G00 X0.0 Y0.0;
Z-10;
G01 Y60.0 F100.0;
X100.0;
Y0.0;
X0.0;
G00 Z50.0;
X200.0 Y200.0;

We start by calling the tool, in this case, a 10mm endmill. Then we perform a tool change with the M06 command and set turn the spindle on (M03) at 800RPM. We also set the machine to absolute and metric systems using G21 and G90.

Before we move the cutter we apply the G41 cutter compensation and tell the machine that we are offsetting it my 5mm with the P value. (5mm being the radius of the tool)
We are machining this part by starting at the datum position at the lower left-hand corner and travelling up to Y60.0 position. So the endmill will need to be offset to the left of the material, hence using G41 and not G42.

The rest of the program is the dimensional moves to cut the shape of the part.

Tool nose radius compensation (Lathe)

Tool nose radius compensation on a CNC Lathe

When we talk about cutter compensation on a Lathe or machining centre, we refer to it as tool nose radius compensation.

When turning, the machine has to calculate the small radius on the nose of the tool when applying our tool paths to ensure we cut the same size as we have programmed.

The direction that the tool cuts will determine if we use G41 or G42 for the correct direction to offset with compensation. This graphic shows the correct direction when applying tool nose radius compensation on a lathe.

When setting up the tooling information in the tool table of the machine controls, we add the size of the radius and the orientation of the tool. This enables the machine to select the correct direction to offset the tool when it reads the G41 or G42 in our program.

Tool quadrent setting on a CNC Lathe

The graphic above shows what we set the tool quadrants to in relationship to the tool. For example, an external roughing tool would be set to 3 and an internal boring bar would be set to 2. This is assuming the tool turret is above the spindle, if it is below these values would be reversed.

For a left-handed external roughing tool we would select 4 if the turret is above the spindle at its tool change position or 1 if it is a lower turret design.

Share this article

To learn the basics of G Code programming, check out my Foundation course

The quickest way to learn CNC Programming