Skip to content

G86, G87 and G88: the boring cycles that aren't G85

All three are boring canned cycles, and what sets them apart is what they do at the bottom of the hole: G86 stops the spindle and comes out in rapid; G87 is back boring, which goes in through the hole with the tool shifted off center and cuts pulling upward; and G88 stops the spindle, waits and lets the operator bring the tool out by hand before continuing. They are rarely used and very control-dependent, and the difference between them shows up mostly in the wall finish and in process safety.

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
Cycles
Machine
Milling, Mill-turn
Risk
Medium
Example
G86 X20 Y0 Z-25 R2 F80

Syntax by control

Fanuc (milling)
G99 G86 X40. Y30. Z-25. R3. F80
G86 goes down at feed, stops the spindle at the bottom and retracts in rapid with the tool stopped. Because the cutting edge is still touching the wall, it leaves a vertical line along the whole length of the hole.
Fanuc (milling), back boring
G87 X40. Y30. Z-5. R-30. Q2. F80
In G87 the spindle orients, the tool shifts by Q to pass through the hole, goes down to R, moves back into position, starts and cuts upward to Z. The orientation and the shift direction depend on the control and on the tool: read the manual before the first hole.
Haas (milling)
G99 G86 X40. Y30. Z-25. R3. F80 / G77 (back bore) / G87 and G88 (manual retract)
Watch out, Haas uses different numbers: back boring is G77, not G87. On Haas, G87 is bore with manual retract and G88 adds a dwell before that retract. A Fanuc program with G87 does not do the same thing on a Haas: check your model's manual.
Siemens 840D / 828D
CYCLE86(...) / CYCLE87(...) / CYCLE88(...)
The numbers match, but the cycles do not. CYCLE86 orients the spindle at the bottom, moves the cutting edge off the wall and retracts at rapid, so it leaves no mark: it is closer to Fanuc G76 than to G86. CYCLE87 stops the spindle at the bottom and waits for the operator, and CYCLE88 adds a dwell first. They are written from the cycle screen form.
Heidenhain TNC (Klartext)
CYCL DEF 202 BORING / CYCL DEF 204 BACK BORING
On Heidenhain, regular boring is cycle 202 and back boring is cycle 204, with their own parameters for the off-center distance and the spindle orientation angle.

Address letters used with it

LetterWhat it setsUnit
X YHole position. As in any canned cycle, following blocks that carry only coordinates repeat the cycle until G80.mm / in
ZFinal level. In G86 and G88 it is the bottom of the hole; in G87 it is the top level the tool cuts up to, which is above R.mm / in
RApproach plane. In G87 it differs from every other cycle: it is the lower level, below the part, from which the upward cut starts.mm / in
QSideways shift of the tool with the spindle oriented, G87 only. It is what lets the bar pass through a hole smaller than the diameter it is going to bore.mm / in, always positive
PDwell time at the bottom in the cycles that accept it. Same format as in G04: check whether your control counts it in milliseconds or in seconds.ms or s depending on the control
FBoring feedrate. Finish boring runs at low feeds and with the spindle at moderate rpm so it doesn't leave waviness.mm/min under G94

Worked example

Ø52 H7 bearing bore in a cast iron plate, already pre-bored to Ø51. It is finished with a single-point boring bar. The example shows G86 and why, for an H7 dimension, it is almost never what you want; after that it shows the usual alternative with an oriented stop and a shift, which is the fine boring cycle.

O0186 (MANDRINADO DE ALOJAMIENTO CON G86)
( 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. )
T9 M06
( Boring bar set to Ø52. )
G90 G54 G00 X40. Y30.
( Positions over the center of the bore. )
G43 H09 Z50. M03 S900
( T9 length offset and spindle on at moderate rpm, which is what a finish boring operation calls for. )
M08
( Coolant on. )
G99 G86 X40. Y30. Z-25. R3. F80
( The cycle: rapids down to Z3, bores at feed to Z-25, stops the spindle and rapids up to the R plane. Because the cutting edge is still resting on the wall as it comes up with the spindle stopped, it leaves a vertical line from top to bottom. )
G80 G00 Z50. M09
( Cancels the cycle and retracts. )
(PARA UNA COTA H7 LO CORRECTO ES EL CICLO DE MANDRINADO FINO, QUE ORIENTA EL HUSILLO Y APARTA EL FILO ANTES DE SUBIR)
( G86 is fine for holes where the line doesn't matter: bolt clearance, through holes, roughing. For a dimension with a bearing tolerance you use the cycle that shifts the cutting edge, and if the machine doesn't have it, you bring the tool out with the spindle turning. )
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 G86/G87/G88 in the workshop

Why G86 marks the wall and when it doesn't matter

At the bottom, G86 stops the spindle and retracts in rapid. With the spindle stopped, the cutting edge stays at a fixed spot on the circumference and rubs the wall all the way up, so it leaves a continuous vertical mark. In a through hole, in a bore that later takes a seal or in a preliminary roughing pass, that doesn't matter at all, and the cycle is fast and convenient. In an H7 bearing bore, on the other hand, that line is grounds for rejection, and the right cycle there is the one that orients the spindle and moves the cutting edge away before coming up.

G87: back boring, step by step

G87 is for machining a face on the underside of the part that you can't reach from the front. The cycle orients the spindle, shifts the tool by the amount Q so the bar passes through the existing hole, rapids down to R, which here is a level below the part, puts the tool back on the axis, starts the spindle and cuts upward to Z. Then it stops, shifts off again and comes out. It is the most delicate of all the canned cycles: the shift direction depends on the control and on how the cutting edge is mounted, and getting it wrong means breaking the bar inside the hole.

G88 and the cycle that asks the operator for help

G88 bores to the bottom, dwells for the programmed time, stops the spindle and leaves the machine in feed hold: the operator has to bring the tool out manually and then press cycle start for the cycle to continue. It is a relic from the days of boring with tools that had to be moved clear by hand, and you see very little of it today. The risk is obvious: it turns an automatic program into one that depends on someone doing the right thing mid-cycle, and in an unattended cell it blocks the machine. If you find it in an old program, it is almost always worth rewriting the operation.

Mistakes that cost you a part (or a tool)

  • Using G86 on a dimension with a bearing tolerance: the vertical line the cutting edge leaves on the way up with the spindle stopped makes the part fail inspection.
  • Programming G87 without checking in the manual which way the control shifts the tool with the spindle oriented: if it goes the other way, the bar hits the wall of the hole.
  • Writing the R of G87 as if it were an approach plane above the part: in this cycle R is the lower level from which you cut upward.
  • Leaving a G88 in a program that is going to run unattended: the machine sits stopped, waiting for someone to bring the tool out.
  • Forgetting that these cycles, like all canned cycles, stay active until G80: a later positioning move bores again.
  • Boring at milling rpm: a long boring bar at high revolutions goes into chatter and leaves waviness on the wall.
  • Assuming the cycle number means the same thing on Siemens or Heidenhain: there they are cycles with other parameters and you have to rebuild the operation.

Frequently asked questions

What is the difference between G85 and G86?

G85 comes up at feed with the spindle turning, so it skims the wall again and leaves a good finish. G86 stops the spindle at the bottom and rapids up with the cutting edge resting on the wall, which leaves a vertical line. For toleranced finishes you use G85 or the fine boring cycle, not G86.

What exactly is G87 back boring?

Machining a face on the underside of the part. The tool shifts with the spindle oriented so it can pass through the existing hole, goes down, moves back into position and cuts pulling upward. It is the cycle for making a counterbore on the bottom face without flipping the part.

Why does G88 leave the machine stopped?

Because that is how it was designed: at the bottom it dwells, stops the spindle and goes into feed hold so the operator can pull the tool out by hand. The cycle continues when cycle start is pressed. It was meant for old tooling and today it is practically never used.

What does the Q in G87 mean?

The sideways shift the tool makes with the spindle oriented, so the bar fits through the hole before it starts cutting. It is always written positive; the control decides the direction, and you have to check that in the machine manual.

Do these cycles exist on every machine?

G86 is almost always there; G87 and G88 depend heavily on the control and the installed option, and G87 also needs a spindle that can orient. Before using them, look at your machine's G-code list and try the cycle in the air.

Related codes

Other codes in Cycles

See the full list of G and M codes

Related apps