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
[1.1.x] M303 thermal runaway protection #8209
[1.1.x] M303 thermal runaway protection #8209
Conversation
Marlin/temperature.cpp
Outdated
@@ -394,6 +427,16 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS], | |||
#endif | |||
|
|||
temp_ms = ms + 2000UL; | |||
|
|||
#if WATCH_THE_BED || WATCH_HOTENDS | |||
heated = heated || input > watch_temp_target; |
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.
???
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.
I see I should have been more clear about what my pull request actually does.
Normally when a heater is on, thermal protection currently functions by ensuring that:
- The heater continually makes progress until the target temperature is reached
- Once the target temperature is reached, the temperature does not stray outside a specified range
Currently during M303, the only guarantee is that straying outside the min and max temperature range results in an error. My pull request ensures that the above two conditions are also guaranteed during PID tuning.
Currently, thermal runaway protection is not available during M303. Therefore, if someone plugs the thermistors in incorrectly and goes to autotune their printer, the printer temperature could runaway and damage could occur.
94660f6
to
664ce00
Compare
I see I should have been more clear about what my pull request actually does. Normally when a heater is on, thermal protection currently functions by ensuring that:
Currently during M303, the only guarantee is that straying outside the min and max temperature range results in an error. My pull request ensures that the above two conditions are also guaranteed during PID tuning. |
|
||
#if WATCH_THE_BED || WATCH_HOTENDS | ||
if (!heated && input > next_watch_temp) { | ||
if (input > watch_temp_target) heated = true; |
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 line (and lack of sleep) had me confused. This accomplishes the same thing without being too much like my usual obfuscated coding style.
* Added M303 thermal runaway protection Currently, thermal runaway protection is not available during M303. Therefore, if someone plugs the thermistors in incorrectly and goes to autotune their printer, the printer temperature could runaway and damage could occur. * Replace removed line, clarifying its logic
* Added M303 thermal runaway protection Currently, thermal runaway protection is not available during M303. Therefore, if someone plugs the thermistors in incorrectly and goes to autotune their printer, the printer temperature could runaway and damage could occur. * Replace removed line, clarifying its logic
Currently, thermal runaway protection is not available during PID autotuning.
If someone were to plug in their printer's thermistors incorrectly and run M303, serious damage could occur. Although this is not a common problem, I still think it is worth addressing due to issues like #8103.
To add thermal protection to M303, I needed to reimpliment most of the hotend watching logic inside PID_autotune. This led to an increase in size of 812 bytes (115,950->116,762) which is not a problem on my arduino mega but seems like a significant amount of space for 128K boards.
I'd like some feedback on my code and the following: