Skip to main content
CNC.wikiCNC.wiki

G17, G18, and G19 CNC Working Plane Selection Guide: All Brands

Master CNC working plane selection using G17, G18, and G19 on Fanuc, Siemens, and Mitsubishi. Learn critical parameter settings and resolve plane selection alarms.

Hakan Gündoğdu
Hakan Gündoğdu

CNC CARE Co-founder

Introduction

A tool diving along a severely distorted trajectory, a cutting tip slamming directly into the physical chuck or tail stock barrier, or an immediate alarm code halt mid-cut—these critical failures frequently arise from a single overlooked working plane selection. When a programmer commands a coordinate system rotation or swivels axes without cleanly resetting active parameters, the CNC system can retain spatial offsets and apply them to the wrong geometric plane. In high-precision milling and turning, a mismatch between the active mathematical plane and the physical setup of the machine axes defeats predictive collision avoidance models, risking a catastrophic crash or immediate tool breakage.

Technical Summary

Technical SpecificationDetails
Command CodeG17, G18, G19
Modal GroupPlane Selection (Modal G-codes)
Supported BrandsFanuc, Siemens, Mitsubishi
Critical ParametersParameter 1022 / 1023 (Fanuc), MD20360 (Siemens), Parameter #1025 (Mitsubishi)
Main ConstraintPlane changes are strictly prohibited during active cutter radius or tool-nose compensation (G41/G42), triggering immediate alarms (PS0037 on Fanuc, Alarm 10757 on Siemens, P112 on Mitsubishi).

Quick Read

  • Deselect Compensation First: Always program G40 to deactivate cutter or tool-nose radius compensation before commanding a working plane change (G17/G18/G19) to prevent immediate cycle halts.
  • Reset Rotations on Siemens: Explicitly clear active coordinate system rotations (via ROT/AROT) before switching planes to avoid severe axis path distortion.
  • Verify Startup Defaults: Check machine parameters (Parameter 3402/3458 on Fanuc, #1025 on Mitsubishi) to confirm if the system initializes in G17 (X-Y) or G18 (Z-X) mode at power-on.
  • Isolate Turning Tools on Siemens: Never swivel the working plane while a turning tool is active (triggers Alarm 61148); load a milling tool first.
  • Coordinate Arc Addresses: Ensure circular interpolation axis addresses (G02/G03) precisely match the active working plane coordinates to avoid illegal plane selection alarms.
  • Mind Parallel Axes Rules: Program basic axes or parallel axes (like U, V, W) according to brand syntax; do not program basic and parallel duplicates together on Siemens (triggers Alarm 12726).

Basic Concepts

The primary practical programming effect of the G17, G18, and G19 commands is configuring the CNC to mathematically understand which two physical axes construct the two-dimensional spatial geometry for arc interpolation, cutter radius compensation, and coordinate rotation. Programmers and operators must meticulously watch the modal plane state before engaging the workpiece, because commanding a profile on the wrong plane will cause the machine to interpolate the wrong physical axes. By establishing the active plane, the programmer also defines the perpendicular third axis, which is used for tool length compensation, canned cycles, and drilling feed depth.

Understanding the modal nature of G17, G18, and G19 is vital before engaging the cutting tool with the workpiece. If the active plane does not align with the physical machining coordinates, the control will interpret program lines in the wrong plane, driving physical axes along incorrect paths. This can easily cause tool collisions or scrap parts, as the machine attempts to execute standard planar movements on axes that are physically perpendicular to the intended machining surface.

Command Structure

To declare a working plane, the modal commands G17, G18, or G19 are issued in the NC program. These commands do not require additional coordinate values to execute in standard applications, immediately altering the system's spatial math upon block execution. The selected plane remains active across all subsequent blocks until a different plane command is explicitly called.

Depending on the CNC brand, the command structure can be expanded to dynamically substitute basic axes with parallel linear axes, such as U, V, or W. When parallel axes are assigned within the plane selection block, the controller maps the custom axes to the Cartesian plane. However, the syntax and constraints governing parallel axes vary significantly across Fanuc, Siemens, and Mitsubishi, requiring careful attention to parameter mappings and dialect settings.

; Fanuc Standard Syntax
G17 ; (Selects Xp-Yp plane)
G18 ; (Selects Zp-Xp plane)
G19 ; (Selects Yp-Zp plane)

; Siemens Syntax G17 ; (Standard X/Y plane) G17 <Axis name> <Axis name> ; (e.g. G17 U0 Y0 substitution with parallel axis)

; Mitsubishi Syntax G17 ; or G17 X_ Y_ ; G18 ; or G18 Z_ X_ ; G19 ; or G19 Y_ Z_ ;

BrandParameterDescriptionValue Range / Action
FanucParameter 1022Configures basic axis mapping in the system.0 to 7 (1=X, 2=Y, 3=Z, 5=||X, 6=||Y, 7=||Z)
FanucParameter 1023Maps servo axis number to system logical axes.0 to 7
FanucParameter 3402Sets power-on default active plane.Bit 1 (G18), Bit 2 (G19). Both 0 = G17.
FanucParameter 3458Defines lathe (T-series) startup plane.Bit 0: 0 forces G18; 1 follows Parameter 3402.
SiemensMD20360Tool parameter definition mask.Bits 0, 1, 2 set to 0 or 1. Restricts tools with wear component to selection plane.
SiemensSD42940Freeze tool length constant on plane change.Set non-zero to lock tool length axis assignments.
SiemensSD42942Freeze turning tool length constant.Non-zero freezes axis assignment for turning tools.
MitsubishiParameter #1025Sets the active plane at power-on or reset.0 or 1 = G17, 2 = G18, 3 = G19.
MitsubishiParameter #1026Defines name of the basic X-axis.Standard control axis address (e.g., X).
MitsubishiParameter #1027Defines name of the basic Y-axis.Standard control axis address (e.g., Y).
MitsubishiParameter #1028Defines name of the basic Z-axis.Standard control axis address (e.g., Z).

Brand Applications

Fanuc

Fanuc systems manage G17, G18, and G19 plane selection with detailed parameter settings. Machine builders use parameters to configure logical coordinate planes, enabling the machine to support custom multi-axis kinematics safely. Programmers must ensure these parameters are correctly set to align active planes with physical coordinates.

Standard G-code syntax supports G17 to select the Xp-Yp plane, G18 to select the Zp-Xp plane, or G19 to select the Yp-Zp plane, where Xp, Yp, and Zp denote basic axes or axes parallel to them.

  • Parameters: Parameter 1022 and Parameter 1023 map servo axes to the basic logical axes. Parameter 3402 determines the default plane at power-up, and Parameter 3458 selects the default plane specifically for lathe (T-series) systems.
  • Alarms: Alarm PS0021 occurs if an off-plane axis is programmed during circular interpolation (G02/G03) or if three parallel axes are commanded simultaneously. Alarm PS0037 triggers if the plane is changed while cutter compensation (G41/G42) is active.
  • Versions: Fanuc T-series lathes can default to the G18 ZX plane upon power-up using Parameter 3458, whereas M-series machining centers default to the G17 XY plane based on Parameter 3402. Older FS15-T controls handle canned cycle drilling planes differently than newer models.

Warning: Changing the active working plane while cutter or tool-nose radius compensation is active immediately triggers a PS0037 alarm to halt the tool path.

Siemens

Siemens controls establish working planes to determine tool offsets and interpolation. Sinumerik systems allow parallel axis substitutions directly within plane blocks, but this is restricted depending on the active programming mode. Operators must carefully monitor active spatial offsets to avoid path errors.

The basic syntax is G17 for the X/Y plane, G18 for the Z/X plane, and G19 for the Y/Z plane. Programmers can also append parallel axes, such as commanding G17 U0 Y0.

  • Parameters: MD20360 restricts a tool with a wear component to its selection plane. SD42940 locks tool length components to axes when the machining plane changes, and SD42942 performs the same freeze function for turning tools.
  • Alarms: Alarm 10757 triggers if the plane is switched during active cutter compensation (G41/G42). Alarm 12726 occurs if a basic coordinate axis and its assigned parallel axis are programmed in the same plane block. Alarm 14199 is raised when a tool with a diameter-evaluated wear component is programmed in a conflicting plane. Alarm 61148 occurs when a swivel plane is commanded with an active turning tool. Alarm 700013 triggers if machining is attempted with the chuck unclamped.
  • Versions: In native Siemens mode (G290), parallel axes can be dynamically activated in the plane block (e.g., G17 U0 Y0). However, in ISO Dialect mode (G291), parallel axes cannot be programmed within standard plane commands, restricting the system to standard basic axes.

Warning: Changing the working plane while cutter radius compensation is active forces immediate block reorganization and halts the machine with Alarm 10757.

Mitsubishi

Mitsubishi systems offer highly flexible trajectory definitions that separate them from other controls. Setting parameter #1025 determines the initial plane at power-on. Linear movement commands run independently of the selected plane, allowing robust axis control without syntax barriers.

Standard Cartesian plane selection uses G17 (X-Y plane), G18 (Z-X plane), or G19 (Y-Z plane). Alternatively, the syntax G17 X_ Y_ executes plane selection alongside axis movement.

  • Parameters: Parameter #1025 determines the default plane at power-on. Parameters #1026, #1027, and #1028 define basic axes, while #1029, #1030, and #1031 define auxiliary parallel axis names. Parameters #8113 and #8114 initialize the G16 cylindrical plane or G19 plane for lathe milling mode.
  • Alarms: Alarm P112 triggers when a plane change is commanded during active tool radius compensation (G41/G42). Alarm P111 occurs if a plane change is commanded during coordinate rotation. Alarm P113 triggers if a circular arc axis conflicts with the selected plane. Alarm P485 occurs if a plane is changed during polar coordinate interpolation. Alarm P903 triggers when plane changes are commanded during normal line control.
  • Versions: Lathe systems operating under command types 3, 4, 5, or 6 (where parameter #1037 is 3, 4, 5, or 6) can use parameters #8113 and #8114 to initialize G16 or G19 planes for milling, which is not applicable to machining centers.

Warning: Programming a circular arc using axis coordinates that do not belong to the active working plane will immediately trigger Alarm P113, stopping production.

Brand Comparison

Feature / TopicFanucSiemensMitsubishi
Dynamic Parallel AxesNot supported in standard block; requires mapping via parameters 1022 and 1023.Supported in native Siemens mode (G290) via syntax (e.g. G17 U0 Y0). Blocked in ISO Dialect mode (G291).Supported natively by declaring parallel axes in plane command (e.g., G18 U_ V_) combined with parameters #1029 to #1031.
Startup Default PlaneSet by Parameter 3402 and Parameter 3458. Lathe T-series can default to G18, while milling M-series defaults to G17.Milling defaults to G17 (X/Y). Turning defaults to G18 (Z/X).Set by Parameter #1025 (1=G17, 2=G18, 3=G19). Lathe mill mode initialized via #8113 and #8114.
Frame Rotation Behavior— (no source)Retained. Programmed rotation angles (ROT/AROT) are kept and applied to the new plane (requires manual reset before change).Prohibited. Triggers a P111 alarm if plane change is attempted while coordinate rotation is active.
Radius Compensation ClashTriggers Alarm PS0037 if plane change is attempted while cutter compensation is active.Triggers Alarm 10757 if plane change is attempted while tool radius compensation is active.Triggers Alarm P112 if plane change is commanded while tool radius or nose R compensation is active.
Axis Duplication in BlockTriggers Alarm PS0021 if identical parallel basic axes are specified simultaneously.Triggers Alarm 12726 if a basic axis and its assigned parallel axis are programmed in the exact same plane block.Allowed. Basic axis processed first to determine plane, then parallel axes.
Axis Move Outside PlaneGenerates Alarm PS0021 if off-plane axes are programmed during circular interpolation blocks.Allowed. Linear commands can address any axis regardless of active plane.Allowed. Linear movement commands (e.g. G19 X100.) are independent of active plane and execute safely.

Technical Analysis

An analysis of working plane behaviors across these three major CNC control systems reveals different engineering philosophies for managing multi-axis coordinate systems. Fanuc relies heavily on parameter-driven mappings, forcing users to configure physical servo axes to logical axes before program execution. Parameter 1022 and Parameter 1023 serve as the foundation, ensuring that parallel axes are mapped at a system level. This approach keeps G-code programming extremely simple but limits real-time flexibility, as programmers cannot easily redefine axes on the shop floor without parameter modifications. Additionally, Fanuc separates lathe and machining center kinematics through parameter 3402 and parameter 3458, which initialize the default plane upon startup.

In contrast, Siemens Sinumerik controls offer a modular and flexible axis substitution syntax. Programmers can dynamically declare parallel axes directly in the plane selection block (e.g., G17 U0 Y0) in native Siemens mode (G290). However, Siemens restricts this capability in legacy ISO Dialect mode (G291), where the control forces standard Cartesian planes. Furthermore, Siemens manages spatial rotations uniquely during plane changes. If a 3D frame rotation is active, switching planes via G17, G18, or G19 will not cancel the rotation angles. Instead, the control retains the existing rotation and immediately projects it onto the newly selected plane. This requires explicit reset commands (ROT) before changing planes to prevent severe path errors.

Mitsubishi combines standard G-code compliance with highly independent linear axis travel. One of Mitsubishi's most distinguishing features is that standard linear movements have absolutely no structural link to the active working plane. A programmer can safely command G19 X100., and the machine will move the X-axis entirely independent of the active Y-Z plane without throwing a formatting error. However, Mitsubishi strictly prohibits plane changes during active coordinate rotations, issuing a P111 alarm immediately. It also utilizes auxiliary parameters #1029 through #1031 to map parallel axes natively, allowing programmers to declare planes like G18 U_ V_ directly. The system resolves duplication by prioritizing the basic axis first, creating a predictable hierarchy that helps programmers manage complex turning and milling operations.

Program Examples

Fanuc Example

G18 ;                           (Selects Z-X plane for turning or horizontal milling)
G02 X50.0 Z-20.0 R15.0 F100.0 ; (Circular interpolation arc in active Z-X plane)
G17 ;                           (Switches back to X-Y plane for standard milling)

Dry Run Analysis

The program first commands G18, which modally sets the working plane to the Z-X coordinate space. In the next block, the G02 circular interpolation command uses coordinate addresses X and Z to interpolate a clockwise arc with a radius of 15.0 mm at a feedrate of 100.0 mm/min. Because G18 is active, this arc is interpolated using the physical Z and X axes. Finally, G17 is programmed to safely return the control's spatial calculations back to the standard X-Y plane for subsequent operations.

Siemens Example

N10 G17 T5 D8 ; (Selects X/Y plane, loads tool 5, and applies offset D8)
N20 G17 U0 Y0 ; (Substitutes basic X-axis with parallel axis U in native Siemens mode)
N30 G18 G02 Z50 X30 R15 F100 ; (Circular arc interpolation in Z/X plane using Z and X axes)

Dry Run Analysis

In block N10, the command G17 establishes the standard X/Y working plane, and tool parameter offsets are loaded. In block N20, the control is in native Siemens mode (G290), allowing the dynamic substitution of the standard X-axis with parallel axis U by commanding G17 U0 Y0. In block N30, G18 is called to select the Z/X plane, followed by a G02 clockwise circular interpolation using axes Z and X to generate an arc with a radius of 15 mm at a feedrate of 100 mm/min, with tool length compensation now applied along the perpendicular Y-axis.

Mitsubishi Example

G17 X100. R50. ;  (Plane selection combined with an arc movement in X-Y plane)
G19 X100. ;       (Selects Y-Z plane while executing independent axis movement on X)
G18 U_ V_ ;       (Establishes working plane directly using parallel axes U and V)

Dry Run Analysis

In the first block, G17 establishes the standard X-Y working plane, and the control processes a clockwise circular movement using radius R50.0. In the second block, the program commands G19 X100.; the Mitsubishi control sets the active plane to Y-Z, but because linear movements are independent of plane selection, it safely moves the X-axis to 100.0 mm without generating format errors. In the third block, G18 U_ V_ uses parameters #1029 and #1030 to define the working plane directly using parallel axes U and V, adjusting length compensation to the perpendicular axis.

Error Analysis

BrandAlarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
FanucPS0021Commanding a circular arc (G02/G03) with axis addresses not belonging to the active plane, or duplicate parallel basic axes programmed simultaneously.The machine halts immediately and displays illegal plane select alarm on screen.Incorrect axis addresses in circular interpolation. Modify the arc program coordinate addresses to match the active plane, or verify parameter mappings (1022/1023).
FanucPS0037Attempting to change the active plane (G17/G18/G19) while cutter radius compensation (G41/G42) is active.Cycle halts instantly, displaying plane change error during tool radius compensation.Program attempt to change mathematical plane during active compensation. Insert G40 to deselect tool radius compensation prior to the plane selection block.
Siemens10757Changing the compensation plane while tool radius compensation (G41/G42) is active.Automatic execution halts, showing compensation plane error.Switching G17/G18/G19 during active tool radius compensation. Program G40 in a separate intermediate block to deactivate compensation before switching planes.
Siemens12726Programming a basic coordinate system axis together with its assigned parallel axis in a plane selection block.The Sinumerik control stops block processing and triggers illegal parallel axis plane select alarm.Duplicate basic and parallel axes programmed together. Program only the basic axis or only the parallel axis, never both.
Siemens61148Attempting to swivel the machining plane while a turning tool is actively loaded in the spindle.Program stops, throwing swivel plane turning tool alarm.Active turning tool loaded during plane swivel command. Ensure a milling tool is loaded before swiveling, or suppress the alarm via SD 55410 if allowed.
MitsubishiP112Issuing a plane selection command (G17/G18/G19) while tool nose R compensation (G41/G42/G46) is actively commanding a path.The machine halts mid-program, displaying plane selection compensation error.Altering the active plane while path offsets are active. Insert G40 to cancel tool radius compensation and execute an axis movement before switching planes.
MitsubishiP113Circular interpolation command axis does not correspond to the currently active working plane.The machine stops moving and shows illegal plane select alarm on screen.Attempting to interpolate an arc using an off-plane axis. Issue a plane selection command (e.g. G17) that matches the arc coordinate axes before commanding G02/G03.

Application Note

An unexpected tool crash or severe geometry error occurs when a spatial plane change is commanded while a coordinate system rotation is active on a Siemens control. If the angles of rotation are not cleared via a ROT command before swiveling the plane, the Sinumerik interpreter retains the rotation angles and applies them directly to the new working plane. The tool then travels along a severely distorted path, bypassing collision avoidance models and slamming into the physical chuck or workpiece fixture. To prevent this, operators must ensure that ROT is commanded to clear rotations before selecting G17, G18, or G19. Similarly, programmers operating Mitsubishi controls must ensure that circular interpolation coordinate addresses match the active plane. Programming an off-plane axis during circular interpolation causes an immediate P113 alarm code, halting the automatic cycle. To protect physical boundaries like the chuck, operators must utilize graphic trace screens to verify plane transitions. In double turret setups, fail-safe parameters like the chuck barrier check must be verified, as selecting an incorrect plane for a facing turret face will invert tool-path geometry, leading to reversed axis motion and tooling failure.

Related Command Network

  • G01 Linear Interpolation: G17, G18, and G19 define the two coordinate axes that construct the spatial plane for linear path execution, while the perpendicular third axis governs depth feed.
  • G02 Circular Interpolation: The direction of clockwise arc movement is mathematically calculated based on the active selected working plane.
  • G03 Circular Interpolation: The direction of counter-clockwise arc movement is defined entirely by G17, G18, or G19, ensuring the controller interpolates the correct physical axes.
  • G40/G41/G42 (Tool Radius Compensation): The active working plane determines which two axes receive tool radius and tool nose R offsets, and compensation must be deselected via G40 before changing planes.
  • G68/G69 (Coordinate System Rotation): These commands rotate the coordinate system relative to the active plane, and rotating without coordinate reset can distort subsequent plane paths.

Conclusion

Meticulous management of working plane modal states is the foundation of error-free multi-axis CNC programming. By establishing clear startup defaults through parameter mapping and structuring programs so that plane transitions occur only in a clean G40 state, programmers can prevent severe path distortions and tool collisions. Utilizing graphic trace screens to verify plane alignment prior to live cutting ensures that tool offsets and circular interpolation paths execute with absolute mathematical precision across all Fanuc, Siemens, and Mitsubishi controls.

FAQ

Why does a Siemens control throw Alarm 10757 during a G17 to G18 plane change?

Alarm 10757 triggers because the CNC block parser detects a plane change command while tool radius compensation (G41/G42) is active. The controller cannot recalculate spatial tool offsets dynamically mid-compensation, so it halts the machine to prevent tool path distortion. To resolve this, always insert a G40 command in a standalone block to deactivate cutter radius compensation before selecting a new working plane.

What causes a Fanuc controller to trigger a PS0021 Illegal Plane Select alarm?

The PS0021 alarm triggers when the coordinate addresses in a circular interpolation block (G02/G03) do not match the axes of the active working plane, or if duplicate parallel basic axes are programmed together. The controller cannot calculate circular interpolation math on an off-plane axis, resulting in an immediate cycle halt. To fix this, verify that the programmed arc axes correspond directly to G17 (X/Y), G18 (Z/X), or G19 (Y/Z), and ensure that system parameters 1022 and 1023 are correctly configured.

How does an uncleared ROT coordinate rotation affect a Siemens working plane change?

When a plane change is commanded on Siemens without resetting active rotations, the control retains the existing rotation angles and immediately applies them to the new plane. This retention distorts the tool trajectory, causing the cutter to stray from its programmed path and risk a hard collision with the chuck or workpiece. To prevent this, always program a ROT command to reset active rotations to zero before switching between G17, G18, and G19 planes.

Still not resolved?

Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

Ask AI Assistant
Hakan Gündoğdu
Hakan Gündoğdu
  • CNC CARE Co-Founder (May 2025 - Present)
  • Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
  • Reis CNC Service Engineer (2003 - 2005)
  • Ö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