G-code drilling cycle G81, G82, G83, G73 and G84: Step-by-step instructions

In the previous blog posts, „CNC programming: Learn G-code - Quick and easy“ and „Learning G-Code Part 2/2: Advanced CNC programming„, we learnt the basics and advanced aspects of G-code programming. However, one important G-code command has not yet been covered in these articles - the G-code drilling cycle.

In this article, we will take a detailed look at the G-code drilling cycle. You can then easily integrate these commands into your projects. Have fun reading!

We use our free G-Code Simulator as a working tool cncGraF.
Click here to download cncGraF free of charge“.

To find out more about our G-Code Simulator, please click here
cncGraF: Free G-code simulator and CNC machine emulator„.

cncGraF 8: Free G-code simulator and CNC machine emulator

Drilling without G-code Drilling cycle

As drilling only requires a lowering in the Z-axis, this can also be carried out without the G-code drilling cycle. To do this, simply use the G-code command G01 Z is used. An example (excerpt) of the corresponding G-code looks like this:

Example
; 10 mm into the workpiece at a feed rate of 600 mm per minute
G01 Z-10 F600
; wait 1 second
G04 H1
; Lift the tool at rapid speed to the height Z = 5 mm above the zero point
G00 Z5
Drilling with G01 Z without G-code drilling cycle

G-code drilling cycle: G81 and G82

The simplest drilling cycle is the G-code command G81. This drilling cycle is used for simple drilling, while the command G82 additionally enables drilling with a dwell time at the bottom of the hole.

The G81/G82-command has the following syntax:
G98(G99) G81(G82) X Y Z R F (P)

The parameters are as follows:

  1. With the parameter G98/G99 The retraction height to which the tool should move after the drilling cycle is defined.
    G98 - The starting height (starting height) is approached after the drilling cycle.
    G99 - the retraction height (defined in the parameter R) is approached after the drilling cycle.
    Note: If no parameter G98 or G99 is specified, then G98.
  2. The parameters X,Y,Z:
    X - Position X
    Y - Position Y
    Z - Depth Z (absolute)
  3. R - Incremental value of the retraction plane, in relation to the starting point in the Z-axis
  4. F - Feed speed in mm/min
  5. The G-Code drilling cycle G82 also has the parameter P for waiting time in milliseconds
    (1000ms = 1sec.) at the bottom of the hole
Example
G00 Z0
G98 G82 X10 Y10 Z-3 F300 P100
Drilling cycle G82 with the parameter P

In the example above, a hole is drilled at positions X10 and Y10, with a drilling depth of 3 millimetres. In addition, a dwell time (parameter P) of 100 milliseconds, during which the milling machine pauses. At the end of the drilling process, the starting height, which in this case is Z=0, is approached again.

G-Code command: G80

The drilling cycle is started with the command G80 or by another G-code command such as G00 or G01 deleted.

Example
G98 G82 X20 Y20 Z-3 F300 P100
; Repeat drilling cycle at three points
X30 Y20
X40 Y20
X50 Y20
; Delete drilling cycle
G80
In this example, the drilling cycle G82 with the specified parameters. The drilling cycle is then repeated 3 times at different positions, whereby the settings of the drilling cycle are retained. Finally, the drilling cycle is ended with G80 deleted.

G-code drilling cycle: G83 Deep-hole drilling with chip removal

Compared to the drilling cycles G81/G82 this drilling cycle contains an additional parameter Q. The parameter Q is used to control the chip removal. As chips are produced during drilling, this drilling cycle is particularly recommended for deep hole drilling.

The G83-command has the following syntax:
G98(G99) G83 X Y Z R F P Q

The parameters are the same as for the G-code drilling cycle G81/G82, but with an additional parameter:
Q - Drilling depth per infeed defined in millimetres

Example
G00 Z0
G98 G83 X10 Y10 Z-9 F300 P100 Q3
Drilling cycle G83 with the parameter Q

In the example above, a hole is drilled at positions X10 and Y10, with a drilling depth of 9 millimetres. In addition, a dwell time of 100 milliseconds is executed at the bottom of the hole, during which the milling machine pauses. The hole is drilled with a triple infeed, as the plunge depth per infeed is 3 millimetres (parameter Q). At the end of the drilling process, the initial height Z=0 is approached. The graphic below explains the parameter Q.

The parameter Q: G-code drilling cycle G83

G-code drilling cycle: G73 Deep hole drilling

This drilling cycle corresponds to drilling cycle G83, with the difference that a short lift-off distance is approached after each chip removal with Q. The setting for the lift-off distance can be made in cncGraF under „Settings -> Options -> G-Code“.


G-code tapping cycle: G84

Finally, we turn our attention to the supreme discipline of tapping with the G-code command G84. This command can be used to create both right-hand and left-hand threads. Please note that a spindle with both anti-clockwise and clockwise rotation is required.

Note: In cncGraF under „Settings -> Options -> G-Code“, the option „Use old G84 version“ must be deactivated. This old version of the G84 command does not comply with the G-Code standard, but is still supported by cncGraF to ensure compatibility with old G-Code programmes.

The G84-command has the following syntax:
G98(G99) G84 X Y Z R P F M

The parameters for G84 are as follows:
X - Position X
Y - Position Y
Z - Depth Z (absolute)
R - Incremental value of the retraction plane in relation to the starting point in the Z-axis
P - Waiting time in milliseconds (1000ms = 1sec.) at the bottom of the hole
F - Feed speed in mm/min
M M03 Right-hand thread, otherwise M04 Left-hand thread

Example
G00 Z0
G98 G84 X10 Y10 Z-10 F300 P100 M03
Tapping cycle G84 as right-hand thread

In the above example, a right-hand thread (parameter M03 for clockwise rotation) with a depth of 10 millimetres and a feed speed of 300 mm/min. At the bottom of the hole, a waiting time of 100 milliseconds (parameter P) is executed.


We hope that this article will help you to quickly find your way around the world of drilling cycles.

Yours sincerely, Your BOENIGK-electronics Team


Posted

in

,

by