Professional Documents
Culture Documents
Tesslibs 17: Controls Component Library Mathematical Reference
Tesslibs 17: Controls Component Library Mathematical Reference
Volume 2
Revision history
2005-11 For TESSLibs 2.00 and TRNSYS 16.00.0000
2010-05 For TESSLibs 17.0 and TRNSYS 17.00.0000
2012-03 For TESSLibs 17.1 and TRNSYS 17.01.0000
Notice
This report was prepared as an account of work partially sponsored by the United States
Government. Neither the United States or the United States Department of Energy, nor any of
their employees, nor any of their contractors, subcontractors, or employees, including but not
limited to Thermal Energy System Specialists, LLC, makes any warranty, expressed or implied, or
assumes any liability or responsibility for the accuracy, completeness or usefulness of any
information, apparatus, product or process disclosed, or represents that its use would not infringe
privately owned rights.
© 2013 by Thermal Energy System Specialists, LLC of Madison, Wisconsin, USA
The software described in this document is furnished under a license agreement. This manual
and the software may be used or copied only under the terms of the license agreement. Except
as permitted by any such license, no part of this manual may be copied or reproduced in any form
or by any means without prior written consent from Thermal Energy System Specialists, LLC, of
Madison, Wisconsin.
3–2
TessLibs 17 – Mathematical Reference
A.V. Naik
3–3
TESSLibs 17 – Mathematical Reference
3–4
TessLibs 17 – Mathematical Reference
TABLE OF CONTENTS
3. CONTROLLERS LIBRARY M ATHEMATICAL REFERENCE 3–7
3.1. Type 658: Humidistat 3–8
3.1.1. Nomenclature 3–8
3.1.2. Mathematical Description 3–8
3.1.3. References 3–9
3.2. Type 661: Delayed Output Device 3–10
3.2.1. Mathematical Description 3–10
3.3. Type 698: Five Stage Room Thermostat for n Temperatures 3–11
3.3.1. Mathematical Reference 3–11
3.4. Type 911: Differential Controller with Lockouts 3–14
3.4.1. Nomenclature 3–14
3.4.2. Mathematical Description 3–14
3.5. Type 953: Tempering Valve Controller 3–16
3.5.1. Nomenclature 3–16
3.5.2. Mathematical Description 3–16
3.6. Type 970: N-Stage Differential Heating Controller with Multiple Setpoints, Multiple
Deadbands and Time Delay 3–18
3.6.1. Mathematical Description 3–18
3.7. Type 971: N-Stage Differential Cooling Controller with Multiple Setpoints, Multiple
Deadbands and Time Delay 3–20
3.7.1. Mathematical Description 3–20
3.8. Type 973: N-Stage Differential Controller with 1 Setpoint, 1 Deadband and Time Delay 3–22
3.8.1. Mathematical Description 3–22
3.9. Type 974: N-Stage Differential Cooling Controller with 1 Setpoint, 2 Deadbands, Minimum
Run Time and Time Delay 3–24
3.9.1. Mathematical Description 3–24
3.10. Type 980: On/Off Time Calculator 3–26
3.10.1. Mathematical Reference 3–26
3.11. Type 1233: Thermostatic Control with Specified Run-Time 3–28
3.12. Type 1250: Outside Air Reset Controller 3–29
3.13. Type 1502: N-Stage Heating Aquastat or Simple Thermostat 3–31
3.13.1. Nomenclature 3–31
3.13.2. Mathematical Description 3–31
3.14. Type 1503: N-Stage Cooling Aquastat or Simple Thermostat 3–33
3.14.1. Nomenclature 3–33
3.14.2. Mathematical Description 3–33
3.15. Type 1669: Proportional Controller 3–35
3–5
TESSLibs 17 – Mathematical Reference
3–6
TessLibs 17 – Mathematical Reference
3. CONTROLLERS LIBRARY
MATHEMATICAL REFERENCE
This manual provides a detailed reference on each component model (Type) in the TESS
Libraries add-on to the TRNSYS Simulation Environment. The information includes the
mathematical basis of the model, as well as other elements that the user should take into
consideration when using the model (e.g. data file format, etc.).
This guide is organized in thirteen component categories that match the upper level directories in
the Simulation Studio proformas. Those categories are:
Applications
Cogeneration (CHP)
Controllers
Electrical
Geothermal (GHP)
Ground Coupling
HVAC
High Temperature Solar
Hydronics
Loads and Structures
Optimization (TRNOPT)
Solar
Storage
Utility
Within the categories, components are organized according to the models implemented in each
component. This is different from the Simulation Studio structure, where components are first
organized according to the function they perform, then according to the operation modes. An
example is the mathematical model known as Type 1 (Solar Collector), which is the first
component in the "Solar Thermal collectors" category in this manual. Type 1 is the underlying
model for 5 different proformas listed in the "Solar Thermal Collectors\Quadratic Efficiency"
category in the Simulation Studio. It is very frequent for one Type listed in this manual to be
associated with several proformas which correspond to different modes of operation for the
component.
3–7
TESSLibs 17 – Mathematical Reference
3.1.1. Nomenclature
The relative humidity set point for the humidistat. In other words, the target
RHSetPoint %
zone relative humidity.
TAirInlet C The temperature of air sensed by the controller.
The multiplier used to calculate the relative humidity set point from the
A -
inlet air temperature.
The constant used to calculate the relative humidity set point from the inlet
B -
air temperature.
Where “A” is the relative humidity set point multiplier (parameter 6) and “B” is the relative humidity
set point constant (parameter 5). For safety considerations, a high limit cut-out is included with
this controller. Regardless of the dead band conditions, the control function will be set to zero if
the high limit condition is exceeded.
The overall control strategy is as follows. If the input control signal was ON at the previous time
step (in other words humidification was being called for at the last time) then the signal remains
ON as long as the difference between the relative humidity set point and the zone relative
humidity is greater than the lower relative humidity dead band. Otherwise, the control signal
switches OFF.
If the input control signal was OFF at previous time step, then the signal switches ON if the
difference between the relative humidity set point and the zone relative humidity is greater than
the upper relative humidity dead band. Otherwise, the control signal stays OFF.
3–8
TessLibs 17 – Mathematical Reference
As stated previously, the signal switches OFF regardless of the dead band conditions if the high
limit cutout is activated. The control strategy is depicted graphically in Error! Reference source
ot found..
When the difference between the relative humidity set point and the zone relative humidity nears
the upper or lower dead band in the normal mode of operation, the control signal may sometimes
oscillate between ON and OFF for successive iterations at a given time step. This happens
because the relative humidity set point and the relative humidity of the zone change slightly at
each iteration, alternately satisfying and not satisfying the conditions for switching the controller.
The value of parameter 1 in this model is the number of oscillations of the control signal that are
permitted in the time step before the component “sticks” the output signal at one value so that the
calculations at this time step may be solved. It is recommended that the value of this first
parameter be set to an odd number to avoid biasing short-term results.
The problem of control strategies, controller sticking, and hysteresis in simulation is discussed in
section 4.1 in the Mathematical Reference in the TRNSYS documentation set.
An example with the Type658 component model is included in the following location.
“.\Tess Models\Examples\Controllers Library\Type658.tpf”
3.1.3. References
[1] Beckman, W.A., J.W. Thornton,, S. Long, and B.D. Wood, “Control Problems in Solar
Domestic Hot Water Systems”, Proceedings of the American Solar Energy Society, Solar 93
Conference, Washington D.C., 1993
[2] Duffie, J.A. and W.A. Beckman, Solar Engineering of Thermal Processes, Wiley Interscience,
New York, 1980
3–9
TESSLibs 17 – Mathematical Reference
3–10
TessLibs 17 – Mathematical Reference
3–11
TESSLibs 17 – Mathematical Reference
a way that if even the high burner setting was still not sufficient to bring the zone temperature
back up, an electric resistance heater (completely separate from the furnace) could be brought on
as a third stage heating device. Type698 is able to control up to three stages of heating and two
stages of cooling. Thus the user must specify three heating set points and two cooling set points
as inputs (since they may vary with time). Type698 checks to insure that the set point
temperature are all realistic. That is to say that the second stage cooling set point much be higher
than the first stage cooling set point, which in turn must be higher than the first stage heating set
point, which must be higher than the second stage heating set point, which must be higher than
the third stage heating set point temperature. The relative placement of the various set points is
shown graphically on a temperature scale in Error! Reference source not found..
If the zone temperature goes above the stage two cooling set point temperature, it may be
desirable for both the equipment associated with stage two and the equipment associated with
stage 1 cooling to be ON simultaneously. Alternatively, it may be desirable for the stage 1 cooling
equipment to shut OFF and for only the stage two equipment to be running. Similarly for heating it
may be desirable for stage 1 heating equipment to shut off in stage 2 but to come back on in
stage 3. To this end, Type698 requires the user to specify a series of parameter values to
indicate exactly when a stage may be enabled and when it should be disabled. The following
table summarizes the parameters, their values and the corresponding equipment enabling.
3–12
TessLibs 17 – Mathematical Reference
Component Operation
At any given iteration, Type698 determines the appropriate settings of up to 25 controllers, all of
which use the same set points and stage enabling scheme but which may each be monitoring a
different temperature. The value of 25 is a soft limit that may be increased as appropriate by
recompiling Type698 and relinking it into a DLL. For more information on this operation please
refer to the main TRNSYS documentation. Each of the controllers is checked to note whether it
has changed states more than the allowable number of times. If so, the state is stuck for all
remaining iterations in the time step and will only be unstuck once a new time step has started. At
the end of each iteration’s calculations, the state of each controller is stored for comparison
during the following iteration.
Example
Type698 is used in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 1.tpf”
3–13
TESSLibs 17 – Mathematical Reference
3.4.1. Nomenclature
*NOTE: While temperature notation is used, the model can be used to sense and make control decisions
based on any variable (flow rate, solar radiation, power, etc.)
3–14
TessLibs 17 – Mathematical Reference
However, two caveats apply. First, once the controller changes states (turns ON when it was
previously OFF or turns OFF when it was previously ON) then a lockout time applies. In other
words when the controller turns ON, it must stay ON for at least as long as the user-specified
minimum ON time. Likewise when the controller turns OFF, it must stay OFF for at least as long
as the user-specified minimum OFF time. Such lockouts are often used in control systems to
avoid controller “chattering.” One very common application is in solar domestic water heating
systems when the sun is just coming up; as the sun comes up, liquid in the collector itself heats
up and signals to the controller that the pump should be turned ON. As soon as liquid starts to
flow, the warm stagnant liquid in the collector is replaced with liquid that has cooled off during the
night and the controller signals the pump to switch OFF. The cycle repeats, causing the pump to
chatter until there is enough solar radiation to consistently heat the liquid in the collector loop. The
second caveat is that the control function is set to zero, regardless of the upper and lower dead
band conditions and regardless of whether the lockout time has passed, if T IN > TMAX. This
situation is often encountered in domestic hot water systems where the pump is not allowed to
run if the tank temperature is above some prescribed limit.
=1
i
1
o
=0
i
0
(T - T )
L H L H
Figure 3-5: Controller Function
Example
Type911 is used in both heating and cooling in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 2.tpf”
3–15
TESSLibs 17 – Mathematical Reference
3.5.1. Nomenclature
TRe turn [ºC] The temperature of the return or mains fluid used to temper the source fluid.
TSet [ºC] The setpoint temperature of the tempered liquid after mixing.
Source [ºC] The fraction of the return fluid that should be sent to the heat source.
3–16
TessLibs 17 – Mathematical Reference
applications). This means that the valve can change from heating to cooling mode during a
simulation; a useful feature for hydronic heating and cooling systems that make use of the same
piping network throughout the entire year.
In heating mode, the fraction of fluid that goes to the source is given by:
Treturn Tset
source Eq 3.5.2-1
Treturn Tsource
In cooling mode, the fraction of fluid that goes to the source is given by:
Tset Treturn
source Eq 3.5.2-2
Tsource Treturn
Type953 keeps track of whether the tempering valve has changed the fraction of fluid that should
go to the source from one TRNSYS iteration to the next (within a given time step). Type953’s sole
parameter allows the user to control how many changes in valve state are allowed before the
valve sticks to its last-calculated source fraction. The Type also keeps track of and reports the
number of simulation time steps during which the valve had to stick to its decision in order to
prevent excessive iteration. The report at the end is counted as a warning but should not worry
the user unless the valve was stuck at an inordinately large fraction of the simulation time steps.
3–17
TESSLibs 17 – Mathematical Reference
3–18
TessLibs 17 – Mathematical Reference
Example
Type970 is used in both heating and cooling in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 2.tpf”
3–19
TESSLibs 17 – Mathematical Reference
3–20
TessLibs 17 – Mathematical Reference
fan come on. If the temperature continues to increase past a second set point, the air conditioner
will switch over to high compressor setting and fan speed, removing more energy from the space.
Such an air conditioner would be referred to by this model as a two stage cooling device. The
same air conditioner could be used in such a way that if even the high cooling setting was still not
sufficient to bring the zone temperature back down, an auxiliary cooling device (completely
separate from the furnace) could be brought on as a third stage heating device. Type971 is able
to control up to n-stages of cooling. Thus, the user must specify n-cooling set points, up to 25, as
inputs (since they may vary with time). Type971 checks to insure that the set point temperatures
are all realistic. That is to say that the second stage cooling set point must be higher than the first
stage cooling set point. The third stage cooling set point must be higher than both the first and
second stage set points. This trend will be continued for all 25 levels of cooling set points.
Example
Type971 is used in both heating and cooling in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 2.tpf”
3–21
TESSLibs 17 – Mathematical Reference
3–22
TessLibs 17 – Mathematical Reference
The 1st stage heating turns "on" or to logic value 1 when temperatures falls below 15 C and 1st
stage "off" when temperature rises to 25 C. The example of the Type973 represented by this
figure turns subsequent stages "on" at 5-hour increments if the temperature remains below the
set point temperature - dead band temperature. The heating stages will turn "off" after 2 hour
increments if the temperature remains above the 20 C set point temperature.
Example
Type973 can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 2.tpf”
3–23
TESSLibs 17 – Mathematical Reference
3–24
TessLibs 17 – Mathematical Reference
The above figure is a graphical representation of the Type974 with four heating stages. The 1st
stage heating turns "on" or to logic value 1 when temperatures falls below 15 C and 1st stage
"off" when temperature rises to 25 C. The example of the Type974 represented by this figure
turns subsequent stages "on" at 5-hour increments if the temperature remains below the set point
temperature - dead band temperature. The heating stages will turn "off" after 2 hour increments if
the temperature remains above the 20 C set point temperature. The control sequence will not be
initiated until stage 3 is reached, which is set by Input 3.
Example
Type974 is used in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 2.tpf”
3–25
TESSLibs 17 – Mathematical Reference
After convergence of the TRNSYS simulation, if the input control signal is greater than 0.5 then
the "on time" output control signal is incremented by the timestep and the "off- time" signal is set
to zero. If the input control signal is zero, the "on time" control signal is set to zero and the "off
time" control signal is incremented by the timestep. Thus, this component calculates and outputs
the time current time within the temperature (or any other variable) range and the current time
that the temperature is outside the range.
Figure 3-13:
The above figure is a graphic representation of the Type980 calculating the running time that the
temperature is within the bounds of 15 C to 25 C (good control), and the running time that the
temperature is < 15 C or > 25 C (poor control). The Type980 component watches an input control
3–26
TessLibs 17 – Mathematical Reference
signal, up to n watched inputs, and calculates the duration which the signal is within or outside
the specified bounds.
Example
Type980 is used in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 2.tpf”
3–27
TESSLibs 17 – Mathematical Reference
For safety considerations, a high/low limit cut-out is included with this controller. Regardless of
the current conditions, the control function will be set to zero if the high limit condition is exceeded
in heating mode or if the low limit condition has been tripped in cooling mode.
A minimum run-time period and a minimum reset time period to better replicate controllers found
in many HVAC and solar applications has been implemented for this controller. We've also
added a lockout input that sets the output control function to zero whenever this lockout signal is
greater than 0.5. This feature can be used to disable the controller during certain times of the
day, certain times of year, or during periods where a given criteria is met.
Thus, this subroutine models a simple "Run-Time" controller that will turn "on" when a
temperatures falls below a user-specified setpoint temperature and stay on until the run-time
period has been elapsed or until the temperature rises above the safety-limit temperature.The
device can only come back "on" when the temperature falls below the setpoint temperature AND
enough time has passed to clear the minimum "off-time" condition.
NOTE: This control strategy can only be used with solver 0 (Successive substitution).
Example
Type1233 is used in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 3.tpf”
3–28
TessLibs 17 – Mathematical Reference
Heating Mode:
For example, the user wishes to provide heated water to a radiant floor system where the
temperature of the water is 40 C at an ambient temperature of -20 C but only 30 C at an ambient
temperature of 10 C.
It's important to note that at ambient temperatures less than T_Amb_L, the setpoint remains at
the T_Set_L condition and the operating signal is set to 1 (ON). At ambient temperatures above
T_Amb_H, the operating signal is set to 0 (off) and the setpoint is set to the T_Set_H condition.
Cooling Mode:
For example, the user wishes to provide chilled water to a cooling coil where the temperature of
the water should be 10 C at an ambient temperature of 35 C but has to be only 15 C at an
ambient temperature of 20 C.
3–29
TESSLibs 17 – Mathematical Reference
T_Amb_H = 35
T_Set_H = 10
It is important to note that at ambient temperatures greater than T_Amb_H, the setpoint remains
at the T_Set_H condition and the operating signal is set to 1 (ON). At ambient temperatures
below T_Amb_L, the operating signal is set to 0 (off) and the setpoint is set to the T_Set_L
condition.
Example
Type1250 is used in an example that can be found in:
“.\Tess Models\Examples\Controllers Library\Controls Example 3.tpf”
3–30
TessLibs 17 – Mathematical Reference
3.13.1. Nomenclature
n [0 or 1] Heating control signal at the previous time step for stage n.
DTSe Back [ºC] Dead band temperature difference for set up effect .
In many heating applications, a desired fluid temperature may depend on the time of day or the
day of the week. This variation of the heating set point temperatures are modeled here using an
optional set back control function and a set back temperature difference.
As with many controller components in TRNSYS, instabilities may occur when system
temperatures are at or very near to their set point values. Again as with other controllers, these
instabilities can be reduced by adding hysteresis (dead bands) to the controller such that the
controller signal does not change until the system temperature has reached its set point plus (or
minus) a small delta temperature. Hysteresis effects can be included in the model by supplying
the optional dead band temperature difference DTdb. A single value of DTdb, is applied to all
three output control functions.
3–31
TESSLibs 17 – Mathematical Reference
PARAMETER 2, NSTK, sets the number of oscillations permitted within a time step before the
output state of the controller is stuck. It is recommended that NSTK be set to a value of 3 or 5.
Odd values of NSTK ensure that if controller sticking becomes a problem, the controller will
change states between time steps and that the system will move toward a more stable state. For
a more detailed discussion of controller stability problems, see the introduction to the Controllers
section (chapter 4.1) of the TRNSYS documentation set.
At each iteration, the current values of the watch temperatures are compared to the current
values of the heating ON/OFF temperatures as computed using equations 1502.1 through
1502.3. The controller sets the value of the appropriate stage’s output control signal to 1 if the
current watch temperature is below the corresponding heating ON/OFF temperature.
In this model, dead band temperature differences for both hysteresis and temperature set back
are centered on the set point temperature.
If hysteresis effects are not used, then the dead band DTdb is set to zero. If the set back option is
not used, both SetBack and DTSetBack are set to zero.
NOTE: Care should be taken when choosing dead bands and set points. Dead bands that are
greater than the temperature difference between the set points will cause the controller to have
convergence problems.
Example
Type1502 is used in an example that can be found in:
“ . \Tess Models\Examples\Controllers Library\Controls Example 1.tpf”
3–32
TessLibs 17 – Mathematical Reference
3.14.1. Nomenclature
n [0 or 1] Cooling control signal at the previous time step for stage n.
In many cooling applications, a desired fluid temperature may depend on the time of day or the
day of the week. This variation of the cooling set point temperatures are modeled here using an
optional set up control function and a set up temperature difference.
As with many controller components in TRNSYS, instabilities may occur when system
temperatures are at or very near to their set point values. Again as with other controllers, these
instabilities can be reduced by adding hysteresis (dead bands) to the controller such that the
controller signal does not change until the system temperature has reached its set point plus (or
minus) a small delta temperature. Hysteresis effects can be included in the model by supplying
the optional dead band temperature difference DTdb. A single value of DTdb, is applied to all
three output control functions.
PARAMETER 1, NSTK, sets the number of oscillations permitted within a time step before the
output state of the controller is stuck. It is recommended that NSTK be set to a value of 3 or 5.
Odd values of NSTK ensure that if controller sticking becomes a problem, the controller will
change states between time steps and that the system will move toward a more stable state. For
3–33
TESSLibs 17 – Mathematical Reference
a more detailed discussion of controller stability problems, see the introduction to the Controllers
section (chapter 4.4) of the TRNSYS documentation set.
At each iteration, the current values of the watch temperatures are compared to the current
values of the cooling ON/OFF temperatures as computed using equations 503.1 through 503.3.
The controller sets the value of the appropriate stage’s output control signal to 1 if the current
watch temperature is above the corresponding cooling ON/OFF temperature.
In this model, dead band temperature differences for both hysteresis and temperature set up are
centered on the set point temperature.
If hysteresis effects are not used, then the dead band DTdb is set to zero. If the set up option is
not used, both SetUp and DTSetUp are set to zero.
NOTE: Care should be taken when choosing dead bands and set points. Dead bands that are
greater than the temperature difference between the set points will cause the controller to have
convergence problems.
Example
Type1503 is used in an example that can be found in:
“ . \Tess Models\Examples\Controllers Library\Controls Example 1.tpf”
3–34
TessLibs 17 – Mathematical Reference
Mathematically, the simple proportion of the input to the values is described by Equation 1669.1.
This was the primary function of the previous Type669 component
Value LowerSetPt
max 0, min 1, (Eq. 1669.1)
UpperSetpt LowerSetPt
Oppose to the former Type669, Type1669 now has the maximum rate of increase per hour and
the maximum rate of decrease per hour as parameters. When both of these parameters are equal
to 1, the above equation still applies. However, when those parameters are not equal to 1 (there
is a maximum rate of increase per hour or maximum rate of decrease per hour for the controller),
the following applies. When the control signal value is more than the previous value, the following
is the control signal.
3–35
TESSLibs 17 – Mathematical Reference
If 𝛾𝑖−1 < 𝛾𝑖 ,
When the control signal value is less than the previous control signal, the following is the control
signal.
If 𝛾𝑖−1 > 𝛾𝑖 ,
When the control signal value is less than the previous control signal, the following is the control
signal.
It will occasionally be desired to implement this component in the opposite conditioning mode (i.e.
heating instead of cooling). The simplest way to implement this is with an EQUATION block in
TRNSYS. Make an input in the EQUATION block; this input will be the output control signal from
Type1669. Next, implement an output equation such as the following.
γ
γHeating = 1 − (Eq. 1669.4)
1
Example
Type1669 is used in an example that can be found in:
“ . \TESS Models\Examples\Controllers Library\ Controls Example 1.tpf”
3–36