jschuh/klipper-macros

[BUG] Homing bypassing [Probe] Activate Gcode

Firas95k opened this issue · 1 comments

Before making a report please ensure you've followed the troubleshooting steps at:
https://github.com/jschuh/klipper-macros#troubleshooting

You can also get general troubleshooting assistance in the Q&A Discussion tab:
https://github.com/jschuh/klipper-macros/discussions/categories/q-a

Describe the bug
On my Voron 2.4r2 I am using sensorless homing and Voron TAP (uses the nozzle as probe), noticed with the last full update that homing was halfway done (only first probe touch down to bed) with higher nozzle temp than the max in [Probe] Activate Gcode which was 135degC, then Klipper waits for the nozzle to cooldown to 130degC to do the second touch down and finish the homing command.

Update: Reverted back to only mainsail macros and disabled everything else the issue was gone, then used klipper-macros only, the issue appeared again.

Klipper errors
10:44 PM
Extruder temperature 135.7C is still too high, waiting until below 135.0C
10:44 PM
Extruder temperature target of 180.0C is too high, lowering to 130.0C
10:44 PM
Run Current: 0.80A Hold Current: 0.80A
10:44 PM
Run Current: 0.80A Hold Current: 0.80A
10:44 PM
Run Current: 1.36A Hold Current: 1.36A
10:44 PM
Run Current: 1.36A Hold Current: 1.36A
10:44 PM
Run Current: 0.80A Hold Current: 0.80A
10:44 PM
Run Current: 0.80A Hold Current: 0.80A
10:44 PM
Run Current: 1.36A Hold Current: 1.36A
10:44 PM
Run Current: 1.36A Hold Current: 1.36A
10:44 PM
G28
10:44 PM
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=180
10:42 PM
TURN_OFF_HEATERS
10:41 PM
M117 Same behavior when homing again after last homing (Motors kept enabled from last time)
10:38 PM
Extruder temperature 171.2C is still too high, waiting until below 135.0C
10:38 PM
Extruder temperature target of 170.0C is too high, lowering to 130.0C
10:38 PM
Run Current: 0.80A Hold Current: 0.80A
10:38 PM
Run Current: 0.80A Hold Current: 0.80A
10:37 PM
Run Current: 1.36A Hold Current: 1.36A
10:37 PM
Run Current: 1.36A Hold Current: 1.36A
10:37 PM
Run Current: 0.80A Hold Current: 0.80A
10:37 PM
Run Current: 0.80A Hold Current: 0.80A
10:37 PM
Run Current: 1.36A Hold Current: 1.36A
10:37 PM
Run Current: 1.36A Hold Current: 1.36A
10:37 PM
G28
10:36 PM
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=170
10:36 PM
M117 Homing from disabled motors Behavior, First probe touchdown with 150degC (Max as per Probe Gcode is 135degC, so it should not be possible), waited to cooldown to 130degC to do second touchdown to finish Homing
10:30 PM
Extruder temperature 147.8C is still too high, waiting until below 135.0C
10:30 PM
Extruder temperature target of 150.0C is too high, lowering to 130.0C
10:30 PM
Run Current: 0.80A Hold Current: 0.80A
10:30 PM
Run Current: 0.80A Hold Current: 0.80A
10:30 PM
Run Current: 1.36A Hold Current: 1.36A
10:30 PM
Run Current: 1.36A Hold Current: 1.36A
10:30 PM
Run Current: 0.80A Hold Current: 0.80A
10:30 PM
Run Current: 0.80A Hold Current: 0.80A
10:29 PM
Run Current: 1.36A Hold Current: 1.36A
10:29 PM
Run Current: 1.36A Hold Current: 1.36A
10:29 PM
G28
10:28 PM
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=150

Klipper config
Attached Klippy.log and my printer configs. TBH I noticed the issue after updating everything (Last time I updated ~3month ago).

[probe]
activate_gcode:
{% set PROBE_TEMP = 130 %}
{% set MAX_TEMP = PROBE_TEMP + 5 %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}

{% if TARGET_TEMP > PROBE_TEMP %}
    { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
    M109 S{ PROBE_TEMP }
{% else %}
    # Temperature target is already low enough, but nozzle may still be too hot.
    {% if ACTUAL_TEMP > MAX_TEMP %}
        { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
        TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
    {% endif %}
{% endif %}

klippy.zip
config-20240807-221807.zip

Update: Monkey Patched by inserting [Probe] Activate Gcode in the [homing_override] as below

`
[homing_override]
set_position_z: 10
gcode:

G0 Z10 F1200

{% 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 %}
G90
G1 X175 Y175 F12000 ## Change this. Should home to the z endstop pin if you don't use TAP. Also, this is for a Voron 2.4 350.

{% set PROBE_TEMP = 130 %}
{% set MAX_TEMP = PROBE_TEMP + 5 %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}

{% if TARGET_TEMP > PROBE_TEMP %}
    { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
    M109 S{ PROBE_TEMP }
{% else %}
    # Temperature target is already low enough, but nozzle may still be too hot.
    {% if ACTUAL_TEMP > MAX_TEMP %}
        { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
        TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
    {% endif %}
{% endif %}

 G28.6245197 Z   ## Home Z
 # G28 Z
G1 Z10 F1200

{% endif %}

`

So far it seems like a working solution.
klippy.log
config-20240808-183551.zip