Skip to content

Commit

Permalink
Homing: Fix homing method determination
Browse files Browse the repository at this point in the history
  • Loading branch information
miklschmidt committed Jan 5, 2024
1 parent c182e6a commit 55b1e37
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions homing.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ gcode:
{% set z_speed = printer["gcode_macro RatOS"].macro_z_speed|float * 60 %}
{% set z_hop = printer.configfile.config.ratos_homing.z_hop|float %}
{% set z_hop_speed = printer.configfile.config.ratos_homing.z_hop_speed|float * 60 %}
{% set homing = printer["gcode_macro RatOS"].homing|lower %}
{% set homing_x = printer["gcode_macro RatOS"].homing_x|lower %}
{% set homing_y = printer["gcode_macro RatOS"].homing_y|lower %}
{% set homing = printer["gcode_macro RatOS"].homing|lower %}
{% set homing_x = homing_x if homing_x else homing %}
{% set homing_y = homing_y if homing_y else homing %}
{% set prev_stop_on_error = printer["gcode_macro RatOS"].stowable_probe_stop_on_error %}

# Make stowable probe assertion failures cause an emergency stop
Expand All @@ -34,9 +36,9 @@ gcode:
G90 # Absolute positioning

{% if params.X is defined or params.Y is not defined and params.Z is not defined %}
{% if homing_x == 'endstop' or homing == 'endstops' %}
{% if homing_x == 'endstop' %}
G28 X
{% elif homing_x == 'sensorless' or homing == 'sensorless' %}
{% elif homing_x == 'sensorless' %}
HOME_X_SENSORLESS
{% else %}
{ action_emergency_stop("expected RatOS variable_homing_x to be 'sensorless' 'endstop' or variable_homing to be 'sensorless' or 'endstops' but found {} and {}".format(homing_x, homing)) }
Expand All @@ -46,9 +48,9 @@ gcode:
{% endif %}

{% if params.Y is defined or params.X is not defined and params.Z is not defined %}
{% if homing_y == 'endstop' or homing == 'endstops' %}
{% if homing_y == 'endstop' %}
G28 Y
{% elif homing_y == 'sensorless' or homing == 'sensorless' %}
{% elif homing_y == 'sensorless' %}
HOME_Y_SENSORLESS
{% else %}
{ action_emergency_stop("expected RatOS variable_homing_y to be 'sensorless' 'endstop' or variable_homing to be 'sensorless' or 'endstops' but found {} and {}".format(homing_y, homing)) }
Expand Down

0 comments on commit 55b1e37

Please sign in to comment.