The photoelectric encoder uses the principle of grating diffraction to realize displacement-digital conversion. It has been used in machine tools and computing instruments since the 1950s. Because of its simple structure, high measurement accuracy, and long life, it has received attention and promotion at home and abroad. Positioning, speed, length, acceleration, vibration and other aspects have been widely used.