Patent ID: 7732757

Claim:
An optical encoder provided with an origin detection unit, comprising: a scale having an optical grating portion provided with an optically discontinuous portion; a light receiving unit including a plurality of units of light receiving elements, each of the units of the light receiving elements having the same number of light receiving elements, the light receiving unit being provided in association with a pitch of the optical grating and movable relative to the scale; a calculation unit that detects a change of a signal from the light receiving unit over a predetermined length of section that occurs when a light beam, which illuminates the discontinuous portion of the scale and is reflected thereon, is incident on the light receiving unit, performs calculation based on the change, and detects an origin position based on the result of the calculation, wherein in one cycle of signals which are output from the light receiving unit and have a predetermined interval which is determined based on a relationship between the number of units of the light receiving elements in the light receiving unit and the size of the discontinuous portion of the scale, either a middle voltage of a section during which a detection signal changes from a minimum value to a maximum value or a middle voltage of a section during which the detection signal changes from a maximum value to a minimum value is obtained, and wherein the middle voltage is retrieved every time when the scale moves by one pitch, the origin position is detected by a calculation based on two middle voltages apart from each other by “(a number of units in the light receiving unit)+n−1” pitches, where n represents a width of the discontinuous portion in terms of a number of light-and-shade slits on the scale.