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

Temperature variance monitor tweaks #23571

Conversation

zeleps
Copy link
Contributor

@zeleps zeleps commented Jan 19, 2022

Description

It appears that some heaters tend to keep their temperature constant for prolonged periods of time, thus triggering the thermal malfunction error and halting. So some tweaking is necessary to filter out such false positives.

This tweak allows defining a larger detection window for thermal malfunction, without affecting the other thermal runaway checks. This poses the risk that the time window override might be too large for some faster heaters, allowing them to reach higher temperatures in the case of real temperature malfunction.

Also, added some detailed information in the comments about the feature and how to tweak it.

Requirements

THERMAL_PROTECTION_VARIANCE_MONITOR

Benefits

Allows finer tweaking in the case of very stable heaters.

Configurations

Related Issues

#20749, #23373

@zeleps
Copy link
Contributor Author

zeleps commented Jan 19, 2022

This is the most decent solution I could think of. Other tweaks I considered:

  • define separate time windows for each heater (practically not an important improvement)
  • detect variance globally - if any heater updates do not halt, but this does not take into account different polling methods (thermistors are updated independently from thermocouples)

I think the issue at hand is rare (such extreme temperature stability), but still the firmware should be as reliable as possible, so it is important that the variance feature remains enabled, even with some compromise. There's room for discussion here, so I'm leaving this PR as a draft for the moment.

@The-EG
Copy link
Contributor

The-EG commented Jan 20, 2022

Some info that may be helpful: one of my printers triggers this pretty consistently on the hotend heater.

According to OctoPrint, the hotend temperature only varied from target a few times over 30+ minutes, and then only by 0.2 C at most, granted OctoPrint is only getting the temperature periodically so the actual temp probably does fluctuate more often, but it is very stable:
image

This is an Ender 3 Pro with a MicroSwiss hotend using stock thermistor and heater, so not some rare/odd setup.

I'll try to flash these changes and see if it improves, but current bugfix renders my printer unusable with this feature turned on unfortunately.

@zeleps
Copy link
Contributor Author

zeleps commented Jan 20, 2022

Thank you @The-EG, this is valuable information. I guess this is with the default thermal protection periods, so do give it a try if you will, with the period override (120'' or maybe more) and see how it works. You don't have to print anything, just keep the heater on.

If you still get errors, you should keep the feature off, and we might have to think of a different solution.

@The-EG
Copy link
Contributor

The-EG commented Jan 20, 2022

Yes, sorry I didn't specify, that was with the default periods. I pulled this PR down and set the period to 120 seconds, reflashed, heated up the hotend and waited. it failed after 7 minutes. Here's the temps that got reported back to OctoPrint during that time, starting just before the temp stabilized:

Log Output
Recv:  T:219.17 /230.00 B:19.37 /0.00 @:127 B@:0
Recv:  T:222.14 /230.00 B:19.37 /0.00 @:73 B@:0
Recv:  T:224.29 /230.00 B:19.37 /0.00 @:51 B@:0
[...]
Recv:  T:226.00 /230.00 B:19.41 /0.00 @:40 B@:0
Recv:  T:227.00 /230.00 B:19.37 /0.00 @:40 B@:0
[...]
Recv:  T:227.00 /230.00 B:19.45 /0.00 @:58 B@:0
Recv:  T:227.00 /230.00 B:19.41 /0.00 @:69 B@:0
Recv:  T:227.00 /230.00 B:19.49 /0.00 @:78 B@:0
[...]
Recv:  T:227.00 /230.00 B:19.41 /0.00 @:84 B@:0
Recv:  T:227.12 /230.00 B:19.45 /0.00 @:87 B@:0
[...]
Recv:  T:228.00 /230.00 B:19.41 /0.00 @:75 B@:0
Recv:  T:229.00 /230.00 B:19.53 /0.00 @:62 B@:0
Recv:  T:229.75 /230.00 B:19.41 /0.00 @:52 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.49 /0.00 @:55 B@:0
Recv:  T:230.00 /230.00 B:19.53 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.57 /0.00 @:62 B@:0
Recv:  T:230.00 /230.00 B:19.53 /0.00 @:63 B@:0
Recv:  T:230.00 /230.00 B:19.53 /0.00 @:64 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.69 /0.00 @:65 B@:0
Recv:  T:230.06 /230.00 B:19.37 /0.00 @:63 B@:0
[...]
Recv:  T:230.62 /230.00 B:19.65 /0.00 @:52 B@:0
Recv:  T:230.94 /230.00 B:19.57 /0.00 @:48 B@:0
Recv:  T:230.37 /230.00 B:19.65 /0.00 @:61 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.69 /0.00 @:66 B@:0
Recv:  T:230.00 /230.00 B:19.80 /0.00 @:64 B@:0
Recv:  T:230.00 /230.00 B:19.73 /0.00 @:63 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.77 /0.00 @:62 B@:0
Recv:  T:230.00 /230.00 B:19.61 /0.00 @:62 B@:0
[...]
Recv:  T:230.12 /230.00 B:19.96 /0.00 @:60 B@:0
Recv:  T:230.87 /230.00 B:19.88 /0.00 @:44 B@:0
Recv:  T:230.25 /230.00 B:19.84 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.80 /0.00 @:63 B@:0
Recv:  T:230.00 /230.00 B:19.77 /0.00 @:61 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.80 /0.00 @:61 B@:0
Recv:  T:230.00 /230.00 B:19.84 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:19.77 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.80 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.88 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:19.96 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:19.92 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.96 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:19.92 /0.00 @:60 B@:0
[...]
Recv:  T:230.06 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.19 /230.00 B:20.00 /0.00 @:56 B@:0
[...]
Recv:  T:230.06 /230.00 B:19.96 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:19.96 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.96 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:19.96 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:229.94 /230.00 B:20.00 /0.00 @:61 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:229.94 /230.00 B:20.00 /0.00 @:61 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
[...]
Recv:  T:230.12 /230.00 B:20.00 /0.00 @:57 B@:0
Recv:  T:230.06 /230.00 B:20.04 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.00 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.12 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:60 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.12 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.16 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.08 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.12 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.04 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.16 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.16 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.20 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.20 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.08 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.23 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.31 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.20 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.27 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.43 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.20 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.27 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.39 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.51 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.47 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.43 /0.00 @:59 B@:0
Recv:  T:229.94 /230.00 B:20.39 /0.00 @:60 B@:0
Recv:  T:230.00 /230.00 B:20.47 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.35 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.51 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.39 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.43 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.51 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.47 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.39 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.51 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.47 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.51 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.55 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.47 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.51 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.55 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.55 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.59 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.66 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.66 /0.00 @:59 B@:0
[...]
Recv:  T:230.00 /230.00 B:20.70 /0.00 @:59 B@:0
Recv:  T:230.00 /230.00 B:20.62 /0.00 @:59 B@:0

I'll turn this off for now, but if there's something more I can test later, let me know.

edit: if it matters this is with a creality v4.2.7 board, so STM32F1

@zeleps
Copy link
Contributor Author

zeleps commented Jan 20, 2022

Yeah, you better keep it off.

This makes me rethink the usefulness of variance monitoring as a general solution to the temperatures updating issue...

@CBDesignS
Copy link

@zeleps Looks like you are finding more hardware that is falling over. p.s I disabled the other PR and the printer completed a near 10hr print just fine. Rome was`nt built in 1 day so keep going.

@zeleps
Copy link
Contributor Author

zeleps commented Jan 21, 2022

@CBDesignS unfortunately this is something you have to anticipate when writing software that may run on an assortment of hardware platforms. These features need a lot of comprehensive testing, and this is not an option for this project. I have to admit that you've been - involuntarily - part of the testing squad, since there is no other way.

My recommendation for the feature right now is to keep it disabled by default, with a suppressible compilation warning and detailed explanation of its function, configuration and expected behavior. I'll create a new commit in this direction probably tomorrow.

@thisiskeithb, could you please add a "needs discussion" label to this PR?

@thisiskeithb
Copy link
Member

My recommendation for the feature right now is to keep it disabled by default,

I think that should be done now since it's currently enabled & will likely cause issues on any printer with stable temps.

@zeleps
Copy link
Contributor Author

zeleps commented Jan 21, 2022

My recommendation for the feature right now is to keep it disabled by default,

I think that should be done now since it's currently enabled & will likely cause issues on any printer with stable temps.

I'm not home right now. Also, it should probably be done on 2.0.9.3 as well, but I don't think I can create a PR for that, can I?

@thisiskeithb
Copy link
Member

thisiskeithb commented Jan 21, 2022

Also, it should probably be done on 2.0.9.3 as well, but I don't think I can create a PR for that, can I?

thinkyhead has magical powers.

@zeleps
Copy link
Contributor Author

zeleps commented Jan 21, 2022

By all means then, please go ahead and disable it, I'll make my proposed changes in comments and warnings tomorrow.

@CBDesignS
Copy link

@zeleps if it was`nt for you and like minded Devs I would still be running Sailfish on a prehistoric 8 bit board. I/we are just glad to help by testing on lots of different hardware so little bugs etc can be squashed and keep Marlin going strong. Respect is offered where Respect is due.

@zeleps
Copy link
Contributor Author

zeleps commented Jan 22, 2022

Disabled the feature by default, updated comments, added a suppressible warning.

Also thinking of a mechanism complimentary to watchdog (in the main loop) that would ensure temperature ISR is reading sensor values regularly. We don't really know if this is the source of the original problem, but it will help pinpoint the issue if it happens again. I'll propose something more concrete soon.

Sebazzz added a commit to Sebazzz/Marlin-Configurations that referenced this pull request Feb 17, 2022
@Sebazzz
Copy link
Contributor

Sebazzz commented Feb 17, 2022

Also ran into this with the Ender 3 S1, default hardware configuration, properly PID tuned.

Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv: SD printing byte 194608/12029131
Recv: ok P0 B0
Send: M27
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv:  T:215.00 /215.00 B:60.01 /60.00 @:55 B@:22
Recv: SD printing byte 194736/12029131
Recv: ok P0 B0
Send: M27
Recv:  T:215.00 /215.00 B:59.99 /60.00 @:55 B@:30
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv:  T:215.00 /215.00 B:60.00 /60.00 @:55 B@:26
Recv: Error:Thermal Malfunction, system stopped! Heater_ID: E0
Changing monitoring state from "Printing from SD" to "Cancelling"
Send: M108
Recv: 
Recv:  T:215.00 /0.00 B:59.99 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:215.00 /0.00 B:59.99 /0.00 @:0 B@:0
Recv:  T:215.00 /0.00 B:59.99 /0.00 @:0 B@:0
Recv: start
Recv:  Watchdog Reset
Recv: Marlin bugfix-2.0.x
Recv: echo: Last Updated: 2022-02-14 | Author: (none, default config)
Recv: echo: Compiled: Feb 17 2022
Recv: echo: Free Memory: 36319  PlannerBufferBytes: 1856
Recv: 

May I suggest we do enable this by default for external temperature monitors like the MAX31865, which are more likely to have the required variances and have more likelihood of failing compared to the ADC inputs of the micro controller?

@zeleps
Copy link
Contributor Author

zeleps commented Feb 17, 2022

@Sebazzz, the problem we're trying to detect is related to the ADC input reading (which is done in the temperatures ISR), not external sensors. All reports in #20749 are related to onboard thermistors.

@InsanityAutomation
Copy link
Contributor

Ive got many machines in chambers which hold very stable temps. This may work better if comparing to the raw adc readings with temp_hotend[e].raw and compare for any meaningful change, even if its below the point that conversion to C will show or compare the current translated temperature to the direct reading and throw error if they deviate. That would avoid issues on very stable systems.

Another thing to note, the hang issues you mentioned I have seen almost exclusively on overflashed BTT boards. They instruct users to flash 256k rated MCU's to 512k and issues like this occur. Its likely memory corruption as rejected memory is being used. Has there been an absolute confirmation of hangs with heaters on with a board flashed withing MCU rated limits?

@zeleps
Copy link
Contributor Author

zeleps commented Oct 1, 2022

It's been a while. I haven't heard back from @MakerMeik since.

Last thing I know about this is that my latest commit (1ffe8b4) properly triggers the watchdog, thus preventing a thermal runaway (this was tested thoroughly).

I'm not using this board anymore, so I don't personally care whether this PR is merged or not, but I think the proposed way of handling ADC reads is definitely better than ignoring the doneness bit.

I guess it's time to close this, one way or another.

@MakerMeik
Copy link

Believe it or not, the problem has not reoccurred since our last contact. And in the meantime I have made several dozen prints with the machine. According to my understanding, the print should at least stop when the problem occurs. But that was not (any longer) the case. Who knows whether the cause was a loose contact that just happened to get better again.
I also assume that your last commit basically works.
So I also think you should close the issue. If something changes, I would contact you anyway ;-)
Anyway, thanks a lot for your great support @zeleps and the great work of you and the whole team!

@zeleps
Copy link
Contributor Author

zeleps commented Oct 1, 2022

Really glad to know that @MakerMeik! I don't know if reading and respecting the doneness bit actively solves the issue, but that's the code that Meik's been using.

@thinkyhead thinkyhead force-pushed the bugfix-2.0.x-TempVarianceFeatureTweaks branch from e7f36df to 7f5665e Compare March 18, 2023 11:23
@thinkyhead
Copy link
Member

One interesting development in the area of thermal protection is Prusa Firmware updating its behavior so that if the temperature goes too far outside the hysteresis range for too long, instead of killing the machine due to thermal runaway, it sounds an alarm and pauses the machine, allowing the user to resume if the temperature has simply been thrown off by something. That would be a good addition to Marlin as well.

thinkyhead added a commit to MarlinFirmware/Configurations that referenced this pull request Mar 18, 2023
@thinkyhead thinkyhead merged commit 5be895d into MarlinFirmware:bugfix-2.1.x Mar 18, 2023
shadow578 added a commit to shadow578/Marlin-H32 that referenced this pull request Apr 7, 2023
* [cron] Bump distribution date (2023-03-05)

* 🐛 Fix apply_power for SPINDLE_SERVO (MarlinFirmware#25465)

* 🐛 Fix Flash EEPROM for STM32G0B1CB (MarlinFirmware#25469)

* 🌐 Update Turkish language (MarlinFirmware#25447)

* [cron] Bump distribution date (2023-03-06)

* 🧑‍💻 Script to make non-accented languages

* 🌐 Update Turkish language

Followup to MarlinFirmware#25447

* [cron] Bump distribution date (2023-03-07)

* 🌐 DGUS Reloaded non-accented French (MarlinFirmware#25443)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🔧 Add DGUS_LCD_UI RELOADED conditions

* [cron] Bump distribution date (2023-03-08)

* ✨ Extra Z Servo Probe options (MarlinFirmware#21427)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🔧 Update some config.ini options

* 🔨 VSCode + Devcontainer support (MarlinFirmware#22420)

* [cron] Bump distribution date (2023-03-09)

* ✨ Z_SAFE_HOMING_POINT_ABSOLUTE (MarlinFirmware#23069)

* [cron] Bump distribution date (2023-03-10)

* ✨ BTT Octopus Max EZ 1.0, SKR 3.0 / 3.0 EZ (MarlinFirmware#25387)

BTT Octopus Max EZ V1.0 (STM32H723VE/ZE), SKR V3.0 / V3.0 EZ (STM32H723VG)

* [cron] Bump distribution date (2023-03-11)

* 🐛 Fix Anet ET4 SD_SS_PIN (MarlinFirmware#25492)

* [cron] Bump distribution date (2023-03-12)

* BTT Octopus … followup (MarlinFirmware#25495)

Followup to MarlinFirmware#25387

* ⚡️ Exit from ISR on AVR already does sei

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* 🎨 Cosmetic stepper updates

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ✨ MAX7219_DEBUG_MULTISTEPPING

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ⚡️ Use hal_timer_t for timing vars

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ⚡️ Use cached la_active state

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ⚡️ Use AxisFlags for step_needed

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* [cron] Bump distribution date (2023-03-13)

* ⚡️ Major shaper optimization

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ⚡️ Set steps_per_isr in calc_multistep_timer_interval

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* 🔧 Expose MULTISTEPPING_LIMIT option

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ⚡️ Optimize speed lookup for AVR

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* ⚡️ Update ISR cycle counts

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>

* 📺 DGUS_RELOADED 1.03 (MarlinFirmware#25490)

* [cron] Bump distribution date (2023-03-14)

* 🐛 Fix Polargraph without Z (MarlinFirmware#25514)

* 🐛 Fix long filename read/report (MarlinFirmware#25509)

* 🩹 Fix IA_CREALITY float, startup (MarlinFirmware#25493)

Followup to MarlinFirmware#25440

* [cron] Bump distribution date (2023-03-15)

* 🎨 Misc. formatting

* 🎨 Misc. tramming menu cleanup (MarlinFirmware#25519)

* 🩹 Fan Menu / Status fixes

Followup to MarlinFirmware#21888

* 🩹 Fix DWIN MarlinUI Fan/E/XY (MarlinFirmware#25502)

* [cron] Bump distribution date (2023-03-16)

* 🔧 Safer default for Z_MIN_PROBE_PIN override (MarlinFirmware#25524)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* ♻️ Refactor PROBE_PT_[123]

* ♻️ Refactor UBL 'G29 J'

* [cron] Bump distribution date (2023-03-17)

* 🚸 Refinements for UBL G29 J (tilt mesh) (MarlinFirmware#25486)

* [cron] Bump distribution date (2023-03-18)

* 🔧 Optional MPC_AUTOTUNE to save 5.5 - 5.8KB

* ✨ Sovol v1.3.1 (Sovol SV06) (MarlinFirmware#25267)

* 🧑‍💻 More IntelliSense-friendly declares

* 🎨 Clean up IA_CREALITY includes (MarlinFirmware#25530)

* 🎨 Suppress warning (MarlinFirmware#25529)

* 🔧 SQUARE_WAVE_STEPPING => EDGE_STEPPING (MarlinFirmware#25526)

Co-Authored-By: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🚸 Improve Z-Probe raise for deploy (MarlinFirmware#25498)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🐛 Fix LVGL / MKS WiFi long filename (MarlinFirmware#25483)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🔨 Fix STM32H723Vx_btt for case-sensitive (MarlinFirmware#25535)

* 🐛 Fix FYSETC Cheetah v2.0 Servo/Probe pins (MarlinFirmware#24635)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🐛 Prevent MPC E-permm overrun in Load Filament (MarlinFirmware#25531)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🚸 Fix / improve LCD_BED_TRAMMING (MarlinFirmware#25425)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🔧 Sanity-check PRINTCOUNTER_SAVE_INTERVAL + ESP32 I2S Exp (MarlinFirmware#25527)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* ⚡️ Smart Adaptive Multi-Stepping (MarlinFirmware#25474)

* 🚸 Temperature Variance Monitor tweaks (MarlinFirmware#23571)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🩹 Fix Ender 2 stock LCD (MarlinFirmware#25538)

* ⚡️ Misc. optimizations

* [cron] Bump distribution date (2023-03-19)

* ✨ REPORT_ADAPTIVE_FAN_SLOWING (MarlinFirmware#25537)

* 🩹 Fix a serial_ternary

* ✨ Z_SERVO_DEACTIVATE_AFTER_STOW (MarlinFirmware#24215)

* 🐛 Avoid step rate overflow (MarlinFirmware#25541)

* [cron] Bump distribution date (2023-03-20)

* ✨ PROBING_TOOL (MarlinFirmware#24411)

* [cron] Bump distribution date (2023-03-22)

* ✨ FILAMENT_SWITCH_AND_MOTION (MarlinFirmware#25548)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🧑‍💻 ExtUI::onSetPowerLoss

* [cron] Bump distribution date (2023-03-23)

* 🎨 calibration_stage => stage

* [cron] Bump distribution date (2023-03-24)

* 🩹 Reset touch screen calibration on failure (MarlinFirmware#25334)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>

* 🎨 TMC SPI Pins

Co-Authored-By: Martin Turski <turningtides@outlook.de>

* 🎨 Pins header comments

Co-Authored-By: Martin Turski <turningtides@outlook.de>

* 🎨 Wrap font includes

Co-Authored-By: Martin Turski <turningtides@outlook.de>

* 🎨 LPC_SOFTWARE_SPI => SOFTWARE_SPI

Co-Authored-By: Martin Turski <turningtides@outlook.de>

* 🔨 INI Updates

Co-Authored-By: Martin Turski <turningtides@outlook.de>

* 🎨 Misc. fixes, cleanup

Co-Authored-By: Martin Turski <turningtides@outlook.de>

* 🩹 Update TRONXY_V10 SPI_FLASH pins

* [cron] Bump distribution date (2023-03-25)

* 🩹 Fix Chitu3D V6 default probe pin (MarlinFirmware#25552)

* 🔧 Remove TVPM warning (MarlinFirmware#25551)

* 🐛 Fix MKS Gen L 2.1 MOSFET pins (MarlinFirmware#25542)

* 🩹 Refine MKS boards with a dedicated FAN port (MarlinFirmware#25567)

* 🎨 Rename FAN_PIN to FAN0_PIN (MarlinFirmware#25568)

* 📝 Fix spelling (MarlinFirmware#25563)

* [cron] Bump distribution date (2023-03-26)

* 🎨 Timer tweaks

* 🔧 Refactor endstop state config (MarlinFirmware#25574)

* ✨ AnyCubic Vyper / Vyper LCD (MarlinFirmware#25405)

* 🩹 Fix Touch Calibration first point (MarlinFirmware#25298)

* 🧑‍💻 Auto Fan / Cooler Fan updates (MarlinFirmware#25554)

* 🐛 Prevent divide-by-zero in calc_timer_interval (MarlinFirmware#25557)

* 🔧 Sanity-check for endstop inverting

Followup to MarlinFirmware#25574

* 🔧 Clarify axis disable / timeout (MarlinFirmware#25571)

* [cron] Bump distribution date (2023-03-27)

* 🔨 Fix thread-unsafe deque iteration

* 🐛 Fix AnyCubic Vyper ProcessPanelRequest

Followup to MarlinFirmware#25405

* 🎨 Suppress a type warning (MarlinFirmware#25575)

* ⚡️ Improve TFT DMA for STM32 (MarlinFirmware#25359)

* 🐛 Fix M23 long filename support (MarlinFirmware#25540)

* [cron] Bump distribution date (2023-03-28)

* 🎨 Misc. cleanup

* 🔧 Fix up WiFi options (MarlinFirmware#25586)

* 🔨 Update config.ini endstop states

Followup to MarlinFirmware#25574

* [cron] Bump distribution date (2023-03-29)

* 🔧 Impose Hephestos 2 Bed Kit requirements (MarlinFirmware#25585)

* 🎨 Remove unused ProUI : UBLValidMesh (MarlinFirmware#25591)

* 🔨 Improve Docker local tests support (MarlinFirmware#25583)

* 🔨 MarlinSimUI updates (MarlinFirmware#25589)

* [cron] Bump distribution date (2023-03-30)

* 🩹 Update Trigorilla V006 fan pin

Followup to MarlinFirmware#25568

* 🩹 Fix Ender-3 V2 with no fan

* 🐛 Fix _HAS_FAN for fan on Pin 0

* 🎨 Refine probe, more debug

* 🩹 Fix displayed mix percentages

* [cron] Bump distribution date (2023-03-31)

* 🔧  DGUS_LCD_UI selectable options

* 🔧 Fix SENSORLESS hit state error (MarlinFirmware#25604)

* 🧑‍💻 CardReader adjustments (MarlinFirmware#25611)

* [cron] Bump distribution date (2023-04-01)

* 🎨  HAS_SHAPING => HAS_ZV_SHAPING

* ✨ Fixed-Time Motion with Input Shaping by Ulendo (MarlinFirmware#25394)

Co-authored-by: Ulendo Alex <alex@ulendo.io>

* 🐛 Fix Long FIlename lookup (MarlinFirmware#25598)

* 🌐 Update Italian language (MarlinFirmware#25587)

* 🔨 Move Docker local test script

Followup to MarlinFirmware#25583

* 🩹 FT_MOTION Followup

* 🐛 Ensure root for 'M503 C'

* 🐛 Clean up DELTA babystep Z

* 🐛 INVERT_*_DIR for FT_MOTION (MarlinFirmware#25637)

* 🔧 Move DOGLCD options

* 🧑‍💻 Update pinsformat.js

* 📝 Update Ender # labels

* [cron] Bump distribution date (2023-04-07)

* 🚸 Support CoreXY without Z (MarlinFirmware#25630)

* 🎨 Apply const (MarlinFirmware#25643)

* update `pins_Aquila_X2.h` to new format

---------

Co-authored-by: thinkyhead <thinkyhead@users.noreply.github.com>
Co-authored-by: Hans-Christian Ebke <ebke@cs.rwth-aachen.de>
Co-authored-by: alextrical <35117191+alextrical@users.noreply.github.com>
Co-authored-by: Abdullah YILMAZ <h.abdullahyilmaz@hotmail.com>
Co-authored-by: albatorsssx <albator_ssx@hotmail.com>
Co-authored-by: Kurt Haenen <Misterke@users.noreply.github.com>
Co-authored-by: Sion Williams <sion5@hotmail.co.uk>
Co-authored-by: Evgeniy Zhabotinskiy <evg-zhabotinsky@users.noreply.github.com>
Co-authored-by: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com>
Co-authored-by: tombrazier <68918209+tombrazier@users.noreply.github.com>
Co-authored-by: Neo2003 <Neo2003@users.noreply.github.com>
Co-authored-by: jbubik <jbubik@centrum.cz>
Co-authored-by: Eduard Sukharev <sukharev.eh@gmail.com>
Co-authored-by: Davide Rombolà <davide.rombola@gmail.com>
Co-authored-by: dwzg <50058606+dwzg@users.noreply.github.com>
Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com>
Co-authored-by: jamespearson04 <jamespearson04@hotmail.co.uk>
Co-authored-by: Michael Hill <mhill@hillsoftware.com>
Co-authored-by: James Gilliland <neclimdul@gmail.com>
Co-authored-by: Liam Powell <liam+github@liampwll.com>
Co-authored-by: George Fu <nailao_5918@163.com>
Co-authored-by: Piotr Paczyński <ppaczyn@gmail.com>
Co-authored-by: Farva42 <100859196+Farva42@users.noreply.github.com>
Co-authored-by: John Robertson <john@cirtech.co.uk>
Co-authored-by: John Lagonikas <39417467+zeleps@users.noreply.github.com>
Co-authored-by: StevilKnevil <stevilknevil@hotmail.co.uk>
Co-authored-by: FilippoR <filippo.rossoni@gmail.com>
Co-authored-by: BIGTREETECH <38851044+bigtreetech@users.noreply.github.com>
Co-authored-by: Martin Turski <turningtides@outlook.de>
Co-authored-by: Giuliano Zaro <3684609+GMagician@users.noreply.github.com>
Co-authored-by: Bob Kuhn <bob.kuhn@att.net>
Co-authored-by: Alexander Gavrilenko <jmz52@users.noreply.github.com>
Co-authored-by: Andrew <18502096+classicrocker883@users.noreply.github.com>
Co-authored-by: John Unland <junland.foss@gmail.com>
Co-authored-by: Chris Pepper <p3p@p3psoft.co.uk>
Co-authored-by: Ulendo Alex <alex@ulendo.io>
EvilGremlin pushed a commit to EvilGremlin/Marlin that referenced this pull request Apr 8, 2023
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit that referenced this pull request Apr 10, 2023
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request May 16, 2023
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
EvilGremlin pushed a commit to EvilGremlin/Marlin that referenced this pull request May 17, 2023
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
tspiva pushed a commit to tspiva/Marlin that referenced this pull request May 25, 2023
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Andy-Big pushed a commit to Andy-Big/Marlin_FB_Reborn that referenced this pull request Jul 10, 2023
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
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.

9 participants