Module 9 · Manufacturing

CNC machining

Computer numerical control — axes, G-code, offsets, speeds and feeds, and how a program becomes a part.

Notes
On this page
  1. The idea
  2. Everyday intuition
  3. How it works
  4. Key formulas
  5. Worked example
  6. Where it is used
  7. Common misconceptions
  8. Self-check

The idea

A machine is a lathe or mill whose axes and spindle are driven by a program. The program, usually written in (often generated by CAM software), lists moves, speeds and feeds. tell the machine where the part sits, so the same program makes identical parts, all day, with little operator skill at the machine.

Everyday intuition

A piano roll or a music box: the tune is stored, and the machine plays it the same way every time. Change the roll and you get a different tune — or a different part.

How it works

  1. Axes. Right-handed X, Y, Z (Z along the spindle); 4- and 5-axis machines add rotations (A, B, C) to reach more faces in one set-up.
  2. Drives and feedback. Servo motors turn ball screws; encoders or linear scales report position to the controller in a closed loop.
  3. G-code words. G00 rapid move, G01 straight cut, G02/G03 arcs, G90 absolute, G54 work offset; S spindle speed, F feed rate, T tool, M03 spindle on, M08 coolant on.
  4. Speeds and feeds. N = 1000v/(πD) and v_f = f_z z N, using the cutter maker’s v and chip load f_z.
  5. Offsets. Work offsets locate the part’s datum; tool-length and radius offsets let the same program use tools of different sizes.
  6. Workflow. CAD model → CAM toolpaths → post-processor → G-code → dry run and first-part inspection → production.
spindle X Y Z part zero

The program's zero is set on the part with a work offset.

Axes of a vertical milling machine. Tap the axes and the part zero. CNC machine axes. Original diagram drawn for this site. Tap labelled parts for an explanation.
CNC machine axes

Key formulas

Milling — spindle speed and feed rate:

N=1000 vπDvf=fz z NN = \dfrac{1000\,v}{\pi D} \qquad v_f = f_z\,z\,N
vv
cutting speed m/min
DD
cutter diameter mm
fzf_z
feed per tooth mm
zz
number of teeth none
vfv_f
table feed rate mm/min

Worked example

Where it is used

  • Aerospace brackets and frames: 5-axis milling from solid.
  • Mould and die making: complex 3D surfaces cut by CNC.
  • Car parts in volume: CNC machining centres in automated cells.
  • Prototype and small-batch parts: quick turnaround from a CAD file.

Common misconceptions

Self-check

Check Which G-code word sets the feed rate and which sets the spindle speed?

Show answer

F sets the feed rate; S sets the spindle speed.

Check What does a work offset such as G54 store?

Show answer

The position of the part’s origin on the machine, so programs can work from the part’s datum.

Check A 10 mm cutter is to run at 100 m/min. What spindle speed is that?

Show answer

N = 1000 × 100/(π × 10) ≈ 3180 rpm.

My notes

Private to this browser. Select any text above to highlight it.

↑ ↓ move Enter open Esc close