Mastering G19: YZ Plane Selection for CNC Machining
In CNC machining, the G17
, G18
, and G19
G-codes are used to select the active working plane. While G17
(XY plane) is the default for most milling operations and G18
(XZ plane) is standard for turning, the G19
G-code selects the YZ plane. This article provides a comprehensive guide to understanding and using G19
, covering:
- The concept of plane selection.
- The specific function of
G19
. - When to use
G19
on machining centers (mills). - When (and why)
G19
is rarely used on lathes. - How
G19
affects circular interpolation (G02
/G03
) and cutter compensation (G41
/G42
). - Control-specific considerations (Fanuc, Siemens, Haas, Mazak, Mitsubishi).
- Troubleshooting tips.
- The role of CAM software.
Crucial Note: Always consult the programming manuals for your specific CNC control system and machine tool. While G17
, G18
, and G19
are generally standardized, there might be subtle variations.
1. Plane Selection: The Foundation
CNC machines operate in 3D space, but many operations are planned and executed within a 2D plane. Plane selection G-codes tell the control which two axes define this plane. This is critical for:
- Circular Interpolation (
G02
/G03
): The control needs to know in which plane to draw the arc. - Canned Cycles (Drilling, Tapping, etc.): These cycles usually operate perpendicular to the selected plane.
- Cutter Compensation (
G41
/G42
): The control needs to know in which plane to offset the toolpath. - Rotary Axes: Correct plane definition is essential.
2. G17, G18, and G19: The Three Planes - A Quick Review
G-Code | Plane | Milling (Typical) | Turning (Typical) |
---|---|---|---|
G17 |
XY | Default, most operations | Face milling (with live tooling & C-axis) |
G18 |
XZ | Side milling (tool axis parallel to Y) | Default, standard turning operations |
G19 |
YZ | Side milling (tool axis parallel to X) | Rare, specialized applications (with live tooling) |
3. G19 Syntax
The syntax is very simple:
G19 ; Select the YZ plane
G19
is a modal G-code. It remains active until another plane selection command (G17
or G18
) is programmed.
4. G19 on CNC Machining Centers (Mills): When and Why
While G17
(XY plane) is the default and most common working plane on mills, G19
(YZ plane) is used for specific situations:
-
Side Milling (Tool Axis Parallel to X): The primary reason to use
G19
on a mill is when you need to machine a feature on a surface that is parallel to the YZ plane. This means the tool axis (the direction the tool is pointing) is parallel to the X-axis. -
Specialized Canned Cycles: Rarely, a specific canned cycle might require
G19
(always consult your machine’s manual). -
5-Axis Machining:
Examples (Milling - G19):
- Milling a Vertical Slot (YZ Plane):
G17 ; Ensure you are in default mode first.
G00 X5.0 Y0 Z0 ; Rapid to start (X is now the tool axis)
G19 ; Select YZ plane <-- ESSENTIAL
G01 Y-0.25 F100 ; Feed to depth (Y is depth in this case)
G01 Z-2.0 F50 ; Mill the slot along the Z-axis
G00 Y0 ; Rapid retract in Y
G17 ; Return to XY plane (IMPORTANT!)
- Circular Interpolation in YZ (G19):
G17
G00 X5.0 Y0 Z0 ; Rapid to start
G19 ; Select YZ plane
G01 Y-0.25 F100 ; Feed to depth
G03 Y-1.0 Z-1.0 J-0.5 K0.0 F30 ; Counter-Clockwise arc in YZ plane
G17; Return to default.
- Cutter Compensation:
G17
G00 X5.0 Y0 Z0 ; Rapid to start
G19 ; Select YZ plane
G41 D1; Cutter compensation.
G01 Y-0.25 F100 ; Feed to depth
G03 Y-1.0 Z-1.0 J-0.5 K0.0 F30 ; Counter-Clockwise arc in YZ plane
G40; Cancel Compensation.
G17; Return to default.
5. G19 on CNC Lathes (Very Rare)
On standard 2-axis CNC lathes, G19
is almost never used. G18
(XZ plane) is the standard turning plane.
However, on lathes with live tooling (a milling spindle) and a Y-axis, G19
could theoretically be used for milling operations where the tool is oriented along the X-axis and cutting in the YZ plane. This is a very specialized application.
Hypothetical Example (Lathe with Live Tooling and Y-axis - Highly Unusual):
; **WARNING: This is a highly unusual example. Most lathes do NOT use G19.**
; **Consult your machine's manual before attempting anything like this.**
G28 U0 W0 ; Home
T0101 M06 ; Select milling tool (live tooling)
G97 S2000 M03 ; Spindle on (constant RPM)
G00 X5.0 Y0 Z0 ; Rapid to a safe position (X is tool axis!)
G19 ; Select YZ plane <-- VERY UNUSUAL on a lathe!
G01 Y-0.25 F100 ; Feed to depth (Y is depth)
G01 Z-2.0 F50 ; Mill a slot along the Z-axis
G00 Y0 ; Rapid retract
G18 ; Return to XZ plane (ESSENTIAL!)
G28 U0 W0; Home
M30 ; Program end
%
Key Point: This example is highly unusual. Most milling on a lathe with live tooling is done in either:
G17
(XY plane): For milling on the face of the part (using a virtual C-axis).G18
(XZ plane): For milling on the circumference of the part (using cylindrical interpolation, if supported).
6. Interaction with Other G-Codes (Review)
G02
/G03
(Circular Interpolation): The active plane dictates howG02
andG03
are interpreted.G41
/G42
(Cutter Compensation): Cutter compensation is plane-dependent.- Canned Cycles: Most canned cycles are plane-dependent.
G90
/G91
(Absolute/Incremental): Not directly affected by plane selection, but be aware of the active plane.
7. Control-Specific Variations
- Fanuc:
G17
,G18
, andG19
are standard. - Siemens:
G17
,G18
, andG19
are standard. - Haas:
G17
,G18
, andG19
are standard. - Mazak:
G17
,G18
, andG19
are standard in EIA/ISO mode. Mazatrol handles planes differently. - Mitsubishi:
G17
,G18
, andG19
are standard. - Other Controls: Always consult your documentation.
8. Troubleshooting
- Incorrect Tool Movements: Wrong plane selected is the most likely cause.
- Circular Interpolation Errors: Double-check the plane selection if using
G02
/G03
. - Cutter Compensation Issues: Ensure you are using cutter compensation on the correct plane.
9. CAM Software
CAM software handles plane selection automatically. You define the workpiece orientation and machining operations, and the CAM system selects the appropriate plane (G17
, G18
, or G19
) for each toolpath.
10. Frequently Asked Questions (FAQ)
- Q: What’s the difference between G17, G18, and G19?
- A: They select different working planes:
G17
(XY),G18
(XZ),G19
(YZ).
- A: They select different working planes:
- Q: Which plane should I use for turning?
- A:
G18
(XZ plane) for standard turning.G17
(XY plane) for face milling with live tooling.
- A:
- Q: Which plane is the default on a milling machine?
- A:
G17
(XY plane) is the default on most mills.
- A:
- Q: Can I change planes in the middle of a program?
- A: Yes, but you must be very careful.
- Q: When would I use G19 on a mill?
- A: For side milling when the tool axis is parallel to the X-axis.
11. Conclusion
The G19
command selects the YZ plane for CNC machining operations. While G17
(XY) is the default for milling and G18
(XZ) is the standard for turning, G19
is essential for side milling operations on machining centers where the tool is oriented along the X-axis. On lathes, G19
is very rarely used, even with live tooling. Understanding plane selection is critical for accurate circular interpolation, cutter compensation, and canned cycle execution. Always consult your machine’s documentation and, for complex operations, use CAM software