o sub # = #1 (feed rate from UI main screen DRO) # = [# / 20] G92.1 (Cancel G92 offset, maybe some day it should be allowed) o100 if [#<_metric> EQ 1] # = 25.4 o100 else # = 1 o100 endif o110 if [#5220 EQ 1] (G54, 5520 = current work space ID 1-9) # = #5221 o110 elseif [#5220 EQ 2] (G55) # = #5241 o110 elseif [#5220 EQ 3] (G56) # = #5261 o110 elseif [#5220 EQ 4] (G57) # = #5281 o110 elseif [#5220 EQ 5] (G58) # = #5301 o110 elseif [#5220 EQ 6] (G59) # = #5321 o110 elseif [#5220 EQ 7] (G59.1) # = #5341 o110 elseif [#5220 EQ 8] (G59.2) # = #5361 o110 elseif [#5220 EQ 9] (G59.3) # = #5381 o110 else (default to G54) # = #5221 o110 endif # = [[#<_ini[AXIS_0]MIN_LIMIT> - # + .001] * #] # = #5420 (Current X Position including offsets in current program units) # = [[#5410 / 2] * #] (Probe Tip Radius) # = [.050 * #] (fast probe) F # G38.2 X # # = #5061 (partial retract) G38.6 X [# + #] (slow probe) F # G38.2 X # o120 if [#5070] (probing succesful) # = #5061 M68 E 12 Q [# - #] (set analog output 12 to the x probed point - tip radius) o120 else M68 E 12 Q 0.0 o120 endif (retract to start) F # G38.6 X # o endsub M02 (end program)