doom-micron/sensorless.cfg

64 lines
1.8 KiB
INI

[gcode_macro SENSORLESS_HOME_X]
gcode:
{% set HOME_CUR = 0.300 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
{% set RUN_CUR = driver_config.run_current %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
# Pause to ensure driver stall flag is clear
G4 P2000
# Home
G28 X0
# Move away
G91
G1 X98 F{400*60} # dodge probe
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
G90
[gcode_macro SENSORLESS_HOME_Y]
gcode:
{% set HOME_CUR = 0.300 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_y'] %}
{% set RUN_CUR = driver_config.run_current %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
# Pause to ensure driver stall flag is clear
G4 P2000
# Home
G28 Y0
# Move away
G91
G1 Y-5 F{400*60}
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
G90
[homing_override]
axes: xyz
gcode:
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
{% set probe_offset = 24.2 %}
{% if home_all or 'X' in params %}
SENSORLESS_HOME_X
{% endif %}
{% if home_all or 'Y' in params %}
SENSORLESS_HOME_Y
{% endif %}
{% if home_all or 'Z' in params %}
G90 # Absolute positioning
# park above bed center
G1 X90 Y{90 - probe_offset} # With probe
G28 Z
G91
G1 Z10
{% endif %}