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

Add POWER_OFF_DELAY option #19987

Merged
merged 8 commits into from
Nov 9, 2020

Conversation

Kannix2005
Copy link
Contributor

@Kannix2005 Kannix2005 commented Nov 1, 2020

Description

Added a power off timeout before the printer/mainboard is shut off to enable a cooldown fan or other appliances to be powered even if the print has finished. The delay can be given in seconds.

Benefits

Power off delay not existing.

Configurations

POWER_OFF_DELAY added in Configuration.h under PSU_CONTROL section.

Related Issues

  • none -

@GMagician
Copy link
Contributor

GMagician commented Nov 1, 2020

Doesn't a G4 in PSU_POWEROFF_GCODE work?

@boelle
Copy link
Contributor

boelle commented Nov 1, 2020

i tried to search for PSU_POWEROFF_GCODE in both config files and could not find it

@Kannix2005
Copy link
Contributor Author

Doesn't a G4 in PSU_POWEROFF_GCODE work?

No not really: the printer won´t report a finish to e.g. octoprint with the added G-Code, because it is still "printing".

@thinkyhead thinkyhead changed the title Added power off timeout Power-off timeout Nov 8, 2020
@thinkyhead
Copy link
Member

This is slightly problematic, because there's no way to cancel the power-down, but you could go ahead and start a new print job while waiting for a long shutdown delay, and then the power would turn off at some point during the print job. It would be better to piggyback off of the POWER_TIMEOUT feature and just do this instead of spinning in safe_delay() to get the same effect, but in a way which can be canceled:

lastPowerOn = millis() - (POWER_TIMEOUT) + (POWER_OFF_TIMEOUT);

@thinkyhead thinkyhead changed the title Power-off timeout Add POWER_OFF_TIMEOUT option Nov 9, 2020
@thinkyhead thinkyhead changed the title Add POWER_OFF_TIMEOUT option Add POWER_OFF_DELAY option Nov 9, 2020
@thinkyhead thinkyhead merged commit 4ace02f into MarlinFirmware:bugfix-2.0.x Nov 9, 2020
FhlostonParadise pushed a commit to FhlostonParadise/Marlin that referenced this pull request Nov 21, 2020
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
tharts pushed a commit to tharts/Marlin that referenced this pull request Jan 6, 2021
dpreed pushed a commit to dpreed/Marlin_2.0.x that referenced this pull request Feb 5, 2021
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 28, 2021
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
thinkyhead added a commit that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants