In order to detect positions, an optical encoder utilizes the phenomenon that the ratio in intensities of diffracted light beams of different orders change depending on the patterns of aperture ratios in one pitch of a grating on the scale, and that the distance between the positive and the negative diffracted light beams of the same order vary depending on the patterns of the grating pitch on the scale, or that the light spots of the positive and the negative diffracted light beams of the same order move (rotate) depending on the patterns of the grating line direction. Therefore, this optical encoder is free from the adverse influence of fluctuations in the amount of coherent light illuminated from the light source to thereby enable precise positional detection.
High resolution optical encoder having a long detection stroke