Skip to main content
CNC.wiki

G13.1 Polar Coordinate Interpolation Cancel Command Guide

Learn how to use G13.1 to cancel polar coordinate interpolation on Fanuc, Siemens, and Mitsubishi CNC systems without triggering parameters or program alarms.

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

CNC CARE Co-founder

Introduction: Operational Risks of Polar Coordinate Cancellation

An un-indexed rotary C-axis during polar coordinate interpolation setup introduces a severe alignment defect on the machine floor. When an operator triggers G12.1 without first commanding a physical alignment block such as G00 C0;, the CNC control forcibly overrides the C-axis virtual counter and resets it to 0. This sudden, software-driven reset shifts the starting point relative to the actual physical orientation of the workpiece. Consequently, the milling cutter machines the flats, hexagons, or face slots out of position, rotationally offset from previous features. This immediately ruins the workpiece, turning a high-value component into scrap metal, and risks driving the milling cutter directly into a chuck jaw or fixture clamp if safety envelopes are breached.

Correct tool length compensation practices represent another critical area of risk when transitioning to milling on a lathe turret. Attempting to activate tool length offsets or change tools once the polar mode is active halts the CNC immediately. Programmers must enforce all coordinate systems and geometry compensations before G12.1 is read, ensuring the machine maintains absolute control over physical limits throughout the interpolation cycle.

Technical Summary of G13.1

The G13.1 command is the modal instruction that cancels polar coordinate interpolation mode and restores standard turning coordinates on multi-axis CNC machines. The following table highlights the essential specifications of this cancel code:

SpecificationDetails
Command CodeG13.1 (paired with G12.1 activation)
Modal GroupGroup 19 (or Group 21 depending on the specific G-code system) / Modal
Compatible BrandsFanuc, Siemens, Mitsubishi
Critical Parameters#1516 (mill_ax), #1517 (mill_c), #8111 (Milling Radius), #1293 (ext29/bit0)
Main ConstraintMust be programmed alone in independent blocks. Active compensations must be cancelled before execution.

Quick Read: Constraints and Actions

  • C-Axis Pre-positioning: Pre-position the C-axis to 0 via G00 C0; prior to G12.1 activation to prevent rotational offset errors.
  • Independent Block Rule: Program both G12.1 and G13.1 entirely alone in dedicated blocks to avoid instant program execution halts.
  • Compensation Cancellation: Turn off tool nose radius compensation using G40 before commanding G13.1 to prevent Program Error P485.
  • Offset Ordering: Activate all tool length offsets (G43/G44) before enabling polar coordinate interpolation to prevent Program Error P481.
  • Feedrate Mode Restorations: Entering G12.1 overrides active feedrates to feed per minute (G94), while G13.1 automatically restores the prior feedrate per revolution (G95) state.
  • CSS Deactivation: Ensure constant surface speed control (G96) is turned off (using G97) before invoking G12.1 to avoid coordinate plane corruption.
  • Safety Barriers: Implement Chuck and Tailstock Barriers (G22/G23) to establish electronic safety zones and prevent turret collisions.

Basic Concepts of G13.1 and G12.1

The practical programming effect of Mitsubishi G12.1 polar coordinate interpolation is that it allows the programmer to contour flats, hexagons, complex profiles, and off-center slots on the face of a turned part as if programming standard flat coordinates on a machining center. The CNC dynamically resolves the virtual orthogonal positions, translating them into synchronized physical linear X-axis and rotary C-axis movements. However, programmers and operators must watch the starting position of the rotary C-axis. When G12.1 is activated, the control forcibly resets the virtual C-axis position counter to 0. If the operator does not pre-position the C-axis (e.g., commanding G00 C0;) prior to G12.1 activation, the machined flat or profile will be rotationally offset, resulting in a misaligned contour and a ruined damaged workpiece or scrap part.

Common failure causes during polar coordinate interpolation stem from feedrate transitions and active compensations. Entering G12.1 forcibly overrides the cutting feedrate and establishes asynchronous feed per minute (G94) as the active state. When the interpolation is canceled via G13.1, the system automatically restores the feedrate per revolution (G95) state that was active prior to starting. In addition, all tool length offsets and compensations must be completed and active before commanding G12.1; attempting to change tool length compensation (G43/G44) inside polar mode halts the system under Program Error P481. If an operator makes an error with tool offsets, the lathe turret can travel off-trajectory during rapid transitions, driving the tool straight into the raw stock clamped in the workpiece chuck or colliding with table-mounted fixture clamps, resulting in a catastrophic collision. Utilizing Chuck and Tailstock Barriers (G22/G23) on the control panel ensures that if a tool path crosses these electronic safety zones, the system halts axis movement and displays a stored stroke limit alarm code, avoiding hardware damage. Manual arbitrary reverse run (G127) and block search / program restart are strictly disabled during polar interpolation, meaning any manual backtracking in this mode will trigger the alarm E98 CAN'T RESEARCH.

Command Structure and Syntax

The command structure for polar coordinate interpolation comprises an activation command and a corresponding cancellation command. The system maps a virtual coordinate system onto the physical machine axes, turning linear and angular movements into synchronized paths. These commands must stand alone in independent blocks to prevent control errors.

In standard configurations, the active coordinate plane (usually G17 XY) must be defined before calling the activation command. When the operation completes, the cancel command G13.1 cancels polar coordinate mode and returns the system to standard turning coordinates, such as G18 ZX. The syntax and parameter details are outlined below:

G12.1 D_ E=_;  (Activation of polar interpolation / milling mode)
G13.1;          (Cancellation of polar interpolation)
Address / ParameterDescriptionNotes
DDesignates the milling hypothetical axis name.0 represents the virtual Y-axis; 1 represents the virtual rotary axis.
E=Designates the rotary axis address letter.For example, E=C, representing the physical rotary C-axis.
Parameter #1516Sets the physical name of the rotary axis used for milling interpolation.Typically assigned to the rotary C-axis on the machine.
Parameter #1517Sets the name of the hypothetical milling interpolation axis.Used when the D command is omitted from the activation block.
Parameter #8111Dictates whether linear coordinate addresses follow radius or diameter programming.Completely overrides standard G10.9 coordinate designations.
Parameter #1533Establishes the linear coordinate axis used to determine the active polar coordinate plane.Typically maps to the X, Y, or Z physical axes.
Parameter #1293 (bit 0)Dictates synchronous feedrate behavior (ext29/bit0).When set to 1, allows G95 to remain active during interpolation.

Brand Applications

Fanuc

On standard Fanuc lathe systems, polar coordinate interpolation is activated using the preparatory command G12.1 and canceled using G13.1. Fanuc systems lack the ability to accept direct block arguments like D and E in the activation block. Instead, the control relies on rigid parameters to define the physical rotary and virtual linear axes prior to execution.

A program written for a Fanuc system must execute G12.1 after selecting the G17 plane and pre-positioning the C-axis. Programmers must ensure feed per minute (G94) is active, because standard Fanuc systems do not allow synchronous feed per revolution (G95) inside the interpolation modal. If G95 is commanded, the control generates a system feedrate alarm and halts operations.

Brand FeatureImplementation Details
ParametersRigidly mapped via parameters (e.g. 5460 series for polar coordinate axis mapping).
AlarmsStandard feedrate alarms are triggered if feed per revolution (G95) is commanded.
VersionsStandard across Fanuc Series 16i/18i/21i, Series 0i, and Series 15i controls.

Warning: Ensure that the feedrate mode is set to G94 prior to executing G12.1 to prevent immediate program execution aborts due to feedrate parameter mismatch.

Siemens

Siemens SINUMERIK controls do not natively support standard G12.1 or G13.1 preparatory codes in their native mode. Instead, Siemens systems utilize the high-level TRANSMIT kinematic transformation solver to handle polar coordinate interpolation. This solver is activated and deactivated via native NC commands rather than G-codes.

To run legacy programs that contain G12.1 and G13.1, a Siemens system must switch from Siemens NC mode to ISO Dialect mode using the preparatory command G291. The control then maps G12.1 and G13.1 to its internal transformation parameters, translating them via its software bilingual translator. Reverting back to Siemens native mode requires calling G290 after G13.1 cancellation.

Brand FeatureImplementation Details
ParametersMaps coordinates directly to TRANSMIT internal transformation parameters.
AlarmsKinematic configuration errors generate internal Siemens transformation alarms.
VersionsSupported via ISO Dialect translator on Sinumerik 840D sl and 828D controls.

Warning: Do not execute G12.1 or G13.1 commands while in Siemens native mode (G290 active) or the control will fail to recognize the G-code and throw a command error.

Mitsubishi

Mitsubishi CNC systems fully support standard polar coordinate interpolation using G12.1 and G13.1, along with the ability to define dynamic, in-program axis mapping. The programmer can pass block arguments like D and E to select the virtual milling axis and the physical rotary axis name directly inside the active block.

Mitsubishi controls also allow synchronous feed per revolution (G95) to remain active throughout the cycle, provided Parameter #1293 ext29/bit0 is set to 1. This parameter configuration provides a major advantage over Fanuc, permitting spindle-synchronized face contouring without changing feedrate modes.

Brand FeatureImplementation Details
Parameters#1516 (mill_ax), #1517 (mill_c), #8111 (Milling Radius), #1533 (mill_Pax), #1293 (ext29/bit0)
AlarmsP32 (rotary coordinate error), P33 (independent block syntax), P35 (D value), P481 (compensation/diameter switch), P485 (CSS/plane/compensation cancel)
VersionsM800V/M80V controls. Software version A8 or earlier triggers P128 with G120.1; version A9 or later supports concurrent execution.

Warning: The control forcibly resets the virtual C-axis position counter to 0 upon G12.1 activation; failure to command G00 C0 before activation causes the profile to rotate, ruining the workpiece.

Brand Comparison

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

TopicFanucSiemensMitsubishi
Native Preparatory G-CodeSupported via G12.1 and G13.1 (axis mapping is parameter-dependent)Not supported natively; uses TRANSMIT solver. Supported in ISO Dialect mode (G291)Supported via G12.1 D_ E=_; and G13.1 (supports dynamic axis mapping)
G95 Feed-per-RevolutionEnforces feed per minute (G94) during G12.1; triggers alarm if G95 is commanded— (no source)Can remain active if Parameter #1293 ext29/bit0 is set to 1
Command Block ArgumentsRigidly mapped to parameters; does not support dynamic block argumentsMaps coordinates to internal transformation record parametersSupports dynamic axis selection (D for virtual axis, E= for rotary axis)

Technical Analysis of Brand Variations

Three distinct behaviors clearly differentiate Mitsubishi's G12.1 polar interpolation from Fanuc and Siemens controls:

First, Mitsubishi features a highly specific G95 Feed-per-Revolution Option Integration managed by Parameter #1293 ext29/bit0. While Fanuc lathes strictly enforce feed per minute during G12.1 and trigger alarms if synchronous feed per revolution is commanded, Mitsubishi allows the programmer to keep synchronous feed (G95) active throughout the entire polar coordinate interpolation cycle if #1293 bit0 is configured to "1".

Second, Mitsubishi incorporates Embedded Axis Mapping Arguments directly inside its G12.1 command structure (using G12.1 D_ E=_;). This allows the programmer to dynamically select the milling hypothetical axis (D0 for Y-axis, D1 for rotary axis name) and assign the active physical rotary axis name (using E= rotary axis name) on-the-fly inside the part program. On standard Fanuc lathe systems, G12.1 lacks these direct block arguments and is rigidly mapped to standard parameter configurations.

Third, Siemens SINUMERIK does not natively support the G12.1/G13.1 preparatory codes in standard mode, relying instead on its high-level TRANSMIT kinematic transformation solver. While Siemens can interpret G12.1 legacy programs via its ISO Dialect mode (G291), it maps these coordinates to its internal transformation record parameters rather than executing a simple, rigid axis-mapping loop, managing the translation through a completely different software-based bilingual translator architecture.

Program Examples

Fanuc G-Code Program Example

G17 G90 G00 X40.0 C0. Z3.0; (Select G17 plane, pre-index C-axis to 0, rapid to safety coordinates)
G12.1;                         (Activate polar coordinate interpolation mode)
G01 G42 X20.0 F2000;           (Initiate linear feedrate and enable tool nose radius compensation G42)
G03 X10.0 C20.0 R10.0;         (Execute counterclockwise circular interpolation using R-radius)
G40 X40.0;                     (Deactivate tool nose radius compensation before cancellation)
G13.1;                         (Cancel polar coordinate interpolation, returning turret to standard coordinates)

dry run

During a dry run, the operator must verify that the spindle indexes C to 0 before G12.1 executes. The control will reset the virtual C-axis position counter to 0 immediately upon reading G12.1. The feedrate mode automatically switches to feed per minute (G94). The tool nose compensation G42 is safely enabled after G12.1 activation and cancelled with G40 before G13.1. Watch for axis speed surges during rapid transitions as the rotary axis translates Cartesian paths into angular movements near the polar coordinate origin.

Siemens ISO Dialect Program Example

G291;
G17 G90 G00 X40.0 C0. Z3.0; (Select G17 XY plane, pre-position C-axis, position tool)
G12.1;
G01 G42 X20.0 F2000;           (Begin linear feed with cutter radius compensation active)
G03 X10.0 C20.0 R10.0;         (Perform circular interpolation on the part face)
G40 X40.0;                     (Cancel cutter radius compensation)
G13.1;
G290;                          (Switch control back to native Siemens mode)

dry run

To dry run this program, verify the transition from native Siemens mode to ISO Dialect mode via G291. The control reads the G12.1 block and uses the TRANSMIT kinematic solver configuration to translate X and C coordinates. Ensure the tool nose compensation G42 is deactivated prior to reading G13.1. Finally, check that G290 successfully returns the system to native Siemens mode, ensuring subsequent cycles execute in the correct coordinate format.

Mitsubishi G-Code Program Example

G17 G90 G00 X40.0 C0. Z3.0; (Pre-position rotary C-axis to 0 and position tool)
G12.1;
G01 G42 X20.0 F2000;           (Start linear cutting feed with tool nose radius compensation)
G03 X10.0 C20.0 R10.0;         (Perform counterclockwise face-milling interpolation)
G40 X40.0;                     (Deactivate tool nose radius compensation)
G13.1;                         (Cancel polar coordinate interpolation mode)

dry run

When conducting a dry run on a Mitsubishi system, check Parameter #1293 ext29/bit0 to determine if G95 feedrate mode remains active during G12.1. If bit 0 is set to 0, the CNC will override the active feedrate to G94 (feed per minute). Observe the rotary C-axis; it must pre-index to C0 to avoid a rotationally offset profile. The dry run confirms that tool radius compensation G42 is active only within the G12.1 modal and cancelled via G40 before G13.1 is read.

Error Analysis

Incorrect programming syntax or improper modal states during polar interpolation 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
MitsubishiProgram Error P32Coordinate value programmed directly with rotary axis name after E= (e.g. E=C90.0).CNC halts execution, showing error on the display panel.Remove the coordinate value from the G12.1 activation block. Only define the axis letter.
MitsubishiProgram Error P33G12.1 or G13.1 is not written in an independent block, or rotary name is omitted.Program stops immediately, preventing axis movement.Write G12.1 and G13.1 completely alone in independent blocks. Check syntax for E= address.
MitsubishiProgram Error P481Attempting tool length compensation (G43/G44) or G10.9 switching while G12.1 is active.Lathe turret halts during path transition; machine displays error code.Activate all tool offsets before calling G12.1. Avoid G10.9 radius/diameter changes.
MitsubishiProgram Error P485Attempting plane switching (G18/G19), active G96 CSS, or omitting G40 before G13.1.The CNC program interrupts active cutting; alarm light illuminates.Deactivate CSS using G97 before G12.1. Ensure G40 is active before G13.1. Avoid changing planes.
MitsubishiAlarm E98Attempting manual arbitrary reverse run (G127) or block search / program restart during polar interpolation.The system rejects manual backtracking or search requests.Do not use manual reverse run or block search while G12.1 is active. Re-run from the start of the program if halted.
FanucSystem Alarm (Feedrate)Commanding or keeping synchronous feed per revolution (G95) active during polar mode.Control panel displays a feedrate conflict alarm and stops the feed.Switch to feed per minute (G94) before executing G12.1.

Application Note

An operator error during tool offset setup inside the polar coordinate mode can cause the lathe turret to travel off-trajectory during rapid transitions, driving the milling cutter straight into the raw stock clamped in the workpiece chuck or colliding with the table-mounted fixture clamps. This causes a catastrophic machine collision, damaging the spindle bearings and misalignment of the turret head. To mitigate this risk, operators must utilize Chuck and Tailstock Barriers (G22/G23) on the control panel. When the tool path crosses these electronic safety zones, the system halts axis movement and displays a stored stroke limit alarm code, avoiding physical hardware damage. All tool length compensations must be fully active before commanding G12.1; attempting to change tool length offsets inside the polar interpolation mode triggers Program Error P481, which immediately halts the machine mid-cut and leaves the tool in contact with the workpiece, risking cutter breakage.

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 G13.1:

  • g12.1-polar-coordinate-interpolation: Activates polar coordinate/milling interpolation mode, mapping Cartesian coordinates to synchronized X and C axis movements.
  • g11-programmable-data-input-cancel: Cancels programmable data input mode, ensuring coordinate parameters are not altered after completing face-milling sequences.
  • g07.1-cylindrical-interpolation: Activates cylindrical interpolation on the rotary axis, representing a related rotary-to-linear mapping mode.
  • G40: Cancels active tool nose radius compensation, which must be executed prior to the G13.1 cancel command to prevent plane errors.
  • G94 / G95: Dictates feedrate modes, where G94 controls feed per minute and G95 controls feed per revolution.

Conclusion

Successful face-milling operations on multi-axis lathes depend on precise coordinate transitions and clean modal cancellations. Programmers must ensure the C-axis is pre-indexed to C0, write G12.1 and G13.1 in independent blocks, and deactivate tool nose radius compensation via G40 prior to cancellation. Adhering to these structural G-code rules prevents axis alignment errors, avoids program halts, and eliminates the risk of turret collisions during face-milling cycles.

FAQ

Why does the machined profile rotate on the workpiece face?

The CNC control forcibly resets the virtual C-axis counter to 0 upon G12.1 activation. Operators must pre-position the C-axis using G00 C0 before enabling polar coordinate mode, or the machined flat or profile will be rotationally offset, resulting in a misaligned contour and a ruined damaged workpiece.

Can tool length compensation be changed while G12.1 is active?

No. Attempting to activate or change tool length compensation with G43 or G44 inside the G12.1 mode halts the control and generates Program Error P481. Programmers must ensure all tool length offsets are fully active before enabling polar coordinate interpolation.

What happens if G13.1 is not programmed in an independent block?

Executing G13.1 in a block that contains other coordinate movements or preparatory codes causes the control to halt and trigger Program Error P33. Always place G13.1 in its own independent block to guarantee a clean transition back to standard turning mode.

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