LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency of digital pulse NI USB-6008 (rotational speed)

Hi,

 

First of all a slight disclaimer: I'm very much a beginner to LabVIEW, so please bear with me!

 

I'm currently trying to measure the rpm of a shaft using a digital optical sensor. I've connected it to my DAQ (NI USB-6008), and subsequently into LabVIEW (2014). So far I've tried a number of different methods based on what I've seen on these forums and general guesswork, but I don't really know what I'm doing and time is running out!

 

My question is: What is the best way of getting the rpm of the shaft? The most obvious way seems to be getting the frequency of the pulses from the sensor, but quite how to do that seems to be eluding me!

 

The closest I've got is by using the method described in this thread http://forums.ni.com/t5/LabVIEW/How-do-you-count-the-frequency-of-a-boolean-signal/m-p/1087995#M4814...

However the frequency that I get is all over the place, and generally not accurate to what it should be (up to and over 5,000rpm)

 

Any help would be greatly appreciated (feel free to tell me if I'm being an idiot and missing something obvious!)

 

Thanks in advance!

0 Kudos
Message 1 of 7
(2,729 Views)

Hi NB,

 

your USB6008 provides a counter input you can use to count your pulses.

 

Now all you need to do is reading the counter value once a second (loop_time = 1s). Get the difference between current and previous counter value, then calc speed by:

rpm := (current - previous counter value) / (pulses per revolution) * 60 / loop_time


 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,706 Views)

I have never had good luck with counters for whatever reason.  So in order to get an RPM value, I acquire an analog signal of the optical sensor.  It's basically a square wave.  I use the Extract Single Tone VI to get the frequency, multiply by 60 and divide by the number of pulses per revolution.  It gives me a very accurate measurement (within 1RPM) at 5000RPM when compared to a laser tachometer. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 7
(2,669 Views)

Hi aputman,

 

So you do basically the same, but instead of letting the hardware do the counting you need to employ software... 😄

I use counters quite often, even/especially counters of cheap USB600x devices!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(2,652 Views)

Well, I tried using counters when I was still a noob at Labview.  And since I was able to get the analog method working back in the day, I haven't gone back and looked at it.  "If it ain't broke...." Smiley Wink

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 7
(2,649 Views)

@aputman wrote:

Well, I tried using counters when I was still a noob at Labview.  And since I was able to get the analog method working back in the day, I haven't gone back and looked at it.  "If it ain't broke...." Smiley Wink


No doubt you will be back to counter tasks as soon as you have a 600x device.  Just like the OP.  The di sample rate is rather nasty on the software timed devices


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(2,646 Views)

I don't remember what the issues were at the time.  I started off using a USB-6009 device but I don't think we lasted very long with it.  We eventually went to a USB-6212, and that works great for what we are doing.  We record RPMs of impellers that spin from 1200 RPM to 6000 RPM with varying numbers of blades, detecting the space between the blades using a reflective photoelectric sensor.  I seem to recall issues getting out-of-range values and there may have been issues with the range of frequencies being measured.  Now that I think about it, I may have been trying to count edges rather than measure the frequency.   I was a noob using DAQ Assistants....it's a wonder that the app worked at all.  Smiley Very Happy

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 7 of 7
(2,639 Views)