Patent ID: 7565256

Claim:
A displacement detecting encoder comprising: a scale having a positional code comprising a maximum length pseudo random code, wherein a pseudo random number P 0 of a predetermined digit is calculated by a formula P 0 =D 0 xor D 1 xor D 2 xor D 3 , wherein D 0 -D 3 are data of tap positions; a detection portion which is disposed so as to make a relative movement with respect to the scale and detect at least a part of the positional code provided on the scale; a processing portion which processes a part of the positional code detected by the detection portion, thereby outputting the positional information; and a positional code generating means for generating the pseudo random number P 0 of the predetermined digit based on the formula, wherein a judgment is made that there is no error where the detected pseudo random number P 0 is in agreement with the pseudo random number P 0 generated by the positional code generating means, and wherein when the detected pseudo random number P 0 is not in agreement with the pseudo random number P 0 generated by the positional code generating means, an error making bit is specified with reference to values of a plurality of error detecting bits E 0 -E 4 defined by a formula E=D 0 xor D 1 xor D 2 xor D 3 xor P 0 , detected erroneous information of the error making bit is corrected, and absolute position is measured using corrected data.