Differential Rules
Differential rules set an element based on the difference between two other elements. The target and the value being tested must be elements - the other parameters can be either elements or numeric values. The template is as folllows:
Set Element1 (to TRUE) if Element2 is at least Element/Value greater (or less) than Element/Value with a deadband of Element/Value
NOTE: Differential rules have an implied 'to TRUE' as part of the template. If the conditions in a differential rule are satisfied, the target element will be set to TRUE.
NOTE 2: Differential rules ALWAYS set the value of the target variable. It's set to TRUE if the rule criteria are met, and FALSE if not.
The differential rules have a lot of options and a lot of resulting complexity. There are five parameters involved, and four of them are required.
Example: Solar Circulator
A differential rule might be used to control a solar panel circulator, for instance. In that case, we might want the circulator to be on any time the panel temperature is at least 5 degrees above the storage tank temperature. The rule might look like this:
Set SolarCirc if PanelTemp is at least 5.0 greater than StorageTemp with a deadband of 2.0
In this example, these elements are used:
- SolarCirc: A discrete output that turns on the solar panel circulator
- PanelTemp: A sensor input that reads the panel outlet temperature
- StorageTemp: A sensor input that reads the storage tank temperature
The first element is the target. It is set to TRUE (a numeric value of 1) if the rule is triggered. In most cases, the target element will be a discrete output that controls a pump or a valve. In our example, it's SolarCirc.
The second element is the first of two values to be compared. It will typically be either a sensor value or a variable. In our example it's PanelTemp.
The third element is the differential. In our example it's the numeric value 5.0. This element is optional. If omitted, it assumes a value of zero, and the displayed rule will not show this element.
The fourth element is the second value that's part of the comparison. In the example, it's the storage tank temperature. It could also be a variable.
The fifth element is deadband (sometimes called hysteresis). This helps prevent excessive cycling. A more detailed discussion of deadband can be found below.
Example: Thermostat
A fairly common need is to implement a rule that has the same effect as a thermostat. For instance, we might want to open Zone Valve 1 if the top floor temperature is below the top floor setpoint. In this case, we don't need the third term so it's omitted. The rule will be displayed without the differential term.
Here's the rule:
Set ZoneValve1 if TopFloorTemp is less than TopFloorSetpoint with a deadband of 2.0/span>
In this example, these elements are used:
- ZoneValve1: A discrete output that opens the top floor zone valve.
- TopFloorTemp: A sensor input that reads the top floor temperature
- TopFloorSetpoint: A variable that contains the desired temperature for the top floor.
Deadband is a value that's added (or subtracted) from the temperature difference depending on whether the target element is active or not. It has the effect of preventing short cycling.
If you had a rule that turned on a circulator whenever a measured temperature was less than 70 degrees, you might have a situation where the temperature was near 70 degrees, but fluctuating between 69.9 and 70. Without deadband, the circulator would cycle on and off with every fluctuation.
With that same rule and a two degree deadband, the system will subtract two degrees from the setpoint whenever the circulator is off. That means that when the temperature hits 70, the circulator turns off. It will stay off until the temperature hits 68 degrees.
In this way, the temperature will cycle between 68 and 70. The value of deadband can be changed to tune system performance.
For rules with a 'less than' term such as our thermostat example, deadband is subtracted from the fourth element (setpoint in this case). For rules with a 'greater than' term, the deadband is added.