There's a Mach3 wizard that does it, but I don't know if there's anything that can do it in Mach4.
https://www.craftycnc.com/probe-it-wizard-mach3/