The min_ambient_change defines how much the ambient temperature should be adjusted to correct errors in the calibration values. A higher value, could result in a faster convergence to the target temperature, but might decrease stability of the ambient temp.
One could change the min_ambient_change while the control algorithm is running to improve convergence speed and stability:
Initially it will use a high value, until the ambient temperature is no longer increasing or decreasing (fluctuating around a range of values). Then it will decrease the min_ambient_change until there is some ambient_temp at which the algorithm stabilizes.
Alternatively one could do the following:
delta = 1.0 - max(0.0, min(1.0, temp / target_temp))
and then calculate the ambient_change with ambient_change = delta * (max_ambient_change - min_ambient_change) + min_ambient_change (or just use a map_range(delta, 0.0, 1.0, min_ambient_change, max_ambient_change) function)
The
min_ambient_change
defines how much the ambient temperature should be adjusted to correct errors in the calibration values. A higher value, could result in a faster convergence to the target temperature, but might decrease stability of the ambient temp.One could change the
min_ambient_change
while the control algorithm is running to improve convergence speed and stability:Initially it will use a high value, until the ambient temperature is no longer increasing or decreasing (fluctuating around a range of values). Then it will decrease the
min_ambient_change
until there is someambient_temp
at which the algorithm stabilizes.Alternatively one could do the following:
delta = 1.0 - max(0.0, min(1.0, temp / target_temp))
and then calculate theambient_change
withambient_change = delta * (max_ambient_change - min_ambient_change) + min_ambient_change
(or just use amap_range(delta, 0.0, 1.0, min_ambient_change, max_ambient_change)
function)