big overhaul
This commit is contained in:
36
nc_files/subs/drill.ngc
Normal file
36
nc_files/subs/drill.ngc
Normal file
@@ -0,0 +1,36 @@
|
||||
; drill - peck-drilling subroutine
|
||||
; Requires globals: #<_z_top>, #<_z_bot>
|
||||
; Optional global: #<_z_clearance>
|
||||
o<drill> sub
|
||||
; x, y, peck
|
||||
; #1 #2 #3
|
||||
|
||||
G90 ; absolute x,y,z
|
||||
M101 ; enable Z-axis (M102 disables)
|
||||
|
||||
o2 if [EXISTS[#<_z_clearance>]]
|
||||
#<z_clearance> = #<_z_clearance>
|
||||
o2 else
|
||||
#<z_clearance> = #<_z_top>
|
||||
o2 endif
|
||||
|
||||
G0 Z#<z_clearance>
|
||||
G0 X#1 Y#2
|
||||
G0 Z#<_z_top>
|
||||
|
||||
o104 if [#3 NE 0] ; peck drilling
|
||||
#<h> = [#<_z_top> - #3] ; first peck target (one peck below top)
|
||||
o101 while [#<h> GT #<_z_bot>]
|
||||
G1 Z#<h>
|
||||
G0 Z#<_z_top> ; full retract
|
||||
G0 Z[#<h>+.02] ; rapid back to just above previous depth
|
||||
#<h> = [#<h>-#3]
|
||||
o101 endwhile
|
||||
o104 endif
|
||||
|
||||
G1 Z#<_z_bot>
|
||||
G0 Z#<z_clearance>
|
||||
|
||||
o<drill> endsub
|
||||
|
||||
M2
|
||||
Reference in New Issue
Block a user