KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesCNC Numerical Control ProgrammingEngineering · MechanicalLesson 69/129← PrevNext →
GuidePublished 11 Jul 2026Updated 13 Aug 202611 min readBy Kevin Jogin
On this page

Ask about this page

KEVOS AICNC Numerical Control Programming

KEVOS knowledge first · trusted web sources when needed

Skip to content
KEVOS® Knowledge Library · Engineering → Mechanical Engineering

Engineering / Mechanical Engineering

CNC Numerical Control Programming

A CNC machine follows a written program of coordinates and commands — the same cutting speeds and feeds of the earlier pages, now expressed as numbers a controller obeys. Learn the coordinate system, a handful of codes, and how to turn cutting data into a spindle speed, and the language opens up.

  • Reading time · 6 min
  • 7 sections
  • Spindle speed in code, worked
  • Constant surface speed
X Z G01 linear G02/G03 arc moves are built from straight lines and circular arcs
Doc №KL-ENG-MECH-108
SectionEngineering → Mechanical Engineering
Sheet1 of 1
DrawnKEVOS®
Date2026-07-11

In this reference

  1. A machine that reads
  2. Axes and coordinates
  3. G-codes and M-codes
  4. Speed and feed in the program
  5. Interpolation
  6. Constant surface speed
  7. Quick reference

§1A machine that reads

Computer numerical control replaces the operator’s hands with a program: a list of instructions telling the machine where to move, how fast, and what the spindle and coolant should do. The cutting physics is unchanged — only the control is.

Everything from the earlier pages still holds on a CNC machine — the cutting speed from N = 1000 V/(π D), the feed that sets finish, the depth that sets force — but instead of an operator turning handwheels, a controller reads a program and drives the axes with motors and lead-screws to the numbers it is given. This buys repeatability (every part identical), complex paths (curves and contours no handwheel could trace) and unattended running. The programmer’s job is to express the cut as coordinates and commands: where to go (§2), what to do there (§3), and at what speed and feed (§4). The language is simple in its parts; the skill is stringing them into a safe, correct path.

Contents

§2Axes and coordinates

A CNC machine positions the tool in a coordinate system — named axes with numbers — and those numbers can be given as absolute positions or as steps from where the tool is.

The axes follow a convention: X, Y, Z for the three linear directions (a mill uses all three; a lathe uses X across the diameter and Z along the axis), with rotary axes A, B, C where fitted. Positions are stated one of two ways, and confusing them is a classic error. In absolute mode (G90) every coordinate is measured from one fixed origin — the part zero — so X50 always means the same place. In incremental mode (G91) each coordinate is a step from the current position — X50 means fifty millimetres further on. Absolute is easier to check and recover from and is the usual choice; incremental suits repeated features. A work offset ties the program’s zero to the actual part on the table, so the same program runs wherever the part is clamped. Get the axes and the absolute-or-incremental mode right, and the geometry follows.

Contents

§3G-codes and M-codes

A CNC program is a list of blocks, each built from short codes: G-codes command motion and mode, M-codes command machine functions, and letter-addresses carry the numbers.

The core codes
CodeMeans
G00 / G01rapid move / straight-line cutting move (feed)
G02 / G03clockwise / anticlockwise circular arc
G20 / G21inch / millimetre units
G90 / G91absolute / incremental coordinates
S · F · Tspindle speed (rev/min) · feed · tool number
M03 / M05 · M08 / M09spindle on/off · coolant on/off
A block combines them: G01 X50 Z-20 F0.15 means “cut in a straight line to X50, Z−20 at 0.15 mm/rev.” G-codes set what kind of move and which modes are active (many are “modal” — they stay in force until changed), M-codes switch the spindle, coolant and other functions on and off, and the letter-addresses S, F and T carry the cutting numbers. A whole program is just many such blocks in sequence.
Contents

§4Speed and feed in the program

The S and F values in a program are exactly the spindle speed and feed of the earlier pages — so programming a cut begins with the same cutting-data calculation.

Example 1 — from cutting speed to an S word

To turn a 50 mm diameter at a recommended cutting speed of 120 m/min, the spindle speed is the familiar N = 1000 × 120/(π × 50) = 764 rev/min, so the program carries S764 M03 (spindle on, clockwise, at 764 rev/min). If the finish wants a feed of 0.15 mm/rev, the block adds F0.15. In other words, the programmer does the same speed-and-feed work as the manual machinist — pick the cutting speed for the material and tool, convert to rev/min through the diameter, choose the feed for the finish — and simply writes the results as S and F words. The CNC does not change the cutting data; it only asks for it in numbers. Everything the speeds-and-feeds page taught feeds straight into the program.

Contents

§5Interpolation

A CNC machine builds any path from two primitives — straight lines and circular arcs — moving several axes together so the tool follows the commanded shape. This coordinated motion is interpolation.

Linear interpolation (G01) drives the axes together in the right proportion to cut a straight line to a point at the programmed feed — the workhorse cutting move, in any direction (the hero). Circular interpolation (G02 clockwise, G03 anticlockwise) drives them so the tool sweeps a circular arc of a given radius or centre — how curves, radii and round pockets are cut. Between them, straight lines and arcs can approximate any profile, and a contour is programmed as a chain of G01 and G02/G03 moves. Rapid moves (G00) position the tool quickly between cuts, not for cutting. The controller does the continuous mathematics of coordinating the axes; the programmer supplies the endpoints and, for arcs, the radius or centre. This is why CNC can cut shapes no manual machine could trace by hand — the machine interpolates the path the program only outlines.

Contents

§6Constant surface speed

On a lathe, the cutting speed changes with diameter for a fixed rev/min — so CNC lathes offer a mode that varies the spindle speed automatically to hold the cutting speed constant as the diameter changes.

Example 2 — why the rev/min must change

Cutting speed is N × π D, so at a fixed spindle speed the edge cuts faster on a large diameter than a small one — a problem when facing across to the centre, or turning a stepped part. Constant surface speed (G96) solves it: the programmer commands a cutting speed, and the controller continuously adjusts the rev/min to hold it as the diameter changes. Turning at 120 m/min, the machine runs 764 rev/min at 50 mm diameter but 1528 rev/min at 25 mm — doubling the rev/min as the diameter halves, to keep the surface speed at 120 (recall N = 1000 V/(π D), inversely proportional to D). This keeps the finish and tool load uniform across changing diameters, and is switched back to a fixed rev/min (G97) for operations like drilling on centre or threading, where a steady spindle speed is needed. It is the earlier pages’ speed relationship, now enforced live by the control.

Contents

§7Quick reference

The working core of the page on one card rack.

Coordinates

X Y Z axes · G90 abs / G91 inc

work offset ties to the part

Codes

G00 rapid · G01 line · G02/03 arc

M03/05 spindle · M08/09 coolant

Speed/feed

S = 1000 V/(π D) · F = feed

D50 @ 120 → S764

Interpolation

lines + arcs → any profile

CSS (G96)

holds V as dia changes

764 → 1528 rpm (50→25 mm)

Contents

Handbook application: from concept to controlled practice

Purpose. This expanded section turns the original page into a practical handbook. It preserves the supplied material and adds a repeatable way to apply, check and review CNC Numerical Control Programming. It does not replace a contract, legislation, a controlled standard, competent engineering judgement or specialist advice.

The operating aim is to carry the subject from function and assumptions through design evidence, verification and controlled release. Read the original explanation first, then use the workflow and checks below to convert knowledge into evidence.

Apply CNC Numerical Control Programming by beginning with the duty, not the component or software command. Convert the key ideas—speed, numerical, control, programming, axes—into measurable requirements and interfaces. Record operating and non-operating environments, duty cycle, expected life, loads, energy sources, human interaction and reasonably foreseeable abnormal conditions. When a value is not a project requirement or verified supplier datum, identify it as an assumption or illustrative value.

Create a calculation and evidence trail that another competent person can audit. Every input should carry a source, unit, revision and uncertainty or tolerance where relevant. Every model should state its boundary conditions and limitations. Keep nominal capacity separate from design capacity, and keep verification margin separate from an arbitrary safety factor. If a code or standard governs the work, confirm the applicable edition and contractual status rather than copying a number from a secondary summary.

Design for manufacture, assembly, inspection, operation and maintenance at the same time. A technically valid geometry can still fail because it cannot be fixtured, measured, cleaned, guarded, reached or replaced. Review process capability, datum or reference strategy, tolerance accumulation, access, error-proofing and changeover. Where people interact with plant, apply the hierarchy of controls and consult those who will operate, clean, maintain and recover the equipment.

Plan verification before release. Define the characteristic, method, equipment, sample or test condition, acceptance criterion, record and responsible person. Validation then asks a different question: whether the resulting system is effective and suitable in the intended use context. A passed drawing check or analysis does not by itself validate usability, maintainability or production performance.

Step-by-step operating method

  1. Define the duty. Capture the required function, interfaces, operating environment, life, loads and unacceptable outcomes.
  2. Establish the model. Identify governing principles, units, material or process data, assumptions and uncertainty.
  3. Develop alternatives. Compare feasible concepts against performance, manufacturability, safety, maintainability and cost.
  4. Verify the design. Use analysis, test, inspection or demonstration with acceptance criteria defined before execution.
  5. Release and learn. Baseline the design, control changes, retain evidence and feed operating results into the next revision.

Illustrative design review record

Illustrative values only. Build a one-page record with the required function, input sources, assumptions, governing load or process condition, failure consequences, selected concept, verification method and acceptance criterion. Mark every numerical input as project requirement, verified supplier data, measured value, calculation output or assumption. Review the weakest evidence first. If an assumption can change safety, compliance, interchangeability or capacity, it must be resolved before release rather than buried in a calculation note.

Evidence classQuestionRelease expectation
RequirementWhat must the design do and under which conditions?Approved and traceable
InputWhere did the load, property, tolerance or process limit come from?Source, unit and revision recorded
AnalysisWhich model and assumptions connect input to result?Checkable calculation or simulation
VerificationHow will conformity be demonstrated?Method and acceptance criterion agreed
ValidationWill the solution work for intended users and conditions?Representative use evidence

Common failure modes and recovery actions

1. Watch for

Starting detailed design before interfaces and operating limits are agreed.

Recovery: Return to the governing definition or requirement and restate the decision in one sentence.

2. Watch for

Using catalogue or typical values as though they were certified project inputs.

Recovery: Separate evidence from assumption, assign an owner and set a date for validation.

3. Watch for

Checking nominal performance while ignoring tolerances, degradation and foreseeable misuse.

Recovery: Run a small counterexample, boundary test, pilot or independent check before proceeding.

4. Watch for

Confusing verification of requirements with validation of user need.

Recovery: Record the consequence, decision and rationale, then update the controlled baseline.

5. Watch for

Releasing drawings or procedures without configuration, inspection and change controls.

Recovery: Escalate when the issue affects safety, compliance, acceptance, material value or an agreed tolerance.

Review checklist

  • What function and failure consequence govern this decision?
  • Which inputs are measured, specified, assumed or illustrative?
  • How will conformity be demonstrated and recorded?
  • What change would invalidate the current evidence?
  • Are mandatory requirements distinguished from recommendations and illustrative values?
  • Are sources, assumptions, units, dates and versions recorded closely enough to reproduce the decision?
  • Have safety, legal, ethical, stakeholder and operational consequences been considered at the appropriate level?
  • Is there a named owner and a trigger for review, escalation, change or retirement?

Questions for deeper application

What is the most important distinction a practitioner must preserve when applying CNC Numerical Control Programming?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

Which assumption about speed would change the result most if it proved false?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

What evidence would allow an independent reviewer to reproduce or challenge the conclusion?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

Which boundary, exception or failure case has not yet been tested?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

What must be handed over, monitored or reviewed after the immediate work is complete?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

Authoritative references and use notes

The sources below were selected as institutional or primary guidance for the broader practice. They support the handbook method; they do not imply that every statement or clause in a source applies to every project. Confirm the current edition, jurisdiction, contract and application before treating any requirement as mandatory.

  • NIST Manufacturing Extension Partnership — National Institute of Standards and Technology. Used for manufacturing productivity, quality, cost and capability improvement. Accessed 2026-08-13.
  • Identify, assess and control hazards — Safe Work Australia. Used for hazard identification, risk assessment, controls and review. Accessed 2026-08-13.

KEVOS® Knowledge Library · Engineering → Mechanical Engineering · Original KEVOS® synthesis — written, computed and drawn for this page. Built 11 July 2026.

Continue learning

Grinding and Other Abrasive ProcessesGuide · MechanicalNEXT LESSON →Sheet Metal Working and PressesGuide · MechanicalGrinding Feeds and SpeedsGuide · MechanicalElectrical Discharge MachiningGuide · Mechanical
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®