Turning program step by step: facing, G71 roughing and G70 finishing
Most lathe parts start the same way: face the end, rough the outside, then finish it. This post builds that program for a Fanuc-style control, one block at a time. The same part is the example in the Learn tab of the app.
The part
A shaft from a 50 mm bar. From the face: a 2 mm × 45° chamfer, Ø24 for 25 mm, a shoulder to Ø36, Ø36 up to a 3 mm fillet, a shoulder to Ø44, and Ø44 to 60 mm.
The full program
% O1001 (SHAFT FROM D50 BAR) N1 (FACE AND ROUGH) G28 U0 W0 T0101 G50 S2500 G96 S200 M03 G00 X54. Z0 M08 G01 X-1.6 F0.2 G00 X52. Z3. G71 U2. R0.5 G71 P10 Q20 U0.4 W0.1 F0.28 N10 G00 X18. G01 Z0 F0.15 X20. X24. Z-2. Z-25. X36. Z-37. G02 X42. Z-40. R3. G01 X44. Z-60. N20 X52. G28 U0 W0 M01 N2 (FINISH) T0202 G96 S240 M03 G42 G00 X52. Z3. G70 P10 Q20 G40 G28 U0 W0 M09 M30 %
Block by block
Start-up
G28 U0 W0: go to the machine reference point, a safe place to index the turret. Many shops use a fixed safe position instead.T0101: tool 01 with offset 01, the roughing tool.G50 S2500: the spindle never goes above 2500 min⁻¹. Always set this before G96.G96 S200 M03: constant cutting speed, 200 m/min. The spindle speeds up as X gets smaller.
Facing
G00 X54. Z0 M08: rapid to just outside the bar at the face, coolant on.G01 X-1.6 F0.2: face past the centre. Going slightly below zero (here twice the nose radius, 0.8 mm) cleans the pip in the middle. If the bar has more stock on the face, add a pass atZ1.first.
G71 roughing (two blocks)

G00 X52. Z3.: the cycle start point. It must be outside the bar and in front of the face, because the tool comes back here after the cycle.G71 U2. R0.5: depth of cut 2 mm per side, retract 0.5 mm after each pass.G71 P10 Q20 U0.4 W0.1 F0.28: the contour is from N10 to N20. Leave 0.4 mm on the diameter (U) and 0.1 mm in Z (W) for finishing. Rough feed 0.28 mm/rev.
The contour (N10 to N20)
These blocks describe the finished shape, from the front of the part to the end. G71 reads them to plan the rough passes, and G70 follows them for the finish pass. The F0.15 written here is only used by G70.
N10 G00 X18.: the first block of the contour moves in X only.X24. Z-2.: the 2 × 45° chamfer from Ø20 to Ø24.G02 X42. Z-40. R3.: the 3 mm fillet at the shoulder.- The X values only grow from N10 to N20. That is what a standard (type I) G71 expects.
G70 finishing
T0202andG96 S240: the finishing tool, a little faster.G42 G00 X52. Z3.: nose radius compensation on, approach to the same start point.G70 P10 Q20: one pass along the contour, using the F in the contour.G40 G28 U0 W0 M09: compensation off, go home, coolant off.M30ends the program.
On Okuma OSP
OSP does the same job with LAP. The contour goes between NAT1 G81 and G80, G85 NAT1 roughs it (D is a diameter there, so D4. is 2 mm a side) and G87 NAT1 finishes it. Careful: on OSP, G71 is the thread cycle, not roughing. The app's program converter does this rewrite for you and marks the lines to check.
Every machine is a little different. Reference return, coolant and tool numbers depend on your machine and shop. Simulate the program and run it in single block with the rapid override low before you cut.
Calculators, process sheet to program, simulation, codes and lessons. Free to start, no sign-in, on phone and laptop.
Open the app

