Skip to content

Instantly share code, notes, and snippets.

@Nathan22211
Created April 21, 2025 01:03
Show Gist options
  • Save Nathan22211/3f3eea0076628d8b99c9229fc35cdccc to your computer and use it in GitHub Desktop.
Save Nathan22211/3f3eea0076628d8b99c9229fc35cdccc to your computer and use it in GitHub Desktop.
[gcode_macro home_vars] # to store if it has homed
variable_homed: 0
gcode:
[homing_override] # homing override to home once
gcode:
{% if "Z" in params %}
G90
SET_KINEMATIC_POSITION Z=0
G0 X175 Y175 F7200
G28 Z
G91
{% endif %}
{% if printer["gcode_macro home_vars"].homed == 0 %}
SET_KINEMATIC_POSITION Z=0
G0 Z5 F1800
G28 X
G28 Y
G90
G0 X175 Y175 F7200
G28 Z
G91
QUAD_GANTRY_LEVEL
G90
G0 X175 Y175 F7200
G28 Z
G91
{% endif %}
SET_GCODE_VARIABLE MACRO=home_vars VARIABLE=homed VALUE=1
[gcode_macro M84] # to make it home again when motors are turned off
rename_existing: M84.1
gcode:
SET_GCODE_VARIABLE MACRO=home_vars VARIABLE=homed VALUE=0
M84.1 {rawparams}
[gcode_macro PRIME_LINE] # modified to be in the same spot
gcode:
M117 Prime Line
G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Z Axis up
G90
G1 X30 Y50 Z0.75 F5000 ;Move to start position
G1 X30 Y200.0 Z0.75 F1500 E25 ;Draw the first line
G1 X30 Y200.0 Z0.95 F1500 ;Move up a little
G1 X30 Y50 Z0.95 F1500 E25 ;Draw the second line
G1 X30 Y50 Z1.15 F1500 ;Move up a little
G1 X30 Y200 Z1.15 F1500 E25 ;Draw the thirdline
G1 X30 Y200 Z1.35 F1500 ;Move up a little
G1 X30 Y50 Z1.35 F1500 E25 ;Draw the thirdline
G1 X30 Y30 Z0.20 F1000 ;Lower To Wipe Nozzle Prevent Stringing
G92 E0 ;Reset Extruder
G91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment