ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
336 stars 48 forks source link

Optimize pid_i capping #151

Closed Chupaka closed 1 year ago

Chupaka commented 1 year ago

I'm finally observing some specials conditions where pid_i can be over-limited by current code, so PID Controller is working in non-optimal way. And here's easy fix, where we're allowing pid_i to decrease where control_output is 100% and increase where output is 0%. And now pid_i can go below zero to compensate e.g. pid_e, but still without over-saturating the output (e.g. if current temp is always below target temp, pid_i will decrease until PID output is zero, not further).

Closes #146, closes #150.