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

Get Instant Quote

CNC Basics

How Do CNC Machines Work?

A CNC machine reads a program and moves a cutting tool along a defined path, correcting its own position thousands of times per second. This page explains that chain end to end: code, controller, drives, spindle, fixturing and inspection. Engineers and buyers can use it to judge what a machine can hold, where errors come from, and what to check before releasing a job.

±0.005 mm tolerance16 five-axis centers127 CNC machines3–5 day shipping
How Do CNC Machines Work?
Quick answers

Key takeaways

The machine does not thinkIt follows coordinates and feed rates written by a CAM programmer. No program, no motion.
Accuracy comes from feedbackEncoders on each axis report position back to the controller, which corrects error on the fly.
Rigidity sets the limitA light finishing pass holds ±0.005 mm. A heavy roughing pass in the same setup may not.
Setup decides the first partWork offset, tool length and fixture clamp position matter more than spindle speed for part one.
Inspection closes the loopA machine only proves itself when the first article is measured and the offsets are trimmed.
The chain of control

How do CNC machines work: the control loop explained

A CNC machine is a machine tool with motors that obey numbers. A CAM system turns a 3D model into G-code. The controller reads that code line by line and converts it into position commands for each axis. Servo drives push the ball screws, and the spindle turns the tool. When the tool touches the stock, it removes material along the programmed path.

The key difference from a manual mill is the feedback loop. A rotary encoder on each axis reports actual position several thousand times per second. The controller compares that number to the commanded position and adjusts motor current before the error becomes visible in the cut. This is why a CNC can repeat a 0.5 mm deep pass across 200 identical parts without drifting.

That loop has limits. Backlash in a worn ball screw, thermal growth in a spindle after two hours of running, or a loose vise jaw will all show up in the part. The controller corrects what the encoder sees, not what the workpiece does. Everything between the encoder and the cutting edge is your responsibility as the process planner.

One common misconception: CNC is not fully autonomous. Someone still chooses the tool, sets the work offset, proves the first part and watches for chatter, chip packing and tool wear. The machine handles motion. The operator and programmer handle judgment.

  • 1
    G-codeCoordinates, feed rate and tool calls. A line such as G01 X10 Y20 F100 moves the tool linearly to X10 Y20 at 100 mm/min.
  • 2
    ControllerInterprets the code, runs look-ahead, and manages acceleration so corners do not overshoot.
  • 3
    Servo and encoderClosed-loop pair that moves the axis and reports its real position back.
  • 4
    Spindle and toolTurns the cutter at the programmed rpm. Tool runout here becomes size error in the part.
Axes and machine types

How 3-axis, 4-axis and 5-axis motion differ

A 3-axis machine moves the tool in X, Y and Z only. The part stays in one orientation. This covers most prismatic work: plates, housings, brackets and pockets reachable from one direction. Setup is simple and the machine is stiff, which helps when you need tight tolerances on flat features.

A 4-axis machine adds a rotary table, usually turning around the X or Y axis. Now you can machine four sides of a part in one setup, index to a new face, and hold position between faces. This removes the re-clamping error that creeps in when you flip a part by hand. A Ø400 mm rotary table is a typical size for mid-size work.

A 5-axis machine adds a second rotary axis, so the tool can approach the part from almost any angle. The payoff is not just reach. Short, rigid tools can machine deep pockets and contoured surfaces that a long 3-axis tool would have to reach with chatter. Simultaneous 5-axis motion also lets the tool stay normal to a curved surface, which improves finish on aerospace and medical geometry.

Five-axis is not always the right answer. Simple 2.5D parts with a few holes run faster and cheaper on a 3-axis machine. The rule we use: if a part needs more than three setups, or has features that a straight tool cannot reach without a long overhang, move it to 4-axis or 5-axis.

  • 1
    3-axisBest for flat plates, single-side pockets, and parts with one dominant machining direction.
  • 2
    4-axisBest for shafts, cylinders and parts with features on four sides that must stay in relation.
  • 3
    5-axisBest for contoured surfaces, deep cavities, and parts that would otherwise need four or more setups.
Process planning

From CAD model to first article: what happens in between

The route from model to part has five links: CAD, CAM, setup, cutting and inspection. Break any one and the rest do not save you. A perfect program on a machine with a dirty chuck will still produce scrap.

In CAM, the programmer picks toolpaths, stepover, stepdown and feed rates. For aluminum 6061 on a 12 mm carbide end mill, a typical roughing stepdown is 2–4 mm with a 45–60% stepover. For 316 stainless the same tool might run 0.5–1.5 mm stepdown at half the feed. These are starting points, not laws. The machine, the holder and the coolant all shift the window.

Setup is where most first-part errors are born. The work offset tells the controller where the part sits. Tool length offsets tell it how long each tool is. If a tool length is off by 0.05 mm, every Z depth on that tool is off by the same amount. We probe tools and set offsets before the first cut, then verify with a test feature rather than trusting the numbers alone.

Cutting is where the theory meets chips. Listen for chatter, watch the chip color and shape, and check the load meter. Blue chips in steel usually mean the surface speed is too high or the feed is too low. Stringy chips in aluminum mean the chip load per tooth is too light.

Inspection closes the loop. Measure the first article, compare to the drawing, and trim the offsets. Only then run the batch. This is why a 100% inspection routine exists before shipment: catching a drift at part one is cheap, catching it at part 500 is not.

Tolerance and finish

What determines accuracy and surface finish

Accuracy is a stack of small errors. Machine geometry, ball screw condition, thermal growth, tool runout, holder taper wear, fixture rigidity and material springback all add up. The controller can only correct the axis position, not the cutting force pushing the tool away from the part.

For most metal parts we hold ±0.005 mm on critical features and Ra 0.8–1.6 μm on machined surfaces. Where the drawing allows, an as-machined finish of Ra 1.6–3.2 μm is a cost-effective choice. Reaching Ra 0.2–0.8 μm usually means a separate finishing pass with a smaller stepover and a fresh tool, which adds cycle time.

Material matters as much as the machine. Aluminum 6061 cuts freely and holds size well. Stainless 316 work-hardens, so a dwell or a too-light pass will rub instead of cut and push the surface finish the wrong way. Titanium Ti-6Al-4V needs lower surface speed and more coolant. Inconel demands rigid setups and patience.

The practical rule: match the process to the tightest real requirement. If only one bore needs ±0.005 mm, do not machine the whole part to that band. Rough everything, then finish the critical feature last with a sharp tool and a short overhang.

  • 1
    Machine conditionWorn ball screws and loose guideways show up as size drift over a long run.
  • 2
    Thermal growthA spindle warming up can move the tool 0.01–0.02 mm over the first hour. Warm up before finishing.
  • 3
    Tool and holderRunout of 0.01 mm on a 6 mm cutter changes the effective cutting diameter and the finish.
  • 4
    FixturingA part that moves 0.02 mm under cutting load will not hold tolerance no matter how good the program is.
Operator sequence

Step by step: setting up and running a CNC job

  • 1
    1. Read the drawing and confirm datumIdentify the datum surfaces, the tightest tolerance and the critical features. Decide which face gets machined first. If the drawing calls ±0.005 mm, note which features carry that callout, because not every dimension needs it.
  • 2
    2. Mount and indicate the workholdingClamp the vise or fixture, then indicate it to within 0.01 mm before loading the part. A vise that is 0.03 mm out of square will tilt every part you cut in it. Clean the jaws and the table first.
  • 3
    3. Set work offset and tool lengthsTouch off X, Y and Z, or use a probe if the machine has one. Set each tool length offset and verify with a gauge block or a test cut. Record the numbers so a shift change can repeat them.
  • 4
    4. Dry run the programRun with the spindle off and the tool clear of the stock, or use the machine's graphic simulation. Watch for rapid moves that pass through the part and for tool changes that collide with the fixture.
  • 5
    5. Cut the first article on a conservative passStart at 70–80% of the calculated feed and speed. Take a light finishing pass on the critical surfaces first, measure, then adjust offsets. Do not chase the final size with a heavy cut.
  • 6
    6. Measure and trim offsetsCheck the critical features. If a pocket is 0.02 mm oversize, adjust the cutter compensation, not the drawing. Re-cut the test feature and confirm before releasing the batch.
  • 7
    7. Run the batch with in-process checksCheck the first part, then every 20–50 parts depending on tool wear rate. Replace or re-measure the tool when the size drifts beyond half the tolerance band. Log the readings.
  • 8
    8. Final inspection and documentationInspect 100% of the parts against the drawing before shipment. Record the results and keep the inspection report with the job. Raw material check and in-process monitoring are part of the same record.
Selection guide

When to use which machine and setup

Use this table to decide the machine type and the cutting approach for a given part and tolerance.

Part or conditionMachine choiceTypical parameterWhat to watch
Flat plate, one face3-axis millFeed 800–2,000 mm/min in 6061Vise flatness
Shaft with four sides4-axis with rotaryIndex 90° per faceRotary backlash
Deep contoured pocket5-axis simultaneousShort 8–12 mm toolTool holder clearance
±0.005 mm bore3-axis or 4-axis, finish passCutter comp 0.01 mm stepsSpindle thermal drift
Ra 0.2–0.8 μm finishAny axis, slow finish pass0.1–0.3 mm stepoverTool wear
One prototype3-axis, manual setupConservative speedsSetup cost vs part cost
10,000+ partsDedicated fixture, 4 or 5-axisOptimized stepdownCycle time and tool life
Thin wall under 1 mm3-axis with supportLight radial engagementDeflection and chatter

The short version

A CNC machine is only as good as the program, the setup and the inspection behind it. If you have a part that needs ±0.005 mm, send the drawing and we will tell you which machine and which setup it belongs on.

FAQs

Frequently asked questions

Do CNC machines need an operator?

Yes. A CNC machine follows a program, but an operator loads the part, sets offsets, proves the first article and watches for tool wear, chatter and chip buildup.

Lights-out running is possible for proven jobs with good chip evacuation and tool-life monitoring, but someone still checks the parts and replaces tools.

What is G-code and do I need to write it?

G-code is the list of coordinates, feed rates and tool calls the controller executes. CAM software generates most of it from a 3D model.

A programmer still chooses the toolpaths, cutting parameters and order of operations. The code is the output of those decisions, not a replacement for them.

How tight a tolerance can a CNC machine hold?

On a rigid setup with a sharp tool and a warm machine, ±0.005 mm is achievable on critical features. We hold that as a standard capability.

The whole part does not need to be that tight. Wider bands on non-critical features keep cycle time and cost down.

Why does the first part sometimes fail?

Most first-part failures come from setup, not the program. A work offset typed wrong, a tool length that is 0.05 mm off, or a vise jaw that is not square will all show up in the cut.

Dry running the program and cutting a test feature before the real part catches nearly all of these errors.

When should a part move from 3-axis to 5-axis?

Move it when the part needs more than three setups, when a straight tool cannot reach a feature without long overhang, or when a contoured surface needs the tool held normal to the surface.

If the part has one dominant machining direction and simple features, 3-axis is faster and cheaper.

How does material choice change the cutting parameters?

Aluminum 6061 runs at high surface speed and heavy feed. Stainless 316 needs lower speed and a steady feed to avoid work hardening. Titanium and Inconel need lower speeds again and more coolant.

The machine stays the same. The tool, speed, feed and depth of cut change with the material.

Send your drawing, get a DFM review

Upload your CAD file and we will return a quotation and a free DFM analysis within 12 hours. Prototypes and production runs both welcome.

12-hour quoteNo minimum orderNDA on request100% inspection

Follow our shop

More from GreatLight

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