ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
352 stars 50 forks source link

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

Closed AnHardt closed 7 months ago

AnHardt commented 7 months ago

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.

Chupaka commented 7 months ago

See discussions in #150 and #151 :(

ScratMan commented 7 months ago

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.