To reliably detect the amount of relative displacement by controlling whether detected magnetic information is to be adopted or not.
The device has a propagation time detection means 18 for detecting the propagation time of magnetic information detected by a magnetic detection means 26, a means 20 for detecting the amount of relative displacement between first and second members from the propagation time, and a judging means 19 for prohibiting the adoption of the propagation time which is judged to be abnormal for calculating the amount of relative displacement, thereby reliably calculation of the amount of relative displacement can be from carried out from the propagation time of normal magnetic information without being affected by, for example, the generating magnetic field of an electromagnetic actuator and reliable magnetic information is available.