AC power supply frequency detection method and device, electrical equipment and storage medium

By monitoring and statistically analyzing the zero-crossing signal of AC power supply voltage, the problem of low accuracy in AC power supply frequency detection has been solved, enabling accurate frequency identification and stable equipment operation under different power grid environments.

CN121878299APending Publication Date: 2026-04-17GUANGDONG GALANZ ENTERPRISES CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG GALANZ ENTERPRISES CO LTD
Filing Date
2026-01-08
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

AC power frequency detection has low accuracy in electrical equipment, affecting equipment performance and efficiency, especially due to differences in power frequency in different regions and power grid interference, leading to misjudgments.

Method used

By monitoring the zero-crossing signal of the AC power supply, counting the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different frequencies, and combining the fault tolerance interval and sorting algorithm, the current power supply frequency is determined, thereby improving the anti-interference and accuracy of the detection.

Benefits of technology

It enables accurate power frequency identification under different power grid environments, improves the operating efficiency and stability of electrical equipment, and reduces the false judgment rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121878299A_ABST
    Figure CN121878299A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of household appliances, and discloses an AC power supply frequency detection method and device, electrical equipment and a storage medium, and the method comprises the steps: monitoring voltage zero-crossing signals of an AC power supply, and determining a zero-crossing pulse period corresponding to each voltage zero-crossing signal; in a preset time interval, respectively counting the number of zero-crossing pulse periods in the pulse period ranges corresponding to different alternating current power supply frequencies; and determining the current power supply frequency of the alternating current power supply on the basis of the size relationship of the zero-crossing pulse period numbers in the pulse period ranges corresponding to different alternating current power supply frequencies, and counting the pulse numbers in the period ranges corresponding to different frequencies in the specific time by continuously monitoring and counting the zero-crossing pulse periods of the alternating current voltage, so that the current power supply frequency of the alternating current power supply is determined. Therefore, the power supply frequency is detected, the anti-interference performance of power supply frequency detection is improved, and the accuracy of the detection result is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of household appliance technology, specifically to AC power frequency detection methods, devices, electrical equipment, and storage media. Background Technology

[0002] Power supply frequency is a key parameter for maintaining the stable operation of electrical equipment under certain operating conditions. Different power supply frequencies correspond to different output power for electrical equipment. Especially in electrical equipment powered by AC power, if the actual frequency deviates from the rated frequency, it will affect the operating performance and efficiency of the equipment. Therefore, power supply frequency detection is crucial to ensure the normal operation of electrical equipment. Furthermore, since different regions use different power supply frequencies (e.g., some areas use 50Hz, some use 60Hz, and some use both), appliances such as microwave ovens need to detect the power supply frequency when powered on. However, factors such as voltage fluctuations, electromagnetic interference, aging plugs and sockets, and poor contact can affect frequency detection, leading to misjudgment of the power supply frequency by the appliance, thus affecting its efficiency and normal use. Summary of the Invention

[0003] This invention provides an AC power frequency detection method, device, electrical equipment, and storage medium to solve the problem of low accuracy in AC power frequency detection of electrical equipment in related technologies, which affects the efficiency and normal use of electrical equipment.

[0004] In a first aspect, the present invention provides an AC power supply frequency detection method, the method comprising: Monitor the zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each zero-crossing signal; Within a preset time interval, the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies is counted. The current power frequency of the AC power supply is determined based on the relationship between the number of zero-crossing pulse cycles within the pulse period range corresponding to different AC power supply frequencies.

[0005] This invention continuously monitors and statistically analyzes the zero-crossing pulse period of AC voltage, counts the number of pulses within a specific time period corresponding to different frequencies, determines the current power supply frequency based on the central tendency of the quantity distribution, and improves the anti-interference capability of power supply frequency detection by detecting voltage waveform characteristics, resulting in high accuracy of detection results.

[0006] In one optional implementation, before counting the number of zero-crossing pulse cycles within the pulse period range corresponding to different AC power supply frequencies within a preset time interval, the method further includes: When it is determined that the current voltage zero-crossing signal belongs to the first zero-crossing pulse period range, the AC power frequency is initially determined as the first AC power frequency. When it is determined that the current voltage zero-crossing signal belongs to the second zero-crossing pulse period range, the AC power frequency is initially determined as the second AC power frequency; wherein, the first AC power frequency is less than the second AC power frequency.

[0007] This invention pre-judges the detected voltage zero-crossing signal based on the zero-crossing pulse period range of the initially detected voltage zero-crossing signal before counting the number of zero-crossing pulse cycles. This preliminarily determines the AC power frequency to which the detected voltage zero-crossing signal belongs, and sets the zero-crossing pulse period range to improve the system's anti-interference capability and AC power frequency detection. This improves the accuracy of AC power frequency detection, facilitates the rapid determination of the current AC power frequency, and can adapt to power grids of different standards. This method achieves automatic and rapid identification of AC power frequency, improving the operating efficiency of electrical equipment.

[0008] In one optional implementation, within a preset time interval, the number of zero-crossing pulse cycles within the pulse period range corresponding to different AC power supply frequencies is counted, including: Within a preset time interval, count the number of zero-crossing pulses at the first AC power frequency and the number of zero-crossing pulses at the second AC power frequency.

[0009] This invention, by separately counting the number of zero-crossing pulse cycles of the first AC power frequency and the second AC power frequency, helps to verify the accuracy of the initially determined AC power frequency, ensures that the electrical equipment operates at the correct AC power frequency, and guarantees the continuous operating efficiency of the electrical equipment.

[0010] In one optional implementation, the current power frequency of the AC power supply is determined based on the relationship between the number of zero-crossing pulse periods within the pulse period range corresponding to different AC power supply frequencies, including: When the AC power frequency is initially determined to be the first AC power frequency, and the number of zero-crossing pulses of the first AC power frequency is determined to be greater than or equal to the number of zero-crossing pulses of the second AC power frequency, the current power frequency of the AC power is determined to be the first AC power frequency. When the AC power frequency is initially determined to be the first AC power frequency, and the number of zero-crossing pulses of the first AC power frequency is determined to be less than the number of zero-crossing pulses of the second AC power frequency, the current power frequency of the AC power is corrected to the second AC power frequency. When the AC power frequency is initially determined to be the second AC power frequency, and the number of zero-crossing pulses of the second AC power frequency is determined to be greater than or equal to the number of zero-crossing pulses of the first AC power frequency, the current power frequency of the AC power is determined to be the second AC power frequency. When the AC power frequency is initially determined to be the second AC power frequency, and the number of zero-crossing pulses of the second AC power frequency is determined to be less than the number of zero-crossing pulses of the first AC power frequency, the current power frequency of the AC power supply is corrected to the first AC power frequency.

[0011] This invention improves the accuracy of verifying the initially determined AC power frequency by statistically analyzing and comparing the number of zero-crossing pulses corresponding to the first and second AC power frequencies. The current AC power frequency is only confirmed as the first AC power frequency if it is initially determined to be the first AC power frequency and the number of zero-crossing pulses at the first AC power frequency is greater than the number of zero-crossing pulses at the second AC power frequency; otherwise, the initial determination is corrected. Similarly, the current AC power frequency is only confirmed as the second AC power frequency if it is initially determined to be the second AC power frequency and the number of zero-crossing pulses at the second AC power frequency is greater than the number of zero-crossing pulses at the first AC power frequency. This improves the accuracy and reliability of AC power frequency detection, ensuring the operational stability of electrical equipment.

[0012] In one optional implementation, the pulse period range corresponding to different AC power supply frequencies is determined as follows: Obtain the pulse period corresponding to each AC power frequency; Set a duration tolerance range for the pulse period corresponding to each AC power supply frequency, and determine the range of pulse periods corresponding to different AC power supply frequencies.

[0013] This invention obtains the standard zero-crossing pulse period value corresponding to the frequency of the AC power supply to be identified, and sets a time tolerance interval for each standard period value. This effectively covers the period deviation caused by signal jitter, measurement error, or slight frequency fluctuation that may be present in the actual system. Each frequency corresponds to a standard period value and the pulse period range determined by the tolerance interval. The setting of the tolerance interval effectively accommodates normal errors and small fluctuations in the actual system, avoids misjudgment caused by slight deviations in a single period value, makes the frequency identification result more stable, realizes AC power supply frequency detection, and improves its adaptability in practical applications.

[0014] In one optional implementation, the current power frequency of the AC power supply is determined based on the relationship between the number of zero-crossing pulse periods within the pulse period range corresponding to different AC power supply frequencies, including: The number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies is sorted. Based on the sorting results, the AC power frequency corresponding to the pulse period range with the most zero-crossing pulse periods is determined as the current power frequency.

[0015] This invention sorts the actual number of zero-crossing pulse cycles from most to least, and determines the AC power frequency corresponding to the range of cycles with the most cycles as the current power frequency based on the sorting results. It is suitable for application scenarios that require real-time frequency detection, ensuring identification stability and reducing the false judgment rate.

[0016] In one optional implementation, within a preset time interval, the number of zero-crossing pulse cycles within the pulse period range corresponding to different AC power supply frequencies is counted, including: Compare the current zero-crossing pulse period with the pulse period range corresponding to each AC power supply frequency; If the current zero-crossing pulse period is within the range of the pulse periods being compared, the current zero-crossing pulse period is determined as the target AC power frequency corresponding to the range of the pulse periods being compared, and the number of zero-crossing pulse periods corresponding to the target AC power frequency is updated.

[0017] This invention compares each newly detected zero-crossing pulse period with the pulse period range corresponding to each AC power supply frequency. Once the period value falls within the period range of a certain frequency, the current zero-crossing pulse period is determined as the target AC power supply frequency corresponding to the currently compared pulse period range. At the same time, the corresponding statistical count is accumulated until the preset time interval ends, thereby obtaining the total number of zero-crossing pulse periods corresponding to each target AC power supply frequency. This improves the robustness of AC power supply frequency detection, realizes the real-time performance of AC power supply frequency identification, and provides reliable input for frequency-related control.

[0018] In one alternative implementation, the method further includes: If the current zero-crossing pulse period is not within the pulse period range corresponding to any AC power frequency, start abnormal timing, update the next zero-crossing pulse period to the current zero-crossing pulse period, and return to the step of comparing the current zero-crossing pulse period with the pulse period range corresponding to each AC power frequency, until the current zero-crossing pulse period is within the pulse period range corresponding to any AC power frequency, clear the abnormal timing, or, in response to the duration of the abnormal timing reaching a first preset duration, issue a power frequency identification error alarm.

[0019] This invention addresses the issue by having the system start a timer to record the duration of an abnormal state when the measured period value fails to match any preset normal frequency range. The system then continuously attempts to match the abnormal state with subsequent period values. Once a match is successful, the timer is cleared and normal operation resumes. However, if the abnormal state persists beyond a preset safety time limit, it is considered a persistent fault and an alarm is triggered. This effectively distinguishes between transient interference and genuine faults, avoiding false alarms for short-term fluctuations while ensuring timely warnings for prolonged signal anomalies, thus improving the system's anti-interference capability and reliability.

[0020] In one alternative implementation, monitoring the zero-crossing signal of the AC power supply includes: Convert the AC voltage signal of the AC power supply into a square wave signal with the same frequency and phase as the AC power supply. Interrupt detection is performed based on square wave signals, and the interrupt is triggered by the rising edge. The zero-crossing pulse period is determined based on two adjacent interrupt trigger signals.

[0021] This invention converts the AC voltage signal of an AC power supply into a square wave signal with the same phase. When the rising edge of the square wave signal is triggered, an interrupt signal is triggered. The zero-crossing pulse period is determined based on two adjacent interrupt trigger signals, thereby achieving accurate detection of the power supply frequency and improving the anti-interference capability of power supply frequency detection.

[0022] In one alternative implementation, the method further includes: The level of the square wave signal is detected; If the detected level remains high or low for a duration that reaches the second preset duration, a power frequency identification error alarm will be triggered.

[0023] This invention continuously monitors the high and low levels of a square wave signal. If the level remains unchanged (either consistently high or consistently low) for a preset period of time, it is determined that the power frequency identification is incorrect and an alarm is issued. This allows for rapid detection of complete signal loss or severe distortion, thus enhancing the system's responsiveness to abnormal situations.

[0024] In one alternative implementation, the method further includes: In response to receiving the first interrupt trigger signal, interrupt triggering is disabled for a first duration and then resumed. The first duration is less than the minimum value of the pulse period range corresponding to each AC power supply.

[0025] Upon detecting an interrupt signal (e.g., a rising edge of a square wave), this invention temporarily disables the interrupt function for a short period (shorter than any possible normal power cycle) before re-enabling interrupts. This prevents multiple false interrupts near zero-crossing due to signal jitter or interference, ensuring that each true voltage zero-crossing cycle is accurately identified and processed only once, thus improving the reliability of interrupt signals and cycle measurements.

[0026] In one alternative implementation, the method is applied to an electrical device with microwave functionality, and the method further includes: Obtain the current operating status of electrical equipment; If the current operating state is non-microwave operating state, the step of monitoring the voltage zero-crossing signal of the AC power supply and determining the zero-crossing pulse period corresponding to each voltage zero-crossing signal is performed.

[0027] This invention only performs monitoring and periodic measurement of the AC zero-crossing signal when the electrical equipment is detected to be in a non-microwave operating state. This avoids the impact of strong electromagnetic interference on the accuracy of the zero-crossing detection circuit during high-power microwave transmission, ensuring reliable frequency measurement and operation of the electrical equipment, thereby improving the stability and anti-interference capability of the entire power monitoring system.

[0028] In a second aspect, the present invention provides an AC power frequency detection device, the device comprising: The first determining module is used to monitor the voltage zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each voltage zero-crossing signal. The statistics module is used to count the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies within a preset time interval. The second determining module is used to determine the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0029] Thirdly, the present invention provides an electrical device, including a controller, the controller comprising: The memory and the processor are interconnected and communicate with each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the method described in the first aspect or any of its corresponding embodiments.

[0030] In one alternative implementation, the electrical appliance is a microwave oven.

[0031] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0032] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0033] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2This is a schematic flowchart of the first method for detecting AC power frequency according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the second process of the AC power frequency detection method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the third process of the AC power frequency detection method according to an embodiment of the present invention; Figure 5 This is a flowchart of an AC power supply frequency detection method according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the pin connections of a microcontroller according to an embodiment of the present invention; Figure 7 This is a structural block diagram of an AC power frequency detection device according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the hardware structure of the controller of the electrical device according to an embodiment of the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0035] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0036] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0037] As an optional application scenario of this invention, such as Figure 1 As shown, an electrical device includes a controller 101 for performing an AC power frequency detection method. The overall process of the controller 101 performing the AC power frequency detection method is detailed in the relevant description of the method embodiments below, and will not be repeated here.

[0038] This embodiment provides an electrical device, taking a microwave oven as an example. When the microwave oven reaches the zero-crossing point, both the voltage and current approach zero. At this point, the contact is activated with minimal electrical impact between the contacts. Specifically, the circuit supplying power to the high-voltage transformer energizes the relay coil, driving the contacts to close. Simultaneously, to better automatically identify the power supply frequency and adjust the output power accordingly, microwave oven control schemes generally include a zero-crossing detection circuit. The software identifies the current power supply frequency based on the zero-crossing I / O port.

[0039] Specifically, the AC power frequency detection method described in this embodiment includes a zero-crossing detection circuit.

[0040] Power frequency is a key parameter for maintaining the stable operation of electrical equipment under certain operating conditions. Electrical equipment has different output power at different power frequencies. Especially in electrical equipment powered by AC power, if there is a deviation between the actual frequency and the rated frequency, it will affect the operating performance and efficiency of the electrical equipment. Therefore, power frequency detection is crucial to ensure the normal operation of electrical equipment.

[0041] Microwave interference can affect the zero-crossing signal during microwave operation; fluctuations and interference from the power grid can also affect the zero-crossing signal; in addition, aging sockets or poor contact can also cause the loss of the zero-crossing signal when the microwave oven is powered on.

[0042] In related technologies, the power supply frequency is determined by acquiring the number of voltage zero-crossings within a certain time period. However, in electrical equipment with microwave functions, microwave interference can affect the zero-crossing signal. At the same time, fluctuations and interference in the power grid may also affect the zero-crossing signal, resulting in low accuracy of AC power supply frequency detection.

[0043] Based on the above problems, this embodiment focuses on analyzing how the number of zero-crossing voltages changes and how the zero-crossing pulse period changes. Specifically, it analyzes how to accurately identify the power supply frequency through the zero-crossing voltage signal without being subject to microwave interference.

[0044] According to an embodiment of the present invention, an embodiment of an AC power frequency detection method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0045] This embodiment provides an AC power frequency detection method, which can be used in the aforementioned electrical appliances, such as microwave ovens. Figure 2 This is a schematic flowchart of the first method for detecting AC power frequency according to an embodiment of the present invention, as follows: Figure 2 As shown, the process includes the following steps: Step S201: Monitor the zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each zero-crossing signal.

[0046] Alternating current (AC) power refers to a power source whose voltage and current magnitude and direction change periodically over time. It is typically a sinusoidal alternating current, such as 220V / 50Hz.

[0047] In this context, voltage zero crossing refers to the moment when the voltage in a sinusoidal alternating current changes from the positive half-cycle to the negative half-cycle, or from the negative half-cycle to the positive half-cycle, and passes through zero (0V). Each complete sine wave has two zero crossings.

[0048] It should be noted that a voltage zero-crossing signal refers to an electrical signal that can be recognized by a circuit or microcontroller.

[0049] Therefore, in this embodiment, the AC power supply voltage exhibits a sinusoidal periodic change, and each cycle necessarily passes through two zero-voltage points (positive zero-crossing and negative zero-crossing). The monitoring circuit generates the corresponding zero-crossing voltage signal through these zero-voltage points.

[0050] The detection of the zero-crossing voltage signal is accomplished by the zero-crossing detection circuit; the zero-crossing pulse period corresponding to each zero-crossing voltage signal is determined by a microcontroller or digital circuit.

[0051] For example, the time interval between two adjacent zero-crossing signals of the same type corresponds to half a cycle of alternating current. For instance, 50Hz alternating current has a cycle of 20 milliseconds, so its corresponding zero-crossing pulse cycle is 10 milliseconds.

[0052] Step S202: Within a preset time interval, count the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0053] Among them, different AC power supply frequencies refer to 50Hz or 60Hz, or different frequency values ​​that actually occur in the same power grid during operation, such as 49.8Hz, 50Hz, 50.2Hz, etc.

[0054] It should be noted that the number of zero-crossing pulse cycles refers to the number of zero-crossing pulse cycles that occur within the pulse cycle range corresponding to the power supply frequency of 50Hz or 60Hz, within a preset time interval.

[0055] For example, the preset time interval is 500 milliseconds.

[0056] Step S203: Determine the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0057] It should be noted that the actual power supply frequency will result in a significantly larger number of zero-crossing pulse cycles within its corresponding theoretical period range compared to other frequency ranges. The current power supply frequency can be determined by comparing the number of cycles in each frequency band.

[0058] The AC power frequency detection method provided in this embodiment continuously monitors and counts the period of AC voltage zero-crossing pulses, counts the number of pulses within the period range corresponding to different frequencies within a specific time, determines the current power frequency based on the central tendency of the number distribution, and detects through voltage waveform characteristics, thereby improving the anti-interference capability of power frequency detection and achieving high accuracy of detection results.

[0059] This embodiment provides an application example of an AC power frequency detection method, which can be used in the aforementioned electrical appliances, such as microwave ovens. Figure 3 This is a schematic diagram of a second process for an AC power frequency detection method according to an embodiment of the present invention, as shown below. Figure 3 As shown, the process includes the following steps: Step S301: Monitor the zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each zero-crossing signal. For details, please refer to [link to relevant documentation]. Figure 2 Step S201 of the illustrated embodiment will not be described again here.

[0060] Step S302: When it is determined that the current voltage zero-crossing signal belongs to the first zero-crossing pulse period range, the AC power frequency is initially determined as the first AC power frequency.

[0061] For example, the first zero-crossing pulse period ranges from 18 milliseconds to 22 milliseconds, and the second zero-crossing pulse period ranges from 14 milliseconds to 18 milliseconds.

[0062] For example, when it is determined that the voltage zero-crossing signal is acquired in 20 milliseconds, the current AC power frequency is initially determined to be 50 Hz; when it is determined that the voltage zero-crossing signal is acquired in 16.7 milliseconds, the current AC power frequency is initially determined to be 60 Hz.

[0063] It should be noted that the zero-crossing pulse period range in the above example can be adaptively adjusted according to the actual situation.

[0064] It should be noted that the current voltage zero-crossing signal is determined by the time window between the first and second zero-crossings of the voltage. For example, after the voltage completes the first and second zero-crossings, a zero-crossing cycle can be determined after the second zero-crossing is completed, at which point the voltage zero-crossing signal is triggered.

[0065] Step S303: When it is determined that the current voltage zero-crossing signal belongs to the second zero-crossing pulse period range, the AC power frequency is initially determined as the second AC power frequency; wherein, the first AC power frequency is less than the second AC power frequency.

[0066] For example, when the voltage zero-crossing signal is obtained for 20 milliseconds, it is determined that the current voltage zero-crossing signal belongs to the first zero-crossing pulse period range; when the voltage zero-crossing signal is obtained for 16.7 milliseconds, it is determined that the current voltage zero-crossing signal belongs to the second zero-crossing pulse period range.

[0067] In this embodiment, before counting the number of zero-crossing pulse cycles, a preliminary judgment is made on the currently detected zero-crossing voltage signal based on the range of the zero-crossing pulse cycle to which the initially detected zero-crossing voltage signal belongs. This preliminarily determines the AC power frequency to which the detected zero-crossing voltage signal belongs, sets the zero-crossing pulse cycle range to improve the system's anti-interference capability and AC power frequency detection, and improves the accuracy of AC power frequency detection. This facilitates the rapid determination of the current AC power frequency and can adapt to power grids of different standards. This method achieves automatic and rapid identification of AC power frequency and improves the operating efficiency of electrical equipment.

[0068] Step S304: Within a preset time interval, count the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0069] Specifically, step S304 includes: Step S3041: Within a preset time interval, count the number of zero-crossing pulses of the first AC power frequency and the number of zero-crossing pulses of the second AC power frequency.

[0070] It should be noted that in a power grid environment where the AC power frequency includes both the first AC power frequency and the second AC power frequency, the zero-crossing pulse period obtained statistically is either the zero-crossing pulse period of the first AC power frequency or the zero-crossing pulse period of the second AC power frequency.

[0071] It should be noted that the preset time interval is 500 milliseconds. The number of zero-crossing pulses of the first AC power frequency and the number of zero-crossing pulses of the second AC power frequency are counted in each preset time period of 500 milliseconds, so as to detect the AC power frequency and verify the accuracy of the initially determined AC power frequency.

[0072] For example, within a 500-millisecond time interval, the number of zero-crossing pulse cycles corresponding to the initial 50Hz is 0, and the number of zero-crossing pulse cycles corresponding to the initial 60Hz is 0.

[0073] Specifically, when the voltage zero-crossing signal is obtained at 20 milliseconds, it is determined that the current voltage zero-crossing signal belongs to the pulse period range of 18 milliseconds to 22 milliseconds, and the number of zero-crossing pulse periods corresponding to 50Hz is accumulated; when the voltage zero-crossing signal is obtained at 16.7 milliseconds, it is determined that the current voltage zero-crossing signal belongs to the pulse period range of 14 milliseconds to 18 milliseconds, and the number of zero-crossing pulse periods corresponding to 60Hz is accumulated.

[0074] In this embodiment, by counting the number of zero-crossing pulse cycles of the first AC power frequency and the second AC power frequency respectively, it is beneficial to verify the accuracy of the initially determined AC power frequency, ensure that the electrical equipment operates at the correct AC power frequency, and ensure the continuous operating efficiency of the electrical equipment.

[0075] Step S305: Determine the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0076] Specifically, step S305 includes: Step S3051: When the AC power frequency is initially determined to be the first AC power frequency, and the number of zero-crossing pulses of the first AC power frequency is determined to be greater than or equal to the number of zero-crossing pulses of the second AC power frequency, the current power frequency of the AC power is determined to be the first AC power frequency.

[0077] For example, when the current AC power frequency is initially determined to be 50Hz, and the number of zero-crossing pulse cycles corresponding to 50Hz is determined to be greater than or equal to the number of zero-crossing pulse cycles corresponding to 60Hz, the current power frequency of the AC power supply is determined to be 50Hz.

[0078] Step S3052: When the AC power frequency is initially determined to be the first AC power frequency, and the number of zero-crossing pulses of the first AC power frequency is determined to be less than the number of zero-crossing pulses of the second AC power frequency, the current power frequency of the AC power is corrected to the second AC power frequency.

[0079] For example, when the current AC power frequency is initially determined to be 50Hz, and the number of zero-crossing pulse cycles corresponding to 50Hz is determined to be less than the number of zero-crossing pulse cycles corresponding to 60Hz, the initially determined current power frequency of the AC power supply is corrected to 60Hz.

[0080] It should be noted that during the process of detecting and counting the number of zero pulse cycles at 500 millisecond intervals, this step can be used to identify whether the AC power frequency has been switched and to update the detected AC power frequency, for example, switching the power frequency from 60Hz to 50Hz.

[0081] Step S3053: When the AC power frequency is initially determined to be the second AC power frequency, and the number of zero-crossing pulses of the second AC power frequency is determined to be greater than the number of zero-crossing pulses of the first AC power frequency, the current power frequency of the AC power is determined to be the second AC power frequency.

[0082] For example, when the current AC power frequency is initially determined to be 60Hz, and the number of zero-crossing pulse cycles corresponding to 60Hz is determined to be greater than or equal to the number of zero-crossing pulse cycles corresponding to 50Hz, the current power frequency of the AC power supply is determined to be 60Hz.

[0083] Step S3054: When the AC power frequency is initially determined to be the second AC power frequency, and the number of zero-crossing pulses of the second AC power frequency is determined to be less than the number of zero-crossing pulses of the first AC power frequency, the current power frequency of the AC power is corrected to the first AC power frequency.

[0084] For example, when the current AC power frequency is initially determined to be 60Hz, and the number of zero-crossing pulse cycles corresponding to 60Hz is less than the number of zero-crossing pulse cycles corresponding to 50Hz, the initially determined current AC power frequency is corrected to 50Hz.

[0085] It should be noted that during the process of detecting and counting the number of zero pulse cycles at 500 millisecond intervals, this step can be used to identify whether the AC power frequency has been switched and to update the detected AC power frequency, for example, switching the power frequency from 60Hz to 50Hz.

[0086] In this embodiment, by statistically analyzing and comparing the number of zero-crossing pulses corresponding to the first AC power frequency and the second AC power frequency, the current AC power frequency is determined to be the first AC power frequency only if it is initially determined to be the first AC power frequency and the number of zero-crossing pulses of the first AC power frequency is greater than the number of zero-crossing pulses of the second AC power frequency. Otherwise, the initial determination is corrected. Similarly, if it is initially determined to be the second AC power frequency and the number of zero-crossing pulses of the second AC power frequency is greater than the number of zero-crossing pulses of the first AC power frequency, the current AC power frequency is determined to be the second AC power frequency only if it is initially determined to be the second AC power frequency and the number of zero-crossing pulses of the second AC power frequency is greater than the number of zero-crossing pulses of the first AC power frequency. Otherwise, the initial determination is corrected. This improves the accuracy of verifying the initially determined AC power frequency, enhances the anti-interference capability of AC power frequency detection, thereby improving the accuracy and reliability of AC power frequency detection and ensuring the operational stability of electrical equipment.

[0087] This embodiment provides an AC power frequency detection method, which can be used in the aforementioned electrical appliances, such as microwave ovens. Figure 4 This is a schematic diagram of a second process for an AC power frequency detection method according to an embodiment of the present invention, as shown below. Figure 4 As shown, the process includes the following steps: Step S401: Monitor the zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each zero-crossing signal.

[0088] Specifically, step S401 includes: Step S4011: Convert the AC voltage signal of the AC power supply into a square wave signal with the same frequency and phase as the AC power supply.

[0089] For example, a zero-crossing detection circuit can be used to convert a sinusoidal AC voltage (such as 220V / 50Hz) into a series of square wave pulse signals, with the rising or falling edge of each pulse corresponding to the moment when the AC voltage crosses zero.

[0090] It should be noted that the AC voltage signal of an AC power supply is a sine wave. For example, 220V 50Hz AC voltage changes sinusoidally with time, with a period of 20 milliseconds, or 60Hz AC voltage has a period of approximately 16.67 milliseconds. The square wave signal is the converted output signal.

[0091] Among them, the square wave signal in phase refers to the periodic position of the signal at a specific point in time, which means that the rising edge or falling edge of the square wave must be strictly aligned with the zero-crossing point of the sine wave.

[0092] Specifically, when the input sine wave voltage is higher than 0V, the comparator outputs a high level; when the input sine wave voltage is lower than 0V, the comparator outputs a low level.

[0093] Step S4012: Interrupt detection is performed based on the square wave signal, and the interrupt is triggered by the rising edge.

[0094] It should be noted that interrupt detection refers to the microcontroller continuously monitoring the level state of the input pin and triggering the interrupt service routine on the rising edge.

[0095] Among them, the AC current corresponding to the rising edge crosses zero from negative to positive and is not easily affected by the signal amplitude.

[0096] Step S4013: Determine the zero-crossing pulse period based on two adjacent interrupt trigger signals.

[0097] It should be noted that two adjacent interrupt trigger signals refer to two trigger signals of the same type that occur consecutively in time, such as the first rising edge and the next rising edge. For example, the period corresponding to 50Hz is 20 milliseconds, and the period corresponding to 60Hz is approximately 16.67 milliseconds.

[0098] In this embodiment, the AC voltage signal of the AC power supply is converted into a square wave signal with the same phase. An interrupt signal is triggered when the rising edge of the square wave signal is triggered. The zero-crossing pulse period is determined based on two adjacent interrupt trigger signals, thereby achieving accurate detection of the power supply frequency and improving the anti-interference capability of the power supply frequency detection.

[0099] Step S402: Within a preset time interval, count the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0100] Specifically, step S402 includes: Step S4021: Obtain the pulse period corresponding to each AC power supply frequency.

[0101] It should be noted that the period equals 1 divided by the AC power frequency. Here, the pulse period corresponding to each AC power frequency is, for example, 50Hz corresponds to a complete period of 20 milliseconds, 60Hz corresponds to a complete period of 16.67 milliseconds, and 400Hz corresponds to a complete period of 2.5 milliseconds.

[0102] Step S4022: Set a duration tolerance range for the pulse period corresponding to each AC power supply frequency, and determine the range of pulse periods corresponding to different AC power supply frequencies.

[0103] It should be noted that the tolerance range is set based on the pulse period. Since the actual power grid frequency is not an absolutely stable nominal value, but fluctuates within a certain range, small fluctuation errors are inevitable. At the same time, the measurement circuit and the microcontroller timer itself also have slight errors. Therefore, a time tolerance range is set. For example, the tolerance range is centered on the calculated theoretical pulse period, extended upwards and downwards by an allowable time deviation.

[0104] In this embodiment, by obtaining the standard zero-crossing pulse period value corresponding to the frequency of the AC power supply to be identified, a time tolerance interval is set for each standard period value. This effectively covers the period deviation caused by signal jitter, measurement error, or slight frequency fluctuation that may actually be included. Each frequency corresponds to a standard period value and the pulse period range determined by the tolerance interval. The setting of the tolerance interval effectively accommodates normal errors and small fluctuations in the actual system, avoids misjudgment caused by slight deviation of a single period value, makes the frequency identification result more stable, realizes AC power supply frequency detection, and improves adaptability in practical applications.

[0105] Step S4023: Compare the current zero-crossing pulse period with the pulse period range corresponding to each AC power supply frequency.

[0106] It should be noted that the current zero-crossing pulse period is the zero-crossing pulse period obtained from the detection.

[0107] Among them, the pulse period range corresponding to each AC power frequency can be between 18 and 22 milliseconds for 50Hz and between 14 and 18 milliseconds for 60Hz.

[0108] Step S4024: If the current zero-crossing pulse period is within the range of the pulse period being compared, the current zero-crossing pulse period is determined as the target AC power frequency corresponding to the range of the pulse period being compared, and the number of zero-crossing pulse periods corresponding to the target AC power frequency is updated.

[0109] It should be noted that if the current zero-crossing pulse period is within the range of the pulse periods being compared, it does not directly mean that the current power supply frequency is the target AC power supply frequency corresponding to the range of pulse periods being compared. Instead, the number of zero-crossing pulse periods is updated, and the current power supply frequency is determined by comparing the final number.

[0110] In this embodiment, for each newly detected current zero-crossing pulse period, it is compared sequentially with the pulse period range corresponding to each AC power supply frequency. Once the period value falls within the period range of a certain frequency, the current zero-crossing pulse period is determined as the target AC power supply frequency corresponding to the currently compared pulse period range. At the same time, the corresponding statistical count is accumulated until the preset time interval ends, thereby obtaining the total number of zero-crossing pulse periods corresponding to each target AC power supply frequency. This improves the robustness of AC power supply frequency detection, realizes the real-time performance of AC power supply frequency identification, and provides reliable input for frequency-related control.

[0111] Step S403: Determine the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0112] Specifically, step S403 includes: Step S4031: Sort the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0113] It should be noted that the number of zero-crossing pulse periods within the pulse period range corresponding to different AC power supply frequencies is sorted in descending order. This applies to power grid environments where the AC power supply frequency includes at least a first AC power supply frequency and a second AC power supply frequency, such as a first AC power supply frequency of 50Hz and a second AC power supply frequency of 60Hz. In addition to AC power supply frequencies of 50Hz and 60Hz, it also includes 16.7Hz used in other regions and 400Hz used in aerospace technology, etc.

[0114] Step S4032: Based on the sorting results, determine the AC power frequency corresponding to the range of pulse periods with the most zero-crossing pulse periods as the current power frequency.

[0115] For example, if we calculate and count the number of zero-crossing pulses corresponding to 50Hz within every 500 milliseconds, and find that there are 98 zero-crossing pulses corresponding to 60Hz, then the current power supply frequency can be determined to be 50Hz.

[0116] In this embodiment, the number of zero-crossing pulse cycles actually counted is sorted from most to least. Based on the sorting result, the AC power frequency corresponding to the range of cycles with the most cycles is determined as the current power frequency. This is suitable for application scenarios that require real-time frequency detection, ensuring identification stability and reducing the false judgment rate.

[0117] Step S404: If the current zero-crossing pulse period is not within the pulse period range corresponding to any AC power frequency, start abnormal timing, update the next zero-crossing pulse period to the current zero-crossing pulse period, return to the step of comparing the current zero-crossing pulse period with the pulse period range corresponding to each AC power frequency, until the current zero-crossing pulse period is within the pulse period range corresponding to any AC power frequency, clear abnormal timing, and perform a power frequency identification error alarm.

[0118] It should be noted that if the current zero-crossing pulse period is not within the pulse period range corresponding to any AC power supply frequency, it indicates that the current signal is lost or the detection is abnormal, such as a power outage or a malfunction in the detection circuit. Therefore, it is necessary to perform abnormal timing to accurately determine whether there is an anomaly in the power supply frequency detection.

[0119] Alternatively, in step S405, in response to the duration of the abnormal timing reaching a first preset duration, a power frequency identification error alarm is triggered.

[0120] It should be noted that the first preset duration is a duration that can characterize power frequency identification errors, derived from statistical analysis of experimental data. Too short a duration will result in false alarms, while too long a duration will result in missed alarms. Therefore, the first preset duration is set based on a large amount of experimental data, taking into account the power frequency and the possible duration of identification errors.

[0121] In this embodiment, when the measured period value cannot match any preset normal frequency range, the system starts a timer to record the duration of the abnormal state and continuously attempts to match it with subsequent period values. Once a match is successful, the timer is cleared and normal operation is restored. However, if the abnormal state continues for more than a preset safety time limit, it is determined to be a persistent fault and an alarm is triggered. This effectively distinguishes between transient interference and real faults, avoiding false alarms for brief fluctuations while ensuring timely warnings when the signal is abnormal for a long period, thus improving the system's anti-interference capability and reliability.

[0122] Step S406: Detect the level of the square wave signal.

[0123] It should be noted that the level of a square wave signal can characterize the voltage state at the current moment.

[0124] Step S407: If the detected level is continuously high or low for a duration that reaches the second preset duration, a power frequency identification error alarm is triggered.

[0125] Specifically, if the detected voltage level remains high for a duration equal to a second preset duration, a power frequency identification error alarm is triggered. Alternatively, if the detected voltage level remains low for a duration equal to a second preset duration, a power frequency identification error alarm is triggered.

[0126] The second preset duration must be greater than the expected duration of the maximum interference event in order to improve the filtering capability of instantaneous interference. The second preset duration is derived from experimental data and a rigorous analysis of the system tolerance and the physical nature of the fault. It can ensure reliable alarm, avoid false alarms, and reflect the real fault.

[0127] In this embodiment, the high and low level states of the square wave signal are continuously monitored. If the level remains unchanged (either consistently high or consistently low) for a preset period of time, it is determined that the power frequency identification is incorrect and an alarm is issued. This allows for rapid detection of complete signal loss or severe distortion, thus enhancing the system's responsiveness to abnormal situations.

[0128] Step S408: In response to receiving the first interrupt trigger signal, interrupt triggering is disabled for a first duration and then resumed. The first duration is less than the minimum value of the pulse period range corresponding to each AC power supply.

[0129] It should be noted that the first duration can be 12 milliseconds. The 12-millisecond read protection further enhances the anti-interference capability of power frequency detection.

[0130] In this embodiment, after an interrupt signal (e.g., rising edge of a square wave) is detected, the system will temporarily disable the interrupt function. The time for disabling the interrupt function is shorter than that for all possible normal power cycles. Then, the interrupt is re-enabled. In order to prevent multiple false interrupts from being generated near the zero crossing due to signal jitter or interference, this ensures that each real voltage zero crossing cycle is accurately identified and processed only once, thereby improving the reliability of interrupt signals and cycle measurements.

[0131] The method provided in this embodiment is applied to electrical equipment with microwave functionality, and the method further includes: Step S409: Obtain the current working status of the electrical equipment.

[0132] For example, in a microwave oven, the current operating state can be divided into a microwave operating state and a non-microwave operating state based on microwaves.

[0133] In microwave operation mode, the magnetron is driven by high voltage, emitting microwave energy into the oven cavity. In non-microwave operation mode, the magnetron stops emitting microwaves.

[0134] Alternatively, the working state of a microwave oven can be divided into a heating state and a standby state. The heating state includes a microwave heating stage, a grilling stage, and an alternating stage of microwave heating and grilling. In this stage, the magnetron is only active during the microwave heating stage, which is the microwave working state.

[0135] Step S410: If the current working state is a non-microwave working state, perform the step of monitoring the voltage zero-crossing signal of the AC power supply and determining the zero-crossing pulse period corresponding to each voltage zero-crossing signal.

[0136] It should be noted that the non-microwave operating mode can avoid the impact of power grid fluctuations and interference on the zero-crossing signal.

[0137] In this embodiment, the system only performs monitoring and period measurement of the AC zero-crossing signal when the electrical device (such as a microwave oven) is detected to be in a non-microwave operating state. This avoids the accuracy of the zero-crossing detection circuit being affected by strong electromagnetic interference during the high-power microwave emission phase, ensuring reliable operation of frequency measurement and electrical equipment, thereby improving the stability and anti-interference capability of the entire power monitoring system.

[0138] Combination Figure 5 and Figure 6 Taking a microwave oven as an example, an application embodiment of the present invention is described below. Figure 6 The zero-crossing detection port of the zero-crossing detection circuit 601 shown is connected to pin P02 of the microcontroller U2 and is used to input a zero-crossing detection signal to the microcontroller. The specific circuit structure is existing technology and will not be described in detail here.

[0139] Microwave interference can affect the zero-crossing signal during microwave operation; power grid fluctuations and interference can also affect the zero-crossing signal; additionally, aging sockets or poor contact can cause the loss of the zero-crossing signal when the microwave oven is powered on. To address these technical issues, this method proposes a new solution for the zero-crossing detection logic.

[0140] After the AC signal passes through chip U3 (PC817B (optocoupler)) and the pull-up / pull-down switches of this circuit, the zero-crossing signal I / O port P02 will generate a square wave with the same frequency and phase as the AC power supply signal, where the high level is 5V and the low level is 0V. The zero-crossing signal I / O port P02 is an external interrupt port, configured by software to detect external interrupts, triggering the interrupt service routine on the rising edge.

[0141] To address the potential impact of microwave interference on the zero-crossing signal during microwave operation, this method only detects the power supply frequency during the non-microwave operation countdown. To avoid the influence of power grid fluctuations and interference on the zero-crossing signal, this method initiates a 12ms interrupt prevention period upon detecting the rising edge of the zero-crossing (because the period corresponding to a 50Hz power supply is 20ms, and the period corresponding to a 60Hz power supply is approximately 16.67ms). The zero-crossing interrupt detection service is then enabled after 12ms.

[0142] To address the issue of lost zero-crossing signals caused by aging or poor contact in the socket when the microwave oven is powered on, and to better avoid the problem of frequency recognition fluctuating between 50Hz and 60Hz at critical power frequencies in the original program, this method is based on... Figure 5 The process shown is used to write a power frequency identification program, which is then adjusted to calculate and compare the number of 50Hz pulses and the number of 60Hz pulses within every 500ms interval.

[0143] Theoretically, the period of 50Hz is the reciprocal of the frequency, i.e., 20ms. With a certain error tolerance, if the zero-crossing pulse period is between 18ms and 22ms, it is counted as a 50Hz pulse plus 1. This count is then accumulated within a 500ms interval. Similarly, the period of 60Hz is theoretically the reciprocal of the frequency, i.e., 16.667ms. With a certain error tolerance, if the zero-crossing pulse period is between 14ms and 18ms, it is counted as a 60Hz pulse plus 1. This count is then accumulated within the same 500ms interval. The counts of 50Hz and 60Hz pulses are then compared. If the number of 50Hz pulses is greater, the current power supply frequency is determined to be 50Hz; otherwise, it is 60Hz.

[0144] If the pulse period is not between 14ms and 22ms (i.e., the pulse width is neither 50Hz nor 60Hz), the abnormal time is accumulated. When the continuous abnormal time reaches a certain value, a power frequency recognition error alarm is triggered. Simultaneously, when the level of the zero-crossing I / O port P02 is normally high or normally low, the corresponding abnormal time is also accumulated. When the continuous abnormal time reaches a certain value, a power frequency recognition error alarm is also triggered.

[0145] The power frequency detection method in this embodiment can more accurately identify the power frequency in high-interference usage scenarios. It also adds a 12ms read protection period; after each read is triggered, it will not be triggered again for 12ms, further enhancing the anti-interference capability of the solution. This method has a wide range of applications, requiring only software modifications.

[0146] This embodiment also provides an AC power frequency detection device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0147] This embodiment provides an AC power frequency detection device, such as... Figure 7 As shown, it includes: The first determining module 701 is used to monitor the voltage zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each voltage zero-crossing signal. The statistics module 702 is used to count the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies within a preset time interval. The third determining module 703 is used to determine the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

[0148] In one alternative embodiment, the device further includes: The first preliminary determination module is used to initially determine the AC power frequency as the first AC power frequency when it is determined that the current voltage zero-crossing signal belongs to the first zero-crossing pulse period range. The second preliminary determination module is used to initially determine the AC power frequency as the second AC power frequency when it is determined that the current voltage zero-crossing signal belongs to the second zero-crossing pulse period range; wherein, the first AC power frequency is less than the second AC power frequency.

[0149] In one alternative implementation, the statistics module 702 includes: The statistics unit is used to count the number of zero-crossing pulses of the first AC power frequency and the number of zero-crossing pulses of the second AC power frequency within a preset time interval.

[0150] In one optional implementation, the third determining module 703 includes: The first determining unit is used to determine the current power frequency of the AC power supply as the first AC power supply frequency when the AC power supply frequency is initially determined to be the first AC power supply frequency, and the number of zero-crossing pulses of the first AC power supply frequency is determined to be greater than or equal to the number of zero-crossing pulses of the second AC power supply frequency. The first correction unit is used to correct the current power frequency of the AC power supply to the second AC power supply frequency when the AC power supply frequency is initially determined to be the first AC power supply frequency and the number of zero-crossing pulses of the first AC power supply frequency is determined to be less than the number of zero-crossing pulses of the second AC power supply frequency. The second determining unit is used to determine the current power frequency of the AC power supply as the second AC power supply frequency when the AC power supply frequency is initially determined to be the second AC power supply frequency, and the number of zero-crossing pulses of the second AC power supply frequency is determined to be greater than the number of zero-crossing pulses of the first AC power supply frequency. The second correction unit is used to correct the current power frequency of the AC power supply to the first AC power supply frequency when the AC power supply frequency is initially determined to be the second AC power supply frequency and the number of zero-crossing pulses of the second AC power supply frequency is determined to be less than the number of zero-crossing pulses of the first AC power supply frequency.

[0151] In an optional implementation, the statistics module 702 further includes: The acquisition unit is used to acquire the pulse period corresponding to each AC power frequency. The pulse period range determination unit is used to set a duration tolerance range for the pulse period corresponding to each AC power supply frequency, and to determine the pulse period range corresponding to different AC power supply frequencies.

[0152] In an optional implementation, the third determining module 703 further includes: The sorting unit is used to sort the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies. The power supply frequency unit is used to determine the AC power supply frequency corresponding to the range of pulse periods with the most zero-crossing pulse periods based on the sorting results.

[0153] In one alternative implementation, the statistics module 702 includes: The comparison unit is used to compare the current zero-crossing pulse period with the pulse period range corresponding to each AC power supply frequency. The update unit is used to determine the current zero-crossing pulse period as the target AC power frequency corresponding to the current comparison pulse period range if the current zero-crossing pulse period is within the range of the current comparison pulse period, and update the number of zero-crossing pulse periods corresponding to the target AC power frequency.

[0154] In one alternative embodiment, the device further includes: The first error alarm module is used to start abnormal timing if the current zero-crossing pulse period is not within the pulse period range corresponding to any AC power frequency, update the next zero-crossing pulse period to the current zero-crossing pulse period, return to the step of comparing the current zero-crossing pulse period with the pulse period range corresponding to each AC power frequency, until the current zero-crossing pulse period is within the pulse period range corresponding to any AC power frequency, clear the abnormal timing, and perform a power frequency identification error alarm.

[0155] The second error alarm module is used to perform a power frequency identification error alarm in response to the duration of abnormal timing reaching a first preset duration.

[0156] In one optional implementation, the first determining module 701 includes: The signal conversion unit is used to convert the AC voltage signal of the AC power supply into a square wave signal with the same frequency and phase as the AC power supply. The interrupt detection unit is used to detect interrupts based on square wave signals. The interrupt is triggered by the rising edge. The zero-crossing pulse period determination unit is used to determine the zero-crossing pulse period based on two adjacent interrupt trigger signals.

[0157] In one alternative embodiment, the device further includes: The level detection module is used to detect the level of the square wave signal; The alarm module is used to trigger a power frequency identification error alarm if the detected voltage level remains high or low for a duration that reaches a second preset duration.

[0158] In one alternative embodiment, the device further includes: The signal control module is used to respond to the receipt of the first interrupt trigger signal, disable interrupt triggering for a first duration, and then resume interrupt triggering. The first duration is less than the minimum value of the pulse period range corresponding to each AC power supply.

[0159] In one alternative embodiment, the device is applied to an electrical appliance with microwave functionality, and the device further includes: The working status acquisition module is used to acquire the current working status of electrical equipment; The monitoring module is used to monitor the zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each zero-crossing signal if the current working state is non-microwave working state.

[0160] The AC power frequency detection device provided in this embodiment of the invention can execute the AC power frequency detection method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0161] Figure 8 This is a schematic diagram of the hardware structure of a controller for an electrical device provided in an embodiment of the present invention.

[0162] The following is a detailed reference. Figure 8The diagram illustrates a structural schematic suitable for implementing a controller in an embodiment of the present invention. The controller may include a processor (e.g., a central processing unit, graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 802 or a program loaded from memory 808 into random access memory (RAM) 803. RAM 803 also stores various programs and data required for controller operation. The processor 801, ROM 802, and RAM 803 are interconnected via bus 804. An input / output (I / O) interface 805 is also connected to bus 804.

[0163] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; memory 808 including, for example, magnetic tape, hard disk, etc.; and communication devices 809. Communication device 809 allows the controller to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 A controller with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown, and may alternatively implement or have more or fewer devices.

[0164] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a memory 808, or installed from a ROM 802. When the computer program is executed by the processor 801, it performs the functions defined in the AC power frequency detection method of the embodiments of the present invention.

[0165] Figure 8 The controller shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0166] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the AC power frequency detection method shown in the above embodiments is implemented.

[0167] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0168] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for detecting the frequency of an AC power supply, characterized in that, The method includes: Monitor the zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each zero-crossing signal; Within a preset time interval, the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies is counted. The current power frequency of the AC power supply is determined based on the relationship between the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies.

2. The method according to claim 1, characterized in that, Before counting the number of zero-crossing pulse cycles within the pulse period range corresponding to different AC power supply frequencies within a preset time interval, the method further includes: When it is determined that the current voltage zero-crossing signal belongs to the first zero-crossing pulse period range, the AC power supply frequency is initially determined to be the first AC power supply frequency; When it is determined that the current voltage zero-crossing signal belongs to the second zero-crossing pulse period range, the AC power frequency is initially determined to be the second AC power frequency; wherein, the first AC power frequency is less than the second AC power frequency.

3. The method according to claim 2, characterized in that, The step of counting the number of zero-crossing pulse cycles within the preset time interval corresponding to different AC power supply frequencies includes: Within the preset time interval, the number of zero-crossing pulses of the first AC power frequency and the number of zero-crossing pulses of the second AC power frequency are counted.

4. The method according to claim 3, characterized in that, Determining the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse periods within the pulse period range corresponding to different AC power supply frequencies includes: When the AC power frequency is initially determined to be the first AC power frequency, and the number of zero-crossing pulses of the first AC power frequency is determined to be greater than or equal to the number of zero-crossing pulses of the second AC power frequency, the current power frequency of the AC power is determined to be the first AC power frequency. When the AC power frequency is initially determined to be the first AC power frequency, and the number of zero-crossing pulses of the first AC power frequency is determined to be less than the number of zero-crossing pulses of the second AC power frequency, the current power frequency of the AC power is corrected to the second AC power frequency. When the AC power frequency is initially determined to be the second AC power frequency, and the number of zero-crossing pulses of the second AC power frequency is determined to be greater than the number of zero-crossing pulses of the first AC power frequency, the current power frequency of the AC power is determined to be the second AC power frequency. When the AC power frequency is initially determined to be the second AC power frequency, and the number of zero-crossing pulses of the second AC power frequency is determined to be less than the number of zero-crossing pulses of the first AC power frequency, the current power frequency of the AC power is corrected to the first AC power frequency.

5. The method according to claim 1, characterized in that, The pulse period range corresponding to the different AC power supply frequencies is determined in the following way: Obtain the pulse period corresponding to each AC power frequency; Set a duration tolerance range for the pulse period corresponding to each AC power supply frequency, and determine the range of pulse periods corresponding to different AC power supply frequencies.

6. The method according to claim 1, characterized in that, Determining the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse periods within the pulse period range corresponding to different AC power supply frequencies includes: The number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies is sorted. Based on the sorting results, the AC power frequency corresponding to the range of pulse periods with the most zero-crossing pulse periods is determined as the current power frequency.

7. The method according to claim 1, characterized in that, The step of counting the number of zero-crossing pulse cycles within the preset time interval corresponding to different AC power supply frequencies includes: Compare the current zero-crossing pulse period with the pulse period range corresponding to each AC power supply frequency; If the current zero-crossing pulse period is within the range of the pulse periods being compared, the current zero-crossing pulse period is determined as the target AC power frequency corresponding to the range of the pulse periods being compared, and the number of zero-crossing pulse periods corresponding to the target AC power frequency is updated.

8. The method according to claim 2 or 7, characterized in that, The method further includes: If the current zero-crossing pulse period is not within the pulse period range corresponding to any AC power frequency, abnormal timing begins, and the next zero-crossing pulse period is updated to the current zero-crossing pulse period. The process then returns to the step of comparing the current zero-crossing pulse period with the pulse period range corresponding to each AC power frequency, until the current zero-crossing pulse period falls within the pulse period range corresponding to any AC power frequency. At this point, abnormal timing is cleared. In response to the abnormal timing duration reaching the first preset duration, a power frequency identification error alarm is triggered.

9. The method according to claim 1, characterized in that, The monitoring of the zero-crossing signal of the AC power supply includes: The AC voltage signal of the AC power supply is converted into a square wave signal with the same frequency and phase as the AC power supply. Interruption detection is performed based on the square wave signal, and the interrupt is triggered by a rising edge. The zero-crossing pulse period is determined based on two adjacent interrupt trigger signals.

10. The method according to claim 9, characterized in that, The method further includes: The level of the square wave signal is detected; If the duration of the detected high or low level signal reaches the second preset duration, a power frequency identification error alarm will be triggered.

11. The method according to claim 9, characterized in that, The method further includes: In response to receiving the first interrupt trigger signal, interrupt triggering is disabled for a first duration and then resumed, where the first duration is less than the minimum value of the pulse period range corresponding to each AC power supply.

12. The method according to claim 1, characterized in that, The method is applied to electrical equipment with microwave functionality, and the method further includes: Obtain the current operating status of the electrical equipment; If the current operating state is a non-microwave operating state, the step of monitoring the voltage zero-crossing signal of the AC power supply and determining the zero-crossing pulse period corresponding to each voltage zero-crossing signal is performed.

13. An AC power supply frequency detection device, characterized in that, The device includes: The first determining module is used to monitor the voltage zero-crossing signal of the AC power supply and determine the zero-crossing pulse period corresponding to each voltage zero-crossing signal. The statistics module is used to count the number of zero-crossing pulse cycles within the pulse cycle range corresponding to different AC power supply frequencies within a preset time interval. The second determining module is used to determine the current power frequency of the AC power supply based on the relationship between the number of zero-crossing pulse periods within the pulse period range corresponding to different AC power supply frequencies.

14. An electrical appliance, characterized in that, Includes a controller, the controller comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 12.

15. The electrical equipment according to claim 14, characterized in that, The electrical appliance is a microwave oven.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 12.