06-21-2013 01:17 PM
Hello,
I am new to LabView. I have a cDaq 9172 and three modules (9263, 9201, and 9401). I am trying to measure rpm of a shaft with a 24 tooth gear and magnetic pick up. The shaft is expected to rotate in a range between 0.5 and 5 RPM which corresponds to 0.2-2Hz square wave signals (analog acquisition). I've tried using the frequency channel on the digital module (9401) but I couldn't get the programming to wait to aquire the relatively low frequencies. I've also tried post processing the analog signal (module 9201) but the Tone Measurement VI gives me inaccurate measurements at low frequencies (<1Hz).
Could someone please offer me a simple solution for measuring frequency accurately for the expected range so that I can calculate the RPM?
Much appreciated,
Jake
06-23-2013 04:56 PM
At the low pulse frequency you are looking for, you will probably have more success measuring the dwelll time between pulses, and then converting that to a frequency.
My 2 cents worth, good luck with your project,
Dave
06-25-2013 11:22 AM
Dave,
How would I go about measuring the time between pulses? I see how I can start a timer on the "rising edge" but then how do I stop the timer on the next rising edge? I'm assuming part or all of this would go into a loop so that I get continuous period time measurements, is that correct?
Thanks
Jake
06-26-2013 10:47 AM
Hello Jkfish,
For frequencies that low, you should be able to poll the signal and set a boolean to true when you hit an edge. You could then take a tick count (ms) and wait until the next edge, then find the time in between. For the frequencies you are talking about, a polling frequency of 100 Hz - 1 kHz should be more then enough to get a fairly accurate reading.
Please let me know if this makes sense or if you would like further clarification.
-N
06-26-2013 11:31 AM
Nathanael,
Thank you for the response. I've been trying to measure the time between edges but so far no luck. Is there an example in LabView Help that I could mimic explicitly for this range of frequencies? I've been working on programming it myself based on a block diagram image I found in this forum but again I have not gotten very far. I've attached the programs showing where I'm at right now with it. Suggestions would be greatly appreciated.
In my experiment, the square wave signal from the speed sensor has an amplitude of 24V and a frequency range from 0.5-2Hz. I am attempting to simulate that in the attached VI by producing a similar square wave, checking whether the value is above 5V and if it is I want to start a timer to run until the greater-than-5V-condition is met again. I'm confused on how to make the condition TRUE for only rising signals (going from 0V to above 5V). Also, I'm not certain about the timing method. I'll try putting in the Tick Count (ms) as you suggested. Again, any help would be nice.
Regards,
Jake
06-26-2013 11:41 AM
Hi Jkfish,
To get the rising edge, you could hold on to a previous sample and compare the two. If one is below the 5V threshold and the other is above, then you have hit an edge. You could then wire this into a case structure to get a tick count and store that value, then on the next edge, get another tick count and subtract the two to get the period.
I hope this helps.
-N
06-26-2013 05:49 PM
I found my solution! Now on each iteration the signal is checked for whether or not the value is above 5V and if the value on the previous iteration was below 5V (rising edge). If both are TRUE the Tick Count (ms) value is read. During each iteration the Tick Count value is compared to the previous value and if the difference between the two values is greater than 0 then the difference is converted into frequency and then into RPM from my specific experiement parameters (24 tooth gear). See attached for solution.
Jake