You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old June 16th, 2003, 12:53 PM   #1
slenkovj
Member
United States

slenkovj is offline
 
slenkovj's Avatar
 
Join Date: Jun 2003
Posts: 3
Flow Ladder Logic

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.
  Reply With Quote
Old June 16th, 2003, 01:10 PM   #2
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 4,672
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.
  Reply With Quote
Old June 16th, 2003, 03:24 PM   #3
ckipling
Guest
 
Posts: n/a
Thumbs up

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.
  Reply With Quote
Old June 16th, 2003, 03:51 PM   #4
lenny
Member
United States

lenny is offline
 
Join Date: Jun 2002
Posts: 62
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 by lenny; June 16th, 2003 at 03:54 PM.
  Reply With Quote
Old June 16th, 2003, 04:08 PM   #5
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 4,672
Quote:
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"!
  Reply With Quote
Old June 16th, 2003, 04:25 PM   #6
lenny
Member
United States

lenny is offline
 
Join Date: Jun 2002
Posts: 62
So the formula WAS lacking the conversion. Parden me.
  Reply With Quote
Old June 16th, 2003, 04:35 PM   #7
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 4,672
I posted the following formula:

Quote:
Total = Total + (Rate * Period)
Immediately following it, I added the following warning:

Quote:
Remember, you also need to include any necessary unit conversion factors.
  Reply With Quote
Old June 16th, 2003, 07:30 PM   #8
lenny
Member
United States

lenny is offline
 
Join Date: Jun 2002
Posts: 62
Quote:
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.
  Reply With Quote
Old June 16th, 2003, 08:01 PM   #9
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 4,672
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 by Steve Bailey; June 16th, 2003 at 08:49 PM.
  Reply With Quote
Old June 16th, 2003, 11:35 PM   #10
Eric Nelson
Lifetime Supporting Member + Moderator
United States

Eric Nelson is offline
 
Eric Nelson's Avatar
 
Join Date: Apr 2002
Location: Randolph, NJ
Posts: 4,119
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
  Reply With Quote
Old June 17th, 2003, 08:20 AM   #11
Leonardo2003
Member
Philippines

Leonardo2003 is offline
 
Leonardo2003's Avatar
 
Join Date: Jun 2003
Location: Saudi Arabia
Posts: 63
Talking

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
Attached Images
File Type: gif dodge.gif (5.4 KB, 453 views)
  Reply With Quote
Old May 14th, 2013, 07:36 AM   #12
Danimal
Member
United States

Danimal is offline
 
Join Date: May 2013
Location: USA
Posts: 10
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.
  Reply With Quote
Old May 14th, 2013, 10:57 AM   #13
Lancie1
Lifetime Supporting Member + Moderator
United States

Lancie1 is offline
 
Lancie1's Avatar
 
Join Date: Jul 2003
Location: Alabama
Posts: 7,429
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
  Reply With Quote
Old May 14th, 2013, 12:53 PM   #14
Danimal
Member
United States

Danimal is offline
 
Join Date: May 2013
Location: USA
Posts: 10
I put the wrong number in there and yes you are correct. Thinking per minute and typed the wrong value. oops....
  Reply With Quote
Old May 14th, 2013, 01:05 PM   #15
Danimal
Member
United States

Danimal is offline
 
Join Date: May 2013
Location: USA
Posts: 10
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....
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
CarWash Ladder Logic sicminds LIVE PLC Questions And Answers 30 November 14th, 2007 01:54 AM
ladder logic hammerl70 LIVE PLC Questions And Answers 5 May 4th, 2005 12:08 PM
ONLINE Changing ladder logic for a redundant PLC5 ckchew666 LIVE PLC Questions And Answers 3 June 26th, 2004 09:09 AM
Ladder Logic Editor Shafiq LIVE PLC Questions And Answers 4 May 19th, 2003 11:44 AM
Ladder logic without symbols Deer LIVE PLC Questions And Answers 15 November 27th, 2002 07:13 PM


All times are GMT -5. The time now is 12:34 AM.


.