G47 Tool Offset Double Increase: CNC Programming on Fanuc and Mitsubishi
Master G47 tool offset double increase on Fanuc and Mitsubishi CNCs. Learn syntax parameters, Siemens alternatives, and how to prevent Alarm PS0041.
Introduction to G47 Tool Offset Double Increase and Collision Risks
A catastrophic hard collision where the tool or tool turret crashes directly into the rotating spindle chuck or a workpiece vise jaw can occur instantly if an operator runs a legacy program containing G47 tool offset double increase without sufficient starting clearances or with incorrect register signs. Because G47 coordinates shifts directly in the active motion block, any error in the sign (+/-) of the value stored in the D or H offset registers completely inverts the programmed direction of tool travel. This error transforms an expected double expansion of the toolpath into a double contraction. If the coordinate calculation shifts the path beyond the programmed travel distance, the axis moves in the opposite direction of the programmed contour. When this unexpected shift occurs near physical barriers such as a tailstock clamp, structural table clamps, or the spindle chuck, the carbide cutting insert shatters, the machine axis guideways deform, and the controller triggers a severe axis-overload alarm code like Fanuc No. 041 / PS0041, immediately converting raw stock into a ruined scrap part.
To mitigate this hazard, programmers and setup operators must establish a minimum clearance envelope larger than twice the tool radius (or tool nose radius) and verify all starting and ending positions in open, clear areas. Because G47 is non-modal (one-shot), the offset is active only within the specific block in which it is programmed, requiring manual repeat commands in every block where path translation is desired. This makes managing block-by-block offsets extremely tedious and error-prone compared to modern, modal cutter compensation.
Technical Summary
| Specification | Details |
|---|---|
| Command Code | G47 |
| Modal Group | Group 00 / Non-modal (one-shot) on Fanuc and Mitsubishi. Unsupported on Siemens. |
| Brands | Fanuc, Siemens (G47 not supported), Mitsubishi |
| Critical Parameters | Fanuc Parameter No. 5040 Bit 3 (TCT), Mitsubishi Parameter No. 1003 iunit, Siemens MD 10760 $MN_G53_TOOLCORR |
| Main Constraint | G47 cannot be programmed during active modal cutter compensation (G41/G42). Zero-travel behavior varies: in incremental mode (G91), the tool moves by double the offset value; in absolute mode (G90), the tool does not move. |
Quick Read
- Establish a minimum safety clearance envelope larger than twice the tool radius before commanding G47 offsets.
- Avoid programming G47 during active cutter compensation (G41 or G42) to prevent look-ahead calculator failure and Alarm PS0041.
- Ensure incremental mode (G91) is active when using a zero-travel command to physically execute the double offset shift.
- Verify the sign of the value stored in the H or D offset registers to prevent inverting the programmed travel direction.
- Avoid using G47 on lathe or turning configurations, as G47 is unsupported on Siemens and Mitsubishi lathes use G47.1 for spindle control instead.
- Do not program G47 tool offsets inside the finishing shape program blocks (P to Q) of canned roughing cycles (G71, G72, G73) on Fanuc systems.
Basic Concepts of G47 Tool Offset Double Increase
The G47 tool offset double increase command is a non-modal, Group 00 preparatory function designed to extend or expand the programmed travel distance of a specific axis movement by exactly twice the value stored in the designated compensation register. Because the offset is non-modal, it applies only to the coordinate move programmed in the same block. Modern CNC manufacturers classify G45 to G48 as obsolete legacy functions and retain them strictly for backward compatibility. Modern setup operators rarely use G47, preferring standard modal cutter compensation such as G41 cutter radius compensation and G40 compensation cancel.
When G47 is invoked on milling machines or machining centers, it dynamically modifies the tool center trajectory. The controller retrieves the geometry offset from the specified H or D register, doubles it, and adds or subtracts it from the programmed path travel. Programmers historically used this tool position offset function to adjust part sizes on a block-by-block basis, for instance, during roughing passes or face milling. However, manually inserting offset commands in every motion block is error-prone compared to automated path offsets calculated by modern modal compensation systems.
Command Structure and Programming Syntax
To command G47 Tool Offset Double Increase, the command must be programmed in the same block as an axis motion command, along with the coordinate target and the offset register address. The coordinates can be absolute (G90) or incremental (G91). In incremental mode, if the programmed travel distance is zero (for example, G91 G47 X0 D01;), the tool physically moves by double the offset value stored in D01. Conversely, in absolute mode, a zero-travel target (such as G90 G47 X0 D01;) results in no tool movement. This difference is critical for operator safety during coordinate setup.
A vital constraint when using G47 is the sign logic of the register value. A positive value in the offset register expands the travel distance in the programmed direction. A negative value acts as a subtraction, which reverses the directional meaning and behaves as a double contraction. The compensation register address is selected using D or H, depending on parameter configurations. Stacking G47 in the same block or running it concurrently with modal tool nose or cutter radius compensations is prohibited. To ensure the correct application of offsets, programmers must ensure tool length compensations like G43 tool length compensation are initialized first.
Syntax Formats
Fanuc Milling / Machining Center Mode:
G90 (or G91) G00 (or G01) G47 IP_ D_ (or H_) ;
Mitsubishi Machining Center Mode:
G90 (or G91) G00 (or G01) G47 IP_ D_ (or H_) ;
Siemens Controls Mode:
(G47 is not supported. Use Tx Dx edge selection and OFFN instead.)
Parameters
| Address | Description | Range / Limit |
|---|---|---|
IP_ | Coordinate target endpoint along the programmed movement axis (e.g., X, Y, Z). | Within machine travel limits |
D_ / H_ | Specifies the tool offset register containing the geometry compensation value. | 01 to 999 (D00/H00 is hard-locked to zero) |
Brand Applications: Fanuc, Siemens, and Mitsubishi
Fanuc
In Fanuc machining centers, G47 is classified under G-code Group 00 as a non-modal tool offset double increase command. It requires Parameter No. 5040 Bit 3 (TCT) to be configured to 1 to enable modern offset structures and Group 23 G-codes. The increment system resolution is defined by Parameter No. 1013, which scales valid tool compensation value inputs.
The standard programming format is G91 G01 G47 X-120.0 D01 F300;. This block incrementally moves the axis, extending the travel in the programmed -X direction by double the offset value in register D01.
| Type | Code / Parameter | Details |
|---|---|---|
| Parameter | Parameter No. 5040 Bit 3 (TCT) | Tool Change Type. Must be set to 1 to enable Group 23 G-codes and modern offsets. |
| Parameter | Parameter No. 19625 | Look-Ahead Buffer Size. Interruption occurs if consecutive non-motion blocks exceed buffer. |
| Parameter | Parameter No. 5000 Bit 3 (GNI) | Controls G40 cancel block behavior with zero motion to prevent tool path gouging. |
| Parameter | Parameter No. 1013 | Controls Increment System IS-A/B/C/D/E to determine input resolution. |
| Alarm | Alarm PS0041 | Cutter radius compensation interference. Occurs when G47 is programmed during active G41/G42. |
| Alarm | Alarm PS0368 | Triggered when switching offset types without calling G49 first, or changing TCT with active offset. |
| Alarm | Alarm PS0325 | Occurs if G47 is programmed within sequence blocks P to Q of roughing cycles (G71, G72, G73). |
| Alarm | Alarm PS5257 | Occurs if tool position offset or radius compensation is active in MDI when Parameter 5008 Bit 4 (MCR) is 1. |
| Version | Series 30i/31i/32i-B Plus vs. legacy | Parameter No. 5000 Bit 3 (GNI)=0 treats G40 cancel blocks with no tool movement differently, potentially causing overcutting on newer systems. |
Warning: Modifying Parameter No. 5040 Bit 3 (TCT) while an offset is active is strictly prohibited and can cause subsequent offset operations to fail or trigger Alarm PS0368.
Siemens
Siemens controls do not support the legacy G47 double increase command in native mode or under ISO Dialect (G291) mode. Instead, Siemens manages tool length and radius compensation dynamically via the tool call Tx and edge selection Dx. Approaches and retractions are controlled via modal commands and plane selection (G17/G18/G19).
In Siemens controls, tool radius compensation is activated modally by commanding NORM G41 X50.0 Y50.0 OFFN=1.5 F500;. This activates left TRC with a straight-line approach and a 1.5mm contour offset allowance.
| Type | Code / Parameter | Details |
|---|---|---|
| Parameter | MD 10760 $MN_G53_TOOLCORR | Suppression/retention of tool offsets during G53, G153, and SUPA. Default is 2 (values 2 to 4). |
| Parameter | MD 20250 | Look-ahead buffer consecutive block interruption limit in TRC mode. Default is 3. |
| Parameter | DISC | Transition circle overshoot at outer corners during G450. Range is 0 to 100. |
| Parameter | OFFN | Contour offset allowance applied normal to the programmed profile. |
| Parameter | Address D | Cutting edge selection register (values 1 to 32000) to activate offsets. |
| Alarm | Alarm 10751 | Collision danger alarm. Triggered if look-ahead preprocessor determines no intersection point is geometrically possible during G40 retraction. |
| Alarm | Alarm 14011 | Rapid tool retract active via digital interrupt but CYCLE3106.spf is missing. |
| Alarm | Alarm 61800 | ISO Dialect command (G291) called but MD 18800 is not enabled. |
| Version | 840D sl vs. 802D sl | Group 20 multi-edge turning functions (G51.2, G50.2) supported only on 840D sl; 802D sl locks parameter MD 10604. |
Warning: Attempting to call G47 on Siemens controls will result in parsing errors. Siemens users must rewrite programs to use Tx Dx edge selections and OFFN allowances.
Mitsubishi
Mitsubishi machining center controls support G47 under G-code Group 00 as a one-shot tool position offset double elongation command. Axis target coordinates are shifted by twice the offset stored in the D or H register. Lathe systems, however, do not support G47 for tool position offset; instead, G47.1 is reserved for all spindles simultaneous control mode.
The standard programming format for milling is G90 G01 G47 X50.0 D01 F300;. This block executes an absolute linear cut, elongating the path by twice the value stored in D01.
| Type | Code / Parameter | Details |
|---|---|---|
| Parameter | Parameter No. 1003 iunit | Input setting unit defining the resolution and valid range of the offset value (B, C, D, or E). |
| Parameter | Parameter No. 1120 TofVal | Determines whether variables in the #2000 order shape/wear compensation registers are adjusted. |
| Parameter | Parameter No. 1041 I_inch | Configures input/output dimensions to follow metric (0) or inch (1) systems. |
| Alarm | Program Error (P45) | Triggered if G47 is executed while G43.7 (Tool Position Compensation) is active. |
| Alarm | Program Error (P35) | Triggered if the compensation value exceeds the maximum command range defined by #1003 iunit. |
| Alarm | Program Error (P128) | Triggered if G45 to G48 commands are active when high-speed high-accuracy cycles G120.1 or G121 are executed. |
| Version | Machining Center vs. Lathe | Only machining centers support G47 position offset. Lathe configurations use G47.1 for spindle control. |
| Version | M800V/M80V vs. legacy | M800V/M80V supports Unit E/F input settings (up to ±999.999999 mm) for sub-micron precision. |
Warning: Attempting to call high-speed high-accuracy cycles (G120.1 or G121) while a G47 tool position offset is active will trigger Program Error P128, immediately halting program execution.
Brand Comparison
| Feature / Metric | Fanuc | Siemens | Mitsubishi |
|---|---|---|---|
| G47 Command Support | Supported (Group 00 non-modal tool offset double increase). | Not supported. Offsets are managed via Tx Dx and G41/G42. | Supported (Group 00 non-modal tool position offset double elongation). |
| Reverse Run Coordinate Recovery | No dynamic recovery of non-modal offsets during handwheel reverse tracing. | — (no source) | Supported. Integrates with G127 manual arbitrary reverse run using modal information storage blocks to prevent axis drift. |
| Bilingual Compiler Integration | Single unified G-code compiler. | Toggled compiler. Requires G291 for ISO Dialect G-code and G290 for native SINUMERIK mode. | Allows G188/G189 format switching between turning and machining center systems. |
| Transformation Interrupt Behavior | Transformation models allow modal compensation transitions without halts. | Switches in D edge directions for tool types 400–599 during active transformations trigger preprocessing stops. | Supports tool length compensation modes (physical axis movement vs. coordinate shift) via parameter #1268 bit 6. |
Technical Analysis
An analytical evaluation of tool offset management reveals three primary distinctions between Fanuc, Siemens, and Mitsubishi controls. First, Fanuc retains G47 strictly as a legacy, Group 00 unmodal command to maintain backward compatibility with old programs. Siemens, by contrast, completely omits G45 to G48 from its vocabulary. Instead, Siemens relies on cutting edge offsets (Address D) and the programmable contour offset variable OFFN to manage allowances dynamically. This architectural difference means that legacy programs containing G47 cannot run on Siemens controls without translating the block-by-block offset logic into modal profile compensation commands.
Second, Mitsubishi machining center controls support G47 as a Group 00 unmodal offset double elongation, but on lathe systems, the command does not exist for position offsets. Instead, Mitsubishi lathe configurations reserve G47.1 for all spindles simultaneous control mode. To ensure the correct execution of coordinate systems, Mitsubishi programs can utilize G188 or G189 format switches to dynamically toggle between turning and machining center systems. During a format switch, tool offsets are reinitialized, and if G47 cancellation is incomplete, the compiler halts execution with a program error (such as P29).
Third, Mitsubishi integrates unmodal offsets with its manual arbitrary reverse run function (G127) to recover coordinate information. During manual handwheel tracing, Mitsubishi's motion kernel recovers G45-G48 unmodal offset coordinates using its specialized modal information storage block, preventing axis drift. Fanuc controls do not support coordinate recovery during handwheel reverse tracing for unmodal, one-shot position offsets, which increases the risk of a tool turret crash if the operator attempts manual retraction along the programmed path. Additionally, Fanuc enforces a strict lookup buffer constraint via Parameter No. 19625, where running too many consecutive blocks without travel can exhaust the buffer, causing gouging, whereas Siemens utilizes G461/G462 arc and line extensions to handle boundary blocks when no path intersection can be calculated.
Program Examples
Fanuc Example
G91 G01 G47 X-120.0 D01 F300 ;
G90 G00 G47 Z10.0 H02 ;
G91 G00 G47 Y0 H03 ;
dry run
- The controller executes a linear interpolation move along the X-axis in incremental mode. The actual travel distance is increased in the programmed negative X direction by exactly double the offset value stored in tool compensation register D01 at a feedrate of 300 mm/min.
- The controller switches to absolute mode (G90) and performs a rapid traverse move (G00) to Z10.0. The Z-axis target coordinate is shifted by double the offset value of H02.
- The controller switches back to incremental mode (G91) and commands a zero-travel move along the Y-axis. The Y-axis physically moves (shifts) by exactly double the offset value stored in register H03.
Siemens Example (TRC Alternative)
N10 G17 T1 D2 M03 S1200 ;
N20 G01 G41 NORM X50.0 Y50.0 OFFN=1.5 F500 ;
N30 G40 G00 KONT X100.0 Y100.0 D0 ;
dry run
- The controller selects the XY plane (G17), activates tool T1 with cutting edge D2, and starts the spindle clockwise at 1200 RPM, loading length and radius offsets.
- The tool moves to X50.0 Y50.0 while activating left tool radius compensation (G41) with a normal approach vector (NORM). An allowance of 1.5 mm is programmed directly normal to the contour profile using the OFFN parameter at a feedrate of 500 mm/min.
- The controller cancels tool radius compensation (G40) and executes retraction via the transition circle path (KONT) to coordinates X100.0 Y100.0, clearing active tool offsets (D0).
Mitsubishi Example
G90 G01 G47 X50.0 D01 F300 ;
G91 G00 G47 Y0 H02 ;
G90 G02 G47 X10.0 Y10.0 I10.0 J0 D03 F150 ;
dry run
- The controller executes an absolute linear cut (G90 G01), shifting the target coordinate to X50.0 and elongating the actual physical path by twice the value stored in tool offset register D01 at a feedrate of 300 mm/min.
- The controller executes incremental positioning (G91 G00) with a zero-travel command along the Y-axis. The axis physically moves by exactly twice the tool offset value stored in register H02.
- The controller executes a 1/4 circle absolute circular interpolation (G02) to coordinates X10.0 Y10.0 with center point I10.0 J0. The actual circular path is elongated by twice the tool position offset value stored in register D03 at a feedrate of 150 mm/min.
Error Analysis
| Brand | Alarm Code | Trigger Condition | Operator Symptom | Root Cause / Operator Fix |
|---|---|---|---|---|
| Fanuc | Alarm PS0041 / No. 041 | Attempting to program G47 tool offset double increase command during active, modal cutter compensation (G41/G42). | The CNC screen displays Alarm PS0041, the axis motion halts immediately, and program execution is aborted. | Cutter radius compensation interference. Operator must cancel cutter compensation first using G40, or remove G47 from G41/G42 blocks. |
| Fanuc | Alarm PS0368 | Switching between tool compensation types without calling G49 first, or modifying Parameter No. 5040 Bit 3 (TCT) while an offset is active. | The CNC screen displays Alarm PS0368 and halts machine operations. | Active offset conflict. Program a G49 command to cancel the current compensation mode before switching offset types or changing parameter settings. |
| Fanuc | Alarm PS0325 | G47 or other tool offset commands (like G43) programmed inside finishing shape program blocks (from sequence number P to Q) of canned roughing cycles (G71, G72, G73). | The CNC screen displays Alarm PS0325 and aborts the roughing cycle execution. | Unavailable command in shape program. Remove G47 or compensation commands from the finishing shape definition block range. |
| Fanuc | Alarm PS5257 | Calling tool position offset or radius compensation in MDI mode when Parameter No. 5008 Bit 4 (MCR) is set to 1. | The CNC screen displays Alarm PS5257 and rejects the command. | Cutter radius compensation in MDI mode is disabled. Set Parameter MCR to 0, or execute offsets in memory mode. |
| Siemens | Alarm 10751 | Look-ahead preprocessor determines no intersection point is geometrically possible in a G40 retraction block. | The NC program halts with Alarm 10751, locking the axis and stopping spindle rotation. | Collision danger detected by preprocessor. Use G461 (arc extension) or G462 (line extension), or adjust retraction coordinates to allow a valid exit vector. |
| Siemens | Alarm 14011 | G10.6 rapid tool retract activated via digital interrupt, but retraction subroutine CYCLE3106.spf is missing. | Spindle retract fails during rapid lift command, and Alarm 14011 halts execution. | Missing retraction macro. Upload CYCLE3106.spf to the parts program memory directory. |
| Siemens | Alarm 61800 | ISO Dialect command (G291) is called but global option parameter MD 18800 is disabled. | The controller fails to parse ISO commands and triggers Alarm 61800. | ISO dialect option is disabled. Set machine data MD 18800 to 1 to enable external language interpretation. |
| Mitsubishi | Program Error (P45) | Attempting to execute G47 tool position offset double elongation command while G43.7 (Tool Position Compensation) is active. | The control screen displays Program Error (P45) and halts coordinate movements. | Tool position compensation conflict. Deactivate G43.7 before commanding G47. |
| Mitsubishi | Program Error (P35) | The tool offset value programmed via G10 or active register exceeds the maximum command range defined by Parameter No. 1003 iunit. | The program aborts and displays Program Error (P35) on the operator screen. | Value out of bounds. Adjust the programmed offset value to fit within the resolution range of the active input setting unit. |
| Mitsubishi | Program Error (P128) | G47 or other tool position offset commands (G45–G48) are active when high-speed high-accuracy cycles G120.1 or G121 are executed. | The control halts axis movement and displays Program Error (P128). | Position offset active during high-accuracy cycle. Deactivate G47 offsets before initiating G120.1 or G121. |
Application Note
A tool turret crash into a structural table clamp or a workpiece vise jaw occurs when coordinate shifts are active near physical barriers. When setup operators program G47 on Fanuc or Mitsubishi systems, or use incorrect cutting edge offsets on Siemens controls, any directional sign error stored in the D or H offset registers completely inverts the path trajectory. If the programmed travel distance is smaller than the offset value, the tool travels in the opposite direction of the expected contour. Rather than retracting safely, the axis executes an unprogrammed shift, driving the spindle and cutting insert directly into the fixtures. This sudden collision shatters carbide tools, deforms the machine axis guides, and generates severe overload alarms, turning raw stock into scrap. To prevent these mechanical crashes, operators must establish a safety clearance envelope larger than twice the tool radius and verify register values in open areas prior to running the cycle.
Related Command Network
- G45 (Tool Position Offset: Single Increase): Increases the programmed travel distance by the single offset value, representing the single-step expansion counterpart to G47.
- G46 (Tool Position Offset: Single Decrease): Reduces the programmed travel distance by the single offset value, representing the single-step contraction counterpart to G47.
- G48 (Tool Position Offset: Double Decrease): Reduces the programmed travel distance by exactly twice the offset value, representing the double-step contraction counterpart to G47.
- G40 / G41 / G42 (Cutter Radius Compensation Cancel, Left, Right): Calculates modal, continuous look-ahead path offsets that replace the legacy, non-modal G45–G48 block-by-block offsets.
- G43 / G44 / G49 (Tool Length Compensation Plus, Minus, Cancel): Activates and cancels tool length offsets along the spindle axis, which must be managed separately from G47 coordinates shifts.
Conclusion
Safe execution of G47 tool offset double increase commands depends on maintaining a strict safety clearance envelope larger than twice the tool radius and verifying offset registers prior to running the program. Programmers must ensure G91 incremental mode is active when specifying zero-travel shifts to force physical axis movement. Ultimately, transitioning legacy programs to modern modal cutter compensations prevents coordinate sign inversion errors and protects structural clamps and turrets from sudden mechanical collisions.
Frequently Asked Questions
Why does G47 cause the tool to move in the opposite direction of the programmed contour?
This backward travel occurs if the tool offset register contains a negative value, which mathematically inverts the double increase into a double decrease, or if the double offset subtraction value is larger than the programmed travel distance. Operators must check the sign of the value stored in the H or D register and ensure the programmed travel distance exceeds double the offset value before running the block.
Can G47 be commanded while cutter compensation (G41/G42) is active?
Stacking G47 inside active cutter compensation is strictly prohibited because it disrupts the preprocessor's look-ahead calculations, causing path deviations and triggering Alarm PS0041 on Fanuc or Program Error P45 on Mitsubishi. Always command a G40 to cancel active cutter compensation before attempting to execute G45–G48 one-shot tool position offsets.
What happens if a zero-travel command is programmed with G47 in absolute mode?
In absolute mode (G90), a zero-travel command such as G90 G47 X0 D01; results in zero physical axis movement because the control evaluates the target absolute coordinate as identical to the starting position. To execute a physical coordinate shift equal to double the offset amount, programmers must select incremental mode (G91) or use incremental axis addresses.
Still not resolved?
Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

- CNC CARE Co-Founder (May 2025 - Present)
- Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
- Reis CNC Service Engineer (2003 - 2008)
- Ören Kalıp CNC Mold Line Team Leader (1999 - 2002)
With over 25 years of experience working in all areas of the CNC machine industry, I continue my activities as a co-founder of CNC CARE, where we offer brand-independent consulting, engineering, and original spare parts services.
Related Articles
Other articles on this topic
G71 Metric Dimensioning Guide for Siemens SINUMERIK Controls
Learn how to program G71 and G710 metric dimensioning on Siemens SINUMERIK controls, including parameter MD 10240, alarm codes, and G-code syntax errors.
G69 Balance Cut Cancel: Coordinate Recovery & Crash Prevention
Learn how to program the G69 balance cut cancel command for Fanuc, Siemens, and Mitsubishi turning centers. Cancel dual slide synchronization and prevent crashes.
G70 CNC Finishing Cycle Guide for Fanuc, Siemens, and Mitsubishi
Learn the G70 finishing cycle for CNC turning. Master syntax, parameters, and alarm codes for Fanuc, Siemens CYCLE95, and Mitsubishi controls to avoid crashes.
G69 Coordinate System Rotation Cancel: Modals, Alarms, and Setup
Learn to cancel G68 facing turret mirrors and coordinate rotations using G69 on Fanuc, Siemens, and Mitsubishi CNCs to prevent turret crashes.