jario_
Back to overview

CNC Basics · Chapter 5

Drilling cycles

Imagine you ask someone to bring you a glass of water. You do not say: "Stand up, go to the kitchen, take a glass, hold it under the tap …". You just say: "Bring me a glass of water." The person knows the steps. A cycle works exactly like this: the machine already knows the steps of drilling, you only give the values.

One block instead of four

When you drill by hand, every hole takes four steps: move over the hole, lower to just above the surface, drill with G01, move back up. The cycle G81 does all this in one block:

  • X Y: the position of the hole.
  • Z: the depth, negative from the surface.
  • R: the retract plane. This is a height just above the surface, usually R2. The machine moves there in rapid traverse and drills with feed from there on.
  • F: the feed rate while drilling.
G90 G21 G17T2 M6S1000 M3G81 X30 Y25 Z-12 R2 F100   (drill a hole 12 mm deep, retract plane 2 mm)G80                        (end the cycle)M5M30

G80 ends the cycle. Never forget it: a cycle that is still open at the end of the program counts as an error.

Dwell: G82

The bottom of a blind hole often stays rough. If the drill keeps turning there briefly without going deeper, it becomes smooth. This is called a dwell.

G82 is a G81 with a dwell. It adds the word P: the time in milliseconds (1000 ms are one second). Without P the machine raises an alarm.

By hand there is G04 P… for this: the machine waits for the given time and then continues. A cycle with P saves you this line.

G90 G21 G17T2 M6S1000 M3G82 X30 Y25 Z-6 R2 P800 F60   (dwell 800 ms at the bottom)G80M5M30

Where does the drill retract to? G98 and G99

After the hole the drill moves out again. Two words decide how far:

  • G98: back to the start plane, the height before the cycle. This is the default and the safe way if clamps are in the way.
  • G99: only back to the retract plane R. This saves time because the way to the next hole gets shorter.

Both stay valid until you set the other one.

G90 G21 G17T2 M6S1000 M3G98                          (default: retract to the start plane)G81 X20 Y30 Z-8 R2 F100G99                          (from now on: retract only to R)G81 X50 Y30 Z-8 R2 F100G80M5M30

Common mistakes

  • Z positive instead of negative

    The depth is measured from the surface downwards, so it is negative: Z-10. With Z10 the target lies above R and the machine raises an alarm.

  • Forgetting R or F

    Every cycle needs Z and R. G81 also needs a feed rate F. If one is missing, the machine stops with an alarm.

  • G80 is missing

    A cycle stays active until you end it. If you forget G80, the cycle stays open until the end of the program. The rule "cycle ended" is then not met.

  • Forgetting P with G82

    G82 without P does not know how long to wait. Add the time in milliseconds, for example P500.