Method for robot to detect walking distance and mobile robot
By using the drive motor and code disk in the cleaning robot, combined with the PWM value integral and distance conversion coefficient, the problem of inaccurate walking speed and path planning of the cleaning robot is solved, and accurate detection of walking distance and improved path planning are achieved.
Patent Information
- Application Number
- CN202211344154.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-10-31
AI Technical Summary
The actual walking speed of the cleaning robot on the glass surface is different from the standard driving wheel walking speed converted from the fixed PWM value of the motor, resulting in inaccurate path planning.
By installing the drive motor and code disk in the robot, the PWM value is obtained and the integration process is performed, the distance conversion coefficient is applied to calculate the walking distance correction value to accurately detect the walking distance.
Accurate detection of the robot's walking distance is achieved, the impact of gravity and forward and reverse rotation of the drive wheel is overcome, and the accuracy of path planning is improved.
Smart Images

Figure CN115599101B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of mobile robots, and in particular to a method for detecting walking distance by a robot and a mobile robot. Background Art
[0002] Cleaning robots using inertial sensor navigation include sweeping robots, window cleaning robots, floor washing robots, etc. The window cleaning robot is adsorbed to a vertically set glass surface; when the window cleaning robot walks upward on the glass surface, the window cleaning robot does work on gravity, and the drive wheel motor of the window cleaning robot needs to output part of the power to overcome the influence of gravity in order to walk upward; when the window cleaning robot walks downward on the glass surface, gravity does work on the window cleaning robot, and if no braking action is taken, gravity can push the window cleaning robot to accelerate downward; and, if the window cleaning robot walks upward, downward, left or right on the glass surface, the current characteristics generated by the forward and reverse rotation of the drive wheel motor are different, and the torque required for the forward and reverse rotation of the drive wheel is different, the time consumed by the forward and reverse rotation of the drive wheel of the window cleaning robot over the same distance is different; therefore, the actual walking speed of the window cleaning robot on the glass surface is different from the standard driving wheel walking speed converted from the fixed PWM value of the motor, and the travel distance measured by the robot walking along the same path in different directions is different, which affects the path planning of the window cleaning robot on the glass surface. Summary of the invention
[0003] This application discloses a method for a robot to detect walking distance and a mobile robot, and the specific technical solution is as follows:
[0004] A method for a robot to detect walking distance, wherein driving wheels are installed on both sides of the robot, and a driving motor electrically connected to the driving wheels is installed inside the robot; the robot is also installed with a fan for adsorbing the robot on a working surface; the method for the robot to detect walking distance includes: after the robot enters a walking state from a stationary state, the robot starts to walk on the working surface and obtains a first PWM value, and then integrates the obtained first PWM value within a preset PWM value range to determine a reference walking distance value of the robot; or, during the robot walking on the working surface, the robot sets the travel distance value measured in real time by a code disk installed on it as the reference walking distance value of the robot; in combination with the relationship between the robot's walking direction and the gravity direction, a matching distance conversion coefficient is applied to the robot's reference walking distance value, and a walking distance correction value of the robot is calculated; wherein the robot maintains closed-loop regulation of the PWM value used to control the driving motor, and obtains the first PWM value during the closed-loop regulation process.
[0005] Furthermore, before the robot starts walking, a first PWM value is loaded into the drive motor to control the rotation of the drive wheel to overcome the static friction of the working surface, until the first PWM value is greater than a preset starting threshold value, and the robot is determined to enter a walking state from a stationary state so that the walking speed of the robot is linearly related to the first PWM value obtained in real time, and then the robot starts walking on the working surface to overcome the obstruction of the static friction from the working surface; wherein the preset starting threshold value is a PWM value determined when the drive wheel of the robot enters the walking state on working surfaces with different friction forces; the setting method of the working surface includes vertical setting, horizontal setting or inclined setting.
[0006] Furthermore, the method for integrating the first PWM value acquired within the preset PWM value range includes: after the robot enters the walking state, the robot samples the first PWM value within a preset sampling time, and then integrates all the first PWM values sampled within the preset sampling time that are greater than a preset starting threshold, and then sets the integration result of the first PWM value as the reference walking distance value of the robot; wherein the preset PWM value range refers to the PWM value range that is greater than the preset starting threshold; within the preset sampling time, the walking speed of the robot is proportional to the first PWM value sampled by the robot.
[0007] Furthermore, within the preset sampling time, the robot configures its internal timer to trigger an interrupt signal once every unit sampling time, and each time the robot detects an interrupt signal, it samples the first PWM value once; the first PWM value is used to feed back the walking speed of the robot within each unit sampling time.
[0008] Furthermore, the method of applying a corresponding distance conversion coefficient to a reference walking distance value of the robot in combination with the relationship between the walking direction of the robot and the direction of gravity to calculate a walking distance correction value of the robot includes: the robot measures the walking direction of the robot on the working surface in real time through a gyroscope, and determines the posture relationship between the walking direction of the robot and the direction of gravity; when the walking direction of the robot is not perpendicular to the direction of gravity, if the walking direction of the robot is set upward relative to the horizontal plane, it is determined that the robot walks upward on the working surface relative to the horizontal plane, and the currently calculated reference walking distance value is controlled to be multiplied by a first distance conversion coefficient to determine the walking distance correction value of the robot; when the walking direction of the robot is not perpendicular to the direction of gravity, if the walking direction of the robot is set downward relative to the horizontal plane, it is determined that the robot walks downward on the working surface relative to the horizontal plane, and the currently calculated reference walking distance value is controlled to be multiplied by a second distance conversion coefficient to determine the walking distance correction value of the robot; wherein, the working surface is not set parallel to the horizontal plane; and the direction of gravity is vertically downward.
[0009] Furthermore, when the robot walks upward on the working surface relative to the horizontal plane, the walking direction of the robot is set to a first preset inclined direction; when the robot walks downward on the working surface relative to the horizontal plane, the walking direction of the robot is set to a second preset inclined direction; the first preset inclined direction and the second preset inclined direction are symmetrical; on the same working surface, the first distance conversion coefficient and the second distance conversion coefficient are reciprocals of each other; the time taken by the robot to walk along the first preset inclined direction over the first preset reference distance value is marked as upward test time, and the time taken by the robot to walk along the second preset inclined direction over the first preset reference distance value is marked as downward test time; on the premise that the robot sets the ratio of the downward test time to the upward test time to the first distance conversion coefficient, the robot walks along the first preset inclined direction on the working surface When the robot walks in the second preset inclined direction on the working surface, the calculated walking distance correction value of the robot is less than the reference walking distance value; when the robot walks in the second preset inclined direction on the working surface, the calculated walking distance correction value of the robot is less than the reference walking distance value under the premise that the robot sets the ratio of the downward test time to the upward test time to the second distance conversion coefficient; when the robot walks along the first preset inclined direction on the working surface, the calculated walking distance correction value of the robot is greater than the reference walking distance value; when the robot walks in the second preset inclined direction on the working surface, the calculated walking distance correction value of the robot is greater than the reference walking distance value under the premise that the robot sets the ratio of the upward test time to the downward test time to the second distance conversion coefficient. Thus, a matching distance conversion coefficient is applied to the reference walking distance value of the robot.
[0010] Further, the first preset reference distance value is used to represent the distance between the uppermost boundary of the working surface and the lowermost boundary of the working surface; wherein, the time taken by the robot to walk in a straight line from the lowermost boundary of the working surface along the first preset inclined direction to the uppermost boundary of the working surface is the upward test time; wherein, the time taken by the robot to walk in a straight line from the uppermost boundary of the working surface to the lowermost boundary of the working surface along the second preset inclined direction is the downward test time.
[0011] Furthermore, the method of applying a corresponding distance conversion coefficient to a reference walking distance value of the robot in combination with the relationship between the walking direction of the robot and the direction of gravity to calculate a walking distance correction value of the robot also includes: when the walking direction of the robot is perpendicular to the direction of gravity, if the walking direction of the robot is a first preset horizontal direction perpendicular to the direction of gravity, then controlling the currently calculated reference walking distance value to be multiplied by a third distance conversion coefficient to determine the walking distance correction value of the robot; when the walking direction of the robot is perpendicular to the direction of gravity, if the walking direction of the robot is a second preset horizontal direction perpendicular to the direction of gravity, then controlling the currently calculated reference walking distance value to be multiplied by a fourth distance conversion coefficient to determine the walking distance correction value of the robot; wherein, the first preset horizontal direction points to one side of the working surface, and the second preset horizontal direction points to the other side of the working surface.
[0012] Furthermore, the time taken for the robot to walk along the first preset horizontal direction over the second preset reference distance is marked as the first test time, and the time taken for the robot to walk along the second preset horizontal direction over the second preset reference distance is marked as the second test time; the robot sets the ratio of the first test time to the second test time as the third distance conversion coefficient; or the robot sets the ratio of the second test time to the first test time as the third distance conversion coefficient; the first preset horizontal direction and the second preset horizontal direction are symmetrical; wherein, on the same working surface, the third distance conversion coefficient and the fourth distance conversion coefficient are reciprocals of each other.
[0013] Further, the second preset reference distance value is the distance between the leftmost boundary of the working surface and the rightmost boundary of the working surface; wherein, the time taken by the robot to walk in a straight line from the leftmost boundary of the working surface to the rightmost boundary of the working surface along the first preset horizontal direction is the first test time; wherein, the time taken by the robot to walk in a straight line from the rightmost boundary of the working surface to the leftmost boundary of the working surface along the second preset horizontal direction is the second test time.
[0014] Furthermore, if the working surface is parallel to the direction of gravity, the robot is configured to be adsorbed on the working surface, and the driving wheels of the robot are allowed to rotate forward or reverse on the working surface when the robot walks on the working surface; if the working surface is perpendicular to the direction of gravity, the robot is not configured to be adsorbed on the working surface, and the driving wheels of the robot are allowed to rotate forward or reverse on the working surface when the robot walks on the working surface.
[0015] Furthermore, the method for closed-loop adjustment of the PWM value for controlling the drive motor includes: when the absolute value of the angle difference between the heading angle measured in real time by the robot and the target navigation angle in the current adjustment cycle is not within a preset angle error range, the robot performs PID adjustment on the PWM value for controlling the drive motor for the drive motor connected to the drive wheel installed on each side of the robot. In the process of PID adjustment of the PWM value for controlling the drive motor, the difference between the PWM value for controlling the drive motor and the first preset target PWM value in the current adjustment cycle is used as feedback input for the next adjustment cycle to reduce the difference between the PWM value for controlling the drive motor and the first preset target PWM value, and the PWM value for controlling the drive motor is set to a first PWM value, and the first PWM value is input into the drive motor on the corresponding side in real time to obtain a drive wheel current sampling value output by the drive motor on this side, wherein the robot After entering the walking state, the real-time rotation speed of the driving motor is proportional to the first PWM value; for the driving motors connected to the driving wheels installed on each side of the robot, when the PWM value used to control the driving motor on the corresponding side and the first preset target PWM value are less than the corresponding preset driving wheel steady-state error, the robot adjusts the walking direction based on the difference in the real-time rotation speeds of the driving motors on both sides to guide the absolute value of the angular difference between the heading angle of the robot and the target navigation angle to be within the preset angular error range; wherein the absolute value of the angular difference between the heading angle of the robot and the target navigation angle is positively correlated with the absolute value of the real-time rotation speed difference between the driving motors connected to the driving wheels installed on both sides of the robot; wherein the heading angle of the robot is measured in real time by the built-in gyroscope of the robot; the driving wheels installed on both sides of the robot are each connected to a driving motor; the target navigation angle is pre-planned by the robot to guide the robot to walk along the pre-planned working path.
[0016] A mobile robot, wherein a driving wheel is installed on each of the left and right sides of the mobile robot, and a driving motor electrically connected to the driving wheel is installed inside the mobile robot; the mobile robot is also installed with a fan for adsorbing the mobile robot on a working surface; the mobile robot is configured to execute the method for detecting walking distance of the robot.
[0017] Furthermore, when the mobile robot is a suction cup window cleaning machine, the driving wheels installed on the left and right sides are cleaning turntables, which are used to support the suction cup window cleaning machine to move on the working surface to which it is adsorbed.
[0018] In the present application, the robot walks on a work surface placed in various orientations, and uses the first PWM value obtained by closed-loop adjustment to calculate the integral result of the first PWM value of the driving motor of the robot during the stable output current phase of the driving motor over time, which is used as the robot's walking distance to be corrected on the work surface. It preliminarily reflects the distance the robot has walked, and can detect the distance the robot's current position has walked relative to the starting position of the walking state.
[0019] Based on the distance the robot has traveled relative to the starting position of the walking state, the following distance correction effects exist:
[0020] If the robot walks upward along a vertically set working surface or walks upward along an inclined working surface, the currently calculated reference walking distance value is controlled to be multiplied by the first distance conversion coefficient to determine the robot's walking distance correction value and obtain a standard distance information; or, if the robot walks downward along a vertically set working surface or walks downward along an inclined working surface, the currently calculated reference walking distance value is controlled to be multiplied by the second distance conversion coefficient to determine the robot's walking distance correction value and obtain a standard distance information. To overcome the influence of the robot's gravity on the robot's walking on the current walking surface and the speed difference caused by the different rotation directions of the robot's driving wheels, the downward walking distance information can be used to represent the correction value of the upward walking distance, so as to overcome the influence of gravity and the difference caused by the forward and reverse rotation of the driving wheel for the robot's path planning in the vertical upward direction or the inclined upward direction; the upward walking distance can also be used to represent the correction value of the downward walking distance, so as to offset the influence of gravity and the difference caused by the forward and reverse rotation of the driving wheel for the robot's path planning in the vertical downward direction or the inclined downward direction.
[0021] If the robot walks in a horizontal direction along a vertically set working surface, or walks in a horizontal direction along an inclined working surface, or walks along a working surface set parallel to the horizontal plane, the currently calculated reference walking distance value is controlled to be multiplied by the corresponding distance conversion coefficient to determine the robot's walking distance correction value; since the robot does not do work on gravity, and gravity does not do work on the robot, the difference in current characteristics generated by the forward and reverse rotation of the driving wheel motor becomes a factor affecting the difference in the reference walking distance values calculated in different walking directions. Therefore, the reference walking distance value of the robot is converted into a standard distance information by setting a distance conversion coefficient that is multiplied by the reference walking distance value, thereby overcoming the speed difference caused by the different rotation directions of the robot's driving wheels. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of a method for a robot to detect walking distance based on walking direction disclosed in one embodiment of the present invention.
[0023] Figure 2 It is a structural schematic diagram of an intelligent window cleaning machine disclosed in one embodiment of the present invention. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the drawings in the embodiments of the present invention. To further illustrate the embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementations and advantages of the present invention.
[0025] The window cleaning robot is adsorbed to a vertically set glass surface. When the window cleaning robot walks upward on the glass surface, the window cleaning robot does work on gravity. The drive wheel motor of the window cleaning robot needs to output part of the power to overcome the influence of gravity in order to move upward. Even if the influence of the code disk installed in the drive wheel is ignored, the window cleaning robot may not be able to continue to move upward when the output power of the drive motor is too small, but the mileage information calculated based on the PWM value used to control the drive motor is still greater than 0, or the actual distance traveled is less than the mileage information calculated by the PWM value used to control the drive motor. At this time, the present application will convert the mileage information calculated by the PWM value used to control the drive motor through a preset distance conversion coefficient to obtain the distance information in the calibration mode, including the walking distance converted to the opposite direction.
[0026] When the window cleaning robot walks downward on the glass surface, gravity does work on the window cleaning robot. If no braking action is taken, gravity can push the window cleaning robot to accelerate downward, which may easily cause slipping. The window cleaning robot may continue to walk downward when the drive motor outputs too little power, and the actual distance walked may be greater than the mileage information calculated by the PWM value used to control the drive motor. At this time, the present application will convert the mileage information calculated by the PWM value used to control the drive motor through a preset distance conversion coefficient to obtain the distance information in the calibration mode, including the walking distance converted to the opposite direction.
[0027] Similarly, taking into account the different characteristics of the forward and reverse rotation of the driving wheel, if the window cleaning robot walks up, down, left or right on the glass surface, or the sweeping robot walks up, down, left or right on the working surface (including horizontal ground and sloped surface), based on the different current characteristics generated by the forward and reverse rotation of the driving wheel motor and the different torques required for the forward and reverse rotation of the driving wheel, the time consumed by the window cleaning robot's driving wheel to rotate forward and reverse for the same walking distance is different. The present application will convert the mileage information calculated by the PWM value used to control the driving motor through a preset distance conversion coefficient to obtain the distance information in the calibration mode, including the walking distance converted to the opposite direction.
[0028] As an embodiment, this embodiment discloses a method for detecting walking distance of a robot, which is used to reflect the walking distance of the robot on the working surface, which does not necessarily represent the actual distance, but can be a relative distance relative to a preset starting point position; and the detected distance information is represented by a power value, which can be proportional to the distance value. The execution subject of the method for detecting walking distance of the robot is a fully automatic planning mobile robot, including a wheeled robot, a suction cup robot and a crawler robot. This type of robot is mainly a sweeping robot and a window cleaning robot, which is a cleaning robot with a fan and a drive motor; driving wheels are installed on both sides of the robot, generally one driving wheel is installed on each side of the left and right sides of the chassis of the body; a driving motor electrically connected to the driving wheel is installed inside the robot, and each driving wheel is connected to a driving motor, then the robot is provided with two driving motors for controlling the rotation speed of the driving wheel to control the walking speed of the robot on the working surface, and the rotation speed difference of the two driving wheels can control the walking direction of the robot, and the driving wheel of the robot can contact the working surface to generate friction that can hinder the walking of the robot; the robot is also equipped with a fan to generate suction on the walking surface of the robot. When the robot is a sweeping robot, the dust suction fan inside the sweeping robot is used to vacuum the working surface; when the robot is a window cleaning robot, the fan inside the window cleaning robot is used to adsorb on the working surface; the working surface here can be a cleaning medium placed in various postures, such as a horizontal ground, inclined glass or wall, etc.
[0029] See also Figure 1It can be seen that the method for detecting the walking distance of the robot includes: step S1, after the robot enters the walking state from the static state, the robot starts to walk on the working surface and obtains the first PWM value, and then integrates the first PWM value obtained in the robot walking process and is within the preset PWM value range to determine the reference walking distance value of the robot; and then executes step S2. In this embodiment, at the starting position of entering the walking state, the robot overcomes the static friction on the working surface, the driving force generated by the driving motor is greater than the static friction, the walking speed of the robot is proportional to the first PWM value, the first PWM value is integrated in the curve of the body start-up time stage greater than the preset threshold, and the reference walking distance value is calculated to reflect the distance information of the robot walking; the larger the reference walking distance value, the farther the robot walks relative to a preset starting position; the smaller the reference walking distance value, the closer the robot walks relative to a preset starting position, and the preset starting position is adaptively set according to the expected navigation path or working area of the robot on the working surface, and is not specifically limited to a fixed position.
[0030] In some embodiments, step S1 includes, after the robot enters the walking state from the stationary state, during the process of the robot walking on the working surface, the robot sets the travel distance value measured in real time by the code disk installed on it as the reference walking distance value of the robot, without integrating the PWM value; and then executes step S2. Among them, the robot is equipped with a code disk, that is, the code disk is installed in the driving wheels on the left and right sides, specifically, a photoelectric encoder is installed on both sides of the same driving wheel to measure the distance rotated by the driving wheel in real time, and the robot receives the travel distance value fed back by the code disk.
[0031] It is worth noting that, considering the combined effects of the forward and reverse rotation of the driving wheels and gravity on the walking distance of the robot on the working surface mentioned in the background technology, it is necessary to continue to execute step S2 after executing step S1.
[0032] Step S2, combining the relationship between the robot's walking direction and the gravity direction, applying a matching distance conversion coefficient to the robot's reference walking distance value, and calculating the robot's walking distance correction value to reflect the robot's relative walking distance on the working surface, especially the distance information relative to the edge position of the working surface. Step S2 specifically converts the robot's reference walking distance value through a preset distance conversion coefficient to obtain the distance information in the calibration mode. The specific conversion method includes: when the reference walking distance value is configured as the equivalent distance that the robot has walked on the working surface in the opposite direction to the current walking direction, step S2 is equivalent to converting the equivalent distance to the distance reached by the robot on the working surface along the current walking direction for the same time; or directly converting the reference walking distance value to the distance reached by the robot on the working surface in the opposite direction to the current walking direction for the same time; overcoming the influence of the robot's gravity on the robot's walking speed on the working surface and the influence of the forward and reverse rotation of the driving wheel on the robot's walking speed on the working surface.
[0033] During the execution of step S1 and step S2, the robot maintains closed-loop regulation of the PWM value used to control the drive motor, and obtains a first PWM value during the closed-loop regulation process. The first PWM value obtained in real time forms a PWM value change curve. Since the driving force (such as torque) output by the drive motor is controlled by the first PWM value, and the driving force output by the drive motor is applied to the drive wheel to form the rotation speed of the drive wheel, and then the product of the rotation speed of the drive wheel and the circumference of the drive wheel is equal to the walking speed of the drive wheel, the first PWM value is greater than the preset threshold during the body startup time stage, and the walking speed of the robot is proportional to the first PWM value. The first PWM value can be collected under the condition of unobstructed straight-line operation. The ratio parameter of the walking speed of the robot and the first PWM value is related to the type of the drive motor, and the first PWM value corresponding to the walking speed of the robot (the walking speed or driving force of the drive wheel) can be obtained (which can also be further converted into the current output by the drive motor). Therefore, the robot of the present application walks on a work surface placed in various orientations, and uses the first PWM value adjusted by closed-loop adjustment to calculate the integral result of the first PWM value of the driving motor of the robot in the stable stage of the output current of the driving motor over time, as the robot's walking distance to be corrected on the working surface, which preliminarily reflects the distance the robot has walked, and realizes the detection of the distance the robot's current position has walked relative to the starting position of entering the walking state. Since the PWM value used to adjust the driving wheel is used to calculate the robot's walking distance, if the mileage data fed back by the code disk is not used, the cost of the sensor and the mechanical assembly structure can be saved.
[0034] In the process of closed-loop regulation of the PWM value used to control the drive motor in this application, the PWM value can control the speed of the drive motor, then the PWM value can change the speed of the drive wheel, and then change the walking speed of the robot. Specifically, the heading angle of the robot will be adjusted by controlling the relative size of the torque output by the drive motor of the left and right drive wheels. When the speeds of the drive wheels on both sides of the robot are inconsistent, the walking direction of the robot will change, such as turning, and the heading angle of the robot will change. Therefore, in the process of closed-loop regulation, the absolute value of the angle difference between the heading angle measured in real time by the robot and the target navigation angle can be adjusted to be within a preset angle error range, so that the robot walks in a predetermined direction. Specifically, the robot can adjust the PWM signal used to control the drive motor through an angle closed-loop feedback regulation device, and apply the first PWM value adjusted in real time to the drive motor, the drive wheel will change the output speed, and then the heading angle of the robot corresponding to the speed of the drive wheel after the change is used as the feedback input of the angle closed-loop feedback regulation device to maintain the closed-loop regulation, and also indirectly adjust the closed-loop regulation of the heading angle measured in real time by the robot.
[0035] It should be noted that pulse width modulation (PWM) is the abbreviation of "Pulse Width Modulation". The PWM value is the average value of the on-time of the switch tube in a cycle. The longer the on-time, the larger the PWM value applied to the motor, the larger the average value of the DC output of the switch tube, and the motor speed can be proportional to the PWM value. The PWM frequency is a ratio of the on-time to the cycle time in a cycle, usually called the duty cycle. The more on-times, the higher the frequency. Therefore, the basic principle of PWM speed control is to connect and disconnect the power supply at a fixed frequency, and change the "duty cycle" of the voltage on the armature of the DC motor by changing the on-time ratio (duty cycle) in a cycle as needed, thereby changing the average voltage, controlling the motor speed, and then changing the walking speed of the robot.
[0036] It is known to those skilled in the art that, whether it is a fan or a drive motor, their power generation components are motors. Preferably, the bridge circuit is a drive circuit structure, which controls the forward and reverse rotation of the motor and outputs the drive current of the motor. The drive motor is a motor that controls the rotation of the drive wheel; the PWM value acting on the left and right wheels is linearly related to the wheel torque, and the PWM value acting on the fan is a rotatable PWM value in most cases. The PWM signal input to the motor is actually a rectangular pulse wave with a continuously adjustable pulse width, which is a pulse with a certain frequency and adjustable pulse width provided to the motor through a modulator. The larger the pulse width, the larger the duty cycle, the larger the average voltage provided to the motor, and the higher the motor speed. On the contrary, the smaller the pulse width, the smaller the duty cycle. The smaller the average voltage provided to the motor, the lower the motor speed. Thus, by controlling the motor to output different analog voltages through the PWM signal, the motor can reach different output speeds, which is also regarded as changing the output torque of the motor.
[0037] The PWM signal or PWM value (which can be regarded as proportional to the duty cycle) that regulates the motor speed. The duty cycle is the ratio of the high level in one cycle. The larger the ratio of the high level, the larger the duty cycle. For a DC motor, the motor can rotate when the motor output pin is high. When the output is high, the motor will rotate, but it will speed up little by little. When the high level suddenly turns to a low level, the motor will not stop because the inductance has the function of preventing sudden current changes, and will maintain the original speed. In this way, the motor speed is the average voltage value output within the cycle, which can be linearly related to the aforementioned PWM value in a certain operating stage; so in essence, speed regulation is to put the motor in a state that seems to be stopped but not stopped, seems to be rotating at full speed but not rotating at full speed, so the average speed in one cycle is the speed adjusted by the duty cycle.
[0038] As an embodiment, in step S1, before the robot starts walking, the first PWM value is loaded into the drive motor to control the rotation of the drive wheel to overcome the static friction of the working surface, until the first PWM value is greater than a preset starting threshold, and the robot is determined to enter a walking state from a stationary state so that the walking speed of the robot is linearly related to the first PWM value obtained in real time. Then, the robot starts walking on the working surface to overcome the obstruction of the static friction from the working surface, wherein the walking speed of the robot is proportional to the first PWM value obtained in real time.
[0039] Specifically, before the robot starts walking at a preset starting position on the working surface, it starts the drive motor from a stationary state and is controlled by the first PWM value adjusted in real time, so as to generate an acceleration direction and have a relative sliding tendency relative to the working surface; it also starts the fan and is controlled by the second PWM value adjusted in real time to adsorb to the working surface (especially the window cleaning robot); there is static friction between the robot and the contacted working surface until the robot is at the preset starting position after a preset starting time from a stationary state, and the driving force provided by the drive motor at the current moment just exceeds the static friction to overcome the influence of the static friction, and it is determined that the robot has completed the body startup and started walking on the working surface, entering the walking state.
[0040] In some embodiments, within the preset start-up time, the robot can also execute the robot motion calibration disclosed in Chinese patent CN111852925B, that is, each driving wheel of the robot is calibrated, and the motion calibration of the left and right wheels is completed within 210ms, including the left wheel of the robot is stationary, and the right wheel of the robot rotates forward and reverse for a fixed time respectively; and the right wheel of the robot is stationary, and the left wheel of the robot rotates forward and reverse for a fixed time respectively; then the current signal output by the driving motor becomes stable, that is, it enters the linear stage, and the motion calibration before this is not counted as the robot walking on the current walking surface in this application.
[0041] It should be noted that the preset start threshold is set to the PWM value required for the robot's driving wheel to enter the walking state on working surfaces with different friction forces; the setting method of the working surface includes vertical setting, horizontal setting or inclined setting. When the medium or position setting method of the working surface changes, or there is a certain deviation in the motor performance, it is basically difficult for the first PWM value actually adjusted to be completely consistent with the theoretical PWM value. Therefore, when performing the subsequent PWM value comparison, it is preferred that the difference between the first PWM value current obtained in real time and the preset start threshold is within a deviation threshold to determine that the robot is in a stationary state, otherwise the robot enters a walking state from a stationary state.
[0042] Preferably, the preset start threshold value can be set according to the first PWM value required for the robot to walk normally on working surfaces with different friction forces. When the robot walks normally, there will be no problem that the driving wheel cannot rotate due to excessive suction of the fan or the driving wheel slips due to insufficient suction of the fan when the robot is working, and there will be no problem that the driving wheel cannot rotate or slips due to the change of torque output by the driving motor.
[0043] First, place the robot on a material with less friction, and adjust the first PWM value up and down so that the robot can walk normally using the torque formed by the first PWM value controlled by the aforementioned closed-loop adjustment. Then place the robot on a material with greater friction, and fine-tune the first PWM value so that the robot can walk normally using the torque formed by the first PWM value controlled by the aforementioned closed-loop adjustment; then verify on working surfaces with different friction whether the robot can walk normally according to the current first PWM value, and if so, set the first PWM value to the preset start threshold; if not, find a balance value to meet most of the situations encountered by the robot. Due to the huge differences in drive motors, drive wheels, mold structures, etc. of different types of machines, the first PWM values required for normal walking of different types of robots are also different, so it is necessary to obtain in advance the first PWM value when the current robot walks normally. The adjustment of the first PWM value can be achieved by changing the first preset target PWM value in the angle closed-loop feedback adjustment device, or directly changing the first PWM value.
[0044] In the embodiment corresponding to the above-mentioned step S1, the method for integrating the acquired first PWM value within the preset PWM value range includes: after the robot enters the walking state, the robot starts walking on the working surface from a preset starting position, and can maintain crossing different medium working surfaces or walking in a straight line without obstacles at different height positions on the same working surface, wherein the preset starting position is the starting position for entering the walking state; the robot samples the first PWM value within a preset sampling time, and then integrates all first PWM values sampled within the preset sampling time that are greater than the preset start threshold, and then sets the integration result of the first PWM value as the reference walking distance value of the robot; wherein the preset PWM value range refers to the PWM value range greater than the preset start threshold. Therefore, the integration processing method disclosed in this embodiment can also be regarded as integrating the curve where the first PWM value within the preset PWM value range is located, and the integration time interval is the set of times corresponding to the first PWM value greater than the preset start threshold; within the preset sampling time, the walking speed of the robot is proportional to the first PWM value sampled by the robot, and the preset sampling time is set to the time taken by the robot to walk from the starting position of entering the walking state to the current position; if the first PWM values sampled within the preset sampling time are all greater than the preset start threshold, the integration time is the preset sampling time, and a more comprehensive first PWM value is sampled to obtain a more complete integration result, so as to feedback more accurate robot walking distance information. Although the dimensions are different, since the walking speed of the robot is proportional to the first PWM value sampled by the robot, the integration result of the first PWM value within the corresponding integration time can at least feedback the distance of the current position of the robot relative to the preset starting position.
[0045] In the above embodiment, in order to sample a stable first PWM value, this embodiment preferably sets the preset start time and the preset sampling time as two adjacent time periods, and there may be no time interval between the preset start time and the preset sampling time to ensure that the preset sampling time is the linear stage after the robot overcomes the static friction, that is, the current signal output by the driving motor is in a relatively stable state, so that the walking speed of the robot is proportional to the first PWM value sampled by the robot.
[0046] Preferably, within the preset sampling time, the robot is configured to configure its internal timer to trigger an interrupt signal once every unit sampling time, and each time the robot detects an interrupt signal, it samples the first PWM value once, which is recorded as the PWM value at a moment in the PWM value curve required for integral processing; since within the preset sampling time, the rotation speed of the drive motor and the walking speed of the robot can be proportional to the first PWM value, the first PWM value is used to feedback the walking speed of the robot within each unit sampling time, and can be recorded as the average speed within a period of time (represented by the average PWM value within the same period of time), or it can be the instantaneous walking speed.
[0047] In some embodiments, in order to reduce the situation where the current is unstable when the driving motor just starts to rotate, the sampling of the PWM value required for the integral processing is located in the second half of the fixed time 360ms, so as to use a stable current and reduce errors. For example, the preset start time is equal to 210ms, and the preset sampling time is equal to 100ms. The preset sampling time is delayed from the preset start time, and sampling starts at 210ms and stops at 310ms, with a total sampling time of 100ms; therefore, the robot can complete the overcoming of static friction and the sampling of the PWM value required to calculate the reference walking distance value in a shorter time, making the practicality of the present application stronger.
[0048] As an embodiment, the method of applying a corresponding distance conversion coefficient to a reference walking distance value of the robot in combination with the relationship between the walking direction of the robot and the gravity direction to calculate a walking distance correction value of the robot includes:
[0049] The robot measures the walking direction of the robot on the working surface in real time through the gyroscope, and determines the posture relationship between the walking direction of the robot and the direction of gravity, so as to determine the work done by gravity on the robot walking on the working surface; the robot uses the gyroscope to detect the angle change generated from the preset starting position, and the angle change includes the angle change of the robot's heading angle, the angle change of the pitch angle, and the angle change of the roll angle, which is used to indicate the change of the robot's walking direction, specifically indicating the change of the robot's walking direction on the working surface. Among them, the posture relationship between the robot's walking direction and the direction of gravity includes: when the robot's walking direction is not perpendicular to the direction of gravity, when the robot's walking direction is biased upward relative to the direction of gravity, the robot walking on the working surface does work on its gravity, so that gravity causes walking hindrance to the robot during the robot's walking; when the robot's walking direction is biased downward relative to the direction of gravity, gravity does work on the robot walking on the working surface, so that gravity introduces walking acceleration to the robot during the robot's walking. The steering of the driving wheels when the walking direction of the robot is biased upward relative to the direction of gravity is different from the steering of the driving wheels when the walking direction of the robot is biased downward relative to the direction of gravity.
[0050] When the robot's walking direction is perpendicular to the direction of gravity, no matter the robot's walking direction is biased to the left or to the right relative to the direction of gravity, gravity does not do work on the robot walking on the working surface, and the robot walking on the working surface does not do work on its gravity. The steering of the driving wheels when the robot's walking direction is biased to the left relative to the direction of gravity is different from the steering of the driving wheels when the robot's walking direction is biased to the right relative to the direction of gravity.
[0051] In this embodiment, the robot measures the walking direction of the robot on the working surface through a gyroscope, which can be combined with the acceleration information provided by the accelerometer to form the posture information of the robot, and then the posture is solved through the coordinate system to obtain the heading angle, pitch angle and roll angle of the robot, and then the posture relationship between the walking direction of the robot and the gravity direction is determined, including the angular relationship between the walking direction of the robot and the gravity acceleration direction. The specific posture or angle solution method is a conventional trigonometric function operation. According to the definition of the pitch angle and the roll angle, there can be multiple forms of conversion methods, which will not be described in detail here.
[0052] It should be noted that the robot can move on the working surface through various combinations of real-time changes relative to the three mutually perpendicular axes defined by the body. The three vertical axes include: the front and rear axis, the lateral axis and the central vertical axis; the moving direction along the front and rear axis is marked as the front side, which serves as the head (forward end) of the robot; the backward driving direction along the front and rear axis is marked as the rear side, which serves as the tail (rearward end) of the robot; the direction of the lateral axis is essentially along the direction of the line connecting the centers of the rotating shafts of the left and right driving wheels.
[0053] When the robot climbs up a vertical or inclined working surface, the front part of the robot tilts upward and the rear part of the robot tilts downward, which is regarded as the body "tilting up", so that the body of the robot contacts the surface of the working surface at a certain tilt angle. The robot is in an upward-looking state. When the tilt of the working surface increases, the gyroscope measures that the pitch angle of the robot gradually increases to 90 degrees during the robot's walking process; when the gyroscope measures that the pitch angle of the robot is between 0 degrees and 90 degrees but has not reached 90 degrees, it can be regarded that the walking direction of the robot is not perpendicular to the direction of gravity; when the pitch angle of the robot reaches 0 degrees, it can be regarded that the walking direction of the robot is perpendicular to the direction of gravity.
[0054] When the robot goes downhill along the inclined working surface, the rear part of the robot's body tilts upward and the front part of the robot's body tilts downward, which is regarded as the body "pitching down", so that the robot's body contacts the surface of the working surface at a certain tilt angle, and the pitch angle of the robot measured by the gyroscope is not 0; when the robot is in a overlooking state, the greater the tilt of the working surface, the pitch angle of the robot measured by the gyroscope gradually decreases to -90 degrees during the robot's walking process; when the gyroscope measures the robot's pitch angle between 0 degrees and -90 degrees but has not reached -90 degrees, it can be regarded as the robot's walking direction is not perpendicular to the gravity direction; when the robot's pitch angle reaches 0 degrees, it can be regarded as the robot's walking direction is perpendicular to the gravity direction.
[0055] In addition, the robot can rotate around the central vertical axis. When the robot is walking in the forward direction, when the robot rotates to the right side of the front and rear axis, it is "right flip", and when the robot rotates to the left side of the front and rear axis, it is "left flip".
[0056] After determining the posture relationship between the walking direction of the robot and the direction of gravity, when the robot detects that the walking direction of the robot is not perpendicular to the direction of gravity, if the walking direction of the robot is set upward relative to the horizontal plane, it is determined that the robot walks upward relative to the horizontal plane on the working plane, and the reference walking distance value currently calculated in step S2 is controlled to be multiplied by the first distance conversion coefficient, and then the product of the reference walking distance value and the first distance conversion coefficient is marked as the walking distance correction value of the robot. When determining that the walking direction of the robot is not perpendicular to the direction of gravity, if the walking direction of the robot is set downward relative to the horizontal plane, it is determined that the robot walks downward relative to the horizontal plane on the working plane, and the reference walking distance value currently calculated in step S2 is controlled to be multiplied by the second distance conversion coefficient, and then the product of the reference walking distance value and the second distance conversion coefficient is marked as the walking distance correction value of the robot; wherein the working plane is not set parallel to the horizontal plane; the direction of gravity is vertically downward. The working plane can be set obliquely with the horizontal plane, or it can be set vertically on the horizontal plane, and the working plane includes but is not limited to an inclined glass plate and a wall perpendicular to the horizontal ground. The gravity direction of the robot is vertically downward, and it is kept perpendicular to the horizontal plane, which is the direction information obtained in advance.
[0057] Specifically, when the robot walks upward relative to the horizontal plane on the working surface, the walking direction of the robot is set to the first preset tilt direction; when the robot walks downward relative to the horizontal plane on the working surface, the walking direction of the robot is set to the second preset tilt direction; the angle information corresponding to the first preset tilt direction and the angle information corresponding to the second preset tilt direction can be obtained by solving the angle measured by the gyroscope. On the same working surface, the first distance conversion coefficient and the second distance conversion coefficient are reciprocals of each other. When the first preset tilt direction and the second preset tilt direction are symmetrical, the first preset tilt direction and the second preset tilt direction point in opposite directions respectively. The time taken for the robot to walk along the first preset inclined direction over the first preset reference distance value is marked as the upward test time, and the time taken for the robot to walk along the second preset inclined direction over the first preset reference distance value is marked as the downward test time; preferably, the robot is on a work surface with a boundary, and the robot is controlled to record the walking time of the robot from a preset starting position, the robot walks upward to the uppermost boundary, and then walks in a straight line from the uppermost boundary of the work surface to the lowermost boundary of the same work surface, and the time taken for the robot to walk in a straight line from the uppermost boundary of the work surface to the lowermost boundary of the same work surface is recorded as the downward test time. ; Then, the time taken by the robot to walk in a straight line from the bottom boundary of the working surface to the top boundary of the same working surface is recorded as the upward test time; wherein, the distance that the robot walks in a straight line between the top boundary and the bottom boundary of the same working surface is fixed, and the distance between the top boundary and the bottom boundary of the same working surface is represented by a first preset reference distance value, and the reference walking distance value, the first preset reference distance value and the walking distance correction value disclosed in the present application all use the same dimension, which can specifically be the dimension of the integral result of the PWM value over time; of course, the relative position of the top boundary and the bottom boundary of the same working surface is also fixed.
[0058] As a first conversion embodiment, under the premise that the robot sets the ratio of the downward test time to the upward test time as the first distance conversion coefficient, when the robot walks on the working surface along the first preset inclined direction, the robot walks upward on the working surface relative to the horizontal plane, and the walking distance correction value of the robot calculated in step S2 is less than the reference walking distance value, thereby obtaining a walking distance correction value that can introduce the influence of the walking distance difference caused by the effect of gravity and the forward and reverse rotation of the driving wheel through the first distance conversion coefficient; because gravity causes a walking acceleration effect on the robot in the process of the robot walking downward, and gravity causes a walking obstruction effect on the robot in the process of the robot walking upward , the effect of gravity is dominant over the walking distance difference caused by the forward and reverse rotation of the driving wheel, so the downward test time is less than the upward test time, and the first distance conversion coefficient is set to be less than the value 1, so the currently converted distance value is less than the reference walking distance value obtained by integration when walking upward, so that the walking distance correction value of the robot calculated in step S2 introduces the hindering effect of the robot's gravity on the robot's walking on the working surface and the walking distance difference caused by the forward and reverse rotation of the driving wheel, so that the walking distance correction value of the robot calculated in step S2 is less than the reference walking distance value obtained by integration of the first PWM value alone (affected by the torque applied to the driving wheel). Specifically, in the process of the robot walking upward along a vertically set working surface or walking upward along an inclined working surface, the difference in walking distance caused by the gravity relative to the forward and reverse rotation of the driving wheel is dominant, and the robot is hindered by the gravity of the robot, that is, the reduction effect of the gravity acceleration on the walking speed of the robot which is proportional to the first PWM value. Under the control of the first PWM value sampled by the robot, the robot walking speed converted by the output current of the driving motor (obtained by the product of the real-time rotation speed of the driving motor and the circumference of the driving wheel) is greater than the actual walking speed of the robot in the working surface. In this case, it is necessary to convert the distance that plays a correction role through the first distance conversion coefficient which is less than the value 1, and use this distance to represent the correction value of the distance walked upward, that is, the walking distance correction value of the robot, so as to compensate for the weakening effect of the gravity acceleration on the walking speed output by the motor (the distance calculated by the integral of the PWM value is greater than the actual distance walked) by reducing the reference walking distance value, and restore the relative distance information actually walked by the robot on the working surface.
[0059] As a second conversion embodiment, under the premise that the robot sets the ratio of the downward test time to the upward test time as the second distance conversion coefficient, when the robot walks on the working surface in the second preset inclined direction, the robot walks downward on the working surface relative to the horizontal plane, and the walking distance correction value of the robot calculated in step S2 is less than the reference walking distance value, so as to realize the conversion of the reference walking distance value of the robot into the distance reached by the robot when walking upward on the working surface relative to the horizontal plane in the same time, and this same time is the time taken for the robot to walk downward on the working surface relative to the horizontal plane from the preset starting position to the current position; because gravity accelerates the robot's walking in the process of the robot walking downward, and gravity hinders the robot's walking in the process of the robot walking upward, the effect of gravity on the walking speed The influence exerted is dominant over the walking distance difference caused by the forward and reverse rotation of the driving wheel, so the downward test time is less than the upward test time, and the second distance conversion coefficient is set to be less than the value 1, and the walking distance correction value of the robot calculated in step S2 is less than the reference walking distance value. Therefore, the setting of the second distance conversion coefficient disclosed in this embodiment weakens the acceleration effect of the robot's gravity on the robot's downward walking on the working surface and the influence of the walking distance difference caused by the forward and reverse rotation of the driving wheel, which is convenient for comparing the robot's walking distance correction value with the reference walking distance value calculated by step S1 during the robot's actual upward walking of the working surface relative to the horizontal plane. There is a distance standard for comparison in the same walking direction to convert the distance traveled by the robot into the first preset inclined direction.
[0060] As a third conversion embodiment, under the premise that the robot sets the ratio of the upward test time to the downward test time as the first distance conversion coefficient, when the robot walks along the first preset inclination direction on the working plane, the robot walks upward on the working plane relative to the horizontal plane, and the robot's walking distance correction value is calculated to be greater than the reference walking distance value, so as to realize the conversion of the robot's reference walking distance value into the distance reached by the robot when walking downward on the working plane relative to the horizontal plane in the same time. The same time in this embodiment is the time taken for the robot to walk upward on the working plane relative to the horizontal plane from the preset starting position to the current position. In the present embodiment, since gravity accelerates the robot's walking when the robot is walking downward, and gravity hinders the robot's walking when the robot is walking upward, the influence of gravity on the walking speed is dominant over the walking distance difference caused by the forward and reverse rotation of the driving wheel. Therefore, the downward test time is less than the upward test time, and the first distance conversion coefficient is set to be greater than the value 1, and the walking distance correction value of the robot calculated in step S2 is greater than the reference walking distance value. Therefore, the setting of the first distance conversion coefficient disclosed in the present embodiment weakens the hindering effect of the robot's gravity on the robot's walking downward on the working surface and the influence of the walking distance difference caused by the forward and reverse rotation of the driving wheel, so as to facilitate the comparison of the robot's walking distance correction value with the reference walking distance value calculated by step S1 when the robot actually walks downward on the working surface relative to the horizontal plane. That is, if there is a comparison distance standard in the same walking direction, it can be uniformly converted into the distance of the robot's walking in the second preset inclined direction.
[0061] In some embodiments, when the robot walks along the first preset inclined direction on the working surface, the driving wheel rotates forward; when the robot walks along the second preset inclined direction on the working surface, the driving wheel rotates backward; because the torque required for the forward and reverse rotation of the driving wheel is different and the corresponding current output by the driving motor is different, the real-time rotation speed generated by the forward and reverse rotation is also different, causing the distance traversed by the robot walking along the first preset inclined direction on the working surface for a fixed period of time to be different from the distance traversed by the robot walking along the second preset inclined direction on the working surface for the same period of time, resulting in the difference in walking distance caused by the forward and reverse rotation of the driving wheel, and combined with the gravity of the robot, it can cause a greater distance difference (the interference of gravity acceleration on the walking speed in different directions). In particular, when the driving wheel changes from forward to reverse, the first PWM value may change from a positive value to a negative value, then the first PWM value controls the driving wheel to rotate forward in a positive state, if the first PWM value crosses the value 0 and becomes a negative value during the forward rotation of the driving wheel, it will introduce a distance error, which needs to be considered.
[0062] As a fourth conversion embodiment, under the premise that the robot sets the ratio of the upward test time to the downward test time as the second distance conversion coefficient, when the robot walks on the working surface in the second preset inclined direction, the robot walks downward relative to the horizontal plane on the working surface, and the calculated walking distance correction value of the robot is greater than the reference walking distance value, so that the walking distance correction value that can introduce the influence of the walking distance difference caused by the gravity effect and the positive and negative rotation of the driving wheel is converted through the second distance conversion coefficient; because the gravity causes the walking acceleration of the robot in the process of the robot walking downward, and the gravity causes the walking hindrance to the robot in the process of the robot walking upward, the influence of the gravity on the walking speed is dominant relative to the walking distance difference caused by the positive and negative rotation of the driving wheel, so the downward test time is less than the upward test time, and the second distance conversion coefficient is set to be greater than the value 1, so the currently converted distance value is greater than the reference walking distance value obtained by the integral processing when walking downward, so that the walking distance correction value of the robot calculated in step S2 introduces the acceleration effect of the robot's gravity on the robot's walking on the working surface, so that the walking distance correction value of the robot calculated in step S2 is greater than the reference walking distance value obtained by the integral processing of the first PWM value alone (affected by the torque applied to the driving wheel). Specifically, in the process of the robot walking downward along a vertically set working surface or walking downward along an inclined working surface, the robot is hindered by the gravity of the robot, that is, the enhancing effect of gravity acceleration on the walking speed of the robot which is proportional to the first PWM value. Under the control of the first PWM value sampled by the robot, the robot walking speed converted by the output current of the drive motor (obtained by the product of the real-time rotation speed of the drive motor and the circumference of the drive wheel) is less than the actual walking speed of the robot in the working surface. In this case, it is necessary to convert the distance that plays a corrective role through the second distance conversion coefficient that is greater than the value 1, and use this distance to represent the corrected value of the distance walked downward, that is, the walking distance correction value of the reference walking distance value, so as to compensate for the accelerating effect of gravity acceleration on the walking speed output by the motor (the distance calculated by the integral of the PWM value is smaller than the actual distance walked) by increasing the reference walking distance value, and restore the relative distance information actually walked by the robot downward on the working surface.
[0063] It should be noted that, in the above four conversion embodiments, the first distance conversion coefficient and the second distance conversion coefficient do not change due to the change of the medium of the working surface contacted by the same type of robot; the first distance conversion coefficient and the second distance conversion coefficient both change with the change of the type of robot. Moreover, the first preset inclination direction and the second preset inclination direction are symmetrical, so the upward test time and the downward test time can be measured in the same walking path or on a parallel path, so that the difference between the upward test time and the downward test time is greatly affected by the acceleration of gravity, reducing the influence of the difference between the positive and negative rotations of the driving wheel; on the same working surface, the first distance conversion coefficient and the second distance conversion coefficient are reciprocal to each other. Among them, the robot starts from the boundary of the lowest end of the working surface along the first preset inclination direction and walks in a straight line to the boundary of the highest end of the working surface, and the time consumed is the upward test time; the robot starts from the boundary of the highest end of the working surface along the second preset inclination direction and walks in a straight line to the boundary of the lowest end of the working surface, and the time consumed is the downward test time.
[0064] In summary, in order to obtain the walking distance correction value that can introduce the influence of gravity and the walking distance difference caused by the forward and reverse rotation of the driving wheel through the first distance conversion coefficient, the reference walking distance value is reduced to compensate for the weakening effect of gravity acceleration on the walking speed output by the motor (the distance calculated by the integral of the PWM value is greater than the actual distance traveled), the currently calculated reference walking distance value is controlled to be multiplied by the first distance conversion coefficient whose value is less than 1, and the walking distance correction value of the robot is determined to form a standard distance information that introduces the influence of gravity and the walking distance difference caused by the forward and reverse rotation of the driving wheel, so as to restore the relative distance information that the robot actually walked on the working surface to a certain extent.
[0065] In order to weaken the acceleration effect of the robot's gravity on the robot's walking downward on the working surface and the influence of the walking distance difference caused by the different rotation directions of the driving wheels, the currently calculated reference walking distance value is controlled to be multiplied by the second distance conversion coefficient whose value is less than 1, and the robot's walking distance correction value is determined, so as to convert the reference walking distance value obtained by the robot's integration processing in the second pre-tilted direction into the distance reached by the robot when walking upward on the working surface relative to the horizontal plane in the same time, and convert it into a standard distance information for comparing the distance walked by the robot in the first preset tilted direction.
[0066] In order to weaken the hindering effect of the robot's gravity on the robot's upward walking on the working surface and the influence of the difference in walking distance caused by the different rotation directions of the driving wheels, the currently calculated reference walking distance value is controlled to be multiplied by the first distance conversion coefficient whose value is greater than 1, and the robot's walking distance correction value is determined, so as to convert the reference walking distance value integrated by the robot in the first pre-tilted direction into the distance reached by the robot when walking downward on the working surface relative to the horizontal plane in the same time, and convert it into a standard distance information for comparing the distance walked by the robot in the second preset inclined direction.
[0067] In order to obtain a walking distance correction value that can introduce the influence of gravity and the walking distance difference caused by the forward and reverse rotation of the driving wheel through the second distance conversion coefficient, the reference walking distance value is increased to compensate for the acceleration effect of gravity acceleration on the walking speed output by the motor (the distance calculated by the integral of the PWM value is greater than the actual distance traveled), the currently calculated reference walking distance value is controlled to be multiplied by the second distance conversion coefficient whose value is greater than 1, and the walking distance correction value of the robot is determined to form a standard distance information that introduces the influence of gravity and the walking distance difference caused by the forward and reverse rotation of the driving wheel, and to a certain extent, it can restore the relative distance information that the robot actually walked downward on the working surface.
[0068] Therefore, a matching distance conversion coefficient is applied to the reference walking distance value of the robot; if the robot walks upward along a vertically set working surface or walks upward along an inclined working surface, the currently calculated reference walking distance value is controlled to be multiplied by the first distance conversion coefficient to determine the walking distance correction value of the robot and obtain a standard distance information; or, if the robot walks downward along a vertically set working surface or walks downward along an inclined working surface, the currently calculated reference walking distance value is controlled to be multiplied by the second distance conversion coefficient to determine the walking distance correction value of the robot and obtain a standard distance information. The influence of the robot's gravity on the robot's walking on the current walking surface and the speed difference caused by the different rotation directions of the robot's driving wheels can be overcome, and the downward walking distance information can be used to represent the correction value of the upward walking distance, so as to suppress the influence of gravity and the difference caused by the forward and reverse rotation of the driving wheel for the robot's path planning in the vertical upward direction or the inclined upward direction; the upward walking distance can also be used to represent the correction value of the downward walking distance, so as to suppress the influence of gravity and the difference caused by the forward and reverse rotation of the driving wheel for the robot's path planning in the vertical downward direction or the inclined downward direction.
[0069] As an embodiment, the method of applying a corresponding distance conversion coefficient to a reference walking distance value of the robot in combination with the relationship between the walking direction of the robot and the gravity direction to calculate a walking distance correction value of the robot further includes:
[0070] When the walking direction of the robot is perpendicular to the direction of gravity, if the walking direction of the robot is a first preset horizontal direction perpendicular to the direction of gravity, it is determined that the robot walks along the first preset horizontal direction on the working surface, and the robot does not do work on gravity during the walking process, and gravity does not do work on the robot, then the currently calculated reference walking distance value is controlled to be multiplied by the third distance conversion coefficient, and then the product of the reference walking distance value and the third distance conversion coefficient is marked as the walking distance correction value of the robot, and the walking distance correction value of the robot is determined, which can reflect the distance traveled by the current position of the robot relative to a preset starting point position of the working surface. When the walking direction of the robot is perpendicular to the direction of gravity, if the walking direction of the robot is a second preset horizontal direction perpendicular to the direction of gravity, then the currently calculated reference walking distance value is controlled to be multiplied by the fourth distance conversion coefficient, and then the product of the reference walking distance value and the fourth distance conversion coefficient is marked as the walking distance correction value of the robot, which can reflect the distance traveled by the current position of the robot relative to a preset starting point position of the working surface; wherein, the starting point position for entering the walking state is the preset starting point position. Since the robot does not do work on gravity and gravity does not do work on the robot, the difference in current characteristics generated by the forward and reverse rotation of the drive wheel motor becomes an influencing factor for the difference in the currently calculated reference walking distance value in different walking directions in the same walking area; therefore, the speed difference caused by the different rotation directions of the robot's drive wheels is overcome by setting a distance conversion coefficient that is multiplied by the reference walking distance value.
[0071] In this embodiment, when the working surface is arranged parallel to the horizontal plane, the angle formed by the second preset horizontal direction and the first preset horizontal direction on the working surface is greater than 90 degrees, and the second preset horizontal direction and the first preset horizontal direction point to the two sides of the robot respectively; when the working surface is not arranged parallel to the horizontal plane, the angle formed by the second preset horizontal direction and the first preset horizontal direction on the working surface is 180 degrees. Preferably, the working surface can be arranged obliquely with the horizontal plane, can be arranged vertically on the horizontal plane, or can be on the horizontal ground; the working surface includes but is not limited to an inclined glass plate, a wall perpendicular to the horizontal ground, and a horizontal floor. The gravity direction of the robot is vertically downward, and is kept perpendicular to the horizontal plane, which is the direction information obtained in advance. The walking direction of the robot is obtained by solving the angle measured by the gyroscope according to the above embodiment, and determining the posture relationship between the walking direction of the robot and the gravity direction, including the angle relationship between the walking direction of the robot and the gravity direction.
[0072] Specifically, when the robot walks in the horizontal direction along a vertically arranged working surface, or walks in the horizontal direction along an inclined working surface, or walks along a working surface arranged parallel to the horizontal surface, the first preset horizontal direction points to one side of the working surface, and the second preset horizontal direction points to the other side of the working surface. On the same working surface, the third distance conversion coefficient and the fourth distance conversion coefficient are reciprocals of each other. When the first preset horizontal direction and the second preset horizontal direction are symmetrical, the first preset horizontal direction and the second preset horizontal direction point to opposite directions respectively, and are for the same horizontal plane. For example, when the first preset horizontal direction is set to point to the right side of the working surface, the second preset horizontal direction is set to point to the left side of the working surface.
[0073] In order to obtain the third distance conversion coefficient and the fourth distance conversion coefficient, the calculation method in this embodiment is that the time taken for the robot to walk along the first preset horizontal direction over the second preset reference distance is marked as the first test time, and the time taken for the robot to walk along the second preset horizontal direction over the second preset reference distance is marked as the second test time; then the robot sets the ratio of the first test time to the second test time as the third distance conversion coefficient; or the robot sets the ratio of the second test time to the first test time as the third distance conversion coefficient, wherein, on the same working surface, the third distance conversion coefficient and the fourth distance conversion coefficient are reciprocals of each other. Preferably, the robot is on a work surface with a boundary, and the robot is controlled to record the walking time of the robot from a preset starting position. The robot walks to the left to the leftmost boundary, and then walks in a straight line from the leftmost boundary of the work surface to the rightmost boundary of the same work surface. The time taken by the robot to walk in a straight line from the leftmost boundary of the work surface to the rightmost boundary of the same work surface is recorded as the first test time; then, the time taken by the robot to walk in a straight line from the rightmost boundary of the work surface to the leftmost boundary of the same work surface is recorded as the second test time; wherein, the distance walked in a straight line between the leftmost boundary and the rightmost boundary of the same work surface by the robot is fixed, and the distance between the leftmost boundary and the rightmost boundary of the same work surface is represented by a second preset reference distance value, and the reference walking distance value, the second preset reference distance value and the walking distance correction value disclosed in the present application all use the same dimension, which can specifically be the dimension of the integral result of the PWM value over time; of course, the relative position between the leftmost boundary and the rightmost boundary of the same work surface is also fixed.
[0074] As a fifth conversion embodiment, under the premise that the robot sets the ratio of the second test time to the first test time as the third distance conversion coefficient, when the robot walks along the first preset horizontal direction on the working surface, gravity neither accelerates nor hinders the robot. Due to the different current characteristics generated by the forward and reverse rotation of the motor of the driving wheel and the different torques required for the forward and reverse rotation of the driving wheel, the time consumed by the driving wheel of the robot to rotate forward and reverse over the same distance is different, so the third distance conversion coefficient is not equal to the value 1, then the walking distance correction value of the robot calculated in step S2 is not equal to the reference walking distance value, the walking distance correction value of the robot calculated in step S2 is equivalent to the robot using the walking speed corresponding to its walking along the first preset horizontal direction on the working surface to walk along the second preset horizontal direction on the working surface for the same time, this same time is the time consumed by the robot to walk from the preset starting position to the current position along the first preset horizontal direction on the working surface, the driving wheel steering required for the robot to walk along the first preset horizontal direction and the driving wheel steering required for the robot to walk along the second preset horizontal direction may be opposite, and the walking speeds formed in each walking direction under the control of the same first PWM value may be different. Therefore, the third distance conversion coefficient is introduced to convert the reference walking distance calculated in step S2 into a new walking direction, thereby overcoming the walking distance difference caused by the forward and reverse rotation of the driving wheel, so that the walking distance correction value of the robot calculated in step S2 can better reflect the distance the robot has walked relative to the preset starting position than the reference walking distance value obtained by integrating the first PWM value alone (affected by the torque applied to the driving wheel).
[0075] As the sixth conversion embodiment, under the premise that the robot sets the ratio of the second test time to the first test time as the fourth distance conversion coefficient, when the robot walks along the second preset horizontal direction on the working surface, the walking distance correction value of the robot calculated in step S2 realizes the conversion of the reference walking distance value of the robot into the distance reached by the robot walking on the working surface along the first preset horizontal direction for the same time. This same time is the time taken for the robot to walk from the preset starting position to the current position on the working surface along the second preset horizontal direction. Due to the different current characteristics generated by the forward and reverse rotation of the motor of the driving wheel and the different torque required for the forward and reverse rotation of the driving wheel, the robot The time consumed by the driving wheel to rotate forward and reverse for the same distance is different, so the fourth distance conversion coefficient is not equal to the value 1, and the walking distance correction value of the robot calculated in step S2 is not equal to the reference walking distance value. Therefore, the setting of the second distance conversion coefficient disclosed in this embodiment is convenient for comparing the walking distance correction value of the robot with the reference walking distance value calculated by step S1 when the robot actually walks upward on the working surface relative to the horizontal plane, forming a comparison distance standard in the same walking direction, so as to convert it into the first preset horizontal direction to identify the distance traveled by the robot, thereby weakening the influence of the walking distance difference caused by the forward and reverse rotation of the driving wheel.
[0076] As the seventh conversion embodiment, under the premise that the robot sets the ratio of the first test time to the second test time as the fourth distance conversion coefficient, when the robot walks along the second preset horizontal direction on the working surface, gravity neither accelerates nor hinders the robot. Due to the different current characteristics generated by the forward and reverse rotation of the motor of the driving wheel and the different torques required for the forward and reverse rotation of the driving wheel, the time consumed by the robot's driving wheel to rotate forward and reverse over the same distance is different, so the third distance conversion coefficient is not equal to the value 1, then the walking distance correction value of the robot calculated in step S2 is not equal to the reference walking distance value, the walking distance correction value of the robot calculated in step S2 is equivalent to the robot using the walking speed corresponding to its walking along the second preset horizontal direction on the working surface to walk along the first preset horizontal direction on the working surface for the same time, this same time is the time consumed by the robot to walk from the preset starting position to the current position along the second preset horizontal direction on the working surface, the driving wheel steering required for the robot to walk along the second preset horizontal direction may be opposite to the driving wheel steering required for the robot to walk along the first preset horizontal direction, and the walking speeds formed in each walking direction under the control of the same first PWM value may be different. Therefore, the fourth distance conversion coefficient is introduced to convert the reference walking distance calculated in step S2 into a new walking direction, thereby overcoming the walking distance difference caused by the forward and reverse rotation of the driving wheel, so that the walking distance correction value of the robot calculated in step S2 can better reflect the distance the robot has walked relative to the preset starting position than the reference walking distance value obtained by integrating the first PWM value alone (affected by the torque applied to the driving wheel).
[0077] As conversion embodiment eight, under the premise that the robot sets the ratio of the first test time to the second test time as the third distance conversion coefficient, when the robot walks along the first preset horizontal direction on the working surface, the walking distance correction value of the robot calculated in step S2 is used to convert the reference walking distance value of the robot into the distance reached by the robot walking on the working surface along the second preset horizontal direction in the same time. This same time is the time taken for the robot to walk from the preset starting position to the current position on the working surface along the first preset horizontal direction. Due to the different current characteristics generated by the forward and reverse rotation of the motor of the driving wheel and the different torques required for the forward and reverse rotation of the driving wheel, the driving characteristics of the robot are different. The time consumed by the driving wheel to rotate forward and reverse over the same distance is different, so the third distance conversion coefficient is not equal to the value 1, and the walking distance correction value of the robot calculated in step S2 is not equal to the reference walking distance value. Therefore, the setting of the first distance conversion coefficient disclosed in this embodiment facilitates the robot's walking distance correction value to be directly compared with the reference walking distance value calculated by step S1 during the robot's actual walking along the second preset horizontal direction on the working surface, forming a comparison distance standard in the same walking direction to convert it into the second preset horizontal direction to identify the distance traveled by the robot, thereby weakening the influence of the walking distance difference caused by the forward and reverse rotation of the driving wheel.
[0078] In the above-mentioned embodiment, for the difference in walking distance caused by the forward and reverse rotation of the driving wheel, preferably, when the robot walks along the first preset horizontal direction on the working surface, the driving wheel is forward; when the robot walks along the second preset horizontal direction on the working surface, the driving wheel may be reversed; because the torque required for the forward and reverse rotation of the driving wheel is different and the corresponding current output of the driving motor is different, the real-time rotation speed generated by the forward and reverse rotation is also different, causing the robot to walk along the first preset horizontal direction on the working surface for a fixed time. The distance traversed by the robot walking along the second preset horizontal direction on the working surface for the same time is different, resulting in a difference in walking distance caused by the forward and reverse rotation of the driving wheel. The present application applies a matching distance conversion coefficient to the reference walking distance value of the robot, and the disclosed third distance conversion coefficient is used to overcome the speed difference caused by the different rotation directions of the driving wheel of the robot; the fourth distance conversion coefficient is used to overcome the speed difference caused by the different rotation directions of the driving wheel of the robot; wherein, the third distance conversion coefficient and the fourth distance conversion coefficient do not change due to the change of the medium of the working surface contacted by the same type of robot; the third distance conversion coefficient and the fourth distance conversion coefficient both change with the change of the type of robot.
[0079] In summary, if the robot walks in a horizontal direction along a vertically set working surface, or walks in a horizontal direction along an inclined working surface, or walks along a working surface set parallel to the horizontal plane, the currently calculated reference walking distance value is controlled to be multiplied by the corresponding distance conversion coefficient to determine the robot's walking distance correction value; since the robot does not do work on gravity, and gravity does not do work on the robot, the difference in current characteristics generated by the forward and reverse rotation of the driving wheel motor becomes a factor affecting the difference in the reference walking distance values calculated in different walking directions. Therefore, the reference walking distance value of the robot is converted into a standard distance information by setting a distance conversion coefficient that is multiplied by the reference walking distance value, thereby overcoming the speed difference caused by the different rotation directions of the robot's driving wheels.
[0080] In some embodiments, regardless of whether the walking direction of the robot is perpendicular to the direction of gravity, if the working surface is parallel to the direction of gravity, the robot needs to be configured to be adsorbed on the working surface, wherein the working surface can be the surface of a wall or a glass window, and the robot needs to be adsorbed on this type of working surface first, and then walk along a predetermined direction on this type of working surface, such as a window cleaning robot; when the robot walks on the working surface, the driving wheels of the robot are allowed to rotate forward or reverse on the working surface to adapt to the change of the walking direction of the robot on the working surface. In addition, regardless of whether the walking direction of the robot is perpendicular to the direction of gravity, if the working surface is perpendicular to the direction of gravity, the working surface is regarded as a horizontal surface, such as a horizontal ground, and the working surface abuts the driving wheels of the robot, so the robot does not need to be configured to be adsorbed on the working surface, and when the robot walks on the working surface, the driving wheels of the robot are allowed to rotate forward or reverse on the working surface to adapt to the change of the walking direction of the robot on the working surface.
[0081] Preferably, in addition to the effect of gravity, when the robot is walking on the working surface, the driving wheels of the robot are in contact with the working surface so that the robot bears the friction from the working surface; when the robot walks upward or downward relative to the horizontal plane on the working surface, the friction borne by the robot is a relatively small external resistance relative to the robot's own gravity, and even does not occupy a dominant factor in affecting the robot's walking speed. Among them, when the medium of the working surface contacted by the robot changes, the friction borne by the robot on the working surface changes accordingly, but it does not affect the same type of robot to execute the aforementioned robot detection walking distance method to obtain the robot's walking distance correction value.
[0082] As an embodiment, the method for closed-loop regulating the PWM value for controlling the drive motor includes:
[0083] When the absolute value of the angle difference between the heading angle measured in real time by the robot and the target navigation angle in the current adjustment cycle is not within the preset angle error range, the robot performs PID adjustment on the PWM value used to control the drive motor for the drive motor connected to the drive wheel installed on each side of the robot. In the process of performing PID adjustment on the PWM value used to control the drive motor, the difference between the PWM value used to control the drive motor and the first preset target PWM value in the current adjustment cycle is used as the feedback input of the next adjustment cycle to reduce the difference between the PWM value used to control the drive motor and the first preset target PWM value, and the PWM value used to control the drive motor is set to the first PWM value, and the first PWM value is input into the drive motor on the corresponding side in real time to obtain the drive wheel current sampling value output by the drive motor on this side, wherein after the robot enters the walking state, the real-time The rotation speed is proportional to the first PWM value; for the driving motors connected to the driving wheels installed on each side of the robot, when the PWM value used to control the driving motors on the corresponding side and the first preset target PWM value are less than the corresponding preset driving wheel steady-state error, the robot adjusts the walking direction based on the difference in real-time rotation speeds of the driving motors on both sides to guide the absolute value of the angular difference between the robot's heading angle and the target navigation angle to be within the preset angular error range; wherein the absolute value of the angular difference between the robot's heading angle and the target navigation angle is positively correlated with the absolute value of the real-time rotation speed difference between the driving motors connected to the driving wheels installed on both sides of the robot; wherein the robot's heading angle is measured in real time by the robot's built-in gyroscope; the driving wheels installed on both sides of the robot are each connected to a driving motor; the target navigation angle is pre-planned by the robot to guide the robot to walk along a pre-planned working path.
[0084] Specifically, the robot can adjust the PWM value used to control the drive motor through the angle closed-loop feedback adjustment device, and input the first PWM value adjusted in real time into the drive motor. The drive motor will change the output speed, and then use the heading angle of the robot corresponding to the changed speed as the feedback input of the angle closed-loop feedback adjustment device to maintain the closed-loop adjustment, and also indirectly adjust the heading angle measured by the robot in real time in a closed-loop manner, wherein the closed-loop adjustment has a corresponding adjustment cycle. Therefore, the method for closed-loop regulation of the PWM value used to control the drive motor includes: when the absolute value of the angle difference between the heading angle measured in real time by the robot and the target navigation angle in the current adjustment cycle is not within the preset angle error range, the robot uses the absolute value of the angle difference between the heading angle measured in real time and the target navigation angle in the current adjustment cycle or the robot configures the heading angle measured in real time as the feedback input of the next adjustment cycle of the angle closed-loop feedback regulation device to perform PID regulation on the PWM value used to control the drive motor. In this embodiment, the closed-loop regulation is set to PID regulation; and the real-time feedback regulation result of the PWM value used to control the drive motor is set to the first PWM value, then a first PWM value will be regulated in each adjustment cycle and acquired in real time by the outside; and the first PWM value is input into the drive motor to adjust the heading angle of the robot in real time until the heading angle measured in real time by the robot is consistent with the target The absolute value of the angle difference of the navigation angle changes within a preset angle error range or remains constant within the preset angle error range, and the most recently obtained first PWM value is input into the drive motor, and the closed-loop adjustment of the heading angle measured in real time by the robot is promoted by PID adjustment of the first PWM value to approach the target navigation angle, and guide the robot to walk in the direction corresponding to the target navigation angle; wherein, the target navigation angle is pre-planned by the robot to guide the robot to walk along a pre-planned working path, and the target navigation angle is allowed to be modified. When the target navigation angle is modified too much or the robot stops and then restarts walking, it is necessary to re-execute steps S1 and S2. Generally, in the scenario of colliding with an obstacle, the robot stops or turns around first, and then it is necessary to re-execute steps S1 and S2 to recalculate the current relative walking resistance current value; the heading angle of the robot is measured in real time by the robot's built-in gyroscope.
[0085] The angle closed-loop feedback regulating device can be divided into a first angle closed-loop feedback regulating device and a second angle closed-loop feedback regulating device. The first angle closed-loop feedback regulating device is used to perform PID regulation on the PWM value of the left drive motor, and the second angle closed-loop feedback regulating device is used to perform PID regulation on the PWM value of the right drive motor. The first angle closed-loop feedback regulating device and the second angle closed-loop feedback regulating device can be composed of PID controllers.
[0086] The method for closed-loop regulation of the PWM value for controlling the drive motor includes: when the absolute value of the angle difference between the heading angle measured in real time by the robot and the target navigation angle in the current regulation cycle is not within the preset angle error range, the robot controls the first angle closed-loop feedback regulation device to perform PID regulation on the PWM value for controlling the left drive motor; in the process of PID regulation of the PWM value for controlling the left drive motor, the first angle closed-loop feedback regulation device outputs the latest PWM value for controlling the left drive motor in the current regulation cycle, and the robot configures the difference between the PWM value for controlling the left drive motor and the preset left target PWM value in the current regulation cycle as the feedback input of the next regulation cycle of the first angle closed-loop feedback regulation device to reduce the difference between the PWM value for controlling the left drive motor and the preset left target PWM value, and as time increases, the difference becomes smaller until it is equal to zero, so that the first angle closed-loop feedback regulation device can enter a steady state, and the heading angle measured in real time by the robot is relatively close to the target navigation angle. The first angle closed-loop feedback regulation device is a closed-loop control system with a negative feedback regulation function. The robot will set the most recently adjusted PWM value for controlling the left drive motor as the first PWM value, and then input the first PWM value into the left drive motor in real time to obtain the real-time rotation speed of the left drive motor. The current signal output by the left drive motor can be sampled to feedback the resistance of the left drive wheel on the walking surface; wherein, without considering external resistance (such as friction and collision factors), the real-time rotation speed of the left drive motor is proportional to the first PWM value.
[0087] At the same time, when the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle in the current adjustment cycle is not within the preset angle error range, the robot controls the second angle closed-loop feedback adjustment device to perform PID adjustment on the PWM value used to control the right drive motor; in the process of PID adjustment on the PWM value used to control the left drive motor, the second angle closed-loop feedback adjustment device outputs the latest PWM value used to control the right drive motor in the current adjustment cycle, and the robot configures the difference between the PWM value used to control the right drive motor and the preset right target PWM value in the current adjustment cycle as the feedback input of the next adjustment cycle to reduce the difference between the PWM value used to control the right drive motor and the preset right target PWM value. As time goes by, the difference becomes smaller until it is equal to zero, which can make the second angle closed-loop feedback adjustment device enter a steady state, and the heading angle measured by the robot in real time is relatively close to the target navigation angle. The second angle closed-loop feedback adjustment device is a closed-loop control system with a negative feedback adjustment function. The robot will set the most recently adjusted PWM value for controlling the right drive motor as the first and second PWM values, and then input the first and second PWM values into the right drive motor to obtain the real-time rotation speed of the right drive motor. The current signal output by the right drive motor can be sampled to feedback the resistance of the right drive wheel on the walking surface; wherein, without considering external resistance (such as friction and collision factors), the real-time rotation speed of the right drive motor is proportional to the first and second PWM values.
[0088] When the difference between the PWM value used to control the left drive motor and the preset left target PWM value is less than the first preset drive wheel steady-state error, and the difference between the PWM value used to control the right drive motor and the preset right target PWM value is less than the second preset drive wheel steady-state error, the robot adjusts the walking direction based on the difference between the real-time rotational speed of the left drive motor and the real-time rotational speed of the right drive motor, and the adjustment angle is determined by the difference between the real-time rotational speed of the left drive wheel and the real-time rotational speed of the right drive wheel. After adjusting the direction, the heading angle measured in real time by the robot is configured as the feedback input of the angle closed-loop feedback adjustment device (including the first angle closed-loop feedback adjustment device and the second angle closed-loop feedback adjustment device) in the next adjustment cycle, so as to adjust the absolute value of the angle difference between the robot's heading angle and the target navigation angle to change within the preset angle error range or remain constant within the preset angle error range during the aforementioned PID adjustment process. It should be noted that, in the present embodiment, the robot first measures the current heading angle in real time through the gyroscope, the real-time rotation speed of the left driving wheel is proportional to the PWM value used to control the left driving motor and there is a preset conversion relationship, the real-time rotation speed of the right driving wheel is proportional to the PWM value used to control the right driving motor and there is a preset conversion relationship, the radius of the left driving wheel is equal to the radius of the right driving wheel and is symmetrically arranged on the left and right sides of the robot, then the circumference of the left driving wheel is equal to the circumference of the right driving wheel; the robot multiplies the difference between the real-time rotation speed of the left driving wheel and the real-time rotation speed of the right driving wheel by the circumference of the left driving wheel (or the circumference of the right driving wheel), and the result of the multiplication is marked as the walking speed of the left driving wheel The difference between the walking speed of the right driving wheel and the walking speed of the right driving wheel, and then the ratio of the multiplication result and the body width of the robot is set as the angular velocity reached by the robot to adjust the walking direction, and then the product of the angular velocity reached by the robot to adjust the direction and the adjustment time of the walking direction is set as the angle turned by the robot to adjust the walking direction, that is, the adjustment angle. If necessary, the radian unit formed by the calculation can be converted into an angle unit; the adjustment angle gradually approaches or even equals the absolute value of the angle difference between the current heading angle of the robot and the target navigation angle under the adjustment of the angle closed-loop feedback adjustment device, wherein the preset angle error range includes the value 0, and the dimension is the same as the dimension applicable to the angle measured by the gyroscope. Preferably, when the chassis shape of the robot is a disc shape, the body width of the robot is the body diameter of the robot.
[0089] In the above-mentioned embodiment of the closed-loop adjustment of the angle, the first PWM value includes a first PWM value and a first second PWM value; a left drive wheel is installed on the left side of the robot, and the left drive wheel is electrically connected to the left drive motor; a right drive wheel is installed on the right side of the robot, and the right drive wheel is electrically connected to the right drive motor. In the process of closed-loop adjustment, the absolute value of the difference between the real-time rotation speed of the left drive motor and the real-time rotation speed of the right drive motor can be positively correlated with the absolute value of the angle difference between the heading angle and the target navigation angle of the robot, that is, the greater the absolute value of the angle difference between the heading angle and the target navigation angle of the robot, the greater the absolute value of the difference between the real-time rotation speed of the left drive motor and the real-time rotation speed of the right drive motor, and the greater the speed difference between the left and right drive wheels, but the turning direction of the robot formed by the rotation of the left and right drive wheels is opposite to the deviation direction of the robot's walking direction relative to the direction indicated by the target navigation angle, so as to reduce the absolute value of the angle difference between the heading angle and the target navigation angle of the robot, and form a negative feedback adjustment of the angle.
[0090] It should be noted that PID (Proportional Integral Derivative) regulation is a basic control method of the control system in classical control theory. It is a linear regulation law with proportional, integral and differential effects. It is widely used in industrial process control, especially in deterministic control systems that can establish accurate mathematical models. When the structure and parameters of the controlled object cannot be fully mastered, or an accurate mathematical model cannot be obtained, other control theory techniques are difficult to adopt, and the structure and parameters of the system controller must be determined by experience and on-site debugging. At this time, it is most convenient to apply PID regulation technology. That is, when a system and a controlled object are not fully understood, or when the system parameters cannot be obtained through effective measurement methods, PID control technology is most suitable. PID regulation, in practice, also has PI and PD control. PID regulation is to calculate the control quantity based on the error of the system using proportional, integral and differential methods for control. Increasing the proportional coefficient Kp can reduce the static error of the system, but when Kp is too large, the dynamic quality of the system will deteriorate, causing oscillation of the controlled quantity, and even leading to instability of the closed-loop system. A large integral coefficient Ti indicates a weak integral effect, whereas a small integral coefficient Ti indicates a strong integral effect. Increasing Ti will slow down the process of eliminating static errors, but can reduce overshoot and improve stability. As the differential coefficient Td increases, the differential effect is strengthened, which helps reduce overshoot, overcome oscillation, stabilize the system, speed up the system's response, reduce adjustment time, and thus improve the system's dynamic performance.
[0091] Based on the aforementioned embodiments, the present application also discloses a mobile robot, wherein a driving wheel is installed on each of the left and right sides of the mobile robot, and a driving motor electrically connected to the driving wheel is installed inside the mobile robot; the mobile robot is also equipped with a fan for adsorbing the mobile robot on a work surface; a code disc may not be installed in the driving wheel, or a code disc may also be installed in the driving wheel; the mobile robot is configured to execute the method for detecting walking distance of the robot to obtain a walking distance correction value of the robot.
[0092] The mobile robot is an intelligent window cleaning machine. The intelligent window cleaning machine adopts the above-mentioned method of detecting walking distance of the intelligent robot to detect the distance traveled by the robot relative to the starting position of entering the walking state. It can further combine the influence of gravity and the difference caused by the forward and reverse rotation of the driving wheel to complete the distance correction, thereby improving the cleaning quality, walking efficiency and cleaning coverage of the intelligent window cleaning machine. When the mobile robot is a suction cup window cleaning machine, the driving wheels installed on the left and right sides are cleaning turntables, which are used to support the suction cup window cleaning machine to move on the working surface on which it is adsorbed. Each cleaning turntable is connected to a driving motor and receives the first PWM value control obtained in real time in step S1 of the aforementioned embodiment.
[0093] The intelligent window cleaning machine is a circular intelligent window cleaning machine, and the left and right driving wheels are two left and right cleaning turntables. The intelligent window cleaning machine is a square intelligent window cleaning machine, and the left and right driving wheels are two left and right track wheels. The intelligent window cleaning machine mainly includes a circular intelligent window cleaning machine and a square intelligent window cleaning machine. When these two intelligent window cleaning machines start working, they are first attached to the glass, the fan is turned on, and the glass is adsorbed by the suction of the fan. Then the intelligent window cleaning machine sets the PWM value of the fan to facilitate the control of the robot movement.
[0094] In some embodiments, according to Figure 2It can be seen that the intelligent window cleaning machine 1 is a suction cup window cleaning machine, which moves and cleans by rotating the left and right cleaning turntables on the glass. The left cleaning turntable 2 of the intelligent window cleaning machine 1 is set to the dead-locking mode. After the right cleaning turntable 3 is configured to fix the first PWM value, it is close to the glass and rotates clockwise for a fixed time, then stops rotating, and then rotates counterclockwise for a fixed time. When the right cleaning turntable 3 rotates clockwise or counterclockwise, it rotates around the left cleaning turntable 2 with the left cleaning turntable 2 as the center of motion. The right cleaning turntable 3 of the intelligent window cleaning machine 1 is set to the dead-locking mode. After the left cleaning turntable 2 is configured to fix the first PWM value, it is close to the glass and rotates clockwise for a fixed time, then stops rotating, and then rotates counterclockwise for a fixed time. When the left cleaning turntable 2 rotates clockwise or counterclockwise, it rotates around the right cleaning turntable 3 with the right cleaning turntable 3 as the center of motion. Each cleaning turntable of the intelligent window cleaning machine needs to be calibrated before the robot starts to detect the walking distance, or enter the walking state from a stationary state and determine the obstruction of overcoming static friction.
[0095] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0096] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable technicians familiar with the technical field to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting walking distance of a robot, wherein driving wheels are installed on both sides of the robot, and a driving motor electrically connected to the driving wheels is installed inside the robot; the robot is also equipped with a fan for adsorbing the robot on a working surface; the method is characterized in that: The robot detects the walking distance by: After the robot enters the walking state from a stationary state, the robot starts to walk on the working surface and obtains a first PWM value, and then integrates the obtained first PWM value within a preset PWM value range to determine the reference walking distance value of the robot; or, during the robot walking on the working surface, the robot sets the travel distance value measured in real time by the code disk installed on it as the reference walking distance value of the robot; Combined with the relationship between the robot's walking direction and the gravity direction, a matching distance conversion coefficient is applied to the robot's reference walking distance value to calculate the robot's walking distance correction value; The method of applying a corresponding distance conversion coefficient to a reference walking distance value of the robot in combination with the relationship between the walking direction of the robot and the gravity direction to calculate a walking distance correction value of the robot includes: The robot uses a gyroscope to measure the walking direction of the robot on the working surface in real time, and determines the posture relationship between the walking direction of the robot and the direction of gravity; When the walking direction of the robot is not perpendicular to the gravity direction, if the walking direction of the robot is set upward relative to the horizontal plane, it is determined that the robot walks upward relative to the horizontal plane on the working surface, and the currently calculated reference walking distance value is controlled to be multiplied by the first distance conversion coefficient to determine the walking distance correction value of the robot; When the walking direction of the robot is not perpendicular to the gravity direction, if the walking direction of the robot is set downward relative to the horizontal plane, it is determined that the robot walks downward relative to the horizontal plane on the working surface, and the currently calculated reference walking distance value is controlled to be multiplied by the second distance conversion coefficient to determine the walking distance correction value of the robot; Among them, the working surface is not set parallel to the horizontal plane; the direction of gravity is vertically downward; The method of applying a corresponding distance conversion coefficient to a reference walking distance value of the robot in combination with the relationship between the walking direction of the robot and the gravity direction to calculate a walking distance correction value of the robot also includes: When the walking direction of the robot is perpendicular to the gravity direction, if the walking direction of the robot is a first preset horizontal direction perpendicular to the gravity direction, the currently calculated reference walking distance value is controlled to be multiplied by a third distance conversion coefficient to determine a walking distance correction value of the robot; When the walking direction of the robot is perpendicular to the gravity direction, if the walking direction of the robot is a second preset horizontal direction perpendicular to the gravity direction, the currently calculated reference walking distance value is controlled to be multiplied by a fourth distance conversion coefficient to determine a walking distance correction value of the robot; Wherein, the first preset horizontal direction points to one side of the working surface, and the second preset horizontal direction points to the other side of the working surface; If the working surface is parallel to the direction of gravity, the robot is configured to be adsorbed on the working surface, and the driving wheels of the robot are allowed to rotate forward or reverse on the working surface when the robot walks on the working surface; If the working surface is perpendicular to the direction of gravity, the robot is not configured to be adsorbed on the working surface, and the driving wheels of the robot are allowed to rotate forward or reverse on the working surface when the robot walks on the working surface; The robot maintains closed-loop regulation of a PWM value for controlling a driving motor, and obtains a first PWM value during the closed-loop regulation process; When the robot walks upward relative to the horizontal plane on the working surface, the walking direction of the robot is set to the first preset inclined direction; when the robot walks downward relative to the horizontal plane on the working surface, the walking direction of the robot is set to the second preset inclined direction; the first preset inclined direction and the second preset inclined direction are symmetrical; on the same working surface, the first distance conversion coefficient and the second distance conversion coefficient are reciprocal of each other; The time taken by the robot to walk along the first preset inclined direction over the first preset reference distance value is marked as the upward test time, and the time taken by the robot to walk along the second preset inclined direction over the first preset reference distance value is marked as the downward test time; Under the premise that the robot sets the ratio of the downward test time to the upward test time as the first distance conversion coefficient, when the robot walks along the first preset inclined direction on the working surface, the calculated walking distance correction value of the robot is less than the reference walking distance value; Under the premise that the robot sets the ratio of the upward test time to the downward test time as the second distance conversion coefficient, when the robot walks in the second preset inclined direction on the working surface, the calculated walking distance correction value of the robot is greater than the reference walking distance value; The time taken for the robot to walk along the first preset horizontal direction over the second preset reference distance is marked as the first test time, and the time taken for the robot to walk along the second preset horizontal direction over the second preset reference distance is marked as the second test time; The robot sets the ratio of the second test time to the first test time as a third distance conversion coefficient; The first preset horizontal direction and the second preset horizontal direction are symmetrical; wherein, on the same working surface, the third distance conversion coefficient and the fourth distance conversion coefficient are reciprocals of each other.
2. The method for detecting walking distance of a robot according to claim 1, characterized in that: Before the robot starts walking, the first PWM value is loaded to the driving motor to control the driving wheel to rotate to overcome the static friction of the working surface, until the first PWM value is greater than the preset starting threshold, it is determined that the robot enters the walking state from the static state so that the walking speed of the robot is linearly related to the first PWM value obtained in real time, and then the robot starts walking on the working surface to overcome the obstruction of the static friction from the working surface; Among them, the preset starting threshold is a PWM value determined by setting the driving wheel of the robot to enter the walking state on working surfaces with different friction forces; the setting method of the working surface includes vertical setting, horizontal setting or inclined setting.
3. The method for detecting walking distance of a robot according to claim 2, characterized in that: The method for integrating the acquired first PWM value within the preset PWM value range comprises: After the robot enters the walking state, the robot samples the first PWM value within the preset sampling time, then integrates all the first PWM values sampled within the preset sampling time that are greater than the preset starting threshold, and then sets the integration result of the first PWM value as the reference walking distance value of the robot; wherein the preset PWM value range refers to the PWM value range greater than the preset starting threshold; Within the preset sampling time, the walking speed of the robot is proportional to the first PWM value sampled by the robot.
4. The method for detecting walking distance of a robot according to claim 3, characterized in that: Within the preset sampling time, the robot configures its internal timer to trigger an interrupt signal every unit sampling time. Each time the robot detects an interrupt signal, it samples the first PWM value; the first PWM value is used to feed back the walking speed of the robot within each unit sampling time.
5. The method for detecting walking distance of a robot according to claim 1, characterized in that: The first preset reference distance value is used to represent the distance between the uppermost boundary of the working surface and the lowermost boundary of the working surface; The robot starts from the lowermost boundary of the working surface and walks in a straight line to the uppermost boundary of the working surface along the first preset inclined direction, and the time consumed is the upward test time; The robot starts from the uppermost boundary of the working surface and walks in a straight line to the lowermost boundary of the working surface along the second preset inclination direction, and the time consumed is the downward test time.
6. The method for detecting walking distance of a robot according to claim 1, characterized in that: The second preset reference distance value is the distance between the leftmost boundary of the working surface and the rightmost boundary of the working surface; The robot starts from the leftmost boundary of the working surface and walks in a straight line to the rightmost boundary of the working surface along the first preset horizontal direction, and the time consumed is the first test time; The robot starts from the rightmost boundary of the working surface and walks in a straight line to the leftmost boundary of the working surface along the second preset horizontal direction, and the time consumed is the second test time.
7. The method for detecting walking distance of a robot according to claim 1, characterized in that: The method for closed-loop regulation of a PWM value for controlling a drive motor comprises: When the absolute value of the angle difference between the heading angle measured in real time by the robot and the target navigation angle in the current adjustment cycle is not within the preset angle error range, the robot performs PID adjustment on the PWM value used to control the drive motor for the drive motor connected to the drive wheel installed on each side of the robot. In the process of performing PID adjustment on the PWM value used to control the drive motor, the difference between the PWM value used to control the drive motor and the first preset target PWM value in the current adjustment cycle is used as the feedback input of the next adjustment cycle to reduce the difference between the PWM value used to control the drive motor and the first preset target PWM value, and the PWM value used to control the drive motor is set to the first PWM value, and then the first PWM value is input into the drive motor on the corresponding side in real time to obtain the drive wheel current sampling value output by the drive motor on this side, wherein after the robot enters the walking state, the real-time rotation speed of the drive motor is proportional to the first PWM value; For the driving motors connected to the driving wheels installed on each side of the robot, when the PWM value used to control the driving motors on the corresponding side and the first preset target PWM value are less than the corresponding preset driving wheel steady-state error, the robot adjusts the walking direction based on the difference in real-time rotation speeds of the driving motors on both sides, so as to guide the absolute value of the angular difference between the heading angle of the robot and the target navigation angle to be within the preset angular error range; wherein the absolute value of the angular difference between the heading angle of the robot and the target navigation angle is positively correlated with the absolute value of the real-time rotation speed difference between the driving motors connected to the driving wheels installed on both sides of the robot; Among them, the robot's heading angle is measured in real time by the robot's built-in gyroscope; the driving wheels installed on both sides of the robot are each connected to a driving motor; the target navigation angle is planned in advance by the robot to guide the robot to walk along the pre-planned work path.
8. A mobile robot, wherein a driving wheel is installed on each of the left and right sides of the mobile robot, and a driving motor electrically connected to the driving wheel is installed inside the mobile robot; the mobile robot is also equipped with a fan for adsorbing the mobile robot on a working surface; characterized in that: The mobile robot is configured to execute the method for detecting walking distance by a robot as described in any one of claims 1 to 7.
9. The mobile robot according to claim 8, characterized in that: When the mobile robot is a suction cup window cleaning machine, the driving wheels installed on the left and right sides are cleaning turntables, which are used to support the suction cup window cleaning machine to move on the working surface it is adsorbed on.
Citation Information
Patent Citations
Methods for adjusting fan suction in extreme situations
CN111852925B
Method for correcting odometer error of suspended back wheel in downhill by inertial sensor and pressure sensor
CN107063305A
Robot mileage positioning method and device, terminal device and computer storage medium
CN109866217A