G17, G18, G19: CNC Plane Selection Explained – Essential for Circular Moves
In CNC programming, plane selection defines the active 2D plane for circular interpolation (G2/G3) and canned drilling cycles (like G81, G83). It tells the controller which axes form the arc or the drill movement pattern.
Neglecting plane selection can result in:
- Arcs moving in the wrong direction
- Circular motions not executing correctly
- Invalid drilling operations
🧭 Plane Selection G-Codes
| Code | Active Plane | Axes Involved |
|---|---|---|
| G17 | XY Plane | X and Y (Z normal) |
| G18 | XZ Plane | X and Z (Y normal) |
| G19 | YZ Plane | Y and Z (X normal) |
- These set the plane for arc commands (G2/G3) and some drilling cycles.
- Default plane is G17 (XY) on most controllers.
🔁 Why It Matters – G2/G3 Arcs
Circular interpolation (G2 for CW, G3 for CCW) uses a selected plane to define the arc. Without proper plane selection, the tool may move unpredictably.
Example:
G17 ; XY plane
G2 X50 Y50 I25 J0 ; Arc move in XY
If G18 or G19 were active, this would produce an incorrect or even illegal arc.
🧪 Real-World Example – G18 (XZ Plane Arc)
Let’s say you’re cutting a contour on a vertical face.
G18
G2 X50 Z-20 I25 K0 ; Arc in XZ plane
IandKare used instead ofIandJ- This would not work if G17 was active
🔩 Canned Drilling Cycles
Some cycles like G81 (drilling), G83 (peck drilling) operate along the plane normal. If you’re drilling in a face perpendicular to the XY plane, you’d need G18 or G19.
G19 ; Activate YZ plane
G81 Y0 Z-20 R2 F150 ; Drilling along X-axis (uncommon but possible)
🧠 Tip: Always Set the Plane Explicitly
Even if G17 is the default, it’s best practice to include it in your program header.
G21 G90 G17 G40 G49
This ensures that circular moves behave consistently — especially important when using CAM output or switching between machines.
📊 Summary Table
| G-Code | Plane | Main Use Cases |
|---|---|---|
| G17 | XY | 2D profiling, face milling, top-down arcs |
| G18 | XZ | Side contouring, lathe face cuts, vertical arcs |
| G19 | YZ | 5-axis drilling, rare side face milling |
🚫 Common Mistakes
| Mistake | Result | Fix |
|---|---|---|
| Forgetting G17 | Arcs not executing correctly | Set G17 at program start |
| Using wrong plane for G2/G3 | Arc in unexpected direction or crash risk | Set appropriate G17/G18/G19 before arc |
| Drilling on angled face | Drill travels incorrectly | Use correct plane for complex drilling |
🧪 Example: Complete Program with Multiple Planes
%
O4001 (Plane Selection Demo)
G21 G90 G17
T1 M6
G0 X0 Y0
G43 H1 Z100
S1500 M3
(--- XY plane arc ---)
G1 Z5 F200
G3 X50 Y0 I25 J0
G1 Z100
(--- XZ plane arc ---)
G18
G0 X0 Z5
G3 X50 Z-20 I25 K0
G1 Z100
(--- Reset to XY plane ---)
G17
M30
%
💡 CAM Integration
Most modern CAM software auto-selects the required plane for 3D toolpaths, especially in:
- 5-axis machining
- Rotary operations
- Undercut strategies
However, if you’re writing manual code or editing CAM output, verifying G17/G18/G19 is crucial.
🔚 Final Thoughts
Plane selection is a fundamental but often overlooked part of CNC programming. Mastering it ensures:
- Accurate arcs and interpolations
- Safe and predictable tool movement
- Compatibility with advanced cycles and CAM-generated code
Don’t just move in circles — move in the right plane.
Leave a comment