Zero-crossing comparison circuit for frequency measurement
By using a differential in-phase amplifier circuit and a comparator circuit, the problems of noise interference and low accuracy in frequency measurement are solved, and high-precision, low-resource-consumption frequency measurement is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- QINGDAO RUIJIE INTELLIGENT EQUIP CO LTD
- Filing Date
- 2025-08-04
- Publication Date
- 2026-07-07
AI Technical Summary
Existing technologies suffer from problems in frequency measurement, such as noise interference leading to false triggering, low frequency measurement accuracy, high microcontroller resource consumption, and computational delay.
By employing a differential in-phase amplifier circuit, a comparator circuit, and a voltage follower circuit, noise is suppressed by setting a small voltage window, ensuring the accuracy of zero-crossing detection, and converting slowly changing zero-crossing points into steep voltage jumps, the software design of the microcontroller is simplified.
It improves the accuracy and anti-interference capability of zero-crossing detection, reduces measurement jitter, improves frequency measurement accuracy, and reduces the resource consumption and computing requirements of the microcontroller.
Smart Images

Figure CN224471755U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of frequency measurement technology, and more specifically, to a zero-crossing comparison circuit for frequency measurement. Background Technology
[0002] like Figure 5 As shown, the frequency measurement of AC voltage is mainly achieved through zero-point identification technology. However, the implementation logic of this technology mostly involves inputting AC power into a voltage and current sampling circuit, passing it through an operational amplifier circuit, and then feeding it into a microcontroller. The software program then identifies the number of zero points in the AC power to calculate its frequency. However, this method still has the following drawbacks:
[0003] First, AC voltage signals are usually not perfect sine waves and may contain noise, harmonic distortion, or glitches. When the signal amplitude is close to 0V, these interferences can cause the microcontroller to trigger falsely multiple times near the zero point or fail to accurately determine the true zero-crossing moment.
[0004] Secondly, the slope (dV / dt) of an analog signal near the zero crossing point may not be steep enough (especially at low frequencies or when the signal is distorted). The microcontroller needs to set a threshold voltage to determine the zero crossing, which inherently introduces errors. Furthermore, when the signal changes slowly, there will be significant jitter in the judgment time, resulting in low frequency measurement accuracy.
[0005] Furthermore, continuously performing high-precision ADC sampling via a microcontroller and then running algorithms (such as finding changes in the sign of the sampling points) to determine the zero-crossing point not only consumes a lot of CPU resources and power, but also introduces inherent delays in the calculation due to the need to collect sampling points, thereby reducing efficiency.
[0006] No effective solutions have yet been proposed to address the problems in the relevant technologies. Utility Model Content
[0007] In view of the problems in the related technologies, this utility model proposes a zero-crossing comparison circuit for frequency measurement to overcome the above-mentioned technical problems existing in the existing related technologies.
[0008] Therefore, the specific technical solution adopted by this utility model is as follows:
[0009] A zero-crossing comparator circuit for frequency measurement, the circuit comprising:
[0010] Differential in-phase amplifier circuit used to amplify the amplitude of the sampled signal after voltage division;
[0011] A comparison circuit used to compare the sampled signal after amplitude amplification with a reference signal and output high and low level logic signals based on the comparison result;
[0012] A voltage follower circuit used to transmit high and low level logic signals to an analog-to-digital converter chip;
[0013] In this circuit, the output terminal of the differential non-inverting amplifier circuit is electrically connected to the input terminal of the comparator circuit, and the output terminal of the comparator circuit is electrically connected to the input terminal of the voltage follower circuit.
[0014] Furthermore, the differential non-inverting amplifier circuit includes chip IC2, resistors R20, R22, R24, R21, R23 and R25;
[0015] The first pin of chip IC2 is connected to one end of resistor R22 and one end of resistor R24 respectively. The other end of resistor R24 is connected to the comparator circuit. The other end of resistor R22 is connected to one end of resistor R20 and the second pin of chip IC2 respectively. The other end of resistor R20 is grounded. The third pin of chip IC2 is connected to the current sampling signal after voltage division.
[0016] The seventh pin of chip IC2 is connected to one end of resistor R25 and one end of resistor R23 respectively. The other end of resistor R25 is connected to the comparator circuit. The other end of resistor R23 is connected to one end of resistor R21 and the sixth pin of chip IC2 respectively. The other end of resistor R21 is grounded. The fifth pin of chip IC2 is connected to the voltage sampling signal after voltage division.
[0017] Furthermore, the comparison circuit includes a first comparison circuit and a second comparison circuit;
[0018] The voltage follower circuit includes a first voltage follower circuit and a second voltage follower circuit;
[0019] The output of the first comparator circuit is electrically connected to the input of the first voltage follower circuit, and the output of the second comparator circuit is electrically connected to the input of the second voltage follower circuit.
[0020] Furthermore, the first comparator circuit includes chip IC3, resistor R26, capacitor C9, and switching diode D1;
[0021] The first pin of chip IC3 is connected to one end of resistor R26, one end of capacitor C9, and the first and second pins of switching diode D1, respectively. The third pin of switching diode D1 is connected to the other end of capacitor C9, the second pin of chip IC3, and the other end of resistor R24, respectively. The third pin of chip IC3 is grounded, and the other end of resistor R26 is connected to the first voltage follower circuit.
[0022] Furthermore, the first voltage follower circuit includes chip IC3 and capacitor C10;
[0023] One end of capacitor C10 is connected to the sixth pin of chip IC3 and the other end of resistor R26, and the other end of capacitor C10 is connected to the seventh pin of chip IC3. The fifth pin of chip IC3 is grounded.
[0024] Furthermore, the second comparator circuit includes chip IC3, resistor R29, capacitor C12, and switching diode D2;
[0025] The fourteenth pin of chip IC3 is connected to one end of resistor R29, one end of capacitor C12, and the first and second pins of switching diode D2. The third pin of switching diode D2 is connected to the other end of capacitor C12, the thirteenth pin of chip IC3, and the other end of resistor R25. The twelfth pin of chip IC3 is grounded, and the other end of resistor R29 is connected to the second voltage follower circuit.
[0026] Furthermore, the second voltage follower circuit includes chip IC3 and capacitor C11;
[0027] One end of capacitor C11 is connected to the ninth pin of chip IC3 and the other end of resistor R29, and the other end of capacitor C11 is connected to the eighth pin of chip IC3. The tenth pin of chip IC3 is grounded.
[0028] Furthermore, chip IC2 is a dual operational amplifier chip, and chip IC3 is a quad JFET input operational amplifier.
[0029] The beneficial effects of this utility model are as follows:
[0030] 1. This invention can improve the accuracy and anti-interference capability of zero-point detection. The zero-crossing comparator has hysteresis characteristics. By setting a very small voltage window (such as the GND signal), the output will only change when the signal clearly crosses this window. This greatly suppresses false triggering caused by noise and small signal fluctuations near the zero point, ensuring that only one clear and definite zero-crossing pulse (usually the rising or falling edge of a square wave) is generated in each cycle. The reference terminal (inverting terminal) of the comparator is grounded, so that it flips when the input signal truly crosses zero. Even if the signal amplitude changes, as long as it is greater than the sensitivity of the comparator, it can still generate a stable change at the zero-crossing point.
[0031] 2. The zero-crossing comparator circuit provided by this utility model instantly converts the slowly changing zero-crossing point into a very steep voltage jump (the edge of a square wave). This edge signal is an ideal digital signal, which is very suitable for being captured by the external interrupt pin of the microcontroller or the timer pin with input capture function. The timing accuracy of capturing the edge is extremely high (limited only by the propagation delay of the comparator, which is usually very small), thereby reducing measurement jitter and improving the frequency measurement accuracy.
[0032] 3. The zero-point comparison circuit provided by this utility model completes the most critical analog signal processing and zero-crossing detection. The microcontroller only needs to be configured with an external interrupt or input capture channel to record the time each time an edge transition is detected. The software only needs to calculate the time difference (period) between two consecutive zero-crossing points and take the reciprocal to obtain the frequency, which greatly simplifies the software design and reduces the requirements on the microcontroller's ADC performance and computing power.
[0033] 4. The zero-crossing comparison circuit provided by this utility model has a response speed that is usually much faster than the delay of software sampling and judgment, and can respond to zero-crossing events more quickly, which is especially important for applications that require fast response. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this utility model or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this utility model. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic block diagram of a zero-crossing comparison circuit for frequency measurement according to an embodiment of the present invention.
[0036] Figure 2 This is one of the circuit diagrams of a zero-crossing comparison circuit for frequency measurement according to an embodiment of the present utility model;
[0037] Figure 3 This is a second circuit diagram of a zero-crossing comparison circuit for frequency measurement according to an embodiment of the present utility model;
[0038] Figure 4 This is a circuit diagram of a voltage divider circuit in a zero-crossing comparison circuit for frequency measurement according to an embodiment of the present invention.
[0039] Figure 5 This is a schematic diagram of the principle of conventional frequency measurement in a zero-crossing comparison circuit for frequency measurement according to an embodiment of the present invention.
[0040] Figure 6 This is a schematic diagram illustrating the principle of frequency measurement in a zero-crossing comparison circuit for frequency measurement according to an embodiment of the present invention.
[0041] In the picture:
[0042] 1. Differential in-phase amplifier circuit; 2. Comparison circuit; 201. First comparator circuit; 202. Second comparator circuit; 3. Voltage follower circuit; 301. First voltage follower circuit; 302. Second voltage follower circuit. Detailed Implementation
[0043] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.
[0044] According to an embodiment of the present invention, a zero-crossing comparison circuit for frequency measurement is provided.
[0045] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, the zero-crossing comparison circuit for frequency measurement according to an embodiment of the present invention includes:
[0046] A differential in-phase amplifier circuit 1 is used to amplify the amplitude of the sampled signal after voltage division; a comparator circuit 2 is used to compare the sampled signal after amplitude amplification with a reference signal and output high and low level logic signals based on the comparison result; and a voltage follower circuit 3 is used to transmit the high and low level logic signals to the analog-to-digital converter chip. The output terminal of the differential in-phase amplifier circuit 1 is electrically connected to the input terminal of the comparator circuit 2, and the output terminal of the comparator circuit 2 is electrically connected to the input terminal of the voltage follower circuit 3.
[0047] In one embodiment, such as Figure 2 As shown, the differential non-inverting amplifier circuit 1 includes chip IC2, resistors R20, R22, R24, R21, R23, and R25. The first pin of chip IC2 is connected to one end of resistor R22 and one end of resistor R24, and the other end of resistor R24 is connected to comparator circuit 2. The other end of resistor R22 is connected to one end of resistor R20 and the second pin of chip IC2, and the other end of resistor R20 is grounded. The third pin of chip IC2 is connected to the current sampling signal after voltage division. The seventh pin of chip IC2 is connected to one end of resistor R25 and one end of resistor R23, and the other end of resistor R25 is connected to comparator circuit 2. The other end of resistor R23 is connected to one end of resistor R21 and the sixth pin of chip IC2, and the other end of resistor R21 is grounded. The fifth pin of chip IC2 is connected to the voltage sampling signal after voltage division.
[0048] In one embodiment, such as Figure 3As shown, the comparator circuit 2 includes a first comparator circuit 201 and a second comparator circuit 202; the voltage follower circuit 3 includes a first voltage follower circuit 301 and a second voltage follower circuit 302; the output terminal of the first comparator circuit 201 is electrically connected to the input terminal of the first voltage follower circuit 301, and the output terminal of the second comparator circuit 202 is electrically connected to the input terminal of the second voltage follower circuit 302.
[0049] In one embodiment, the first comparator circuit 201 includes a chip IC3, a resistor R26, a capacitor C9, and a switching diode D1; the first pin of the chip IC3 is connected to one end of the resistor R26, one end of the capacitor C9, and the first and second pins of the switching diode D1, respectively; the third pin of the switching diode D1 is connected to the other end of the capacitor C9, the second pin of the chip IC3, and the other end of the resistor R24, respectively; the third pin of the chip IC3 is grounded; and the other end of the resistor R26 is connected to the first voltage follower circuit 301.
[0050] In one embodiment, the first voltage follower circuit 301 includes a chip IC3 and a capacitor C10; one end of the capacitor C10 is connected to the sixth pin of the chip IC3 and the other end of the resistor R26, the other end of the capacitor C10 is connected to the seventh pin of the chip IC3, and the fifth pin of the chip IC3 is grounded.
[0051] In one embodiment, the second comparator circuit 202 includes a chip IC3, a resistor R29, a capacitor C12, and a switching diode D2; the fourteenth pin of the chip IC3 is connected to one end of the resistor R29, one end of the capacitor C12, and the first and second pins of the switching diode D2, respectively; the third pin of the switching diode D2 is connected to the other end of the capacitor C12, the thirteenth pin of the chip IC3, and the other end of the resistor R25, respectively; the twelfth pin of the chip IC3 is grounded; and the other end of the resistor R29 is connected to the second voltage follower circuit 302.
[0052] In one embodiment, the second voltage follower circuit 302 includes a chip IC3 and a capacitor C11; one end of the capacitor C11 is connected to the ninth pin of the chip IC3 and the other end of the resistor R29, the other end of the capacitor C11 is connected to the eighth pin of the chip IC3, and the tenth pin of the chip IC3 is grounded.
[0053] Specifically, such as Figure 6 As shown, this invention adds a zero-crossing comparator circuit, an AD conversion chip, and an optocoupler isolation chip after the voltage divider circuit, thereby improving the accuracy and speed of frequency measurement.
[0054] The circuit diagram of the voltage divider circuit is as follows: Figure 4As shown, the high-voltage signal is filtered by inductor L1 and then enters a voltage divider circuit composed of resistors R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R14, R15, and R17. After passing through the voltage divider circuit, a signal with a smaller voltage value is input to analog switch IC1. The microcontroller outputs a signal AX to control the opening and closing of analog switch IC1. After the switch is closed, the voltage sampling signal, after preliminary processing, enters the zero-crossing comparison circuit. The component specifications in the voltage divider circuit are shown in Table 1.
[0055] Table 1: Component Specifications in Voltage Divider Circuits
[0056]
[0057] The zero-crossing comparator circuit diagram is shown in Figure 2- Figure 3 As shown ( Figure 2 ① end and Figure 3 (Connected at terminal ①) Chip IC2 is a dual operational amplifier chip. One operational amplifier, together with resistors R20, R22, and R24, forms a differential non-inverting amplifier circuit for the current sampling signal. The other operational amplifier, together with resistors R21, R23, and R25, forms a differential non-inverting amplifier circuit for the voltage sampling signal. Chip IC3 is a quad-JFET input operational amplifier. The first operational amplifier in chip IC3, together with resistor R26, capacitor C9, and switching diode D1, forms a first comparator circuit 201 for comparing the current signal with ground. The second operational amplifier in chip IC3, together with capacitor C10, forms a first voltage follower circuit 301 for the output result of the first comparator circuit 201. After passing through resistor R27 and pull-up resistor R30, the result of the zero-crossing comparison of the current signal is input to the analog-to-digital converter chip.
[0058] The fourth operational amplifier in chip IC3, together with resistor R29, capacitor C12, and switching diode D2, forms a second comparator circuit 202 for comparing the voltage signal with ground. The third operational amplifier in chip IC3, together with capacitor C11, forms a second voltage follower circuit 302 for the output of the second comparator circuit 202. After passing through resistor R28 and pull-up resistor R31, the result of the zero-crossing comparison of the voltage signal is input to the analog-to-digital converter chip. The component specifications in the zero-crossing comparison circuit are shown in Table 2.
[0059] Table 2: Component Specifications in Zero-Crossing Comparator Circuits
[0060]
[0061] To facilitate understanding of the above-mentioned technical solutions of this utility model, the working principle or operation method of this utility model in actual process will be described in detail below.
[0062] In practical applications, the zero-crossing comparison circuit provided by this utility model includes a differential in-phase amplifier circuit 1, a comparison circuit 2 composed of operational amplifiers, and a voltage follower circuit 3.
[0063] After voltage division, the voltage signal and the current signal sampled by the sampling resistor are input to the zero-crossing comparator circuit. First, the sampled signal is amplified approximately 22 times by a differential-non-inverting amplifier circuit 1, composed of chip IC2 and resistors R20, R21, R22, R23, R24, and R25. Then, it enters comparator circuit 2 and voltage follower circuit 3, composed of chip IC3, capacitors C10 and C11. At this point, the sampled signal is compared between the inverting input of the operational amplifier and the ground signal at the non-inverting input. If the sampled signal is positive (i.e., the voltage value is greater than ground), comparator circuit 2 outputs a low level; if the sampled signal is negative (i.e., the voltage value is less than ground), comparator circuit 2 outputs a high level. After the comparator circuit 2 outputs a high or low level, it passes through voltage follower circuit 3 and enters the analog-to-digital converter chip, then the microcontroller for software processing. The switching diodes D1 and D2 function as amplitude limiters in the comparator circuit, restricting the amplitude of the output signal to between the input signal and ground.
[0064] The zero-crossing comparison circuit provided by this invention converts the slowly changing zero-crossing point into a very steep voltage jump (the edge of a square wave). This edge signal is an ideal digital signal, very suitable for capture by the microcontroller's external interrupt pin or a timer pin with input capture function. The timing accuracy of capturing the edge is higher than that of capturing the number of zero-crossings solely by the microcontroller program, greatly reducing measurement jitter and improving frequency measurement accuracy.
[0065] In this utility model, unless otherwise explicitly specified and limited, the terms "installation", "setting", "connection", "fixing", "screw connection", etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal connection of two components or the interaction between two components. Unless otherwise explicitly limited, those skilled in the art can understand the specific meaning of the above terms in this utility model according to the specific circumstances.
[0066] The above description is only a preferred embodiment of the present utility model and is not intended to limit the present utility model. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present utility model should be included within the protection scope of the present utility model.
Claims
1. A zero-crossing comparator circuit for frequency measurement, characterized in that, The circuit includes: Differential in-phase amplifier circuit (1) for amplifying the amplitude of the sampled signal after voltage division; A comparison circuit (2) is used to compare the sampled signal after amplitude amplification with the reference signal and output high and low level logic signals based on the comparison result; Voltage follower circuit (3) used to transmit high and low level logic signals to analog-to-digital converter chip; The output terminal of the differential in-phase amplifier circuit (1) is electrically connected to the input terminal of the comparator circuit (2), and the output terminal of the comparator circuit (2) is electrically connected to the input terminal of the voltage follower circuit (3).
2. The zero-crossing comparison circuit for frequency measurement according to claim 1, characterized in that, The differential non-inverting amplifier circuit (1) includes chip IC2, resistors R20, R22, R24, R21, R23 and R25; The first pin of the chip IC2 is connected to one end of the resistor R22 and one end of the resistor R24 respectively. The other end of the resistor R24 is connected to the comparator circuit (2). The other end of the resistor R22 is connected to one end of the resistor R20 and the second pin of the chip IC2 respectively. The other end of the resistor R20 is grounded. The third pin of the chip IC2 is connected to the current sampling signal after voltage division. The seventh pin of the chip IC2 is connected to one end of the resistor R25 and one end of the resistor R23 respectively. The other end of the resistor R25 is connected to the comparator circuit (2). The other end of the resistor R23 is connected to one end of the resistor R21 and the sixth pin of the chip IC2 respectively. The other end of the resistor R21 is grounded. The fifth pin of the chip IC2 is connected to the voltage sampling signal after voltage division.
3. The zero-crossing comparison circuit for frequency measurement according to claim 1, characterized in that, The comparison circuit (2) includes a first comparison circuit (201) and a second comparison circuit (202); The voltage follower circuit (3) includes a first voltage follower circuit (301) and a second voltage follower circuit (302); The output terminal of the first comparator circuit (201) is electrically connected to the input terminal of the first voltage follower circuit (301), and the output terminal of the second comparator circuit (202) is electrically connected to the input terminal of the second voltage follower circuit (302).
4. The zero-crossing comparison circuit for frequency measurement according to claim 3, characterized in that, The first comparator circuit (201) includes chip IC3, resistor R26, capacitor C9 and switching diode D1; The first pin of the chip IC3 is connected to one end of the resistor R26, one end of the capacitor C9, and the first and second pins of the switching diode D1. The third pin of the switching diode D1 is connected to the other end of the capacitor C9, the second pin of the chip IC3, and the other end of the resistor R24. The third pin of the chip IC3 is grounded. The other end of the resistor R26 is connected to the first voltage follower circuit (301).
5. A zero-crossing comparison circuit for frequency measurement according to claim 4, characterized in that, The first voltage follower circuit (301) includes the chip IC3 and capacitor C10; One end of the capacitor C10 is connected to the sixth pin of the chip IC3 and the other end of the resistor R26, the other end of the capacitor C10 is connected to the seventh pin of the chip IC3, and the fifth pin of the chip IC3 is grounded.
6. A zero-crossing comparison circuit for frequency measurement according to claim 5, characterized in that, The second comparator circuit (202) includes the chip IC3, resistor R29, capacitor C12 and switching diode D2; The fourteenth pin of the chip IC3 is connected to one end of the resistor R29, one end of the capacitor C12, and the first and second pins of the switching diode D2. The third pin of the switching diode D2 is connected to the other end of the capacitor C12, the thirteenth pin of the chip IC3, and the other end of the resistor R25. The twelfth pin of the chip IC3 is grounded. The other end of the resistor R29 is connected to the second voltage follower circuit (302).
7. A zero-crossing comparison circuit for frequency measurement according to claim 6, characterized in that, The second voltage follower circuit (302) includes the chip IC3 and capacitor C11; One end of the capacitor C11 is connected to the ninth pin of the chip IC3 and the other end of the resistor R29, the other end of the capacitor C11 is connected to the eighth pin of the chip IC3, and the tenth pin of the chip IC3 is grounded.
8. A zero-crossing comparison circuit for frequency measurement according to claim 7, characterized in that, The IC2 chip is a dual operational amplifier chip, and the IC3 chip is a four-channel JFET input operational amplifier.