G40/G41/G42: Radius compensation
Activates or cancels tool radius compensation.
For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.
- Family
- Compensation
- Machine
- Milling, Turning, Mill-turn
- Risk
- High
- Example
- G01 G41 D01 X50 Y0 F200
G01 G41 D01 X50 Y0 F200Parameters
- D
- Número del corrector de radio de herramienta (tabla de offsets).G41 compensa a la izquierda del avance, G42 a la derecha. Activar en un bloque de aproximación lineal más largo que el radio; G40 en otro movimiento lineal de salida.
Machine: Milling, Turning, Mill-turnRisk: High
ISO común
G40 / G41 D... / G42 D...- It needs enough approach and retract to compensate.
Fanuc · Haas
G41/G42 D...- Fanuc: D calls the radius offset in milling.
- Haas: It can alarm if there is no valid input movement.
Heidenhain
RL / RR / R0- Heidenhain usually uses RL, RR and R0 for lateral compensation.
Related:DT
Other codes in Compensation
Frequently Asked Questions (FAQ)
What does G40/G41/G42 mean in a CNC program?
Activates or cancels tool radius compensation. In the catalogue it appears as "Radius compensation", within the Compensation family.
How is G40/G41/G42 written on each control?
Fanuc: G41/G42 D... · Haas: G41/G42 D... · Heidenhain: RL / RR / R0 · ISO común: G40 / G41 D... / G42 D.... The exact syntax depends on the control version and the machine parameters: always confirm with the manufacturer's manual.
Can you give me an example of G40/G41/G42?
G01 G41 D01 X50 Y0 F200 — Activates or cancels tool radius compensation.
Which other codes is G40/G41/G42 combined with?
In practice G40/G41/G42 appears alongside these codes: G43, D, T. It is worth reading them together, because the state one leaves behind conditions what the next one does.
Which machines use G40/G41/G42?
G40/G41/G42 is used in: Milling, Turning, Mill-turn.
What should you watch out for with G40/G41/G42?
High risk: a mistake here can cause a crash, a broken tool or an out-of-tolerance part. Simulate the program and dry-run it before cutting.
Related tools
CNC G-code Simulator
CNC IDE: editing with G/M tooltips, line inspector, conversion between controls and 2D/3D toolpath.
CNC Alarms Guide
CNC Alarms and Solutions Guide. Enter the error code or symptom to find the cause and how to repair it at the machine.
Calculate cycle time
Estimate CNC turning and milling cycle time from G-code. Calculate parts per hour with a breakdown of cutting, rapids, canned cycles and tool changes.