G45 Tool Offset Increase and Position Compensation in CNC Programming
Master G45 tool offset increase for Fanuc, Siemens, and Mitsubishi. Learn parameter settings, alarm codes, and G-code examples to prevent machine crashes.
Introduction
A catastrophic hard collision shatters the carbide insert, bends the spindle shaft, and halts automatic operation when an incorrect tool length value is loaded or an offset register is called with active parameter conflicts on a milling machine. During rapid Z-axis descents under positioning blocks, the tool holder or tool turret can descend at rapid traverse (G00) and slam directly into table-mounted workpiece clamps, a fixture vise jaw, or a rotating spindle chuck. These physical impacts trigger severe axis-overload alarm codes such as Y51 108 or P170, leaving the operator with a ruined scrap part and costly machine downtime.
To avoid these mechanical collisions, CNC setup personnel must understand the coordinate translation and offset behaviors of the machine control. By programming tool position offsets, operators can shift the active workpiece coordinates to match physical tool geometry. Correctly applying non-modal offset commands like G45 tool offset increase allows safe tool positioning relative to fixture obstructions before beginning machining cycles. To ensure safe clearance transitions, operators should coordinate their retract sequences using G40 compensation cancel or G43 tool length compensation to retract tools before performing manual zero reference returns.
Technical Summary
| Specification | Details |
|---|---|
| Command Code | G45 |
| Modal Group | Group 00 / Non-modal |
| Supported Brands | Fanuc, Siemens, Mitsubishi |
| Critical Parameters | Mitsubishi #1268 ext04/bit6, Mitsubishi #1268 ext04/bit5 |
| Main Constraint | Non-modal command that must be specified in every block where tool position offset increase is required. |
Quick Read
- Understand Modal Limits: Recognize that G45 is a non-modal Group 00 command, requiring explicit programming in every block it is intended to affect.
- Match Register Addresses: Verify that the H register number matches the correct tool offset index to prevent unexpected coordinate shifts and tool crashes.
- Configure Operation Type: Check machine parameter #1268 ext04/bit6 to determine whether length offsets execute as physical axis movements or silent coordinate system shifts.
- Isolate Circular Blocks: Never command tool length offsets like G43 tool length compensation in the same block as circular interpolation G02 or G03 to avoid Program Error (P70).
- Control Standalone Updates: Set parameter #1274 ext10/bit3 to 1 if you need to update the modal offset register H using a standalone command block.
- Validate Parameter Harmony: Avoid setting parameters #1247 set19/bit0, #1292 ext28/bit3, and #1274 ext10/bit3 to 1 simultaneously to prevent MCP Alarm Y51 108.
Basic Concepts
Activating positive tool length compensation on a milling system allows programmers and operators to establish a mathematically recalculated tool tip path that eliminates the need to know exact cutter lengths during program development. The programmer develops the tool path relative to a theoretical blueprint plane, while the setup operator measures the physical tool assembly on a tool presetter and inputs this value into the control's length offset register under the corresponding H address. When G43 tool length compensation is commanded, the control dynamically adjusts the coordinates of the motion axis. However, programmers must understand how the machine tool builder has configured parameter #1268 ext04/bit6. If set to 1 (coordinate shift type), a standalone command does not cause any immediate physical axis movement; instead, the coordinate counters shift silently in the background, and the tool only executes the offset translation when the next absolute movement command is processed.
Setup operators and programmers must maintain absolute vigilance regarding how active tool compensation behaves during reference point returns and coordinate transitions. When an automatic reference position return (G28 or G30) is executed, the tool length compensation amount is automatically canceled by the control once reference zero is reached. If the operator performs a manual reference return and parameter #1210 is not configured to retain G43, the modal length compensation state is lost, causing the tool to travel on an uncompensated trajectory upon the next positioning block. If an incorrect tool length is loaded into the register or the offset register number does not match, a catastrophic hard collision can occur where the tool holder or tool turret can descend at rapid traverse (G00) and slam directly into table-mounted workpiece clamps, a fixture vise jaw, or a rotating spindle chuck, shattering the carbide insert, bending the spindle shaft, triggering a severe axis-overload alarm code (such as Y51 108 or P170), and rendering the raw workpiece a ruined scrap part.
Command Structure
The G45 command is a non-modal (one-shot) tool position offset that increases the target endpoint coordinate along the programmed axis. When G45 is specified in a block, the control retrieves the tool offset value from the H address register and adds this value to the movement distance of the designated axis. This command only applies to the block in which it is programmed, meaning subsequent motion blocks revert to standard uncompensated coordinates unless another offset code is called.
To define the magnitude of the coordinate extension, programmers must pair G45 with a coordinate address (such as X, Y, or Z) and an H address register. In Mitsubishi controls, related commands include G46 for tool position offset reduction, G47 for double increase, and G48 for double decrease. These commands allow the operator to fine-tune axis endpoints without rewriting core toolpaths, but improper cancellation or coordinate shifting can result in program errors if format switches are executed.
Syntax
Fanuc: — (no source)
Siemens: — (no source)
Mitsubishi: G45 X_ Y_ Z_ H_ ;
| Address / Modifier | Description | Key Requirement |
|---|---|---|
| G45 | Tool position offset: increase / Tool offset: increase | Non-modal Group 00 command that offsets target endpoint in positive direction by H. |
| X_ Y_ Z_ | Coordinate axis targets | Specifies the target coordinate endpoints along which the position offset is applied. |
| H_ | Tool offset number | Designates the tool offset register number containing the length or radius offset value. |
| G46 | Tool position offset (reduction) | Non-modal command that offsets target endpoint in negative direction by H. |
| G47 | Tool position offset (double increase) | Non-modal command that offsets target endpoint in positive direction by 2 × H. |
| G48 | Tool position offset (double decrease) | Non-modal command that offsets target endpoint in negative direction by 2 × H. |
Brand Applications
Fanuc
On Fanuc controls, there is no source data for G45 command syntax, parameters, or alarms.
— (no source)
| Category | Parameter / Alarm ID | Description and Value Details |
|---|---|---|
| — | — | — (no source) |
Siemens
On Siemens controls, there is no source data for G45 command syntax, parameters, or alarms.
— (no source)
| Category | Parameter / Alarm ID | Description and Value Details |
|---|---|---|
| — | — | — (no source) |
Mitsubishi
On Mitsubishi CNC controls, the G45 tool position offset is configured using parameters #1268 and #1247 to control coordinate shifting and standalone axis movement behaviors. Operators must ensure these are aligned to prevent conflicts.
G45 X100.0 Y100.0 H01 ;
| Category | Parameter / Alarm ID | Description and Value Details |
|---|---|---|
| Parameter | #1268 ext04/bit6 | Tool length offset operation type. Selects compensation by physical axis movement (0) or coordinate shift (1). Value: 0 or 1. |
| Parameter | #1268 ext04/bit5 | Offset operation behavior when offset amount is changed dynamically during execution. 0 = axis movement type; 1 = coordinate shift type. Value: 0 or 1. |
| Parameter | #1247 set19/bit0 | Movement by tool length command. Controls axis movement when G43/G43.7/G49 is commanded alone. 0 = moves by offset; 1 = does not move. Value: 0 or 1. |
| Parameter | #1292 ext28/bit3 | Timing for applying changed compensation values. 1 = applied in next block; 0 = next compensation axis movement block. Value: 0 or 1. |
| Parameter | #1210 RstGmd/bit18 and bit7 | Modal G-code reset setting. Configures whether to retain G43 modal status upon reset. Bit 18 = 1, Bit 7 = 0. |
| Parameter | #8122 Keep G43 MDL M-REF | Keep G43 modal at manual reference return. 1 = reactivates G43 when axis moves after reaching reference position. Value: 0 or 1. |
| Parameter | #1274 ext10/bit3 | Tool offset number H stand-alone command (for M system only). 1 = enables H modal update. Value: 0 or 1. |
| Parameter | #1381 TolOfsCmdCheck_M | Screen empty values for offset amount. If bit 1 is 1, throws error if offset evaluates to 0. Value: 0 or 1. |
| Parameter | OFE, OFD, OFC, OFA | Unit and range of tool compensation value (metric input). Limits range from ±9999.99 mm to ±9999.999999 mm. |
| Parameter | #1003=B to #1003=E | Unit and range of tool compensation value (metric/inch input). Metric shape: ±999.999 to ±999.999999 mm. Inch shape: ±99.9999 to ±99.9999999 inch. |
| Alarm | MCP Alarm Y51 108 | Simultaneously setting #1247 set19/bit0, #1292 ext28/bit3, and #1274 ext10/bit3 to 1 in conflict. Halts NC, preventing automatic operation from starting. |
| Alarm | Program Error (P170) | Active tool length compensation offset register number (H address) exceeds specification range. Program a valid offset number. |
| Alarm | Program Error (P169) | Active tool offset command check (#1381/bit1 = 1) finds offset amount in register evaluates to zero. Input non-zero value or disable parameter check. |
| Alarm | Program Error (P29) | Format switch G188/G189 called before G43 cancellation complete; or G92.1 commanded during G43 without specifying compensation axis in block; or G49 issued in drilling cycle when #1268 ext04/bit6 = 1. |
| Alarm | Program Error (P70) | Specified G43/G44/G49 and circular command G02/G03 in the same block. Program in separate blocks. |
| Version Difference | High-Speed High-Accuracy Control III (G05 P20000) | In M800V/M80V series, if G43 is active and tool radius compensation (G41 cutter radius compensation) is turned ON, High-Speed High-Accuracy Control III dynamically drops down to High-Speed High-Accuracy Control II (G05 P10000) to prevent look-ahead calculation errors. |
| Version Difference | Lathe vs. Machining Center Coordinate Shifting | Lathe/turning systems apply length compensation automatically via T-code. Machining centers require explicit H (length) and D (radius) codes. |
Warning: Simultaneously setting parameters #1247, #1292, and #1274 to 1 causes a look-ahead conflict that immediately triggers MCP Alarm Y51 108 and locks out automatic operation.
Brand Comparison
| Topic | Fanuc | Siemens | Mitsubishi |
|---|---|---|---|
| Compensation Operation Type | — (no source) | — (no source) | Controlled by parameter #1268 ext04/bit6 to shift coordinates (1) or move physical axis (0) |
| Changing Offset Amount Operation | — (no source) | — (no source) | Controlled by parameter #1268 ext04/bit5 |
| Safety Lock Alarms | — (no source) | — (no source) | MCP Alarm Y51 108 locks automatic operation if parameters conflict |
| Program Format Switch Interaction | — (no source) | — (no source) | Compiler halts with Program Error (P29) if G188/G189 called before G43 cancellation complete |
| Standalone H command | — (no source) | — (no source) | H address standalone block update is enabled by parameter #1274 ext10/bit3 |
Technical Analysis
The architectural design of Mitsubishi controls exhibits three distinct behaviors that clearly separate its tool offset and length compensation execution from Fanuc and Siemens controls. First, Mitsubishi utilizes a highly structured, background parameter safety check that enforces a hardware-level automatic operation lock via MCP Alarm Y51 108. If the machine parameters for movement by tool length command (#1247 set19/bit0), operation at changing tool length offset (#1292 ext28/bit3), or H stand-alone command (#1274 ext10/bit3) are set to "1" simultaneously, the Mitsubishi control detects an unsafe conflict, immediately locking out automatic operation and throwing the alarm. Fanuc and Siemens controls process these look-ahead and register changeover transitions in software without throwing protective, hardware-level PLC/MCP lock alarms of this kind.
Second, Mitsubishi’s G43 modal interacts directly with its dynamic Program Format Switch (G188/G189) compiler. Mitsubishi allows a single parts program to dynamically switch formats between turning (lathe system) and milling (machining center system). During this switch, G43 modal states and tool registers are initialized. If a programmer commands G188 or G189 while the G43 length offset cancel is still incomplete, the compiler immediately stops the machine and outputs Program Error (P29). Siemens and Fanuc lack this bimodal, parameter-linked bimodal coordinate shift architecture, requiring separate programs or dedicated macro interpreters.
Third, Mitsubishi implements dual-method compensation operations (axis movement vs. coordinate shift) controlled by parameter #1268 bit 6. This enables the machine tool builder to configure whether calling G43 causes the physical Z-axis to translate immediately by the offset amount or whether it shifts the active workpiece coordinate system in the background without moving the machine. Fanuc controls are rigid in requiring physical axis motion for G43 startup, while Siemens controls manage tool length compensation strictly through tool edge (D) registers in native mode, completely bypassing G43/G44 direction G-code commands.
Program Examples
Fanuc Example
; Fanuc:
; Mitsubishi: N10 G90 G00 G54 X100.0 Y100.0 ; Absolute rapid positioning to safe starting coordinates
; Mitsubishi: N20 G43 Z2.0 H01 M08 ; Activates G43 (+) tool length compensation to Z2.0 with offset register H01 and coolant ON
; Mitsubishi: N30 G49 G00 Z200.0 ; Cancels tool length compensation with G49 and retracts the Z-axis
Dry Run Analysis (Fanuc): During a dry run, the operator verifies that no physical axis movement occurs if the control is configured for coordinate shifting. The spindle travels to absolute coordinates X100.0 and Y100.0 in the G54 coordinate system, activates positive tool length compensation to Z2.0 using register H01 with coolant active, and subsequently retracts to Z200.0 while canceling the compensation via G49.
Siemens Example
; Siemens:
; Mitsubishi: N10 G90 G00 G54 X100.0 Y100.0 ; Absolute rapid positioning to safe starting coordinates
; Mitsubishi: N20 G43 Z2.0 H01 M08 ; Activates G43 (+) tool length compensation to Z2.0 with offset register H01 and coolant ON
; Mitsubishi: N30 G49 G00 Z200.0 ; Cancels tool length compensation with G49 and retracts the Z-axis
Dry Run Analysis (Siemens): During a dry run, the machine executes the positioning block, rapid-positioning the X and Y axes to X100.0 and Y100.0. The control activates tool length compensation along the Z-axis to Z2.0 using H01 and turns on the coolant system. Finally, G49 cancels the active tool offset while retracting the Z-axis to a safe clearance coordinate of Z200.0.
Mitsubishi Example
; Mitsubishi:
; Mitsubishi: N10 G90 G00 G54 X100.0 Y100.0 ; Absolute rapid positioning to safe starting coordinates
; Mitsubishi: N20 G43 Z2.0 H01 M08 ; Activates G43 (+) tool length compensation to Z2.0 with offset register H01 and coolant ON
; Mitsubishi: N30 G49 G00 Z200.0 ; Cancels tool length compensation with G49 and retracts the Z-axis
Dry Run Analysis (Mitsubishi): During a dry run, the operator monitors the axis coordinates. In block N10, the tool rapids to the starting point X100.0 Y100.0 under G54. Block N20 activates positive tool length compensation G43 to Z2.0 with H01. If parameter #1268 ext04/bit6 is set to 1, the coordinate system shifts without immediate Z-axis movement. Finally, block N30 executes G49 to cancel the offset and retracts the Z-axis to Z200.0. The operator must verify that the tool does not plunge when G49 is executed.
Error Analysis
| Brand | Alarm Code | Trigger Condition | Operator Symptom | Root Cause / Fix |
|---|---|---|---|---|
| Mitsubishi | MCP Alarm Y51 108 | Simultaneously setting #1247 set19/bit0, #1292 ext28/bit3, and #1274 ext10/bit3 to 1 in conflict. | Halts NC, preventing automatic operation from starting. | Check parameter conflicts and ensure they are not set to 1 simultaneously. |
| Mitsubishi | Program Error (P170) | Active tool length compensation offset register number (H address) exceeds specification range. | Program execution stops at the block containing the invalid H address. | Program a valid offset register number within the control's configured range. |
| Mitsubishi | Program Error (P169) | Active tool offset command check (#1381/bit1 = 1) finds offset amount in register evaluates to zero. | Program execution halts with an error message on the screen. | Input a non-zero value in the register or disable parameter check. |
| Mitsubishi | Program Error (P29) | Format switch G188/G189 called before G43 cancellation complete; or G92.1 commanded during G43 without specifying compensation axis in block; or G49 issued in drilling cycle when #1268 ext04/bit6 = 1. | NC halts and displays error code P29. | Cancel G43 properly before formatting/drilling, or command axis in preset. |
| Mitsubishi | Program Error (P70) | Specified G43/G44/G49 and circular command G02/G03 in the same block. | Program stops and displays error code P70. | Program tool compensation and circular interpolation in separate blocks. |
| Fanuc | — (no source) | — (no source) | — (no source) | — (no source) |
| Siemens | — (no source) | — (no source) | — (no source) | — (no source) |
Application Note
Shattering the carbide insert and bending the spindle shaft occurs when the setup operator performs a manual reference return and modal length compensation G43 is lost because parameter #1210 is not configured to retain G43. When the next positioning block is processed, the machine tool travels along an uncompensated trajectory at rapid traverse G00. The spindle descends and slams directly into table-mounted workpiece clamps, a fixture vise jaw, or a rotating chuck. This crash halts automatic operation and triggers axis-overload alarms Y51 108 or P170. CNC operators must verify that parameter #1210 is configured with bit 18 set to 1 and bit 7 set to 0, ensuring that the G43 modal status is retained upon reset, or perform dry runs in the air to verify path clearance.
Related Command Network
- Active cutter radius compensation must be canceled using G40 compensation cancel before executing tool length offset cancellations.
- Cutter radius compensation left (G41 cutter radius compensation) shifts the toolpath perpendicular to the contour and cannot be active with G43 under High-Speed High-Accuracy Control III.
- Positive tool length compensation is initiated via G43 tool length compensation to offset the spindle axis to the positive side.
- The non-modal G45 tool offset increase extends target coordinates along the designated axis by the H register value.
- Cancellation of tool length and position compensation is executed via G49 to clear active offsets.
Conclusion
To guarantee collision-free machining, CNC program developers and setup operators must verify parameter configurations for coordinate shifting and timing register updates. Verifying parameters #1268 and #1247 before initiating automatic cycles ensures that tool position offsets translate correctly without unexpected physical axis movement. Establishing a rigid checklist for cancel commands and performing visual dry runs provides the final line of defense against tool destruction.
FAQ
How does parameter #1268 ext04/bit6 affect tool offset movement?
This parameter determines whether the tool length offset translates the tool through physical axis movement or coordinate shifts. When set to 1, calling G43 shifts the coordinate system silently in the background, which means no physical motion occurs until the next absolute movement block. Operators must check this parameter in the machine parameters screen and perform an air cut to verify if the Z-axis moves immediately during tool offset activation.
What triggers MCP Alarm Y51 108 on Mitsubishi controls?
This alarm is triggered when parameters #1247 set19/bit0 (movement by tool length command), #1292 ext28/bit3 (operation at changing offset), and #1274 ext10/bit3 (standalone H command) are simultaneously set to 1. The control interprets this combination as a safety conflict and locks automatic operation. To resolve this, access the machine parameters list and change at least one of these settings to 0 to restore automatic cycling.
Why does Program Error (P29) occur during format switches?
Program Error (P29) is triggered if a dynamic format switch command (G188 or G189) is called while a tool length compensation cancel is still incomplete. The Mitsubishi compiler requires all active offset vectors to be cleared to initialize coordinate systems. Always program a G49 command in a separate block prior to calling G188 or G189 to ensure the offset cancel is fully complete.
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.