rate of change alarm for tank level

gordon beers

Member
Join Date
Nov 2006
Location
Houtzdale, Pennsylvania
Posts
5
I am a water works operator attempting to learn the new plc based control system (TSX Quantum and Momentum) I am a beginner at best with the proworks software. I would love to find a program example of a rate of change alarm for tank levels. ie if the tank is dropping at a defined rate then energize an alarm contact. Any ideas out there?
 
Greetings Gordon and welcome to the forum.

My apologies for not being able to show you a Proworx snap shot as I don't have it installed on this particular computer.

Program a timer to compare your current tank level with the previous tank level at a periodic rate. Each time the timer passes power you perform three SUB instructions. Assume that:
40001 - current tank level
40002 - previous tank level
40003 - change in tank level
40004 - rate of change alarm level.

The first SUB instruction will subtract the current level 40001 from the previous level 40002 and place the result in 40003.

Then use another SUB to subtract 0 from the current tank level 40001 and place it in the previous level register 40002 (SUB 0 or ADD 0 is how you move single words of data in Proworx).

Finally, SUB 40004 and 40003. If you refer to online help for the SUB instruction in Proworx you will see that the SUB instruction can pass poewer on three lines, if the result is positive, if the result is 0, and if the result is negative. You can use these to set your alarm bit.

Make sure you tie all three outputs lines of the first two SUB instruction together so that you pass power to the final SUB instruction no matter what the results are.

I hope this helps.
 
Alaric said:
Then use another SUB to subtract 0 from the current tank level 40001 and place it in the previous level register 40002 (SUB 0 or ADD 0 is how you move single words of data in Proworx).

I have read enough of Alaric's posts to be sure that he knows what he is doing but after more than 20 years of working with many different PLC's I find the above to be astonishing. Is there really no other way of moving values than fudging maths instructions using Proworx.
Andybr
 
There is a block move function BLKM which can move 1 or multiple registers, but for a single register move I prefer the SUB function, its faster and you can see the value of the data being moved
 
I'm not familiar with the PLC in question, but based on the importance of the time interval and the levels being sampled (to obtain an accurate slope), wouldn't this require some sort of INTERRUPT priority? I know that in GE Fanuc, you have to specify an interrupt or it will be only as accurate as the plc scan allows.
 
processing................

Thanks, You are all great! I can see that I will not be alone as I continue learning PLC Programming. Thank you for sharing your knowledge. I do not think this is going to be a problem but I will mention it anyway...Well two things...The tank level readings will be accomplished via leased line communications for several distribution sites (polled RTU units) The poll loop takes less than 4 minutes for all sites (I live in the boonies and cannot do radio)None-the-less I expect the program to solve using the last known value until the register is updated by the latest poll. No problem right? The next issue deals with Rate of Change while the booster pumps are filling the tank. On many occasions a leak will develope in our distribution sytem while a booster is running. The tank level will hold or gradually drop while the pump works at pushing the water out of the leak. Perhaps I can set a bit to enable a reverse Rate of Change calc and alarm only while the pumps are running.
 
rytko said:
Tank levels usually don't change very fast, so I doubt an interrupt is necessary. The normal program scan should be adequate.


You are so right! I was thinking in terms of slope and trying to accuratly measure it, so I overlooked what was being measured and how SLOW that rate would be. Might be faster than watching paint dry!
 
Rate of change

I am not familiar with the programming tool you are using and the response so far looks good. But, by definition rate of change is change over time. The method shown only appears to give the direction of change, not the rate of change. The amount of change divided by the time between readings would give the rate of change.
 
Berryh, welcome.

The method I suggested first computes the amount of change over a specific time interval. Next it is necessary to determine if this change exceeds the allowed amount of change during that interval, whatever it is. The way to do this is with a comparrison. The solution I posted compares the change in tank level, in reg. 40003, to a max alarm value, reg. 40004. The simplest way to do a comparrison in a Modicon PLC is with a SUB instruction. The Modicon SUB instruction block has three different outputs. The state of these output is dependent on the result of the SUB instruction. These three outputs can be used to determine if the change in level is greater than the alarm point, equal to the alarm point, or less than the alarm point. If the OP wanst to alarm when the rate of change is greater than or equal to the setpoint, then he will tie two of the SUB instruction ouputs to a single alarm coil and leave the third unconnected in his logic.
 
I have attached an excerpt from the Modicon instrucition set reference manual on the SUB instruction for anyone who wants to see how it is used also as a comparator and for single word moves.
 

Similar Topics

We are using PLC 5 and currently have "Temp Rate Change Alarm" that is basically doing a compare every 8 seconds and alarming on any change of...
Replies
5
Views
2,546
How can I write Logic for Rate Of change Alarm in UnityPro V4.0 Please Help...
Replies
1
Views
1,936
I am working on a PLC program that requires an analog valve to close a given percentage in a given time in seconds. I give the start position, the...
Replies
22
Views
2,957
Hi All, My question is about how to detect the rate of change in a register and know is it increasing or decreasing, for example I wanna know if...
Replies
11
Views
3,806
Hello, I'm trying to take input from a group of load cells and compute throughput (i.e. tons/hour, kg/hour, etc.). Currently the load cells...
Replies
6
Views
1,633
Back
Top Bottom