From 6766039cc791a9cd79f1a8bfc9f9905bfe0e31e1 Mon Sep 17 00:00:00 2001 From: Javier Arigita Date: Sat, 2 May 2020 22:34:08 +0200 Subject: [PATCH] Fix merge --- tasmota/xdrv_39_thermostat.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_39_thermostat.ino b/tasmota/xdrv_39_thermostat.ino index 45943a967..623058f99 100644 --- a/tasmota/xdrv_39_thermostat.ino +++ b/tasmota/xdrv_39_thermostat.ino @@ -586,8 +586,10 @@ void ThermostatCalculatePI(uint8_t ctr_output) // Calculate output Thermostat[ctr_output].time_total_pi = Thermostat[ctr_output].time_proportional_pi + Thermostat[ctr_output].time_integral_pi; + + // Antiwindup of the output + // If result is bigger than cycle time, the result will be adjusted // to the cylce time minus safety time and error will not be cummulated]] - if (Thermostat[ctr_output].time_total_pi >= ((int32_t)Thermostat[ctr_output].time_pi_cycle * 60)) { // Limit to cycle time //at least switch down a minimum time Thermostat[ctr_output].time_total_pi = ((int32_t)Thermostat[ctr_output].time_pi_cycle * 60);