Welcome! Log In Create A New Profile

Advanced

Filament out sensor extension for Marlin Gcode

Posted by buildrob 
Filament out sensor extension for Marlin Gcode
May 22, 2014 09:24AM
There is a github feature request for a Marlin firmware feature to pause the print when a filament out sensor is triggered (but obviously could also be linked to an explicit pause/resume button).

The discussion isn't getting much visibility and so I wanted to hear other people's thoughts.
[github.com]

For SD card prints with an LCD this is not too difficult because the Marlin firmware is in control of the print.

For host-based G-code is it more diffcult because the host is primarily in control of the print. And the G-code doesn't allow any sort of asynchronous recoverable event reporting.

Ideally you want some mechanism where
a) pausing the print which does not cause unware host implementations to break, but
b) allows host implementations which are aware of the event to provide a richer experience.

My suggestion is as follows:

The main problem is that Marlin has no way to indicate events back to the host. So can we extend the G-code protocol in a harmless way to return something other than ok, rs, !!, // to indicate an event has occurred - in addition to returning the normal rs/Resend response? For instance, could we send a response such as:

%% S="Print paused - loss of filament detected on extruder 1"
Resend: 546

The %% would be used to indicate that this is an event rather than just a // informational comment.

On an unaware host the unknown %% response should just be ignored by the host program (Marlin does after all send all sorts of other non-standard response strings on the serial port without using the // prefix so I would expect a host not to choke on non-standard strings). An unaware host would hopefully then just continue to resend the command until the system restarts. [If the host doesn't support resumption, this would require that you have either an LCD or just a dedicated "Pause/Resume" button on the printer (as you don't want the printer automatically restarting - potentially while you're still messing about with the extruder - i.e., safety issue).]

A host program which is aware of the meaning of the %% message can however
a) Display the event message on the screen (asking if they want to attempt to resume printing/clear fault which may or may not be successful).
b) It could then send an as yet undefined M??? Resume Printing command to attempt to restart the printing when requested by the user (e.g., after the reinserting the filament) instead of just continuing to resending the same command like an unaware host would.

Thoughts? Do you think this will cause existing hosts to break?

Edited 3 time(s). Last edit at 05/23/2014 09:28AM by buildrob.
Sorry, only registered users may post in this forum.

Click here to login