jario_
Back to overview

CNC Basics · Chapter 8

Several tools

If you want to hang a picture, you first mark the spot with a pencil, then you drill, then you use the screwdriver. Every tool has its place in the order. A CNC machine works the same way: a part often needs a centre drill, a drill, a tap and a countersink. In this chapter you learn to put the tools in the right order and to program a whole part.

Centre first, then drill

A drill has a point at the front that easily slips away on smooth metal. So the centre drill (T1) first makes a small dent. The drill (T2) finds its hold in the dent and the hole sits exactly in the right place.

Between two tools you stop the spindle with M5, change with T.. M6 and switch it on again with S.. M3. End every cycle with G80.

G90 G21 G17T1 M6                    ; centre drillS1500 M3G81 X40 Y25 Z-2 R2 F80   ; small dent, 2 mm deepG80M5T2 M6                    ; drill, finds its hold in the dentS1500 M3G81 X40 Y25 Z-12 R2 F150G80M5M30

All holes with one tool first

A tool change takes time. With several holes the rule is: one tool works off all of its holes, then the next one comes. The cycle is modal, so you write the position of every further hole on its own.

At every single hole the order is still right: first T1, then T2. The machine checks exactly that.

G90 G21 G17T1 M6                    ; tool 1: centre both holesS1500 M3G81 X20 Y40 Z-2 R2 F80X60G80M5T2 M6                    ; tool 2: drill both holesS1500 M3G81 X20 Y40 Z-10 R2 F150X60G80M5M30                      ; two tool changes instead of four

Countersinking

A screw with a countersunk head should sit flush in the plate. For that the hole gets a cone at the top, the countersink. It is made by the countersink tool (T5). It always works after drilling and only goes in shallow.

The cone has 90°. At the surface it is as wide as it is deep, times two: at Z-5 the countersink is about 10 mm wide. A hole of Ø6 only gets a chamfer from 3 mm depth on.

G90 G21 G17T2 M6S1500 M3G81 X30 Y30 Z-10 R2 F150   ; drill firstG80M5T5 M6                      ; countersink after drillingS500 M3G81 X30 Y30 Z-5 R2 F60     ; 90 degree cone: about 10 mm wide at the topG80M5M30

Tapping with G84

A thread is cut by the tap (T4) into a pre-drilled hole. The pitch is the distance from one thread turn to the next; for M8 it is 1.25 mm. With every turn the tap has to move exactly one pitch deeper. That is why the feed is fixed:

F = S × pitch

You write G84 like G81. At the bottom of the hole the cycle reverses the spindle and moves out. The order at the hole: centre (T1), pre-drill (T2), thread (T4).

G90 G21 G17T4 M6                         ; tap M8, pitch 1.25S300 M3G84 X45 Y30 Z-12 R2 F375      ; F = S x pitch = 300 x 1.25G80M5M30

If F does not match S, there is an alarm. The alarm tells you the expected value.

Common mistakes

  • Spindle running during the tool change

    M5 comes before M6. After the change the spindle does not start on its own: you need S.. M3 again. Without a running spindle the machine raises an alarm.

  • Wrong feed for the thread

    With G84 the F is not free. Calculate F = S × pitch, for M8 times 1.25. If you simply copy F from a drill, you get an alarm.

  • Thread before drilling

    The tap needs a pre-drilled hole. First centre, then drill, then the thread. And the countersink comes last of all.

  • One change per hole

    If you change all tools at every hole, you lose a lot of time. Sort by tool, not by hole.