The G84 canned cycle is primarily used for tapping threads inside drilled holes. Unlike drilling cycles such as G81, G82, and G83, tapping requires precise synchronization between the spindle and feed with the thread pitch. Therefore, the G84 cycle automatically controls both spindle rotation and feed, so that the tap cuts correctly and, as a result, reduces the risk of tool breakage. In addition, this automation makes the tapping process faster and more reliable compared to manual programming.
G84 Syntax
G84 X_ Y_ Z_ R_ F_
-
X, Y → Hole location coordinates
-
Z → Final thread depth
-
R → Reference (retract) plane
-
F → Feedrate (must equal tap pitch × spindle speed)
Working Principle of G84
- The tool rapids to the R plane.
- The spindle rotates clockwise (M03), feeding the tap into the hole.
- Feedrate matches thread pitch × spindle RPM to maintain synchronization.
- At the bottom depth (Z), the spindle automatically reverses (M04).
- The tap retracts at the same feedrate to the R plane.
Some controls allow rigid tapping (synchronization between spindle encoder and feed), while others use a floating tap holder.

Example Program
N20 G90 G54 G00 X20 Y20 (Move to hole position)
N30 G43 H08 Z100. M03 (Tool length offset, spindle ON)
N100 G00 Z100. (Safe retract)
N110 M30
- Hole at X20 Y20
- Thread depth Z-15
- R2. → Retract plane 2 mm above surface
- S500 M03 → Spindle 500 RPM clockwise
- F1.25 → Feedrate = Tap pitch (M10 × 1.25 → pitch = 1.25 mm/rev) × 500 RPM = 625 mm/min feed
- At Z-30, spindle reverses (M04) and retracts
Important Notes
-
The feedrate must equal pitch × spindle RPM.
-
Use rigid tapping (if machine supports) for higher accuracy.
-
Always check if your control requires a special command (like G95 feed per revolution mode).
-
Ensure correct tap type: hand tap, spiral flute, or gun tap depending on blind or through holes.
Quick Checklist Before Running G84 Cycle
-
Select the correct tap size and type for material.
-
Verify feedrate matches tap pitch × RPM.
-
Confirm spindle reverse (M04) works at bottom depth.
-
Set a safe R plane to prevent crashing.
-
Use cutting fluid to reduce tap breakage.