Example program · Lathe

Lathe Threading M20 × 2.5 with G76 — G-Code Example

Cuts an external M20 × 2.5 thread 30 mm long with the Fanuc two-line G76 cycle.

By cnccode · Updated

Cuts an external M20 × 2.5 thread 30 mm long with the Fanuc two-line G76 cycle.

ItemValue
MachineCNC lathe (Fanuc G-code system A)
UnitsMetric (G21)
Lines9

Program

G-code
O2003 (M20 X 2.5 EXTERNAL THREAD)
G21 G18 G40 G99
T0303 (60 DEG THREADING INSERT)
G97 S800 M03
G00 X22. Z7.5 M08
G76 P010060 Q50 R0.02
G76 X16.933 Z-30. P1533 Q400 F2.5
G00 X100. Z100. M09
M30

▶ Simulate in the G-code viewer

How it works

  • Thread height 0.6134 × 2.5 = 1.533 mm → P1533 (µm).
  • Minor diameter = 20 − 2 × 1.533 = 16.933 mm.
  • Start Z is 3 pitches ahead of the part for spindle synchronisation.

Codes used in this program

Always check feeds, speeds, offsets and clearances for your own machine and tooling, and prove new programs with single block and reduced rapid.

More lathe programs