-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Introduce temp watch protection for the bed #3554
Conversation
When setting the bed temp via M140/M190 if the thermistor does not read an increase of WATCH_BED_TEMP_INCREASE degrees by WATCH_BED_TEMP_PERIOD seconds then it will throw "Error:Heating failed, system stopped! Heater_ID: bed" and call the kill() function. Conflicts: Marlin/Configuration_adv.h
…configuration headers and not WATCH_TEMP_PERIOD and WATCH_TEMP_INCREASE
This looks like a well made reinvention of my #2310 and it's followers. To find a consensus about the activation of this feature will be much easier these days. Most of the beds out there do not need this feature at all, because they are self limiting and there is no risk of fire. But some (me) desperately need it for their monster-bed-heaters: If merged in the RC-phase i recommend a deactivated by default version. |
@AnHardt Not sure how I missed the fact that |
@AnHardt will you validate this PR with your ~1KW setup ? :-) |
@jbrazio But as long the algorithm is the same as in the nozzle heater version, i have unlimited trust in it. |
@AnHardt sincerely hope you get better. The logic is identical to the nozzle. |
In the days when i begun to experiment with, heat activated epoxy's, on high temperature beds, before i got the power-beds, i used to say "give me all you have", give me 150°, even if the bed barely could reach 225° maybe 130° with closed printer doors. Of course this is not what you want, but the best you can get, and more common than you might think. |
This feature and the Bed Temp Residency checking have both been hovering on the periphery as features "we never wanted to add" because heated beds operate in a lower temp range and are –as pointed out– pretty well self-limiting. Still, for symmetry I don't think it's bad to have these two features added now. But I'm sure we can leave them disabled by default. We ought to be leaving these extra bed temperature features (and a couple of other enhancements disabled by default) anyway, to accommodate the smaller (64K) boards that are now getting crowded out by the ballooning size of the Marlin binary. With that in mind, keep an eye out for any chance to reduce the size of the "standard" or "default" install of Marlin. Aim for a target binary as small as version 1.0.2-1, or even smaller if possible. |
There is no way to only disable this feature, it is enabled by |
There are several ways to check that separately.
instead of
|
Conflicts: Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
@thinkyhead @Blue-Marlin I can wrap the heating sanity check code for both the nozzle and the bed with |
NVM that will [in the long run] be worst. Let's keep the config flags for the bed as close as possible as the ones for the nozzle. As this is a safety feature, do we have any idea what would be a good fits-the-most default value ? Let's do some testing if nothing wrong comes then let's ship this enabled by default as we do for nozzle. |
For "completeness" I suppose it makes sense to wrap the appropriate code in conditionals like the following, so we can disable these "sub-features" by either non-defining or setting the option to zero: #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 We already have some precedent for this, as it allows us to avoid needing to add another "enable" flag. |
* WATCH_TEMP_INCREASE should not be below 2. | ||
*/ | ||
#define WATCH_TEMP_PERIOD 20 // Seconds | ||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines should be in the block above, and the WATCH_BED_TEMP_*
items in the code above should be here.
…ocessor conditional involving a check for whether or not they are enabled. start_watching_bed() is now also called in ultralcd.cpp Also correct SanityCheck error for THERMAL_PROTECTION_BED.
…d in tvrrug Round2's example Configuration_adv.h
@thinkyhead @jbrazio check out my last two commits, I think it should be good to go now. |
@scalez thanks, it's looking good ! |
…t_ms is now defined as millis_t and millis_t is typedef'ed as an unsigned long not int (WATCH_TEMP_PERIOD's limit is therefore 4294967s).
@@ -439,9 +439,9 @@ | |||
*/ | |||
#if WATCH_TEMP_PERIOD > 500 | |||
#error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds. | |||
#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) | |||
#elif (DISABLED(THERMAL_PROTECTION_HOTENDS) || WATCH_TEMP_PERIOD <= 0) && (defined(WATCH_TEMP_PERIOD) || (defined(THERMAL_PROTECTION_PERIOD) && WATCH_TEMP_PERIOD > 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original reason for these tests was to deal with older configurations that didn't have THERMAL_PROTECTION_HOTENDS
or THERMAL_PROTECTION_BED
options, so the other options could be enabled without them. This isn't a problem with your new options, which are … new. So you can drop all your changes to SanityCheck.h
here.
enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway }; | ||
void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); | ||
#if ENABLED(THERMAL_PROTECTION_HOTENDS) | ||
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here and below. This condition will break compilation if WATCH_TEMP_PERIOD
is zero.
Other than the needed changes I just listed, it all looks good! |
@thinkyhead abc3bc1 made the needed changes, let me know what you think. |
When setting the bed temp via
M140
/M190
, if the thermistor does not read an increase ofWATCH_BED_TEMP_INCREASE
degrees withinWATCH_BED_TEMP_PERIOD
seconds then it will throw "Error:Heating failed, system stopped! Heater_ID: bed
" and call thekill()
function.