07-06-2018 08:12 AM
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.
Solved! Go to Solution.
07-06-2018 08:18 AM
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.
07-06-2018 08:46 AM
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
07-06-2018 08:58 AM
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
07-06-2018 09:44 AM
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.
07-07-2018 07:34 AM
Thanks! Deploying a median filter helped to remove the spike from acquired data.