G-codeMotionMill

G05: High-Speed Machining Mode

G05 switches a machining centre into its high-speed mode, where the control previews the blocks ahead of the one being cut so a program of thousands of short CAM moves runs at a steady feed instead of stuttering from block to block. On a current Fanuc the code is G05.1: G05.1 Q1 turns AI contour control on and G05.1 Q0 turns it off. G05 is not a standard code. A Haas lathe reads it as fine spindle control motion for live tooling, a Haas mill uses G187 for the same job, and Marlin reads G5 as a Bézier curve move.

Syntax

G05.1 Q1                 AI contour control on (Fanuc)
G05.1 Q1 R__             AI contour control on at machining condition level R (Fanuc option)
G05.1 Q3 X0 Y0 Z0        Nano smoothing on for the axes named (Fanuc option)
G05.1 Q0                 Mode off (Fanuc)
G187 P__ E__             Smoothness level and corner rounding (Haas mill)
CYCLE832(...)            High Speed Settings (Siemens native)

Parameters

AddressMeaningNotes
QG05.1 functionQ1 AI contour control, Q3 nano smoothing (or smart tolerance control where that option is fitted), Q0 off. G05.1 goes in a block of its own, with no other G code
RMachining condition levelWith Q1, on controls with the machining condition selecting function. Give G05.1 Q1 R__ before nano smoothing is switched on
X Y ZAxes to smoothWith Q3 only, written as 0. Up to three axes; they are smoothed, not moved
PHaas G187 smoothnessP1 rough, P2 medium, P3 finish. Without G187 the control uses Setting 191, medium from the factory
EHaas G187 corner roundingThe largest corner rounding allowed, overriding Setting 85 until G187 is cancelled

G05.1 carries more than one function, told apart by Q, which is why the Q word matters more than the G number. The 30i-B manual files AI contour control I and II under G05.1 in its high-speed cutting chapter and smooth interpolation under G05.1 again in its interpolation chapter.

Example

O0050 (FINISH A 3D FILLET, 6082 ALUMINIUM)
G21 G17 G40 G49 G80 G90          (safe start block)
T12 M06                          (8MM BALL NOSE)
G54
S12000 M03
G00 X-5. Y0.                     (clear of the part)
G43 H12 Z25. M08                 (length comp on before the mode)
G05.1 Q1                         (AI CONTOUR CONTROL ON, OWN BLOCK)
G01 Z0.5 F2400
X0. Z0.
X0.4 Z-0.004                     (CAM POINTS 0.4MM APART)
X0.8 Z-0.016
X1.2 Z-0.036
X1.6 Z-0.064
X2.0 Z-0.101
X2.4 Z-0.146
X2.8 Z-0.199
X3.2 Z-0.261
G00 Z25.
G05.1 Q0                         (MODE OFF BEFORE THE TOOL CHANGE)
M09
G49
G91 G28 Z0.                      (home Z)
G90
M05
M30

Controller differences

ControlBehaviour
FanucThe 0i-F machining centre list has no plain G05: high-speed contouring is G05.1, and G08 is accepted as the advanced preview control compatible command. The lathe list carries G08 as advanced preview control. Nano smoothing is switched off by a reset.
HaasThe mill does the job with G187: G187 P3 for finish smoothness, G187 E0.01 for the corner rounding limit, and G187 alone goes back to Setting 191 and drops the E value. Reset, M30, M02, the end of the program and E-stop all cancel it. On the lathe G05 is fine spindle control motion for live tooling, a different function altogether.
Siemens 840DNo G05. The native route is CYCLE832, High Speed Settings, for example CYCLE832(0.01,_TOP_SURFACE_SMOOTH_ON+_ORI_FINISH,1), where Top Surface works through look-ahead (G645) and the COMPSURF compressor. In ISO dialect mode the compressor is switched on from Siemens mode, G290, COMPON, G291, and it compresses only blocks holding G01, axis words, a feed, a block number or a comment.
MazakIn EIA/ISO, G05 is high-speed machining mode, a one-shot code in group 00 and an option with its own chapter. Corner and short-block accuracy is a separate code, G61.1 geometry compensation, modal in group 13.
GrblNo G5 of any kind. Motion modes stop at G0 to G3, the G38 probes and G80, so a G05 or G05.1 block stops the stream with error:20. Strip it in the post.
MarlinG5 is a cubic Bézier move in the XY plane, and only when the firmware is built with BEZIER_CURVE_SUPPORT. I and J offset the first control point from the start, P and Q offset the second from the end, and any axis other than X and Y is an error.

What goes wrong

A high-speed line posted for one control does something else on the next. The same G05 is fine spindle control motion on a Haas lathe and error:20 on Grbl, which halts the job mid-stream. On Marlin, G05 P10000 is a Bézier move whose second control point sits 10,000mm (394in) from the end point. A Haas mill wants G187 instead. Check the post against the machine, not the file name.

Second, the mode is left on. G05.1 Q1 stays active until G05.1 Q0, so a finish pass that never switches it off hands the mode to the drill that follows. Posts put Q0 before every tool change and before M30 for that reason. Haas runs the other way: Reset, M30 and E-stop all cancel G187, so a restart from the middle of the program after a reset skips the G187 block and runs the rest of the finish at the Setting 191 default.

Third, compensation changed inside the mode. With Fanuc nano smoothing on, a G43, G44 or G49 between on and off stops the program with PS0343, and a G41 or G42 cancels the smoothing outright. Apply length comp before the mode and cancel it after, as the example does.

Last, expecting the mode to rescue the program. Nano smoothing drops out on blocks shorter or longer than parameters 8486 and 8490 allow and at corners sharper than parameter 8487, and the Siemens compressor leaves any block holding an M code or another G code uncompressed. One M08 left on a line in a run of 3000 points is cut as a plain block in the middle of the run.

Updated 31 Oct 2026