LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Differentiation of speed

Hi, is there an easy way to differentiate the delta t from data streaming to a DAQ onto a chart?

 

i an using the USB 9221 DAQ, with the aqusition at 1 sample on demand.

 

also how can i find out the sample rate of "1 sample on demand"

0 Kudos
Message 1 of 9
(3,469 Views)

moreinfo:

 

the input signal is a voltage which represents speed. i want to find the acceleration during the immediate time, and therefore differentiating the speed

0 Kudos
Message 2 of 9
(3,467 Views)

Well, to differentiate for 1 sample on demand, you would have to know the delta between each data pt.  I suppose you could do that with a timestamp if it's slow enough...  If you are taking the data in a loop, you could use a time delay to set the sampling rate.  Keep in mind that this will substantially slow down your data acquisition.

 

Sample rate for "1 sample on demand" -- I don't think you can do that, but I could be wrong.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 9
(3,466 Views)

You may want to use the "Derivative x(t) PtbyPt.vi" function located at Signal Processing >> Point by Point >> Integral & Differential PtbyPt.  This function is available with LabVIEW Full or Pro.  You can also use the Derivative block in a Simulation Loop if you have the LabVIEW Control Design & Simulation module.

 

One important thing to remember is that differentiating a noisy signal will produce very erronious data, so you will need to make sure your acquired "speed" signal is as clean as possible.

 

Chris M 

0 Kudos
Message 4 of 9
(3,452 Views)

iv used Derivative x(t) PtbyPt.vi but as you meantioned it does give erroneous data. ,my signal is noisly but will it improve the reading of i increase the delta t?

 

 

is there an other easy way of doing it.

0 Kudos
Message 5 of 9
(3,434 Views)
Why are you doing 1 sample on demand instead of using hardware timed acquisition? You would have a dependable dt instead of something arbitrary such as your loop rate.
0 Kudos
Message 6 of 9
(3,430 Views)

i used it because it was the only way the chart graph would display properly.

 

 

if i didnt use 1 sample on demand it will show as a standing wave. not actually charting as i want it to.

 

 

is there a way to get around this?

 

0 Kudos
Message 7 of 9
(3,424 Views)
If you acquire multiple samples, all of the samples will be displayed on a chart. If you acquire more samples, those samples will be appended to the previous ones as long as you do not exceed the chart history length. What do you have that set to? How long do you want to acquire and how many samples. You can also use a normal graph. With a shift register, you can append new signals to old ones.
Message 8 of 9
(3,422 Views)

I think you are running into a misunderstanding between visualisation and datastorage. And, to be honest, i think you lack some basics of data acquisition....

 

Nevertheless, what you are doing

- is only valid for slow data acquisition (very dependent on CPU load and system configuration), i'd say something with dt > 10ms (better >100ms). So i'd use "1 sample on demand" (if ever) only for frequencies <50 Hz.

- You get a single value and want to determine something what depends on "the trend" of the signal. I wouldn't do so.

 

Explanation on data acquisition:

Using "1 sample on demand" introduces a huge jitter since the data is acquired using interrupts. So your dt is not constant!

Use a continuous acquisition (which is hardware timed) to ensure a constant dt. The dt is known to you since you configure the acquisition rate (1/dt).

 

Explanation on building the derivative

The derivative describes the slope of a tangent line to the point. Therefore, you have to know what i called "the trend" of the graph. Single point acquisition therefore introduces overhead which leads to about 60times longer calculation times (i asume dependend on system).

 

Explanation on visualistation:

A Chart displays points per index. Single points can be added in the history (at the "end" ). Since "1 sample on demand" ha no constant dt, there is no reflection of timing in the x-axis (at least not accurate at all). Since you are currently only looking into "i want to see what i expect", you alter your data set in a negative way in regard to "what you really want to know". This is not a good idea. You should ask yourself "Why does the graph not look the way i'd expect? Is my expectation not correct or is the dataacquisition still not configured correctly?" (hint: Nyquist)

 

Please take this a constructive feedback!

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 9 of 9
(3,393 Views)