CNC Milling | G41 and G42 Codes | Tool Radius Offset

Tool Radius Introduction

Contour of a part - also known as a profile - is normally programmed for milling applications by establishing the depth in Z-axis first, then moving the cutting tool individually along the X-axis, Y-axis, or both axes simultaneously. For turning applications, either the X-axis or the Z-axis, or both axes can be used to face, turn or bore a contour. For both types of machining, each contour element requires a single block of cutting motion in the program. These motions between contour change points can be programmed in millimeters or inches and they can use absolute value positions or incremental distances. In either case, keep in mind that this type of programming always uses the spindle centerline as the X-Y or X-Z tool movements. Although centerline programming is a very convenient method for program development, it is also a method unacceptable for machining. During contact with material, the cutting tool edge must be in contact with the programmed part contour - not its centerline.

Actual toolpath for all contouring operations is always equivalent to the cutting tool motion. Whether used on a CNC machining center or on a CNC lathe, the cutting tool edge must always be tangent to the contour, which means the tool motion has to create a path where the center point of the cutter is always at the same distance from the contour of the part. This is called the equidistant tool path.

The illustration in Figure 30-1 shows two types of a tool path. One is not compensated, the other is compensated. Both are applied to a particular contour, with the cutter diameter shown as well, including its positions.

Tool path not compensated (above) and compensated (below), by the specified cutter radius

Tool Radius Offset Commands

In order to program one or the other mode of cutting (based on cutting direction), control systems offer two preparatory commands to select the desired cutter radius offset direction mode.

G41 : Offset (compensation) of the cutter radius is to the LEFT of contouring direction
G42 : Offset (compensation) of the cutter radius is to the RIGHT of contouring direction

When either G41 or G42 mode is no longer required, it must be canceled by the G40 command:

G40 : Cutter radius offset mode CANCEL

Figure 30-10 shows all three radius offset commands:

Figure 30-10
Application of G41, G42, and G40 to a cutter path

Keeping in mind that the terms climb and conventional refer to milling only and are relative to spindle rotation and the hand of milling cutter. By this definition, the G41 command is applied for climb milling mode, G42 command is applied for conventional milling mode:

The table shows all relationships between tool type, tool rotation, and cutting direction.
There is no cutter radius offset applied when G40 command is in effect.

Figure 30-11
Climb milling and Conventional milling mode for a right hand cutter and spindle rotation mode M03

Figure 30-11 shows the G41 command as a climb milling mode and the G42 command as a conventional milling mode. Climb milling mode is the most common in CNC milling, particularly in contour milling.

General Rules of G41 and G42

Reminders and rules are only important until a particular subject is fully understood. Until then, a general overview and some additional points of interest may come handy. Programming cutter radius offset is no different. Most of the following items apply to milling and turning, some are unique to milling only.

Milling Only

  • Reach the Z-axis milling depth in G40 mode (cutter radius offset cancel mode)
  • Do not forget the offset number D… to include in the program - it is a small error that can cost a lot
  • Retract from the depth (along Z-axis only) after the radius offset has been canceled
  • Make sure the cutter radius offset corresponds to the work plane selected

Milling and Turning

  • Never start or cancel radius offset in an arc cutting mode (with G02 or G03 in effect). Between the startup block and the cancel block, arc commands are allowed and normal, if the job requires them
  • Make sure the cutter radius is always smaller than the smallest inside radius of the part contour
  • In the canceled mode G40, move the cutter to a clear area. Always consider the cutter radius, as well as all reasonable clearances
  • Apply cutter radius offset with G41 or G42 command, along with a rapid or a linear motion to the first contour element (only with G00 or G01 in effect)
  • Use a single axis approach from the startup position
  • Make sure to know exactly where the tool command point will be when the radius offset is applied along two axis
  • In compensated mode (G41 or G42 in effect), watch for blocks that do not contain an axis motion. Avoid non-motion blocks if possible (missing X, Y and Z)
  • Cancel cutter radius offset with G40 command, along with rapid or linear motion (G00/G01) only, preferably as single axis motion only
  • G28/G30 machine zero return commands will not cancel cutter radius offset (but either one will cancel tool length offset)
  • G40 command can be input through MDI to cancel any cutter radius offset (usually as a temporary or an emergency measure)

There are no unique turning requirements.

G41 and G42 Codes Examples

Example - 1

CNC Tool Radius Offset ( G41 and G42 Codes ) Example Program

Tool Diameter : 16mm

N80 T02 M6;
N85 G94 F800;
N90 S2500 M03;
N95 G43 G0 Z10. H2;
N100 G00 X–10 Y0;
N105 G00 Z–7.5;
N110 G42 G1 G90 X10.Y10. D2;
N115 G01 X110;
N120 Y110;
N125 X10;
N130 Y15;
N135 X105;
N140 Y105;
N145 X15;
N150 Y15;
N155 G40;
N160 G01 X–10 Y0;
N165 G00 Z–15;
N170 G42 G1 G90 X10.Y10. D2;
N175 G01 X110;
N180 Y110;
N185 X10;
N190 Y15;
N195 X105;
N200 Y105;
N205 X15;
N210 Y15;
N215 G40;
N220 G00 X–10 Y0;
N225 G00 Z–7.5;
N230 G42 G1 G90 X25.Y25. D2;
N235 G01 X95;
N240 Y95;
N245 X25;
N250 Y30;
N255 X90;
N260 Y90;
N265 X30;
N270 Y30;
N275 G40;
N280 G00 X15 Y15;
N285 G01 X60;
N290 G41 G1 G90 X75. Y30. D2;
N295 G01 Y100;
N300 X45;
N305 Y10;
N310 G40;
N315 G28;
N320 M05 M09;
N325 M30;