Results 1 to 9 of 9

Thread: AWC code using ATK and FMM optical switches

  1. #1
    New User
    Join Date
    Sep 2017
    Location
    20646
    Posts
    6

    AWC code using ATK and FMM optical switches

    I need some help to review this code and make sure that there are no glaring errors. I am trying to do a favor for someone and help program an AWC on a tank that is a couple hundred miles away from me. I have my own AWC, but my code will not work for this particular setup. I had to modify my code extensively because my system, due to its configuration, has to fill first and then drain. It also has momentary switches on a BoB that allow the AWC to be run on demand and SW to be mixed, which I don't need here. Below is a copy of the code that I am planning to try on this system. This system should drain and then refill during the AWC. All of the float switches are defined at the top of the left column. Physical and virtual outlets are defined in the right column, with a short explanation of what each line is doing. My main concern is that I want to make sure the code will function as desired. I don't want any surprises. Thank you for the help.


    ATO_LO
    ATO_HI
    SumpLo
    SwResL

    Waterchange
    Fallback OFF
    Set OFF
    If Output AWCDrain = ON Then ON
    Defer 006:00 Then OFF
    If Output AWCTIME = ON Then ON


    AWCTIME

    Fallback OFF
    Set OFF
    If Time 16:00 to 16:01 Then ON
    Defer 001:40 Then ON

    AWCDrain
    Fallback OFF
    If Output WaterChange = ON Then ON
    If Output WaterChange = OFF Then OFF
    If Output DrainDone = ON Then OFF
    When On > 001:00 Then OFF

    DrainDone
    Set OFF
    If SumpLo OPEN Then ON
    If SwResL OPEN Then ON
    If Output WaterChange = OFF Then OFF
    Defer 006:00 Then OFF

    AWCFill
    Fallback OFF
    If Output WaterChange = ON Then ON
    If Output WaterChange = OFF Then OFF
    If Output AWCDrain = ON Then OFF
    If Output FillDone = ON Then OFF

    FillDone
    If ATO_LO CLOSED Then ON
    If ATO_LO OPEN Then OFF
    If ATO_HI CLOSED Then ON
    If Output AWCDrain = ON Then OFF
    If Output WaterChange = OFF Then OFF
    Defer 006:00 Then OFF

    SumpPump
    Fallback OFF
    If Output AWCDrain = ON Then ON
    If Output DrainDone = ON Then OFF


    SWResPmp
    Fallback OFF
    If Output AWCFill = ON Then ON
    If Output FillDone = ON Then OFF

    ATK
    Fallback OFF
    Set OFF
    If ATO_LO OPEN Then ON
    If ATO_HI CLOSED Then OFF
    When On > 005:00 Then OFF
    Defer 000:10 Then ON
    Defer 000:04 Then OFF
    Min Time 060:00 Then OFF
    If Output WaterChange = ON Then OFF
    Lower float switch for normal water level on ATK
    Upper backup float switch for ATK if ATO_LO fails
    Low opt switch on FMM for WC to stop draining
    Float switch at bottom of fresh SW drum on BoB


    Virtual Outlet (VO) to turn on WaterChange
    Turns OFF if communication is lost with Apex
    Sets initial state to OFF before following code
    Keeps the WC running
    Keeps VO on for six minutes during water change
    Turns WC on automatically at correct time

    VO to start WC at set time
    Turns OFF if communication is lost with Apex
    Sets initial state to OFF before following code
    Says to turn on WC at 16:00
    Delays command until 16:01:40. Holds button for 20 seconds to start AWC.

    VO to start draining
    Turns OFF if communication is lost with Apex
    If WC VO is ON Then it is ON
    If WC VO is OFF Then OFF
    Turns OFF when drain is done
    Turns OFF when on > 1 min. Saves pump from running dry if SwResL fails. Fill takes 30 seconds.

    VO that stops draining of water
    Sets initial state to OFF before following code
    If Low Float Switch is dry drain is done
    If no fresh saltwater, stops WC
    If WC VO times out then stops WC
    Waits 6 min to turn stop the process.

    VO that fills with fresh saltwater
    Turns OFF if communication is lost with Apex
    If WC VO is ON Then it is ON
    If WC VO is OFF Then OFF
    Cannot drain and fill at the same time
    Turns off when refill is complete

    VO that stops filling
    Stops filling at lower float switch on ATK
    Keeps filling until lower ATK float switch is reached
    Stops filling if lower ATK float switch fails
    Cannot drain and fill at same time
    If WC VO times out then stops WC
    Waits 6 min to stop the process, giving time for WC to finish.

    Pump to remove saltwater
    Turns OFF if communication is lost with Apex
    If VO is ON then drain
    If finished draining then OFF


    Fresh saltwater pump in barrel
    Turns OFF if communication is lost with Apex
    Turn on to refill with water
    Turn OFF when finished

    ATK programming
    Turns OFF if communication is lost with Apex
    Sets initial state to OFF before following code
    If lower ATK switch is dry then ON
    If high ATK switch is wet then OFF
    Turn OFF if running > 5 minutes
    Do not turn back ON for at least 10 seconds
    ATK will run for at least 4 seconds before turning OFF
    ATK will not run for at least 60 min after turning OFF
    Turns OFF ATK if WaterChange is ON to prevent filling with RODI instead of SW

  2. #2
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    11,681
    Something is screwed u pl with your formatting and I can't make heads or tails if what you posted.

    Sent from my SM-G965U using Tapatalk

  3. #3
    New User
    Join Date
    Sep 2017
    Location
    20646
    Posts
    6
    I did not realize that it looks fine in my computer's browser, but if you look at it on the mobile site nothing lines up. No wonder you can't understand it. I will have to get rid of the columns and try this again. Thanks.

  4. #4
    New User
    Join Date
    Sep 2017
    Location
    20646
    Posts
    6
    Here is all of the outlets without the explanation of the code. Let me know if this is viewable. If it is not I will try again. Thanks again.

    The names of the float switches are below:
    ATO_LO -
    Lower float switch for normal water level on ATK
    ATO_HI - Upper backup float switch for ATK if ATO_LO fails
    SumpLo - Low opt switch on FMM for WC to stop draining
    SwResL - Float switch at bottom of fresh SW drum-empty on BoB

    Waterchange
    Fallback OFF
    Set OFF
    If Output AWCDrain = ON Then ON
    Defer 006:00 Then OFF
    If Output AWCTIME = ON Then ON

    AWCTIME
    Fallback OFF
    Set OFF
    If Time 16:00 to 16:01 Then ON
    Defer 001:40 Then ON

    AWCDrain
    Fallback OFF
    If Output WaterChange = ON Then ON
    If Output WaterChange = OFF Then OFF
    If Output DrainDone = ON Then OFF
    When On > 001:00 Then OFF

    DrainDone
    Set OFF
    If SumpLo OPEN Then ON
    If SwResL OPEN Then ON
    If Output WaterChange = OFF Then OFF
    Defer 006:00 Then OFF

    AWCFill
    Fallback OFF
    If Output WaterChange = ON Then ON
    If Output WaterChange = OFF Then OFF
    If Output AWCDrain = ON Then OFF
    If Output FillDone = ON Then OFF

    FillDone
    If ATO_LO CLOSED Then ON
    If ATO_LO OPEN Then OFF
    If ATO_HI CLOSED Then ON
    If Output AWCDrain = ON Then OFF
    If Output WaterChange = OFF Then OFF
    Defer 006:00 Then OFF

    SumpPump
    Fallback OFF
    If Output AWCDrain = ON Then ON
    If Output DrainDone = ON Then OFF


    SWResPmp
    Fallback OFF
    If Output AWCFill = ON Then ON
    If Output FillDone = ON Then OFF

    ATK
    Fallback OFF
    Set OFF
    If ATO_LO OPEN Then ON
    If ATO_HI CLOSED Then OFF
    When On > 005:00 Then OFF
    Defer 000:10 Then ON
    Defer 000:04 Then OFF
    Min Time 060:00 Then OFF
    If Output WaterChange = ON Then OFF

  5. #5
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    11,681
    Is there any particular reason your friend needs to do a drain then fill method vs continuous? Your approach is quite complex for a newer user and all that really saves him about a 2-5% reduction in saltwater use.

    Sent from my SM-G965U using Tapatalk

  6. #6
    New User
    Join Date
    Sep 2017
    Location
    20646
    Posts
    6
    He previously had an AWC and ATO that someone helped him build, but it had started to malfunction. There were problems with the float switches and the BoB. He just purchased a new BoB, as well as an ATK to replace the ATO, so this looked like a good opportunity to redo the AWC. He could use something like the DOS, but this way allows him to save some money on equipment and stick with a process he knows. He has been changing 5 gallons of water per day in a 300 gallon system.

  7. #7
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    11,681
    Why are you deferring the drain done and fill done for 6 minutes? 10-30 seconds would make sense but 6 minutes doesn't.

    Your water change outlet should be on long enough for the full cycle plus a small buffer. How long does the drain and fill take normally?

    Sent from my SM-G965U using Tapatalk

  8. #8
    New User
    Join Date
    Sep 2017
    Location
    20646
    Posts
    6
    Fill will take about 90 seconds and drain takes about 60 seconds. How much extra time do you think is appropriate to add as a buffer? Do you see any other blatant errors in the code? I have already had him physically install the ATK and the float switches, as well as contact support to update his Apex Classic and setup the ATK in fusion. I am just trying to do my best to make sure that when we enable the water change there will not be a catastrophic failure. Your help is greatly appreciated.

  9. #9
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    11,681
    I can't get it to copy cleanly to edit, so I will just show what the control methodology should be.

    A water change enable outlet should be on for 6 minutes. This should be supervised by conductivity, high and low sump levels, and low NSW reservoir but use a min time to let it finish if levels were good at the start.

    An enable drain should be on for the first 3 minutes.

    An enable fill should be on for the last 3 minutes.

    The drain outlet should be on when allow drain is on and supervised by the low level float, low NSW reservoir. A short defer of 10 seconds or so might be worthwhile.

    The fill outlet should be on when allow fill is on and supervised by the normal level float. A short defer of 10 seconds or so might be worthwhile.

    Sent from my SM-G965U using Tapatalk

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •