Open hallboyone opened 1 year ago
After some testing, I think the problem is with the LMT01 sensor. For a single reading, the sensor will begin to report a temp around -50C, and the controller responds as it should. If these misreadings happen with increased frequency, the temperature will begin to increase and display the behavior I have observed.
Regardless of why we are getting bad readings, additional safe guards are needed to catch and stop this failure. Perhaps an error triggered by large differences between two temp readings. This should disable the boiler at the very least.
While the sensor bug should definitely be addressed at some point, I think more important is the development of a boiler malfunction monitor within the code. I'll be opening a new issue to address it.
After further thought, I think a median filter should be applied to the LMT01 sensor. This will reject the periodic spikes in its readings. The thermal runaway is triggered to throw an error if the temp reading varies too quickly so a spike will trip it (even if behavior returns to normal at the next reading). A median filter should fix this while only delaying the detection of a true problem by a couple hundred ms at most.
I have observed occasional erratic behavior in the boiler. I'm not sure if it's software (sensor driver, PID implementation, etc) or hardware (sensor failure). Best guess is an overflow error somewhere in the PID controller, but I need to do more tests.