sjpbailey Posted October 19, 2022 Posted October 19, 2022 Hello! i have a administration console pool program for my pool node sever and i am controlling a pool sweep with a Valve. Control is tri-tate, two contact closures, one for open and one for closed on our pool valve for our pool sweep. (Works great!) Unfortunately I had to replace the valve as it was overworked. Why does the administration console THEN in a program continuously cycle the THEN routine? When IF activates it. I have the valve timed in the program to open in Skim mode for 45 seconds to open the valve all the way, then stop, then close Sweep for 9 seconds to give the sweeper enough water to run. Well the THEN routine keeps cycling when i want it to only cycle through its sequence once at the start of the program! i tried STOP and DISABLE in the routine and neither work! hey i do not want to keep buying a $200 24vac tri-state pool valve its expensive for a retired disabled person and a large pain in MY *** for my broken back to replace the valve again! So this continually running THEN is costing me money in worn out parts i do not want to wear out!!! Not happy and cannot find a fix in the much too long wiki and cookbook! Lots of useless information on the topic. i am sure this has caused many problems overworking equipment so i need a fix for this!!! i am glad i am not an integrator running this on a customers equipment! I would be out of business quick!!! running this on an ISY, Polisy running node server soon to be all polisy. Regards!
MrBill Posted October 19, 2022 Posted October 19, 2022 (edited) You'll need to post the program so that we can see what's going on. Right click the program name and pick Copy to Clipboard all the way at the bottom of the list, then paste the clipboard into a forum post. If I had to guess tho, I'd guess that one of the IF values changed. When that happens the currently running copy of the program ceases to exist at the next break (wait, repeat, etc). The methods to avoid that are to link several programs together: Program 1 If some condition then run program 2 (then) Program 2 If (blank) then Disable Program 1 do some stuff Wait X seconds do some more stuff repeat until X=Y another line and another Enable Program 1 Sometimes when deal with, for example, temperatures were we need a hysteresis we might use 3 programs. Program 1 If Temp > 80 then Run Program 2 (then) Program 2 If (nothing) then Disable Program 1 repeat every 20 minutes turn fan on wait 10 minutes turn fan offProgram 3 If Temp < 76 then Stop Program 2 turn fan off (it may or may not be on, but make certain) Enable Program 1 In either case we should also create a program that runs at startup to create known conditions, for this second example we would want Program 4 (disabled) (run at startup) If (none) then Turn fan off Enable Program 1 either condition may or may not be true but on startup there must be known conditions. There's a couple ways to set the Run at Startup flag on a program, the simplest is from the "Summary" sub-tab under programs. Edited October 20, 2022 by MrBill 2
MrBill Posted October 20, 2022 Posted October 20, 2022 @sjpbailey did this help? do you still have questions? do you need program suggestions? 1
sjpbailey Posted October 20, 2022 Author Posted October 20, 2022 Thank you @MrBill i will display the program this evening when i am back home. It is a scheduled start IF with a Then routine. 1
sjpbailey Posted October 22, 2022 Author Posted October 22, 2022 (edited) Okay @MrBill Sorry I had three contractors show up at the house yesterday. I have Three programs currently running. One to stop pump and two for cleaning. I removed an AND on the IF that was looking at the solar edge node server for kW so if above 400 watts and schedule start IF. This may have caused the THEN to continually cycle. In reading your response I see I may need a separate program to do this similar to my stop program. I think it would be okay to add AND or OR to an IF statement along with a schedule however maybe it is not seeing the Node Server information consistently causing the THEN to cycle. I am finishing a 1956 F-100 with an 79 year old Dave stopped by wanting something to do and said he saw my truck apart wondered if I needed help, so lucky to have him as I have a ten pound weight limit on lifting. LOL! We also have front landscaping project currently taking my time up and I did not have time to follow up with you on this, I apologize! Highest Regards, Bailey Edited October 22, 2022 by sjpbailey
sjpbailey Posted October 22, 2022 Author Posted October 22, 2022 @MrBill Here is what I did have an AND on the IF for kW threshold to be achived to start the pool pump. Currently this will be removed and I will watch the relief valve for valve actuation. It is also weird that watching AC I never witnessed the THEN show RUNNING in AC Programs, Summary.
MrBill Posted October 22, 2022 Posted October 22, 2022 6 hours ago, sjpbailey said: @MrBill Here is what I did have an AND on the IF for kW threshold to be achived to start the pool pump. Currently this will be removed and I will watch the relief valve for valve actuation. It is also weird that watching AC I never witnessed the THEN show RUNNING in AC Programs, Summary. Yes that AND statement will cause the IF to be reevaluated each and every time the watts value changes by .1 Further since there are a lot of "wait" statements in the program the THEN block will be restarted from the top every time the value changes by .1 To help fix your program I need to understand the intent better and what the watt value normally is. Also once it starts is it ok to complete the cycle even if the value falls below 400? In other words I'm not sure if you want to stop the cycle if the sun goes away. Either way tho we need some hysteresis to prevent short cycling. --- In the future please post actual program lines rather than sceenshots of programs. As I mentioned above: On 10/19/2022 at 9:15 AM, MrBill said: Right click the program name and pick Copy to Clipboard all the way at the bottom of the list, then paste the clipboard into a forum post. The reason is because if a program is posted in this manner and we want to show you how to change it, Copy and paste can be used. Example: Magic Orb Copy - [ID 01EA][Parent 0001] If From Sunrise To 11:55:00PM (same day) Then Set 'Magic Orb#' On Else Set 'Magic Orb#' Off If we want to make suggestions then it simple to copy and paste to show you a better way without retyping your entire program. 1
sjpbailey Posted October 23, 2022 Author Posted October 23, 2022 @MrBill Well I have a valve that can either sweep the pool or skim the pool. At high speed it can do both. So first is getting the valve which is tr-state to the right position for the right gpm, i achieve this by using time of stroke to set valve position. The kW threshold is, when above 400kW. Which would only be a problem without any hysteresis on a cloudy day as the node server should be in constant communications. When I noticed the problem I was easily above 3000kW so it was not a hysteresis problem when I realized it was stroking and that was the problem eating valves. I believe it is also sample rate when the node server is being communicated with. I believe there are intermediate breaks in communication. That is one main problem with the line code in AC. There is no differential (if > or if <) in one statements for an IF or a THEN. You should be able to say, Start Pump if kW is above 400kW and not if < 200kW within one IF control statement. Needs an update to add this I believe, switch it all to python... LOL!
MrBill Posted October 23, 2022 Posted October 23, 2022 11 hours ago, sjpbailey said: When I noticed the problem I was easily above 3000kW so it was not a hysteresis problem when I realized it was stroking and that was the problem eating valves. If the node server updates the value every every 30 seconds, as written your admin console program will be starting from the top every 30 seconds. Your example above shows with one decimal place.. so if it's 3000.0 now and 3000.1 in 30 seconds from now that causes the admin console program to restart from the top of the THEN block. in another 30 seconds if the next value is 2999.7... that too restarts the THEN block from the top. Each time the value of the node changes the true/false status of the program IF is re-evaluate... and EACH TIME it's re-evaluated the THEN or ELSE block will start. This is both a powerful feature and a powerful curse. To avoid the problem you need to use either an Integer Variable or a State Variable. How to pick? An integer variable when used in a IF body acts as a filter on. A state variable can be both a filter and a trigger. For example, lets consider an integer variable, iSunValue. iSunValue is set by the program: If Active Power <> -99999.9 then iSunValue = Active Power Since active power will never be -99999.9, that means that iSunValue will be updated each and every time Active Power changes. In other words iSunValue will always mirror the value of the node Active Power. Why is that helpful? Because when used in the if statement above: If On Sat, Tue, Thur From 8:00 Am to 2:00 PM (same day) AND iSunValue > 400.0 will now work as you were expecting it to. Only at 8AM will the sun value be taken into account. On the other hand if we change the variable to a State Variable i.e. sSunValue and consider the programs: If Active Power <> -99999.9 then sSunValue = Active Power If On Sat, Tue, Thur From 8:00 Am to 2:00 PM (same day) AND sSunValue > 400.0 That program will behave EXACTLY the same way as you wrote it above: That being each time Active Power Updates so will the variable which since a State Variable is also a trigger in an IF statement will cause the THEN block to restart EACH TIME a value in the IF block changes. so first program works, Second program doesn't. If you want to re-evaluate the Sun value periodically throughout the time period we might do this, using a state variable: If On Sat, Tue, Thur From 7:59 Am to 2:00 PM (same day) then Repeat every 30 minutes sSunValue = Active Power If On Sat, Tue, Thur From 8:00 Am to 2:00 PM (same day) AND sSunValue > 400.0 That pair of programs will only include the Active Power on 30 minute intervals. In all cases I left your THEN and ELSE block off to alleviate typing. That's why it's nice to have your programs in text form, because better examples can be copy and pasted together. 1
Solution sjpbailey Posted November 2, 2022 Author Solution Posted November 2, 2022 (edited) @MrBill good morning how do you close this? Solution to the problem was to separate the valve control in its own program with its own schedule. As you pointed out! - Reason every other 30 seconds the SolarEdge would show zero for 30 seconds even though it always had kW output at the device. It also has locked up before and was fixed by Bob when converted to PG3. The pump on its own now rides through this and now the valve doesn't care on its own and never runs THEN repetitively again because it is now a schedule only. i am not going to copy and paste the programs because i am right in the middle of writing code for Tuya and this simple basic programming could use a hysteresis in all if >< statements in IF! To have three programs to do one function is convoluted. i have used Automated Logic's Eikon that has hysteresis built in as a setting for IF >< statements this with a graphical interface. I hope after Polyglot is finished oh and it is working so very well now, that we can have this upgraded as well. While i am wishing, some graphics would make this a little more desirable in the controls market along with trends on graphs that are pickable and work with auto axis would also be cool. I see trends are there and they should be pickable for all node variables automatically. History in troubleshooting is the most important to finding a problem and fixing it. its okay i was only doing pneumatic and electric controls in the 70's-80's then electronic controls as i ran the controls department in the Bay Area for Acco Air Conditioning Company inc now Acco Engineered Systems for 10 year starting in 1993. Tridium, Automated logics, Robert Shaw, Johnson, Honeywell etc... Also a pipe-fitter and systems operation, so yes on your high or low rise construction all the equipment on my jobs i would put into commission. Now after three years of Python i am a Jr developer and never went to college, not bad for five credits short of an AA degree 😂 Cheers and THANK YOU for your valuable TIME, Case Closed! Highest Regards, Bailey Edited November 2, 2022 by sjpbailey
Recommended Posts