A rotating field sensor configured to detect an angle that a direction of a rotating magnetic field in a reference position forms with respect to a reference direction, the rotating field sensor comprising:
- first to sixth signal generators configured to generate first to sixth signals, respectively, each of the first to sixth signals being responsive to the direction of the rotating magnetic field, each of the first to sixth signal generators including at least one magnetic detection element;
- and
- an angle detector configured to generate a detected angle value based on the first to sixth signals, the detected angle value having a correspondence relationship with the angle that the direction of the rotating magnetic field in the reference position forms with respect to the reference direction, wherein
- each of the first to sixth signals contains:
- an ideal component that varies periodically with a predetermined signal period;
- a first error component of a period of ½ the predetermined signal period;
- and a second error component of a period of ⅓ the predetermined signal period,
- the ideal components of the first to sixth signals are different in phase from each other,
- an absolute value of a phase difference between the ideal component of the first signal and the ideal component of the second signal, an absolute value of a phase difference between the ideal component of the third signal and the ideal component of the fourth signal, and an absolute value of a phase difference between the ideal component of the fifth signal and the ideal component of the sixth signal are all greater than 150° and smaller than 210°, and
- the angle detector includes:
- a first computing circuit configured to generate, based on the first and third signals, a first post-computation signal in which the second error component of the period of ⅓ the predetermined signal period is reduced as compared with the first and third signals;
- a second computing circuit configured to generate, based on the second and fourth signals, a second post-computation signal in which the second error component of the period of ⅓ the predetermined signal period is reduced as compared with the second and fourth signals;
- a third computing circuit configured to generate, based on the third and fifth signals, a third post-computation signal in which the second error component of the period of ⅓ the predetermined signal period is reduced as compared with the third and fifth signals;
- a fourth computing circuit configured to generate, based on the fourth and sixth signals, a fourth post-computation signal in which the second error component of the period of ⅓ the predetermined signal period is reduced as compared with the fourth and sixth signals;
- a fifth computing circuit configured to generate, based on the first and second post-computation signals, a fifth post-computation signal in which the first error component of the period of ½ the predetermined signal period is reduced as compared with the first and second post-computation signals;
- a sixth computing circuit configured to generate, based on the third and fourth post-computation signals, a sixth post-computation signal in which the first error component of the period of ½ the predetermined signal period is reduced as compared with the third and fourth post-computation signals;
- and
- a seventh computing circuit configured to determine the detected angle value based on the fifth and sixth post-computation signals.