12-09-2015 06:45 PM - edited 12-09-2015 06:47 PM
Hello guys,
I'm measuring the RPM of a tachometer with an optical sensor. Basically, I have a pulse that a need to measure.
I did a Vi to count the time between every revolution of the tachometer. The problem is the VI is doing only around 200 iterations per minute, and that's very low to count high RPMs.
Another problem is that my frequency is adjusting very slowly.
Can you help me?
12-10-2015 04:56 AM
Anyone?
12-10-2015 05:51 AM - edited 12-10-2015 05:52 AM
Hi Dany,
The problem is the VI is doing only around 200 iterations per minute, and that's very low to count high RPMs.
Your DAQAssistent is set to read 100 samples at 1kS/s sample rate, this will take 0.1s on it's own.
That's why your outer loop is limited to max. 600 iterations/minute.
But that's not "the problem":
- one minor problem is you read 100 samples but then you use FromDDT function to give you just one of those 100 samples to work with.
- one BIG problem is your inner loop running forever as you wired a FALSE constant to the loop stop condition…
Other things:
- Why is the VI named "FPGA" when you use a DAQAssistent ExpressVI?
- Why use high resolution timer for this purpose?
- What's that weird logic inside the inner loop to provide a value to the case structure selector? Why do you use DBL values here?
- What's the purpose of the "Untitled" VI?
- Which DAQ hardware do you use?
What do you want to achieve at all?
12-10-2015 08:53 AM
-> one minor problem is you read 100 samples but then you use FromDDT function to give you just one of those 100 samples to work with.
Should I read one sample at a time with a higher frequency?
-> one BIG problem is your inner loop running forever as you wired a FALSE constant to the loop stop condition…
I already corrected this one, but thank you for pointing that. I sent the previous version of the file. Yeah, I'm dumb 😄
->Why is the VI named "FPGA" when you use a DAQAssistent ExpressVI?
I was using a VI from NI and I never changed the name.
- Why use high resolution timer for this purpose?
I changed this too from the previous version. Since with 10k RPM I would need a Tick Count (ms) i then changed to this one.
- What's that weird logic inside the inner loop to provide a value to the case structure selector? Why do you use DBL values here?
I slightly changed that, but it is supposed to change the case selector in a way that checks if the value I got from the DAQ is greater than threshold and then change to check if it is lower than hysterisis.
- What's the purpose of the "Untitled" VI?
As I said I sent the previous version of the file that didnt' use a subVI but then changed it to make it easier to understand, so the Untitled.vi is supposed to be a subVI of the most recent version. I'll attach the correct files this time.
- Which DAQ hardware do you use?
NI USB-6215
What do you want to achieve at all?
I want to measure the time between two pulses read by the DAQ ( this signal is obtained with an optical sensor and ranges from 0V when not reflecting to 3V when reflecting a disc on an engine) to calculate the frequency at which the disc is rotating.
Thank you for your help,
Best regards
12-11-2015 05:19 AM
Bump
12-11-2015 05:59 AM
Hi Dany,
- what's the point of using FXP datatypes in your subVI? Use DBL as is given from DAQAssistent!
- You made the DAQAssistent even worse: now you read 100kS at 250kS/s - and still use just one single sample…
When you want to measure time between pulses you need to analyze ALL samples!
More easy way: Your USB6215 has two counters available. Use them to count the pulses.
From puls count you can easily determine speed: rpm:=(count1-count0)/(time between counts)
12-11-2015 06:11 AM - edited 12-11-2015 06:12 AM
- You made the DAQAssistent even worse: now you read 100kS at 250kS/s - and still use just one single sample…
How can I use all the samples then?
More easy way: Your USB6215 has two counters available. Use them to count the pulses.
From puls count you can easily determine speed: rpm:=(count1-count0)/(time between counts)
Do you know any tutorial on how to implement these counters?
Thank you for help!
Best regards
12-11-2015 06:21 AM - edited 12-11-2015 06:23 AM
12-11-2015 08:28 AM
Yeah, you are right, I'm just using one value, it's kinda dumb 😄
I just have one question. How can i use a square wave with 5v max and 0v min as a digital input?
12-11-2015 08:44 AM - edited 12-11-2015 08:45 AM