An azimuth measuring device which arranges magnetic sensors in two or three directions, measures earth magnetism using the magnetic sensors in the respective directions and measures azimuth is known.
When a magnetized part such as a speaker is placed near the magnetic sensors of such an azimuth measuring device, an offset is produced in the outputs of the magnetic sensors due to a magnetic field leaking from the magnetized part.
In order to prevent errors from occurring in azimuth calculations due to the offset of the magnetic sensors, the above described azimuth measuring device needs to carry out calibration on the azimuth measuring device for the purpose of correcting the offset of the magnetic sensors.
Therefore, a conventional azimuth measuring device carries out calibration on the azimuth measuring device, for example, by rotating the azimuth measuring device around a specific axis at a constant angular velocity.
FIG. 12 illustrates an output waveform of a magnetic sensor when an azimuth measuring device is rotated around the z-axis at a constant angular velocity.
In FIG. 12, when a portable device 301 is rotated around the z-axis at a constant angular velocity ω, an output Srx of an x-axis Hall element HEx mounted on the portable device 301 is given by Formula (1) below:Srx=axMxy cos (ωt+θ0)+X0  (1)where ax is sensitivity of the x-axis Hall element Hex and X0 is an offset of the x-axis Hall element HEx.
Furthermore,Mxy=√{square root over ( )}(Mx2+My2)θ0=tan−1(My/Mx)where Mx is an x-direction component of earth magnetism M and My is a y-direction component of earth magnetism M.
Therefore, a maximum value Xmax and minimum value Xmin of the output Srx of the x-axis Hall element HEx can be expressed by Formulas (2), (3) below:Xmax=axMxy+X0  (2)Xmin=−axMxy+X0  (3)
As a result, from Formulas (2), (3), the offset X0 of the x-axis Hall element HEx can be calculated by Formula (4) below:X0=(Xmax+Xmin)/2  (4)
FIG. 13 is a flow chart showing a conventional azimuth measuring method.
In FIG. 13, a calibration start button of the portable device 301 is pressed (step S21).
Then, while keeping the portable device 301 mounted with the x-axis Hall element HEx horizontal, the portable device 301 is slowly rotated 360 degrees at a constant speed (step S22).
After the portable device 301 is rotated 360 degrees, the calibration end button of the portable device 301 is pressed (step S23).
Here, while the portable device 301 is rotated 360 degrees, a maximum value Xmax and minimum value Xmin of the output Srx of the x-axis Hall element HEx are searched, a value obtained by adding up these values and then dividing by 2 is assumed to be an offset X0 of the x-axis, and thus it is possible to carry out calibration of the x-axis.
However, according to the conventional azimuth measuring method, it is necessary to rotate the portable device 301 360 degrees or more on a specific plane to search the maximum value Xmax and minimum value Xmin of the output Srx of the x-axis Hall element HEx.
As a result, there are problems that when the rotation speed of the portable device 301 does not fall within a certain speed range, the calibration accuracy deteriorates, for example, when the rotation speed of the portable device 301 is too high, the maximum value Xmax and minimum value Xmin may be overlooked and when the rotation speed is too low, the amount of data read becomes enormous, causing a memory to overflow.
For this reason, the user is required to repeat trial and error and rotate the portable, device 301 many times until calibration is completed successfully.
Therefore, it is an object of the present invention to provide an azimuth measuring device and azimuth measuring method capable of carrying out calibration on magnetic sensors without putting load on the user.