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.17k stars 19.21k forks source link

[BUG] power loss recovery on latest marlin 2.1.x bugfix dosent work properly, restarts print instead of resuming. #25899

Closed Unanimous24 closed 1 year ago

Unanimous24 commented 1 year ago

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

Yes, and the problem still exists.

Bug Description

power loss recovery on latest marlin 2.1.x bugfix dosent work properly on ender 3 neo with a skr mini e3 v3. Instead of resuming print after clicking the resume button that comes after power loss, the printer parks the nozzle and then restarts the print entirely including the g28 and g29 commands.

Bug Timeline

No response

Expected behavior

Print in progress Power outage occurs After power comes back printer switches on Resume print menu occurs Select "resume" Nozzle reheats and returns to finish layer where it left

Actual behavior

Print in progress Power outage occurs After power comes back printer switches on Resume print menu occurs Select "resume" Printer homes x and y Nozzle parks in front left corner Heats to 180 (instead of the 203 print temp) Nozzle then heats to 150 Starts ABL part of the gcode Restarts print

Steps to Reproduce

1.[start print] 2.[switch printer off] 3[select resume print after switching on]

Version of Marlin Firmware

2.1.x bugfix

Printer model

Ender 3 neo

Electronics

Upgraded to the skr mini e3 v3 motherboard

Add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Prusa Slicer

Host Software

None

Don't forget to include

Additional information & file uploads

Config files below

Configuration.zip

vfbank commented 1 year ago

The position of the blue marlin's home position is assigned to 'RAM', a volatile storage device, and when the power is turned off, the location information stored in the memory is naturally lost, so the XYZ position cannot be known. Therefore, it is natural to return to the original position when restarting. It's not a bug. To use this function, only printers with a structure that does not touch the output on the x-axis or y-axis can be used.

Unanimous24 commented 1 year ago

The position of the blue marlin's home position is assigned to 'RAM', a volatile storage device, and when the power is turned off, the location information stored in the memory is naturally lost, so the XYZ position cannot be known. Therefore, it is natural to return to the original position when restarting. It's not a bug. To use this function, only printers with a structure that does not touch the output on the x-axis or y-axis can be used.

Yea but it used to work originally on the stock software. Apart from that it is restarting the print entirely instead of just loosing coordinates

plampix commented 1 year ago

POWER_LOSS_RECOVERY saves the current z-height on every layer, and apparently that works, otherwise you wouldn't get a resume option after powering on again. So it's either a bug, an issue with the SD card, or power loss at the exact moment marlin is saving the data to SD (very small chance) causing corrupted data.

Unanimous24 commented 1 year ago

The thing is I've tried it multiple times and it does this each time ( restarts print instead of resume)

plampix commented 1 year ago

If you cancel the recovery, turn the printer off and on again, does it still ask you to resume (it shouldn't)? (just to check if marlin is able to remove the recovery file)

plampix commented 1 year ago

If you've connected your printer to a computer, you could uncomment the //#define DEBUG_POWER_LOSS_RECOVERY line in Marlin/src/feature/powerloss.h, rebuild, and watch the serial output.

Unanimous24 commented 1 year ago

If you cancel the recovery, turn the printer off and on again, does it still ask you to resume (it shouldn't)? (just to check if marlin is able to remove the recovery file)

It dosent. If I cancel the print and then restart it dosent give an option to resume

Unanimous24 commented 1 year ago

If you've connected your printer to a computer, you could uncomment the //#define DEBUG_POWER_LOSS_RECOVERY line in Marlin/src/feature/powerloss.h, rebuild, and watch the serial output.

I'll do that. I also saw some person comment about another problem related to power loss recovery a few years ago where it would just go back to it's last position and freeze and he said that adding

Card.release(); Card.mount();

Under printjobrecovery::resume() fixed the issue for him so I'll try that as well and see what happens

Unanimous24 commented 1 year ago

If you've connected your printer to a computer, you could uncomment the //#define DEBUG_POWER_LOSS_RECOVERY line in Marlin/src/feature/powerloss.h, rebuild, and watch the serial output.

This is what I get on Pronterface after resuming print :

Disconnected. Connecting... Printer is now online. echo:SD card released echo:SD card ok echo:Bed Leveling OFF echo:Fade Height 10.00 echo:Home XYZ First echo:Bed Leveling OFF echo:Fade Height 10.00 echo:Now fresh file: /SHAPE-~1.GCO File opened: SHAPE-~1.GCO Size: 401340 File selected //action:resume //action:prompt_end //action:prompt_begin Resuming SD //action:prompt_button Dismiss //action:prompt_show M106 P0 S0

I then shut down the printer so that it wouldn't crash into the print

thinkyhead commented 1 year ago

With DEBUG_POWER_LOSS_RECOVERY you can also do some tests with M413 outside of a print job, and it will print out the PLR information that is being saved / loaded. This can help to see what's going on internally.

Depending on which LCD controller you have, there might be customized behavior that could cause some inconsistencies. But the core feature should still work.

  #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
    if (parser.seen("RL")) recovery.load();
    if (parser.seen_test('W')) recovery.save(true);
    if (parser.seen_test('P')) recovery.purge();
    if (parser.seen_test('D')) recovery.debug(F("M413"));
    if (parser.seen_test('O')) recovery._outage(true);
    if (parser.seen_test('C')) (void)recovery.check();
    if (parser.seen_test('E')) SERIAL_ECHOF(recovery.exists() ? F("PLR Exists\n") : F("No PLR\n"));
    if (parser.seen_test('V')) SERIAL_ECHOF(recovery.valid() ? F("Valid\n") : F("Invalid\n"));
  #endif
Unanimous24 commented 1 year ago

Can you guide me on how to do this? I connected it to my PC and opened pronterface but when I enter m413 it sends back "M413 S1; ON"

github-actions[bot] commented 1 year ago

This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.

github-actions[bot] commented 11 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.