Skip to content
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

Make M109 S not wait for cooldown #2060

Open
wants to merge 2 commits into
base: MK3
Choose a base branch
from
Open

Make M109 S not wait for cooldown #2060

wants to merge 2 commits into from

Conversation

haarp
Copy link

@haarp haarp commented Jul 30, 2019

Make the Prusa firmware follow Marlin specs, as per http://marlinfw.org/docs/gcode/M109.html

fixes #1474

Flash: +78
RAM: +1

@DRracer DRracer added FW 3.9.0 RC1 firmware 3.9.0 RC1 and removed FW 3.9.0 Beta labels Jan 15, 2020
@DRracer DRracer added FW 3.9.0 and removed FW 3.9.0 RC1 firmware 3.9.0 RC1 labels Feb 17, 2020
@DRracer
Copy link
Collaborator

DRracer commented Mar 26, 2020

postponing to future release, this can be a breaking change of behavior, needs broader discussion

@bwright86
Copy link

I would like to see this feature added. I have been looking for a way ignore the "Blocking" M109 command, if my extruder is already above that temperature. This would allow my prints to start quicker, versus having to wait for the extruder to cool down to a midway temperature, then return to the full temperature.

This would be a breaking change, but I don't think it would be a negative one.
People are probably not using the "R" switch, since it has the same effect as "S", and "S" is the first switch in the command.

The scenario for using the M109 gcode is to block the queue before bed calibration, to ensure the extruder is to temperature. This is likely to prevent a cold blob on the extruder from causing issues during calibration.

I do not see this having a negative effect the other way around. If people were actively using the "R" switch, I don't believe it would negatively affect their print if it didn't block until the extruder came down to that desired temperature.

Here is an example of the current Prusa Start gcode:
(Original Prusa i3 MK2.5S MMU2S Single - PrusaSlicer v2.2.0)

M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
Tx
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
G28 W ; home all without mesh bed level
G80 ; mesh bed leveling

The scenario I use in my print jobs is to:

  • Set the heat bed to full temperate (Non-Blocking)
  • Set the extruder temp to partial temp 180C (Blocking)
  • After reaching the temp, set the full extruder temp (Non-Blocking)
  • Initiate the mesh bed leveling command while the extruder and heat bed come up to full temp.
  • After calibration, I set the heat bed full temp (Blocking) and the extruder full temp (Blocking), then finally start the print job.

This has the benefit of performing the mesh bed calibration while everything is still heating up. But preventing issues with a cold blob from a cold extruder.

Here is an example of my start Gcode:

M140 S[first_layer_bed_temperature] ; set bed temp
M109 S180 ; wait for extruder temp to reach 180 degrees.
M104 S[first_layer_temperature] ; set extruder temp

G28 W ; Home all Axis
G80 ; Automatic mesh bed leveling

G1 Z20 F800  ; Raise Z-Axis while heating
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp

Not having the "R" switch available causes issues with my scenario, when the extruder is already to full temperature (say 240C), and I start a print job. I must now wait for the extruder to cool to 180C. Rather than immediately starting the bed calibration, because the extruder is already hot enough to prevent a cold blob issue.

Please consider adding this to an upcoming firmware release.

@DRracer DRracer removed the FW 3.10.x label Apr 21, 2021
@DRracer DRracer added this to the FW 3.11.0 milestone Apr 21, 2021
@mmirate
Copy link

mmirate commented May 10, 2021

@bwright86 Why not (a) install a SuperPINDA and then just run the G80 on a cold hotend, and/or (b) adjust your end-of-the-print gcode to retract filament all the way out of the hot zone? (without unloading it from the extruder gears)

@bwright86
Copy link

bwright86 commented May 10, 2021 via email

@mmirate
Copy link

mmirate commented May 10, 2021

Hey @mmirate, that is a good point, and I just upgraded to an MK3S recently, so it has the SuperPINDA.

But it is a common scenario to still have a blob of filament on the end of the extruder after a print (no matter the retract logic), so usually the extruder is heated to make it soft.

I did mention this near the end of the comment, as a cold blob issue. If the extruder is cold and the blob hits the print bed, this can cause calibration issues. So SuperPINDA wouldn’t solve for that scenario.

Thanks for the comment!

Oh, sorry, I wasn't precise enough.

If you retract all the way out of the melt zone at the end of the print; then at the beginning of the next print, you should be able to heat the hotend all the way to the first-layer print temperature - softening the blob and probably increasing accuracy on PINDAv2 - without any more plastic oozing out from inside the nozzle, because it's too high to be melted by the hotend.
Hence my confusion.

Copy link
Collaborator

@leptun leptun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not do enough to be able to use M109 S and M109 R. This is because CooldownNoWait only gets set properly in M190. With M109, R and S have the same meaning at the moment and never update CooldownNoWait. If that part is fixed, the PR should work properly. Until I get to fix that, I'm blocking merging of this PR

Copy link
Collaborator

@leptun leptun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've synchronised this PR with the upstream changes and fixed the issues in my last review. I also tested the PR and everything seems to be working according to the spec (both bed and hotend).

@3d-gussner
Copy link
Collaborator

@haarp Can you please rebase the PR (again sorry) for the last time and fix the conflicts before we can merge it.

@bwright86
Copy link

bwright86 commented Aug 2, 2023 via email

@3d-gussner
Copy link
Collaborator

@wavexx @leptun @gudnimg Please review it after my rebase and conflict fixes.

@@ -235,6 +235,7 @@ uint8_t newFanSpeed = 0;
#endif

static bool cancel_heatup = false;
bool CooldownNoWait;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After re-reading this, it seems that wait_for_heater is also called from restore_extruder_temperature_from_ram, so the last value of M109 and M190 will affect the behavior of wait_for_heater, which is incorrect.

I don't see a reason why we need a global for this. I would add a parameter to wait_for_heater, with the default being false to match the previous behavior.

@@ -6102,7 +6105,7 @@ SERIAL_PROTOCOLPGM("\n\n");
case 190:
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
{
bool CooldownNoWait = false;
CooldownNoWait = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written before, this would cause M190 to affect the wait for extruder temperature during recovery.. which is not good. I would keep this one as-is.

@3d-gussner 3d-gussner modified the milestones: FW 3.13.1, FW 3.14.0 Aug 25, 2023
@3d-gussner 3d-gussner self-assigned this Nov 17, 2023
@3d-gussner 3d-gussner modified the milestones: FW 3.14.0, FW 3.14.1 Nov 28, 2023
@3d-gussner 3d-gussner removed this from the FW 3.14.1 milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

M109 S always waits for cooldown
7 participants