Measuring the distance traveled with encoders
Encoders are sensors that change value based on the movement of a part. They detect where the shaft is or how many times an axle has turned. These can be rotating or sensing along a straight-line track.
Sensing how far something has traveled is also known as odometry, and the sensors can also be called tachometers, or tachos for short. The sensors suggested in the Technical requirements section may also show up as Arduino tacho in searches.
Where machines use encoders
Our robots use electronic sensors. Cars and large commercial vehicles use electronic or mechanical sensors for speedometers and tachos.
Printers and scanners combine encoders with DC motors as an alternative to stepper motors. Sensing how much of an arc the robot has turned through is an essential component of servomechanisms, which we saw in Chapter 10, Using Python to Control Servo Motors. High-end audio or electrical test/measurement systems use these in control...