-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Resuming after Pause breaks relative E mode #1083
Comments
Some of the specified logic is already implemented. I think only the relative e is not restored on resume. Ideally first could be created gcode test files with the expected result for different combinations. |
In the meantime, here's some g-code as exported from Prusaslicer: bed spacer-standoff.gcode.zip |
The test fails due to thread join unrelated to kliment#1083 This is fixed with next commit, then fails for missing M83 command, which is fixed with another commit
@VanessaE , you can checkout this branch https://github.com/volconst/Printrun/commits/resume-rel-extr if it fixes the problem |
Sorry I took so long to get back to this one. I tested with an XYZ cube, and it seems to work as it should. I also used your test gcode file:
I guess that's a success 😃 I am not sure what you meant with that last bit about comparing behavior; what I did above suggests no unexpected changes. |
Thank you @VanessaE |
Oh you can ignore that, I was testing with the "factory" configuration rather than one of my usual config files and didn't bother to disable that option 😃 |
If the printer is in relative E mode as commanded by
M83
orG91
in the g-code, and you "Pause" and then immediately "Resume" the print without doing anything else, Pronterface forces the printer back into absolute E mode. I assume this actually applies to all axes and not just E.This leads to unpredictable results, but is guaranteed to fail.
As far as I'm aware, there's no way to query the printer for its default axis modes, or for which axes are in which mode at the moment, so I suggest the following:
When the print starts, before reading/sending any g-code, set a flag in the program to indicate XYZ are in absolute mode (they're always in the same mode, whatever it is), and set a flag indicating E is in absolute mode.
During the print, watch for
G90
,G91
,M82
, andM83
commands:G90
, set both the XYZ and E flags to indicate that they're absolute mode.G91
, set both flags to indicate everything's in relative mode.M82
, set the E flag to indicate absolute mode.M83
, set the E flag to indicate relative mode.On pause: immediately issue
M114
to get the current coordinates.On resume, we just need to read those flags and reset the mode(s):
G90
G1 ...
command to restore the nozzle position thatM114
reported earlierG92 X0 Y0 Z0
G92 E0
(if there's more than one extruder, you'll probably want to send pairs of tool change commands andG92 E0
, to reset all extruders to 0).G90
orG91
, according to the state of the XYZ flagM82
orM83
according to the state of the E flag (you can omit this if the flags match)This way Pronterface can do its usual stuff like jogging or homing in absolute mode, but should put the printer back into whatever state the g-code had it in on resume.
The text was updated successfully, but these errors were encountered: