Tool Radius Compensation (D, G40, G41, G42)

D

D<v>

Select tool v. The new tool applies to its own block and all succeeding blocks until a new tool is selected. Tool 0 is special. Its selection deactivates any tool compensation. Tool 0 can be regarded as tool where all tool parameters are set to zero. It is selected by default.

Example:

In the following example tool 1 is defined to have a Y-offset of 10 and tool 2 to have an Y-offset of 20. Block N10 and block N50 use tool 0. Tool 1 applies to block N20 and to block N30. In block N40 tool 2 is active. Figure “ExampleD” shows the resulting programmed path (dotted line) and the resulting tool center point path (solid line).

!toolSet(index:=1, nr:=1, offsetY:=10);
!toolSet(index:=2, nr:=2, offsetY:=20);
N10 G01 X10 Y0 F6000
N20 G01 X20 Y0 D1
N30 G01 X30 Y0
N40 G01 X40 Y0 D2
N50 G01 X50 Y0 D0
M02
Tool Radius Compensation (D, G40, G41, G42) 1:

Figure “ExampleD”.

G40

Command

G40 (default setting)

Cancellation

G41 or G42

Deactivate Tool Radius Compensation (TRC).

G41

Command

G41

Cancellation

G40 or G42

Activate tool radius compensation (TRC). After activation the programmed path is shifted left by the radius of the currently selected tool. (See D.)

Tool Radius Compensation (D, G40, G41, G42) 2:

On activation, a tool with a nonzero index must be selected.

Example:

The following example demonstrates the activation and deactivation of tool radius compensation. The programmed path (dotted line) and the compensated path (solid/ dashed line) are shown in Figure “ExampleG40G41”.

!trcOffsetSet(offset:=5);
!trcApproachDepartSet(approachRadius:=5, approachAngle:=90, departRadius:=5, departAngle:=90);
!toolSet(index:=1, tooltype:=tooltypeMill, radius:=10);
N10 G01 X10 F6000
N20 X20 G41 D1
N30 X35
N40 X40
N50 Y20
N60 G02 X50 Y10 U10
N70 G01 X70
N80 X80 Y0 G40
N90 X90
M02
Tool Radius Compensation (D, G40, G41, G42) 3:

Figure “ExampleG40G41”.

G42

Command

G41

Cancellation

G40 or G41

This function is the same as G41, except that the path is shifted to the right. See G41 for details.