# Most precise way to measure linear distance travelled by a wheel

Suppose a bot with wheels is traveling in a a straight line, and we want to measure this linear distance traversed by it as accurately as possible.

One of the ways is to use an optical encoder to measure the angle of rotation of the wheels and get the linear distance traveled.

Another way could be to use the data from accelerometer and get the linear distance traveled.

Which of these two methods would be better? Is there a third method which is more precise than the previous two?

• Calculating speed and distance traveled purely by integrating (twice) the input of an accelerometer is complex and will never be very accurate (small measurement errors will add up to large errors). My recommendation would be to use the optical encoder and circumference of the wheels for this as it's much simpler and more accurate. Dec 4, 2020 at 10:00

If you measure one of the free running wheels (with no motor connect to it), it depends on the traction of the wheel, but that could be fairly accurate.

If you move horizontally a simple accellerometer (1 axis) would be great. But if you have a vertical component, then you can not distinct between accelleration and weight force (Einstein). If you use a 3 axes accellerometer, you can compute/extract the robots moving speed (subtract the G component = 9.81 m/s²) and thus the distance. You have to use vector arithmetic in this case.

If the ground has enough "structure" you could use an optical sensor (like optical mice have).

If you have a reference object (e.g. a wall, a book) you could use a LIDAR sensor (https://en.wikipedia.org/wiki/Lidar) to measure the absolute distances at time points and compute the relative distance between these time points.

• A comment on the idea of the free-running wheel. Back in the 1970s the standard method used by engineers at General Motors was a "fifth wheel" attached to rear of the car. It was an ordinary bicycle wheel that was free to bounce up and down on a pivoting hitch. We could look out the rear window and see it bouncing. But it was always dead-on accurate since it had enough rotational inertia to keep the speed, even though it was airborne much of the time. Dec 4, 2020 at 14:37

If you use an accelerometer, you have to integrate twice to arrive at distance travelled. These two integrations will also compound errors and noise, so the result won't be very accurate without many corrections.

If a wheel doesn't slip and is undriven, the results of counting wheel rotations should be fairly accurate when the robot is moving in a straight line.

Dragging a cheap computer mouse behind the robot and reading its output could also work, but I haven't tried that one yet.

The most accurate, if you can set up a flat object that reflects well enough at the destination of the robot, is probably LIDAR. Not cheap, but easy enough to do as long as the robot moves in a straight line.

Another option would be to count wheel rotations, and calibrate with LIDAR (or GPS for very long distances) and use the calibrated wheel rotations in the final version, or use two or more methods and do sensor fusion.