Wheel Encoders and Quantization
A wheel encoder counts ticks as a slotted disk turns past a light sensor. Counting ticks gives distance, and counting ticks per time gives speed. Because ticks are whole numbers, the speed estimate comes in steps.
From ticks to speed
With \(N\) ticks per revolution, wheel radius \(r\), and \(\Delta n\) ticks counted in a sample time \(T\), the estimated wheel speed is
Quadrature
Two sensors, A and B, sit a quarter tick apart. Whichever signal rises first tells you the direction. Counting every rising and falling edge of both gives four counts per tick.
What to notice
The red estimate is a staircase. At low speed it often reads zero, then jumps, because no tick arrived in that sample. You can make the steps finer with more ticks per revolution or a longer sample time, but a longer sample time also makes the estimate lag behind real changes. Robots often measure the time between ticks instead when the wheel turns slowly.