Needing help with some auto zero coding
So I am working on a CNC router, which I have done before and is going well. But I want to install a auto Tool Height sensor. The link to the one I have is: https://www.amazon.ca/gp/aw/d/B07PRP...b_b_asin_title
But I want to have a Macro installed in Mach3 so when it's done using the router bit that it has it pauses, moves the front of the machine, stops and allows me to change the bit, then it moves to the height sensor and sets z zero, the continues on with the program. I'm not to familiar with macros for Mach3, at least not this complicated. Any help would be greatly appreciated.
Thanks everyone
Re: Needing help with some auto zero coding
I'm not using Mach3, but G code is G code right? The following might help if you can figure how to implement it.
I use a similar setter.
https://photos.app.goo.gl/sQkvtc2VG2aKBsb77
with this code.
Code:
o<ztouch> sub
;
G21 ( use metric units)
;
G10 L20 P0 Z0 ( Set current Z position to 0 so that we will always be moving down )
;
G38.2 Z-25 f150 ( Probe to Z-25 rough position seek )
G91 (Incremental distance mode)
G1 Z2 f400 (Rapid Z up 2mm)
;
G38.2 Z-25 f25 ( Probe to Z-25 slow! )
G10 L20 P1 Z67.473 (set Probe position to the tool setter height)
;
G90 (absolute mode)
G53 G0 (Use machine coordinates)
;
G91 (Incremental mode)
;
G1 Z25 f500 (Rapid Z up 25mm)
;
G90(absolute mode)
o<ztouch> endsub