G17, G18 and G19 select the working plane — the pair of axes the
control uses to interpret circular moves (G2/G3), cutter compensation,
and canned cycles:
G17— XY plane (the default; arcs useI/J)G18— ZX plane (lathe convention; arcs useI/K)G19— YZ plane (arcs useJ/K)
The third axis — the one perpendicular to the active plane — becomes the helix axis for spiral arcs and the drilling axis for canned cycles.
#What the plane changes
An arc block is only two-dimensional: start point, end point, center. The
plane tells the control which two of the three axes those live in. The
same G2 block means a different curve under each plane:
G17 G2 X10 Z-5 I5 J0 ; arc in XY, helixing down in Z
G18 G2 X10 Z-5 I5 K0 ; arc in ZX — a completely different shape
Cutter compensation (G41/G42) offsets the tool within the active plane,
and canned cycles plunge along its normal. That's three separate systems
all quietly keyed to one modal setting — which is why the plane belongs in
every program's preamble even though 3-axis mill work never changes it:
G21 G90 G17 G54 ; mm, absolute, XY plane, work offset 1
| Operation | LinuxCNC | GRBL | Centroid | FANUC | Mach3 | Mach4 | Notes |
|---|---|---|---|---|---|---|---|
| Select XY plane | G17 |
G17 |
G17 |
G17 |
G17 |
G17 |
Default. Arcs use I/J. |
| Select ZX plane | G18 |
G18 |
G18 |
G18 |
G18 |
G18 |
Arcs use I/K. |
| Select YZ plane | G19 |
G19 |
G19 |
G19 |
G19 |
G19 |
Arcs use J/K. |
— means the control has no equivalent code. Full cross-control tables: the complete G-code & M-code reference.
#When you actually switch planes
- Lathes run in G18 by convention — the tool moves in Z (along the spindle) and X (diameter). Lathe posts emit G18 in the preamble the same way mill posts emit G17.
- Arcs on a vertical face: rounding an edge with the side of a ball or bull nose cutter means the arc lives in ZX or YZ. Switch in, cut the arc, switch back.
- Rotated setups (horizontal machines, angle heads) can put the "logical" drilling axis somewhere other than Z.
If none of those apply, the correct number of plane changes in your
program is zero — one G17 at the top.
#Common mistakes
- Inheriting the wrong plane. A previous lathe-style program leaves
G18 active; your next file's arcs alarm or cut garbage. The preamble
G17costs nothing and prevents it. - Wrong I/J/K pair for the plane. Posting
I/Jwords while G18 is active is either an error or — worse — a silently different arc. If arcs fail right after a plane change, check the offset words first. - Canned cycles in a non-G17 plane by accident. The cycle drills along the plane normal. Under G18 that's the Y axis — an alarming surprise on a vertical mill.