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

Introduce temp watch protection for the bed #3554

Closed
wants to merge 8 commits into from

Conversation

scalez
Copy link
Contributor

@scalez scalez commented Apr 18, 2016

When setting the bed temp via M140/M190, if the thermistor does not read an increase of WATCH_BED_TEMP_INCREASE degrees within WATCH_BED_TEMP_PERIOD seconds then it will throw "Error:Heating failed, system stopped! Heater_ID: bed" and call the kill() function.

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
@AnHardt
Copy link
Member

AnHardt commented Apr 18, 2016

This looks like a well made reinvention of my #2310 and it's followers.
If we don't have a maximum test temperature here, we will get a lot of false positives
(#2310 (comment))

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:
picture 162
picture 163

If merged in the RC-phase i recommend a deactivated by default version.

@scalez
Copy link
Contributor Author

scalez commented Apr 18, 2016

@AnHardt Not sure how I missed the fact that millis_t is typedef'ed as an unsigned long but now WATCH_BED_TEMP_PERIOD should be able to hold a value up to 4294967 seconds (49.71 days)! I set WATCH_BED_TEMP_PERIOD to 60 seconds, I'd say that there should be a point where we can claim that if a bed does not reach its target temp within an extreme WATCH_BED_TEMP_PERIOD then the design is inherently flawed and the designer/user should be aware that what they're doing is potentially dangerous.

@jbrazio jbrazio added Needs: Testing Testing is needed for this change PR: New Feature labels Apr 18, 2016
@jbrazio
Copy link
Contributor

jbrazio commented Apr 18, 2016

@AnHardt will you validate this PR with your ~1KW setup ? :-)

@AnHardt
Copy link
Member

AnHardt commented Apr 18, 2016

@jbrazio
Sorry. No. No in the near future (days - weeks). Since Easter I'm still barely healthy enough to keep my business going and to drop a few lines now and then.

But as long the algorithm is the same as in the nozzle heater version, i have unlimited trust in it.
@scalez
Alone finding reasonable default values for the case the target temperature is above the self-limiting-temperature, is an impossible task. If the bed will not reach the target temperature the user will realize that - it does not need a error message and a safety shutdown then and more important: "There is no risk of fire" . For that a maximum test temperature is needed and that has to be well below the self-limiting-temperature - if there is a self-limiting-temperature. If the is no self-limiting before self destruction - the maximum test temperature can be MAX_TEMP_BED.).

@scalez
Copy link
Contributor Author

scalez commented Apr 18, 2016

@AnHardt sincerely hope you get better.

The logic is identical to the nozzle.
If the designer/user is aware of the self-limiting-temperature then the case when the target is unreachable should never happen. If the designer/user is setting the target temp using M140 and printing prior to the target temperature being reach (i.e. using M190) then that can also be considered a design/user error.

@AnHardt
Copy link
Member

AnHardt commented Apr 18, 2016

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.
If i remember correct, for an original K8200, "give me all" is the standard for printing ABS.

Of course this is not what you want, but the best you can get, and more common than you might think.

@thinkyhead
Copy link
Member

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.

@jbrazio
Copy link
Contributor

jbrazio commented Apr 19, 2016

There is no way to only disable this feature, it is enabled by THERMAL_PROTECTION_BED which currently controls THERMAL_PROTECTION_BED_HYSTERESIS.. nothing against, just a reminder.

@Blue-Marlin
Copy link
Contributor

There are several ways to check that separately.
On of them is to check for

#if WATCH_BED_TEMP_PERIOD > 0

instead of

#if ENABLED(THERMAL_PROTECTION_BED)

Conflicts:
	Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
@scalez
Copy link
Contributor Author

scalez commented Apr 19, 2016

@thinkyhead @Blue-Marlin I can wrap the heating sanity check code for both the nozzle and the bed with #if WATCH_TEMP_PERIOD > 0 and #if WATCH_BED_TEMP_PERIOD > 0, and set #define WATCH_BED_TEMP_PERIOD 0 in the PR if we get a consensus. Let me know what should be done and I can commit it. Ultimately, I believe a new macro should be created for > 0 purposes.

@scalez scalez mentioned this pull request Apr 19, 2016
@jbrazio
Copy link
Contributor

jbrazio commented Apr 19, 2016

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.

@thinkyhead
Copy link
Member

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
Copy link
Member

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.

@jbrazio jbrazio modified the milestone: 1.1.0-RC6 Apr 23, 2016
…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
@scalez
Copy link
Contributor Author

scalez commented Apr 25, 2016

@thinkyhead @jbrazio check out my last two commits, I think it should be good to go now.

@jbrazio
Copy link
Contributor

jbrazio commented Apr 25, 2016

@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))
Copy link
Member

@thinkyhead thinkyhead Apr 26, 2016

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
Copy link
Member

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.

@thinkyhead
Copy link
Member

thinkyhead commented Apr 26, 2016

Other than the needed changes I just listed, it all looks good!

@scalez
Copy link
Contributor Author

scalez commented Apr 26, 2016

@thinkyhead abc3bc1 made the needed changes, let me know what you think.

@thinkyhead
Copy link
Member

@scalez I've squashed all the commits into a single commit and will merge #3653 shortly.

@thinkyhead thinkyhead closed this May 1, 2016
@alephobjects-sync-bot alephobjects-sync-bot deleted the BedTempWatch branch July 15, 2016 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants