Home › G-codes › Mach3 Mach4 › G42
G42 Cutter comp right
Mach3 Mach4 G-code · Mill
Offsets the tool to the right of the path by the tool radius. Used for climb milling inside a pocket or hole.
Format
G42 [D] [P] X Y
Addresses
| Address | What it does |
|---|---|
D | Tool table number for the diameter |
P | Direct offset value instead of the table |
X Y | Lead in end point |
How it works
Modal, cutter comp group. Cancel with G40.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T1 M6 (TOOL CHANGE)
S8000 M3 (SPINDLE ON)
G0 X1.5 Y-0.75 (START)
…
T1 M6 (TOOL CHANGE)
S8000 M3 (SPINDLE ON)
G0 X1.5 Y-0.75 (START)
…
The full 10-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Turn comp on and off on straight moves longer than the radius. Mach4 errors if the comp move is an arc.
- Mach3 D is optional. Without D it uses the tool in the spindle. P gives a direct value. Mach4 P is the actual offset.
- Comp works in G17 only on Mach3. Check the toolpath display for gouges on short moves.
Related codes
G42 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Cutter compensation right |
| Haas NGC | Cutter compensation right |
| Mazak (EIA) | Cutter radius compensation right |
| Okuma OSP | Cutter radius compensation right |
| Mitsubishi M70 M80 | Cutter radius comp right |
| Brother Speedio | Cutter compensation right |
| Siemens 840D 828D | Tool radius compensation right |
| Heidenhain TNC (ISO) | Radius compensation right |
| Fagor 8055 8065 | Tool radius compensation right |
| LinuxCNC Tormach | Cutter compensation right |
| Centroid CNC12 Acorn | Cutter compensation right |
| Hurco WinMax (NC) | Cutter compensation right |
| Fadal | Cutter radius compensation right, conventional |
| Swiss (Citizen Star) | Nose radius compensation right |
Every G-code for Mach3 Mach4 in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open G42 in the app All Mach3 Mach4 G-codes