From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure rpm using a shaft encoder and labview

Hi,

How does one measure the rpm of a shfat with a shaft encoder on it using labivew. I tried to modify the measuring angular position code that is attached to do the job but I havent been successful. If anyone has a code to measure the rpm of a shaft using an encoder, that would be vry much appreciated.

I am using a quadrature encoder with 2500 cycles per revolution and the NI 9401 and N1 9172 chassis

0 Kudos
Message 1 of 7
(11,716 Views)

Hello Eluan, 

 

What about the example you attached is not working? Are you getting the correct angual positon in LabVIEW? Since you are concerend about the RPM I would instead utilize the DAQ assistant to preform a frequency (Hz=Pulses/Second) measurment and convert that frequency into RPM [Hz (Pulses/Second)/2500 (Pulses/Revolution) (assumption based on your statement)] *60 seconds/1minute. Please take a look at the snippet below. 

 

Untitled11.png

 

Best Regards,

 

Izzy O.

Applications Engineer

National Instruments

www.ni.com/support

 

 

0 Kudos
Message 2 of 7
(11,682 Views)

There is a very good white paper on how to do this

 

http://www.ni.com/white-paper/3921/en 

 

Look at the comments for limitations but we use it successfully.

HalMP
Message 3 of 7
(11,672 Views)
Thanks for your reply. I tried your suggestion but nothing is plotted on the graph.
0 Kudos
Message 4 of 7
(11,671 Views)

Hello Eluan,

 

Which graph is nothing plotted on the frequency, RPM or both? Here are some steps to troubleshoot the behavior you are seeing.

 

  1. Check to see if any errors are being thrown.
  2. Ensure your encoder is firmly connected to your 9401.
  3. Check to make sure you are addressing the correct counter on your 9174 which your encoder is connected to.
  4. Utilize a count edges task to count the edges of a known signal (a time base) then count the pulses coming from the A line of your encoder. This will tell us if the counter works fine, whether there is an issue with the encoder sensor, and if there is an issue with how you wired the encoder for the frequency task.

Best Regards,

 

Izzy O.

Applications Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 5 of 7
(11,633 Views)

Hello everyone,

I'm trying to read the angular velocity of a shaft using optical encoder and write data to a file, the CPR for my encoder is 10000. Attached please find my code.

I do not have any known angular velocity to test my code. Can someone tell me that the code is working correct or not?!

Thanks.

Meysam

0 Kudos
Message 6 of 7
(11,321 Views)

Izzy:


Can you show the SCHEMATIC hookup?? How are you hooking up a QUADRATURE encoder to measure RPM?


Can you use just ONE of the goodies?

 

How would you hook it up??

 

Any help would be AWESOME!

 

My email is dave.korpi@gmail.com

 

0 Kudos
Message 7 of 7
(9,633 Views)