This page was translated from Japanese by machine translation. The Japanese page is the original.

How to Use Rigid Tapping

A tap in a threaded hole, with arrows for forward and reverse rotation

2026-11-05. I investigated and decided on how to use rigid tapping on this machine (7I76EU, spindle is A6-RS with a 2:1 ratio, and Z is a closed-loop stepper). I read the official documentation and forums. I also used Gemini searches as clues. I only used answers from Gemini that were verified against original sources. [Source] means official documentation or product literature. [Forum] means user reports. [Calculation] means an estimate based on assumptions.

Conclusions

1. Rigid Tapping in LinuxCNC (G33.1)

The syntax is G33.1 Z- K- I- $-. [Source]

WordMeaning
ZCommanded depth. Move XY to the hole position on the preceding line. Write only Z in G33.1. Writing XY results in coordinated diagonal motion.
KFeed per revolution. For metric threads, this is the pitch (K1.5 for M10). Do not write F.
ISpindle speed multiplier on retract (optional).
$Spindle number (optional).

Sequence of motion (from the official documentation). [Source]

  1. Waits for spindle index, then feeds down to the commanded depth synchronized with spindle rotation.
  2. Commands spindle reversal at the commanded depth (increases speed if I is specified).
  3. Until the spindle actually stops and reverses, it continues past the commanded depth while remaining synchronized.
  4. Retracts to the starting height synchronized with the spindle, then commands reversal again.
  5. Overshoots slightly upward until the spindle stops and reverses.
  6. Disengages synchronization and returns to the starting height.

2. Signal Connections

Signal Connections

HAL example. The numbers assume stepgen 00 to 03 are used for two X motors, Y, and Z, and 04 is used for the spindle. Numerical values will be determined during commissioning.

# Spindle: velocity-mode stepgen
setp hm2_7i76e.0.stepgen.04.control-type 1
setp hm2_7i76e.0.stepgen.04.position-scale [SPINDLE_0]STEP_SCALE   # pulses per spindle rev
setp hm2_7i76e.0.stepgen.04.maxaccel 50                            # spindle rev/s². Reversal speed
net spindle-vel-cmd  spindle.0.speed-out-rps => hm2_7i76e.0.stepgen.04.velocity-cmd
net spindle-on       spindle.0.on            => hm2_7i76e.0.stepgen.04.enable

# Spindle position: A/B from servo, index from spindle sensor
setp hm2_7i76e.0.encoder.00.scale [SPINDLE_0]ENCODER_SCALE         # counts per spindle rev
net spindle-revs     hm2_7i76e.0.encoder.00.position    => spindle.0.revs
net spindle-vel-fb   hm2_7i76e.0.encoder.00.velocity    => spindle.0.speed-in
net spindle-index    hm2_7i76e.0.encoder.00.index-enable <=> spindle.0.index-enable

# At-speed: compare commanded and encoder speeds (without using a dedicated terminal)
loadrt near
addf near.0 servo-thread
net spindle-vel-cmd  => near.0.in1
net spindle-vel-fb   => near.0.in2
setp near.0.scale 1.05
setp near.0.difference 0.2
net spindle-at-speed near.0.out => spindle.0.at-speed

3. Overshoot at the Bottom of the Hole

G33.1 Motion

The Z axis continues down by the amount the spindle rotates between commanding reversal and coming to a complete stop. [Calculated from source behavior]

Overshoot = Pitch × Spindle speed / 60 × Deceleration time / 2

At the same cutting speed, a larger tap runs at a lower spindle speed but has a larger pitch, so overshoot is almost identical regardless of the tap diameter.

ThreadPilot hole5 m/min10 m/minZ speed (10 m/min)Overshoot (0.1 s to stop)Same (0.2 s)Z acceleration (0.1 s)
M3×0.5φ2.5530 rpm1060 rpm530 mm/min0.440.8888 mm/s²
M4×0.7φ3.34008005600.460.9393
M5×0.8φ4.23206405100.420.8585
M6×1φ5.02655305300.440.8888
M8×1.25φ6.82004005000.410.8383
M10×1.5φ8.51603204800.400.8080
M12×1.75φ10.21332654600.390.7777

4. Sources of Synchronization Error

SourceExpected magnitudeDecision
How the spindle stops (overshoot)0.4–0.8 mmSince Z moves following the spindle, this does not cause thread pitch errors. It only adds depth.
Belt stretch and key playKey play of 0.05 mm (at the outer circumference of a φ19 shaft, assumed) is about 0.3°. About 0.001 mm in the M10 axial direction.A/B monitors the motor. However, because of the 2:1 reduction, the axial error is small. [Calculation] In forums, there was also the opinion that "belt play breaks taps." However, we decided that does not apply with this machine's ratio. The key is secured with a setscrew (Spindle Pulley Strength Calculation).
Z lag (closed-loop stepping)UnverifiedOur biggest concern. During reversal, if Z lags behind the spindle, it pushes or pulls on the tap. We will check joint.N.f-error with halscope. We absorb this with the slight float in the holder.
Index positionDoes not affect a single round tripFor pecking or re-entering the same hole, the spindle's 1 pulse per revolution becomes a source of misalignment. Mount the sensor so its position does not shift.

Practical example: There is a report of running G33.1 with a 7I92H and an AC servo (step/direction) spindle. In this example, a Z following error occurred at I3, but did not occur at I1.5. [Forum] There is also a report of routinely tapping M3–M6 with a 7I76 and a ±10 V servo spindle (1:1.8, A/B on the servo, index on the spindle) (AC Servo as Spindle). For the control setup, see Control and Electrical Configuration.

5. Taps and Holders

Holders (Decision)

MethodAxial complianceDecision for this machine
Holding round shank with ER colletNone. Slips in rotation directionWe do not use this. If the tap slips when reversing, depth and phase get out of sync.
ER tap collet driven by squareNoneRunner-up. Inexpensive (expected to be in the thousand-yen range each for overseas products, unverified). Can be used with our existing BT30-ER32 holders. Any sync error is transferred directly to the tap.
Synchro holder (with micro-float)Approx. 0.2–0.5 mmWe chose this. Absorbs Z-axis lag and reduces axial load on the tap. Runout is small, too. BT30 models can be purchased from MISUMI for approx. ¥27,000–35,000 (tax excluded, search excerpt). Requires separate collets matching each tap size.
Tension-compression floating holder (GT12, etc.)Several mmBackup insurance. Lets you tap with G84 even while synchronization is not working properly. Thread accuracy drops, and runout also becomes larger.

Taps and Conditions

Torque

Differences in tap torque estimates

ThreadRule-of-thumb formulaCalculated back from Yamawa, SS400, etc.Same, S45C, etc.Spindle (rated 6.36, torque limit approx. 12)
M61.41.5 to 2.52.3 to 4.0Within rated range
M83.03.1 to 5.34.8 to 8.4SS400 is within rated range. S45C exceeds rated, but within limit
M105.35.6 to 9.68.6 to 15.2SS400 is within limit (margin is small). S45C may exceed limit
M128.79.2 to 15.614.1 to 24.8Exceeds limit. We use a thread mill

Units are N·m. The torque limit is the value determined from the belt force (Control and Electrical Configuration). If it hits the limit, the servo lags and Z follows the spindle, so the thread is expected to stop without stripping (estimated).

Why the torque estimates differ

EstimateValue for M10DetailsReliability
Rule-of-thumb formula (Cutting Force Calculations)5.3T = P² × D × kc / 8000, kc 1900 (drilling guideline for SS400)Source of the formula is unverified
Calculated back from Yamawa's roll tap formulaSS400 etc. 5.6 to 9.6, S45C etc. 8.6 to 15.2Roll tap T = Kf × D × P² / 1000 (female thread length 1.5D, 75% thread engagement). Stated that "roll tap torque is 2 to 3 times that of cutting taps", so divided by 2 and 3[Original source] However, the back-calculation is my own conversion
Yamawa's measured bar graphHT 1500, SP approx. 900, PO approx. 750M10, Ck60 (equivalent to S60C), 10 m/min, non-water-soluble oil, 20 mm through hole, φ8.5 pilot hole, piezoelectric dynamometer[Original source] No units written on the axis. Reading it as N·cm gives SP approx. 9, PO approx. 7.5 N·m (estimated)
Gemini's 1st attempt10 to 15Claimed as "OSG's S45C torque chart"Cannot find the original source
Gemini's 2nd attempt7.52Claimed as "OSG A-SFT, S45C, 20 m/min"The provided source image was unrelated, and Yamawa's page number was also incorrect. Do not use

6. Writing the G-code

G21 G90 G17 G40 G80
G0 X50 Y30                  (To hole position. Do not write XY in G33.1)
G0 Z3                       (Start height. Allow margin for spindle acceleration and synchronization)
S160 M3                     (M10, 5 m/min)
G33.1 Z-15 K1.5             (M10×1.5. For blind holes, goes 0.4 to 0.8 deeper)
G0 Z10
M5

Pecking (repeating G33.1 with increasing depth in the same hole). G33.1 returns to the start height each time, and the position aligns via the index.

o<peck_tap> sub
  (#1 final depth  #2 pitch  #3 depth per peck  #4 start height)
  #<z> = #4
  G0 Z#4
  o100 while [#<z> GT #1]
    #<z> = [#<z> - #3]
    o101 if [#<z> LT #1]
      #<z> = #1
    o101 endif
    G33.1 Z#<z> K#2
  o100 endwhile
o<peck_tap> endsub

7. Thread Milling (A Method That Doesn't Need Synchronization)

Added 2026-11-05. Since our policy is to use thread milling for M12 and above and for M10 in S45C, we checked whether this machine can cut properly.

Thread mill path

Why synchronization isn't needed

What takes effect instead

SourceEffect on the threadExpectation on this machine
XY circular errors (play, reversal lag)Twice the radius error becomes the pitch diameter errorIf the play in the guides and screws is 0.010 mm (Machining Methods for Accurate Holes), the pitch diameter error is around 0.02 mm. This is small compared to the 0.18 mm tolerance for an M10×1.5 6H pitch diameter (9.026 to 9.206 mm, ISO values; source unread). [Calculation]
Tool deflectionThe thread becomes undersized. It gets narrower toward the bottom (tool tip)Cut in two passes, then trace once more at the same diameter (spring pass).
Tool runoutThe thread becomes oversizedMinimize holder runout. Start with the ER collets on hand and measure the runout.
Z lead screw pitch errorPitch errorExpected to be under 0.01 mm for a thread length of 15 to 20 mm (estimated; grade of the Z ballscrew is unverified).
Small circular motionIf the circularity is poor, the pitch diameter will varyWhen cutting an M10 thread with a φ8 tool, the tool center only moves along a circle with a radius of 1 mm (Fig. 4). The machine play shows up directly. Check this with a test hole.

Spindle Speed and Feed Rate

The table for the OSG AT-2 (thread mill) lists 115 to 180 SFM (approx. 35 to 55 m/min) for low-carbon steel (up to C 0.25%), 260 to 525 SFM (approx. 79 to 160 m/min) for medium-carbon steel (C 0.25 to 0.45%), and a feed per tooth of 0.0004 to 0.0028 in (approx. 0.01 to 0.07 mm). It assumes an air blow and notes that cutting conditions should be adjusted based on machine and clamping rigidity. [Source] The AT-2 is a left-hand cutting tool (rotated with M4). Therefore, use these figures as a guideline and redetermine them based on the catalog data for the specific tool you purchase.

ThreadTool diameter (example)Spindle speed at 35 m/minSpindle speed at 79 m/minCutting speed at 3000 rpmDecision
M6×1φ4.72370 rpm5350 rpm44 m/minAchievable for SS400. Not achievable for S45C
M8×1.25φ61860419057Same as above
M10×1.5φ81390314075Achievable for SS400. Slightly falls short for S45C
M12×1.75φ9.51170265090Achievable for both
M16×2φ129302100113Achievable for both

G-code

Subroutine for a single-point thread mill (a tool that cuts one pitch per revolution). It spirals upward using G3 (climb milling when cutting a right-hand thread with an M3 right-hand cutting tool). This matches the motion shown in Fig. 4.

o<thread_mill> sub
  (#1 X  #2 Y  #3 Thread major diameter  #4 Pitch  #5 Tool diameter)
  (#6 Thread bottom Z  #7 Thread top Z  #8 Diameter offset  #9 Feed: tool center)
  #<r> = [[#3 + #8 - #5] / 2]           (Radius of the tool center circle)
  #<n> = [FIX[[#7 - #6] / #4] + 1]      (Number of revolutions. Always exceeds the top end)
  G0 X#1 Y#2
  G0 Z[#7 + 2]
  G1 Z#6 F[#9 * 5]                       (Descend at the center of the pilot hole)
  #<z> = [#6 + #4 / 2]
  G3 X[#1 + #<r>] Y#2 Z#<z> I[#<r> / 2] J0 F#9      (Lead-in: semi-circle)
  #<k> = 0
  o110 while [#<k> LT #<n>]
    #<z> = [#<z> + #4]
    G3 X[#1 + #<r>] Y#2 Z#<z> I[0 - #<r>] J0          (One pitch per revolution)
    #<k> = [#<k> + 1]
  o110 endwhile
  G3 X#1 Y#2 Z[#<z> + #4 / 2] I[0 - #<r> / 2] J0    (Lead-out: semi-circle to center)
  G0 Z[#7 + 2]
o<thread_mill> endsub
G21 G90 G17 G40 G80 G64 P0.005
S1600 M3                                 (SS400, φ8, 40 m/min)
o<thread_mill> call [50] [30] [10] [1.5] [8] [-15] [0] [-0.3] [29]   (1st pass: diameter 0.3 smaller)
o<thread_mill> call [50] [30] [10] [1.5] [8] [-15] [0] [0] [29]      (2nd pass: finish)
o<thread_mill> call [50] [30] [10] [1.5] [8] [-15] [0] [0] [29]      (One more pass at the same diameter: spring pass for deflection)
G0 Z10
M5

Conclusion

8. Commissioning Procedure

  1. Spindle direction and scale. Turn the spindle 1 revolution by hand. Make sure spindle.0.revs increases by 1.0. It must increase positively with M3.
  2. Index. Run the spindle. Raise index-enable and make sure it drops within 1 revolution.
  3. Reversal. Switch between M3 and M4. Make sure the A6-RS doesn't trip with an overvoltage fault. If it trips, lower maxaccel or reconsider the regenerative resistor. There are reports of stepper spindles tripping with overvoltage after stopping abruptly. [Forum]
  4. G33.1 in air. Use halscope to capture spindle.0.revs, commanded and actual Z positions, and joint.N.f-error. Measure the overshoot and Z lag during reversal. Replace the overshoot values in the table with your measured values.
  5. Through-holes in SS400 scrap for M6, M8, and M10. Check them with a thread gauge.
  6. Blind holes. Only after deepening the pilot holes based on the measured overshoot.
  7. M3 to M5. Do these last since they break easily.

9. Uncertain Points

10. Sources

Comments

No comments yet.

Comments with links, phone numbers or email addresses appear after the site approves them.

Sending needs JavaScript in your browser.

QR code for this page

https://robo100.jp/en/000023