Skip to main content
CNC.wiki

G48 Tool Offset Double Decrease: CNC Programming on Fanuc and Mitsubishi

Master G48 tool offset double decrease on Fanuc and Mitsubishi CNCs. Learn syntax parameters, Siemens alternatives, and how to prevent Alarm PS0368.

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

CNC CARE Co-founder

Introduction to G48 Tool Offset Double Decrease and Collision Risks

A catastrophic hard collision where the tool or tool turret crashes directly into a rotating spindle chuck, table-mounted clamps, or a workpiece vise jaw can occur instantly if an operator runs a legacy program containing G48 tool offset double decrease without sufficient starting clearances or with incorrect register signs. Because G48 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 contraction of the toolpath into a double expansion. 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 Alarm PS0368 or 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 G48 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

SpecificationDetails
Command CodeG48
Modal GroupGroup 00 / Non-modal (one-shot) on Fanuc and Mitsubishi. Unsupported on Siemens.
BrandsFanuc, Siemens (G48 not supported), Mitsubishi
Critical ParametersFanuc Parameter No. 5040 Bit 3 (TCT), Mitsubishi Parameter No. 1003 iunit, Siemens MD 10760 $MN_G53_TOOLCORR
Main ConstraintG48 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 the negative direction; in absolute mode (G90), the tool does not move. Negative offsets invert the direction.

Quick Read

  • Establish a minimum safety clearance envelope larger than twice the tool radius before commanding G48 offsets.
  • Avoid programming G48 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 G48 on lathe or turning configurations, as G48 is unsupported on Siemens and Mitsubishi lathes use G46 instead.
  • Do not program G48 tool offsets inside the finishing shape program blocks (P to Q) of canned roughing cycles (G71, G72, G73) on Fanuc systems.

Basic Concepts of G48 Tool Offset Double Decrease

The G48 tool offset double decrease command is a non-modal, Group 00 preparatory function designed to shorten or contract 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 G48, preferring standard modal cutter compensation such as G41 cutter radius compensation and G40 compensation cancel.

When G48 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 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 G48 Tool Offset Double Decrease, 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 G48 X0 D01;), the tool physically moves by double the offset value stored in D01 in the negative direction. Conversely, in absolute mode, a zero-travel target (such as G90 G48 X0 D01;) results in no tool movement. This difference is critical for operator safety during coordinate setup.

A vital constraint when using G48 is the sign logic of the register value. A positive value in the offset register contracts the travel distance in the programmed direction. A negative value acts as an addition, which reverses the directional meaning and behaves as a double expansion. The compensation register address is selected using D or H, depending on parameter configurations. Stacking G48 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) G48 IP_ D_ (or H_) ;

Mitsubishi Machining Center Mode:

G90 (or G91) G00 (or G01) G48 IP_ D_ (or H_) ;

Siemens Controls Mode:

(G48 is not supported. Use Tx Dx edge selection and OFFN instead.)

Parameters

AddressDescriptionRange / 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, G48 is classified under G-code Group 00 as a non-modal tool offset double decrease 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 G48 X120.0 D01 F300;. This block incrementally moves the axis, shortening the travel in the programmed positive X direction by double the offset value in register D01.

TypeCode / ParameterDetails
ParameterParameter No. 5040 Bit 3 (TCT)Tool Change Type. Must be set to 1 to enable Group 23 G-codes and modern offsets.
ParameterParameter No. 19625Look-Ahead Buffer Size. Interruption occurs if consecutive non-motion blocks exceed buffer.
ParameterParameter No. 5001 Bit 3 (TAL)Set to 1 to suppress system alarms when multi-axis tool length offset commands are performed simultaneously.
ParameterParameter No. 5008 Bit 4 (MCR)Set to 1 to prevent radius compensations in MDI mode.
ParameterParameter No. 5000 Bit 3 (GNI)Determines if G40 cancel with no motion is treated as no tool movement.
ParameterParameter No. 0001 Bit 1 (FCV)Set to 1 to interpret G-code in Series 15 format (where D after cycles G71-G76 is depth of cut).
AlarmAlarm PS0368Switching between tool length compensation (G43/G44/G49) and unmodal (G45–G48) offsets without canceling first with G49, or changing Parameter 5040 Bit 3 while offset is active.
AlarmAlarm PS0325Tool position offsets (G45–G48) specified inside finish shape blocks of canned roughing cycles (G71, G72, G73).
AlarmAlarm PS0041 / Alarm No. 041Programmed clearance between toolpath contour and start positions during offset start/cancel is smaller than tool radius.
AlarmAlarm PS5257Tool offsets commanded from MDI mode when Parameter No. 5008 Bit 4 (MCR) is set to 1.

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 G48 double decrease 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.

TypeCode / ParameterDetails
ParameterMD 10760 $MN_G53_TOOLCORRSuppression/retention of tool offsets during G53, G153, and SUPA. Default is 2 (values 2 to 4).
ParameterMD 20380 $MC_TOOL_CORR_MODE_G43_G44Handles how G43/G44 tool length offsets are processed when external language mode is active.
ParameterMD 18800 $MN_MM_EXTERN_LANGUAGEActivates the external NC language interpreter. Must be set to 1.
ParameterMD 10604 $MC_WALIM_GEOAX_CHANGE_MODEDetermines if active working area limitations are retained (1) or deactivated (0).
ParameterDISCTransition circle overshoot at outer corners during G450 (0 to 100).
ParameterOFFNContour offset allowance programmed directly on the contour.
AlarmAlarm 14011Rapid tool retract active via digital interrupt but CYCLE3106.spf is missing.
AlarmAlarm 14016Conflict ASUB / M-cycle. Program cycle call conflict where a subroutine call is superimposed on M functions.
AlarmAlarm 61800ISO dialect command (such as G291) is executed in the program while the global option parameter MD 18800 is not enabled.

Warning: Attempting to call G48 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 G48 under G-code Group 00 as a one-shot tool position offset double decrease command. Axis target coordinates are shifted by twice the offset stored in the D or H register. Lathe systems, however, do not support G48 for tool position offset; instead, they use G46 and G47.1.

The standard programming format for milling is G90 G01 G48 X120.0 D01 F300;. This block executes an absolute linear cut, contracting the path by twice the value stored in D01.

TypeCode / ParameterDetails
ParameterParameter No. 1003 iunitInput setting unit defining the resolution and valid range of the offset value (B, C, D, or E).
ParameterParameter No. 1120 TofValDetermines whether variables in the #2000 order shape/wear compensation registers are adjusted.
ParameterParameter No. 1041 I_inchConfigures input/output dimensions to follow metric (0) or inch (1) systems.
ParameterParameter #1268 ext04/bit6Dual-method tool length compensation operations (axis movement vs. coordinate shift).
ParameterParameter #1292 ext28/bit3Operation at changing tool length compensation amount.
ParameterParameter #1247 set19/bit0Movement by tool length compensation command when G43/G44/G49 commanded alone.
ParameterParameter #1520 Tchg34Configuration of additional axes' tool compensation.
AlarmProgram Error (P128)Triggered if G45 to G48 commands are active when high-speed high-accuracy cycles G120.1 or G121 are executed.
AlarmProgram Error (P45)Triggered if G43.7 (Tool Position Compensation) is commanded while G45–G48 tool position offset is active.
AlarmProgram Error (P35)Triggered if the compensation value written to the register exceeds the maximum allowable command range.
AlarmProgram Error (P29) / P294Triggered if program format switch ON (G188) or cancel (G189) is executed while G48 offset cancel is incomplete.

Warning: Attempting to call high-speed high-accuracy cycles (G120.1 or G121) while a G48 tool position offset is active will trigger Program Error P128, immediately halting program execution.

Brand Comparison

Feature / MetricFanucSiemensMitsubishi
G48 Command SupportSupported (Group 00 non-modal tool offset double decrease).Not supported. Offsets are managed via Tx Dx and G41/G42.Supported on Machining Center systems in M2/M0 format as Group 00 unmodal command.
Look-ahead buffer limitationRigid limitation (Parameter No. 19625). Consecutive no-motion blocks cannot exceed N-2, otherwise overcuts occur.Deep pre-read queues dynamically resolve compensation vectors across multiple no-motion blocks.Deep pre-read queues dynamically resolve compensation vectors across multiple no-motion blocks.
Reverse Run Coordinate RecoveryNo 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.
Canned cycle interlock / behaviorG43/D commands inside P-Q sequence blocks are ignored or trigger Alarm PS0325.Finishing contour segments managed dynamically within high-level cycles.G45-G48 commands are ignored during fixed cycle.
Tool length compensation commandsSeparate positive (G43) and negative (G44) commands.Direction shifts managed automatically through tool edge selection model (D1, D2) in native mode.Separate positive (G43) and negative (G44) commands.

Technical Analysis

An analytical evaluation of tool offset management reveals three primary distinctions between Fanuc, Siemens, and Mitsubishi controls. First, Fanuc retains G48 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 G48 cannot run on Siemens controls without translating the block-by-block offset logic into modal profile compensation commands.

Second, Mitsubishi machining center controls support G48 as a Group 00 unmodal offset double decrease, but on lathe systems, the command does not exist for position offsets. Instead, Mitsubishi lathe configurations reserve G46 for tool nose radius compensation and 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 G48 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 G48 X100.0 D01 F150 ;
G90 G00 G48 Y50.0 H02 ;
G91 G00 G48 X0 Y0 D03 ;

dry run

  • The controller executes a linear interpolation move along the X-axis in incremental mode. The actual travel distance is decreased in the programmed positive X direction by exactly double the offset value stored in tool compensation register D01 at a feedrate of 150 mm/min.
  • The controller switches to absolute mode (G90) and performs a rapid traverse move (G00) to Y50.0. The Y-axis target coordinate is shifted (decreased) by double the offset value of H02.
  • The controller switches back to incremental mode (G91) and commands a zero-travel move along the X and Y axes. The axes physically move (shift) by exactly double the negative value of offset stored in register D03, resulting in a double expansion.

Siemens Example (TRC Alternative)

N10 G17 T="DRILL" D1 M03 S1500 ;
N20 G01 G41 G461 NORM X50.0 Y50.0 OFFN=1.2 F600 ;
N30 G40 G00 KONT X100.0 Y100.0 D0 ;

dry run

  • The controller selects the XY plane (G17), activates tool "DRILL" with cutting edge offset D1, starts the spindle clockwise at 1500 RPM, and loads the 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) and G461 corner extension. An allowance of 1.2 mm is programmed directly normal to the contour profile using the OFFN parameter at a feedrate of 600 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 the active tool offsets (D0).

Mitsubishi Example

G91 G01 G48 X-50.0 D01 F300 ;
G90 G00 G48 Z100.0 D02 ;
G91 G00 G48 Y0 D03 ;

dry run

  • The controller executes an incremental linear cut (G91 G01) along the negative X direction. The travel distance is decreased by double the value in offset register D01 at a feedrate of 300 mm/min.
  • The controller switches to absolute mode (G90) and performs a rapid traverse positioning move (G00) to Z100.0, decreased by double the offset value stored in register D02.
  • The controller executes incremental positioning (G91 G00) with a zero-travel command along the Y-axis. The axis physically moves by exactly twice the negative offset value stored in register D03.

Error Analysis

BrandAlarm CodeTrigger ConditionOperator SymptomRoot Cause / Operator Fix
FanucAlarm PS0041 / No. 041Attempting to program G48 tool offset double decrease 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 G48 from G41/G42 blocks.
FanucAlarm PS0368Switching between tool length compensation (G43/G44/G49) and unmodal (G45–G48) offsets without canceling first with G49, or changing Parameter 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.
FanucAlarm PS0325G48 or other tool offset commands 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 G48 or compensation commands from the finishing shape definition block range.
FanucAlarm PS5257Calling 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.
SiemensAlarm 14011G10.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.
SiemensAlarm 14016Program cycle call conflict where a subroutine call is superimposed on M functions with predetermined significance.Program execution halts, and Alarm 14016 appears.Avoid command conflicts in cycles/M-functions.
SiemensAlarm 61800ISO dialect command (such as G291) is executed in the program while the global option parameter MD 18800 is not enabled.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.
MitsubishiProgram Error (P45)Attempting to execute G48 tool position offset double decrease 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 G48.
MitsubishiProgram 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.
MitsubishiProgram Error (P128)G48 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 G48 offsets before initiating G120.1 or G121.
MitsubishiProgram Error (P29) / P294Program format switch ON (G188) or cancel (G189) is executed while G48 offset cancel is incomplete.The compiler halts execution and displays Program Error (P29).Complete offset cancellation before executing format switches.

Application Note

A tool turret crash into a structural table clamp or a workpiece vise jaw occurs when coordinate shifts are active near physical boundaries. When setup operators program G48 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

Conclusion

Safe execution of G48 tool offset double decrease 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 G48 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 decrease into a double increase, 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 G48 be commanded while cutter compensation (G41/G42) is active?

Stacking G48 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 G48 in absolute mode?

In absolute mode (G90), a zero-travel command such as G90 G48 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.

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