; homeall.g ; called to home all axes ; M400 ; make sure everything has stopped before we make changes M574 X1 Y1 S3 ; set endstops to use motor stall M913 X50 Y50 ; drop motor currents to 50% M915 X Y S2 R0 ; set sensitivity to +2 unfiltered G91 ; use relative positioning G1 S2 Z4 F200 ; lower bed 4mm to ensure it is above the switch trigger height G1 X-400 F4000 S1 ; move X all the way left and stop at end G1 X9 ; move to edge of glass G92 X0 ; set X0 at edge of glass G1 Y-400 F4000 S1 ; move Y all the way left and stop at end G1 Y30 ; move to edge of glass G92 Y0 ; set Y0 at edge of glass G1 X320 Y0 F8000 ; put the head wherever you want it to be when you home Z (omit this line if it doesn't matter) G91 ; relative mode G1 S1 Z-200 F800 ; raise bed up fast until the switch triggers G1 Z2 F400 G1 S1 Z-200 F100 ; raise bed up slow until the switch triggers ;G90 ; back to absolute mode G92 Z0 M400 ; make sure everything has stopped before we reset the motor currents M913 X100 Y100 Z100 ; motor currents back to 100% G90 ; back to absolute positioning