# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Calculate velocity!

Hi all,

I currently measure the distance travel of a plunger on my UUT using a LVDT output (analog voltage going to a DAQ card). How would I measure velocity since I can't think of way to measure travel time of plunger ! I'm using LV 8.5.

Thanks

Message 1 of 14
(7,636 Views)
Solution
Accepted by topic author dphan128

## Re: Calculate velocity!

How are you acquiring data now?  Is it single point acquisition or measuring a waveform?  If you take the derivative of the waveform, that would give you velocity.
Message 2 of 14
(7,620 Views)

## Re: Calculate velocity!

I acquire single point data now
Message 3 of 14
(7,592 Views)

## Re: Calculate velocity!

Are you measuring distance or are you measuring position?

If you're measuring position, then you have to take TWO readings, and TWO timer values:

Velocity = (Current Position - Previous Position ) / (Current Time - Previous Time)

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 4 of 14
(7,584 Views)

## Re: Calculate velocity!

I'm measuring distance of travel. I took the analog reading at start of travel and another at end of travel. And do my calculation to figure out distance of travel. My problem is I can't figure out way of measure timing from start to end with my set up!
Message 5 of 14
(7,577 Views)

## Re: Calculate velocity!

If you want a rough approximation, then whatever triggers the START reading should also remember the current mSec timer.

Whatever triggers the STOP reading should also remember the current mSec timer.

Two positions + two timers = Velocity, as outlined above.

That's "roughly approximate" because there's no hard correlation between triggering the reading and reading the timer - you don't know which comes first, or by how much.

If you need a more exact answer, consider sampling the whole travel at a fixed rate, then count samples between start and end.  Multiply the sample distance by the delta-T and you have time.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 6 of 14
(7,575 Views)

## Re: Calculate velocity!

That was my issue. I had no way of "marking" the initial and "marking" the end ! I'm using state machine method in my LV so every action just happens in a sequence. Basiscally it looks like this:

-set my plunger to home postion

-measure home postion's analog value

-set my plunger to fully extend postion

-measure fully extend postion's analog value

-subtract fully extend postion value by home position value and calculate distance of travel

Message 7 of 14
(7,568 Views)

## Re: Calculate velocity!

So, you ARE measuring position.

Again, what is triggering the measurements?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 8 of 14
(7,563 Views)

## Re: Calculate velocity!

In the state "measure home position's analog value" add a "Tick count (ms)" and put the reading in control "Start Time"

In the state "measure fully extend position's analog value" add a "Tick count (ms)" and put the reading in control "Arrival Time"

Subtract both control and you have the travel time, if and only if your code is synchronous with your plunger 😞

I would read the value of the plunger continuously.

Using the scan rate of your DAQ you know the exact time between readings.

Out of this two you get velocity.

Or like Ravens Fan already said, read position continuously in waveform type and differentiate the waveform.

Message 9 of 14
(7,562 Views)

## Re: Calculate velocity!

Hi, how do I differentiate the waveform to attain the value of velocity?

Message 10 of 14
(7,078 Views)