tool_sensor.ngc
1 o<tool_sensor> sub 2 3 #<max_probe> = #<_ini[TOOLSENSOR]maxprobe> 4 #<search_vel> = #<_ini[TOOLSENSOR]search_vel> 5 #<probe_vel> = #<_ini[TOOLSENSOR]probe_vel> 6 #<sensor_height> = #<_ini[TOOLSENSOR]height> 7 #<zero_height> = #1 8 9 (print, max_probe is #<max_probe>) 10 (print, search vel is #<search_vel>) 11 (print, probe vel is #<probe_vel>) 12 (print, sensor height is #<sensor_height>) 13 (print, zero height is #<zero_height>) 14 15 G21 (use metric units) 16 G53 G0 Z0 (raise spindle to Z0) 17 G53 G0 X#<_ini[TOOLSENSOR]x> Y#<_ini[TOOLSENSOR]y> 18 G49 (cancel tool offset) 19 G10 L20 P0 Z0 (clear current offsets) 20 G91 (switch to incremental mode) 21 22 ; this section commented out for sim 23 ;G38.2 Z[-#<max_probe>] F#<search_vel> (probe down) 24 ;G1 Z4.0 (move up 4 mm) 25 ;G4 P0.5 (pause for 0.5 sec.) 26 ;G38.2 Z-6.0 F#<probe_vel> (probe down slower) 27 28 ; this section used for sim, comment out otherwise 29 G1 Z-10 F#<search_vel> 30 31 G10 L20 P0 Z[#<sensor_height> - #<zero_height>] 32 G90 (absolute distance mode) 33 G53 G0 Z0 (move Z up to 0) 34 o<tool_sensor> endsub 35 M2