GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

Application guide

CNC Lathe Programming Examples: A Working Set for Novices

Five part shapes that cover most first-year turning work, written as readable G-code blocks with the numbers that matter. Read this and you can tell whether your own program will cut metal or scrap it.

G71 / G70 rough and finishG76 threadingGrooving with G75±0.005 mm tolerance
CNC lathe programming examples for novices: typical turning and programming cases
Key takeaways

What these examples teach

Start from the drawing, not the codeDecide tooling, clamping and datum before writing one line of G-code.
Roughing and finishing are separate passesG71 leaves 0.2–0.5 mm for G70 on most 6061 and 304 work.
Threading needs a pitch tableDepth of cut per pass in G76 controls tool load and flank quality.
Grooving fails on chip evacuationShort pecks and coolant decide whether the insert survives.
Measure the first part completelyA 30-second check beats a scrapped batch.
Case 1

Example 1: Shaft with Shoulders, G71 and G70

The first of these CNC lathe programming examples is a stepped shaft in 6061-T6, Ø40 mm bar, three diameters and a chamfer at the front. Clamp on 25 mm of stock in a three-jaw chuck, face the front, and set Z0 at the finished face. This single decision fixes every other coordinate in the program.

Rough with G71 using 1.5 mm depth of cut per pass and 0.3 mm finish allowance on X and Z. A 0.8 mm corner radius insert handles the shoulders without chatter at 600–900 rpm in aluminum. Leave 0.2–0.5 mm radial stock for G70.

Finish with G70 and a 0.4 mm nose radius insert at 1,200–1,800 rpm, feed 0.08–0.12 mm/rev. For Ø40 mm aluminum, cutting speed of 200–350 m/min gives a clean surface around Ra 0.8–1.6 μm.

Check the shoulder runout on the first part with a dial indicator. If it drifts past 0.02 mm, the jaws are bell-mouthed or the bar was not seated. Fix the clamping before touching the offsets.

  • 1
    StockØ40 mm 6061-T6 bar, 120 mm long
  • 2
    ToolsCNMG roughing insert, DNMG finishing insert
  • 3
    TargetØ30 / Ø25 / Ø20 mm, ±0.05 mm general
Case 2

Example 2: External Thread, G76 Two-Block Format

Thread turning trips up novices more than any other lathe operation. Take an M20 × 2.5 external thread in 1045 steel. Thread height for a 60° metric form is 0.6134 × pitch, so 1.53 mm of radial infeed. Split that across the first pass and the remaining passes.

In the two-block G76 format, the first block sets the number of spring passes, the chamfer amount, the thread angle and the minimum depth of cut. The second block carries the major diameter, the thread height, the first pass depth and the pitch. Keep the included angle at 60° for a standard metric form.

Load a full-form insert matched to a 2.5 mm pitch. A partial-profile insert works too, but you then have to control the crest diameter yourself.

Run the first thread at reduced speed and check with a ring gauge or thread micrometer. Pitch diameter, not the crest, decides whether the part passes. Adjust the X wear offset by the measured difference and rerun.

  • 1
    Thread height0.6134 × pitch for 60° metric form
  • 2
    First pass0.5–0.8 mm radial for steel
  • 3
    Speed300–500 rpm in 1045 to limit flank load
Case 3

Example 3: Groove and Undercut with G75

A relief groove behind a shoulder looks simple and breaks tools anyway. On a Ø50 mm part with a 4 mm wide, 3 mm deep groove in 304 stainless, use a grooving insert narrower than the groove and step over with G75, or plunge once if the insert width matches.

Peck in 0.5–0.8 mm increments. Full-depth plunging in stainless work-hardens the floor and snaps the insert on the second pass. Coolant aimed at the cutting edge, not the part, keeps chips moving.

Feed rate for grooving sits lower than turning: 0.04–0.08 mm/rev. Feed too fast and the insert deflects, leaving a tapered floor that fails a depth check.

Deburr the groove edges in the program with a small chamfer pass. Hand deburring a groove 3 mm deep is slow, and a raised edge on a mating face causes assembly problems later.

  • 1
    Step over≤ 70% of insert width
  • 2
    Peck depth0.5–0.8 mm in stainless
  • 3
    Speed120–200 m/min for 304
Case 4

Example 4: Bored Hub with a Through Hole

Now a hub with a Ø30 mm through bore, 40 mm deep, in 6061. Drill 28 mm first on the lathe, then bore to size with a boring bar. Drilling removes most of the material; boring fixes position and diameter.

Rough the bore in two passes at 0.5 mm radial depth and finish at 0.15–0.25 mm radial depth. A boring bar deflects more than an external tool, so keep the overhang under 4 × bar diameter.

Bore diameter tolerance of +0.02 / 0 mm suits most bearing seats. Measure with a bore gauge at three depths to catch taper from bar deflection.

If the bore comes out tapered, the bar is too long or the feed too high. Shorten the overhang, drop the feed, and rerun the finishing pass.

  • 1
    DrillØ28 mm, 118° point, through
  • 2
    Overhang≤ 4 × boring bar diameter
  • 3
    Finish0.15–0.25 mm radial, 0.08 mm/rev
Case 5

Example 5: Thin-Wall Sleeve, Light Cuts Only

A sleeve with a 2 mm wall in 6061 or 316L is the case where good programs still fail. Cutting forces push the wall outward, and the finished part springs back oval. Light passes and support are the only real answers.

Rough with 0.5 mm depth of cut and leave 0.5 mm for finishing. Use a sharp, positive-rake insert. Dull edges raise radial force and ovality.

Finish in two passes at 0.15 mm radial depth and 0.06–0.10 mm/rev. Do not aim for one heavy finishing pass to save cycle time.

Check ovality with a micrometer at 0° and 90°. If it exceeds 0.03 mm, reduce depth of cut and add a spring pass at the same setting.

For walls under 1.5 mm, consider a soft-jaw or expanding mandrel setup instead of a three-jaw chuck. Clamping force, not the toolpath, is usually the limiting factor.

  • 1
    Roughing0.5 mm depth, 0.15 mm/rev
  • 2
    Finishing0.15 mm radial, 0.06–0.10 mm/rev
  • 3
    ClampingSoft jaws or expanding mandrel below 1.5 mm wall
Comparison

Which Cycle Fits Which Feature

Pick the cycle by feature geometry, not habit.

FeatureCycleTypical allowanceWatch out for
Stepped external profileG71 + G700.2–0.5 mm radialShoulder chatter on long overhang
60° external threadG76 two-blockN/A (thread height sets it)Wrong pitch table, crest-only gauging
Relief grooveG750.5–0.8 mm peckWork hardening in 304
Through boreDrill + G71 boring0.15–0.25 mm radialBar deflection and taper
Thin-wall sleeveG71 with light cuts0.5 mm radialOvality from clamping force

The Rule That Saves the Most Parts

Rough with the biggest safe depth of cut, finish with the smallest one that holds the tolerance, and never skip the first-part measurement. If the wall is under 1.5 mm, change the clamping before changing the program.

FAQs

Questions Novices Ask

Do I always need both G71 and G70?

Not always. On a short part with a simple profile, one pass can hold tolerance in soft aluminum.

For anything with shoulders, threads or a tolerance under ±0.05 mm, rough and finish separately. Mixing them usually costs more in scrap than the cycle time saves.

What surface finish can a lathe reach without grinding?

Turning with a sharp insert and correct feed reaches Ra 0.8–1.6 μm on most aluminum and steel. Finer inserts and lower feed can reach Ra 0.2–0.8 μm on aluminum.

Below that, you need grinding, honing or a polishing step outside the lathe.

Why does my thread look fine but fail the gauge?

The crest is the easiest feature to see and the least important. Pitch diameter controls fit.

Check the thread with a ring gauge or thread micrometer, then correct the X wear offset by the measured difference and rerun the thread.

When should I switch from a three-jaw chuck to soft jaws?

When wall thickness drops below about 1.5 mm, or when roundness matters more than cycle time.

Soft jaws bore to the workpiece diameter and spread clamping load across a larger arc, which cuts ovality.

How much stock should I leave for finishing?

0.2–0.5 mm radial is the usual range for external turning. Boring runs lighter, around 0.15–0.25 mm.

Leave more and the finishing pass removes it all at low feed, which costs cycle time and can pull the part out of round.

Can these examples run on a lathe without a tailstock?

Yes for parts under roughly 4 × diameter in length. Beyond that, deflection grows and the finish suffers.

Use a tailstock or a steady rest when length exceeds 4–5 × diameter.

Send the Drawing, Get a Turning Plan

Share your part file and we return a quotation plus DFM feedback within 12 hours. Prototypes and short runs, no minimum order quantity.

12-hour quote100% inspection±0.005 mm tolerance

Follow

More machining notes

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC