Skip to main content
CNC.wiki

G05 High-Speed & High-Precision Contour Control: A G-Code Guide

Learn how to use G05 High-Speed Precision Contour Control on Fanuc, Siemens, and Mitsubishi CNC controls to prevent servo lag, axis alarms, and scrap parts.

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

CNC CARE Co-founder

Introduction

During high-feed contouring of complex surfaces, executing an unsupported interpolation path or experiencing look-ahead buffer starvation will force a sudden deceleration, causing the milling cutter to plow directly into the raw stock, breaking the tool and turning the workpiece into a scrap part. In more severe cases, if coordinate system offsets or tool length compensations are entered incorrectly during rapid transitions, the tool turret can travel off-trajectory at high speed, leading to a catastrophic hard collision with the vise jaw, workpiece chuck, or fixture clamp. To prevent these mechanical and structural failures, CNC controllers utilize advanced look-ahead algorithms—such as Fanuc AI Contour Control, Siemens CYCLE832/compressors, and Mitsubishi High-Speed Machining—which pre-process micro-segment trajectories and smooth velocity transitions before axis interpolation.

Technical Summary

FieldTechnical Specification
Command CodeG05, G05.1 (Fanuc, Mitsubishi), CYCLE832 / Compressor codes (Siemens)
Modal GroupGroup 00 (non-modal preparatory function in Fanuc/Mitsubishi), Group 30/10/59/etc. in Siemens
BrandsFanuc, Siemens, Mitsubishi
Critical ParametersParameter No. 5000 Bit 3 (Fanuc GNI), CYCLE832 _TOL / _TECH (Siemens), Parameter #8040 (Mitsubishi High-SpeedAcc)
Main ConstraintMust be programmed in an independent block on Fanuc and Mitsubishi; ON/OFF switches must be executed only when the tool is safely retracted from the workpiece to prevent dwell marks or speed drops.

Quick Read

  • Execute switches in clean air: G05 starts and cancels trigger a deceleration phase and must only be executed when the cutter is safely separated from the raw stock to avoid severe dwell marks.
  • Program independent blocks: Command G05 or G05.1 alone in a block on Fanuc and Mitsubishi controls, as any movement or auxiliary codes in the same block will trigger Program Error P33.
  • Deactivate coordinates first: Turn off rotary table dynamic fixture offsets (G54.2) on Fanuc systems before activating G05 to prevent Alarm PS0114.
  • Cancel compensation: Ensure active tool nose radius compensation (G41/G42) is cancelled (G40) before commanding G05.1 Q0 on Mitsubishi systems to avoid Program Error P29.
  • Verify ASUB files: Confirm that interrupt subprogram CYCLE3106.spf is present in Siemens SINUMERIK memory before using G10.6 rapid lift, otherwise Alarm 14011 halts execution during retraction.
  • Manage parameter promotion: Activate Parameter #8131 on Mitsubishi controls to automatically promote G05 P10000 commands to High-Speed High-Accuracy Control III without editing G-code.

Basic Concepts

High-speed contouring control enables CNC systems to process micro-segment G-code programs at extremely high feedrates without introducing axis vibration, servo-lag path errors, or feedrate drops at block intersections. By pre-reading toolpath segments in advance, the control calculates the optimal acceleration and deceleration profiles before interpolation. This look-ahead capability stabilizes velocity transitions and keeps the actual toolpath within the micron-level tolerance of the CAD/CAM model.

However, maintaining continuous-path speed requires strict management of active compensation modes. Under active cutter compensation, introducing non-movement blocks like a G04 dwell, spindle stops M05, or parameter changes G10 will exhaust the look-ahead parser. To maintain constant velocity across block boundaries, programmers must coordinate G-code activations when the tool is safe and separate dynamic offsets from geometry commands.

Command Structure

To configure high-speed precision contour control, the programmer must specify the command in a format recognized by the respective CNC control unit. For Fanuc and Mitsubishi, this involves non-modal preparatory functions that must be programmed in an independent block to prevent syntax faults. On Siemens SINUMERIK systems, high-speed machining is configured through technological cycles and compiler compression settings, separating technology parameters from geometry paths.

The activation and deactivation commands set the look-ahead buffer size, feedforward gains, and path smoothing levels. When these modes are active, the interpolation path is restricted to linear and circular commands. Advanced coordinates, multi-axis swiveling modes, and polar transformations must be coordinated outside these preparatory blocks to prevent control alarms.

Fanuc Syntax:

G05 P1; (AI contour control / High-speed cycle cutting ON)
G05.1 Q1; (AI contour control with smooth interpolation / Nano smoothing ON)
G05 P0; (Cancel AI contour control / High-speed cycle cutting)
G05.1 Q0; (Cancel AI contour control with smooth interpolation / Nano smoothing)

Siemens Syntax:

CYCLE832(_TOL, _TECH, _ORI_TOL); (Native SINUMERIK HSC configuration)
G291; G05 Pxxxxx Lxxx; (ISO Dialect Mode subroutine call)
COMPCAD G642 ADIS=...; (CAD-optimized compressor with continuous-path rounding)

Mitsubishi Syntax:

G05 P1; (High-Speed Machining Mode I ON)
G05.1 Q1; (High-Speed High-Accuracy Control I ON)
G05 P10000; (High-Speed High-Accuracy Control II ON)
G05 P20000; (High-Speed High-Accuracy Control III ON)
G05 P0; (Cancel High-Speed Machining and High-Accuracy Control modes)
BrandParameterDescriptionValue Range / Default
FanucParameter No. 3402 (Bit 6 - CLR)Determines default clear state of modal G-codes upon power-up, reset, or emergency stop.Binary (0 or 1)
FanucParameter No. 5000 (Bit 3 - GNI)Controls vector look-ahead behavior during cutter compensation cancellation.Binary (0 or 1)
FanucParameter No. 5040 (Bit 3 - TCT)Controls tool length compensation shift type; must be 1 to enable specific tool length shifts.Binary (0 or 1)
SiemensMD20734 ($MC_EXTERN_FUNCTION_MASK)Controls ISO Dialect scanner. Bit 3: 0 = alarms, 1 = bypass. Bit 2: 0 = seconds/ms, 1 = spindle revolutions.Bit-mask
SiemensSetting Data $SC_CONTPRECSpecifies maximum permissible contour violation when programmable contour precision (CPRECON) is active.Positive Real numbers (mm or inches)
SiemensCYCLE832 Tolerance (_TOL)Determines maximum allowable deviation from programmed contour.Real numbers (e.g., 0.100, 0.050, 0.010)
SiemensCYCLE832 Technology (_TECH)Selects technology G-group 59.0 (DYNNORM), 1 (DYNFINISH), 2 (DYNSEMIFIN), 3 (DYNROUGH)
SiemensMD10760 ($MN_G53_TOOLCORR)Suppresses active tool length and tool radius offsets during zero offset suppressions.Byte-based (2 to 4)
MitsubishiParameter #8040 High-SpeedAccActivates High-Speed Machining Mode II for a part system.Binary (0 or 1)
MitsubishiParameter #8131 High speed/accu 3Determines if G05 P10000 is automatically promoted to High-Speed High-Accuracy Control III.Binary (0 or 1)
MitsubishiParameter #1148 Initial hi-precisDictates default high-accuracy modal state upon power-on.0 to 4 (representing G08P0 to G05P20000)
MitsubishiParameter #8033 Fairing ONControls active fairing algorithm during high-precision processing.0 (Both off), 1 (Fairing ON), 2 (Smooth fairing ON)

Brand Applications

Fanuc

In Fanuc controls, the AI contour control (AICC) is enabled to run complex multi-axis milling profiles by checking ahead in the G-code program. This function is activated using parameters like Parameter No. 5000 (Bit 3) and Parameter No. 5040 (Bit 3) to configure compensation vector behavior and tool shift calculations.

To start high-speed cutting on a Fanuc system, command G05 P1 or G05.1 Q1 in an independent block, and cancel using G05 P0 or G05.1 Q0 as shown in the G-code examples below:

G05 P1; (Activates AI contour control / high-speed cycle cutting mode)
G05.1 Q1; (Activates AI contour control / smooth interpolation / Nano smoothing mode)
G05 P0; (Cancels AI contour control)
  • Critical Parameters: Parameter No. 5000 Bit 3 (GNI) controls vector look-ahead behavior during cutter compensation cancellation. Parameter No. 5040 Bit 3 (TCT) manages the tool length compensation shift type. Parameter No. 3402 Bit 6 (CLR) determines the clear state of modal G-codes.
  • Alarm Codes: Alarm PS0522 is triggered when an unsupported interpolation command (e.g. cylindrical or helical) is specified under active contour control. Alarm PS0114 is triggered when G05 is called while operating in G54.2 dynamic fixture offset mode.
  • Version Differences: On Series 30i/31i/32i-B Plus, the tool nose retraction during G40 cutter compensation cancellation with GNI set to 0 returns the tool nose to the previous block's normal position. On legacy Series 16i/18i/21i, this behavior differed, which can lead to overcutting if legacy programs are run without setting GNI to 1.

Warning: Specifying G43 tool length compensation inside an active G41/G42 cutter compensation block halts the look-ahead parser, causing the machine to decelerate to a complete stop and leaving a gouge mark on the part.

Siemens

On Siemens SINUMERIK controls, high-speed contouring is configured natively using Cycle 832 (CYCLE832) and G-group 30 compressor codes. This separates the technological tolerance parameters from the coordinate geometry, using machine data MD20734 to configure how the parser scans ISO dialect codes.

To enable native high-speed cycle settings, configure CYCLE832 with specific contour tolerances and dynamic technology groups, or call pre-compiled subprograms in ISO dialect mode:

CYCLE832(0.005, 1, 1); (Enables native CYCLE832 with a 0.005 mm contour tolerance and active finishing technological G-group 59 DYNFINISH)
COMPCAD G642 ADIS=0.015; (Enables CAD optimized surface compressor and continuous-path corner rounding with axial precision of 0.015 mm)
G291; G05 P10123 L2; (Switches to ISO Dialect mode and calls subroutine 10123.mpf twice)
  • Critical Parameters: CYCLE832 Tolerance (_TOL) determines the maximum allowable contour deviation. CYCLE832 Machining Type (_TECH) selects the technological dynamics group. Machine Data MD20734 controls the ISO scanner scanner-bypass and dwell options. MD10760 ($MN_G53_TOOLCORR) suppresses tool length and radius offsets during zero offset suppressions.
  • Alarm Codes: Alarm 12080 occurs in ISO mode when the scanner encounters an unmapped command while MD20734 Bit 3 is 0. Alarm 14800 is triggered if a movement block is executed with a zero feedrate (F0). Alarm 14011 is triggered when a retraction signal is received but CYCLE3106.spf is missing from the part program memory.
  • Version Differences: SINUMERIK 840D sl supports widescreen multi-touch panels with dedicated sidescreen windows for keyboard and machine control panels, whereas legacy Siemens panels lack these dedicated sidescreens. Additionally, block skip characters '/' and '/1' are treated as separate skip levels in SINUMERIK.

Warning: Continuous path rounding (G641/G642) with a large ADIS rounding distance or loose CYCLE832 contour tolerance can lead to excessive deviations from the mathematical CAD profile, producing a scrap part.

Mitsubishi

Mitsubishi controls feature a multi-tier high-accuracy system managed via Parameters #8040 and #8131. These parameters activate High-Speed Machining II and manage legacy code promotion, while Parameter #1148 dictates the initial high-accuracy state upon power-on.

To start high-speed machining or high-accuracy control on a Mitsubishi system, command G05 P1, G05.1 Q1, or G05 P10000 in an independent block, and cancel using G05 P0:

G05 P1; (Activates High-Speed Machining Mode I)
G05.1 Q1; (Activates High-Speed High-Accuracy Control I)
G05 P10000,R1; (Activates High-Speed High-Accuracy Control II with Smooth Fairing active via the R1 address modifier)
G05 P0; (Cancels High-Speed Machining and High-Accuracy Control)
  • Critical Parameters: Parameter #8040 High-SpeedAcc enables high-speed machining mode II for up to two part systems. Parameter #8131 controls the promotion of G05 P10000 to Type III. Parameter #1148 Initial hi-precis sets the default power-on state. Parameter #8033 Fairing ON controls active fairing and smooth fairing algorithms.
  • Alarm Codes: Program Error P129 occurs when G05 is called in a part system where Parameter #8040 is 0. Program Error P33 is triggered if G05 is not commanded in an independent block. Program Error P29 is triggered if G05.1 Q0 is executed while tool nose compensation G41/G42 is active. Program Error P560 occurs when switching fairing types without an intermediate G05 P0 cancel. MCP Alarm Y51 0032 is triggered if Parameter #8040 is enabled on three or more part systems. MCP Alarm Y51 0017 occurs when Parameter #1205 is configured to 2 on any system other than the first.
  • Version Differences: Premium M850V/M830V controls achieve micro-segment processing speeds of 168 kBPM in Mode II, whereas the M80 Type A is limited to 67.5 kBPM, and the M80 Type B lacks Mode II completely. Additionally, the M80V TypeB control triggers program errors when advanced options like G54.4 or G43.4 are combined with G05.

Warning: Programmers must avoid switching directly between fairing and smooth fairing modes; a G05 P0 cancel block must always be inserted between them to prevent halting the system with Program Error P560.

Brand Comparison

TopicFanucSiemensMitsubishi
Primary G-codeG05 / G05.1 to activate AI Contour Control / High-Speed Cycle Cutting.CYCLE832 / Compressor codes (COMPCAD) / continuous path rounding (G642). G05 is strictly a subroutine call in ISO mode.G05 / G05.1 to activate High-Speed Machining (I/II) or High-Accuracy Control (I/II/III).
Cutter Compensation Look-AheadHighly restrictive. G43 (tool length offset) in a block during active G41/G42 cutter comp prevents look-ahead, causing a complete stop and leaving contour gouge marks.Advanced look-ahead pre-read buffers dynamically resolve and synchronize compensation vectors without stopping axis velocity.Advanced look-ahead pre-read buffers dynamically resolve and synchronize compensation vectors without stopping axis velocity.
Parameter / Legacy TranslationUses Parameter No. 5000 Bit 3 (GNI) to toggle look-ahead vector math for legacy programs.Bilingual compiler switches between SINUMERIK (G290) and ISO Dialect (G291) seamlessly, running native or ISO blocks.Parameter #8131 automatically promotes legacy G05 P10000 commands to Type III without G-code modification.
Machining Dynamics SeparationParameters set globally or via preparatory codes.Dedicated technological G-group 59 (DYNROUGH, DYNSEMIFIN, DYNFINISH, DYNNORM) separates dynamics from geometry.On-the-fly technological parameter switching via Machining Condition Selection I (G120.1 / G121).
Smoothing CompensatorNano smoothing / smooth interpolation.Polynomial compression curves (COMPON, COMPCURV, COMPCAD).Fairing and Smooth Fairing trajectory compensators. Aborts with P560 error if switched without intermediate G05 P0.

Technical Analysis

The primary technical difference between Fanuc, Siemens, and Mitsubishi high-speed algorithms lies in their look-ahead parser restrictions and dynamic technologies. Fanuc imposes rigid syntax and motion limits under active AI contour control. Incorporating coordinate changes, dwells, or tool length compensation G43 blocks inside G41/G42 cutter compensation interrupts the Fanuc pre-read buffer, forcing the machine to stop axis velocity and leave tool marks. In contrast, Siemens SINUMERIK and Mitsubishi systems utilize advanced pre-read look-ahead buffers that dynamically calculate and synchronize compensation vectors, maintaining steady axis velocity through block transitions.

Furthermore, the integration of technology and geometry is handled differently. Siemens uses Technology G-group 59 (with commands DYNROUGH, DYNSEMIFIN, and DYNFINISH) to isolate acceleration and precontrol values from the geometry program. Mitsubishi achieves similar adaptability through Machining Condition Selection I (G120.1/G121), which recalibrates soft filters and forward gains on-the-fly. Fanuc relies on global parameters and binary bits that must be configured manually before starting the program. For legacy programs, Fanuc uses Parameter No. 5000 Bit 3 (GNI) to match older look-ahead vector math, whereas Mitsubishi features automatic command promotion via Parameter #8131, and Siemens relies on its bilingual mode switch (G290/G291) to transition between native and ISO compilers.

Program Examples

Fanuc Example:

G90 G54 G00 X0 Y0 Z50. T01 M06;
G43 H01 Z5.;
G05.1 Q1; (Activate AI contour control with smooth interpolation)
G01 X100. F5000.; (High-speed linear interpolation)
G02 X150. Y50. R50.; (High-speed circular interpolation)
G01 Y100.;
G05.1 Q0; (Deactivate AI contour control)
G00 Z50. M05;

dry run: For the Fanuc block above, during dry run execution with the spindle off, the operator should toggle the single-block execution switch and use manual feedrate override. Verify that the tool turret approaches the workpiece along the Z-axis, activates G05.1 Q1 safely in clean air before contacting raw stock, executes the high-speed linear and circular paths, and cancels the AI contour control (Q0) after retracting the tool to a safe height of Z5.0 mm above all workholding clamps.

Siemens Example:

T02 M06;
G54 G710;
M03 S12000;
CYCLE832(0.005, 1, 1); (Enables finishing DYNFINISH with 0.005 mm tolerance)
COMPCAD G642 ADIS=0.015; (CAD compressor and continuous-path rounding)
G01 X100. Y100. F12000;
G01 X200. Y150.;
COMPOF G60; (Deactivate compressor and continuous-path rounding)
M30;

dry run: For the Siemens CYCLE832 and COMPCAD block, execute the program in simulation or "dry run" mode on the controller. Verify on the widescreen display panel that the axes do not stop at block junctions, and monitor the axis dynamic responses. Confirm that continuous path rounding ADIS=0.015 does not cause path deviations near the vise jaws, and ensure CYCLE832 finishing settings are cancelled using COMPOF and G60 before returning the tool to the tool changer.

Mitsubishi Example:

G90 G54 G00 X0 Y0 Z100.;
G05 P10000; (Activate High-Speed High-Accuracy Control II)
G01 X50. Y50. F8000;
G01 X100. Y100. F10000;
G05 P0; (Deactivate High-Speed High-Accuracy Control)
G00 Z100. M05;

dry run: For the Mitsubishi G05 P10000 sequence, verify that Parameter #8040 is set to 1 in the part system prior to program launch. Run the NC program with dry run feedrates active. Confirm that the command G05 P10000 is written in an independent block and executed in clean air, the tool transitions smoothly through the G01 coordinates without axis vibration, and the high-accuracy mode is fully deactivated with G05 P0 after the tool is clear of the workpiece chuck.

Error Analysis

BrandAlarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
FanucAlarm PS0522Unsupported interpolation command (cylindrical, helical, or involute) is specified under active AI contouring.Axis motion halts immediately mid-cut, potentially breaking the tool and ruining the part.Program only standard linear (G01) or circular (G02/G03) moves while G05/G05.1 is active; cancel high-speed mode before executing advanced sweeps.
FanucAlarm PS0114G05 or G05.1 command issued while operating in rotary table dynamic fixture offset (G54.2) mode.System halts at the activation block before axis motion begins, preventing program execution.Deactivate the dynamic fixture offset (G54.2) before calling G05/G05.1.
SiemensAlarm 12080ISO scanner encounters an unmapped command in G291 mode while MD20734 Bit 3 is set to 0.CNC system stops reading the program and displays a syntax error message on the screen.Correct the G-code command formatting or set machine data MD20734 Bit 3 to 1 to bypass scanner errors.
SiemensAlarm 14011Retraction lift G10.6 is triggered by a digital input, but CYCLE3106.spf is not present in program memory.The machine halts with an alarm instead of lifting, dragging the cutter and scrapping the workpiece.Verify that CYCLE3106.spf exists and is loaded in the part program directory.
MitsubishiProgram Error P129High-speed machining or high-accuracy control command issued in a part system where Parameter #8040 is set to 0.Automatic cycle halts immediately at the activation block with a program error.Change Parameter #8040 to 1 on the active part system (limited to a maximum of two part systems).
MitsubishiProgram Error P33Movement command programmed in the same block as G05, or G05 block lacks a P address modifier.The controller flags a formatting error and refuses to execute the program block.Program G05 in an independent block and ensure the P address is specified without a decimal point.
MitsubishiProgram Error P560Direct switch between fairing and smooth fairing modes without an intermediate G05 P0 cancel command.Tool stops mid-cycle with a program error, leaving a dwell mark and risking part scrap.Insert a G05 P0 block between different fairing mode changes.

Application Note

Gouge marks on the workpiece contour occur when a tool length compensation command G43 is programmed during active cutter compensation (G41/G42), causing look-ahead parsing to halt and forcing the machine axes to decelerate to a complete stop. To eliminate these marks and prevent tool breakage, programmers must sequence tool offsets outside active compensation zones. When executing high-speed milling, operators must configure Parameter No. 5000 Bit 3 (GNI) to 1 on modern Fanuc Series 30i controls if they are running legacy programs, ensuring vector look-ahead calculations do not cause overcutting. On Mitsubishi setups, ensuring C-axis clamp M-codes are fully cancelled before deactivating high-accuracy mode prevents Program Error P29 from stopping the machine mid-cut and scrapping the workpiece.

Related Command Network

  • G00 Rapid Traverse Positioning: Position axes at rapid speed before activating G05/CYCLE832 to ensure high-speed contouring begins only at a safe start height.
  • G01 Linear Interpolation: G01 represents the primary motion command used under active G05 contour control to interpolate micro-segment toolpaths smoothly.
  • G08 (Advanced Preview Control): G08 acts as an alternative advanced preview control mode on Fanuc and Mitsubishi systems, precursor to full AI contour control.
  • G290/G291 (Bilingual Mode Switch): G290 and G291 allow Siemens controllers to switch between native SINUMERIK and ISO Dialect modes, dictating whether G05 is treated as a subroutine call or high-speed cycle.

Conclusion

Achieving high-speed accuracy across complex contours requires aligning G-code syntax with the look-ahead capabilities of the specific machine controller. Programmers should isolate G05 and CYCLE832 commands in independent blocks, verify parameter configurations such as Parameter No. 5000 Bit 3 on Fanuc or Parameter #8040 on Mitsubishi, and perform dry runs before full production to protect tools and workholding fixtures from hard collisions.

FAQ

How do look-ahead buffers prevent path deviations at high feedrates?

Look-ahead buffers scan ahead in the NC program to calculate axis deceleration limits based on the curvature of upcoming blocks. This pre-calculation prevents the servo motors from lagging behind the commanded coordinates, which would otherwise result in corner rounding or dimensional errors. Operators should configure the contour tolerance parameter (_TOL in CYCLE832 or Parameter #8033 on Mitsubishi) to match the required surface finish, ensuring the control has sufficient time to calculate deceleration curves.

Why does programming G43 inside G41/G42 cause a dwell mark on the workpiece?

Programming a tool length offset G43 during active cutter compensation G41/G42 disrupts the vector processing of the look-ahead parser, forcing the machine to stop axis movement at the block boundary. This brief pause causes the tool to dwell in contact with the material, leaving visible gouge marks and increasing tool wear. Programmers must activate all tool length offsets (G43) and cutter radius compensation (G41/G42) in separate setup blocks prior to commencing contour profiling.

What is the difference between G05 in Fanuc and Siemens ISO Dialect mode?

On Fanuc systems, G05 P1 or G05.1 Q1 directly activates AI contour control to optimize acceleration and look-ahead functions for high-speed machining. In Siemens ISO Dialect mode (G291), G291; G05 Pxxxxx Lxxx is compiled strictly as a subroutine call to run pre-compiled subprograms from memory without switching compiler modes. To run high-precision contour control on Siemens systems, programmers should instead switch to native Siemens mode (G290) and call CYCLE832 with the appropriate technological group.

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