Also see Understanding X and Y Axes Limits and Homing
Likely you are searching for sample_retract_dist