Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Note you may need to add the following to your printer.cfg somewhere (without the comments of course) for the Kinematic position stuff below to work.
- #[force_move]
- #enable_force_move: True
- [gcode_macro _HOME_X]
- gcode:
- # Home
- {% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %}
- {% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %}
- {% set HOME_CURRENT = 0.49 %}
- SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
- SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
- SET_KINEMATIC_POSITION X=-15 SET_HOMED=X
- G91
- G1 X15 F1200
- #G4 P2000
- #M400 to finish all pending moves/process the buffer
- M400
- G28 X
- # Move away
- G91
- G1 X15 F1200
- SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
- SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
- [gcode_macro _HOME_Y]
- gcode:
- {% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %}
- {% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %}
- {% set HOME_CURRENT = 0.49 %}
- SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
- SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
- SET_KINEMATIC_POSITION Y=-15 SET_HOMED=Y
- G91
- G1 Y15 F1200
- #G4 P2000
- #M400 to finish all pending moves/process the buffer
- M400
- # Home
- G28 Y
- # Move away
- G91
- G1 Y15 F1200
- # Wait just a second… (give StallGuard registers time to clear)
- SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
- SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
- [homing_override]
- axes: xyz
- gcode:
- {% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
- SET_KINEMATIC_POSITION Z=1 SET_HOMED=Z
- G1 Z4 F1200
- {% if home_all or 'X' in params %}
- _HOME_X
- {% endif %}
- {% if home_all or 'Y' in params %}
- _HOME_Y
- {% endif %}
- {% if home_all or 'Z' in params %}
- G90
- G1 X175 Y175 F3000
- G28 Z
- G1 Z10 F1500
- {% endif %}
- [gcode_macro _CG28]
- description: Homing only if necessary
- gcode:
- {% if "xyz" not in printer.toolhead.homed_axes %}
- G28
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment