hallboyone / RaspberryLatte

A full stack suite to add smarts to a single boiler espresso machine using a Raspberry Pi Pico as the brains.
MIT License
15 stars 1 forks source link

CRITICAL - Occasional erratic behavior in boiler #16

Open hallboyone opened 1 year ago

hallboyone commented 1 year ago

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.

hallboyone commented 1 year ago
Screenshot 2023-04-23 at 6 47 42 PM

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.

hallboyone commented 1 year ago

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.

hallboyone commented 1 year ago

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.