On a CNC machining centre, tapping means forming an internal thread inside a pre-drilled hole. During this operation the spindle rotation and the Z-axis feed must stay in step: for every spindle revolution the Z axis must move exactly one thread pitch. If this harmony is lost, the tap can be loaded in tension or compression, spoil the thread profile, jam in the hole or break.
As a continuation of the drilling cycles, this page covers the G84 cycle widely used for right-hand tapping on CNC mills, rigid tapping, the pitch–speed–feed relationship and the causes of tap breakage.
How Does Tapping Work?
- The tool moves to the hole centre.
- It descends to the R approach plane.
- The spindle turns in the appropriate direction.
- The tap enters the hole using a feed matched to the pitch.
- It reaches the programmed Z depth.
- The spindle direction is reversed.
- The tap follows the same pitch out of the hole.
- The tool reaches the return plane and moves to the next hole.
Synchronization between the spindle and the Z axis is critical in this operation.
What Is G84?
G84 is the right-hand tapping cycle on common FANUC-type CNC systems. General format:
G84 X... Y... Z... R... F...Example: G84 X20. Y20. Z-18. R3. F500.; — X20 Y20 is the hole centre, Z-18 the final Z level the tap reaches, R3 the approach plane where the tapping feed begins and F500 the programmed feed. The exact format can differ between controls.
What Is Rigid Tapping?
In rigid tapping the spindle rotation and the Z-axis feed are synchronized electronically by the CNC control. The control manages the spindle angular position, the spindle speed, the Z-axis motion and the reversal sequence together. Advantages: more accurate pitch, better thread quality, higher speeds, shorter cycle time, the ability to work with a solid (rigid) tap holder and better depth control.
The rigid tapping command
On some FANUC-type controls the rigid mode is called like this:
M29 S500
G84 Z-15 R2 F625Here M29 prepares the rigid synchronization, S500 is the spindle speed and G84 is the tapping cycle. However M29 is not the same on every CNC; some machines use a different M code, a special G code, a machine parameter or an automatic rigid mode. FANUC documentation states that no axis movement or new S command should be written between M29 and G84. Do not use M29 without confirming the machine’s programming manual.
Rigid holder vs tension-compression holder
A rigid holder holds the tool without axial float; the spindle–Z synchronization must be correct, and it is used on machines suited to rigid tapping. A tension-compression (floating) holder can extend and compress axially by a set amount, helping to absorb small synchronization differences, spindle deceleration effects and reversal delay. However, a floating holder does not fully correct an incorrect feed calculation.
How Is the Tapping Feed Calculated?
Feed (mm/min) = Speed (rev/min) × Pitch (mm/rev)
In short: F = S × PHere F is the feed per minute, S the spindle speed and P the thread pitch.
Worked examples
M8 × 1.25, S400: F = 400 × 1.25 = 500 mm/min. M10 × 1.5, S300: F = 300 × 1.5 = 450 mm/min. M6 × 1, S600: F = 600 × 1 = 600 mm/min — when the pitch is 1 mm, the speed and the mm/min feed look numerically identical.
Feed for inch threads
Inch threads are usually given in TPI (threads per inch). The metric pitch is 25.4 / TPI. For example, for 20 TPI the pitch is 25.4 / 20 = 1.27 mm. At S300, F = 300 × 1.27 = 381 mm/min, i.e. about F381 in metric programming.
Tapping with G94 and G95
G94 is feed per minute (mm/min); G95 is feed per revolution (mm/rev). Under G95 the F value equals the pitch directly; for M8 × 1.25 you can use G95 then G84 Z-18 R3 F1.25. But some machining centres require mm/min feed during G84; always check the active feed mode.
What happens if G94 and G95 are confused?
Suppose F500 is given for an M8 × 1.25 tap. Under G94 this is correctly read as 500 mm/min. Under G95 it becomes 500 mm/rev, a physically impossible value, or the control alarms. Conversely, writing F1.25 under G94 makes the tool try to move at just 1.25 mm/min. For this reason G94 should be recalled after the tapping cycle before any milling moves.
Basic Addresses in the G84 Cycle
| Address | Function |
|---|---|
| X / Y | Hole centre coordinates |
| Z | Final tap level |
| R | Approach and cycle-start plane |
| F | Tapping feed or pitch |
| S | Spindle speed |
| P | Dwell at the bottom on some controls |
| G98 / G99 | Return to initial plane / R plane |
| G80 | Cycle cancel |
Support for the P address and its unit can differ between controls.
Choosing the R Plane
If the part top is Z0, R3 can mean the tap begins the cycle 3 mm above the part surface. The R plane must be at a safe distance from burrs, curved surfaces, the hole mouth and clamping elements. Too high an R lengthens the cycle; too low an R can let the tap hit the part surface during rapid motion.
Using G98, G99 and G80
G98 returns the tool to the initial plane at the end of the cycle — safer when there are vices, clamps or stepped surfaces between holes. G99 returns the tool to the R plane, reducing cycle time for many holes on the same flat surface with no obstacles between them. When using G99, confirm that the R plane allows a safe pass over any vice, clamp or projection. After the tap group is finished, G80 must be written; otherwise the cycle can run again at the next X-Y positions.
Right-Hand and Left-Hand Tapping
Most standard metric taps are right-hand and use G84; the spindle usually turns in the M03 direction going in and the CNC reverses automatically coming out. For left-hand threads, some controls use G74 as the reverse tapping cycle. However G74 can mean different things on CNC lathes and mills; do not assume every control has a left-hand tapping cycle.
The Tap Drill (Pre-Drill)
The hole drilled before tapping must be the correct diameter. Too small, and the tapping torque rises, chips jam, the tap can break and the thread comes out too tight. Too large, and the thread height drops and the joint strength falls. An approximate rule for standard metric threads:
Tap drill ≈ Nominal diameter − Pitch
Example M8 × 1.25: 8 − 1.25 = 6.75 mm| Tap | Approx. tap drill |
|---|---|
| M4 × 0.7 | 3.3 mm |
| M5 × 0.8 | 4.2 mm |
| M6 × 1.0 | 5.0 mm |
| M8 × 1.25 | 6.8 mm |
| M10 × 1.5 | 8.5 mm |
| M12 × 1.75 | 10.2 mm |
These are general examples. The tool manufacturer’s recommendation should govern, based on material, thread engagement percentage, tap type and tolerance class.
Tap Depth in Blind and Through Holes
In a blind hole three different depths must be kept apart: the total drill depth, the usable full-thread depth and the programmed tap travel depth. The tip of the tap has lead threads that do not form a full thread, so if 15 mm of full thread is required, sending the tap only to Z-15 may not be enough. The bottom of a blind hole must also leave chip space, tap-tip clearance and a safe bottom distance.
Total hole depth =
Full-thread depth
+ Tap lead allowance
+ Chip space
+ Drill point cone
+ Safety allowanceIf the base thickness is insufficient, the blind hole bottom can be pierced. If the drawing lacks the detail, do not guess the depth.
Tap Types: Spiral Point, Spiral Flute and Form Tap
A spiral point (gun) tap pushes chips forward; it is preferred in through holes where chips can exit below. Used in a blind hole, chips can jam at the bottom. A spiral flute tap pulls chips upward; it is used in blind holes where chips must be brought out of the hole, with the flute direction and geometry chosen for the material. A form (roll) tap forms the thread by displacing material rather than cutting, so it produces no chips — no chip jamming in blind holes and high thread strength in some materials. However, its tap drill differs from a cutting tap, it needs higher torque, suits ductile materials and depends heavily on lubrication; a hole drilled for a cutting tap may not suit a form tap.
Cutting Fluid in Tapping
In tapping, lubrication is not only for cooling; it also reduces friction between the thread flanks and the tap. Insufficient lubrication raises torque, spoils the thread surface and can cause the tap to weld to the material and break. Depending on the material, use cutting oil, a suitable emulsion, through-tool coolant or a special tapping fluid.
What Happens if the Pitch Is Entered Wrongly?
Say an M8 × 1.25 tap runs at S400; the correct feed is F500. If F400 is entered by mistake, the Z axis feeds slower than the tap’s pitch; the tap starts to be pulled inside the holder, loaded axially, damages the thread surface and can break. A rigid tapping system may detect some mismatches as an alarm, but the correct feed calculation is still required.
Multi-Hole Tapping Program (Rigid)
Four M8 × 1.25 holes, S400 and F500:
%
O1800
G17 G21 G40 G49 G80 G90
(T1 - M8 TAP)
T01 M06
G54
G00 X20 Y20
G43 H01 Z50
M08
M29 S400
G98 G84 Z-18 R3 F500
X80 Y20
X80 Y50
X20 Y50
G80
G00 Z50
M09
M05
G53 G00 Z0
M30
%This example shows FANUC-type rigid tapping logic. The use of M29 must be confirmed for the specific machine.
M8 tap program with G95
%
O1810
G17 G21 G40 G49 G80 G90
T01 M06
G54
G00 X20 Y20
G43 H01 Z50
M08
G95
M29 S400
G98 G84 Z-18 R3 F1.25
X80 Y20
G80
G94
G00 Z50
M09
M05
M30
%G94 is recalled after the cycle so that a wrong feed mode does not carry over into later milling moves.
When Does the Spindle Reverse During the Cycle?
In a standard G84 cycle the control generally turns forward on entry, reaches the final Z level, slows and stops the spindle, reverses the direction and withdraws the tap in step with the pitch. The operator must not issue a manual M04 during the cycle; the reversal is managed by the cycle.
Is Dwell Used at the Bottom?
Some controls allow a short dwell in G84 with a P value (e.g. G84 Z-15 R3 P200 F500). But a dwell can cause the tap to rub at the bottom, raise torque and spoil the thread surface. Unless the control and tool manufacturer recommend it, avoid unnecessary dwell.
Main Causes of Tap Breakage
- Wrong tap drill diameter (too small → excessive load)
- Wrong feed (F not matched to speed and pitch)
- Wrong spindle direction
- Insufficient bottom clearance in a blind hole (tap hits the bottom)
- Chip jamming (wrong tap geometry or insufficient clearance)
- Insufficient lubrication
- A dull tap
- Tap-to-hole misalignment
- Wrong holder (rigid or floating system applied incorrectly)
- Tool runout
- Wrong Z depth
If the tap will not come out of the hole
Possible causes: the spindle did not reverse, rigid mode is not active, the tap is jammed with chips, the return synchronization is disturbed, the holder is mechanically stuck, the tap drill is too small or the tap has broken. The operator must not move the spindle or Z axis with random JOG; for a broken or stuck tool, follow the machine builder’s recovery procedure.
Feed Override, Cycle Stop and the Recovery Function
During rigid tapping the feed override and spindle override behaviour differs by control: some machines force overrides to 100%, some change spindle and feed proportionally together, some do not allow override. On the first part, do not rely on the override switch to fix a wrong speed or feed programmed in the code.
Using a sudden Feed Hold or Cycle Stop while the tap is in the part can be risky depending on the control; on some machines the tap can stay in the hole. Some machining centres have special Tapping Recovery / Rigid Tap Return / Tap Retract functions that drive the spindle and Z axis in reverse, synchronized, to help extract the tap. Each machine’s recovery method differs; forcing the tap out with normal JOG can break it. Before the operation, learn the emergency-stop procedure and the tap-retract method from the machine manual.
Pre-Tapping Checklist
Tool: are the tap diameter and pitch correct, is the right/left hand correct, does it suit a blind/through hole, are the cutting edges sound, is the holder suitable, is the tool length measured?
Hole: is the tap-drill diameter correct, is the hole deep enough, is there bottom clearance in a blind hole, is there a large burr at the mouth, is the hole axis correct?
Program: is G94/G95 correct, is the S speed correct, is F matched to the pitch, is the Z depth correct, is the R plane safe, is a rigid command needed, is there a G80 at the end of the cycle?
Machine: is there a rigid tapping feature, is the spindle encoder working, is cooling/lubrication sufficient, is the holder sound, is there an active alarm?
Tapping Feed Calculation Table
| Tap | Pitch | Speed | G94 feed |
|---|---|---|---|
| M4 × 0.7 | 0.70 mm | 600 rpm | 420 mm/min |
| M5 × 0.8 | 0.80 mm | 500 rpm | 400 mm/min |
| M6 × 1.0 | 1.00 mm | 500 rpm | 500 mm/min |
| M8 × 1.25 | 1.25 mm | 400 rpm | 500 mm/min |
| M10 × 1.5 | 1.50 mm | 300 rpm | 450 mm/min |
| M12 × 1.75 | 1.75 mm | 250 rpm | 437.5 mm/min |
The speeds in the table are calculation examples only. Real speeds must be chosen from tool and material data.
Full G84 Program Example
A training example for four M6 × 1 tapped holes:
%
O1820
G17 G21 G40 G49 G80 G90
G94
(T1 - M6 X 1 TAP)
T01 M06
G54
G00 X20 Y20
G43 H01 Z50
M08
M29 S500
G98 G84 Z-15 R3 F500
X70 Y20
X70 Y50
X20 Y50
G80
G00 Z50
M09
M05
G53 G00 Z0
M30
%M6 pitch is 1 mm, spindle 500 rpm, G94 feed 500 × 1 = 500 mm/min. After the first hole only the X-Y coordinates change, and the group is ended with G80.
Alarm Types in the G84 Cycle
Alarm numbers vary by control. Messages you may see: Rigid tapping not ready, Spindle synchronization error, Tapping cycle error, Improper G84 command, Spindle speed error, Feedrate command error, R plane error, Z level error, Spindle orientation error, Excessive spindle deviation, Canned cycle not cancelled. Possible causes: rigid mode not enabled, no spindle encoder feedback, wrong F–S relationship, faulty cycle format, unsuitable R and Z levels, spindle unable to reach the commanded speed, or the machine not supporting the G84 cycle.
Common G84 Mistakes
- Using a random F instead of the pitch (the tap cannot move in sync)
- Confusing G94 and G95 (F applied in the wrong unit)
- Drilling the tap drill too small (torque rises, tap can break)
- Miscalculating blind-hole depth (tap hits the bottom)
- Using a spiral-point tap in a blind hole (chips pile at the bottom)
- Using a solid holder without rigid mode
- Forgetting G80
- Using G99 on an obstructed part
- Not measuring the tool length
- Relying on override
Summary
This page covered the G84 tapping cycle, rigid tapping, spindle–Z synchronization, the pitch–speed–feed relationship, the G94/G95 difference, the R plane, G98/G99 use, the tap drill, the blind vs through hole difference, spiral-flute / spiral-point / form taps and the causes of tap breakage. Calculating the feed from the pitch is the foundation of a successful, safe tapping operation.
Mentor CNC Disclaimer and Safety Notice
This content is prepared for general CNC machining centre training. The G84 format, the rigid tapping command, G94/G95 use, spindle directions, the return motion and the recovery procedure differ between controls. In real work, the machine’s programming manual, the tap manufacturer’s cutting data and the workshop’s safety procedures take precedence.
Try it yourself: To run the G84 tapping cycle on a real part and read the generated G code line by line with explanations, use the CNC Milling CAM Simulator and G Code Generator.