Master CNC
Blog · 6 min read · 16 Oct 2026

Fanuc G76 threading cycle explained, with an M20 × 2.5 example

G76 cuts a whole thread from two lines of program: it plans every pass, cuts along one flank and finishes with spring passes. The words look cryptic because most of them are in microns. Here is every word, with a complete M20 × 2.5 example.

The short version: a 40-second video. Also on YouTube.

The two blocks

G76 P(m)(r)(a) Q(dmin) R(d)
G76 X(U) Z(W) R(i) P(k) Q(Δd) F(L)

First block

WordMeaningExample
P mNumber of finish (spring) passes, 2 digits02
P rChamfer (pull-out) at the end, in 0.1 × lead, 2 digits00 = none
P aTool angle, 2 digits60
QMinimum depth of cut, µm (radius)Q50 = 0.05 mm
RFinish allowance, mm (radius)R0.05

Second block

WordMeaning
X / ZRoot diameter and end of the thread
RTaper: radius difference start to end (leave out for a straight thread)
PThread height, µm (radius)
QDepth of the first cut, µm (radius)
FLead (the pitch, for a single-start thread)

Example: M20 × 2.5 outside thread, 25 mm long

1. Thread height and root diameter

A common shop value for the depth of an outside metric thread is 0.6134 × pitch:

height = 0.6134 × 2.5 = 1.534 mm
P      = 1534  (µm, radius)
root X = 20 − 2 × 1.534
       = 16.933

2. The program

T0303
G97 S1000 M03
G00 X24. Z7. M08
G76 P020060 Q50 R0.05
G76 X16.933 Z-25. P1534 Q450 F2.5
G00 X60. Z50. M09
  • G97 S1000: a fixed RPM, as every thread cycle needs. 1000 RPM on Ø20 is about 63 m/min. Check the speed for your insert and that your machine can feed 2.5 × 1000 = 2500 mm/min.
  • Z7.: start about three leads in front of the part, so the Z axis is up to speed before the thread starts.
  • P020060: 2 spring passes, no pull-out chamfer, 60° insert.
  • Q450: the first cut is 0.45 mm deep (radius).
Thread groove showing G76 passes getting thinner: depth = 0.45 × square root of the pass number
Each pass goes to Q × √n deep, so the passes get thinner as the tool goes deeper.

3. How the passes are planned

The depth after pass n is Q × √n, so each pass removes about the same area of metal:

pass 1: 0.450   pass 2: 0.636
pass 3: 0.779   pass 4: 0.900
pass 5: 1.006   ... pass 11: 1.484

The rough passes stop at height − R = 1.484 mm. Then one pass takes the last 0.05 mm, and the 2 spring passes run at full depth. A pass is never thinner than the minimum in block 1 (Q50 = 0.05 mm).

Internal and taper threads

  • Internal: X is the major diameter of the nut thread (bigger than the start point). P and Q stay positive.
  • Taper: add R in block 2, the difference in radius between the start and the end of the thread.

Common mistakes

  1. Decimal points in P and Q. Write them as plain integers in µm. Q450, not Q0.45.
  2. Diameter instead of radius. P and Q are radius values; only X is a diameter.
  3. G96 left on. Always G97 before threading.
  4. Older controls use a one-block G76 with different words. Check which format your control expects.

On Okuma OSP the same job is done by the one-block G71 thread cycle, with diameter values in mm.

Thread height depends on the standard and on your insert. Check the first part with a ring gauge or thread mic, and run the cycle once with the override low.

Try it in Master CNC

Calculators, process sheet to program, simulation, codes and lessons. Free to start, no sign-in, on phone and laptop.

Open the app