Flow Ladder Logic

slenkovj

Member
Join Date
Jun 2003
Posts
3
In ladder logic, how can I generate totalized flow data from a flowmeter input? My flowmeter input is 12 bit analog (0-4095) which I use in a PID loop table and display on a touchscreen as "gallons per minute". Because the flow is intermittent, I would like to include a numeric display on my touchscreen that shows total flow (gallons) for the past 24 hours as well as "number of times flow was active". I am new to ladder logic and am using an Automation Direct DL-450 plc.
 
This has been discussed several times previous threads, but I'll give you a quick overview. If you need additional detail, you can search through the archives.

To build a totalizer, you sample the rate periodically, multiply the sampled rate by the time since the last sample and add the result to a running total.

Total = Total + (Rate * Period)

Remember, you also need to include any necessary unit conversion factors.

When you go a long time between samples, you introduce inaccuracies due to fluctations in flow between samples. If you sample more frequently, you need to make sure that the maximum value in the running total doesn't overflow the PLC memory. It's usually a good idea to convert integers to floating point numbers before doing the calcuclations.
 
Most good flowmeters have a totalizer output, that will pulse
everytime a certain volume of water has passed through it. If
you have such an output, configure it to pulse at the volume
you want e.g. ml's, cc's, L's etc.... Then connect it to an input
on your PLC and count away, I'm sure you won't need a high speed
counter.
 
Totalizers have always been hard for me to program even in old S5 statement list much less in ladder.........but I remain confused with Steves equation. Total= Total+(rate*period). If I sample a 100gpm flow signal (assume scaled numerical value of 100) evey 10 seconds using the above formula I get 6000 gal total after a min. of samples.

What am I missing??? Shouldn't it be 100 gallons?

This seems to work if I use Total=Total+(rate/period)

I can see where this would get to be really weird if you were working in MGD.

Lenny

Oh I forgot...To sence the presence of flow you could use a simple compair for greater than say 5gpm and disable the totalizer below that number.
 
Last edited:
If I sample a 100gpm flow signal (assume scaled numerical value of 100) evey 10 seconds using the above formula I get 6000 gal total after a min. of samples.

In the retail or the real estate business they talk about the three key factors for success of location, location, and location.

In engineering calculations, the three key factors are units, units, and units.

If, in your example, a value of 100 represents 100 gallons per Minute and you multiply it by 10 seconds, the result has units of gallon-seconds per minute. To convert that to gallons, you need to apply the conversion factor of 60 seconds per minute.

Now hold your hand in front of you, palm facing upward. Bring your palm rapidly to your forehead, and as your palm and forehead meet, exclaim loudly "DOH"!
 
Now hold your hand in front of you, palm facing upward. Bring your palm rapidly to your forehead, and as your palm and forehead meet, exclaim loudly "DOH"!

Parden me if I find your manor a bit offencive. I was of the inpression that this forum is here to share knowledge not be-little those of us with questions. If I framed my original question poorly please be assured I ment only to understand the example.

Bottom line though (rate /10) would work for GPM with a 1/10 min. sample wouldn't it? Wouldn't it save back-scaleing the result? Come out in gallons then. I'll have to fool with it some more cuz GPM is not what I do, MGD is more where I need to work.
 
Geez lenny, it was intended as a joke. This forum can also be a place where we can have a little fun if we don't take ourselves too seriously.

The next sounds you hear will be my own palm encountering my forehead, accompanied by the requisite "DOH"!


Here's how I was taught to do dimensional analysis. Using the totalizer example, when you multiply the rate (100 gallons per minute) by the sample period (10 seconds) you can write it like this:


100 gallons | 10 seconds
____________|___________
minute |




The result (1000) has units of gallon-seconds per minute. If you take ten samples, you wind up with an accumulated total of 6000. The problem with the answer is 'what the heck is a gallon-second per minute'?

Obviously, we need to apply a unit conversion factor. The one that springs quickly to mind is 60 seconds per minute. Do we multiply by 60 or divide by 60? Let's go back to the way I originally wrote the fornula and see what happens when we multiply by 60.



100 gallons | 10 seconds | 60 seconds
____________|_____________|____________
minute | | minute




This doesn't look to promising. Now we've got 60,000 gallon-seconds squared per minute squared. Let's try dividing by 60.



100 gallons | 10 seconds | minute
____________|____________|__________
minute | | 60 seconds




This time we end up with 16.67 gallons for each sample. That's because the units of seconds in the numerator (top half of the fraction) and the denominator (bottom half of the fraction) cancel each other out. Likewise for the units of minutes. The only other trick is to recognize that since division is the inverse of multiplication, you also invert the units.

Now try it for larger units like MGD (million gallons per day). Lets say the flow meter is calibrated in MGD, and we sample every ten seconds.


100 million gal | 10^6 gallon | day | hour
_________________|_____________|_________|_______
day | million gal |24 hours |3600 sec



So each sample value of 100 MGD over a 10 second span represents 11,574 gallons.
 
Last edited:
Oh, NOW I get it... MGD = million gallons per day... 🙃

And I always thought MGD was just an acronym for Terry's 'beverage of choice'... 🍺

beerchug

-Eric
 
I think this is much better to discuss with "Gallons of Beer per minute infront of us" ... joke! joke! joke! joke!

Sorry, I have nothing to share on this... I am still a beginner for industrial automation... maybe in some sort I can help :)

dodge.gif
 
This is an interesting post. I am trying to measure deflection per minute with a sample rate of .5 seconds. I am subtracting my last sample from the current sample and multiplying by 60. This does not seem to be too accurate tho, as simply as it appears.
 
If your sample rate is 0.5 seconds, to convert to minutes, would you not need to multiply by 120?

Deflections per minute = (Old - New)/0.5 seconds X 60 seconds/minute =
(Old-New) x 120
 
I put the wrong number in there and yes you are correct. Thinking per minute and typed the wrong value. oops....
 
In looking at the expression that you posted I think you may have transposed the Old and New values. Shouldn't it be: Deflection/Minute=(New-Old)/0.5*60=(New-Old)/0.5*120

The deflection value will increase with time and the rate that it increases is what I have to control at a set point of 22mm/Min. I am adjusting an I/P transducer that inputs air into the test stand and inflates the sample.

Thank you for your suggestions....
 

Similar Topics

There have been many threads started about integrating the signal from an analog flow sensor to get a total volume along with comments (some by...
Replies
4
Views
341
I'm running an Allen Bradley CompactLogix L32E plc with Logix5000. I am in need of a method to which fmy Function Block flow totalizers to Ladder...
Replies
5
Views
7,756
Can any one advise to the process to carry out when converting ladder logic to state flow diagrams?
Replies
1
Views
3,759
Hello everyone, I'm currently programming a Fatek FBs-60MC PLC, converting an old program from an ABB's SLC500. The project reads some analog...
Replies
1
Views
1,635
Hi guys. First post ;) We are working on a project for my company where we get data from some analog and digital transmitters (pressure, on/off...
Replies
6
Views
2,083
Back
Top Bottom