Skip to main content
CNC.wiki

Guide to G39 Corner Offset Circular Interpolation in CNC

Learn how to program G39 corner offset circular interpolation on Fanuc, Siemens, and Mitsubishi CNC controls to prevent tool gouging and maintain finishes.

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

CNC CARE Co-founder

Introduction

An operator executing an outer contour milling operation on a workpiece clamped in a table-mounted vise jaw witnesses a sudden, violent deceleration followed by a loud crash. The toolholder slams directly into the vise jaw, shattering the carbide insert, bending the spindle, and throwing a severe axis-overload alarm on the control screen. This catastrophic hard collision and the resulting ruined scrap workpiece are the direct consequences of an incorrectly programmed corner offset transition under cutter radius compensation. When cutter compensation (G41 or G42) is active, navigating sharp outer corners requires precise tool path vector adjustments. Failing to program correct corner circular interpolation or setting incorrect geometry offsets causes the pre-read buffer to miscalculate the tool path, forcing the machine to deviate into fixtures. Implementing commands like G39 or G450 creates a safe, tangential transition arc around convex outer corners, maintaining constant feedrate and protecting both the workpiece and machine tool components from high-impact collisions.

Technical Summary

FieldDetails
Command CodeG39 (Fanuc / Mitsubishi / Siemens ISO Dialect), G450 / G451 (Siemens Native)
Modal GroupGroup 00 / Non-modal (Fanuc / Mitsubishi / Siemens ISO), Group 18 / Modal (Siemens Native)
Supported BrandsFanuc, Siemens, Mitsubishi
Critical ParametersParameter No. 19625 (Fanuc pre-read buffer size), DISC (Siemens transition overshoot, 0 to 100), Parameter No. 1084 RadErr (Mitsubishi max arc radius error)
Main ConstraintsCutter compensation (G41/G42) must be active; approach clearance must exceed double tool nose radius; non-motion blocks must not exceed look-ahead capacity (N − 2).

Quick Read

  • Activate Cutter Compensation: Ensure G41 or G42 is modally active before calling G39 or G450.
  • Maintain Minimum Approach Clearance: Program a startup approach clearance distance that is greater than the double tool nose radius to avoid startup errors.
  • Isolate Motion in Fanuc G39: Keep Fanuc G39 blocks strictly free of axis movement commands to prevent PS5445 program errors.
  • Program G39 Inline on Mitsubishi: Write Mitsubishi G39 commands on the same line as the coordinate motion block to insert the corner arc before that block's travel.
  • Configure Siemens for ISO Mode: Switch Siemens controls to ISO Dialect mode via G291 to enable native G39 interpreter support.
  • Limit Non-Movement Blocks: Prevent buffer overruns by stacking fewer than N − 2 consecutive non-movement blocks like M-codes or dwells in the compensation path.
  • Apply Only to Convex Corners: Restrict corner transitions to outer (convex) workpiece corners with angles less than 180 degrees to prevent tool gouging.

Basic Concepts

Implementing G39 corner circular interpolation (or G450 transition circle in Siemens) provides a highly reliable method for programmers to maintain exact surface finishes and avoid dwell marks at sharp outer corners. Under standard tool radius compensation, the tool center path must execute a transition around outer workpiece corners to remain tangent to the profile. By programming a transition arc whose radius is exactly equal to the cutter radius value stored in the active offset register, the CNC motion kernel automatically generates a transition arc. This tangential rounding prevents the tool from decelerating to a stop at the corner, maintaining constant cutting feed and eliminating corner chipping. Programmers must ensure corner offset circular interpolation is programmed exclusively at outer (convex) corners where the workpiece intersection angle is less than 180 degrees. Attempting to apply transition calculations at an inner (concave) corner is a critical error that defeats intersection calculations, causing the tool to gouge directly into the raw material, producing a ruined scrap workpiece.

Operators and setup personnel must maintain a strict clearance envelope when navigating compensation paths near machine fixtures. To initiate tool compensation safely before a corner is reached, the approach block must have a clearance distance from the raw stock that is larger than the double tool nose radius. If the approach clearance is too small, the pre-read buffer cannot construct the starting compensation vector, immediately halting the machine with an alarm. If the operator inputs incorrect offset data into the geometry register or programs an incorrect coordinate offset, the tool path will deviate. If this path deviation occurs near a table-mounted vise jaw, a spindle chuck, or physical workpiece clamps, the toolholder or turret can slam directly into the workholding equipment. This can result in a catastrophic hard collision that shatters the carbide insert, bends the spindle, throws a severe axis-overload alarm code, and produces a ruined scrap part. Additionally, programmers must not stack more than N − 2 non-movement blocks (dwells, M-codes, or coordinate-less statements) in offset mode, as look-ahead buffering will fail, producing a perpendicular vector that causes tool gouging.

Command Structure

The syntax and structure of corner offset circular interpolation vary depending on whether the system runs a Fanuc-compatible G-code list, a Mitsubishi command structure, or a native Siemens SINUMERIK control. On Fanuc and Siemens ISO Dialect systems, G39 acts as a standalone, non-modal block that commands the CNC compiler to insert a transition arc between the previous and subsequent coordinate paths. In these systems, the programmer can specify optional vector-direction modifiers (I, J, and K) to force the transition arc's endpoint normal to a specific plane-specific coordinate. No coordinate motion is permitted within this G39 block, separating the command from standard axis motion.

Mitsubishi controls, on the other hand, require the G39 command to be programmed on the same line as the coordinate motion block. This tells the control to automatically insert a corner transition arc immediately before executing the motion command programmed in that block. Native Siemens controls bypass G39 entirely in native mode, using the modal Group 18 commands G450 and G451. G450 inserts a transition circle around workpiece corners, while the DISC parameter controls the amount of transition overshoot. To use G39 on Siemens systems, the control must first be switched to ISO Dialect mode.

Fanuc and Siemens ISO Dialect Mode Syntax:
G39 ;
G39 I_ J_ ;
G39 I_ K_ ;
G39 J_ K_ ;

Mitsubishi G-Code Syntax: G39 G01 X_ Y_ F_ ; G39 G02 X_ Y_ R_ F_ ;

Siemens Native Mode Syntax: G450 DISC=50 ; G451 ;

BrandParameterDescriptionValid Range
FanucParameter No. 19625Pre-read look-ahead buffer size (N) for offset calculations.Integer
FanucParameter No. 1411Default corner arc velocity in G00 mode when no feedrate is active.Feedrate value
FanucParameter No. 19607 Bit 2 (CCC)Configures connection mode at outer corners (0: Linear, 1: Circular).0 or 1
FanucParameter No. 3405 Bit 4 (CCR)Disables I, J, K modifiers for chamfering to prevent syntax conflicts.0 or 1
FanucParameter No. 5000 Bit 3 (GNI)Controls tool path vector deletion behavior upon cancellation.0 or 1
SiemensDISCControls the transition circle overshoot under modal G450.0 to 100
SiemensMD 18800 $MN_MM_EXTERN_LANGUAGEEnables the external ISO Dialect interpreter to compile G39 commands.0 or 1
SiemensMD 20154 $MC_EXTERN_GCODE_RESET_VALUESDefines active G-code default settings at power-on or control reset.Array
SiemensMD 11411 $MN_ENABLE_ALARM_MASKConfigures path diagnostic and velocity alarm masks.Mask
MitsubishiParameter No. 1037 cmdtypSelects the active G-code system list (System A, B, or C).2, 3, 4, 5, 6, 7
MitsubishiParameter No. 1084 RadErrMaximum allowable center/radius calculation error (delta R) for arcs.Error threshold
MitsubishiParameter No. 1238 set10/bit0Remaps G36 function between circular threading and length measurement.0 or 1
MitsubishiParameter No. 1278 ext14/bit7Enables spiral interpolation when start and end radii mismatch.0 or 1

Brand Applications

Fanuc

Fanuc systems execute G39 under cutter radius compensation (G41 or G42) to insert circular corner transitions. Programmers can customize the default path connection by setting Parameter No. 19607 (CCC) and control look-ahead buffer capacity through Parameter No. 19625.

The G39 command is programmed as a standalone, non-modal command in the G-code group 00, meaning it must be executed in a dedicated block without any coordinate movement commands. Programmers can include vector-direction modifiers I, J, and K to specify the plane-specific vector to which the corner arc will be rounded normal.

CategoryDetails
ParametersParameter No. 19625 (buffer size); Parameter No. 1411 (G00 corner velocity); Parameter No. 19607 CCC (circular connection); Parameter No. 3405 CCR (disable I, J, K for chamfering); Parameter No. 5000 GNI (vector deletion).
AlarmsAlarm PS5445 (axis motion commanded in G39 block); Alarm PS0037 (plane change in compensation mode); Alarm PS0041 (cutter radius interference).
VersionsSeries 30i/31i/32i uses different tool tip R center path calculations compared to legacy 16i/18i/21i, and handles G40 vector deletion differently when GNI is set to 0.

Warning: Stacking more than N − 2 non-movement blocks between motion commands causes look-ahead buffering to fail, forcing the tool center normal to the profile and resulting in severe tool gouging.

Siemens

Siemens controls manage corner smoothing using native modal Group 18 commands rather than standalone corner G-codes. The external dialect interpreter is activated by setting machine data MD 18800 to 1, while default G-code modes are restored via reset values defined in MD 20154.

In native SINUMERIK mode (G290), G450 is used to generate a transition circle at outer corners where the DISC parameter adjusts the transition overshoot, whereas G451 extends the tool path to the intersection of the equidistant paths. To parse the standard ISO G39 command, the programmer must switch the control to ISO Dialect mode using G291.

CategoryDetails
ParametersDISC (0 to 100 transition overshoot); MD 18800 (enable ISO Dialect mode); MD 20154 (reset G-code defaults); MD 11411 (alarm configuration mask).
AlarmsAlarm 61800 (external CNC system missing); Alarm 61000 (no tool compensation active); Alarm 61105 (cutter radius too large for pocket).
VersionsSINUMERIK 840D sl supports advanced multi-edge turning codes G51.2 and G50.2, whereas the compact SINUMERIK 802D sl completely omits them and write-protects related machine data.

Warning: Attempting to call G39 in native Siemens mode (G290) will trigger a syntax compiler error; tool radius compensation must always be active before invoking a corner transition.

Mitsubishi

Mitsubishi CNC controls require G39 to be programmed within the motion block itself to automatically insert a preceding corner transition arc. The active G-code system is set by Parameter No. 1037, and the maximum radius deviation limit is governed by Parameter No. 1084.

Unlike other controls, Mitsubishi programs G39 in the same block as the coordinate movement command (such as G39 G01 X_ Y_ F_). The control automatically inserts a corner-rounding transition arc using the active offset register D before executing the coordinate motion.

CategoryDetails
ParametersParameter No. 1037 cmdtyp (G-code system list); Parameter No. 1084 RadErr (max arc error); Parameter No. 1238 set10/bit0 (circular threading vs length measurement); Parameter No. 1278 ext14/bit7 (spiral interpolation).
AlarmsProgram Error (P128) (machining condition G120.1/G121 active during compensation); Program Error (P951) (G39 called under simple inclined surface control G176); Program Error (P33) (illegal axis configuration); Program Error (P70)/(P71) (arc radius error exceeds RadErr limit).
VersionsM800V/M80V Series uses G37.1 for automatic tool length measurement and G37 for grid cycles, whereas M800/M80 uses G37 for tool length measurement. On lathe systems, X-axis measurement is remapped based on Parameter No. 1238.

Warning: Never program G39 while simple inclined surface control (G176) is active, as it triggers a Program Error (P951) and halts execution.

Brand Comparison

TopicFanucSiemensMitsubishi
Command RoundingNon-modal standalone G39 block. Axis coordinates in block trigger PS5445 alarm.No native G39. Uses modal G450 DISC=... or RND=... inline parameters. Blends with G642/G643 dynamics.G39 programmed directly in coordinate motion block (e.g. G39 X40.0), inserting arc before block travel.
Language InterpreterNative parsing under standard G Group 00 G-code list.Requires G291 switch to ISO Dialect mode to parse G39; G290 switches back to SINUMERIK.Native parsing under standard G Group 00 G-code list.
Safety & RecoveryHard-locked look-ahead parameter checking (Parameter No. 19625 look-ahead limit).Deceleration blended with continuous path tolerance and G62 override.Throws Program Error (P128) on active G120.1/G121 conflicts. G127 manual reverse run supports reverse contour tracing.

Technical Analysis

The architectural differences between Fanuc, Siemens, and Mitsubishi controls in executing outer corner transitions are visible in how each system validates blocks, parses commands, and handles real-time feed dynamic adjustments. Fanuc uses a strict, non-traversing, one-shot G39 block that enforces safety by isolating the transition calculation entirely from axis displacement. Programming any coordinate motion inside a Fanuc G39 block triggers Alarm PS5445 immediately. This hard-locked compiler validation protects the machine from unexpected linear slides, making the resulting toolpath highly predictable on the shop floor. In contrast, Mitsubishi integrates G39 directly into the coordinate motion block, executing the transition arc immediately before the commanded travel. This approach reduces program length but links motion and compensation logic into a single block, which is then validated against Mitsubishi's multi-tier Program Error system. The Mitsubishi control also supports manual arbitrary reverse run (G127), which allows operators to back the tool out along the exact transition contour during emergency stops.

Siemens SINUMERIK controls bypass discrete G39 blocks in native mode (G290), opting instead for global, modal path smoothing via G450 or G451. Once a programmer specifies a G450 block with a DISC parameter (e.g., G450 DISC=50), the control dynamically smooths every outer corner in the entire contour. This eliminates the need to manually program transition commands at every intersection. Siemens also allows direct integration of corner transitions with continuous-path tolerances (such as G642 or G643) and automatic corner overrides (G62), adapting velocities in real-time based on machine dynamics. To execute G39 on Siemens, the control must switch interpreter parsers to ISO Dialect mode via G291. This requires active machine data (MD 18800 set to 1) to parse the commands before G290 restores the native SINUMERIK compiler.

Program Examples

Fanuc

N10 G17 G90 G01 G41 X10.0 Y0.0 D01 F1000 ;
N20 G39 ;
N30 G01 Y-10.0 ;

Dry Run Trace:

  1. Block N10: Activates cutter radius compensation Left (G41) on the G17 XY plane, moving to coordinates X10.0 Y0.0 with offset register D01 at a feedrate of 1000 mm/min. The control pre-reads block N20 to establish the start compensation vector.
  2. Block N20: Executes G39 corner circular interpolation. The tool path does not move linearly; instead, the control inserts a circular transition arc at the corner between N10 and N30. The radius of this arc is exactly equal to the offset value stored in register D01, keeping the cutter tangent to the workpiece contour.
  3. Block N30: The tool continues along the linear path to Y-10.0, completing the contour.

Siemens

G291 ;
G39 I-1.0 K2.0 ;
G290 ;

Dry Run Trace:

  1. Block 1 (G291): Switches the SINUMERIK interpreter from native mode to ISO Dialect mode to enable parsing of G39 corner commands.
  2. Block 2 (G39 I-1.0 K2.0): Executes a vector-directed corner circular interpolation on the active G18 Z-X plane. The tool center path generates a corner rounding arc whose endpoint is normal to the vector defined by components I-1.0 and K2.0. The radius of the arc is defined by the active tool radius compensation value.
  3. Block 3 (G290): Switches the interpreter parser back to native SINUMERIK mode to allow execution of native cycles and parametric subroutines.

Mitsubishi

G91 G01 G42 X20.0 Y20.0 D1 F100 ;
N101 G39 X40.0 ;
N102 G39 Y40.0 ;

Dry Run Trace:

  1. Startup Block: Activates tool radius compensation Right (G42) using offset register D1, moving incrementally X20.0 Y20.0 at a feedrate of 100 mm/min.
  2. Block N101: Commands an incremental motion of X40.0. The prefix G39 instructs the Mitsubishi control to insert a circular corner transition arc at the corner preceding the X40.0 movement. The tool center swings around the corner using the active radius from register D1 before completing the X-axis linear slide.
  3. Block N102: Commands an incremental motion of Y40.0. The G39 command automatically places a corner rounding transition arc at the corner between N101 and N102, keeping the tool tangent to the workpiece contour.

Error Analysis

Alarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
Fanuc PS5445Axis motion coordinate commanded inside a G39 block.The machine halts instantly; program execution stops, and the control screen displays a syntax alarm.Remove any X, Y, Z, U, V, or W axis movement coordinates from the G39 block. Program G39 as a standalone one-shot line.
Fanuc PS0041Cutter radius interference detected during path transition calculation.The control interrupts path execution, displays a cutter radius interference alarm, and stops motion.Increase the approach startup clearance to be larger than the double tool nose radius, or use a smaller tool.
Siemens 61800G39 or ISO dialect commands called when interpreter options are disabled.The program halts immediately upon reading G39; the control displays an "External CNC system missing" fault.Set machine data MD 18800 to 1 to enable the external ISO Dialect interpreter.
Siemens 61000Transition cycle called when tool radius compensation is not active.Machining cycle fails to execute; operator sees an alarm indicating tool compensation is inactive.Program G41 or G42 to active tool radius compensation prior to calling the transition cycle.
Mitsubishi P128Machining Condition Selection (G120.1/G121) called while compensation or G39 is active.Program execution is immediately blocked, and the screen displays Program Error (P128).Cancel tool compensation and complete G39 cycles before switching machining condition selections.
Mitsubishi P70 / P71Arc radius calculation error exceeds the parameter limit.The machine halts during circular interpolation, showing an arc difference error.Correct the programmed coordinates, or adjust Parameter No. 1084 RadErr to allow a slightly higher error threshold.

Application Note

Shattered carbide inserts, bent spindles, and damaged workholding fixtures occur when operators input incorrect offset data into the geometry register or when startup clearance envelopes are ignored. Safe activation of tool radius compensation requires an approach clearance from the raw stock that is greater than the double tool nose radius. If the clearance is insufficient, the pre-read buffer fails to calculate the initial compensation vector, halting the machine. When the toolpath deviates near vise jaws, chucks, or workpiece clamps, the toolholder or turret can strike the fixtures, triggering a hard collision. Programmers must also avoid stacking more than N − 2 non-movement blocks (such as dwells, comments, or M-codes) in offset mode, as this interrupts look-ahead buffering and forces a normal vector that gouges the workpiece.

Related Command Network

  • G40: Cancels active tool radius and tool nose compensation modes to return the tool to its programmed coordinates.
  • G41 / G42: Activates tool radius compensation Left or Right, which is a required prerequisite for executing G39 or G450 corner transitions.
  • G38: Designates or retains a cutter compensation vector for a single block without executing intersection calculations.
  • G01 / G02 / G03: Performs linear and circular path movements that G39 smooths around outer corners.
  • G290 / G291: Switches Siemens controls between native SINUMERIK mode and ISO Dialect mode to parse standard G39 commands.

Additionally, other Group 00 unmodal commands like G37 automatic tool length measurement manage axis calibration, while commands such as G34 variable-lead threading and G35 thread cutting with decreasing lead manage custom helical paths.

Conclusion

Successful outer corner rounding depends on matching the programmed G-code to the controller's specific path validation rules and maintaining correct offset registers. Standardizing program start clearances, verifying parameter limits such as Parameter No. 19625 or Parameter No. 1084, and validating look-ahead buffering requirements prevents unexpected toolpath deviations and spindle crashes on the production floor.

FAQ

Why does my Fanuc control trigger alarm PS5445 when using G39?

Alarm PS5445 occurs because an axis motion command (such as X, Y, or Z coordinates) was programmed in the same block as the non-modal G39 command. Fanuc enforces a strict system rule where G39 must be programmed on its own standalone line without any motion coordinates. To resolve this, remove any coordinate movement from the G39 block and place them in the subsequent contour blocks.

How does Siemens execute G39 corner rounding without a native G39 command?

Native Siemens SINUMERIK controls do not have a G39 G-code. Instead, they manage outer corner smoothing modally using G450 (transition circle) or G451 (intersection), where the parameter DISC (valued 0 to 100) controls the amount of transition overshoot. However, if the control is switched to ISO Dialect mode via G291, the Siemens interpreter will natively parse standard G39 corner commands.

Why does my Mitsubishi control fail to calculate G39 corner transitions, causing tool gouging?

This tool gouging is typically caused by a buffer overrun where too many consecutive non-movement blocks (such as dwells, M-functions, or comments) are stacked in the compensation path. This interrupts the pre-read look-ahead buffer, making the control fail to construct the corner vector. To prevent this, ensure that consecutive non-movement blocks (M) do not exceed the limit (N − 2), where N is the look-ahead buffer size.

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