CNC mill · G-code

G83: peck drilling cycle

G83 drills in pecks and retracts to the R plane after each one to clear chips: the deep-hole cycle. Haas lists it in modal group 09. Formats below from Haas, LinuxCNC, Mach4 and Fanuc, each from its maker.

Worked example

Two holes 1.5" deep, 0.25" pecks. Written for this page in the Haas format.

T1 M06 (tool 1)G00 G90 G54 X1. Y1. (first hole)S1200 M03G43 H01 Z0.1 M08G83 Z-1.5 R0.1 Q0.25 F10.X2.G80 G00 Z1. M09 (cancel the cycle)M30
The worked example’s toolpath, from the front (X, Z): feed moves solid, rapid moves dashed, from the start point.R planework surfacedepth Z-1.5rapidfeedstart pointXZ
The worked example’s toolpath. Drawn to the example’s own coordinates; the pecks spread sideways and their clearances drawn schematically.

From R0.1 to Z-1.5 at Q0.25 is 1.6 ÷ 0.25 = 6.4, so 7 pecks, the last one short.

How each control writes it

Haas G83 X- Y- Z- R- Q- F- (or I- J- K- in place of Q)

One source: Haas Automation, the control's maker

E
Chip-clean RPM: the spindle reverses to throw chips after each cycle (optional)
F
Feedrate
I
First peck depth (optional)
J
Amount each peck shrinks (optional)
K
Minimum peck (optional)
L
Number of holes (repeats) in G91 incremental mode (optional)
P
Dwell after the last peck, seconds (optional)
Q
Peck depth, always incremental (optional)
R
R plane: the Z position above the part the cycle feeds from (optional)
X
X location of the hole (optional)
Y
Y location of the hole (optional)
Z
Z position at the bottom of the hole
  • Don't give Q with I, J, K.
  • Setting 52 raises the chip-clearing retract above R, so R can sit close to the part.
  • Setting 22 sets how far above the last peck it rapids back down to.

Source: Haas Automation, mill G83 (archived Nov 5, 2024)

LinuxCNC G83 X- Y- Z- R- Q- L-

One source: the LinuxCNC project, the control's maker

X
Hole X location (optional)
Y
Hole Y location (optional)
Z
Final depth
R
Retract (R) plane along Z
Q
Peck increment along Z; must be positive
L
Repeat count, used in incremental mode (optional)
  • Every peck retracts to R, even under G98; the last retract follows G98/G99.
  • It rapids back down to 0.010 in (0.254 mm) above the last depth.

Source: LinuxCNC documentation, "G83 Peck Drilling Cycle" (archived Oct 29, 2026)

Mach4 G83 X- Y- Z- Q- R- L- F-

One source: Artsoft (Newfangled Solutions), the control's maker

X
Hole X position (optional)
Y
Hole Y position (optional)
Z
End point (bottom) of the hole
Q
Peck amount, always positive
R
Retract plane; the rapid plane under G99 (optional)
L
Number of repetitions (optional)
F
Feed rate
  • Retracts fully out of the hole after every peck, then rapids back down to just above the last depth: parameter 5115, default 0.010 in (0.25 mm).

Source: Mach4 Mill Programming Guide v1.1 (Artsoft), "G83 Peck Drilling" (archived Jul 1, 2024)

Fanuc G83 X_ Y_ Z_ R_ Q_ F_ K_ ;

One source: FANUC, the control's maker

X
Hole X position (optional)
Y
Hole Y position (optional)
Z
Bottom of the hole: a position in G90, the distance from the R point in G91
R
R point: a position in G90, the distance from the initial level in G91
Q
Depth of each peck: always incremental, and positive
F
Feedrate
K
Number of repeats, for equally spaced holes (give the first hole in G91) (optional)
  • FANUC 0i-MF (machining centre), from its operator’s manual. On another FANUC model, check that control’s manual.
  • After each peck it rapids back down to a clearance, set in parameter No. 5115, short of the last depth.
  • The small-hole peck drilling cycle uses the same code with I and P added (§5.1.7).
  • G98 returns to the initial level after the hole, G99 to the R point.
  • Start the spindle with an M code before the cycle.

Source: FANUC B-64604EN-2/01, Operator's Manual, 0i-MF (machining centre), §5.1.6

How the controls differ

  • Only Haas takes E, I, J, P.
  • A word two controls share can still mean different things: read each control's list above.

Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.