In CNC machining, drilling is a common operation that involves creating cylindrical holes in a workpiece. The G81 and G83 codes are used to control drilling operations on CNC machines. G81 is used for simple drilling, while G83 is used for peck drilling, which is a method used to break up chips when drilling deep holes. The G98 and G99 codes are modal commands that control the return position of the tool after drilling.
Usage Format
- G81 Drilling Cycle:
G81 R... Z...
- G83 Peck Drilling Cycle:
G83 R... Z... Q...
- G98 Return to Initial Z Position:
G98
- G99 Return to R Position:
G99
Explanation
- G81 is the code for a simple drill cycle without chip breaking. The tool plunges into the material, drills to the specified depth, and then retracts.
- G83 is the peck drilling cycle code, which allows for intermittent cutting and retraction to break up chips and clear them from the hole.
- G98 and G99 are modal commands that determine the return position after drilling. G98 returns the tool to the initial Z position, while G99 returns it to the R position, just above the material.
Example
Here’s a text diagram and example program using G81 and G83 with G98 and G99:
%
O1001 (Example Program)
T01 M06 (Tool Change to Drill)
G90 G17 G20 (Absolute Positioning, XY Plane, Inch Mode)
M03 S500 (Spindle On, Clockwise at 500 RPM)
G00 X1.0 Y1.0 (Rapid Move to Position)
G43 Z0.1 H01 (Tool Length Compensation)
G98 G81 R0.1 Z-0.5 F5.0 (Simple Drill Cycle)
X2.0 Y2.0 (Move to Next Position)
G80 (Cancel Drill Cycle)
G83 R0.1 Z-1.0 Q0.2 F3.5 (Peck Drill Cycle)
X3.0 Y3.0 (Move to Next Position)
G80 (Cancel Drill Cycle)
G99 G81 R0.1 Z-0.5 F5.0 (Simple Drill Cycle with Return to R Position)
X4.0 Y4.0 (Move to Next Position)
G80 (Cancel Drill Cycle)
M05 (Spindle Stop)
G00 Z1.0 (Rapid Move to Clear)
M30 (Program End)
%
In this program:
T01 M06
selects the drill tool.G90 G17 G20
sets absolute positioning, the XY plane, and inch mode.M03 S500
starts the spindle.G00 X1.0 Y1.0
moves the tool to the starting position.G43 Z0.1 H01
applies tool length compensation.G98 G81 R0.1 Z-0.5 F5.0
performs a simple drilling operation.G83 R0.1 Z-1.0 Q0.2 F3.5
performs a peck drilling operation.G99 G81 R0.1 Z-0.5 F5.0
performs a simple drilling operation with the tool returning to the R position.
The text diagram visually represents the tool path for each drilling operation, with R
being the retract position, Z
the drilling depth, and Q
the peck depth for the G83 cycle.