How do cleaning robots accurately measure the distance they’ve travelled?

Fig:1 - Cleaning robot
Fig:1 - Cleaning robot

Why is distance measurement important for cleaning robots?

To save time and battery power, cleaning robots must follow the most efficient path (pictured below) as they navigate through a room. To follow this path, the robot needs to take a turn and travel a small distance after colliding with the wall. By doing so, the robot can easily avoid overlap when cleaning. This small distance is highlighted in blue in the picture.

Fig: 1 Distance required to cover while taking turns, highlighted in blue
Fig: 1 Distance required to cover while taking turns, highlighted in blue

Details about Magnetic Encoders:

To accurately measure this distance, an incremental magnetic wheel encoder is used inside the robot. This wheel encoder is attached to the driving motor’s shaft to help the robot by counting the wheel rotation.

Fig:2 Wheel encoder with ring magnet and Hall effect sensor
Fig:2 Wheel encoder with ring magnet and Hall effect sensor

Inside the wheel encoder, a ring magnet (which looks like a metal washer) is connected to the motor shaft. This ring magnet is specially created with multiple pairs of N-S poles, as shown below.

Fig:3- Ring magnet with multiple magnetic poles
Fig:3- Ring magnet with multiple magnetic poles

To sense, a Hall effect sensor connected to the main controller is placed closer to this ring magnet. This sensor generates an electrical pulse when the ring’s magnetic field is rotated.

Fig:4 - Hall effect sensor for detecting magnetic field change
Fig:4 - Hall effect sensor for detecting magnetic field change

Mathematics behind the rotation count:

How is the robot able to count the wheel rotation with the help of this wheel encoder? Suppose the magnetic ring has 4 separate magnetic poles inside it. In one full rotation of the magnetic ring, the Hall effect sensor will generate 4 electrical pulses due to the change of magnetic field.

Fig: 5 - Counting of magnetic poles while rotating
Fig: 5 - Counting of magnetic poles while rotating

On the other side of the motor shaft, the wheel of the robot is connected through a gear reduction box. Let’s assume it has a 20:1 gear reduction ratio, meaning that the motor shaft needs to rotate 20 times for one revolution of the wheel. Then the total no. of electric pulses generated for one revolution or 3600-degree rotation of the wheel is 80 (4 electric pulse generated per motor shaft rotation X 20 motor shaft rotation per wheel rotation) and in each electric pulse, the wheel rotates by 4.50 (3600/80) degrees.

Fig: 6- Mounting arrangement of wheel encoder inside the cleaning robot
Fig: 6- Mounting arrangement of wheel encoder inside the cleaning robot

If the controller knows the circumference of the wheel, it can easily convert the generated electric pulse into the distance travelled simply dividing the circumference of the wheel with the total no. of generated pulses in one rotation.

Distance travelled on each pulse = circumference of the wheel / Total no. of generated electric pulse

= (𝝅 X d) / 80

= (𝝅 X 50) / 80    (Assuming the diameter is 50mm)

= 1.96 mm

Therefore, on each pulse generated by the magnetic wheel encoder, the robot travels approximately 2 mm. The robot can easily combine the distance value with the other sensor data to follow the most efficient path around the room, go back to its charging station, detect unclean areas, and do some other cool stuff.

Fig: 7 – The path of a cleaning robot with magnetic encoders
Fig: 7 – The path of a cleaning robot with magnetic encoders

We hope you enjoyed this Lesics members-only Article. Thank you for being part of our team!

 175