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.

New Here? Please read this important info!!!


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

Reply
 
Thread Tools Display Modes
Old April 7th, 2016, 08:06 PM   #1
joaco1993
Lifetime Supporting Member
United States

joaco1993 is offline
 
Join Date: Sep 2014
Location: newyork
Posts: 177
Calculate instant flow with pulse input

Hello everyone, i know there are some posts about this topic but none convinced me.

I have an input pulse that comes for every m3 of water that flows.

So my idea is to have a timer running continously with a preset of 30 sec.

Then i have a counter, that counts up every time that the pulse comes.

So to calculate the instant flow i would do the following calculation as I have 1 m3 for each pulse:

instantflow=counter.acc/timer.pre

This would give me the instant flow in m3/s

This calculation will be done when timer.dn bit is enable

Is this idea correct ??

Thanks
  Reply With Quote
Old April 7th, 2016, 09:04 PM   #2
Pete.S.
Member
United States

Pete.S. is offline
 
Join Date: Mar 2016
Location: Fl
Posts: 464
Quote:
Originally Posted by joaco1993 View Post
...
So my idea is to have a timer running continously with a preset of 30 sec.
...
Is this idea correct ??

Thanks

Why 30 seconds?

You need to measure the time between pulses to get the flow. That is all there is to it.

If it takes 13.45 seconds then the (average) flow is 1/13.45 = 0.074 m3/s.

If you use a timer to measure time then you need to reset it after each pulse.
You can also use system time if your plc has it. Then you calculate the time between the new pulse and the last pulse by saving the system time after you've done the calculations.

.

Last edited by Pete.S.; April 7th, 2016 at 09:11 PM.
  Reply With Quote
Old April 7th, 2016, 09:32 PM   #3
joaco1993
Lifetime Supporting Member
United States

joaco1993 is offline
 
Join Date: Sep 2014
Location: newyork
Posts: 177
Pete, I put 30 seconds just to put a value, it could be another one, depending how often do I want to refresh the instant flow..

My approach is wrong ??

cant see why..

If I have counter.acc*constant/timer.pre that would give me [m3/s]

constant would be the m3 per pulse
  Reply With Quote
Old April 7th, 2016, 09:40 PM   #4
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 4,082
The problem with your idea is that time is not directly related to receiving a pulse. At the end of the 30 second period you know how many full pulses you have received. But it is extremely likely you have a partial pulse in there to deal with also. And you have no idea how far along that pulse you are.

If you think you will receive 1000 pulses in that 30 second period, the partial pulse really doesn't matter. But if you think you will only receive 5 pulses in that 30 second period then the partial pulse is a huge deal.

What Pete.S. proposes deals with the partial pulse issue. The plc can measure time with much finer granularity than you have with flow meter pulses. As a result you will have a more accurate result if you take time between pulses (or 10 pulses or 100 pulses) than you will if you look at pulses over time.

There is a breakover point to this where it makes more sense to measure pulses over a fixed time. It all comes down to what gives you the best resolution.

Keith
  Reply With Quote
Old April 7th, 2016, 09:43 PM   #5
Pete.S.
Member
United States

Pete.S. is offline
 
Join Date: Mar 2016
Location: Fl
Posts: 464
+1 what kamenges wrote above.
  Reply With Quote
Old April 7th, 2016, 09:47 PM   #6
joaco1993
Lifetime Supporting Member
United States

joaco1993 is offline
 
Join Date: Sep 2014
Location: newyork
Posts: 177
I get it.. thanks both for answering.

Tomorrow i will see how many pulses I get in 30 sec, if I get too many like you said i would be doing with 30 sec which is easier, otherwise the other method.

BTW, Im using rslogix500, is there an internal clock which i could use for this purpose ??

thanks
  Reply With Quote
Old April 7th, 2016, 10:05 PM   #7
joaco1993
Lifetime Supporting Member
United States

joaco1993 is offline
 
Join Date: Sep 2014
Location: newyork
Posts: 177
would this be ok ??
Attached Images
File Type: jpg zz.jpg (46.6 KB, 73 views)

Last edited by joaco1993; April 7th, 2016 at 10:21 PM.
  Reply With Quote
Old April 8th, 2016, 09:28 AM   #8
Tom Jenkins
Lifetime Supporting Member
United States

Tom Jenkins is online now
 
Tom Jenkins's Avatar
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 6,062
A lot of selecting the method depends on individual cases. I've used both successfully.

If the pulse is high frequency then counting over a time interval is just fine. This assumes, of course, that your input card can handle that frequency. If you use a 10 second timer on a 2,000 pulse per second signal then missing one partial pulse won't create much error. If your flow rate is slow in changing or you don't care about transients then this method is also fine. With a high frequency pulse measuring the time between pulses won't be accurate unless you use the built in function on a high speed counter input.

On the other hand if you have a slow pulse rate of just a few per second then counting may not be accurate, and a missed pulse is a big percentage error. In that case measuring the time between pulses is going to be more satisfactory.

Do a little sensitivity analysis to see which is best in your specific case.
  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
How to calculate the decimal value of thumbwheel bool input? wqtony2004 LIVE PLC Questions And Answers 17 April 6th, 2015 09:55 AM
Kind of Input for a Flowmeter ( PULSE ) Joe Frey LIVE PLC Questions And Answers 12 February 18th, 2015 12:10 AM
Pulse input from flow meter JIBIN LIVE PLC Questions And Answers 6 November 5th, 2013 04:42 AM
Calculate Flow Rate m3/h by digital input pulses gespro LIVE PLC Questions And Answers 0 November 5th, 2011 12:25 PM
Pulse Counting - Flow Conversion slenkovj LIVE PLC Questions And Answers 4 October 9th, 2003 03:06 AM


All times are GMT -4. The time now is 12:21 PM.


.