# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Finding an objects velocity using a 1-D position array

Hello all,

I am trying to take a derivative of a 1-D array of points of an object that I am tracking so I can get its velocity. Basically, I have a 1-D array of position coordinates (X,Y,Z) that are continuously being refreshed (or updated) every 100ms. I would like to turn this position data into velocity data. Is the solution to this problem as easy as using the LabVIEW derivative function?

Thank you!

Message 1 of 4
(2,789 Views)
Solution
Accepted by topic author djj790

## Re: Finding an objects velocity using a 1-D position array

Maybe.

I would certainly start there. Or maybe just use shift registers and subtract to get differences between X[i] and X[i-1].

Are you looking at dx, dy, and dz separately or do you want derivatives along some vector?

If your data is noisy, derivatives tend to enhance the noise.  In that case the Savitsky-Golay smoothing and derivative algorithms may be advantageous.

Lynn

Message 2 of 4
(2,786 Views)

## Re: Finding an objects velocity using a 1-D position array

Thank you for your prompt reply! Right now I am trying to find dx, dy, and dz separately. I tried the derivative function and it is giving me a non-zero value when the object is stationary O_o. One thing I was thinking of is whether or not the derivative function automatically uses the previous position (iteration i-1) in its calculation. I assume it works like this: (x2-x1)/(t2-t1)?

Message 3 of 4
(2,782 Views)

## Re: Finding an objects velocity using a 1-D position array

Read the Detailed Help for the Derivative x(t).vi. It can do that calculation but the default method is 2nd Order Central which uses:

y[i] = (x[i+1] - x[i-1])/2dt

Lynn

Message 4 of 4
(2,753 Views)