12-17-2016 01:03 PM
Hi, trying to acquire a frequency from a flow sensor. I'm trying to figure out why my signal doesn't have a more "flat" line. I currently believe the Daq card is seeing false triggers. If I direct couple a function generator to the Daq card I get a flat line with very little ripple. I have tried several different flow meters all with similar waveforms. I have tried to provide the flow sensor with steady flow to eliminate flow fluctuations. I have created a simple program to demonstrate my issue. DAQ Assistant is configured for a "1 counter Low frequency" measurement method. I have been averaging the signal and that helps a lot. I also added a Schmitt trigger circuit before the Daq card. It had almost no effect on the waveform. Is there a better way to do this from a software standpoint? Or hardware? I have attached a screen shot of the current setup and waveform.
Current setup;
Labview 2010
cDAQ-9178
NI9401
Thanks
Ryan
Solved! Go to Solution.
12-17-2016 01:37 PM
Hi Ryan,
I have been averaging the signal and that helps a lot.
That's not "averaging", when you use the MEDIAN function!
Use a (running) average function instead!
I'm trying to figure out why my signal doesn't have a more "flat" line
Why do you think you will get the very same flow value (aka pulse count) from your sensor?
12-17-2016 02:38 PM
The LabVIEW corollary of "A Picture is Worth 1000 Words" is "A VI is Worth 1000 Pictures". Please post your VI. That will let us see what you are trying to do inside the Dreaded DAQ Assistant.
Sometimes when you get results that you don't understand from Data that you also don't understand, it helps to write a simple Simulation, using a random number generator (or one of LabVIEW's Signal Generators) to create a "simple" signal on which you can do analysis. This can often show you silly mistakes in the analysis (such as the difference between "Mean" and "Median").
Bob Schor
12-17-2016 02:42 PM - edited 12-17-2016 02:46 PM
Changed the "Median function" to a "Mean function" that was an oversight on my part.
As for the varying pulse count I'm not sure exactly what to expect from the flow sensor. I just wanted to be sure I was doing everything I could on my end. I was comparing the output values from Labview and an off the shelf flow meter display. The flow meter display shows less variance in flow rate. I'm sure the off the shelf flow meter display has filters, etc to help with this at least more so than my simple program in Labview has.
So can I conclude this varying pulse count is coming from the flow meter?
Thanks again.
Ryan
12-17-2016 04:20 PM
What kind of flow meter do you use and how can you configure the output?
How often do you need to update the flow value? I think you are updating to often!
I work quite a bit with flow meters and Labview.
Ideally I would use a flow meter with a digital bus, ie modbus. 😃
If that is not present, I would use a flow meter with analog output (due to simplicity, given the accuracy of common flow meters this is often enough).
If that is not present, I would use digital signals but then I would use pulses and simply count the pulses. Of course you need to use a sensible update interval and some smoothing. Flow meters with digital indicators often use a couple of seconds themselfs to smooth out the signal. Read the manual and see for yourself.
12-17-2016 04:21 PM
@ry78 wrote:
As for the varying pulse count I'm not sure exactly what to expect from the flow sensor.
Ryan,
The above sentence sums up the main issue -- you need to know what to expect from the flow sensor! Have you looked at the signals with an oscilloscope? Does the flow meter manual tell you useful things? I'm guessing (based on how you've set up the Dreaded DAQ Assistant, a.k.a DDA, thanks for providing it) that it produces a TTL Pulse Train ranging from 2 to 300 Hz, right? Do you need to do anything to transform these frequency values to flow?
The other thing is that your code shows a loop wired to two charts. However, the DDA seems set to give you a single sample each time it is called, and your While loop has no obvious timing control, so who knows how fast these points are going to come in. I see you are using the DDA's Evil Twin, the Dynamic Wire, so there's another mystery, but if the wire contains a single sample, there's no reason that ... oh, you are doing a Point-by-Point Mean, my mistake. Do you know about GIGO (Garbage In, Garbage Out)? [Doesn't quite apply here, I suppose].
Bob Schor
12-17-2016 05:21 PM - edited 12-17-2016 05:31 PM
perhult, this flow meter has a voltage (0-5 Vdc) and frequency (0-5 Vdc square wave, 0-203 Hz) output. From the (Analog) oscilloscope the signal looks good although the frequency does vary slightly. I'm averaging about 6% error in flow rate with the frequency method. (I haven't tried the voltage side) I was looking at ways of reducing this error if possible. This particular flow meter typically averages 1-2% error with my other flow control hardware. These are my least accurate sensors. I have tried my more accurate flow meters on this Labview program and average 0.5-1% error. With those more accurate flow meters I can typically achieve 0.03% error on other dedicated hardware.
I'm trying to understand what I have to do to achieve these higher accuracy's in Labview. I can look at slower update rates. How would you "smooth" the signal? I choose an averaging method but maybe that's not going to work. I'll also try the count pulses method.
I created a simple program that uses 2 flow sensor inputs to control 2 pump motors. Please ignore the first program I was using, that was for diagnostic purposes only.
Thanks
Ryan
12-18-2016 10:00 AM
Among other things, this is an exercise in understanding the concepts of Precision, Accuracy, and Time-Varying behavior. Here's what I mean:
Bob Schor
12-18-2016 12:54 PM
Bob,
After reading your post I looked at a few things differently. Could I say from my original "Labview Clip" picture the varying frequency I see is not so much "electrical" noise but more or less the variance in wheel speed within the sensor itself + some possible counting error? If I understand correctly and take it a step further, I see about a 3 hz peak to peak difference in the waveform. For example 34hz/37hz= approx. 8% wheel speed variance (mechanical error) + possible frequency count error. If this is true that would explain why my better flow meters show less error. (mechanically better constructed)
Interesting, have some things to look at now.
Thanks
Ryan
12-18-2016 04:17 PM
I am used to much larger inductive flowmeters with integrated displays. They always have internal electronics which takes care of the signal processing to produce a stable output signal (whether it is a digital or analog signal)
It sounds like you are using a wheel flow meter without any internal signal conditioning. Then you will need to construct the signal conditioning yourself as Bob has explained.