G-codeCanned CyclesModal group 9Mill

G76 & G85 to G89: Boring Cycles

G76 is the fine boring cycle: it feeds the bar to depth, stops the spindle at a fixed angle, moves the tool tip off the wall by the Q amount and rapids out, so the finished bore carries no retract mark. G85 to G89 are the other boring cycles, and what separates them is what happens at the bottom of the hole and on the way out: feed back out, stop the spindle and rapid out, dwell, or stop and wait for the operator. G87 is the back boring cycle on a Fanuc, for a bore or counterbore on the underside of the part. All of them stay modal until G80, like the drilling cycles, so every X or Y that follows bores another hole.

Syntax

G76 X__ Y__ Z__ R__ Q__ P__ F__ K__   Fine bore: feed in, orient, shift by Q, rapid out
G85 X__ Y__ Z__ R__ F__ K__           Feed in, feed out to R
G86 X__ Y__ Z__ R__ F__ K__           Feed in, spindle stop, rapid out
G87 X__ Y__ Z__ R__ Q__ P__ F__ K__   Back bore (Fanuc); on a Haas it is G77
G88 X__ Y__ Z__ R__ P__ F__ K__       Feed in, dwell, spindle stop, manual retract
G89 X__ Y__ Z__ R__ P__ F__ K__       Feed in, dwell, feed out
G80                                   Cancel the cycle

Parameters

AddressMeaningNotes
X YHole positionEach later block with an X or a Y bores another hole
ZBottom of the boreOn a back bore the end of the upward cut
RStart of the feedAbove the part, except on a back bore, where it sits below the part
QShift at the bottom, G76 and the back boreA distance, not a direction. Fanuc ignores the sign; the direction is a machine setting
I JShift in X or Y, Haas onlyUsed on G76 and G77 when the block has no Q
PDwell at the bottomG76, G88 and G89. On a Fanuc P1000 is one second
FBoring feedFeed per minute under G94. G85 and G89 come back out at the same F
KRepeat countL on a Haas, used with G91

The Q shift is a distance off the wall, not a peck. The bar moves away from the tool tip, so on G76 the shift has to be smaller than the gap between the bar and the far wall, and on a back bore large enough for the cutter to pass down the pre-bored hole.

Example

O0017 (2X 25MM BORE AND 2X 40H7 FINE BORE, 40MM S355 BLOCK)
(BOTH SIZES PRE-BORED THROUGH, 0.3MM ON THE DIAMETER LEFT)
G21 G17 G40 G49 G80 G90 G94      (safe start block, feed per minute)
T11 M06                          (25mm boring bar)
G54
S900 M03                         (spindle on before the cycle)
G00 X30. Y20.
G43 H11 Z25. M08
G99 G85 Z-42. R3. F90            (feed in and feed out, 2mm past the back face)
G98 X110.                        (second hole, back to Z25)
G80 G00 Z25. M09
M05
T12 M06                          (40mm fine boring head, insert set to the orient mark)
S700 M03                         (spindle on before G76)
G00 X30. Y60.
G43 H12 Z25. M08
G99 G76 Z-42. R3. Q0.2 P500 F56  (0.08mm/rev, orient at the bottom, shift 0.2mm, rapid out)
G98 X110. Q0.2                   (second bore, Q written again, back to Z25)
G80 G00 Z25. M09
M05
G49
G91 G28 Z0.                      (home Z)
M30

Controller differences

ControlBehaviour
FanucThe spindle has to be running before G76, and the cycle makes the oriented stop itself, so no M19 goes in the program. Q has to be positive, the sign is ignored, and parameter No. 5148 sets which way the tool shifts. Q is held as modal cycle data and is also the depth of cut for G73 and G83. Q and P are only stored from a block that bores, and a G00 to G03 on the G76 block is not allowed. In single block G88 stops at Z after the dwell. On a lathe the numbers mean other cycles: G85 face boring, G87 side drilling, G88 side tapping and G89 side boring, in all three G code systems.
HaasThe back bore is G77, not G87. Its R is negative and has to go past the bottom of the part, the tool shifts before it goes down the hole and shifts back before it comes out, and it takes the last spindle direction commanded: after an M05 it runs with the spindle stopped. Setting 27, G76/G77 Shift Dir., picks X+, X-, Y+ or Y-, and I or J replace Q when the block has no Q. On the classic control G87 is Bore In and Manual Retract and G88 adds a dwell: the tool is jogged out by hand and Cycle Start carries on. The current online manual lists five boring cycles, G76, G77, G85, G86 and G89, with no G87 or G88.
Siemens 840DNative programs use CYCLE85 to CYCLE89. CYCLE86 is the fine bore: POSS gives the orientation angle in degrees and RPA, RPO and RPAP give the lift-off as signed distances in the call, so the direction lives in the program, not in a machine setting. CYCLE85 takes separate feeds in and out (FFR and RFF). CYCLE87 and CYCLE88 stop with M5 and M0 at depth, and after NC Start the cycle retracts at rapid by itself, with no jogging. In ISO dialect mode G76, G85, G86, G87 and G89 have sections of their own, and the canned cycles run only in the G17 plane.
MazakEIA/ISO programs have G76, G85, G86, G87 back boring, G88 and G89. One-way positioning is switched off automatically for the shift in the fine boring and back boring cycles.
OkumaThe OSP-P200M manual covers G76 fine boring, G85 and G89 together, G86 and G87 back boring, with no section for G88, and the return level has its own code, G71.
GrblNo boring cycles. G76 and G85 to G89 are not on the v1.1 list, and a block carrying one stops the stream with error:20.
MarlinG85 to G89 are not in the G-code index, and G76 is a different command altogether: probe temperature calibration, on builds with probe temperature compensation.

What goes wrong

The shift goes the wrong way and drives the insert into the finished bore. The cycle orients the spindle and moves away from where the control thinks the tool tip is; if the boring head went into the holder 180 degrees out, it moves straight into the wall instead and scores a line up a 40H7 bore. Fanuc takes the direction from parameter No. 5148 and a Haas from Setting 27, so set the insert to the orient mark after every holder change.

A back bore posted for a Fanuc goes wrong on a Haas, where the back bore is G77. On a classic Haas G87 bores in and then waits to be jogged out, and the current list does not have it at all. G77 itself takes the last spindle direction, so after an M05 it runs with the spindle stopped and the bar is fed into the part.

Then Q. A Fanuc holds it as cycle data and the peck cycles use the same address, so a G76 written straight after a G83, with no G80 between and no Q of its own, shifts by the peck depth, and a 5mm (0.2in) peck is enough to put the bar into the opposite wall. Writing Q-0.2 to reverse the shift does nothing either: the sign is ignored.

Last, G86 on a finish bore. The spindle stops but the tool does not shift, so the rapid out drags the insert up the wall and leaves the line G76 exists to avoid.

Updated 14 Oct 2026