High-Efficiency Automatic Recharging Mechanism for Cleaning Robot Using Multi-Sensor

Cleaning robot has the highest penetration rate among the service robots. This paper proposes a high-efficiency mechanism for an intelligent cleaning robot automatically returns to charging in a short time when the power is insufficient. The proposed mechanism initially combines the robot’s own motor encoder with neural network linear regression to calculate the moving distance and rotation angle for the location estimation of the robot itself. At the same time, a self-rotating camera is applied to scan the number of infrared spots on the docking station to find the location of the docking station so that the cleaning robot returns to charging properly in two stages, existing infrared range and extended infrared range. In addition, six-axis acceleration and ultrasound are both applied to deal with the angle error that is caused by collision. Experimental results show that the proposed recharging mechanism significantly improves the efficiency of recharging.


Introduction
In recent years, mobile robots are being widely used in industrial automation, home automation, hospitals, entertainment, space exploration, military, etc [1][2][3][4][5][6][7][8][9][10][11][12][13]. Due to the decreased size and the low cost of mobile robots, more and more mobile robots are now working around us and they will help us a lot in our daily lives, such as cooking, cleaning, house plant watering, pet feeding, and taking care of children [1][2][3][4][5]. In order to complete these tasks continuously and efficiently, many auto-recharging methods have been proposed.
Currently efficient auto-recharging methods can be generally classified into three types. (1) In simultaneous localization and mapping (SLAM), the robot starts from an unknown environment and acts in this environment, and continuously repeats the information of the environment to achieve its own positioning and status. Then, build an environmental map one by one based on the surrounding environment information constructed by its own location [14][15][16][17][18][19]. Lidar SLAM has high measurement accuracy but is expensive. Camera SLAM is cheaper but the disadvantage is that if the image is large, the calculation is complicated. (2) In wireless positioning and recharging, the strength of the received wireless signal is used to estimate the position of the docking station by using wireless signals to sense the position of the docking station, such as Bluetooth, WiFi or ZigBee wireless communication [20][21][22][23]. Depending on the wireless device, the requirements of the corresponding environment are different.

Introduction to the Testing Cleaning Robot
The testing robot in this paper is a teaching robot produced by American IRobot company, as shown in Figure 1. User communicates with the robot through RS-232 communication interface. Based on this robot, we combine Arduino platform, Raspberry Pi 3, cameras, and ultrasonic sensors to design an automatic return charging mechanism. Figure 2 shows the overall structure of the robot. The hardware setting and the proposed mechanism are introduced in the following subsections.
RS-232 is a serial-type data transmission. It is a bit-by-bit character transfer method. Most of them use the RX and TX pins to communicate with each other. The robot uses the RX to receive the instructions from the Arduino and the TX transfers the state of the robot to the Arduino. The robot has three modes: (1) Passive mode, enable the robot, but cannot modify the parameters of the internal sensor. (2) Safe mode, enable the robot, and modify the parameters of the internal sensor, but some sensors will be restricted. (3) Full mode, has the second function above and no restrictions of sensor modification. This paper adopts mode (3). Based on the official specifications [5], its control instruction is Opcode (Open Interface control instruction), including Start, Stop, Drive, Drive Direct, which represent start, stop, forward/backward, and rotation, respectively. These commands are used to control robot. We set the speed value of the wheel, so that the robot can travel at this speed and turn left/right. For example, if the speed value is 50, then the robot advances at a speed of 50 mm/s. In the sweeping function, the clean robot has three functions: random-path cleaning, spiral-path cleaning, and square-path cleaning. In the part that automatically returns to the charging, the signal that is emitted by the infrared sensor of the docking station is used, and during the traveling, the infrared signal is continuously scanned to guide the cleaning robot to return to the docking station for charging. In the sweeping function, the clean robot has three functions: random-path cleaning, spiral-path cleaning, and square-path cleaning. In the part that automatically returns to the charging, the signal that is emitted by the infrared sensor of the docking station is used, and during the traveling, the infrared signal is continuously scanned to guide the cleaning robot to return to the docking station for charging.

Arduino for Calculating Travel Distance and Direction Angle
The general mechanism of the cleaning robot cannot know its position when performing work tasks. When returning to the docking station for charging, it can only rely on the only infrared scanning function, but even if the infrared scanning function is used, the cleaning robot is not in the docking station. In the range of the infrared signal sent, it takes a long time to recharge. In order to solve this problem, the embedded platform Arduino is used as the platform for robot control. Through this platform, the travel distance and direction angle are calculated, as shown in Figure 3.  In the sweeping function, the clean robot has three functions: random-path cleaning, spiral-path cleaning, and square-path cleaning. In the part that automatically returns to the charging, the signal that is emitted by the infrared sensor of the docking station is used, and during the traveling, the infrared signal is continuously scanned to guide the cleaning robot to return to the docking station for charging.

Arduino for Calculating Travel Distance and Direction Angle
The general mechanism of the cleaning robot cannot know its position when performing work tasks. When returning to the docking station for charging, it can only rely on the only infrared scanning function, but even if the infrared scanning function is used, the cleaning robot is not in the docking station. In the range of the infrared signal sent, it takes a long time to recharge. In order to solve this problem, the embedded platform Arduino is used as the platform for robot control. Through this platform, the travel distance and direction angle are calculated, as shown in Figure 3.

Arduino for Calculating Travel Distance and Direction Angle
The general mechanism of the cleaning robot cannot know its position when performing work tasks. When returning to the docking station for charging, it can only rely on the only infrared scanning function, but even if the infrared scanning function is used, the cleaning robot is not in the docking station. In the range of the infrared signal sent, it takes a long time to recharge. In order to solve this problem, the embedded platform Arduino is used as the platform for robot control. Through this platform, the travel distance and direction angle are calculated, as shown in Figure 3.

Infrared LED and Camera
The automatic back to charging method of the clean robot is to continuously scan the infrared sensor signal on the charging stand by using the infrared sensor on the clean robot. Figure 4 shows the emission range of the infrared light. In this range, the clean robot can return to charging once it detects the infrared signal. However, outside the range, the robot itself does not know that the docking station is beside and thus walks randomly or even away from the docking station. In order to improve the above situation, we added three infrared LEDs to the docking station to increase the exiting infrared signal range. Since the infrared sensor cannot detect the added infrared LED, it is necessary to use the camera and process the image captured with the Raspberry Pi 3, as shown in Figures 5 and 6.
In order to confirm the range of the camera after adding the camera, as shown in Figure 7, the black dotted circle is the position where the cleaning robot is placed, and the upper figure is the angle corresponding to the docking station. We first placed the robot from the middle of the 70-degree position, and watched whether the camera had infrared light. After testing, it was found that the range of shooting was up to 90 degrees.
If you want to increase the range to more than 100 degrees, then you need to add more LEDs, but in fact the 90-degree range is enough for the robot to return to the docking station correctly, as shown in Table 1.

Infrared LED and Camera
The automatic back to charging method of the clean robot is to continuously scan the infrared sensor signal on the charging stand by using the infrared sensor on the clean robot. Figure 4 shows the emission range of the infrared light. In this range, the clean robot can return to charging once it detects the infrared signal. However, outside the range, the robot itself does not know that the docking station is beside and thus walks randomly or even away from the docking station.

Infrared LED and Camera
The automatic back to charging method of the clean robot is to continuously scan the infrared sensor signal on the charging stand by using the infrared sensor on the clean robot. Figure 4 shows the emission range of the infrared light. In this range, the clean robot can return to charging once it detects the infrared signal. However, outside the range, the robot itself does not know that the docking station is beside and thus walks randomly or even away from the docking station. In order to improve the above situation, we added three infrared LEDs to the docking station to increase the exiting infrared signal range. Since the infrared sensor cannot detect the added infrared LED, it is necessary to use the camera and process the image captured with the Raspberry Pi 3, as shown in Figures 5 and 6.
In order to confirm the range of the camera after adding the camera, as shown in Figure 7, the black dotted circle is the position where the cleaning robot is placed, and the upper figure is the angle corresponding to the docking station. We first placed the robot from the middle of the 70-degree position, and watched whether the camera had infrared light. After testing, it was found that the range of shooting was up to 90 degrees.
If you want to increase the range to more than 100 degrees, then you need to add more LEDs, but in fact the 90-degree range is enough for the robot to return to the docking station correctly, as shown in Table 1.  In order to improve the above situation, we added three infrared LEDs to the docking station to increase the exiting infrared signal range. Since the infrared sensor cannot detect the added infrared LED, it is necessary to use the camera and process the image captured with the Raspberry Pi 3, as shown in Figures 5 and 6.
In order to confirm the range of the camera after adding the camera, as shown in Figure 7, the black dotted circle is the position where the cleaning robot is placed, and the upper figure is the angle corresponding to the docking station. We first placed the robot from the middle of the 70-degree position, and watched whether the camera had infrared light. After testing, it was found that the range of shooting was up to 90 degrees.
If you want to increase the range to more than 100 degrees, then you need to add more LEDs, but in fact the 90-degree range is enough for the robot to return to the docking station correctly, as shown in Table 1.

Infrared LED and Camera
The automatic back to charging method of the clean robot is to continuously scan the infrared sensor signal on the charging stand by using the infrared sensor on the clean robot. Figure 4 shows the emission range of the infrared light. In this range, the clean robot can return to charging once it detects the infrared signal. However, outside the range, the robot itself does not know that the docking station is beside and thus walks randomly or even away from the docking station. In order to improve the above situation, we added three infrared LEDs to the docking station to increase the exiting infrared signal range. Since the infrared sensor cannot detect the added infrared LED, it is necessary to use the camera and process the image captured with the Raspberry Pi 3, as shown in Figures 5 and 6.
In order to confirm the range of the camera after adding the camera, as shown in Figure 7, the black dotted circle is the position where the cleaning robot is placed, and the upper figure is the angle corresponding to the docking station. We first placed the robot from the middle of the 70-degree position, and watched whether the camera had infrared light. After testing, it was found that the range of shooting was up to 90 degrees.
If you want to increase the range to more than 100 degrees, then you need to add more LEDs, but in fact the 90-degree range is enough for the robot to return to the docking station correctly, as shown in Table 1.

Six-Axis Sensors
The MPU-6050 six-axis sensor, as shown in Figure 8, is composed of an accelerometer and a gyroscope that calculate the current direction or angle of the robot. Specifications are shown in Table 2.

Six-Axis Sensors
The MPU-6050 six-axis sensor, as shown in Figure 8, is composed of an accelerometer and a gyroscope that calculate the current direction or angle of the robot. Specifications are shown in Table 2.

Six-Axis Sensors
The MPU-6050 six-axis sensor, as shown in Figure 8, is composed of an accelerometer and a gyroscope that calculate the current direction or angle of the robot. Specifications are shown in Table 2.

Without Adding Three Infrared LEDs
With Adding Three Infrared LEDs Infrared signal range (degree) 60 60-90

Six-Axis Sensors
The MPU-6050 six-axis sensor, as shown in Figure 8, is composed of an accelerometer and a gyroscope that calculate the current direction or angle of the robot. Specifications are shown in Table 2.

Proposed Mechanism
This section mainly combines neural network-linear regression with the proposed sensing techniques, including self-rotating camera, six-axis sensors, and ultrasonic sensors to propose a high-efficiency recharging mechanism.

Neural Network-Linear Regression
We review neural network in case of linear regression for later use before introducing the proposed mechanism for a clean robot automatically returns to charging. A neuron with label y j receives an input x i from predecessor neurons by a connection assigned a weight w ji .
The error e j between real output d j and y j is then rewritten as The total error is 1 2 which implies 1 2 By introducing a parameter η called learning rate, the new weighting W new j is obtained by As shown in Figure 9, this expression means that each input will correspond to a different weight, and the output is multiplied by the weight to calculate the input of the next layer, and the weight is continuously updated until convergence to obtain the continuous output finally. The distance D traveled by the cleaning robot is generally defined by

. Travel Distance Estimation
The distance D traveled by the cleaning robot is generally defined by where v is the speed value of the wheel; d t is the duration of the walking (in milliseconds); and, d t /100 denotes time calculation unit of 100 milliseconds. Replacing d t /100 by t, equation (7) can be rewritten as In other words, 1 s is equal to 1000 ms/100 ms = 10 which means t = 10. If the travel time is 2 s then D(2) = v(2 × 10). In order to verify the efficiency of formula in (2), we perform a series of experiments and the results are shown in Table 3. By the relation, distance error = actual travel distance − estimated travel distance, these results indicate that the longer the time, the greater the error, as shown in Figure 10. In order to reduce the distance error in Table 1, we apply neural network-linear regression in section A to find the curve f error in Figure 6 sketched by the distance error by where W = · · · w i · · · T , X = · · · x i · · · T , and η = 0.0001. When the number of iterations reaches 500 times, the error has become saturated. Therefore, we train 500 times and compare the estimated travel distance with the actual travel distance. The results are shown in Table 4. The estimated distance between the traveled distance and the actual travel distance can be improved a lot. However, when the walking time reaches 30 to 40 s, the actual travel distance is gradually smaller than the estimated travel distance, but, when considering that the robot delay time (100ms) When the number of iterations reaches 500 times, the error has become saturated. Therefore, we train 500 times and compare the estimated travel distance with the actual travel distance. The results are shown in Table 4. The estimated distance between the traveled distance and the actual travel distance can be improved a lot. However, when the walking time reaches 30 to 40 s, the actual travel distance is gradually smaller than the estimated travel distance, but, when considering that the robot used in the home is not Continuous straight line travels for 30 s, and the method of this method will recalculate the distance as long as the robot collides or detects obstacles, so the part after 30 s is not considered.

Rotation Angle Estimation
To get the location of the robot in addition to the estimated travel distance, we need to know the rotation angle of robot's body itself by the formula in Equation (11).
where θ is the rotation angle of the robot; E R is the speed value of the right wheel; E L is the speed value of the left wheel; and, L is the distance between the left wheel and the right wheel. The time part of formula (11) can also be replaced by t according to the method of the previous section, and can be obtained formula (12).
In order to verify the efficiency of the formula (12), we have a series of tests and the results are shown in Table 5. From the results, the longer the duration of rotation, the angle error becomes ever larger. According to the estimated rotation angle, the actual rotation angle is smaller than the estimated rotation angle, so that we have the relation actual rotation angle = estimated rotation angle − angle error. In order to reduce the angle error in Table 5, we apply neural network-linear regression in section A to find the curve θ error in Figure 11 sketched by the angle error as the following two formulas. where W = · · · w i · · · T , X = · · · x i · · · T . to find the curve error θ in Figure 11 sketched by the angle error as the following two formulas.
where [ ]  When the number of trainings is 300 to 500 times, the resulting angular error is already close to zero. Therefore, we train 300 times and compare the estimated rotation angle with the actual rotation angle. The results are shown in Table 6. The estimated distance between the traveled distance and the actual travel distance can be improved a lot. When the number of trainings is 300 to 500 times, the resulting angular error is already close to zero. Therefore, we train 300 times and compare the estimated rotation angle with the actual rotation angle. The results are shown in Table 6. The estimated distance between the traveled distance and the actual travel distance can be improved a lot.

Cleaning Robot Position Estimation
After we estimate the distance and rotation angle of the robot by compensation, we can estimate the position of the robot. Based on the Cartesian coordinate system, the location of the docking station is set to (0, 0) and then the position of the robot is calculated by the following formula.
where D corresponds to the travel distance and 90 − θ is the rotation angle between the robot and the x-axis, as shown in Figure 12.
After we estimate the distance and rotation angle of the robot by compensation, we can estimate the position of the robot. Based on the Cartesian coordinate system, the location of the docking station is set to (0, 0) and then the position of the robot is calculated by the following formula. cos(90 ) , (0 2 ) sin(90 ) where D corresponds to the travel distance and 90 − is the rotation angle between the robot and the x-axis, as shown in Figure 12. The compensation of travel distance and rotation angle are calculated in Arduino to obtain robot's Cartesian coordinate. In addition, we use USB to connect Arduino and Rasberry pi, so that we can observe robot's Cartesian coordinate on end device by Rasberry pi, as shown in Figure 13. The compensation of travel distance and rotation angle are calculated in Arduino to obtain robot's Cartesian coordinate. In addition, we use USB to connect Arduino and Rasberry pi, so that we can observe robot's Cartesian coordinate on end device by Rasberry pi, as shown in Figure 13.

Self-Rotating Camera for Searching Docking Station
In order to adjust the robot until it enters the exiting infrared signal range, we propose a searching method for the self-rotating camera combined with the angle and distance estimation proposed in the previous section. This search method is described, as follows. When the infrared spot is captured via the HoughCircles function [30], it is judged whether the docking station is currently on the left or the right side of the robot according to the current estimated angle and distance, and proceeds in the direction of the judgment. This method will be used repeatedly until the infrared spot changes from one to two, indicating that it enters the infrared signal range (60° range), because in the 90° range, only one infrared spot is captured. Moreover, we can compare the actual distance between the robot and the docking station from Table 7, thereby eliminating the distance error.

Self-Rotating Camera for Searching Docking Station
In order to adjust the robot until it enters the exiting infrared signal range, we propose a searching method for the self-rotating camera combined with the angle and distance estimation proposed in the previous section. This search method is described, as follows. When the infrared spot is captured via the HoughCircles function [30], it is judged whether the docking station is currently on the left or the right side of the robot according to the current estimated angle and distance, and proceeds in the direction of the judgment. This method will be used repeatedly until the infrared spot changes from one to two, indicating that it enters the infrared signal range (60 • range), because in the 90 • range, only one infrared spot is captured. Moreover, we can compare the actual distance between the robot and the docking station from Table 7, thereby eliminating the distance error.  10 25-33 20 25

Collision Angle Error Compensation by Six-Axis Sensors
During the execution of the mission, the clean robot may collide with obstacles. When it hits an obstacle, the robot may have a collision displacement. This collision displacement will cause the robot's angle to change. In order to correct the collision offset, this paper uses six-axis sensors (MPU-6050) to compensate for collision error angles. As shown in Table 8, there are about 10 • of error between estimated angle and actual angle due to the collision. In order to reduce the error, we adopt six-axis sensor with two parts: accelerometer and Gyroscope. The values read by the accelerometer and Gyroscope in the six-axis sensor are shown in Figure 14.

The Part of the Accelerometer
Since the clean robot is traveling horizontally, we calculate the angle φ acce between the Z-axis and the X-axis of the accelerometer by using the values read by the accelerometer in the six-axis sensor, az and ax, respectively.
where acz = az/accesen, acx = ax/accesen, and accesen is the sensitivity of the accelerometer with unit LSB/g.

The Part of the Gyroscope
The gyroscope is mainly designed to measure the angular velocity, based on the theory of conservation of angular momentum. The angular velocity of rotation shown in Figure 15 is usually expressed in dps ( • /s). Since the robot is traveling in a horizontal state, we mainly do angular offset compensation for the Z-axis. If only the Z-axis is rotated, then the X and Y axes output is 0 and the Z-axis output is the angular velocity of rotation.
where gz(t) is the raw value read by the gyroscope and gyrosen is the sensitivity of the gyroscope.
Then, the rotation angle gyro φ along z-axis is calculated by There are advantages and disadvantages in both methods. Accelerometers are prone to error interference during fast vibration (high frequency). The gyroscope is prone to drift problems in an almost stationary (low frequency) state. In order to estimate collision offset, we introduce a parameter Accordingly, the collision angle error compensation is completed. The detail of six-axis sensor usage process is shown in Figure 16. We first calculate the angular velocity v z along Z-axis by v z (t) = gz(t)/gyrosen (17) where gz(t) is the raw value read by the gyroscope and gyrosen is the sensitivity of the gyroscope. Then, the rotation angle φ gyro along z-axis is calculated by There are advantages and disadvantages in both methods. Accelerometers are prone to error interference during fast vibration (high frequency). The gyroscope is prone to drift problems in an almost stationary (low frequency) state. In order to estimate collision offset, we introduce a parameter α (0 < α < 1) in an equation defined by Accordingly, the collision angle error compensation is completed. The detail of six-axis sensor usage process is shown in Figure 16. Accordingly, the collision angle error compensation is completed. The detail of six-axis sensor usage process is shown in Figure 16.

Avoid Obstacles with Ultrasonic Sensors
When the speed of the clean robot is fast, the collision of the object will result in a large angular offset due to the impact force and the six-axis sensor detection speed cannot keep up with the compensation failure. To solve this problem, as shown in Figures 17 and 18, we use the three ultrasonic sensors that are installed on the clean robot to immediately perform the direction change action when the cleaning robot detects obstacles around it, so as to avoid collisions with obstacles.

Avoid Obstacles with Ultrasonic Sensors
When the speed of the clean robot is fast, the collision of the object will result in a large angular offset due to the impact force and the six-axis sensor detection speed cannot keep up with the compensation failure. To solve this problem, as shown in Figures 17 and 18, we use the three ultrasonic sensors that are installed on the clean robot to immediately perform the direction change action when the cleaning robot detects obstacles around it, so as to avoid collisions with obstacles.

The Proposed Machanism
This paper mainly enables the robot automatically recharging with high efficiency. Based on subsections A-F, the entire automatic recharging mechanism is proposed, as shown in Figure 19, which is presented, as follows: Step 1.
Enable clean robot and perform certain tasks. Step 2.
Enable recharge instruction. If clean robot receives the recharging instruction, we determine the current position of clean robot and enable recharge function proposed in step 3 and step 4. Otherwise go back to step 1.
Setting a threshold to enable six-axis sensor or ultrasonic. Six-axis sensor is enabled to compensate the angle error caused by collision when the travel speed is slow while ultrasonic is enabled to avoid obstacles when the travel speed is fast.
Calculate clean robot's angle and capture infrared spot via the HoughCircles function to judge whether the charging dock is currently on the left or the right side of the robot according to the current estimated angle and distance, and proceeds in the direction of the judgment. This action repeats until the infrared spot changes from one to two, indicating that it enters the infrared signal range (60 • range). Once the infrared spot changes from one to two, go to step 5.
Enable infrared scanning until the robot returns to charging correctly.
judge whether the charging dock is currently on the left or the right side of the robot according to the current estimated angle and distance, and proceeds in the direction of the judgment. This action repeats until the infrared spot changes from one to two, indicating that it enters the infrared signal range (60° range). Once the infrared spot changes from one to two, go to step 5.
Step 5. Enable infrared scanning until the robot returns to charging correctly. Figure 19. Auto-recharging mechanism for cleaning robot.

Experimental Results
The experimental environment is 275 cm long and 254 cm wide with obstructions, as shown in Figure 20. The black circle is the starting position of the clean robot, and the charging dock placed behind the black circle. Figure 19. Auto-recharging mechanism for cleaning robot.

Experimental Results
The experimental environment is 275 cm long and 254 cm wide with obstructions, as shown in Figure 20. The black circle is the starting position of the clean robot, and the charging dock placed behind the black circle.

Collision Angle Compensation
In order to verify that the angle compensation of the six-axis accelerometer has not been added, we compare the robot's actual position and angle per minute. The experimental results are shown in Table 9. It can be found that the actual position, angle, and estimated position and angle are greatly different. In order to solve this problem, a six-axis accelerometer is added. The corrected results are shown in Table 10. After the addition of the six-axis sensor, the collision angle compensation is smaller than the original without added angle error, and the estimated position is within 50 cm from the actual position.
Although the accuracy of the traveling speed of 50 (mm/s) is improved after being compensated by the six-axis sensor, in comparison with the traveling speed of 200 (mm/s), as shown in Table 11, the error bias can be known. Big. The reason is that the faster the moving speed of the sweeping robot, the more the impact force will cause the angular offset to be large and the detection speed of the sixaxis sensor cannot keep up, which will cause the compensation failure. To solve this problem, we use the three ultrasonic sensors. When the clean robot detects obstacles around it, then it can immediately

Collision Angle Compensation
In order to verify that the angle compensation of the six-axis accelerometer has not been added, we compare the robot's actual position and angle per minute. The experimental results are shown in Table 9. It can be found that the actual position, angle, and estimated position and angle are greatly different. In order to solve this problem, a six-axis accelerometer is added. The corrected results are shown in Table 10. After the addition of the six-axis sensor, the collision angle compensation is smaller than the original without added angle error, and the estimated position is within 50 cm from the actual position.
Although the accuracy of the traveling speed of 50 (mm/s) is improved after being compensated by the six-axis sensor, in comparison with the traveling speed of 200 (mm/s), as shown in Table 11, the error bias can be known. Big. The reason is that the faster the moving speed of the sweeping robot, the more the impact force will cause the angular offset to be large and the detection speed of the six-axis sensor cannot keep up, which will cause the compensation failure. To solve this problem, we use the three ultrasonic sensors. When the clean robot detects obstacles around it, then it can immediately perform the action of changing direction, avoiding collisions with obstacles, and avoiding angle errors that are caused by collisions. Table 12 shows the results of the experiment after adding the ultrasonic sensor. It can be found that the problem of the angle caused by the collision after the addition of the ultrasonic sensor is greatly improved, but the longer the walking time, the position of the estimation is gradually caused by the problem of the error accumulation. There is a gap in the actual location.

Comparison between General-Type Auto-Recharging Mechanism and the Proposed Auto-Recharging Mechanism
This section compares the general-type recharge mechanism with the mechanism proposed in this paper. The general-type recharging mechanism has only the basic infrared detection recharging function without additional sensors and method for calculating its position. The mechanism that is proposed in this paper combines a variety of sensors to estimate the approximate position of the robot and thus proposed a new mechanism of automatic recharging. The comparison between the general-type recharging mechanism and the proposed mechanism is as follows.
The experiment is divided into two parts. In the first part, the cleaning robot is placed outside the range of the infrared signal emitted by the infrared sensor of the docking station to back to charging. That is, the cleaning robot is placed outside the range of the dotted fan in front of the docking station in Figure 21 to back to charging. As shown in Figure 21a-d, in the general-type mechanism, the circle with arrow inside is the beginning position of the cleaning robot, and the arrow is the direction of the current orientation. When the recharge instruction is enabled, the cleaning robot travels in the direction of the arrow. When the robot walks to the infrared signal range without detecting the infrared signal, it may bypasses until the infrared signal is detected.
charging. That is, the cleaning robot is placed outside the range of the dotted fan in front of the docking station in Figure 21 to back to charging. As shown in Figure 20a-d, in the general-type mechanism, the circle with arrow inside is the beginning position of the cleaning robot, and the arrow is the direction of the current orientation. When the recharge instruction is enabled, the cleaning robot travels in the direction of the arrow. When the robot walks to the infrared signal range without detecting the infrared signal, it may bypasses until the infrared signal is detected. Figure 20e-h shows the automatic recharge mechanism that is proposed in this paper. The robot walks to the same position as the general-type mechanism, and then activates the recharging function. According to our proposed mechanism, it determines which direction should be followed and then finishes the recharge action. From these figures and   robot facing up bypasses until the infrared signal is detected. (b) Without detecting the infrared signal in the general-type mechanism, robot facing the right did not bypasses until the infrared signal is detected. (c) Without detecting the infrared signal in the general-type mechanism, robot facing the left bypasses until the infrared signal is detected. (d) Without detecting the infrared signal in the general-type mechanism, facing down bypasses until the infrared signal is detected.
(e) By the proposed mechanism, robot facing up determines which direction should be followed and then finishes the recharge action. (f) By the proposed mechanism, robot facing the right determines which direction should be followed and then finishes the recharge action. (g) By the proposed mechanism, robot facing the left determines which direction should be followed and then finishes the recharge action. (h) By the proposed mechanism, robot facing down determines which direction should be followed and then finishes the recharge action. Figure 21e-h shows the automatic recharge mechanism that is proposed in this paper. The robot walks to the same position as the general-type mechanism, and then activates the recharging function. According to our proposed mechanism, it determines which direction should be followed and then finishes the recharge action. From these figures and Table 13, one can find that the efficiency of recharging is greatly improved. The second part is the experiment performed inside the infrared signal range of the charging dock. Similarly, we compare the recharging path and time in different directions for the general-type mechanism and the proposed mechanism, as shown in Figure 22a-h and Table 14. It can be found that the automatic recharge time of the proposed mechanism is still less than the recharge time of the general mechanism. The second part is the experiment performed inside the infrared signal range of the charging dock. Similarly, we compare the recharging path and time in different directions for the general-type mechanism and the proposed mechanism, as shown in Figure 22a-h and Table 13. It can be found that the automatic recharge time of the proposed mechanism is still less than the recharge time of the general mechanism. In the general-type mechanism, robot facing the right bypasses until the infrared signal is detected. (c) In the general-type mechanism, robot facing the left bypasses until the infrared signal is detected. (d) In the general-type mechanism, robot facing down bypasses until the infrared signal is detected. (e) By the proposed mechanism, robot facing up determines which direction should be followed and then finishes the recharge action. (f) By the proposed mechanism, robot facing the right determines which direction should be followed and then finishes the recharge action. (g) By the proposed mechanism, robot facing the left determines which direction should be followed and then finishes the recharge action. (h) By the proposed mechanism, robot In the general-type mechanism, robot facing the right bypasses until the infrared signal is detected. (c) In the general-type mechanism, robot facing the left bypasses until the infrared signal is detected. (d) In the general-type mechanism, robot facing down bypasses until the infrared signal is detected. (e) By the proposed mechanism, robot facing up determines which direction should be followed and then finishes the recharge action. (f) By the proposed mechanism, robot facing the right determines which direction should be followed and then finishes the recharge action. (g) By the proposed mechanism, robot facing the left determines which direction should be followed and then finishes the recharge action. (h) By the proposed mechanism, robot facing the right determines which direction should be followed and then finishes the recharge action.

Conclusions
This paper designs a high-efficiency automatic recharge mechanism to plan the method of automatic return charging through the travel distance, rotation angle, and so on. We made a variety of attempts on the way to find out the appropriate solution for robot travel distance, rotation angle, angle collision and other issues. Through the method that is proposed in this paper, the method of automatically returning the charging of the sweeping robot is planned, which is obviously more efficient than the method of returning charging to the general mechanism.
In future research, we will continue to improve the accumulated error when walking for a long time even the machine learning method is used to compensate the error of the travel distance and the rotation angle of the sweeping robot. In addition, we will also improve the accuracy of image recognition.