G17 G-code

Change Planes

G17 means “select the XY plane for circular interpolation”.

This command sets the plane used for arc motions in G2 and G3 commands. It controls the interpretation of the I, J, and K offset parameters:

  • In the XY plane: I and J offsets define the arc center, K is ignored
  • Other planes can be selected with G18 (XZ) or G19 (YZ)

Smoothieware starts in G17 mode by default, so the XY plane is the initial plane selection.

This command is modal, meaning once executed, all subsequent arc commands remain in XY plane mode until you switch to a different plane with G18 or G19.

Format

The command is used as:

G17

Which means: Configure arc commands (G2 and G3) to operate in the XY plane.

Parameters

No parameters.

Examples

Select XY plane and execute an arc:

G17        ; Select XY plane (default)
G2 X10 Y20 I5 J5 F100  ; Clockwise arc to (10, 20) with center offset (5, 5)

Switch between planes:

G17        ; XY plane
G2 X10 Y10 I5 J5      ; Arc in XY plane

G18        ; Switch to XZ plane
G2 X10 Z10 I5 K5      ; Arc in XZ plane (different axes)

G17        ; Back to XY plane
G3 X20 Y20 I10 J10    ; Counter-clockwise arc in XY plane

V1 and V2 Compatibility

V1 Implementation:

  • Source: Robot.cpp line 570
  • Function: select_plane(X_AXIS, Y_AXIS, Z_AXIS)
  • Sets plane_axis_0 = X_AXIS, plane_axis_1 = Y_AXIS, plane_axis_2 = Z_AXIS
  • Fully supported and functional
  • Used for arc interpolation in G2/G3 commands
  • Modal command that persists until changed

V2 Implementation:

  • Source: Robot.cpp line 1048
  • Function: select_plane(X_AXIS, Y_AXIS, Z_AXIS) (identical)
  • Sets plane_axis_0 = X_AXIS, plane_axis_1 = Y_AXIS, plane_axis_2 = Z_AXIS
  • Fully supported with identical behavior to V1
  • Used for arc interpolation in G2/G3 commands
  • Modal command that persists until changed

Status: Identical implementation across V1 and V2 - no behavioral differences.

  • G18 - Select XZ plane
  • G19 - Select YZ plane
  • G2 - Clockwise arc motion
  • G3 - Counter-clockwise arc motion

Further Reading

These resources are used as references for G-code:

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.