LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

positive displacement flow meter

I have a spur gear positive displacement flow meter and a sensor which counts the number of impulses (square-waves). 1800 impulses indicate  1 gallon. How can I measure the volumetric flow rate in Gallon per second? What I plan to do is to count the number of impulses in 0.01s and times as N, and then times 1 gallon/1800 to get the volume, and then divide the product by 0.01. What if the square wave is not complete when the 0.01s period is not complete.

0 Kudos
Message 1 of 17
(3,280 Views)

What DAQ hardware are you using to measure the pulses?

 

Are you trying to analyze a waveform acquired on an analog input channel, or are you using a digital counter input channel?

 

Is .01 second enough time to get an adequate number of pulses?  Are you trying to measure the flow rate 100 times per second, which to me seems to be an extremely fast rate for any normal flow rate type of measurement.

0 Kudos
Message 2 of 17
(3,275 Views)

I have FPGA 7831R. I am trying to analyze a waveform acquired on an analog input channel. I think that will create a problem for me, because I know how to detect the rising or falling edge of a digital signal, but not the analog signal. Do you have any idea on this?

 

I want to calculate the volumetric flow rate 100 times per second. My supply pressure will be a signal close to a square wave. The rising and falling time is only 10ms. This means the volumetric flow rate will be changing in that rate. I wanted to used a faster flow meter, but the one in the lab is an old positive displacement flow meter.

0 Kudos
Message 3 of 17
(3,268 Views)

Look for Basic Level Trigger Detection.vi down kind of deep in the waveform, analog waveform palette.  It will allow you to search for a rising edge or falling edge in the waveform.  Repeatedly do that find all the rising edges in a given sample of the waveform.

 

Also, look in the example finder.  Something like the Trigger Counter example might give you some ideas.

0 Kudos
Message 4 of 17
(3,262 Views)

@Ravens Fan wrote:

Look for Basic Level Trigger Detection.vi down kind of deep in the waveform, analog waveform palette.  It will allow you to search for a rising edge or falling edge in the waveform.  Repeatedly do that find all the rising edges in a given sample of the waveform.

 

Also, look in the example finder.  Something like the Trigger Counter example might give you some ideas.


I know how to use the Basic level Trigger detection now, and I am trying to counter the number of rising edges. I am intend to use a cases struture to do it. When the trigger detection is true, then do the loop. The problem is how to memorize the value of last time. I also looked at an example file from the forum. But that one makes me confused.

Download All
0 Kudos
Message 5 of 17
(3,238 Views)

You use shift registers to remember values between loop iterations.

 

The Detect All Triggers.vi is a special implementation of it.  It is actually more like a functional globabl variable or action engine.  Normally these are drawn with a True boolean wired to the loop's stop condition terminal.  In this one, they used a False wired to a Continue? terminal.  Effectively the same thing.  The loop runs only once per call of that subVI.  But it is able to remember values between calls because of the uninitialized shift register.  You'll notice is has a mechanism to essentially initialize the data by way of the first call? primitive or if someone feeds a True value into the reset control.

0 Kudos
Message 6 of 17
(3,232 Views)

@Ravens Fan wrote:

You use shift registers to remember values between loop iterations.

 

The Detect All Triggers.vi is a special implementation of it.  It is actually more like a functional globabl variable or action engine.  Normally these are drawn with a True boolean wired to the loop's stop condition terminal.  In this one, they used a False wired to a Continue? terminal.  Effectively the same thing.  The loop runs only once per call of that subVI.  But it is able to remember values between calls because of the uninitialized shift register.  You'll notice is has a mechanism to essentially initialize the data by way of the first call? primitive or if someone feeds a True value into the reset control.


The shift register works, your are very helpful. In order to average the counts every 0.01s, I think I need to use the for loop. The remain question is how to make the iteration matches the time elapse. I used elapsed time to control this, but there is a type conversion between them. Do you have any idea to eliminate the type conversion.

0 Kudos
Message 7 of 17
(3,223 Views)

You've lost me on what you are doing here.  I really don't understand what you are doing in your lower For Loop.  You take an elapsed time value and feed it to the N of a For Loop.  It wil iterate N times and either add 1 to a shift register or not depending on the value of the boolean coming in.  That boolean is either true or false, and once that for loop starts, it is going to remain True or False until the next time the outer loop iterates around again.  So your boolean value determines whether you have a value of 0 or N, and the lower For Loop is just a needless waste of time.  I think perhaps you are so new to LabVIEW that you don't quite understand how the data flows in a LabVIEW block diagram.  I would recommend looking at the online LabVIEW tutorials.
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 8 of 17
(3,215 Views)

I think the current will be more reasonable. But there is still some problem. I specify the frequency to be 100Hz, so the counter should give me 100 counts per second. But the vi is running much longer than 1s, and it gives more than 5000 counts per second. How could this happen? Thank you for your patience.

0 Kudos
Message 9 of 17
(3,204 Views)

First, there is no correlation between the speed of the loop and the sample rate that is defined in your analog waveform.  That entire while loop will run as fast as it possibly can.

0 Kudos
Message 10 of 17
(3,198 Views)