LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displacement to Velocity using a Quad Encoder

Hi All,
 
I have been using an Omron Quad encoder to measure the displacement of a point on a shaft. To do this i have used
 
 
and then scaled the corresponding output from the counter inside the while loop to get my displacement. This has been a fairly accurate way to measure the displacement (to around 0.5mm over 100mm) however i cannot seem to calculate my velocity from this. I have tried using the differentiate functions but this hasn't seemed to work. Is there any other way of calculating my velocity. Any help would be appreciated.
 
Cheers.
0 Kudos
Message 1 of 6
(3,205 Views)

Hi,

You can calculate the speed with the "point to point" method : (Xn+1 - Xn)/(Tn+1  - Tn) ; it means you must divide for each increment the distance (in mm) by the time between the the 2 points.

Regards,

Wilfried.
0 Kudos
Message 2 of 6
(3,179 Views)
Hi daveyg,

I believe the reason that the differentiate vis are not working is due to the fact that you are only reading one point at a time in your loop.  I modified the vi you referenced to just physically calcluate the derivative (calculate Δt and calcluate Δθ between the last 2 points, and find Δθ/Δt).  I believe that would be the easiest way to do it.  You could also change the number of samples to read and use a waveform output, then you could use the derivative express vi or break the components apart and use the derviative vi. I did not test this, but the idea is pretty straight foward, so I'm pretty sure it will work.

Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 3 of 6
(3,174 Views)
Have only a moment and am not near LV so sorry, no details or examples.  Just a starting suggestion.
 
You're using one counter to capture encoder displacement, right?  Software derivatives are going to give extra "noise".  A better way to determine speed is to configure your other counter to perform frequency or period measurement on one of the encoder signals.  Let your data acq hardware help you out...
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 4 of 6
(3,173 Views)

Hey, Thanks for everyones help.

To Neal M though, the code you modified was saved as a Labview 8.2 file however I'm using Labview 7.1 so i therefore cannot open the file. If you are able to save it under the earlier version software that'd great, I wouldn't want your work to go to waste.

Dave.

0 Kudos
Message 5 of 6
(3,156 Views)
Dave,

Attached is the VI in 7.1.  I ran into some issues converting it, but it should work... I think... Either way, I attached a jpg of the code I modified.  Its pretty straight forward, so you should be able to get it. Happy Halloween.
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
Download All
0 Kudos
Message 6 of 6
(3,129 Views)