Alternating current signal zero crossing point detection method and system based on sectional type sampling strategy
By employing a segmented sampling strategy and combining low-precision and high-precision acquisition modules, the problem of balancing accuracy and cost in AC signal zero-crossing detection is solved, achieving high-precision detection while reducing costs.
Patent Information
- Application Number
- CN202511443331.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-01-23
AI Technical Summary
Existing methods for detecting the zero-crossing point of AC signals struggle to balance accuracy and cost; high-precision detection is expensive, while low-precision detection lacks sufficient accuracy.
A segmented sampling strategy is adopted. The first acquisition module with low precision is used for preliminary sampling to locate the preset amplitude range. Then, the second acquisition module with high precision is used for precise sampling to establish a mathematical model to determine the zero crossing point.
It significantly reduces costs while ensuring detection accuracy, and is suitable for various occasions requiring high-precision AC signal zero-crossing detection. It is simple to operate and easy to implement.
Smart Images

Figure CN121385402A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of AC signal detection technology, and in particular to a method and system for detecting the zero-crossing point of AC signals based on a segmented sampling strategy. Background Technology
[0002] In fields such as AC power systems, electronic measurement, and motor control, the detection of zero-crossing points of AC signals plays a crucial role. Accurate acquisition of the zero-crossing moment has a direct impact on applications such as synchronization control, phase measurement, and harmonic analysis.
[0003] Currently, common methods for detecting the zero-crossing point of AC signals mainly include hardware detection and software detection. Hardware detection typically uses circuits such as comparators to process the AC signal and outputs the signal directly at the zero-crossing point. However, this method is greatly affected by factors such as the accuracy of the hardware circuit and temperature drift, resulting in limited detection accuracy and making it difficult to meet the needs of high-precision applications.
[0004] Software-based detection methods typically involve sampling AC signals and then calculating zero-crossing points based on the sampled data. Existing software-based detection methods often employ single-precision acquisition modules for sampling. While using high-precision, high-frequency acquisition modules can improve detection accuracy, it significantly increases costs, and the large amount of sampled data also adds to the data processing burden. Conversely, using low-precision acquisition modules cannot guarantee detection accuracy.
[0005] Therefore, how to reduce detection costs while ensuring detection accuracy has become an urgent problem to be solved in the field of AC signal zero-crossing detection. Summary of the Invention
[0006] This invention provides a method and system for detecting the zero-crossing point of AC signals based on a segmented sampling strategy, in order to solve the problem that the accuracy and cost of AC signal zero-crossing point detection are difficult to balance in related technologies.
[0007] This invention provides a method for detecting zero-crossing points of AC signals based on a segmented sampling strategy, comprising: Based on the first acquisition module, the AC signal to be detected is continuously sampled to determine the first sample value, and based on the first sample value, the target time point when the AC signal to be detected enters the preset amplitude range near zero is determined. Based on the second acquisition module, starting from the target time point, the AC signal to be detected is continuously sampled within the preset amplitude range to determine the second sampled value and its corresponding sampling time; Based on the second sampled value and its corresponding sampling time, a mathematical model of the AC signal to be detected within the preset amplitude range is established, and the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range is determined. The sampling frequency of the first acquisition module is lower than that of the second acquisition module.
[0008] According to the present invention, an AC signal zero-crossing detection method based on a segmented sampling strategy is provided, wherein the preset amplitude range includes multiple sampling point groups; after determining the zero-crossing prediction time when the signal amplitude is zero in the mathematical model, the method further includes: Based on the second sampled value of each sampled point in the target sampling point group corresponding to the zero-crossing prediction time, calculate the slope sequence formed by the slope between every two adjacent sampled points in the target sampling point group, and calculate the average slope within the slope sequence based on the slope sequence. Based on the difference between every two adjacent slopes in the slope sequence and the average slope, the slope fluctuation index within the target sampling point group is calculated. Based on the slope fluctuation index, the confidence level of the zero-crossing prediction time is calculated.
[0009] According to the present invention, a method for detecting zero-crossing points of AC signals based on a segmented sampling strategy is provided, wherein calculating the confidence level of the predicted zero-crossing point time based on the slope fluctuation index includes: If the slope volatility index is less than the minimum volatility threshold, then the confidence level is determined to be 100%. If the slope volatility index is greater than or equal to the minimum volatility threshold and less than or equal to the maximum volatility threshold, then the confidence level is determined based on the slope volatility index, the minimum volatility threshold, and the maximum volatility threshold. If the slope fluctuation index is greater than the maximum fluctuation threshold, then the confidence level is determined to be zero. Wherein, the minimum fluctuation threshold is less than the maximum fluctuation threshold.
[0010] According to the present invention, an AC signal zero-crossing detection method based on a segmented sampling strategy is provided, wherein the confidence level of the zero-crossing prediction time is calculated based on the slope fluctuation index, and then the method includes: The zero-crossing prediction time and its confidence level are sent to the target device.
[0011] According to the present invention, an AC signal zero-crossing detection method based on a segmented sampling strategy is provided, wherein the method comprises establishing a mathematical model of the AC signal to be detected within a preset amplitude range based on the second sampled value and its corresponding sampling time, and determining the predicted zero-crossing time of the signal amplitude being zero within the preset amplitude range in the mathematical model, including: The sampling points within the preset amplitude range are divided into multiple sampling point groups, and the second sampling value in each sampling point group and its corresponding sampling time are fitted to obtain the mathematical model corresponding to each sampling point group. The moment when the signal amplitude is zero in the mathematical model corresponding to each sampling point group is determined as the zero-crossing prediction moment.
[0012] The present invention also provides an AC signal zero-crossing detection system based on a segmented sampling strategy, comprising: a first acquisition module, a second acquisition module, and a data processing module; the first acquisition module and the second acquisition module are both connected to the data processing module; The first acquisition module is used to continuously sample the AC signal to be detected, determine the first sample value, and determine the target time point when the AC signal to be detected enters the preset amplitude range near zero based on the first sample value. The second acquisition module is used to continuously sample the AC signal to be detected within the preset amplitude range starting from the target time point, and determine the second sample value and its corresponding sampling time; The data processing module is used to establish a mathematical model of the AC signal to be detected within the preset amplitude range based on the second sampled value and its corresponding sampling time, and to determine the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range. The sampling frequency of the first acquisition module is lower than that of the second acquisition module.
[0013] According to the present invention, an AC signal zero-crossing detection system based on a segmented sampling strategy is provided. The first acquisition module includes a first signal conditioning circuit, a first analog-to-digital converter and a first microprocessor, and the second acquisition module includes a second signal conditioning circuit, a second analog-to-digital converter and a second microprocessor. The frequency response characteristics of the second signal conditioning circuit are better than those of the first signal conditioning circuit; The second analog-to-digital converter has a higher bit depth and conversion rate than the first analog-to-digital converter.
[0014] The AC signal zero-crossing detection system based on a segmented sampling strategy provided by the present invention further includes a communication module; The communication module is communicatively connected to both the data processing module and the target device.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the AC signal zero-crossing detection method based on the segmented sampling strategy described above.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the AC signal zero-crossing detection method based on the segmented sampling strategy described above.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the AC signal zero-crossing detection method based on the segmented sampling strategy described above.
[0018] This invention provides a method and system for detecting zero-crossing points of AC signals based on a segmented sampling strategy. First, a low-precision first acquisition module continuously samples the AC signal to be detected. Then, starting from a target time point when the AC signal enters a preset amplitude range near zero, a high-precision second acquisition module continuously samples the AC signal within the preset amplitude range. Based on the second sampled values within the preset amplitude range and their corresponding sampling times, a mathematical model of the AC signal within that range is established. Solving the mathematical model yields the predicted zero-crossing point time when the signal amplitude is zero within the preset amplitude range. This method first uses the first acquisition module to locate the preset amplitude range, and then uses the second acquisition module to sample the AC signal within that range. This avoids using a high-precision acquisition module throughout the entire process, significantly reducing detection costs while maintaining accuracy. The method is simple to operate, easy to implement, and suitable for various applications requiring high-precision detection of AC signal zero-crossing points, demonstrating strong practicality and promotional value. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the AC signal zero-crossing detection method based on a segmented sampling strategy provided by the present invention.
[0021] Figure 2 This is a schematic diagram of the sampling of the AC signal to be detected by the first acquisition module provided by the present invention.
[0022] Figure 3 This is a schematic diagram of the sampling of the AC signal to be detected by the second acquisition module provided by the present invention.
[0023] Figure 4This is a schematic diagram illustrating the trend of the second sampled values of each sampling point when the confidence level of the zero-crossing prediction time within the target sampling point group provided by the present invention is high.
[0024] Figure 5 This is a schematic diagram illustrating the trend of the second sampled values of each sampling point when the confidence level of the zero-crossing prediction time within the target sampling point group provided by the present invention is low.
[0025] Figure 6 This is one of the structural schematic diagrams of the AC signal zero-crossing detection system based on a segmented sampling strategy provided by the present invention.
[0026] Figure 7 This is the second schematic diagram of the AC signal zero-crossing detection system based on a segmented sampling strategy provided by the present invention.
[0027] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0029] Figure 1 This is a flowchart illustrating an AC signal zero-crossing detection method based on a segmented sampling strategy provided in an embodiment of the present invention. Figure 1 As shown, the method includes: S1, based on the first acquisition module, continuously sample the AC signal to be detected, determine the first sample value, and determine the target time point when the AC signal to be detected enters the preset amplitude range near zero based on the first sample value; S2, based on the second acquisition module, starting from the target time point, the AC signal to be detected is continuously sampled within the preset amplitude range to determine the second sampled value and its corresponding sampling time; S3, Based on the second sampled value and its corresponding sampling time, establish a mathematical model of the AC signal to be detected within the preset amplitude range, and determine the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range; The sampling frequency of the first acquisition module is lower than that of the second acquisition module.
[0030] Specifically, the AC signal zero-crossing detection method based on a segmented sampling strategy provided in this embodiment of the invention is executed by an AC signal zero-crossing detection system based on a segmented sampling strategy. This system can be configured in a computer, which can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and no specific limitation is made here.
[0031] First, step S1 is executed, whereby the first acquisition module continuously samples the AC signal to be detected to determine the first sample value. The sampling frequency of the first acquisition module can be selected as needed, for example, 100Hz. When the first acquisition module continuously samples the AC signal to be detected, each sampling point corresponds to a first sample value and its corresponding sampling time. The first sample value is the amplitude of the AC signal to be detected.
[0032] By continuously determining whether the first sampled value is within a preset amplitude range near zero, the target time point when the AC signal to be detected enters the preset amplitude range near zero is determined. For example, the sampling time corresponding to the first sampled point that enters the preset amplitude range can be used as the target time point. The preset amplitude range can be set as needed; it can be that the amplitude of the AC signal to be detected is within ±3% of the rated amplitude, meaning the lower limit of the preset amplitude range is -3% of the rated amplitude of the AC signal to be detected, and the upper limit is +3% of the rated amplitude of the AC signal to be detected.
[0033] like Figure 2 The diagram shown is a sampling schematic of the AC signal to be detected by the first acquisition module. Figure 2 The vertical axis represents the signal amplitude of the AC signal to be detected. u The horizontal axis represents time. t . Figure 2 middle u 0 represents the upper limit of the preset amplitude range. -u 0 represents the lower limit of the preset amplitude range.
[0034] Subsequently, step S2 is executed. Since the signal change near zero is relatively steep, a high-precision acquisition module is needed for sampling to obtain more dense and accurate second sample values, providing a reliable foundation for the subsequent mathematical model. Therefore, after determining the target time point, an entry signal with a preset amplitude range can be sent to the second acquisition module. Upon receiving the entry signal, the second acquisition module immediately starts sampling the AC signal to be detected within the preset amplitude range, starting from the target time point, to determine the second sample value and its corresponding sampling time. The sampling frequency of the second acquisition module is greater than that of the first acquisition module; that is, the second acquisition module is a high-precision acquisition module, and the first acquisition module is a low-precision acquisition module. For example, the sampling frequency of the second acquisition module can be set to 100kHz. When the second acquisition module continuously samples the AC signal to be detected, each sampling point corresponds to a second sample value and its corresponding sampling time. The second sample value is the amplitude of the AC signal to be detected.
[0035] like Figure 3 The diagram shown is a sampling schematic of the AC signal to be detected by the second acquisition module. Figure 3 middle This is the time range corresponding to the preset amplitude range.
[0036] Finally, step S3 is executed. Polynomial fitting can be used to fit the second sampled value and its corresponding sampling time to the second sampled value and establish a mathematical model of the AC signal to be detected within a preset amplitude range. The vertical axis of the mathematical model is set to zero to obtain the sampling time when the signal amplitude is zero in the mathematical model within the preset amplitude range, and this time is used as the zero-crossing prediction time.
[0037] The AC signal zero-crossing detection method based on a segmented sampling strategy provided in this invention first uses a low-precision first acquisition module to continuously sample the AC signal to be detected. Then, starting from the target time point when the AC signal enters a preset amplitude range near zero, a high-precision second acquisition module continuously samples the AC signal within the preset amplitude range. Based on the second sampled values within the preset amplitude range and their corresponding sampling times, a mathematical model of the AC signal within the preset amplitude range is established. By solving the mathematical model, the predicted zero-crossing time when the signal amplitude is zero within the preset amplitude range is obtained. This method first uses the first acquisition module to locate the preset amplitude range, and then uses the second acquisition module to sample the AC signal within the preset amplitude range. This avoids using a high-precision acquisition module throughout the entire process, significantly reducing detection costs while maintaining detection accuracy. This method is simple to operate, easy to implement, and suitable for various occasions requiring high-precision detection of AC signal zero-crossing points, possessing strong practicality and promotional value.
[0038] Based on the above embodiments, the preset amplitude range includes multiple sampling point groups; after determining the zero-crossing prediction time when the signal amplitude is zero in the mathematical model, the method further includes: Based on the second sampled value of each sampled point in the target sampling point group corresponding to the zero-crossing prediction time, calculate the slope sequence formed by the slope between every two adjacent sampled points in the target sampling point group, and calculate the average slope within the slope sequence based on the slope sequence. Based on the difference between every two adjacent slopes in the slope sequence and the average slope, the slope fluctuation index within the target sampling point group is calculated. Based on the slope fluctuation index, the confidence level of the zero-crossing prediction time is calculated.
[0039] Specifically, when establishing a mathematical model for the AC signal to be detected within a preset amplitude range, the sampling points within the preset amplitude range can be evenly grouped, so that the preset amplitude range includes multiple sampling point groups. Each sampling point group includes the same number of sampling points, and the number of sampling points in each sampling point group is determined by the number of unknowns in the fitting function used in the mathematical model, with the aim of being able to solve the mathematical model; no specific limitation is made here. For example, if the fitting function used in the mathematical model is a fourth-order polynomial, then the number of sampling points in each sampling point group can be at least five, and the sampling time interval between adjacent sampling points in each sampling point group can be the reciprocal of the sampling frequency, i.e., 1 / 100000 seconds.
[0040] Furthermore, after determining the zero-crossing prediction time when the signal amplitude is zero in the mathematical model, the slope between each pair of adjacent sampling points in the target sampling point group can be calculated by using the second sampled value of each sampling point in the target sampling point group corresponding to the zero-crossing prediction time and the corresponding sampling time.
[0041] If the target sampling point group includes m sampling points, then the slope between two adjacent sampling points can be expressed as: ; in, Let be the slope between the i-th sampling point and the (i+1)-th sampling point. Let i be the sampling time corresponding to the i-th sampling point. This represents the sampling time corresponding to the (i+1)th sampling point. The second sampled value of the i-th sampling point. It is the second sampled value corresponding to the (i+1)th sampled point.
[0042] The slope sequence can be represented as: , It can also be referred to as the i-th slope in the slope sequence.
[0043] The average slope within the target sampling point group can be expressed as: ; in, This represents the average slope within the target sampling point group.
[0044] Subsequently, by using the difference between each two adjacent slopes in the slope sequence and the average slope, the slope fluctuation index within the target sampling point group can be calculated.
[0045] The difference between the (i+1)th slope and the ith slope in the slope sequence can be expressed as: .
[0046] The slope volatility index refers to the rate of change of the slope in a slope sequence. It can be determined by the maximum absolute value of the ratios of any two adjacent slopes to the average slope in the sequence, i.e.: , ; .
[0047] Where F is the slope fluctuation index.
[0048] Finally, the confidence level of the zero-crossing prediction time is calculated using the slope fluctuation index. Here, each zero-crossing prediction time corresponds to a confidence level, which represents the reliability of the zero-crossing prediction time. The smaller the slope fluctuation index, the more stable the slope, and the higher the confidence level, resulting in a more reliable zero-crossing prediction time. Conversely, the larger the slope fluctuation index, the greater the slope fluctuation, and the lower the confidence level, resulting in a less reliable zero-crossing prediction time. For example, a correspondence can be established between the slope fluctuation index range and the confidence level calculation method. Then, by determining the slope fluctuation index range it falls within, the corresponding confidence level calculation method can be determined to calculate the confidence level of the zero-crossing prediction time.
[0049] Taking m=5 as an example, such as Figure 4 The diagram shows the trend of the second sampled values of each sampling point when the confidence level of the zero-crossing prediction time within the target sampling point group is high. Figure 5 The figure shown is a schematic diagram illustrating the trend of the second sampled values of each sampling point when the confidence level of the zero-crossing prediction time within the target sampling point group is low.
[0050] In this embodiment of the invention, by calculating the prediction time of each zero-crossing point and its confidence level, a reference can be provided for the subsequent application of each zero-crossing point prediction time. The usage of each zero-crossing point prediction time can be flexibly determined based on the confidence level of each zero-crossing point prediction time.
[0051] Based on the above embodiments, calculating the confidence level of the zero-crossing prediction time based on the slope fluctuation index includes: If the slope volatility index is less than the minimum volatility threshold, then the confidence level is determined to be 100%. If the slope volatility index is greater than or equal to the minimum volatility threshold and less than or equal to the maximum volatility threshold, then the confidence level is determined based on the slope volatility index, the minimum volatility threshold, and the maximum volatility threshold. If the slope fluctuation index is greater than the maximum fluctuation threshold, then the confidence level is determined to be zero. Wherein, the minimum fluctuation threshold is less than the maximum fluctuation threshold.
[0052] Specifically, when calculating the confidence level at the zero-point prediction time, the slope fluctuation index can be compared with the minimum fluctuation threshold and the maximum fluctuation threshold, respectively. Here, both the minimum and maximum fluctuation thresholds can be set as needed, and the minimum fluctuation threshold is less than the maximum fluctuation threshold.
[0053] When the slope volatility index is less than the minimum volatility threshold, the confidence level can be directly determined to be 100%.
[0054] When the slope volatility index is greater than or equal to the minimum volatility threshold and less than or equal to the maximum volatility threshold, the confidence level can be determined using the following formula based on the slope volatility index, the minimum volatility threshold, and the maximum volatility threshold: Where C% represents the confidence level. The minimum fluctuation threshold, This is the maximum fluctuation threshold.
[0055] When the slope volatility index is greater than the maximum volatility threshold, the confidence level can be directly determined to be zero.
[0056] Based on this, the confidence level can be calculated as follows: .
[0057] It should be noted that the granularity of the confidence level, i.e., the difference between adjacent confidence level values, is 5%. Therefore, a confidence level of 0-100% can be represented by decimal numbers 0-20, where 0 represents a confidence level of 0 and 1 to 20 represent values between 5% and 100% confidence levels. Alternatively, a confidence level of 5% granularity can be represented by hexadecimal numbers 0x0-0x14, but no specific limitation is made here.
[0058] In this embodiment of the invention, a specific implementation scheme for calculating the confidence level is provided, which can ensure that the calculation of the confidence level is more accurate and reasonable.
[0059] Based on the above embodiments, the step of calculating the confidence level of the zero-crossing prediction time based on the slope fluctuation index includes: The zero-crossing prediction time and its confidence level are sent to the target device.
[0060] Specifically, after determining the prediction time and confidence level of each zero-crossing point, the prediction time and confidence level can be sent to the target device, which can be an external device or a host computer. Upon receiving the prediction time and confidence level, the target device can determine which zero-crossing prediction times to use and the specific application strategy based on the confidence level.
[0061] Based on the above embodiments, the step of establishing a mathematical model of the AC signal to be detected within the preset amplitude range based on the second sampled value and its corresponding sampling time, and determining the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range, includes: The sampling points within the preset amplitude range are divided into multiple sampling point groups, and the second sampling value in each sampling point group and its corresponding sampling time are fitted to obtain the mathematical model corresponding to each sampling point group. The moment when the signal amplitude is zero in the mathematical model corresponding to each sampling point group is determined as the zero-crossing prediction moment.
[0062] Specifically, in determining the zero-crossing prediction time, sampling points within a preset amplitude range can be divided into multiple sampling point groups. A polynomial fitting method is then used to fit the second sampled value and its corresponding sampling time in each sampling point group, resulting in a mathematical model for each group. For example, each sampling point group includes 5 sampling points. The fitting function used for polynomial fitting can be a fourth-order polynomial. By substituting the second sampled value and its corresponding sampling time of each of the 5 sampling points into the fourth-order polynomial, a polynomial system consisting of 5 fourth-order polynomials can be obtained. Solving this polynomial system yields the mathematical model corresponding to the sampling group. For example, the mathematical model for a given sampling group can be expressed as: ,in , , , , Let be the polynomial coefficients. 0. Solving this polynomial system yields the t value, which is the predicted time of the zero-crossing point of each AC signal within the sampling group.
[0063] In this embodiment of the invention, by decomposing the preset amplitude range, the fitting efficiency can be improved and the determination efficiency of the zero-crossing prediction time can be increased.
[0064] like Figure 6As shown, based on the above embodiments, this embodiment of the invention also provides an AC signal zero-crossing detection system based on a segmented sampling strategy, including: a first acquisition module 61, a second acquisition module 62, and a data processing module 63; both the first acquisition module 61 and the second acquisition module 62 are connected to the data processing module 63; The first acquisition module 61 is used to continuously sample the AC signal to be detected, determine the first sampling value, and determine the target time point when the AC signal to be detected enters the preset amplitude range near zero based on the first sampling value. The second acquisition module 62 is used to continuously sample the AC signal to be detected within the preset amplitude range starting from the target time point, and determine the second sampled value and its corresponding sampling time. The data processing module 63 is used to establish a mathematical model of the AC signal to be detected within the preset amplitude range based on the second sampled value and its corresponding sampling time, and to determine the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range. The sampling frequency of the first acquisition module is lower than that of the second acquisition module.
[0065] In this embodiment of the invention, the data processing module may employ chips or devices with data processing capabilities, such as microcontrollers, digital signal processors (DSPs), or field programmable gate arrays (FPGAs).
[0066] Based on the above embodiments, such as Figure 7 As shown in the embodiment of the present invention, the AC signal zero-crossing detection system based on a segmented sampling strategy includes a first acquisition module 61 comprising a first signal conditioning circuit, a first analog-to-digital (A / D) converter, and a first microprocessor; and a second acquisition module 62 comprising a second signal conditioning circuit, a second A / D converter, and a second microprocessor. Both the first and second signal conditioning circuits are used to filter, amplify, and process the AC signal to be detected, so that the first and second A / D converters can process it. Both the first and second A / D converters convert the input analog signal into a digital signal, and sample the signal during the conversion process.
[0067] The first microprocessor is used to determine the target time point when the AC signal to be detected enters a preset amplitude range near zero, based on the first sampled value.
[0068] The second microprocessor is used to control the sampling process of the second analog-to-digital converter and to record the second sampled value and the corresponding sampling time.
[0069] Here, the frequency response characteristics of the second signal conditioning circuit are superior to those of the first signal conditioning circuit, ensuring better maintenance of sampling accuracy within the preset amplitude range. The frequency response characteristics may include the frequency response bandwidth; that is, the frequency response bandwidth of the second signal conditioning circuit is wider than that of the first signal conditioning circuit.
[0070] The second analog-to-digital converter has a higher bit depth and conversion rate than the first analog-to-digital converter to achieve high-precision, high-frequency sampling.
[0071] In this embodiment of the invention, the specific structures and differences between the first acquisition module and the second acquisition module are given, which can implement two sampling strategies with different sampling frequencies.
[0072] Based on the above embodiments, the AC signal zero-crossing detection system based on a segmented sampling strategy provided in this embodiment of the invention includes multiple sampling point groups in the preset amplitude range; The data processing module is also used for: Based on the second sampled value of each sampled point in the target sampling point group corresponding to the zero-crossing prediction time, calculate the slope sequence formed by the slope between every two adjacent sampled points in the target sampling point group, and calculate the average slope within the slope sequence based on the slope sequence. Based on the difference between every two adjacent slopes in the slope sequence and the average slope, the slope fluctuation index within the target sampling point group is calculated. Based on the slope fluctuation index, the confidence level of the zero-crossing prediction time is calculated.
[0073] Based on the above embodiments, the AC signal zero-crossing detection system based on a segmented sampling strategy provided in this embodiment of the invention further includes a data processing module for: If the slope volatility index is less than the minimum volatility threshold, then the confidence level is determined to be 100%. If the slope volatility index is greater than or equal to the minimum volatility threshold and less than or equal to the maximum volatility threshold, then the confidence level is determined based on the slope volatility index, the minimum volatility threshold, and the maximum volatility threshold. If the slope fluctuation index is greater than the maximum fluctuation threshold, then the confidence level is determined to be zero. Wherein, the minimum fluctuation threshold is less than the maximum fluctuation threshold.
[0074] Based on the above embodiments, such as Figure 7 As shown, the AC signal zero-crossing detection system based on a segmented sampling strategy provided in this embodiment of the invention also includes a communication module 64; The communication module 64 is communicatively connected to the data processing module 63 and the target device, respectively.
[0075] Specifically, the target device can be an external device or a host computer. The communication module enables data transmission and communication between the AC signal zero-crossing detection system based on the segmented sampling strategy and the target device. The communication module 64 can be used to send the zero-crossing prediction time and its confidence level to the target device, and can also be used to receive control commands sent by the target device, thereby enabling remote configuration and management of the AC signal zero-crossing detection system based on the segmented sampling strategy.
[0076] Here, the communication module can adopt a variety of communication methods, such as wireless communication modules (including short-range wireless communication technologies such as ZigBee and Bluetooth) or wired communication interfaces (such as RS-232, RS-485, Ethernet, etc.).
[0077] Based on the above embodiments, the AC signal zero-crossing detection system based on a segmented sampling strategy provided in this embodiment of the invention, wherein the data processing module is specifically used for: The sampling points within the preset amplitude range are divided into multiple sampling point groups, and the second sampling value in each sampling point group and its corresponding sampling time are fitted to obtain the mathematical model corresponding to each sampling point group. The moment when the signal amplitude is zero in the mathematical model corresponding to each sampling point group is determined as the zero-crossing prediction moment.
[0078] Specifically, the functions of each module in the AC signal zero-crossing detection system based on a segmented sampling strategy provided in this embodiment of the invention correspond one-to-one with the operation flow of each step in the above-described method-like embodiments, and the achieved effects are also the same. For details, please refer to the above embodiments, and this will not be repeated in this embodiment of the invention.
[0079] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute the AC signal zero-crossing detection method based on a segmented sampling strategy provided in the above embodiments.
[0080] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to related technologies, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the AC signal zero-crossing detection method based on the segmented sampling strategy provided in the above embodiments.
[0082] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the AC signal zero-crossing detection method based on a segmented sampling strategy provided in the above embodiments. This computer-readable storage medium can be either a non-transitory computer-readable storage medium or a transient computer-readable storage medium, and is not specifically limited herein.
[0083] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0084] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting zero-crossing points of AC signals based on a segmented sampling strategy, characterized in that, include: Based on the first acquisition module, the AC signal to be detected is continuously sampled to determine the first sample value, and based on the first sample value, the target time point when the AC signal to be detected enters the preset amplitude range near zero is determined. Based on the second acquisition module, starting from the target time point, the AC signal to be detected is continuously sampled within the preset amplitude range to determine the second sampled value and its corresponding sampling time; Based on the second sampled value and its corresponding sampling time, a mathematical model of the AC signal to be detected within the preset amplitude range is established, and the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range is determined. The sampling frequency of the first acquisition module is lower than that of the second acquisition module.
2. The AC signal zero-crossing detection method based on a segmented sampling strategy according to claim 1, characterized in that, The preset amplitude range includes multiple sampling point groups; after determining the zero-crossing prediction time when the signal amplitude is zero in the mathematical model, the method further includes: Based on the second sampled value of each sampled point in the target sampling point group corresponding to the zero-crossing prediction time, calculate the slope sequence formed by the slope between every two adjacent sampled points in the target sampling point group, and calculate the average slope within the slope sequence based on the slope sequence. Based on the difference between every two adjacent slopes in the slope sequence and the average slope, the slope fluctuation index within the target sampling point group is calculated. Based on the slope fluctuation index, the confidence level of the zero-crossing prediction time is calculated.
3. The AC signal zero-crossing detection method based on a segmented sampling strategy according to claim 2, characterized in that, The step of calculating the confidence level of the zero-crossing prediction time based on the slope fluctuation index includes: If the slope volatility index is less than the minimum volatility threshold, then the confidence level is determined to be 100%. If the slope volatility index is greater than or equal to the minimum volatility threshold and less than or equal to the maximum volatility threshold, then the confidence level is determined based on the slope volatility index, the minimum volatility threshold, and the maximum volatility threshold. If the slope fluctuation index is greater than the maximum fluctuation threshold, then the confidence level is determined to be zero. Wherein, the minimum fluctuation threshold is less than the maximum fluctuation threshold.
4. The AC signal zero-crossing detection method based on a segmented sampling strategy according to claim 2, characterized in that, The step of calculating the confidence level of the zero-crossing prediction time based on the slope fluctuation index includes: The zero-crossing prediction time and its confidence level are sent to the target device.
5. The AC signal zero-crossing detection method based on a segmented sampling strategy according to claim 1, characterized in that, The step of establishing a mathematical model of the AC signal to be detected within the preset amplitude range based on the second sampled value and its corresponding sampling time, and determining the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range, includes: The sampling points within the preset amplitude range are divided into multiple sampling point groups, and the second sampling value in each sampling point group and its corresponding sampling time are fitted to obtain the mathematical model corresponding to each sampling point group. The moment when the signal amplitude is zero in the mathematical model corresponding to each sampling point group is determined as the zero-crossing prediction moment.
6. A zero-crossing detection system for AC signals based on a segmented sampling strategy, characterized in that, include: The system comprises a first acquisition module, a second acquisition module, and a data processing module. Both the first acquisition module and the second acquisition module are connected to the data processing module; The first acquisition module is used to continuously sample the AC signal to be detected, determine the first sample value, and determine the target time point when the AC signal to be detected enters the preset amplitude range near zero based on the first sample value. The second acquisition module is used to continuously sample the AC signal to be detected within the preset amplitude range starting from the target time point, and determine the second sample value and its corresponding sampling time; The data processing module is used to establish a mathematical model of the AC signal to be detected within the preset amplitude range based on the second sampled value and its corresponding sampling time, and to determine the zero-crossing prediction time of the signal amplitude being zero in the mathematical model within the preset amplitude range. The sampling frequency of the first acquisition module is lower than that of the second acquisition module.
7. The AC signal zero-crossing detection system based on a segmented sampling strategy according to claim 6, characterized in that, The first acquisition module includes a first signal conditioning circuit, a first analog-to-digital converter, and a first microprocessor; the second acquisition module includes a second signal conditioning circuit, a second analog-to-digital converter, and a second microprocessor. The frequency response characteristics of the second signal conditioning circuit are better than those of the first signal conditioning circuit; The second analog-to-digital converter has a higher bit depth and conversion rate than the first analog-to-digital converter.
8. The AC signal zero-crossing detection system based on a segmented sampling strategy according to claim 6 or 7, characterized in that, It also includes a communication module; The communication module is communicatively connected to both the data processing module and the target device.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the AC signal zero-crossing detection method based on the segmented sampling strategy as described in any one of claims 1-5.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the AC signal zero-crossing detection method based on the segmented sampling strategy as described in any one of claims 1-5.