LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Noise frequency measurement while no signals

Hello!

 

I have the Daq USB 6001 device, and I am connecting a flow currentmeter and a tachometer into the analog input. Both signals are supposed to be squared. And I created a VI to display the frequency value in "real time".

 

I have two problems with that:

  1. When the pulses are getting slow down to 0 Hz, the indicators show non zero values (example 3, 5, 8 Hz, etc) as if it were working. I need it shows the real value, maybe not go down to 0, but at least to 0.5 Hz or 1 Hz.
  2. I realized that in sometimes, the squared signals are not too nice, (mostly when I plugin the laptop to the power supply, and when I touch with my hand the currentmeter). I need the VI works also in this situation, how could I filter this noise?

I will be aware of your answers

 

Thank you

 

 

0 Kudos
Message 1 of 9
(2,251 Views)

You might need to use a high pass filter with a low cutoff (instead of or in addition to the lowpass filter) to remove the baseline drift. It won't be perfect, and you will need to get the cutoff correct or it will remove the square wave entirely.

0 Kudos
Message 2 of 9
(2,201 Views)

@pauldavey wrote:

You might need to use a high pass filter with a low cutoff (instead of or in addition to the lowpass filter) to remove the baseline drift. It won't be perfect, and you will need to get the cutoff correct or it will remove the square wave entirely.


You can probably (perhaps better) do this in the HW. A capacitor and a resistor, IIRC?

0 Kudos
Message 3 of 9
(2,167 Views)

As you can see in the block diagram, I am extracting the single tone information per each number of samples, and adding a high pass filter doesn't fix the value. Because I stop the tachometer and values different to zero are appears, I think it is cause of the noise.

 

Remember that I need to get the value zero, when the tachometer is stopped

0 Kudos
Message 4 of 9
(2,100 Views)

Thanks for your comment Wiebe@CARYA

 

I am looking to solve this problem programmatically.

Any ways, What does HW. And is there some value for the capacitor and the resistor?

0 Kudos
Message 5 of 9
(2,094 Views)

It's usually better - especially for the hardware - if you try to do as much shaping and cleaning of the signal as you can before doing it in software.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 9
(2,089 Views)

@Navalandrevs wrote:

I am looking to solve this problem programmatically.

Any ways, What does HW. And is there some value for the capacitor and the resistor?


Of course there are values for the C and R. Basically, you're building a RC filter. I'm not comfortable with hardware enough to advice though. But it should be pretty simple.

 

Here's the problem with software filtering. The data is already captured. That means any signal, including higher frequencies, already disturbed the signal.

 

I've captured 4-20mA signals at 100 Hz. Then the customer added HART signals to the 4-20mA signal (bad, bad customer 😖). Those are kHz signals. They show up in the 100 Hz signal as weird blocks of spikes. It's impossible to filter them out at that stage, as their frequency is totally unpredictable (0-100 Hz). The customer kept insisting to filter it out in the software, but I kindly declined. There's simply now deterministic way to do it. With hardware, it's simple. A low pass filter at 200 Hz does the trick (there are actually OoTB filters to filter out HART).

 

EDIT: of course you can filter out the high frequencies, but you'd also loose high frequencies in the signal. In your example, the noise is gone, but so is the width of the peak. Going up is a high frequency, and after the filter it's going up slower. The HW can filter at a (much) higher frequency than your sampling rate.

Message 7 of 9
(2,066 Views)

In an RC filter, if you look at the units of R (resistance) times C (capacitance), you'll see that it has the units of "time", and is also called the "time constant" of the filter, the time that the filter changes by 1/e (e = base of the natural logarithm, about 2.71828...).  This can be converted to an equivalent "corner frequency" by the expression 1/(2 pi f).  A simple RC circuit will filter out 95% of the signal when you go out two time constants, so you can use this to decide an appropriate value for the product RC (it is usually easier to have a high R than a equivalent high C, consult your Friendly Electrical Engineer).

 

Bob Schor

0 Kudos
Message 8 of 9
(2,051 Views)

And note: R in series with the signal you're measuring, C in parallel.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 9 of 9
(2,039 Views)