m98 pretract_Z.g g91 ; relative mode G1 H1 X350 F10000; move up to 350mm in the X direction, stopping when the homing switch is triggered G1 H2 X-2; move 4mm in the -X direction G1 H1 X10 F400; move slowly 10mm in the +X direction, stopping at the homing switch m98 punretract_Z.g