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.
Cuts an external M20 × 2.5 thread 30 mm long with the Fanuc two-line G76 cycle.
| Item | Value |
|---|---|
| Machine | CNC lathe (Fanuc G-code system A) |
| Units | Metric (G21) |
| Lines | 9 |
Program
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
- Lathe OD Roughing and Finishing (G71 / G70)
- Lathe Facing Program with CSS
- Lathe OD Grooving with G75
- Peck Drilling on a Lathe (G74)
- Lathe Internal Boring (G71 for ID)
- Lathe Parting Off a Part
- Lathe Taper Turning Program
- Lathe Threading with G92 (M12 × 1.75)
- Lathe OD Turning Box Cycle (G90)
- Lathe Facing Box Cycle (G94)
- Lathe Stock Removal in Facing (G72)