[ CNCCookbook’s G-Code Tutorial ]
What are Plane Selection G-Codes (G17, G18, and G19) used for?
It’s convenient to refer to planes for various purposes. A plane is a flat 2-dimensional space defined by two axes. For example, the default plane on most mills is XY. If you draw an arc without specifying a change in the plane, it will be drawn on the XY plane. There is a plane for each combination of the linear axes XYZ.
The G17, G18, and G19 G-Codes select which plane is active.
- G17: XY
- G18: XZ
- G19: YZ
Here is a visual representation of the planes:
Plane selection is modal, so once you have established a plane all future arcs will be against that plane until a different plane selection g-code is invoked.
The selected working plane affects the following commands:
- G02/G03 circular (arc) interpolation
- G16: polar coordinates
- G41/G42: Cutter radius compensation. Radius compensation is relative to the selected plane.
- G43/G44: Cutter length compensation. Length compensation is along the axis that is perpendicular to the selected plane.
- Many canned cycles.
It's a good idea to include a plane selection gcode such as G17 in the preamble or safety block at the top of your g-code program. Most g-code operates in G17 mode and you will seldom use G18 or G19.
Example Use: Right Angle Heads on Milling Machines
FAQs
What is the function of G17?
The G17 gcode specifies the XY plane as the working plane.
What is G18 on a lathe?
The G18 gcode specifies XZ as the active plane on a lathe.
What is the difference between G17 and G18 CNC?
G17 specifies XY as the active plane while G18 specifies XZ as the active plane.
What is the g-code G19?
G19 specifies YZ as the active plane.
What plane is G18?
G18 selects the XZ plane. The active plane determines how the tool path of an arc is interpreted.
Be the first to know about updates at CNC Cookbook
Join our newsletter to get updates on what's next at CNC Cookbook.