-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] SD-Card removal during print stalls printer with heaters on #15390
Comments
As long as the heaters are still regulated i'm not very scared. The filament will be cooked in the nozzle - that's all. |
While this is true its still not good. Imagine doing a big print overnight and the printer does this and will just put a nice glob of plastic over your nozzle which isnt nice either. Now heating the PLA for that long time can produce fumes which arent exactly healthy. |
That is just my opinion. I definitely think the system should not go into a loop with heaters on. |
Interesting that you are experiencing the problem over USB. So the SD card can not be the only problem... Anyhow: Although I don't have a deep insight into Marlin code, I tried to track down the SD issue. Please feel free to confirm or correct me if I'm wrong.
As far as I can see this piece of code just goes back to the main screen but does not trigger any other events. I do not understand the communication between ScreenHandler and Marlin main code (does sendInfoScreen trigger events via memory addresses?), but comparing it to
I think the last piece of code does call events. The question now is: Ain't there a way the removed event could set the SD's flag card.flag.abort_sd_printing? That way Marlin's loop() code would stop the print, wouldn't it? Possible temporary workaround: |
Screen.GotoScreen is the function that switches the screen so its most likely that that functions calls some event. I havent took a look at marlin code ever so cant say for sure. |
Can any of the experts confirm the problem is caused by missing commands in the firmware? |
Seems right to me that a "mysteriously lost" SD card (or SD detect pin changing state) should trigger at least a PAUSE with PARK and timed cooldown, and perhaps a complete shutdown (KILL) if the machine is not attended-to within a reasonable timeframe. |
If you gave me a hint on the how Marlin deals with a lost card (events called) I'd be happy to give it a try. |
@asko58 still an issue? |
Yes, and some card refactoring is planned so it doesnt make sense to change before thats done. |
If an SD_DETECT_PIN is defined and the card is removed, that can be responded to with pause, if available, and a shutdown otherwise. And if there's no detect pin, when the printer is SD printing it can take note whether a long period of time has passed since the last command arrived from the SD card and pause in response to that. |
@InsanityAutomation is the card refactor still in the works? |
Nothing is in place for it at the moment. Work needs to be done but we've been busy with other commitments. |
Still an issue. |
This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days. |
This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days. |
I've just started looking to solve this and am confused as to why it doesn't work already. On line 1315 in MarlinCore.cpp in the main loop the SD status is checked and "abortSDPrinting" is called which seems to shut down everything including the heaters unless its disabled. |
This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days. |
Today another user with similar issue. Looking at marlin options, I think the best approach for any printing interruption is just use HOTEND_IDLE_TIMEOUT. It will handle any type of printing (serial, sd, with and without sd detect pin), and it will protect the printer. |
This one is almost more then a year old?! It only took me more then 15 minutes to find this bug because I was unsure why it was stopping without any feedback to the user and I fist suspected the TMC controllers because I needed to finish the drivers a bit. People having this issue should just remark the endFilePrint(); in Marlin/src/sd/cardreader.cpp under void CardReader::release(){ Since I removed that line prints don't fail anymore even if I remove the SD card a couple of times during a print. So basically if you pull the SD card for 1 second with endFilePrint() active, Marlin just sits there in a invalid state for ever and menu still think it's printing. |
I just sent a fix to abort the printing, if card is removed during a printing from SD. |
The fix was merged. I will close this. |
Does it put a message on the display when it stopped with the reason? Ps. Since I replaced my X stepper motor I haven't seen "Media Inserted" message yet, the stepper is a lot smaller and makes the printer vibrate a lot less when doing some parts of the infill... (but the stopping was pretty random so probably will see it again soon unless I fix it or replace the cheap display) haha |
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. |
This thread is related to my previous post, as can be seen here:
#15337
I have been able to track down the error, it seems to be a faulty connection or software error that makes Marlin unable to read the SD card for a few moments. As I have mentioned the heaters stay on and do not shut off. I have now reproduced the behaviour on SKR 1.3 and I think this is a severe security issue (possible fire hazard):
How to reproduce
(optional: - re-plug SD card)
expected behavior:
actual behavior:
The text was updated successfully, but these errors were encountered: