If then functions

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)

gibbers

Active Member
View Badges
Joined
Apr 3, 2022
Messages
248
Reaction score
256
Location
Metro Detroit
Rating - 100%
1   0   0
Good day all
I have a Profilux 4 and multiple GHL power bars. I have a Versa dosing pump attached to outlet 24 and it doses from my reefocto KS250. I would like to have something setup like this

IF PH < 8.2
THEN switch outlet 24 ON
IF PH >= 8.2
THEN switch outlet 24 OFF

I don’t understand how to make this logic work within the programmable logic maybe I’m just dense lol

thank you in advance
 

Sean Clark

7500 Club Member
View Badges
Joined
May 16, 2019
Messages
8,055
Reaction score
31,580
Location
Michigan
Rating - 0%
0   0   0
I don't have a profilux but my limited programing experience is seeing a few problems.

The first is your pH range. There needs to be some kind of differential or the logic will fail.

Second is the use if multiple logic functions in a single statement. IF PH >= 8.2

An or statement would normally be between the less than and equal. I do not know if GHL supports this.

I would expand the pH range and use a simple if greater than, if less than statement.

The emails, the emails, the, the, the emails...
 
OP
OP
gibbers

gibbers

Active Member
View Badges
Joined
Apr 3, 2022
Messages
248
Reaction score
256
Location
Metro Detroit
Rating - 100%
1   0   0
Ghl has something called programmable logic that I am playing with but it’s not totally clear.
 

Attachments

  • 49C1082D-3A20-4820-AE49-5C20A55A96E6.png
    49C1082D-3A20-4820-AE49-5C20A55A96E6.png
    59.5 KB · Views: 17

tbrown

Nominated Cronie Intern - Might be failing?
View Badges
Joined
Nov 22, 2019
Messages
50,484
Reaction score
110,567
Location
Peoria, AZ
Rating - 100%
2   0   0
Same as @Sean Clark , no GHL experience but I did a little programming back in 2000 (not an expert and that was 22 years ago so take it with a grain of salt). From what I remember, typically in programming you'd have
IF xyz
THEN a

For a second IF/THEN it might be a
ELSE IF lmn
THEN b

So something like:
IF pH <= 8.3
THEN On (might be a 1 for true)
ELSE IF pH >= 8.2
THEN Off (might be a 0 for false)

If 1 is true for on and 0 for false for off it might just be:
IF pH <= 8.3

Again, hard to say as each programming language is slightly different.
 

Gaël

Well-Known Member
View Badges
Joined
Sep 27, 2014
Messages
614
Reaction score
356
Location
France
Rating - 0%
0   0   0
Hi,

If I understand your request correctly, there is no need for dosage scheduling but just dosing according to the pH value. So no need for the dosing pump function in your programmable logic.
So this is done by adjusting the nominal value and using the functions ph increase ph decrease and programmable logics.
May need to create a virtual sensor to have a 2nd nominal value for a finer adjustment.

Some resources:

See also:

Gaël
 
Last edited:

Lasse

10K Club member
View Badges
Joined
Mar 20, 2016
Messages
10,894
Reaction score
29,906
Location
Källarliden 14 D Bohus, Sweden
Rating - 0%
0   0   0
Suggestion

Program outlet 24 with the function pHx increase (pH2 in my case)
Set the nominal value for the actual pH electrode t 8.2 - hysteresis 0.05, Now you will have a variation between 8.175 and 8.225. But GHL is able to more. Here is an example - I use GCC because its better to do a screenshot in there but you find the same functions in the app.
I have set the nominal value to 8.10 and hysteresis to 0.05 (blue circle) You need to change your nominal value to 8.2. Go down to operation mode controller - chose pulse variable. If you do this - the on pulse (to the dose pump) will max run the time you put in beside Pulse (in my case 10 sec) The fix Pause I have put to 1 minute. This means that if the real value is far below the nominal value - it will run 10 sec and wait 1 minute in order to see if anything change - if no or to small change - it will run for 10 sec more - waiting for the new reading during 1 minute and so on. If your real pH get close to the nominal value - the pulse will be shorter but the pause will be the same. In some way the hysteresis play a role. My setting is only a suggestion - you may have to play around with the values depending on your system. If you have a large system with long time before the adjusted water is mixed and reach the sensor - the pause may need to be higher but if your electrode is downstream (close to) the "adding" point - you need to have a short pause time. It is always fixed. The max time for the pulse is depending on the "strength" of the added compound.

1670403049858.png


I have use this formula in "kalk reactors" - but with the outlet function pHx decrease. CO2 is a strong pH lower - the kalk reactor have a short mixing time - it means that I use pulse as short as 1 sec and pause between 10 and 30 sec. Below a chart showing the pH in a large kalk reactor running as we speak. You can see that even with short pulses - great pH change in short time. But in your case - you have to test with different pulse and pause times and and probably with nominal valy and hysteresis too

1670404326523.png

The reactor is only allowed to run between 06:00-22:00, The settings is nominal value 6.45, hysteresis 0.05 and pulse - pause is set to 2 sec pulse resp 30 sec pause time

1670404608884.png



Sincerely Lasse
 
OP
OP
gibbers

gibbers

Active Member
View Badges
Joined
Apr 3, 2022
Messages
248
Reaction score
256
Location
Metro Detroit
Rating - 100%
1   0   0
Suggestion

Program outlet 24 with the function pHx increase (pH2 in my case)
Set the nominal value for the actual pH electrode t 8.2 - hysteresis 0.05, Now you will have a variation between 8.175 and 8.225. But GHL is able to more. Here is an example - I use GCC because its better to do a screenshot in there but you find the same functions in the app.
I have set the nominal value to 8.10 and hysteresis to 0.05 (blue circle) You need to change your nominal value to 8.2. Go down to operation mode controller - chose pulse variable. If you do this - the on pulse (to the dose pump) will max run the time you put in beside Pulse (in my case 10 sec) The fix Pause I have put to 1 minute. This means that if the real value is far below the nominal value - it will run 10 sec and wait 1 minute in order to see if anything change - if no or to small change - it will run for 10 sec more - waiting for the new reading during 1 minute and so on. If your real pH get close to the nominal value - the pulse will be shorter but the pause will be the same. In some way the hysteresis play a role. My setting is only a suggestion - you may have to play around with the values depending on your system. If you have a large system with long time before the adjusted water is mixed and reach the sensor - the pause may need to be higher but if your electrode is downstream (close to) the "adding" point - you need to have a short pause time. It is always fixed. The max time for the pulse is depending on the "strength" of the added compound.

1670403049858.png


I have use this formula in "kalk reactors" - but with the outlet function pHx decrease. CO2 is a strong pH lower - the kalk reactor have a short mixing time - it means that I use pulse as short as 1 sec and pause between 10 and 30 sec. Below a chart showing the pH in a large kalk reactor running as we speak. You can see that even with short pulses - great pH change in short time. But in your case - you have to test with different pulse and pause times and and probably with nominal valy and hysteresis too

1670404326523.png

The reactor is only allowed to run between 06:00-22:00, The settings is nominal value 6.45, hysteresis 0.05 and pulse - pause is set to 2 sec pulse resp 30 sec pause time

1670404608884.png



Sincerely Lasse
thank you for this detail. I’m working on this now. I didn’t realize GCC offered more capabilities
 

Lasse

10K Club member
View Badges
Joined
Mar 20, 2016
Messages
10,894
Reaction score
29,906
Location
Källarliden 14 D Bohus, Sweden
Rating - 0%
0   0   0
I didn’t realize GCC offered more capabilities
Maybe not more capabilities but if you should show something with a a screenshot - it is easier to show all in one windows. For me - old man - it is an easier tool to use - you can toggle between the windows and also show two (ore more) windows at the same time. And it has been a lot of improvements lately - in the light settings - you can set the actual LED you use and get the spectra. The video shows how you get two windows. Just click on the window tab you want to move and drag



If I should work with a lot of things the same time - its the best tool for me to use

Sincerely Lasse
 

Just grow it: Have you ever added CO2 to your reef tank?

  • I currently use a CO2 with my reef tank.

    Votes: 8 5.3%
  • I don’t currently use CO2 with my reef tank, but I have in the past.

    Votes: 5 3.3%
  • I have never used CO2 with my reef tank, but I plan to in the future.

    Votes: 9 6.0%
  • I have never used CO2 with my reef tank and have no plans to in the future.

    Votes: 123 81.5%
  • Other.

    Votes: 6 4.0%
Back
Top