G81 G-Code Command
G81 is a standard G-code command used in CNC machining to perform drilling operations. When a CNC machine receives the G81 command, it initiates a drilling cycle that typically involves rapid movement of the drill to the starting position, followed by a slow and controlled drilling operation into the workpiece. The G81 command can be customized with additional parameters such as the depth and speed of the drilling operation, as well as the number of holes to be drilled. Overall, the G81 command is a crucial tool for precision drilling in CNC machining operations.
How G81 G-Code Command Is Used
Sure, here’s an example of how G81 might be used in a G-code program, with comments in brackets and a spindle on command for 561 RPM:
T5 M06
G00 G90 G54 X10 Y10 (move to first hole position)
M03 S561 (spindle on at 561 RPM)
G43 H5 Z50 M08 (move to Z safe height and turn on coolant)
G81 Z-20 R2 F50 (perform drilling cycle at first position)
X20 Y15 (perform drilling cycle at second position)
G80 (cancel drilling cycle)
M05 (spindle off command)
M30 (end program)
In this example, the G00 command initiates a rapid movement to the starting position, while the M03 command turns on the spindle at 561 RPM. The G81 command then performs a drilling cycle with the specified parameters, including the Z coordinate for the hole depth of 20mm (specified by the negative Z value), a retract distance of 2mm (specified by the R value), and a feed rate of 50 mm/min. The next line specifies the second hole position and the drilling cycle continues for these coordinates.
You will notice that the G81 command does not have to be repeated for the second set of coordinates, this is because G81 and all other canned cycles are modal. Modal means they are active until they are cancelled, in this case by the G80.
The G81 command is also frequently used with the G98 and G99 G-Code Commands.
Finally, the G80 g-code command cancels the drilling cycle and the M05 command turns off the spindle.