10-03-2013 01:35 PM
I am a new Labview user, so some of this is a little overwhelming. I am using a cDAQ-9188 with several modules but the one I have having issues with is the 9411 that is being used to measure the speed off a torque meter.
I attached the program I set up. What I would like it to do is measure the number of edges over a 3 second interval so that I can divide by the number of pulses/revolution*60*1/3 to get rpm. However, the number of edges is not behaving in a linear fashion as I expected. I measured the speed of the shaft using a strobe light and graphed it vs. the number of edges. The results are attached on the excel file.
What am I missing? Should the number of edges not increase as I increase the speed of the shaft, or am I going about this all wrong and not measuring what I think I am?
Thanks in advance.
Solved! Go to Solution.
10-03-2013 04:06 PM - edited 10-03-2013 04:08 PM
Hi Ricus,
I'm actually still using LV 2011 so can't view your VI (if you post a screenshot or VI saved for 2011 I can take a look).
From the method you described, the VI itself should probably look something like this (you'll want the 3 second interval to be clocked somehow in hardware if you aren't doing this already, the PFI filter would be helpful if the input signal is noisy):
If this is in fact a torque sensor (does it output pulses at a frequency proportional to torque or something like that? a link would be helpful) the shape of your curve might not be so unusual depending on the type of motor you are characterizing:
@Ricus wrote:
What I would like it to do is measure the number of edges over a 3 second interval so that I can divide by the number of pulses/revolution*60*1/3 to get rpm.
If the sensor outputs a fixed number of pulses per revolution then this would work, but then it wouldn't be measuring torque.
Best Regards,
10-04-2013 07:09 AM
Thanks for the reply John! I took a screenshot of my VI so you can take a look.
The shape of the graph you linked does look similar to my data however I think that is just a coincidence. That is a graph of the startup torque from a full stop to 100% synchronous speed. Each one of the points I am taking should already be at synchronous speed.
The torque sensor I am using is this one. I have the mV/V bridge connected to a NI9237 module in the cDAQ and that works and reads the torque accurately. I have the speed pickup option with this torque meter and that is what I am connecting to the 9411 module.
John_P1 wrote:
(you'll want the 3 second interval to be clocked somehow in hardware if you aren't)
This is probably my issue. I have it clocked using just the Labview software. I created a VI similar to the one you linked, but I keep getting Error -200284 (Some or all of the samples requested have not yet been acquired). I get the same error when I try and use any of Labview's help examples for counters. I will keep looking into this.
If the sensor outputs a fixed number of pulses per revolution then this would work, but then it wouldn't be measuring torque.
Yep, I already have torque being measured from a different output. Sorry that I didn't state that.
10-04-2013 11:46 AM
Ahh ok, that makes more sense--it seemed like a weird way to report back a measured torque but now I understand that your torque sensor also measures RPM via this speed pickup option and this is what you are asking about (I didn't see how many pulses/rev the sensor is on the Honeywell website though, do you know offhand?).
The software-timed 3 seconds is going to introduce a good deal of variability to your measurement but wouldn't explain the strong negative correlation between RPM and output frequency of the speed sensor (we're talking several ms of non-determinism for a 3 second window). Eventually you'll want to fix this as well but it's not your primary issue right now (as an aside--it would actually be more accurate to measure the frequency of the encoder signal using the 80 MHz timebase as a reference and averaging the result over a 3 second window, the general idea is sort of explained in the 9188 manual here, but I'm digressing).
I think it's more likely that the signal from the speed sensor is a bit noisy (pretty typical for optical encoders) and during transitions the 9411 is picking up multiple edges. A slower RPM equates to longer transitions and thus more false edges. This is just a hunch though, but it's what I can think of off the top of my head that might be causing what you're seeing (If the number of pulses read back is higher than what you would expect given the pulses/rev of the sensor across all RPM ranges than this would support my theory). If you want to ignore the measurement method for a second and try to fix the noise issue (assuming there is one), you can add the following property node to your existing code before you start the task:
You can start by setting MinPulseWidth to 6.4us (which is one of the built-in clock divisors available for the PFI filters on the 9188). You want the MinPulseWidth to be short enough to guarantee detection of a legitimate pulse but long enough to block out any false edges that occur during transitions.
Best Regards,
10-04-2013 11:54 AM - edited 10-04-2013 11:56 AM
Oh also, the screenshot I posted earlier (in my first post) is actually a "VI Snippet". You should be able to just save the image to your computer and then drag it into LabVIEW (dragging directly from a web browser doesn't work without a certain LV Plugin).
Error -200284 is a read timeout. If there is no clock signal for the CI Period task to measure then you wouldn't get any samples and hence a read timeout. The code I posted uses ctr3 to generate a clock and measures it with whatever other counter you want to use so shouldn't have this problem.
Best Regards,
10-04-2013 02:20 PM
I added a property node with a 6.4us MinPulseWidth. The pulses/rev for the torque sensor is 60. I graphed my results on the excel sheet I attached.
Annndd looks like this solved my issue! (1/60 rev/pulse)*(60 sec/min)*(1/3sec) is going to give me the correct rpm. I am going to look into measuring the frequency of the encoder as you suggested, but I am glad I got this first problem taken care of. Thank you so much!