Skip to content

G05 and G05.1: high-speed machining and look-ahead

On Fanuc controls, G05 and G05.1 turn on the high-speed machining functions: block look-ahead, and advanced contour control, which distributes acceleration so the machine follows the path without braking at every corner. In practice they are used in CAM programs with thousands of very short moves, typical of 3D machining, where without them the machine runs far below the programmed feed. The important detail is that their availability, their format and the number of blocks the control reads ahead depend on the purchased option and the machine parameters.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
High speed
Machine
Milling, Mill-turn
Risk
Medium
Example
G05.1 Q1 / G05.1 Q0

Syntax by control

Fanuc (AI contour control)
G05.1 Q1 ... G05.1 Q0
Q1 turns advanced contour control on and Q0 turns it off. Some controls also accept an R from 1 to 10: R1 favors speed and R10 favors accuracy. The number of look-ahead blocks is a machine parameter, not part of the program.
Fanuc (high-precision contour control, HPCC)
G05 P10000 ... G05 P0
G05 with P turns on high-precision machining mode on the controls that have it. The P value identifies the mode and is not the same on every series: check in your control's manual which one applies to your machine.
Haas
G187 P1 E0.05
Haas does not use G05.1: the trade-off between speed and accuracy is set with G187, where P picks a level and E a corner rounding tolerance. The practical effect is the same as that of a contour control.
Siemens 840D / 828D
CYCLE832(tolerance, mode, orientation)
Siemens groups high-speed work in CYCLE832, the so-called High Speed Settings, which internally activates COMPCAD, SOFT, FIFOCTRL and the contour tolerance. It is called at the start of the operation and deactivated when it ends.
Heidenhain TNC
CYCL DEF 32 TOLERANCIA
Cycle 32 sets the allowable contour tolerance, and with it the control decides how much it can smooth to hold the speed. To reset it, define the cycle again and answer NO ENT to the tolerance prompt.

Address letters used with it

LetterWhat it setsUnit
QIn G05.1, turns advanced contour control on (Q1) or off (Q0). This is the way you most often find it in CAM programs.integer, no unit
PIn G05, identifies the high-speed mode being turned on. Its value depends on the control series; P0 usually turns it off.integer, no unit
ROn some controls, the quality level within contour control, from 1 to 10: R1 favors speed and R10 favors accuracy, with more slowdown at corners. Not every control accepts it: some ignore it and others alarm, so check the manual and run a test part.integer, no unit
Tolerance (equivalents)On Haas it is the E of G187, on Siemens the first parameter of CYCLE832 and on Heidenhain the T value of cycle 32. It is the deviation you accept from the theoretical path.mm / in

Worked example

Finishing a 3D surface in a steel mold, with the CAM program generated in very short moves. Without contour control, the machine brakes at every block and the actual feed stays far below the programmed one, and it also leaves marks at the changes of direction. The mode is turned on right before the operation and turned off when it ends, because you do not want it left on for the rest of the program.

O0404 (ACABADO 3D CON CONTROL DE CONTORNO)
( Program header. )
G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state. )
G91 G28 Z0.
( Z to the reference point before the change. )
T8 M06
( Finishing ball end mill. )
G90 G54 G00 X0. Y0.
( Positions over the part. )
G43 H08 Z50. M03 S9000
( T8 length offset and spindle at high speed. )
G00 Z5. M08
( Approach and coolant. )
G05.1 Q1
( Turns on advanced contour control. From here on the control reads blocks ahead and distributes acceleration so it does not brake at every move. )
G01 Z-0.1 F300
( Feeds down to depth at a low rate, with contour control already on. )
G01 X0.5 Y0. F3000
( First move of the finish pass. In normal mode, a feed of 3000 with moves of a few tenths would be out of reach. )
(MILES DE BLOQUES DE CAM)
( This is where the body of the finish pass generated by CAM goes, with very short moves and constant changes of direction. )
G01 X120. Y80. Z-0.1
( Last move on the surface. )
G05.1 Q0
( Turns contour control off. This matters: it adds nothing for the positioning moves and cycles that follow, and it can change the behavior at corners you do want exact. )
G00 Z50. M09
( Retract and coolant off. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 M30
( Back to absolute and end of program. )
Open the simulator to check the example

Practical keys to using G05/G05.1 in the workshop

What look-ahead really does

A control without look-ahead decides the speed block by block, and since it does not know what comes next it has to reach the end of each move in a condition to stop. With moves of tenths of a millimeter, that means accelerating and braking constantly and staying far below the programmed feed. Look-ahead reads tens or hundreds of blocks ahead, sees that the path keeps going in the same direction and distributes acceleration to get through it without braking. The payoff is not only cycle time but also finish, because the marks in 3D machining are usually abrupt speed changes.

Accuracy and speed are always a trade-off

Every contour control smooths the path within a tolerance, and that tolerance is yours to decide. Tighten it a lot and the machine goes back to behaving slowly; loosen it and it speeds up but rounds sharp corners and can leave the part out of spec. That is why you write an E on Haas, a value in CYCLE832 on Siemens and cycle 32 on Heidenhain. The sensible way to choose it is to start from the tolerance the CAM used to generate the program: if the CAM worked to a hundredth of a millimeter, asking the control for a micron is no use, because the error is already in the points.

When you do not want it on

Contour control is designed for long, continuous paths. In operations where the exact vertex matters, like 2D contouring with sharp corners or precision pocketing, smoothing is exactly the opposite of what you want, and that calls for exact stop or a very tight tolerance. It adds nothing in drilling and positioning moves either. That is why the mode is turned on right before the operation that needs it and turned off afterward, and not left in the program header as if it were a general machine setting.

Mistakes that cost you a part (or a tool)

  • Leaving the mode on for the whole program: the sharp corners of the contouring get rounded and the print dimensions are lost.
  • Asking for a tolerance much finer than the one the CAM used to generate the points: you lose speed and gain no real accuracy.
  • Copying a G05.1 Q1 from another control without checking that your machine has the option installed: if it does not, you get a code-not-available alarm.
  • Assuming G05 and G05.1 are interchangeable: they are different functions and the P value of G05 does not mean the same thing on every series.
  • Translating G05.1 to Haas by writing it as is: on Haas the equivalent setting is G187 with its P and E.
  • Blaming contour control for a poor finish that really comes from a CAM program with a large tolerance or badly distributed points.
  • Turning it on for drilling or positioning, where it adds nothing and only masks the machine's real behavior.

Frequently asked questions

What is the difference between G05.1 and G64?

G64 is continuous cutting mode, which simply does not require an exact stop at the end of each block. G05.1 goes much further: it reads blocks ahead and manages acceleration to hold the feed on long paths. G64 is a switch; contour control is an algorithm.

Does my machine have this function?

It depends on the purchased option. You can check it on the control's option screen or in the machine documentation. If it does not have it, the program will throw a code-not-available alarm when it reaches the block, so verify this before running a CAM program from someone else.

What tolerance should I use?

Start with the one you used in CAM to generate the path and adjust it based on the result. In roughing you can be generous; in mold finishing you tighten it. There is no point asking the control for more accuracy than the program's points have.

Does it work for turning?

The high-speed functions are mainly meant for milling with long CAM paths. On a lathe the typical problem is a different one, and what you adjust is usually the exact stop mode and the accelerations. Check your manual for what your lathe control accepts.

Do I have to turn it off at the end?

Yes, it is good practice. It goes on before the operation that needs it and comes off afterward with Q0, so that the corners of the next contours and the positioning moves behave as you expect.

Related codes

Other codes in High speed

See the full list of G and M codes

Related apps