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

Get Instant Quote

CNC drilling basics

What Is a Peck Drilling Subroutine for a CNC Machine?

A peck drilling subroutine for a CNC machine breaks one deep hole into many shallow plunges, retracting the drill between each one to clear chips. This page explains the motion, the G83 and G73 cycles behind it, the parameters you set, and the hole depths where the extra cycle time is worth paying for.

G83 / G73 canned cyclesQ, R and Z valuesDeep holes above 3רChip evacuation
what is a peck drilling subroutine for a cnc machine
Mechanism

How a Peck Drilling Subroutine Moves the Tool

A normal drilling cycle sends the drill from the clearance plane to the final depth in one continuous feed. Chips slide up the flutes the whole way. That works while the hole is shallow. Once the depth passes roughly three times the drill diameter, the flutes are packed with chips and the swarf has nowhere to go.

A peck drilling subroutine splits that single plunge into a stack of short ones. The control feeds the drill down by a set increment, lifts it, feeds again, lifts again, and repeats until Z reaches the programmed depth. Each retraction drags the chip string out of the flutes.

The retract height matters as much as the increment. G83 pulls the drill all the way back to the R plane on every peck, so each plunge starts from a clean flute. G73 uses a smaller retract that stays inside the hole. G73 is faster, but it only works when the chips break short and fall clear.

On a fanuc-style control the whole motion lives in one block: G83 Z-42.0 R2.0 Q5.0 F0.12. The Q value is the peck depth, R is the plane above the part, Z is the final depth, and F is the feed in mm per revolution or inches per revolution depending on your setup.

Nothing about the subroutine is exotic. It is a loop the control runs for you, and every plunge is the same feed and speed as the first one. The difference is where the chips end up.

Parameters

Setting Q, R and Feed for a Peck Drilling Subroutine

Q is the first number to get right. A common starting point is one drill diameter per peck, or half the diameter when the material is gummy and the chips weld to the flute. In 6061 aluminium we often run 1×D per peck at 3,000–4,000 rpm. In 316 stainless the same drill may need 0.5×D and 400–600 rpm.

R sets where the rapid plane sits. Keep it 1–2 mm above the surface for flat stock. On a casting or a rough forging, raise R until the drill clears the highest point of the face, or the first rapid will clip the part.

Feed and speed come from the drill diameter and the material, not from the peck depth. Pecking does not let you run a drill harder. It lets you keep the drill alive in a hole that would otherwise clog. If a 6 mm drill in 304 stainless is running 0.08 mm/rev, it stays at 0.08 mm/rev whether you peck 3 mm or 30 mm.

Watch the first peck. If the drill squeals as it enters, the web is rubbing and the point geometry is wrong for the material. If chips come out as fine dust, the feed is too light and the edge is burnishing instead of cutting. Both problems get worse with depth.

A peck drilling subroutine also has a cost. Every retract is a rapid move, and a deep hole with a 0.5×D peck can take three or four times longer than a single plunge. That is fine on a 40 mm hole and painful on a 6 mm one.

Boundaries

When a Peck Drilling Subroutine Helps and When It Does Not

Pecking earns its keep in three situations: a hole deeper than four diameters, a material that makes long stringy chips, and a part where the drill cannot be flooded with coolant. Aluminium, copper alloys, and low-carbon steel all produce chips that pack a flute on a deep plunge.

It also helps when the hole breaks into a cross-drilled passage or an internal cavity. A single plunge can grab at the breakthrough and snap a small drill. Short pecks let the edge pass the interruption with less torque in the cut.

On shallow holes, pecking buys you nothing. A 3 mm hole in a 3 mm plate is one plunge with a stub drill. Adding G83 there just makes the cycle longer and puts more wear on the rapid axis.

Chip breaking is not the same as chip clearing. G73 breaks the chip but leaves it in the hole. On a blind hole with no coolant through the tool, those chips get re-cut, and re-cutting is what kills the corner of a drill. G83 is the safer choice when evacuation matters.

Some materials make pecking almost mandatory. Titanium and Inconel work-harden at the bottom of a stalled cut, so a drill that dwells even briefly raises the hardness right where the next edge has to cut. In those alloys, keep the peck short and the feed high enough to stay under the hardened layer.

Hole straightness is another factor. A long drill wanders less when each peck starts from a cleared hole. If a 10×D hole has to hold position, pecking is cheaper than buying a gun drill setup.

Shop practice

What a Peck Drilling Subroutine Looks Like on the Shop Floor

On a three-axis mill, the programmer posts G83 with a Q of one diameter and R of 2 mm, then lets the operator prove it on a scrap block. The first part comes off the machine and goes to the bench for a pin gauge check. If the hole is oversize, the drill is walking, not the cycle.

On a five-axis machine the same cycle runs on a tilted face. The control still pecks along the tool axis, so the Q value does not change with the part angle. What changes is the approach, because the drill has to clear the fixture on the retract.

We keep the feeds and speeds for each material family in the CAM template, so a new job starts from a proven Q and R instead of a guess. The tolerance we hold on drilled holes is ±0.005 mm only after reaming. As-drilled holes sit wider, and the peck depth does not change that.

For deep, narrow features, pecking is often the only economical route. A 4,000 mm travel machine can reach a deep bore that a shorter machine cannot, and the subroutine keeps the drill cutting instead of rubbing at the bottom of the hole.

A peck drilling subroutine is a tool for chip control, not a cure for a bad setup. If the drill is not running true, or the coolant is aimed at the wrong spot, no Q value will save the hole.

Program form

Reading and Editing the Subroutine Block by Block

Most programmers never write the loop by hand. The control already contains it, and G83 is the switch that turns it on. What you actually edit is the parameter list: Z, R, Q, and F. Everything else is fixed by the machine builder.

That is why a peck drilling subroutine is easy to tune on the floor. An operator can change Q at the control without a new CAM post. If the chips start packing halfway down a 25 mm hole, dropping Q from 6 mm to 3 mm often fixes it on the spot.

Keep the blocks readable. One cycle per line, with the Q value written out even when it repeats from the previous hole. A clear program is easier to prove out and easier to hand to the next shift.

If you run the same family of parts for years, store the cycle in a subprogram and call it with the depth and Q as arguments. The main program stays short, and no one edits the loop by accident.

The engineer's question is never how the loop is written. It is whether the hole comes out straight, on size, and with a drill that still has its corners. The subroutine is just the lever you pull to get there.

Procedure

Step by Step: Dialing In a Peck Drilling Subroutine

  • 1
    Measure the depth-to-diameter ratioDivide hole depth by drill diameter. Below 2×D, skip pecking. Between 2 and 4×D, start with G73. Above 4×D, go to G83.
  • 2
    Set Q from the materialStart at 1×D per peck for aluminium and free-machining steel. Drop to 0.5×D for 304 or 316 stainless, titanium, and copper alloys that gum up.
  • 3
    Set R above the highest point1–2 mm above flat stock. Raise it for castings and forgings until the first rapid clears the rough face by at least 1 mm.
  • 4
    Hold feed and speed at the drill's normal valuesPecking changes the motion, not the cutting data. Keep the same mm/rev you would use on a single plunge in that material.
  • 5
    Run the first hole dry or with light coolantWatch the chips come out. Fine powder means too light a feed. Long strings that wrap the drill mean Q is too large.
  • 6
    Check position and size on the benchPin gauge the hole and check straightness with a dial bore gauge. Adjust Q before touching feed or speed.
  • 7
    Log the proven valuesSave Q, R, feed and speed in the CAM template for that material so the next job starts from a known point.
Selection

Peck Drilling Subroutine vs Other Drilling Cycles

Depth is measured in drill diameters (×D).

CycleRetract behaviorBest depth rangeTypical use
G81 spot / drillNo retract, one plunge0–2×DThrough holes, spot faces
G82 spot with dwellDwell at bottom, no peck0–2×DFlat-bottom counterbores
G73 chip breakShort retract inside hole2–4×DDuctile material, short chips
G83 deep holeFull retract to R plane4×D and deeperDeep holes, gummy chips
G85 reamFeed in, feed outSet by reamerFinal size on a drilled hole

The Takeaway

Use G83 when the hole is deeper than 4×D or the chips weld to the flute. Use G73 between 2 and 4×D in ductile material with short chips. Skip pecking altogether below 2×D, where a single plunge is faster and kinder to the machine.

FAQs

Peck Drilling Subroutine Questions

Does pecking let me drill faster?

No. The cutting feed stays the same as a single plunge, and the retracts add cycle time. On a hole 10×D deep with a 0.5×D peck, the cycle can run three to four times longer than one continuous feed.

You accept that time because the alternative is a broken drill, a scrapped part, or a hole that has to be reworked. The gain is reliability, not speed.

What Q value should I start with?

One drill diameter per peck is the usual starting point for aluminium, brass and free-machining steel. Halve it for 304 or 316 stainless, titanium, and any copper alloy that produces gummy chips.

Then watch the chips. If they come out as long strings, reduce Q. If they come out as powder, the problem is feed, not Q.

Why does G83 retract all the way out of the hole?

Full retraction to the R plane lets the flutes empty completely, so each new plunge cuts with a clean edge. That matters for deep holes and for materials that produce continuous chips.

The cost is cycle time. G73 breaks the chip with a short retract and stays inside the hole, which is faster but leaves chips down there to be re-cut.

Can I peck drill on a lathe?

Yes. The same G83 and G73 cycles work on the turret, with the Z axis feeding the drill along the spindle axis. The parameters mean the same thing: Q for peck depth, R for the clearance plane.

On a lathe, coolant aimed through the tool is often more effective than on a mill, which can let you use a longer peck without packing the flute.

How does pecking affect hole size and finish?

A drilled hole is a roughing operation. Pecking keeps the drill centered, so the hole tends to be straighter and closer to nominal than a single deep plunge.

Size still depends on the drill, the coolant, and the material. If a hole has to hold ±0.005 mm, drill undersize and ream. No peck depth removes the need for that step.

What if the drill squeals on the first peck?

Squealing at entry usually means the chisel edge is rubbing instead of cutting. Check the point angle and the web thickness against the material.

It can also mean the feed is too light. A drill that burnishes the surface work-hardens it, and the next peck has to cut through that harder skin.

Need Deep Holes Drilled Right the First Time?

Send drawings and we will review the hole depths, materials, and drill access, then quote with a DFM note within 12 hours.

12-hour quote and DFM100% inspection before shipmentNDA on request

Follow

More CNC Knowledge

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