Skip to main content
CNC.wiki

G51 Coordinate Scaling ON (Milling): CNC Programming Guide

Master G51 coordinate scaling on Fanuc, Siemens, and Mitsubishi CNC controls. Prevent hard collisions, adjust feedrates, and troubleshoot alarm codes.

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

CNC CARE Co-founder

Introduction to Coordinate Scaling

An unscaled toolpath plunging directly into a table-mounted clamp at full rapid traverse velocity is one of the most expensive errors on a CNC machining floor. When implementing modal coordinate scaling commands, a simple programmatic offset, manual interruption, or failure to cancel transformations before a zero return can shift coordinate boundaries, bypassing safety clearance envelopes. Instead of executing a programmed reduction, the spindle or tool turret travels on an unscaled path, plowing the cutting tool into a workpiece fixture vise jaw or a rotating spindle chuck. This sudden physical impact results in a catastrophic hard collision, shattering the cutting tool, destroying the workpiece to produce a scrap part, and throwing severe axis-overload alarm codes.

Implementing coordinate scaling allows programmers to enlarge or reduce workpiece shapes without rewriting individual coordinate points. The CNC motion kernel dynamically multiplies the programmed travel coordinates of specified movement axes by a designated scale factor, allowing workpiece contours to be reduced or magnified. This is exceptionally beneficial for machining similar geometries, adding mold shrinkage allowances, executing unit translations, or changing the size of engraved characters.

Technical Summary

FeatureSpecification
Command CodesG51 / G50 (Fanuc, Mitsubishi, Siemens ISO Dialect); SCALE / ASCALE (Siemens native)
Modal Group / ModalityGroup 11 modal (Fanuc, Mitsubishi); Group 18 modal (Siemens ISO Dialect); Group 3 Frame (Siemens native)
Supported BrandsFanuc, Siemens, Mitsubishi
Critical ParametersParameter No. 5008 Bit 4 (Fanuc MCR); MD 22914 (Siemens AXES_SCALE_ENABLE); Parameter #8072 (Mitsubishi SCALING P)
Main ConstraintProgrammed feedrate F does not scale automatically. Active cutter compensation must be deactivated (G40) before scaling. Circular moves require both plane axes to be scaled.

Quick Read: Best Practices

  • Always program coordinate scaling commands in a separate, independent block to prevent parser errors.
  • Cancel scaling using G50 (or a bare SCALE in Siemens native mode) at the exact starting coordinates to prevent coordinate drift.
  • Deactivate cutter radius compensation with G40 before initiating coordinate scaling to ensure correct vector offset calculations.
  • Manually divide the programmed feedrate F by the active scaling factor to maintain cutting speed and protect the tool.
  • Scale both axes of the active plane when executing circular interpolation (G02 or G03) to prevent axis plane mismatch alarms.
  • Set safety working area limitations and verify clearance envelopes are larger than twice the tool nose radius.

Basic Concepts of CNC coordinate scaling

Implementing the G51 scaling function on Fanuc machining centers mathematically translates toolpath coordinate points relative to a specified center pivot, allowing programmers to enlarge or reduce workpiece shapes without rewriting the coordinate points. This is exceptionally beneficial for machining similar geometries, adding mold shrinkage allowances, or executing unit translations. However, programmers and operators must keep in mind that the programmed feedrate F does not scale automatically. If a workpiece contour is scaled to double its original size, the physical machining distance doubles. To maintain a consistent cutting velocity at the tool tip and protect tool life, the programmer must manually recalculate the feedrate by dividing the original feed rate by the active scale factor. Failing to perform this feedrate adjustment can drive the axis at excessive speeds, shattering the cutting insert, throwing overload alarm codes, and rendering the workpiece a ruined scrap part.

Activating coordinate scaling on Siemens controls mathematically adjusts toolpath movements relative to a specified pivot center, allowing programmers to easily modify workpiece dimensions without altering individual G-code coordinates. The practical programming effect is that the tool center path is enlarged or reduced based on the active scale factor. This is particularly useful when machining similar geometric shapes, adding mold shrinkage allowances, or executing unit translations. Programmers must note that scaling is applied strictly to the movement commands of the geometric axes. Technological parameters, such as the feedrate F and spindle speed S, remain unchanged and must be adjusted manually if required to maintain constant surface finishes and protect tool life.

Activating G51 coordinate scaling on a Mitsubishi machining center mathematically adjusts moving axis coordinates relative to a specified scaling center, allowing programmers to easily modify workpiece dimensions without altering the base coordinate points. The practical programming effect is that the tool center path is enlarged or reduced based on the active scale factor. This is particularly useful when machining similar geometric shapes, adding mold shrinkage allowances, or executing unit translations. Programmers must note that scaling is applied strictly to the movement commands of the geometric axes. Cutter compensation, tool position offset, and tool length compensation values themselves are not scaled; instead, they are recalculated and applied directly to the mathematically scaled toolpath coordinates. Scaling is valid strictly for automated movement commands in automatic operation and remains completely invalid for manual handwheel movements.

Command Structure and Syntax

Programmers must construct coordinate scaling blocks with specific address structures depending on whether a common scaling factor is applied to all axes or axis-specific factors are used. The G51 block must be programmed as an independent command, preparing the NC compiler for coordinate transformations before movement commands are executed.

In standard ISO programming systems, the command requires defining the absolute coordinates of the scaling center along with the scaling multiplier. For multi-axis applications where asymmetric deformation is required, separate axial scaling factors can be specified. It is critical to ensure that no more than two parameter numbers or command addresses are discussed in a single paragraph of text to maintain structural clarity.

The standard syntax structure across platforms is defined below:

  • Fanuc:
    G51 I_ J_ K_ P_ ; (where I, J, K specify the absolute scaling center, and P specifies the coordinate scaling factor)
  • Siemens Native:
    SCALE X_ Y_ Z_ ; (Absolute axial scaling factors) or ASCALE X_ Y_ Z_ ; (Additive axial scaling factors)
  • Siemens / Mitsubishi ISO Dialect:
    G51 X_ Y_ Z_ P_ ; (Common factor P around scaling center coordinates) or G51 X_ Y_ Z_ I_ J_ K_ ; (Axis-specific scaling factors)
Address / ParameterDescription
X, Y, ZCoordinates of the scaling center (in absolute or incremental mode depending on G90/G91).
I, J, KCoordinates of the scaling center on Fanuc; independent axial scaling factors on Siemens and Mitsubishi.
PCommon scaling factor multiplier applied to all basic axes.

Brand Applications: Fanuc, Siemens, and Mitsubishi

Fanuc

Implementing coordinate scaling on Fanuc machining centers requires configuring the system resolution parameter to preset the smallest programmable increment of the scaling factor. In addition, parameter No. 5008 Bit 4 (MCR) is utilized to manage MDI operations, and parameter No. 0001 Bit 1 (FCV) governs Series 15 legacy formatting.

The standard G-code programming syntax uses absolute coordinates for the scaling center (I, J, K) and the scaling factor multiplier (P) programmed in an independent block.

  • System Resolution Parameter: Presets the smallest programmable increment of the scaling factor (0.001 or 0.00001).
  • Parameter No. 0001 Bit 1 (FCV): Legacy Series 15 program format mode. If set to 1, canned roughing cycle formatting is modified.
  • Parameter No. 5008 Bit 4 (MCR): Prevents tool compensation and scaling operations in MDI mode when set to 1.
  • Parameter No. 5040 Bit 3 (TCT): Tool Change Type parameter; prohibited to change while offsets are active.
  • Alarm #41: Cutter Radius Compensation Interference due to path deviation or insufficient starting clearance.
  • Alarm PS5257: G41/G42 not allowed in MDI mode (triggers if scaling is attempted in MDI with MCR active).
  • Alarm PS0368: Offset remains at offset command (triggered when attempting to change TCT parameters while offsets are active).
  • Alarm PS0070: Coordinate system setting error (circular interpolation on a single scaled axis).
  • Version Differences: Older models support a smallest scaling increment of 0.001 (up to 999.999). Advanced controls support 0.00001 (up to 9.99999).

Warning: Avoid modifying Parameter No. 5040 Bit 3 (TCT) while workpiece offsets are actively applied, as this can cause coordinate calculation errors or throw Alarm PS0368.

Siemens

Activating coordinate scaling on Siemens controls relies on setting specific machine data registers to enable axial scaling factors and compiler compatibility. External language settings are defined in MD 18800 to process G-code cycles.

Siemens supports absolute and additive scaling through native frame commands SCALE and ASCALE. ISO Dialect mode switches the interpreter using G291 to parse G51 and G50.

  • MD 22914 $MC_AXES_SCALE_ENABLE: Activates axial scaling factor (I, J, K) in G51 blocks when set to 1.
  • MD 22910 $MC_WEIGHTING_FACTOR_FOR_SCALE: Defines the unit increment (0 for 0.001, 1 for 0.00001).
  • SD 43120 $SA_DEFAULT_SCALE_FACTOR_AXIS: Axis-specific default scaling factor when G51 is active but axial factor is omitted.
  • MD 18800 $MN_MM_EXTERN_LANGUAGE: Activates external NC language compiler to parse G50/G51 ISO codes.
  • MD 10760 $MN_G53_TOOLCORR: Defines whether tool length and tool radius compensations are suppressed during SUPA or G53 (values 2 to 4).
  • Alarm 61800: External CNC system missing (triggered if G291/G51 is programmed while MD 18800 is disabled).
  • Alarm 61815: G40 not active (triggered if cutter compensation is active before G51).
  • Alarm 14800: Programmed path velocity is less than or equal to zero (triggered if the scaled feedrate evaluates to zero).
  • Version Differences: G51.2 (Multi-edge turning) is supported exclusively on 840D sl and completely omitted on 802D sl. MD 10604 is locked on 802D sl.

Warning: Native SCALE is a substituting instruction. Programming SCALE in a block by itself deactivates scaling but also resets all other active frame transformations (such as TRANS or ROT) in the stack.

Mitsubishi

Managing scaling on Mitsubishi machining center controls requires setting parameter #8072 for background defaults and parameter #1003 to configure the coordinate input system unit resolution. The input metric/inch state is governed by parameter #1041.

Mitsubishi supports standard scaling with a common multiplier P and axis-specific scaling using addresses I, J, and K. Scaling cancel is executed via G50.

  • Parameter #8072 SCALING P: Default background scaling factor used if the scaling factor is omitted from the G51 block.
  • Parameter #1003 iunit: Active input setting unit defining resolution and command increment (B, C, D, or E).
  • Parameter #1041 I_inch: Configures input/output units to metric (0) or inch (1).
  • Program Error (P350): Scaling commanded when software option is not installed.
  • Program Error (P35): Commanded scaling factor is outside boundaries (between -0.000001 and 0.000001 excluding zero, or exceeds ±99.999999).
  • Program Error (P70): Circular interpolation attempted when only one axis of the plane is scaling-active.
  • Version Differences: Lathe systems disable scaling modal mappings, whereas milling systems fully support G50/G51. The M800V/M80V series supports sub-micron Unit E settings (±9999.999999 mm).

Warning: Executing a program reset, emergency stop, or program end (M02/M30) automatically forces the control back to scaling cancel mode. Resuming machining without re-calling G51 will execute coordinates at 1:1 scale, risking a crash.

Cross-Brand Comparison Table

TopicFanucSiemensMitsubishi
Syntax FormatAddress I, J, K define scaling center, P defines factor: G51 I_ J_ K_ P_High-level frame command SCALE X_ Y_ Z_ or legacy ISO dialect G51 X_ Y_ Z_ P_ / I_ J_ K_G51 X_ Y_ Z_ P_ (common factor) or G51 X_ Y_ Z_ I_ J_ K_ (axis-specific factor)
Reference Returns (G28/G30)Strictly forbidden; must cancel scaling with G50 firstResets active scaling components when zero suppression moves are executedTemporarily cancels scaling at the intermediate point, restores factor upon G29 return
Feedrate ScalingProgrammed feedrate F is not automatically scaled; division by scale factor is requiredTechnological parameters (F, S) remain unchanged during scalingFeedrate F is not scaled automatically
Scaling FactorsHandled as integer values (e.g. P999999) or decimals depending on parametersProgrammed directly as real decimalsProgrammed directly as decimals or integer steps after G51
Bilingual ModeNo toggling; single instruction compilerExplicit interpreter switch using G290 (native) and G291 (ISO Dialect)Dynamically maps G50/G51 modal tables via G188 (lathe) / G189 (milling) program format switch
Manual Interruption / Reverse TraceManual coordinate offset adjustment behaves standardlyResets active programmable scaling frame on program end/resetCoordinates and scaling modal states are recovered via G127 manual arbitrary reverse run

Technical Analysis: Brand Implementations

Analyzing the mechanical and compiler behavior across these CNC architectures reveals three distinct technical behaviors that separate Fanuc, Siemens, and Mitsubishi controls:

First, Siemens operates on a bilingual toggled compiler model (G290/G291). While Fanuc and Mitsubishi controls interpret coordinate scaling and cancellation within a single continuous G-code system, Siemens requires the programmer to explicitly switch the compiler to ISO Dialect mode via G291 to compile G50/G51 blocks. The program must then command G290 to switch back to native SINUMERIK mode to process high-level parametric Siemens frames (TRANS/ROT) and technologically advanced Siemens cycles.

Second, Siemens manages scaling as an independent, modular component of a dynamic frame memory structure (SCALE/ASCALE). In native mode, deactivating scaling via a naked SCALE command clears all other active components of the current programmable frame (such as TRANS or ROT) because Siemens treats programmable transformations as a single, unified mathematical matrix. Fanuc and Mitsubishi, by contrast, manage scaling through modal G-code groups (Group 11) that can be cancelled independently without affecting unrelated coordinate zero registers or rotation offsets.

Third, Fanuc enforces strict, rigid interlocks that prohibit machine zero returns (G28, G30) and coordinate system settings (G92) while scaling is active. Fanuc rules require these commands to be programmed strictly in scaling OFF (G50) mode to prevent severe rounding and coordinate errors. Mitsubishi, by contrast, dynamically integrates scaling modals with reference returns; commanding a reference return temporarily suppresses active scaling at the intermediate point, and automatically restores the scaling factor when a start position return (G29) is executed. Mitsubishi also integrates active scaling vectors with its manual arbitrary reverse run function (G127) using a modal information storage block.

CNC Programming Examples

Fanuc Example:

G90 G00 G54 X-1.0 Y-1.0 ;
G51 I2.0 J1.5 P0.5 ;
G01 X1.0 Y1.0 F100 ;
G50 ;

Before running production, perform a dry run of the Fanuc program. The operator executes a dry run with Z-axis offset elevated. When G51 is read, the coordinate center is set at X2.0 Y1.5. A subsequent move to X1.0 Y1.0 results in a scaled target position. G50 cancels scaling, reverting path calculation to 1:1 scale.

Siemens Example:

N10 G290 ;
N20 TRANS X15 Y15 ASCALE X0.7 Y0.7 ;
N30 SCALE ;
N40 G291 ;
N50 G51 X100.0 Y100.0 P500 ;
N60 G50 ;

Perform a dry run to verify the Siemens native mirroring transition. The compiler switches to native mode, shifts zero offset, and scales XY contours by 70%. The naked SCALE command resets the active frame components. Switching to ISO mode via G291 parses the G51 scaling command around center (100,100) with a 0.5 factor. G50 cancels the ISO scaling mode.

Mitsubishi Example:

G90 G00 G54 X-100.0 Y-100.0 ;
G51 X-100.0 Y-100.0 P0.5 ;
G01 X50.0 Y50.0 F200 ;
G50 ;

Conduct a dry run to verify the Mitsubishi mirroring states. Rapid movement positions the tool at the starting coordinate. G51 initializes scaling with the center at X-100.0 Y-100.0 using a scaling multiplier of 0.5. The axis coordinates are interpolated at half-scale. G50 cancels the scaling mode.

Error Analysis and Troubleshooting

BrandAlarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
FanucAlarm #41Programmed clearance is smaller than the tool nose radius close to scaling center.Cutter Radius Compensation Interference message.Establish starting clearance envelope larger than twice the tool nose radius.
FanucAlarm PS5257Tool radius compensation or scaling startup attempted in MDI mode with Parameter No. 5008 Bit 4 (MCR) set to 1.G41/G42 NOT ALLOWED IN MDI MODE alarm.Set Bit 4 of Parameter No. 5008 to 0 or avoid MDI execution.
FanucAlarm PS0368Attempting to adjust parameters (like TCT) while tool position offsets are actively applied.OFFSET REMAIN AT OFFSET COMMAND alarm.Cancel the offset before changing the parameter.
FanucAlarm PS0070Circular interpolation (G02/G03) commanded where scaling is active for only one of the two active plane axes.Coordinate system setting error message.Scale both plane axes or deactivate scaling before executing circular moves.
SiemensAlarm 61800External language commands (G291, G50, G51) programmed while MD 18800 is disabled.External CNC system missing message.Enable MD 18800 or set option bit 19800.
SiemensAlarm 61815Tool radius compensation (G40) not active before G51 scaling block.G40 not active message.Command G40 to deactivate compensation before initiating scaling.
SiemensAlarm 14800Movement executed during scaling but the programmed feedrate F evaluates to zero.Channel programmed path velocity is less than or equal to zero message.Program a non-zero feedrate.
MitsubishiProgram Error (P350)G51 commanded in a part program when scaling software option is not installed or enabled.Red error light, execution halts.Enable the scaling option.
MitsubishiProgram Error (P35)Commanded scaling factor is outside boundaries (between -0.000001 and 0.000001 excluding zero, or exceeds ±99.999999).Scaling factor command range error.Keep scaling factor command within allowed boundaries.
MitsubishiProgram Error (P70)Circular interpolation (G02/G03) commanded while scaling is valid for only one of the two axes defining the arc plane.Circular interpolation error.Both axes must be scaled, or cancel scaling before executing the arc.

Professional Application Note

A fractured carbide tool tip and a completely ruined scrap part are the direct consequences of failing to adjust technological parameters during coordinate scaling. On Fanuc systems, if a workpiece contour is scaled to double its original size, the physical machining distance doubles. Because the control's motion control kernel does not automatically adjust the programmed feedrate F, the axis will drive the tool tip at twice the intended velocity, throwing overload alarm codes. Operators must manually divide the feedrate by the scale factor to protect tool life. Similarly, under Siemens and Mitsubishi rules, executing a program reset or emergency stop automatically cancels the active coordinate scaling frame. Resuming the cycle without manually re-initializing the G51 or SCALE commands will force the machine to travel on a 1:1 path, driving the spindle or tool turret to crash directly into table-mounted clamps, workpiece fixture vise jaws, or the rotating spindle chuck.

Related Command Network

  • g50-scaling-cancel-milling: The direct modal cancellation G-code for G51 coordinate scaling, restoring unscaled motion calculations.
  • g40-compensation-cancel: Deactivates cutter compensation, which must be executed before calling G51 to avoid vector calculation errors.
  • g41-cutter-radius-compensation: Applies tool radius offset vectors, which are calculated based on the scaled geometry.
  • G290 / G291: Interpreter toggle keys used on Siemens controls to transition between native frames and ISO codes like G51.

Conclusion

Successful coordinate scaling requires strict synchronization between coordinate geometry, active tool offsets, and feedrate values. CNC operators must establish verification routines—checking that starting and cancellation clearance envelopes exceed twice the tool nose radius and verifying parameters such as Parameter No. 5008 Bit 4 (MCR) or MD 22914—before running scaled programs. Cancel scaling at the origin using G50 to prevent axis drift and protect workholding devices from mechanical collisions.

Frequently Asked Questions

Why does my CNC machine throw an alarm when I command G02 or G03 during scaling?

An alarm occurs—specifically Alarm PS0070 on Fanuc or Program Error P70 on Mitsubishi—because you have activated scaling on only one of the two coordinate axes that define the active interpolation plane. Circular interpolation requires both plane axes to be scaled at identical factors to maintain a perfect arc radius; scaling only one axis would distort the arc into an ellipse. Action: Modify the G51 block to include scaling center coordinates for both active axes (e.g., X and Y for G17 plane) or cancel scaling before commanding circular moves.

What happens to tool nose radius compensation (G41/G42) when coordinate scaling is active?

Tool radius and length compensation values are never mathematically scaled by G51 or SCALE commands. Instead, the CNC control applies the full, unscaled compensation offsets directly to the contour coordinates after the scaling calculation has been completed. Action: Always program G40 to deactivate active tool compensation before executing a G51 scaling block, and re-call G41/G42 only after scaling is established.

Why did my machine crash when resuming a program after an emergency stop?

An emergency stop, program reset, or program end (M02/M30) automatically forces the control back to scaling cancel mode (clearing active programmable frames or resetting Group 11 modals). Resuming the program from a block after the G51 command will run the toolpath at a full 1:1 scale instead of the reduced scale, shifting coordinate boundaries and driving the tool nose directly into workholding devices. Action: Always restart the program from the safety block that contains the G51/SCALE command to re-initialize coordinate transformations before movement begins.

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