kevinakasam / ERCF_Filament_Cutter

A simple Filament Cutter for the awesome ERCF!
GNU General Public License v3.0
163 stars 15 forks source link

Macro CUTTER_ACTION called recursively #9

Closed pmyrie closed 5 months ago

pmyrie commented 5 months ago

hi, after updating happy-hare to 2.4 every time theh cutter action is call i get,

An issue with the MMU has been detected whilst out of a print Reason: Error running _MMU_POST_UNLOAD: Macro CUTTER_ACTION called recursively.

BioCookieYT commented 5 months ago

Hi, gonna find a solution ASAP. Please use HHv2.3 if possible

Raabi91 commented 5 months ago

hi, after updating happy-hare to 2.4 every time theh cutter action is call i get,

An issue with the MMU has been detected whilst out of a print Reason: Error running _MMU_POST_UNLOAD: Macro CUTTER_ACTION called recursively.

please upload you klipper log

pmyrie commented 5 months ago

Hi sorry for the delay.

klippy.log

Tutankamon00 commented 5 months ago

Any news? because of this i 'am unable to use ercf, it go in pause and not resume immagine

moggieuk commented 5 months ago

Kevin, the issue is that MMU_EJECT should not be called from within the _MMU_POST_UNLOAD macro because that will cause the recursive callback (yes, it just happened to work previously but should not have. lol).

The fix is to replace MMU_EJECT with _MMU_STEP_UNLOAD_GATE

So that the individual step of unloading the gate is called, not the whole unload sequence.

So I'd recommend:

# New Cutter Action Macro - thanks to xF4m3
[gcode_macro CUTTER_Action]
description: Set Servo in the close position. Doesn't work properly yet.
gcode:
    {% set cutvar = printer["gcode_macro _CUT_VAR"] %}

    CUTTER_OPEN
    MMU_TEST_MOVE MOVE={cutvar.feed_length + cutvar.cut_length}
    {% for i in range(cutvar.cut_amount) %}
      CUTTER_CLOSE
      CUTTER_OPEN
    {% endfor %}
    MMU_TEST_MOVE MOVE=-1
    CUTTER_CLOSE

   _MMU_STEP_SET_FILAMENT STATE=1 
   _MMU_STEP_UNLOAD_GATE

    M400
    G4 P0
Tutankamon00 commented 5 months ago

I tried the Moggieuk solution and work perfect, thank you :)

BioCookieYT commented 5 months ago

Kevin, the issue is that MMU_EJECT should not be called from within the _MMU_POST_UNLOAD macro because that will cause the recursive callback (yes, it just happened to work previously but should not have. lol).

The fix is to replace MMU_EJECT with _MMU_STEP_UNLOAD_GATE

So that the individual step of unloading the gate is called, not the whole unload sequence.

So I'd recommend:

# New Cutter Action Macro - thanks to xF4m3
[gcode_macro CUTTER_Action]
description: Set Servo in the close position. Doesn't work properly yet.
gcode:
    {% set cutvar = printer["gcode_macro _CUT_VAR"] %}

    CUTTER_OPEN
    MMU_TEST_MOVE MOVE={cutvar.feed_length + cutvar.cut_length}
    {% for i in range(cutvar.cut_amount) %}
      CUTTER_CLOSE
      CUTTER_OPEN
    {% endfor %}
    MMU_TEST_MOVE MOVE=-1
    CUTTER_CLOSE

   _MMU_STEP_SET_FILAMENT STATE=1 
   _MMU_STEP_UNLOAD_GATE

    M400
    G4 P0

Thank you so much for helping out! I update the Readme in a bit.