Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a TTL to RPM numeric display.

Hardware

cDAQ NI 9172

Module: NI 9401

Monarch Instrument’s Remote Optical Sensor (for measuring RPM/pulse counts)

 

Software

NI Sound & Vibration Assistant

NI Signal Express

LabView

 

Experience Level

Beginner

 

My objective is to read and record accelerometer and engine speed data together so they are time stamped the same.  Setting the accelerometer up was easy… the RPM, not so easy.

 

I have been trying to convert a 5v TTL signal from an optical sensor, which is used to measure RPM, in NI Sound & Vibration Assistant.  The optical sensor is a stand alone, self powered system with a output signal of “TTL compatible pulse (0 to 5VDC)”.

 

I’ve started a project in NI Sound & Vibration Assistant, “Add Step”, “Acquire Signal”, “Digital Input” and “Line Input”.  On the Step Setup Tab/Configuration Tab, I’ve selected my channel, Acquisition Mode set to Continuous Samples, Rate set to 1.3kHz.  Then on the Step Setup Tab/Advanced Timing I had to select “On Demand” for Sample Clock Type due to error message(s).  “On Demand” is the only way to get the signal to appear on the Step Setup Tab’s graph.  The signal is a square wave represented by 0 and 1 (0s and 1s are overlaid on the graph).  When I block the optical sensor view, the signal goes flat represented by 1.

 

I’ve also messed around “Acquire Signal”, “Counter Input” and “Edge Count” with the same results.

 

Question:  How do I convent this TTL signal to a RPM output… either as a numeric display?

 

Thank you in advance for any help.

          
0 Kudos
Message 1 of 21
(9,296 Views)
Hi,
 
1. Open Sound and Vibration Assistant:
Start >> Programs >> National Instruments >> Sound and Vibration >> Sound and Vibration Assistant
 
2. Acquire Digital Line Input:
 Click Add Step >> Acquire Signals >> DAQmx Acquire >> Digital Input >> Line Input
 
3. Convert Line input to Analog input for processing purposes:
 Right click under the step you added >> processing >> Digital Signals >> Convert Digital to Analog
 
4. Get Frequency of Signal:
Right click under the step you added >> analysis >>Time Domain Measurements >> Timing and transition
 
5. Convert frequency to RPM:
     a. find equation used to convert from frequency to RPM. In this case we will use 1 Hz = 60 RPM
     b. Right click under last step added and choose processing >> analog signal >> Formula
     c. Enter formula into "Operation Setup"
         It specifies x0 as frequency and Y as RPM. 
         Y=x0/60
 
I hope the helps!
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Message 2 of 21
(9,259 Views)

Ima,

Thank you.  I applied your steps.  We're close but not there yet...I'm sure it's something I'm missing.  Could you please review the attached to what I’m doing wrong?

 

Thank you,

Team Stoney

 

0 Kudos
Message 3 of 21
(9,218 Views)
Hi,
 
I am curious about what you mean by you are close but not there yet.  Could you expand on the error you are receiving?  Also, I was looking at the LabVIEW solution that Rob posted here, did you try that ask an option?
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 4 of 21
(9,176 Views)

Have you tried using the 'Acquire Signals >> Counter Input >> Frequency' step?  This step will give return the frequency of your TTL signal.  You can then use the 'Processing >> Formula' step to convert the frequency to RPM by multiplying the frequency by 60 (see attached screenshots).

For frequency measurement, connect your TTL signal to PFI1 (pin 16) on the 9401.  Please note that with the NI cDAQ-9172, only slots 5 and 6 have access to the PFI lines.

I hope this helps.

Message Edited by Feroz on 09-21-2007 10:35 AM

Download All
0 Kudos
Message 5 of 21
(9,143 Views)

Ima,

Thanks for the step by step instructions.  When I say close, I mean my process data shows up as "Inf"... not as numerical output; see slides 11 and 15.  Any ideas on why "Inf" is being displayed?

Thanks in advanced for your help!

Team Stoney

 

0 Kudos
Message 6 of 21
(9,113 Views)

Ferzo,

 

Great example!  I am able to get a RPM numerical value… however when my rotating component slows to a stop, the processed data (logging) stops updating around 500 RPM.  I was expecting the value to drop to zero as my source reached zero.  Plus some of my speeds, that I need to measure, can be a low as 1 to 100 RPM.

 

Please note that your screen shot of the formula page is different than mine.  Mine is missing the “Input and Output Scalars” window… any ideas?

 

Thanks,

Team Stoney

 

 

Download All
0 Kudos
Message 7 of 21
(9,112 Views)

Hello Team Stoney,

Are you not able to measure the values between 1 to 100 RPM?  Have you tried right clickin on the graph and removing the Y autoscale?

Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 8 of 21
(9,103 Views)

Ima,

I cannot read any RPM value under 500 using Feror’s method.  And when I use your method I only get “Inf” as an output value for any RPM.

 See attached for a screen shot of the "Inf".

Team Stoney

0 Kudos
Message 9 of 21
(9,093 Views)

Ima,

Yes, I've tried changing the autoscale... not luck.

0 Kudos
Message 10 of 21
(9,097 Views)