;drill o sub o call # = #1 # = #2 # = #3 # = #4 # = #5 # = #6 # = #8 # = #9 # = #10 # = 0 # = #11 # = #<_z> (starting z) o100 if [# NE #<_current_tool>] (MSG,ERROR : Set tool before use macro) o100 return [-2] ; indicate failure to epilog o100 endif G7 ; diameter mode G17 ; XY Plane G21 ; Metric Units G90 ; Absolute Distance G91.1 ; but not for arcs # = [[1000 * #] / [3.1415 * #]] ; metric mode RPM G97 S# ; Constant RPM mode M3 ; Start Spindle G95 F# ; Feed-Per-Rev Mode G4 P1 ; Wait to reach speed o110 if [#] M8 o110 endif (DEBUG,Drilling dia-# depth-# asked-speed-# feed/rpm-# tool-# peck dist-# full retract calculated-rpm-# start-z-#) G98 G0 X0 ; must drill from the centerline. Tool should be zeroed here G83 Z# R# Q# G80 o300 if[# gt # ] # = [# - #] ; because of drilldiameter and diameter mode G96 D# S# ; Constant Surface Speed Mode M3 ; Start Spindle G95 F# ; Feed-Per-Rev Mode G4P1 ; Wait to reach speed G0 X0 # = #<_x> (DEBUG,Turning finish dia-# start rad-# start length-# finish length-#) o400 while [# LT [# - #]] G0 X # #=[# + #] G1 X # G1 Z # X # G1 X[# - #] G0 Z[#] o400 endwhile G0 X# G1 Z# X# G1 X[# - #] G0 Z# G0 X# ; For touch-off o300 endif M5 M9 o call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var o endsub M2 %