LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to implement Butterworth filter to remove noise from power lines in Pressure sensor

Solved!
Go to solution

Hi,

Please see the attached VI I am using to collect data from my experiments. There is significant noise in the signal. I reached out to NI and they informed me that the noise is in 50-60hz frequency range and is from the power lines. They said that :

 

1) I can either average the data at sampling frequency which is a multiple of the noise frequency. In this case, I would need to sample at 300hz. I am not sure how to average data so I can see the values in real time(live) while I am running experiments. I am a beginner at LabView.

 

2) I can use a point Butterworth filter out the noise. I tried this in the VI attached but I am not sure if I implemented this properly. Do I need to sample at  a higher rate to implement that Butterworth filter?

 

 

0 Kudos
Message 1 of 6
(4,243 Views)

Hi, I suggest you give more information about the range and signal type of your measurements. I think that because the sensor is to read pressure it can be a 4 - 20 mA but I am only supposing.

 

If this is a sensor which output is voltage something that could help is using a differential measurement.

0 Kudos
Message 2 of 6
(4,219 Views)

Hi, 

 

I apologize for not mentioning that earlier. Yes, it is a current signal in the 4-20 mA range. I found this link which solves the problem I am having. https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9oBSAS&l=en-US

I just dont know how to implement it. 

0 Kudos
Message 3 of 6
(4,202 Views)
Solution
Accepted by Frappa11

Hi Frappa,

 

1) I can either average the data at sampling frequency which is a multiple of the noise frequency. In this case, I would need to sample at 300hz. I am not sure how to average data so I can see the values in real time(live) while I am running experiments.

There are averaging functions coming with LabVIEW.

Have you tried to use them?

 

I am a beginner at LabView.

This can be seen from your VI (that's a fact, not an offense) - and from your spelling of "LabVIEW"…

Did you take the beginner courses offered by NI?

 

2) I can use a point Butterworth filter out the noise. I tried this in the VI attached but I am not sure if I implemented this properly. Do I need to sample at  a higher rate to implement that Butterworth filter?

Well, reading data at 1Hz and trying to filter 60Hz noise will not work. Have you heard of Shannon and Nyquist before?

In your linked article they speak about using 300Hz sample rate…

 

On your VI:

- Using ExpressVIs all the time will not help you in creating "good" programs.

- Use a case structure instead of a "Relay" ExpressVI when you want to "switch off" data saving…

- Learn the usage of plain DAQmx functions, as described here and explained in the example VIs.

- It always reminds my of an old semiconductor processing machine (photoresist coating, having 4 pressure gauges using 3 different non-SI units), when I see people mixing up weird pressure units like "inches of water" with SI units… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(4,184 Views)
Solution
Accepted by Frappa11

If you want 1 value each second,

Configure for continous aquisition at 1kSPS , see shipped examples.

In a loop read 1k sample (timing is done by your DAQ hardware) , read an array of values followed by a mean.

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 5 of 6
(4,166 Views)

Thank you all for your help. I was able to use the built-in LabVIEW mean function take the average. The readings became stable after that. 

0 Kudos
Message 6 of 6
(4,144 Views)