LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Filter Noise

Solved!
Go to solution

Hello All,

 

     I am reading RPM from a square wave generated from a BLDC motor. The signal is carrying some noise that I am unable to eliminate. I am sending the signal to USB-6363 DAQ. The problem is that the DAQ is reading the noise spikes and including them in the count. I replaced the signal from the motor with a signal from a waveform generator and I get RPM readings right where they should be. Hook up the motor signal and I get readings in the seven digit range. The frequency range is around 75-150Hz. The noise is being carried on the high and low sides of the waveform.  Cleaning up the signal coming from the motor is not an option as it would entail a product redesign. Is there a way to filter the signal programmatically?  I have attached my code. Any help would be greatly appreciated.

 

0 Kudos
Message 1 of 21
(1,743 Views)

Your X-series board supports digital filtering in hardware.  You can set a minimum valid pulse width and shorter "noise" spikes will be rejected.

 

But first and better, you might be able to reduce the noise with careful attention to your signal wiring.  Try to keep the RPM signal away from the wires carrying high winding current. Generally, pay attention to things like proximity, shielding and ground loops.  Here's a classic KB article aimed at analog acquisition, but there are several parts that are applicable to digital signals as well.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 21
(1,717 Views)

Hi Kevin,

 

Thanks for the response. The first thing I looked at was noise from other circuits. I have isolated all the wiring I am working with, and there is zero opportunity for interference from other wiring. It's just a messy signal from a Hall Effect sensor. I am going to play around with the channel property nodes you suggested. I'll let you know what solved the problem.

 

Dennis

0 Kudos
Message 3 of 21
(1,668 Views)

Actually the noise is a 20kHz PWM signal imbedded in the tach output signal I am trying to measure. Can't get rid of it because all the grounds are referenced to the same point. The DAQ is picking up the 20kHz signal and is using it to compute frequency along with the signal I am trying to measure. I have not been able to filter out the 20kHz noise.

0 Kudos
Message 4 of 21
(1,656 Views)

Can you post something like a scope trace?   Do you think you're seeing pretty much *all* of the 20 kHz PWM cycles or just a few of them?   What is the pulse *width* of your 10-150 Hz tach signal?   It'll need to be distinctly wider than the PWM for digital filtering to have a fair chance to help.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 21
(1,629 Views)

Hi Kevin,

 

   I'll post some oscilloscope shots later this morning. The pulse width of the 10-150Hz signal is 50% duty cycle (it is a tach output from a motor) and is a 5 volt signal. The signal that is being carried on it is exactly 20 kHz, It is a PWM signal being generated by a different circuit with varying duty cycles. I can change the frequency of it anywhere from 20 to 10 kHz and the signal being carried changes accordingly. It is being picked up by the 10-150 Hz signal because all grounds (0 voltage) are tied together so all signals have the same reference. 

 

   I searched Labview help and examples ( and good ol' Google) looking for some examples of how to set up the vi's for filtering with no joy. I have been trying hit and hiss style on my own but haven't figured it out yet. I am sure as comprehensive as Labview is there is a not so difficult way to get his done.

 

Screen shots to follow

0 Kudos
Message 6 of 21
(1,621 Views)

Here are a couple screen shots. The last shows what I need to filter out.

0 Kudos
Message 7 of 21
(1,611 Views)

Why do you need to filter the noise?  There is a big gap between the low and high states.  Just trigger on the polarity with a zero-crossing detector.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 21
(1,602 Views)

The bigger question is why is the waveform 50V Peak-Peak?

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 9 of 21
(1,597 Views)

Answer to 50v question. I changed oscilloscope probes and did not change the attenuation from 10x to 1x.

 

oops

0 Kudos
Message 10 of 21
(1,592 Views)