I installed a z zero toutch plate on my machine. the toutch plate has a wire going to pin a5 on the arduino board and there is a clamp going to my bit with a wire going to the negative terminal of my power supply where the spindle gets it power
g91 - switch to relative mode
g21 - fractional instead of metric (I use a 1-2-3 block that’s 1" high as a touchplate)
G38.2 Z-1 F3 probe down one inch (that’s the -1) at a feed rate of 3" per minute
g10 p1 l20 z1 - set the Z work coordinate for the G54 workspace to one inch below its current position (since I know my touchplate is 1" thick). I set my X and Y somewhere else, not using a probe. [You want to look at http://www.shapeoko.com/wiki/index.php/G-Code for the g10 documentation. Be prepared to cry/laugh; gcode pays no attention to any sort of sensible software design.]
g54 use the G54 workspace
g1 z.1 move up one tenth of an inch off the touchplate
g21 switch back to real measurements (aka metric).
I think the a problem you have is that you’re adjusting your machine coordinates. Those shouldn’t change; you should adjust a workspace instead.
Ok got it fixed by finding a faulty ground in the clip end that goes to my bit. Auto z zero now works. Do I need a 4th line of code to bring it to true z zero or will it just know where it is because of the zeroing process