Jump to content

Creating hysteresis in a program


eric_allman

Recommended Posts

Posted

I've got a fireplace with a fan with thermostat, so that the fan automatically turns on when the fire heats up and off when the fire turns off. I've installed a In-LineLinc Relay With Sense inside the fan so I can tell when the fan turns on and off, and have a program that turns on other fans in the room to get the air moving. The problem is that when the thermostat turns off it "jitters" — that is, it turns off-on-off-on-off in a period of about ten seconds. I want my program to block for a short period after the first "off" so it ignores this jitter.

 

However, this is proving harder than I expected. Since the condition is evaluated even if the program is currently running (and apparently restarts), a simple 20 second wait doesn't work. I tried disabling the program at the start and re-enabling it at the end, but somehow the program still gets interrupted, so it doesn't get re-enabled.

 

Is there some trick to make this work?

 

eric

Posted

Suggest posting the Program. Right click Program name, select Copy to Clipboard and paste to forum post. The Program If will be reevaluated only while in a Wait or Repeat. A simple Wait 20 seconds to allow the Status to settle down before doing anything functional should have been enough (without Enable/Disable) unless the InLineLinc cycling On/Off is occurring over a period longer than 20 seconds.

Posted

eric_allman-

 

Try this:

 

If 
     Status  FireFanSense is On
  and 
    Status OtherFans is Off

Then
   Set Other Fans On

 

 

If 
  Status FireFanSense is Off

Then
  Wait 20 seconds
  Set OtherFans Off

 

Sense has to remain off for 20 seconds before reacting.

 

-Xathros

Posted

Xathros, thanks for the tip. That worked fine (and is really obvious; I'm somewhat embarrassed). I was able to reduce this to one program by using the "on" part in the Then clause and the "off" part in the Else clause, but other than that it's the same thing. Thanks again.

Guest
This topic is now closed to further replies.

×
×
  • Create New...