CAI webcontrol help

gkp741

New Member
Does this look OK? Thanks.
I would like a relay to turn on the pump to the panels when I have a temp difference between the panel output and storage tank of 12 degrees or more and off when it is less than 5 degrees.
T1=solar panel water temp, T2=water tank temp, T3=shop temp
OP1=TTL output 1 for panel pump relay, OPT2=TTL output for heat transfer pump
relay.

Start
ADD 12 T2 VAR1
ADD 5 T2 VAR2
TSTLT T1 VAR2
CALLSUB panel_pump_off
TSTGT T1 T2 VAR 1
CALLSUB panel_pump_on
END

panel_pump_off:
SET OP1 0
RET

Panel_pump_on:
SET OP1 1
RET
 
Does this look OK? Thanks.
I would like a relay to turn on the pump to the panels when I have a temp difference between the panel output and storage tank of 12 degrees or more and off when it is less than 5 degrees.
T1=solar panel water temp, T2=water tank temp, T3=shop temp
OP1=TTL output 1 for panel pump relay, OPT2=TTL output for heat transfer pump
relay.

Start
ADD 12 T2 VAR1
ADD 5 T2 VAR2
TSTLT T1 VAR2
CALLSUB panel_pump_off
TSTGT T1 T2 VAR 1
CALLSUB panel_pump_on
END

panel_pump_off:
SET OP1 0
RET

Panel_pump_on:
SET OP1 1
RET

Did you mean

TSTGT T1 VAR1

in line 6
 
Here is the whole thing. I will have a dedicated CPU connected and would like to log or save T1, T2, T3 and the states of OP1 & OP2 to the computer every 5 minutes. Any suggestions? Thanks.

Start
ADD 12 T2 VAR1
ADD 5 T2 VAR2ADD 5 T3 VAR3
TSTLT T1 VAR2
CALLSUB panel_pump_off
TSTGT T1 VAR 1
CALLSUB panel_pump_on
TSTLT T2 115
CALLSUB heat_off
TSTGT T2 120
CALLSUB heat_on
TSTGT T3 60
CALLSUB heat_off
END

panel_pump_off:
SET OP1 0
RET

Panel_pump_on:
SET OP1 1
RET

heat_off:
SET OP2 0
RET

heat_on:
TSTLT VAR3 60
SET OP2 1
RET
 
Because the temperature is not as smooth as true flat line, sensor reading at one time is 60, the next time ccould be 59.9. I would recommend to add small delay in each of your routine to SET OP1 1/0 SET OP2 1/0, then check the temperature again before set the output. In that way, your relay's life can be extended a lot.

For example, your original:
heat_on:
TSTLT VAR3 60
SET OP2 1
RET
can be changed to:
heat_on:
DELAY 100
TSTLT VAR3 60
SET OP2 1
RET

In that DELAY 100 added 100ms before checking the temperature again. This DELAY length should be determined by your heater and cooling rate. If your heater move temprature very fast, uses a smaller delay. If heater move temperature very slow, uses a bigger delay. Key point is to use this delay as "debouncer" for the signal up and down.
 
There is a program written by io_guy on the universal devices forum. It is designed to synchornize CAI values with variables on ISY, but you don't have to bother with that. You can set it to only sync with a CAI and turn the logging function on and it will save cai values to a log file.
 
Back
Top