From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-29-2016 10:20 AM
Hello,
I am using a position laser to aquire position data of a free falling object, and have also been able to aquire a velocity curve using the basic derivite function, however there is a significant amount of noise on the velocity curve generated when the sample rate is set higher(i.e 10KHZ) as shown below. The laser outputs a +-10V analog signal. I have the program set to auto trigger right before Impact. An offset and multipler is calculated based on the displactment of impact, and the upper and lower bounds.
To filter out the noise I found some information on the Savitzky-Golay Filter but I am having some trouble implementing it and was wondering if anyone could help. The velocity cure above was not recording with the attached VI that includes the filter.
Best,
Dave
09-29-2016 11:37 AM
What values are you using for the SG filter settings? Can you show a screenshot of how it looks when you run it with your code and real data?
Note that if you use the FIR Filter VI to apply the coefficients, rather than the dot-product approach shown in the help for the Filter Coefficients VI, then you need to reverse the filter coefficients array or flip the sign of the resulting derivative calculation.
09-29-2016 03:41 PM
With the code I am using now, I am not showing the filtered or unfiltered result of the derivative on the second waveform graph.
09-29-2016 06:25 PM
Again, what settings are you using for the SG Filter? How many side points, what order etc? You have those values all set to 0 in your VI, which will cause the filter not to do anything.
09-30-2016 07:52 AM
I have been continously adjusting the settings, the latest I have tried are as follows:
Order:12
Sidepoints:19
diff:1
09-30-2016 12:11 PM
Have you probed the output of both the Coefficients VI, and the results of the Filter VI, to check that you're getting data? You should be able to track down, using probes or execution highlighting, exactly where your data disappears. Or, if you wire some real data, in the form of a constant, in place of the DAQ inputs, and then upload that VI, it will be easy for someone on the forum to look at it
09-30-2016 01:33 PM
Considering the type of data you showed at the beginning of this thread, you should be able to use fairly low order for the S-G filter. Higher orders do not necessarily work better and definitely take longer to calculate.
It is often useful to plot the intermediate results, such as the output of the filter. The human eye-brain combination can often identify things which are not easy to determine algorithmically.
Can you post some data?
Lynn
10-11-2016 10:19 AM
Sorry for the delayed response. I have set the program to run continuously while the machine cycles.
This is the probe of the signal from the position sensor going into the waveform block un-modified.
When probing the y input, I am not entirely sure what exactly I am looking at to be honest. The numbers do not resemble much of a pattern and seem to be quite sporadic.
When probing the output of the waveform block I am also getting some output.
However when I run it with an analog trigger so that I only capture the data for approximately 2 inches, I am not getting any velocity data when exported to excel. The position data looks good. I can look into wiring in the position data but I am not sure how to go about doing so.
10-11-2016 03:27 PM
It's hard to follow what you're showing in the screenshots. It would be easier if you provide the data directly, and if you also save the values you're using (for the filter order and side points, etc) as the default values, then upload the data and that VI. You could provide the data by exporting the graph of the raw data to Excel, then saving as a text file. Then, it's easy to modify your code to read in that text file instead of doing the DAQmx operations, and we could see exactly what's happening.
10-19-2016 09:45 AM
I was reading the wrong channel, I was able to isolate the issue by inputing the raw data as advised. Thanks a lot for help it was much appreciated!