Realization of Equal Precision Frequency Meter

Publisher:EnchantingEyesLatest update time:2011-07-05 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Frequency measurement is often used in the field of electronic design and measurement, so the study of frequency measurement methods is of great significance in practical engineering applications. There are two commonly used frequency measurement methods: frequency measurement method and period measurement method. The frequency measurement method counts the number of pulses N of the measured signal within the time t, and then calculates the number of pulses per unit time, which is the frequency of the measured signal. The period measurement method first measures the period T of the measured signal, and then calculates the frequency of the measured signal according to the frequency f=1/T. However, both of the above methods will produce an error of ±1 measured pulse, which has certain limitations in practical applications. According to the measurement principle, it is easy to find that the frequency measurement method is suitable for high-frequency signal measurement, and the period measurement method is suitable for low-frequency signal measurement, but neither of them can take into account the measurement requirements of high and low frequencies with the same accuracy.

1 Principle of equal-precision measurement
One of the biggest features of equal-precision measurement is that the actual gate time of the measurement is not a fixed value, but a value related to the measured signal, which is exactly an integer multiple of the measured signal. Within the counting allowed time, the standard signal and the measured signal are counted at the same time, and then the frequency of the measured signal is derived by mathematical formula. Since the gate signal is an integer multiple of the measured signal, the ±1 cycle error of the measured signal is eliminated, but an ±1 cycle error of the standard signal is generated. The equal precision measurement principle is shown in Figure 1.


From the measurement principle of equal precision described above, we can easily draw the following conclusions: First, the relative error of the measured signal frequency fx is independent of the frequency of the measured signal; second, increasing the measurement time period "software gate" or increasing the "standard frequency" f0 can reduce the relative error and improve the measurement accuracy; finally, since the quartz crystal oscillator that generally provides the standard frequency f0 has high stability, the relative error of the standard signal is very small and can be ignored. Assuming that the frequency of the standard signal is 100 MHz, as long as the actual gate time is greater than or equal to 1s, the maximum relative error of the measurement can be less than or equal to 10-8, that is, the accuracy reaches 1/100 MHz.

2 Implementation of equal precision frequency measurement
The core idea of ​​equal precision measurement is how to ensure that the measured signal is an integer number of cycles within the actual measurement gate, which requires that a certain relationship be established between the actual measurement gate signal and the measured signal in the design. Based on this idea, the rising edge of the measured signal is used as the driving signal for opening and closing the gate in the design. Only at the rising edge of the measured signal is the state of the preset "software gate" in Figure 1 latched. Therefore, the number of measured signals in the "actual gate" Tx can ensure an integer number of cycles, thus avoiding the ±1 error of the measured signal in the ordinary measurement method
. However, it will produce a ±1 cycle error of the high-frequency standard frequency signal. Since the frequency of the standard frequency f0 is much higher than the measured signal, the ±1 cycle error it produces has a very limited impact on the measurement accuracy, especially in the case of medium and low frequency measurements. Compared with the traditional frequency measurement and period measurement methods, it can greatly improve the measurement accuracy.

[page]

The principle diagram of equal-precision frequency measurement is shown in Figure 2. In the figure, the preset software gate signal GATE is generated by the timing module of the FPGA. The time width of GATE has little effect on the frequency measurement accuracy, so it can be selected within a larger range. Here, the length of the preset gate signal is selected to be 1s. CNT1 and CNT2 in the figure are two controllable 32-bit high-speed counters. CNT1_ENA and CNT2_ENA are their count enable terminals, respectively. The reference frequency signal f0 is input from CNT1_CLK, and the signal to be measured fx is input from the clock input terminal CONT2_CLK of CNT2, and fx is connected to the clk terminal of the D flip-flop. During measurement, the preset GATE signal is generated by the timing module of the FPGA. When GATE is high and at the rising edge of fx, the two counters are started to count the measured signal and the reference signal respectively. To close the counting gate, GATE must be low and at the rising edge of fx. If in an actual gate time Tx, the counter counts Nx for the measured signal and N0 for the standard signal, and the frequency of the standard signal is f0, then the frequency of the measured signal is fx, and fx = (N0/Ns)f0. All functions in Figure 2 are implemented on the FPGA side.


The unit shown in Figure 2 completes the core part of equal-precision frequency measurement. In practical applications, the measurement results need to be displayed on a display device most of the time. As can be seen from Figure 2, this design latches the counting results and some control signals due to the design of the latch unit, which is convenient for connecting to a single-chip microcomputer or other single-chip microcomputers (MCU). Therefore, the MCU is connected on the basis of the core unit implemented by the FPGA, which makes it easy to realize the conversion between the count value to the actual frequency value and the corresponding period value, and the display device is controlled by the MCU to display the final result information that needs to be displayed. The block diagram of the FPGA device and the single-chip microcomputer hardware interface circuit is shown in Figure 3. The equal-precision frequency measurement module and latch module in Figure 3 are both implemented by Altera's FPGA device EP1C3T100C6. The output result of the equal-precision counting module is 2 32-bit data. In order to facilitate the connection with the single-chip microcomputer, the 2 32-bit data are latched and output by the latch inside the FPGA device 8 times. The single-chip microcomputer reads 8 bits each time and reads 8 times continuously. The count values ​​of Nx and N0 read are converted into actual frequency values ​​by the single-chip microcomputer according to the equal-precision frequency calculation formula, and finally displayed by DM12864.

3 Error analysis of measurement results
A high-precision signal source is used to output sine wave signals of different frequencies. After the signal conditioning circuit, the shaped square wave signal is provided to the FPGA for counting measurement. The measurement result is compared with the frequency output by the high-precision signal source to calculate its error, as shown in Table 1.


Table 1 gives the measurement results and errors of various frequencies. The results show that the measurement error of this design in the full range of 1Hz to 20MHz is less than 2×10-6. From Figure 4, it can be seen that the error distribution of the measurement results is around the same order of magnitude, achieving the purpose of equal-precision measurement. In actual tests, it was found that if the frequency of the system crystal oscillator is increased or the accuracy level of the crystal oscillator is increased, the error of frequency measurement will be further reduced.



4 Conclusion
The principle of equal-precision measurement is introduced in detail, and the method of implementing the idea of ​​equal-precision measurement on FPGA is given. The test results show that the error of this equal-precision measurement scheme is very small and the error is constant within the measurement range. This design scheme has a certain reference for the design of measurement frequency implementation.

Reference address:Realization of Equal Precision Frequency Meter

Previous article:Design and maintenance of vector network analyzer test system
Next article:Working Principle and Application of Transient Current Detector

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号