LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tachometer problem

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?

Download All
0 Kudos
Message 1 of 10
(4,220 Views)

Anyone?

0 Kudos
Message 2 of 10
(4,187 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 10
(4,173 Views)

 -> 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

Download All
0 Kudos
Message 4 of 10
(4,142 Views)

Bump

0 Kudos
Message 5 of 10
(4,106 Views)

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)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 10
(4,096 Views)

- 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

0 Kudos
Message 7 of 10
(4,091 Views)

Hi Dany,

 

for examples you just need to open the example finder in LabVIEW! There you also find example VIs on how to use counters in DAQmx…

 

To use all samples you should NOT convert the DDT to a scalar value… ("Doh!" :D)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 10
(4,083 Views)

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?

0 Kudos
Message 9 of 10
(4,067 Views)

Hi Dany,

 

DI (or PFI) pins accept TTL signals: just connect your "square wave with 0/5V levels"…

 

Reading the manual of your hardware might be a good idea too!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 10
(4,060 Views)