The grating ruler displacement sensor (abbreviated as grating ruler) is a measurement feedback device that uses the optical principle of grating to work. The missing pulse can be automatically corrected through the cooperation of the grating ruler and the reading head, and feedback to the controller can be timely also when the rotor is locked.