LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove faulty points in read time during data acquisition

Solved!
Go to solution

Hi,
I am trying to acquire data from a load cell using Arduino and Labview VISA module. I am successful in the data acquisition, however, at times I am getting unwanted faulty data points (though not continuous, only a single faulty data point at times). For example, the weight measured is 170 N but suddenly at times, the reading shows 0 N and vice versa (please see the image supplied). 
Is there a way I can remove these unwanted data points programmatically in real time during data acquisition. have already tried exponential and moving average smoothing.

faulty point.jpg

 

0 Kudos
Message 1 of 6
(2,534 Views)

Is it always exactly zero?  It sounds like there might be an error in the communication.  If so, you can detect that there is an error and throw away the result of the string to number conversion.

 

Could zero ever be a valid value?  You could just throw away the zero and not write it to your chart.

 

Is this data coming in at a regular rate?  Would throwing away data point interfere with the chart?  If so, you could use the last valid value in place of the zero to write to the chart.

0 Kudos
Message 2 of 6
(2,529 Views)

Hi,

 

Thanks for looking in. Yes its exactaly zero. Few times, it goes to a extrmly high values as well.  I need a correction in real time with data acquisition. 

Thanks

0 Kudos
Message 3 of 6
(2,517 Views)
Solution
Accepted by topic author sid_29

Hi,

 

if I should guess, I would say it is an issue of Arduino data acquisition e.g IRQs are blocking something. To remove spikes out of a signal, the moving average is not the correct method. Please try a median filter. A rank number of 2 should be ok for that.

 

Regards

Kay

Message 4 of 6
(2,510 Views)

You definitely don't want to "remove" it, just "replace" it with a more reasonable value. Charts assume equal point spacing in time and you need to keep that relationship.

Personally, I would leave it in, because it gives you information about the communication quality. If you would gloss it over and the communication starts failing permanently, you might not notice it for a while. Another option would be to replace values outside a defined valid range with NaN, creating a gap in the graph, again indicating a missing point to the user.

0 Kudos
Message 5 of 6
(2,498 Views)

Thanks! Deploying a median filter helped to remove the spike from acquired data. 

0 Kudos
Message 6 of 6
(2,475 Views)