Skip to content

Commit

Permalink
Save/Restore extruder temperature on pause/resume (#13)
Browse files Browse the repository at this point in the history
* Save/Restore extruder temperature on pause/resume (#1)

Possibility to cooldown the extruder on idle timeout or manually paused.
On resume, the previous extruder temperature is set and wait for.
If extruder temperature was not changed, nothing happens.

Signed-off-by: Frank Roth [email protected]
  • Loading branch information
freakydude authored Apr 19, 2023
1 parent 52d4c47 commit ea19d72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,24 @@ gcode:
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}"

PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
variable_last_extruder_temp: 0
gcode:
##### get user parameters or use default #####
{% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %}
{% set client = printer['gcode_macro _CLIENT_VARIABLE'] %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %}
##### end of definitions #####
M109 S{last_extruder_temp}

_CLIENT_EXTRUDE
RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}

Expand Down

6 comments on commit ea19d72

@mrskizzex
Copy link

Choose a reason for hiding this comment

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

Hi, this change is extremely annoying if you want to use different type of filament after resume. This should be an option to set in _CLIENT_VARIABLE and not a default.

@zellneralex
Copy link
Member

@zellneralex zellneralex commented on ea19d72 Jun 15, 2023

Choose a reason for hiding this comment

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

We did not think about it, I guess you change filament and set the new temp while in Pause. Is this assumption correct?

Would it be an option to hinder it while calling PAUSE, so that you can use it in your M600 e.g.

[gcode_macro M600]
gcode:
    PAUSE RESTORE=0

Or do you need that really as a general option?

@mrskizzex
Copy link

@mrskizzex mrskizzex commented on ea19d72 Jun 15, 2023

Choose a reason for hiding this comment

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

Yeah, it would work just fine if I could disable it while calling PAUSE. Basically any way to disable restoring original temperature that was set before the pause.

@zellneralex
Copy link
Member

Choose a reason for hiding this comment

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

Currently we internally discuss 3 possible solution:

  1. add a parameter to PAUSE (like mentioned above)
  2. do the restore only if coming from a idle_timeout (need to check if we can still see the correct timeout state when RESUME is executed)
  3. do a disable in _CLIENT_VARIABLE. So it would be enabled by default and if it makes troubles you would disable it

For 2) I would need to know from you if that would be an option for you, that would be in my opinion the cleanest solution

@mrskizzex
Copy link

Choose a reason for hiding this comment

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

Like I said, anything would work that doesn't require me to use a different mainsail.cfg. So number 2 would work for me just fine.

@zellneralex
Copy link
Member

Choose a reason for hiding this comment

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

Could you do me an favor and check if https://github.com/mainsail-crew/mainsail-config/tree/feat_prohib_restore_temp is what you looking for?

It change 2 things

  1. it resores the temp only comming from idle_timeout
  2. you can disable the restore on a call by call bases using PAUSE RESTORE=0

The second option is more for extra macros like M600

Please sign in to comment.