摘要 |
PROBLEM TO BE SOLVED: To prevent deterioration of detecting accuracy of a displacement sensor.SOLUTION: A displacement sensor 10 which detects displacement magnitude of a movable body 3 includes: a magnetic scale 9 composed of a shallow groove 23 which is provided in a predetermined gap along a displacement direction of a movable body 3 and has a predetermined depth, and a deep groove 24 which is deeper than the shallow groove 23; a magnetic sensor 18 which is provided in a position where the magnetic scale 9 passes according to displacement of the movable body 3, and outputs a signal corresponding to the magnetic field that changes according to the magnetic scale 9; a determination part 30 which determines whether the magnetic scale 9 which has passed the magnetic sensor 18 is the shallow groove 23 or the deep groove 24 based on an output value from the magnetic sensor 18 and a predetermined reference value; and a reference value updating part 30 which updates the reference value based on the output value from the magnetic sensor 18 when it is determined that the shallow groove 23 has passed and the output value from the magnetic sensor 18 when it is determined that the deep groove 24 has passed. |