11-11-2019 03:44 PM
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:
I will be aware of your answers
Thank you
11-11-2019 09:21 PM
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.
11-12-2019 07:44 AM
@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?
11-14-2019 01:59 PM - edited 11-14-2019 02:01 PM
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
11-14-2019 02:04 PM
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?
11-14-2019 02:16 PM
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.
11-15-2019 03:40 AM - edited 11-15-2019 03:44 AM
@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.
11-15-2019 07:26 AM
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
11-15-2019 08:26 AM
And note: R in series with the signal you're measuring, C in parallel.
-Kevin P