G17 G18 G19 Explained: Plane Selection in CNC Machining and Circular Interpolation
In CNC machining, the controller needs to know which 2D plane you’re working in to correctly execute arc movements (G02/G03) and canned cycles. That’s where G17, G18, and G19 come into play.
These G-codes define the active working plane — affecting how the machine interprets circular moves, helical paths, and even drill cycles.
📘 Quick Overview
| G-Code | Plane | Axes Used | Typical Application |
|---|---|---|---|
| G17 | XY | X/Y movement | Milling, face profiling |
| G18 | XZ | X/Z movement | Lathe OD/ID turning |
| G19 | YZ | Y/Z movement | Milling side profiling |
🧭 G17 – XY Plane (Default for Mills)
G17
G02 X20 Y20 I10 J0
- Arcs are calculated in the XY plane
- Most common on 3-axis mills
- Standard for pocketing, face milling, contouring
✅ This is the default plane on most CNC mills.
🧱 G18 – XZ Plane
G18
G03 X30 Z-10 I5 K0
- Arc motion occurs in the XZ plane
- Common in turning (lathes)
- Used for OD profiling, front-facing arcs, tapered threads
Essential for lathe programming and front tool paths.
🧱 G19 – YZ Plane
G19
G02 Y10 Z-5 J2 K0
- Arcs are in the YZ plane
- Used for side milling, 5-axis contouring, or slotting on part sides
- Often combined with
G41/G42for cutter compensation in YZ
Rare in 3-axis work, but common in multi-axis mills or complex dies/molds
🧠 Why Plane Selection Matters
Plane selection affects:
- Arc direction and radius interpretation
- Canned cycles behavior (
G81,G83, etc.) - Cutter compensation orientation
- Toolpath output from CAM
If the wrong plane is active, your arcs may produce unexpected or dangerous moves.
✅ Best Practices
- Always set the correct plane before G02/G03 or canned cycles
- Reset plane after subprograms if needed
- Use
G17at start of milling programs - CAM software often handles plane selection automatically — verify post-processor output
🔁 Example Program with Plane Switching
G17 ; XY plane (face milling)
G02 X50 Y0 I25 J0
G18 ; XZ plane (lathe contour)
G03 X20 Z-10 I0 K5
G19 ; YZ plane (side slotting)
G02 Y10 Z-5 J0 K5
G17 ; Return to default
🧠 Summary Table
| Plane | G-Code | Axes | Typical Use |
|---|---|---|---|
| XY | G17 | X/Y | Face milling, contours |
| XZ | G18 | X/Z | Turning, front arcs |
| YZ | G19 | Y/Z | Side milling, slotting |
Leave a comment