Oscillating angle detection method and device, oscillating fan and medium

By collecting fan rotation data in real time using an accelerometer and combining it with oscillation information to calculate the angle, the problem of low efficiency and accuracy in existing fan oscillation angle detection is solved, achieving efficient and accurate angle detection and intelligent fan control.

CN121612239APending Publication Date: 2026-03-06GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511856697.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing fan oscillation angle detection methods have low efficiency and accuracy, especially when the fan has not rotated to a fixed detection point, making accurate positioning impossible and prone to errors due to the inability to detect position changes in real time.

Method used

Accelerometers are used to collect fan rotation data in real time. Combined with oscillation information, the angle information is directly calculated. The oscillation angle is calculated through three-dimensional acceleration component analysis. The dynamic angle determination interval is used to filter out instantaneous interference, so as to achieve real-time and accurate positioning of the angle.

Benefits of technology

It improves the efficiency and accuracy of oscillation angle detection, supports intelligent fan features such as 'wind follows the user' and automatic reset, enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121612239A_ABST
    Figure CN121612239A_ABST
Patent Text Reader

Abstract

The invention discloses a head shaking angle detection method and device, a head shaking fan and a medium. The invention relates to the technical field of fans, which comprises the following steps: if a head shaking starting instruction is received, obtaining head shaking information, and driving a fan main body to rotate according to the head shaking information; and receiving the rotation data collected by the detection module, and determining angle information of the fan main body according to the rotation data and the head shaking information. According to the method, the rotation data of the oscillating fan are collected in real time, the angle information is directly calculated in combination with the oscillating information, delay and errors of a traditional fixed point detection method are effectively overcome, and the angle detection efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fan technology, and in particular to a method, device, oscillating fan and medium for detecting oscillation angle. Background Technology

[0002] Today, with the fast pace of life, users have higher demands for the overall performance of fan products. To meet these diverse needs, existing fans generally require oscillation angle detection. Currently, most fans use stepper motors or synchronous motors to drive oscillation, relying on stepper motor counting to control the angle. However, real-time positioning of the fan's current angle during angle control is a major challenge. A common industry method is to set detection points at a few fixed locations, providing feedback signals when the fan rotates to these points. However, when the fan hasn't rotated to these detection points, the current angle cannot be accurately determined, requiring rotation to "find" the target position. But since there are two rotation directions (clockwise and counterclockwise), and the fan system cannot predict the optimal path, the positioning process is time-consuming. Furthermore, if the fan is obstructed by external forces during operation, existing oscillation angle detection methods are prone to errors because they cannot detect position changes in real time. These problems collectively result in low efficiency and accuracy in oscillation angle detection. Summary of the Invention

[0003] This invention provides a method, device, oscillating fan, and medium for detecting oscillation angle, aiming to solve the problem that the efficiency and accuracy of existing fan oscillation angle detection are both low.

[0004] In a first aspect, embodiments of the present invention provide a method for detecting the oscillation angle of an oscillating fan, the oscillating fan including a fan body and a detection module mounted on the fan body, the method comprising: If a oscillation start command is received, oscillation information is obtained, and the fan body is driven to rotate according to the oscillation information; The system receives rotation data collected by the detection module and determines the angle information of the fan body based on the rotation data and the oscillation information.

[0005] Secondly, embodiments of the present invention also provide an oscillation angle detection device for use in an oscillating fan, the oscillating fan including a fan body and a detection module mounted on the fan body, the device including: The drive unit is configured to acquire oscillation information and drive the fan body to rotate according to the oscillation information if an oscillation start command is received. The receiving and determining unit is used to receive the rotation data collected by the detection module and determine the angle information of the fan body based on the rotation data and the oscillation information.

[0006] Thirdly, embodiments of the present invention also provide an oscillating fan including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0007] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0008] This invention provides a method, device, oscillating fan, and medium for detecting oscillation angle. The method includes: if an oscillation start command is received, acquiring oscillation information and driving the fan body to rotate based on the oscillation information; receiving rotation data collected by the detection module and determining the angle information of the fan body based on the rotation data and the oscillation information. The technical solution of this invention effectively overcomes the delay and error of traditional fixed-point detection methods by directly calculating angle information by real-time acquisition of the oscillating fan's rotation data and combining it with oscillation information, thus improving the efficiency and accuracy of angle detection. Attached Figure Description

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

[0010] Figure 1 This is a flowchart illustrating a head-shaking angle detection method according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the installation position of the detection module according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a sub-process of a head-shaking angle detection method provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the left and right head-shaking angles provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the up-and-down head-shaking angle provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of another sub-process of a head-shaking angle detection method provided in an embodiment of the present invention; Figure 7 A schematic diagram of the left-right head shaking angle and the up-down head shaking angle provided for another embodiment of the present invention; Figure 8 A schematic flowchart of a head-shaking angle detection method provided in another embodiment of the present invention; Figure 9 A schematic block diagram of a head-shaking angle detection device provided in an embodiment of the present invention; Figure 10 This is a schematic block diagram of an oscillating fan provided for an embodiment of the present invention. Detailed Implementation

[0011] 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, not all, of the embodiments of the present invention. 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.

[0012] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0013] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0014] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0015] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0016] Please see Figure 1 , Figure 1 This is a flowchart illustrating a head-shaking angle detection method according to an embodiment of the present invention. The head-shaking angle detection method will be described in detail below. Figure 1 As shown, the method includes the following steps S110-S120.

[0017] S110. If a oscillation start command is received, oscillation information is obtained, and the fan body is driven to rotate according to the oscillation information.

[0018] In this embodiment of the invention, the oscillation angle detection method is applied to an oscillating fan, which includes a fan body and a detection module mounted on the fan body. It should be noted that, in this embodiment, the detection module is an accelerometer, and the detection module is specifically installed at the center of the fan shroud within the fan body. Figure 2 As shown, the detection module is installed at position E. Understandably, in other embodiments, the detection module can also be installed at other positions, as long as it can rotate with the fan's up-and-down and left-and-right oscillations and collect rotation data when the fan body rotates. It should also be noted that in this embodiment, the oscillating fan further includes a main control module and a motor drive module. The main control module controls the normal operation of the oscillating fan, additionally processes serial port data information, and calculates the angle information of the oscillating fan. The motor drive module includes a main motor drive module and a synchronous motor drive module. The main motor drive module drives the main motor when the user turns on the oscillating fan, and the corresponding operating speed depends on the user's selected setting. The synchronous motor drive module drives the stepper motor when the user turns on the oscillating fan. If the user activates left-and-right oscillation, it drives the stepper motor corresponding to left-and-right oscillation; if the user activates up-and-down oscillation, it drives the stepper motor corresponding to up-and-down oscillation.

[0019] Furthermore, after the oscillating fan is powered on and the accelerometer sensor is initialized, if an oscillation start command is received, the oscillation information is acquired, including parameters such as the oscillation angle range, oscillation mode, and oscillation speed, and the fan body is driven to rotate according to the oscillation information.

[0020] S120. Receive the rotation data collected by the detection module, and determine the angle information of the fan body based on the rotation data and the oscillation information.

[0021] In this embodiment of the invention, the rotation data includes acceleration data, which includes X-axis acceleration components and Y-axis acceleration components; the angle information includes up-and-down oscillation angles and left-and-right oscillation angles. It should be noted that in this embodiment, the acceleration data also includes a Z-axis acceleration component; the main control module continuously receives real-time rotation data collected by an acceleration sensor installed at the center of the fan shroud via serial communication or other means. The rotation data includes acceleration data, which contains acceleration components (gx, gy, gz) along the X, Y, and Z axes in the sensor coordinate system. It should also be noted that in this embodiment, the sensor coordinate system is established with the center of the fan shroud as the origin, the Z-axis perpendicular to the ground (i.e., the Z-axis points to the sky), the Y-axis representing the front-and-back position of the fan, and the X-axis representing the left-and-right position of the fan.

[0022] In this embodiment, such as Figure 3 As shown, step S120 specifically includes steps S121a-S123a: S121a. If the oscillation mode is left and right oscillation, then calculate the first left and right oscillation angle of the fan body based on the X-axis acceleration component. S122a. If the oscillation mode is up and down oscillation, then calculate the first up and down oscillation angle of the fan body based on the Y-axis acceleration component. S123a. Calculate the average angle of the first left-right oscillation angle / the first up-down oscillation angle within a preset number of sampling periods before the current sampling period, and determine whether the first left-right oscillation angle / the first up-down oscillation angle of the fan body in the current sampling period is the left-right oscillation angle / the up-down oscillation angle based on the average angle.

[0023] In this embodiment of the invention, the accelerometer detects the tilt angle of an object by measuring the changes in the components of gravitational acceleration in three-dimensional space. When the sensor is stationary, the acceleration components along its three axes (X, Y, Z) satisfy the vector relationship of gravitational acceleration: g 2 = gx 2 + gy 2 + gz 2 Where g is the local gravitational acceleration (approximately 9.8 m / s²). 2 gx, gy, and gz are the acceleration components of gravity along the X, Y, and Z axes, respectively. When the fan oscillates, the accelerometer moves with the fan, and the projections of gravitational acceleration onto each axis change. By analyzing the proportions of these components, the angle information can be calculated.

[0024] Furthermore, when the head-shaking mode is left and right, the analysis is performed from a top-down view perspective. The core of this analysis is simplifying the three-dimensional problem into a two-dimensional geometric relationship: in the horizontal plane (XY plane), the projection of gravitational acceleration satisfies g... 2 =gx 2 + gy 2 At this point, gx and gy correspond to the left and right acceleration components of the fan in the horizontal plane, respectively. For example... Figure 4 As shown, assume the fan rotates from its initial position A to point B, with a rotation angle of ∠AOB. In triangle AOB, line segment AB represents the vector magnitude of gravitational acceleration (i.e., g), and CB and AC correspond to the components of gx and gy, respectively. According to trigonometric relationships: sin∠CAB = CB / AB = gx / g; through the arcsine function, we get: ∠CAB = arcsin(gx / g); understandably, since AO and BO are of equal length (symmetric structure), triangle AOB is an isosceles triangle. Therefore, ∠AOB = 180° - 2 × |∠CAB|, where the sign of ∠AOB is determined by the direction of gx: if gx is positive, it indicates shaking to the right; if gx is negative, it indicates shaking to the left. The calculation principle for the vertical shaking angle is similar to that for the horizontal shaking angle, but it needs to be analyzed in the vertical plane (YZ plane): Projection of gravitational components: In the side view, the projection relationship of gravitational acceleration is g 2 =gy 2 + gz 2 At this point, gy corresponds to the fan's acceleration component in the vertical direction. Similarly, using a triangular geometric model, such as... Figure 5 As shown, we can obtain: sin∠CAB = gy / g, and further derive: ∠CAB = arcsin(gy / g); The up and down shaking angle is: ∠AOB = 180° - 2×|∠CAB|, where the sign of ∠AOB is determined by the direction of gy: when gy is positive, it indicates shaking upwards, and when gy is negative, it indicates shaking downwards.

[0025] Furthermore, in practical applications, the data output by the accelerometer is usually normalized to the gravitational acceleration g (i.e., g=1). Therefore, the formulas for left-right and up-down head shaking can be simplified as follows: Left and right head tilt angle: θ_left / right = arcsin(gx) Up / down head tilt angle: θ_up / down = arcsin(gy) Understandably, this simplification reduces computational load, facilitating real-time data processing by the embedded main control module. The accelerometer sends gx and gy to the main control module via serial port. The main control module selects the corresponding formula based on the current oscillation mode (left / right or up / down) to quickly calculate the angle. Specifically, if the oscillation mode is left / right, the X-axis acceleration component gx is substituted into θ_left / right = arcsin(gx) to calculate the first left / right oscillation angle of the fan body; if the oscillation mode is up / down, the Y-axis acceleration component gy is substituted into θ_up / down = arcsin(gy) to calculate the first up / down oscillation angle of the fan body.

[0026] Furthermore, step S123a includes: calculating the product of the average angle information and a preset floating ratio to obtain a floating angle; determining an angle range based on the average angle and the floating angle; if the first left-right oscillation angle / first up-down oscillation angle of the fan body in the current sampling period is within the angle range, then the first left-right oscillation angle / first up-down oscillation angle is used as the left-right oscillation angle / the up-down oscillation angle. It should be noted that in this embodiment, an average angle is obtained by calculating the arithmetic mean of the first left-right oscillation angle or the first up-down oscillation angle corresponding to a preset number (e.g., N) sampling periods prior to the current sampling period. This average angle serves as a trend benchmark for angle changes, effectively solving the problem of inaccurate detection angle information caused by fan shaking or temporary disabling of fan oscillation.

[0027] It should also be noted that in this embodiment, after obtaining the average angle, the average angle is multiplied by a pre-set floating ratio (e.g., 5% or 10%), and the result is a floating angle. This floating ratio defines the allowable angle deviation range, and the product (i.e., the floating angle) quantifies the acceptable reasonable deviation based on the current average angle. Then, a dynamic angle determination interval is constructed with the calculated average angle as the center and the floating angle as the radius. The upper limit of this interval is generally the average angle plus the floating angle, and the lower limit is the average angle minus the floating angle. This interval is essentially a slowly moving "window" over time, and its position is adaptively adjusted according to changes in the average angle. Finally, the validity of the angle is determined by comparing the first left-right yaw angle (or the first up-down yaw angle) collected and calculated in real time during the current sampling period with this dynamic angle interval. Only when the real-time angle value falls within the above interval is the collected angle data considered stable and reliable, and it is ultimately confirmed as the currently valid left-right yaw angle (or up-down yaw angle) for subsequent control. If the real-time angle falls outside the range, it may be considered abnormal data due to momentary disturbance. It will be discarded, and the angle value of the previous valid cycle will be used to ensure the continuity of angle output and the stability of control.

[0028] In one embodiment, such as this embodiment, the rotation data includes offset data, which includes X-axis offset, Y-axis offset, and Z-axis offset; for example... Figure 6 As shown, step S120 specifically includes steps S121b-S123b: S121b. If the oscillation mode is left and right oscillation, then calculate the second left and right oscillation angle of the fan body based on the X-axis offset and the Y-axis offset. S122b. If the oscillation mode is up and down oscillation, then calculate the second up and down oscillation angle of the fan body based on the Y-axis offset and the Z-axis offset. S123b: Calculate the average angle of the second left-right oscillation angle / the second up-down oscillation angle within a preset number of sampling periods before the current sampling period, and determine whether the second left-right oscillation angle / the second up-down oscillation angle of the fan body in the current sampling period is the left-right oscillation angle / the up-down oscillation angle based on the average angle.

[0029] In this embodiment of the invention, if the head-shaking mode is left and right head-shaking, the main control module will synchronously read the acceleration offset (i.e., gx and gy) measured by the accelerometer. Figure 7 As shown, in the horizontal projection plane, the vector direction of the gravitational acceleration is synthesized by the acceleration components of the X and Y axes, and then expressed by the formula... The second left and right yaw angles are calculated. Understandably, A1 is the projection of accelerometer point A onto the XOY plane, θ1 = ∠A1OY. This method, by fusing data from two axes, effectively reduces the potential interference from instantaneous linear acceleration on single-axis data. If the yaw mode is up and down, the main control module synchronously reads the acceleration offsets (gy and gz) of the Y and Z axes. In the vertical projection plane, the acceleration components of the Y and Z axes are synthesized using the formula... ( (Not shown in the diagram) If we assume the projection of accelerometer point A onto the YOZ plane is A2 (θ2 = ∠A2OY), the second vertical oscillation angle is calculated. This method also enhances the anti-interference capability of angle calculation in the vertical plane through dual-axis data fusion. After obtaining the second left-right oscillation angle or the second vertical oscillation angle in the current sampling period, the corresponding angle values ​​calculated in a preset number (e.g., N) consecutive sampling periods prior to the current sampling period are retrieved, and the arithmetic mean of these historical angle values ​​is calculated as the average angle. This average angle reflects the stable movement trend of the fan body over a recent period. After obtaining the average angle, it is also multiplied by a preset floating ratio (e.g., 5% or 10%), and the result is a floating angle. This floating ratio defines the allowable angle deviation range, and its product (i.e., the floating angle) quantifies the acceptable reasonable deviation based on the current average angle. Then, with the calculated average angle as the center and the floating angle as the radius, a dynamic angle determination interval is constructed. The upper limit of this interval is generally the average angle plus the floating angle, and the lower limit is the average angle minus the floating angle. This interval is essentially a slowly shifting "window" whose position adaptively adjusts based on changes in the average angle. Finally, the second left / right yaw angle (or second up / down yaw angle) acquired and calculated in real-time during the current sampling period is compared with this dynamic angle interval. Only when the real-time angle value falls within this interval is the acquired angle data considered stable and reliable, and it is ultimately confirmed as the currently valid left / right yaw angle (or up / down yaw angle) for subsequent control. If the real-time angle falls outside the interval, it may be considered abnormal data due to momentary interference and will be discarded. The angle value from the previous valid period will be used, thus ensuring the continuity of angle output and the stability of control. It should be noted that in this embodiment, When the rotation data includes offset data, it will not include acceleration data; understandably, when the rotation data includes acceleration data, it will not include offset data.

[0030] Please see Figure 8 , Figure 8 This is a flowchart illustrating a head-shaking angle detection method according to another embodiment of the present invention, as shown below. Figure 8As shown, in this embodiment, the method includes steps S110-S130. That is, in this embodiment, the method further includes step S130 after step S120 in the above embodiment.

[0031] S130. Calculate the oscillation direction of the fan body based on the coordinate data and the oscillation information.

[0032] In this embodiment, the rotation data includes the coordinate data of the sampling points; the coordinate data includes X-axis coordinate values ​​and Z-axis coordinate values; step S130 specifically includes: if the oscillation mode is left-right oscillation, then the difference between the X-axis coordinate value of the current sampling point and the X-axis coordinate value of the previous sampling point is calculated to obtain the X-axis coordinate difference value; if the X-axis coordinate difference value is positive, then the oscillation direction of the fan body is from right to left; if the X-axis coordinate difference value is negative, then the oscillation direction of the fan body is from left to right; if the oscillation mode is up-down oscillation, then the difference between the Z-axis coordinate value of the current sampling point and the Z-axis coordinate value of the previous sampling point is calculated to obtain the Z-axis coordinate difference value; if the Z-axis coordinate difference value is positive, then the oscillation direction of the fan body is from top to bottom; if the Z-axis coordinate difference value is negative, then the oscillation direction of the fan body is from bottom to top. Specifically, when the fan is determined to be in left-right oscillation mode, the main control module executes the following logic to determine its horizontal direction: It reads the X-axis coordinate value of the accelerometer at the current sampling point and subtracts it from the X-axis coordinate value recorded in the previous sampling period to obtain the X-axis coordinate difference. This difference directly reflects the change in the relative position of the fan head in the horizontal direction. If the difference is positive, it indicates that the X-axis coordinate value of the fan head has increased compared to the previous moment, corresponding to the fan body rotating horizontally from right to left; conversely, if the difference is negative, it indicates that the X-axis coordinate has decreased, corresponding to the fan body rotating horizontally from left to right. Similarly, when the fan is determined to be in up-down oscillation mode, the direction determination logic is performed in the vertical dimension. It calculates the difference between the Z-axis coordinate value of the current sampling point and the Z-axis coordinate value of the previous sampling point to obtain the Z-axis coordinate difference. If the difference is positive, it indicates that the Z-axis coordinate of the fan body increases, corresponding to the fan body's pitching motion from top to bottom; if the difference is negative, it indicates that the Z-axis coordinate decreases, corresponding to the fan body's tilting motion from bottom to top. Understandably, the above method for determining the oscillation direction only requires simple subtraction and sign judgment, with low computational load and fast response speed, meeting the real-time and accurate detection requirements for fan oscillation direction. It should be noted that in this embodiment, oscillation angle detection empowers many intelligent experiences for the fan: it supports "wind following the person," enabling dynamic wind direction following the person; ensures "automatic reset," completing the efficient reset of the fan head after shutdown; and it is also the foundation for realizing advanced functions such as intelligent wind control, operational fault diagnosis, and user posture recognition, significantly improving the product's intelligence level and user experience. Figure 9 This is a schematic block diagram of a head-shaking angle detection device 200 provided in an embodiment of the present invention. Figure 9As shown, corresponding to the above-described oscillation angle detection method, the present invention also provides an oscillation angle detection device 200. This oscillation angle detection device 200 includes a unit for performing the above-described oscillation angle detection method, and the device can be configured in an oscillating fan. Specifically, please refer to... Figure 9 The head-tilt angle detection device 200 includes an acquisition drive unit 201 and a receiving and determination unit 202. Detailed descriptions of each functional module are as follows: The drive unit 201 is used to acquire oscillation information and drive the fan body to rotate according to the oscillation information if an oscillation start command is received. The receiving and determining unit 202 is used to receive the rotation data collected by the detection module and determine the angle information of the fan body based on the rotation data and the oscillation information.

[0033] In some embodiments, such as this one, the receiving and determining unit 202 is specifically used for: If the oscillation mode is left and right oscillation, then the first left and right oscillation angle of the fan body is calculated based on the X-axis acceleration component; If the oscillation mode is up and down oscillation, then the first up and down oscillation angle of the fan body is calculated based on the Y-axis acceleration component; Calculate the average angle of the first left-right oscillation angle / the first up-down oscillation angle within a preset number of sampling periods before the current sampling period, and determine whether the first left-right oscillation angle / the first up-down oscillation angle of the fan body in the current sampling period is the same as the left-right oscillation angle / the up-down oscillation angle based on the average angle.

[0034] In some embodiments, such as this one, the receiving and determining unit 202 is further configured to: The floating angle is obtained by calculating the product of the average angle information and the preset floating ratio; The angle range is determined based on the average angle and the floating angle; If the first left-right oscillation angle / the first up-down oscillation angle of the fan body is within the angle range in the current sampling period, then the first left-right oscillation angle / the first up-down oscillation angle is taken as the left-right oscillation angle / the up-down oscillation angle.

[0035] In some embodiments, such as this one, the receiving and determining unit 202 is further configured to: If the oscillation mode is left and right oscillation, then the second left and right oscillation angle of the fan body is calculated based on the X-axis offset and the Y-axis offset; If the oscillation mode is up and down oscillation, then the second up and down oscillation angle of the fan body is calculated based on the Y-axis offset and the Z-axis offset; Calculate the average angle of the second left-right oscillation angle / the second up-down oscillation angle within a preset number of sampling periods before the current sampling period, and determine whether the second left-right oscillation angle / the second up-down oscillation angle of the fan body in the current sampling period is the same as the left-right oscillation angle / the up-down oscillation angle based on the average angle.

[0036] In some embodiments, such as this one, the head-shaking angle detection device 200 further includes: The calculation unit is used to calculate the oscillation direction of the fan body based on the coordinate data and the oscillation information.

[0037] In some embodiments, such as this one, the computing unit is specifically used for: If the head-shaking mode is left and right head-shaking, then the difference between the X-axis coordinate value of the current sampling point and the X-axis coordinate value of the previous sampling point is calculated to obtain the X-axis coordinate difference value; If the difference in the X-axis coordinates is positive, then the oscillation direction of the fan body is from right to left; If the difference in the X-axis coordinates is negative, then the oscillation direction of the fan body is from left to right; If the head-shaking mode is up and down head-shaking, then the difference between the Z-axis coordinate value of the current sampling point and the Z-axis coordinate value of the previous sampling point is calculated to obtain the Z-axis coordinate difference value; If the Z-axis coordinate difference is positive, then the oscillation direction of the fan body is from top to bottom; If the Z-axis coordinate difference is negative, then the oscillation direction of the fan body is from bottom to top.

[0038] The aforementioned head-tilt angle detection device can be implemented as a computer program, which can, for example... Figure 10 The oscillating fan shown is running.

[0039] Please see Figure 10 , Figure 10 This is a schematic block diagram of an oscillating fan provided in an embodiment of the present invention. The oscillating fan 300 is a device capable of detecting the oscillation angle.

[0040] See Figure 10 The oscillating fan 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a non-volatile storage medium 303 and internal memory 304.

[0041] The non-volatile storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it causes the processor 302 to execute a head-tilt angle detection method.

[0042] The processor 302 provides computing and control capabilities to support the operation of the entire oscillating fan 300.

[0043] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a head-tilt angle detection method.

[0044] This network interface 305 is used for network communication with other devices. Those skilled in the art will understand that... Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the oscillating fan 300 to which the present invention is applied. The specific oscillating fan 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0045] The processor 302 is used to run a computer program 3032 stored in a memory to implement any embodiment of the above-described head tilt angle detection method.

[0046] It should be understood that, in this embodiment of the invention, the processor 302 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0047] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by a processor in the computer system to implement the process steps of the embodiments of the above methods.

[0048] Therefore, the present invention also provides a storage medium. This storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform any embodiment of the above-described head-tilt angle detection method.

[0049] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0050] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0051] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0052] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0053] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an oscillating fan to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0054] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0055] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.

[0056] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A head swinging angle detecting method applied to a head swinging fan, characterized by, The head-shaking fan comprises a fan body and a detection module mounted on the fan body, and the method comprises: If a head-shaking start instruction is received, head-shaking information is acquired, and the fan body is driven to rotate according to the head-shaking information; Rotation data collected by the detection module is received, and angle information of the fan body is determined according to the rotation data and the head-shaking information.

2. The method of claim 1, wherein, The rotation data comprises acceleration data, the acceleration data comprises an X-axis acceleration component and a Y-axis acceleration component, the angle information comprises up-down head-shaking angle and left-right head-shaking angle, the head-shaking information comprises a head-shaking mode, and the step of determining the angle information of the fan body according to the rotation data and the head-shaking information comprises: If the head-shaking mode is left-right head-shaking, a first left-right head-shaking angle of the fan body is calculated according to the X-axis acceleration component; If the head-shaking mode is up-down head-shaking, a first up-down head-shaking angle of the fan body is calculated according to the Y-axis acceleration component; An average angle of the first left-right head-shaking angle / the first up-down head-shaking angle corresponding to a preset number of sampling periods before a current sampling period is calculated, and whether the first left-right head-shaking angle / the first up-down head-shaking angle of the fan body in the current sampling period is the left-right head-shaking angle / the up-down head-shaking angle is determined according to the average angle.

3. The method of claim 2, wherein, The step of determining whether the first left-right head-shaking angle / the first up-down head-shaking angle of the fan body in the current sampling period is the left-right head-shaking angle / the up-down head-shaking angle according to the average angle comprises: A floating angle is obtained by multiplying the average angle information and a preset floating ratio; An angle interval is determined according to the average angle and the floating angle; If the first left-right head-shaking angle / the first up-down head-shaking angle of the fan body in the current sampling period is in the angle interval, the first left-right head-shaking angle / the first up-down head-shaking angle is taken as the left-right head-shaking angle / the up-down head-shaking angle.

4. The method of claim 2, wherein, The rotation data comprises offset data, the offset data comprises an X-axis offset, a Y-axis offset and a Z-axis offset, and the step of determining the angle information of the fan body according to the rotation data and the head-shaking information comprises: If the head-shaking mode is left-right head-shaking, a second left-right head-shaking angle of the fan body is calculated according to the X-axis offset and the Y-axis offset; If the head-shaking mode is up-down head-shaking, a second up-down head-shaking angle of the fan body is calculated according to the Y-axis offset and the Z-axis offset; An average angle of the second left-right head-shaking angle / the second up-down head-shaking angle corresponding to a preset number of sampling periods before a current sampling period is calculated, and whether the second left-right head-shaking angle / the second up-down head-shaking angle of the fan body in the current sampling period is the left-right head-shaking angle / the up-down head-shaking angle is determined according to the average angle.

5. The method according to any one of claims 1 to 4, characterized in that, The rotation data comprises coordinate data of a sampling point, and the method comprises: A head-shaking direction of the fan body is calculated according to the coordinate data and the head-shaking information.

6. The method of claim 5, wherein, The coordinate data comprises an X-axis coordinate value and a Z-axis coordinate value; the step of calculating the head-tilting direction of the fan body according to the coordinate data and the head-tilting information comprises: if the head-tilting mode is left-right head-tilting, calculating the difference between the X-axis coordinate value of the current sampling point and the X-axis coordinate value of the last sampling point to obtain an X-axis coordinate difference value; if the X-axis coordinate difference value is positive, the head-tilting direction of the fan body is from right to left; if the X-axis coordinate difference value is negative, the head-tilting direction of the fan body is from left to right.

7. The method of claim 6, wherein, The step of calculating the head-tilting direction of the fan body according to the coordinate data and the head-tilting information comprises: if the head-tilting mode is up-down head-tilting, calculating the difference between the Z-axis coordinate value of the current sampling point and the Z-axis coordinate value of the last sampling point to obtain a Z-axis coordinate difference value; if the Z-axis coordinate difference value is positive, the head-tilting direction of the fan body is from up to down; if the Z-axis coordinate difference value is negative, the head-tilting direction of the fan body is from down to up.

8. A device for detecting the oscillation angle of an oscillating fan, characterized in that, The head-tilting fan comprises a fan body and a detection module installed on the fan body, and the device comprises: an acquisition driving unit, configured to acquire head-tilting information if a head-tilting starting instruction is received, and drive the fan body to rotate according to the head-tilting information; a receiving and determining unit, configured to receive rotation data collected by the detection module, and determine angle information of the fan body according to the rotation data and the head-tilting information.

9. A fan oscillating, characterized by, The head-tilting fan comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program can implement the method in any one of claims 1-7 when executed by a processor.