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

Get Instant Quote

Engineering explainer

CNC Drilling Program: How Holes Actually Get Made

A CNC drilling program is a set of coordinates, feeds and depths that turn a drawing's hole callouts into a real part. This page explains what each block of that program controls, how material and depth change the numbers, and when drilling at a machining center beats a drill press. Written for engineers and buyers reviewing a process before release.

±0.005 mm toleranceØ400 mm rotary tableNo minimum order quantity
CNC drilling program setup with a drilling and milling machine
Fundamentals

What a CNC drilling program controls

Every hole in a part needs four decisions before the spindle turns: where the tool goes in X and Y, how fast it feeds down Z, how fast it spins, and how deep it goes. A CNC drilling program is simply those decisions written in G-code and grouped by tool. G81 covers a plain hole. G83 adds a peck cycle, retracting the tool in steps so chips clear instead of packing around the flutes. G84 handles rigid tapping. The choice of cycle, not the coordinate list, decides whether the hole comes out clean.

Position comes from the drawing, but the reference matters. Hole coordinates are usually called from a datum edge or a bore, not from the raw stock corner. If the datum is wrong in the program, every hole shifts by the same amount and the part is scrap. Setup sheets should state the datum, the work offset, and the stock allowance in one place. That single sheet is what a machinist trusts at the machine.

Feed and speed follow the tool and the material. A 6 mm high-speed steel drill in 6061 aluminium runs near 3,000 rpm and 0.15 mm per revolution. The same drill in 4140 steel drops to roughly 800 rpm and 0.08 mm per revolution. Holes deeper than about three times the diameter need either a peck cycle or a through-coolant drill, otherwise chips jam, the drill rubs, and the hole grows oversize.

Depth is where most small programs fail. A blind hole called 10 mm deep must include the drill point. A 118° point adds about 0.3 × diameter of cone below the flat depth, so a 6 mm drill cutting to a 10 mm flat is programmed closer to 11.8 mm. Add clearance for chips and the number moves again. Read the callout on the drawing before you write the Z value.

  • 1
    Drilling cyclesG81, G83 and G84 cover the common hole types
  • 2
    DatumState it once on the setup sheet, not per operation
  • 3
    Peck depthRoughly one diameter per peck in steel
  • 4
    Point allowanceAdd 0.3 × diameter for a 118° drill point
Tooling

Tool choice and hole quality

The drill sets the ceiling on hole quality. A standard twist drill leaves a hole 0.05 to 0.15 mm oversize and rarely holds a tight position, because the point wanders on entry. A spot drill or a stub drill first fixes the start point. For holes that carry a pin or a bolt shank, we spot, drill undersize, then ream to size. Reaming holds ±0.01 mm or better in most steels and aluminium.

Coating changes tool life more than geometry for production runs. TiN and TiAlN coatings let a drill run faster in steel and stainless without burning the edge. Through-coolant drills push chips out of deep holes and let one tool finish a hole that would otherwise need three pecks. In 17-4PH or Inconel, coolant through the tool is often the difference between a stable process and a broken drill.

Carbide drills cut faster and hold size better than high-speed steel, but they are brittle. A slight runout or a hard spot can chip the corner. For a short run in soft material, high-speed steel is cheaper and more forgiving. For thousands of holes in aluminium or cast iron, carbide pays back through cycle time. Pick by run length and material, not by habit.

Hole finish follows the same logic. As-machined drilling lands around Ra 1.6–3.2 μm. A reamed hole reaches Ra 0.8–1.6 μm. If the drawing asks for Ra 0.2–0.8 μm inside a bore, drilling is only a pre-step and the finishing cut belongs to a boring head or a reamer with a controlled feed.

  • 1
    Spot firstStops the drill walking on a curved or angled surface
  • 2
    Ream for fitsHolds ±0.01 mm on pin and dowel holes
  • 3
    Through-coolantBest for depth over 3 × diameter in steel
Materials

How material changes the numbers

Aluminium drills fast and forgiving. 6061 and 7075 both cut cleanly at high spindle speed, but 7075 work-hardens if the feed is too light, so keep the chip load up. Cast aluminium like ADC12 can have porosity that pulls the drill off line. A spot drill and a slightly heavier feed usually fix it. Deep holes in aluminium clear chips well with air blast, no coolant needed.

Steel needs more control. 1018 and 1045 drill predictably with high-speed steel and flood coolant. 4140 and 4340 at higher hardness push you toward carbide or coated tools, lower surface speed, and a peck cycle for anything past two diameters. Work-hardening grades like 17-4PH can harden under a rubbing drill, so a dull tool is worse than no tool. Change the drill before it rubs.

Stainless is where peck drilling earns its keep. 304 and 316 work-harden at the surface, so the drill must cut, not slide. Keep feed per revolution steady, use a sharp coated drill, and peck at about half a diameter in deep holes. 316L behaves similarly. Titanium TC4 and Inconel 718 go further: low surface speed, generous coolant, and a rigid setup. A drill that chatters in Inconel will not last a single hole.

Plastics and composites follow different rules. POM and ABS cut cleanly but melt if the speed is too high. PEEK tolerates more heat but costs more, so tool life matters. Carbon fibre needs carbide and sharp edges to avoid delamination at the exit. In all of these, feed rate controls the finish more than spindle speed.

  • 1
    AluminiumHigh speed, heavy chip load, no peck needed
  • 2
    SteelPeck past two diameters, watch work hardening
  • 3
    StainlessSharp tool, steady feed, half-diameter pecks
  • 4
    CompositesBacking plate at exit stops delamination
Setup

Fixturing, runout and hole position

A perfect CNC drilling program still fails on a loose setup. The vise or fixture must hold the part against the cutting force, which pushes down and sideways. Thin plates bow under a drill unless supported underneath. We use parallels or a dedicated nest for thin parts, and check the setup with an indicator before running the first hole.

Runout is the quiet killer. A drill with 0.03 mm of runout cuts a hole larger than its nominal size and wears on one flute. Check the holder, the collet and the drill shank. A shrink-fit or hydraulic holder holds runout under 0.01 mm. An ER collet is fine if it is clean and torqued correctly. On a five-axis machine, the same rule applies after every tool change.

Position accuracy depends on the machine, the tool and the thermal state. A warm spindle drifts, so long runs need a warm-up cycle. Probing on the machine catches a shifted work offset before the whole batch is cut. For parts with many holes, we drill the critical ones first, measure, then adjust the offset if needed.

On a five-axis machining center, a CNC drilling program can reach holes on five faces in one setup. That removes the re-fixturing error that comes from moving a part between a drill press and a mill. The trade-off is that a five-axis cycle costs more per hour, so it only pays when the part has angled holes or tight true-position callouts.

  • 1
    Support thin platesUse a nest or backing plate under the hole
  • 2
    Check runoutKeep it under 0.01 mm for tight holes
  • 3
    Probe on machineCatches a shifted offset before the batch
Boundaries

Where drilling stops being the right answer

Drilling makes round holes. If the feature is a slot, a pocket or a square opening, a drill is only the entry move, and an end mill does the real work. Writing a drilling cycle for a slot wastes time and leaves a poor floor. Match the tool to the geometry, not to the machine's default list.

Very tight true position is another boundary. A drilled hole typically holds ±0.05 to ±0.1 mm position in a good setup. If the drawing calls for ±0.02 mm between holes, plan to drill undersize and bore or ream. Trying to hold that by tweaking the drilling cycle alone usually fails on the second shift.

Depth-to-diameter ratio sets a hard limit too. Past about 10 × diameter, chip evacuation and drill wander dominate. Gun drilling or a specialist deep-hole process takes over. It is not a matter of a longer peck; the tool itself is too flexible at that length.

Finally, surface finish inside the hole. Drilling leaves a helical feed mark. If the bore seals against a shaft or holds an O-ring, that mark leaks. Reaming or boring fixes it. Do not ask a drilling cycle to deliver a sealing surface.

  • 1
    Slots and pocketsUse an end mill, not a drill cycle
  • 2
    Tight positionDrill undersize, then bore or ream
  • 3
    Over 10 × ØMove to gun drilling or a deep-hole process
  • 4
    Sealing boresReam or bore for a leak-free surface
Selection

Matching the drilling method to the hole

Use the hole's tolerance, depth ratio and quantity to pick the method before you write the cycle.

Hole conditionMethodTypical resultWhen it stops working
Clearance hole, loose toleranceTwist drill, G81±0.1 mm, Ra 1.6–3.2 μmPosition drifts on uneven entry
Deep hole, over 3 × ØPeck drill, G83Straight, chips clearPeck too deep packs the flutes
Pin or dowel fitDrill undersize, then ream±0.01 mm or betterRunout above 0.02 mm ruins size
Angled or curved surfaceSpot drill, then drillNo walk on entryFlat-bottom spot needed for hard steel
Threaded holeDrill tap size, G84 rigid tapClass 2B fit in most casesTapping without float holder breaks taps
Large bore, tight roundnessDrill, then boring headRoundness under 0.01 mmBoring bar too long to stay rigid

When to drill on the mill, when to plan for a finishing pass

If the hole is a clearance hole with a loose tolerance, a spot and a twist drill cycle is enough and costs the least. If the hole carries a pin, a seal or a tight true-position callout, plan the CNC drilling program as a pre-step and budget for reaming or boring. Deciding this before the cycle is written saves a scrap batch later.

FAQs

Common questions on CNC drilling programs

How deep should each peck be?

In steel, about one diameter per peck keeps the flutes clear. In stainless, where work hardening matters, half a diameter is safer and keeps the drill cutting instead of rubbing.

In aluminium, pecking is often unnecessary. A through-coolant or air-blast drill clears chips in one pass for holes up to about five diameters.

Why is my drilled hole larger than the drill?

Runout, a ground drill point that is off-center, or a light feed that lets the drill rub all push the hole oversize. Check the holder first, then the drill, then the feed.

In work-hardening stainless, a dull drill cuts a hole that grows with every revolution. Change the tool before the size drifts past the tolerance.

Can a CNC drilling program hold ±0.005 mm?

Not by drilling alone. ±0.005 mm is a reaming or boring result in most materials. A drilled hole is the pre-step, and the finishing operation delivers that tolerance.

The whole setup has to support it: rigid holder, low runout, stable temperature, and probing on the machine before the finishing pass.

Do I need a spot drill for every hole?

No. On a flat, machined surface a stub drill can start cleanly on its own. A spot drill earns its place on curved surfaces, castings with hard skin, and any hole where position matters.

Skipping the spot step on a rough or angled surface usually means the drill walks and the position is lost.

What changes on a five-axis machine?

A five-axis cycle reaches holes on several faces without re-fixturing, which removes the position error that comes from moving the part between setups.

The program is longer and the machine rate is higher, so it pays when the part has angled holes or a tight true-position callout across faces.

How do you handle a hole through a thin wall?

Support the exit side with a backing plate or a nest. Without support, the drill pushes material out at the exit and leaves a burr or a cracked edge.

Reduce the feed right before breakthrough to lower the exit force, and deburr as a separate operation if the drawing requires a clean edge.

Send the drawing, get the drilling plan back

We review the hole callouts, material and tolerance, then quote with a DFM note on where drilling is enough and where reaming or boring is needed.

12-hour quote100% inspectionNo minimum order quantity

Follow us

More machining notes

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