LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring time between peaks from periodic input signal

Solved!
Go to solution

We have built a circuit that is supposed to mimic an Exercycle.  We have an IR interrupter and a spinning wheel, the interrupter runs into a comparator circuit, and the output from the comparator we have running into LabView.  We have successfully been able to measure the number of rotations of the wheel and the total distance covered by the wheel, but are having trouble measuring the velocity.  We can't figure out how to measure the time between peaks in real-time, which we could then take to divide the circumference of the wheel and calculate velocity also in real-time.  The VI i posted has a simulated square wave in place of the signal we get from our circuit.  Thank you in advance for the assistance.

 

 

Jon and David

0 Kudos
Message 1 of 7
(3,600 Views)

HI

You can use Extract single tone information.vi that will give you frequency of signal.

Otherwise for measuring the time between peak values you can use Transition parameters.vi, for each electrical rotation you can calculate the time for peak value & by taking the differences between two electrical rotation you can find time between the peaks.

 

Message Edited by SantoshJaiswal on 03-20-2009 12:04 AM
Message Edited by SantoshJaiswal on 03-20-2009 12:05 AM
0 Kudos
Message 2 of 7
(3,578 Views)
Calculate the iteration time of your loop.  Divide the number of samples acquired for that loop by the iteration time.
0 Kudos
Message 3 of 7
(3,573 Views)

Thanks for the input guys.

 

Neither of us are very experienced in using labview (maybe a month tops), and we've been trying to use the Transition parameters.vi and Peak detection.vi but can't get anything to output.  We've read over the help file maybe a million times, but I don't think that we understand some basic things about labview to implement it.  Can you give me a rundown of how to hook up either one to get the peak to peak time.  I'm sorry for our inexperience.  Thank you in advance

0 Kudos
Message 4 of 7
(3,562 Views)

HI

In peak detector VI connect waveform to singal In, The Location output gives you the time in mSec.

Location you will get for each electrical rotation 

You can take the difference between of these location and find the time between peaks

Hope this helps.

Also refer example vi on http://forums.ni.com/ni/board/message?board.id=220&message.id=545&requireLogin=False

Regards

Santosh

 

 

0 Kudos
Message 5 of 7
(3,557 Views)
I am Jon's partner for this project, and when I was reading this forum the other week I found a similar thread suggesting that I place my code inside of theirs.
I have attached their code seperately, and another file (operation dumbo) which has my code and explanations for what jon and I are trying to do with labview.

I figured that if we know the circumference of the wheel, 0.377 meters, we can express instantaneous velocity by dividing 0.377 meters by the time in between triggers.  There is one trigger per rotation of the wheel.

I appreciate your time and help guys!

-Patches the Clown
Download All
0 Kudos
Message 6 of 7
(3,518 Views)
Solution
Accepted by topic author JDUB1187

I think you are overcomplicating things by trying to get the elapsed time between pulses yourself.  Instead, you can use the Tone Measurements Express VI and select Frequency for it to measure. Then, you can multiply the circumference of the wheel by the frequency to get the velocity. 

I hope this helps.

- Christina

 

0 Kudos
Message 7 of 7
(3,482 Views)