Oozy END_PRINT bugfix (& filament runout/resume bugs)

I found a bug in the end_print macro. It is present in ALL of Zero’s firmwares. EDIT: Bugs also in SV06 ACE, SV08, and SV08 Max

Sovol intends to retract 4mm (with a little z hop in the middle) in this code block, which would reduce ooze at the end of the print and crud to deal with at the start of the next:

{% if printer['filament_switch_sensor filament_sensor'].enable == True and
      printer['filament_switch_sensor filament_sensor'].filament_detected == True %}
    {% if (printer.extruder.target != 0 and ... ) %}
        G1 E-2 F2700
        G1 E-2 Z0.2 F2400
    {% endif %}
{% endif %}

the trouble is the if statement never returns true, even with the filament_sensor present, because it needs to be checking enableD, like the rest of the macros, not enablE which doesn’t exist anywhere.

simple fix:

{% if printer['filament_switch_sensor filament_sensor'].enabled == True and
      printer['filament_switch_sensor filament_sensor'].filament_detected == True %}
    {% if (printer.extruder.target != 0 and ... ) %}
        G1 E-2 F2700
        G1 E-2 Z0.2 F2400
    {% endif %}
{% endif %}

Thanks to @scotte on Discord for also independently confirming this bug.

Am I missing something…both codes look the same to me.

precisely my point! Probably how Sovol missed it (it also fails silently)

enablE vs enableD

Thanks for pointing that out @rpcyan :100: TY :tumbler_glass:

I had to read the manual because like most things in the 3D printing world I didn’t understand the fix… Not to mention that I periodically hit the end of print ooze, was driving me nuts as the clean cycle always left a string on the cleaning brush or worse dropped in on the build plate when I started a new print…

Klipper Ref:

Cheers,
-Mike

Note that this is also present in the SV08 END_PRINT macro

Hi @sovol3d
Just in case, did you take note of that comment?

Thanks! Fixed for myself too.

What interesting, same file have like 4 similar lines, and 2 is right, while 2 was wrong spelled. Welll.. Happens~

Thanks rpcyan,

It’s the same on my S08 MAX.

Cheers for that info :slight_smile: That mistake appears 3 times in Macro.cfg.

Lines: 131, 278 & 302.

All are enable, rather than enabled.

I’m looking into the other instances you mentioned. It is NOT a blind s/enabled/enabled across all instances.

on your line 278, with this bug, the “Please Insert filament in sensor!” guard never fires. It goes immediately into the else branch and runs the E30/E10 purge and goes into RESUME_BASE. This can safely be simply renamed.

Your line 302 is tricker. Right now resume is refused whenever the switch reads empty, even with the sensor disabled. It needs both a rename and an inverted logic to get the desired behavior. it should read:

{% if printer['filament_switch_sensor filament_sensor'].enabled == True and
              printer['filament_switch_sensor filament_sensor'].filament_detected != True
        %}
            {action_respond_info("Please Insert filament in Sensor!")}

Which macro is this inverted logic needed? I have a modified cfg and the line numbers won’t match up.

There are three sections, I’ll list them in order along with their stock 1.3.7 firmware line number. your placement may vary with later firmwares and/or your own customizations

macro.cfg line location change
~119 END_PRINT macro simple s/enable/enabled change is OK
~291 filament change branch of RESUME simple s/enable/enabled change is OK
~315 normal branch of RESUME requires the logic flip of my previous post

I had just changed the first one, now I have done all three.
Thanks for your work.