Calculate instant flow with pulse input

joaco1993

Lifetime Supporting Member
Join Date
Sep 2014
Location
newyork
Posts
237
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
 
...
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:
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
 
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
 
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
 
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.
 

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
754
Good morning, I have a question. I don't know much about ST yet I would like to calculate the average number of products per hour. how do I do...
Replies
22
Views
2,874
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,032
I want to calculate the energy consumed from instantaneous power. Can this be done using the TOT block with timebase set to Hour?
Replies
2
Views
658
Hi everyone, I have to calculate the length in millimeters of a glass that enters a transport (I don't know the speed yet) through a barrier...
Replies
15
Views
3,436
Back
Top Bottom