obiwan007 / despresso

GNU General Public License v3.0
75 stars 10 forks source link

Stop-at-weight fallback #217

Closed tpict closed 3 months ago

tpict commented 4 months ago

For atypical profiles whose weight flow doesn't flatten out at the end of the shot, the linear regression algorithm used for stop-at-weight doesn't always work. Here's an example of a shot that went 38g above its target weight because the weight flow spiked for a moment as it approached the desired weight.

This PR updates the stop-at-weight logic to stop the shot immediately if the scale reading ever goes above the target weight. If the stop had already been scheduled using the linear regression estimate, it will be cancelled.

I think this minimal effort approach will fix the issue fine, as it's most likely to affect these filter-style profiles where weight of the "shot" can have a much larger margin of error, and the outflow is expected to be slower.