PURPOSE: To obtain highly accurate measuring signals, in a liquid pressure engine which is used in an industrial robot and the like, by providing a magnetic rotary detector, which converts the change in the relative positions of a casing and a shaft and detects the relative rotary speed or position.
CONSTITUTION: An inners surface 23a of a rotor 23 is fixed to the inner surface of a casing 4. Said inner surface 23a is a circular cylinder surface, which is deviated from the axial center of a ring shaped stator 22 (the axial center of the casing 4), which is fixed to the outer surface of a shaft 3. The facing distances between the inner surface 23a and poles 22a, 22b, 22c and 22d are changed with the rotation of the rotor 23 in a sine mode. Sine wave input signals α and β, which are different in phase by 90 degrees, are inputted to primary windings 24 of the poles 22a and 22c and the poles 22b and 22d, which are different in phase by 90 degrees. The rotary speed and the rotary position of the rotor 23 are detected based on the output signal γ from a secondary winding 26. A fine angle signal, which is obtained by dividing one rotation of the casing 4 into several hundred parts, can be obtained.