Control for pump with intermittent duty cycle

  • Thread starter Thread starter Gp!
  • Start date Start date
  • Tagged users Tagged users None

Gp!

Well-Known Member
View Badges
Joined
May 19, 2017
Messages
631
Reaction score
423
Rating - 0%
0   0   0
I have a pump with a 50% duty cycle. I am using it to move water from a storage tank to my mix tank. I have a toggle switch hooked up to a break out box that I want to use to turn it on.

I have created virtual outlet "MIX_FW_ON" to be ON when the toggle switch is flipped up and OFF when flipped down.

I have created virtual outlet "MIX_FULL" to be ON when the water level is as high as it can be without overflowing.

I have created virtual outlet "FW_EMPTY" to be on when the storage tank is empty.

I want outlet "MIX_FW_PUMP" to be on when outlet "MIX_FW_ON" is ON and "MIX_FULL" is OFF. However, I want the pump to cycle between ON and OFF every 5 minutes. Otherwise, I want the pump to be off.

Does this look right?

Code:
Fallback OFF
Set OFF
If Output MIX_FW_ON = ON Then ON
OSC 000:00/005:00/005:00 Then OFF
If Output FW_EMPTY = On Then OFF
If Output MIX_FULL = On Then OFF
 
I don’t think your code will work the way you want. Don’t forget the Apex is a state machine and at the end of parsing the code the state will be either ON or OFF. The OSC command doesn’t care what the prior state was, it just sets a state of ON and OFF based on a defined cycle. So anything you put before it is overridden (e.g. your If Output MIX_FW_ON = ON Then ON).

The commands after the OSC can however change the state further. So the way to do this is to set a default state using the OSC command and then other commands to take other factors into account and change this default state.

I think below will do what you want.

Fallback OFF
Set OFF
OSC 000:00/005:00/005:00 Then ON
If Output MIX_FW_ON = OFF Then OFF
If Output FW_EMPTY = ON Then OFF
If Output MIX_FULL = ON Then OFF
 
The OSC command doesn’t care what the prior state was, it just sets a state of ON and OFF based on a defined cycle. So anything you put before it is overridden (e.g. your If Output MIX_FW_ON = ON Then ON).

Are you saying that the line OSC 000:00/005:00/005:00 Then OFF sets the state to "ON" even though the assignment is "OFF"?
 
I think below will do what you want.

Thanks btw! Haven't done much with advanced programming before. You got me going and I added a momentary button for forcing the pump to fill when I want a touch more
 

TOP 10 Trending Threads

WHICH FLOW PROBLEM IS HARDEST TO SOLVE IN YOUR REEF?

  • Eliminating dead spots

    Votes: 9 23.1%
  • Keeping sand from blowing around

    Votes: 5 12.8%
  • Balancing flow for different coral types

    Votes: 11 28.2%
  • Creating random or turbulent movement

    Votes: 2 5.1%
  • Finding effective pump placement

    Votes: 1 2.6%
  • Managing noise or vibration

    Votes: 2 5.1%
  • Keeping pumps hidden and accessible

    Votes: 2 5.1%
  • I still feel like I’m mostly guessing

    Votes: 7 17.9%
  • Other (Comment in the thread)

    Votes: 0 0.0%
Back
Top
Home
Post thread…
Market
What's new