VoronDesign / Voron-0

Voron 0 CoreXY 3D Printer design
GNU General Public License v3.0
1.32k stars 385 forks source link

sensorless homing - firmware missing macro #256

Closed justgook closed 1 year ago

justgook commented 1 year ago

i just build voron 0.2, and started initial setup,documentation is nice, it even explains how to tune sensorless homing.. problem was that if home few times in row, printer starts grinding it self.. only later i found out that there is need for homing_override described in other section

it would be nice to include those macros in firmware examples (im using skr pico), as they (macros) is kind of required to make sensorless homing work properly.

numanair commented 1 year ago

I am using these macros which are inspired by that doc. Also, conditional/smart homing is extra beneficial when used with the slower sensorless homing. I just use the RatOS macro for that.

[homing_override]
axes: xyz
gcode:
  {% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}

  {% 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 %}
    _HOME_Z
  {% endif %}

[gcode_macro _HOME_X]
gcode:
  # Get settings
  {% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
  {% set homespeed = printer.configfile.config["stepper_x"]["homing_speed"]|float %}
  # Pause to ensure driver stall flag is clear (ms)
  G4 P2000
  # Home
  G28 X
  # Move away from edge to quiet motors
  G90
  G1 X{max_x - 5} F{homespeed * 60}

[gcode_macro _HOME_Y]
gcode:
  # Get settings
  {% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
  {% set homespeed = printer.configfile.config["stepper_y"]["homing_speed"]|float %}
  # Pause to ensure driver stall flag is clear (ms)
  G4 P2000
  # Home
  G28 Y
  # Move away from edge to quiet motors
  G90
  G1 Y{max_y - 5} F{homespeed * 60}

[gcode_macro _HOME_Z]
gcode:
    {% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
    {% set homespeed = printer.configfile.config["stepper_x"]["homing_speed"]|float %}
    G28 Z
    # Move away from endstop
    G90
    G1 Z{max_z - 5} F{homespeed * 60}
nemgrea commented 1 year ago

https://github.com/VoronDesign/Voron-0/pull/265