G84: Tapping Cycle

G84 taps a threaded hole in one line. The tool feeds in, the spindle reverses at the bottom, and the tap feeds back out at the same rate.

G84 is the canned cycle for tapping right-hand threads. In one line it rapids to the hole, rapids down to the R plane, feeds the tap into the hole, reverses the spindle at the bottom and feeds back out.

It uses the same words as the drilling cycles:

Word Meaning
X, Y Position of the hole
Z Depth of the thread
R The R plane, where feeding starts. Many programmers give the tap a little extra room here so the spindle is up to speed.
F Feed rate, which must match the thread pitch

Like the other cycles, G84 is modal: each following X or Y position taps another hole until G80 cancels it. G98 and G99 set the return height between holes.

Setting the feed rate

The tap has to advance exactly one thread pitch per spindle revolution, so the feed rate comes from the spindle speed and the pitch:

  • Metric, feed per minute (G94): F = RPM × pitch. An M6 × 1.0 tap at 500 RPM: F500 mm/min.
  • Inch, feed per minute: F = RPM ÷ threads per inch. A 1/4-20 tap at 400 RPM: F20 in/min.
  • Feed per revolution (G95): F is the pitch, such as F1.0 for M6 × 1.0.

Get it wrong and the tap either strips the thread or snaps.

Rigid and floating tapping

  • Rigid tapping synchronises Z with the spindle encoder, so the tap can be held in a rigid holder. On many Fanuc controls you turn it on with M29 S… before the G84 line. Haas machines with the rigid tapping option use it automatically.
  • Floating tapping is for machines without spindle sync. A tension-compression holder lets the tap float slightly so small errors in the feed don't break it.

LinuxCNC uses G33.1 for spindle-synchronised rigid tapping.

Spindle direction and G74

Start the spindle clockwise with M03 before a G84 cycle. The control reverses it at the bottom of the hole and restores it afterwards. For left-hand threads, use G74 with the spindle turning counter-clockwise (M04).

Example: four M6 holes

This program taps four M6 × 1.0 holes 12 mm deep at 500 RPM, so the feed rate is 500 mm/min. The tap starts feeding from R5, a little higher than a drill would.

(G84 tapping example: four M6 x 1.0 holes, 12 mm deep)
G21 G17 G90 G54
T3 M6 (M6 x 1.0 tap)
S500 M3
G0 X10 Y10 Z25
(Feed = RPM x pitch = 500 x 1.0 = 500 mm/min)
G99 G84 X10 Y10 Z-12 R5 F500
X40
Y40
G98 X10
G80
G0 Z25
M5
M30
Open this example in CutViewer

The last hole uses G98 to return to Z25 before the tap moves away.

  • S500 M3 starts the spindle clockwise, needed for a right-hand tap.
  • G99 G84 X10 Y10 Z-12 R5 F500 taps the first hole, returning to R5.
  • X40 and Y40 tap the next two holes. Only the changed position is needed.
  • G98 X10 taps the last hole and returns to the starting height of Z25.
  • G80 cancels the cycle.

How CutViewer shows G84

CutViewer draws each tapped hole as a rapid to the position, a rapid down to the R plane, a feed to depth and a retract to the G98 or G99 height. The retract is drawn as a feed move, because the machine feeds the tap back out with the spindle reversed, and the run time counts both directions at the feed rate. G74 left-hand tapping is drawn the same way.

Frequently Asked Questions

How do I calculate the feed rate for G84?

In feed per minute (G94), the feed rate is spindle speed times thread pitch. An M6 x 1.0 tap at 500 RPM needs F500 mm/min. A 1/4-20 tap at 400 RPM needs 400 ÷ 20 = 20 inches per minute. In feed per revolution (G95), the feed rate is simply the pitch.

What is the difference between G84 and G74?

G84 taps right-hand threads, with the spindle turning clockwise (M03) on the way in. G74 taps left-hand threads, with the spindle turning counter-clockwise on the way in. Both reverse the spindle at the bottom of the hole.

What is rigid tapping?

In rigid tapping, the control synchronises the Z feed with the spindle rotation, so the tap can be held in an ordinary rigid holder. Without rigid tapping, the tap needs a floating or tension-compression holder that can stretch and compress to absorb small mismatches between the feed and the spindle.

Can I use feed override during G84?

On most controls, no. Feed and spindle overrides are locked at 100% during a tapping cycle, because changing either one would break the thread or the tap.

Check your own program before you cut: open it in CutViewer to see the toolpath in 3D, the run time and any problems.

Open CutViewer