Water line cleaning method based on accelerometer, robot, equipment and medium
By using an accelerometer and judging conditions on the swimming pool robot, we can determine whether it exceeds the water level line, which solves the problems of incomplete cleaning and air entry in the prior art, and achieves efficient cleaning of the robot near the water level line.
Patent Information
- Application Number
- CN202411345961.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-31
AI Technical Summary
When cleaning the water level near the existing swimming pool robots are prone to be too far away from the water level line or exceeding the water level line for a long time, resulting in incomplete cleaning or air entering the robot inside and unable to continue underwater operations.
By installing an accelerometer on the robot, real-time acceleration components and motion data are obtained, and a variety of judgment conditions are used to determine whether it exceeds the water level line, including calculating derivatives, building an acceleration array and comparing acceleration fluctuations, ensuring that the robot is effectively cleaned near the water level line.
It realizes effective cleaning of the robot near the water level line, avoids floating problems caused by air entry, and ensures the integrity and intelligence of the cleaning work.
Smart Images

Figure CN119225368A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of robots, and in particular to an accelerometer-based water level cleaning method, robot, equipment and medium. Background Art
[0002] A pool robot is a device used to clean a pool, such as cleaning the bottom and walls of a pool. Since the pool robot needs to work underwater, it cannot be exposed to the air for a long time, otherwise air will enter the robot and cause the robot to float on the water. The water level of the pool is the boundary between the water surface and the air. When a conventional robot cleans the area near the water level, it often moves too far away from the water level, resulting in incomplete cleaning, or stays above the water level for a long time, causing air to enter the robot. Summary of the invention
[0003] In view of this, the purpose of the present invention is to overcome the shortcomings of the prior art and to provide a water level line cleaning method, robot, equipment and medium based on an accelerometer. The method obtains the real-time acceleration component of the robot and judges the real-time acceleration component through multiple judgment conditions, so as to quickly determine whether the robot has crossed the water level line.
[0004] The present invention provides the following technical solutions:
[0005] In a first aspect, the present application provides a water level cleaning method based on an accelerometer, comprising:
[0006] Acquire motion data of the robot when cleaning the swimming pool, and calculate the acceleration component and real-time speed in front of the robot according to the motion data; the acceleration component is acquired by an accelerometer;
[0007] Determine whether the real-time speed is greater than a preset speed threshold, and if the real-time speed is greater than or equal to the preset speed threshold, obtain an acceleration component set of the robot; the acceleration component set includes multiple real-time acceleration components;
[0008] Calculating derivatives of the multiple real-time acceleration components to obtain a derivative set, and determining whether the derivative set meets a first water outlet condition;
[0009] If the first water outlet condition is not met, obtaining a preset number of real-time acceleration components from the acceleration component set, and constructing an array using the preset number of real-time acceleration components;
[0010] It is determined whether the array satisfies a second water outlet condition; if the second water outlet condition is not satisfied, it is determined that the robot has not exceeded the water level, and the robot is controlled to continue cleaning the swimming pool according to the motion data.
[0011] In one implementation, the determining whether the derivative set satisfies the first water outlet condition includes:
[0012] Obtaining a maximum value and a minimum value in the derivative set, and calculating an acceleration fluctuation value of the robot according to the maximum value and the minimum value;
[0013] Determine whether the acceleration fluctuation value is greater than or equal to the acceleration out of water instantaneous detection fluctuation value; the acceleration out of water instantaneous detection fluctuation value is the fluctuation value generated at the moment when the robot leaves the water level line;
[0014] If the acceleration fluctuation value is greater than or equal to the acceleration water-outlet instantaneous detection fluctuation value, it is determined that the derivation result satisfies the first water-outlet condition.
[0015] In one implementation, acquiring a preset number of the real-time acceleration components from the acceleration component set and constructing an array using the preset number of the real-time acceleration components includes:
[0016] sorting the acceleration components in the acceleration component set from large to small to obtain a new data set;
[0017] Determine the installation direction of the accelerometer of the robot, if the installation direction of the accelerometer is upward, obtain the preset number of first target data at the end of the new data from the new data set, and construct a first array using the first target data;
[0018] If the accelerometer of the robot is installed downward, the preset number of second target data are obtained from the new data set at the front end of the new data, and the second array is constructed using the second target data.
[0019] In one implementation, the determining whether the array satisfies the second water outlet condition includes:
[0020] If the accelerometer is installed upward, each of the first target data in the first array is compared with the water level line reverse acceleration prediction value;
[0021] If all of the first target data are smaller than the water level line reverse acceleration prediction value, it is determined that the first array meets the second water outlet condition.
[0022] In one implementation manner, the determining whether the array satisfies the second water outlet condition further includes:
[0023] If the accelerometer is installed downward, each of the second target data in the second array is compared with the water level line reverse acceleration prediction value;
[0024] If all of the second target data are greater than the water level line reverse acceleration prediction value, it is determined that the second array meets the second water outlet condition.
[0025] In one embodiment, the obtaining of the robot's motion data includes:
[0026] Continuously acquiring multiple pitch angles of the robot, and determining whether each pitch angle is greater than or equal to a preset angle;
[0027] If each of the pitch angles is greater than or equal to the preset angle, determine whether the absolute value of the difference between each two consecutively collected pitch angles is less than the robot's wall climbing angle fluctuation value;
[0028] If both are smaller than the fluctuation value of the robot's wall-climbing angle, it is determined that the robot is located in the swimming pool wall area, and the motion data of the robot located in the swimming pool wall area is obtained.
[0029] In one embodiment, the obtaining of the motion data of the robot and calculating the acceleration component in front of the robot according to the motion data includes:
[0030] If the robot is located in the swimming pool wall area, obtaining the real-time measurement data of the robot's accelerometer and the pitch angle;
[0031] The acceleration component in front of the robot is calculated according to the real-time measurement data of the accelerometer and the pitch angle.
[0032] In one embodiment, the method further comprises:
[0033] If it is determined that the robot is located in the swimming pool wall area, the robot is controlled to run according to the preset speed threshold, and the PWM unit cycle change value of the PID motion model of the robot is controlled to be smaller than the preset change threshold.
[0034] In one implementation, obtaining the acceleration component set of the robot includes:
[0035] Determine the swimming pool material of the swimming pool; the swimming pool material includes a tile swimming pool, a cement swimming pool and a bracket swimming pool;
[0036] Acquire motion sampling data of the robot on different swimming pool walls, where the number of motion sampling data is a target number;
[0037] Determine whether the target number of motion sampling data meets the first water outlet condition and the second water outlet condition;
[0038] If not, increasing the number of the motion sampling data until the number of the motion sampling data meets the judgment requirements of the first water outlet condition and the second water outlet condition;
[0039] The final quantity of the motion data when the judgment requirement is met is recorded, and the construction condition of the acceleration component set is determined according to the final quantity.
[0040] In a second aspect, the present application provides a robot, comprising:
[0041] An acquisition module, used to acquire motion data of the robot when cleaning a swimming pool, and calculate the acceleration component and real-time speed in front of the robot according to the motion data; the acceleration component is acquired by an accelerometer;
[0042] A judging module, used for judging whether the real-time speed is greater than a preset speed threshold, and if the real-time speed is greater than or equal to the preset speed threshold, obtaining an acceleration component set of the robot; the acceleration component set includes a plurality of real-time acceleration components;
[0043] A calculation module, used for calculating the derivatives of the multiple real-time acceleration components to obtain a derivative set, and determining whether the derivative set meets the first water outlet condition;
[0044] A construction module, configured to obtain a preset number of real-time acceleration components from the acceleration component set if the first water outlet condition is not met, and construct an array using the preset number of real-time acceleration components;
[0045] The control module is used to determine whether the array meets the second water outlet condition. If the second water outlet condition is not met, it is determined that the robot has not exceeded the water level line, and the robot is controlled to continue cleaning the swimming pool according to the motion data.
[0046] In a third aspect, the present application provides an electronic device, comprising a memory and at least one processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the accelerometer-based water level line cleaning method as described in the first aspect.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the accelerometer-based water level line cleaning method as described in the first aspect is implemented.
[0048] The embodiments of the present invention have the following beneficial effects:
[0049] The accelerometer-based water level cleaning method provided by the present invention determines whether the robot exceeds the water level through multiple water output judgment conditions. If it does not exceed the water level, the robot is controlled to continue cleaning, ensuring that the swimming pool area close to the water level can also be effectively cleaned, thereby making the robot's cleaning work more intelligent.
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A schematic flow chart of a water level cleaning method based on an accelerometer provided in an embodiment of the present application;
[0053] Figure 2 A cross-sectional view of a robot working environment provided in an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a flow chart of a method for acquiring motion data provided in an embodiment of the present application;
[0055] Figure 4 A schematic diagram of a flow chart of a method for calculating acceleration components provided in an embodiment of the present application;
[0056] Figure 5 A schematic flow chart of a first water outlet condition determination method provided in an embodiment of the present application;
[0057] Figure 6 A schematic flow chart of a second water outlet condition determination method provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of the structure of a robot frame provided in an embodiment of the present application.
[0059] Description of main component symbols:
[0060] 700, robot; 701, acquisition module; 702, judgment module; 703, calculation module; 704, construction module; 705, control module. DETAILED DESCRIPTION
[0061] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0062] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0064] Example 1
[0065] See also Figure 1 , Figure 1 The water level cleaning method based on the accelerometer provided in this embodiment can be applied to various types of swimming pool robots and control the cleaning work of the swimming pool robot according to the water level. The method includes:
[0066] S101. Obtain motion data of the robot when cleaning a swimming pool, and calculate an acceleration component and a real-time speed in front of the robot according to the motion data, wherein the acceleration component is obtained by an accelerometer.
[0067] See also Figure 2 , Figure 2 A cross-sectional view of the robot's working environment.
[0068] Pool robots usually perform cleaning work below the water level and are mainly used to clean the bottom and walls of the pool. Therefore, when the pool robot is working at the bottom of the pool, the water level is higher than the top of the robot. Therefore, when the robot is cleaning at the bottom of the pool, there is usually no need to consider the problem of the robot exceeding the water level.
[0069] However, when the robot is cleaning the wall of the swimming pool, it needs to climb the wall while cleaning, which may cause the robot to climb to the area above the water level. If the robot is cleaning in the area above the water level for a long time, air may be mixed into the robot and it may float on the water surface, making it unable to continue the underwater cleaning work. However, the area near the water level is also the normal operating area of the robot. Therefore, it is particularly important to quickly determine the water level. If ultrasonic or other water level detection devices are installed on the outside of the robot, the cost of the robot will increase, and the production process requirements will also be relatively high.
[0070] See also Figure 3 , step S101 includes:
[0071] S1011. Continuously obtain multiple pitch angles of the robot, and determine whether each pitch angle is greater than or equal to a preset angle.
[0072] An accelerometer, such as an IMU accelerometer, may be provided inside the robot. Through corresponding settings, for example, the IMU accelerometer is provided in parallel with the robot base, the pitch angle measured by the IMU accelerometer is made the same as the actual pitch angle of the robot.
[0073] In order to avoid obstacles with large angles at the bottom of the swimming pool, which may cause misjudgment when the robot is at the bottom of the swimming pool due to a large pitch angle obtained at a single time, multiple pitch angles can be collected continuously to avoid such misjudgment.
[0074] S1012: If each of the pitch angles is greater than or equal to the preset angle, determine whether the absolute value of the difference between each two consecutively collected pitch angles is less than the robot's wall climbing angle fluctuation value.
[0075] There may be slopes at the bottom of the swimming pool. Therefore, if the pitch angle is used alone to determine whether the robot has climbed to the pool wall, misjudgment may occur if the preset angle is too small. The pool bottom and the pool wall are usually perpendicular to each other. Therefore, when the robot climbs from the bottom of the pool to the pool wall, its angle fluctuation value is usually the largest. Therefore, the absolute value of the difference between every two consecutively collected pitch angles can be compared with the angle fluctuation value of the robot climbing the wall.
[0076] For example: the pitch angle is collected once every second, and ten pitch angles are collected in ten seconds. At this time, the absolute value of the difference between the pitch angles collected in the first second and the second second is calculated, and the absolute value is compared with the angle fluctuation value of the robot climbing the wall. If the absolute value is less than the angle fluctuation value of the robot climbing the wall, the absolute value of the difference between the pitch angles collected in the second second and the third second is calculated, and so on.
[0077] S1013: If both are smaller than the robot's wall-climbing angle fluctuation value, it is determined that the robot is located in the swimming pool wall area, and the motion data of the robot located in the swimming pool wall area is obtained.
[0078] If the absolute value of the difference between the pitch angles collected continuously for every two times is smaller than the fluctuation value of the robot's angle on the wall, it can be determined that the robot is located in the swimming pool wall area, otherwise, it can be determined that the robot is located at the bottom of the swimming pool.
[0079] See also Figure 4 , step S101 further includes:
[0080] S1014: If the robot is located in the swimming pool wall area, obtain real-time measurement data of the robot's accelerometer and the pitch angle.
[0081] When the robot reaches the wall of the swimming pool, it starts to obtain the robot's motion data, and then performs subsequent water level detection based on the motion data, thereby saving the robot's power and computing resources. The motion data includes the robot's motion direction, pitch angle, acceleration and other data.
[0082] S1015. Calculate the acceleration component in front of the robot according to the real-time measurement data of the accelerometer and the pitch angle.
[0083] After determining that the robot has climbed to the swimming pool wall area, the acceleration component in front of the robot is calculated. The calculation formula of the acceleration component is: compAccX=accX-g×sin(pitch).
[0084] Among them, accX is the real-time measurement data read by the IMU accelerometer directly in front of the machine, g is the acceleration of gravity, and pitch is the pitch angle of the IMU accelerometer.
[0085] After confirming that the robot has climbed from the bottom of the pool to the pool wall, the water level line detection begins to avoid untimely water level line detection, which may cause the robot to take in air or the area near the water level line to not be cleaned.
[0086] S102, determining whether the real-time speed is greater than a preset speed threshold, and if the real-time speed is greater than or equal to the preset speed threshold, obtaining an acceleration component set of the robot; the acceleration component set includes a plurality of real-time acceleration components.
[0087] Among them, the real-time speed of the robot can be calculated through the data of the robot's machine code disk, and it is determined whether the real-time speed is greater than the preset speed threshold. When the real-time speed is greater than or equal to the preset speed threshold, the acceleration component of the robot at each moment is obtained, and the obtained acceleration components are used to construct an acceleration component set.
[0088] In order to avoid acceleration interference caused by the movement of the robot itself, when the real-time speed of the robot reaches the preset speed threshold, the robot is controlled to move according to the preset speed threshold, and the PWM unit cycle change value of the PID motion model of the robot is controlled to be less than the preset change threshold, so that the acceleration of the robot itself will not affect the judgment of the water level detection. Among them, the PID motion model is an automatic control algorithm model that combines three control links: proportional, integral and differential. The PWM unit cycle change value is the frequency of PWM, which is the number of times the signal changes from high level to low level and then back to high level in one second. In this embodiment, it refers to the speed change rate of the robot itself.
[0089] For example, when the real-time speed of the robot at 1 minute is equal to the preset speed threshold, the acceleration components of the robot are collected at preset time intervals starting from 1 minute, such as once every 5 seconds. The acceleration components collected from 1 minute to 2 minutes are used to construct an acceleration component set, which is defined as compAccX[N].
[0090] After the acceleration component set is constructed, the real-time acceleration component is continuously acquired in time sequence, and the acceleration component set is slidingly updated using the real-time acceleration component.
[0091] For example: after 2 minutes, continue to collect the acceleration component of the robot every 5 seconds, and then use the collected acceleration component to slide and update the data in the acceleration component set, so as to ensure that the data in the acceleration component set is real-time data, making the subsequent water level line detection more efficient and accurate.
[0092] In one embodiment, before obtaining the acceleration component set of the robot, the method includes:
[0093] Acquire motion sampling data of the robot on different swimming pool walls, where the number of motion sampling data is a target number;
[0094] Determine whether the target number of motion sampling data meets the first water outlet condition and the second water outlet condition;
[0095] If not, increasing the number of the motion sampling data until the number of the motion sampling data meets the judgment requirements of the first water outlet condition and the second water outlet condition;
[0096] The final quantity of the motion data when the judgment requirement is met is recorded, and the construction condition of the acceleration component set is determined according to the final quantity.
[0097] Since the acceleration components of swimming pools made of different materials, such as tile swimming pools, cement swimming pools, and bracket swimming pools, may be different, we can first obtain the acceleration component sampling set when the robot is cleaning in swimming pools of different materials. Then, based on the acceleration component sampling set, we determine a sampling standard that meets all swimming pool materials, so that the acceleration component set sampled according to the sampling standard can fully extract the complete features of the robot leaving the water surface in various scenarios, thereby improving the water level detection accuracy of the robot.
[0098] Among them, the sampling standard can be to determine the number of acceleration components. When the number of motion sampling data is small, it may be impossible to judge whether the robot is out of water based on the first water-out condition and the second water-out condition according to the motion sampling data. Therefore, repeated tests can be performed to determine the final number of motion sampling data that can meet the water-out condition judgment requirements. According to the final number, the minimum number of acceleration components that need to be collected when constructing the acceleration component set later can be determined. Alternatively, the number of acceleration components that need to be collected can be determined separately according to the different materials of the swimming pool, so as to avoid inaccurate water-out judgment due to too little sampling, or waste of time due to too much sampling, which affects the real-time judgment of the robot's water-out.
[0099] S103, calculating the derivatives of the multiple real-time acceleration components to obtain a derivative set, and determining whether the derivative set meets a first water outlet condition.
[0100] See also Figure 5 , step S103 includes:
[0101] S1031. Obtain the maximum value and the minimum value in the derivative set, and calculate the acceleration fluctuation value of the robot according to the maximum value and the minimum value.
[0102] Perform the first-order derivative of the acceleration component set compAccX[N] to obtain the derivative result of the acceleration component set compAccX[N], obtain the maximum and minimum values in the derivative result of the acceleration component set compAccX[N], and then calculate the acceleration fluctuation value based on the maximum and minimum values. The calculation formula of the fluctuation value is: fluctuation value = previous maximum value - next minimum value, (or, fluctuation value = previous minimum value - next maximum value).
[0103] S1032. Determine whether the acceleration fluctuation value is greater than or equal to the acceleration fluctuation value detected at the moment of exiting the water; the acceleration fluctuation value detected at the moment of exiting the water is the fluctuation value generated at the moment when the robot leaves the water level line.
[0104] Among them, the robot can be used to conduct multiple tests in advance to test and save the instantaneous fluctuation value when the robot leaves the water level line.
[0105] S1033: If the acceleration fluctuation value is greater than or equal to the acceleration water-outlet instantaneous detection fluctuation value, it is determined that the derivative set meets the first water-outlet condition.
[0106] When the robot is in the actual cleaning process, if the calculated acceleration fluctuation value is less than the acceleration fluctuation value detected at the moment of water outlet, it can be determined that the robot has not left the water level line. At this time, the robot can be controlled to continue cleaning according to the current motion data.
[0107] If the calculated acceleration fluctuation value is greater than or equal to the acceleration fluctuation value detected at the moment of exiting the water, it can be determined that the robot has left the water level line. At this time, the corresponding control method can be adopted to control the movement of the robot.
[0108] For example: since air will enter the robot when the robot works above the water level for a long time, you can set the maximum time the robot can work above the water level. When it is determined that the robot has left the water level, start timing. When the maximum time is about to be reached, control the robot to move away from the water level so that the robot enters the water.
[0109] If the robot works above the water level for more than 3 minutes, there is a risk of air entering the robot. When the robot is detected to exceed the water level, the timing starts. When the robot works in the area above the water level for about 2 minutes and 40 seconds, the robot is controlled to return along the original route, or, according to the robot's movement direction and the water level, the robot is controlled to move in another direction, thereby preventing the robot from being above the water level for a long time.
[0110] S104: If the first water outlet condition is not met, a preset number of real-time acceleration components are obtained from the acceleration component set, and an array is constructed using the preset number of real-time acceleration components.
[0111] In order to avoid errors that may occur in a single water level judgment method, when it is determined that the robot does not meet the first water outlet condition, other judgment methods can also be used to determine whether the robot exceeds the water level.
[0112] First, the acceleration components in the acceleration component set are sorted in descending order to obtain a new data set, and then the last multiple data after sorting are selected from the new data set to construct an array, which is defined as compAccXMin[j], where j is a preset number.
[0113] When the machine reaches the water level, the water waves will push it downward, thus generating a downward acceleration. Therefore, the selection of the real-time acceleration component for constructing the array is related to the installation direction of the robot's IMU accelerometer. Before constructing the array, it is necessary to determine the installation direction of the robot's accelerometer. If the installation direction of the accelerometer is upward, the preset number of first target data is obtained from the new data set, and the first array is constructed using the first target data, which is defined as compAccXMin[j1].
[0114] If the accelerometer of the robot is installed downward, the preset number of second target data are obtained from the new data set, and a second array is constructed using the second target data, which is defined as compAccXMin[j2].
[0115] The first target data is the end data of the new data set, the second target data is the front data of the new data set, and the quantity of the first target data and the second target data can be set according to actual conditions.
[0116] S105, determining whether the array satisfies a second water outlet condition; if the array does not satisfy the second water outlet condition, determining that the robot has not exceeded the water level, and controlling the robot to continue cleaning the swimming pool according to the motion data.
[0117] See also Figure 6 According to the different installation directions of the accelerometer, step S105 includes:
[0118] S1051: if the accelerometer is installed upward, then each of the first target data in the first array is compared with the water level line reverse acceleration prediction value;
[0119] S1052: If all of the first target data are smaller than the water level line reverse acceleration prediction value, it is determined that the first array meets the second water outlet condition.
[0120] Among them, the water level line reverse thrust acceleration prediction value is generated by the reverse thrust force received by the robot when it reaches the water level line. The water level line reverse thrust acceleration prediction value can also be obtained by using the robot for advance testing.
[0121] Step S105 also includes:
[0122] S1053: if the accelerometer is installed downward, then each of the second target data in the second array is compared with the water level line reverse acceleration prediction value;
[0123] S1054: If all of the second target data are greater than the water level line reverse acceleration prediction value, it is determined that the second array meets the second water outlet condition.
[0124] When it is determined that all the first target data in the first array, or all the second target data in the second array are smaller than the water level line reverse acceleration prediction value, that is, compAccXMin[j1]<water level line reverse acceleration prediction value, or compAccXMin[j2]>water level line reverse acceleration prediction value, then it is determined that the robot has reached the water level, and the robot can be controlled to return along the original route within a preset time, or, according to the movement direction of the robot and the water level, the robot can be controlled to move in another direction, thereby avoiding the robot being above the water level for a long time and improving the cleaning efficiency of the robot.
[0125] When the robot accelerometer is installed in a downward direction, if a first target data is greater than or equal to the water level line reverse acceleration prediction value in the first array, it is determined that the robot has not reached the water level. When the robot accelerometer is installed in an upward direction, if a second target data is less than or equal to the water level line reverse acceleration prediction value in the second array, it is determined that the robot has not reached the water level, and the robot can be controlled to continue cleaning according to the original motion data.
[0126] See also Figure 7 , the present application also provides a robot 700, comprising:
[0127] The acquisition module 701 is used to acquire the motion data of the robot when cleaning the swimming pool, and calculate the acceleration component and real-time speed in front of the robot according to the motion data; the acceleration component is acquired by an accelerometer;
[0128] A judgment module 702 is used to judge whether the real-time speed is greater than a preset speed threshold, and if the real-time speed is greater than or equal to the preset speed threshold, obtain an acceleration component set of the robot; the acceleration component set includes multiple real-time acceleration components;
[0129] A calculation module 703 is used to calculate the derivative corresponding to each of the real-time acceleration components in the acceleration component set to obtain a derivative set, and determine whether the derivative set meets the first water outlet condition;
[0130] A construction module 704 is used for obtaining a preset number of real-time acceleration components from the acceleration component set if the first water outlet condition is not met, and constructing an array using the preset number of real-time acceleration components;
[0131] The control module 705 is used to determine whether the array meets the second water outlet condition. If the second water outlet condition is not met, it is determined that the robot has not exceeded the water level line, and the robot is controlled to continue cleaning the swimming pool according to the motion data.
[0132] It can be understood that the implementation method of the water level cleaning method based on the accelerometer described in the above embodiment 1 is also applicable to this embodiment, so it will not be repeated here.
[0133] The embodiment of the present application also provides a computer device, for example, the computer device can be, but is not limited to, a desktop computer, a notebook, etc., and its existence form is not limited, mainly depending on whether it needs to support the interface display function of the browser web page, etc. Exemplarily, the computer device includes a memory and at least one processor, the memory stores a computer program, and the processor is used to execute the computer program to implement the water level cleaning method based on the accelerometer described in the above embodiment 1.
[0134] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. At least one of the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0135] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0136] Furthermore, the memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data (such as iteration data, version data, etc.) created according to the use of the computer device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0137] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the accelerometer-based water level cleaning method described in the above embodiment 1.
[0138] It can be understood that the implementation method of the water level cleaning method based on the accelerometer described in the above embodiment 1 is also applicable to this embodiment, so it will not be repeated here.
[0139] The computer-readable storage medium may be either a non-volatile storage medium or a volatile storage medium. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0140] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0141] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0142] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0143] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
[0144] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.
[0145] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0146] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A water level cleaning method based on an accelerometer, characterized in that: include: Acquire motion data of the robot when cleaning the swimming pool, and calculate the acceleration component and real-time speed in front of the robot according to the motion data; The acceleration component is obtained by an accelerometer; Determine whether the real-time speed is greater than a preset speed threshold, and if the real-time speed is greater than or equal to the preset speed threshold, obtain an acceleration component set of the robot; the acceleration component set includes multiple real-time acceleration components; Calculating derivatives of the multiple real-time acceleration components to obtain a derivative set, and determining whether the derivative set meets a first water outlet condition; If the first water outlet condition is not met, obtaining a preset number of the real-time acceleration components from the acceleration component set, and constructing an array using the preset number of the real-time acceleration components; It is determined whether the array satisfies a second water outlet condition; if the second water outlet condition is not satisfied, it is determined that the robot has not exceeded the water level, and the robot is controlled to continue cleaning the swimming pool according to the motion data.
2. The water level cleaning method based on accelerometer according to claim 1, characterized in that: The determining whether the derivative set satisfies the first water outlet condition includes: Obtaining a maximum value and a minimum value in the derivative set, and calculating an acceleration fluctuation value of the robot according to the maximum value and the minimum value; Determine whether the acceleration fluctuation value is greater than or equal to the acceleration out of water instantaneous detection fluctuation value; the acceleration out of water instantaneous detection fluctuation value is the fluctuation value generated at the moment when the robot leaves the water level line; If the acceleration fluctuation value is greater than or equal to the acceleration water-outlet instantaneous detection fluctuation value, it is determined that the derivative set meets the first water-outlet condition.
3. The water level cleaning method based on accelerometer according to claim 1, characterized in that: The step of acquiring a preset number of the real-time acceleration components from the acceleration component set and constructing an array using the preset number of the real-time acceleration components comprises: sorting the acceleration components in the acceleration component set from large to small to obtain a new data set; Determine the installation direction of the accelerometer of the robot, if the installation direction of the accelerometer is upward, obtain the preset number of first target data at the end of the new data from the new data set, and construct a first array using the first target data; If the accelerometer of the robot is installed downward, the preset number of second target data are obtained from the new data set at the front end of the new data, and the second array is constructed using the second target data.
4. The water level cleaning method based on accelerometer according to claim 3, characterized in that: The determining whether the array satisfies the second water outlet condition includes: If the accelerometer is installed upward, each of the first target data in the first array is compared with the water level line reverse acceleration prediction value; If all of the first target data are smaller than the water level line reverse acceleration prediction value, it is determined that the first array meets the second water outlet condition.
5. The water level cleaning method based on accelerometer according to claim 3, characterized in that: The determining whether the array satisfies the second water outlet condition further includes: If the accelerometer is installed downward, each of the second target data in the second array is compared with the water level line reverse acceleration prediction value; If all of the second target data are greater than the water level line reverse acceleration prediction value, it is determined that the second array meets the second water outlet condition.
6. The water level cleaning method based on accelerometer according to claim 1, characterized in that: The obtaining of the motion data of the robot comprises: Continuously acquiring multiple pitch angles of the robot, and determining whether each pitch angle is greater than or equal to a preset angle; If each of the pitch angles is greater than or equal to the preset angle, determine whether the absolute value of the difference between each two consecutively collected pitch angles is less than the robot's wall climbing angle fluctuation value; If both are smaller than the robot's wall-climbing angle fluctuation value, it is determined that the robot is located in the swimming pool wall area, and the motion data of the robot located in the swimming pool wall area is obtained.
7. The water level cleaning method based on accelerometer according to claim 6, characterized in that: The step of obtaining the motion data of the robot and calculating the acceleration component in front of the robot according to the motion data includes: If the robot is located in the swimming pool wall area, obtaining the real-time measurement data of the robot's accelerometer and the pitch angle; The acceleration component in front of the robot is calculated according to the real-time measurement data of the accelerometer and the pitch angle.
8. The water level cleaning method based on accelerometer according to claim 6, characterized in that: The method further comprises: If it is determined that the robot is located in the swimming pool wall area, the robot is controlled to run according to the preset speed threshold, and the PWM unit cycle change value of the PID motion model of the robot is controlled to be smaller than the preset change threshold.
9. The water level cleaning method based on accelerometer according to claim 1, characterized in that: Before obtaining the acceleration component set of the robot, the method includes: Acquire motion sampling data of the robot on different swimming pool walls, where the number of motion sampling data is a target number; Determine whether the target number of motion sampling data meets the determination requirements of the first water outlet condition and the second water outlet condition; If not, increasing the number of the motion sampling data until the number of the motion sampling data meets the judgment requirements of the first water outlet condition and the second water outlet condition; The final quantity of the motion data when the judgment requirement is met is recorded, and the construction condition of the acceleration component set is determined according to the final quantity.
10. A robot, characterized in that: include: An acquisition module, used to acquire motion data of the robot when cleaning the swimming pool, and calculate the acceleration component and real-time speed in front of the robot according to the motion data; The acceleration component is obtained by an accelerometer; A judging module, used for judging whether the real-time speed is greater than a preset speed threshold, and if the real-time speed is greater than or equal to the preset speed threshold, obtaining an acceleration component set of the robot; the acceleration component set includes a plurality of real-time acceleration components; A calculation module, used for calculating the derivatives of the multiple real-time acceleration components to obtain a derivative set, and determining whether the derivative set meets the first water outlet condition; A construction module, configured to obtain a preset number of real-time acceleration components from the acceleration component set if the first water outlet condition is not met, and construct an array using the preset number of real-time acceleration components; The control module is used to determine whether the array meets the second water outlet condition. If the second water outlet condition is not met, it is determined that the robot has not exceeded the water level line, and the robot is controlled to continue cleaning the swimming pool according to the motion data.
11. An electronic device, characterized in that: The invention comprises a memory and at least one processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the accelerometer-based water level cleaning method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the water level cleaning method based on an accelerometer according to any one of claims 1 to 9 is implemented.
