A Frequency Measurement and Error Compensation Method and System Based on a Step Gate Circuit
Through the frequency measurement method based on the step gate circuit, transformers and operational amplifiers are used to shape the signals and remove the influence of harmonic signals, high-precision and wide range of frequency measurements are achieved, and the problem of insufficient accuracy in low-frequency and variable frequency measurements is solved.
Patent Information
- Application Number
- CN202211661928.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2042-12-23
AI Technical Summary
The prior art is difficult to achieve high frequency measurement accuracy in low-frequency and variable frequency measurements. The traditional method has large measurement errors, especially in electrical measurements of power frequency, which requires exponential growth time when the accuracy reaches 0.1 level, and it is almost impossible to achieve high frequency measurement accuracy in low-frequency and variable frequency measurements.
The frequency measurement method based on the step gate circuit is adopted, and the measured signal is converted into an effective signal through the transformer. The operational amplifier shapes it into a square wave signal in the same frequency. By setting the step threshold voltage, the harmonic signal is eliminated, and the reference crystal oscillator square wave rising edge or the rising edge of the square wave signal in the same frequency is counted to achieve frequency measurement.
It improves the accuracy of frequency measurement, reduces the impact of harmonic signals on fundamental signal frequency measurement, realizes high-precision and wide range of frequency measurements, and can reach 10-7 levels, which is suitable for fast measurement of low-frequency and high-frequency signals.
Smart Images

Figure CN115877075B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of frequency measurement, and particularly relates to a frequency measurement and error compensation method and system based on a step gate circuit. Background Art
[0002] In the prior art, traditional frequency measurement generally measures by counting the number of rising edges (or falling edges) of the measured signal within a unit time or counting the number of rising edges (or falling edges) of the specified measured signal and then timing. The above methods first convert the measured signal into a same-frequency wave of about 5V, and then convert it into a same-frequency square wave through the threshold circuit of the operational amplifier; when measuring the frequency by counting the number of rising edges within a unit time, the frequency calculation formula is as follows: f = (n - 1) / t, where n is the number of rising edges within a unit time, and t is the unit time. If timing starts just after the rising edge of the measured signal, the maximum difference in the number of counted frequencies within the specified time is one, and the measurement error is r = 1 / (n - 1).
[0003] Taking the power frequency electricity as an example, to make the measurement accuracy reach 0.1 level, the counted frequency number should be at least 1001, that is, the frequency can be measured once every 20s. Considering the influence of harmonics and other factors, the measurement time will increase exponentially and it is difficult to meet the requirements. Especially in low-frequency and variable-frequency measurements, it is almost impossible to obtain high-frequency measurement accuracy.
[0004] Therefore, it is very necessary to invent a frequency measurement and error compensation method and system based on a step gate circuit to solve the above problems. Summary of the Invention
[0005] In view of the above problems, the present invention provides a frequency measurement and error compensation method and system based on a step gate circuit to solve the problems proposed in the above background art.
[0006] To achieve the above object, the present invention provides the following technical solution: A frequency measurement and error compensation method based on a step gate circuit, comprising the following steps:
[0007] Collect the measured signal of the step gate circuit;
[0008] Convert the collected measured signal into an effective signal through a transformer, and shape the effective signal into a same-frequency square wave signal through the step threshold voltage of the operational amplifier;
[0009] Compare the frequency of the effective signal with the crystal oscillator frequency of the frequency counter;
[0010] When the frequency of the same-frequency square-wave signal is greater than or equal to twice the frequency of the reference crystal oscillator, counting starts with the rising edge of the reference crystal oscillator's square wave, that is, detecting the first rising edge of the square wave generated by the reference crystal oscillator, synchronously counting the same-frequency square-wave signal and the reference crystal oscillator signal. When the number of counts of the rising edge of the square wave generated by the reference crystal oscillator reaches the preset number, the same-frequency square-wave signal and the reference crystal oscillator signal stop counting synchronously, that is, measuring the frequency of the effective signal by the rising-edge reference counting method of the crystal oscillator square wave.
[0011] When the frequency of the same-frequency square-wave signal is less than twice the frequency of the crystal oscillator, counting starts with the rising edge of the same-frequency square-wave signal, that is, detecting the first rising edge of the same-frequency square-wave signal, synchronously counting the same-frequency square-wave signal and the reference crystal oscillator signal. When the number of counts of the rising edge of the same-frequency square-wave signal reaches the preset number, the same-frequency square-wave signal and the reference crystal oscillator signal stop counting synchronously, that is, measuring the frequency of the effective signal by the rising-edge reference counting method of the same-frequency square-wave signal.
[0012] Further, the shaping of the effective frequency into a same-frequency square-wave signal by the operational amplifier step threshold voltage includes:
[0013] The effective signal includes a fundamental wave signal and a harmonic wave signal;
[0014] The influence of the harmonic wave signal is eliminated by setting the step threshold voltage, and the setting method is as follows:
[0015] When the voltage of the effective signal is greater than or equal to the upper threshold voltage, the operational amplifier generates a rising edge and outputs a high level;
[0016] When the voltage of the effective signal is greater than the lower threshold voltage and less than the upper threshold voltage, the original level state remains unchanged;
[0017] When the voltage of the effective signal is less than or equal to the lower threshold voltage, the operational amplifier generates a falling edge and outputs a low level.
[0018] Further, the setting of the threshold voltage includes:
[0019] Collecting the effective value U of the signal voltage of the fundamental wave signal through the voltage signal acquisition unit 有效 , and the amplitude of the upper threshold voltage is between kU 有效 and U 有效 and the amplitude of the lower threshold voltage is between -U 有效 and -kU 有效 where the value of k is between 0 and 1 and can be set as needed or adaptively determined by the frequency measurement system.
[0020] Further, the measurement of the frequency of the effective signal by the rising-edge reference counting method of the crystal oscillator square wave includes:
[0021] After the system starts up and stabilizes, set the detection duration. The system automatically makes a preliminary comparison between the reference crystal oscillator frequency and the frequency of the square wave of the signal under test. If the frequency of the square wave of the signal under test is greater than or equal to twice the reference crystal oscillator frequency, the system automatically calculates the number of rising edges n of the reference crystal oscillator output. 0 When the first rising edge of the reference crystal oscillator square wave is detected, the counter starts, and begins to synchronously count the number of rising edges of the square wave signal of the signal under test and the reference crystal oscillator signal.
[0022] When the reference crystal oscillator frequency reaches the n 0 th rising edge, the synchronous counting of the square wave signal of the signal under test and the reference crystal oscillator signal stops.
[0023] If the number of reference crystal oscillator square waves measured by counter 1 is n 0 , the number of rising edges of the square wave of the signal under test measured by counter 2 is n x , the crystal oscillator frequency is f 0 , then the effective signal frequency is f x :
[0024] f x = f 0 *(n 0-1 ) / (n x -1), where the measurement error is r = 1 / (n x -1).
[0025] Furthermore, the method for measuring the effective signal frequency by using the rising edge reference counting method of the square wave signal of the signal under test includes:
[0026] After the system starts up and stabilizes, set the detection duration. The system automatically makes a preliminary comparison between the reference crystal oscillator frequency and the frequency of the square wave of the signal under test. If the frequency of the square wave of the signal under test is less than twice the reference crystal oscillator frequency, the system preliminarily calculates the number of rising edges N of the square wave output of the signal under test. When the first rising edge of the square wave of the signal under test is detected, the counter starts, and begins to synchronously count the number of rising edges of the square wave signal of the signal under test and the reference crystal oscillator signal.
[0027] When the Nth rising edge of the square wave signal of the signal under test is detected, the synchronous counting of the square wave signal of the signal under test and the reference crystal oscillator signal stops.
[0028] If the number of reference crystal oscillator square waves measured by counter 1 is n, the number of rising edges of the square wave of the signal under test measured by counter 2 is N, and the crystal oscillator frequency is f 1 , then the effective signal frequency is f;
[0029] f = f 1 *(n - 1) / (N - 1), where the measurement error is R = 1 / (n - 1).
[0030] The present invention also provides a frequency measurement and error compensation system based on a step gate circuit.
[0031] It includes a collection unit, a conversion unit, and a comparison unit;
[0032] The collection unit is used to collect the signal to be measured of the step gate circuit;
[0033] The conversion unit is used to convert the collected signal to be measured into an effective signal through a mutual inductor, and shape the effective signal into a square wave signal with the same frequency through the step threshold voltage of an operational amplifier;
[0034] The comparison unit compares the frequency of the effective signal with the crystal oscillator frequency of the frequency meter;
[0035] When the frequency of the effective signal is greater than or equal to twice the crystal oscillator frequency, the frequency of the effective signal is measured by the rising edge reference counting method of the crystal oscillator square wave;
[0036] When the frequency of the effective signal is less than twice the crystal oscillator frequency, the frequency of the effective signal is measured by the rising edge reference counting method of the square wave signal with the same frequency.
[0037] Furthermore, the conversion unit includes a filtering unit, and the effective signal includes a fundamental wave signal and a harmonic wave signal;
[0038] The filtering unit is used to eliminate the influence of the harmonic wave signal by setting the step threshold voltage. The setting method is as follows:
[0039] When the voltage of the effective signal is greater than or equal to the upper threshold voltage, the operational amplifier generates a rising edge and outputs a high level;
[0040] When the voltage of the effective signal is greater than the lower threshold voltage and less than the upper threshold voltage, the original level state remains unchanged;
[0041] When the voltage of the effective signal is less than or equal to the lower threshold voltage, the operational amplifier generates a falling edge and outputs a low level.
[0042] The technical effects and advantages of the present invention:
[0043] 1. By setting the step threshold voltage, the signal to be measured is converted into a measurable effective signal through the mutual inductor according to a certain ratio. The operational amplifier shapes the fundamental wave of the effective signal into a square wave signal with the same frequency with reference to the step threshold voltage. The frequency of the square wave signal is compared with the reference crystal oscillator frequency to determine the frequency measurement method. By setting the step threshold voltage, the harmonic wave signal in the signal to be measured is completely filtered out after being converted by the operational amplifier. The fundamental wave signal is converted into a rectangular wave signal with the same frequency, thereby eliminating the zero drift or multiple zero crossings caused by the harmonic wave signal on the fundamental wave signal, and then completely eliminating the influence of the harmonic wave signal on the frequency measurement of the fundamental wave signal, reducing the frequency measurement error of the fundamental wave signal, and increasing the accuracy of the frequency measurement of the step gate circuit.
[0044] 2. The present invention makes some improvements to the traditional frequency measurement method in principle, adopts an adaptive frequency division method, and improves the system reliability; the measurement accuracy can reach 10 -7 levels. If the test interval is extended, the measurement accuracy can be further improved, realizing high-precision and wide-range measurement.
[0045] Other features and advantages of the present invention will be described in the subsequent specification, and in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained by the structures pointed out in the specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0047] Figure 1 Shows a schematic flow chart of frequency measurement and error compensation based on a step gate circuit according to an embodiment of the present invention;
[0048] Figure 2 Shows a schematic diagram of measuring the frequency of an effective signal by the rising edge reference counting method of a same-frequency square wave signal according to an embodiment of the present invention;
[0049] Figure 3 Shows a schematic diagram of zero drift affected by harmonics according to an embodiment of the present invention;
[0050] Figure 4 Shows a schematic diagram of multiple zero crossings affected by harmonics according to an embodiment of the present invention;
[0051] Figure 5 Shows a schematic diagram of eliminating the influence of harmonics on the threshold voltage according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0053] The present invention provides a frequency measurement and error compensation method based on a step gate circuit, as Figures 1-5As shown, it includes the following steps:
[0054] Step 1: Collect the measured signal of the step gate circuit.
[0055] When collecting the measured signal, according to the requirements of frequency measurement, it is necessary to intercept sections with different cycle lengths. Different frequency measurement methods require different cycles of the measured signal, so that the collected measured signal is applicable to different frequency measurement methods.
[0056] Step 2: Convert the collected measured signal into an effective signal through a mutual inductor, and shape the effective signal into a square wave signal with the same frequency through the step threshold voltage of the operational amplifier.
[0057] In the embodiment of the present invention, taking the mutual inductor converting the collected measured signal into a same-type and same-frequency wave with an effective value of about 5V as an example for illustrative explanation.
[0058] The operational amplifier shaping the effective frequency into a square wave signal with the same frequency includes:
[0059] The effective signal includes a fundamental wave signal and a harmonic signal. In Figure 3 , the fundamental wave signal is set as a sine wave u = 5sinωt, and the harmonic signal is set as a sine wave u = 5sinωt + 2sin(3ωt + 0.6π). In Figure 4 , the fundamental wave signal is set as a sine wave u = 5sinωt, and the harmonic signal is set as a sine wave u = 5sinωt + 2sin(3ωt + 0.9π) + sin(5ωt + 1.1π), (where ω is the angular velocity, t is the time, and π is the pi). According to Figure 3 and Figure 4 it can be known that taking the 3rd and 5th harmonics as examples, the influence of different degrees of 3rd and 5th other harmonics in the figure is that the zero-crossing point shifts or there is a secondary zero-crossing, which has a certain influence on the measurement of frequency accuracy.
[0060] Among them, due to multiple zero-crossings within one cycle, the frequency measurement of the effective signal will be greater than the fundamental wave signal frequency. Therefore, to accurately measure the fundamental wave signal frequency, the influence of the harmonic signal frequency must be eliminated.
[0061] As Figure 5 shown, the influence of the harmonic signal is eliminated by setting the threshold voltage. The setting method is as follows:
[0062] When the voltage of the effective signal is greater than or equal to the upper threshold voltage, the operational amplifier generates a rising edge and outputs a high level;
[0063] When the voltage of the effective signal is greater than the lower threshold voltage and less than the upper threshold voltage, the original level state remains unchanged;
[0064] When the voltage of the valid signal is less than or equal to the lower threshold voltage, the operational amplifier generates a falling edge and outputs a low level.
[0065] Set the threshold voltage to 2 and -2. The operational amplifier converts the sine wave into a rectangular wave according to the threshold voltage. Although the sine wave of the harmonic has zero drift, the frequency of the rectangular wave converted from the harmonic is the same as that of the sine wave, which has no effect on the measured frequency and can effectively eliminate the influence of the harmonic signal frequency on the measurement.
[0066] The setting of the threshold voltage includes:
[0067] Collect the effective value U of the signal voltage of the fundamental wave signal through the voltage signal acquisition unit 有效 , and the amplitude of the upper threshold voltage is between kU 有效 and U 有效 ; the amplitude of the lower threshold voltage is between -U 有效 and -kU 有效 , where the value of k is between 0 and 1 and can be set as needed or adaptively determined by the frequency measurement system. Since the amplitude, frequency, and harmonic components of the measured signal are unknown, collect the effective value U of the voltage of the measured frequency signal through the voltage signal acquisition unit 有效 , and perform adaptive setting. The threshold voltages u 1 and -u 1 , and the amplitude of the threshold voltage is between 0 and U 有效 , and automatically jumps to find the minimum frequency of the measured signal and output it as the measured signal frequency. Exemplarily, considering the wide application of the frequency meter, the threshold voltages u 1 and -u 1 can also be input through the keyboard, and the amplitude range of the threshold voltage is a multiple of the effective value of the measured signal or the amplitude is directly input.
[0068] Step 3: Compare the frequency of the valid signal with the crystal oscillator frequency of the frequency meter. Exemplarily, the crystal oscillator frequency is greatly affected by the external temperature. To avoid the influence of the change in the frequency of the crystal oscillator itself on the frequency measurement, this design uses a high-precision temperature-compensated crystal oscillator. The capacitors used in the external circuit of the crystal oscillator are high-stability ceramic capacitors. Considering the external circuit comprehensively, the frequency is effectively compensated from the software. In high-precision measurement, the radioactive period of radioactive elements is used as the reference, and the reference frequency is provided for the frequency meter through the hardware frequency division circuit.
[0069] If the frequency of the valid signal is greater than or equal to twice the crystal oscillator frequency, measure the frequency of the valid signal by the crystal oscillator square wave rising edge reference counting method;
[0070] The method of measuring the frequency of the valid signal by the crystal oscillator square wave rising edge reference counting method includes:
[0071] After the system starts up and stabilizes, set the detection duration. The system automatically makes a preliminary comparison between the reference crystal oscillator frequency and the frequency of the square wave of the signal under test. If the frequency of the square wave of the same frequency is greater than or equal to twice the reference crystal oscillator frequency, the system automatically calculates the number n of rising edges output by the reference crystal oscillator. 0 When the first rising edge of the reference crystal oscillator square wave is detected, the counter starts, and begins to synchronously count the number of rising edges of the square wave signal of the same frequency and the reference crystal oscillator signal.
[0072] When the reference crystal oscillator frequency reaches the n 0 th rising edge, the synchronous counting of the square wave signal of the same frequency and the reference crystal oscillator signal stops.
[0073] If the number of reference crystal oscillator square waves counted by counter 1 is n 0 , the number of rising edges of the square wave of the same frequency counted by counter 2 is n x , the crystal oscillator frequency is f 0 , then the effective signal frequency is f x :
[0074] f x = f 0 *(n 0-1 ) / (n x -1), where the measurement error is r = 1 / (n x -1).
[0075] If the frequency of the square wave signal of the same frequency is less than twice the crystal oscillator frequency, start counting with the rising edge of the square wave signal of the same frequency as the reference.
[0076] The method for measuring the frequency of the effective signal by using the rising edge of the square wave signal of the same frequency as the reference for counting includes:
[0077] After the system starts up and stabilizes, set the detection duration. The system automatically makes a preliminary comparison between the reference crystal oscillator frequency and the frequency of the square wave of the signal under test. If the frequency of the square wave of the same frequency is less than twice the reference crystal oscillator frequency, the system preliminarily calculates the number N of rising edges output by the square wave of the same frequency. When the first rising edge of the square wave of the same frequency is detected, the counter starts, and begins to synchronously count the number of rising edges of the square wave signal of the same frequency and the reference crystal oscillator signal.
[0078] When the Nth rising edge of the square wave signal of the same frequency is detected, the synchronous counting of the square wave signal of the same frequency and the reference crystal oscillator signal stops.
[0079] If the number of reference crystal oscillator square waves counted by counter 1 is n, the number of rising edges of the square wave of the same frequency counted by counter 2 is N, and the crystal oscillator frequency is f 1 , then the effective signal frequency is f;
[0080] f = f 1 *(n - 1) / (N - 1), where the measurement error is R = 1 / (n - 1).
[0081] The counting frequency of a general counter is 10 7 orders of magnitude. Therefore, for measuring the frequency of power frequency voltage, the measurement accuracy can reach 10 -5 orders of magnitude as long as it is measured within one power frequency cycle. Thus, the measurement of the frequency of low-frequency signals has the characteristics of high speed and high accuracy. However, there are a large number of harmonics in the power system or other frequency measurement systems, resulting in multiple rising edges of the measured fundamental wave within one fundamental wave cycle, causing the measurement result to be distorted or incorrect. In the embodiments of the present invention, by setting the step threshold voltage, after the harmonic signal is converted by the operational amplifier, the rectangular wave frequency of the harmonic signal is the same as that of the fundamental wave signal, thereby eliminating the influence of zero drift and secondary zero crossing in the harmonic signal on the fundamental wave signal, completely eliminating the influence of the harmonic signal on the fundamental wave signal, reducing the frequency measurement error of the fundamental wave signal, and increasing the frequency measurement accuracy of the step gate circuit. The method for measuring frequency in the embodiments of the present invention can effectively eliminate the influence of harmonics, improve the measurement accuracy of frequency by one order of magnitude, and double the measurement speed. This measurement method is not only applicable to the measurement of ordinary power frequency, but also applicable to the measurement of high-frequency circuits, providing a theoretical basis for the rapid measurement of low frequencies.
[0082] Although the assembly programming instruction code is short and the execution time can be completed within 10 -7 time, improper software processing will bring certain errors to the frequency of the measured signal. To avoid the additional errors caused by software execution, generally, the starting instruction length and the ending instruction length are exactly equal during software programming. When the external hardware counter counts, considering the influence of the hardware response time, compensation is made from the software.
[0083] The present invention also provides a frequency measurement and error compensation system based on a step gate circuit,
[0084] including a collection unit, a conversion unit, and a comparison unit;
[0085] The collection unit is used to collect the measured signal of the step gate circuit;
[0086] The conversion unit is used to convert the collected measured signal into an effective signal through a mutual inductor, and shape the effective signal into a square wave signal with the same frequency through the step threshold voltage of the operational amplifier;
[0087] The comparison unit compares the frequency of the effective signal with the crystal oscillator frequency of the frequency meter; if the frequency of the effective signal is greater than or equal to 2 times the crystal oscillator frequency, the frequency of the effective signal is measured by the crystal oscillator square wave rising edge reference counting method; if the frequency of the square wave signal with the same frequency is less than 2 times the crystal oscillator frequency, counting starts with the rising edge of the square wave signal with the same frequency as the reference.
[0088] The conversion unit includes a filtering unit, and the effective signal includes a fundamental wave signal and a harmonic signal;
[0089] The filtering unit is used to eliminate the influence of harmonic signals by setting a step threshold voltage. The setting method is as follows: when the voltage of the valid signal is greater than or equal to the upper threshold voltage, the operational amplifier generates a rising edge and outputs a high level; when the voltage of the valid signal is greater than the lower threshold voltage and less than the upper threshold voltage, the original level state remains unchanged; when the voltage of the valid signal is less than or equal to the lower threshold voltage, the operational amplifier generates a falling edge and outputs a low level.
[0090] The embodiment of the present invention makes some improvements to the traditional frequency measurement method in principle. By adopting an adaptive frequency division method, the reliability of the system is improved; the measurement accuracy can reach 10 -7 orders of magnitude, realizing high-precision and wide-range measurement.
[0091] Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A frequency measurement and error compensation method based on a step gate circuit, characterized in that: It includes the following steps: Collect the signal to be measured of the step gate circuit; Convert the collected signal to be measured into an effective signal through a mutual inductor, and the effective signal is shaped into a square wave signal of the same frequency through the step threshold voltage of an operational amplifier; Compare the frequency of the effective signal with the crystal oscillator frequency of the frequency meter; When the frequency of the square wave signal of the same frequency is greater than or equal to 2 times the reference crystal oscillator frequency, start counting with the rising edge of the reference crystal oscillator square wave, that is, detect the first rising edge of the square wave generated by the reference crystal oscillator, synchronously count the square wave signal of the same frequency and the reference crystal oscillator signal, and when the counting number of the rising edge of the square wave generated by the reference crystal oscillator reaches the preset number, the square wave signal of the same frequency and the reference crystal oscillator signal stop counting synchronously, that is, measure the frequency of the effective signal by the rising edge reference counting method of the crystal oscillator square wave; When the frequency of the square wave signal of the same frequency is less than 2 times the crystal oscillator frequency, start counting with the rising edge of the square wave signal of the same frequency, that is, detect the first rising edge of the square wave signal of the same frequency, and synchronously count the square wave signal of the same frequency and the reference crystal oscillator signal; When the counting number of the rising edge of the square wave signal of the same frequency reaches the preset number, the square wave signal of the same frequency and the reference crystal oscillator signal stop counting synchronously, that is, measure the frequency of the effective signal by the rising edge reference counting method of the square wave signal of the same frequency; The measurement of the frequency of the effective signal by the rising edge reference counting method of the crystal oscillator square wave includes: After the system starts up and stabilizes, set the detection duration. The system automatically makes a preliminary comparison between the frequency of the reference crystal oscillator and the frequency of the square wave of the signal under test. If the frequency of the square wave of the same frequency is greater than or equal to twice the frequency of the reference crystal oscillator, the system automatically calculates the number n of rising edges output by the reference crystal oscillator. 0 When the first rising edge of the square wave of the reference crystal oscillator is detected, the counter starts, and begins to synchronously count the number of rising edges of the square wave signal of the same frequency and the reference crystal oscillator signal; When the nth 0 rising edge of the reference crystal oscillator frequency occurs, the same-frequency square wave signal and the reference crystal oscillator signal stop counting synchronously; If the number of reference crystal oscillator square waves measured by counter 1 is n 0 , and the number of rising edges of the square wave with the same frequency measured by counter 2 is n x , the crystal oscillator frequency is f 0 , then the effective signal frequency is f x : f x = f 0 * (n 0-1 ) / (n x - 1), where the measurement error is r = 1 / (n x - 1); The measurement of the frequency of the effective signal by the rising edge reference counting method of the square wave signal of the same frequency includes: After the system starts and stabilizes, set the detection duration, and the system automatically preliminarily compares the reference crystal oscillator frequency with the square wave frequency of the signal to be measured of the same frequency. If the square wave frequency of the same frequency is less than 2 times the reference crystal oscillator frequency, the system preliminarily calculates the number N of rising edges of the square wave output of the same frequency. When the first rising edge of the square wave of the same frequency is detected, the counter starts, and starts to synchronously count the number of rising edges of the square wave signal of the same frequency and the reference crystal oscillator signal; When the Nth rising edge of the square wave signal of the same frequency is detected, the square wave signal of the same frequency and the reference crystal oscillator signal stop counting synchronously; If the number of reference crystal oscillator square waves measured by counter 1 is n, the number of rising edges of the square wave with the same frequency measured by counter 2 is N, and the crystal oscillator frequency is f 1 , then the effective signal frequency is f; f=f 1 *(n - 1) / (N - 1), where the measurement error is R = 1 / (n - 1).
2. A frequency measurement and error compensation method based on a step gate circuit according to claim 1, characterized in that: The shaping of the effective frequency into a square wave signal of the same frequency by the operational amplifier through the step threshold voltage includes: The effective signal includes a fundamental wave signal and a harmonic wave signal; Eliminate the influence of the harmonic wave signal by setting the threshold voltage, and the setting method is as follows: When the voltage of the effective signal is greater than or equal to the upper threshold voltage, the operational amplifier generates a rising edge and outputs a high level; When the voltage of the effective signal is greater than the lower threshold voltage and less than the upper threshold voltage, keep the original level state unchanged; When the voltage of the effective signal is less than or equal to the lower threshold voltage, the operational amplifier generates a falling edge and outputs a low level.
3. A frequency measurement and error compensation method based on a step gate circuit according to claim 2, characterized in that: The setting of the threshold voltage includes: The effective value U of the signal voltage of the fundamental wave signal is collected by the voltage signal acquisition unit 有效 , and the amplitude of the upper threshold voltage is between kU 有效 and U 有效 , and the amplitude of the lower threshold voltage is between -U 有效 and -kU 有效 , where the value of k is between 0 and 1 and can be set as needed or adaptively determined by the frequency measurement system.
4. A frequency measurement and error compensation system based on a step gate circuit, used to implement a frequency measurement and error compensation method based on a step gate circuit according to claim 1, characterized in that: It includes a collection unit, a conversion unit and a comparison unit; The collecting unit is used to collect the signal to be measured of the step gate circuit; The converting unit is used to convert the collected signal to be measured into an effective signal through a mutual inductor, and shape the effective signal into a square wave signal with the same frequency through the step threshold voltage of an operational amplifier; The comparing unit is used to compare the frequency of the effective signal with the crystal oscillator frequency of the frequency meter; When the frequency of the effective signal is greater than or equal to twice the crystal oscillator frequency, the frequency of the effective signal is measured by the rising edge reference counting method of the crystal oscillator square wave; When the frequency of the effective signal is less than twice the crystal oscillator frequency, the frequency of the effective signal is measured by the rising edge reference counting method of the square wave signal with the same frequency.
5. A frequency measurement and error compensation system based on a step gate circuit according to claim 4, characterized in that: The converting unit includes a filtering unit, and the effective signal includes a fundamental wave signal and a harmonic wave signal; The filtering unit is used to eliminate the influence of the harmonic wave signal by setting the threshold voltage, and the setting method is as follows: When the voltage of the effective signal is greater than or equal to the upper threshold voltage, the operational amplifier generates a rising edge and outputs a high level; When the voltage of the effective signal is greater than the lower threshold voltage and less than the upper threshold voltage, the original level state remains unchanged; When the voltage of the effective signal is less than or equal to the lower threshold voltage, the operational amplifier generates a falling edge and outputs a low level.
Citation Information
Patent Citations
Frequency measuring method and frequency measuring circuit
CN109669070A
High-speed stable broadband frequency counting method and system and storage medium
CN112946771A