LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TTL measuring frequency

I have a circuit that measures the frequency of a spinning disc. It's output is a TTL signal which is suppose to be compatible with a NI-6025E DAQ card. However I have a program to measure the frequency of a signal which functions well with a TTL signal from a function generator. However it gives an impossible HIGH reading from my own TTL signal circuit. I understand my TTL has a rise time of 100ns and labview only accepts a TTL with a rise time of less than 40ns. Is that correct?
0 Kudos
Message 1 of 9
(3,892 Views)
I do not think rise time would be an issue. Have you verified the freq of your signal by another means (oscope, freq counter)? Noise or glitches on the signal could be causing erroneous results.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 9
(3,874 Views)
I do not have a osciloscope. I understand LV has a osciloscope.VI. However I cannot locate one. Do you know where i can get an osciloscope.VI so that I can check the signal. I have attached my TTL circuit file.
0 Kudos
Message 3 of 9
(3,854 Views)
" Do you know where i can get an osciloscope.VI "

Here : http://www.ni.com/digitizers/

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 4 of 9
(3,848 Views)
Unless you have an analog DAQ card a O'scope vi won't be much help. The concern here is when your measured values vary from your expected you need a means of determining which one is closer to reality. The labview measurement can be off for a number of reasons, triggering issues, triggering mulitple time when it should be once, due to noise, or improper trigger settings are one possibilities. Sometimes you find that what your measurement is telling you is correct because what the real signal really looks like isn't what you expected (I had a rpm signal from a transducer that was supposed to be 8 pulses / rev and turned out was really only 4, my measurement was correct). Do you, per chance, have access to an analog DAQ card?


Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 9
(3,848 Views)
" However I have a program to measure the frequency of a signal which functions well with a TTL signal from a function generator."

Don't worry. You have company here - even I had the same experience. The code that I put together for measuring frequency ( or rpm) was fine with a function generator. But connect the actual signal ( it was also from a opto-isolator ( Sharp make ) with built in Schimdt trigger ) and the readings were all over the place. Running against a tight deadline I did the next best thing : Simply introduced a F-V convertor based on LM331 and converted the frequency to voltage. The result was so good and linear for the purpose, that the customer almost kissed me.

OK my frequency range was 0-6000 Hz and I easily got away with it. Not sure what your frequency range is. And I am not advocating an F-V as a general solution. To me atleast measuring frequency directly with LV has been a tough thing.


Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 9
(3,838 Views)
Are you certain your TTL circuit is designed and functioning properly? Post your schematic, if possible.
Do you have a good strong pull-up to +5V.
How many events/rev on the disc and have you scaled rpm to Hz properly?
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 9
(3,823 Views)
Sorry I missed your schematic in your 2nd post. But that diagram is pretty generic, and without actual component numbers it's anyone's guess if it is designed properly.

What voltage are you supplying Vcc from? What value does the voltage regulator regulate to (or at least it's P/N)?

Are the circuit's groundand the DAQ card digital ground tied together?

Have you tested this circuit by itself to make sure it works, at least statically. Use a DMM and make sure you get TTL compatible levels out when the photodiode is blocked and not blocked from the LED.

What wavelenght is the LED and photodiode sensitive to? If ambient (as opposed to IR) you could be picking up other light sources. If so, shield it from ambient light.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 9
(3,819 Views)
You say that you are getting an impossibly high value. What value are you getting. What value do you expect? Is it a percentage higher or an order of magnitude? How many slots are on the disk that is rotating (how many on/off transistions are you expecting/revolution)? What is the expected rpm of the shaft? As the previous post asked, is the LED/photodiode pair shielded from other light sources? If they are sensitive to any of the ambient light sources you could get the local line frequency or multiples of the line frequency if the sensor is "seeing" room lighting. In the US that would result in a 120Hz signal, in Europe a 100Hz one.
How do you know that the rise time of your circuit is ~100nS, is that a spec from your sensor assembly's data sheet? I don't think that it should pose a problem, even if the NatInst requirement is 40nS, but ...

Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 9 of 9
(3,811 Views)