Internet PLC Forum
General => Technical support => Topic started by: karen on December 12, 2002, 11:31:27 AM
-
' heater control function
' SETIO heater or CLRIO Heater based on the
' value of ADC(1)/10
IF ADC(1)/10 < 15 SETIO HEATER
ENDIF
IF ADC(1)/10 > 17 CLRIO HEATER
ENDIF
thanks for all the help that you have given me i would like your knowlege. i just have one more question for you. the above statement works great in theory but the problem is the heater works ok when it reaches 17 the heater cuts off and the value at ADC(1) rises by 10. this means the liquid cools too much because it takes too long for the number to return to 15. how can i compensate for the increase by ten is there any way to subtract 10 from the upper value. so
heats to 17 heater turns off 0.5 of a second later
value rises to 27 at ADC(1) need to subtract 10
so the numer cools from 17 to 15 then repeat again
thanks karen ???
-
Sorry, I really didn't quite get what you mean. What is 27? Is it value at ADC(1) or is it ADC(1)/10?
You don't have to divide by 10 if it does not serve your purpose, why not:
IF ADC(1) < 155 SETIO HEATER
ENDIF
IF ADC(1) > 175 CLRIO HEATER '
ENDIF
In the above the value is adjusted so that heater only turn off when value of ADC(1) is greater than 175, and turn on when the value is less than 155 which is equivalent to ADC(1)/10 = 17.5 or 15.5 (of course, TBASIC does not support floating point so this is just for illustration purpose only).
If you want a 0.5second delay, you can always turn on a relay that in turns energize a 0.5s timer. When the timer times out the output can be turned off by either the [CLEAR] function or by "CLRIO Heater" statement in another custom function.
-
what happens is there is a fluctuation in the reading because when heater turns off so there is increase in voltage and then this in turn affects the adc(1) so that is the 27
thanks