How to Program Chamfer in CNC: Simple Guide with Examples
To program a chamfer in CNC, use
G01 linear interpolation with angled moves or G41/G42 tool radius compensation for chamfering tools. Specify the chamfer angle and length by moving the tool along the edges at the correct angle using coordinates or incremental moves.Syntax
The basic way to program a chamfer is by using G01 for straight cutting moves at an angle. You specify the end point coordinates to create the chamfer edge. Alternatively, use G41 or G42 for tool radius compensation when using a chamfer tool.
G01 X... Y... Z... F...: Linear move to create chamfer edgeG41/G42 D...: Tool radius compensation left/rightF...: Feed rate for cutting speed
gcode
N10 G90 G00 X0 Y0 Z5
N20 G01 Z-5 F100
N30 G01 X10 Y10 F200 ; chamfer edge move
N40 G00 Z5Example
This example shows how to program a 45-degree chamfer on a corner by moving the tool diagonally from (0,0) to (10,10) while lowering the Z-axis to cut the chamfer.
gcode
N10 G90 G00 X0 Y0 Z5 N20 G01 Z-2 F100 N30 G01 X10 Y10 Z-2 F150 ; chamfer cut at 45 degrees N40 G00 Z5 N50 G00 X0 Y0
Output
Tool moves to start at X0 Y0 Z5
Tool plunges to Z-2
Tool moves diagonally to X10 Y10 Z-2 cutting chamfer
Tool retracts to Z5
Tool returns to start
Common Pitfalls
Common mistakes include:
- Not setting the correct feed rate, causing poor surface finish.
- Forgetting to use
G90(absolute) orG91(incremental) mode correctly, leading to wrong tool paths. - Not retracting the tool before rapid moves, risking collisions.
- Using wrong tool radius compensation direction (
G41vsG42).
gcode
N10 G91 G01 X10 Y10 F200 ; wrong: incremental mode may cause wrong chamfer
N20 G90 G01 X10 Y10 F200 ; right: absolute mode for correct chamferQuick Reference
| Command | Description |
|---|---|
| G01 | Linear interpolation for cutting moves |
| G00 | Rapid positioning (non-cutting) |
| G41 | Tool radius compensation left |
| G42 | Tool radius compensation right |
| F | Feed rate (cutting speed) |
| G90 | Absolute positioning mode |
| G91 | Incremental positioning mode |
Key Takeaways
Use G01 with angled moves to program chamfers precisely.
Set correct feed rates and positioning modes to avoid errors.
Tool radius compensation (G41/G42) helps when using chamfer tools.
Always retract the tool safely before rapid moves.
Double-check coordinate mode (absolute vs incremental) for correct paths.