Patent ID: 8271221

Claim:
A phase detection device detecting a phase in accordance with a position of a measured object based on a sine wave signal and a cosine wave signal having the phase, comprising: a sine wave sign judgment part configured to judge a sign of the sine wave signal; a cosine wave sign judgment part configured to judge a sign of the cosine wave signal; a magnitude judgment part configured to judge a magnitude relationship between an absolute value of the sine wave signal and an absolute value of the cosine wave signal; a section specifying part configured to specify which of eight sections obtained by dividing a range from 0 to 2π for each π/4 from 0 contains the phase based on the judgment results of the sine wave sign judgment part, the cosine wave sign judgment part, and the magnitude judgment part; an arctangent calculation part configured to adjust signs of the sine wave signal and the cosine wave signal and make one of the sine wave signal and the cosine wave signal a sine wave and make the other a cosine wave so that a combination of the sign of the sine wave, the sign of the cosine wave, and the magnitude relationship between the absolute value of the sine wave and the absolute value of the cosine wave becomes constant regardless of which of the eight sections contains the phase, and calculate an approximate arctangent of the tangent based on the sine wave and cosine wave according to a procedure common to the eight sections, by holding data linking a tangent and a correction value comprised by a difference between the tangent and an arctangent, specifying the corresponding correction value from among the data using the value obtained by dividing a smaller value between the absolute value of the sine wave signal and the absolute value of the cosine wave signal by a larger value between the absolute value of the sine wave signal and the absolute value of the cosine wave as the tangent, and adding the specified correction value to the divided value to calculate the approximate arctangent; and a phase calculation part configured to calculate the phase based on the range of the section specified by the section specifying part and the approximate arctangent calculated by the arctangent calculation part.