Skip to main content
CNC.wiki

How to Use G15 Polar Coordinate Command Cancel in CNC Programming

Master the G15 polar coordinate cancel code on Fanuc, Siemens, and Mitsubishi CNC controls to prevent spindle crashes, parameter alarms, and scrap parts.

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

CNC CARE Co-founder

Introduction: Operational Risks of Polar Coordinate Cancellation

A catastrophic tool crash that shatters the main spindle and destroys raw stock occurs when the polar coordinate origin is offset due to incorrect center initialization. Because the polar coordinate pivot point defaults to the last Cartesian coordinate programmed prior to activating G16, any failure to position the tool at the workpiece zero beforehand shifts the entire bolt hole circle or slot pattern off-target. This misalignment drives the tool turret along an incorrect path, gouging raw material and instantly turning a high-value workpiece into a ruined scrap part. To protect the machine, operators must verify tool compensations and configure virtual Chuck Barrier safety zones before cutting.

Technical Summary of G15

The G15 command is the modal instruction that cancels polar coordinate programming mode and restores standard Cartesian coordinates on CNC machines. The following table highlights the essential specifications of this cancel code:

SpecificationDetails
Command CodeG15 (paired with G16 activation)
Modal GroupGroup 18 (Polar Coordinate Command Cancel) / Modal
Compatible BrandsFanuc, Siemens (ISO Dialect Mode G291), Mitsubishi (M-system)
Critical ParametersFanuc Parameter No. 3402 Bit 6 (CLR), Mitsubishi Parameter #1210 Bit 11, Siemens $MC_GCODE_RESET_VALUES (MD20150)
Main ConstraintMust be programmed alone in independent blocks. Active compensations must be cancelled before execution.

Quick Read: Constraints and Actions

  • Always isolate the command: Program G15 alone in its own G-code block to prevent syntax and interpreter errors (e.g., Mitsubishi Program Error P33).
  • Deactivate polar mode before high-speed options: Polar coordinate mode must be canceled with G15 before commanding high-speed high-accuracy cycles like G05.1 Q1 or G05 P10000 on Mitsubishi controls to avoid Program Error P34.
  • Cancel cutter compensation first: Deactivate cutter radius compensation (G40) before commanding G15 to prevent trajectory calculations from executing incorrect path corrections.
  • Define the coordinate origin explicitly: Because G16 defaults the center of the polar system to the last Cartesian coordinate block programmed immediately prior to activation, verify Cartesian coordinates before enabling polar mode to avoid shifting the entire coordinate grid.
  • Verify reset behavior parameters: Check parameter configurations (Fanuc 3402 Bit 6, Mitsubishi #1210 Bit 11) that dictate whether Group 18 modal states default to Cartesian mode (G15) or remain in polar mode (G16) after a machine reset.
  • Ensure Siemens dialect compatibility: On Siemens Sinumerik controls, G15 is not supported natively in G290 mode. You must use G291 ISO Dialect mode, and ensure machine data MD18800 and option bit 19800 are enabled to avoid Alarm 61800.

Basic Concepts of G15 and G16

In standard CNC machining, positions are defined using standard Cartesian coordinates (X, Y, and Z axes) representing linear distances from a workpiece origin. However, machining patterns such as circular bolt hole circles, rotational slot matrices, or circular profiles is computationally complex to program in Cartesian values. To simplify programming, polar coordinate systems are used, which map tool path locations using a radius (distance from a pivot center) and an angular value. Activating this polar interpolation mode (typically G16) instructs the interpreter to map coordinate inputs as polar dimensions, meaning the first axis of the selected plane represents the radius, and the second axis represents the angle. This is similar to plane-specific interpolation like G12.1 polar coordinate interpolation, which dynamically maps coordinates in a polar format.

While polar programming simplifies pattern layouts, the CNC system must eventually return to standard linear Cartesian movements to execute general profiling, tool changes, or retraction moves. This is the role of G15, which cancels polar coordinate programming and restores standard Cartesian axis coordinate interpretation. Safely commanding G15 terminates the polar angle-to-linear mapping, ensuring that subsequent coordinate commands are interpreted strictly as standard distances along the X, Y, and Z axes. Failure to cleanly cancel polar mode can cause the CNC control to misinterpret Cartesian movements as angular/radial steps, leading to unwanted motion. However, once the operation finishes, the programmer must execute standard cancel commands like G15 or G13.1 polar coordinate cancel to restore standard Cartesian axes.

Command Structure and Syntax

The cancellation of polar coordinates is programmed via the modal preparatory code G15. When the interpreter parses a G15 block, it halts the rotational-to-linear coordinate translation and re-establishes the standard orthogonal grid. This switch is modal, meaning that once G15 is executed, the control remains in Cartesian mode until an explicit G16 command is programmed. It is a critical programming rule that G15 must be programmed alone in an independent block. Combining G15 with coordinate movements or auxiliary functions can disrupt the interpreter queue, leading to formatting faults or sudden motion halts.

Under polar mode, coordinate programming is closely bound to the active working plane selection. The working plane (defined by G17, G18, or G19) determines which axes represent the radius and angle. For example, on the G17 XY plane, the first axis (X) acts as the polar radius, while the second axis (Y) represents the polar angle. If the programmer switches planes or fails to specify G15 before calling canned cycles or other coordinate functions, the machine can generate severe alarms. In the command structure, parameters and option bits configure how the control system initializes, reset states, and parses the G15/G16 transition.

The syntax for deactivating polar programming is simple and direct:

G15 ;

Below is a summary of the parameters that govern the behavior of polar coordinate cancellation and reset behaviors:

BrandParameterDescriptionSetting Options / Values
FanucParameter No. 3402 Bit 6 (CLR)Controls modal G-code clear state at power-on or reset.0: Retain polar mode; 1: Initialize to standard state (G15 active)
FanucParameter No. 5040 Bit 3 (TCT)Controls the active tool length compensation shift type. Must not be modified when offsets are active.Binary (0 or 1)
FanucParameter PCCPolar coordinate system radius/angle calculation initialization.0: Initialize radius/angle to 0 upon G16; 1: Calculate from current tool position
FanucParameter No. 0001 Bit 1 (FCV)Enables legacy Series 15 G-code interpreter format.0: Modern compiling; 1: Series 15 legacy interpreter format
SiemensMachine Data MD18800 (or Option 19800)Enables the external ISO Dialect compiling system to process G15/G16 commands.0: Native Siemens mode only; 1: ISO Dialect mode active
SiemensMachine Data MD20150 ($MC_GCODE_RESET_VALUES)Establishes default modal G-codes upon system reset. Group 18 defaults to G15.Selects G15 to initialize in Cartesian mode.
MitsubishiParameter #1210 RstGmd Bit 11Determines modal initialization of Group 18 polar coordinate command upon system reset.0: Reset modal state to G15; 1: Retain active modal state
MitsubishiParameter #1037 cmdtypConfigures the G-code system and command format.2: Machining Center M-system (interprets G15/G16 as polar); 3/4: Lathe system

Brand Applications

Fanuc

On Fanuc systems, G15 cancels polar coordinates in Group 18, reverting coordinate mapping from radial and angular coordinates back to Cartesian axes. This transition is critical to prevent subsequent commands from being interpreted in angles. The command is written as G15 ; in an independent block to cancel polar mode. For example, a typical program executes a polar drilling sequence using G16 and cancels it via G15.

CategorySystem IdentifierDescription / Details
ParametersNo. 3402 Bit 6, No. 5040 Bit 3, Parameter PCCConfigure clear state reset behavior, tool length shift type, and positional calculation source.
AlarmsAlarm PS0368, Alarm PS0325, Alarm PS0330, Alarm PS0050Triggers for active parameter changes, invalid cutter compensation, plane mismatch, and chamfering.
VersionsSeries 16i/18i/21i vs. Modern controlsModern controls differ mathematically in tool path trajectory during G41/G42 start-up/cancellation. Parameter No. 0001 Bit 1 enables legacy Series 15 program format.

Warning: Attempting to edit Parameter No. 5040 Bit 3 (TCT) while work coordinate system offsets or tool length compensations are active will immediately cause the control to trigger Alarm PS0368, halting operations.

Siemens

Siemens SINUMERIK does not support G15 or G16 natively in its default mode. Instead, G15 is parsed under ISO Dialect Mode (G291) to deactivate polar coordinates. G15 must be written in an independent block. In ISO dialect programs, the transition from Cartesian to polar and back is written with G16 and G15 switching.

CategorySystem IdentifierDescription / Details
ParametersMachine Data MD18800, MD20150Set MD18800 (or option 19800) to 1 to compile G15. MD20150 sets default Group 18 to G15.
AlarmsAlarm 61800, Alarm 61003, Alarm 61102, Alarm 14800Triggers for missing ISO dialect system, zero feedrate, missing spindle direction, and zero velocity drops.
VersionsSINUMERIK 840D sl vs. 802D sl840D sl supports G93 inverse-time feedrates, which are unavailable on 802D sl. MD10604 working area limit deactivation is read-only on 802D sl.

Warning: Executing G15 or G16 while machine data MD18800 or option 19800 is disabled will trigger Alarm 61800 ("External CNC system missing"), immediately terminating program execution.

Mitsubishi

Mitsubishi systems support G15 in Group 18 to cancel polar mode for Machining Centers. However, on Lathe systems, G15 is repurposed for Balance Cut ON. G15 must be programmed alone in an independent block. Under Machining Center formats, the polar machining sequence toggles via G16 and G15.

CategorySystem IdentifierDescription / Details
ParametersParameter #1210 RstGmd, Parameter #1037 cmdtypParameter #1210 Bit 11 controls reset modal behavior. Parameter #1037 determines G-code system configuration (set to 2 for Machining Centers).
AlarmsProgram Error P128, Program Error P34 (or P791), Program Error P71, Program Error P33Triggers for machining condition commands, high-speed control active, circular interpolation center deviations, and movement command blocks.
VersionsM800/M80/E80 series versionsOn software version D4 or earlier, G52 local coordinate offsets during G54.1 Pn trigger Program Error P438, which is removed in later versions.

Warning: Under Lathe formats (parameter #1037 cmdtyp set to 3 or 4), G15 is repurposed to activate Balance Cut ON instead of canceling polar coordinates, which can trigger unexpected dual-turret movements.

Brand Comparison

The three major CNC brands display distinct structural variations in how they process polar coordinate cancellation. The table below compares the implementation characteristics across Fanuc, Siemens, and Mitsubishi:

Feature / BehaviorFanucSiemensMitsubishi
Native G15 SupportSupported (Group 18, Polar Input Mode Cancel G-code).Not supported natively. Supported only under ISO Dialect Mode (G291).Supported (Group 18, Polar Coordinate Cancel G-code) for Machining Centers.
Lathe System BehaviorCancels polar coordinate programming.Supported under ISO Dialect Mode (G291) as polar coordinate cancel.Repurposed: G15 activates Balance Cut ON and G16 selects Y-Z Milling Interpolation Plane Selection.
Reset Modal BehaviorInitialized state on system reset or power-on controlled via Parameter No. 3402 Bit 6 (CLR).RESET state Group 18 initialized to G15 via reset values parameter MD20150 $MC_GCODE_RESET_VALUES.Initialized state on reset customizable via Parameter #1210 RstGmd Bit 11 (initialize to G15 vs retain).
Tool Nose Compensation CancelModern Series 30i controls return tool nose to previous block position under G40 cancel if Parameter No. 5000 Bit 3 (GNI) is 0.Standard tool nose radius compensation deactivation.Standard tool nose radius compensation deactivation.

Technical Analysis of Brand Variations

Analytically, the primary difference in polar coordinate cancellation across these three platforms lies in how the interpreter treats Group 18 G-codes. Fanuc and Mitsubishi Machining Center configurations use G15 and G16 as standard modal switches. However, Siemens SINUMERIK completely avoids these G-codes in its native language. Instead of toggle switches, Siemens defines a pole location using native commands (G110, G111, G112) and executes polar coordinates using dedicated radius and angle arguments (RP= and AP=) inside motion blocks. Siemens only processes G15 and G16 blocks when the control is explicitly switched to G291 ISO Dialect mode.

Lathe system configurations reveal a crucial distinction. On Fanuc, G15 remains a polar coordinate cancellation command regardless of the machine type. On Mitsubishi, G15 is completely repurposed under G-code List 3 Lathe formats, activating Balance Cut ON, while G16 selects Milling Interpolation Plane Selection. Programmers who transfer programs between brands must ensure that Parameter #1037 on Mitsubishi is configured to Machining Center format, or risk initiating dual-turret cuts instead of a simple polar coordinate deactivation.

Another major analytical variation is the reset and initialization behavior. While Fanuc uses Parameter No. 3402 Bit 6 to configure whether G15 is loaded automatically at reset, Mitsubishi relies on Parameter #1210 Bit 11 to choose between resetting to G15 or retaining the current state. Siemens handles default reset values via Machine Data MD20150. These differences determine how a machine behaves after an E-stop or program reset, directly affecting operator recovery workflows.

Program Examples

Fanuc G-Code Program Example

G17 G90 G16 ;
G99 G81 X150.0 Y45.0 R5.0 Z-25.0 F120.0 ;
G15 G80 M09 ;

dry run: Before running the cutting cycle, verify axis positions by executing the program "in the air" with workpiece coordinates shifted in Z. Confirm that the tool center aligns with the polar coordinates (R150.0, 45°) and that the G15 block successfully terminates polar mode before the tool retracts to home position.

Siemens ISO Dialect Program Example

G291;
G17 G90 G00 X0 Y0 S900 M03;
G16;
G99 G81 X6.8 Y60.0 R0.1 Z-0.163 F3.0;
G15 G80;
G290;

dry run: With the tool offset from the workpiece, execute the program. Verify that the compiler switches to G291 ISO Dialect mode, positions to X0 Y0, interpolation occurs along the 60° angle path, G15 deactivates polar mode at a complete stop, and G290 successfully returns the compiler to native Siemens mode.

Mitsubishi G-Code Program Example

G17 G90 G00 X0 Y0 S900 M03;
G16;
G99 G81 X6.8 Y60.0 R0.1 Z-25.0 F3.0;
G15;
G80 M09;

dry run: Execute the program with the feedrate override turned down. Confirm that the tool positions to the X0 Y0 origin, activates polar coordinate mode, executes the drilling cycle at R6.8 and 60° angle, and halts at the G15 block boundary. Verify that G15 is executed alone in its block to prevent P33 format errors.

Error Analysis

Incorrect programming syntax or improper modal states during polar coordinate cancellation trigger specific alarm codes. The table below details common errors, their causes, and how to resolve them across all three brands:

BrandAlarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
FanucAlarm PS0368Attempting to modify Parameter No. 5040 Bit 3 (TCT) while coordinate system shifts or tool length offsets are actively applied.CNC control halts with a servo parameter error screen and disables motion.Cancel all active coordinate shifts and tool length offsets in the registers before altering parameter values.
SiemensAlarm 61800Executing G15 or G16 while machine data MD18800 or option 19800 is disabled.The interpreter rejects the ISO block, triggers a system halt, and displays "External CNC system missing".Ensure that Machine Data MD18800 (or Option 19800) is set to 1 to enable the ISO Dialect compiler.
MitsubishiProgram Error P33Commanding G15 or G16 in a G-code block that contains movement commands or auxiliary codes.The program execution immediately halts with "Illegal G-code command format" on the display.Isolate the G15 or G16 command in its own independent block without motion coordinates or other modal functions.
MitsubishiProgram Error P34 (or P791)Commanding high-speed high-accuracy control (G05.1 Q1 or G05 P10000) while polar coordinate mode (G16) is active.CNC control stops during block preview, triggering a high-speed format alarm.Program G15 in a separate block to deactivate polar coordinate mode before calling any high-speed high-accuracy control codes.

Application Note

A catastrophic hard collision resulting in a shattered spindle, destroyed workholding, and a ruined scrap part occurs when operators attempt to modify Parameter No. 5040 Bit 3 (TCT) while tool length or coordinate offsets are still active in the system registers. This modification corrupts the CNC system's compensation calculations, triggering Alarm PS0368. Because the coordinate math becomes corrupted, the tool turret executes an uncoordinated axis shift along an unintended trajectory. This unexpected movement drives the tool tip or turret body directly into the revolving workpiece chuck, a table-mounted vise jaw, or a pneumatic fixture clamp. To safeguard these physical components, operators must configure virtual electronic envelopes on the Chuck Barrier and Tailstock Barrier HMI setup screens. If an incorrect polar coordinate calculation or retraction path attempts to enter these boundaries, the control instantly halts axis travel and triggers a stored stroke limit alarm before physical contact occurs.

Related Command Network

To program milling operations on a lathe, several codes must interact within a structured network. The following commands have direct relationships with G15:

  • G16 (Polar Coordinate Command ON): Toggles the CNC control into polar coordinate programming mode, defining coordinates by radius and angle on the active plane.
  • G17 / G18 / G19 (Plane Selection G-codes): Dictates the active working plane, which defines the radial and angular axis mappings used during polar coordinate movements.
  • G80 (Canned Cycle Cancel): Deactivates active canned drilling, tapping, or boring cycles that are commonly used in combination with polar coordinate grids.
  • G110 / G111 / G112 (Siemens Pole Definition): Defines the reference pole location natively in Siemens controls without using G16 polar coordinate activation.
  • G290 / G291 (Siemens Native/ISO Dialect Compiler Switches): Switches the Siemens interpreter between native SINUMERIK commands and legacy ISO dialect mode where G15 is parsed.
  • G11 (Programmable Data Input Cancel): Terminates the G10 programmable parameter entry mode, returning the CNC control to normal execution state.
  • G12.1 (Polar Coordinate Interpolation): Activates polar coordinate/milling interpolation mode, mapping Cartesian coordinates to synchronized X and C axis movements.
  • G13.1 (Polar Coordinate Cancel): Terminates the polar coordinate interpolation mode, restoring standard lathe coordinates.

Conclusion

To ensure stable CNC operation, programmers must treat G15 as an isolated modal safety barrier that separates radial-angular movements from standard Cartesian positioning. The command should always be placed in an independent block with no other movements, preceded by a G40 cutter compensation cancellation block. Confirming parameter clear states and performing dry runs in the air before committing to raw stock prevents axis trajectory shifts and eliminates the risk of turret collisions with physical fixtures.

FAQ

Can G15 be commanded on the same block as G80 or coolant commands?

While some Fanuc interpreters allow G15 to share a block with auxiliary M-codes or other cancel commands like G80, doing so on Siemens and Mitsubishi systems violates the independent block rule and can trigger Program Error P33 or general syntax faults. The most reliable shop-floor practice is to program G15 completely alone in an independent block immediately preceding the canned cycle cancellation and retraction blocks.

Why did my tool shift and cut in the wrong position after activating polar coordinate mode?

Polar coordinate programming relies on a pivot center, which defaults to the last Cartesian coordinate position programmed before G16 is executed. If the tool is not explicitly positioned at the workpiece zero point (or the intended circle center) before turning G16 ON, the entire polar array shifts by the offset distance. Always command a linear positioning block to the center coordinate before executing the G16 block.

How does a machine reset affect the active G15 modal coordinate state?

The status of the polar coordinate mode after a system reset or power cycle is dictated by machine parameters, such as Fanuc Parameter No. 3402 Bit 6 or Mitsubishi Parameter #1210 Bit 11. Depending on these settings, the control may either initialize Group 18 to G15 (Cartesian) or retain G16 (Polar). To prevent unexpected movement when restarting a program mid-sequence, check these parameter tables or explicitly program G15 in the program initialization block.

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 - 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