Robot collision detection method based on relative walking resistance current value
By adjusting the PWM values of the drive motor and fan in a closed loop, and calculating the relative walking resistance current value of the cleaning robot, the problem of the driving wheel walking resistance feedback information being disturbed by torque and suction is solved, and more accurate obstacle detection and path planning are achieved.
Patent Information
- Application Number
- CN202211344135.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-10-31
AI Technical Summary
When the cleaning robot detects collision with an obstacle, the driving wheel walking resistance feedback information is easily disturbed by changes in the output torque of the drive motor and the fan suction force, resulting in a decrease in detection accuracy.
By adjusting the PWM values of the drive motor and fan in a closed loop, sampling the drive wheel current signal, and the relative walking resistance current value of the computer robot, and comparing it with the preset collision current threshold to detect obstacle collision.
It improves the accuracy of collision detection of cleaning robots on the same medium walking surface, reduces the interference of changes in driving motors and fans on detection, and can avoid obstacles and adapt to complex environments.
Smart Images

Figure CN115648287B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of mobile robots, and particularly to a robot collision detection method based on relative walking resistance current values. Background Art
[0002] Cleaning robots that use inertial sensors for navigation include floor-sweeping robots, window-cleaning robots, floor-washing robots, etc. If the fan suction of a window-cleaning robot is very large and the adsorption force on the glass surface is strong, the driving wheels and cleaning cloth of the window-cleaning robot will bear too much walking resistance, resulting in the inability of the window-cleaning robot to move; when the vacuum cleaner of a floor-sweeping robot is close to the ground and has a large suction force, the walking resistance borne by the driving wheels of the floor-sweeping robot may increase, resulting in the driving wheels being unable to move; the current feedback information of the walking resistance of the driving wheels (friction force from the ground) of these two types of cleaning robots is easily interfered by the current change values caused by the change of the output torque (or torsion, related to the rotation speed, power, and duty cycle of the PWM signal) of the driving motor inside the body and the suction force generated by the fan. Then, the current feedback information sampled for the walking resistance of the driving wheels (friction force from the ground) cannot represent the resistance information of the external environment of the body, thus reducing the accuracy of the cleaning robot using the current feedback information output by the motor to detect collisions with obstacles on the walking surface and affecting the motion planning of the robot. Summary of the Invention
[0003] This application discloses a robot collision detection method based on relative walking resistance current values. The specific technical solutions include:
[0004] For a robot collision detection method based on relative walking resistance current values, 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 generating suction force on the walking surface of the robot. The robot collision detection method includes: the robot performs closed-loop regulation on the PWM value for controlling the driving motor and determines the first PWM value obtained during the closed-loop regulation process; the robot performs closed-loop regulation on the PWM value acting on the fan and determines the second PWM value obtained during the closed-loop regulation process; after transmitting the first PWM value to the driving motor, the robot samples the current signal output by the driving motor to obtain the driving wheel current sampling value; based on the driving wheel current sampling value, the first PWM value, and the second PWM value, calculates the current relative walking resistance current value of the robot, and then detects whether the robot currently collides based on the relationship between the current relative walking resistance current value of the robot and a preset collision current threshold.
[0005] Further, the method for detecting whether a robot currently collides based on the relationship between the current relative walking resistance current value of the robot and a preset collision current threshold includes: when the current relative walking resistance current value of the robot is greater than the preset collision current threshold, the robot currently collides with an obstacle on the walking surface; when the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, the robot currently does not collide with an obstacle; wherein, the preset collision current threshold is applicable to detecting collisions with obstacles on the walking surfaces of different media by robots of the same type.
[0006] Further, when the current relative walking resistance current value of the robot is greater than the preset collision current threshold, the obstacle with which the robot collides is on the walking surface of the same media, and then the robot changes its current walking direction to avoid knocking open the obstacle or walking to the walking surface of other media.
[0007] Further, the current relative walking resistance current value of the robot is the difference between the current walking resistance current value calculated by the robot after a preset sampling time and the reference walking resistance current value calculated within the preset sampling time; within the preset sampling time, the robot has started walking and is not in a stationary state.
[0008] Further, after the robot starts walking on the walking surface, within the preset sampling time, the reference power change value corresponding to the driving wheel current sampling value is sequentially subtracted by the reference power change value corresponding to the first PWM value and the reference power change value corresponding to the second PWM value to determine the reference walking resistance current value calculated within the preset sampling time; wherein, within the preset sampling time, the rotation speed of the driving motor is linearly related to the first PWM value used to control the driving motor; after the robot has walked through the preset sampling time, the driving wheel current sampling value is sequentially subtracted by the power change value caused by the first PWM value and the power change value caused by the second PWM value to determine the current walking resistance current value calculated by the robot after the preset sampling time.
[0009] Further, the method for calculating the current relative walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value includes: The robot starts from a stationary state until it begins to walk to overcome the static friction. Then, within a preset sampling time, the robot calculates a first reference PWM value based on all the obtained first PWM values, calculates a second reference PWM value based on all the obtained second PWM values, and calculates a driving wheel reference current value based on all the obtained driving wheel current sampling values. Then, the product of the first reference PWM value and the first conversion coefficient is marked as the reference power change value corresponding to the first PWM value, the product of the second reference PWM value and the second conversion coefficient is marked as the reference power change value corresponding to the second PWM value, and the driving wheel reference current value is marked as the reference power change value corresponding to the driving wheel current sampling value. Then, control the reference power change value corresponding to the currently marked driving wheel current sampling value to subtract the reference power change value corresponding to the currently marked first PWM value and the reference power change value corresponding to the currently marked second PWM value in sequence, and then set the result of the subtraction as the reference walking resistance current value calculated within the preset sampling time. After the preset sampling time, the robot marks the first PWM value obtained in real time as the first PWM value to be measured, and marks the second PWM value obtained in real time as the second PWM value to be measured. Then, the product of the first PWM value to be measured and the first conversion coefficient is marked as the power change value caused by the first PWM value, and the product of the second PWM value to be measured and the second conversion coefficient is marked as the power change value caused by the second PWM value. Then, control the driving wheel current sampling value obtained in real time to subtract the power change value caused by the currently marked first PWM value and the power change value caused by the currently marked second PWM value in sequence, and then set the result of the subtraction as the current walking resistance current value calculated after the preset sampling time. Then, control the current walking resistance current value calculated after the preset sampling time to subtract the reference walking resistance current value calculated within the preset sampling time, and then set the result of the subtraction as the current relative walking resistance current value of the robot to reflect the external resistance difference borne by the robot between the walking surfaces walked outside within the preset sampling time.
[0010] Further, the method for calculating the current relative walking resistance current value of the robot based on the drive wheel current sampling value, the first PWM value, and the second PWM value includes: The robot starts from a stationary state until it begins to walk to overcome the static friction force. Then, within a preset sampling time, the robot calculates a first reference PWM value based on all the obtained first PWM values, calculates a second reference PWM value based on all the obtained second PWM values, and calculates a drive wheel reference current value based on all the obtained drive wheel current sampling values. Among them, within the preset sampling time, the rotation speed of the drive motor is linearly related to the first PWM value used to control the drive motor. After the preset sampling time, the robot marks the real-time obtained first PWM value as the first PWM value to be measured, marks the real-time obtained second PWM value as the second PWM value to be measured, marks the difference between the real-time obtained drive wheel current sampling value and the drive wheel reference current value as the relative power change value of the drive wheel current sampling value, marks the product of the difference between the first PWM value to be measured and the first reference PWM value and the first conversion coefficient as the relative power change value corresponding to the first PWM value, and marks the product of the difference between the second PWM value to be measured and the second reference PWM value and the second conversion coefficient as the relative power change value corresponding to the second PWM value. Then, control the relative power change value of the drive wheel current sampling value to subtract the relative power change value corresponding to the first PWM value to obtain a first difference. Then subtract the relative power change value corresponding to the second PWM value from the first difference to obtain a second difference. Then mark the second difference as the current relative walking resistance current value of the robot.
[0011] Further, within the preset sampling time, the method for calculating the first reference PWM value based on all the obtained first PWM values includes: taking the average of all the obtained first PWM values within the preset sampling time to obtain the first reference PWM value; or, screening out the first PWM value with the largest value from all the obtained first PWM values within the preset sampling time to determine the first reference PWM value; within the preset sampling time, the method for calculating the second reference PWM value based on all the obtained second PWM values includes: taking the average of all the obtained second PWM values within the preset sampling time to obtain the second reference PWM value; or, screening out the second PWM value with the largest value from all the obtained second PWM values within the preset sampling time to determine the second reference PWM value; within the preset sampling time, the method for calculating the drive wheel reference current value based on all the obtained drive wheel current sampling values includes: taking the average of all the obtained drive wheel current sampling values within the preset sampling time to obtain the drive wheel reference current value; or, screening out the drive wheel current sampling value with the largest value from all the obtained drive wheel current sampling values within the preset sampling time to determine the drive wheel reference current value; wherein, the first PWM value is used to control the change of the output torque of the drive motor to feedback and form one of the power change values in the drive wheel current sampling values; the second PWM value is used to control the change of the air suction of the fan to feedback and form the other power change value in the drive wheel current sampling values.
[0012] Further, if the calculated current relative walking resistance current value of the robot is larger, it is determined that the static friction force borne by the obstacle collided by the robot on the walking surface is larger; the static friction force borne by the obstacle changes with the change of the medium of the walking surface where it is located; on the premise that the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, during the walking process of the robot, when the calculated current relative walking resistance current value changes, the type of the medium of the walking surface contacted by the robot changes.
[0013] Further, when the medium of the walking surface traversed by the robot within the preset sampling time is the same as the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the walking surface contacted at the preset starting position; wherein, the robot keeps walking on the walking surface of the same medium within the preset sampling time; or, when the medium of the walking surface traversed by the robot within the preset sampling time is different from the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the robot on the walking surface traversed within the preset sampling time; wherein, the preset starting position is the starting position where the robot starts to walk after starting from rest, so that the robot walks straight from the preset starting position.
[0014] Further, the method for performing closed-loop regulation on the PWM value for controlling the drive motor includes: 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 period is not within the preset angle error range, for the drive motor correspondingly connected to the drive wheel installed on each side of the robot, the robot performs PID regulation on the PWM value for controlling the drive motor. During the process of performing PID regulation on 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 period is used as the feedback input for the next adjustment period 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 as the first PWM value. Then, the first PWM value is input into the corresponding side drive motor in real time to obtain the drive wheel current sampling value output by the drive motor on that side. Among them, the real-time rotation speed of the drive motor is positively correlated with the first PWM value; for the drive motor correspondingly connected to the drive wheel installed on each side of the robot, when the difference between the PWM value for controlling the drive motor on the corresponding side and the first preset target PWM value is less than the preset drive wheel steady-state error, the robot adjusts the walking direction based on the difference between the real-time rotation speeds of the drive motors on the left and right sides to guide the absolute value of the angle difference between the heading angle and the target navigation angle of the robot to be within the preset angle error range; wherein, the absolute value of the difference between the real-time rotation speeds of the drive motors correspondingly connected to the drive wheels installed on both sides of the robot is positively correlated with the absolute value of the angle difference between the heading angle and the target navigation angle of the robot; wherein, the heading angle of the robot is measured in real time by the gyroscope built in the robot; each of the drive wheels installed on the left and right sides of the robot is connected to a drive motor.
[0015] Further, the method for performing closed-loop regulation on the PWM value acting on the blower includes: when the absolute value of the air pressure difference between the suction force of the blower measured by the robot in real time and the target working suction force within the current regulation period is not within the preset air pressure error range, the robot controls the air pressure closed-loop feedback regulation device to perform PID regulation on the PWM value acting on the blower; during the process of performing PID regulation on the PWM value acting on the blower, the robot configures the difference between the PWM value acting on the blower and the second preset target PWM value within the current regulation period as the feedback input for the next regulation period to reduce the difference between the PWM value acting on the blower and the second preset target PWM value, and sets the PWM value acting on the blower as the second PWM value, and then inputs the second PWM value into the blower to generate a blower suction force; wherein, the blower suction force is positively correlated with the second PWM value; when the difference between the PWM value acting on the blower and the second preset target PWM value is less than the preset blower steady-state error, the absolute value of the air pressure difference between the suction force of the blower measured by the robot in real time and the target working suction force is within the preset air pressure error range value; wherein, a pressure sensor is provided at the air inlet of the blower of the robot for monitoring the blower suction force in real time
[0016] Starting from a stationary state, after the robot sequentially overcomes the static friction and samples various feedback data of the current walking surface, the current sampling value of the PWM signal output by the drive motor, the PWM value used to control the drive motor, and the PWM value acting on the blower are introduced to calculate a relative walking resistance current value that is not affected by the changing electric quantities actively output by the drive motor and the blower, and it is a relative resistance current value calculated based on the external resistance information of the walking surface traveled within a sampling time period (representing the electric quantity information converted from the external resistance); then, based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold, it is detected whether the robot is currently colliding with an obstacle, improving the accuracy of collision detection of the robot on the walking surface of the same medium. The collision detection results on the walking surfaces of various media are not affected by the current interference caused by the torque change of the drive motor output (the change in the force applied to the drive wheel) and the blower suction force change (the change in the resistance applied to the drive wheel). The relative change value of the relatively primitive walking resistance (friction) from the external environment is used to assist in detecting the collision situation between the robot and the obstacle ahead to avoid the obstacle and also facilitate detecting the edge of the walking surface.
[0017] Among them, after the robot samples various feedback data of the current medium as reference data for calculating the relative resistance current value, the calculated current relative walking resistance current value is used to represent the difference in the external resistance received at a specific moment during the robot's walking relative to the external resistance received at the preset starting position (the initial stable point where the robot starts from rest and overcomes the static friction). When this current relative walking resistance current value is less than or equal to the preset collision current threshold, it can represent the resistance difference between two cleaning media walked through successively in an environment without obstacles in front, or the difference in the external resistance borne between the latest walked cleaning media and the cleaning media at the starting position. When the aforementioned current relative walking resistance current value is greater than the preset collision current threshold, it is determined that an obstacle has been touched, and it can be an obstacle that collides with the surface of the same medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic flowchart of a robot collision detection method based on the relative walking resistance current value disclosed in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] Next, the technical solutions in the embodiments of the present invention will be described in detail with reference to the accompanying drawings in the embodiments of the present invention. To further illustrate each embodiment, the present invention provides accompanying drawings. These accompanying drawings are a part of the disclosure of the present invention, and are mainly used to illustrate the embodiments, and can be used to explain the operating principle of the embodiments in conjunction with the relevant descriptions in the specification. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention.
[0020] Fully automatic planning cleaning robots mainly include wheeled robots, suction cup robots, and crawler robots. This type of robot mainly includes floor cleaning robots and window cleaning robots. If the vacuum cleaner of the floor cleaning robot is close to the ground and has a large suction force, the pressure between the driving wheels of the floor cleaning robot and the ground increases, resulting in an increase in the walking resistance of the floor cleaning robot. It is very likely that the driving wheels cannot move due to the excessive resistance actively exerted by the body. Then, the walking resistance of the robot not only includes the frictional force determined by the medium material of the walking surface and the resistance caused by external collision factors, but also includes the resistance applied to the driving wheels due to the change in the suction force of the fan. Therefore, the reason for the floor cleaning robot to stop moving may not only lie in the influence of the medium of the walking surface and the obstruction of external obstacles, but also include that the output torque of the driving motor is too small to overcome the static friction force from the ground, resulting in the driving wheels not being able to rotate. If the fan suction force of the window cleaning robot is large, the extrusion force between the driving wheels and the walking surface increases, which also causes the resistance of the cleaning cloth to be too large and the walking resistance received by the driving wheels to increase, resulting in the window cleaning robot being unable to move. Then, the walking resistance of the robot not only includes the frictional force determined by the medium material of the walking surface and the resistance caused by external collision factors, but also the resistance applied by the change in the fan suction force to the driving wheels. Therefore, the reason for the window cleaning robot to stop moving may not lie in the influence of the medium of the walking surface and the obstruction of external obstacles. Thus, in cleaning robots equipped with a fan and a driving wheel motor, excluding the interference caused by the change in the output torque of the relevant driving motor inside the robot and the interference caused by the change in the fan suction force is crucial for subsequently detecting the collision situation of obstacles by detecting the change in the external resistance borne.
[0021] It should be noted that Pulse Width Modulation (PWM) is the abbreviation of the English "Pulse Width Modulation", simply referred to as pulse width modulation. The PWM value is the average value of the sum of the conduction times of the switching tube within a cycle. The longer the conduction time, the larger the PWM value applied to the motor, and the larger the average value of the DC output of the switching tube. The rotational speed of the motor can be proportional to the PWM value. The PWM frequency is the ratio of the conduction time to the cycle time within a cycle, usually called the duty cycle. The more times of conduction, 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 ratio of the on and off time (duty cycle) within a cycle as needed, thereby changing the average voltage and controlling the rotational speed of the motor.
[0022] As known to those skilled in the art, whether it is a fan or a drive motor, their power generation components are electric motors. Preferably, the bridge circuit is the 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 an electric motor that controls the rotation of the drive wheel; the PWM values acting on the left and right wheels are linearly related to the wheel torque, and in most cases, the PWM value acting on the fan is the PWM value that can rotate. The PWM signal input to the electric motor is actually a rectangular pulse wave with continuously adjustable pulse width, and a pulse current with adjustable pulse width and a certain frequency is provided to the motor through a modulator. The larger the pulse width, that is, 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.
[0023] The PWM signal input to the electric motor is actually a rectangular pulse wave with continuously adjustable pulse width, and a pulse current with adjustable pulse width and a certain frequency is provided to the motor through a modulator. The larger the pulse width, that is, 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 torque output by the motor.
[0024] As an embodiment, a robot collision detection method based on relative walking resistance current value is disclosed. The execution subject of the robot collision detection method 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 floor cleaning robot and a window cleaning robot, belonging to a cleaning robot with a blower and a driving motor. The window cleaning robot mainly includes a circular intelligent window cleaning machine and a square intelligent window cleaning machine; driving wheels are installed on both sides of the robot, generally one driving wheel is installed on each of the left and right sides of the body chassis; a driving motor electrically connected to the driving wheel is installed inside the robot, and each driving wheel is correspondingly connected to a driving motor. Then, two driving motors are provided for controlling the rotation speed of the driving wheels to control the walking speed of the robot on the walking surface. The rotation speed difference between the two driving wheels can control the walking direction of the robot. The driving wheels of the robot can come into contact with the walking surface to generate a frictional force that hinders the robot's walking; the robot is also equipped with a blower for generating suction on the walking surface of the robot. The robot disclosed in this application can be equipped with a collision sensor for detecting collisions with short obstacles, and no specific limitation is imposed on the assembly space of the collision sensor; the robot can also not be equipped with a collision sensor, for example, there is no need to assemble a photoelectric door collision bar, and accordingly, there is no need to add a mechanical installation structure for the photoelectric door collision bar on the periphery of the robot, reducing costs and improving the reliability and lifespan of the product. When the robot is a floor cleaning robot, the dust suction blower inside the floor cleaning robot is used for sucking dust on the walking surface; when the robot is a window cleaning robot, the blower inside the window cleaning robot is used for adsorbing on the walking surface; the walking surface here can be the cleaning medium of the robot, which can be the surface of a horizontal ground, a vertical glass, a vertical wall, or other cleaning media.
[0025] Referring to Figure 1 it can be seen that the robot collision detection method includes the following steps S1 and S2:
[0026] Step S1: The robot performs closed-loop regulation on the PWM value used to control the drive motor, determines the first PWM value obtained during the closed-loop regulation, and simultaneously provides it to the drive motor for use to adjust the walking speed of the robot. The torque or output torque change of the drive current output will also be fed back to the walking state of the drive wheel. The drive wheel starts to rotate by means of torque, so the drive motor needs to adjust the output current, and thus a current change value will be introduced due to the change in output torque. The robot performs closed-loop regulation on the PWM value applied to the fan, determines the second PWM value obtained during the closed-loop regulation, and provides it to the fan for use to adjust the fan suction. Among them, after the fan suction is applied to the walking surface, it will also affect the movement of the drive wheel and introduce resistance when necessary. In order to overcome this resistance, the drive motor needs to output a larger current, and thus a current change amount will be introduced due to the change in fan suction. After transmitting the first PWM value to the drive motor, the robot samples the current signal output by the drive motor to obtain the drive wheel current sampling value. For example, a sampling resistor with a small resistance value is connected in series in the drive wheel control circuit (bridge circuit) inside the robot. The voltage drop across the sampling resistor is a voltage signal proportional to the output current of the drive motor, that is, a voltage signal proportional to the current signal output by the drive motor sampled by the robot. Then, after this voltage signal is amplified by an operational amplifier and sampled by the analog-to-digital converter of the single-chip microcomputer, the drive wheel current sampling value is obtained. The drive wheel current sampling value can reflect the movement state of the drive wheel in real time, including the internal and external interference factors it bears, including the actively generated acting forces and the passively received acting forces. Then, the drive wheel current sampling value will reflect the current change values caused by the friction force of the robot walking surface, the resistance applied by the fan suction to the robot body, the change in the output torque of the drive motor, etc. Among them, in order to overcome the current change values caused by the resistance applied by the change in fan suction to the robot body, the change in the output torque of the drive motor, etc., it belongs to the current interference amount actively generated by the robot relative to the external resistance to be detected. It is necessary to enter step S2 for cancellation processing to further detect the collision situation from the external environment.
[0027] Step S2: Based on the drive wheel current sampling value, the first PWM value, and the second PWM value, calculate the current relative walking resistance current value of the robot, so that the current relative walking resistance current value is not interfered by the current change value caused by the torque change output by the drive motor, nor is it interfered by the current change value caused by the current change applied to the body due to the change in the suction force of the blower on the same walking surface. Thus, extract the external resistance information for detecting the collision situation of the external environment of the robot, which is represented by the relative external resistance current value between two walking surfaces in this embodiment; the current relative walking resistance current value can be represented by the digital signal converted by analog-to-digital conversion, which is consistent with the dimension of the drive wheel current sampling value. After determining the current relative walking resistance current value of the robot, based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold, detect whether the robot has a collision at present, so as to control the robot to stop in time and change the walking direction, avoid obstacles and perform the next path planning. Then, steps S1 and S2 can be executed again to detect the collision situation on the unvisited walking surface and avoid the obstacles newly collided with. Therefore, in this embodiment, after the drive wheel current sampling value sampled in real time overcomes the current change value introduced by the first PWM value (representing the active interference factor caused by the torque change output by the drive motor) and the current change value introduced by the second PWM value (representing the active interference factor caused by the suction force change generated by the blower), if the difference between it and a relatively stable walking resistance current value with the same dimension but different sampling time (the current value corresponding to the external resistance obtained by overcoming the foregoing active interference factors) is within the preset collision current threshold, it is determined that a collision has occurred, otherwise no collision has occurred. This improves the adaptability of the robot to complex environments.
[0028] When a robot collides, the real-time rotational speed of the driving motor or the traveling speed of the driving wheel will suddenly decrease; when the impact object is not very heavy, the obstacle will be knocked away and the motor speed will not decrease significantly; however, in either collision scenario, the sudden change in the external resistance borne by the robot on the current walking surface will be suddenly greater than the external resistance borne by the walking surface without a collision. Therefore, regardless of how the resistance of the walking environment where the robot is located changes, detecting a collision by using the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold is actually equivalent to comparing the current relative walking resistance current value of the robot calculated in real time with the preset collision current threshold to obtain the detection information on whether a collision has occurred. Among them, there are current change values caused by changes in the output torque of the driving motor and current change values caused by changes in the suction force generated by the blower in the driving wheel current sampling value sampled by the robot in real time. Then, when using the driving wheel current sampling value sampled in real time as a threshold judgment to detect a collision, the current change values caused by changes in the output torque of the driving motor and the current change values caused by changes in the suction force generated by the blower will cause the driving wheel current sampling value to be too large, which is reflected as an increase in the walking resistance borne by the driving wheel on the walking surface, rather than an increase in the external resistance, and it is easy to be misjudged as a collision between the robot and an obstacle. At this time, the active interference factor caused by the change in the output torque of the driving motor, that is, the current change value output by the driving motor caused by the torque change, is fed back to form a kind of power change value in the driving wheel current sampling value; the active interference factor caused by the change in the suction force generated by the blower, that is, the change in the suction force of the blower causes a change in the output current of the driving motor, and is fed back to form another power change value in the driving wheel current sampling value. Therefore, to detect the collision situation of the obstacle, it is necessary to overcome the current change value introduced by the first PWM value (representing the active interference factor caused by the change in the output torque of the driving motor) and the current change value introduced by the second PWM value (representing the active interference factor caused by the change in the suction force generated by the blower) before setting the preset collision current threshold for the subsequent comparison of the relative walking resistance current value.
[0029] In summary, when the robot starts from rest, after successively overcoming the static friction and sampling various feedback data of the current walking surface, the current sampling value of the PWM signal output by the drive motor, the PWM value for controlling the drive motor, and the PWM value acting on the blower are introduced to calculate the relative walking resistance current value that is not affected by the variable power output actively by the drive motor and the blower. Moreover, it is a relative resistance current value calculated based on the external resistance information of the walking surface traversed within a sampling time (representing the power information converted from the external resistance); then, based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold, it is detected whether the robot is currently colliding with an obstacle, improving the accuracy of collision detection of the robot on the walking surface of the same medium. The collision detection results on the walking surfaces of various media are not affected by the current interference caused by the torque change (change in the acting force applied to the drive wheel) output by the drive motor and the suction change (change in the resistance applied to the drive wheel) of the blower. The relative change value of the walking resistance (friction and collision hindering acting force) from the external environment is used to assist in detecting the collision situation between the robot and the obstacle ahead to avoid the obstacle, and it can achieve collision detection without the need for a photoelectric door collision bar; furthermore, by detecting a collision with an obstacle, the edge of the walking surface is identified, facilitating the division of the working area and path planning within the identified working area.
[0030] Based on the above embodiments, the method for detecting whether the robot is currently colliding based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold includes: when the current relative walking resistance current value of the robot is greater than the preset collision current threshold, the robot is currently colliding, specifically colliding with an obstacle on the walking surface. Preferably, when the walking surface is a horizontal ground, the obstacle is a wall fixedly arranged on the horizontal ground or furniture placed on the horizontal ground; preferably, when the walking surface is an inclined plane or a wall surface, the obstacle is at the edge position fixedly arranged on the inclined plane or the wall surface. When a collision is detected, the edge position of the walking surface is determined to be recognized; then the robot starts to change the current walking direction. It can first stop walking, then rotate 180 degrees, and then walk along the rotated direction by executing step S1 and step S2, and calculate the current relative walking resistance current value and detect the collision situation. When the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, the robot is currently not colliding, specifically not colliding with an obstacle on the walking surface. The robot can continue to move forward along the current walking direction and can determine whether the external resistance borne by the subsequent walking surface becomes larger or smaller, thereby distinguishing the walking surfaces of different media. For example, when the current relative walking resistance current value changes due to the calculated current traversed cleaning medium, it can be determined that the currently traversed cleaning medium is different from the cleaning medium traversed last time.
[0031] The external resistance disclosed in this application includes the frictional force generated by the driving wheels of the robot in contact with the walking surface and the obstructive force (which can be the abutting force) caused by colliding with external obstacles, but does not include the two factors of the walking resistance formed by the change in the suction force of the fan applied to the driving wheels and the force formed by the change in the output torque of the driving motor applied to the driving wheels, which are the forces actively applied by the robot. Among them, the change in the suction force of the fan generated by the fan and the change in the output torque of the driving motor can be unified into the change in the torque actively output by the robot, corresponding to the change value of the actively output current, so as to distinguish the change value of the current corresponding to the resistance change passively introduced by the external environment (the walking environment other than the fan and the driving motor).
[0032] It should be noted that the preset collision current threshold is applicable to detecting whether a collision occurs when robots of the same type walk on walking surfaces of different media, that is, detecting the collision situation with obstacles on walking surfaces of different media. Preferably, the preset collision current threshold is used to represent the electric quantity corresponding to the minimum external resistance that the robot needs to bear when colliding with obstacles on walking surfaces with different frictional forces. When the robot or the motor device inside the robot needs to be replaced, the preset collision current threshold will be reset; or when the difference in the friction coefficients of the walking surfaces that the robot needs to traverse is relatively large, the preset collision current threshold will also be reset.
[0033] Preferably, the preset collision current threshold can be set according to the current relative walking resistance current value calculated when the robot collides with an obstacle during the normal working process on walking surfaces with different frictional forces, which is equivalent to being set by the difference between the current walking resistance current value calculated when the robot collides with an obstacle during the normal working process and the current walking resistance current value calculated when there is no collision with an obstacle during the normal working process. The normal working of the robot means that when the robot is working, there will be no situation where the driving wheel cannot rotate due to excessive fan suction force, nor will there be a situation where the driving wheel slips due to too small fan suction force, nor will there be a situation where the driving wheel cannot rotate due to the change in the output torque of the driving motor, that is, it cannot overcome the torque effect and cause the driving wheel to be unable to rotate, nor will there be a situation where the torque output by the driving motor is too large and cause the driving wheel to slip on the walking surface.
[0034] In the process of setting the preset collision current threshold, first place the robot on a material with relatively small friction, and adjust the first PWM value and / or the second PWM value up and down so that the robot can work normally and collide with a preset obstacle after using the suction force of the blower adjusted by the aforementioned closed-loop. Then place the robot on a material with relatively large friction, and finely adjust the first PWM value and / or the second PWM value so that the robot can work normally and collide with a preset obstacle after using the suction force of the blower adjusted by the aforementioned closed-loop. Then verify on surfaces with different frictions whether the robot can work normally and collide with the obstacle according to the currently adjusted first PWM value and / or second PWM value. If so, set the currently calculated relative walking resistance current value according to the aforementioned step S2 as the preset collision current threshold. If not, find a balance value to meet most situations encountered by the robot. Due to the huge differences in drive motors, blowers, die structures, etc. of different types of machines, the preset collision current thresholds calculated by different types of robots are also different. Therefore, it is necessary to obtain in advance the preset collision current threshold required for the current robot to judge the collision of obstacles during normal operation. Preferably, the adjustment of the second PWM value can be achieved by changing the corresponding target PWM value in the air pressure closed-loop feedback adjustment device, or directly changing the second PWM value; the adjustment of the first PWM value can be achieved by changing the corresponding target PWM value in the angle closed-loop feedback adjustment device, or directly changing the first PWM value.
[0035] In step S1 of the foregoing embodiment, during the process of performing closed-loop regulation on the PWM value for controlling the driving motor, since the PWM value can control the rotational speed of the driving motor, the PWM value can change the rotational speed of the driving wheels, thereby changing the walking speed of the robot. Specifically, the heading angle of the robot is adjusted by controlling the relative magnitudes of the torques output by the driving motors of the left and right driving wheels. When the rotational speeds of the driving wheels on both sides of the robot are inconsistent, it causes a change in the walking direction of the robot, such as turning, and changes the heading angle of the robot. Therefore, during the closed-loop regulation process, the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle can be adjusted to be within a preset angle error range, so that the robot walks along a predetermined direction. Specifically, the robot can adjust the PWM signal for controlling the driving motor through an angle closed-loop feedback regulation device, and apply the first PWM value adjusted in real time to the driving motor. The driving motor will change the output rotational speed, and then use the heading angle of the robot corresponding to the changed rotational speed as the feedback input of the angle closed-loop feedback regulation device to maintain the closed-loop regulation, and also indirectly perform closed-loop regulation on the heading angle measured by the robot in real time. However, during the foregoing closed-loop regulation process, the first PWM value obtained in real time may not necessarily be stable at the target PWM value in the normal working state. Then it is determined that the first PWM value obtained in real time is prone to fluctuations and causes motor current fluctuations, corresponding to generating torque interference in the torque acting on the rotation of the driving wheels, that is, a change in the torque acting on the rotation of the driving wheels is formed inside, and correspondingly, it will be reflected in the driving wheel current sampling value; relative to the external resistance, a current interference amount in the driving wheel current sampling value is generated. In order to extract the friction situation determined by the environmental medium of the walking surface outside the robot and the collision and obstruction situation of external obstacles, it is necessary to overcome the interference of the torque change factor actively generated by the driving motor when calculating the walking resistance current value or the relative walking resistance current value later.
[0036] In the process of closed-loop regulation of the PWM value for controlling the fan, the PWM value can control the rotation speed of the motor inside the fan, thereby the PWM value can change the air pressure difference inside and outside the fan, that is, change the suction force of the fan. Therefore, during the closed-loop regulation process, the absolute value of the air pressure difference between the suction force of the fan measured by the robot in real time and the target working suction force can be adjusted to be within a preset air pressure error range, enabling the optimal suction force of the fan generated on the walking surface. On this basis, when the robot is an intelligent window cleaning robot, the intelligent window cleaning robot will not have the situation that the wheels cannot rotate due to excessive suction force or the driving wheels slip due to too small suction force during normal operation. Specifically, the robot can adjust the PWM signal for controlling the fan through the air pressure closed-loop feedback adjustment device, and apply the second PWM value adjusted in real time to the fan. The motor inside the fan will change the output rotation speed, and then use the fan suction force corresponding to the changed rotation speed as the feedback input of the air pressure closed-loop feedback adjustment device to maintain the closed-loop regulation, and also indirectly perform the closed-loop regulation of the suction force of the fan measured by the robot in real time. However, in the above process of closed-loop regulation of the PWM value for controlling the fan, the second WM value obtained in real time may not be stable at the target PWM value under the normal suction force state. Then it is determined that the second PWM value obtained in real time is prone to fluctuations and causes the motor current of the fan to jump, which may lead to excessive suction force generated by the fan in real time. The excessive suction force is applied to the driving wheels and increases the pressure between the driving wheels and the walking surface, resulting in an increase in the walking resistance borne by the two driving wheels on both sides of the robot. Correspondingly, the driving motor needs to output a larger current to overcome the hindering effect of this walking resistance. Compared with the required calculated external resistance, this application classifies this walking resistance as the interference of the fan suction force applied inside the robot. In order to extract the friction situation determined by the environmental medium of the walking surface outside the robot and the hindering situation caused by collisions with external obstacles, it is necessary to overcome the interference of the current change value actively caused by the change in the fan suction force when calculating the walking resistance current value or the relative walking resistance current value later.
[0037] After transmitting the first PWM value to the drive motor, the drive wheel starts to be controlled by the first PWM value to perform corresponding rotational actions, that is, to move on the walking surface. The robot samples the current signal of the drive motor to obtain the drive wheel current sampling value. This drive wheel current sampling value is the current sampling value verified by the drive wheel walking on the current walking surface. Then the drive wheel current sampling value carries the torque change information output by the drive motor, which is the current change value generated by the control of the first PWM value; the drive wheel current sampling value also carries the current change value caused by the suction force generated by the fan being applied to the walking surface, and the current change value required to overcome the friction force from the walking surface, and also carries the current change value caused by the change in the external resistance introduced by the collision of the robot with an obstacle. When the robot samples the current output by the drive motor using a sampling resistor, a voltage signal across the sampling resistor is obtained. Preferably, after the collected voltage signal is amplified by an operational amplifier and sampled by the single-chip microcomputer ADC, it is represented in digital signal form as the drive wheel current sampling value. The drive wheel current sampling value feeds back the actual motion force state of the current motion of the drive wheel through the current sampling method; therefore, the first PWM value is used to control the output torque change of the drive motor to feedback and form one of the power change values in the drive wheel current sampling value; the second PWM value is used to control the change in the fan suction force generated by the fan to feedback and form another power change value in the drive wheel current sampling value.
[0038] As an example 1 of calculating the current relative walking resistance current value of the robot, the current relative walking resistance current value of the robot is the difference between the current walking resistance current value calculated by the robot after a preset sampling time and the reference walking resistance current value calculated within the preset sampling time; within the preset sampling time, the robot has started walking and is not in a stationary state. Preferably, the robot keeps walking on the walking surface of the same medium within the preset sampling time; wherein, the current relative walking resistance current value of the robot is used to represent the relative resistance information, that is, the difference between the external resistances borne by two walking surfaces, and the relative walking resistance current value is also the difference between the walking resistance current values calculated at two different times or two different walking surfaces, and can be converted from the PWM value. It can be grasped by those skilled in the art that the calculated current relative walking resistance current value can also be converted from electric quantity to the walking resistance in the physical force dimension. Reference can be made to the calculation method in paragraph
[0023] of the specification of Chinese invention patent CN111852925B, which divides the current value by a fixed PWM value to obtain the walking resistance. Then the current walking resistance calculated by the robot after the preset sampling time can be represented by the current value, and the reference walking resistance calculated within the preset sampling time can also be represented by the current value.
[0039] It should be noted that when there are certain deviations in the performance of the drive motor and the fan, it is basically very difficult for the actually measured current value to be exactly the same as the theoretical current value. Therefore, the current relative running resistance current value can be represented by the difference between the running resistance current values calculated at two different times or on two different running surfaces. There is a running resistance current value calculated during the linear stage after the robot starts. During the linear stage, the driving wheel current sampling value, the first PWM value, and the second PWM value that are linearly related to the PWM value can be used for filtering to obtain the aforementioned reference running resistance current value, which represents the reference external resistance on a certain medium running surface. Then, the difference is taken with the current running resistance current value calculated for the same medium running surface subsequently to obtain the current relative running resistance current value. Calculating the current relative running resistance current value relative to the unified and fixed reference running resistance current value can reduce the subsequent collision detection error.
[0040] Therefore, in this embodiment, it is represented by the relative external resistance current value between two running surfaces; the current relative running resistance current value can be represented by the digital signal converted by analog-to-digital conversion, which has the same dimension as the driving wheel current sampling value. After determining the current relative running resistance current value of the robot, based on the relationship between the current relative running resistance current value of the robot and the preset collision current threshold, the current collision situation between the robot and the obstacle is detected, so as to control the robot to stop in time and change the running direction, avoid the obstacle and perform the next path planning. Then, steps S1 and S2 can be executed again to detect the collision situation on the unvisited running surface and avoid the obstacle that was newly collided with. This improves the adaptability of the robot to complex environments.
[0041] On the basis of the above embodiments, after the robot starts walking on the walking surface, within the preset sampling time, control the reference power change value corresponding to the driving wheel current sampling value to subtract the reference power change value corresponding to the first PWM value and the reference power change value corresponding to the second PWM value in sequence, and determine the reference walking resistance current value calculated within the preset sampling time, that is, set the result of successive subtraction as the reference walking resistance current value calculated within the preset sampling time; after the robot has walked through the preset sampling time, control the driving wheel current sampling value to subtract the power change value caused by the first PWM value and the power change value caused by the second PWM value in sequence, and determine the current walking resistance calculated by the robot after the preset sampling time; wherein, within the preset sampling time, the rotation speed of the driving motor is linearly related to the first PWM value used to control the driving motor. In this embodiment, the method for calculating the current walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value can be understood as: based on the driving wheel current sampling value, the first PWM value, and the second PWM value obtained in real time in step S1, calculate the current walking resistance current value of the robot, that is, execute step S1 synchronously during the execution of step S2.
[0042] Specifically, the method for calculating the current relative walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value includes:
[0043] The robot starts from a stationary state, including starting the drive motor and the blower and applying corresponding PWM values until after a preset start time, the robot starts to move on the current walking surface, forming the start-up stage of the drive motor. The duration can be the preset start time. Of course, the blower also remains working during this stage to generate blower suction, which can vacuum the walking surface or adsorb the body to the walking surface. Among them, before the robot starts to move, the drive motor is started from a stationary state and is controlled by the first PWM value adjusted in real time. Here, the stationary state can also be the state where the movement is stopped due to braking just after hitting an obstacle, and then the robot starts to move in a new walking direction. The position where the robot starts to move is the preset starting position, that is, the starting position after the preset start time, and it is also the position point where the output current of the drive motor tends to be stable and starts to enter the linear state. It should be noted that within the preset start time, the robot starts from a stationary state by gradually increasing the current of the drive motor to start the body. During this start-up process, the first PWM value is applied to the drive motor to start the drive motor and drive the drive wheels to rotate. The second PWM value is also applied to the blower. Then, the robot has a relative sliding tendency with respect to the contacted walking surface, and there is a static friction force between the robot and the contacted walking surface. Until the robot starts from a stationary state and after the preset start time, the first PWM value obtained in real time during the closed-loop adjustment is greater than or equal to the target start PWM value, indicating that the driving force provided by the drive motor at this moment just exceeds the static friction force to overcome the influence of the static friction force, and it is determined that the robot has completed the start-up of the body and starts to move on the current walking surface at the same position, so that the drive wheels of the robot rotate to overcome the static friction force. In some embodiments, within the preset start time, the robot can also perform the robot motion calibration disclosed in Chinese Patent CN111852925B, that is, perform motion calibration on each drive wheel of the robot, and strive to complete the motion calibration of the left and right wheels within 210 ms, including keeping the left wheel of the robot stationary, and the right wheel of the robot rotates forward and backward for a fixed time respectively; and keeping the right wheel of the robot stationary, and the left wheel of the robot rotates forward and backward for a fixed time respectively; then the current signal output by the drive motor becomes stable, that is, it enters the linear stage. The motion calibration before this is not counted as the robot moving on the current walking surface in this application.
[0044] Then, within a preset sampling time, the robot calculates a first reference PWM value based on all the obtained first PWM values, calculates a second reference PWM value based on all the obtained second PWM values, and calculates a driving wheel reference current value based on all the obtained driving wheel current sampling values; wherein, within the preset sampling time, the sampling result of directly sampling the first PWM value obtained in real time in the foregoing closed-loop regulation or sampling the current signal output after inputting the first PWM value obtained in real time in the foregoing closed-loop regulation to the driving motor at a preset time interval is the driving wheel current sampling value. Among them, the preset start time and the preset sampling time are two adjacent time periods without a time interval 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. When the robot walks to the preset starting position, the preset sampling time is timed at the preset starting position, that is, at the preset starting position, the first PWM value required for calculating the first reference PWM value, the second PWM value required for calculating the second reference PWM value, and the driving wheel current sampling value required for calculating the driving wheel reference current value are sampled and calculated.
[0045] Within a preset sampling time, the robot can be in a state of walking on the current walking surface. The robot has overcome static friction and can walk in the same direction. The robot maintains closed-loop regulation of the PWM value used to control the drive motor and determines the first PWM value obtained in real time during the closed-loop regulation process. The robot also maintains closed-loop regulation of the PWM value used to control the fan and determines the second PWM value obtained in real time during the closed-loop regulation process. After transmitting the first PWM value obtained in real time to the drive motor, the robot samples the current signal of the drive motor to obtain the drive wheel current sampling value. Specifically, after the robot starts from rest and passes through a preset start time, during the process of the robot walking within the preset sampling time, the product of the first reference PWM value and the first conversion coefficient is marked as the reference power change value corresponding to the first PWM value, and the product of the second reference PWM value and the second conversion coefficient is marked as the reference power change value corresponding to the second PWM value. The drive wheel reference current value is marked as the reference power change value corresponding to the drive wheel current sampling value. Then, it controls the reference power change value corresponding to the currently marked drive wheel current sampling value to subtract the reference power change value corresponding to the currently marked first PWM value and the reference power change value corresponding to the currently marked second PWM value in sequence. Then, the result of the subtraction is set as the reference walking resistance current value calculated within the preset sampling time, so as to realize converting the dimension of the first reference PWM value and the dimension of the second reference PWM value into the same dimension as the drive wheel current sampling value. Among them, the dimension of the drive wheel reference current value is the same as the dimension of the drive wheel current sampling value. The first conversion coefficient is associated with the type of the drive motor and the type of the robot. When the type of the robot or the type of the drive motor changes, the first conversion coefficient also changes, which is the result of fine-tuning according to the change of the first PWM value or the drive wheel current sampling value adjusted in real time. The second conversion coefficient is associated with the type of the fan and the type of the robot. When the type of the robot or the type of the fan changes, the second conversion coefficient also changes, which is the result of fine-tuning according to the change of the first PWM value or the drive wheel current sampling value adjusted in real time.In this embodiment, the robot controls the reference power change value corresponding to the currently marked driving wheel current sampling value to sequentially subtract the reference power change value corresponding to the currently marked first PWM value and the reference power change value corresponding to the currently marked second PWM value, and then sets the result of the subtraction as the reference walking resistance current value calculated within the preset sampling time. Among them, when controlling the reference current value of the driving wheel to subtract the reference power change value corresponding to the currently marked first PWM value, the difference obtained by the subtraction is marked as the first power difference to offset the interference of the current change value caused by the torque change generated by the driving motor; then subtracting the reference power change value corresponding to the currently marked second PWM value from the first power difference, the second power difference is obtained from the difference of the subtraction. Thus, on the basis of offsetting the interference of the current change value caused by the torque change generated by the driving motor, the influence of the current change value introduced by the change of the fan suction force applied to the driving wheel is continuously offset. Then the second power difference is marked as the reference walking resistance current value calculated by the robot within the preset sampling time to extract the current change value corresponding to the walking resistance information reflecting the external environment, including the power information corresponding to the external resistance not affected by the active output of the robot (the friction related to the surface medium of the walking surface and the obstacles caused by collisions with external obstacles).
[0046] Preferably, in order to reduce the instability of the current when the driving motor starts to rotate, the current sampling is located in the second half of the fixed time of 360 ms. A stable current is used to reduce errors. For example, the preset start time is equal to 210 ms, the preset sampling time is equal to 100 ms, the preset sampling time is delayed after the preset start time, and the sampling starts from 210 ms and stops at 310 ms, lasting for a total sampling time of 100 ms. Therefore, the robot can complete the overcoming of static friction and the current sampling required for calculating the walking resistance current value in a short time, making the practicality of this application stronger. In order to calculate the first reference PWM value, the second reference PWM value, and the reference current value of the driving wheel, the robot samples the first PWM value, the second PWM value, and the driving wheel current sampling value obtained in real time during the closed-loop regulation of the corresponding devices according to the interruption time of the timer. When data acquisition is allowed, the robot samples once every time the timer interrupts. The interruption time of the timer is the reciprocal of the timer frequency. When the timer frequency is 1 KHz, the interruption time is 1 ms, and the sampling time of 100 ms samples 100 times.
[0047] After the preset sampling time, the robot can walk in a straight line in the same direction on the current walking surface. The robot marks the first PWM value obtained in real time as the first PWM value to be measured, and marks the second PWM value obtained in real time as the second PWM value to be measured; then marks the product of the first PWM value to be measured and the first conversion coefficient as the power change value caused by the first PWM value, and marks the product of the second PWM value to be measured and the second conversion coefficient as the power change value caused by the second PWM value, so as to convert the dimension of the first PWM value to be measured and the dimension of the second PWM value to be measured to be the same as the dimension of the driving wheel current sampling value. Among them, the first conversion coefficient is associated with the type of the driving motor and the type of the robot. When the type of the robot or the type of the driving motor changes, the first conversion coefficient also changes; the second conversion coefficient is associated with the type of the fan and the type of the robot. When the type of the robot or the type of the fan changes, the second conversion coefficient also changes; then control the driving wheel current sampling value obtained in real time to subtract the power change value caused by the currently marked first PWM value and the power change value caused by the currently marked second PWM value in turn, and then set the result of the subtraction as the current walking resistance current value calculated after the preset sampling time to cover the true external walking resistance information and is represented by the corresponding current value. Therefore, in this embodiment, the calculation of the current walking resistance current value is started only after the robot walks, in order to reduce the influence of the current instability factor when the driving motor starts to rotate and the external static friction. After obtaining the stable current output by the driving motor and the fan, by subtracting the current jump caused by the PWM signal fluctuation for controlling the driving motor from the driving wheel current sampling value obtained in real time and verified by the driving wheel, and then subtracting the current jump caused by the fan control, the current walking resistance current value borne by the robot at a certain time or on a certain walking surface can be obtained. Then control the current walking resistance current value calculated after the preset sampling time to subtract the reference walking resistance current value calculated within the preset sampling time, and then set the result of the subtraction as the current relative walking resistance current value of the robot to reflect the external resistance difference borne by the robot between the walking surfaces walked outside during the preset sampling time. Among them, the external resistance here is the walking resistance obtained by the robot excluding the current fluctuation interference caused by the torque change actively generated by the motor (the current fluctuation caused by reaching the expected motor speed or the predetermined walking direction during the closed-loop regulation process) and the fan suction change actively generated by the fan (the current fluctuation caused by reaching the expected fan suction during the closed-loop regulation process) from the driving wheel current sampling value, and can include the walking resistance caused by colliding with external obstacles.
[0048] It should be noted that since a driving wheel is installed on each of the left and right sides of the robot, the power change values caused by the driving wheel current sampling value and the PWM value used to control the driving motor in the closed-loop regulation both originate from the driving wheels connected to the same driving motor, so as to obtain the current walking resistance current value of the driving wheels installed on the same side of the robot. In the same robot, the calculation methods of the current relative walking resistance current values corresponding to the driving wheels on the left and right sides are the same; among them, the current relative walking resistance current value of the robot can be divided into the current relative walking resistance current values corresponding to the driving wheels on the left and right sides; for each driving motor connected to a driving wheel on one side, it is necessary to calculate the reference power change value corresponding to the driving wheel current sampling value of this side of the driving wheel, the reference power change value corresponding to the first PWM value, the reference power change value corresponding to the second PWM value, the power change value caused by the first PWM value, and the power change value caused by the second PWM value.
[0049] It should be noted that the driving wheels of the robot are in contact with the walking surface so that the robot bears the external resistance from the walking surface, among which the frictional force from the surface of the walking surface belongs to the external resistance. Preferably, when the current relative walking resistance current value of the robot is greater than the preset collision current threshold, the obstacle with which the robot collides is on the walking surface of the same medium, and then the robot changes its current walking direction to avoid hitting the obstacle or walking to the walking surface of other media, and plans an obstacle avoidance path. In some embodiments, when the medium of the walking surface contacted by the robot changes, the calculated current walking resistance current value or current relative walking resistance current value of the robot changes. Preferably, when the robot does not collide with an obstacle, when the calculated current relative walking resistance current value or current walking resistance current value of the robot changes, it is determined that the medium of the walking surface contacted by the robot has changed, and then the change of the medium of the walking surface contacted by the robot is determined by detecting the difference in external resistance between the two different media walking surfaces passed by the robot. At least, it is possible to determine the two different media walking surfaces passed by the robot, and determine the change in the external resistance (obstruction degree) borne by the currently traversed walking surface relative to the previously traversed walking surface. For example, it can be determined that the frictional force borne by a walking surface walked later is greater than the frictional force borne by a walking surface walked earlier.
[0050] Based on the above embodiments, since the current relative walking resistance current value calculated by the robot in the present application overcomes the interference of the current change value caused by the change in the suction force of the fan generated by the fan and the interference of the current change value caused by the change in the torque output by the motor of the driving wheel, the differential speed of the driving wheels on the left and right sides of the robot (controlled by the motor of the driving wheel and positively correlated with the PWM value of the driving motor for controlling the driving wheel on the corresponding side) does not affect the calculation of the current relative walking resistance current value and the accuracy of collision detection. As a result, the robot collision detection method is applicable not only to the straight walking state where the slip degrees of the left and right driving wheels are the same, but also to the straight walking state where the robot turns or the slip degrees of the left and right driving wheels are different, that is, taking into account the rotational speed differences of the two driving wheels and improving the adaptability of the current relative walking resistance current value and the obstacle collision detection result in various environmental states and various robot motion states.
[0051] As the second embodiment of calculating the current relative walking resistance current value of the robot, calculating the current relative walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value can be understood as calculating the current relative walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value obtained in real time in step S1, that is, synchronously executing step S1 during the execution of step S2. In this embodiment, it can be understood that based on the difference between two first PWM values obtained successively during the robot walking stage, the difference between two corresponding second PWM values obtained successively during the robot walking stage, and two corresponding driving wheel current sampling values obtained successively during the robot walking stage, the current relative walking resistance current value of the robot is calculated, which is used to represent the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the robot when walking on the previous walking surface; then the method for calculating the current relative walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value includes:
[0052] The robot starts from a standstill until it starts walking on the current walking surface to overcome the static friction. During this process, before the robot starts walking, there is static friction between the robot and the walking surface it contacts and the drive motor is started until the robot starts walking on the current walking surface from a standstill, and it is determined that the robot has overcome the static friction. Specifically, before the robot starts walking, the drive motor is started from a standstill and is controlled by the first PWM value adjusted in real time, and the fan is also started and is controlled by the second PWM value adjusted in real time. The stationary state here can also be just after colliding with an obstacle, braking to stop movement and then starting to walk in a new walking direction. The robot starts from a standstill by gradually loading the current of the drive motor to start the body, and then the robot is relative to the walking surface it contacts. The robot experiences relative sliding, and static friction exists relative to the walking surface it contacts. This occurs until the robot starts from rest and a preset startup time has passed, at which point the first PWM value obtained in real time during closed-loop control reaches the startup PWM value. This indicates that the driving force provided by the drive motor at that moment just exceeds the static friction to overcome the effects of static friction, confirming that the robot has completed body startup and begun walking on the current walking surface. This also confirms that the current signal output by the drive motor is stable, ensuring the robot's normal operation on walking surfaces with different media (walking surfaces with varying friction). The robot's starting point is the preset starting position, i.e., the starting point after the preset startup time. This is also the point at which the robot is located when the output current of the drive motor stabilizes and begins to enter a linear state. The preset starting position is pre-set on the walking surface of the medium to be cleaned and serves as the starting point for the robot to sample the drive wheel current. In some embodiments, within the preset start-up time, the robot can also perform 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 not moving, and the right wheel of the robot rotates forward and reverse for a fixed time respectively; and the right wheel of the robot not moving, 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. The motion calibration before this is not counted as the robot walking on the current walking surface in this application.
[0053] Preferably, the starting PWM value is the first PWM value determined when the robot can start normally on walking surfaces with different frictions and can be obtained through closed-loop regulation. The normal start of the robot means starting from rest and walking straight in one direction, overcoming the static friction of the walking surface in various media. First, place the robot on the walking surface of a medium with relatively low friction and adjust the first PWM value up and down so that the robot can start from rest and walk straight in one direction. Then place the robot on the walking surface of a medium with relatively high friction and finely adjust the first PWM value so that the robot can start from rest and walk straight in one direction. Then verify on surfaces with different frictions whether the robot can start from rest and walk straight in one direction according to the current first PWM value. Then set the first PWM value required for the robot to start walking normally as the starting PWM value; if not, find a balance value range to meet most situations encountered by the robot. Due to the huge differences in different types of drive motors, fans, mold structures, etc., the starting PWM values required for different types of robots to start normally are different. Therefore, it is necessary to obtain the starting PWM value in advance, and the starting PWM value requires preliminary manual judgment and setting, which reduces the influence of different types of walking surface media environments on the application of this method and makes the method more applicable.
[0054] Then, within the preset sampling time, the robot calculates a first reference PWM value based on all the obtained first PWM values, calculates a second reference PWM value based on all the obtained second PWM values, and calculates a driving wheel reference current value based on all the obtained driving wheel current sampling values. The robot maintains walking on the current walking surface within the preset sampling time, walking on the walking surface of the same medium to withstand the action of the same surface friction force (the friction force determined by the type of the medium, not affected by the current interference caused by the change in the fan suction output of the robot and the change in the torque output of the driving motor, and the overall gravity of the robot remains unchanged). During the walking process of the robot within the preset sampling time, the calculated first reference PWM value can represent the change in the additional walking resistance with a wide applicable range caused by the torque action of the driving motor output, preventing the interference of the too large or too small PWM values adjusted by the aforementioned closed-loop, so that the first reference PWM value becomes the PWM value corresponding to the reference torque interference factor brought by the driving motor. Similarly, the calculated second reference PWM value can represent the additional walking resistance with a wide applicable range brought by the change in the fan suction applied to the walking surface, and can also feedback the change factor of the fan suction (the torque change amount of the fan) borne by the driving wheel on the walking surface of the same medium, so that the second reference PWM value becomes the PWM value corresponding to the reference active interference factor brought by the fan. Similarly, the calculated driving wheel reference current value can represent the current sampling value corresponding to all the resistance factors existing during the walking of the driving wheel on the walking surface of the same medium, representing the current change value caused by the change in the torque output of the driving motor borne by the driving wheel on the walking surface of the same medium within the preset sampling time, the current change value caused by the change in the fan suction borne by the driving wheel on the walking surface of the same medium, the friction force of the driving wheel affected by the walking surface of the medium (related to the type of the medium of the walking surface in a robot of the same mass), and the obstacle collision and obstruction factors that may exist on the walking surface of the same medium. In order to overcome this obstruction factor, the driving wheel can feedback it as a current change value.
[0055] After the robot calculates the first reference PWM value, the second reference PWM value, and the reference current value of the drive wheel within the preset sampling time and the preset sampling time has elapsed, the first reference PWM value, the second reference PWM value, and the reference current value of the drive wheel are retained as the walking resistance reference values suitable for use on the current walking surface, and the current walking surface can be set as the reference walking surface. If the preset sampling time is relatively short and the current walking surface is relatively long, the robot continues to walk on the current walking surface after the preset sampling time, and the robot can maintain a straight walk on the walking surface of the same medium. On this basis, if the reference current value of the drive wheel is successively subtracted by the first reference PWM value and the second reference PWM value, the subtraction result can be set as the reference walking resistance current value, which represents the effective value of the external resistance borne by the robot on the current walking surface, equivalent to the calibration result of the external resistance current value on the walking surface of the same medium within the preset sampling time, marked as the calibration result of the external resistance current value within the preset sampling time, used to distinguish the walking surface with a different medium from the walking surface walked on within the preset sampling time, and can also detect whether the robot collides on the walking surface relying on the excessively large walking resistance current value calculated in real time on the walking surface of the same medium.
[0056] After the preset sampling time, in order to compare the PWM value obtained in real time with the reference PWM value calculated within the preset sampling time, so as to calculate the current relative walking resistance current value of the robot; the robot first marks the first PWM value obtained in real time as the first PWM value to be measured, and marks the second PWM value obtained in real time as the second PWM value to be measured, and marks the difference between the driving wheel current sampling value obtained in real time and the driving wheel reference current value as the relative power change value of the driving wheel current sampling value, which can represent the difference in walking resistance (which can include the active input walking resistance, driving force and the external resistance received passively acting on the driving wheel together) between the latest position or walking surface reached and the walking surface (reference walking surface) required for calculating the driving wheel reference current value, that is, the walking resistance comparison value formed by the current walking surface relative to the reference walking surface. And mark the product of the difference between the first PWM value to be measured and the first reference PWM value and the first conversion coefficient as the relative power change value corresponding to the first PWM value, which represents the difference degree of the driving motor output torque interference borne by the latest position or walking surface reached by the robot relative to the walking surface (reference walking surface) required for calculating the second reference PWM value, forming the motor output torque interference comparison value formed by the current walking surface relative to the reference walking surface; and mark the product of the difference between the second PWM value to be measured and the second reference PWM value and the second conversion coefficient as the relative power change value corresponding to the second PWM value, which represents the difference degree of the fan suction interference borne by the latest position or walking surface reached by the robot relative to the walking surface (reference walking surface) required for calculating the second reference PWM value, forming the fan suction interference comparison value formed by the current walking surface relative to the reference walking surface. The first conversion coefficient converts the dimension of the PWM value to be the same as that of the driving wheel current sampling value, and the second conversion coefficient converts the dimension of the PWM value to be the same as that of the driving wheel current sampling value. Among them, the dimension of the driving wheel reference current value is the same as that of the driving wheel current sampling value. The first conversion coefficient is associated with the type of the driving motor and the type of the robot. When the type of the robot or the type of the driving motor changes, the first conversion coefficient also changes; the second conversion coefficient is associated with the type of the fan and the type of the robot. When the type of the robot or the type of the fan changes, the second conversion coefficient also changes.
[0057] Then, subtract the relative power change value corresponding to the first PWM value from the relative power change value of the drive wheel current sampling value of the robot to obtain a first difference value (the current change value introduced by the torque output by the drive motor applied to the drive wheel), so as to cancel the active interference comparison value of the drive motor, which can be the corresponding current change value; then subtract the relative power change value corresponding to the second PWM value from the first difference value to obtain a second difference value (the current change value introduced by the suction force of the fan applied to the drive wheel), so as to continue to cancel the influence of the suction force interference comparison value of the fan on the basis of canceling the interference comparison value of the motor output torque. Then, mark the second difference value as the current relative walking resistance current value of the robot to reflect the external resistance difference between the walking surfaces passed by the robot outside during the preset sampling time; further, if the robot first starts from rest on the walking surface of one medium and calculates the current relative walking resistance current value of the robot by executing the foregoing steps S1 and S2, and then starts from rest on the walking surface of another medium and recalculates the current relative walking resistance current value of the robot by re-executing the foregoing steps S1 and S2, then on the premise that no detection collision occurs throughout the process, the difference between the current relative walking resistance current values of the robot calculated on the walking surfaces of the two media can reflect the relative resistance difference between the current traversed medium's walking surface and the previously traversed medium's walking surface, that is, the difference in the relative external resistance borne by the robot on the two media traversed successively. The relative external resistance on each medium is the difference between the external resistance borne by the current position of the robot on the same medium and the external resistance borne by the starting point position. Among them, the external resistance disclosed in this application can be understood as the external walking resistance borne by the robot, which is the walking resistance obtained after excluding the influence of the torque applied by the internal drive motor and the suction force of the fan.
[0058] It should be added that the relative power change value corresponding to the first PWM value can be the difference between the power change value caused by the first PWM value in the foregoing Embodiment 1 and the reference power change value corresponding to the first PWM value; the relative power change value corresponding to the second PWM value can be the difference between the power change value caused by the second PWM value in the foregoing Embodiment 1 and the reference power change value corresponding to the second PWM value; the relative power change value of the drive wheel current sampling value can be the difference between the drive wheel current sampling value in the foregoing Embodiment 1 and the reference power change value corresponding to the drive wheel current sampling value.
[0059] In this embodiment, the calculation of the current relative walking resistance current value starts only after the robot has started walking, in order to reduce the influence of the current instability factor when the driving motor starts to rotate and the static friction force from the outside world. After the output current of the driving motor tends to be stable, among the current fluctuations formed by the current sampling value of the driving wheel verified by the driving wheel relative to the reference current value, the current fluctuation formed by the PWM value used to control the driving motor relative to the reference PWM value is cancelled out, and the current fluctuation existing in the PWM value fluctuation used to control the blower relative to the reference PWM value is also cancelled out. The difference in the current relative walking resistance current value that the robot bears at two certain times or two certain walking surfaces can be obtained, that is, the current relative walking resistance current value of the robot.
[0060] It should be noted that the relative power change value of the current sampling value of the driving wheel and the relative power change value corresponding to the first PWM value both come from the driving wheel connected to the same driving motor, in order to obtain the current relative walking resistance current value of the driving wheel installed on the same side of the robot. For the same robot, the calculation methods of the current relative walking resistance current values corresponding to the driving wheels on its left and right sides are the same; among them, the current relative walking resistance current value of the robot can be divided into the current relative walking resistance current values corresponding to the driving wheels on both sides; for each driving motor connected to a driving wheel on one side, the relative power change value of the current sampling value of the driving wheel required to calculate the current relative walking resistance current value of this side driving wheel, as well as the relative power change value corresponding to the first PWM value, need to be calculated.
[0061] In the first and second embodiments of calculating the current relative walking resistance current value described above, within the preset sampling time, the method for calculating the first reference PWM value based on all the obtained first PWM values includes: taking the average of all the obtained first PWM values within the preset sampling time to obtain the first reference PWM value. Specifically, the sum of the sequentially sampled first PWM values is calculated, and then the average of the sum of the first PWM values within the preset sampling time is calculated according to the number of summations. This average value is set as the first reference PWM value to prevent individual overly large PWM values adjusted by the aforementioned closed-loop from causing the driving wheels to slip or overly small PWM values from causing the driving wheels not to rotate. Preferably, the robot continuously sums up the first PWM values adjusted by real-time closed-loop sampling until sampling is not allowed, and then divides the summation result by the number of summations to obtain the first reference PWM value. There is no restriction on whether the left and right driving wheels rotate forward or backward within the preset sampling time; alternatively, from all the obtained first PWM values within the preset sampling time, the first PWM value with the largest numerical value is selected as the first reference PWM value. Specifically, the magnitudes of all the obtained first PWM values are compared in sequence, and then the first PWM value with the largest numerical value is set as the first reference PWM value to prevent the driving wheels from not moving; thus, within the preset sampling time, both the sampling of the first PWM values can be completed and the filtering of all the obtained first PWM values can be completed within the same time period.
[0062] It should be noted that when the robot walks to the preset starting position, the preset sampling time is timed starting from the preset starting position, that is, starting from the preset starting position, the first PWM value required for calculating the first reference PWM value, the second PWM value required for calculating the second reference PWM value, and the driving wheel current sampling value required for calculating the driving wheel reference current value are sampled. Among them, the preset starting position is the starting position where the robot starts walking after starting from a standstill, so that the robot starts walking in a straight line from the preset starting position. On the basis of the first and second embodiments of calculating the current relative walking resistance current value of the robot described above, the robot starts walking on the current walking surface at the preset starting position, and there is no restriction on the medium of the walking surface where the preset starting position is located, nor on the medium of the walking surface passed through outside the preset sampling time.
[0063] Similarly, within the preset sampling time, the method for calculating the second reference PWM value based on all the obtained second PWM values includes: taking the average of all the obtained second PWM values within the preset sampling time to obtain the second reference PWM value, so as to avoid sampling second PWM values that drive the suction force of the fan to be too large (preventing excessive pressure on the driving wheel and causing the driving wheel to not rotate), and also avoid sampling second PWM values that drive the suction force of the fan to be too small (preventing too little pressure on the driving wheel and easily causing the driving wheel to slip); or, screening out the second PWM value with the largest value from all the obtained second PWM values within the preset sampling time as the second reference PWM value. In this case, even if the largest second PWM value is used, it will be offset when calculating the current walking resistance current value or the current relative walking resistance current value later.
[0064] Similarly, within the preset sampling time, the method for calculating the driving wheel reference current value based on all the obtained driving wheel current sampling values includes: taking the average of all the obtained driving wheel current sampling values within the preset sampling time to obtain the driving wheel reference current value. The average value of the driving wheel current sampling values within the preset sampling time is the driving wheel reference current value, which can be obtained after calculating the first reference PWM value to ensure the real-time performance and effectiveness of the calculated driving wheel reference current value; or, screening out the driving wheel current sampling value with the largest value from all the obtained driving wheel current sampling values within the preset sampling time to obtain the driving wheel reference current value, which can also be obtained after calculating the first reference PWM value to ensure the real-time performance and effectiveness of the calculated driving wheel reference current value. Among them, within the preset sampling time, the robot collects the first PWM value and the second PWM value at preset time intervals, and the collected driving wheel current sampling values are also collected at preset time intervals, so as to obtain a limited number of first reference PWM values, second reference PWM values, and driving wheel reference current values, thereby obtaining a more comprehensive PWM value required for calculating the walking resistance current value, and the calculation speed is relatively fast.
[0065] In summary, the first PWM value is used to control the change in the output torque of the drive motor to feedback and form a power change value among the drive wheel current sampling values; the second PWM value is used to control the change in the suction force of the fan to feedback and form another power change value among the drive wheel current sampling values. In order to detect the relative walking resistance current value of the robot on the latest traversed walking surface and the starting position of the robot or the reference walking surface, and the walking resistance current value of the robot on the latest traversed walking surface, the foregoing embodiments do not simply and isolatedly only judge the sudden change of the motor current or only judge the change of the mileage data recorded by the code disk, but combine the PWM value for controlling the drive motor and the PWM value for controlling the fan to cancel the current change value caused by the torque change generated by the motor and the current change value introduced by the suction force change of the fan in the drive wheel current sampling value, and calculate and obtain the walking resistance current value that is not interfered by the current change values actively output by the internal drive motor and the fan without using the code disk measurement data.
[0066] Among them, during the preset sampling time, the PWM value and the current sampling PWM value are calibrated in the traversed walking surface (regarded as the reference walking surface) to obtain the reference PWM value, and then the relative walking resistance current value of the robot on the latest traversed walking surface and the reference walking surface is calculated, which is also not interfered by the suction force change of the fan and the torque change output by the drive motor); thus, the external resistance situation borne by the robot on the current walking surface is extracted to determine the resistance restricted by the medium type of the current walking surface and the walking resistance caused by the robot's collision with external obstacles, etc.; on the premise of the existence of an obstacle collision, determining the walking resistance borne by the current traversed walking surface of the robot may also include the external resistance introduced by the obstacle collision hindrance, which is convenient to be identified by a threshold value subsequently.
[0067] As an embodiment, in step S2, the method for detecting the current collision situation between the robot and an obstacle based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold includes: when the current relative walking resistance current value of the robot is greater than the preset collision current threshold, it is determined that the robot collides with an obstacle on the walking surface currently, or it can also be determined that an obstacle is detected. Then the robot starts to change its current walking direction. It can first stop walking and then turn 180 degrees to avoid knocking away the obstacle when the mass of the obstacle is small, which can not only avoid affecting the subsequent collision detection effect but also timely distinguish the passable path and the impassable area. If the obstacle with which the robot collides is on a walking surface of the same medium, the robot executes the aforementioned steps S1 and S2 on the walking surface of the same medium. For each walking surface of a medium with a different friction coefficient, the robot can detect the obstacle colliding with it on the walking surface of the same medium by executing the aforementioned steps S1 and S2. When the difference between the media is large, the preset collision current threshold can be replaced to relatively accurately detect the obstacles on the walking surfaces of different media.
[0068] Preferably, if the calculated current relative walking resistance current value of the robot is larger, it is determined that the static friction force borne by the obstacle collided by the robot on the walking surface is greater; if the robot knocks away the obstacle, the calculated current relative walking resistance current value of the robot is not necessarily very large; the static friction force borne by the obstacle changes with the change of the medium of the walking surface where it is located, specifically, it is related to the friction coefficient of the medium. When the mass of the obstacle on the walking surface of the same medium is larger, the static friction force borne by the obstacle is greater, and when the robot collides with this obstacle, the current relative walking resistance current value of the robot is larger; among them, the contact between the driving wheel of the robot and the walking surface and the collision between the robot and the obstacle both make the robot bear the external resistance from the walking surface, that is, the friction force exerted on the driving wheel by the external environment, excluding the suction force of the fan and the torque output by the driving motor.
[0069] It should be noted that after the robot starts from the preset starting position and enters the preset sampling time, the robot starts walking from the preset starting position within the preset sampling time. After walking through the preset sampling time, the first reference PWM value, the second reference PWM value, and the driving wheel reference current value are calculated. Then, the product of the first reference PWM value and the first conversion coefficient is marked as the effective current change value formed by the first PWM value within the preset sampling time, that is, the reference current change value corresponding to the first PWM value. The first reference PWM value can represent the average starting force information or the maximum starting force information (greater than or equal to the maximum static friction force when starting from rest) exerted on the driving wheel by the torque output by the driving motor of the robot during the preset sampling time on the walking surface. Since the medium of the walking surface that the robot walks through within the preset sampling time is the same as the medium at the preset starting position, the first reference PWM value can represent the effective force information exerted on the driving wheel by the torque change of the driving motor of the robot at the preset starting position. Similarly, the second reference PWM value can represent the effective resistance information exerted on the driving wheel by the suction force of the fan of the robot at the preset starting position. The driving wheel reference current value can represent the current sampling value fed back by all the forces applied to the driving wheel when the robot walks at the preset starting position, specifically, it can represent the current change value caused by the torque change of the driving motor that the driving wheel bears on the walking surface of the same medium within the preset sampling time, the current change value caused by the suction force change of the fan that the driving wheel bears on the walking surface of the same medium, the current change value caused by the frictional force (related to the medium type of the walking surface in a robot of the same mass) exerted by the walking surface of the medium on the driving wheel, and the current change value caused by the collision and obstruction of possible obstacles on the walking surface of the same medium. Therefore, the current relative walking resistance current value of the robot can be used to represent the electric quantity corresponding to the difference between the external resistance that the robot bears when walking on the current walking surface and the external resistance that the robot bears at the preset starting position.
[0070] On the premise that the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, during the walking process of the robot, when the calculated current relative walking resistance current value changes, the medium type of the walking surface contacted by the robot changes. Among them, when there is no collision of the robot, the robot can walk without obstacles. When the medium of the walking surface contacted by the robot changes, the corresponding external resistance borne also changes. Therefore, when the medium of the walking surface where the robot has most recently walked is different from the medium at the preset starting position, the current relative walking resistance current value of the robot can reflect the external resistance difference between the walking surfaces of two different media, that is, the external resistance difference between the surface medium of the working area currently traversed by the robot and the surface medium of the working area traversed last time, where the working area traversed last time includes the walking surface traversed by the robot within the preset sampling time and the preset starting position.
[0071] Preferably, when the medium of the walking surface where the robot walks after the preset sampling time is of a different type of material from the medium of the walking surface traversed during the preset sampling time, the same robot is subjected to different frictional forces on different walking surfaces, and the external resistance borne when colliding with obstacles of different masses is also different. The change in frictional force (change in external resistance) borne by the same robot inside and outside the preset sampling time can be detected by the current relative walking resistance current value of the robot and used to detect the collision situation, where the preset sampling time is relatively short. Then, when there is no collision of the robot, based on the same reference quantity, the current relative walking resistance current value of the robot can distinguish the relative frictional forces of walking surfaces of different media, and thresholds can also be correspondingly set for refined distinction, so as to facilitate distinguishing whether the robot has walked onto the walking surface of a new medium.
[0072] It should be noted that the driving wheels of the robot are in contact with the walking surface so that the robot bears the external resistance from the walking surface, including surface friction that varies depending on the medium, which can be attributed to external resistance or external walking resistance. When the current relative walking resistance current value of the robot increases, it is determined that the walking resistance borne by the robot on the current walking surface is greater than the walking resistance borne by the robot at the preset starting position; when the current relative walking resistance current value of the robot decreases, it is determined that the walking resistance borne by the robot on the current walking surface is less than the walking resistance borne by the robot at the preset starting position. When the current relative walking resistance current value of the robot increases or the current walking resistance current value of the robot increases, it is determined that the external resistance borne by the robot on the current walking surface increases; when the current relative walking resistance current value of the robot is greater than the value 0, the external resistance borne by the robot on the current walking surface is greater than the external resistance borne by the robot at the preset starting position; when the current relative walking resistance current value of the robot decreases or the current walking resistance current value of the robot decreases, it is determined that the external resistance borne by the robot on the current walking surface decreases, and when the current relative walking resistance current value of the robot is less than the value 0, the external resistance borne by the robot on the current walking surface is less than the external resistance borne by the robot at the preset starting position.
[0073] As an embodiment, when the medium of the walking surface traversed by the robot within the preset sampling time is the same as the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the walking surface in contact at the preset starting position; wherein, the robot keeps walking on the walking surface of the same medium within the preset sampling time; a preset conversion coefficient needs to be used to transform between the difference in external resistance and the electric quantity value. For example, for the conversion coefficient between ground friction and current, the torque output by the motor may be involved in the conversion, and then this conversion coefficient will be fine-tuned according to the change in the model of the driving motor or fan; wherein, since the robot keeps walking on the walking surface of the same medium within the preset sampling time, the current walking surface, the walking surface traversed by the robot within the preset sampling time, and the medium at the preset starting position are all the same. Generally, there are no obstacles at the preset starting position. The preset starting position is the starting position where the robot starts walking after starting from rest, so that the robot starts walking in a straight line from the preset starting position and performs collision detection after passing through the preset sampling time. Then, when the calculated current relative walking resistance current value of the robot is greater than the preset collision current threshold, if the walking distance of the robot is too small to still be walking on the walking surface of the same medium starting from the preset starting position, it can be determined that the robot has collided with an obstacle on the walking surface of the same medium (the current walking surface).
[0074] As an embodiment, when the medium of the walking surface traversed by the robot within the preset sampling time is different from the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the robot on the reference walking surface. A preset conversion coefficient needs to be used for transformation between the difference in external resistance and the electric quantity value. For example, the conversion coefficient between ground friction and current may involve the participation of the motor output torque in the conversion, and then this conversion coefficient will be fine-tuned according to the change in the model of the driving motor or the blower. Among them, the robot keeps walking on the reference walking surface within the preset sampling time, that is, the robot keeps walking on the walking surface of the same medium within the preset sampling time. The walking surface traversed by the robot within the preset sampling time after starting from rest is the reference walking surface. The reference walking surface can have the same medium as the current walking surface to detect the change in friction borne by the robot on the walking surface of the same medium, and the reference walking surface can also have a different medium from the current walking surface to detect whether the robot is crossing the walking surface of different media. Generally, there are no obstacles on the reference walking surface. When the medium of the walking surface traversed by the robot within the preset sampling time is different from the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the robot on the walking surface traversed within the preset sampling time. Among them, the robot keeps walking on the walking surface of the same medium within the preset sampling time. When the currently calculated relative walking resistance current value of the robot is greater than the preset collision current threshold, if the walking distance of the robot is too large to cross the walking surface of different media starting from the preset starting position, it is determined that the robot collides with an obstacle on the walking surface of the new medium (current walking surface). Among them, the medium of the walking surface where the obstacle collided by the robot abuts is different from the medium of the walking surface traversed within the preset sampling time. When the currently calculated relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, the robot is currently in a straight-line walking state without obstacles. By calculating the current relative walking resistance current value of the robot, it can be determined whether the friction (belonging to external resistance) borne by the walking surface of a certain medium type traversed by the robot currently is greater or smaller than that of the walking surface of another medium type traversed previously. Specifically, it can be the external resistance borne by the walking surface of a certain medium type traversed by the robot currently relative to the external resistance borne by the walking surface where the preset starting position is located, so as to effectively distinguish that the robot has walked to the walking surfaces of media with different frictions successively.
[0075] As an embodiment of the angle closed-loop regulation, in step S1, the method for performing closed-loop regulation on the PWM value for controlling the driving motor includes: when the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle within the current regulation period is not within the preset angle error range, for the driving motors respectively connected to the driving wheels installed on each side of the robot, the robot performs PID regulation on the PWM value for controlling the driving motor. During the process of performing PID regulation on the PWM value for controlling the driving motor, the difference between the PWM value for controlling the driving motor and the first preset target PWM value is used as the feedback input for the next regulation period to reduce the difference between the PWM value for controlling the driving motor and the first preset target PWM value, and the PWM value for controlling the driving motor is set to the first PWM value. Then, the first PWM value is input into the corresponding side driving motor in real time to obtain the driving wheel current sampling value output by the driving motor on that side. Among them, the real-time rotation speed of the driving motor is positively correlated with the first PWM value; for the driving motors respectively connected to the driving wheels installed on each side of the robot, when the difference between the PWM value for controlling the driving motor on the corresponding side and the first preset target PWM value is less than the corresponding preset driving wheel steady-state error, the robot adjusts the walking direction based on the difference between the real-time rotation speeds of the driving motors on the left and right sides to guide the absolute value of the angle difference between the heading angle of the robot and the target navigation angle to be within the preset angle error range; among them, the absolute value of the difference between the real-time rotation speeds of the driving motors respectively connected to the driving wheels installed on both sides of the robot is positively correlated with the absolute value of the angle difference between the heading angle of the robot and the target navigation angle; among them, the heading angle of the robot is measured in real time by a gyroscope built in the robot; one driving wheel is installed on each of the left and right sides of the robot, and each of the driving wheels installed on the left and right sides of the robot is connected to a driving motor.
[0076] Specifically, in the step S1, the robot can adjust the PWM value for controlling the driving motor through the angle closed-loop feedback adjustment device, and input the first PWM value adjusted in real time into the driving motor. The driving motor will change the output rotation speed, and then use the heading angle of the robot formed corresponding to the changed rotation speed as the feedback input of the angle closed-loop feedback adjustment device to maintain the closed-loop adjustment, which also indirectly performs the closed-loop adjustment on the heading angle measured by the robot in real time. The closed-loop adjustment has a corresponding adjustment period. Therefore, the method for performing closed-loop adjustment on the PWM value for controlling the driving motor includes: when the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle within the current adjustment period is not within the preset angle error range, the robot will use the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle within the current adjustment period or configure the heading angle measured by the robot in real time as the feedback input for the next adjustment period of the angle closed-loop feedback adjustment device to perform PID adjustment on the PWM value for controlling the driving motor. In this embodiment, the closed-loop adjustment is set to PID adjustment; and set the real-time feedback adjustment result of the PWM value for controlling the driving motor as the first PWM value. Then, a first PWM value will be adjusted in each adjustment period and obtained in real time externally; then input the first PWM value into the driving motor to adjust the heading angle of the robot in real time until the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle changes within the preset angle error range or remains constant within the preset angle error range. Keep inputting the latest obtained first PWM value into the driving motor, and promote the closed-loop adjustment of the heading angle measured by the robot in real time by performing PID adjustment on the first PWM value to approach the target navigation angle, guiding the robot to walk along the direction corresponding to the target navigation angle; where the target navigation angle is pre-planned by the robot to guide the robot to walk along the pre-planned working path, and the target navigation angle is allowed to be modified. When the modification range of the target navigation angle is too large or the robot stops first and then restarts walking, it is necessary to re-execute steps S1 and S2. Generally, in the scenario of hitting an obstacle, stopping or turning around first, 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 gyroscope built in the robot.
[0077] The angle closed-loop feedback adjustment device can be divided into a first angle closed-loop feedback adjustment device and a second angle closed-loop feedback adjustment device. The first angle closed-loop feedback adjustment device is used to perform PID adjustment on the PWM value of the left driving motor, and the second angle closed-loop feedback adjustment device is used to perform PID adjustment on the PWM value of the right driving motor. The first angle closed-loop feedback adjustment device and the second angle closed-loop feedback adjustment device can be composed of PID controllers.
[0078] 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 by the robot in real time and the target navigation angle within the current regulation period 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 used to control the left drive motor; during the process of performing PID regulation on the PWM value used to control the left drive motor, the first angle closed-loop feedback regulation device outputs the latest PWM value used to control the left drive motor within the current regulation period, and the robot configures the difference between the PWM value used to control the left drive motor and the preset left target PWM value within the current regulation period as the feedback input for the next regulation period of the first angle closed-loop feedback regulation device, so as to narrow the difference between the PWM value used to control the left drive motor and the preset left target PWM value. As time increases, this difference becomes smaller until it equals zero, which can make the first angle closed-loop feedback regulation device enter a steady state, and then the heading angle measured 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 negative feedback regulation function. The robot will set the latest regulated output PWM value used to control 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 speed of the left drive motor. The current signal output by the left drive motor can be sampled to feedback the resistance situation borne by the left drive wheel on the walking surface; among them, on the premise of not considering external resistance (such as friction and collision factors), the real-time speed of the left drive motor is proportional to the first PWM value.
[0079] Meanwhile, when the absolute value of the angle difference between the heading angle measured by the robot in real time and the target navigation angle within the current adjustment period 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; during the process of performing 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 within the current adjustment period, and the robot configures the difference between the PWM value used to control the right drive motor and the preset right target PWM value within the current adjustment period as the feedback input for the next adjustment period to narrow the difference between the PWM value used to control the right drive motor and the preset right target PWM value. As time increases, this difference becomes smaller until it equals zero, enabling the second angle closed-loop feedback adjustment device to enter a steady state, and then 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 latest adjusted PWM value used to control the right drive motor as the first and second PWM value, and then input the first and second PWM value into the right drive motor to obtain the real-time speed of the right drive motor. The current signal output by the right drive motor can be sampled to feedback the resistance situation borne by the right drive wheel on the walking surface; among them, on the premise of not considering external resistance (such as friction and collision factors), the real-time speed of the right drive motor is proportional to the first and second PWM value.
[0080] 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 steady-state error of the drive wheel, 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 steady-state error of the drive wheel, 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. 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 the adjustment direction, the heading angle measured by the robot in real time 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 heading angle of the robot and the target navigation angle to change within the preset angle error range or maintain a constant value within the preset angle error range during the aforementioned PID adjustment process. It should be noted that in this embodiment, first, the robot measures the current heading angle in real time through a gyroscope. The real-time rotational speed of the left drive wheel is proportional to the PWM value used to control the left drive motor and there is a preset conversion relationship. The real-time rotational speed of the right drive wheel is proportional to the PWM value used to control the right drive motor and there is a preset conversion relationship. The radius of the left drive wheel is equal to the radius of the right drive wheel and they are symmetrically arranged on the left and right sides of the robot, so the circumference of the left drive wheel is equal to the circumference of the right drive wheel. The robot multiplies the difference between the real-time rotational speed of the left drive wheel and the real-time rotational speed of the right drive wheel by the circumference of the left drive wheel (or the circumference of the right drive wheel). The result of the multiplication is marked as the difference between the walking speed of the left drive wheel and the walking speed of the right drive wheel. Then, the ratio of the result of the multiplication to the body width of the robot is set as the angular velocity reached by the robot to adjust the walking direction. 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 calculated radian unit can be converted to an angle unit. Under the adjustment of the angle closed-loop feedback adjustment device, 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. Among them, 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.
[0081] In the foregoing embodiments of the angular closed-loop regulation, the first PWM value includes a first one PWM value and a first two PWM value; a left driving wheel is installed on the left side of the robot, and the left driving wheel is electrically connected to a left driving motor; a right driving wheel is installed on the right side of the robot, and the right driving wheel is electrically connected to a right driving motor. During the closed-loop regulation process, the absolute value of the difference between the real-time rotational speed of the left driving motor and the real-time rotational speed of the right driving motor can be positively correlated with the absolute value of the angular difference between the heading angle of the robot and the target navigation angle, that is, the larger the absolute value of the angular difference between the heading angle of the robot and the target navigation angle, the larger the absolute value of the difference between the real-time rotational speed of the left driving motor and the real-time rotational speed of the right driving motor, and the larger the rotational speed difference between the left and right driving wheels. However, the turning direction of the robot formed by the rotation of the left and right driving wheels is opposite to the deviation direction of the walking direction of the robot relative to the direction indicated by the target navigation angle, so as to reduce the absolute value of the angular difference between the heading angle of the robot and the target navigation angle, and form a negative feedback regulation of the angle.
[0082] As an embodiment of the air pressure closed-loop regulation, the method for closed-loop regulating the PWM value acting on the fan includes: when the absolute value of the air pressure difference between the fan suction force measured by the robot in real time and the target working suction force in the current regulation period is not within the preset air pressure error range, the robot controls the air pressure closed-loop feedback regulation device to perform PID regulation on the PWM value acting on the fan; during the process of performing PID regulation on the PWM value acting on the fan, the robot configures the difference between the PWM value acting on the fan and the second preset target PWM value in the current regulation period as the feedback input for the next regulation period, so as to reduce the difference between the PWM value acting on the fan and the second preset target PWM value, and set the PWM value acting on the fan as the second PWM value, and then input the second PWM value to the fan to generate a fan suction force; wherein, the fan suction force is positively correlated with the second PWM value; when the difference between the PWM value acting on the fan and the second preset target PWM value is less than the preset fan steady-state error, the absolute value of the air pressure difference between the fan suction force measured by the robot in real time and the target working suction force is within the preset air pressure error range value; wherein, a pressure sensor is provided at the air inlet of the fan of the robot for monitoring the fan suction force in real time.
[0083] Specifically, in the step S1, the robot can adjust the PWM value for controlling the fan through the air pressure closed-loop feedback adjustment device, and apply the second PWM value adjusted in real time to the fan. The motor inside the fan will change the output rotation speed, and then use the fan suction force formed corresponding to the changed rotation speed as the feedback input of the air pressure closed-loop feedback adjustment device to maintain the closed-loop adjustment, and indirectly perform the closed-loop adjustment of the fan suction force measured by the robot in real time. Therefore, the method for performing closed-loop adjustment on the PWM value for controlling the fan described in step S1 includes: when the absolute value of the air pressure difference between the fan suction force measured by the robot in real time and the target working suction force within the current adjustment cycle is not within the preset air pressure error range, the robot configures the absolute value of the air pressure difference between the fan suction force measured by the robot in real time and the target working suction force within the current adjustment cycle or the fan suction force measured by the robot in real time as the feedback input of the air pressure closed-loop feedback adjustment device in the next adjustment cycle to perform PID adjustment on the PWM value for controlling the fan. In this embodiment, the closed-loop adjustment is set as PID adjustment; and the real-time feedback adjustment result of the PWM value for controlling the fan is set as the second PWM value. Then, a second PWM value will be adjusted in each adjustment cycle and be obtained externally in real time to calculate the current walking resistance current value or the current relative walking resistance current value; then input the second PWM value into the fan to adjust the fan suction force in real time until the absolute value of the air pressure difference between the fan suction force measured by the robot in real time and the target working suction force within the current adjustment cycle changes within the preset air pressure error range or remains constant within the preset air pressure error range. Keep inputting the latest obtained second PWM value into the fan, and promote the closed-loop adjustment of the fan suction force measured by the robot in real time by performing PID adjustment on the second PWM value to approach the target working suction force. Among them, the target working suction force is preset by the robot to adapt to the air pressure situation of the walking surface where the robot is currently located; a pressure sensor is provided at the air inlet of the robot's fan to monitor the fan suction force in real time.
[0084] The method for closed-loop regulation of the PWM value used to control the fan includes: when the absolute value of the air pressure difference between the suction force of the fan measured by the robot in real time and the target working suction force within the current regulation cycle is not within the preset air pressure error range, the robot controls the air pressure closed-loop feedback regulation device to perform PID regulation on the PWM value used to control the fan; during the process of performing PID regulation on the PWM value used to control the fan, the robot configures the difference between the PWM value used to control the fan and the second preset target PWM value within the current regulation cycle as the feedback input of the air pressure closed-loop feedback regulation device in the next regulation cycle, so as to narrow the difference between the PWM value used to control the fan and the second preset target PWM value. As time increases, this difference becomes smaller until it equals zero, which can make the air pressure closed-loop feedback regulation device enter a steady state, and then the suction force of the fan measured by the robot in real time is relatively close to the target working suction force. The air pressure closed-loop feedback regulation device is a closed-loop control system with negative feedback regulation function. The robot will set the PWM value used to control the fan to the second PWM value, and then input the second PWM value into the fan to generate a fan suction force and apply it to the walking surface and the driving wheels; among them, the fan suction force is positively correlated with the second PWM value. When the difference between the PWM value used to control the fan and the second preset target PWM value is less than the preset fan steady-state error, the absolute value of the air pressure difference between the suction force of the fan measured by the robot in real time and the target working suction force changes within the preset air pressure error range or remains constant within the preset air pressure error range. Among them, the preset air pressure error range includes the value 0, and the dimension is the same as the dimension applicable to air pressure.
[0085] It should be noted that the method for the robot to sample the current signal output by the driving motor and obtain the driving wheel current sampling value includes: the robot samples the current signal output by the left driving motor through an analog-to-digital converter to obtain the left driving wheel current sampling value to reflect the motion state of the left driving wheel; at the same time, the robot samples the current signal output by the right driving motor through an analog-to-digital converter to obtain the right driving wheel current sampling value to reflect the motion state of the right driving wheel; among them, the driving wheel current sampling value includes the left driving wheel current sampling value and the right driving wheel current sampling value, the current signal output by the driving motor belongs to the PWM signal, and the driving wheel current sampling value can use the voltage value to represent the current change situation and feedback all types of forces borne by the driving wheels, including the force exerted by the driving torque output by the driving motor on the driving wheel (not an external resistance), and also including the walking resistance caused by the suction force generated by the fan applied to the driving wheel (not an external resistance), and also including the friction force determined by the ground medium (an external resistance), and the resistance force exerted by the obstacle colliding with the robot on the robot (an external resistance).
[0086] It should be noted that PID (Proportional Integral Derivative) regulation is a basic regulation method for control systems in classical control theory, and it is a linear regulation law with proportional, integral, and differential actions. It is widely used in industrial process control, especially suitable for deterministic control systems that can establish accurate mathematical models. When the structure and parameters of the controlled object cannot be fully grasped, or an accurate mathematical model cannot be obtained, and other techniques of control theory are difficult to apply, 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 the controlled object are not fully understood, or system parameters cannot be obtained through effective measurement means, PID control technology is most suitable. In actual PID regulation, there are also PI and PD controls. PID regulation is to calculate the control quantity based on the error of the system using proportion, integral, and differential for control. Increasing the proportional coefficient Kp can reduce the static error of the system. However, when Kp is too large, it will deteriorate the dynamic quality of the system, cause oscillation of the controlled quantity, and even lead to instability of the closed-loop system. A large integral coefficient Ti indicates weak integral action, and vice versa. Increasing Ti will slow down the process of eliminating the static error, but can reduce overshoot and improve stability. Increasing the differential coefficient Td will strengthen the differential action, help reduce overshoot, overcome oscillation, make the system tend to be stable, speed up the response speed of the system, reduce the adjustment time, and thus improve the dynamic performance of the system.
[0087] Based on the above embodiments of calculating the current relative walking resistance current value, when the first PWM value adopts the first one PWM value and the driving wheel current sampling value adopts the left driving wheel current sampling value, subtract the power change value caused by the first one PWM value in the closed-loop regulation from the left driving wheel current sampling value to obtain a first difference, then subtract the power change value caused by the second PWM value in the closed-loop regulation from the first difference to obtain a second difference, and then mark the second difference as the current walking resistance current value of the left driving wheel of the robot; or, subtract the relative power change value corresponding to the first one PWM value from the power change value of the left driving wheel current sampling value to obtain a first difference, then subtract the relative power change value corresponding to the second PWM value from the first difference to obtain a second difference, and then mark the second difference as the current relative walking resistance current value of the left driving wheel of the robot.
[0088] When the first PWM value uses the first and second PWM values and the drive wheel current sampling value uses the right drive wheel current sampling value, the power change value of the right drive wheel current sampling value minus the power change value caused by the first and second PWM values in the closed-loop regulation is used to obtain a first difference, and then the first difference is subtracted by the power change value caused by the second PWM value in the closed-loop regulation to obtain a second difference, and then the second difference is marked as the current walking resistance current value of the right drive wheel of the robot; or, when the first PWM value uses the first and second PWM values and the drive wheel current sampling value uses the right drive wheel current sampling value, the relative power change value of the right drive wheel current sampling value minus the relative power change value corresponding to the first and second PWM values is used to obtain a first difference, and then the first difference is subtracted by the relative power change value corresponding to the second PWM value to obtain a second difference, and then the second difference is marked as the current relative walking resistance current value of the right drive wheel of the robot.
[0089] Preferably, when the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, there are the following ways to adjust the suction of the fan: when the floor cleaning robot or the window cleaning robot needs to adjust the target fan suction of the closed-loop regulation, when the calculated current relative walking resistance current value of the robot is greater than the preset relative value or the value 0, the external resistance received by the robot on the currently traversed walking surface is increased compared with the external resistance received by the walking surface traversed last time. This change information of the external resistance can be understood as not being interfered by the current change value caused by the torque change of the driving motor output (equivalent to the interference of the acting force applied by the driving force factor) and the current change value caused by the change of the fan suction (equivalent to the interference of the acting force applied by the driving force factor), and is completely the result caused by the friction force of the walking surface of the external environment. Then reduce the target working suction to prevent the driving wheel from not rotating on the currently traversed walking surface due to the increase in the fan suction; if the calculated current relative walking resistance current value of the robot is less than the preset relative value or the value 0, the external resistance received by the robot on the currently traversed walking surface is reduced compared with the external resistance received by the walking surface traversed last time, then increase the target working suction to prevent the driving wheel from slipping on the currently traversed walking surface. Among them, the preset relative value can be set according to the second PWM value when the robot works normally on two walking surfaces with different friction forces successively. The normal operation of the robot means that when the robot works, there will be no situation where the fan suction is too large and the driving wheel cannot rotate, or the fan suction is too small and the driving wheel slips, nor will there be a problem that the driving wheel cannot rotate or slip due to the torque change of the driving motor output. First, place the robot on a material with a smaller friction force, adjust the second PWM value up and down so that the robot can work normally after using the fan suction regulated by the aforementioned closed-loop regulation. Then place the robot on a material with a larger friction force and fine-tune the second PWM value so that the robot can work normally after using the fan suction regulated by the aforementioned closed-loop regulation; then verify on surfaces with different friction forces whether the robot works normally according to the current second PWM value. If so, set the current relative walking resistance current value calculated according to the aforementioned step S1 and step S2 as the preset relative value; for the adjustment of the second PWM value, the second preset target PWM value can be changed through the air pressure closed-loop feedback adjustment device, thereby changing the second PWM value, or directly change the second PWM value.
[0090] The logic and / or steps represented in the flowchart or otherwise described herein can, for example, be considered a definitional sequence list of executable instructions for implementing a logical function, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable medium on which the program can be printed, as the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.
[0091] The above embodiments are only for illustrating the technical concept and features of the present invention, and the purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. It is not intended to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit and essence of the present invention should be covered within the protection scope of the present invention.
Claims
1. A robot collision detection method based on the relative walking resistance current value. 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 blower for generating suction force on the walking surface of the robot; it is characterized in that, The robot collision detection method includes: The robot performs closed-loop regulation on the PWM value for controlling the driving motor and determines the first PWM value obtained during the closed-loop regulation; the robot performs closed-loop regulation on the PWM value acting on the fan and determines the second PWM value obtained during the closed-loop regulation; after transmitting the first PWM value to the driving motor, the robot samples the current signal output by the driving motor to obtain the driving wheel current sampling value; Based on the driving wheel current sampling value, the first PWM value, and the second PWM value, calculate the current relative walking resistance current value of the robot, and then detect whether the robot is currently colliding based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold.
2. The robot collision detection method according to claim 1, wherein The method for detecting whether the robot is currently colliding based on the relationship between the current relative walking resistance current value of the robot and the preset collision current threshold includes: When the current relative walking resistance current value of the robot is greater than the preset collision current threshold, the robot is currently colliding on the walking surface; when the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, the robot is not currently colliding; Among them, the preset collision current threshold is applicable to detecting whether a collision occurs on the walking surfaces of different media for robots of the same type.
3. The robot collision detection method according to claim 2, characterized in that, When the current relative walking resistance current value of the robot is greater than the preset collision current threshold, the obstacle with which the robot collides is on the walking surface of the same medium, and then the robot changes its current walking direction to avoid knocking away the obstacle or walking to the walking surface of other media.
4. The robot collision detection method according to claim 2, wherein, The current relative walking resistance current value of the robot is the difference between the current walking resistance current value calculated by the robot after the preset sampling time and the reference walking resistance current value calculated within the preset sampling time; Within the preset sampling time, the robot has started walking and is not in a stationary state.
5. The robot collision detection method according to claim 4, wherein After the robot starts walking on the walking surface, within the preset sampling time, sequentially subtract the reference power change value corresponding to the first PWM value and the reference power change value corresponding to the second PWM value from the reference power change value corresponding to the driving wheel current sampling value to determine the reference walking resistance current value calculated within the preset sampling time; among them, within the preset sampling time, the rotation speed of the driving motor is linearly related to the first PWM value used to control the driving motor; After the robot has walked through the preset sampling time, sequentially subtract the power change value caused by the first PWM value and the power change value caused by the second PWM value from the driving wheel current sampling value to determine the current walking resistance current value calculated by the robot after the preset sampling time.
6. The robot collision detection method according to claim 5, wherein The method for calculating the current relative walking resistance current value of the robot based on the driving wheel current sampling value, the first PWM value, and the second PWM value includes: The robot starts from rest until it begins to move to overcome static friction. Then, within a preset sampling time, the robot calculates a first reference PWM value based on all the obtained first PWM values, calculates a second reference PWM value based on all the obtained second PWM values, and calculates a reference drive wheel current value based on all the obtained drive wheel current sampling values. Then, the product of the first reference PWM value and the first conversion coefficient is marked as the reference power change value corresponding to the first PWM value, the product of the second reference PWM value and the second conversion coefficient is marked as the reference power change value corresponding to the second PWM value, and the reference drive wheel current value is marked as the reference power change value corresponding to the drive wheel current sampling value. Then, it controls the reference power change value corresponding to the currently marked drive wheel current sampling value to subtract the reference power change value corresponding to the currently marked first PWM value and the reference power change value corresponding to the currently marked second PWM value in sequence, and then sets the result of the subtraction as the reference walking resistance current value calculated within the preset sampling time. After the preset sampling time, the robot marks the real-time obtained first PWM value as the first PWM value to be measured and marks the real-time obtained second PWM value as the second PWM value to be measured. Then, the product of the first PWM value to be measured and the first conversion coefficient is marked as the power change value caused by the first PWM value, and the product of the second PWM value to be measured and the second conversion coefficient is marked as the power change value caused by the second PWM value. Then, it controls the real-time obtained drive wheel current sampling value to subtract the power change value caused by the currently marked first PWM value and the power change value caused by the currently marked second PWM value in sequence, and then sets the result of the subtraction as the current walking resistance current value calculated after the preset sampling time. Then it controls the current walking resistance current value calculated after the preset sampling time to subtract the reference walking resistance current value calculated within the preset sampling time, and then sets the result of the subtraction as the current relative walking resistance current value of the robot to reflect the external resistance difference borne by the robot between the walking surfaces it has passed through inside and outside the preset sampling time.
7. The robot collision detection method according to claim 2, characterized in that, The method for calculating the current relative walking resistance current value of the robot based on the drive wheel current sampling value, the first PWM value, and the second PWM value includes: The robot starts from rest until it begins to move to overcome static friction. Then, within a preset sampling time, the robot calculates a first reference PWM value based on all the obtained first PWM values, calculates a second reference PWM value based on all the obtained second PWM values, and calculates a reference drive wheel current value based on all the obtained drive wheel current sampling values. Among them, within the preset sampling time, the rotational speed of the drive motor is linearly related to the first PWM value used to control the drive motor. After the preset sampling time, the robot marks the first PWM value obtained in real time as the first PWM value to be measured, marks the second PWM value obtained in real time as the second PWM value to be measured, marks the difference between the driving wheel current sampling value obtained in real time and the driving wheel reference current value as the relative power change value of the driving wheel current sampling value, marks the product of the difference between the first PWM value to be measured and the first reference PWM value and the first conversion coefficient as the relative power change value corresponding to the first PWM value, and marks the product of the difference between the second PWM value to be measured and the second reference PWM value and the second conversion coefficient as the relative power change value corresponding to the second PWM value; Then, control the relative power change value of the driving wheel current sampling value minus the relative power change value corresponding to the first PWM value to obtain a first difference; then subtract the relative power change value corresponding to the second PWM value from the first difference to obtain a second difference; then mark the second difference as the current relative walking resistance current value of the robot.
8. The robot collision detection method according to claim 6 or 7, characterized in that, The method for calculating the first reference PWM value based on all the obtained first PWM values within the preset sampling time includes: taking the average of all the obtained first PWM values within the preset sampling time to obtain the first reference PWM value; or, screening out the first PWM value with the largest value from all the obtained first PWM values within the preset sampling time to determine the first reference PWM value; The method for calculating the second reference PWM value based on all the obtained second PWM values within the preset sampling time includes: taking the average of all the obtained second PWM values within the preset sampling time to obtain the second reference PWM value; or, screening out the second PWM value with the largest value from all the obtained second PWM values within the preset sampling time to determine the second reference PWM value; The method for calculating the driving wheel reference current value based on all the obtained driving wheel current sampling values within the preset sampling time includes: taking the average of all the obtained driving wheel current sampling values within the preset sampling time to obtain the driving wheel reference current value; or, screening out the driving wheel current sampling value with the largest value from all the obtained driving wheel current sampling values within the preset sampling time to determine the driving wheel reference current value; Among them, the first PWM value is used to control the output torque change of the driving motor to feedback and form one of the power change values in the driving wheel current sampling value; the second PWM value is used to control the suction change of the fan to feedback and form the other power change value in the driving wheel current sampling value.
9. The robot collision detection method according to claim 2, wherein, On the premise that the current relative walking resistance current value of the robot is greater than the preset collision current threshold, if the calculated current relative walking resistance current value is larger, it is determined that the static friction force borne by the obstacle collided by the robot on the walking surface is greater; The static friction force borne by the obstacle changes with the change of the medium of the walking surface where it is located; On the premise that the current relative walking resistance current value of the robot is less than or equal to the preset collision current threshold, during the walking process of the robot, the calculated current relative walking resistance current value changes, and the medium type of the walking surface contacted by the robot changes.
10. The robot collision detection method according to claim 8, wherein When the medium of the walking surface that the robot has walked on within the preset sampling time is the same as the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the walking surface contacted at the preset starting position; wherein, the robot keeps walking on the walking surface of the same medium within the preset sampling time; Or, when the medium of the walking surface that the robot has walked on within the preset sampling time is different from the medium at the preset starting position, the current relative walking resistance current value of the robot is used to represent the electric quantity value corresponding to the difference between the external resistance borne by the robot when walking on the current walking surface and the external resistance borne by the walking surface that the robot has walked on within the preset sampling time; Wherein, the preset starting position is the starting position where the robot starts to walk after starting from rest.
11. The robot collision detection method according to claim 1, wherein, 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 by the robot in real time and the target navigation angle is not within the preset angle error range within the current regulation period, for the drive motor correspondingly connected to the drive wheel installed on each side of the robot, the robot performs PID regulation on the PWM value for controlling the drive motor. During the process of performing PID regulation on 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 within the current regulation period is used as the feedback input for the next regulation period 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 the first PWM value, and then the first PWM value is input into the corresponding side drive motor in real time to obtain the drive wheel current sampling value output by the drive motor on that side. Among them, the real-time rotation speed of the drive motor is positively correlated with the first PWM value; For the drive motor correspondingly connected to the drive wheel installed on each side of the robot, when the difference between the PWM value for controlling the drive motor on the corresponding side and the first preset target PWM value is less than the corresponding preset drive wheel steady-state error, the robot adjusts the walking direction based on the difference between the real-time rotation speeds of the drive motors on both sides to guide the absolute value of the angle difference between the heading angle and the target navigation angle of the robot to be within the preset angle error range; wherein, the absolute value of the angle difference between the heading angle and the target navigation angle of the robot is positively correlated with the absolute value of the difference between the real-time rotation speeds of the drive motors correspondingly connected to the drive wheels installed on both sides of the robot; Wherein, the heading angle of the robot is measured in real time by a gyroscope built in the robot; each of the drive wheels installed on the left and right sides of the robot is connected to a drive motor.
12. The robot collision detection method according to claim 1, wherein, The method for closed-loop regulation of the PWM value acting on the fan includes: When the absolute value of the air pressure difference between the suction force of the fan measured by the robot in real time and the target working suction force within the current adjustment cycle is not within the preset air pressure error range, the robot controls the air pressure closed-loop feedback adjustment device to perform PID adjustment on the PWM value acting on the fan; during the process of performing PID adjustment on the PWM value acting on the fan, the robot configures the difference between the PWM value acting on the fan and the second preset target PWM value within the current adjustment cycle as the feedback input for the next adjustment cycle to narrow the difference between the PWM value acting on the fan and the second preset target PWM value, and sets the PWM value acting on the fan to the second PWM value, and then inputs the second PWM value into the fan to generate a fan suction force; wherein, the fan suction force is positively correlated with the second PWM value; When the difference between the PWM value acting on the fan and the second preset target PWM value is less than the preset fan steady-state error, the absolute value of the air pressure difference between the fan suction force measured by the robot in real time and the target working suction force is within the preset air pressure error range value; Wherein, a pressure sensor is arranged at the air inlet of the fan of the robot for monitoring the fan suction force in real time.
Citation Information
Patent Citations
Methods for adjusting fan suction in extreme situations
CN111852925B
Method for detecting walking resistance current value of robot
CN115656607A