Heat pump programs for TSTAT 10

I’m writing programs for a for a heat pump with electric reheat and I think Im close but having trouble with a call for heat going straight to electric heat below 10 degrees F when the heat pump locks out. Maybe someone could help me. Here is what I got so far.

IN1 OAT (OUTSIDE TEMP)
IN2 RMTMP (ROOM TEMP)
IN3 HUM (ROOM HUMIDITY)

OUT1 RVLV (B ENERGIZED IN HEAT)
OUT2 COMP (Y COMPRESSOR)
OUT3 REHEAT (W2)
OUT4 HM (HUMIDIFIER)

MODEPRG
10 IF OAT > 65 THEN ENABLE HPCLPRG
20 IF OAT > 65 THEN STOP RVLV
30 IF OAT < 65 THEN DISABLE HPCLPRG
40 IF OAT > 70 THEN ENABLE DEHUMPRG
50 IF OAT < 70 THEN DISABLE DEHUMPRG
60 IF OAT < 60 THEN START RVLV
70 IF OAT < 60 THEN ENABLE HPHTPRG
80 IF OAT > 60 THEN DISABLE HPHTPRG
90 IF OAT < 10 THEN DISABLE HPHTPRG
100 IF OAT > 10 THEN ENABLE HPHTPRG
110 IF OAT < 40 THEN ENABLE AXHTPRG
120 IF OAT > 40 THEN DISABLE AXHTPRG
130 IF OAT < 40 THEN ENABLE HPRG
140 IF OAT > 40 THEN DISABLE HPRG

HPCLPRG (HP COOL)
10 IF RMTMP > 72 THEN START COMP
20 WAIT 00:20:00
30 IF RMTMP < 72 THEN STOP COMP
40 WAIT 00:20:00

DEHUM
10 IF COMP = 1 AND HUM > 50 THEN START REHEAT
20 IF COMP = 0 OR HUM < 50 THEN STOP REHEAT

HPHTPRG (HP HEAT)
10 IF RMTMP < 70 THEN START COMP
20 WAIT 00:10:00
30 IF RMTMP > 70 THEN STOP COMP
40 WAIT 00:10:00

HPRG (HUMIDIFIER)
10 IF COMP = 1 AND HUM < 40 THEN START HM
20 IF COMP = 0 OR HUM > 40 THEN STOP HUM

AXHTPRG
10 IM STUCK
ONLY AFTER 10 MINUTES OF COMPRESSOR ON IN HEAT AND ROOM TEMP ISNT ABOVE 70 YET SHOULD THE AUX HEAT COME ON, BUT BELOW 10 OUTSIDE THE HEAT PUMP COMPRESSOR WILL BE DISABLED, SO IN THAT CASE A CALL FOR HEAT WILL GO STRAIGHT TO AUX HEAT.

I can figure out everything else, but I can’t get my mode program to start and stop other programs based on outside temp?

A quick work around would be to use a variable as a flag instead. Then the first line of each program checks this flag and jumps out if the flag is disabled.

10 IF FLAG THEN END <Jump out of this particular program.
20 IF THIS AND THAT THEN… <normal logic here.

Lijun will check the statements related to running programs, I do recall there was a command for that.

See if writing it this way helps?

AXHTPRG
10 IF OAT < 10 THEN START REHEAT                 ; Immediately use auxiliary heat below 10°F
20 IF OAT >= 10 THEN
30     IF COMP = 1 AND RMTMP < 70 THEN WAIT 00:10:00   ; Wait for 10 minutes if compressor is running and room temperature is below setpoint
40     IF COMP = 1 AND RMTMP < 70 THEN START REHEAT    ; After 10 minutes, start auxiliary heat if room temperature is still not above 70
50     IF COMP = 0 OR RMTMP >= 70 THEN STOP REHEAT     ; Stop auxiliary heat if the compressor is off or room temperature is above 70

Thanks so much Lijun. I’ll try this code for the reheat.

I was unable to get programs to start and stop by outside temp, so I wrote this code to goto different lines based on outside temp and this works so far. This heat pump is Gree Flex and the reversing valve energizes in heat mode. My waits are only 5 seconds for testing. In real life they would be 10-15 minutes to set the cycles per hour properly.

10 IF OAT < 10 THEN GOTO 180
20 IF OAT < 62 THEN START RVLV AND GOTO 100
30 IF OAT > 62 THEN STOP RVLV AND GOTO 40
40 WAIT 00:00:05
50 IF RMTMP > 72 THEN START COMP
60 WAIT 00:00:05
70 IF RMTMP < 72 THEN STOP COMP
80 GOTO 10
90 WAIT 00:00:05
100 IF RMTMP < 70 THEN START COMP
120 WAIT 00:00:05
130 IF RMTMP < 70 THEN START REHEAT
140 WAIT 00:00:05
150 IF RMTMP > 70 THEN STOP REHEAT
160 IF RMTMP > 70 THEN STOP COMP
170 GOTO 10
180 IF RMTMP < 70 THEN START REHEAT
190 WAIT 00:00:05
200 IF RMTMP > 70 THEN STOP REHEAT

I really suggest creating a timer for the compressor, this can be laid on the screens, user interface, trend logs, alarms and so on. Using the wait statement, this important bit of info is held in the ‘ether’ basically, you cannot see it, touch it or debug it.

VAR100 = TIME-ON( COMP )
VAR101 = TIME-OFF( COMP )

Use these timer vars in your logic rather than waits and gotos. STRONGLY urge you to steer away from what Lijun has up there in these two last posts. (Sorry Lijun and Aaron).

Thanks Maurice, I’ll try to wrap my head around the VAR instead of the waits and the gotos I’m getting good at. Yes I’m sitting in the living room watching Bree play Nintendo and programming on the T3-Demo Rev1 lol

1 Like


Bree loves this thing. Maybe she’ll start programming soon.

1 Like

I think I got it all right. 2H/1C HP program with RV energized in heating and hum below 40% in heating and dehum in cooling using reheat in cooling mode above 50%. Below 10 OAT heat pump locks out and only electric heat runs. From 10-61 OAT HP, humidifier and aux heat work. Above 62 cooling and dehum work.

10 IF OAT < 10 THEN GOTO 180
20 IF OAT < 62 THEN START RVLV AND GOTO 100
30 IF OAT > 62 THEN STOP RVLV AND GOTO 40
40 WAIT 00:00:05
50 IF RMTMP > 72 THEN START COMP
55 IF COMP AND HUM > 50 THEN START REHEAT ELSE STOP REHEAT
60 WAIT 00:00:05
70 IF RMTMP < 72 THEN STOP COMP
80 GOTO 10
90 WAIT 00:00:05
100 IF RMTMP < 70 THEN START COMP
110 IF COMP AND HUM < 40 THEN START HUM ELSE STOP HM
120 WAIT 00:00:05
130 IF RMTMP < 70 THEN START REHEAT
140 WAIT 00:00:05
150 IF RMTMP > 70 THEN STOP REHEAT
160 IF RMTMP > 70 THEN STOP COMP
170 GOTO 10
180 IF RMTMP < 70 THEN START REHEAT
185 IF REHEAT AND HUM < 40 THEN START HM ELSE STOP HM
190 WAIT 00:00:05
200 IF RMTMP > 70 THEN STOP REHEAT

As usual I am not a fan of the wait statements, the program could run from top to bottom with no waits and no gotos. If there’s something that needs a delay you can create a variable which is used in other areas of the program that wait till the timer hits a certain triger point. This way you can add the timers to the displays and trend logs for debugging.

For IF THIS THEN THAT type programs, make sure to have some hysterisis in the logic. If below setpoint then start fan else stop fan for example, this could cause some short cycling around the setpoint. This can be improved with something like: if below setpoint then stop fan, if temp over setpoint + 0.5 then start fan.

That said, the general program looks solid, I will spend some time with it for more feedback soon.

Thanks for the guidance Maurice. I can’t get the individual programs to start and stop based on outside temp and I can’t figure out how to get this heat pump to run 3 different modes (below 10 OAT, 11-61OAT and above 62 OAT) without the gotos?

Here’s a stab at it, let me know how this goes. The CHANGOVR variable needs to be in the units of TIME, not seconds, minutes, hours, etc. Those safety lines are probably not required but that’s where you would add hard wired type interlocks, at the end of the program to override earlier logic as the final say.

10 IF OAT < 10 THEN START MODE1
20 IF OAT > 10 AND OAT < 61 THEN START MODE2
30 IF OAT > 61 THEN START MODE3
40 IF OAT < 10 AND TIME-ON( MODE2 ) > CHANGOVR THEN STOP MODE2.
50 IF OAT < 61 AND TIME-ON( MODE3 ) > CHANGOVR THEN STOP MODE3.
60 REM ****SAFETIES ***************
70 IF MODE1 THEN STOP MODE2, STOP MODE3
80 IF MODE2 THEN STOP MODE1, STOP MODE1
90 IF MODE3 THEN STOP MODE1, STOP MODE2
50 REM ****END OF THE PROGRAM ***********

THANKS! I left that controller at school so I’ll try it tomorrow night.