Leak Detection with PLC

Bullzi

Lifetime Supporting Member
Join Date
Jun 2012
Location
Colorado
Posts
1,530
Hi Everyone,
Working with a L73 and Studio 5k v24

I have a requirement to monitor 2 flow meters on each end of the pipeline for leak detection. I am suppose to set an alarm if the difference between their totalizers over a rolling 24 hour period is too large.

Now I have all the logic written to read the totalizers and determine the difference between them. That was the easy part.

How would you go about doing this? I have so many ideas in my head they are all starting to run together. I think I need a fresh perspective.

Please let me know any thoughts you have.
Thanks for your help.
 
First thing you have to think about is how often you check/update the difference. Every hour? Every 15 minutes? Every minute?

My impression is that every hour would be enough. So every hour, for each totaliser, you need to store the current value of each totaliser, and calculate the increase over the last 24 hours by comparing it to the stored value from 24 hours ago. Here's basically how I'd tackle it. You will need to do this for both totalisers.

- Create an array of 24 DINT's (or REAL's, or whatever data format your totaliser values are)
- Every hour, trigger an FFL to load the current value into the array (have a read of the help file on the FFL and FFU if you're unfamiliar with them)
- When you execute the FFL, also check if the FFL is full of valid data records (which it always will be, after the initial 24 hours). To do this, use the .DN bit of the FFL. If it's full, then execute an FFU on the same array. This will unload the oldest value (i.e. the one from 24 hours ago) from the array
- Compare the unloaded value with the just-loaded value - the difference between them is the totalised flow from that flow meter over the last 24 hours

Do that to both flow meters, and then each time your FFL/FFU executes, you have a "totalised flow over the last 24 hours" figure from each.
 
Now I have all the logic written to read the totalizers and determine the difference between them. That was the easy part.

Simple. At say, 1:00 am have the PLC read the current values in each totalizer and store them. At 12:59:59 am the next day compare the two and generate an alarm if necessary. At 1 am load the new totals into the PLC and repeat.
 
rootboy,
I am already doing something similar to that. I am reading the totals all the time but at midnight I move the totals into a start totalizer and then use that number to subtract from the live totals to get a daily total. That wont give me the moving 24 hour window that I need. That will give me a diffrence in a fixed 24 hour block. I am afraid that wont meet the requirements.

ASF,
Thanks for the info!! I will double check with the project engineer and find out if the 1 hour time base is good for him. I was thinking of the same type of thing but have never used the FFL/FFU instructions before. I will look into doing it that way.

Thanks to you both for helping!!
 
ASF,
Do I have to execute the FFU before I execute the FFL if the array is full? I am adding this now and that question came to mind.
Thanks!!
 
Now that you mention it - yes, that's probably a better way of doing it. Every hour, unload the 24-hour old data, compare it against the current data, then load the current data in.

If you need more frequent checking, you just have to increase the size of your array proportionally. e.g. if you need it updated every 15 minutes, create an array of size 96.
 
Thanks!!
That is how I have done it. On the change of the hour I FFU the array if the FFL is done and compare the old value with the current value. On the next rung I execute the FFL to load the current total value.

I really appreciate the help. Like I said I have never used FFL/FFU but always wondered how it worked. Now that I understand it I can think of some other places where I can use it.
 
No problem, glad it's helped! Yes, they're very useful instructions - I use them for calculating rolling averages, storing diagnostic information, storing batch queue information...the list goes on and on.
 
This is a simple water pumping system. They just want to know if the plastic pipe that is transporting the water has a leak. So a dedicated leak detection system would be overkill and expensive for this application.

If it was Petroleum I would definitely use a dedicated system.
 
rootboy,
I am already doing something similar to that. I am reading the totals all the time but at midnight I move the totals into a start totalizer and then use that number to subtract from the live totals to get a daily total. That wont give me the moving 24 hour window that I need. That will give me a diffrence in a fixed 24 hour block. I am afraid that wont meet the requirements.

"I am suppose to set an alarm if the difference between their totalizers over a rolling 24 hour period is too large."

You did say over a 24 hour period. Be careful what you ask for... :)
 
Bullzi,

How big is the pipe?
If you have a break, how much water will you loose before you detect the break?

you may want to have a second monitor in place that looks at the pressure drop say every 2 1/2 minutes. Not recording data, just looking at the pressure. it will detect the break.
just make sure when it resets, it keeps the high pressure value.

regards,
james
 
Well I have just talked to the project Engineer. His original spec called for a leak over a 24 hour period. Checking every hour is too slow as we could have a large leak before we get an alarm. So we are changing it to checking every minute with a max delta of 0.5 gallon from minute to minute. So I have to re-think the routine but at least I did get to use the FFL and FFU for the first time.
 
Sounds about right. Wait til you get it working, then move the goal posts.

Checking every minute against the last minute is dead easy.

XIC One_Minute_Pulse BST SUB Totaliser_1 Totaliser_2 Delta_This_Check SUB Delta_Last_Check Delta_This_Check Delta_Last_Minute GRT Delta_Last_Minute 0.5 OTL Leak_Alarm NXB MOV Delta_This_Check Delta_Last_Check BND

That makes a few assumptions about which figures are going to be higher or lower, but the structure should get you pretty close
 
Oh, and the first check will of course give you a fault as there's no "Delta_Last_Check" value until the first time through, but after that it should be OK
 

Similar Topics

We are building some ATEX motor control panels. I need a electrode relay that has CE stamp and "declaration of conformity" document. This is...
Replies
5
Views
4,171
Hi all, I'm trying to undertake my first conveyor system project which I hope/think could be relatively simple for experienced programmers such...
Replies
6
Views
2,790
Hi, I am looking for simple leak detector that I can wire into an I/O module. This is not for a critical piece of equipment, so I'm not looking...
Replies
14
Views
2,951
I want to try to detect if a 25kg paper sack has not been stitched correctly. The sack is checkweighed laying flat, where it is a good place to...
Replies
23
Views
6,742
Has anyone worked with a Cosmo Air Leak Tester(LS r-902) with Ethernet/Ip, to connect to A Compact Logix, I´m doing a proyect with this equipment...
Replies
7
Views
2,056
Back
Top Bottom