Files
probe-basic-sim/configs/probe_basic_lathe/subroutines/touch_z.ngc
2025-12-14 18:29:18 +01:00

19 lines
440 B
Plaintext

o<touch_z> sub
#<set_mt_z> = #1 (current x axis position)
#<gage_thickness> = #2 (=0.0000)(gage thickness, gage block or paper thickness etc.)
#<total_z_position> = [#<set_mt_z> + #<gage_thickness>]
#<current_tool_z_position> = #5422
#<touch_z> = [#<current_tool_z_position> - #<total_z_position>]
G10 L1 P #5400 Z [#<touch_z>] (5400 = tool number)
T #5400 G43 (enable tool length offset)
o<touch_z> endsub
M2 (end program)