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.

By cnccode · Updated

Turns a stepped shaft from Ø50 bar: G71 roughs with 2 mm depth per side and G70 finishes the same profile.

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

Program

G-code
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

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