; homez.g ;!Called to home the Z axis. This file is a macro to set z via the z-probe sensing the metal plate or aluminum bed G91 ; Set relative positioning G1 H2 Z10 F1000 ; lower Z relative to current position in case the bed is in a position wehre the probe is currently triggered. G90 ; Return to absolute positioning. ;! Ask the user if the build plate is present or there is a metal piece on the buildplate, and nothing else on the buildplate. If no, don't do anything. M291 P"Be sure there is a metal build plate or metal heated bed below the center of the bed before saying OK." R"Z-home using probe" S3 ;################ ;!If X has not been homed, home x if !move.axes[0].homed M291 P"X axis not yet homed. Homing now." R"Z-home using probe" S0 T5 ; S0 means no buttons, t5 means wait 5 seconds and move on. M98 P"0:/sys/homex.g" ; run the homex gcode file in the sys directory. Note line leading spaces needed to define IF Block 0:/sys/homex.g is the way to write an absolute path ;else ;M291 p"X already homed, moving on." s0 ;################;! If Y has not been homed, home Y if !move.axes[1].homed M291 P"Y axis not yet homed. Homing now." R"Z-home using probe" S0 T5 ; S0 means no buttons, t5 means wait 5 seconds and move on. M98 P"0:/sys/homey.g" ; run the homey gcode file in the sys directory. Note line leading spaces needed to define IF Block 0:/sys/homey.g is the way to write an absolute path ;else ;M291 p"Y already homed, moving on." s0 ;################;! Move the probe to the center of the bed g0 X{165 + global.Z_probe_Xoffset} Y{200+global.Z_probe_Yoffset} ;################;! Probe the bed and set the probe trigger point to Z=0 ;M208 Z0:410 ;!Set the Min:Max Z axis soft limits. Max position is value set when Y endstop is triggered. Not needed because its in the config.g file. G30 ;! Move to the selected z-probe offset. This is the command where we define how far above plate we want z to bed ;! After moving to the selected point, set this location to become Z=0 ;! Done ; ; generated by RepRapFirmware Configuration Tool v3.1.4 on Sun Oct 11 2020 12:47:10 GMT-0700 (Pacific Daylight Time) ;G91 ; relative positioning ;G1 H1 Z430 F1800 ; move Z down until the endstop is triggered ;G1 H2 Z-5 F6000 ; raise Z relative to current position ;G92 Z415.1 ; set Z position to axis maximum (you may want to adjust this) ; Uncomment the following lines to lift Z after probing ;G91 ; relative positioning ;G1 Z5 F100 ; lift Z relative to current position ;G90 ; absolute positioning