ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If 'ke' is in use make it possible to let 'i'<0

AnHardt opened this issue · comments

Is your feature request related to a problem? Please describe.
A simple way to find a value for 'ke' is to set it first to zero. Wait until the system is stable ('p'=0) and divide 'i' by the difference of f.e. target_temperature and outside_temperature. Ideally if that is the new 'ke' 'i' would result in 0.
In average this results in a slightly to high temperature (respective a negative 'p') because 'i' here can't be negative.
So, at the moment, you have to set 'ke' a bit smaller then calculated, to get a positive 'i', to have some 'room' for regulation by 'i'.

Describe the solution you'd like
Make it possible for 'i' to be negative when 'ke' is different from 0.

See discussions in #150 and #151 :(

The purpose of the integral is to compensate losses by keeping a constant heating power. A heater can't remove heat, having negative values for pid_i would be a nonsense.
If your pid_i tends to 0, that means your Ke gain is too strong or the heating power (meaning radiators temperature for example) is much too high.