Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Increase counter frequency performance

Hi Jochen

 

I have read this thread about counter performance and I would like to know:

 

Can I actually do continuous frequency measurements using a 6602 or 6608 counter?

 

I am selecting the hardware for a frequency counter on this performance:

 

- Accuracy: 0.1Hz

- Range: 1Khz - 100Khz

 

Maybe you can also give me some hints on its performance. I calculated that:

 

- 6602 uses 80Mhz clock and has 50ppm accuracy => 80,000,000*50/1,000,000 = 4,000 Hz

- 6608 uses 10Mhz and has 75ppb stability => 10,000,000*75/1,000,000,000 = 0.75Hz

 

According to this, none of these NI comply the frequency accuracy of 0.1Hz.

 

Am I doing some calcualtion wrong?

 

Regards

0 Kudos
Message 11 of 16
(1,792 Views)

Your calculations are not entirely correct, as you are only calculating the accuracy of the clock signals, but not of your measurement results. That's a big difference. Let's make an example:

 

Signal frequency = 1 kHz

Board = NI 6602

 

According to your calculations the base frequency of the 6602 could be between 80,004,000 Hz and 79,996,000 Hz, so within one period of the signal (= 1 ms) the board could count either 80,004 or 79,996 periods of the base clock. So in this scenario the measured frequency could be between 1 / (80,004 * 125 ns) = 999.95 Hz and 1 / (79,996) * 125 ns) = 1000.05 Hz

As you can see, at this source signal frequency, even the 6602 would meet your needs.

 

Unfortunately at higher source signal frequencies things are different. At e. g. 100 kHz the base clock accuracy is not the limiting factor for the measurement accuracy anymore. As the base clock is not phase locked to the source signal, you never can be sure, if the board counts n counts or n +/- 1 counts of the base clock within one period of the base clock. So for example, regardless of the ppm or ppb error, with an 80 MHz clock you could count either 800 or 799 counts for one period of a 100 kHz signal, resulting in either 100,000 Hz or 100,125 Hz measurement result.

 

If you need to determine the frequency of a signal by measuring the time of a single period with an accuracy of 0.1 Hz at 100 kHz, this means, that you need to count at least 1 million clock periods within one period of the source signal, resulting in a base clock frequency of 100,000 * 1,000,000 = 100 GHz! This sounds like extremely expensive hardware and I doubt that it's available as a product today.

 

As an alternative solution you could measure the frequency of your signal by counting the periods of your source signal over a longer period of time, but this requires quite long measurement cycles to get the accuracy that you have specified. Here you can find some more in-depth information about this topic.

 

I hope, this makes things a bit clearer to you.

 

Kind regards,

Jochen Klier

National Instruments

 

Message Edited by Jochen on 08-03-2009 02:59 PM
0 Kudos
Message 12 of 16
(1,771 Views)

Sorry, there is an error in my last post:

 

Wrong:

As the base clock is not phase locked to the source signal, you never can be sure, if the board counts n counts or n +/- 1 counts of the base clock within one period of the base clock.

 

Correct:

As the base clock is not phase locked to the source signal, you never can be sure, if the board counts n counts or n +/- 1 counts of the base clock within one period of the source signal.

 

Jochen

Message Edited by Jochen on 08-03-2009 03:11 PM
0 Kudos
Message 13 of 16
(1,764 Views)

Nice, thanks a lot for the detailed answer

 

Actually this link that you sent me I found it some time ago and has been my reference for the calculations.

 

Since I posted my last message, I made some more calculations. (I put all my latest conclussions in this thread: http://forums.ni.com/ni/board/message?board.id=40&message.id=7586#M7586 )

 

All in all my conclussions have been:

 

- If I derive a clock from the main time base, the stability remains the same, relative to the generated frequency.

 

- Measuring frequency generates error due to the base clock, and due to the measurement technique (synch error)

 

       a. A clock stability of 50ppm generates too much error, no matter which freq estimation technique you use.75ppb would be enough

 

       b. Synch error generated by method 1 would require, as you say, 100Ghz clock. For method 2, they would require10 seconds of measurement. For method 3 they would need different frequency dividers depending on the frequency bur would work nice.

 

 

I subscribe to all your calculations, mine say the same.

 

However I am not sure that the way in which I considered both error types is right.  I would appreciate a second opinion on them:

 

Assuming that I use the divide down method for frequency estimation:

 

Clock freq         10,000,000.0000    Hz    

Signal freq         100,000 Hz

Frequency divider 10000 

 

After dividing down the signal's frequency with a 75ppb stability clock:

 

Divided down signal freq    10    Hz    (signal freq / freq divider)
Max divided down freq    10.00000075    Hz    (divided down signal + (stability * divided down signal))
Min divided down freq    9.99999925    Hz    (divided down signal - (stability * divided down signal))

 

Now if we coun this signal with its fluctuations, we get this oscillation in the counts:

 

Max count for signal    1000000    count    (max oscilat freq / min divided freq)
Min count for signal    999999    count    (min oscilat freq / max divided freq)

If we process these count numbers:

 

Max estimated freq    100000.1075    Hz    (max oscillat freq / min count * divider )
Min estimated freq    99999.9925    Hz    (min oscillat freq / max count * divider )

 

Therefore:

 

Absolute error    0.107500107    Hz    maximum of the errors of both estimations
Max measurement time    0.1    s    frequency divider / signal frequency

 

Which would be fine, slightly in the limit, but fine. For a 1Khz signal, same calculations would perform better, but require  10seconds measurement. For this reason the frequency divider value could be reduced without compromising the accuracy.

 

I hope my calculations are clear enough that somebody can oversee them!

 

Thanks  in advance

0 Kudos
Message 14 of 16
(1,757 Views)

Hi,

 

I have done the calculations by myself and I have come to the same results and to the same conclusion. With a 6608 the base clock accuracy is much better than the error introduced by the fluctuations. With a 6602 it would be the other way round, so the 6608 should be a solution for your application.

 

Kind regards,

Jochen

0 Kudos
Message 15 of 16
(1,737 Views)

Thanks Jochen

 

I may also do some simulations before freezing the design.

 

If I find something contradictory I will let you know.

 

Cheers

0 Kudos
Message 16 of 16
(1,730 Views)