Patent ID: 7876091

Claim:
A magnetic encoder comprising: a rotation body that is rotatably supported; a magnetic body including a plurality of magnetic poles that are alternately polarized as N poles and S poles along a rotation direction on an outer peripheral side surface of the rotation body; and a plurality of magnetoresistance elements that are disposed along the rotation direction in the vicinity of the magnetic body so as to face the magnetic body, wherein each of the plurality of magnetoresistance elements includes at least a pinned layer, and a free layer in which an internal magnetization direction changes in accordance with external magnetic fields emitted by the magnetic body, a magnetization direction of the pinned layer is set to be in the rotation direction, and an initial magnetization direction of the free layer is set to be in a direction that is parallel to the outer peripheral side surface and that is perpendicular to the rotation direction, wherein a pitch of the N poles and the S poles that are adjacent to one another in the rotation direction and an arrangement pitch of the plurality of magnetoresistance elements are set to the same pitch, and wherein each of the plurality of magnetoresistance elements includes, in addition to the pinned layer and the free layer, an antiferromagnetic layer that pins the magnetization direction of the pinned layer in a predetermined direction, and hard bias layers that provide a bias magnetic field which sets the initial magnetization direction of the free layer to be in a reference direction, the hard bias layers being disposed at both sides of the pinned layer and the free layer.