Example program · Lathe
Lathe OD Roughing and Finishing (G71 / G70) — G-Code Example
Turns a stepped shaft from Ø50 bar: G71 roughs with 2 mm depth per side and G70 finishes the same profile.
Turns a stepped shaft from Ø50 bar: G71 roughs with 2 mm depth per side and G70 finishes the same profile.
| Item | Value |
|---|---|
| Machine | CNC lathe (Fanuc G-code system A) |
| Units | Metric (G21) |
| Lines | 24 |
Program
O2001 (OD ROUGH + FINISH)
G21 G18 G40 G99
T0101 (CNMG 120408 ROUGH)
G50 S2500
G96 S200 M03
G00 X52. Z2. M08
G71 U2. R0.5
G71 P10 Q20 U0.4 W0.1 F0.25
N10 G00 X20.
G01 Z0 F0.12
X24. Z-2.
Z-25.
G02 X34. Z-30. R5.
G01 X40.
Z-50.
X48. Z-54.
N20 X52.
G00 X100. Z100.
T0202 (VNMG 160404 FINISH)
G96 S250 M03
G00 X52. Z2.
G70 P10 Q20
G00 X100. Z100. M09
M30▶ Simulate in the G-code viewer
How it works
- F inside N10–N20 (0.12) is only used by G70.
- U0.4 leaves 0.2 mm per side for finishing.
- The profile must start with X (and Z for Type II) in block N10.
Codes used in this program
- G71 — Stock Removal in Turning (Roughing Cycle)
- G70 — Finishing Cycle (Lathe)
- G96 — Constant Surface Speed (CSS)
- G50 — Max Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill)
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 Facing Program with CSS
- Lathe Threading M20 × 2.5 with G76
- 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)