Guide to G17 XY Plane Selection in CNC Programming
Learn how to program the G17 XY plane selection command on Fanuc, Siemens, and Mitsubishi. Prevent coordinate shifts and machine tool collisions.
Understanding G17 Plane Selection and Production Risks
An incorrect tool length compensation command like G43 Z_ H_ executed while setting up parallel axes incorrectly under G17 plane selection leads to sudden, massive coordinate shifts. When the coordinate system shifts unexpectedly near workholding devices, the tool turret moves along an unintended path, leading to a catastrophic hard collision. The spindle slams directly into a table-mounted physical vise jaw, the rotating jaws of a workpiece chuck, or a hydraulic fixture clamp. This crash shatters the carbide insert, bends the spindle shaft, destroys the spindle bearings, and results in a heavily damaged scrap part while triggering a critical machine halt alarm like Fanuc Alarm PS0037, Alarm PS0330, or Mitsubishi Program Error P452. Operators must strictly verify their coordinate system offsets and software barrier configurations on the control screen before executing automatic cycles.
Technical Summary of G17 Commands
The following table provides the operational specifications of the G17 plane selection command:
| Operational Parameter | Technical Specification |
|---|---|
| G-Code Command | G17 |
| Modal Group | Group 02 (Fanuc / Mitsubishi) / Group 06 (Siemens SINUMERIK) - Plane Selection (Modal) |
| Compatible Brands | Fanuc, Siemens, Mitsubishi |
| Primary Parameters | Fanuc No. 5101 Bit 0 (FXY), Siemens MD20150 $MC_GCODE_RESET_VALUES, Mitsubishi Parameter #1025 I_plane |
| Operational Constraints | Cannot switch planes while cutter compensation (G41/G42) is active. Tapping/drilling coordinates must lie on the active plane. Parallel axes configurations must match parameter designations. |
Quick Read: Key Rules for Plane Selection
- Select G17 at the start of the program to establish the XY plane as the default for milling, circular interpolation, and tool radius compensation.
- Deactivate cutter compensation with G40 before attempting to switch working planes to avoid triggering active compensation alarms.
- Define parallel axes mapping using Parameter No. 1022 on Fanuc, MD20112 on Siemens, or Parameters #1029 to #1031 on Mitsubishi before utilizing alternative axes.
- Match coordinate addresses in the G-code block to the active plane to prevent travel endpoint errors or axis command alarms.
- Establish virtual safety zones using Chuck Barriers and Tailstock Barriers (G22/G23) on the setup screens to protect physical fixtures.
- Verify coordinate orientations and clearance planes by running a first-article dry run "in the air" before cutting raw stock.
Basic Concepts of CNC Plane Selection
Establishing the G17 plane defines the two-dimensional workspace (XpYp plane for Fanuc/Mitsubishi, X/Y working plane for Siemens) for executing circular interpolation (G02/G03), tool radius or nose radius compensation (G41/G42), and canned drilling cycle positioning (G81-G89). Under this active plane, the perpendicular axis—typically the Z-axis (or its parallel W-axis)—serves as the tool infeed axis, depth axis, and drilling direction.
Unlike lathe setups that default to the G18 Z-X plane for turning operations, milling and machining centers default to G17. However, when executing operations like face-milling, cross-drilling, or slot-routing, programmers must explicitly declare G17 or G19 to ensure correct calculation of toolpath vectors and arc directions.
To coordinate advanced machine movements, programmers can integrate other cycles. For instance, when switching to polar geometries, understanding the relationships between plane selection and coordinates is key. Commands like G16 Polar Coordinate Command allow circular layouts relative to the active plane, while G15 Polar Coordinate Cancel restores Cartesian mode. When profiling, G12.1 Polar Coordinate Interpolation can interpolate a virtual linear axis with a rotary axis.
Managing coordinate offsets within the G17 plane prevents sudden deviations. If cutter compensation vectors are calculated incorrectly due to active plane mismatches, the tool path will deviate. Operators must configure their setup envelopes and verify spatial transformations before launching cycles.
Command Structure and Parameter Syntax
The G17 command is modal and requires no additional parameters to activate the default basic axes X and Y. When written as a standalone command, it instructs the controller's interpreter that all subsequent circular interpolations (G02 and G03), tool radius compensation vectors (G41 and G42), and drilling canned cycles will be calculated relative to the horizontal-vertical plane. The depth coordinates for milling and drilling are automatically mapped to the perpendicular Z-axis.
In advanced configurations, the G17 command can be paired with axis coordinates to designate parallel axes. For example, Fanuc and Mitsubishi allow the substitution of parallel axes such as U, V, or W (e.g., G17 U_ Y_;) to dynamically swap coordinates. On Siemens controls, this mapping is managed via system frames and geometry axis configurations rather than direct in-program coordinates, though bilingual dialect translators can interpret standard syntax format.
The basic command syntax is structured as follows:
G17 ;
The parameters governing plane selection behavior are summarized in the following table:
| Brand | Parameter Address | Technical Function | Valid Range |
|---|---|---|---|
| Fanuc | No. 5101 Bit 0 (FXY) | Switches drilling/tapping axis dynamically based on active plane (in G17, Zp). | Binary (0 or 1) |
| Fanuc | No. 5103 Bit 3 (PNA) | Generates Alarm PS0021 if plane selection command lacks axis coordinates. | Binary (0 or 1) |
| Fanuc | No. 5209 Bit 0 (RTX) | Defines drilling axis during side rigid tapping (G88). G17 plane: 0 = Yp, 1 = Zp. | Binary (0 or 1) |
| Fanuc | No. 1022 | Configures parallel axes (such as establishing U, V, W parallel to X, Y, Z). | Positive integers |
| Siemens | MD20150 $MC_GCODE_RESET_VALUES | Sets default plane on reset. Value 1 selects G17 (milling), value 2 selects G18 (turning). | Integer (1 or 2) |
| Siemens | MD20734 $MC_EXTERN_FUNCTION_MASK Bit 3 | Determines if syntax errors in the external ISO translator generate alarms. | Binary (0 or 1) |
| Siemens | MD18800 $MN_MM_EXTERN_LANGUAGE | Enables external NC language dialect interpreter (must be set to 1 for ISO G-code). | Binary (0 or 1) |
| Mitsubishi | Parameter #1025 I_plane | Configures default plane selection (G17, G18, or G19) at system boot or reset. | G-code integer |
| Mitsubishi | Parameters #1026 to #1028 | Sets primary physical geometry axes (typically X, Y, Z) for plane mapping. | Axis ID |
| Mitsubishi | Parameters #1029 to #1031 | Sets flat parallel axes (typically U, V, W) for dynamic substitution. | Axis ID |
| Mitsubishi | Parameter #1080 Dril_Z | Restricts rotated tapping cycle execution strictly to G17 plane when set to 1. | Binary (0 or 1) |
Brand-Specific Applications: Fanuc, Siemens, and Mitsubishi
Fanuc
Fanuc CNC systems utilize G17 as a modal G-code belonging to Group 02 to activate the XpYp plane. Circular interpolation (G02/G03), tool radius compensation (G41/G42), and canned cycles (G81-G89) are calculated on this plane. The perpendicular Zp-axis acts as the tool axis. Under legacy Series 15 program format, rigid tapping G84.2 strictly selects the drilling axis based on plane selection (forcing the Z-axis in G17). In G-code System A, incremental addresses U, V, and W cannot be configured as parallel axes. Parameters like No. 5101 Bit 0 (FXY), No. 5103 Bit 3 (PNA), and No. 5209 Bit 0 (RTX) govern drilling axis switching and alarm suppression. If a parallel axis is configured (e.g., A parallel to X via parameter No. 1022) and a chamfer is programmed using X instead of the parallel axis, Alarm PS0055 is triggered.
Warning: Failing to pre-position the axes before executing G17 offsets the polar coordinate origin. The tool turret can then travel along an unintended path, crashing into chuck jaws, vise jaws, or fixture clamps.
Siemens
Siemens SINUMERIK controls establish the orthogonal X/Y working plane via G17 in G-group 6, mapping X as the 1st axis, Y as the 2nd axis, and Z as the perpendicular 3rd axis. The bilingual transition mode allows switching between native Siemens mode (G290) and ISO Dialect mode (G291) within the same program file using MD18800 and option bit 19800. Tool orientation coordinate frames can be dynamically aligned to the tool tip using the TOFRAME and TOROT command suite. Furthermore, ShopMill and ShopTurn graphical parameters dynamically adapt positioning coordinates (XO/YO/Z1) based on the selected plane. Common alarms include Alarm 14800 (programmed path velocity less than or equal to zero) and Alarm 61003 (no feed programmed in the cycle). Features like G51.2 multi-edge turning and MD10604 working area limit deactivation are fully supported on the 840D sl but locked or unavailable on the 802D sl series.
Warning: Activating G17 under ISO mode while MD18800 is disabled triggers Alarm 61800, halting the machine. Trajectory errors can cause hard collisions with workholding chucks, vise jaws, or pneumatic clamps.
Mitsubishi
Mitsubishi CNC systems (M800/M80/E80/C80 Series) use G17 in Group 02 to select the abscissa-ordinate (I-J) working plane, which defaults to basic geometry axes X and Y. Parallel flat axes like U, V, or W can be substituted dynamically using the G17 I_ J_ format (e.g., G17 U_ Y_). A dynamic Axis Name Switch command (G111) allows on-the-fly axis remapping, which is not supported on Fanuc or Siemens. The milling mode default plane is configured via parameters #8113 and #8114, defaulting to G17 if both are 0. Under the special format option parameter #1265 ext01/bit2 = 1, setting parameter #1080 Dril_Z to 1 restricts rotated tapping strictly to the G17 plane, triggering Program Error P111 if called on G18 or G19. The M800/M80 series supports up to 8 digits for sequence number N, whereas the C80 is limited to 6 digits.
Warning: Attempting to cancel mirror image functions anywhere except at the exact mirror center while G17 is active causes coordinate deviations, driving the tool turret straight into chuck jaws, vise jaws, or fixture clamps.
Cross-Brand Technical Comparison
The following table compares the plane selection command characteristics across Fanuc, Siemens, and Mitsubishi controllers:
| Technical Feature | Fanuc | Siemens | Mitsubishi |
|---|---|---|---|
| Parallel Axis Selection | Configured statically via parameter No. 1022 to map parallel axes (U, V, W). | Assigned via geometry axis mapping. Supports dynamic orientation to tool tip via TOFRAME/TOROT. | Programmable dynamically at runtime using the G111 Axis Name Switch command. |
| Drilling / Tapping Axis | Perpendicular Zp-axis is the drilling axis. Series 15 rigid tapping (G84.2) axis is strictly plane-controlled. | Determined by ShopMill/cycle screen parameters (XO/YO/Z1) translating into dynamic cycle calls. | Perpendicular Zp-axis is standard. Coordinate rotated tapping restricted to G17 under special format #1080 Dril_Z=1. |
| Milling Mode Default Plane | Rigidly defaults to G17 XY plane when Milling Mode is active. | Managed by TRANSMIT/TRACYL kinematic transformation commands. | Configurable via milling initial parameters #8113 and #8114 (defaults to G17 if both 0). |
| Bilingual Mode Transition | Requires distinct parameter configurations to toggle NC dialects. | Dynamically switches between Siemens (G290) and ISO Dialect (G291) modes in the same program. | Uses separate G-code parameter lists for lathe/milling systems. |
Deep Technical Analysis of Controller Behaviors
The primary architectural difference in G17 plane handling among the three major controller brands lies in axis versatility and programming flexibility. Mitsubishi stands out with its dynamic runtime axis remapping via the G111 command, allowing operators to change coordinate assignments on the fly. In contrast, Fanuc relies on rigid parameter mappings (such as Parameter No. 1022) that are static during execution. Fanuc's G-code System A also restricts incremental addresses (U, V, W) from being configured as parallel axes for plane selection. Siemens manages working planes by leveraging coordinate frame transformations (such as TOFRAME and TOROT) that dynamically rotate the working plane relative to the tool tip, a powerful multi-axis capability.
The handling of drilling and tapping axes during canned cycles also highlights controller differences. Under Fanuc's legacy Series 15 program format, the active tapping axis during rigid tapping G84.2 is strictly determined by the active plane; G17 forces the Z-axis, while G18/G19 shifts it to Y/X. Siemens avoids these interpreter limitations entirely through ShopMill and ShopTurn graphical interfaces, where the active plane is selected via a drop-down menu and coordinates dynamically adapt (XO/YO/Z1). Mitsubishi restricts coordinate-rotated tapping to the G17 plane when parameter #1080 Dril_Z is set to 1 under its special format option, a constraint not present in the other two brands.
System resets and default initialization settings also show variations. Siemens configures the default power-up G-code plane through machine data MD20150, where milling defaults to G17 and turning defaults to G18. Mitsubishi controls default plane initialization via parameter #1025, and default milling planes via parameters #8113 and #8114. Fanuc defaults are tied to G-code group states. These differences dictate the initial modal environment of the machine, affecting how programs restart after a reset.
G-Code Programming Examples and Dry Runs
Fanuc Milling Example
G17 G90 G54 G00 X0 Y0 Z50.0 ;
G43 H01 Z10.0 ;
G01 Z-5.0 F200 ;
G41 D01 X20.0 Y20.0 ;
G03 X20.0 Y20.0 I-20.0 J0 F150 ;
G40 G01 X0 Y0 ;
G00 Z50.0 ;
dry run: Shift the work coordinate system Z-axis zero upwards away from the workpiece. Execute the program to verify that G17 activates the XY plane. Confirm that the left cutter compensation G41 executes correctly on the XY coordinates and that circular interpolation G03 executes an arc without triggering Alarm PS0037. Check that G40 cancel is active before any plane changes are initiated.
Siemens Milling Example
G290 ;
G17 T1 D1 ;
G90 G00 X0 Y0 Z50.0 ;
G01 Z-5.0 F200.0 ;
G41 X20.0 Y20.0 ;
G02 X40.0 Y20.0 CR=10.0 F150.0 ;
G40 G01 X0 Y0 ;
G00 Z50.0 ;
dry run: Perform a dry run with the spindle off. Confirm that the parser compiles native Siemens mode (G290) and that selecting G17 applies tool length compensation correctly along the Z-axis. Verify that the tool nose compensation G41 acts on the X/Y geometry axes and that circular interpolation G02 follows the expected 10mm radius arc path before G40 is executed.
Mitsubishi Milling Example
G17 G90 G00 X0 Y0 ;
G43 H01 Z50.0 ;
G01 Z-5.0 F200 ;
G41 D01 X20.0 Y20.0 ;
G03 X20.0 Y20.0 I-20.0 J0 F150 ;
G40 G01 X0 Y0 ;
G00 Z50.0 ;
dry run: Run the program with axis feeds bypassed. Verify that G17 selection maps default geometry axes X and Y. Confirm that the tool moves to coordinates X20.0 Y20.0 with compensation active and performs circular interpolation G03. Verify that no G111 command is nested inside active compensation, preventing Program Error P111 or P411.
Error Analysis and Diagnostic Troubleshooting
Incorrect programming syntax or improper modal states during plane selection activate specific alarm codes. The table below details common errors, their causes, and how to resolve them across all three brands:
| Brand | Alarm Code | Trigger Condition | Operator Symptom | Root Cause / Fix |
|---|---|---|---|---|
| Fanuc | Alarm PS0037 | Attempting to switch planes (G17/G18/G19) while cutter radius compensation (G41/G42) is active. | The CNC control halts axis travel immediately, and an active compensation alarm is displayed. | Deactivate tool radius compensation with G40 before executing a plane change. |
| Fanuc | Alarm PS0055 | Chamfering instruction given to basic axis when parallel axis is active in G17 parameters. | Interpreter halts execution at the start of the chamfering block. | Match the programmed coordinate address to the active axis (e.g. use parallel U instead of basic X). |
| Siemens | Alarm 14800 | Path velocity is less than or equal to zero during an axis move in G17 mode. | The controller stops the axis feedrate and throws a velocity warning. | Program a valid non-zero feedrate F in the block or establish a global feedrate. |
| Siemens | Alarm 61800 | ISO dialect G-codes are interpreted but MD18800 or option bit 19800 is disabled. | The compiler rejects the G-code block, and program execution is halted. | Configure MD18800 to 1 and ensure the external language option is enabled. |
| Mitsubishi | Program Error P111 | Tapping cycle called during coordinate rotation on G18/G19 when #1080 Dril_Z is set to 1. | The cycle execution is aborted, and a program format error is displayed on the screen. | Select the G17 plane before executing coordinate rotated tapping. |
| Mitsubishi | Program Error P396 | Coordinates in geometric commands do not lie on the selected plane, or plane changed inside arc. | The controller stops execution during geometry calculations. | Ensure coordinates match the active G17 plane and avoid plane switches within geometry sequences. |
Application Notes for Shop Floor Integration
A catastrophic spindle crash, shattered tooling, and a ruined scrap part occur when operators execute a tool length compensation command like G43 Z_ H_ incorrectly or configure parallel axes mismatched to the actual G17 setup coordinates. If the coordinate system shifts unexpectedly, the tool turret moves along an unintended trajectory, driving the cutter directly into a table-mounted physical vise jaw, the rotating jaws of a workpiece chuck, or a hydraulic fixture clamp. To prevent these mechanical crashes, operators must establish virtual safety envelopes using Chuck Barriers and Tailstock Barriers (G22/G23) on the control panel, while strictly verifying starting coordinates on the control screen before executing automatic cycles.
Related G-Codes and Command Network
- G18 (ZX Plane Selection) and G19 (YZ Plane Selection): Used to select alternative working planes for circular interpolation and tool radius compensation when milling or turning along different coordinate axes.
- G12.1 Polar Coordinate Interpolation: Activates milling mode on lathe systems to interpolate a virtual linear axis with a rotary axis, transforming polar movements on the G17 plane.
- G16 Polar Coordinate Command: Enables polar programming where coordinates represent radius and angle values calculated within the active G17 plane.
- G15 Polar Coordinate Cancel: Cancels the polar coordinate command mode, returning the controller to standard Cartesian coordinates.
- G40, G41, G42 (Cutter radius / tool nose compensation commands): Must be coordinated with the active G17 plane to allow the preprocessor to correctly calculate tool offset vectors.
Conclusion and Operational Takeaways
Before launching automatic machining cycles, programmers must explicitly declare G17 at the program header to ensure all milling contours and tool radius compensation vectors are calculated on the correct XY plane. Deactivating cutter compensation (G40) before changing planes, confirming parallel axis parameters, and performing a dry run in the air are standard operating procedures to protect the machine spindle and workholding from damage.
Frequently Asked Questions (FAQ)
How does the G17 plane affect canned drilling cycles like G81?
The active G17 plane establishes the XY coordinates as the positioning plane while designating the perpendicular Z-axis as the drilling and tool depth axis. To prevent positioning errors, programmers must verify that parameter FXY (Parameter No. 5101 Bit 0) is set to 1 on Fanuc systems to allow dynamic drilling axis switching, and program depth coordinates strictly along the Z-axis.
Can I switch the working plane from G17 to G18 while G41 cutter compensation is active?
No. Attempting to change planes while tool radius compensation is active will trigger Alarm PS0037 on Fanuc or geometry errors on Mitsubishi, halting the machine. Action: Always program a G40 command to cancel cutter compensation before selecting a new working plane like G18 or G19.
How do Siemens controls handle polar coordinates differently on the G17 plane?
Unlike Fanuc and Mitsubishi which use modal G16 and G15 commands, Siemens controls in native mode define a pole using G110, G111, or G112 commands, and then specify radius (RP) and angle (AP) values directly in motion blocks. Action: When running legacy G16 programs on Siemens, switch to ISO Dialect mode via G291 and ensure MD18800 is set to 1.
Still not resolved?
Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

- CNC CARE Co-Founder (May 2025 - Present)
- Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
- Reis CNC Service Engineer (2003 - 2008)
- Ören Kalıp CNC Mold Line Team Leader (1999 - 2002)
With over 25 years of experience working in all areas of the CNC machine industry, I continue my activities as a co-founder of CNC CARE, where we offer brand-independent consulting, engineering, and original spare parts services.
Related Articles
Other articles on this topic
G27 Reference Position Return Check: CNC Guide for Multi-Brand Systems
Master the CNC G27 reference position return check on Fanuc, Siemens, and Mitsubishi controls. Learn parameters like MD 34100 and fix Alarm 61816.
Siemens SINUMERIK G26 Upper Working Area & Spindle Speed Limit
Master the Siemens SINUMERIK G26 command for upper working area and spindle speed limits. Learn syntax, parameters like SD 43420, and alarms to avoid crashes.
G26 Spindle Speed Fluctuation Detection ON: CNC Programming Guide
Learn how to configure G26 on Fanuc, Siemens, and Mitsubishi CNC controls to prevent spindle speed fluctuations, set travel limits, and avoid tool crashes.
G25 Lower Working Area and Spindle Speed Limit: Siemens CNC
Master G25 lower working area and spindle speed limits on Siemens SINUMERIK controls. Avoid chuck collisions and configure safety parameter SD 43430.