PROGRAMS
Now for the programming, its not done yet but here’s where I am at.
10 REM ********** ENABLE FAN ACCORDING TO SCHEDULE *********
20 IF OCCUPIED OR AHU1OVMD THEN START AHU1FAN
30 IF AHU1NITH OR AHU1NITC THEN START AHU1FAN
40 IF NOT AHU1OVMD AND NOT OCCUPIED AND NOT AHU1NITH AND NOT AHU1NITC THEN STOP AHU1FAN
50 IF AHU1SMKS THEN STOP AHU1FAN
OCCUPIED is the schedule that we set up earlier, AHU1OVMD is the overide mode which is triggered by a momentary contact wired to input5. The program was getting a little long so I put the logic for this button and timer in a separate timer program #2. A hit on the override button triggers a counter to a certain value and then decrements it every second till it hits zero at which time the AHU1OVMD overide mode then goes to off. The fan will come on if the schedule or overide mode are true. The fan can also come on for night heating and cooling, if either of these are true the fan can also come on in the unoccupied period to maintain the night setpoints.
The nigh cooling and night heating variables, if they are ON then heating and/or cooling can come on at night. If you want to lock out night cooling or heating you just toggle these to OFF.
The smoke detector shutdown is the last line related to the fan, this means it has higher priority than all the preceding lines. If there’s smoke you want to shut this unit down, no matter what logic is up above. Normally there’d be a hardwired interlock anyway but its good to have it in the logic as well.
60 REM ********** COOLING ****************
70 IF PID1 > 30 THEN START AHU1COL1
80 IF PID1 > 50 THEN START AHU1COL2
90 IF PID1 < 25 THEN STOP AHU1COL1
100 IF PID1 < 45 THEN STOP AHUCOL2
110 IF NOT AHU1COK THEN STOP AHU1COL1 , STOP AHU1COL2
120 IF AHU1KFAN = 2 THEN STOP AHU1COL1 , STOP AHU1COL2
130 IF NOT OCCUPIED AND NOT AHU1NITC THEN STOP AHU1COL1 , STOP AHU1COL2
140 IF NOT AHU1FAN THEN STOP AHU1COL1 , STOP AHU1COL2
The cooling is done by staging of stage1 and 2 at the rather arbitrary trip points as shown. The trip points have a hysterisis of 5%, this is a small gap to avoid short cycling around the trigger points. The stage1 and stage2 also have a small gap to avoid jumping between one stage and two stage cooling.
Lines further down in the program will override the earlier lines, so we put some lockouts further down, like line 140 if the fan is off we dont want the compressor on. Similarly in line 130 if the building is unoccupied and the night cooling is OFF then we dont want the cooling coming on. Line 120 is for the case where the program is loaded into a Tstat10, the user can command the system into heating (2) or cooling (1) and so on from the keypad.
150 REM ********** HEATING ****************
160 IF PID2 > 30 THEN START AHU1HEA1
170 IF PID2 > 50 THEN START AHU1HEA2
180 IF PID2 < 25 THEN STOP AHU1HEA1
190 IF PID2 < 45 THEN STOP AHU1HEA2
200 IF NOT AHU1HOK THEN STOP AHU1HEA1 , STOP AHU1HEA2
210 IF AHU1KFAN = 1 THEN STOP AHU1HEA1 , STOP AHU1HEA2
220 IF NOT OCCUPIED AND NOT AHU1NITH THEN STOP AHU1HEA1 , STOP AHU1HEA2
230 IF NOT AHU1FAN THEN STOP AHU1HEA1 , STOP AHU1HEA2
The heating works in the same way as the cooling but using its own heating PIDs to drive the staging.
240 REM *************** SETPOINTS ***************
250 IF OCCUPIED OR AHU1OVMD THEN AHU1SETP = AHU1DSET ELSE AHU1SETP = AHU1NSET
260 IF AHU1SETP > AHU1MAXS THEN AHU1SETP = AHU1MAXS
270 IF AHU1SETP < AHU1MINS THEN AHU1SETP = AHU1MINS
280 AHU1CSET = AHU1SETP + COOLDB
290 AHU1HSET = AHU1SETP - HEATDB
If the building is in occupied or overide mode then the main ‘setpoint’ is equal to the ‘daytime setpoint’, otherwise set it to the night time setback setpoints. The main ‘setpoint’ is a single setpoint which the user can see on the dipslays to manage it manually. It could also be on the display of the Tstat10 and managed from the keypad if this program were to be loaded into one of those.
The heating and cooling setpoints are offset from the main ‘setpoint’ by the cooling and heating deadbands in lines 280 and 290. Normally these will be a degee or two DegF or C. The gap provided by these deadbands helps prevent simultaneous heating and cooling which can happen when you are using integral control, the I term in the PID settings screens above. We also have the changeover delay so this gap could in theory be zero… but I like to use the gap and adjust it for day and night in the program. During the daytime we can program in a small gap for optimum comfort and at night the gap can be loosened up.
Lines 260 and 270 will clip the main ‘setpoint’ between the min and max settings. This is done to keep the user from cranking the value too high or low, either from the T3000 user screens and/or the Tstat10 keypad if that applies to your project.
ToBeDone:
lead/lag operation,
modulating option,
free cooling & damper
min and max supply temp limits
Tstat10 option, occupant control from keypad.
https://temcocontrols.com/ftp/software/28_TwoHeatTwoCoolPlusModulatingOption_Rev3.prog