Method, device and electronic device for determining zero-crossing value of AC signal

By determining the sampling period and sampling difference of the AC signal and calculating the zero crossing value of the AC signal, the problem of low calculation accuracy of the AC signal in the prior art is solved, and the calculation accuracy is improved.

CN114859109BActive Publication Date: 2025-04-18ECOFLOW INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210364907.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-04-18
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

When calculating the effective value of an AC signal, the calculation accuracy decreases due to the deviation of the theoretical value of the AC signal zero crossing point.

Method used

By obtaining the AC period of the AC signal, at least one sampling period is determined, the AC signal is sampled according to the preset sampling frequency during the sampling period, the sampling difference value during the sampling period is calculated, and the sampling value corresponding to the minimum sampling difference value is determined as the zero crossing value of the AC signal.

Benefits of technology

The deviation between the zero crossing value of the AC signal and the actual value is reduced, and the calculation accuracy of the effective value of the AC signal is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114859109B_ABST
    Figure CN114859109B_ABST
Patent Text Reader

Abstract

The present application provides a method, device and electronic device for determining the zero-crossing value of an AC signal, and relates to the field of AC signal technology, wherein the method comprises: first obtaining the AC cycle of the AC signal, and determining at least one sampling cycle according to the AC cycle of the AC signal; then sampling the AC signal according to a preset sampling frequency in the sampling cycle; then determining N sampling differences according to each sampling value collected in the sampling cycle, and determining the minimum sampling difference from the N sampling differences; finally determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference of the sampling cycle. The technical solution provided by the present application can reduce the deviation between the zero-crossing value and the actual value of the AC signal, thereby improving the calculation accuracy when calculating the effective value of the AC signal according to the zero-crossing value of the AC signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of alternating current signals, and in particular to a method, device and electronic device for determining a zero-crossing value of an alternating current signal. Background Art

[0002] A single-chip microcomputer is commonly used in circuits to perform high-frequency analog-to-digital (AD) sampling on the AC signal of one cycle of the AC power, and then calculate the effective value of the AC signal based on the instantaneous sampling value of the AD sampling and the zero-crossing value of the AC signal.

[0003] During calculation, the theoretical value of the zero-crossing point of the AC signal is generally used instead of the zero-crossing value of the AC signal. However, due to the existence of resistance in the circuit and the precision loss of related components in the circuit, there will be a deviation between the theoretical value of the zero-crossing point of the AC signal and the actual value, resulting in a deviation in the calculation of the effective value of the AC signal.

[0004] At present, the commonly used method for calibrating the zero-crossing value of the AC signal is to input a fixed signal at the factory stage of the equipment, and compare the actual sampling value of the signal when it crosses the zero point with the theoretical value of the AC signal zero-crossing point to correct the zero-crossing value of the AC signal. However, due to factors such as long-term operation and aging of the equipment, the zero-crossing value of the AC signal corrected at the factory stage will deviate from the actual value, affecting the calculation accuracy of the effective value of the AC signal. Summary of the invention

[0005] In view of this, the present application provides a method, device and electronic device for determining the zero-crossing value of an AC signal, so as to reduce the deviation between the zero-crossing value of the AC signal and the actual value, thereby improving the calculation accuracy of the effective value of the AC signal.

[0006] In order to achieve the above objectives, in a first aspect, an embodiment of the present application provides a method for determining a zero-crossing value of an AC signal, comprising:

[0007] Obtaining the AC period of the AC signal;

[0008] Determining at least one sampling period according to the AC period of the AC signal;

[0009] In the sampling period, the AC signal is sampled according to a preset sampling frequency, the sampling period includes an upper half period and a lower half period, the upper half period and the lower half period are equal in duration, and the sampling number of the upper half period and the sampling number of the lower half period are both N;

[0010] Determine N sampling differences according to each sampling value collected in the sampling period, and determine the minimum sampling difference from the N sampling differences; wherein the nth sampling difference is the absolute value of the difference between the nth sampling value in the upper half of the sampling period and the nth sampling value in the lower half of the sampling period, 0 <n≤N;

[0011] The zero-crossing value of the AC signal is determined according to the sampling value corresponding to the minimum sampling difference value of the sampling period.

[0012] As an optional implementation of the embodiment of the present application, determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period includes:

[0013] An average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period is calculated, and the average value of the two sampling values ​​is used as the zero-crossing value of the sampling period.

[0014] As an optional implementation of the embodiment of the present application, determining at least one sampling period according to the AC period of the AC signal includes:

[0015] Determining a preset number of sampling periods according to an AC period of the AC signal;

[0016] Determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period includes:

[0017] Determine a zero-crossing point estimation value of the sampling period according to two sampling values ​​corresponding to the minimum sampling difference value of the sampling period;

[0018] The zero-crossing value of the AC signal is determined according to the preset number and the zero-crossing point estimation value of each sampling period.

[0019] As an optional implementation of the embodiment of the present application, determining the zero-crossing point estimation value of the sampling period according to the two sampling values ​​corresponding to the minimum sampling difference value of the sampling period includes:

[0020] The average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period is calculated, and the average value of the two sampling values ​​is used as the zero-crossing point estimation value of the sampling period.

[0021] As an optional implementation of the embodiment of the present application, determining the zero-crossing value of the AC signal according to the preset number and the zero-crossing point estimation value of each sampling period includes:

[0022] According to the preset number and the zero-crossing point estimation value of each sampling period, a zero-crossing point average value is calculated, and the zero-crossing point average value is used as the zero-crossing value of the AC signal.

[0023] As an optional implementation of the embodiment of the present application, determining at least one sampling period according to the AC period of the AC signal includes:

[0024] Obtaining the duration of the communication cycle;

[0025] The duration of the sampling period is set to be consistent with the duration of the AC period.

[0026] As an optional implementation of the embodiment of the present application, the sampling value is a voltage value, and correspondingly, the zero-crossing value of the AC signal is a zero-crossing voltage value of the AC signal.

[0027] In a second aspect, an embodiment of the present application provides a device for determining a zero-crossing value of an AC signal, comprising:

[0028] An acquisition module, used for acquiring an AC cycle of an AC signal;

[0029] A first determining module, configured to determine at least one sampling period according to an AC period of the AC signal;

[0030] A sampling module, used for sampling the AC signal at a preset sampling frequency within the sampling period, wherein the sampling period includes an upper half period and a lower half period, the upper half period and the lower half period are equal in duration, and the sampling number of the upper half period and the sampling number of the lower half period are both N;

[0031] The second determination module is used to determine N sampling difference values ​​according to each sampling value collected in the sampling period, and determine the minimum sampling difference value from the N sampling difference values; wherein the nth sampling difference value is the absolute value of the difference between the nth sampling value in the upper half period of the sampling period and the nth sampling value in the lower half period, 0 <n≤N;

[0032] The third determination module is used to determine the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a first timer, a second timer, a sampler, and a processor, wherein an interrupt frequency of the first timer is 2N times an interrupt frequency of the second timer;

[0034] The sampler is used for sampling the AC signal after receiving the interrupt signal of the first timer;

[0035] The processor is used to obtain the AC cycle of the AC signal; determine at least one sampling cycle according to the AC cycle of the AC signal; after receiving the interrupt signal of the second timer, obtain the sampling value collected by the sampler within the sampling cycle, determine N sampling difference values ​​according to each sampling value collected within the sampling cycle, and determine the minimum sampling difference value from the N sampling difference values; wherein the sampling cycle is the same as the duration of the interrupt cycle of the second timer, the sampling cycle includes an upper half cycle and a lower half cycle, the duration of the upper half cycle and the duration of the lower half cycle are equal, the number of samples in the upper half cycle and the number of samples in the lower half cycle are both N, the nth sampling difference is the absolute value of the difference between the nth sampling value in the upper half cycle of the sampling cycle and the nth sampling value in the lower half cycle, 0 <n≤N;

[0036] The zero-crossing value of the AC signal is determined according to the sampling value corresponding to the minimum sampling difference value of the sampling period.

[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for determining a zero-crossing value described in the first aspect or any one of the embodiments of the first aspect is implemented.

[0038] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on the electronic device, the electronic device executes the zero-crossing value determination method described in any one of the first aspects above.

[0039] The method, device and electronic device for determining the zero-crossing value of an alternating current signal provided by the embodiments of the present application first obtain the alternating current period of the alternating current signal, and determine at least one sampling period according to the alternating current period of the alternating current signal; then, within the sampling period, sample the alternating current signal respectively according to a preset sampling frequency; then determine N sampling differences according to the respective sampling values collected within the sampling period, and determine the minimum sampling difference from the N sampling differences; finally, determine the zero-crossing value of the alternating current signal according to the sampling value corresponding to the minimum sampling difference of the sampling period, where the sampling period includes an upper half period and a lower half period, the durations of the upper half period and the lower half period are equal, the number of samplings in the upper half period and the lower half period is N, and the nth sampling difference is the absolute value of the difference between the nth sampling value in the upper half period and the nth sampling value in the lower half period of the sampling period, 0 < n ≤ N. In this technical solution, the sampling values of the upper half period and the lower half period corresponding to the minimum sampling difference within at least one sampling period can be obtained. Since the absolute value of the difference between the sampling value in the upper half period and the sampling value in the lower half period of the alternating current signal is the smallest at the zero-crossing point, the zero-crossing value of the alternating current signal determined according to the sampling values of the upper half period and the lower half period corresponding to the minimum sampling difference of each sampling period has a very small deviation from the actual value of the zero-crossing point of the alternating current signal. In this way, the deviation between the zero-crossing value of the alternating current signal and the actual value can be reduced, so that the calculation accuracy can be improved when calculating the effective value of the alternating current signal according to the zero-crossing value of the alternating current signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a schematic flowchart of the method for determining the zero-crossing value of the alternating current signal provided by the embodiments of the present application;

[0041] Figure 2 is a schematic diagram of the sampling period provided by the embodiments of the present application;

[0042] Figure 3 is a schematic structural diagram of the device for determining the zero-crossing value of the alternating current signal provided by the embodiments of the present application;

[0043] Figure 4 is a schematic structural diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the implementation part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. These several specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0045] When calculating the effective value of an AC signal in a circuit, a single-chip microcomputer is generally used to perform high-frequency analog-to-digital sampling on the AC signal of one cycle of the AC power, and then the effective value of the AC signal is calculated based on the instantaneous sampling value of the AD sampling and the zero-crossing value of the AC signal. Since the zero-crossing value of the AC signal is constantly changing, the theoretical value of the zero-crossing point of the AC signal is generally used instead of the zero-crossing value of the AC signal during calculation. However, due to the existence of resistance in the circuit and the precision loss of related components in the circuit, there will be a deviation between the theoretical value of the zero-crossing point of the AC signal and the actual value, resulting in a deviation in the calculation of the effective value of the AC signal.

[0046] To address the above problem, a fixed signal is usually input when the equipment leaves the factory. The zero-crossing value of the AC signal is corrected by comparing the actual sampling value of the signal when it passes through the zero point with the theoretical value of the AC signal when it passes through the zero point. The corrected zero-crossing value is used as the zero-crossing value of the AC signal in subsequent use.

[0047] However, due to factors such as long-term operation and aging of the equipment, the zero-crossing value of the AC signal corrected by the above scheme may deviate from the actual value, thereby affecting the calculation accuracy of the effective value of the AC signal. In view of this, an embodiment of the present application provides a method for determining the zero-crossing value of an AC signal, which is used to reduce the deviation between the zero-crossing value of the AC signal and the actual value and improve the calculation accuracy of the effective value of the AC signal.

[0048] Figure 1 A flow chart of a method for determining a zero-crossing value of an AC signal provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps:

[0049] S110: Acquire an AC cycle of an AC signal.

[0050] Specifically, when it is necessary to determine the zero-crossing value of the AC signal, the AC cycle of the AC signal can be obtained by detecting the interval between adjacent peaks or adjacent troughs of the AC signal. For example, if the interval between adjacent peaks of the AC signal is detected to be 20ms, the duration of the AC cycle of the AC signal is 20ms. In actual use, because the AC frequency of the AC signal is different, its AC cycle is also different. For example, when the AC frequency of the AC signal is 50Hz, its AC cycle is 20ms. If the AC frequency of the AC signal is 60Hz, its AC cycle is about 16.67ms. In this embodiment, if the zero-crossing point of the AC signal is to be detected, it is necessary to first determine the AC cycle of the AC signal. More specifically, the AC signal can be an AC signal input to a load, or it can be an AC signal output by a DC to AC device or an AC to AC device.

[0051] S120: Determine at least one sampling period according to an AC period of the AC signal.

[0052] Specifically, one or more sampling periods can be determined according to the AC period of the AC signal. The duration of the sampling period can be equal to the duration of the AC period of the AC signal. The duration of each sampling period can be equal. For example, the duration of the AC period is 20 ms, and the duration of each sampling period is 20 ms.

[0053] If there are multiple sampling periods, the multiple sampling periods may be from the first sampling period to the most recent sampling period, or may be a fixed number of sampling periods closest to the current moment.

[0054] Multiple sampling periods can be continuous. When sampling, continuous sampling can be performed within multiple sampling periods. Multiple sampling periods can also be set at intervals. When sampling, the AC signal can be sampled for one sampling period at each interval. The interval duration can be an integer multiple of the duration of the sampling period. For example, according to the AC cycle of the AC signal, 10 sampling periods are determined, and the duration of each sampling period is 20ms. Then, a sampling period can be set every 40ms, that is, a sampling of 20ms is performed every 40ms.

[0055] The sampling period may include an upper half period and a lower half period, and the upper half period and the lower half period are equal in duration.

[0056] It can be understood that the starting point of the sampling period may be the position of the peak or trough of the AC signal, or any other position of the AC signal, which is not specifically limited in this embodiment.

[0057] S130 . Within a sampling period, sample the AC signal according to a preset sampling frequency.

[0058] When sampling an AC signal, the voltage value of the AC signal may be sampled, or the current value of the AC signal may be sampled. In the following, the present implementation will be described by taking the sampling of the voltage value of the AC signal as an example.

[0059] The sampling frequency can be an even multiple of the frequency of the sampling cycle (i.e., the frequency of the AC cycle), and the number of samples in the upper half cycle and the number of samples in the lower half cycle can be equal. For example, if the frequency of the sampling cycle is 50 Hz, the sampling frequency can be 10000 Hz, that is, 200 samples are taken in each sampling cycle to obtain 200 voltage points, of which 100 are in the upper half cycle and 100 are in the lower half cycle. The time intervals between adjacent sampling points can be equal.

[0060] Figure 2 A schematic diagram of a sampling period provided in an embodiment of the present application, such as Figure 2As shown, the starting point of the sampling cycle is between the peak and the zero crossing point of the AC signal, and the duration of the upper half cycle and the lower half cycle are both 10ms. The number of samples in this sampling cycle is 40, of which the number of samples in the upper half cycle and the number of samples in the lower half cycle are 20 respectively, and the interval time between each sampling point is equal.

[0061] During sampling, the single chip microcomputer can collect the voltage analog signal of the alternating current in the circuit according to the preset sampling frequency, and then convert the voltage analog signal into a digital signal through analog-to-digital conversion to obtain the voltage value.

[0062] It is understandable that after sampling in a sampling cycle is completed, the sampling data of the sampling cycle can be stored in a database or cache, so that when the next sampling cycle starts, the sampling data of the sampling cycle is read from the storage location to calculate the zero-crossing value of the AC signal.

[0063] In addition, if there is a certain interval between adjacent sampling cycles, after the sampling of a sampling cycle is completed, the sampling data of the sampling cycle can be stored in a database or cache, and then in the interval between the sampling cycle and the next sampling cycle, the sampling data of the sampling cycle can be read from the storage location to calculate the zero-crossing value of the AC signal.

[0064] S140 . Determine N sampling differences according to each sampling value collected within a sampling period, and determine a minimum sampling difference from the N sampling differences.

[0065] In a sampling cycle, the nth sampling difference value among N sampling difference values ​​is the absolute value of the difference between the nth sampling value in the first half of the sampling cycle and the nth sampling value in the second half of the sampling cycle, where 0 <n≤N。

[0066] For example, in a sampling cycle, 200 samples are collected in the first half cycle and 200 samples are collected in the second half cycle. The first sampling value in the first half cycle can be subtracted from the first sampling value in the second half cycle to obtain the first sampling difference value. The second sampling value in the first half cycle can be subtracted from the second sampling value in the second half cycle to obtain the second sampling difference value. This can be repeated to obtain 200 sampling differences. According to the characteristics of the AC signal, there will only be one minimum sampling difference value among the 200 sampling differences. The minimum sampling difference value among the 200 sampling differences can be further determined.

[0067] S150 . Determine the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period.

[0068] If the sampling period is determined to be one according to the AC period of the AC signal, the average of the sampling value of the upper half period and the sampling value of the lower half period corresponding to the minimum sampling difference of this sampling period can be calculated first, and then the average of the two sampling values ​​is used as the zero-crossing value of the AC signal. For example, the minimum sampling difference in a sampling period is 2, and this minimum sampling difference is the difference between the 10th sampling value of the upper half period (for example, 2050mV) and the 10th sampling value of the lower half (for example, 2048mV), then the zero-crossing value of the AC signal is (2050+2048) / 2=2049mV.

[0069] If multiple sampling periods are determined based on the AC period of the AC signal, the average values ​​of the upper half-period sampling values ​​and the lower half-period sampling values ​​corresponding to the minimum sampling difference of each sampling period can be calculated respectively, and each average value can be used as the zero-crossing point estimation value of each corresponding sampling period.

[0070] Then, the sum of the estimated zero-crossing values ​​of each sampling period is divided by the number of sampling periods to obtain the average value of the zero-crossing points of these sampling periods, and the average value of the zero-crossing points is used as the zero-crossing value of the AC signal. For example, if the sampling period is determined to be 3, through calculation, the estimated zero-crossing values ​​of these 3 sampling periods are 2048mV, 2050mV and 2052mV respectively, then the zero-crossing value of the AC signal is (2048+2050+2052) / 3=2050mV.

[0071] It is understandable that if the sampling period determined according to the AC period of the AC signal is multiple, the upper half period sampling value and the lower half period sampling value corresponding to the minimum sampling difference of each sampling period can also be directly added, and then the result of the addition is divided by the number of sampling periods, and then divided by 2, and the final result is used as the zero-crossing value of the AC signal. For example, the sampling period determined is 3, and the upper half period sampling value and the lower half period sampling value corresponding to the minimum sampling difference of these 3 sampling periods are (2046mV, 2050mV), (2049mV, 2051mV) and (2051mV, 2053mV), respectively, then the zero-crossing value of the AC signal is (2046+2050+2049+2051+2051+2053) / (3*2)=2050mV.

[0072] The method, device and electronic device for determining the zero-crossing value of an alternating current signal provided by the embodiments of the present application first obtain the alternating current period of the alternating current signal, and determine at least one sampling period according to the alternating current period of the alternating current signal; then, within the sampling period, sample the alternating current signal respectively according to a preset sampling frequency; then determine N sampling differences according to the respective sampling values collected within the sampling period, and determine the minimum sampling difference from the N sampling differences; finally, determine the zero-crossing value of the alternating current signal according to the sampling value corresponding to the minimum sampling difference of the sampling period, where the sampling period includes an upper half period and a lower half period, the durations of the upper half period and the lower half period are equal, the number of samplings in the upper half period and the lower half period are both N, and the nth sampling difference is the absolute value of the difference between the nth sampling value in the upper half period and the nth sampling value in the lower half period of the sampling period, 0 < n ≤ N. In this technical solution, the sampling values of the upper half period and the lower half period corresponding to the minimum sampling difference within at least one sampling period can be obtained. Since the absolute value of the difference between the sampling value in the upper half period and the sampling value in the lower half period of the alternating current signal is the smallest at the zero-crossing point, the zero-crossing value of the alternating current signal determined according to the sampling values of the upper half period and the lower half period corresponding to the minimum sampling difference of each sampling period has a very small deviation from the actual value of the zero-crossing point of the alternating current signal. In this way, the deviation between the zero-crossing value and the actual value of the alternating current signal can be reduced, so that the calculation accuracy can be improved when calculating the effective value of the alternating current signal according to the zero-crossing value of the alternating current signal.

[0073] Based on the same inventive concept, the embodiments of the present application further provide a device for determining the zero-crossing value of an alternating current signal. Figure 3 As shown in the structural schematic diagram of the device for determining the zero-crossing value of an alternating current signal provided by the embodiments of the present application, Figure 3 As shown, the device for determining the zero-crossing value of an alternating current signal provided by the embodiments of the present application may include:

[0074] An acquisition module 11, configured to acquire the alternating current period of the alternating current signal;

[0075] A first determination module 12, configured to determine at least one sampling period according to the alternating current period of the alternating current signal;

[0076] A sampling module 13, configured to sample the alternating current signal respectively according to a preset sampling frequency within the sampling period, where the sampling period includes an upper half period and a lower half period, the durations of the upper half period and the lower half period are equal, and the number of samplings in the upper half period and the lower half period are both N;

[0077] The second determination module 14 is used to determine N sampling difference values ​​according to each sampling value collected in the sampling period, and determine the minimum sampling difference value from the N sampling difference values; wherein the nth sampling difference value is the absolute value of the difference between the nth sampling value in the upper half period of the sampling period and the nth sampling value in the lower half period, 0 <n≤N;

[0078] The third determination module 15 is used to determine the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period.

[0079] As an optional implementation manner, the third determining module 15 is specifically configured to:

[0080] An average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period is calculated, and the average value of the two sampling values ​​is used as the zero-crossing value of the sampling period.

[0081] As an optional implementation manner, the first determining module 12 is specifically configured to:

[0082] Determining a preset number of sampling periods according to an AC period of the AC signal;

[0083] The third determining module 15 is further used for:

[0084] Determine the zero-crossing point estimation value of the sampling period according to the two sampling values ​​corresponding to the minimum sampling difference value of the sampling period; determine the zero-crossing value of the AC signal according to the preset number and the zero-crossing point estimation value of each sampling period.

[0085] As an optional implementation manner, the third determining module 15 is specifically configured to:

[0086] The average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period is calculated, and the average value of the two sampling values ​​is used as the zero-crossing point estimation value of the sampling period.

[0087] As an optional implementation manner, the third determining module 15 is specifically configured to:

[0088] According to the preset number and the zero-crossing point estimation value of each sampling period, a zero-crossing point average value is calculated, and the zero-crossing point average value is used as the zero-crossing value of the AC signal.

[0089] As an optional implementation manner, the first determining module 12 is specifically configured to:

[0090] Acquire the duration of the AC cycle; and set the duration of the sampling cycle to be consistent with the duration of the AC cycle.

[0091] As an optional implementation manner, the sampling value is a voltage value, and correspondingly, the zero-crossing value of the AC signal is a zero-crossing voltage value of the AC signal.

[0092] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device provided by this embodiment includes: a first timer 210, a second timer 220, a sampler 230 and a processor 240, and the interrupt frequency of the first timer 210 is 2N times the interrupt frequency of the second timer 220;

[0093] The sampler 230 is used to sample the AC signal after receiving the interrupt signal of the first timer 210;

[0094] The processor 240 is used to obtain the AC cycle of the AC signal; determine at least one sampling cycle according to the AC cycle of the AC signal; after receiving the interrupt signal of the second timer 220, obtain the sampling value collected by the sampler 230 within the sampling cycle, determine N sampling differences according to each sampling value collected within the sampling cycle, and determine the minimum sampling difference from the N sampling differences; wherein the sampling cycle is the same as the duration of the interrupt cycle of the second timer 220, the sampling cycle includes an upper half cycle and a lower half cycle, the duration of the upper half cycle and the duration of the lower half cycle are equal, the number of samples in the upper half cycle and the number of samples in the lower half cycle are both N, the nth sampling difference is the absolute value of the difference between the nth sampling value in the upper half cycle of the sampling cycle and the nth sampling value in the lower half cycle, 0 <n≤N;

[0095] The zero-crossing value of the AC signal is determined according to the sampling value corresponding to the minimum sampling difference value of the sampling period.

[0096] As an optional implementation, the processor 240 is specifically configured to calculate an average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period, and use the average value of the two sampling values ​​as the zero-crossing value of the sampling period.

[0097] As an optional implementation, the processor 240 is specifically configured to: determine a preset number of sampling periods according to an AC period of the AC signal;

[0098] Determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period includes:

[0099] Determine a zero-crossing point estimation value of the sampling period according to two sampling values ​​corresponding to the minimum sampling difference value of the sampling period;

[0100] The zero-crossing value of the AC signal is determined according to the preset number and the zero-crossing point estimation value of each sampling period.

[0101] As an optional implementation, the processor 240 is specifically used to: calculate the average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period, and use the average value of the two sampling values ​​as the zero-crossing point estimation value of the sampling period.

[0102] As an optional implementation, the processor 240 is specifically used to: calculate the zero-crossing average value according to the preset number and the zero-crossing estimated value of each sampling period, and use the zero-crossing average value as the zero-crossing value of the AC signal.

[0103] As an optional implementation manner, the processor 240 is specifically configured to:

[0104] Obtaining the duration of the communication cycle;

[0105] The duration of the sampling period is set to be consistent with the duration of the AC period.

[0106] As an optional implementation manner, the sampling value is a voltage value, and correspondingly, the zero-crossing value of the AC signal is a zero-crossing voltage value of the AC signal.

[0107] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0108] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiment is implemented.

[0109] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the method described in the above method embodiment when executing the computer program product.

[0110] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0111] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0112] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media can include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0113] The naming or numbering of the steps in this application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The named or numbered process steps can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.

[0114] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0115] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0116] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0117] In the description of this application, unless otherwise specified, " / " indicates that the objects associated with each other are in an "or" relationship, for example, A / B can represent A or B; "and / or" in this application is merely a description of the association relationship between associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.

[0118] Furthermore, in the description of this application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0119] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0120] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.

[0121] References described in the specification of the present application to "one embodiment" or "some embodiments" etc. mean that one or more embodiments of the present application include a specific feature, structure or characteristic described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in the specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining a zero-crossing value of an AC signal, characterized in that: include: Obtaining the AC period of the AC signal; Determining at least one sampling period according to the AC period of the AC signal; In the sampling period, the AC signal is sampled according to a preset sampling frequency, the sampling period includes an upper half period and a lower half period, the upper half period and the lower half period are equal in duration, and the sampling number of the upper half period and the sampling number of the lower half period are both N; Determine N sampling differences according to each sampling value collected in the sampling period, and determine the minimum sampling difference from the N sampling differences; wherein the nth sampling difference is the absolute value of the difference between the nth sampling value in the upper half of the sampling period and the nth sampling value in the lower half of the sampling period, 0 <n≤N; Determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period; Wherein, determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period includes: An average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period is calculated, and the average value of the two sampling values ​​is used as the zero-crossing value of the sampling period.

2. The method for determining a zero-crossing value according to claim 1, wherein: The determining at least one sampling period according to the AC period of the AC signal comprises: Determining a preset number of sampling periods according to an AC period of the AC signal; Determining the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference value of the sampling period includes: Determine a zero-crossing point estimation value of the sampling period according to two sampling values ​​corresponding to the minimum sampling difference value of the sampling period; The zero-crossing value of the AC signal is determined according to the preset number and the zero-crossing point estimation value of each sampling period.

3. The method for determining a zero-crossing value according to claim 2, characterized in that: Determining the zero-crossing point estimation value of the sampling period according to the two sampling values ​​corresponding to the minimum sampling difference value of the sampling period includes: The average value of two sampling values ​​corresponding to the minimum sampling difference value of the sampling period is calculated, and the average value of the two sampling values ​​is used as the zero-crossing point estimation value of the sampling period.

4. The method for determining a zero-crossing value according to claim 3, characterized in that: Determining the zero-crossing value of the AC signal according to the preset number and the zero-crossing point estimation value of each sampling period includes: According to the preset number and the zero-crossing point estimation value of each sampling period, a zero-crossing point average value is calculated, and the zero-crossing point average value is used as the zero-crossing value of the AC signal.

5. The method for determining a zero-crossing value according to claim 1, wherein: The determining at least one sampling period according to the AC period of the AC signal comprises: Obtaining the duration of the communication cycle; The duration of the sampling period is set to be consistent with the duration of the AC period.

6. The method for determining a zero-crossing value according to any one of claims 1 to 5, characterized in that: The sampling value is a voltage value, and correspondingly, the zero-crossing value of the AC signal is a zero-crossing voltage value of the AC signal.

7. A device for determining a zero-crossing value of an AC signal, characterized in that: include: An acquisition module, used for acquiring an AC cycle of an AC signal; A first determining module, configured to determine at least one sampling period according to an AC period of the AC signal; A sampling module, used for sampling the AC signal at a preset sampling frequency within the sampling period, wherein the sampling period includes an upper half period and a lower half period, the upper half period and the lower half period are equal in duration, and the sampling number of the upper half period and the sampling number of the lower half period are both N; A second determination module, configured to determine N sampling differences according to each sampling value collected within the sampling period, and determine the minimum sampling difference from the N sampling differences; wherein, the nth sampling difference is the absolute value of the difference between the nth sampling value in the first half period and the nth sampling value in the second half period of the sampling period, 0 < n ≤ N; A third determination module, configured to determine the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference of the sampling period; Specifically, the third determination module is configured to calculate the average value of two sampling values corresponding to the minimum sampling difference of the sampling period, and use the average value of the two sampling values as the zero-crossing value of the sampling period.

8. An electronic device, characterized in that: Comprising: A first timer, a second timer, a sampler and a processor, wherein the interruption frequency of the first timer is 2N times that of the second timer; The sampler is configured to sample the AC signal after receiving the interruption signal of the first timer; The processor is configured to obtain the AC period of the AC signal; determine at least one sampling period according to the AC period of the AC signal; after receiving the interruption signal of the second timer, obtain the sampling values collected by the sampler within the sampling period, determine N sampling differences according to each sampling value collected within the sampling period, and determine the minimum sampling difference from the N sampling differences; wherein, the duration of the sampling period is the same as that of the interruption period of the second timer, the sampling period includes a first half period and a second half period, the durations of the first half period and the second half period are equal, the number of samplings in the first half period and the number of samplings in the second half period are both N, the nth sampling difference is the absolute value of the difference between the nth sampling value in the first half period and the nth sampling value in the second half period of the sampling period, 0 < n ≤ N; determine the zero-crossing value of the AC signal according to the sampling value corresponding to the minimum sampling difference of the sampling period; Specifically, the processor is configured to calculate the average value of two sampling values corresponding to the minimum sampling difference of the sampling period, and use the average value of the two sampling values as the zero-crossing value of the sampling period.

9. 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 zero-crossing value determination method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Method for estimating rotor position of switched reluctance motor without position sensor

    CN101902190A

  • Ero crossing point detecting device, power supply device, and zero crossing point detecting method

    EP3106885A1