Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:02 01 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Temperature differential logic

Author Message
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 01:10pm 09 Apr 2016
Copy link to clipboard 
Print this post

Just not quite getting my rusty brain around temperature differential logic.
This simple code works, but doesn't allow for any differential. Like say 0.3°


If TmpCur<TmpTar Then 'Compare Current & Target temperature.
PumpStat="Running" 'Turn the Pump on.
pin(PinLed1)=1
else
PumpStat="Standby" 'Turn the Pump off.
pin(PinLed1)=0
endif


Main reason I want differential, is not for Solar control, but for when I'm using the Heat Pump. I want to reduce the amount of times it cycles on & off.

Cheers.
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 724
Posted: 02:05pm 09 Apr 2016
Copy link to clipboard 
Print this post

.....???

HYSTERESIS ?
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 02:08pm 09 Apr 2016
Copy link to clipboard 
Print this post

That's the term I should have used.

Ie,

When temperature gets to 34°C, stop heating, but don't start again before it falls below say 33.6°.

Guessing it will need some sort of cycle flag.

Cheers
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 724
Posted: 02:38pm 09 Apr 2016
Copy link to clipboard 
Print this post

This Is very simple.
HYSTERESIS is done by a Schmitt-Trigger.
You need a software Schmitt-Trigger like this:

if( Input > top)
LED = 1

else if( Input < min)
LED = 0Edited by atmega8 2016-04-11
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2428
Posted: 05:22pm 09 Apr 2016
Copy link to clipboard 
Print this post

try the following:


hyst = 1

If TmpCur<(TmpTar-hyst) Then 'Compare Current & Target temperature.
PumpStat="Running" 'Turn the Pump on.
pin(PinLed1)=1
endif

If TmpCur>(TmpTar+hyst) Then 'Compare Current & Target temperature.
PumpStat="Standby" 'Turn the Pump off.
pin(PinLed1)=0
endif


when the current temperature falls 1 degree below the target temperature, the pump is turned on.

when the current temperature rises 1 degree above the target temperature, the pump turns off.


cheers,
rob :-)
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 08:39pm 09 Apr 2016
Copy link to clipboard 
Print this post

  robert.rozee said   try the following:


hyst = 1

If TmpCur<(TmpTar-hyst) Then 'Compare Current & Target temperature.
PumpStat="Running" 'Turn the Pump on.
pin(PinLed1)=1
endif

If TmpCur>(TmpTar+hyst) Then 'Compare Current & Target temperature.
PumpStat="Standby" 'Turn the Pump off.
pin(PinLed1)=0
endif


when the current temperature falls 1 degree below the target temperature, the pump is turned on.

when the current temperature rises 1 degree above the target temperature, the pump turns off.


cheers,
rob :-)


Thanks Rob,

That's basically what I came up with once I rested my brain & could thing logically again.


If TmpCur<(TmpTar - TmpDif) Then
PumpStat="Running" 'Turn the Pump on.
pin(PinLed1)=1
else if TmpCur>(TmpTar) then
PumpStat="Standby" 'Turn the Pump off.
pin(PinLed1)=0
endif



Just not swinging on the high side of the set temp.

Will just have to add a minimum wait timer on it for when it's in heat pump mode now so the compressor unit can depressurise.

Have found a good example some else has done of Ardurino over here.
Phil.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025