Host Engineering Forum

General Category => DirectSOFT => Topic started by: dieseltwitch on May 07, 2009, 09:22:06 PM

Title: Comparing Temps
Post by: dieseltwitch on May 07, 2009, 09:22:06 PM
Ok so here is my problem, I need to compare two different temperatures then turn on an output IF and only IF the difference is greater or equal than a given set point.
Example:
lets say temp 1 is at 160*
and the "on setpoint" is 12*
then Y0 will only turn on when Temp 2 reaches 172* or above.
and at the same time once Y0 is on the temperatures much be within 4* before Y0 turns off.
Basically a differential temperature controller for a solar thermal system.

Any one got any ideas
Title: Re: Comparing Temps
Post by: b_carlton on May 08, 2009, 12:10:21 AM
Let's see if this is correct:

State 1: If Temp2 > (Temp1 + 12) then turn on Y0, go to state 2

(I'll assume the turning on Y0 will tend to drive Temp2 toward Temp1, is that correct?)

State 2 when Temp2 < (Temp1 + 4) then turn Y0 off, go to state 1.


Does that sound anything like what you want?  Please correct as needed. By the way - state logic (or Stage or RLLPlus as AD calls it) is great for doing something then as conditions change doing something else.
Title: Re: Comparing Temps
Post by: dieseltwitch on May 08, 2009, 12:57:16 AM
You are correct.
Temp 1 is the the temperature of the solar collectors
Temp 2 is the tank temperature

How do i do the math in the program to get Temp1 +12 and Temp1+4?
 
Title: Re: Comparing Temps
Post by: b_carlton on May 08, 2009, 08:49:17 AM
Import the following

PLC 05

// Rung 1
// Address 0
SG S0

// Rung 2
// Address 2
LD V2000
ADDD K12 (Note: if your readings are in Binary than change this to ADDB Kc)
OUT V2003

// Rung 3
// Address 6
STR V2001 V2003
JMP S1

// Rung 4
// Address 9
SG S1

// Rung 5
// Address 11
OUT Y0
LD V2000
ADDD K4  (Note: If your readings are in binary then change this to ADDB K4)
OUT V2004

// Rung 6
// Address 16
STRN V2001 V2004
JMP S0

// Rung 7
// Address 19
END

// Rung 8
// Address 20
NOP


#BEGIN ELEMENT_DOC
"Y0","Something","","You didn't say what this was, I presume a pump?"
"S0","Wait High Temp","",""
"S1","Wait Low Temp","",""
"V2000","Solar Coll Temp","","Temperature of the Solar Collectors"
"V2001","Tank Temperature","",""
"V2003","High Switch Pnt","",""
"V2004","Low Switch Pnt","",""

#END
Title: Re: Comparing Temps
Post by: dieseltwitch on May 10, 2009, 05:25:28 PM
Thanks! that works great!