Running pump at intervals

Do you have a question on how to do something.
Ask in here.
Post Reply
wolffman64
Posts: 62
Joined: Mon Feb 24, 2014 9:38 pm
Location: Sydney, Australia

Running pump at intervals

Post by wolffman64 »

Hi, I need to run my pump for the chiller for, let's say, 1 minute every hour throughout a 24 hour interval, to avoid that the water in my chiller gets anaerobic during long periods of not requiring the chiller.

I also need to check that the chiller and pump is not already running (due to temp in sump already running the chiller pump).

Is there a way to easily code this? Any help greatly appreciated.
/Jan

P.S. how can I get that cool banner from my RA to appear at the bottom of each of my replies?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Running pump at intervals

Post by rimai »

What is the temp range for your chiller.
You can do something like this:

Code: Select all

if (ReefAngel.Params.Temp[T1_PROBE]<250)
{
  ReefAngel.Relay.Set(Port1,elapsedSecsToday(now())<60);
}
else
{
  ReefAngel.StandardFan(Port5,253,260);
}
For the banner, you need to change your signature.
If you go to the Portal, you will find the banner styles and a link. Use the link to add it to your signature.
Roberto.
wolffman64
Posts: 62
Joined: Mon Feb 24, 2014 9:38 pm
Location: Sydney, Australia

Re: Running pump at intervals

Post by wolffman64 »

Cool, I have a banner! :-)
wolffman64
Posts: 62
Joined: Mon Feb 24, 2014 9:38 pm
Location: Sydney, Australia

Re: Running pump at intervals

Post by wolffman64 »

Thanks Roberto.

I don't think that it works testing on the temp, since the temp can be in the same interval either because it stable there, or because the chiller is on but in the process of bringing it down.

Can I instead test if the time is xx:15 (xx is any hour between 00 to 23), and if port 6 is off, then run the pump (will be on port 4) for 1 minute? This needs to be repeated every hour.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Running pump at intervals

Post by lnevo »

if (!ReefAngel.Relay.Status(Port6) ReefAngel.Relay.Set(Port4, (now()+900)%SECS_PER_HOUR<60);

Which says... if Port 6 is off... Set Port 4 to the result of the equation after the comma...

if the current time is 15 minutes after the hour (+900) divide the time by how many seconds per hour and get the remainder... if the remainder is less than 60 seconds (first minute of every XX:15) then the pump will be On otherwise it will be Off.

Sorry if that's a bit cryptic, but the equation will work. For a bit easier explanation and if you want to modify...

(now()+OFFSET)%REPEAT_INTERVAL<RUNTIME
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Running pump at intervals

Post by rimai »

How is port4 coded?
It has to be coded to turn on with the chiller, right?
Lee's code would probably not work if that's the case.
I think this code would work:

Code: Select all

if (minute()==15 && !ReefAngel.Relay.Status(Port6)) ReefAngel.Relay.On (Port4);
Roberto.
wolffman64
Posts: 62
Joined: Mon Feb 24, 2014 9:38 pm
Location: Sydney, Australia

Re: Running pump at intervals

Post by wolffman64 »

Thanks guys, really appreciate the help. Realised after both your suggestions that this is more complicated than I thought...

Port4 is coded just like port 6, to switch on when temp2=25.6, and switch off when temp2=25.
ReefAngel.StandardFan( Port4,250,256 )

What I want is for the pump (port4) to run at least 1 minute every hour at the time xx:15, which Roberto's code above would solve, apart from that code line doesn't have any runtime in it (it must switch off after a minute). But, what happens if the pump/chiller needs to run (temp2=25.6) during that minute? Then I want the "normal" code take over and run pump and chiller. Can I somehow use the ReefAngel.StandardFan( Port4,250,256 ) expression to see if standard fan is "on", or about to go "on"?

Also, to make it ideal, if the chiller/pump has already run in the last hour, I don't really need to start the pump for a minute at xx:15, but this last condition is not that important.

Sorry for being a bit of a "noob" in this programming language....
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Running pump at intervals

Post by rimai »

Use like this:

Code: Select all

ReefAngel.StandardFan( Port4,250,256 );
if (minute()==15 && !ReefAngel.Relay.Status(Port6)) ReefAngel.Relay.On (Port4);
I'm pretty sure it will work.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Running pump at intervals

Post by rimai »

Thinking about again, I don't think it will...
Try this instead:

Code: Select all

ReefAngel.StandardFan( Port4,250,256 );
if (minute()==15 && !ReefAngel.Relay.Status(Port6)) // if port6 is off and we have 15minutes from the hour
  ReefAngel.Relay.Override (Port4,1); // Override port4 on
else
  ReefAngel.Relay.Override (Port4,2); // Put port4 back to auto
Roberto.
wolffman64
Posts: 62
Joined: Mon Feb 24, 2014 9:38 pm
Location: Sydney, Australia

Re: Running pump at intervals

Post by wolffman64 »

Brilliant Roberto!, thanks so much!
Post Reply