A high-precision zero-crossing processing system and method for frequency and phase calculation
By filtering out noise using filters and protective components, and combining linear interpolation and weak low-pass filter processing methods, the problems of noise interference and period variation in traditional frequency measurement methods are solved, achieving high-precision and stable frequency measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGDAO DINGJUN ELECTRIC CO LTD
- Filing Date
- 2025-07-08
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional frequency measurement methods are affected by factors such as noise interference, large sampling point intervals, and period variations, resulting in insufficient accuracy and stability of frequency measurement.
High-frequency noise is filtered out by filters and protection components in the voltage input front-end circuit module and the current input circuit. The analog-to-digital conversion module filters out noise interference through a rate of change check mechanism. The zero-crossing time position is determined by linear interpolation. The main control microcontroller module performs smoothing by accumulating samples and combining them with a weak low-pass filter.
It significantly improves the accuracy and stability of frequency measurement, reduces interpolation errors and noise interference, and generates more stable frequency measurement results.
Smart Images

Figure CN122238702A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of electrical energy metering, and in particular to a high-precision zero-crossing processing system and method for frequency and phase calculation. Background Technology
[0002] In power systems, electricity metering is a crucial link in ensuring stable grid operation and reasonable billing. Within electricity metering systems, frequency measurement is a key component. Accurate frequency measurement not only improves the precision of electricity metering but also aids in power quality analysis. Traditional frequency measurement methods primarily rely on zero-crossing detection, calculating the frequency by detecting the zero-crossing points of the voltage signal. However, factors such as noise interference, large sampling intervals, and period variations can affect the accuracy and stability of frequency measurements. Therefore, improving the accuracy of zero-crossing detection and achieving more precise frequency measurement has become an urgent problem to be solved. Summary of the Invention
[0003] In view of this, the present invention provides a high-precision zero-crossing processing system and method for frequency and phase calculation. The system effectively filters out high-frequency noise through filters and protection components in the voltage input front-end circuit module and the current input circuit, ensuring the purity of the voltage and current signals. The analog-to-digital conversion module further filters out noise interference through a rate-of-change check mechanism, ensuring that the detected zero-crossing point is the true zero-crossing point of the voltage signal. Linear interpolation is used to more accurately determine the time position of the zero-crossing point, reducing interpolation errors and significantly improving the accuracy of frequency measurement. The main control microcontroller module accumulates sufficient samples and combines them with a weak low-pass filter to smooth the changes during the cycle, further stabilizing the frequency measurement results.
[0004] To achieve the above objectives, the present invention provides the following technical solution: A high-precision zero-crossing processing system for frequency and phase calculation includes: Voltage input front-end circuit module, current input front-end circuit module, analog-to-digital conversion module, hardware zero-crossing judgment circuit module, and main control microcontroller module; The voltage input front-end circuit module is used to filter and protect the voltage signal before sending the voltage signal to the analog-to-digital conversion module for digital processing. The current input front-end circuit module is used to filter and protect the current signal, and then send the current signal to the analog-to-digital conversion module for digital processing. The analog-to-digital conversion module is used to accurately measure the current and voltage of each phase of the AC power supply, and transmits the digitized voltage signal and the current signal to the main control microcontroller module. The analog-to-digital converter module is used to measure the current and voltage of each phase of the AC power supply and convert them into digital signals; When the hardware zero-crossing detection circuit module detects a zero-crossing point, it checks the rate of change of the voltage signal and sends an interrupt signal to the main control microcontroller module. The main control microcontroller module is used to execute the power metering algorithm based on the data from the analog-to-digital conversion module, and to calculate the time difference between two adjacent zero-crossing points based on the interrupt signal from the hardware zero-crossing judgment circuit module to obtain the frequency, and to smooth the changes during the cycle.
[0005] Preferably, the voltage signal, after being filtered, enters the positive input terminal of the hardware zero-crossing detection circuit module, and the negative input terminal of the hardware zero-crossing detection circuit module is grounded.
[0006] Preferably, when the voltage signal crosses zero, the output state of the hardware zero-crossing judgment circuit module changes, triggering and sending an interrupt signal to the main control microcontroller module.
[0007] Preferably, the main control microcontroller module includes a linear interpolation algorithm module for determining the time position of the zero-crossing point.
[0008] Preferably, the hardware zero-crossing detection circuit module includes a high-speed comparator.
[0009] The present invention also provides a method for simulating and detecting faults in electricity meters, comprising the following steps: Step S100: Perform preliminary filtering on the voltage signal; Step S200: After detecting the zero-crossing point of the voltage signal, an interrupt signal is triggered; Step S300: Use linear interpolation to determine the time position of the zero crossing point to reduce interpolation error; Step S400: Calculate the time difference between two adjacent zero-crossing points to obtain the estimated frequency; Step S500: Smooth the changes during the period to generate stable frequency measurement results.
[0010] Preferably, in step S200, when a zero-crossing point is detected, the rate of change of the voltage signal is checked to filter out noise interference, and an interrupt signal is triggered after determining that the detected zero-crossing point is a real zero-crossing point of the voltage signal.
[0011] Preferably, in step S700, an average result is generated by accumulating the changes during the cycle using a weak low-pass filter.
[0012] As can be seen from the above technical solution, the electricity meter fault simulation detection system provided by the present invention can effectively filter out high-frequency noise through the filters and protection components in the voltage input front-end circuit module and the current input circuit, ensuring the purity of voltage and current signals; the analog-to-digital conversion module further filters out noise interference through the rate of change check mechanism, ensuring that the detected zero-crossing point is the real zero-crossing point of the voltage signal, and uses linear interpolation to more accurately determine the time position of the zero-crossing point, reducing interpolation error and significantly improving the accuracy of frequency measurement; the main control microcontroller module accumulates sufficient samples and combines them with a weak low-pass filter to smooth the changes during the cycle, further stabilizing the frequency measurement results. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart illustrating a high-precision zero-crossing processing method for frequency and phase calculation according to an exemplary embodiment; Detailed Implementation
[0015] This invention discloses a high-precision zero-crossing processing system and method for frequency and phase calculation. The system effectively filters out high-frequency noise through filters and protection components in the voltage input front-end circuit module and the current input circuit, ensuring the purity of the voltage and current signals. The analog-to-digital conversion module further filters out noise interference through a rate-of-change check mechanism, ensuring that the detected zero-crossing point is the true zero-crossing point of the voltage signal. Linear interpolation is used to more accurately determine the time position of the zero-crossing point, reducing interpolation errors and significantly improving the accuracy of frequency measurement. The main control microcontroller module accumulates sufficient samples and combines them with a weak low-pass filter to smooth the changes during the cycle, further stabilizing the frequency measurement results.
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] This disclosure provides an exemplary embodiment of a high-precision zero-crossing processing system for frequency and phase calculations, such as... Figure 1 As shown, Figure 1This is a flowchart illustrating a high-precision zero-crossing processing method for frequency and phase calculations according to an exemplary embodiment. The explanation follows.
[0018] The specific embodiments described below are intended to help those skilled in the art understand this embodiment, but this embodiment is not limited to the specific embodiments described below.
[0019] This disclosure provides an exemplary embodiment of a high-precision zero-crossing processing system for frequency and phase calculation, and an energy meter fault simulation detection system comprising: Voltage input front-end circuit module, current input front-end circuit module, analog-to-digital conversion module, hardware zero-crossing judgment circuit module, and main control microcontroller module; The voltage input front-end circuit module is used to filter and protect the voltage signal before sending it to the analog-to-digital converter module for digital processing. The current input front-end circuit module is used to filter and protect the current signal before sending it to the analog-to-digital converter module for digital processing. The analog-to-digital converter module is used to accurately measure the current and voltage of each phase of the AC power supply and transmit the digitized voltage and current signals to the main control microcontroller module. The analog-to-digital converter module is used to measure the current and voltage of each phase of an AC power supply and convert them into digital signals; When the hardware zero-crossing detection circuit module detects a zero-crossing point, it checks the rate of change of the voltage signal and sends an interrupt signal to the main microcontroller module. The main control microcontroller module is used to execute the power metering algorithm based on the data from the analog-to-digital conversion module, and to calculate the time difference between two adjacent zero-crossing points based on the interrupt signal from the hardware zero-crossing judgment circuit module to obtain the frequency, and to smooth the changes during the cycle.
[0020] For example, the voltage input front-end circuit module includes a spike protection varistor, an electromagnetic interference filter, a voltage divider, and a low-pass filter to filter and protect the voltage signal, ensuring the purity and stability of the voltage signal.
[0021] The current input front-end circuit module is used as the analog front-end for current input.
[0022] The analog-to-digital conversion module includes a high-performance multi-channel analog-to-digital converter (ADC) for measuring voltage and current passing through the voltage input front-end circuit module and the current input front-end circuit module.
[0023] The hardware zero-crossing detection circuit module includes a high-speed comparator. After the voltage signal is filtered, it enters the positive input terminal of the comparator, and the negative input terminal of the comparator is grounded.
[0024] The main control microcontroller module includes a main control microcontroller (MCU), which is responsible for processing data from the analog-to-digital conversion module and executing various energy metering algorithms. The main control microcontroller module is also responsible for generating energy pulse outputs for subsequent energy calculations.
[0025] In this embodiment, the voltage signal, after being filtered and protected by the voltage input front-end circuit module, has high-frequency noise removed before being sent to the analog-to-digital conversion module for digital processing. Preliminary filtering reduces the impact of high-frequency noise on the voltage signal, providing a cleaner signal for subsequent zero-crossing detection.
[0026] After being filtered and protected by the current input front-end circuit module, the current signal is sent to the analog-to-digital converter module for digital processing.
[0027] The analog-to-digital converter module converts the voltage and current from the voltage input front-end circuit module and the current input front-end circuit module into digital signals and sends them to the main control microcontroller module.
[0028] When the hardware zero-crossing detection circuit module detects a zero-crossing point, it notifies the main control microcontroller module to process it via an interrupt signal. That is, when the voltage signal crosses zero, the output state of the high-speed comparator, which is part of the hardware zero-crossing detection circuit, changes, triggering an interrupt signal to notify the main control microcontroller module to process it.
[0029] After receiving an interrupt signal, the main control microcontroller module checks the rate of change of the voltage signal to filter out possible noise interference, ensuring that the detected zero-crossing point is the real zero-crossing point of the voltage signal. The rate of change check mechanism can effectively filter out noise interference, avoid misjudgment caused by noise, and improve the accuracy of zero-crossing point detection.
[0030] In this embodiment, the filters and protection components in the voltage input front-end circuit module and the current input circuit can effectively filter out high-frequency noise, ensuring the purity of the voltage and current signals. The analog-to-digital conversion module further filters out noise interference through a rate of change check mechanism, ensuring that the detected zero-crossing point is the true zero-crossing point of the voltage signal. The linear interpolation method is used to more accurately determine the time position of the zero-crossing point, reducing interpolation errors and significantly improving the accuracy of frequency measurement. The main control microcontroller module can further stabilize the frequency measurement results by accumulating sufficient samples and combining them with a weak low-pass filter to smooth the changes during the cycle.
[0031] In an exemplary embodiment of this disclosure, the main control microcontroller module includes a linear interpolation algorithm module for determining the time position of the zero-crossing point.
[0032] For example, the main control microcontroller module uses linear interpolation to more accurately determine the time position of the zero crossing point, reducing interpolation errors. Compared with fixed sampling points, linear interpolation can capture the true zero crossing moment more accurately, significantly improving the accuracy of frequency measurement.
[0033] In this embodiment, the main control microcontroller includes a weak low-pass filter. The main control microcontroller module estimates the frequency by calculating the time difference between two adjacent zero-crossing points and uses the weak low-pass filter to smooth the changes during the cycle, generating a stable frequency measurement result. The weak low-pass filter can effectively smooth the fluctuations between cycles, reduce the jitter of the frequency measurement result, and improve the stability of the frequency measurement.
[0034] This disclosure also provides a high-precision zero-crossing processing method for frequency and phase calculation, referring to... Figure 1 This includes the following steps: Step S100: Perform preliminary filtering on the voltage signal; Step S200: After detecting the zero-crossing point of the voltage signal, an interrupt signal is triggered; Step S300: Use linear interpolation to determine the time position of the zero crossing point to reduce interpolation error; Step S400: Calculate the time difference between two adjacent zero-crossing points to obtain the estimated frequency; Step S500: Smooth the changes during the period to generate stable frequency measurement results.
[0035] For example, refer to Figure 1 After the voltage signal is filtered and protected by the voltage input front-end circuit module, high-frequency noise is removed before it is sent to the analog-to-digital converter module for digital processing. Preliminary filtering reduces the impact of high-frequency noise on the voltage signal, providing a cleaner signal for subsequent zero-crossing detection.
[0036] After being filtered and protected by the current input front-end circuit module, the current signal is sent to the analog-to-digital converter module for digital processing.
[0037] The analog-to-digital converter module converts the voltage and current from the voltage input front-end circuit module and the current input front-end circuit module into digital signals and sends them to the main control microcontroller module.
[0038] When the hardware zero-crossing detection circuit module detects a zero-crossing point, it notifies the main control microcontroller module to process it via an interrupt signal. That is, when the voltage signal crosses zero, the output state of the high-speed comparator, which is part of the hardware zero-crossing detection circuit, changes, triggering an interrupt signal to notify the main control microcontroller module to process it.
[0039] Upon receiving an interrupt signal, the main control microcontroller module uses linear interpolation to more accurately determine the zero-crossing time position, reducing interpolation errors. Compared to fixed sampling points, linear interpolation can more accurately capture the true zero-crossing moment, significantly improving the accuracy of frequency measurement. After receiving the interrupt signal, the main control microcontroller module also performs a rate-of-change check on the voltage signal to filter out possible noise interference, ensuring that the detected zero-crossing point is the true zero-crossing point of the voltage signal. The rate-of-change check mechanism effectively filters out noise interference, avoiding misjudgments caused by noise and improving the accuracy of zero-crossing detection. Furthermore, a weak low-pass filter smooths the periodic variations, generating stable frequency measurement results. The weak low-pass filter effectively smooths the fluctuations between periods, reducing jitter in the frequency measurement results and improving the stability of frequency measurement.
[0040] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A high-precision zero-crossing processing system for frequency and phase calculation, characterized in that, include: Voltage input front-end circuit module, current input front-end circuit module, analog-to-digital conversion module, hardware zero-crossing judgment circuit module, and main control microcontroller module; The voltage input front-end circuit module is used to filter and protect the voltage signal before sending the voltage signal to the analog-to-digital conversion module for digital processing. The current input front-end circuit module is used to filter and protect the current signal, and then send the current signal to the analog-to-digital conversion module for digital processing. The analog-to-digital conversion module is used to accurately measure the current and voltage of each phase of the AC power supply, and transmits the digitized voltage signal and the current signal to the main control microcontroller module. The analog-to-digital converter module is used to measure the current and voltage of each phase of the AC power supply and convert them into digital signals; When the hardware zero-crossing detection circuit module detects a zero-crossing point, it checks the rate of change of the voltage signal and sends an interrupt signal to the main control microcontroller module. The main control microcontroller module is used to execute the power metering algorithm based on the data from the analog-to-digital conversion module, and to calculate the time difference between two adjacent zero-crossing points based on the interrupt signal from the hardware zero-crossing judgment circuit module to obtain the frequency, and to smooth the changes during the cycle.
2. The electricity meter fault simulation and detection system according to claim 1, characterized in that, After being filtered, the voltage signal enters the positive input terminal of the hardware zero-crossing detection circuit module, while the negative input terminal of the hardware zero-crossing detection circuit module is grounded.
3. The electricity meter fault simulation detection system according to claim 2, characterized in that, When the voltage signal crosses zero, the output state of the hardware zero-crossing judgment circuit module changes, triggering and sending an interrupt signal to the main control microcontroller module.
4. The electricity meter fault simulation detection system according to claim 1, characterized in that, The main control microcontroller module includes a linear interpolation algorithm module for determining the time position of the zero-crossing point.
5. The electricity meter fault simulation and detection system according to claim 1, characterized in that, The hardware zero-crossing detection circuit module includes a high-speed comparator.
6. A method for simulating and detecting faults in an electricity meter, characterized in that, Includes the following steps: Step S100: Perform preliminary filtering on the voltage signal; Step S200: After detecting the zero-crossing point of the voltage signal, an interrupt signal is triggered; Step S300: Use linear interpolation to determine the time position of the zero crossing point to reduce interpolation error; Step S400: Calculate the time difference between two adjacent zero-crossing points to obtain the estimated frequency; Step S500: Smooth the changes during the period to generate stable frequency measurement results.
7. The method for simulating and detecting electricity meter faults according to claim 6, characterized in that, In step S200, when a zero-crossing point is detected, the rate of change of the voltage signal is checked to filter out noise interference. After determining that the detected zero-crossing point is a real zero-crossing point of the voltage signal, an interrupt signal is triggered.
8. The method for simulating and detecting faults in an electricity meter according to claim 7, characterized in that, In step S500, the average result is generated by accumulating the changes during the week.