Example program · Lathe
Lathe OD Turning Box Cycle (G90) — G-Code Example
Turns a Ø50 bar down to Ø40 over 30 mm with the G90 single-pass box cycle, 1.5 mm depth per side per pass, then a finish pass.
Turns a Ø50 bar down to Ø40 over 30 mm with the G90 single-pass box cycle, 1.5 mm depth per side per pass, then a finish pass.
| Item | Value |
|---|---|
| Machine | CNC lathe (Fanuc G-code system A) |
| Units | Metric (G21) |
| Lines | 14 |
Program
O2102 (G90 TURN D50 TO D40 X 30)
G21 G18 G40 G99
T0101
G50 S2500
G96 S200 M03
G00 X52. Z2. M08
G90 X47. Z-30. F0.25
X44.
X41.
X40.2
G96 S250
X40. F0.1
G00 X100. Z100. M09
M30▶ Simulate in the G-code viewer
How it works
- Each X value repeats the full box: in, along Z, out, back.
- G71 is better for profiles with several diameters.
Codes used in this program
- G90 — Absolute Programming (Mill) / OD Turning 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 OD Roughing and Finishing (G71 / G70)
- 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 Facing Box Cycle (G94)
- Lathe Stock Removal in Facing (G72)