Sign in to follow this  
Followers 0
mhowasso

GPM

25 posts in this topic

Hi All, Getting a pulse for every gallon (1PPG), what is the best way to calculate Gallons Per Minute (GPM)..?? Thanks

Share this post


Link to post
Share on other sites
DETAIL in your question, promotes DETAIL in my answer. That depends a little on how fast the pulses will be coming in, it may take a High Speed Counter input or maybe a standard input. Add them up in a given time frame and multiply or divide depending on your time frame. And how quickly or often will you need to update the 'Rate Meter'? For instance if you suspect around 100 GPM count the number of pulses coming in at 10 second intervals and multiply by 6. Or to make it real easy count how many you get in a 1 minute time frame for GPM. :) Edited by RussB

Share this post


Link to post
Share on other sites
Try a normally closed contact for the pulse to the input of a TON. When the pulse goes true, move the TON.ACC into a register. That's seconds per pulse. Since it's 1 gal per pulse you now know how many sec / gallon. If it's 20s then 20/60 = .3333 minutes per gallon. 1/minutes per gallon = gallons per minute and 1/.33333 = 3 and change or 3.00003 gallons per minute 1/GPM = minutes per gallon. See the relationship? RussB makes a good point on possibly needing an HSC. The higher the frequency the greater the resolution required. So 10,000 gallons per minute would be 10,000 / 60 = 166.67 pulses per second or .00599988 seconds per pulse Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
Thanks to both of you. You are right, Im sorry about the details. I was so tired when I got home I wasn't thinking. Im using a ML1500 with RSLogix500. The MAX flow rate is 500 GPM This is a new installation and I have the ability on my flow device to select the pulse rate output. I have a 1769-IQ16 and a 1769-IQ16F and a 1769-HSC to use. If possible, I would like to set my pulse rate so I can use the 1769-IQ16F but its hard for me to tell what the max pulse rate is for the 1769-IQ16F. Once I can count the pulses, I was thinking I could use a combination of TON, DIV, CTU to somehow calculate the GPM rate to display on an HMI screen. I want it to be simple but I also need it to be pretty accurate. But as usual, its not as straight forward as I had thought. So... What pulse rate output would you recommend I use..???? What module would work the best..???? What logic do I use to calculate the GPM..???? Thanks in advance for all your help/advice..!!! Edited by mhowasso

Share this post


Link to post
Share on other sites
I'm doing something like this in an 1100 for what we call meter fail. I'll have to take a look at the program and refresh my memory. We normally use one pulse per barrel (oil company) but the idea is the same. I'll post back pretty soon

Share this post


Link to post
Share on other sites
The first question is how accurate does calculated flow need to be? That will determine which card you will use. Your digital inputs have a finite amount of life. If you pulse them at a high rate they will eventually fail. The higher the pulse rate, the sooner they fail. As I said earlier, we use rate units of BPH. One BPH = .7 GPM. The AO Smith meters that we use (but have almost gotten completely away from) send a 1 pulse per barrel meter confirmation signal (sometimes 10 pulses per barrel) and that's what is used to calculate flow rate. It also has a 10 kHz frequency output that we connect to a flow computer (technically the frequency range we use varies dependent on the max flow rate of the meter) . We could connect it to an HSC and calculate flow but that's typically not needed because we can send a scaled analog from the flow computer to the PLC. Think of your flow signal as a square wave that occurs at a frequency that varies with flow rate. The simplified formula for this is (simplified because it's for water at 60 deg F. For sales meter accuracy you have to apply correction factors based on the fluid properties and conditions): K = f/Q where K = Meter factor (pulses per unit volume) f = Frequency Q = Flow rate Where K = 10000 pulses per gallon and Q = 500 GPM f = KQ = 500 x 10000 = 5,000,000 pulses per minute at max flow. It would be a bad idea to use a DI Where K = 1 pulse per barrel and Q = 500 GPM (350 BPH) f = KQ = 1 x 350 = 350 pulses per hour = 5.833 pulses per minute = .09722 pulses per second or 1/.09722 = 10.286 seconds per pulse. A DI will work fine. We found that some meters have a 10 pulse per barrel confirmation signal and the pulse is too short for a DI and it would sometimes miss a pulse and throw the calc off. We solved that by using the first (on board) DI and configuring it to be on for one scan in the Advanced tab of the IO configuration. The program in the attached PDF did not make use of this feature and it works fine because they used a mag pickup that was tripped once per rotation and it's on time was long enough for the DI to register the rising pulse. I didn't write the meter logic in the attached calc. If I had it would be documented better. We inherited it from someone else but it works. The logic starts at Rung 6 and goes to the last rung EAGLE_PASS_V2 1-16-10.pdf Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
The attached PDF is how another programmer (inherited program) chose to do the flow calc. Similar metering... different way to go. Note the very last rung in the program. That was his solution to overflow. For that reason, I don't recommend this method... I can't rewrite the program because it belongs to a customer. All we do is maintain it. They wouldn't know if I rewrote it but I would and if something screwed up it would be my responsibility. None for me thanks. EASTEX.pdf Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
It looks like I completely blew past your 1 pulse per gallon question... so- Where K = 1 pulse per gallon and Q = 500 GPM f = KQ = 1 x 500 = 500 pulses per minute at max flow = 500 / 60 = 8.333 pulses per second or 1/8.333 = .12 seconds per pulse. I wouldn't use a DI. I would use the HSC. The calc will be pretty straight forward. No different than if you were calculating RPM from a gear tooth...

Share this post


Link to post
Share on other sites
Hi Michael, Thanks so much for all the info. Question...what would be the ideal pulse output you would use..??? If you dont mind, I will add some logic and post for you to review and tell me if it is OK or not. I downloaded some info on the 1769-HSC module but Im not sure about the configuration. Any suggestions..??? Again...Thanks a Bunch Edited by mhowasso

Share this post


Link to post
Share on other sites
If this was a CLX I could help with the HSC. I haven't used one in the ML series so I'll have to defer to someone else for that. If you set the frequency of the output device you can make it easy on yourself and do multiples of the range (0-500). So frequency (pulse per gallon) could be 5, 50, 500. 5000, 50000 per gallon which correlates to 0.01 : 1, 0.1:1, 1:1. 10:1, and 100:1 or put another way, correlates to the decimal point accuracy that you need. The higher the frequency the more accurate the calc WITHIN THE LIMITS OF THE TRANSMITTER. <-- not yelling but this is important. It makes no sense to have a super accurate calc if the end device (transmitter) is only good for plus or minus 1 gallon per minute. I'm about to hit the road for a job site that's about 4 hours away so I may not be able to reply until later or tomorrow. It depends on phone reception and how busy I get.

Share this post


Link to post
Share on other sites
Michael, I was able to get the 1769-HSC to count my pulses, and the totalizing is simple. But I still dont understand how to take my counts and come up with a GPM rate. My counts are 200 pulses per gallon with a max rate of 500 gpm. I am attaching the program where I am bringing in the pulses. Any advice/modifications would be greatly appreciated. I:1.4 = Pulse Input L10:0 = Pulse counts N7:1 = 200 (200 pulses per gallon) L10:1 = gallon counts L10:2 = gallon totalizer Thanks ML1500_GPM.RSS

Share this post


Link to post
Share on other sites
I think that the HSC should be set to rate if you want to use it to calc flow rate. The output of the HSC will be a frequency that is proportional to flow when set to rate The transmitter that you are using should have a K factor in pulses per gallon. I think that is the value you put in N7:1 (200 pulses per gallon). The output of the HSC is frequency (f). The flow calc is Q = f / K so HSC output divided by K factor of the transmitter = flow rate. Frequency is the number of occurrences of a repeating event per unit time. The output should be in Hz = Cycles per second. If I'm doing this right then your calc result from Q = f / k should be Gallons per Second. So multiply by 60 to get GPM. Q in GPM = ( f / 200 ) X 60

Share this post


Link to post
Share on other sites
That rung is nearly always present in Logix500 programs. Strictly speaking, he's not necessarily ignoring overflow, that may be handled as it occurs elsewhere in the code. The Overflow Trap Bit (S:5/0) is unique to Logix500 (SLC & MicroLogix), none of the other A-B families have it, so I question its usefulness. It is simply a secondary bit that is set whenever the actual arithmetic "Overflow" status bit is set.... sort of like a memory that it occurred somewhere in the scan. It's a nuisance, because if the trap bit is still set at the end of the scan, the processor Major Faults. Questions 1. What does it actually tell you ? 2. Can you do anything "useful" knowing that it is set ? Answers 1. An overflow occurred somewhere in the scan - it doesn't tell you where though.... 2. No, because you don't know where, or even how many times, an overflow occurred. Conclusion It's relatively useless, so unlatch it, forget it, and let the processor make another scan..... If "overflow" is important, then it is also important to know which instruction caused it.... A good programmer will check the Math Status flags (S:0/0 thru S:0/3) when appropriate, and act on them accordingly. Edited by daba

Share this post


Link to post
Share on other sites
I've never used it or needed it but I'm glad to know its acceptale to use it.

Share this post


Link to post
Share on other sites
It's important if your trying to use 32 bit Floats. And I will agree with Daba, the programmer should and better know where they are using it to do what!

Share this post


Link to post
Share on other sites
All, I tried using what you said but it did not work. And the Rate feature does not work with this application on a ML1500. And to get the HSC to work you HAVE to configure AND ENABLE all four counters. If not you get a 189h Fault. I have attached what I did get to "kind of work". It works until the pulse rate gets over 400 Hz. Under 400 hertz it works great, over 400 Hz it seems to not be able to process the logic fast enough. Over 400 Hz my actual GPM (N7:15) is very unstable and bounces between 144 and 180 and nevr higher. Im using a ML1500 AWA base and a 1769-HSC Just thought someone may have an idea..?? Is the ML1500 just not fast enough to handle this..??? Thanks, ML1500_GPM.RSS Edited by mhowasso

Share this post


Link to post
Share on other sites
Your program is looking for an exact count of 200 and is probably missing it at higher speeds. Let the counter do what it does best. The 'overflow' bit for your counter will be set whenever it counts to 200 (your max) and resets. It will stay on until you unlatch it. If the overflow for counter 0 - I:1.12/0 is on then do a one shot. This is so the next line operates once per overflow. Using the one-shot add 1 to L10:1 and also latch the ResetCountOverflow - O:1.5/2 for this counter. If the overflow is off then unlatch O:1.5/2 (We use the Latch/Unlatch in case the reset takes more than one scan.) Read more about this under the section "Ring Counter" in the manual.

Share this post


Link to post
Share on other sites
Simplifying the code I suggested: If the overflow for counter 0 - I:1.12/0 is on then do a one shot and add 1 to L10:1 If the overflow is on then do an OTE to the ResetCountOverflow - O:1.5/2 for this counter.

Share this post


Link to post
Share on other sites
Thank you Mr Carlton, I will try this and let you know how I make out. After working with the 1769-HSC I don't feel so intimidated by it. The configuration of the module appears to be the key. I have also found I don't need to use a Long Integer since the 2nd word is always zero so I just use a N integer. My Configuration values so far.... I:1.4 is my actual pulses I:1.8 is my rate I:1.8 x .3 = GPM

Share this post


Link to post
Share on other sites
Thank you Mr Carlton, I will try this and let you know how I make out. After working with the 1769-HSC I don't feel so intimidated by it. The configuration of the module appears to be the key. I have also found I don't need to use a Long Integer since the 2nd word is always zero so I just use a N integer. My Configuration values so far.... I:1.4 is my actual pulses I:1.8 is my rate I:1.8 x .3 = GPM

Share this post


Link to post
Share on other sites
I did what you suggested and it does not work. I called AB Tech support and they said on a ML1500 those setting will not work.

Share this post


Link to post
Share on other sites
That's interesting. I see nothing in the manual or in the Knowledgebase prohibiting the use I suggested.

Share this post


Link to post
Share on other sites
How did your flow calc problem work out?

Share this post


Link to post
Share on other sites
It is working fine. Here are the steps to making a 1769-HSC work with a ML1500. I am using a 200 pulse per gallon signal from a FMC flow meter. I wanted to do a totalizer and flow rate (GPM). Download the 1769-HSC Users Manual and print out Appendix D. You will need Tables 30, 31 and 32. In the project tree, open up the I/O config for the HSC card. There will be 5 tabs. The two you will need to config are called "Counters" and "Ranges". My HSC is in Slot 1. Counters.. Select the desired counter 0-3 (I had to do all four even tho I was only using three..kept giving config fault if I didnt) Max Count = 200 Min Count = 0 Preset = 0 Update Time (x1ms) = 100 Hysteresis = 0 RPM Scale Factor = 1 Acc behavior on Over/Under Flow = Ring Counter Filters = None Storage Mode = not used Ranges.. Counter Used = I used Ranges 0-3 and assigned them to Counters 0-3 Range Type = Count Value High Limit = 200 Low Limit = 170 Range Active = Within the Limits Output Mask = 0010 for counter 0, 0020 for 1, 0040 for 2, and 0080 for 3 Ladder Program.. For Counter 0 (It helps to change Radix to Decimal) Use Output Data File and put a 1 into O:1.5,6,7 and 8 (This Enables the Counters to work) Use Output Data File and put a F0 into O:1.1 (This Enables to soft output to work) Use Output Data File and put a 1 into O:2/0 (This Enables the Ranges to work) Latch O:1/32 on with OTE I:1.4 = Actual Counts I:1.1/4 to trigger an ADD for my "Totalizer" (I:1.1/4 goes true after 200 pulses or 1 Gallon) I:1.8 = Flow Rate (Must Multiply by 0.3 to get actual GPM) After having an outside company prove our equipment I was within 1.2 gallons per 1000 gallons on Totalizer and .02% on GPM flowrate. Sorry for the lengthy explanation. Also, just FYI..Table 32, 0-1 are mislabled as Mask and they are really the Enables (per AB Tech Support) Mark Edited by mhowasso
1 person likes this

Share this post


Link to post
Share on other sites
That's good news and great info. It might not matter to you but in case it does: This I:1.8 = Flow Rate (Must Multiply by 0.3 to get actual GPM) and this Q in GPM = ( f / 200 ) X 60 are the same thing mathematically speaking. 60 / 200 = 0.3 so the formula can be rearranged to Q in GPM = f X (60/200) = f X 0.3 :o)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0