G91 ; relative mode G1 S2 Z-4 F200 ; raise head 4mm G1 S1 X250 Y-120 F3000 ; move up to 250mm and -150mm in the +X and -Y directions until the homing switches are triggered G1 S2 X-4 Y4 F600; move slowly 6mm in -X and +Y directions G1 S1 X10 Y-10 ; move up to 10mm in the +X and -Y directions until the homing switches are triggered G90 ; back to absolute mode