Lesson 7: Holes – Spot Drilling, Drilling and Tapping with Canned Cycles
Updated
On a milling machine a tapped hole is usually made with three tools: a spot drill (G81 or G82), a tap drill (G81 or G83) and a tap (G84, preceded by M29 S for rigid tapping on Fanuc). This lesson writes a complete program for four M8 holes in the training plate, using G99 between holes, G98 on the last hole and G80 after every cycle.
In this lesson you will learn:
- how to plan the hole sequence: spot drilling, drilling, tapping;
- how to choose Z, R, Q and P values for each cycle;
- how to use G99 between holes and G98 on the last hole;
- how to activate rigid tapping with M29 and calculate the G84 feed;
- how to write a complete three-tool program.
This is a practical lesson: cycle theory, address meanings and an overview of all cycles are in drilling canned cycles G73–G89. We use a Fanuc-style control (e.g. 0i-MF) in G21; cycles may differ on other controls, so the machine manual is the authoritative source.
Task and operation sequence
The training plate (EN AW-6082, 100 × 60 × 20 mm, G54 zero at the lower-left corner and top surface) needs four blind M8 tapped holes at X15 Y15, X85 Y15, X85 Y45 and X15 Y45. The holes are 15 mm from the edges, with centre distances of 70 mm in X and 30 mm in Y.
| Operation | Tool | Cycle | Z | R | Q / P | S | F |
|---|---|---|---|---|---|---|---|
| Spot drilling | T2, Ø8 mm 90° | G82 | -3.5 | 2 | P200 | 3000 | 300 |
| Drilling | T3, Ø6.8 mm | G83 | -18 | 2 | Q5 | 4000 | 500 |
| Tapping | T4, M8×1.25 | M29 + G84 | -14 | 5 | – | 500 | 625 |
Speeds and feeds are example values for aluminium; the tool maker's data takes priority (see cutting speed and rpm).
Choosing the depths
- Spot drilling. With a 90° spot drill the spot diameter equals twice the depth, so Z-3.5 gives a spot of about Ø7.0 mm – slightly larger than the drill. The drill starts exactly on centre and a small chamfer is left at the hole edge. If you need a chamfer larger than the Ø8 thread, use a larger spot drill or a chamfer mill. The P200 dwell (0.2 s) cleans up the spot. See spot and centre drills.
- Drilling. Z-18 is the depth of the drill point. The point of a 118° drill is about 0.3×D long, i.e. about 2 mm, so the full Ø6.8 mm diameter reaches roughly Z-16. Below the point 20 − 18 = 2 mm of material remains. A depth of 18 mm is about 2.6×D, so G83 with Q5 is used, clearing chips every 5 mm. The drill size comes from the tap drill size table.
- Tapping. Z-14 is the depth of the tap end. The chamfer of a tap for blind holes usually covers 2–3 threads (2.5–3.75 mm), so the full-profile thread will be about 10–11 mm long; this must match the drawing. About 2 mm is left between the tap end and the full drill diameter for chips. Tap types are covered in taps.
G98, G99 and the R plane
After G43 each tool is brought to Z25 – this is the initial level. There are no obstacles between the holes, so G99 is used: the tool returns only to the R plane (2 mm above the surface) and saves time. G98 is written on the last hole so the tool rises to Z25 before G80 and the tool change. For tapping a larger R5 is chosen because the spindle needs distance to accelerate and synchronise with the Z axis. The holes are visited in a loop, which gives the shortest path.
Complete program
O1007 (LESSON 7 - 4 HOLES M8)
N10 G21 G17 G40 G49 G80 G90
(T2 SPOT DRILL)
N20 T2 M06 (SPOT DRILL D8 90)
N30 G54 G00 X15.0 Y15.0 S3000 M03
N40 G43 H2 Z25.0 M08
N50 G99 G82 X15.0 Y15.0 Z-3.5 R2.0 P200 F300
N60 X85.0
N70 Y45.0
N80 G98 X15.0
N90 G80 M09
N100 G91 G28 Z0
N110 G90
N120 M01
(T3 DRILL)
N130 T3 M06 (DRILL D6.8)
N140 G54 G00 X15.0 Y15.0 S4000 M03
N150 G43 H3 Z25.0 M08
N160 G99 G83 X15.0 Y15.0 Z-18.0 R2.0 Q5.0 F500
N170 X85.0
N180 Y45.0
N190 G98 X15.0
N200 G80 M09
N210 G91 G28 Z0
N220 G90
N230 M01
(T4 TAP)
N240 T4 M06 (TAP M8X1.25)
N250 G54 G00 X15.0 Y15.0
N260 G43 H4 Z25.0 M08
N270 M29 S500
N280 G99 G84 X15.0 Y15.0 Z-14.0 R5.0 F625
N290 X85.0
N300 Y45.0
N310 G98 X15.0
N320 G80 M09
N330 G91 G28 Z0
N340 G90
N350 M05
N360 M30
Each tool section starts the same way: T and M06, G54 with the X and Y of the first hole, G43 with the matching H (see Lesson 5). The cycle is modal, so blocks N60–N80 only need the coordinate that changes. M01 before each tool change lets you stop and inspect the holes while proving out the program.
Rigid tapping: M29 and G84
On Fanuc controls rigid tapping is activated with M29 S500 before G84; no M03 is programmed because the cycle itself controls spindle rotation. In G94 mode the feed is F = S × pitch = 500 × 1.25 = 625 mm/min. Feed and speed overrides are normally ignored during tapping. With a floating (compensating) tap holder M29 is omitted and the spindle is started with M03 before the cycle. The M29 code may differ on some machines – see M-codes. Good lubrication matters when tapping aluminium (coolant and MQL).
Exercise
A fifth, identical M8 hole is needed at the centre of the plate, X50 Y30. Modify program O1007 so that all three tools machine five holes, with G98 still on the last hole. The answer is in the FAQ.
Next lesson: Lesson 8.
Frequently asked questions
Why spot drill before drilling?
A drill point can walk on a flat surface, so the hole ends up out of position or the drill breaks. The spot guides the drill exactly into position and also forms a small chamfer at the hole edge.
Can G81 be used instead of G83?
An 18 mm deep hole is about 2.6×D. With a carbide drill and through-tool coolant such a hole in aluminium can often be drilled with G81 or G73, but while learning and with an HSS drill G83 is safer. The drill maker's recommendations decide.
Why is the R plane higher for tapping?
In rigid tapping the spindle must accelerate and synchronise with the Z axis before the tap enters the hole. A larger R, such as 5 mm, leaves distance for this and protects the tap.
Exercise answer
In each cycle replace the block G98 X15.0 with X15.0 (G99 stays active) and add G98 X50.0 Y30.0 after it, e.g. for spot drilling: N80 X15.0, N85 G98 X50.0 Y30.0. Do the same in the G83 and G84 cycles; G80 still follows every cycle.
Looking for someone to do this job? Find a manufacturer on the marketplace or post a request.
Services offered I need a service