BrewPi/firmware

Beer temp integral not getting reset

Closed this issue · 1 comments

I noticed today that if the current integral value is set to something, say 20, and you create a new profile and start cooling, the integral value never climbs backs to zero while the state is not idle. In my situation the temp error is greater than iMaxError, and since the fridge target temp is so low (it's attempting to cool 8 degrees), it takes a while to reach an IDLE state, which means it's still using the integral value of '20' in it's PID calculation, which throws off the target fridge temp. I would expect the integral value to just be zero since the error is great than iMaxError.

I forked the code and don't mind fixing it. I'm just curious if this is how I should fix it:

If abs(error) > iMaxError, then no matter what decrease the value by 1/8 (even if the state is not idle).

There have been many algorithm improvements and in particular, a few anti-windup improvements in develop. This should not happen anymore.