School of Engineering · Playlist

CNC Turning

Setting up a CNC lathe and its offsets, spindle and feed modes, profiles and canned cycles, and a full turning program.

  1. CNC Turning Setup and Offsets
  2. CNC Turning Spindle and Feed Modes
  3. CNC Turning Profiles and Cycles
  4. CNC Turning Program Walkthrough
Machining/CNC

CNC Turning Setup and Offsets

Read lathe X and Z coordinates, identify tooling and workholding, and separate part location from tool geometry and wear.

Read X as a size and Z as a position along the spindle; Practice

Read X as a size and Z as a position along the spindle

Start with CNC Control Fundamentals for how CNC works and Lathe Operations for the cuts a lathe makes. Here the work rotates and the ordinary turning tool moves in the XZ plane. Z runs along the spindle; positive Z is away from the headstock in the basic arrangement shown. X moves radially, even when its displayed value is a diameter. A slant bed or rear turret changes the view, so check the machine's axis diagram.

Confirm diameter or radius programming before reading an X value. For a 28 mm diameter, diameter mode uses X28 and radius mode uses X14. Moving from X28 to X24 in diameter mode removes 2 mm radially. Z is not halved. Confirm incremental and arc-centre conventions separately.

Lathe side view: work zero is at the face on the spindle centreline. Positive Z points away from the headstock; X28 in diameter mode represents a surface 14 mm from the centreline.

Use Absolute and Incremental Positioning for coordinate arithmetic. On many Fanuc-style lathes X/Z are absolute endpoints and U/W are increments; G90 can be a turning cycle. Do not paste a mill's G90/G91 startup into a lathe program.

Practice lathe X commands

The tool arrangement determines how the next cutter reaches the work

The tool arrangement determines how the next cutter reaches the work

A turret indexes a selected tool station into working position. Gang tooling mounts several tools on a slide; moving the slide brings the selected tool into position without turret indexing. Each tool still needs the correct offsets and a checked approach path.

Live tooling powers a rotating cutter on the lathe for operations such as drilling or milling. A C axis controls the spindle's angular position, allowing the work to be indexed or rotated under position control. These are options, not features of every CNC lathe. Some machines also add a Y axis. Live-tool and spindle-mode commands belong to the machine's manual.

Supporting detail: Addendum 1 — Why an extra axis changes the work a turning center can do.

Match the workholding and automation to the part

Match the workholding and automation to the part

  • A chuck grips with jaws. A self-centering chuck moves its jaws together; independent jaws permit individual adjustment. Jaw style and setup determine which shapes can be held.
  • A collet closes around a matching stock size and shape. Its useful size range depends on the collet design.
  • A tailstock center supports the free end of suitable work. It does not replace the chuck or collet that drives the work.
  • A bar feeder advances bar stock for successive parts. A parts catcher receives a separated part. Their timing and interlocks are machine-specific; neither is assumed in an ordinary two-axis program.

For operating requirements use the Safety collection and CNC Programming and Prove-Out. No particular shop machine or installed option is assumed here.

Locate the part face once, then locate each tool relative to it

Locate the part face once, then locate each tool relative to it

Use CNC Axes and Offsets for machine zero, work zero and the general offset relationship. On a lathe, a common part datum is Z0 at the finished face and X0 on the spindle centreline. Establish the Z work shift using the control's documented reference-tool, probe or touch-off method. Allow for any material still to be faced away.

For X touch-off, the reference is a measured diameter. In a trial-cut method, a tool cuts a short cylindrical surface and that diameter is measured; the control's measurement function uses the known size to establish that tool's X geometry. Use the manual's procedure for the actual machine, including which table receives the value. Do not enter the measured diameter as though it were automatically the raw geometry-offset value.

Stored informationWhat it describes
Work shift or work offsetThe part datum, especially its Z location.
X and Z tool geometryThe position of each tool's reference tip relative to the established reference system.
X and Z wearSmall dimensional corrections after measurement, separate from the basic tool setup.
Nose radius and tip orientationThe rounded cutting corner and how its imaginary tip relates to it; see CNC Turning Profiles and Cycles.

Check whether an X wear entry is interpreted radially or diametrally, its sign, and whether the control adds to or replaces the existing value. A work-offset change affects the shared datum; a tool correction addresses one tool. Selecting G54 does not measure or store a new zero. G53 does not erase the offset table.

Supporting detail: Addendum 2 — Control example: separate geometry and wear fields.

Machining/CNC

CNC Turning Spindle and Feed Modes

Calculate constant-surface-speed RPM, apply an RPM ceiling, and distinguish feed per revolution from feed per minute.

G96 changes RPM with diameter; G97 holds a requested RPM; Practice

G96 changes RPM with diameter; G97 holds a requested RPM

In the Fanuc-style lathe convention used here, G96 selects constant surface speed (CSS). S gives cutting speed: surface feet per minute with inch units, or metres per minute with metric units. G97 cancels CSS and makes S an RPM value. Confirm the actual control's units and code meanings.

Use the work diameter at the cutting point, not the insert size. From Feeds and Speeds:

  • Inch: RPM = SFM × 12 / (π × diameter in inches).
  • Metric: RPM = cutting speed in m/min × 1000 / (π × diameter in mm).

At 180 SFM on a 1.5 in diameter, RPM = 180 × 12 / (π × 1.5) = 458 RPM, rounded to a whole RPM. At 90 m/min on a 30 mm diameter, the result is 955 RPM. These are arithmetic examples, not recommended cutting data.

Practice CSS calculations

Set the maximum RPM before enabling constant surface speed; Interactive; Practice

Set the maximum RPM before enabling constant surface speed

Establish an appropriate spindle-speed ceiling for the actual setup before G96. On the Fanuc-style lathe convention here, G50 S1800 limits requested speed to 1800 RPM. The number is only an illustration; determine the permissible limit from the machine, workholding, tooling and setup documentation. Other controls use different commands or parameters.

G50 S1800 (ILLUSTRATIVE RPM CEILING)
G96 S90   (METRIC CSS: 90 METRES PER MINUTE)
G97 S600  (LEAVE CSS: REQUEST 600 RPM)

As diameter approaches zero during facing, CSS requests increasing RPM. Once the clamp is reached, RPM stays limited and surface speed falls. At the centre, a nonzero surface speed cannot be maintained at any finite RPM. Use CNC Programming and Prove-Out and the Safety collection for the required operating checks.

Supporting detail: Addendum 3 — Calculate where a speed ceiling starts to matter.

Worked example: 240 SFM, 2 in stock outside diameter (OD), and a 1000 RPM clamp. These are teaching values, not cutting recommendations. D* = 240 × 12 / (π × 1000) = 0.917 in.

Spindle RPM002Diameter (in)1000 clampD*
The dashed horizontal line is the RPM ceiling. The dot shows D = 0.5 in.
Surface speed (SFM)002Diameter (in)240 setpointD*
Below D*, RPM stays at 1000 and surface speed falls linearly toward zero.
One setpoint, three cutting diameters
D (in)RPMSFMClamped?
2458.37240No
0.51000130.9Yes
010000Yes

At 2 in: 240 × 12 / (π × 2) = 458.37 RPM. At 0.5 in, CSS would request 1833.46 RPM; the clamp gives 1000 RPM and π × 0.5 × 1000 / 12 = 130.90 SFM. At D = 0, the model commands the clamp RPM and surface speed is zero.

This ideal steady-state model uses π without rounding in the calculations. Displays round RPM and surface speed to two decimal places, diameters to three; trailing zeros are omitted. It assumes the commanded RPM is reached immediately and omits acceleration and other machine limits. Unit changes load a fresh teaching preset. For operating checks, see CNC Programming and Prove-Out and the Safety collection.

Explain the RPM clamp

Read the feed mode before interpreting F; Practice

Read the feed mode before interpreting F

In this common Fanuc-style lathe convention, G99 means feed per spindle revolution and G98 means feed per minute. With inch units, G99 F0.006 means 0.006 in/rev; G98 F0.006 means 0.006 in/min. With metric units, the corresponding lengths are millimetres. Codes vary: the milling return-level meanings of G98/G99 do not apply here.

Feed per minute = feed per revolution × RPM. At 800 RPM, 0.006 in/rev gives 4.8 in/min. If CSS increases RPM while G99 holds F constant, the feed per minute increases too. If G98 holds feed per minute constant, feed per revolution changes with RPM.

Set the intended feed mode explicitly. See CNC Program Structure for modal behavior and CNC Turning Program Walkthrough for a commented turning example.

Supporting detail: Addendum 4 — Reference for the code convention used here.

Practice feed conversion

Machining/CNC

CNC Turning Profiles and Cycles

Account for a rounded tool nose on tapers and arcs, then distinguish roughing, finishing, grooving and threading cycles.

A rounded tool nose does not cut at the imaginary sharp tip

A rounded tool nose does not cut at the imaginary sharp tip

A turning insert has a rounded corner, called its nose radius. Touching off along X and Z establishes an imaginary tip: the intersection of the two tangent reference lines. There is no cutting material at that intersection. The actual contact point moves around the nose as the direction of the surface changes.

Axis-parallel cuts can reach the measured diameter or face with the corresponding touch-offs. On a taper, chamfer or arc, simply driving the imaginary tip along the desired surface leaves a profile error. Account for the nose radius with a calculated toolpath or the control's tool nose compensation. See Turning Tapers for taper geometry.

A rounded nose touches the X and Z reference lines, whose intersection is the imaginary tip. A taper through that tip misses the rounded edge; a parallel tangent line shows the resulting surface without compensation.

Supporting detail: Addendum 5 — Why a good diameter measurement does not prove a taper is correct.

Compensation needs nose radius, tip orientation and a clear entry and exit

Compensation needs nose radius, tip orientation and a clear entry and exit

In common Fanuc-style usage, G41 selects compensation to the left of the programmed direction of travel and G42 to the right; G40 cancels it. Judge the side in the control's XZ-plane convention. Do not choose a code from the screen's apparent left or right, or assume one code means every outside cut.

Enter the actual nose radius and the control's tip orientation, which tells it where the imaginary tip sits relative to the nose centre. Select the correct tool-offset register, use the manual's lead-in and lead-out requirements, and check the resulting path with CNC Programming and Prove-Out. Tip numbers differ by control; there is no universal number table here.

Do not apply full nose-radius compensation again to a path already corrected for that radius. Check whether a CAM post expects full geometry compensation, wear-only compensation or no control compensation.

Supporting detail: Addendum 6 — Where to check the control behavior.

A roughing cycle removes layers while leaving stock for finishing

A roughing cycle removes layers while leaving stock for finishing

A G71-type roughing cycle uses a defined final profile to generate repeated stock-removal passes, commonly along Z for outside or inside turning. The programmer supplies the applicable cut depth, retract and finish allowance. A G70-type finishing cycle follows the defined profile to remove the remaining allowance.

Upper half of turning stock: successive roughing passes run along Z toward the headstock and leave an allowance above a stepped finished profile. Finishing follows the final outline.

Read the control's cycle definition before entering parameters. One-block and two-block formats differ. A depth word may be radial while an X allowance is diametral; the same letter can mean different things in different blocks. P and Q commonly identify the first and last numbered profile blocks. Check the referenced blocks, permitted profile direction changes, return path and compensation rules.

Supporting detail: Addendum 7 — Why no universal cycle template is shown.

Grooving repeats plunges; threading synchronizes feed with rotation

Grooving repeats plunges; threading synchronizes feed with rotation

A grooving or peck cycle divides a plunge into smaller advances and retracts. Some formats repeat the plunge at different Z positions to make a wider groove. G75 is one common outside/inside grooving family; face-grooving and peck-drilling families may use other codes. Check peck size, final depth, groove width and tool-width convention separately.

A G76-type threading cycle makes repeated synchronized passes with increasing depth. The thread lead determines the axial advance per spindle revolution. The cycle also needs control-specific information about final size, infeed, pass depth and runout. Use Single-Point Threading for pitch, lead and thread form; a threading cycle does not choose those dimensions for you.

Formats differ by control, so no complete parameter syntax is universal. See the Haas G75 reference and the G70/G76 entries in its lathe workbook as examples. CNC Turning Program Walkthrough spells out ordinary moves so the sequence can be read without decoding a cycle.

Machining/CNC

CNC Turning Program Walkthrough

Trace an original facing, outside roughing, chamfering, finishing and cutoff sequence with every block explained.

Read the setup assumptions before the first block

Read the setup assumptions before the first block

Illustrative; check your control's manual. This is a reading example in a common Fanuc-style lathe dialect, not a machine-ready file. Read CNC Program Structure for blocks and modes, CNC Turning Setup and Offsets for offsets, and CNC Turning Spindle and Feed Modes for S and F. The mill simulator in G-code and Toolpaths cannot validate this lathe program.

The invented part is 20 mm in diameter and 25 mm long, with a 1 mm × 45° front chamfer. The chamfer runs from X18 Z0 to X20 Z−1: the 2 mm diameter change is a 1 mm radial change. Stock is 24 mm diameter with its raw face at Z+0.5. G54 has Z0 at the finished face and X0 on the spindle centreline. Stock and clearance extend beyond Z−28; workholding is farther toward negative Z.

Assume diameter programming and absolute X/Z endpoints; this dialect does not need G90 for absolute moves. T0101 selects station 1 and offset 1: a right-hand OD/facing tool with a 0.4 mm nose radius, suitable for the illustrated cuts. Its imaginary tip and radius are set, and G42 is the correct side for this setup's finish contour. T0202 selects a 2 mm wide cutoff tool and offset 2. Its Z reference is the edge toward positive Z, so Z−25 puts the blade in the interval Z−27 to Z−25. The cutoff tool is capable of the illustrated small travel past centre.

The example assumes X60 Z10 is an already-verified tool-change clearance location for both tools and the turret sweep, and starts there with spindle and coolant off. These coordinates are not a general clearance rule. All speeds, feeds and the 1800 RPM ceiling are teaching values, not material recommendations. Verify the real setup, tool calls, compensation entry/exit, centre crossing and file delimiters using CNC Programming and Prove-Out and the Safety collection.

Face the end, then leave a small allowance on the outside diameter

Face the end, then leave a small allowance on the outside diameter

Every parenthesized comment explains its block. G01 remains active until G00 replaces it; X/Z values here are destinations. Facing travels slightly past the centre to account for the rounded nose. Roughing uses two explicit lengthwise passes rather than a control-specific canned-cycle format.

O2460 (IDENTIFY THIS EXAMPLE PROGRAM)
G18 G21 G40 G80 G99 (XZ PLANE, MM, COMP OFF, CYCLES OFF, MM/REV)
G54 (SELECT THE PRESET PART WORK OFFSET)
T0101 (SELECT OD TOOL 1 WITH OFFSET 1 AT VERIFIED CLEARANCE)
G50 S1800 (SET THE EXAMPLE MAXIMUM SPINDLE RPM)
G97 S600 M03 (FIXED 600 RPM, START SPINDLE IN SETUP DIRECTION)
G00 X26.0 (APPROACH OUTSIDE THE 24 MM STOCK AT Z10)
G00 Z0.0 (MOVE TO FINISHED FACE PLANE WHILE OUTSIDE STOCK)
M08 (TURN ON THE ASSUMED FLOOD COOLANT SYSTEM)
G96 S90 (SELECT 90 M/MIN CSS WITH THE RPM CEILING ACTIVE)
G01 X-0.8 F0.10 (FACE THROUGH CENTRE: 0.4 MM RADIAL OVERTRAVEL)
G00 Z2.0 (RETRACT AXIALLY BEYOND THE FACED END)
G00 X22.0 (POSITION FOR THE FIRST OD ROUGHING PASS IN AIR)
G01 Z-28.0 F0.20 (ROUGH LENGTHWISE TO 22 MM DIAMETER)
G00 X26.0 (RETRACT RADIALLY OUTSIDE THE ORIGINAL STOCK)
G00 Z2.0 (RETURN TO THE FRONT AT CLEAR X)
G00 X20.6 (POSITION FOR THE SECOND OD ROUGHING PASS)
G01 Z-28.0 F0.20 (LEAVE 0.6 MM ON DIAMETER FOR FINISHING)
G00 X26.0 (RETRACT OUTSIDE STOCK AGAIN)
G00 Z2.0 (RETURN AHEAD OF THE FACE FOR FINISHING)

Supporting detail: Addendum 8 — Check roughing depth and remaining material.

Compensate the chamfer and finish, then cut off at fixed RPM

Compensate the chamfer and finish, then cut off at fixed RPM

The finish contour uses the same tool at a smaller feed. Nose compensation is active for the chamfer and OD; it is entered ahead of the face and cancelled after departing the finished contour. See CNC Turning Profiles and Cycles for why a sharp-point assumption would give the wrong chamfer.

G00 X16.0 (POSITION AHEAD OF THE FACE FOR THE COMPENSATED ENTRY)
G01 G42 X18.0 Z0.0 F0.10 (ENGAGE RIGHT COMP ON THE FACE APPROACH)
G01 X20.0 Z-1.0 (CUT THE 1 MM RADIAL BY 1 MM AXIAL CHAMFER)
G01 Z-26.0 (FINISH THE 20 MM OD PAST THE CUTOFF FACE)
G01 X22.0 Z-27.0 (FEED OUT FROM THE OD BEHIND THE FINISHED PART)
G01 G40 X26.0 (CANCEL COMPENSATION ON THE OUTWARD DEPARTURE)
G97 S600 (CANCEL CSS AND REQUEST FIXED 600 RPM)
G00 X60.0 (RETRACT RADIALLY TO THE ASSUMED CLEARANCE X)
G00 Z10.0 (RETURN AXIALLY TO THE VERIFIED TOOL-CHANGE LOCATION)
M09 (COOLANT OFF)
M05 (STOP THE SPINDLE BEFORE THE TOOL CHANGE)
T0202 (SELECT CUTOFF TOOL 2 AND ITS EDGE-REFERENCED OFFSET 2)
G97 S500 M03 (START AT FIXED 500 RPM FOR THIS CUTOFF EXAMPLE)
G00 X26.0 (POSITION OUTSIDE THE STOCK WITH THE NEW TOOL)
G00 Z-25.0 (LOCATE THE POSITIVE-Z BLADE EDGE AT THE REAR FACE)
M08 (COOLANT ON)
G01 X-0.2 F0.05 (PART OFF WITH THE ASSUMED 0.1 MM RADIAL OVERTRAVEL)
G00 X60.0 (WITHDRAW RADIALLY FROM THE CUTOFF SLOT)
G00 Z10.0 (RETURN TO THE ASSUMED CLEARANCE Z)
M09 (COOLANT OFF)
M05 (SPINDLE STOP)
M30 (END AND RESET THE PROGRAM; NO RETURN MOVE IS IMPLIED)

File-start/end percent delimiters, tool-call behavior and supported startup codes must be supplied or adapted as required by the target control. No bar-feeder or parts-catcher sequence is implied.

Trace the modal state and finished dimensions on paper; Checklist; Practice

Trace the modal state and finished dimensions on paper

  • Mark where S means RPM and where it means metres per minute; locate the preceding RPM clamp.
  • Confirm that every F value is interpreted in mm/rev under G99.
  • Calculate the radial depth of each OD pass and the two chamfer endpoints.
  • Locate the nose-compensation entry and departure, and identify the selected offset register.
  • Check that the cutoff blade's positive-Z edge leaves the intended 25 mm length.

The syntax conventions can be compared with the Haas lathe programming reference. This original example is not copied from a manufacturer program. A paper trace establishes intended geometry and modal state; actual prove-out still follows CNC Programming and Prove-Out.

Spot a feed-mode error

Supporting detail

Addendum

Additional evidence, standards context, and background referenced from the main text.

  1. Addendum 3. Calculate where a speed ceiling starts to matter

    With 90 m/min and a ceiling of 1800 RPM, the crossover diameter is 90 × 1000 / (π × 1800) = 15.92 mm. At 10 mm, unrestricted CSS would request 2865 RPM, so the simplified steady-state result is 1800 RPM. Acceleration and other machine limits can reduce actual speed further. See Haas's spindle-speed commands workbook for its G50/G96/G97 implementation.

    Back to reference 3

  2. Addendum 5. Why a good diameter measurement does not prove a taper is correct

    The two axis touch-offs locate tangent lines, not every possible contact point on the nose. The normal to an angled surface points in another direction, so its tangency requires another offset. Haas's tool nose compensation discussion describes the resulting undercut or overcut on tapered and curved profiles.

    Back to reference 5

  3. Addendum 8. Check roughing depth and remaining material

    The first pass changes diameter from 24 to 22 mm, a 1 mm radial cut. The second changes 22 to 20.6 mm, a 0.7 mm radial cut. Finishing from 20.6 to 20 removes 0.3 mm radially. Extending the OD cuts beyond Z−25 leaves room for the cutoff blade and places the finishing departure on material that will not belong to the finished part.

    Back to reference 8