; homez.g ; called to home the Z axis ; G91 ; relative mode G1 Z4 F200 S2 ; raise head 4mm to ensure it is above the switch trigger height G90 ; back to absolute mode G1 X0 Y0 S2 F2000 ; 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 Z-200 S1 F100 ; move Z down until the switch triggers G90 ; back to absolute mode G92 Z0.3 S2 ; tell the firmware that we are at Z=0.3mm