LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital frequency converter

Hi,
 
I have an rotation table which is equipped with an encoder. The encoder is sending about 737 pulses each time the rotation table does one complete turn. If the rotation frequency is, let say, 10 turns/second the encoder will by sending pulses at a frequency of 7370Hz. I need a way to convert this pulse train by another pulse train at lower frequency. For the example at hand here I would like to divide the pulse train frequency by a factor of 7.37.
 
Also, the rotation frequency may change in realtime but the conversion factor (7.37) will remain the same.
 
Is there an easy way to do this? I currently have a PCI-6601board, how could I use it for this application?
 
Thanks
 
 
0 Kudos
Message 1 of 4
(2,889 Views)

I don't know a simple way to do exactly what you describe with hardware.  Here are a couple things you *can* do using 1 or 2 counters (most multifunction boards have 2).  Not exactly what you're after, but maybe one or the other will work good enough?

1. You can use 1 counter to divide down a TTL signal by any integer >= 4.  You would define your pulse train using units of "Ticks" and then specify the integer #'s of ticks for high time and low time.  (The minimum allowed value of ticks is 2.)  You would also have to specify the external encoder signal as the counter's "timebase source" signal.

2. You can achieve nearly any fractional division factor by using 2 counters.  One will measure the incoming encoder freq, the other will generate an output that is some arbitrary fraction of the other.  However, the output won't change instantaneously with the input, nor can it be expected to track every nuance of the input variation.  You have to perform software calls to sample, then calculate, and finally update the output freq.  Note that the output pulse train can have its freq changed on-the-fly without stopping.

   Another tip for option #2:  measure your input frequency with continuous sampling.  Then you can setup DAQmx Read properties to request that you read the most recent N samples.  That way each time you request data, the call will return immediately with the freshest available data.  You can then do any needed filtering or averaging on these samples to determine the most representative input freq.

Don't have time to explain all details of terminology above.  Search the forums and you'll probably find quite a bit of help.  You can include my signature ("Kevin P") in the search because I've been involved in past threads using many of these terms such as "timebase source", "units of Ticks", "on the fly", "most recent samples".

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(2,872 Views)
As Kevin said, simple ways may not be available.

A technique used in phase-locked-loop (PLL) frequency synthesis is to multiply the reference frequency (in your case the encoder output at ~7370 Hz) by some integer factor and then divide the higher frequency by another integer. You could multiply by 100 (to ~737000 Hz) and then divide by 737. I have never tried to put together a PLL multiplier using LV and a counter, so I cannot advise you on the implementation.

Lynn
0 Kudos
Message 3 of 4
(2,859 Views)

Hello kwijibo28,

If you are trying to generate a pulse train with a frequency that is 1/7.37 the frequency of the pulse train generated by your encoder,

as a simple solution, I would recommend performing a digital frequency counter measurement with the encoder as the counter input.

Next, I would perform a digital pulse train generation, with the frequency input of the CO Pulse Freq. DAQmx Create Virtual Channel  being

the fequency output from the digital frequency counter measurement divided by 7.37.   You can find VIs for digital frequency counter

measurement and digital pulse train in NI Example Finder.

 

Best wishes,

Wallace F.

National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(2,845 Views)