LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert digital input to a velocity graph

I've set up a hall-effect sensor to measure the velocity of a bicycle wheel as I rotate it.  It provides a digital input into labview, from where I can calculate the veloicty based on the rpms.  I've managed to find a way to work out the velocity of the wheel after the fact, but is there anyway that I can program labview to show me the velocity in realtime?
0 Kudos
Message 1 of 4
(2,947 Views)
egordze,

There are many ways you could do this -- it sounds like you are receiving a pulse train in the form of a PWM signal, from which you can derive velocity.  If you want to see updates on this continually you can use a rolling average -- this could be accomplished using a while loop and shift registers or even just a while loop that runs at a certain rate and counts the number of rising edges --

it kind of depends on how you are receiving the signal into labview -- if you have to poll the digital line you need to poll fast enough to catch every rising edge no matter how fast your wheel is spinning.  You could count these rising edges and divide them by some time interval to determine velocity.  This could be done in a while loop to continually monitor velocity.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 2 of 4
(2,931 Views)

Do you have an example of a rolling average?  I have used the Passive digital realization filter  at http://en.wikipedia.org/wiki/Low-pass_filter .  Is this considered a rolling average?

\alpha = \frac{\Delta t}{RC + \Delta t}

yn = αx + (1 − α)yn − 1

where:

yn is the current output value
yn − 1 is the previous output value
x input value
Δt is the time interval between samples
RC is the time constant

This works pretty good but I would like to use a rolling average with n data points where the n data points are averaged and the array is updated with new measurement value.

 

0 Kudos
Message 3 of 4
(2,904 Views)
I would use a counter as your input instead of a digital input.

If your input is pulse width modulation (the duty cycle changes with speed), then you need to set up the counter to measure the time between the rising and falling edges of your digital waveform.

If your input is pulse rate modulation (the duty cycle is the same, but the time between subsequent pulses changes with speed), then you need to set up the counter to measure the time between rising edges.

There are examples of this under DAQmx/Counter/Measure Period or Pulse Width.

Message Edited by rpursley8 on 02-01-2007 11:48 AM

Randall Pursley
0 Kudos
Message 4 of 4
(2,893 Views)