Do no reset the accumulated error after temp change. Lower the coefs

This commit is contained in:
Jean-Marc Collin
2023-10-31 22:17:33 +00:00
parent 3c497d24fb
commit 663a13809c
4 changed files with 20 additions and 8 deletions

View File

@@ -227,13 +227,23 @@ class RegulationParamLight:
""" Light parameters for regulation"""
kp:float = 0.2
ki:float = 0.05
k_ext:float = 0.05
offset_max:float = 1.5
stabilization_threshold:float = 0.1
accumulated_error_threshold:float = 10
class RegulationParamMedium:
""" Light parameters for regulation"""
kp:float = 0.3
ki:float = 0.05
k_ext:float = 0.1
offset_max:float = 2
stabilization_threshold:float = 0.1
accumulated_error_threshold:float = 20
class RegulationParamMedium:
class RegulationParamStrong:
""" Medium parameters for regulation"""
kp:float = 0.4
ki:float = 0.08
@@ -242,7 +252,8 @@ class RegulationParamMedium:
stabilization_threshold:float = 0.1
accumulated_error_threshold:float = 25
class RegulationParamStrong:
# Not used now
class RegulationParamVeryStrong:
""" Strong parameters for regulation"""
kp:float = 0.6
ki:float = 0.1

View File

@@ -29,7 +29,8 @@ class PITemperatureRegulator:
def set_target_temp(self, target_temp):
""" Set the new target_temp"""
self.target_temp = target_temp
self.accumulated_error = 0
# Do not reset the accumulated error
# self.accumulated_error = 0
def calculate_regulated_temperature(self, internal_temp: float, external_temp:float): # pylint: disable=unused-argument
""" Calculate a new target_temp given some temperature"""