Mark, can't see anything in the code that would make it do that. These are the lines that set the new Zero by entering the thickness of your probe plate into the Z DRO and then it retracts up to 25mm above new Zero so shouldn't go anywhere near 50mm.?

Do you have any tool height offset's set in the tool table.?

Quote Originally Posted by kell View Post
Call SetDro (2, 19.10) ' change .060 to your plate thickness and then adjust for final accuracy
Sleep 200 'Pause for Dro to update.
Code "G1 Z25 F50" 'put the Z retract height you want here, must be greater than the touch plate thickness