This documentation describes an adaptive temperature control algorithm designed for systems that monitor and control two temperature readingsβone slow-responding (e.g., a vessel's internal temperature) and one fast-responding (e.g., ambient or external temperature). The algorithm calculates a weighted average of these temperatures, dynamically adjusting the weighting to avoid overshoot while ensuring timely responses to temperature changes.
- payload.t1: The internal, slow-responding temperature reading (e.g., the temperature inside a liquid vessel).
- payload.t2: The external, fast-responding temperature reading (e.g., the ambient temperature in a cabinet or surrounding environment).
- payload.target or payload.tset: The desired target temperature that the system aims to achieve. Denoted πset in the documentation.
- payload: The adjusted combined temperature of π1 and π2, that should be passed as temperature reading to the thermostat.
- t1: The latest π1 value
- t2: The latest π2 value
- target: The desired target temperature. Can be useful as pass-through to directly provide to the thermostat.
When controlling a temperature-sensitive system, especially in cases where you have a more sluggish (slow-responding) internal temperature sensor and a faster-responding external sensor, there's often a risk of overshooting the internal temperature. This happens when the external environment is heated or cooled too quickly while the internal temperature lags behind. By dynamically adjusting the weight between the two temperature readings based on how close the internal temperature is to the setpoint, this algorithm helps:
- Prevent temperature overshoot by smoothly transitioning control focus from the faster external temperature to the more sluggish internal temperature.
- Enhance response time by leveraging the faster-responding temperature reading when the internal temperature is far from the target.
- Provide balanced control in systems with different temperature dynamics for internal and external environments.
The algorithm combines two temperature readings, π1 (internal) and π2 (external), and dynamically adjusts the weight assigned to each, with a focus on minimizing overshoot. The weight is determined by a function that changes based on how close the internal temperature is to the target setpoint πset.
The algorithm is as follows:
Where:
- πΌ(π1,πset) is the dynamic weighting factor and determines how much weight is given to the internal temperature π1.
The following parameters affects how the combined temperature is calculated and can be changed in the node configuration. The default values serve as a good starting point.
- baseline: Defaults to 0.65. A parameter that determines the minimum influence of π1 in the calculation. A baseline of 0.5 means that π1 will always have at least a 50% influence, even when the internal temperature is far from the setpoint.
- beta (π½): Defaults to 0.5. A steepness parameter that controls how quickly the algorithm shifts from relying on π2 to relying on π1. A higher π½ value makes the transition sharper, while a lower π½ value smooths the transition.
- delta (Ξπ): Defaults to 3.5. A threshold value that controls how close π1 needs to be to the setpoint before the algorithm starts prioritizing it over π2. A smaller Ξπ value means the algorithm will start focusing on π1 only when it's very close to the setpoint, while a larger Ξπ will cause the system to prioritize π1 earlier.
-
Baseline:
-
Higher baseline (e.g., 0.6β0.7): Ensures that π1 (the internal temperature) has a higher influence on the combined temperature, even when it's far from the setpoint. This could result in slower system response but minimizes the risk of overshooting the target.
-
Lower baseline (e.g., 0.3β0.4): Allows π2 to have more influence when π1 is far from the setpoint, resulting in a faster response to temperature changes, but potentially increasing the risk of overshoot.
-
-
Beta:
-
Higher π½ (e.g., 5-10): Causes a rapid shift from relying on π2 to π1 as π1 nears the setpoint. This makes the system more sensitive to changes in π1 as it approaches the target but could lead to less smooth control.
-
Lower π½ (e.g., 1-3): Results in a smoother transition, making the system less responsive to sudden changes but providing more stable control.
-
-
Delta T:
-
Larger Ξπ (e.g., 2-3Β°C): The system will begin prioritizing π1 earlier, when it's still relatively far from the setpoint. This reduces the risk of overshooting but may make the system slower to reach the desired temperature.
-
Smaller Ξπ (e.g., 0.5-1Β°C): The system will rely on π2 for longer, only prioritizing π1 when it's very close to the setpoint. This makes the system more responsive but can lead to overshoot if π1 lags behind significantly.
-
Imagine you are controlling the temperature of a fermentation vessel inside a climate-controlled cabinet. The internal temperature of the liquid (π1) is slow to change, while the cabinet's air temperature (π2) can change more rapidly. Using this algorithm, you can:
- Allow the external air temperature (π2) to influence the control system when the liquid temperature is far from the setpoint.
- Gradually shift the focus to the liquid temperature (π1) as it nears the desired setpoint, avoiding overshooting the internal temperature.
This method ensures smooth, adaptive control, minimizing temperature fluctuations in sensitive environments like fermentation, laboratory experiments, or other temperature-critical applications.