LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RPM calculation using NI 9435 Digital input

Hi all,

        I'm trying to use digital input module as a Frequency counter module. For that I using a proximity (hall effect) sensor to find RPM of a Motor. This sensor will give maximum voltage when there is no metal near to its tip and minimum voltage (0 V) when there is a metal nearby(range is 1mm to 6mm). I have a motor with 4 blades which will come near to my sensor. My program is working fine for lower speed(say Max. 175 Hz) but when the speed increases, it shows wrong values. I used CRO to cross check my output, it is working fine for higher frequencies. What should I do? pls review my logic and let me know how to fix it.

Hardware used, cDAQ 9172 and NI 9435.. software is LabVIEW 8.6.

pls help..

Download All
0 Kudos
Message 1 of 8
(5,174 Views)

Hi there,

 

This could be due to your sampling frequency not being high enough to minimise the risk of aliasing. What sample rate are you using?

 

Many thanks,

 

 

Liam A.
National Instruments
Applications Engineer
Message 2 of 8
(5,167 Views)

Hi,

   The Number of samples to read is 1118 . It is connected as a constant shown in that main VI image, And i tried with a control to change the "Number of samples to read" during runtime, but if i exceed 1118, im getting higher frequency values.

0 Kudos
Message 3 of 8
(5,152 Views)

Hi again,

 

The VI you have created doesn't have any sample timing included in it. This means that the VI is trying to acquire 1118 samples as fast as it can over and over.

 

I have included a link to an example on Digital input sampling below.

 

http://decibel.ni.com/content/docs/DOC-12376

 

This sampling rate needs to be a least twice the rate of the highest data rate expected to prevent the signals being misinterpreted (aliasing).

 

I hope this helps.

 

 

Liam A.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(5,143 Views)

Hi Liam A,

              I tried the example which is suggested by you, but i'm getting an error "External sample clock source must be specified for this application".

I tried to rectify it and came up with an idea to use express VI to acquire samples. This is working fine.:)

Express VI settings:

1. NI 9435 in slot 1 of cDAQ 9172.

2. Digital input-- port input 0

3. Time settings -- Continous samples

4. Samples to Read -- 100k

5. Rate(Hz) - 1

6. Advanced timing

         Sample clock rate - External

         Clock source  -- 100kHz Time base

         Active edge -- Rising

I attached the VI.

0 Kudos
Message 5 of 8
(5,120 Views)

Hi,

 

I'm glad to hear it is working!

 

However, i'm not so sure as to whether settings are the best practice in terms of sampling rate... the rate of 1 Hz could cause a problem with higher frequencies.

 

I have included a further link to provide you with more DIO sampling rate examples if you would like to take this further at some point.

 

http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:ex/q/DAQ%20digital%20...

 

Merry Christmas!

Liam A.
National Instruments
Applications Engineer
0 Kudos
Message 6 of 8
(5,114 Views)

Hi there,

 

Could you please provide me with the VI file of the above Program. Actually I am trying to read signal from my Hall SPeed sensor and I have to display the speed of the wheel on Labview. I am trying to figure it out. It would be really helpful if you can assist me.

 

Thanks a lot in anticiaption

0 Kudos
Message 7 of 8
(4,725 Views)

Please could you provide us with the freq count subvi.vi ?

Thank you in advance.

0 Kudos
Message 8 of 8
(3,182 Views)