05-12-2017 06:50 AM
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!
05-12-2017 07:24 AM - edited 05-12-2017 07:25 AM
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
05-12-2017 09:42 AM
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.
05-12-2017 03:59 PM
05-12-2017 04:06 PM
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...."
05-12-2017 04:18 PM - edited 05-12-2017 04:22 PM
@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...."
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
05-12-2017 04:50 PM
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.