An optical encoder equipped with an origin detection apparatus has a scale
provided with an optical grating, a plurality of light receiving elements
that is provided in association with the pitch of the optical grating and
movable relative to the scale and a light source that illuminates the
light receiving elements with light through the scale. An optically
discontinuous portion is provided in the optical grating of the scale, a
change of a light beam that occurs over a certain length of section at
the time when a light beam corresponding to the discontinuous portion is
incident on the light receiving elements, a change occurring in that
section is detected, calculation is performed, and an origin position is
detected from the result of the calculation.