Patent ID: 7417218

Claim:
An optical encoder comprising: a scale which is installed on one of members of which a displacement is detected; and a detecting head which is installed on other member which is displaced relatively with respect to the one of the members, and which is disposed facing the scale, wherein the scale is provided with a second grating which has an optical pattern of a second pitch with respect to a direction of a relative displacement, and the detecting head is provided with a light projecting section which irradiates a predetermined light on the scale, and a photodetecting section which detects a movement of a self image which is formed on a light receiving surface of a photodetector by light which is irradiated from the light projecting section to the scale, and which is reflected and diffracted by the second grating, wherein the light projecting section is structured to irradiate the predetermined light by combining a light source and a first grating which is disposed on a side facing the scale with respect to the light source, and an optical grating of a first pitch is formed in the first grating with respect to the direction of the relative displacement, and the photodetecting section is structured to detect the movement of the self image by combining the photodetector and a third grating which is disposed on the light receiving surface of the photodetector, and an optical grating of a third pitch is formed in the third grating for the direction of the relative displacement, and each of a formation surface of the first grating and a formation surface of the third grating is disposed substantially parallel with respect to the scale, and in an optical path of light emitting from the light projecting section and reaching up to the photodetecting section upon being reflected and diffracted by the scale, a light transmitting area which is substantially flat and substantially parallel to the scale is formed on a surface of the detecting head facing the scale, and the first grating is formed apart from the third grating, and the first grating is formed directly on a light emitting surface of the light source or a light transparent substrate on which the first grating is formed and the first grating is stacked on the light emitting surface of the light source, the third grating is formed directly on the light receiving surface of the photodetector or an other light transparent substrate on which the third grating is formed and the third grating is stacked on the light receiving surface of the photodetector, and a light transparent resin which has a refractive index greater than 1 is disposed in a space from the first grating up to the surface of the detecting head, and in a space from the third grating up to the surface of the detecting head, except in a space where the light transparent substrate is disposed.