02-11-2013 02:22 PM
Hi all:
I am very new to LabView so forgive me if this is a simple answer. I have a position transducer inputting data into my DAQ. I have figured out how to take that data and plot it into a graph (using the DAQ assistant. However, I would also like to plot velocity, acceleration, and jerk all as a function of time using the same data. Attached is some broken code that I honestly don't even think is close to the direction I should be heading in. I know I need to take the derivative, and I am pretty sure I need to convert the data into an array to do that, but I am not sure how to do all of this. Any advice would be very much appreciated.
Thank you,
Cody
02-11-2013 03:06 PM
Cody,
You are making it more difficult than needed, mostly.
The Express VIs produce signals in the form of Dynamic Data Type, which no one except maybe the guy who developed it likes.
So the first thing to do is Convert From Dynamic Data (select Array in the dialog). This assumes you have set the DAQ Assistant to collect multiple samples on each call. I do not have the DAQ Assistant on this platform so I cannot tell how it is configured. Then use the Derivative x(t).vi. The Point by Point VIs are useful when you get only one point at a time. Place three copies of Derivative and you get all the signals you want.
You can start crying before you run it. Unless your data is extremely smooth and free of noise, the jerk signal will be essentially useless and the acceleration signal will be quite noisy. This is because noise has high frequency components and the differentiation process enhance the higher frequencies.
Savitsky-Golay is a process which can handle much of the required smoothing, but it takes some effort to learn and probably some experimentation to get suitable parameters for your signals.
Lynn
02-11-2013 03:16 PM
If you are using the DAQ Assistant the easiest way to take the derivative is probably the "Time Domain Math" Express VI.
If you want to use the lower-level VIs the conversion you need is to first convert the data into a waveform (or array of waveforms if you have multiple channels) using the "From DDT" Express VI and then get the waveforms Y and dt components using the "Get Waveform Components" node.
Here's a picture with the nodes labelled so you can using Search/QuickDrop to find them:
Hope this helps, good luck with the rest.
Simon
02-12-2013 02:25 PM
Thank you for your responses! They were both very helpul to me, and I have everything working now.