G42- Cutter Compensation Right

G42 turns on cutter compensation to the right of the programmed tool path. The cutter is offset to the right-hand side by an amount calculated from the tool diameter, wear diameter and P value.

Syntax
G42 / G42 P5
Modal
Yes – Group 7
Applies to
MASSO G3 and G3 Touch (Advanced)
INFORMATION
Cutter compensation is part of the Advanced portfolio and works the same on both MASSO G3 and MASSO G3 Touch controllers. It's available for download through myWorkshop.
WARNING
Not following the cutter compensation rules (section 4) can cause unpredictable motion and damage the workpiece or the machine.

1. Offset calculation

Toolpath offset = (Tool Diameter + Wear Diameter) ÷ 2 + P
ValueSet inMeaning
Tool DiameterF4 Tool TableDiameter of the cutter, e.g. a 10 mm end mill. Must be positive. Usually 0 if compensation is already applied in CAM.
Wear DiameterF4 Tool TableTool wear or size variation. Negative for an undersized tool, positive for an oversized tool.
P (optional)G-codeA radius added to the offset, typically used in hand-written G-code. Without P, only the Tool and Wear Diameter are used.

When G42 is issued, MASSO uses the Tool Diameter and Wear Diameter of the currently active tool. See section 6 for how to manage these values.

2. Examples

CodeResult
T1 M06
G42
Turns on compensation using the Tool Diameter and Wear Diameter of tool 1 in the F4 Tool Table.
T1 M06
G42 P5
Offsets the cutter 5 mm from the tool path. Any Tool and Wear Diameter set for tool 1 are added to this.

Full example with lead-in and lead-out

N10 T1 M06
N20 G00 X25 Y50 Z25
N30 G01 Z-5 F250
N40 G42
N50 Y25 (Lead in)
N60 Y-100
N70 X100
N80 Y-25
N90 X-25
N100 G40
N110 X-50 Y-25 (Lead out)
N120 G00 Z25

Compensation is turned on once the tool is at cutting depth, and a linear lead-in move is made before cutting starts. G40 then cancels compensation, and a lead-out move takes the tool to a safe location before it retracts. The lead-out isn't shown as a compensated move.

G42 compensated toolpath
Compensated toolpath shown in purple.

3. Understanding G42 direction

Imagine standing behind the cutter as it moves away from you. With G42 active, the cutter moves to the right-hand side of the programmed tool path.

G42 cutter compensation direction

4. Cutter compensation rules

TopicRule
DisplayCompensated paths are calculated and shown when the G-code file is loaded. Outside corners are radiused automatically.
Plane and axesValid in the G17 XY plane only, for X and Y moves only. Don't include Z, A or B moves while compensation is active – results may be unpredictable.
Cutting depthMove the tool to cutting depth before turning compensation on.
Other commandsDon't include non-cutting commands, such as coolant on or off, while compensation is active.
Lead-in / lead-outA linear lead-in to a safe location is required before turning compensation on, and a linear lead-out to a safe location after cancelling it. Both must be linear moves only and longer than the cutter radius. The lead-out isn't shown as a compensated move.
CirclesDon't cut a complete circle with a single arc command.
After G40Give both X and Y on the first move after cancelling compensation, to avoid unpredictable motion.
Jump to lineDon't use jump-to-line while compensation is active. To resume, rewind the program to a point before compensation was turned on.

5. Troubleshooting

If the compensated path shows loops or self-intersections, the calculated cutter size is too large for the programmed geometry. Choose a smaller cutter that suits the job.

Cutter too large
Cutter too large
Cutter size correct
Cutter size correct

6. Managing Tool Diameter, Wear Diameter and P

MASSO cutter compensation works with both CAM-generated and hand-written G-code. The current tool's Tool Diameter and Wear Diameter are applied automatically whenever G42 is turned on, and the final offset always combines them with any P value in the G-code.

ValueHow to use it
P valueGives the cutter radius directly in G-code – e.g. P5 for a 10 mm cutter. Common in hand-written G-code, where you program the nominal geometry and let the controller apply the offset. Set the Tool Diameter to 0 so P controls the radius; any Wear Diameter is still included. P can be combined with a Tool Diameter if an application needs it, though this is uncommon.
Tool DiameterUsually 0 when compensation is handled in CAM. When the G-code has no compensation (e.g. hand-written programs), use it to apply the offset. It can be the measured or the nominal diameter, with final sizing done by the Wear Diameter.
Wear DiameterFine-tunes the effective cutter size as the tool wears. Negative = undersized, positive = oversized. For a 10 mm cutter, −0.5 mm gives an effective 9.5 mm; +0.5 mm gives 10.5 mm.