Skip to content

M29: rigid tapping mode on Fanuc

M29 puts the control in rigid tapping mode: from that block on, spindle rotation and Z axis feed are synchronized so that the tap advances exactly one pitch per revolution, with no need for a floating tap holder. It goes right before the tapping cycle, normally a G84 on a mill, with the tapping S already given. It belongs to the Fanuc world and compatible controls; on other machines rigid tapping is turned on some other way or is simply the normal behavior, so the first thing is to know how yours does it.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Threading
Machine
Milling, Mill-turn
Risk
High
Example
M29 S800 / G84 Z-15 R2 F1.25

Syntax by control

Fanuc (milling)
M29 S500 / G84 Z-20. R5. F1.25
M29 goes in the block immediately before the cycle, or in the same block depending on the control. The cycle F is the pitch multiplied by the rpm if you are in G94, or simply the pitch if you work in G95.
Fanuc (left-hand rigid tapping)
M29 S500 / G74 Z-20. R5. F1.25
G74 is the left-hand tapping cycle, with the spindle turning the opposite way. The M29 preparation is the same.
Haas
G84 Z-20. R5. F1.25 (rigid by default on equipped machines)
On Haas machines with rigid tapping, the G84 cycle already runs synchronized and M29 is not needed. Some models accept it for compatibility without anything changing. Confirm it in your machine's manual before removing it from a program.
Siemens 840D / 828D
CYCLE84(...) for rigid / CYCLE840(...) for floating tap
Siemens separates the two cases into different cycles instead of using a preparation code. Translating an M29 plus G84 means choosing CYCLE84.
Heidenhain TNC
CYCL DEF 207 ROSCADO RIGIDO
Cycle 207 is rigid tapping and cycle 206 is tapping with a compensating holder. As on Siemens, the choice is made by cycle and not by a preceding code.

Address letters used with it

LetterWhat it setsUnit
STapping rpm. Written in the M29 block itself or right before it, and must not be changed afterward: the cycle calculates the synchronization with that value.rpm
F (in G94)Cycle feed in millimeters per minute, which comes from multiplying the thread pitch by the rpm. For M8 x 1.25 at 500 rpm that is 625 mm/min.mm/min
F (in G95)Feed in millimeters per revolution, which in tapping is exactly the thread pitch. Of the two, this is the form less prone to error.mm/rev
Z and RFinal thread depth and retract plane of the cycle. In a blind hole, Z has to leave room for the tap point and the thread runout.mm / in

Worked example

Four M8 x 1.25 threads, 20 mm deep, in a steel plate, with the Ø6.8 pilot hole already drilled. Tapping runs at 500 rpm with a machine tap in rigid mode, in G94, so the cycle feed is 1.25 x 500 = 625 mm/min. That feed calculation is where taps get broken.

O0407 (ROSCADO RIGIDO M8X1.25)
( Program header. )
G21 G17 G40 G49 G80 G94
( Millimeters, XY plane, a clean state and feed in millimeters per minute. )
G91 G28 Z0.
( Z to the reference point before the change. )
T6 M06
( M8 x 1.25 machine tap. )
G90 G54 G00 X20. Y20.
( Positions over the first hole, already drilled to Ø6.8. )
G43 H06 Z50.
( Tap length offset. In rigid tapping, a badly measured length is a broken tap. )
M08
( Coolant. )
M29 S500
( Prepares rigid tapping mode at 500 rpm. It does not start the spindle: the G84 cycle turns it, synchronized with the Z axis. )
G99 G84 Z-20. R5. F625
( Tapping cycle: bottom at 20 mm, retract plane 5 mm above the face and a feed of 625 mm/min, which is 1.25 mm pitch times 500 rpm. )
X60. Y20.
( Second thread. The cycle is modal: each new position taps another hole. )
X60. Y60.
( Third thread. )
X20. Y60.
( Fourth thread. )
G80 G00 Z50. M09
( Cancels the cycle and rigid mode with it, moves up and shuts off the coolant. Without G80, the next positioning move would tap again. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 M30
( Back to absolute and end of program. )
Open the simulator to check the example

Practical keys to using M29 in the workshop

Rigid or floating: what really changes

With a floating tap holder, the spindle and the Z axis are not perfectly in step and the compensator absorbs the difference by stretching or compressing. It works, but it limits speed, wears the compensator and leaves the first thread slightly bell-mouthed. In rigid tapping the control synchronizes the two motions with the spindle encoder, so you can go much faster, tap finer threads and repeat the depth. In exchange it is unforgiving: if the programmed feed does not match the pitch exactly, the tap takes the force and breaks in the hole.

The feed calculation is the line to check

Working in G94, the cycle feed is the pitch multiplied by the rpm, and this is where most mistakes happen: changing the S and forgetting to recalculate the F, copying a cycle from a different thread, or mixing metric pitches with threads per inch. The check takes ten seconds and saves broken taps: divide F by S and the result has to be exactly the pitch. If you work in G95 the problem goes away, because F is simply the pitch; that is why many programmers prefer to tap in feed per revolution.

Before rigid tapping: hole, length and clearance

Rigid tapping does not fix what is wrong beforehand. The pilot hole diameter has to suit the pitch and the thread percentage you are after, and in steel it is best not to go past seventy-five percent. The tool length has to be measured properly, because the cycle goes exactly to the Z you ask for. And in a blind hole you have to leave room below the last usable thread for the tap point and the chips, because a tap that bottoms out while turning breaks, no question.

Mistakes that cost you a part (or a tool)

  • Programming the feed without recalculating it after changing the rpm: F has to be exactly the pitch times S.
  • Writing M29 far from the cycle, with other blocks in between: the control expects to find the tapping cycle right after it.
  • Changing S between M29 and the cycle: the synchronization is calculated with the value in effect when it was turned on.
  • Tapping a blind hole all the way to the bottom with no room for the tap point and the chips.
  • Using the wrong pilot hole diameter: too little room and the tap is forced; too much and the thread does not hold.
  • Assuming M29 is needed on every machine: on many Haas machines G84 is already rigid and the code is redundant.
  • Forgetting G80 after the cycle: the next positioning move taps again where it should not.

Frequently asked questions

Is M29 required for tapping?

Only on Fanuc and compatible controls that use it to prepare rigid tapping. On many Haas machines G84 already runs synchronized and it is not needed, and on Siemens and Heidenhain you make the choice by picking one cycle or the other. Look it up in your machine's manual.

Where exactly does it go?

In the block immediately before the tapping cycle, together with S, or in the same block depending on the control. What you must not do is leave motion blocks or speed changes between M29 and the cycle.

How do I calculate the cycle feed?

Working in millimeters per minute, feed equals pitch times rpm: an M8 x 1.25 at 500 rpm is 625 mm/min. If you work in feed per revolution, F is simply the pitch, 1.25 in that example, and there is nothing to calculate.

Can I rigid tap with a floating tap holder?

You can mount one, but you lose the advantage: the compensator will keep absorbing motion and you gain no accuracy. For rigid tapping you use a rigid tap holder or one with minimal compensation, whichever the tap manufacturer recommends.

How do I get out of rigid mode?

By canceling the cycle with G80 or with a reset. M05 only stops the spindle: it does not take you out of rigid mode. In practice, the clean safety block of the next operation takes care of it; what matters is not leaving the cycle active as you move to another area of the part.

Related codes

G84G74G80G95G84.2/G84.3

Other codes in Threading

See the full list of G and M codes

Related apps