Skip to content

Solutions/CNC programming

CNC programming with AI

How a 3D model becomes a program a machine can run, where the programmer’s time goes, and which parts of the work software can sensibly draft for review.

10 min readAI CAM

Why programming is the bottleneck

A CNC machine cuts exactly what its program tells it to. Before the first chip, someone decides how the part will be held, which tools will cut it, in what order, how fast and along which paths. That person is the CNC programmer. The program is the result: toolpaths, the routes the tools follow, and machine instructions, built in CAM (computer-aided manufacturing) software and translated into the code one particular machine reads.

A repeat part is programmed once. A new part starts from nothing, and a housing with features on several faces, tight tolerances and awkward details takes far longer than a plain plate: every feature needs a decision, checked against the tools and machines the shop has.

Good programmers are scarce, and they are usually a shop’s most experienced machinists. Their day is split between new programs, proving programs at the machine, problems on the floor and questions from estimators. When programming queues, machines and orders wait.

Quoting hits the same constraint. The price of a machined part depends heavily on its cycle time, the time a machine spends making one part. The reliable way to know it is to program the part, and few shops can program every part they quote when many quotes never become orders. So estimators work from experience and similar jobs. A low guess loses money on every part in the batch. A high guess loses the order.

From model to program

A program starts from the customer’s 3D model, usually a STEP file, and the drawing that carries tolerances, surface finishes and notes. The programmer then works through a chain of decisions, each constraining the next.

Orientation and setups

A setup is one way of holding the part on the machine; everything the tools can reach from that position is cut before the part is moved. On a 3-axis machine the tool approaches only from above, so each face with features needs a setup that turns it upwards, or a 3+2 machine, which tilts the part to a fixed angle and then cuts with three axes. Fewer setups mean less handling and fewer chances to lose accuracy. Each setup has a datum, the reference point the machine measures every position from.

Workholding and stock

Workholding is whatever grips the part: a machine vice, soft jaws (vice jaws machined to the shape of one part) or a dedicated fixture. It must resist the cutting forces without distorting the part and leave room for the tools. Stock, the raw plate or bar, is sawn a few millimetres oversize. A common approach grips the extra under the part in a vice for the first setup, then flips the part into soft jaws and faces the extra away.

Setup 1Top side
150 mm vice, 5 mm grip

Face, rough and finish the top, drill and tap the holes, chamfer the edges. Cut the profile 1 mm below the part.

Setup 2Bottom side
Soft jaws cut to the profile

Face off the grip stock to a 20.0 mm thickness and chamfer the bottom edges.

Two setups for the aluminium housing used throughout this article, cut from 104 × 74 × 28 mm stock. Dashed outlines show stock, blue lines the surfaces machined in each setup, and G54 the datum each setup measures from.

Features and tools

The programmer reads the model as features. A pocket is a recess cut into a face, a boss a raised feature, a slot a narrow pocket often open at one end or both. Each feature implies operations and tools: a pocket needs an end mill small enough for its corners, and a tapped hole needs a spot drill, a drill and a tap. Tools come from the shop’s library, the cutters and holders it owns, with their diameters, lengths and limits.

Machinability comes first

Before any toolpath, the useful question is whether the part can be made as drawn with the tools and machines available. A problem found here costs minutes. Found at the machine, it costs scrap, broken tools and a late delivery. Found after the quote, it costs margin.

  • Internal corners tighter than the smallest cutter. A rotating tool leaves its own radius in every internal vertical corner. Anything tighter needs a smaller tool, EDM (spark erosion) or a change to the drawing.
  • Deep, narrow pockets. Beyond about three to four diameters of reach, an end mill deflects and chatters, so feeds fall and long-reach tools are needed.
  • Thin walls. They vibrate and spring under cutting forces, and need lighter cuts and a careful order of operations.
  • Undercuts. A 3-axis machine reaches only what it can see from above. Features under an overhang need a special cutter, another setup or a five-axis machine.
  • Missing or awkward stock. A model without stock, or a part too big for the machine’s travels or the vice, needs a decision first.
  • Tolerances beyond the process. A close-fit bore may need a reamer or boring head the shop does not own.
PartØ6 end millLeft behind
Pocket corners are R2

The smallest end mill in the library is Ø6, radius 3 mm. It leaves up to 0.41 mm of material in each corner.

Options
  1. 1Ask the customer whether R3.5 corners are acceptable.
  2. 2Add a Ø3 end mill. At 15 mm deep it works at five diameters, so it cuts slowly.
  3. 3Leave the corners for EDM, priced as a separate operation.
A 15 mm deep pocket drawn with R2 corners, checked against a library whose smallest end mill is Ø6. The tool cannot cut a corner tighter than its own 3 mm radius.

Each finding changes the job: an extra tool, an extra setup, a slower operation or a question for the customer. Caught while quoting, it can be priced in or settled before the order is placed.

Strategies, and why order matters

A strategy is a pattern of tool movement for one kind of cut. Most milled parts follow the same sequence: remove the bulk, clear what the big tool left, cut the final surfaces, then make holes and edges.

  1. Facing cuts the top of the stock flat, giving a clean surface to measure from.
  2. Roughing removes most of the material, leaving an allowance of a few tenths of a millimetre for finishing.
  3. Rest machining sends a smaller tool only where the roughing tool could not reach, such as tight corners.
  4. Finishing cuts walls and floors to size with light, even cuts for accuracy and surface finish.
  5. Drilling and tapping use canned cycles, preset machine routines for spot drilling, peck drilling and tapping.
  6. Chamfering breaks sharp edges with a chamfer mill.

Adaptive clearing is the usual roughing strategy on modern machines. Its toolpath keeps the tool’s engagement with the material roughly constant, pairing a small stepover, the sideways distance between neighbouring passes, with a large stepdown, the depth of each pass, often most of the flute length, the cutting length of the tool. Conventional offset pocketing uses wide stepovers and shallow stepdowns, and the load spikes wherever the tool wraps into a corner. Steady load lets the tool run faster, spreads wear along the whole flute and carries heat away in the chips.

Pocket64 × 40 × 15 mm, R4 cornersSetup 1
Adaptive rough, T2 Ø10Left for rest machining, T3 Ø6Finish pass, T3 Ø6
The three passes in the housing’s pocket. The Ø10 roughing tool cannot follow the R4 corners, so a Ø6 tool clears them before finishing. Loop spacing is enlarged for clarity.

Order matters. Holes drilled before facing change depth when the face is cut. Walls finished before nearby roughing is complete get marked by later cuts. Thin walls are finished in alternating steps, so uncut material supports each pass. And because every tool change costs time, programmers group operations by tool wherever the part allows.

Feeds and speeds

Every operation needs a spindle speed and a feed rate. Both start from the tool and the material.

  • Surface speed (Vc) is the speed of the cutting edge through the material, in metres per minute. Tool makers publish ranges for each material and coating. Aluminium tolerates high surface speeds; titanium and hardened steel need low ones.
  • Chip load (fz), or feed per tooth, is how far the tool advances each time one cutting edge passes, in millimetres. Too little and the edge rubs and heats up. Too much and it chips or breaks.

Two formulas turn these into machine settings. Spindle speed in rpm is Vc × 1000 ÷ (π × D), where D is the tool diameter in millimetres. Feed rate in mm/min is rpm × z × fz, where z is the number of flutes.

The machine then sets limits: maximum spindle speed, spindle power and rigidity, which depends on the machine’s build, the tool holder and the stick-out, the length the tool protrudes from the holder. The setup adds its own: a part gripped by 5 mm of stock cannot take the forces a solid fixture can.

The worked example is a Ø10 three-flute carbide end mill, adaptive roughing 6061 aluminium on a machine whose spindle tops out at 10,000 rpm.

StepWorkingResult
Surface speed, chosenCarbide in 6061400 m/min
Spindle speed, calculated400 × 1000 ÷ (π × 10)12,732 rpm
Spindle speed, programmedMachine maximum10,000 rpm
Surface speed, actualπ × 10 × 10,000 ÷ 1000314 m/min
Chip thickness, targetChosen0.05 mm
Radial engagement10% of diameter1.0 mm
Chip-thinning factor2 × √(0.1 × 0.9)0.60
Chip load0.05 ÷ 0.600.083 mm
Feed rate10,000 × 3 × 0.08332,500 mm/min
Illustrative starting values for this worked example. Take real values from your tool maker’s data and prove them on your own machine.

The calculated 12,732 rpm exceeds the spindle, so the program runs at 10,000 rpm and the actual surface speed falls to 314 m/min. The later rows matter for adaptive clearing: when a tool engages less than half its diameter, each tooth cuts a chip thinner than the chip load: at 10% engagement, 60% as thick. Holding a 0.05 mm chip means a chip load of 0.083 mm and a feed of 2,500 mm/min instead of 1,500. Without that correction the tool rubs, runs hot and wears quickly.

Power is the last check. Metal removal rate is radial engagement × stepdown × feed: at a 15 mm stepdown, 1.0 × 15 × 2,500 ÷ 1000 = 37.5 cm³/min, well within the power of most machining centres in aluminium. Rigidity resists a formula. Programmers learn which machine, holder and stick-out will chatter, and carry conservative numbers in their heads.

Cycle time you can quote from

Cycle time has four parts:

  • Cutting time: each toolpath’s length at its programmed feed.
  • Rapids: fast moves between cuts, including approach and retract.
  • Tool changes: the machine’s chip-to-chip time, from one tool leaving the cut to the next cutting, for each change.
  • Handling: loading, flipping and unloading the part.

Setup time is counted separately. Fitting the vice and jaws, loading tools, setting offsets and proving the first part happen once per batch, and their cost is shared across it.

The table sums the housing from the figures above: 6061 aluminium, 100 × 70 × 20 mm, two setups.

OperationToolTime, min:s
Face topT1 · Ø50 face mill0:40
Adaptive rough, pocket and profileT2 · Ø10 end mill3:10
Rest rough cornersT3 · Ø6 end mill0:50
Finish walls and floorsT3 · Ø6 end mill1:25
Spot, drill and tap 4 × M6T4 to T6 · 3 tools1:05
Chamfer top edgesT7 · chamfer mill0:25
Face bottom to thicknessT1 · Ø50 face mill0:40
Chamfer bottom edgesT7 · chamfer mill0:20
Rapids, approach and retractAll tools0:45
Tool changes9 × 6 s0:54
Load, flip and unloadOperator1:00
Cycle time per part7 tools, 2 setups11:14
Illustrative cycle time for the example housing. Cutting takes 8 min 35 s; rapids, tool changes and handling take 2 min 39 s.

A machine rate is the hourly cost of running a machine: depreciation, power, space, maintenance and usually the operator. At an illustrative $90 an hour, a minute costs $1.50, so this housing costs $16.85 to machine. A 1.5-hour setup over a batch of 50 adds $2.70 a part. Material, finishing, inspection, overheads and margin come on top.

Guess 8 minutes for this part and the machining line falls to $12.00, $4.85 short on every part in the batch.

A cycle time taken from toolpaths is still an estimate. Machines slow down on short moves and tight curves, and controllers differ, so estimates are worth checking against the run times machines record. In CAS Quotation, machining time from the program becomes the machining line of the quote, priced at your own machine rates.

What stays with the programmer

Software can take on much of the routine work: recognising features, matching tools to them, generating toolpaths, calculating feeds and speeds and summing cycle times. Judgement stays with the programmer: how this part will behave on this machine, which surfaces the customer cares about, where a thin wall will ring or a part will move, and what the operator needs on the setup sheet.

The last step is posting. A post-processor is a translator written for one machine and controller: it turns toolpaths into the G-code dialect that machine reads, with its conventions for tool changes, coolant and safe moves. Programmers keep the post-processors they already trust.

Much of a good programmer’s value is shop knowledge held in their head. Written down as rules, it applies to every part, including those programmed while that person is on holiday.

  • Preferred tools: rough aluminium with the Ø10 three-flute carbide end mill.
  • Workholding: second operations over 20 parts go in the soft jaws on vice 2.
  • Conservative limits: on the older machine, run long-reach tools at 70% of the calculated feed.

When a programmer corrects a proposal for the same reason twice, that reason belongs in a rule.

How CAS approaches it

AI CAM is our software for this work, and it is in early access. It runs inside the CAM system you already use, such as Autodesk Fusion, Mastercam, Siemens NX CAM, SolidCAM or hyperMILL. Your CAM system still calculates, simulates and posts every toolpath; AI CAM drafts the decisions in this article and writes them into your CAM file as native operations.

  • Machinability first. Open the model in your CAM system and add its drawing. AI CAM checks both against your tools, machines and workholding and pins each finding to its feature.
  • Setups and operations from your shop. It plans setups for 3-axis and 3+2 milling in your vices, soft jaws and fixtures, and chooses strategies and tools from your library.
  • Feeds and speeds within your machines’ limits. Surface speed and chip load come from the material and the tool, held within each machine’s spindle speed, power and rigidity. Every value is shown on its operation.
  • Your shop’s rules. Preferred tools, workholding and conservative limits are written once and applied to every proposal.
  • Cycle times per operation and per part, which flow into CAS Quotation.
  • Native operations for review. Setups and operations appear in your CAM tree like any others. Your programmer checks them, edits what they want and posts with your own post-processor. A setup sheet gives the operator the workholding, datum, tools and drawing notes.

The aim is a sound first draft for every part, so programmers spend their time on the decisions that need them and estimators price from a program instead of a guess.

To try it on your own models, machines and tools, request early access from the AI CAM page.

FAQ

What is the difference between 3+2 and five-axis machining?

A 3+2 machine uses its two rotary axes to tilt the part to a fixed angle, locks them, then cuts with the three linear axes. It reaches several faces in one setup, often with shorter and stiffer tools. Simultaneous five-axis machining moves all five axes during the cut, which continuous curved surfaces such as impeller blades need.

Why does adaptive clearing run at a higher feed than conventional pocketing?

At low radial engagement each tooth cuts a chip thinner than the chip load. Raising the feed restores the target chip thickness, so the edge cuts cleanly instead of rubbing. The constant engagement also keeps the load steady, which lets the tool take a deep stepdown along most of its flute length.

How accurate is a cycle time taken from toolpaths?

It is an estimate. Cutting time follows from toolpath length and programmed feed, but machines slow down on short moves and tight curves, and controllers differ. Compare estimates with the run times your machines record, and adjust the machine figures where they differ.

Do AI-generated toolpaths need a different post-processor?

Toolpaths are posted like any other program, through the post-processor written for the machine and its controller. With AI CAM, your programmer reviews the toolpaths in your CAM system and posts them with the post-processors you already use.

Can software program a part without a programmer?

Software can draft the routine work: recognising features, choosing tools, generating toolpaths, calculating feeds and speeds and summing cycle times. The programmer decides how the part will behave on the machine, which surfaces matter to the customer and what runs. Treat every generated program as a draft for review.