G91 ; relative positioning G1 H1 Y-400 F1800 ; move up to 400mm in the -Y direction, stopping if the homing switch is triggered (first pass) G1 H2 Y5 F6000 ; go back a few mm G1 H1 Y-400 F360 ; move slowly to Y axis endstop once more (second pass) G90 ; absolute positioning