MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.32k stars 19.25k forks source link

[BUG] M600 and pause broken on Ender-3 S1 (and V2?) #24996

Open Jackson240193 opened 2 years ago

Jackson240193 commented 2 years ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

After flashing to version 2.1.1 or 2.1.x, there was a problem with resuming printing after a pause. ... When printing from an SD card, when you press pause, the print head parks as it should. But after pressing the resume print, the print head returns to the last print location and freezes. ... In this case, during the pause, a second problem arises. If you choose to clean the filament when printing is resumed, then after the extruder pushes the required amount of filament, the printer will also freeze. But this problem in firmware version 2.1.1 is treated by modifying the file:

dwin.cpp in /src/lcd/e3v2/jyersui/:

case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; CrealityDWIN.Popup_Handler(PurgeMore); break;

In version 2.1.x, this fix did not work. ... I'm using a stock Ender 3 S1 on STM32F4. There were no problems with the pause with the native firmware of this printer.

Bug Timeline

This is a new bug. Started after firmware version 2.1.1.

Expected behavior

After clicking on resume printing, I expected the print head to return to the last print location and, accordingly, continue printing.

Actual behavior

After pressing Resume Printing, the print head returns to the last print location and freezes. Printing does not continue.

Steps to Reproduce

  1. Flash the Ender 3 S1 printer to version 2.1.1.
  2. Start printing any model from the SD card.
  3. Pause.
  4. Resume printing.
  5. Get a frozen printer.

Version of Marlin Firmware

2.1.1 or 2.1.x

Printer model

Ender 3 S1 on STM32F4

Electronics

Stock electronics on STM32F4

Add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Cura

Host Software

SD Card (headless)

Don't forget to include

Additional information & file uploads

Configuration.zip 1 2 3

Jackson240193 commented 2 years ago

UPD: The problem is precisely when executing the m600 command. ... If you write the m600 command in the gcode or simulate the situation with the end of the filament when the thread beat sensor is triggered, then the situation described above occurs: The print head parks, but when the LCD confirms the replacement of the filament, printing does not continue, the printer freezes. Only restarting the printer helps.

thinkyhead commented 2 years ago

Do you see the same issue when using the other UI options, like ProUI ?

Jackson240193 commented 2 years ago

Hello. Tell me please. To test this I have to uncomment it here?

Configuration.h

//============================================================================= //============================ Other Controllers ============================ //=============================================================================

// // Ender-3 v2 OEM display. A DWIN display with Rotary Encoder. // //#define DWIN_CREALITY_LCD // Creality UI //#define DWIN_LCD_PROUI // Pro UI by MRiscoC

define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers

//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation) //#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation)

And finally check with this:

//#define DWIN_CREALITY_LCD // Creality UI

define DWIN_LCD_PROUI // Pro UI by MRiscoC

//#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers //#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation) //#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation)

Jackson240193 commented 2 years ago

Observations (suddenly will help in solving the problem):

If you insert a pause command m25 or m125 in the gcode, then the process of pausing and resuming printing will work. The print head will park and after confirmation via the display, it will return and continue printing. At the same time, the function of cleaning the filament during a pause also works. Interestingly: When using the m25 command, printing resumes immediately. But if you use the m125 command, printing resumes with a delay of 10-15 seconds. I can’t understand what this is connected with, because the m25 command, according to the idea, calls the m125 command...

_m24m25.cpp:

void GcodeSuite::M25() {

if ENABLED(PARK_HEAD_ON_PAUSE)

  M125();
#else

...

At the same time, if the printer paused with the M25 command written in the Gcode, you cannot enter the settings menu and change the print settings: when you select Tune, a window pops up on the display with the choice of cleaning the filament or continuing printing. And it is not possible to change the print settings during the pause. And cleaning the filament and continuing to print under these conditions works. ... If, during the M25 pause, the filament is physically replaced, the filament replacement procedure will be called when the thread break sensor is triggered (I think that the M600 command is triggered at this moment). If after that you replace the filament and confirm on the display that the filament has been replaced, a window will pop up with the choice of cleaning the filament or continuing printing. And cleaning the filament and continuing to print under these conditions works.

Conclusion: problems arise when a pause is called from the LCD display during printing or when the thread beat sensor (M600 command) is triggered during printing.

Checked on firmware version 2.1.1 with the above correction of the dwin.cpp file in /src/lcd/e3v2/jyersui/

RV-from-be commented 1 year ago

@Jackson240193 it's easy to fix it. I use this patch since one year wihtout issue:

Replace in Marlin/src/lcd/e3v2/common/encoder.cpp:

if (!ui.backlight) ui.refresh_brightness();
      const bool was_waiting = wait_for_user;
      wait_for_user = false;
      return was_waiting ? ENCODER_DIFF_NO : ENCODER_DIFF_ENTER;
    }
    else return ENCODER_DIFF_NO;

by:

if (!ui.backlight) ui.refresh_brightness();
      else {
        #if ENABLED(DWIN_CREALITY_LCD_JYERSUI)
          return ENCODER_DIFF_ENTER;
        #else
          const bool was_waiting = wait_for_user;
          wait_for_user = false;
          return was_waiting ? ENCODER_DIFF_NO : ENCODER_DIFF_ENTER;
        #endif
      }
    }
    else return ENCODER_DIFF_NO;
Jackson240193 commented 1 year ago

@RV-from-be Thank you very much! Your patch really works. Pausing from the display while printing works as it should. At the same time, during the pause, it became possible to enter the "TUNE" menu and change the print settings. Resume printing works too!

But the problem with the printer freezing when the thread beat sensor was triggered remained unresolved (M600): The print head parks, a window pops up on the display to confirm the replacement of the filament. After confirming the filament replacement and choosing to continue printing, the printer freezes. The following message appears on the display: Resuming Print Please wait until done. Only restarting the printer helps.

Tested on version 2.1.1 with fixes for the following files:

Marlin/src/lcd/e3v2/jyersui/dwin.cpp Marlin/src/lcd/e3v2/common/encoder.cpp

6490dk commented 1 year ago

@RV-from-be Thank you very much! Your patch really works. Pausing from the display while printing works as it should. At the same time, during the pause, it became possible to enter the "TUNE" menu and change the print settings. Resume printing works too!

But the problem with the printer freezing when the thread beat sensor was triggered remained unresolved (M600): The print head parks, a window pops up on the display to confirm the replacement of the filament. After confirming the filament replacement and choosing to continue printing, the printer freezes. The following message appears on the display: Resuming Print Please wait until done. Only restarting the printer helps.

Tested on version 2.1.1 with fixes for the following files:

Marlin/src/lcd/e3v2/jyersui/dwin.cpp Marlin/src/lcd/e3v2/common/encoder.cpp

I have the same problem. Any solutions yet?

RV-from-be commented 1 year ago

@Jackson240193

But the problem with the printer freezing when the thread beat sensor was triggered remained unresolved (M600): The print head parks, a window pops up on the display to confirm the replacement of the filament. After confirming the filament replacement and choosing to continue printing, the printer freezes. The following message appears on the display: Resuming Print Please wait until done. Only restarting the printer helps

I have tried either by adding an M600 in a gcodes file, or by generating a runout. The printer (ender3v2) correctly resumes printing and returns to the Print page as expected. Not having an ender3 S1, I cannot confirm or refute the proper functioning.

6490dk commented 1 year ago

@Jackson240193

But the problem with the printer freezing when the thread beat sensor was triggered remained unresolved (M600): The print head parks, a window pops up on the display to confirm the replacement of the filament. After confirming the filament replacement and choosing to continue printing, the printer freezes. The following message appears on the display: Resuming Print Please wait until done. Only restarting the printer helps

I have tried either by adding an M600 in a gcodes file, or by generating a runout. The printer (ender3v2) correctly resumes printing and returns to the Print page as expected. Not having an ender3 S1, I cannot confirm or refute the proper functioning.

I also have the Ender 3v2, but I have the problem... Maybe it's because of the yjearsui?

RV-from-be commented 1 year ago

@Jackson240193 I am too with JyersUI.

RV-from-be commented 1 year ago

@Jackson240193 I also forgot this change in \src\feature\pause.cpp:

#if ENABLED(EXTENSIBLE_UI)
  #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
  #include "../lcd/e3v2/proui/dwin.h"
#endif

by:

#if ENABLED(EXTENSIBLE_UI)
  #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
  #include "../lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
  #include "../lcd/e3v2/jyersui/dwin.h"
#endif

and:

#if M600_PURGE_MORE_RESUMABLE
        if (show_lcd) {
          // Show "Purge More" / "Resume" menu and wait for reply
          KEEPALIVE_STATE(PAUSED_FOR_USER);
          wait_for_user = false;
          #if EITHER(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
            ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
          #else
            pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
          #endif
          while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
        }
      #endif

by:

#if M600_PURGE_MORE_RESUMABLE
        if (show_lcd) {
          // Show "Purge More" / "Resume" menu and wait for reply
          KEEPALIVE_STATE(PAUSED_FOR_USER);
          wait_for_user = false;
          #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
            ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
          #else
            pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
          #endif
          while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
        }
      #endif

and: TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING)); by:

TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING));
TERN_(DWIN_CREALITY_LCD_JYERSUI, LCD_MESSAGE(MSG_REHEATING));

and: TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE)); by:

TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE));
TERN_(DWIN_CREALITY_LCD_JYERSUI, LCD_MESSAGE(MSG_REHEATDONE));
6490dk commented 1 year ago

@Jackson240193 I also forgot this change in \src\feature\pause.cpp:

#if ENABLED(EXTENSIBLE_UI)
  #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
  #include "../lcd/e3v2/proui/dwin.h"
#endif

by:

#if ENABLED(EXTENSIBLE_UI)
  #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
  #include "../lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
  #include "../lcd/e3v2/jyersui/dwin.h"
#endif

and:

#if M600_PURGE_MORE_RESUMABLE
        if (show_lcd) {
          // Show "Purge More" / "Resume" menu and wait for reply
          KEEPALIVE_STATE(PAUSED_FOR_USER);
          wait_for_user = false;
          #if EITHER(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
            ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
          #else
            pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
          #endif
          while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
        }
      #endif

by:

#if M600_PURGE_MORE_RESUMABLE
        if (show_lcd) {
          // Show "Purge More" / "Resume" menu and wait for reply
          KEEPALIVE_STATE(PAUSED_FOR_USER);
          wait_for_user = false;
          #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
            ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
          #else
            pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
          #endif
          while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
        }
      #endif

and: TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING)); by:

TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING));
TERN_(DWIN_CREALITY_LCD_JYERSUI, LCD_MESSAGE(MSG_REHEATING));

and: TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE)); by:

TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE));
TERN_(DWIN_CREALITY_LCD_JYERSUI, LCD_MESSAGE(MSG_REHEATDONE));

Yay, it's working again. Thanks a lot for your help!!!

Jackson240193 commented 1 year ago

@RV-from-be Yes, it works!!! Thank you very much!!! Now, when the M600 command is called or when the thread beat sensor is triggered, printing resumes without problems!!!

I ask the developers, if possible, to add these fixes to the firmware.

Tested on firmware version 2.1.1 with fixes for the following files:

silentpain711 commented 1 year ago

@RV-from-be where is the fix for my problem? i see only fixes for freezes by M600 and no fix for not working Bed Leveling with Z Probe.

sammcj commented 1 year ago

Is there a workaround for the resume without having to rebuild your firmware? (e.g. some custom gcodes / settings before the printing tries to start again)

sammcj commented 1 year ago

Also - confirming this bug impacts the Ender 3 v2 Neo (4.2.2).

RV-from-be commented 1 year ago

@sammcj No, sorry! You must rebuild the firmware with these fix.

gunderbolt commented 1 year ago

I'm running with the code changes provided by @6490dk and the Filament Resume seems to work now. However, I'm seeing a few things and I'm not sure if they are due to these changes or not:

  1. The prompt to continue extruding filament or resume the print appears before the extruder motor has finished. I was previously using this pre-built binary from Jyers' branch and it waited until the filament stopped extruding before the dialog appeared.
  2. After several prints, the messages to the LCD screen from the M117 gcode stopped working. That area of the screen was blank while printing.

Thanks for your guys' work on this!

leseaw commented 1 year ago

Hi,

with ender 5 plus and last firmware, the same problem there too. How can we fix it there?

JoJos1220 commented 9 months ago

I got the same issue with ender 5 plus. Pause/Resume and filament change M600 is not possible.

Ender 5 plus Marlin Bugfix 2.1.x from today Stock LCD Screen BIGTREETECH Skr mini v3

YannickAdriaenssens commented 2 months ago

I got the same issue with ender 5 plus. Pause/Resume and filament change M600 is not possible.

Ender 5 plus Marlin Bugfix 2.1.x from 08/24 Stock LCD Screen BIGTREETECH SKR3

Any idea when this would be solved?

thisiskeithb commented 2 months ago

I got the same issue with ender 5 plus. Pause/Resume and filament change M600 is not possible.

@YannickAdriaenssens: Your printer uses a different display/firmware and is not related to this issue. Also, you've also already commented on the correct issue for your hardware, so please follow that one for updates.

YannickAdriaenssens commented 2 months ago

@thisiskeithb okay will do, thank you!