PWM signal frequency detection method and device, and household appliance

By capturing the edges of the PWM signal and performing specific operations, the problem of large errors in PWM signal frequency detection is solved, more accurate frequency detection and device control are achieved, and the operating accuracy and reliability of household appliances are improved.

CN120722073APending Publication Date: 2025-09-30QINDAO HAIER REFRIGERATOR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410376778.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-29
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

The existing PWM signal frequency detection method has large errors, which affects the speed control accuracy of household appliance compressors and other equipment.

Method used

By capturing the target edge of the PWM signal, obtaining the initial period value, performing multiplication and division operations on the counting frequency value within a certain range, and combining the target multiples and remainder processing, the actual frequency value of the PWM signal is calculated to reduce calculation errors.

Benefits of technology

The accuracy of PWM signal frequency detection is improved, ensuring more accurate frequency conversion operation of household appliances, protecting the equipment and extending its service life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120722073A_ABST
    Figure CN120722073A_ABST
Patent Text Reader

Abstract

The invention discloses a PWM signal frequency detection method and device and a household appliance, and belongs to the technical field of household appliances. The PWM signal frequency detection method comprises the following steps: counting based on a counting period, and obtaining an initial period value based on counting values when a target edge of a PWM signal is continuously captured twice; the target edge comprises at least one of a rising edge and a falling edge; under the condition that the initial period value is in the first range, multiplying a counting frequency value corresponding to the counting period by a target multiple, dividing by the initial period value, and rounding down to obtain an initial rotating speed value; the target multiple is the multiple of the rotating speed of the target equipment relative to the working frequency of the target equipment; and obtaining the value of the actual frequency of the PWM signal based on the quotient obtained by dividing the initial rotating speed value by the target multiple. According to the PWM signal frequency detection method and device, and the household electrical appliance provided by the invention, a more accurate frequency value can be obtained, and the precision of frequency detection of the PWM signal can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of household appliances, and in particular relates to a method and device for detecting the frequency of a PWM signal, and a household appliance. Background Art

[0002] PWM (Pulse Width Modulation) is a periodic digital signal consisting of a series of square wave pulses with varying pulse widths. Within a fixed period, the PWM signal alternates between high and low levels, with the duration of the high level being the pulse width.

[0003] In the field of household appliances, PWM signals are widely used to control compressors and other components. By varying the frequency of the PWM signal, the speed of the compressor and other components can be altered, thereby achieving variable-frequency operation of the appliance. For example, a variable-frequency refrigerator typically achieves variable-frequency operation by sending PWM signals of varying frequencies to the inverter board based on cooling requirements. The inverter board then analyzes the PWM signal and converts it into the compressor's speed.

[0004] Therefore, the accuracy of PWM signal frequency detection is directly related to the precision of speed control for household appliances such as compressors. Existing PWM signal frequency detection methods generally use a timer to count the PWM signal pulses and directly determine the PWM signal frequency based on the count value. However, the frequency detected by this method can have significant errors. Summary of the Invention

[0005] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a method and device for detecting the frequency of a PWM signal, and a household appliance, which can more accurately detect the frequency of the PWM signal.

[0006] In a first aspect, the present application provides a method for detecting the frequency of a PWM signal, the method comprising:

[0007] Counting based on a counting cycle, and obtaining an initial cycle value based on a count value when a target edge of the PWM signal is captured twice in succession; the target edge includes at least one of a rising edge and a falling edge;

[0008] When the initial period value is within the first range, the counting frequency value corresponding to the counting period is multiplied by a target multiple, and the resultant is divided by the initial period value and rounded down to obtain an initial rotational speed value; the target multiple is a multiple of the rotational speed of the target device relative to the operating frequency of the target device;

[0009] The actual frequency value of the PWM signal is obtained based on a quotient obtained by dividing the initial rotation speed value by the target multiple.

[0010] According to the frequency detection method of the PWM signal of the present application, the target edge of the PWM signal is captured to obtain the initial period value. When the initial period value is within the first range, the counting frequency value corresponding to the counting period is multiplied by the target multiple, divided by the initial period value and rounded down to obtain the initial speed value. Then, based on the quotient obtained by dividing the initial speed value by the target multiple, the actual frequency value of the PWM signal is obtained. The initial speed value is first multiplied by the target multiple to obtain the initial speed value, and then divided by the initial speed value to obtain the actual frequency value of the PWM signal. Compared with the method of directly calculating the inverse of the period value and rounding it to obtain the frequency value, the method of multiplying first and then dividing can retain the decimal part of each parameter as much as possible, thereby reducing the calculation error, obtaining a more accurate frequency value, and improving the accuracy of frequency detection of the PWM signal.

[0011] According to one embodiment of the present application, obtaining the actual frequency value of the PWM signal based on a quotient obtained by dividing the initial speed value by the target multiple includes:

[0012] When the remainder obtained by dividing the initial speed value by the target multiple is greater than a preset threshold, the quotient is added by 1 to obtain the actual frequency value of the PWM signal; the preset threshold is less than the target multiple and greater than half of the target multiple.

[0013] According to the frequency detection method of the PWM signal of the present application, by adding 1 to the initial frequency value when the remainder obtained by dividing the initial speed value by the target multiple is greater than a preset threshold, the actual frequency value of the PWM signal is obtained. This can accurately determine that the remainder is generated by an actual complete cycle of the PWM signal, and the obtained actual frequency value of the PWM signal is more accurate, which can improve the accuracy of the frequency detection of the PWM signal.

[0014] According to one embodiment of the present application, obtaining the actual frequency value of the PWM signal based on a quotient obtained by dividing the initial speed value by the target multiple further includes:

[0015] When the remainder is less than or equal to the preset threshold, the quotient is determined as the value of the actual frequency of the PWM signal.

[0016] According to one embodiment of the present application, after obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes:

[0017] When a timing cycle has passed and the number of pulses of the PWM signal captured in the timing cycle is within a second range, multiplying the most recently obtained actual frequency of the PWM signal by the target multiple to obtain a target speed value;

[0018] When the target device is not shut down, the actual rotation speed of the target device is controlled based on the target rotation speed value.

[0019] According to the frequency detection method of the PWM signal of the present application, when a timing cycle has passed and the number of pulses of the PWM signal captured within a timing cycle is within a second range, the actual frequency value of the PWM signal obtained most recently is multiplied by the target multiple to obtain the target speed value. When the target device is not shut down, the actual speed of the target device is controlled based on the target speed value, which can more accurately control the actual speed of the target device.

[0020] According to one embodiment of the present application, after obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes:

[0021] After a timing cycle has elapsed and the number of pulses of the PWM signal captured within the timing cycle is not within a second range, determining whether a target condition is met; the target condition is that the number of pulses is not within the second range for N consecutive timing cycles; N is a positive integer greater than 1;

[0022] When the target condition is met, the target rotational speed value is reset to zero, the target device is controlled to shut down, and the initial cycle value is reacquired.

[0023] According to the frequency detection method of the PWM signal of the present application, by clearing the target speed value to zero and controlling the target device to shut down when a timing cycle has passed and the number of pulses of the PWM signal captured within a timing cycle is not within the second range, and the number of pulses of the PWM signal captured within N consecutive timing cycles is not within the second range, anomalies in the variable frequency operation of household appliances can be discovered more promptly, household appliances can be protected, and the service life of household appliances can be extended.

[0024] According to one embodiment of the present application, after obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes:

[0025] If a timing cycle has not elapsed, the initial cycle value is reacquired.

[0026] According to one embodiment of the present application, after multiplying the most recently obtained actual frequency value of the PWM signal by the target multiple to obtain the target speed value, the method further includes:

[0027] When the target device is stopped and the target rotational speed value is within a third range, the target device is controlled to start up and the actual rotational speed of the target device is controlled based on the target rotational speed value.

[0028] According to one embodiment of the present application, after determining whether the target condition is met, the method further includes:

[0029] If the target condition is not met, the initial period value is reacquired.

[0030] In a second aspect, the present application provides a frequency detection device for a PWM signal, the device comprising:

[0031] A first acquisition module is configured to count based on a counting cycle and acquire an initial cycle value based on a count value when a target edge of the PWM signal is captured twice in succession; the target edge includes at least one of a rising edge and a falling edge;

[0032] a second acquisition module configured to, when the initial period value is within the first range, multiply the counting frequency value corresponding to the counting period by a target multiple, divide the result by the initial period value, and round down to obtain an initial rotational speed value; the target multiple is a multiple of the rotational speed of the target device relative to the operating frequency of the target device;

[0033] The third acquisition module is configured to acquire a value of an actual frequency of the PWM signal based on a quotient obtained by dividing the initial rotational speed value by the target multiple.

[0034] According to the frequency detection device of the PWM signal of the present application, the target edge of the PWM signal is captured to obtain the initial period value. When the initial period value is within the first range, the counting frequency value corresponding to the counting period is multiplied by the target multiple, divided by the initial period value and rounded down to obtain the initial speed value. Then, based on the quotient obtained by dividing the initial speed value by the target multiple, the actual frequency value of the PWM signal is obtained. The initial speed value is first multiplied by the target multiple to obtain the initial speed value, and then divided by the initial speed value to obtain the actual frequency value of the PWM signal. Compared with the method of directly calculating the inverse of the period value and rounding it to obtain the frequency value, the method of multiplying first and then dividing can retain the decimal part of each parameter as much as possible, thereby reducing the calculation error, obtaining a more accurate frequency value, and improving the accuracy of frequency detection of the PWM signal.

[0035] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the frequency detection method for the PWM signal as described in the first aspect above is implemented.

[0036] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the frequency detection method of the PWM signal as described in the first aspect above is implemented.

[0037] In a fifth aspect, the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the frequency detection method of the PWM signal as described in the first aspect.

[0038] In a sixth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the frequency detection method for a PWM signal as described in the first aspect above.

[0039] In the seventh aspect, the present application provides a household appliance, characterized in that it adopts the frequency detection method of the PWM signal as described in the first aspect, or includes the frequency detection device of the PWM signal as described in the second aspect, or includes the electronic device as described in the third aspect, or includes the non-transitory computer-readable storage medium as described in the fourth aspect.

[0040] According to one embodiment of the present application, the household appliance includes at least one of a refrigerator, an air conditioner, a washing machine, a dishwasher, a range hood, a steam oven, a microwave oven, a water heater, a purifier and a disinfection cabinet.

[0041] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0043] Figure 1 This is one of the flow charts of the frequency detection method of the PWM signal provided in the embodiment of the present application;

[0044] Figure 2 This is a second flow chart of the frequency detection method of a PWM signal provided in an embodiment of the present application;

[0045] Figure 3 1 is a schematic structural diagram of a frequency detection device for a PWM signal provided in an embodiment of the present application;

[0046] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0048] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0049] In the related art, variable frequency operation of household appliances is achieved by changing the rotation speed of a device included in the household appliance. For example, for air conditioners and refrigerators, the device may be a compressor; for range hoods, the device may be a fan.

[0050] The PWM signal used to control household appliances to achieve variable frequency operation is a square wave. The frequency of the PWM signal is generally 40Hz to 150Hz, and the frequency value is a positive number, not a decimal. The change in the rotational speed of the above-mentioned device is achieved based on the change in the frequency of the PWM signal. Generally, there is a multiple relationship between the rotational speed of the above-mentioned device and the frequency of the PWM signal. For example, for the compressor included in an air conditioner or refrigerator, the compressor speed = 30 * the frequency of the PWM signal. When the frequency of the PWM signal is 40Hz to 150Hz, the corresponding compressor speed is 1200 to 4500 revolutions per second.

[0051] Due to the clock size, accuracy, and chip resource limitations of the microcontrollers used in the main control board and / or inverter board of a household appliance, it's difficult for the main control board to generate a PWM signal with a very accurate frequency. Typically, there's a certain error between the frequency of the PWM signal it generates and the target value. Furthermore, even if the main control board generates a PWM signal with a very accurate frequency, there may still be a certain error between the actual frequency of the PWM signal received by the inverter board and the actual frequency and timing of the PWM signal generated by the main control board.

[0052] To improve the performance and user experience of household appliances, the requirements for the speed control accuracy of these devices are becoming increasingly stringent, now requiring no more than ±5 revolutions, or ±5% of the speed corresponding to the target frequency. Since the accuracy of PWM signal frequency detection is directly related to the accuracy of speed control of these devices, the requirements for PWM signal frequency detection accuracy are also becoming increasingly stringent.

[0053] The following, in conjunction with the accompanying drawings, describes in detail the PWM signal frequency detection method, PWM signal frequency detection device, electronic device, and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0054] The frequency detection method of the PWM signal may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0055] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but a desktop computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0056] In the following embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse, and a joystick.

[0057] The frequency detection method for a PWM signal provided in an embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the frequency detection method for a PWM signal. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The frequency detection method for a PWM signal provided in an embodiment of the present application is described below using an electronic device as an example of the execution entity.

[0058] The PWM signal frequency detection method provided in the embodiments of the present application can be applied to any household appliance capable of variable frequency operation. The household appliance may include the electronic device that executes the PWM signal frequency detection method, or a functional module or functional entity within the electronic device that is capable of implementing the PWM signal frequency detection method.

[0059] like Figure 1 As shown, the frequency detection method of the PWM signal includes: step 110, step 120 and step 130.

[0060] Step 110 : Count based on the counting cycle, and obtain an initial cycle value based on the count value when the target edge of the PWM signal is captured twice in succession; the target edge includes at least one of a rising edge and a falling edge.

[0061] In actual implementation, counting can be performed based on a preset counting cycle, with the count value incremented by one after each counting cycle. While counting, the target edge of the PWM signal can be captured. Each time a target edge of the PWM signal is captured, the count value at that time is obtained.

[0062] It is understandable that the above-mentioned PWM signal may be a PWM signal received by a frequency conversion board of a household appliance and input by a main control board to the frequency conversion board.

[0063] It is understood that the counting period can be set according to actual conditions, as long as it is greater than the maximum frequency of the PWM signal. The specific value of the counting period is not specifically limited in the embodiments of the present application. Generally, the smaller the counting period, the more accurate the initial period value obtained subsequently. For example, the counting period can be 0.000015625 seconds or 0.00003125 seconds, etc. In actual implementation, the counting period can be equal to or slightly less than the minimum time resolution achievable by the above-mentioned electronic device.

[0064] In actual implementation, the target edge may be a rising edge or a falling edge, or the target edge may be both a rising edge and a falling edge. Therefore, capturing the target edge of the PWM signal twice consecutively may include: capturing the rising edge of the PWM signal twice consecutively, capturing the falling edge of the PWM signal twice consecutively, or capturing the rising edge and falling edge of the PWM signal once and then capturing the rising edge and falling edge of the PWM signal again.

[0065] After the target edge of the PWM signal is captured twice in succession, the count value when the target edge of the PWM signal is captured the second time in the two consecutive times minus the count value when the target edge of the PWM signal is captured the first time in the two consecutive times can be used as the initial period value.

[0066] It can be understood that the difference between the count values ​​when the target edge of the PWM signal is captured twice in succession is the number of the aforementioned count cycles that pass between the two target edges of the PWM signal, and thus can be used to indicate the period of the PWM signal.

[0067] It should be noted that the above step of obtaining the initial period value may be performed continuously, that is, each time the target edge of the PWM signal is captured twice in succession, the initial period value is obtained based on the count value when the target edge of the PWM signal is captured twice in succession.

[0068] In actual execution, after obtaining the initial period value each time, the count value may be cleared to zero, or the count value may not be cleared to zero.

[0069] Step 120: When the initial period value is within the first range, multiply the counting frequency value corresponding to the counting period by the target multiple, divide the result by the initial period value, and round down to obtain the initial rotational speed value; the target multiple is the multiple of the rotational speed of the target device relative to the operating frequency of the target device.

[0070] In actual execution, after obtaining the initial period value, it can be determined whether the initial period value is within the first range.

[0071] In actual implementation, the upper limit of the first range is no greater than the counting frequency corresponding to the counting period, and the lower limit of the first range can be no less than the counting frequency divided by a first preset value. The first preset value can be slightly greater than the maximum allowable frequency of the PWM signal emitted by the main control board of a household appliance to which this PWM signal frequency detection method is applied, used for variable frequency operation, as a redundancy. The purpose of this redundancy is to reduce errors and improve the accuracy of frequency detection. The specific values ​​of the first range are not limited in this embodiment of the present application.

[0072] For example, when the maximum allowed frequency of the PWM signal is 150 Hz, the first preset value may be 200. Correspondingly, when the counting frequency value is 64,000, the first range may be 320 to 64,000.

[0073] It can be understood that the product of the counting period and the counting frequency value corresponding to the counting period is equal to 1 second.

[0074] In actual execution, when the initial period value is not within the first range, it indicates that an error occurs in capturing the target edge of the PWM signal and the obtained initial period value is incorrect, that is, the obtained initial period value is an invalid value and is discarded.

[0075] In actual execution, when the initial cycle value is within the first range, the counting frequency value can be multiplied by the target multiple first; after the multiplication, the product obtained by the multiplication is divided by the initial cycle value; after the division, the quotient obtained by the division is rounded down, and the rounded-down result is recorded as the initial speed value.

[0076] For example, when the counting frequency value is 64000 and the target multiple is 30, the calculation formula of the initial rotation speed value may be: initial rotation speed value=(64000*30) / initial period value.

[0077] It is understood that the target multiple is a multiple of the rotation speed of the target device relative to the operating frequency of the target device. The target device is a device such as a compressor or a fan included in the household appliance in the related art, which is used to achieve variable frequency operation of the household appliance.

[0078] It should be noted that the remainder division method is adopted in the embodiments of the present application.

[0079] Step 130 : Obtain the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple.

[0080] In actual execution, after obtaining the initial speed value, the initial speed value is divided by the target multiple, and the quotient obtained by this division is used as the initial frequency value.

[0081] After the initial frequency value is obtained, a correction operation may be performed on the initial frequency value according to the remainder obtained by the current division, thereby obtaining the actual frequency value of the aforementioned PWM signal.

[0082] It should be noted that the frequency value of the PWM signal used by the household appliance to realize the variable frequency operation of the household appliance is an integer. Since the remainder division method is adopted, it is necessary to consider the influence of the remainder of the initial speed value divided by the target multiple on the frequency detection result. Therefore, performing the correction operation may include: judging whether the influence of the remainder can be ignored based on the above-mentioned remainder; if it can be ignored, the initial speed value can be used as the actual frequency value of the aforementioned PWM signal; if it cannot be ignored, the initial speed value can be added by 1 as the actual frequency value of the aforementioned PWM signal.

[0083] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, the target edge of the PWM signal is captured to obtain the initial period value. When the initial period value is within the first range, the counting frequency value corresponding to the counting period is multiplied by the target multiple, divided by the initial period value and rounded down to obtain the initial speed value. Then, based on the quotient obtained by dividing the initial speed value by the target multiple, the actual frequency value of the PWM signal is obtained. The initial speed value is first multiplied by the target multiple to obtain the initial speed value, and then divided by the initial speed value to obtain the actual frequency value of the PWM signal. Compared with the method of directly calculating the inverse of the period value and rounding it to obtain the frequency value, the method of multiplying first and then dividing can retain the decimal part of each parameter as much as possible, thereby reducing the calculation error, obtaining a more accurate frequency value, and improving the accuracy of frequency detection of the PWM signal.

[0084] In some embodiments, the actual frequency value of the PWM signal is obtained based on the quotient obtained by dividing the initial speed value by the target multiple, including: when the remainder obtained by dividing the initial speed value by the target multiple is greater than a preset threshold, the quotient is added by 1 to obtain the actual frequency value of the PWM signal; the preset threshold is less than the target multiple and greater than half of the target multiple.

[0085] In actual execution, the remainder obtained by dividing the initial rotation speed value by the target multiple can be compared with a preset threshold value, and how to correct the initial rotation speed value can be determined based on the comparison result.

[0086] It should be noted that the preset threshold value may be less than the target multiple and greater than half of the target multiple. The present embodiment does not specifically limit the specific value of the preset threshold value. For example, when the target multiple is 30, the preset threshold value may be 22 to 24; when the target multiple is 40, the preset threshold value may be 32 to 36; and when the target multiple is 20, the preset threshold value may be 15 to 16.

[0087] If the remainder obtained by dividing the initial speed value by the target multiple is greater than the preset threshold, it means that the remainder is more likely to be generated by an actual complete cycle of the PWM signal. Therefore, the initial frequency value can be increased by 1 to obtain the actual frequency value of the PWM signal.

[0088] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, by adding 1 to the initial frequency value when the remainder obtained by dividing the initial speed value by the target multiple is greater than a preset threshold, the actual frequency value of the PWM signal is obtained. This can accurately determine that the remainder is generated by an actual complete cycle of the PWM signal. The obtained actual frequency value of the PWM signal is more accurate, which can improve the accuracy of the frequency detection of the PWM signal.

[0089] In some embodiments, obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple also includes: when the remainder is less than or equal to a preset threshold, determining the quotient as the actual frequency value of the PWM signal.

[0090] In actual execution, if the remainder obtained by dividing the initial speed value by the target multiple is less than or equal to the preset threshold, it means that the remainder is more likely to be generated by a non-existent cycle of the PWM signal, that is, the remainder is more likely to correspond to a non-existent cycle. Therefore, the initial frequency value can be used as the actual frequency value of the PWM signal.

[0091] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, by using the initial frequency value as the actual frequency value of the PWM signal when the remainder obtained by dividing the initial speed value by the target multiple is less than or equal to the preset threshold, it can be accurately determined that the remainder is generated by a non-existent cycle of the PWM signal. The obtained actual frequency value of the PWM signal is more accurate, which can improve the accuracy of the frequency detection of the PWM signal.

[0092] In some embodiments, after obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes: after a timing cycle has passed and the number of pulses of the PWM signal captured within a timing cycle is within a second range, multiplying the most recently obtained actual frequency value of the PWM signal by the target multiple to obtain the target speed value.

[0093] In actual implementation, after detecting the frequency of the PWM signal, the rotation speed of the target device can be more accurately controlled based on the detected actual frequency value of the PWM signal.

[0094] Since frequency is the number of periodic changes per unit time, and is typically measured in fractions of a second (Hz), this unit time can be used as a timing cycle. The number of PWM signal pulses captured during each timing cycle is then counted to obtain the pulse count. In theory, the pulse count should equal the PWM signal's frequency.

[0095] After a timing cycle has passed, it can be determined whether the number of pulses of the PWM signal captured in the timing cycle is within the second range, so as to avoid frequency false triggering.

[0096] Generally, the timing period can be 1 second or 0.5 second, etc.

[0097] The second range is determined based on the permissible frequency range of the PWM signal emitted by the main control board of a household appliance to which this PWM signal frequency detection method is applied, for achieving variable-frequency operation. In actual implementation, the permissible frequency range of the PWM signal can be directly used as the second range, or redundancy can be added to the permissible frequency range of the PWM signal to obtain the second range. The redundancy reduces errors and improves the accuracy of speed control. The specific value of the second range is not limited in this embodiment of the present application.

[0098] For example, the frequency range of the PWM signal for the variable frequency refrigerator to achieve variable frequency operation is generally 40Hz to 150Hz. When the timing period is 1 second, the second range can be 40 to 150, or the second range can be 30 to 200, 30 to 180 or 35 to 160, etc.

[0099] For example, the frequency range of the PWM signal for the variable frequency refrigerator to achieve variable frequency operation is generally 40Hz to 150Hz. When the timing period is 0.5 seconds, the second range can be 20 to 75, or the second range can be 15 to 100, 15 to 90 or 17 to 80, etc.

[0100] If the number of PWM signal pulses captured during the current timing cycle falls within the second range, the pulse count is valid. The actual frequency of the PWM signal obtained at the end of the current timing cycle and the closest to the end of the current timing cycle can be obtained. After obtaining this value, it can be multiplied by the target multiplier to obtain the target speed value.

[0101] When the target device is not shut down, the actual rotation speed of the target device is controlled based on the target rotation speed value.

[0102] In actual execution, after obtaining the target speed value, if the target device is not shut down, the target speed value can be used as a control target for the actual speed of the target device to control the actual speed of the target device.

[0103] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, when a timing cycle has passed and the number of pulses of the PWM signal captured within the timing cycle is within the second range, the actual frequency value of the PWM signal obtained most recently is multiplied by the target multiple to obtain the target speed value. When the target device is not shut down, the actual speed of the target device is controlled based on the target speed value, which can more accurately control the actual speed of the target device.

[0104] In some embodiments, in some embodiments, after multiplying the actual frequency value of the PWM signal obtained most recently by the target multiple to obtain the target speed value, the method also includes: when the target device is shut down and the target speed value is within a third range, controlling the target device to start and controlling the actual speed of the target device based on the target speed value.

[0105] In actual execution, after obtaining the target rotational speed value, when the target device is shut down, it can be determined whether the target rotational speed value is within the third range.

[0106] The third range may be determined by the rotation speed range allowed by the target device. The specific value of the third range is not limited in the embodiment of the present application.

[0107] For example, the allowable rotation speed range of the compressor of the inverter refrigerator is generally 1200 to 4500 revolutions per second, so the third range may be 1200 to 4500 revolutions per second.

[0108] When the target speed value is within the third range, it means that the target speed value is within the speed range allowed by the target device, and the previous steps have determined that the number of pulses of the PWM signal captured within this timing cycle is within the second range, which meets the startup conditions of the target device. The abnormality of the variable frequency operation of the household appliance has been eliminated, and the target device can be controlled to start and the target speed value can be used as the control target of the actual speed of the target device to control the actual speed of the target device.

[0109] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, when a timing cycle has passed and the number of pulses of the PWM signal captured within the timing cycle is within the second range, the actual frequency value of the PWM signal obtained most recently is multiplied by the target multiple to obtain the target speed value. When the target device is shut down and the target speed value is within the third range, the target device is controlled to start and the actual speed of the target device is controlled based on the target speed value. This can more accurately determine that the target device can be started and the actual speed of the target device can be controlled.

[0110] In some embodiments, after obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes: after a timing cycle has passed and the number of pulses of the PWM signal captured within a timing cycle is not within a second range, determining whether the target condition is met; the target condition is that the number of pulses for N consecutive timing cycles is not within the second range; N is a positive integer greater than 1.

[0111] In actual execution, after a timing cycle, the number of pulses of the PWM signal captured in the timing cycle is not within the second range, indicating that an error occurs in capturing the pulses of the PWM signal and the number of pulses is invalid.

[0112] If the number of pulses of the PWM signal captured within the current timing cycle is not within the second range, a determination is made as to whether the number of pulses of the PWM signal captured within N consecutive timing cycles (the current timing cycle being the third of the N consecutive timing cycles) is not within the second range.

[0113] When the target conditions are met, the target speed value is cleared to zero, the target device is controlled to stop, and the initial cycle value is re-obtained.

[0114] In actual execution, the number of pulses of the PWM signal captured within N consecutive timing cycles is not within the second range, indicating that the number of pulses of the PWM signal captured within this timing cycle is not within the second range and is not caused by occasional interference, but by an abnormality in the frequency of the PWM signal emitted by the main control board and an abnormality in the variable frequency operation of the household appliance. The target speed value is cleared to zero and the target device is controlled to shut down to protect the household appliance.

[0115] While clearing the target speed value to zero and controlling the target device to shut down, the process can also return to step 110 to re-acquire the initial cycle value.

[0116] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, by clearing the target speed value to zero and controlling the target device to shut down when a timing cycle has passed and the number of pulses of the PWM signal captured within the timing cycle is not within the second range, and the number of pulses of the PWM signal captured within N consecutive timing cycles is not within the second range, anomalies in the variable frequency operation of household appliances can be discovered more promptly, household appliances can be protected, and the service life of household appliances can be extended.

[0117] In some embodiments, after determining whether the target condition is met, the method further includes: if the target condition is not met, reacquiring the initial period value.

[0118] In actual execution, when the number of pulses of the PWM signal captured in the current timing cycle is not within the second range, and the number of pulses of the PWM signal captured in N consecutive timing cycles (the current timing cycle is the third timing cycle of the above N consecutive timing cycles) is not within the second range, it means that the number of pulses of the PWM signal captured in the current timing cycle is not within the second range, which may be caused by occasional interference. The target device is temporarily not controlled to shut down, and the initial cycle value is re-obtained. It is subsequently determined whether the number of pulses of the PWM signal captured in N consecutive timing cycles is not within the second range, so as to determine whether the number of pulses of the PWM signal captured in the current timing cycle is not within the second range due to occasional interference or due to abnormality in the variable frequency operation of the household appliance.

[0119] According to the frequency detection method of the PWM signal provided in the embodiment of the present application, by re-obtaining the initial cycle value after a timing cycle has passed and the number of pulses of the PWM signal captured within the timing cycle is not within the second range, and the number of pulses of the PWM signal captured within N consecutive timing cycles is not outside the second range, it is possible to further determine whether the variable frequency operation of the household appliance is abnormal. This can accurately determine whether the variable frequency operation of the household appliance is abnormal and avoid false triggering of the target device to shut down.

[0120] In some embodiments, after obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes: re-obtaining the initial cycle value before a timing cycle has elapsed.

[0121] In actual execution, the initial period value can be re-acquired before a timing cycle has passed, and the initial period value can be periodically obtained until a timing cycle has passed. The actual frequency value of the PWM signal can be further confirmed based on the number of pulses to prevent frequency false triggering.

[0122] In order to facilitate the understanding of the above embodiments of the present application, an implementation process of the frequency detection method of the PWM signal is described below. Figure 2 As shown, an implementation process of the frequency detection method of the PWM signal may include the following steps.

[0123] Step 210: Obtain an initial rotation speed value.

[0124] In actual implementation, a timer with a capture function can be used to capture the target edge of the PWM signal. Frequency conversion boards generally use single-chip microcontrollers, and the timer with a capture function has relatively low requirements for the microcontroller, which can be met by most microcontrollers.

[0125] Exemplarily, the timer may be a 16-bit timer. Exemplarily, the timer clock input may be set to 64K, or other values. The timer clock input being 64K indicates that the frequency of the timer's counting cycle is 64KHz.

[0126] The count value at the time of capturing the target edge minus the count value at the time of capturing the target edge last time is the period value of the PWM signal, which is recorded as the initial period value. If the initial period value is greater than 64000 or less than 320, it is considered an invalid value and is discarded.

[0127] Set a constant value of 64000 (Hz) to equal the frequency value corresponding to the count cycle. Initial speed value = (64000 * 30) / initial cycle value. Initial frequency value equals the integer part of the initial speed value divided by 30. The target multiple is 30.

[0128] Step 220: Calculate the remainder of the initial rotation speed value to the target multiple.

[0129] Step 230: Determine whether the remainder is greater than 22.

[0130] Determine whether the remainder of the initial speed value divided by 30 is greater than 22. The preset threshold is 22. If yes, execute step 240; if no, execute step 250.

[0131] In step 240 , the actual frequency value is equal to the initial frequency value plus 1.

[0132] In step 250 , the actual frequency value is equal to the initial frequency value.

[0133] Step 260: Determine whether the timing has passed 1 second.

[0134] The timing period is 1 second. If yes, execute step 270; if no, return to execute step 210.

[0135] To prevent false frequency triggering, the frequency is confirmed by counting the number of PWM signal pulses within 1 second. Each time a PWM signal pulse is captured, an interrupt is generated. Each time an interrupt is captured, the count value is incremented, thus obtaining the number of PWM signal pulses within 1 second.

[0136] Step 270: Determine whether the number of pulses is greater than 200 or less than 30.

[0137] If yes, go to step 290 ; if no, go to step 280 .

[0138] The second range is 30 to 200. If the number of PWM signal pulses in one second is between 30 and 200, it is considered reasonable; if it is outside the range, it is considered unreasonable. The count value of the PWM signal pulses is reset to zero after each second.

[0139] Step 280: The target speed value is equal to 30 multiplied by the actual frequency.

[0140] After the target speed value is determined, the process returns to step 210 .

[0141] Step 290: Determine whether the result of step 270 is yes three times in a row.

[0142] If yes, execute step 291; if no, return to execute step 210.

[0143] Step 291: The target speed value is reset to zero.

[0144] The compressor of the inverter refrigerator is running. If the number of pulses is unreasonable for three consecutive times, it is considered that the compressor needs to shut down.

[0145] If the compressor is in the stopped state, the number of pulses within one second is within 30 to 200, and the target speed value meets the startup requirements, the compressor can be restarted, otherwise it will not start.

[0146] The compressor startup conditions can be between 30 and 200 pulses per second and a target speed between 1200 and 4500 revolutions per second. The third range is 1200 to 4500. If the target speed is within a reasonable range, the compressor can start and operate.

[0147] Practical verification has shown that the frequency detection method for PWM signals provided by any embodiment of the present application accurately detects frequency. By utilizing the timer capture function of the microcontroller and adding a correction mechanism, accurate frequency detection can be achieved, thereby accurately controlling the speed. The speed control error can be controlled to no more than plus or minus 5 revolutions or no more than plus or minus 5% of the speed corresponding to the target frequency.

[0148] The frequency detection method for PWM signals provided in the embodiment of the present application can be performed by a frequency detection device for PWM signals. In the embodiment of the present application, the frequency detection method for PWM signals performed by the frequency detection device for PWM signals is used as an example to illustrate the frequency detection device for PWM signals provided in the embodiment of the present application.

[0149] An embodiment of the present application also provides a frequency detection device for a PWM signal.

[0150] like Figure 3 As shown, the frequency detection device of the PWM signal includes: a first acquisition module 310 , a second acquisition module and a third acquisition module 330 .

[0151] A first acquisition module 310 is configured to count based on a counting cycle and acquire an initial cycle value based on a count value when a target edge of the PWM signal is captured twice in succession; the target edge includes at least one of a rising edge and a falling edge;

[0152] The second acquisition module 320 is configured to, when the initial period value is within the first range, multiply the counting frequency value corresponding to the counting period by a target multiple, divide the result by the initial period value, and round down to obtain an initial rotational speed value; the target multiple is a multiple of the rotational speed of the target device relative to the operating frequency of the target device;

[0153] The third acquisition module 330 is configured to acquire the actual frequency value of the PWM signal based on a quotient obtained by dividing the initial rotational speed value by the target multiple.

[0154] According to the frequency detection device of the PWM signal provided in the embodiment of the present application, the target edge of the PWM signal is captured to obtain the initial period value. When the initial period value is within the first range, the counting frequency value corresponding to the counting period is multiplied by the target multiple, divided by the initial period value and rounded down to obtain the initial speed value. Then, based on the quotient obtained by dividing the initial speed value by the target multiple, the actual frequency value of the PWM signal is obtained. The initial speed value is first multiplied by the target multiple to obtain the initial speed value, and then divided by the initial speed value to obtain the actual frequency value of the PWM signal. Compared with the method of directly calculating the inverse of the period value and rounding it to obtain the frequency value, the method of multiplying first and then dividing can retain the decimal part of each parameter as much as possible, thereby reducing the calculation error, obtaining a more accurate frequency value, and improving the accuracy of frequency detection of the PWM signal.

[0155] In some embodiments, the third acquisition module 330 can be specifically used to add 1 to the quotient to obtain the actual frequency value of the PWM signal when the remainder obtained by dividing the initial speed value by the target multiple is greater than a preset threshold; the preset threshold is less than the target multiple and greater than half of the target multiple.

[0156] In some embodiments, the third obtaining module 330 may be further configured to determine the quotient as the actual frequency value of the PWM signal when the remainder is less than or equal to a preset threshold.

[0157] In some embodiments, the PWM signal frequency detection device may further include:

[0158] a fourth acquisition module, configured to, when a timing cycle has passed and the number of pulses of the PWM signal captured within the timing cycle is within a second range, multiply the value of the most recently obtained actual frequency of the PWM signal by the target multiple to obtain a target speed value;

[0159] The control module is used to control the actual rotation speed of the target device based on the target rotation speed value when the target device is not shut down.

[0160] In some embodiments, the PWM signal frequency detection device may further include:

[0161] a determination module, configured to determine whether a target condition is satisfied when a timing cycle has elapsed and the number of pulses of the PWM signal captured within the timing cycle is not within a second range; the target condition being that the number of pulses for N consecutive timing cycles is not within the second range; N being a positive integer greater than 1;

[0162] The control module can also be used to reset the target speed value to zero, control the target device to stop, and re-acquire the initial cycle value when the target conditions are met.

[0163] In some embodiments, the first acquisition module 310 may also be configured to reacquire the initial period value when a timing period has not elapsed.

[0164] In some embodiments, the control module may also be configured to control the target device to start up and control the actual rotation speed of the target device based on the target rotation speed value when the target device is shut down and the target rotation speed value is within a third range.

[0165] In some embodiments, the first acquisition module 310 may also be configured to reacquire the initial period value when the target condition is not met.

[0166] The PWM signal frequency detection device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or chip. The electronic device can be a terminal or other devices other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0167] The PWM signal frequency detection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0168] The frequency detection device of the PWM signal provided in the embodiment of the present application can achieve Figures 1 to 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0169] In some embodiments, as Figure 4 As shown, an embodiment of the present application further provides an electronic device 400, including a processor 410, a memory 420, and a computer program stored in the memory 420 and executable on the processor 410. When the program is executed by the processor 410, each process of the above-mentioned PWM signal frequency detection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0170] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0171] An embodiment of the present application further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned PWM signal frequency detection method embodiment are implemented, and the same technical effects can be achieved. To avoid repetition, they are not described here.

[0172] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0173] An embodiment of the present application further provides a computer program product, including a computer program, which implements the above-mentioned PWM signal frequency detection method when executed by a processor.

[0174] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0175] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned PWM signal frequency detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0176] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0177] An embodiment of the present application also provides a household appliance that adopts the PWM signal frequency detection method provided in any of the foregoing embodiments, or includes the PWM signal frequency detection device provided in any of the foregoing embodiments, or includes the electronic device provided in any of the foregoing embodiments, or includes the non-transitory computer-readable storage medium provided in any of the foregoing embodiments.

[0178] In some embodiments, the household appliances include at least one of a refrigerator, an air conditioner, a washing machine, a dishwasher, a range hood, a steam oven, a microwave oven, a water heater, a purifier and a disinfection cabinet.

[0179] In actual implementation, the above-mentioned household appliances can be any household appliances that can operate with variable frequency, such as refrigerators, air conditioners, washing machines, dishwashers, range hoods, steam ovens, microwave ovens, water heaters, purifiers or disinfection cabinets.

[0180] According to the household appliance of the present application, the control of the variable frequency operation of the household appliance is more precise, the service life of the household appliance can be extended, and the user experience can be improved.

[0181] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0183] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

[0184] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0185] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and purpose of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for detecting the frequency of a PWM signal, characterized in that: include: Counting is performed based on the counting cycle, and an initial cycle value is obtained based on the count value when the target edge of the PWM signal is captured twice in succession; The target edge includes at least one of a rising edge and a falling edge; When the initial period value is within the first range, multiplying the counting frequency value corresponding to the counting period by the target multiple, dividing the result by the initial period value, and rounding down to obtain an initial rotational speed value; The target multiple is a multiple of the rotation speed of the target device relative to the operating frequency of the target device; The actual frequency value of the PWM signal is obtained based on a quotient obtained by dividing the initial rotation speed value by the target multiple.

2. The frequency detection method of the PWM signal according to claim 1, wherein: The acquiring the actual frequency value of the PWM signal based on a quotient obtained by dividing the initial speed value by the target multiple includes: When the remainder obtained by dividing the initial speed value by the target multiple is greater than a preset threshold, the quotient is added by 1 to obtain the actual frequency value of the PWM signal; the preset threshold is less than the target multiple and greater than half of the target multiple.

3. The frequency detection method of the PWM signal according to claim 2, characterized in that: The step of obtaining the actual frequency of the PWM signal based on a quotient obtained by dividing the initial speed value by the target multiple further includes: When the remainder is less than or equal to the preset threshold, the quotient is determined as the value of the actual frequency of the PWM signal.

4. The method for detecting the frequency of a PWM signal according to any one of claims 1 to 3, wherein: After obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes: When a timing cycle has passed and the number of pulses of the PWM signal captured in the timing cycle is within a second range, multiplying the most recently obtained actual frequency of the PWM signal by the target multiple to obtain a target speed value; When the target device is not shut down, the actual rotation speed of the target device is controlled based on the target rotation speed value.

5. The frequency detection method of the PWM signal according to claim 4, characterized in that: After obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes: After a timing cycle has elapsed and the number of pulses of the PWM signal captured within the timing cycle is not within a second range, determining whether a target condition is met; the target condition is that the number of pulses is not within the second range for N consecutive timing cycles; N is a positive integer greater than 1; When the target condition is met, the target rotational speed value is reset to zero, the target device is controlled to shut down, and the initial cycle value is reacquired.

6. The method for detecting the frequency of a PWM signal according to claim 4, wherein: After obtaining the actual frequency value of the PWM signal based on the quotient obtained by dividing the initial speed value by the target multiple, the method further includes: If a timing cycle has not elapsed, the initial cycle value is reacquired.

7. The method for detecting the frequency of a PWM signal according to claim 4, wherein: After multiplying the most recently obtained actual frequency of the PWM signal by the target multiple to obtain a target speed value, the method further includes: When the target device is stopped and the target rotational speed value is within a third range, the target device is controlled to start up and the actual rotational speed of the target device is controlled based on the target rotational speed value.

8. The method for detecting the frequency of a PWM signal according to claim 5, wherein: After determining whether the target condition is met, the method further includes: If the target condition is not met, the initial period value is reacquired.

9. A frequency detection device for a PWM signal, characterized in that: include: A first acquisition module is configured to count based on a counting cycle and acquire an initial cycle value based on a count value when a target edge of the PWM signal is captured twice in succession; The target edge includes at least one of a rising edge and a falling edge; a second acquisition module, configured to, when the initial period value is within a first range, multiply the counting frequency value corresponding to the counting period by a target multiple, divide the result by the initial period value, and round down to obtain an initial rotational speed value; The target multiple is a multiple of the rotation speed of the target device relative to the operating frequency of the target device; The third acquisition module is configured to acquire a value of an actual frequency of the PWM signal based on a quotient obtained by dividing the initial rotational speed value by the target multiple.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the frequency detection method of the PWM signal according to any one of claims 1 to 8 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the frequency detection method of the PWM signal according to any one of claims 1 to 8 is implemented.

12. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the frequency detection method of the PWM signal according to any one of claims 1 to 8 is implemented.

13. A household appliance, characterized in that: Adopting the frequency detection method of the PWM signal according to any one of claims 1 to 8, or including the frequency detection device of the PWM signal according to claim 9, or including the electronic device according to claim 10, or including the non-transitory computer-readable storage medium according to claim 11.

14. The household appliance according to claim 13, characterized in that The utility model comprises at least one of a refrigerator, an air conditioner, a washing machine, a dishwasher, a range hood, a steam oven, a microwave oven, a water heater, a purifier and a disinfection cabinet.