Rotary encoders are devices that measure the angular position or velocity of a rotating shaft. They are used in a variety of applications, from industrial automation to automotive and aerospace systems, and have become an integral part of many modern control systems. The basic operation of a rotary encoder is quite simple. It consists of a disk with a pattern of lines or slots cut into it, which is attached to the rotating shaft. As the disk rotates, a sensor detects the lines or slots in the disk, and translates them into electrical signals, which can then be read by a controller. Depending on the type of encoder, the signals may be pulses, pulses with direction, quadrature signals, or absolute position. This allows the controller to determine the angular position or velocity of the shaft, which can then be used to control the system. Video Here is a video explaining the concept; you can skip to the explaination here.