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

Get Instant Quote

Turning guide

How to Program CNC Lathe Machine: A Shop-Floor Workflow

This guide walks through the order we use when we program cnc lathe work on shafts, bushings, and fittings. It covers setup sheets, zero points, G-code structure, simulation, and the first-article checks that catch a crash before it happens.

Ø400 mm rotary table±0.005 mm toleranceRa 0.8–1.6 μm12-hour DFM review
how to program cnc lathe machine
Quick view

Key takeaways

Geometry first, code secondDraw the complete turned profile in CAM before touching the control. A missing chamfer or radius costs a second setup.
Zero points decide everythingZ0 at the finished face, X0 at the spindle centerline. Write both on the setup sheet, not on a scrap of paper.
Rough in constant surface speedG96 with a max RPM clamp. On 6061-T6 that often means 200–350 m/min; on 304 stainless keep it lower.
Simulate before you dry runToolpath simulation catches holder collisions that a single-block dry run will not show you.
Check the first article on the machineMeasure OD, length, and a thread gauge before the second part is cut. Adjust wear offsets, not the program.
Foundation

What you need before you program cnc lathe work

A CNC lathe spins the workpiece while a single-point tool moves along X and Z. That is the whole difference from a mill, and it drives how you plan the job. On a lathe the part rotates, so every feature is defined relative to the centerline. Diameters are programmed in X, lengths in Z. If you come from milling, the first habit to break is thinking in Cartesian edges. Think in radii and faces instead.

Before you open CAM, you need three things on the bench: a released drawing with a clear tolerance block, a stock size that matches the bar or billet on the shelf, and a tool list that reflects what is actually loaded in the turret. A program built around a tool that is not in the machine is a program you will rewrite at the machine.

Check the drawing for features that a standard turning pass cannot reach. Cross-holes, milled flats, and slot features need live tooling or a second operation. If a feature sits on the back side of a shoulder, a right-hand tool will not cut it without a groove insert or a second setup. Flag those now, not after the first part is half finished.

Finally, decide which faces are datums. On a shaft, that is usually the finished face plus the centerline. On a bushing, it might be the bore. Write the datum callouts on the setup sheet so the operator and the programmer are working from the same reference.

  • 1
    Drawing and revisionConfirm the revision letter matches the one in the traveler.
  • 2
    Stock formBar, cast, or forged stock changes how much you rough in the first pass.
  • 3
    Tool listMatch insert grades and nose radii to the material and finish callout.
  • 4
    Datum calloutsMark the face and centerline datums on the setup sheet.
Structure

How a lathe program is structured

A turning program has a repeating shape: a safety block, a tool change, a speed and feed call, a positioning move, the cutting moves, and a retract. Once you see that pattern, reading someone else's program gets much faster. The header sets the work offset, the units, and the plane. After that, each tool block is a small self-contained story.

In inch or metric, pick one and stay in it. G20 and G21 are not interchangeable mid-program without a full rethink of your feeds and offsets. Most of our work runs in metric with G21 declared in the header. If the drawing is in inches, convert once and note the conversion on the setup sheet.

The work offset (G54 through G59) tells the control where the part sits. On a lathe this is usually a Z face plus an X centerline. Get the Z face from a touch-off on the finished face, not on the raw stock. Raw stock varies; the finished face does not.

Every program needs a safe retract position. Pick a point clear of the tailstock, the chuck jaws, and any live tooling. If you retract to a point that clears the part but not the jaws, the next tool change will tell you about it in the loudest possible way.

  • 1
    HeaderUnits, plane, work offset, and a stop for the operator.
  • 2
    Tool blockTool call, spindle speed, feed, and approach move.
  • 3
    Cutting blockRough, finish, threads, grooves, and any live-tool work.
  • 4
    Retract and endSafe position, spindle stop, and M30.
G-code

G-codes you will use on almost every job

You do not need to memorize the whole G-code list. A working set of about a dozen codes covers the majority of turned parts. G00 moves at rapid, G01 at the feed you set. G02 and G03 cut arcs, clockwise and counterclockwise as viewed from the positive X axis. That viewing direction trips people up, so check it once and commit it to memory.

For turning cycles, G71 handles roughing a profile, G70 finishes it, G76 cuts threads, and G75 cuts grooves. G71 takes a start and end block for the profile, plus a depth of cut. A typical roughing depth on 4140 steel sits around 1.5–2.5 mm per side, while 6061-T6 can take 3–4 mm per side with the right insert.

Spindle control is G96 for constant surface speed and G97 for fixed RPM. G96 keeps the finish consistent as the tool moves across a changing diameter, but it needs a G50 max RPM clamp so the spindle does not overspeed near X0. On a small-diameter finish pass, that clamp is the difference between a clean cut and a spun insert.

Coolant, tool changes, and program stops round out the set. M03 and M04 start the spindle forward or reverse, M08 turns coolant on, and M00 stops the program for the operator. Use M00 deliberately, not as a substitute for planning the operation order.

  • 1
    G00 / G01Rapid positioning and linear feed moves.
  • 2
    G02 / G03Arc moves, viewed from positive X.
  • 3
    G71 / G70Profile roughing cycle and its finishing pass.
  • 4
    G76 / G75Threading cycle and grooving cycle.
Turning decisions

Speeds, feeds, and when a part is not a lathe job

Surface speed is the number that matters, not RPM. On 6061-T6 aluminium, 200–350 m/min is a reasonable roughing range with carbide. On 304 stainless, drop to 120–180 m/min and expect work hardening if the tool rubs. On titanium such as Ti-6Al-4V, keep surface speed low and never let the insert dwell in the cut.

Feed per revolution controls chip thickness and finish. A 0.8 mm nose radius insert at 0.15–0.25 mm/rev gives a finish in the Ra 0.8–1.6 μm range on many steels. Push the feed too low and the tool rubs instead of cutting. Push it too high and you trade surface finish for cycle time.

Depth of cut should engage the insert's intended range. Light passes on hard material wear the nose radius and generate heat. Heavy passes on a slender shaft push the part away from the tool and cut a taper. If the shaft is long relative to its diameter, use a tailstock or a steady rest before you blame the program.

Not every part belongs on a lathe. A flat plate with a few holes and a pocket is a mill job. A part with a deep internal cavity and no rotational symmetry is usually a mill or a mill-turn job. Mill-turn centers handle both, and we run 16 of them for parts that need turned and milled features in one setup.

  • 1
    Aluminium 6061-T6200–350 m/min surface speed, 0.15–0.30 mm/rev feed.
  • 2
    Stainless 304 / 316120–180 m/min, 0.10–0.20 mm/rev, keep the tool moving.
  • 3
    Steel 4140150–220 m/min, 1.5–2.5 mm per side roughing depth.
  • 4
    Slender shaftsUse a tailstock or steady rest before adjusting the program.
Common errors

Mistakes that cost the most time

The most expensive mistake is a wrong work offset. If Z0 is set on raw stock instead of the finished face, every length in the program shifts by the stock allowance. The operator usually catches it on the first part, but only after the tool has already cut.

The second is ignoring tool deflection on a finish pass. A boring bar with a long overhang will push away from the cut. The result is a bore that measures small at the entrance and large at the back, or the reverse. Shorten the overhang or take a lighter finish pass.

The third is running G96 without a max RPM clamp. Near X0 the control commands very high RPM and the insert fails. Set the clamp to the spindle's safe limit for the workholding, and check it every time you change a work offset.

Chip control is the quiet one. On 304 stainless, a chip that wraps the tool will scratch the finish on the next pass. Adjust feed and depth to break the chip, or add a high-pressure coolant line if the machine has one.

  • 1
    Wrong Z0Set Z0 on the finished face, never on raw stock.
  • 2
    Tool deflectionShorten overhang before you change the feed.
  • 3
    Missing RPM clampG50 or the control equivalent, set every setup.
  • 4
    Chip wrappingFix feed and depth before adding a second coolant line.
Workflow

Step by step: how to program a cnc lathe

Follow this order on the next turned part you set up.

  • 1
    1. Build the setup sheetList stock size, material, workholding, work offset, tool numbers, and datum faces. Include the tolerance block and any critical feature. Keep it to one page the operator can read at the machine.
  • 2
    2. Set the zero pointsTouch off Z0 on the finished face and X0 on the spindle centerline. Record both values. If the part has a second face, define a separate work offset rather than reusing G54.
  • 3
    3. Model the turned profileDraw the finished profile including chamfers and radii. Extend the stock boundary so CAM knows what to remove. Check that every radius is tangent; a non-tangent corner will show up as a dwell mark on the part.
  • 4
    4. Choose tools and cut parametersPick a roughing insert, a finishing insert, and any grooving or threading tools. Set surface speed and feed per revolution for the material. Clamp G96 with a max RPM that suits the smallest diameter in the pass.
  • 5
    5. Generate and read the codePost the program, then read it. Look for correct work offset, safe approach moves, and a proper retract before every tool change. Fix the code here, not at the machine.
  • 6
    6. Simulate the full cycleRun toolpath simulation with the actual holder geometry. Watch for collisions with the chuck, tailstock, and live tooling. A simulation takes a few minutes; a crash takes a shift.
  • 7
    7. Dry run and single blockRun the program with no stock, feed hold between blocks, and keep a hand on the override. Confirm each tool reaches its intended position before it cuts.
  • 8
    8. Cut the first article and measureCut one part, then measure OD, length, and any thread or bore. Adjust wear offsets to bring dimensions into tolerance. Do not edit the program to fix a wear issue.
Reference

Lathe programming choices and when they fit

Use this when you are deciding between control-side edits and a fresh CAM pass.

SituationBest approachWatch for
Simple shaft, one diameterManual G-code at the controlWrong Z face after a stock change
Multiple diameters and radiiCAM with G71 / G70 cyclesNon-tangent corners leaving dwell marks
Threaded fitting, standard pitchG76 threading cycleThread height and chamfer lead-in
Cross-hole or milled flatLive tooling or second opHolder clearance to the chuck
Slender shaft, L/D over 8Tailstock or steady restTaper from part deflection, not the program
Tight bore, ±0.005 mmSeparate boring bar, small depthTool deflection on the finish pass
Short run, one or two partsConversational control programmingSkipping simulation to save time

Get the program right before the first chip

Simulate, dry run, and measure the first article. If you would rather hand the setup to a shop that runs this workflow daily, send us the drawing.

FAQs

Frequently asked questions

What is the difference between programming a lathe and a mill?

On a lathe the workpiece rotates and the tool moves in X and Z. On a mill the tool rotates and the table moves in X, Y, and Z. That changes how you think about datums: a lathe program is built around a centerline, a mill program around a face and two edges.

The G-code sets overlap but the cycles are different. A lathe uses G71, G70, G76, and G75 for roughing, finishing, threading, and grooving. A mill uses cutter compensation and pocket or contour cycles instead.

Do I need to learn G-code to program a cnc lathe?

You can generate a program entirely in CAM, but you still need to read the output. When a tool crashes or a dimension drifts, the fix usually starts with reading the code and checking the offset.

Learning the dozen codes that cover most turning work is enough to debug a program at the machine. You do not need to write every line by hand.

Which materials can be turned on a CNC lathe?

Aluminium, stainless steel, carbon and alloy steel, copper and brass, titanium, and engineering plastics all turn well with the right insert and parameters. We run 6061-T6, 304, 316L, 4140, 17-4PH, Ti-6Al-4V, and PEEK among others.

The material changes surface speed, feed, and insert grade, not the basic program structure. Hardened tool steel above roughly 45 HRC usually needs a different insert grade or a grinding operation after turning.

How do I check that a lathe program is accurate before running production?

Simulate the toolpath with real holder geometry, then dry run the program in single block with no stock. Confirm each tool reaches position and retracts clear of the chuck and tailstock.

Cut one part and measure it against the drawing before starting the second. Record the wear offsets you applied so the next run starts from a known point.

When should a part move to a mill-turn center instead of a lathe?

When the part needs cross-holes, milled flats, or slots that would otherwise require a second setup. Moving a part between machines adds handling time and stacks two sets of position errors.

We run 16 mill-turn centers for parts that need turned and milled features in one cycle. If the milled features are simple and the quantity is low, two setups on separate machines can still be the cheaper route.

Can you program and run a turned part from a drawing alone?

Yes. Send the drawing with the tolerance block and material callout, and we return a quotation with a DFM review within 12 hours. We program from the released drawing and confirm any ambiguous callouts before cutting.

Uploads stay confidential and an NDA is available on request. There is no minimum order quantity, so a single prototype and a 10,000-part run go through the same programming workflow.

Send your turned part for programming and production

Quotation and DFM analysis within 12 hours. Production can start within 24 hours of approval, with parts shipping in 3–5 days.

12-hour quoteNo minimum order quantity100% inspection before shipment

Follow

More shop-floor 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