[go: up one dir, main page]

JP2013124871A - Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer - Google Patents

Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer Download PDF

Info

Publication number
JP2013124871A
JP2013124871A JP2011272274A JP2011272274A JP2013124871A JP 2013124871 A JP2013124871 A JP 2013124871A JP 2011272274 A JP2011272274 A JP 2011272274A JP 2011272274 A JP2011272274 A JP 2011272274A JP 2013124871 A JP2013124871 A JP 2013124871A
Authority
JP
Japan
Prior art keywords
offset
measurement data
magnetic
magnetic measurement
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2011272274A
Other languages
Japanese (ja)
Inventor
Naoyuki Ozawa
直行 小澤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujikura Ltd
Original Assignee
Fujikura Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujikura Ltd filed Critical Fujikura Ltd
Priority to JP2011272274A priority Critical patent/JP2013124871A/en
Publication of JP2013124871A publication Critical patent/JP2013124871A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Measuring Magnetic Variables (AREA)

Abstract

【課題】オフセットの算出及び有効性を判定する磁気測定データとして、より真値に近いオフセットを算出する磁気測定データを得る磁気測定データ校正装置を提供する。
【解決手段】本発明の磁気測定データ校正装置は、磁気測定データのオフセットを求め、磁気測定データを補正する装置であり、加速度センサからの加速度データから傾斜角を求める傾斜角算出部と、傾斜角の角度範囲との組合毎に磁気測定データを記憶させる領域が設けられた磁気測定データバッファと、磁気センサからの磁気測定データを、傾斜角に対応する領域に書き込む磁気測定データ判定部と、磁気測定データからオフセットを求めるオフセット算出部と、算出オフセットと現在使用している設定オフセットのいずれが確からしいかを、磁気測定データバッファに記憶された磁気データにより判定し、確からしいとするオフセットを新たな設定オフセットとするオフセット有効性判定部とを備える。
【選択図】図1
An object of the present invention is to provide a magnetic measurement data calibration apparatus for obtaining magnetic measurement data for calculating an offset closer to a true value as magnetic measurement data for determining offset calculation and validity.
An apparatus for calibrating magnetic measurement data according to the present invention is an apparatus for obtaining an offset of magnetic measurement data and correcting the magnetic measurement data, an inclination angle calculating unit for obtaining an inclination angle from acceleration data from an acceleration sensor, and an inclination A magnetic measurement data buffer provided with an area for storing magnetic measurement data for each combination with an angular range of angles, a magnetic measurement data determination unit for writing magnetic measurement data from a magnetic sensor in an area corresponding to an inclination angle, and The offset calculation unit that calculates the offset from the magnetic measurement data, and whether the calculated offset or the currently used set offset is likely is determined from the magnetic data stored in the magnetic measurement data buffer. An offset validity determination unit for setting a new set offset.
[Selection] Figure 1

Description

本発明は、携帯機器に搭載される磁気センサの校正を行う磁気測定データ校正装置、方位角計測装置及びバッファに関する。   The present invention relates to a magnetic measurement data calibration device, an azimuth measurement device, and a buffer for calibrating a magnetic sensor mounted on a portable device.

近年、携帯電話などの携帯機器に3軸の磁気センサ(以下、単に磁気センサ)が搭載され、携帯機器における方位測定に用いられている。
この方位測定に用いる磁気センサは、通常、携帯機器に搭載する前に、3軸ヘルムホルツコイルを用いて、各軸毎のゼロ磁界出力値の調整(以下、オフセット調整)をしておく。
この具体的な調整手順は、予め校正された磁気センサにより、地磁気の測定を行い、その予め校正された磁気センサの出力する3軸各々の磁気測定データを基準磁気測定データとして、方位測定に用いる。
In recent years, a three-axis magnetic sensor (hereinafter simply referred to as a magnetic sensor) is mounted on a mobile device such as a mobile phone and is used for orientation measurement in the mobile device.
The magnetic sensor used for this azimuth measurement is usually adjusted with a zero magnetic field output value for each axis (hereinafter referred to as offset adjustment) using a triaxial Helmholtz coil before being mounted on a portable device.
In this specific adjustment procedure, geomagnetism is measured by a magnetic sensor calibrated in advance, and magnetic measurement data for each of the three axes output from the magnetic sensor calibrated in advance is used as reference magnetic measurement data for azimuth measurement. .

次に、3軸ヘルムホルツコイルにより、基準磁気測定データと逆方向の磁界を、オフセット調整の対象である対象磁気センサに対して印加する。
ここで、対象磁気センサは、オフセットが無い場合、出力する磁気測定データが3軸共に0であり、オフセットを有する場合、出力する磁気測定データが0ではない。
ここで、対象磁気センサが出力する磁気測定データを、対象磁気センサ自身の有するオフセットとして測定し、この磁気測定データにより、磁気センサの出力する磁気測定データのオフセット調整を行う。
すなわち、磁気センサの出力する磁気測定データから、3軸ヘルムホルツコイルで測定したオフセットを、各磁気測定データから減算し、磁気センサの測定結果として方位検出を行うことになる。
Next, a magnetic field in the direction opposite to the reference magnetic measurement data is applied to the target magnetic sensor that is the target of offset adjustment by the three-axis Helmholtz coil.
Here, when the target magnetic sensor has no offset, the magnetic measurement data to be output is 0 for all three axes, and when it has the offset, the magnetic measurement data to be output is not 0.
Here, the magnetic measurement data output from the target magnetic sensor is measured as an offset of the target magnetic sensor itself, and the offset of the magnetic measurement data output from the magnetic sensor is adjusted based on the magnetic measurement data.
That is, the offset measured by the 3-axis Helmholtz coil is subtracted from each magnetic measurement data from the magnetic measurement data output from the magnetic sensor, and the direction is detected as the measurement result of the magnetic sensor.

しかしながら、磁気センサ単体でオフセット調整を行ったとしても、携帯機器には方位を検出する磁気センサ以外にも多くの他の部品が使われており、これら他の部品が発生する磁界が磁気センサに対して影響を与える場合がある。例えば、スピーカに搭載されている磁石、開閉スイッチに設けられている磁石、あるいは携帯機器の部品に施されたニッケルメッキなどから磁界が発生している。   However, even if the offset adjustment is performed with the magnetic sensor alone, many other parts are used in the portable device in addition to the magnetic sensor that detects the orientation, and the magnetic field generated by these other parts is applied to the magnetic sensor. It may have an effect on it. For example, a magnetic field is generated from a magnet mounted on a speaker, a magnet provided on an open / close switch, or nickel plating applied to a component of a portable device.

このため、携帯機器内部に設けられた磁気センサに対して周囲の環境による環境オフセットが生じ、オフセット調整を行った磁気センサ単体から環境オフセットが重畳した磁気測定データが出力されることになる。
したがって、磁気センサ単体でオフセット調整を行った後、搭載される携帯機器の他の部品が発生する磁界により、携帯機器が向いている実際の方位と、磁気センサが出力する磁気測定データから得られる方位とに、環境オフセットによる差異が生じることになる。
For this reason, an environmental offset due to the surrounding environment occurs with respect to the magnetic sensor provided inside the portable device, and magnetic measurement data in which the environmental offset is superimposed is output from the magnetic sensor alone that has performed the offset adjustment.
Therefore, after performing offset adjustment with a single magnetic sensor, the magnetic field generated by other components of the mobile device to be mounted is obtained from the actual orientation of the mobile device and the magnetic measurement data output by the magnetic sensor. A difference due to the environmental offset occurs in the bearing.

また、磁気センサを他の部品とともに携帯機器に搭載した状態で、3軸ヘルムホルツコイルにより環境オフセットを含めたオフセット調整を行うことが考えられる。
しかしながら、各部品の磁力の経時的な変化や、携帯機器の周囲の温度の変化、さらには携帯機器の周囲に強度の磁界を発生する物体の存在により、環境オフセットの値が常に変動してしまう。
Further, it is conceivable to perform offset adjustment including environmental offset by a three-axis Helmholtz coil in a state where the magnetic sensor is mounted on a portable device together with other components.
However, the value of the environmental offset always fluctuates due to changes in the magnetic force of each component over time, changes in the temperature around the portable device, and the presence of an object that generates a strong magnetic field around the portable device. .

したがって、3軸ヘルムホルツコイルにより、携帯機器に搭載した後に、環境オフセットを含めた磁気センサのオフセット調整を行っても、周囲の状況により環境オフセットが刻々変動する。このため、磁気センサの磁気測定データに重畳する環境オフセットの変動により、磁気センサが出力する磁気測定データが真値に対してずれてしまうことになる。
このため、オフセットを再度行う必要があるが、常に3軸ヘルムホルツコイルにより、携帯機器に搭載された磁気センサのオフセット調整を行うことができない。したがって、3軸ヘルムホルツコイルを使用せずに、自身が磁気センサのオフセット調整を行う機能を、携帯機器に対して持たせる必要がある。
Therefore, even if the offset adjustment of the magnetic sensor including the environmental offset is performed after being mounted on the portable device by the three-axis Helmholtz coil, the environmental offset fluctuates every moment depending on the surrounding conditions. For this reason, the magnetic measurement data output from the magnetic sensor shifts from the true value due to the fluctuation of the environmental offset superimposed on the magnetic measurement data of the magnetic sensor.
For this reason, although it is necessary to perform offset again, the offset adjustment of the magnetic sensor mounted in the portable device cannot always be performed by the three-axis Helmholtz coil. Therefore, it is necessary to give the mobile device the function of adjusting the offset of the magnetic sensor without using the 3-axis Helmholtz coil.

このため、携帯機器に搭載されたオフセット調整部が、3軸各々の磁気センサにより、各軸の磁界の強度を多数測定し、測定した磁気測定データを内部のデータバッファに一旦蓄積し、オフセットを正しい値として算出することが行われている(例えば、特許文献1参照)。
すなわち、特許文献1においては、データバッファに蓄積された磁気測定データと、オフセットとの距離が最小となるように、オフセットの値を決定するという手法が用いられている。
For this reason, the offset adjustment unit mounted on the portable device measures a number of magnetic field strengths of each axis by the magnetic sensors of each of the three axes, temporarily stores the measured magnetic measurement data in the internal data buffer, and sets the offset. Calculation as a correct value is performed (see, for example, Patent Document 1).
That is, in Patent Document 1, a method is used in which the offset value is determined so that the distance between the magnetic measurement data stored in the data buffer and the offset is minimized.

しかし、この特許文献1の構成の問題点は、データバッファに蓄積されている磁気測定データが、特定点の近傍に集中している場合、すなわち、ピッチ角及びロール角からなる傾斜角が同様な位置における磁気測定データが多い場合、オフセットの推定精度が低下してしまう。
すなわち、ゼロ磁界における磁気センサのゼロ磁界出力をキャンセルするオフセットを算出する際、磁気測定データが偏っていると、算出されるオフセットが偏った磁気測定データの影響を受け、真値のオフセットとに対してずれが生じる。
However, the problem of the configuration of Patent Document 1 is that the magnetic measurement data stored in the data buffer is concentrated in the vicinity of a specific point, that is, the inclination angle composed of the pitch angle and the roll angle is the same. When there is a lot of magnetic measurement data at the position, the estimation accuracy of the offset is lowered.
That is, when calculating the offset that cancels the zero magnetic field output of the magnetic sensor in the zero magnetic field, if the magnetic measurement data is biased, the calculated offset is affected by the biased magnetic measurement data and becomes a true offset. In contrast, a shift occurs.

このため、データバッファに磁気測定データを一旦蓄積した後、蓄積した磁気測定データの傾斜角による領域分割を行い、どの程度に蓄積した磁気測定データの取得した傾斜角がばらついているかを求める。ここで、領域分割とは、例えばオフセットを中心とした球の表面を、例えば、正八面体に分割し、磁気測定データの各々が測定された傾斜角に対応する(傾斜角が含まれる)正八面体にグルーピングする。
このグルーピング結果において、磁気測定データが割り当てられた正八面体の数が設定した値より多い(予め設定した閾値を超えた)場合のみ、オフセット算出を行い、このオフセットに対する真値判定(真値に近いか否かの判定)を行う(例えば、特許文献2参照)。
For this reason, after the magnetic measurement data is temporarily stored in the data buffer, the region of the stored magnetic measurement data is divided by the inclination angle to determine how much the acquired inclination angle of the magnetic measurement data varies. Here, the region division is, for example, a regular octahedron that divides the surface of a sphere centered on an offset into, for example, a regular octahedron and corresponds to the tilt angle at which each of the magnetic measurement data is measured (including the tilt angle). Group.
In this grouping result, the offset calculation is performed only when the number of regular octahedrons to which the magnetic measurement data is assigned is larger than the set value (exceeds a preset threshold value), and the true value determination for this offset (close to the true value) (For example, refer to Patent Document 2).

特許4391416号公報Japanese Patent No. 4391416 特許4448975号公報Japanese Patent No. 4448975

しかしながら、特許文献2は、データバッファに対して磁気測定データを時系列に記憶させるため、以下に示す状態が発生し、正確なオフセットを得る処理が行われないことがある。
a.データバッファに蓄積されている磁気測定データの全てが、上記正八面体のいずれか一つの面に集中して分布している。
b.データバッファに蓄積されている磁気測定データの大半(例えば、80%以上)が、上記正八面体のいずれか一つの面に集中し、残りの磁気測定データが他の面に分布している。
c.領域分割を行う正八面体を生成する際、球の中心となるオフセット点がずれている。
However, since Patent Document 2 stores magnetic measurement data in a time series in the data buffer, the following state may occur and processing for obtaining an accurate offset may not be performed.
a. All of the magnetic measurement data stored in the data buffer is concentrated on one of the regular octahedrons.
b. Most of the magnetic measurement data stored in the data buffer (for example, 80% or more) is concentrated on any one surface of the regular octahedron, and the remaining magnetic measurement data is distributed on the other surface.
c. When generating a regular octahedron that performs region division, the offset point that is the center of the sphere is shifted.

すなわち、上記aの状態の場合、キャリブレーションを行う際、現在分布している面と異なる面に対応する磁気測定データを取得するため、携帯機器の向きをあらゆる角度に向ける(円を描くように回転させる)必要がある。
また、携帯機器の向きによっては、磁気測定データのグルーピングされた面の数が、オフセットを算出するための閾値を超えない。このため、オフセットの算出及び更新が行われず、キャリブレーション時間が長くなり、携帯機器の向きを換える動作をユーザが継続させる必要があり、キャリブレーションが面倒な作業となる。
In other words, in the case of the above-described state a, when performing calibration, the orientation of the portable device is directed to any angle in order to acquire magnetic measurement data corresponding to a surface different from the currently distributed surface (like drawing a circle) Need to be rotated).
In addition, depending on the orientation of the mobile device, the number of the grouped surfaces of the magnetic measurement data does not exceed the threshold for calculating the offset. For this reason, the offset is not calculated and updated, the calibration time becomes long, the user needs to continue the operation of changing the orientation of the portable device, and the calibration becomes a troublesome work.

また、上記bの状態の場合、磁気測定データのグルーピングされた面の数が、オフセットを算出する閾値を超えても、正八面体のいずれかの一面に磁気測定データが集中していると、すでに述べたように、集中した面の磁気測定データの影響を受け、正確なオフセットを算出できない。
すなわち、磁気測定データが集中した面が、オフセットを算出する際の重み付けが他の面に対して大きくなり、真値からずれたオフセットが算出されてしまう。
In the case of the state b, if the magnetic measurement data is already concentrated on one of the regular octahedrons even when the number of grouped surfaces of the magnetic measurement data exceeds the threshold for calculating the offset, As described above, it is not possible to calculate an accurate offset due to the influence of the magnetic measurement data of the concentrated surface.
That is, the surface on which the magnetic measurement data is concentrated has a higher weight when calculating the offset than the other surfaces, and an offset deviated from the true value is calculated.

また、上記cの状態の場合、磁気測定データをグルーピングするための正八面体を作成する際、この正八面体のもととなる球がある程度正確なオフセットを中心としている必要がある。しかし、正八面体を生成する直前のオフセットが正確に算出されていない場合、正八面体にグルーピングすると、本来判定されるべき面(傾斜角の領域)とは異なる面に対応付けられてしまう。
このため、グルーピング自体に信頼性が無く、オフセット算出を行うか否かの判定を行う際、誤判定を起こすことになり、真値からずれたオフセットが算出されてしまう場合や、真値のオフセットが得られるにもかかわらずオフセット算出が行われない場合が発生する。
In the case of the state c, when creating a regular octahedron for grouping the magnetic measurement data, it is necessary that the sphere that forms the regular octahedron is centered on an offset that is accurate to some extent. However, if the offset just before the regular octahedron is not calculated correctly, grouping into the regular octahedron will be associated with a surface that is different from the surface (inclination angle region) that should be determined.
For this reason, the grouping itself is unreliable, and when determining whether or not to perform offset calculation, an erroneous determination occurs, and an offset deviating from the true value may be calculated, or the true value offset In some cases, offset calculation is not performed even though

本発明は、このような事情に鑑みてなされたもので、オフセットの算出、あるいは算出したオフセットの有効性を判定するために用いる磁気測定データとして、より真値に近いオフセットを算出する磁気測定データを得ることが可能な磁気測定データ校正装置、方位角計測装置及びバッファを提供することを目的とする。   The present invention has been made in view of such circumstances, and magnetic measurement data for calculating an offset closer to a true value as magnetic measurement data used for calculating an offset or determining the effectiveness of the calculated offset. An object of the present invention is to provide a magnetic measurement data calibration device, an azimuth angle measurement device, and a buffer that can obtain the above.

この発明は上述した課題を解決するためになされたもので、本発明の磁気測定データ校正装置は、互いに直交する3つの測定軸を有し、測定軸方向の地磁気を測定する軸センサからなる磁気センサから出力される前記測定軸毎の地磁気の測定結果である磁気測定データのオフセットを求め、前記磁気測定データを補正する磁気測定データ校正装置であり、加速度センサから供給される加速度データからロール角及びピッチ角を求める傾斜角算出部と、前記ロール角の角度範囲と前記ピッチ角の角度範囲との組合せ毎に、当該組合せに対応した磁気測定データを記憶させる領域が設けられた磁気測定データバッファと、磁気センサから供給される磁気測定データを、当該磁気測定データの測定時に検出された前記ロール角及び前記ピッチ角に対応する前記領域に対して書き込んで記憶させる磁気測定データ判定部と、前記磁気測定データから前記オフセットを所定の計算により求めるオフセット算出部と、オフセット算出部の求めたオフセットである算出オフセットと、現在使用しているオフセットである設定オフセットのいずれが確からしいかを、前記磁気測定データバッファに記憶された磁気データを用いて判定し、確からしいと判定されたオフセットを新たな設定オフセットとするオフセット有効性判定部とを備えることを特徴とする。   The present invention has been made to solve the above-described problems, and a magnetic measurement data calibration apparatus according to the present invention has three measurement axes orthogonal to each other, and includes a magnetic sensor comprising an axis sensor that measures the geomagnetism in the measurement axis direction. A magnetic measurement data calibration device for obtaining an offset of magnetic measurement data that is a measurement result of geomagnetism for each measurement axis output from a sensor, and correcting the magnetic measurement data, wherein a roll angle is determined from acceleration data supplied from an acceleration sensor. And an inclination angle calculation unit for obtaining a pitch angle, and a magnetic measurement data buffer provided with an area for storing magnetic measurement data corresponding to each combination of the angle range of the roll angle and the angle range of the pitch angle And the magnetic measurement data supplied from the magnetic sensor to the roll angle and the pitch angle detected when measuring the magnetic measurement data. A magnetic measurement data determination unit that writes and stores the area to be stored, an offset calculation unit that obtains the offset from the magnetic measurement data by a predetermined calculation, a calculated offset that is an offset obtained by the offset calculation unit, and a current use The offset validity is determined by using the magnetic data stored in the magnetic measurement data buffer to determine which of the set offsets that are offset is likely, and using the offset determined to be likely as the new set offset. And a determination unit.

本発明の磁気測定データ校正装置は、前記オフセット算出部が、測定された磁気測定データの前記測定軸毎の磁気測定データと、前回求められたオフセットとの差分から誤差関数を求める誤差関数計算部と、前記誤差関数及び前回求められた共分散行列からオフセット残差を算出するオフセット残差計算部と、前回の前記磁気測定データの測定時に設定した前記設定オフセットに対し、前記オフセット残差を加算し、前記算出オフセットを算出するオフセット更新部と、測定された前記磁気測定データを用い、以前に測定された前記磁気測定データを母集団とする磁気測定データの共分散行列を更新し、測定された前記磁気測定データを前記母集団に加えて新たな共分散行列を生成する共分散行列更新部とを備えることを特徴とする。   In the magnetic measurement data calibration apparatus of the present invention, the offset calculation unit calculates an error function from the difference between the magnetic measurement data for each measurement axis of the measured magnetic measurement data and the previously obtained offset. An offset residual calculation unit for calculating an offset residual from the error function and the previously obtained covariance matrix, and adding the offset residual to the set offset set at the time of the previous measurement of the magnetic measurement data The offset update unit for calculating the calculated offset and the measured magnetic measurement data are used to update the covariance matrix of the magnetic measurement data using the previously measured magnetic measurement data as a population. And a covariance matrix updating unit that generates a new covariance matrix by adding the magnetic measurement data to the population.

本発明の磁気測定データ校正装置は、前記オフセット算出部が、前記領域に書き込まれている磁気測定データと仮のオフセットとの差分をそれぞれの測定軸毎に算出して二乗して領域毎に加算し、この加算結果を前記磁気測定データバッファに磁気測定データが記憶されている全ての領域で加算し、この加算結果が最小となる前記仮のオフセットを前記算出オフセットとすることを特徴とする。   In the magnetic measurement data calibration apparatus according to the present invention, the offset calculation unit calculates the difference between the magnetic measurement data written in the area and the temporary offset for each measurement axis, squares it, and adds it for each area. Then, the addition result is added to all the areas where the magnetic measurement data is stored in the magnetic measurement data buffer, and the temporary offset that minimizes the addition result is used as the calculated offset.

本発明の磁気測定データ校正装置は、前記オフセット有効性判定部が、前記磁気測定データから算出した前記算出オフセットと、前記磁気測定データバッファに記憶されている磁気データとの差分の標準偏差である第1の標準偏差を求め、また現在使用している前記設定オフセットと、前記磁気測定データバッファに記憶されている磁気データとの差分の標準偏差である第2の標準偏差を求め、前記第1の標準偏差と前記第2の標準偏差とを比較し、比較結果により前記算出オフセット及び前記設定オフセットのいずれを、新たな設定オフセットとするかの判定を行うことを特徴とする。   The magnetic measurement data calibration apparatus of the present invention is a standard deviation of a difference between the calculated offset calculated from the magnetic measurement data by the offset validity determination unit and the magnetic data stored in the magnetic measurement data buffer. A first standard deviation is obtained, and a second standard deviation which is a standard deviation of a difference between the set offset currently used and the magnetic data stored in the magnetic measurement data buffer is obtained, and the first standard deviation is obtained. The standard deviation is compared with the second standard deviation, and it is determined which of the calculated offset and the set offset is a new set offset based on the comparison result.

本発明の方位角計測装置は、互いに直交する3つの測定軸を有し、測定軸方向の地磁気を測定する軸センサからなる磁気センサと、互いに直交する3つの測定軸を有し、測定軸方向の加速度を測定する加速度センサと、前記磁気センサから出力される前記測定軸毎の地磁気の測定結果である磁気測定データのオフセットを求め、前記磁気測定データを補正する磁気測定データ校正部と、前記磁気測定データ校正装置から出力される、前記磁気測定データを校正した磁気校正データから方位角を算出する方位角計測部とを備え、加速度センサから供給される加速度データからロール角及びピッチ角を求める傾斜角算出部と、前記ロール角の角度範囲とピッチ角の角度範囲との組合せ毎に、当該組合せに対応した磁気測定データを記憶させる領域が設けられた磁気測定データバッファと、磁気センサから供給される磁気測定データを、当該磁気測定データの測定時に検出された前記ロール角及び前記ピッチ角に対応する前記領域に対して書き込んで記憶させる磁気測定データ判定部と、前記磁気測定データから前記オフセットを所定の計算により求めるオフセット算出部と、オフセット算出部の求めたオフセットである算出オフセットと、現在使用しているオフセットである設定オフセットのいずれが確からしいかを、前記磁気測定データバッファに記憶された磁気データを用いて判定し、確からしいと判定されたオフセットを新たな設定オフセットとするオフセット有効性判定部とを備えることを特徴とする。   The azimuth measuring device of the present invention has three measurement axes orthogonal to each other, and includes a magnetic sensor composed of an axis sensor for measuring geomagnetism in the measurement axis direction, and three measurement axes orthogonal to each other, and the measurement axis direction An acceleration sensor that measures the acceleration of the magnetic field, a magnetic measurement data calibration unit that obtains an offset of magnetic measurement data that is a measurement result of the geomagnetism for each measurement axis that is output from the magnetic sensor, and corrects the magnetic measurement data; An azimuth angle measurement unit that calculates an azimuth angle from magnetic calibration data obtained by calibrating the magnetic measurement data output from the magnetic measurement data calibration device, and determines a roll angle and a pitch angle from acceleration data supplied from an acceleration sensor. An area for storing magnetic measurement data corresponding to each combination of an inclination angle calculation unit and the roll angle angle range and the pitch angle angle range. The magnetic measurement data buffer provided and the magnetic measurement data supplied from the magnetic sensor are written and stored in the area corresponding to the roll angle and the pitch angle detected when measuring the magnetic measurement data. Any one of a measurement data determination unit, an offset calculation unit that obtains the offset from the magnetic measurement data by a predetermined calculation, a calculated offset that is an offset obtained by the offset calculation unit, and a set offset that is an offset currently used An offset validity determination unit that determines whether it is probable using the magnetic data stored in the magnetic measurement data buffer and uses the offset determined to be probable as a new set offset is provided.

本発明のバッファは、互いに直交する3つの測定軸を有し、測定軸方向の地磁気を測定する軸センサからなる磁気センサから出力される前記測定軸毎の地磁気の測定結果である磁気測定データのオフセットを求め、前記磁気測定データを補正する、加速度センサから供給される加速度データからロール角及びピッチ角を求める傾斜角算出部と、前記磁気測定データから前記オフセットを所定の計算により求めるオフセット算出部と、オフセット算出部の求めたオフセットである算出オフセットと、現在使用しているオフセットである設定オフセットのいずれが確からしいかを、前記磁気測定データバッファに記憶された磁気データを用いて判定し、磁気測定データを前記磁気センサから取得する磁気測定データ判定部と、確からしいと判定されたオフセットを新たな設定オフセットとするオフセット有効性判定部とからなる磁気測定データ校正装置に用いられるバッファであり、前記ロール角の角度範囲と前記ピッチ角の角度範囲との組合せ毎に、当該組合せに対応した磁気測定データを記憶させる領域が設けられ、前記磁気測定データ判定部により、磁気センサから供給される磁気測定データが、当該磁気測定データの測定時に検出された前記ロール角及び前記ピッチ角に対応する前記領域に対して書き込まれることを特徴とする。   The buffer according to the present invention has three measurement axes orthogonal to each other, and outputs magnetic measurement data that is a measurement result of the geomagnetism for each measurement axis output from a magnetic sensor including an axis sensor that measures the geomagnetism in the measurement axis direction. An inclination angle calculation unit for obtaining an offset and correcting the magnetic measurement data, obtaining a roll angle and a pitch angle from acceleration data supplied from an acceleration sensor, and an offset calculation unit for obtaining the offset from the magnetic measurement data by a predetermined calculation And using the magnetic data stored in the magnetic measurement data buffer to determine which of the calculated offset that the offset calculation unit has obtained and the set offset that is currently used offset is likely, A magnetic measurement data determination unit that acquires magnetic measurement data from the magnetic sensor, and is determined to be probable. Is a buffer used in a magnetic measurement data calibration device comprising an offset validity determination unit that uses the offset as a new set offset, and for each combination of the roll angle angle range and the pitch angle angle range, the combination An area for storing magnetic measurement data corresponding to the magnetic measurement data is provided, and the roll angle and the pitch angle detected by the magnetic measurement data determination unit when the magnetic measurement data supplied from the magnetic sensor is measured. It is written in the area corresponding to.

この発明によれば、オフセットの算出、あるいは算出したオフセットの有効性を判定するために用いる磁気測定データとして、3次元空間においてピッチ角及びロール角を所定の間隔の角度範囲にて設定し、3次元空間におけるオフセットを中心とする全方位を示す球面上を、ピッチ角の角度範囲とロール角の角度範囲との組の各々が指定する領域に分割し、磁気測定データバッファにおける領域毎に設定した記憶領域に、ピッチ角及びロール角が対応する磁気測定データを書き込むため、全方位においてばらついた磁気測定データを蓄積することができる。
これにより、この発明によれば、球面状におけるばらついた領域に蓄積された磁気測定データを、オフセットの算出あるいは算出したオフセットの有効性の判定に用いることができ、磁気測定データの特定方向における重み付けによるオフセットの偏りを抑制し、従来に比較してより真値に近いオフセットを算出することができる。
According to the present invention, the pitch angle and the roll angle are set in a three-dimensional space within an angle range of a predetermined interval as magnetic measurement data used for calculating the offset or determining the effectiveness of the calculated offset. The spherical surface showing the omni-direction centered on the offset in the dimensional space is divided into regions designated by each of the pitch angle angle range and roll angle angle range, and each region in the magnetic measurement data buffer is set. Since the magnetic measurement data corresponding to the pitch angle and the roll angle is written in the storage area, the magnetic measurement data that varies in all directions can be accumulated.
As a result, according to the present invention, the magnetic measurement data accumulated in the dispersed region in the spherical shape can be used for calculating the offset or determining the effectiveness of the calculated offset, and weighting the magnetic measurement data in a specific direction. This makes it possible to calculate the offset closer to the true value as compared with the conventional case.

本発明の第1の実施形態による磁気測定データ校正装置を用いた方位角計測装置の構成例を示す概略ブロック図である。It is a schematic block diagram which shows the structural example of the azimuth angle measuring apparatus using the magnetic measurement data calibration apparatus by the 1st Embodiment of this invention. 3軸加速度センサにより求まる絶対座標系と、3軸磁気センサである磁気計測装置の検出するセンサ座標系との各軸のずれを説明する図である。It is a figure explaining the shift | offset | difference of each axis | shaft of the absolute coordinate system calculated | required by a triaxial acceleration sensor, and the sensor coordinate system which the magnetic measuring device which is a triaxial magnetic sensor detects. 磁気測定データバッファ13に記憶される、検出された磁気測定データを格納する磁気測定データテーブルの構成例を示す図である。It is a figure which shows the structural example of the magnetic measurement data table which stores the detected magnetic measurement data memorize | stored in the magnetic measurement data buffer. オフセットを中心とした球を傾斜角により分割して生成する領域を説明する図である。It is a figure explaining the area | region which divides | segments and produces | generates the sphere centering on an offset by an inclination angle. 第1の実施形態による磁気センサ2が検出した磁気測定データMを校正する処理の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the process which calibrates the magnetic measurement data M which the magnetic sensor 2 by 1st Embodiment detected. 磁気測定データバッファ13に記憶される、検出された磁気測定データを格納する磁気測定データテーブルの他の構成例を示す図である。It is a figure which shows the other structural example of the magnetic measurement data table which stores the detected magnetic measurement data memorize | stored in the magnetic measurement data buffer. この発明の第2の実施形態による磁気測定データ校正装置を用いた方位角計測装置の構成例を示す概略ブロック図である。It is a schematic block diagram which shows the structural example of the azimuth measuring apparatus using the magnetic measurement data calibration apparatus by 2nd Embodiment of this invention. RLSを用いた磁気測定データの構成を行うオフセット算出部14Aの構成例を示すブロック図である。It is a block diagram which shows the structural example of 14 A of offset calculation parts which perform the structure of the magnetic measurement data using RLS. 第2の実施形態による磁気センサ2が検出した磁気測定データMを校正する処理の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the process which calibrates the magnetic measurement data M which the magnetic sensor 2 by 2nd Embodiment detected. 第1の実施形態のオフセット算出部1、あるいは第2の実施形態のオフセット算出部14Aを用いた方位計測装置の方位角θを求める処理の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the process which calculates | requires azimuth | direction angle (theta) of the azimuth | direction measuring device using the offset calculation part 1 of 1st Embodiment, or the offset calculation part 14A of 2nd Embodiment.

<第1の実施形態>
以下、図面を参照して、本発明の第1の実施形態について説明する。図1は、この発明の第1の実施形態による磁気測定データ校正装置を用いた方位角計測装置の構成例を示す概略ブロック図である。この方位角計測装置は、携帯機器などに搭載される。
本実施形態の方位角計測装置は、磁気測定データ校正装置1、磁気センサ2、加速度センサ3及び方位角計測部4から構成されている。
<First Embodiment>
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a schematic block diagram showing a configuration example of an azimuth measuring device using the magnetic measurement data calibration device according to the first embodiment of the present invention. This azimuth measuring device is mounted on a portable device or the like.
The azimuth measuring device of the present embodiment includes a magnetic measurement data calibration device 1, a magnetic sensor 2, an acceleration sensor 3, and an azimuth measuring unit 4.

磁気センサ2は、互いに直交する3つの測定軸を有し、測定軸の各々に対応した地磁気を測定する軸センサから構成されている。この磁気センサ2は、例えば、X軸方向の測定軸における磁界の強度を示す磁気測定データMを測定するX軸方向磁気検出部21、Y軸方向の測定軸における磁界の強度を示す磁気測定データMを測定するY軸方向磁気検出部22、Z軸方向の測定軸における磁界の強度を示す磁気測定データMを測定するZ軸方向磁気検出部23とから構成された、X軸、Y軸及びZ軸の3軸の測定軸を有する磁気センサである。ここで、X軸方向磁気検出部21、Y軸方向磁気検出部22及びZ軸方向磁気検出部23は、例えば、ホール素子、磁気抵抗素子、フラックスゲート型磁気素子などが用いられる。また、X軸方向磁気検出部21、Y軸方向磁気検出部22、Z軸方向磁気検出部23の各々の測定軸は直交している。 The magnetic sensor 2 has three measurement axes that are orthogonal to each other, and is composed of an axis sensor that measures the geomagnetism corresponding to each of the measurement axes. The magnetic sensor 2 includes, for example, an X-axis direction magnetic detection unit 21 that measures magnetic measurement data M x indicating the strength of the magnetic field in the measurement axis in the X-axis direction, and a magnetic measurement that indicates the magnetic field strength in the measurement axis in the Y-axis direction constructed from the Z-axis direction magnetic sensing portion 23 for measuring magnetic measurement data M z indicating the strength of the magnetic field in the Y-axis direction magnetic detection unit 22, the Z-axis direction of the measuring axis for measuring data M y, X-axis, This is a magnetic sensor having three measurement axes, Y-axis and Z-axis. Here, as the X-axis direction magnetic detection unit 21, the Y-axis direction magnetic detection unit 22, and the Z-axis direction magnetic detection unit 23, for example, a Hall element, a magnetoresistive element, a flux gate type magnetic element, or the like is used. The measurement axes of the X-axis direction magnetic detection unit 21, the Y-axis direction magnetic detection unit 22, and the Z-axis direction magnetic detection unit 23 are orthogonal to each other.

加速度センサ3は、互いに直交する3つの測定軸を有し、測定軸の各々に対応した加速度を測定する軸センサから構成されている。この加速度センサ3は、例えば、X軸方向の測定軸における加速度の強度を示す加速度データSを測定するX軸加速度検出部31、Y軸方向の測定軸における加速度の強度を示す加速度データSを測定するY軸加速度検出部32、Z軸方向の測定軸における加速度の強度を示す加速度データSを測定するZ軸加速度検出部33とから構成された、X軸、Y軸及びZ軸の3軸の測定軸を有する加速度センサである。また、X軸加速度検出部31、Y軸加速度検出部32、Z軸加速度検出部33の各々の測定軸は直交している。 The acceleration sensor 3 has three measurement axes that are orthogonal to each other, and includes an axis sensor that measures acceleration corresponding to each of the measurement axes. The acceleration sensor 3 includes, for example, an X-axis acceleration detecting unit 31 that measures acceleration data S x that indicates the intensity of acceleration in the measurement axis in the X-axis direction, and acceleration data S y that indicates the intensity of acceleration in the measurement axis in the Y-axis direction. Of the X-axis, Y-axis, and Z-axis, comprising a Y-axis acceleration detection unit 32 that measures acceleration and a Z-axis acceleration detection unit 33 that measures acceleration data S z indicating the intensity of acceleration in the measurement axis in the Z-axis direction. The acceleration sensor has three measurement axes. The measurement axes of the X-axis acceleration detection unit 31, the Y-axis acceleration detection unit 32, and the Z-axis acceleration detection unit 33 are orthogonal to each other.

磁気測定データ校正装置1は、磁気センサ2から供給される、磁気測定データM、磁気測定データM及び磁気測定データMからなる磁気測定データM(M,M,M)のオフセットを、加速度センサ3の出力する傾斜角(ロール角及びピッチ角)に基づいて校正した磁気校正データM(Mfx,Mfy,Mfz)を出力する。
方位角計測部4は、磁気測定データ校正装置1が校正した磁気校正データM(Mfx,Mfy,Mfz)を用い、方位角計測装置の向いている方位を出力する。
Magnetic measurement data correcting device 1 is supplied from the magnetic sensor 2, a magnetic measurement data M x, magnetic measurements made of the magnetic measurement data M y and magnetometric data M z data M (M x, M y, M z) of Magnetic calibration data M f (M fx , M fy , M fz ) in which the offset is calibrated based on the tilt angle (roll angle and pitch angle) output by the acceleration sensor 3 is output.
The azimuth measuring unit 4 uses the magnetic calibration data M f (M fx , M fy , M fz ) calibrated by the magnetic measurement data calibrating apparatus 1 and outputs the azimuth directed by the azimuth measuring apparatus.

次に、磁気測定データ校正装置1は、傾斜角算出部11、磁気測定データ判定部12、磁気測定データバッファ13、オフセット算出部14、磁気測定データ処理部15、オフセット記憶部16及びオフセット有効性判定部17を備えている。   Next, the magnetic measurement data calibration apparatus 1 includes an inclination angle calculation unit 11, a magnetic measurement data determination unit 12, a magnetic measurement data buffer 13, an offset calculation unit 14, a magnetic measurement data processing unit 15, an offset storage unit 16, and an offset validity. A determination unit 17 is provided.

傾斜角算出部11は、以下に説明するように、ロール角及びピッチ角からなる傾斜角を算出する。
すなわち、傾斜角算出部11は、加速度センサ3の検出した重力の傾きの程度から自身の傾斜角を計算する。
次に、図2は、加速度センサ3により求まる絶対座標系と、磁気センサ2の検出するセンサ座標系との各軸のずれを説明する図である。
図2において、3次元の絶対座標系を校正するX軸、Y軸及びZ軸を定義する。そして、X軸を回転軸とした回転角度をピッチ角(p)とし、Y軸を回転軸とした回転角度をロール角(r)とし、Z軸を回転軸とした回転角度を方位角(θ)とする。
The inclination angle calculation unit 11 calculates an inclination angle composed of a roll angle and a pitch angle, as will be described below.
That is, the inclination angle calculation unit 11 calculates its own inclination angle from the degree of gravity inclination detected by the acceleration sensor 3.
Next, FIG. 2 is a diagram for explaining the deviation of each axis between the absolute coordinate system obtained by the acceleration sensor 3 and the sensor coordinate system detected by the magnetic sensor 2.
In FIG. 2, an X axis, a Y axis, and a Z axis for calibrating a three-dimensional absolute coordinate system are defined. The rotation angle with the X axis as the rotation axis is the pitch angle (p), the rotation angle with the Y axis as the rotation axis is the roll angle (r), and the rotation angle with the Z axis as the rotation axis is the azimuth angle (θ ).

上記絶対座標系とは、本実施形態においては、重力ベクトル(重力の方向及び大きさを示すベクトル量)に対してX軸とY軸とにより形成される平面が垂直であり、磁気センサ2の測定する磁気測定データM(Mx,My,Mz)の全てがゼロとなる地点を原点Oとした座標系としている。
また、センサ座標系は、磁気センサ2が測定する磁気測定データM(M,M,M)が形成する座標系である。このため、磁気センサ2が磁気測定データM(M,M,M)を測定する測定点毎にセンサ座標系は異なる。
In the present embodiment, the absolute coordinate system means that the plane formed by the X axis and the Y axis is perpendicular to the gravity vector (vector quantity indicating the direction and magnitude of gravity), and the magnetic sensor 2 A coordinate system having the origin O as a point where all of the magnetic measurement data M (Mx, My, Mz) to be measured becomes zero.
The sensor coordinate system is a coordinate system formed by magnetic measurement data M (M x , M y , M z ) measured by the magnetic sensor 2. For this reason, the sensor coordinate system is different for each measurement point at which the magnetic sensor 2 measures the magnetic measurement data M (M x , M y , M z ).

しかしながら、ユーザが携帯した携帯機器を、絶対座標系におけるX軸及びY軸のなす平面と、磁気センサの測定軸、すなわちセンサ座標系におけるX軸(Mの測定軸)及びY軸(Mの測定軸)のなす平面とを平行とすることは困難である。
そのため、磁気センサ2により方位角を推定する場合、常に絶対座標系におけるX軸及びY軸のなす平面に対して、磁気センサ2のセンサ座標系におけるX方向の測定軸(X軸検出磁界)とY方向の測定軸(T軸検出磁界)とのなす平面が平行であれば、周囲の環境による磁界の変化などの影響があっても、常に、傾斜センサとして用いた3軸加速度センサの測定する重力ベクトルにより、磁気センサ2、すなわち方位角計測装置の傾斜角を正確に測定することができる。
However, the mobile device user portable, and form planes of X-axis and Y-axis of the absolute coordinate system, the measurement axis of the magnetic sensor, that is, the X axis in the sensor coordinate system (measurement axis of the M x) and Y-axis (M y It is difficult to make the plane formed by the measurement axis) parallel to each other.
Therefore, when the azimuth angle is estimated by the magnetic sensor 2, the measurement axis (X-axis detection magnetic field) in the X direction in the sensor coordinate system of the magnetic sensor 2 is always relative to the plane formed by the X axis and the Y axis in the absolute coordinate system. If the plane formed by the measurement axis in the Y direction (T-axis detection magnetic field) is parallel, the triaxial acceleration sensor used as the tilt sensor is always measured even if there is an influence of changes in the magnetic field due to the surrounding environment. The inclination angle of the magnetic sensor 2, that is, the azimuth measuring device can be accurately measured by the gravity vector.

このときに、方位角計測装置(携帯機器)が地表に対して水平状態である場合、加速度センサ3の出力する加速度計測データを、加速度計測データS(S,S,S)とする。一方、方位角計測装置が地表に対して傾斜状態である場合、加速度センサ3の出力する加速度計測データを、加速度計測データS’(S’,S’,S’)とする。
このとき、加速度計測データS(S,S,S)と加速度計測データS’(S’,S’,S’)との関係は、以下の(1)式により示される。
At this time, when the azimuth measuring device (portable device) is in a horizontal state with respect to the ground surface, the acceleration measurement data output from the acceleration sensor 3 is the acceleration measurement data S (S x , S y , S z ). . On the other hand, when the azimuth measuring device is tilted with respect to the ground surface, the acceleration measurement data output from the acceleration sensor 3 is assumed to be acceleration measurement data S ′ (S x ′, S y ′, S z ′).
At this time, the relationship between the acceleration measurement data S (S x , S y , S z ) and the acceleration measurement data S ′ (S x ′, S y ′, S z ′) is expressed by the following equation (1). .

Figure 2013124871
Figure 2013124871

そして、ユーザの携帯する携帯機器が傾斜状態にあるとき、この傾斜状態での重力加速度で規格化された加速度センサ3の出力を加速度計測データA(A,A,A)とすると、地表面に対して方位計測装置が水平状態にある場合、A(A,A,A)=A(0,0,1)であるため、上記(1)式は以下に示す(2)式となる。 When the portable device carried by the user is in an inclined state, the output of the acceleration sensor 3 normalized by the gravitational acceleration in the inclined state is acceleration measurement data A (A x , A y , A z ). When the azimuth measuring device is in a horizontal state with respect to the ground surface, since A (A x , A y , A z ) = A (0, 0, 1), the above equation (1) is shown below (2 ).

Figure 2013124871
Figure 2013124871

したがって、傾斜角算出部11は、加速度センサ3の出力する加速度計測データA(A,A,A)を用い、ピッチ角(p)が以下に示す(3)式から、また、ロール角(r)が以下に示す(4)式により算出する。 Therefore, the tilt angle calculation unit 11 uses the acceleration measurement data A (A x , A y , A z ) output from the acceleration sensor 3, and the pitch angle (p) from the following expression (3) The angle (r) is calculated by the following equation (4).

Figure 2013124871
Figure 2013124871

Figure 2013124871
Figure 2013124871

次に、図3は、磁気測定データバッファ13に記憶される磁気測定データを格納する磁気測定データテーブルの構成例を示す図である。ここで、磁気測定データバッファ13は、磁気測定データを格納する磁気測定データテーブルが記憶されるバッファである。
上記図3において、磁気測定データテーブルは、磁気測定データを取得した位置のロール角及びピッチ角の組合せの傾斜角と、磁気測定データが記憶されているか否かを示すフラグと、磁気測定データを取得した時刻を示す時間情報と、測定された磁気測定データとが、領域毎に記憶される構成となっている。
Next, FIG. 3 is a diagram showing a configuration example of a magnetic measurement data table that stores magnetic measurement data stored in the magnetic measurement data buffer 13. Here, the magnetic measurement data buffer 13 is a buffer in which a magnetic measurement data table for storing magnetic measurement data is stored.
In FIG. 3, the magnetic measurement data table includes an inclination angle of a combination of a roll angle and a pitch angle at a position where the magnetic measurement data is acquired, a flag indicating whether or not the magnetic measurement data is stored, and magnetic measurement data. Time information indicating the acquired time and measured magnetic measurement data are stored for each region.

次に、図4は、オフセットを中心とした球を傾斜角により分割して生成する領域を説明する図である。
領域は、オフセットを中心とした球における磁気測定データの位置が含まれる、ロール角及びピッチ角の各々の範囲を示している。すなわち、磁気測定データバッファ13における領域数は、傾斜角(ロール角及びピッチ角)の測定範囲を一定角度で分割した数で決定される。例えば、オフセットOを中心として全方位を表すためには、ピッチ角pが−90°から90°までの範囲、ロール角rが−180°から180°までの範囲が測定できていれば良い。
Next, FIG. 4 is a diagram for explaining a region generated by dividing a sphere centered at an offset by an inclination angle.
The area indicates each range of the roll angle and the pitch angle including the position of the magnetic measurement data in the sphere with the offset as the center. That is, the number of regions in the magnetic measurement data buffer 13 is determined by the number obtained by dividing the measurement range of the tilt angle (roll angle and pitch angle) by a fixed angle. For example, in order to represent all directions with the offset O as the center, it is only necessary to measure a range where the pitch angle p is −90 ° to 90 ° and a roll angle r is −180 ° to 180 °.

このとき、ピッチ角及びロール角の各々を30°の一定角度毎に分割すると、ピッチ角pの分割数が6個、またロール角rの分割数が12個となる。
したがって、これらのピッチ角p及びロール角rの各々の角度範囲の組合せの数は72となり、領域は72種類となる。
図3に戻り、磁気測定データバッファ13は、記憶容量として、上述のようにピッチ角及びロール角の組合せ数から決定される領域数に比例した数のバッファ数を設けるように構成する。
したがって、従来のように同一方向のベクトルを有する磁気測定データが集中して蓄積されるのではなく、同一のベクトルを有する磁気測定データが供給された場合、対応する磁気測定データバッファ13の領域に、時間の新しい磁気測定データが蓄積される。このため、3次元空間における全方位の方向を示す球面上の異なる位置の磁気測定データ、すなわちばらついた方向のベクトルを有する磁気測定データが磁気測定データバッファ13に蓄積されることになる。
At this time, when each of the pitch angle and the roll angle is divided at a constant angle of 30 °, the number of divisions of the pitch angle p is 6, and the number of divisions of the roll angle r is 12.
Therefore, the number of combinations of the angle ranges of these pitch angle p and roll angle r is 72, and there are 72 types of regions.
Returning to FIG. 3, the magnetic measurement data buffer 13 is configured so that the number of buffers proportional to the number of areas determined from the number of combinations of pitch angle and roll angle as described above is provided as the storage capacity.
Therefore, the magnetic measurement data having the same direction vector is not concentrated and accumulated as in the prior art, but when the magnetic measurement data having the same vector is supplied, the corresponding magnetic measurement data buffer 13 area is stored. , New magnetic measurement data of time is accumulated. For this reason, magnetic measurement data at different positions on the spherical surface indicating the directions in all directions in the three-dimensional space, that is, magnetic measurement data having vectors in the different directions are accumulated in the magnetic measurement data buffer 13.

次に、磁気測定データバッファ13における磁気測定データが、図4に示す球面状に近づく理由について以下に説明する。図4においては、傾斜角が変化した場合の磁気測定データの軌跡について説明している。
傾斜角が0(ロール角r及びピッチ角pの双方が0)の状態において、携帯機器を地平面に対して平行な円の円周を一回転させた場合、磁気測定データMは、図4に示すように、一定の球面上の下、すなわち球の下部の面の円周上の軌跡をたどることになる。
また、傾斜角においてロール角rが0°であり、ピッチ角pが30°である状態において、携帯機器を地平面に対して平行な円の円周を一回転させた場合、磁気測定データMは、図4に示すように、上述した軌跡をX軸回りに30°傾けた円周上の軌跡をたどることになる。
Next, the reason why the magnetic measurement data in the magnetic measurement data buffer 13 approaches the spherical shape shown in FIG. 4 will be described below. FIG. 4 illustrates the trajectory of magnetic measurement data when the tilt angle changes.
In a state where the tilt angle is 0 (both the roll angle r and the pitch angle p are 0), when the portable device is rotated once around the circumference of a circle parallel to the ground plane, the magnetic measurement data M z is As shown in FIG. 4, the trajectory is traced down on a certain spherical surface, that is, on the circumference of the lower surface of the sphere.
Further, when the roll angle r is 0 ° and the pitch angle p is 30 ° at the tilt angle, the magnetic measurement data M is obtained when the portable device is rotated once around the circle parallel to the ground plane. As shown in FIG. 4, z follows a locus on a circumference obtained by inclining the locus described above by 30 ° around the X axis.

上述した磁気測定データバッファ13に対する磁気測定データの格納方法は、例えば後述する図3あるいは図6に示すように、ピッチ角pの角度範囲を0°から30°、ロール角rの角度範囲を0°から30°の組合せを、領域R1として設定している。磁気測定データバッファ13における領域R1のアドレスバッファに対し、ロール角rの角度範囲とピッチ角pの角度範囲とにおいて、図4に示したそれぞれの円周の間に挟まれる領域の磁気測定データが書き込まれる可能性がある。
すなわち、ロール角r及びピッチ角pの各々の角度範囲を限定することにより、図4の球における磁気測定データの取り得る範囲を限定することができ、しかもその範囲は球面の一部となる。このように、球の面を領域として分割し(すなわち、オフセットを中心とした全方位を角度範囲により領域として分割し)、それぞれの領域に対応する磁気測定データを磁気測定データバッファ13に書き込んで記憶させることにより、各磁気測定データM(M,M,M)の分布が球面に近づくことになる。
The magnetic measurement data is stored in the magnetic measurement data buffer 13 as described above, for example, as shown in FIG. 3 or FIG. 6 to be described later, the angle range of the pitch angle p is 0 ° to 30 °, and the angle range of the roll angle r is 0. A combination from ° to 30 ° is set as the region R1. With respect to the address buffer of the region R1 in the magnetic measurement data buffer 13, the magnetic measurement data of the region sandwiched between the respective circumferences shown in FIG. 4 in the angle range of the roll angle r and the angle range of the pitch angle p is stored. May be written.
That is, by limiting the angle ranges of the roll angle r and the pitch angle p, it is possible to limit the range of magnetic measurement data that can be taken in the sphere of FIG. 4, and the range becomes a part of a spherical surface. In this way, the surface of the sphere is divided into regions (that is, all directions around the offset are divided into regions according to the angle range), and magnetic measurement data corresponding to each region is written into the magnetic measurement data buffer 13. By storing, the distribution of each magnetic measurement data M (M x , M y , M z ) approaches a spherical surface.

また、磁気測定データバッファ13は、予め領域が設定されており、領域R1が例えばロール角rが0度から30度の範囲、ピッチ角pが0度から30度の範囲として設定されている。
また、領域R2がロール角rが0度から30度の範囲、ピッチ角pが31度から60度の範囲として設定され、他の領域R3から領域R72も同様にロール角r及びピッチ角pの範囲で設定されている。
The magnetic measurement data buffer 13 has an area set in advance, and the area R1 is set, for example, as a roll angle r ranging from 0 degrees to 30 degrees and a pitch angle p ranging from 0 degrees to 30 degrees.
Further, the region R2 is set so that the roll angle r is in the range of 0 to 30 degrees, and the pitch angle p is in the range of 31 to 60 degrees, and the other regions R3 to R72 are similarly set to the roll angle r and the pitch angle p. It is set with a range.

このロール角rの角度範囲とピッチ角pの角度範囲とによる組合せ数、すなわち領域数を設定する際、分割する領域は細かければ細かいほど磁気測定データの軌跡(磁気測定データバッファ13に記憶される磁気測定データの検出する位置)が球面状に近づくことになる。
しかしながら、傾斜角の測定精度より、角度範囲が小さくなると、測定誤差を有するロール角r及びピッチ角pとの組合せにより、異なったバッファアドレスが対応アドレスから読み出されることになる。
すなわち、磁気測定データバッファ13において本来格納すべきバッファアドレスに書き込むことができなくなり、オフセット算出部14の行うオフセット算出処理や、オフセット有効性判定部17が行うオフセット有効性判定処理で誤った結果を出力することになる。
When setting the number of combinations by the angle range of the roll angle r and the angle range of the pitch angle p, that is, the number of regions, the smaller the region to be divided, the smaller the track of the magnetic measurement data (stored in the magnetic measurement data buffer 13). The position of the magnetic measurement data detected) approaches a spherical shape.
However, if the angle range becomes smaller than the measurement accuracy of the tilt angle, different buffer addresses are read out from the corresponding addresses by the combination of the roll angle r and the pitch angle p having measurement errors.
In other words, the magnetic measurement data buffer 13 cannot write to the buffer address that should be originally stored, and an incorrect result is obtained in the offset calculation process performed by the offset calculation unit 14 or the offset validity determination process performed by the offset validity determination unit 17. Will be output.

また、分割する領域は細かければ細かいほど、上述したように、磁気測定データバッファ13における領域数が多くなり、オフセット算出部14がオフセット座標O(O,O,O)を算出する際の時間が増加することになる。
このため、本実施形態においては、ピッチ角pの分割数を18個とし、ロール角rの分割数を36個とし、ピッチ角pの角度範囲及びロール角rの角度範囲の組合せの数である領域数を、648個とする。ここで、角度範囲のステップ数は10°ごとに設定されている。
Further, as the area to be divided becomes finer, the number of areas in the magnetic measurement data buffer 13 increases as described above, and the offset calculation unit 14 calculates the offset coordinates O (O x , O y , O z ). Time will increase.
Therefore, in the present embodiment, the number of divisions of the pitch angle p is 18, the number of divisions of the roll angle r is 36, and the number of combinations of the angle range of the pitch angle p and the angle range of the roll angle r is the number. The number of areas is 648. Here, the number of steps in the angle range is set every 10 °.

図1に戻り、磁気測定データ判定部12は、磁気センサ2から磁気測定データM(M、M、M)の取得に同期し、傾斜角算出部11から傾斜角データ(ロール角r及びピッチ角p)を取得する。
すなわち、磁気測定データ判定部12は、磁気測定データM(M、M、M)と、この磁気測定データM(M、M、M)を取得した位置の傾斜角とを取得する。
また、磁気測定データ判定部12は、図示しない計時を行うタイマから、磁気測定データMを取得した時刻を読み込む。
これにより、磁気測定データ判定部12は、傾斜角におけるロール角rとピッチ角pとの組合せが含まれる領域を磁気測定データバッファ13において抽出する。
Returning to FIG. 1, the magnetic measurement data determination unit 12 synchronizes with acquisition of the magnetic measurement data M (M x , M y , M z ) from the magnetic sensor 2, and the inclination angle data (roll angle r) from the inclination angle calculation unit 11. And the pitch angle p).
That is, the magnetic measurement data determination unit 12 calculates the magnetic measurement data M (M x , M y , M z ) and the inclination angle of the position where the magnetic measurement data M (M x , M y , M z ) is acquired. get.
Further, the magnetic measurement data determination unit 12 reads the time when the magnetic measurement data M is acquired from a timer that performs time measurement (not shown).
Thereby, the magnetic measurement data determination unit 12 extracts a region including the combination of the roll angle r and the pitch angle p in the tilt angle in the magnetic measurement data buffer 13.

ここで、磁気測定データ判定部12は、ロール角rの角度範囲とピッチ角pの角度範囲との組合せと、磁気測定データバッファ13のバッファアドレスとを対応付けた対応テーブルが、内部記憶部に予め書き込まれて記憶されている。
したがって、磁気測定データ判定部12は、取得した磁気測定データM(M、M、M)が検出された位置のピッチ角pとロール角rとが含まれるロール角rの角度範囲とピッチ角pの角度範囲との組合せを内部記憶部から検出する。
そして、磁気測定データ判定部12は、ロール角rの角度範囲とピッチ角pの角度範囲との組合せに対応して記憶されているバッファアドレス(領域毎の記憶位置を示すアドレス)を内部記憶部から読み出す。
Here, the magnetic measurement data determination unit 12 has a correspondence table in which the combination of the angle range of the roll angle r and the angle range of the pitch angle p is associated with the buffer address of the magnetic measurement data buffer 13 in the internal storage unit. Pre-written and stored.
Therefore, the magnetic measurement data determination unit 12 includes an angle range of the roll angle r including the pitch angle p and the roll angle r at the position where the acquired magnetic measurement data M (M x , M y , M z ) is detected. A combination with the angle range of the pitch angle p is detected from the internal storage unit.
Then, the magnetic measurement data determination unit 12 stores the buffer address (address indicating the storage position for each area) stored in association with the combination of the angle range of the roll angle r and the angle range of the pitch angle p. Read from.

磁気測定データ判定部12は、磁気測定データバッファ13において、内部記憶部から読み出したバッファアドレスに対して、取得した磁気測定データM(M、M、M)を磁気測定データの欄(書き込み領域)に書き込んで記憶させる。
このとき、磁気測定データ判定部12は、磁気測定データM(M、M、M)を書き込むとともに、磁気測定データバッファ13の読み出したバッファアドレスに対応して、傾斜角の欄にロール角r及びピッチ角pを書き込み、フラグの欄に磁気測定データを書き込んだことを示すフラグ情報を書き込み、磁気測定データMと取得した際の時刻を時間情報の欄に書き込む。
In the magnetic measurement data buffer 13, the magnetic measurement data determination unit 12 uses the acquired magnetic measurement data M (M x , M y , M z ) for the buffer address read from the internal storage unit in the magnetic measurement data column ( Write to (write area) and store.
At this time, the magnetic measurement data determination unit 12 writes the magnetic measurement data M (M x , M y , M z ) and rolls it in the column of the tilt angle corresponding to the buffer address read out of the magnetic measurement data buffer 13. The angle r and the pitch angle p are written, flag information indicating that the magnetic measurement data has been written is written in the flag column, and the magnetic measurement data M and the time at the time of acquisition are written in the time information column.

ここで、磁気測定データ判定部12は、磁気測定データを書き込む領域に、すでに磁気測定データが書き込まれている場合、これから書き込もうとする磁気測定データとすでに書き込まれている磁気測定データとのいずれが新しい磁気測定データかの検出を行う。
すなわち、磁気測定データ判定部12は、これから書き込もうとする磁気測定データとすでに書き込まれている磁気測定データとの各々の時間情報を比較し、時刻が遅いほうの磁気測定データを新しいとして判定する。
これにより、磁気測定データ判定部12は、書き込まれている磁気測定データが新しい場合、書き込もうとする磁気測定データを破棄し、書き込まれている磁気測定データが古い場合、書き込もうとする磁気測定データを上書きする。
Here, when the magnetic measurement data is already written in the area in which the magnetic measurement data is written, the magnetic measurement data determination unit 12 determines which one of the magnetic measurement data to be written and the already written magnetic measurement data. Detection of new magnetic measurement data.
That is, the magnetic measurement data determination unit 12 compares the time information between the magnetic measurement data to be written and the already written magnetic measurement data, and determines that the magnetic measurement data with the later time is new.
Thereby, the magnetic measurement data determination unit 12 discards the magnetic measurement data to be written when the written magnetic measurement data is new, and if the written magnetic measurement data is old, the magnetic measurement data to be written is discarded. Overwrite.

オフセット算出部14は、磁気測定データバッファ13の磁気測定データテーブルから、各領域のフラグの欄を検索し、フラグ情報が設定されている領域を検出し、この領域から磁気測定データMを読み出し、オフセットの算出を行う。
例えば、オフセット算出部14は、以下の(5)式により、オフセットを算出する。
The offset calculation unit 14 searches the flag column of each area from the magnetic measurement data table of the magnetic measurement data buffer 13, detects the area where flag information is set, reads the magnetic measurement data M from this area, Calculate the offset.
For example, the offset calculation unit 14 calculates the offset by the following equation (5).

Figure 2013124871
Figure 2013124871

この(5)式において、O,O,Oがオフセットの値(オフセット座標O(O,O,O))であり、Rが定数であり、Xi、Yi及びZiの各々が、ぞれぞれの領域における磁気測定データM、M、Mである。
したがって、オフセット算出部14は、上述した(5)式を用い、領域毎に、磁気測定データM、M、Mの各々から、それぞれO、O、Oを減算した数値を二乗した数値を加算し、加算した数値からR2を減算し、この減算結果を全領域で加算して評価値Gを求める。このとき、オフセット算出部14は、O、O、Oの各々を仮の値として変化させつつ、評価値Gが最小となるO、O、Oの組合せを求め、この組合せをオフセット座標O(O,O,O)として出力する。
In the equation (5), O x , O y , and O z are offset values (offset coordinates O (O x , O y , O z )), R is a constant, and each of Xi, Yi, and Zi Are the magnetic measurement data M x , M y , M z in the respective regions.
Therefore, the offset calculation unit 14 uses the above-described equation (5), and subtracts the numerical values obtained by subtracting O x , O y , and O z from the magnetic measurement data M x , M y , and M z for each region. The squared numerical value is added, R2 is subtracted from the added numerical value, and this subtraction result is added in all areas to obtain the evaluation value G. At this time, the offset calculation unit 14 obtains a combination of O x , O y , and O z that minimizes the evaluation value G while changing each of O x , O y , and O z as provisional values. Are output as offset coordinates O (O x , O y , O z ).

オフセット有効性判定部17は、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)と、磁気測定データバッファ13に記憶されている磁気測定データM(M、M、M)との領域毎の差分を算出し、全領域における差分の標準偏差σ1を求める。
また、オフセット有効性判定部17は、新たに算出した算出オフセットであるオフセット座標O(O,O,O)と、磁気測定データバッファ13に記憶されている設定オフセットである磁気測定データM(M、M、M)との領域毎の差分を算出し、全領域における差分の標準偏差σ2を求める。
The offset validity determination unit 17 includes offset coordinates O (O x , O y , O z ) stored in the offset storage unit 16 and magnetic measurement data M (M x , The difference for each region with M y , M z ) is calculated, and the standard deviation σ1 of the difference in all regions is obtained.
The offset validity determination unit 17 also includes offset coordinate O (O x , O y , O z ) that is a newly calculated offset, and magnetic measurement data that is a set offset stored in the magnetic measurement data buffer 13. A difference for each area with M (M x , M y , M z ) is calculated, and a standard deviation σ2 of the difference in all areas is obtained.

ここで、オフセット有効性判定部17は、標準偏差σ1と標準偏差σ2とを比較し、標準偏差σ1が標準偏差σ2より小さい場合、オフセット記憶部16の書き換えを行わない。
一方、オフセット有効性判定部17は、標準偏差σ2が標準偏差σ1より小さい場合、すなわち、新たなオフセットが、すでにオフセット記憶部16に記憶されているオフセット座標より確からしいと判定した場合、オフセット記憶部16に対して新たなオフセット座標O(O,O,O)を上書きする。
上述した方法により、球面状に近い多数の磁気測定データを用いて、オフセット座標と磁気測定データとの距離との差分の標準偏差σを算出するため、球面を推定する信頼性が高くなる。
Here, the offset validity determination unit 17 compares the standard deviation σ1 and the standard deviation σ2, and if the standard deviation σ1 is smaller than the standard deviation σ2, the offset storage unit 16 is not rewritten.
On the other hand, when the standard deviation σ2 is smaller than the standard deviation σ1, that is, when it is determined that the new offset is more likely than the offset coordinates already stored in the offset storage unit 16, the offset validity determination unit 17 stores the offset. The new offset coordinates O (O x , O y , O z ) are overwritten on the part 16.
Since the standard deviation σ of the difference between the offset coordinate and the distance between the magnetic measurement data is calculated by using the above-described method using a large number of magnetic measurement data close to a spherical shape, the reliability of estimating the spherical surface is increased.

また、上述した標準偏差σを求めて、算出したオフセット座標O(O,O,O)の有効性を判定するのではなく、他の方法において、算出したオフセット座標O(O,O,O)の有効性を判定する構成としても良い。
例えば、オフセット有効性判定部17は、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)と、新たに算出されたオフセット座標O(O,O,O)との差分を求め、この差分を有効性の判定に用いる構成としても良い。
すなわち、オフセット有効性判定部17は、内部記憶部に予め閾値が予め書き込まれて記憶されている。この閾値は、例えば、地磁気の大きさに設定されている。
Further, instead of determining the above-described standard deviation σ and determining the effectiveness of the calculated offset coordinates O (O x , O y , O z ), the calculated offset coordinates O (O x , It is good also as a structure which determines the effectiveness of Oy , Oz ).
For example, the offset validity determination unit 17 uses the offset coordinates O (O x , O y , O z ) stored in the offset storage unit 16 and the newly calculated offset coordinates O (O x , O y , O It is good also as a structure which calculates | requires the difference with z ) and uses this difference for determination of effectiveness.
That is, the offset validity determination unit 17 stores the threshold value in advance in the internal storage unit. This threshold value is set to the magnitude of geomagnetism, for example.

オフセット有効性判定部17は、求めた差分が閾値を超える場合、新たに算出したオフセット座標O(O,O,O)が誤っている可能性が高いため、新たなオフセット座標O(O,O,O)を破棄し、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)をそのままとする。
一方、オフセット有効性判定部17は、求めた差分が閾値以下の場合、新たに算出したオフセット座標O(O,O,O)が正しい可能性が高いため、新たなオフセット座標O(O,O,O)を、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)に対して上書きする。
If the calculated difference exceeds the threshold value, the offset validity determination unit 17 is likely to have an error in the newly calculated offset coordinate O (O x , O y , O z ). O x , O y , O z ) are discarded, and the offset coordinates O (O x , O y , O z ) stored in the offset storage unit 16 are left as they are.
On the other hand, when the calculated difference is equal to or smaller than the threshold value, the offset validity determination unit 17 has a high possibility that the newly calculated offset coordinate O (O x , O y , O z ) is correct. O x , O y , O z ) is overwritten on the offset coordinates O (O x , O y , O z ) stored in the offset storage unit 16.

また、他の有効性を判定する方法として、オフセット有効性判定部17は、オフセット座標O(O,O,O)と磁気測定データバッファ13の各領域の磁気測定データとの距離を、領域毎に算出する。
オフセット有効性判定部17は、領域毎に算出された磁気測定データの各々に対応する距離の中から、最大値と最小値との差を判定値に用いる構成としてもよい。この判定値が大きければ大きいほど、オフセット座標O(O,O,O)が磁気測定データバッファ13の各領域の磁気測定データの各々から等距離にない、すなわち球の中心ではないことを意味している。
As another method for determining the validity, the offset validity determination unit 17 determines the distance between the offset coordinate O (O x , O y , O z ) and the magnetic measurement data in each region of the magnetic measurement data buffer 13. Calculate for each area.
The offset validity determination unit 17 may be configured to use the difference between the maximum value and the minimum value as the determination value from the distances corresponding to each of the magnetic measurement data calculated for each region. The larger this judgment value is, the more the offset coordinate O (O x , O y , O z ) is not equidistant from each of the magnetic measurement data in each region of the magnetic measurement data buffer 13, that is, not the center of the sphere. Means.

ここで、オフセット有効性判定部17は、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)に対応する判定値D1と、新たに算出したオフセット座標O(O,O,O)の判定値D2とを求める。
そして、オフセット有効性判定部17は、判定値D1が判定値D2以下である(D1≦D2)場合、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)が、新たに算出されたオフセット座標O(O,O,O)より有効であると判定する。
したがって、オフセット有効性判定部17は、新たなオフセット座標O(O,O,O)を破棄し、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)をそのままとする。
Here, the offset validity determination unit 17 determines the determination value D1 corresponding to the offset coordinate O (O x , O y , O z ) stored in the offset storage unit 16 and the newly calculated offset coordinate O (O x , O y , O z ) and a determination value D2.
When the determination value D1 is equal to or less than the determination value D2 (D1 ≦ D2), the offset validity determination unit 17 uses the offset coordinates O (O x , O y , O z ) stored in the offset storage unit 16. It is determined that the offset coordinates O (O x , O y , O z ) newly calculated are more effective.
Therefore, the offset validity judging unit 17, a new offset coordinates O (O x, O y, O z) Destroys the offset coordinates stored in the offset storage unit 16 O (O x, O y , O z ) As it is.

一方、オフセット有効性判定部17は、判定値D1が判定値D2以上である(D1>D2)場合、新たに算出されたオフセット座標O(O,O,O)が、現在使用されているオフセット、すなわちオフセット記憶部16に記憶されているオフセット座標O(O,O,O)より有効であると判定する。
したがって、オフセット有効性判定部17は、新たなオフセット座標O(O,O,O)を、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)に対して上書きする。
On the other hand, when the determination value D1 is greater than or equal to the determination value D2 (D1> D2), the offset validity determination unit 17 currently uses the newly calculated offset coordinates O (O x , O y , O z ). Is determined to be more effective than the offset coordinate O (O x , O y , O z ) stored in the offset storage unit 16.
Therefore, the offset validity judging unit 17, a new offset coordinates O (O x, O y, O z), and the offset coordinates O stored in the offset storage unit 16 (O x, O y, O z) in Overwrite on the other hand.

オフセット記憶部16は、オフセット座標O(O,O,O)が、オフセット有効性判定部17により書き込まれて記憶されている。
磁気測定データ処理部15は、磁気センサ2から取得された磁気測定データMから、オフセット座標を減算し、この減算結果を補正後の磁気測定データとし、磁気校正データM(Mfx,Mfy,Mfz)として、方位角計測部4に対して出力する。
方位角計測部4は、磁気測定データ校正装置1が構成した磁気校正データM(Mfx,Mfy,Mfz)を用い、方位角計測装置の向いている方位を出力する。
In the offset storage unit 16, offset coordinates O (O x , O y , O z ) are written and stored by the offset validity determination unit 17.
The magnetic measurement data processing unit 15 subtracts the offset coordinate from the magnetic measurement data M acquired from the magnetic sensor 2 and uses the subtraction result as corrected magnetic measurement data, and magnetic calibration data M f (M fx , M fy). , M fz ) and output to the azimuth measuring unit 4.
The azimuth measuring unit 4 uses the magnetic calibration data M f (M fx , M fy , M fz ) configured by the magnetic measurement data calibrating apparatus 1 and outputs the azimuth facing the azimuth measuring apparatus.

次に、図1及び図5を用いて、本実施形態の磁気測定データ校正装置1における磁気測定データの校正を行う処理について説明する。図5は、磁気センサ2が検出した磁気測定データMを校正する処理の動作例を示すフローチャートである。
ステップS1:
磁気測定データ判定部12は、外部からユーザが設定した全方位におけるピッチ角pの角度範囲及びロール角rの角度範囲とにより、領域数を決定し、磁気測定データバッファ13における各領域を示すバッファアドレスと、領域におけるピッチ角r及びロール角rの角度範囲の組合せとを対応付けた対応テーブルを作成する。ここでのバッファアドレスは、すでに説明したように、磁気測定データバッファ13内における各領域の各欄のアドレスを示している。
そして、磁気測定データ判定部12は、作成した対応テーブルを内部記憶部に書き込んで記憶させる。すなわち、磁気測定データ判定部12は、磁気測定データバッファ13に対して、磁気測定データを書き込む領域を確保する。
Next, a process for calibrating magnetic measurement data in the magnetic measurement data calibration apparatus 1 of the present embodiment will be described with reference to FIGS. FIG. 5 is a flowchart showing an operation example of processing for calibrating the magnetic measurement data M detected by the magnetic sensor 2.
Step S1:
The magnetic measurement data determination unit 12 determines the number of regions based on the angle range of the pitch angle p and the roll angle r in all directions set by the user from the outside, and a buffer indicating each region in the magnetic measurement data buffer 13 A correspondence table is created in which addresses are associated with combinations of pitch angles r and roll angle r ranges in the region. The buffer address here indicates the address of each column of each area in the magnetic measurement data buffer 13 as described above.
Then, the magnetic measurement data determination unit 12 writes and stores the created correspondence table in the internal storage unit. That is, the magnetic measurement data determination unit 12 reserves an area for writing magnetic measurement data in the magnetic measurement data buffer 13.

また、磁気測定データ判定部12の内部記憶部に対し、予め固定されたテーブルとして磁気測定データバッファ13における各領域を示すバッファアドレスと、領域におけるピッチ角r及びロール角rの角度範囲の組合せとを対応付けた対応テーブルを書き込んで記憶させておいても良い。
そして、磁気測定データ判定部12は、磁気測定データバッファ13における全ての領域のフラグを初期化する。すなわち、磁気測定データ判定部12は、磁気測定データバッファにおける全てのフラグの欄のフラグ情報を削除し、磁気測定データが書き込まれていない状態に変更する。
Further, a buffer address indicating each area in the magnetic measurement data buffer 13 as a table fixed in advance with respect to the internal storage section of the magnetic measurement data determination section 12, and a combination of an angle range of the pitch angle r and the roll angle r in the area May be written and stored.
Then, the magnetic measurement data determination unit 12 initializes the flags of all the areas in the magnetic measurement data buffer 13. That is, the magnetic measurement data determination unit 12 deletes the flag information in all the flag fields in the magnetic measurement data buffer, and changes the state so that no magnetic measurement data is written.

ステップS2:
磁気測定データ判定部12は、磁気測定データM(M,M,M)を磁気センサ2から読み込むととともに、傾斜角算出部11に対して傾斜角の算出を行う制御信号を出力する。
この制御信号により、傾斜角算出部11は、加速度センサ3から加速度計測データS(S,S,S)を読み込む。
そして、傾斜角算出部11は、加速度計測データSから、すでに述べたように、ロール角r及びピッチ角pを算出し、算出したロール角r及びピッチ角pの傾斜角データを磁気測定データ判定部12に対して出力する。
Step S2:
The magnetic measurement data determination unit 12 reads the magnetic measurement data M (M x , M y , M x ) from the magnetic sensor 2 and outputs a control signal for calculating the tilt angle to the tilt angle calculation unit 11. .
With this control signal, the tilt angle calculation unit 11 reads acceleration measurement data S (S x , S y , S z ) from the acceleration sensor 3.
Then, as described above, the inclination angle calculation unit 11 calculates the roll angle r and the pitch angle p from the acceleration measurement data S, and determines the inclination angle data of the calculated roll angle r and pitch angle p as magnetic measurement data determination. Output to the unit 12.

ステップS3:
磁気測定データ判定部12は、傾斜角データにおけるロール角r及びピッチ角pの各々が含まれるロール角rの角度範囲及びピッチ角pの角度範囲の組合せを、内部記憶部から検索する。
次に、磁気測定データ判定部12は、検索したロール角rの角度範囲及びピッチ角pの角度範囲の組合せに対応する、磁気測定データバッファ13における領域のバッファアドレスを読み出す。
Step S3:
The magnetic measurement data determination unit 12 searches the internal storage unit for a combination of the angle range of the roll angle r and the angle range of the pitch angle p including the roll angle r and the pitch angle p in the tilt angle data.
Next, the magnetic measurement data determination unit 12 reads the buffer address of the area in the magnetic measurement data buffer 13 corresponding to the combination of the searched angular range of the roll angle r and the angular range of the pitch angle p.

そして、磁気測定データ判定部12は、磁気測定データバッファ13に対して、内部記憶部から読み出したバッファアドレスに、磁気測定データM(M,M,M)を書き込んで記憶させるとともに、フラグの欄にフラグ情報を書き込む。
また、磁気測定データ判定部12は、磁気測定データMを書き込んだバッファアドレスに対し、磁気測定データM(M,M,M)を読み込んだ時刻を示す時刻情報と、傾斜角算出部11の算出した傾斜角データとの各々を書き込んで記憶させる。
The magnetic measurement data determination unit 12 writes and stores the magnetic measurement data M (M x , M y , M x ) in the buffer address read from the internal storage unit in the magnetic measurement data buffer 13. Write flag information in the flag column.
The magnetic measurement data determination unit 12 also includes time information indicating the time at which the magnetic measurement data M (M x , M y , M x ) is read with respect to the buffer address in which the magnetic measurement data M is written, and an inclination angle calculation unit. Each of the 11 calculated tilt angle data is written and stored.

ステップS4:
オフセット算出部14は、磁気測定データバッファ13からフラグ情報が書き込まれている領域を抽出し、抽出した領域の磁気測定データを読み出す。
そして、オフセット算出部14は、磁気測定データバッファ13から読み出した磁気測定データから、すでに説明したように、オフセット座標O(O,O,O)を算出する。
(5)式を用いる統計的処理の方法による算出を行うことにより、他の方法に比較してより精度の高いオフセット座標O(O,O,O)を得ることができる。
すなわち、球面上にまんべんなく分布する多くの磁気測定データを用いて、統計的な推定を行うため、より真値に近いオフセット座標O(O,O,O)を算出することができる。
Step S4:
The offset calculation unit 14 extracts the area where the flag information is written from the magnetic measurement data buffer 13 and reads the magnetic measurement data of the extracted area.
Then, the offset calculation unit 14 calculates the offset coordinates O (O x , O y , O z ) from the magnetic measurement data read from the magnetic measurement data buffer 13 as described above.
By performing the calculation by the statistical processing method using the equation (5), it is possible to obtain offset coordinates O (O x , O y , O z ) with higher accuracy than other methods.
That is, since statistical estimation is performed using a lot of magnetic measurement data distributed evenly on the spherical surface, offset coordinates O (O x , O y , O z ) closer to true values can be calculated.

ステップS5:
オフセット有効性判定部17は、すでに説明したいずれかの方法により、新たに算出したオフセット座標O(O,O,O)と、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)とのいずれに有効性があるかの判定を行う。
そして、オフセット有効性判定部17は、新たに算出したオフセット座標O(O,O,O)が、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)より有効性があると判定した場合、オフセット記憶部16に新たに算出したオフセット座標O(O,O,O)を書き込む。
Step S5:
The offset validity determination unit 17 uses the previously described offset coordinate O (O x , O y , O z ) and the offset coordinate O (O x , O y , and O z ) are determined to be effective.
Then, the offset validity judging unit 17, the offset coordinates O newly calculated (O x, O y, O z) is the offset coordinates O (O x stored in the offset storage unit 16, O y, O z ) If it is determined that there is more validity, the newly calculated offset coordinates O (O x , O y , O z ) are written in the offset storage unit 16.

一方、オフセット有効性判定部17は、オフセット記憶部16に記憶されているオフセット座標O(O,O,O)が、新たに算出したオフセット座標O(O,O,O)より有効性があると判定した場合、オフセット記憶部16のオフセット座標O(O,O,O)を書き換えない。
そして、磁気測定データ判定部12は、上述したステップS2からステップS5の処理を繰り返して行い、周期的にオフセット記憶部16のオフセット座標O(O,O,O)の更新処理を行う。
On the other hand, the offset validity determination unit 17 uses the offset coordinates O (O x , O y , O z ) newly calculated as the offset coordinates O (O x , O y , O z ) stored in the offset storage unit 16. ) If it is determined that there is more validity, the offset coordinates O (O x , O y , O z ) of the offset storage unit 16 are not rewritten.
And the magnetic measurement data determination part 12 repeats the process of step S2 to step S5 mentioned above, and performs the update process of the offset coordinate O ( Ox , Oy , Oz ) of the offset memory | storage part 16 periodically. .

上述した本実施形態によれば、球の領域を分割し、それぞれの領域に対応する磁気測定データを磁気測定データバッファ13の磁気データ測定テーブルに書き込んで記憶させるため、各領域に記憶されている磁気測定データM(M,M,M)の分布が球面に近づく。
このため、本実施形態によれば、球の中心座標をまんべんなく取り囲むように、磁気測定データを限られた磁気測定データバッファ13に有効書き込むことができ、オフセット算出部14がこれらの磁気測定データを用いて、精度の高いオフセット座標座標O(O,O,O)を算出することができる。
According to the above-described embodiment, the sphere regions are divided, and the magnetic measurement data corresponding to the respective regions are written in the magnetic data measurement table of the magnetic measurement data buffer 13 and stored therein. The distribution of the magnetic measurement data M (M x , M y , M z ) approaches a spherical surface.
For this reason, according to the present embodiment, the magnetic measurement data can be effectively written in the limited magnetic measurement data buffer 13 so as to surround the center coordinates of the sphere, and the offset calculation unit 14 stores these magnetic measurement data. It is possible to calculate offset coordinate coordinates O (O x , O y , O z ) with high accuracy.

次に、図6は、磁気測定データバッファ13に記憶される、検出された磁気測定データを格納する磁気測定データテーブルの他の構成例を示す図である。
また、本実施形態においては、図3に示すように、各領域に1個の磁気測定データが記憶される構成の磁気測定データテーブルの構成としていた。
しかしながら、図6に示すように、1つの領域に複数の磁気測定データを蓄積する磁気測定データテーブルの構成としても良い。
Next, FIG. 6 is a diagram showing another configuration example of the magnetic measurement data table stored in the magnetic measurement data buffer 13 and storing the detected magnetic measurement data.
Further, in the present embodiment, as shown in FIG. 3, the magnetic measurement data table has a configuration in which one magnetic measurement data is stored in each area.
However, as shown in FIG. 6, a configuration of a magnetic measurement data table that accumulates a plurality of magnetic measurement data in one area may be adopted.

このとき、オフセット算出部14は、(5)式を用い、各領域の磁気測定データ毎にオフセットとの差の二乗を求め、各領域内でこの二乗和を求め、さらに全領域においてこの二乗和を加算し、評価値Gを求める。
また、磁気測定データ判定部12は、各領域に磁気測定データが書き込む際、フラグの欄の全てにフラグ情報が書き込まれている場合、時間情報における最も古い時刻の磁気測定データに上書きする。
これにより、本実施形態において、より球面状に近づく磁気測定データのデータ群を、磁気測定データバッファ13に格納することができる。
At this time, the offset calculation unit 14 obtains the square of the difference from the offset for each magnetic measurement data in each region using the equation (5), finds the square sum in each region, and further sums this square sum in all regions. To obtain an evaluation value G.
In addition, when the magnetic measurement data is written in each area, the magnetic measurement data determination unit 12 overwrites the magnetic measurement data at the oldest time in the time information when the flag information is written in all the flags.
Thereby, in this embodiment, the data group of the magnetic measurement data which approaches a more spherical shape can be stored in the magnetic measurement data buffer 13.

<第2の実施形態>
以下、図面を参照して、本発明の第2の実施形態について説明する。図7は、この発明の第2の実施形態による磁気測定データ校正装置を用いた方位角計測装置の構成例を示す概略ブロック図である。この方位各計測装置は、第1の実施形態と同様に、携帯機器などに搭載される。
本実施形態の方位計測装置は、磁気測定データ校正装置1A、磁気センサ2、加速度センサ3及び方位角計測部4から構成されている。
図7において、第1の実施形態と同様の構成については、同一の符号を付し、説明を省略する。
<Second Embodiment>
The second embodiment of the present invention will be described below with reference to the drawings. FIG. 7 is a schematic block diagram showing a configuration example of an azimuth measuring device using the magnetic measurement data calibration device according to the second embodiment of the present invention. Each azimuth measuring device is mounted on a portable device or the like as in the first embodiment.
The azimuth measuring apparatus according to this embodiment includes a magnetic measurement data calibration apparatus 1A, a magnetic sensor 2, an acceleration sensor 3, and an azimuth measuring unit 4.
In FIG. 7, the same components as those of the first embodiment are denoted by the same reference numerals, and the description thereof is omitted.

磁気測定データ校正装置1Aは、磁気センサ2から供給される、磁気測定データM、磁気測定データM及び磁気測定データMからなる磁気測定データM(M,M,M)のオフセットを、加速度センサ3の出力する傾斜角(ロール角及びピッチ角)に基づいて校正した磁気校正データM(Mfx,Mfy,Mfz)を出力する。
以下、第1の実施形態と異なる構成及び動作についてのみ説明する。
Magnetic measurement data correcting device 1A is supplied from the magnetic sensor 2, a magnetic measurement data M x, magnetic measurements made of the magnetic measurement data M y and magnetometric data M z data M (M x, M y, M z) of Magnetic calibration data M f (M fx , M fy , M fz ) in which the offset is calibrated based on the tilt angle (roll angle and pitch angle) output by the acceleration sensor 3 is output.
Only the configuration and operation different from the first embodiment will be described below.

本実施形態において、補正すべきオフセットを、オフセットO(O,O,O)とする。ここで、OはX軸方向のオフセットであり、OはY軸方向のオフセットであり、OはZ軸方向のオフセットである。
また、磁気測定データM(Mxn,Myn,Mzn)は、n番目の磁気測定データである。また、地磁気ベクトルの大きさ(以下、全磁力)をRとする。
ここで、全磁力は、磁気測定データM(Mxn,Myn,Mzn)とオフセットO(O,O,O)とを用い、以下の(6)式により、求められる。
In the present embodiment, an offset to be corrected is an offset O (O x , O y , O z ). Here, O x is an offset in the X-axis direction, O y is an offset in the Y-axis direction, and O z is an offset in the Z-axis direction.
The magnetic measurement data M n (M xn , M yn , M zn ) is the nth magnetic measurement data. The magnitude of the geomagnetic vector (hereinafter referred to as total magnetic force) is R.
Here, the total magnetic force is obtained by the following equation (6) using the magnetic measurement data M n (M xn , M yn , M zn ) and the offset O (O x , O y , O z ).

Figure 2013124871
Figure 2013124871

この(6)式の関係は常に成り立つ。すなわち、携帯機器を携帯するユーザの移動の際、携帯機器が回転することにより、磁気測定データにおける各測定軸方向の磁気測定データが変化する。しかしながら、この磁気測定データから検出される全磁力が変化しない限り、磁気測定データをX軸、Y軸及びZ軸からなる3次元空間の座標点として配置すると、磁気測定データは測定軸からなる3次元空間において、同一の球面上のいずれかの位置に存在する(この点については従来例と同様に同一球面上で移動することを仮定している)。
したがって、全磁力が同一であるならば、上述した(6)式の関係は、磁気測定データにおける各測定軸方向の磁気測定データが変化したとしても、常に成り立つことになる。
The relationship of this equation (6) always holds. That is, when the user who carries the portable device moves, the magnetic measurement data in each measurement axis direction in the magnetic measurement data changes as the portable device rotates. However, as long as the total magnetic force detected from the magnetic measurement data does not change, when the magnetic measurement data is arranged as coordinate points in a three-dimensional space consisting of the X axis, the Y axis, and the Z axis, the magnetic measurement data consists of 3 measurement axes. It exists at any position on the same sphere in the dimensional space (this point is assumed to move on the same sphere as in the conventional example).
Therefore, if the total magnetic force is the same, the relationship of the above-described equation (6) always holds even if the magnetic measurement data in each measurement axis direction in the magnetic measurement data changes.

上記(6)式において、4個の磁気測定データMを用いることにより、オフセットOの各測定軸におけるオフセット成分O、O、O、全磁力Rを、算出することができる。
ここで、(1)式を変形するため、以下の(7)式に示す定数Qを定義する。
In the above formula (6), by using the four pieces of magnetic measurement data M, the offset components O x , O y , O z and the total magnetic force R in each measurement axis of the offset O can be calculated.
Here, in order to modify the equation (1), a constant Q shown in the following equation (7) is defined.

Figure 2013124871
Figure 2013124871

上記(6)式を用いて(5)式を行列の構成とすることにより、以下の(8)式のように変形する。   By using the above formula (6) and formulating the formula (5) as a matrix, the following formula (8) is transformed.

Figure 2013124871
Figure 2013124871

上記(8)式を解くことにより、オフセット成分O、O、O、全磁力Rを求めることができる。このとき、(8)式の左辺の逆行列が存在することが必要である。
しかしながら、実際の磁気測定データMには、携帯機器の各部品からのまたは外部からの磁気ノイズが重畳している。
このため、(8)式から算出されるオフセット成分O、O、O、全磁力Rは正確な値を得ることができない場合がある。
したがって、統計的な手法、すなわちRLS(Recursive Least Square:再帰的最小二乗)法を用いて、磁気ノイズを低減することにより、オフセット成分O、O、O、全磁力Rの最も真値に近いと考えられる推定値(以下、最尤推定値)を算出する。最尤推定値が算出できる説明は後述する。以下、本実施形態における、RLS法を用いた磁気測定データの校正について説明する。
By solving the above equation (8), the offset components O x , O y , O z , and the total magnetic force R can be obtained. At this time, it is necessary that an inverse matrix on the left side of the equation (8) exists.
However, magnetic noise from each part of the portable device or from the outside is superimposed on the actual magnetic measurement data M.
For this reason, the offset components O x , O y , O z and the total magnetic force R calculated from the equation (8) may not be able to obtain accurate values.
Therefore, by using a statistical method, that is, RLS (Recursive Least Square) method, by reducing the magnetic noise, the most true value of the offset components O x , O y , O z , the total magnetic force R is obtained. An estimated value considered to be close to (hereinafter, maximum likelihood estimated value) is calculated. The description that the maximum likelihood estimated value can be calculated will be described later. Hereinafter, calibration of magnetic measurement data using the RLS method in the present embodiment will be described.

この磁気測定データ校正装置1Aは、図7に示すように、測定データ入力部10、傾斜角算出部11、磁気測定データ判定部12、磁気測定データバッファ13、オフセット算出部14A、磁気測定データ処理部15、オフセット記憶部16及びオフセット有効性判定部17を備えている。
測定データ入力部10は、X軸方向磁気検出部21、Y軸方向磁気検出部22及びZ軸方向磁気検出部23の各々から入力されるアナログ値の軸センサ測定値を、デジタル値に変換して出力する。ここで、X軸方向磁気検出部21、Y軸方向磁気検出部22及びZ軸方向磁気検出部23の各々は、自身の感知方向で検出した磁場に対応した、アナログ値である電圧値を磁気測定データとして出力する。
また、測定データ入力部10は、アナログ値の磁気測定データM(M,M,M)を、デジタル値の磁気測定データM(M、M、M)に変換する際、アナログ値の磁気測定データに含まれているオフセット値を除去するため、磁気センサ単体でのオフセット調整を行うようにしてもよい。
As shown in FIG. 7, the magnetic measurement data calibration apparatus 1A includes a measurement data input unit 10, an inclination angle calculation unit 11, a magnetic measurement data determination unit 12, a magnetic measurement data buffer 13, an offset calculation unit 14A, and magnetic measurement data processing. Unit 15, offset storage unit 16, and offset validity determination unit 17.
The measurement data input unit 10 converts an analog axis sensor measurement value input from each of the X-axis direction magnetic detection unit 21, the Y-axis direction magnetic detection unit 22, and the Z-axis direction magnetic detection unit 23 into a digital value. Output. Here, each of the X-axis direction magnetic detection unit 21, the Y-axis direction magnetic detection unit 22, and the Z-axis direction magnetic detection unit 23 magnetizes a voltage value that is an analog value corresponding to the magnetic field detected in its own sensing direction. Output as measurement data.
The measurement data input unit 10, when converting magnetometric data M analog values (M x, M y, M z) and magnetic measurement data M digital value (M x, M y, M z) in, In order to remove the offset value contained in the magnetic measurement data of the analog value, the offset adjustment with the magnetic sensor alone may be performed.

図8は、上述したRLSを用いた磁気測定データの構成を行うオフセット算出部14Aの構成例を示すブロック図である。
オフセット算出部14Aは、共分散行列計算部14A_1、共分散行列更新部14A_2、誤差関数計算部14A_3、オフセット残差計算部14A_4、オフセット更新部14A_5及び記憶部14A_6を備えている。
共分散行列計算部14A_2は、後述するオフセット残差計算部14A_4において用いる共分散行列Pの初期値を、以下の(9)式のように設定する。
FIG. 8 is a block diagram illustrating a configuration example of the offset calculation unit 14A that performs configuration of magnetic measurement data using the RLS described above.
The offset calculation unit 14A includes a covariance matrix calculation unit 14A_1, a covariance matrix update unit 14A_2, an error function calculation unit 14A_3, an offset residual calculation unit 14A_4, an offset update unit 14A_5, and a storage unit 14A_6.
The covariance matrix calculation unit 14A_2 sets the initial value of the covariance matrix P used in the offset residual calculation unit 14A_4 described later as shown in the following equation (9).

Figure 2013124871
Figure 2013124871

この(9)式において、共分散行列計算部14A_1は、定数αを、例えば1.000から100.000までの範囲で設定する。
また、(9)式における左辺の4行×4列の行列における磁気測定データを示す列行列を、以下の(10)式のベクトルzとして定義する。
In equation (9), the covariance matrix calculator 14A_1 sets the constant α in a range from 1.000 to 100.000, for example.
In addition, a column matrix indicating magnetic measurement data in a matrix of 4 rows × 4 columns on the left side in the equation (9) is defined as a vector z n in the following equation (10).

Figure 2013124871
Figure 2013124871

また、(9)式における左辺の4行×1列の行列を、以下の(11)式のオフセットのベクトルxとして定義する。 Further, a matrix of 4 rows × 1 column on the left side in the equation (9) is defined as an offset vector x n in the following equation (11).

Figure 2013124871
Figure 2013124871

上記(11)式は、n番目の磁気測定データを用いて更新された際のオフセットO(Oxn,Oyn,Ozn)と全磁力から計算された定数Qからなるベクトルを示す行列である。 The above equation (11) is a matrix indicating a vector composed of an offset O n (O xn , O yn , O zn ) and constant Q n calculated from the total magnetic force when updated using the n-th magnetic measurement data. It is.

誤差関数計算部14A_3は、以下の(12)式を用いて、誤差関数eを算出する。 Error function calculation unit 14A_3, using the following equation (12) calculates an error function e n.

Figure 2013124871
Figure 2013124871

すなわち、誤差関数計算部14A_3は、n番目に測定された磁気測定データMと、前回算出したオフセットOn−1(n−1番目の磁気測定データMn−1を用いて求めたオフセット)と、前回算出した全磁力Rn−1(n−1番目の磁気測定データMn−1を用いて求めた全磁力)とから、誤差関数eを算出する。
ここで、誤差関数計算部14A_3は、磁気測定データMとオフセットOとの距離の二乗と、全磁力Rn−1の二乗を算出し、磁気測定データMとオフセットOとの距離の二乗から、全磁力Rn−1の二乗を減算し、減算結果を誤差関数eとする。ここで、磁気測定データMとオフセットOとの距離とは、測定軸であるX軸、Y軸及びZ軸からなる3次元空間において、磁気測定データMとオフセットOn−1とを配置した際の、磁気測定データMとオフセットOn−1との座標点の距離である。
That is, the error function calculation unit 14A_3 uses the n-th measured magnetic measurement data M n and the previously calculated offset On -1 (the offset obtained using the (n-1) th magnetic measurement data M n-1 ). If, because the (total magnetic force were determined using n-1 th magnetic measurement data M n-1) total force R n-1 previously calculated, to calculate the error function e n.
Here, the error function calculator 14A_3, the distance and the square of the distance between the magnetic measurement data M n and the offset O n, calculates the square of the total magnetic R n-1, a magnetic measurement data M n and the offset O n from square, subtracting the square of the total magnetic R n-1, the subtraction result and the error function e n. Here, the distance between the magnetic measurement data M n and the offset O n, X-axis is the measurement axis, in 3-dimensional space consisting of Y-axis and Z-axis, and the offset O n-1 magnetometric data M n This is the distance between the coordinate points of the magnetic measurement data M n and the offset On -1 when arranged.

オフセット残差計算部14A_4は、誤差関数計算部14A_3の求めた誤差関数eと、前回測定時に求めた共分散行列Pn−1とを用い、以下の(13)式により、オフセット残差ηを算出する。 Offset residual calculator 14A_4 includes error function e n obtained error function calculator 14A_3, using a covariance matrix P n-1 obtained at the previous measurement, the following equation (13), offset residual η Is calculated.

Figure 2013124871
Figure 2013124871

この(13)式において、忘却係数ρは、RLS法で用いられる定数である。一般的に、0.95<ρ<1の範囲に設定される。   In this equation (13), the forgetting factor ρ is a constant used in the RLS method. Generally, it is set in the range of 0.95 <ρ <1.

共分散行列更新部14A_2は、磁気測定データMを共分散行列の母集団に含めた際の共分散行列Pを、(10)式の行列zと、(10)式の転置行列z と、磁気測定データMからMn−1を母集団とする共分散行列Pn−1と、忘却係数ρとを用い、以下に示す(14)式により算出する。すなわち、共分散行列更新部14A_2は、測定された磁気測定データMを用い、以前に測定された磁気測定データを母集団とする磁気測定データの共分散行列Pn−1を更新し、測定された磁気測定データMを母集団に加えて新たな共分散行列Pを生成する。 The covariance matrix updating unit 14A_2 uses the covariance matrix P n when the magnetic measurement data M n is included in the covariance matrix population as the matrix z n in the equation (10) and the transposed matrix z in the equation (10). and n T, the covariance matrix P n-1 to a population of M n-1 from the magnetic measurement data M 0, using the forgetting factor [rho, is calculated by the following shown (14). That is, the covariance matrix updating unit 14A_2 uses the measured magnetic measurement data M n to update the covariance matrix P n−1 of the magnetic measurement data whose population is the previously measured magnetic measurement data, and performs measurement. The obtained magnetic measurement data M n is added to the population to generate a new covariance matrix P n .

Figure 2013124871
Figure 2013124871

オフセット更新部14A_5は、直前の磁気測定データMn−1から求めたオフセットベクトルxn−1と、オフセット残差ηとから、磁気測定データMに対応するオフセットベクトルxを、以下の(15)式により算出する。 Offset updating unit 14A_5 is offset vector x n-1 obtained from the magnetometric data M n-1 immediately preceding, from the offset residual eta, the offset vector x n corresponding to the magnetic measurement data M n, the following ( 15) Calculated by the equation.

Figure 2013124871
Figure 2013124871

図7の磁気測定データ処理部15は、磁気測定データMの磁気測定データMxn、Myn、Mznの各々から、オフセットベクトルXにおけるOxn、Oyn、Oznをそれぞれ減算し、磁気校正データM(Mfx,Mfy,Mfz)を算出する。
オフセット更新部14A_5は、後述するオフセット有効性判定部17の制御信号により、有効とされたオフセットベクトルXnに対応する共分散行列Pと、オフセットベクトルxと、全磁力Rとを、記憶部14A_6に書き込んで記憶させる。共分散行列P、オフセットベクトルx及び全磁力Rの各々は、それぞれ書き込まれる際に、次の算出において用いられる直前のデータである、共分散行列Pn−1、オフセットベクトルXn−1及び全磁力Rn−1として書き込まれる。また、同様に、オフセット更新部14A_5は、後述するオフセット有効性判定部17の制御信号により、オフセットベクトルXn−1及び全磁力Rn−1を、オフセット記憶部16に対して書き込んで記憶させる。
また、記憶部14_Aには、共分散行列Pの初期値、忘却係数ρ、(10)式、(11)式、(12)式、(13)式、(14)式、(15)式が予め書き込まれて記憶されている。
The magnetic measurement data processing unit 15 in FIG. 7 subtracts O xn , O yn , and O zn in the offset vector X n from each of the magnetic measurement data M xn , M yn , and M zn of the magnetic measurement data M n , Magnetic calibration data M f (M fx , M fy , M fz ) is calculated.
The offset update unit 14A_5 stores the covariance matrix P corresponding to the valid offset vector Xn, the offset vector x, and the total magnetic force R in the storage unit 14A_6 according to the control signal of the offset validity determination unit 17 described later. Write and store. Each of the covariance matrix P, the offset vector x, and the total magnetic force R is the data immediately before being used in the next calculation when written, respectively, the covariance matrix P n−1 , the offset vector X n−1 and the total magnetic force R. It is written as a magnetic force Rn -1 . Similarly, the offset update unit 14A_5 writes and stores the offset vector X n−1 and the total magnetic force R n−1 in the offset storage unit 16 in accordance with a control signal from the offset validity determination unit 17 described later. .
In addition, the initial value of the covariance matrix P, the forgetting coefficient ρ, the expressions (10), (11), (12), (13), (14), and (15) are stored in the storage unit 14_A. Pre-written and stored.

また本実施形態において、オフセット有効性判定部17は、磁気センサ2から読み込んだ磁気測定データMから求めたオフセットOが有効か否かの判定を行い、オフセットOが有効でないと判定した場合、前回求めたオフセットOn−1を新たなオフセットOとして用いる。
このとき、オフセット有効性判定部17は、有効性を判定する際に用いる磁気測定データを磁気測定データバッファ13から読み込んで用いる。
すなわち、磁気測定データバッファ13には、すでに説明したように、傾斜角のピッチ角pの角度範囲及びロール角rの角度範囲の組合せ数に対応したデータバッファが設けられている。ここで、磁気測定データバッファ13において、フラグにフラグ情報が書き込まれている領域の磁気測定データがオフセット有効性判定部17の有効性判定の処理に用いられる。例えば、第1の実施形態と同様に、648個の領域が設けられ、このうち200個の磁気測定データMに対応する領域のフラグにフラグ情報が書き込まれている場合、この200個の磁気測定データが磁気測定データMからM200までの磁気測定データとして、オフセット有効性判定部17により、磁気測定データバッファ13から読み出されて用いられることになる。
In the present embodiment, the offset validity judging section 17 performs the offset O n is valid for determining whether or not obtained from the magnetic measurement data M n read from the magnetic sensor 2, it is determined that the offset O n is not valid If, using the offset O n-1 previously determined as a new offset O n.
At this time, the offset validity determination unit 17 reads and uses the magnetic measurement data used when determining the validity from the magnetic measurement data buffer 13.
That is, as already described, the magnetic measurement data buffer 13 is provided with a data buffer corresponding to the number of combinations of the angle range of the pitch angle p of the inclination angle and the angle range of the roll angle r. Here, in the magnetic measurement data buffer 13, the magnetic measurement data in the area where the flag information is written in the flag is used for the validity determination process of the offset validity determination unit 17. For example, as in the first embodiment, 648 areas are provided, and when flag information is written in a flag of an area corresponding to 200 magnetic measurement data M, the 200 magnetic measurements The data is read from the magnetic measurement data buffer 13 by the offset validity determination unit 17 and used as magnetic measurement data from the magnetic measurement data M 1 to M 200 .

ここで、磁気測定データ判定部12は、磁気測定データMを測定した検出したロール角r及びピッチ角pの組合せが含まれる角度範囲に対応した領域を内部記憶部の対応テーブルから検索し、磁気測定データバッファ13の検索された領域に対して磁気測定データMを書き込んで記憶させている。
このとき、オフセット有効性判定部17は、1つの領域に複数の磁気測定データが記憶されている(図6の磁気測定データテーブルの構成の)場合、磁気測定データバッファ13の検索された領域における最も古い磁気測定データに、新たな磁気測定データMを上書きする。すなわち、オフセット有効性判定部17は、磁気測定データ判定部12がオフセット計算をして更新すると判定された磁気測定データのみをデータに書き込んで記憶させる。
Here, the magnetic measurement data determination unit 12 searches the correspondence table of the internal storage unit for an area corresponding to the angle range including the combination of the detected roll angle r and pitch angle p from which the magnetic measurement data M n is measured, Magnetic measurement data M n is written and stored in the searched area of the magnetic measurement data buffer 13.
At this time, when a plurality of magnetic measurement data are stored in one area (in the configuration of the magnetic measurement data table in FIG. 6), the offset validity determination unit 17 in the searched area of the magnetic measurement data buffer 13 The newest magnetic measurement data Mn is overwritten on the oldest magnetic measurement data. That is, the offset validity determination unit 17 writes and stores only the magnetic measurement data determined to be updated by the magnetic measurement data determination unit 12 by calculating the offset.

また、オフセット有効性判定部17は、オフセット記憶部16からオフセットOn−1と、全磁力Rn−1とを読み出し、このオフセットのベクトルをO(O1x,O1y,O1z)とし、全磁力をRとする。
オフセット有効性判定部17は、以下の(16)式により、磁気測定データバッファ13に記憶され、フラグにフラグ情報が記述されている磁気測定データMからMの各々と、オフセットのベクトルOとの距離d1nをそれぞれ算出する。
Further, the offset validity judging unit 17, the offset O n-1 from the offset storage unit 16 reads out the total magnetic R n-1, the vector of the offset O 1 (O 1x, O 1y , O 1z) and The total magnetic force is R 1 .
The offset validity determination unit 17 stores each of the magnetic measurement data M 1 to M n stored in the magnetic measurement data buffer 13 and flag information described in the flag, and the offset vector O according to the following equation (16). 1 and the distance d 1n the calculated respectively.

Figure 2013124871
Figure 2013124871

すなわち、オフセット有効性判定部17は、磁気測定データM毎に、磁気測定データMからオフセットO1xを減算した結果を二乗し、磁気測定データMyからオフセットO1yを減算した結果を二乗し、磁気測定データMからオフセットO1zを減算した結果を二乗する。
そして、オフセット有効性判定部17は、それぞれ二乗した結果を加算し、加算結果の平方根を算出することで、距離d1nを求める。ここで、オフセット有効性判定部17は、磁気測定データM1からMnの各々に対応し、距離d11からd1nの各々を求める。
また、オフセット有効性判定部17は、以下の(17)式により、評価値G1を算出する。
That is, for each magnetic measurement data M, the offset validity determination unit 17 squares the result of subtracting the offset O 1x from the magnetic measurement data M x and squares the result of subtracting the offset O 1y from the magnetic measurement data My . The result of subtracting the offset O 1z from the magnetic measurement data M z is squared.
And the offset effectiveness determination part 17 calculates | requires the distance d1n by adding the squared result, and calculating the square root of an addition result. Here, the offset validity judging section 17 corresponds to each of Mn from the magnetic measurement data M1, obtains each d 1n from the distance d 11.
Moreover, the offset validity determination part 17 calculates the evaluation value G1 by the following (17) Formula.

Figure 2013124871
Figure 2013124871

すなわち、オフセット有効性判定部17は、距離d11からd1nの各々から、それぞれ全磁力Rを減算し、減算結果毎に二乗して、減算結果の二乗の総和を求めるため、全ての二乗結果を加算し、加算結果である二乗の総和を評価値G1とする。
また、オフセット有効性判定部17は、磁気センサ2から読み込んだ磁気測定データMnから求めたオフセットOnのオフセットのベクトルをO(O2x,O2y,O2z)とし、このベクトルO(O2x,O2y,O2z)と、磁気測定データMnとから新たに全磁力R2を求める。
そして、オフセット有効性判定部17は、以下の(18)式により、データバッファに記憶されている磁気測定データMからMの各々に対応する距離d2nを算出する。
That is, the offset validity determination unit 17 subtracts the total magnetic force R 1 from each of the distances d 11 to d 1n and squares each subtraction result to obtain the sum of the squares of the subtraction results. The results are added, and the sum of the squares as the addition result is set as the evaluation value G1.
Further, the offset validity determination unit 17 sets the offset vector of the offset On obtained from the magnetic measurement data Mn read from the magnetic sensor 2 as O 2 (O 2x , O 2y , O 2z ), and this vector O 2 (O 2x , O 2y , O 2z ) and the magnetic measurement data Mn, the total magnetic force R2 is newly obtained.
Then, the offset validity determination unit 17 calculates the distance d 2n corresponding to each of the magnetic measurement data M 1 to M n stored in the data buffer by the following equation (18).

Figure 2013124871
Figure 2013124871

すなわち、オフセット有効性判定部17は、磁気測定データM毎に、磁気測定データMからオフセットO2xを減算した結果を二乗し、磁気測定データMからオフセットO2yを減算した結果を二乗し、磁気測定データMからオフセットO2zを減算した結果を二乗する。
そして、オフセット有効性判定部17は、それぞれ二乗した結果を加算し、加算結果の平方根を算出することで、距離d2nを求める。ここで、オフセット有効性判定部17は、磁気測定データM1からMnの各々に対応し、距離d21からd2nの各々を求める。
また、オフセット有効性判定部17は、以下の(19)式により、評価値G2を算出する。
That is, the offset validity judging unit 17, for each magnetic measuring data M, squares the result of subtracting the offset O 2x from magnetometric data M x, the offset O 2y squares the result of subtracting from the magnetometric data M y The result of subtracting the offset O 2z from the magnetic measurement data M z is squared.
And the offset effectiveness determination part 17 calculates | requires distance d2n by adding the squared result, and calculating the square root of an addition result. Here, the offset validity judging section 17 corresponds to each of Mn from the magnetic measurement data M1, obtains each d 2n from the distance d 21.
Further, the offset validity determination unit 17 calculates the evaluation value G2 by the following equation (19).

Figure 2013124871
Figure 2013124871

すなわち、オフセット有効性判定部17は、距離d21からd2nの各々から、それぞれ全磁力Rを減算し、減算結果毎に二乗して、減算結果の二乗の総和を求めるため、全ての二乗結果を加算し、加算結果である二乗の総和を評価値G2とする。
評価値G1及びG2を算出すると、オフセット有効性判定部17は、この評価値G1と評価値G2の比較を行う。
このとき、オフセットOと全磁力Rとが真値になっている場合、評価値G1が真値であり、オフセットOと全磁力Rとが真値になっている場合、評価値G2が真値である。すなわち、オフセットOと全磁力Rとが真値に近くなるほど評価値G1が小さくなり、また、オフセットOと全磁力Rとが真値に近くなるほど評価値G2が小さくなると考えられる。
That is, the offset validity determination unit 17 subtracts the total magnetic force R 2 from each of the distances d 21 to d 2n and squares each subtraction result to obtain the sum of the squares of the subtraction results. The results are added, and the sum of squares as the addition result is set as an evaluation value G2.
When the evaluation values G1 and G2 are calculated, the offset validity determination unit 17 compares the evaluation value G1 with the evaluation value G2.
At this time, when the offset O 1 and the total magnetic force R 1 are true values, the evaluation value G 1 is a true value, and when the offset O 2 and the total magnetic force R 2 are true values, the evaluation value G2 is a true value. That is, it is considered that the evaluation value G1 becomes smaller as the offset O 1 and the total magnetic force R 1 become closer to the true value, and the evaluation value G2 becomes smaller as the offset O 2 and the total magnetic force R 2 become closer to the true value.

したがって、オフセット有効性判定部17は、評価値G1及びG2を比較し、評価値G2が評価値G1未満である(G2<G1)場合、新たに算出されたオフセットO及び全磁力Rが前回算出したオフセットOn−1及び全磁力Rn−1より真値に近いと判定する。
一方、オフセット有効性判定部17は、評価値G2が評価値G1以上である(G2≧G1)場合、前回算出したオフセットOn−1及び全磁力Rn−1が新たに算出されたオフセットO及び全磁力Rより真値に近いか、あるいは同様と判定する。
Therefore, the offset validity judging unit 17 compares the evaluation values G1 and G2, evaluation value G2 is smaller than the evaluation value G1 (G2 <G1) when the offset O n and total magnetic R n newly calculated It is determined that the value is closer to the true value than the previously calculated offset On -1 and total magnetic force Rn -1 .
On the other hand, when the evaluation value G2 is equal to or greater than the evaluation value G1 (G2 ≧ G1), the offset effectiveness determination unit 17 determines the offset O n−1 calculated previously and the offset O newly calculated as the total magnetic force R n−1. determining from the n and the total force R n or close to the true value, or similar to.

ここで、オフセット有効性判定部17は、G2<G1の場合、新たに算出されたオフセットO及び全磁力Rを、磁気測定データ処理部15へ出力するとともに、オフセットを更新することを示す制御信号を、オフセット更新部14A_5に対して出力する。
オフセット更新部14A_5は、前回算出したオフセットOn−1を更新することを示す制御情報が供給されると、オフセット記憶部16及び記憶部14A_6に記憶されているオフセットOn−1対して、新たに算出されたオフセットOを上書きする。これにより、記憶部14_6には最新のオフセットOが保持される。
また、オフセット有効性判定部17は、G2≧G1の場合、オフセット記憶部16及び記憶部14A_6に記憶されているオフセットの値と全磁力Rとを、磁気測定データ処理部15へ出力するとともに、オフセットを更新しないことを示す制御信号を、オフセット更新部14A_5に対して出力する。
オフセット更新部14A_5は、オフセットを更新しないことを示す制御情報が供給されると、記憶部14_6に記憶されている前回算出したオフセットOn−1を上書きせず、前回算出したオフセットOn−1の値の更新処理を行わない。これにより、オフセット記憶部16及び記憶部14A_6には、最新のオフセットとして、前回算出したオフセットOn−1と同じ値のオフセットOが保持される。
また、第2の実施形態においても、第1の実施形態におけるオフセット有効性判定部17によるオフセット有効性判定と同様の処理を行い、オフセット記憶部16及び記憶部14A_6に格納するオフセットの有効性を判定しても良い。
Here, the offset validity judging unit 17, when the G2 <G1, the offset O n and the total force R n are newly calculated, and outputs to the magnetic measurement data processing unit 15, indicating that updating the offset The control signal is output to the offset update unit 14A_5.
Offset updating unit 14A_5, when the control information indicating that updating the offset O n-1 previously calculated is supplied, the offset O n-1 for that is stored in the offset storage unit 16 and the storage unit 14A_6, new overwrite offset O n calculated for. Thus, the latest offset O n is held in the storage unit 14_6.
Further, when G2 ≧ G1, the offset validity determination unit 17 outputs the offset value and the total magnetic force R stored in the offset storage unit 16 and the storage unit 14A_6 to the magnetic measurement data processing unit 15, and A control signal indicating that the offset is not updated is output to the offset update unit 14A_5.
Offset updating unit 14A_5, when the control information indicating that no update the offset is supplied, without overwriting the offset O n-1 calculated last time is stored in the storage unit 14_6, the offset O n-1 previously calculated Do not update the value of. Thus, in the offset storage unit 16 and the storage unit 14A_6 as latest offset, the offset O n of the same value is maintained offset O n-1 previously calculated.
Also in the second embodiment, the same processing as the offset validity determination by the offset validity determination unit 17 in the first embodiment is performed, and the validity of the offset stored in the offset storage unit 16 and the storage unit 14A_6 is increased. You may judge.

次に、図7、図8及び図9を用いて、本実施形態の磁気測定データ校正装置1Aにおける磁気測定データの校正を行う処理について説明する。図9は、磁気センサ2が検出した磁気測定データMを校正する処理の動作例を示すフローチャートである。
ステップS11:
磁気測定データ判定部12は、携帯機器の電源が投入されると、第1の実施形態におけるステップS1と同様に、傾斜角におけるピッチ角pの角度範囲及びロール角rの角度範囲の組合せの数に対応した領域を、磁気測定データバッファ13に対して確保する。
また、磁気測定データ判定部12は、確保した領域におけるフラグの欄を全て初期化し、磁気測定データが書き込まれていない状態とし、処理をステップS12へ進める。
Next, processing for calibrating magnetic measurement data in the magnetic measurement data calibration apparatus 1A of the present embodiment will be described with reference to FIGS. FIG. 9 is a flowchart showing an operation example of processing for calibrating the magnetic measurement data M detected by the magnetic sensor 2.
Step S11:
When the power of the portable device is turned on, the magnetic measurement data determination unit 12 counts the number of combinations of the angle range of the pitch angle p and the angle range of the roll angle r in the tilt angle, as in step S1 in the first embodiment. An area corresponding to is secured for the magnetic measurement data buffer 13.
In addition, the magnetic measurement data determination unit 12 initializes all the flag fields in the secured area, sets the magnetic measurement data not written, and advances the process to step S12.

ステップS12:
共分散行列計算部14A_1は、オフセットO及び全磁力Rの初期化を行う。
このとき、例えば、オフセットOの初期化の値としては磁気センサ2の単体で3軸ヘルムホルツコイルにて測定されたオフセット値が記憶部14_6に予め書き込まれて記憶されている。また、全磁力Rの初期化の値としては、複数の地域における地磁気基準値が記憶部14_6に予め書き込まれて記憶されている。
Step S12:
The covariance matrix calculator 14A_1 initializes the offset O and the total magnetic force R.
At this time, for example, as the initialization value of the offset O, the offset value measured by the triaxial Helmholtz coil of the single magnetic sensor 2 is written and stored in advance in the storage unit 14_6. In addition, as a value for initializing the total magnetic force R, geomagnetic reference values in a plurality of areas are written and stored in advance in the storage unit 14_6.

次に、携帯機器に電源を投入した後、ユーザは携帯機器の表示部に表示される複数の地域から、自身の居住地が含まれる地域を選択する。
これにより、共分散行列計算部14A_1は、記憶部14_6から、オフセットOの初期値を読み出すとともに、ユーザの選択した地域に対応して記憶されている地磁気基準値を全磁力Rの初期値として読み出す。
また、GPS(Global Positioning System)機能が携帯機器に搭載されている場合、共分散行列計算部14A_1は、GPSから得られる緯度経度情報が含まれる地域(緯度経度情報の範囲で規定された領域)に対応して記憶されている地磁気基準値を全磁力Rの初期値として読み出すように構成しても良い。
そして、共分散行列計算部14A_1は、処理をステップS13へ進める。
Next, after powering on the portable device, the user selects a region including his / her residence from a plurality of regions displayed on the display unit of the portable device.
As a result, the covariance matrix calculation unit 14A_1 reads the initial value of the offset O from the storage unit 14_6, and reads the geomagnetic reference value stored corresponding to the area selected by the user as the initial value of the total magnetic force R. .
In addition, when a GPS (Global Positioning System) function is mounted on a portable device, the covariance matrix calculation unit 14A_1 includes an area including latitude and longitude information obtained from GPS (an area defined by a range of latitude and longitude information). Alternatively, the geomagnetic reference value stored corresponding to may be read as the initial value of the total magnetic force R.
And covariance matrix calculation part 14A_1 advances a process to step S13.

ステップS13:
次に、共分散行列計算部14A_1は、共分散行列Pの初期化を行う。すなわち、共分散行列計算部14A_1は、記憶部14A_6に予め書き込まれて記憶されている(9)式を読み出し、読み出した(4)式を共分散行列の初期値とする。
そして、共分散行列計算部14A_1は、処理をステップS14へ進める。
Step S13:
Next, the covariance matrix calculation unit 14A_1 initializes the covariance matrix P. That is, the covariance matrix calculation unit 14A_1 reads the equation (9) that is written and stored in advance in the storage unit 14A_6, and sets the read equation (4) as the initial value of the covariance matrix.
And covariance matrix calculation part 14A_1 advances a process to step S14.

ステップS14:
測定データ入力部10は、磁気センサ2のX軸方向磁気検出部21、Y軸方向磁気検出部22及びZ軸方向磁気検出部23の各々から、磁気測定データMとして磁気測定データMxn、Myn及びMznを読み込む。
そして、測定データ入力部10は、読み込んだ磁気測定データMを、磁気測定データ判定部12、オフセット算出部14A及び磁気測定データ処理部15へ出力する。
磁気測定データMを読み込んだ後、磁気測定データ判定部12は、傾斜角算出部11から供給されるピッチ角p及びロール角rの含まれる領域のバッファアドレスを内部記憶部の対応テーブルから検索する。
そして、磁気測定データ判定部12は、検索された磁気測定データバッファ13における領域に対し、磁気測定データMnを書き込む。
Step S14:
The measurement data input unit 10 includes magnetic measurement data M xn as magnetic measurement data M n from each of the X-axis direction magnetic detection unit 21, the Y-axis direction magnetic detection unit 22, and the Z-axis direction magnetic detection unit 23 of the magnetic sensor 2. Read M yn and M zn .
Then, the measurement data input unit 10 outputs the read magnetic measurement data M n to the magnetic measurement data determination unit 12, the offset calculation unit 14A, and the magnetic measurement data processing unit 15.
After reading the magnetic measurement data M n , the magnetic measurement data determination unit 12 retrieves the buffer address of the area including the pitch angle p and the roll angle r supplied from the tilt angle calculation unit 11 from the correspondence table of the internal storage unit. To do.
Then, the magnetic measurement data determination unit 12 writes the magnetic measurement data Mn to the searched area in the magnetic measurement data buffer 13.

また、誤差関数計算部14A_3は、記憶部14A_6から読み込んだ(12)式に対し、磁気センサ2から読み込んだ磁気測定データMxn、Myn及びMznと、記憶部14A_6から読み込んだオフセットOn−1(Oxn−1,Oyn−1,Ozn−1)とを代入し、誤差関数eを算出する。
すなわち、誤差関数計算部14A_3は、磁気測定データMxnからオフセットOxn−1を減算した結果を二乗し、磁気測定データMynからオフセットOyn−1を減算した結果を二乗し、磁気測定データMznからオフセットOzn−1を減算した結果を二乗する。
そして、誤差関数計算部14A_3は、それぞれの減算した結果を加算し、この加算した結果から、全磁力Rn−1の二乗を減算し、誤差関数eを求める。
誤差関数eを算出した後、誤差関数計算部14A_3は、処理をステップS15へ進める。
また、図9のフローチャートにおけるステップS14からステップS18までのループ(繰り返し処理)において、携帯機器の電源が投入されてから1回目のループの際、オフセットOn−1としては初期化におけるオフセットの数値が用いられ、同様に、全磁力Rn−1としては初期化における全磁力の数値が用いられる。
The error function calculation unit 14A_3 is read from the storage unit 14A_6 to (12), magnetic measurement data M xn read from the magnetic sensor 2, and M yn and M zn, offset O n read from the storage unit 14A_6 -1 (O xn-1, O yn-1, O zn-1) substituted and, to calculate the error function e n.
That is, the error function calculator 14A_3 squares the result of subtracting the offset O xn-1 from the magnetic measurement data M xn , squares the result of subtracting the offset O yn-1 from the magnetic measurement data M yn , and generates the magnetic measurement data. The result of subtracting the offset O zn−1 from M zn is squared.
The error function calculation unit 14A_3 adds the result of each subtraction, from the addition result, by subtracting the square of the total magnetic R n-1, obtaining an error function e n.
After calculating the error function e n, error function calculation unit 14A_3 advances the process to step S15.
Further, in the loop (repetitive processing) from step S14 to step S18 in the flowchart of FIG. 9, in the first loop after the portable device is turned on, the offset On -1 is the numerical value of the offset in initialization. Similarly, the numerical value of the total magnetic force in initialization is used as the total magnetic force R n−1 .

ステップS15:
オフセット残差計算部14A_4は、記憶部14A_6から、(10)式と、(13)式と、忘却係数ρと、前回求めた共分散行列Pn−1とを読み出す。
次に、オフセット残差計算部14A_4は、磁気測定データMを(10)式に代入してベクトルzの行列を生成し、この生成したベクトルzの行列の転置行列z を生成する。
そして、オフセット残差計算部14A_4は、忘却係数ρ、共分散行列Pn−1、ベクトルz及び転置行列z の各々を(13)式に代入し、オフセット残差ηを算出し、このオフセット残差ηをオフセット更新部14A_5へ出力する。
オフセット残差ηを算出した後、オフセット残差計算部14A_4は、処理をステップS16へ進める。
Step S15:
The offset residual calculation unit 14A_4 reads the expression (10), the expression (13), the forgetting factor ρ, and the covariance matrix P n−1 obtained last time from the storage unit 14A_6.
Next, the offset residual calculation unit 14A_4 generates a matrix of the vector z n by substituting the magnetic measurement data M n into the equation (10), and generates a transposed matrix z n T of the generated matrix of the vector z n. To do.
Then, the offset residual calculation unit 14A_4 substitutes each of the forgetting coefficient ρ, the covariance matrix P n−1 , the vector z n, and the transposed matrix z n T into the equation (13) to calculate the offset residual η, The offset residual η is output to the offset update unit 14A_5.
After calculating the offset residual η, the offset residual calculation unit 14A_4 advances the process to step S16.

ステップS16:
共分散行列更新部14A_2は、記憶部14A_6から、(10)式と、(14)式と、忘却係数ρと、共分散行列Pn−1とを読み込む。
次に、共分散行列更新部14A_2は、磁気測定データMを(10)式に代入してベクトルzの行列を生成し、この生成したベクトルzの行列の転置行列z を生成する。
そして、共分散行列更新部14A_2は、忘却係数ρと、共分散行列Pn−1と、ベクトルzと、転置行列z とを、(14)式に代入し、新たな共分散行列Pを生成し、記憶部14A_6に書き込んで記憶させる。この共分散行列更新部14A_2が記憶部14A_6に書き込んだ共分散行列Pが、磁界のループにおいては共分散行列Pn−1として用いられる。
今回の磁気測定データMを含む、今までに共分散行列Pを生成するために用いた磁気測定データMの全てを母集団とする共分散行列Pを生成した後、共分散行列更新部14A_2は、処理をステップS17へ進める。
Step S16:
The covariance matrix updating unit 14A_2 reads the expression (10), the expression (14), the forgetting factor ρ, and the covariance matrix P n−1 from the storage unit 14A_6.
Next, the covariance matrix update unit 14A_2 generates a matrix of the vector z n by substituting the magnetic measurement data M n into the equation (10), and generates a transposed matrix z n T of the generated matrix of the vector z n. To do.
Then, the covariance matrix updating unit 14A_2 substitutes the forgetting factor ρ, the covariance matrix P n−1 , the vector z n, and the transposed matrix z n T into the equation (14), and creates a new covariance matrix. Pn is generated and written and stored in the storage unit 14A_6. The covariance matrix P n written by the covariance matrix updating unit 14A_2 in the storage unit 14A_6 is used as the covariance matrix P n−1 in the magnetic field loop.
Including this magnetic measurement data M n, after all of the magnetic measurement data M to generate the covariance matrix P n to the population that was used to generate the covariance matrix P ever, the covariance matrix update unit 14A_2 advances the process to step S17.

ステップS17:
オフセット更新部14A_5は、記憶部14A_6から(11)式及び(15)式を読み出す。
次に、オフセット更新部14A_5は、(11)式に対し、前回算出されたオフセットOn−1と全磁力Rn−1とを代入し、オフセットのベクトルxn−1を求める。
そして、オフセット更新部14A_5は、オフセット残差計算部14A_4から供給されるオフセット残差ηと、求めたベクトルとを(15)式に代入し、磁気測定データMを測定した時点(すなわち現在)におけるオフセットを示すオフセットのベクトルxを算出する。すなわち、オフセット更新部14A_5は、ベクトルxn−1に対し、オフセット残差ηを加算することにより、新たなオフセットを示すベクトルxを算出する。
ベクトルxを算出した後、オフセット更新部14A_5は、処理をステップS18へ進める。
Step S17:
The offset update unit 14A_5 reads the expressions (11) and (15) from the storage unit 14A_6.
Next, the offset updating unit 14A_5 is (11) with respect to formula, and substituting the offset O n-1 calculated last time and the total force R n-1, obtaining the vector x n-1 of the offset.
Then, the offset update unit 14A_5 substitutes the offset residual η supplied from the offset residual calculation unit 14A_4 and the obtained vector into the equation (15), and measures the magnetic measurement data M n (ie, the current time). An offset vector x n indicating the offset at is calculated. That is, the offset update unit 14A_5 calculates a vector xn indicating a new offset by adding the offset residual η to the vector xn-1 .
After calculating the vector x n, offset updating unit 14A_5 advances the process to step S18.

ステップS18:
次に、オフセット有効性判定部17は、磁気測定データバッファ13において、フラグ(フラグ欄)にフラグ情報が記載された領域(傾斜角)を検索し、フラグ情報が記載された傾斜角に対応して記憶されている磁気測定データMからMを、磁気測定データバッファ13から読み出すとともに、前回算出されて記憶されたオフセットOn−1(O)を、オフセット記憶部16から読み出し、磁気測定データM毎に、上述した(16)式により距離d1nを算出する。
そして、オフセット有効性判定部17は、オフセット記憶部16に記憶されている磁気測定データMn−1とオフセットOn−1とを読み出し、(6)式により全磁力Rを算出する。
これにより、オフセット有効性判定部17は、算出した磁気測定データ毎の距離d1nと、全磁力Rとから、(17)式により評価値G1の算出を行う。
Step S18:
Next, the offset validity determination unit 17 searches the magnetic measurement data buffer 13 for an area (inclination angle) in which flag information is described in the flag (flag field), and corresponds to the inclination angle in which the flag information is described. The magnetic measurement data M 1 to M n stored in the above are read out from the magnetic measurement data buffer 13, and the offset O n−1 (O 1 ) calculated and stored in the previous time is read out from the offset storage unit 16 to be magnetic. For each measurement data M, the distance d 1n is calculated by the above-described equation (16).
Then, the offset validity judging unit 17 reads a magnetic measurement data M n-1 are stored in the offset storage unit 16 and the offset O n-1, calculates the total magnetic R 1 (6) below.
Thereby, the offset validity determination unit 17 calculates the evaluation value G1 from the calculated distance d 1n for each magnetic measurement data and the total magnetic force R 1 according to the equation (17).

次に、オフセット有効性判定部17は、フラグにフラグ情報が記載された領域を検索し、フラグ情報が記載された傾斜角に対応して記憶されている磁気測定データMからMを、磁気測定データバッファ13から読み出す。
そして、オフセット有効性判定部17は、磁気測定データMからMの各々と、今回算出されて記憶されたオフセットO(O)とにおいて、磁気測定データM毎に、上述した(18)式により距離d2nを算出する。
また、オフセット有効性判定部17は、磁気測定データMと、オフセット記憶部16から読み出したオフセットOとを用い、(6)式により全磁力Rを算出する。
これにより、オフセット有効性判定部17は、算出した磁気測定データ毎の距離d2nと、全磁力Rとから、(19)式により評価値G2の算出を行う。
Next, the offset validity judging unit 17 searches the area flag information is described in the flag, a M n from magnetometric data M 1 to the flag information is stored in correspondence with the inclination angle described, Read from the magnetic measurement data buffer 13.
Then, the offset validity judging unit 17, and each of the M n from magnetometric data M 1, in the currently calculated by the stored offset O n (O 2), for each magnetic measuring data M, the above-described (18 ) To calculate the distance d 2n .
Further, the offset validity judging unit 17, using the magnetic measurement data M n, and the offset O n read from the offset storage unit 16, calculates the total magnetic R 2 by (6).
Thereby, the offset validity determination unit 17 calculates the evaluation value G2 by the equation (19) from the calculated distance d 2n for each magnetic measurement data and the total magnetic force R 2 .

次に、オフセット有効性判定部17は、算出した評価値G1とG2とを比較し、評価値G2が評価値G1未満であるか否かの判定を行う。
このとき、オフセット有効性判定部17は、評価値G2が評価値G1未満である場合、今回求めたオフセットOが前回オフセット記憶部16及び記憶部14A_6にオフセットとして書き込まれて記憶されたオフセットOn−1より真値に近いため、今回求めたオフセットOを更新しないことを判定する。
そして、オフセット有効性判定部17は、オフセット記憶部16及び記憶部14A_6に記憶されているオフセットの値を更新することを示す制御信号を、オフセット更新部14A_5に対して出力する。
この更新を行うことを示す制御情報が供給されると、オフセット更新部14A_5は、記憶部14A_6及びオフセット記憶部16に記憶されているオフセットに対し、今回求めたオフセットOを上書きし、オフセットの値の更新を行う。
Next, the offset validity determination unit 17 compares the calculated evaluation values G1 and G2, and determines whether or not the evaluation value G2 is less than the evaluation value G1.
At this time, when the evaluation value G2 is less than the evaluation value G1, the offset validity determination unit 17 stores the offset O n obtained this time as an offset in the previous offset storage unit 16 and storage unit 14A_6 and stored. since than n-1 close to the true value determines not to update the offset O n that currently obtained.
Then, the offset validity determination unit 17 outputs a control signal indicating that the offset value stored in the offset storage unit 16 and the storage unit 14A_6 is updated to the offset update unit 14A_5.
When the control information indicating that performing this update is supplied, the offset updating unit 14A_5, compared offset stored in the storage unit 14A_6 and offset storage unit 16 overwrites the offset O n determined now, the offset Update the value.

一方、オフセット更新部14A_5は、評価値G2が評価値G1以上である場合、今回求めたオフセットOに対して、前回オフセット記憶部16及び記憶部14A_6にオフセットとして書き込まれて記憶されたオフセットOn−1の方が真値に近いため、前回書き込まれたオフセットの値を維持したまま更新することを示す制御信号を、オフセット更新部14A_5へ出力する。
この更新を行わないことを示す制御情報が供給されると、オフセット更新部14A_5は、オフセット記憶部16及び記憶部14A_6に記憶されているオフセットO、前回のオフセットOn−1の値を維持したまま上書し、オフセットの値の更新を行う。
On the other hand, the offset updating unit 14A_5, when evaluation value G2 is rated value G1 or more, with respect to the offset O n found this time, the offset O, which is stored is written as an offset to the previous offset storage unit 16 and the storage unit 14A_6 Since n-1 is closer to the true value, a control signal indicating that updating is performed while maintaining the previously written offset value is output to the offset update unit 14A_5.
When the control information indicating that this update is not performed is supplied, the offset update unit 14A_5 maintains the values of the offset O and the previous offset On -1 stored in the offset storage unit 16 and the storage unit 14A_6. Overwrite as is and update the offset value.

上述したように、本実施形態によれば、前回求めたオフセットOn−1と、現時点で測定した磁気測定データMとを用い、誤差関数eが最小となるように、オフセット残差ηを算出し、このオフセット残差ηと前回求めたオフセットOn−1とを用いてオフセットOを算出するため、磁気測定データMに重畳する磁気ノイズも最小化することが可能となり、従来に比較してより高い精度により、測定される磁気測定データMのオフセットOを求めることができる。 As described above, according to this embodiment, an offset O n-1 previously obtained, using a magnetic measurement data M n measured at the present time, so that the error function e n is minimized, offset residual η calculates, this in order to calculate the offset O n and offset residual η using the offset O n-1 previously obtained, it is possible to minimize magnetic noise that is superimposed on the magnetic measurement data M n, conventional it is the higher accuracy compared to determine the offset O n of the magnetic measurement data M n measured thing.

また、本実施形態によれば、今回の磁気測定データMからオフセットOを求めるため、前回求めたオフセットOn−1に加算するオフセット残差ηを求める際、誤差関数をどの程度反映させるかの割合を、前回までの測定値を母集団とする共分散行列Pn−1と、現時点の磁気測定データMと、忘却係数ρとにより設定しており、従来のように同一球面上を移動させて複数の磁気測定データMを測定する必要が無いため、新たな磁気測定データMを測定する毎に、前回までのオフセットOn−1から容易に現時点のオフセットOを求めることが可能となり、環境オフセットの変動に対する従性を向上させることができる。 Further, according to this embodiment, since the current of the magnetic measurement data M n seek offset O n, when determining the offset residual η to be added to the offset O n-1 previously obtained, to what extent reflects the error function Is set by the covariance matrix P n−1 having the previous measured values as the population, the current magnetic measurement data M n, and the forgetting factor ρ, the move because there is no need to measure a plurality of magnetometric data M, each time measuring the new magnetic measurement data M n, to obtain the offset O n-1 easily offset O n the current from up to the previous time It becomes possible to improve the compliance with the fluctuation of the environmental offset.

また本実施形態によれば、オフセットOの算出に使用可能と判定された磁気測定データMが供給される毎に、オフセットOnを算出し、この算出したオフセットOと前回有効と判定されてオフセット記憶部16に記憶されているオフセットOn−1とのいずれが真値に近いかを、磁気測定データバッファ13を用いて算出した評価値G1とG2とにより比較し、より真値に近いオフセットを選択し、選択したオフセットを記憶部14_6に保持するため、常に最も真値に近いと推定されるオフセットOを磁気測定データMの校正に用いることができ、精度の高い磁気測定データの校正が行えることになる。
ここで、磁気測定データバッファ13において、フラグの欄にフラグ情報が記載された磁気測定データは、オフセットを中心とした球を、ピッチ角p及びロール角rの組合せで分割しており、これらの領域に供給される磁気測定データを格納している。このため、本実施形態によれば、オフセットを中心とした球面上の全体にくまなく分布する磁気測定データにより、真値か否かの判定を行う評価値G1とG2とを算出するため、評価値に偏りがなく、精度の高い有効性の判定が行える。
According to the present embodiment, every time the magnetic measurement data M which has been determined to be used for the calculation of the offset O is supplied, it is determined to calculate the offset On, the offset O n and the previous valid that the calculated offset Which one of the offset On-1 stored in the storage unit 16 is closer to the true value is compared with the evaluation values G1 and G2 calculated using the magnetic measurement data buffer 13, and an offset closer to the true value is obtained. Since the selected offset is stored in the storage unit 14_6, the offset O that is always estimated to be closest to the true value can be used for the calibration of the magnetic measurement data M, and the magnetic measurement data can be calibrated with high accuracy. It will be.
Here, in the magnetic measurement data buffer 13, the magnetic measurement data in which the flag information is described in the flag column is obtained by dividing a sphere centered at the offset by a combination of the pitch angle p and the roll angle r. The magnetic measurement data supplied to the area is stored. For this reason, according to the present embodiment, evaluation values G1 and G2 for determining whether or not a true value is calculated from magnetic measurement data distributed all over the sphere centered on the offset. There is no bias in the value, and the effectiveness can be judged with high accuracy.

また、測定データ入力部10が以下のようなデータ処理を行うように構成しても良い。測定データ入力部10は、前回オフセットOn−1を算出した磁気測定データMn−1、現時点で測定された磁気測定データMとの距離dを算出する。この距離dは、すでに説明したように、磁気センサ2のX軸、Y軸及びZ軸方向の各々の測定軸で構成される3次元空間(磁界を示す3次元空間)に磁気測定データM及びMn−1を配置した際の、それぞれの座標値の距離である。
また、測定データ入力部10は、算出した距離dが予め設定した閾値dを超えない場合、磁気測定データ校正装置1Aにおいて、新たな磁気測定データMによるオフセットOの算出を行わない制御を行う。この場合、記憶部14_6に記憶されるデータは、磁気測定データMn−1において算出された数値が、書き換えられずにそのまま記憶されることになる。
Further, the measurement data input unit 10 may be configured to perform the following data processing. The measurement data input unit 10 calculates the distance d between the magnetic measurement data M n −1 for which the previous offset On n−1 was calculated and the magnetic measurement data M n measured at the present time. As described above, the distance d is obtained by measuring the magnetic measurement data M n in a three-dimensional space (three-dimensional space indicating a magnetic field) constituted by the measurement axes in the X-axis, Y-axis, and Z-axis directions of the magnetic sensor 2. And M n−1 are the distances of the respective coordinate values.
The measurement data input unit 10, if the calculated distance d does not exceed the threshold value d s set in advance, the magnetic measurement data correcting device 1A, does not perform the calculation of the offset O n by new magnetometric data M n control I do. In this case, as the data stored in the storage unit 14_6, the numerical value calculated in the magnetic measurement data M n-1 is stored as it is without being rewritten.

ここで、閾値dは、以下のように設定されている。すなわち、閾値dは磁気センサ2の測定における測定ノイズに対応した数値で決定される。磁気測定データを測定するX軸、Y軸及びZ軸方向の各測定軸の測定ノイズを、それぞれ測定ノイズv、v、zとすると、静止状態においても、時系列に磁気センサ2において測定される磁気測定データ間の距離は、0とはならない。
方位計測装置を静止状態とし、X軸、Y軸及びZ軸方向の各測定軸の磁気測定データの変動幅を予め測定し、この変動幅を含む範囲を測定ノイズv、v、zとする。
Here, the threshold value d s is set as follows. That is, the threshold value d s is determined by a numerical value corresponding to the measurement noise in the measurement of the magnetic sensor 2. When the measurement noise of each measurement axis in the X-axis, Y-axis, and Z-axis directions for measuring magnetic measurement data is measurement noise v x , v y , z v , the magnetic sensor 2 in time series even in a stationary state. The distance between the measured magnetic measurement data is not zero.
With the azimuth measuring device in a stationary state, the fluctuation width of the magnetic measurement data of each measurement axis in the X-axis, Y-axis, and Z-axis directions is measured in advance, and the range including this fluctuation width is measured as noises v x , v y , z v And

したがって、以下に示す(20)式により、測定データ入力部10は閾値dを求めている。この閾値dは予め記憶部14_6に書き込まれ記憶されている。ここで、閾値dは、測定ノイズのベクトル(v、v、z)の長さ、すなわち磁気センサ2の測定軸で構成される3次元空間の原点と、測定ノイズv、v、zの座標値との距離で設定されている。
例えば、X軸、Y軸及びZ軸方向の各測定軸の測定ノイズの標準偏差が1μTである磁気センサを用いた場合、(20)式により求められる変動幅は最大で4.5μTである。この場合、閾値dsを5μTとして設定する。
また、測定データ入力部10は、オフセットOが求められた後、磁気測定データMを磁気測定データバッファ13に、ピッチ角p及びロール角rの組合せに対応した領域に書き込んで記憶させる。
Therefore, the measurement data input unit 10 obtains the threshold value d s by the following equation (20). This threshold value d s is written and stored in the storage unit 14_6 in advance. Here, the threshold value d s is the length of the measurement noise vector (v x , v y , z v ), that is, the origin of the three-dimensional space constituted by the measurement axes of the magnetic sensor 2, and the measurement noise v x , v y, is set at a distance between the coordinate values of z v.
For example, when a magnetic sensor having a standard deviation of measurement noise of 1 μT on each measurement axis in the X-axis, Y-axis, and Z-axis directions is used, the fluctuation range obtained by the equation (20) is 4.5 μT at the maximum. In this case, the threshold value ds is set as 5 μT.
The measurement data input unit 10, after the offset O n is determined, the magnetic measurement data M n in magnetometric data buffer 13, and stores written in a region corresponding to a combination of the pitch angle p and the roll angle r.

Figure 2013124871
Figure 2013124871

上述した構成により、本実施形態においては、同一あるいは同様の磁気測定データ、すなわち距離が小さな磁気測定データにおいて、オフセットを算出する計算を繰り返すことにより、オフセットを大きく推定する、すなわち磁気測定データが全てオフセットであると判定してしまう欠点を解消することが可能である。
第1の実施形態においても、磁気測定データ判定部12が上述した測定データ入力部10のオフセットに用いる磁気測定データMの選択処理を行うように構成しても良い。
With the configuration described above, in the present embodiment, the same or similar magnetic measurement data, that is, magnetic measurement data with a short distance, is repeatedly estimated to calculate the offset by repeating the calculation to calculate the offset, that is, all the magnetic measurement data is It is possible to eliminate the disadvantage that it is determined that the offset.
Also in the first embodiment, the magnetic measurement data determination unit 12 may be configured to perform the selection process of the magnetic measurement data M used for the offset of the measurement data input unit 10 described above.

<RLS法によりオフセットが最尤推定値として得られることの説明>
以下に、RLS法を用いた場合、共分散行列を用いて最新の磁気測定データMを用いてオフセットOを更新する、すなわちオフセットのベクトルxを更新ことで、常にオフセットOの最尤値(最尤推定値)を得ることができることの説明を行う。
まず、磁気測定データM(Mxn,Myn,Mzn)から、以下の(21)式を定義する。
<Explanation that offset is obtained as maximum likelihood estimate by RLS method>
In the following, when the RLS method is used, the offset O is updated using the latest magnetic measurement data M using the covariance matrix, that is, the offset vector x is always updated, so that the maximum likelihood value of the offset O (maximum value) is always obtained. The likelihood that the likelihood estimate) can be obtained will be described.
First, the following equation (21) is defined from the magnetic measurement data M n (M xn , M yn , M zn ).

Figure 2013124871
Figure 2013124871

一般的な最小二乗法によれば、現時点までに測定した磁気測定データMからMを用い、以下に示す(22)式の評価関数Jを最小とするオフセットのベクトルxを算出することになる。 According to a general least square method, using the magnetic measurement data M 1 to M n measured up to the present time, the offset vector x that minimizes the evaluation function J 1 of the following equation (22) is calculated. become.

Figure 2013124871
Figure 2013124871

次に、(23)式に示すように、ベクトルzの転置行列z を要素とする列行列Zと、(21)式のベクトルyを要素とする列行列Yとを定義する。 Next, as shown in Expression (23), a column matrix Z n whose elements are the transposed matrix z n T of the vector z n and a column matrix Y n whose elements are the vectors y n of Expression (21) are defined. To do.

Figure 2013124871
Figure 2013124871

上記(23)式の列行列ZとYとを用いることにより、(22)式が以下に示す(24)式のように変形することができる。 By using the column matrices Z n and Y n of the above equation (23), the equation (22) can be transformed into the following equation (24).

Figure 2013124871
Figure 2013124871

上記(24)式は、(23)式から判るように、磁気測定データMからMまで、すなわち現在までに測定した全ての磁気測定データの要素が含まれている。 Above (24), as seen from (23), the magnetic measurement data M 1 to M n, that is, contains elements of all magnetic measurement data measured so far.

次に、重み付け係数Wnを要素とする行列、すなわち重み付け行列Wnを以下の(25)式のように定義する。   Next, a matrix having the weighting coefficient Wn as an element, that is, a weighting matrix Wn is defined as the following equation (25).

Figure 2013124871
Figure 2013124871

そして、この重み付け行列Wと、列行列Y及びZとを用いて、評価関数Jを以下の(26)式として示す。 Then, using this weighting matrix W n and the column matrices Y n and Z n , the evaluation function J 2 is shown as the following expression (26).

Figure 2013124871
Figure 2013124871

(25)式に示すように、重み付け行列Wnは、磁気測定データM毎を計算に用いる際の重み付け、すなわち特定の磁気測定データMの影響度を高くするために導入している。この重み付け行列Wが単位行列であるならば、評価関数Jはすでに示した(22)式による評価関数Jと同一の評価値(J=J)を求める最小二乗法になる。 As shown in the equation (25), the weighting matrix Wn is introduced in order to increase the influence when the magnetic measurement data M is used for calculation, that is, the influence of the specific magnetic measurement data M. If this weighting matrix W n is a unit matrix, the evaluation function J 2 is a least square method for obtaining the same evaluation value (J 2 = J 1 ) as the evaluation function J 1 according to the equation (22) already shown.

ここで、(26)式の評価関数J2が最小となるオフセットのベクトルxは、以下の(27)式に示すものとなる。   Here, the offset vector x that minimizes the evaluation function J2 of the equation (26) is expressed by the following equation (27).

Figure 2013124871
Figure 2013124871

上記(27)式を(26)式に代入すると、(26)式の評価関数Jが最小、すなわちJ=0となるため、(27)式が最尤推定値のベクトルxを示していることが判る。 When the above equation (27) is substituted into the equation (26), the evaluation function J 2 of the equation (26) is minimum, that is, J 2 = 0. Therefore, the equation (27) indicates the vector x of the maximum likelihood estimated value. I know that.

また、計算で用いる共分散行列Pを表すため、行列Uを以下の(28)式により定義する。 Further, in order to represent the covariance matrix P n used in the calculation, the matrix Un is defined by the following equation (28).

Figure 2013124871
Figure 2013124871

(28)式の行列Unの逆行列に対し、(23)式及び(25)式を代入することにより、以下に示す(29)式が得られる。   By substituting the equations (23) and (25) for the inverse matrix of the matrix Un of the equation (28), the following equation (29) is obtained.

Figure 2013124871
Figure 2013124871

ここで、(29)式を解析的に解くため、逆行列の補助定理を用いる。すなわち、逆行列の補助定理において、行列Aがn×n行列、行列bがn×1ベクトル、行列cがn×1ベクトルである場合、以下の(30)式に示す関係が成り立つことになる。   Here, in order to solve Equation (29) analytically, the inverse matrix theorem is used. That is, in the inverse matrix lemma, when the matrix A is an n × n matrix, the matrix b is an n × 1 vector, and the matrix c is an n × 1 vector, the relationship expressed by the following equation (30) is established. .

Figure 2013124871
Figure 2013124871

したがって、(29)式を(30)式に代入すると、以下の(31)式となる。   Therefore, substituting equation (29) into equation (30) yields the following equation (31).

Figure 2013124871
Figure 2013124871

これにより、(29)式は、(31)式の逆行列を求めることにより、以下の(32)式の漸化式として表すことができる。   Thereby, (29) Formula can be expressed as a recurrence formula of the following (32) Formula by calculating | requiring the inverse matrix of (31) Formula.

Figure 2013124871
Figure 2013124871

ここで、(25)式における重み付け行列を、以下に示す(33)式のように設定する。   Here, the weighting matrix in the equation (25) is set as the following equation (33).

Figure 2013124871
Figure 2013124871

上記(33)において、忘却係数ρを0から1の範囲(0<ρ<1)で設定すると、過去に取得した磁気測定データの影響(反映)の度合いが徐々に低くなる。
また、共分散行列Pを、重み付け係数wと行列Uで表すと、以下の(34)式となり、(32)式が(14)式と一致することになる。
In the above (33), when the forgetting factor ρ is set in the range of 0 to 1 (0 <ρ <1), the degree of influence (reflection) of the magnetic measurement data acquired in the past gradually decreases.
Further, the covariance matrix P n, expressed in weighting coefficient w n and the matrix U n, and becomes less (34), thereby coinciding with the (32) equation (14) below.

Figure 2013124871
Figure 2013124871

また、以降の計算の都合上、kを以下の(35)式のように定義する。 Further, for the convenience of subsequent calculations, defined by the following expression (35) to k n.

Figure 2013124871
Figure 2013124871

次に、(27)式に対し、(32)式と(35)式とを代入すると、以下に示す(36)式が得られる。   Next, by substituting the equations (32) and (35) into the equation (27), the following equation (36) is obtained.

Figure 2013124871
Figure 2013124871

また、磁気測定データMからMn−1までのデータで求められたオフセットのベクトルxn−1の推定値、すなわちn−1番目のベクトルxn−1の推定値は以下の(37)式で求められる。 Further, the estimated value of the offset vector x n−1 obtained from the magnetic measurement data M 1 to M n−1 , that is, the estimated value of the n−1th vector x n−1 is the following (37). It is calculated by the formula.

Figure 2013124871
Figure 2013124871

したがって、n番目のベクトルxnの推定値は、上記(37)式を(36)式に代入し、(37)式を変形することで、以下に示す(38)式として表される。   Therefore, the estimated value of the n-th vector xn is expressed as the following equation (38) by substituting equation (37) into equation (36) and modifying equation (37).

Figure 2013124871
Figure 2013124871

そして、この(38)式を変形することにより、以下の(39)式を得る。   Then, the following equation (39) is obtained by modifying the equation (38).

Figure 2013124871
Figure 2013124871

上記(39)式を用いることにより、(38)式の右辺の第3項はkn×ynと簡略化できることから、(38)式から以下に示す(40)式のベクトルxの漸化式を導くことができる。   By using the above equation (39), the third term on the right side of the equation (38) can be simplified to kn × yn. Therefore, the recurrence equation of the vector x in the equation (40) shown below from the equation (38) Can lead.

Figure 2013124871
Figure 2013124871

上記(40)式は、(13)式及び(15)式を統合した式となっている。したがって、上述してきたRLS法により、最新の磁気測定データMを用いてオフセットのベクトルxの更新を行うことにより、常に、ベクトルxの最尤推定値を得ることができる。   The equation (40) is an equation obtained by integrating the equations (13) and (15). Therefore, by updating the offset vector x using the latest magnetic measurement data M by the RLS method described above, the maximum likelihood estimated value of the vector x can always be obtained.

<方位検出装置>
次に、第1の実施形態の磁気測定データ校正装置1、及び第2の実施形態による磁気測定データ校正装置1Aを用いた方位角計測装置の動作を以下に示す。
携帯機器に搭載される方位角計測装置には、図1に示す3軸の磁気検出部からなる磁気センサ2と、3軸の加速度センサ3とを組み合わせた構成が搭載されている。
すなわち、この方位角計測装置は、加速度センサ3により重力を検出し、検出した重力の傾きの程度から自身の傾斜角を計算する。
そして、磁気計測装置において、磁気センサ2により測定された磁気測定データが、例えば、磁気測定データ校正装置1あるいは磁気測定データ校正装置1Aにより、オフセットが校正された磁気校正データMを生成する。
方位角計測装置は、磁気測定データ校正装置1あるいは磁気測定データ校正装置1Aから出力される磁気校正データMにより、方位角を算出する。
<Direction detection device>
Next, operations of the azimuth measuring apparatus using the magnetic measurement data calibration apparatus 1 of the first embodiment and the magnetic measurement data calibration apparatus 1A of the second embodiment will be described below.
The azimuth angle measuring device mounted on the portable device has a configuration in which the magnetic sensor 2 including the three-axis magnetic detection unit shown in FIG. 1 and the three-axis acceleration sensor 3 are combined.
That is, this azimuth measuring device detects gravity by the acceleration sensor 3, and calculates its own inclination angle from the degree of inclination of the detected gravity.
Then, in the magnetic measurement device, the magnetic measurement data measured by the magnetic sensor 2 generates magnetic calibration data Mf with the offset calibrated by, for example, the magnetic measurement data calibration device 1 or the magnetic measurement data calibration device 1A.
The azimuth angle measuring apparatus calculates the azimuth angle from the magnetic calibration data Mf output from the magnetic measurement data calibration apparatus 1 or the magnetic measurement data calibration apparatus 1A.

以下に、方位角計測部4が行う磁気校正データMによる方位角の算出について、図2を用いて説明する。
図2は、すでに説明したように、加速度センサ3により求まる絶対座標系と、3軸磁気センサである磁気計測装置の検出するセンサ座標系との各軸のずれを説明する図である。 そして、方位角計測部4は、傾斜角算出部11が算出したピッチ角p及びロール角rを読み込む。
Hereinafter, the calculation of the azimuth angle by the magnetic calibration data Mf performed by the azimuth angle measurement unit 4 will be described with reference to FIG.
FIG. 2 is a diagram for explaining the deviation of each axis between the absolute coordinate system obtained by the acceleration sensor 3 and the sensor coordinate system detected by the magnetic measuring device which is a three-axis magnetic sensor, as already described. Then, the azimuth measuring unit 4 reads the pitch angle p and the roll angle r calculated by the tilt angle calculating unit 11.

また、ユーザの携帯する携帯機器が傾斜状態にあるとき、磁気測定データ校正装置1から出力される磁気校正データMを、磁気測定データM(Mtx,Mty,Mtz)とすると、傾斜角算出部11が(3)式及び(4)式の各々から算出したピッチ角(p)とロール角(r)とにより、以下の(41)式により、水平状態における磁気測定データM(H,H,V)が求まる。 Further, when the portable device carried by the user is in an inclined state, if the magnetic calibration data M f output from the magnetic measurement data calibration device 1 is the magnetic measurement data M (M tx , M ty , M tz ), the inclination is The angle calculation unit 11 uses the pitch angle (p) and the roll angle (r) calculated from the expressions (3) and (4) to calculate the magnetic measurement data M (H in the horizontal state according to the following expression (41). x , Hy , V) is obtained.

Figure 2013124871
Figure 2013124871

したがって、方位角計測部4は、上記(41)式により算出した磁気測定データM(H,H,V)を用い、以下に示す(42)式から方位角(θ)を算出する。 Therefore, the azimuth measuring unit 4 uses the magnetic measurement data M (H x , H y , V) calculated by the above equation (41) to calculate the azimuth angle (θ) from the following equation (42).

Figure 2013124871
Figure 2013124871

上述したように、本実施形態によれば、環境オフセットを調整し、磁気センサ2の出力する磁気測定データMを校正した(すなわちゼロ磁界における磁気測定データの調整が行われた)磁気校正データMfを用い、かつ3軸磁気センサにより傾斜状態を補正して方位角を求めることが可能となり、常に、方位角測定装置の検出座標系のX軸方向及びY軸方向のなす平面と、絶対座標系における地表面とが水平状態であり、かつオフセットが校正がされた磁気測定データを用いることができるため、高い精度で方位角を求めることが実現できる。   As described above, according to the present embodiment, the environmental offset is adjusted, and the magnetic measurement data M output from the magnetic sensor 2 is calibrated (that is, the magnetic measurement data in the zero magnetic field is adjusted). , And the azimuth angle can be obtained by correcting the tilt state with a three-axis magnetic sensor, and the plane formed by the X-axis direction and the Y-axis direction of the detection coordinate system of the azimuth angle measuring device is always the absolute coordinate system. Since the magnetic measurement data in which the ground surface is horizontal and the offset is calibrated can be used, it is possible to obtain the azimuth angle with high accuracy.

次に、図1及び図10を用いて、本実施形態の磁気測定データ校正装置1を用いた方位計測装置における磁気測定データから方位角θを求める処理について説明する。図10は、第1の実施形態のオフセット算出部14Aを用いた方位計測装置の方位角θを求める処理の動作例を示すフローチャートである。
ステップS21:
磁気測定データ判定部12は、磁気測定データバッファ13において、ユーザが指定するピッチ角pの角度範囲及びロール角rの角度範囲の組合せ数に対応する数の領域の確保を行う。
磁気測定データ判定部12は、磁気センサ2から磁気測定データM(M,M,M)を取得する。
このとき、磁気測定データ判定部12は、この磁気測定データM(M,M,M)を読み込んだタイミングにて、傾斜角算出部11に対して傾斜角(ピッチ角p及びロール角r)を求めることを要求する制御信号を出力する。
Next, a process for obtaining the azimuth angle θ from the magnetic measurement data in the azimuth measuring apparatus using the magnetic measurement data calibration apparatus 1 of the present embodiment will be described with reference to FIGS. 1 and 10. FIG. 10 is a flowchart illustrating an operation example of processing for obtaining the azimuth angle θ of the azimuth measuring apparatus using the offset calculation unit 14A of the first embodiment.
Step S21:
The magnetic measurement data determination unit 12 secures a number of areas in the magnetic measurement data buffer 13 corresponding to the number of combinations of the angle range of the pitch angle p and the roll angle r specified by the user.
The magnetic measurement data determination unit 12 acquires magnetic measurement data M (M x , M y , M z ) from the magnetic sensor 2.
At this time, the magnetic measurement data determination unit 12 reads the inclination angle (pitch angle p and roll angle) from the inclination angle calculation unit 11 at the timing when the magnetic measurement data M (M x , M y , M z ) is read. A control signal requesting to obtain r) is output.

ステップS22:
次に、傾斜角算出部11は、磁気測定データ判定部12から制御信号が供給されると、加速度センサ3から加速度データS(S,S,S)を読み込む。
ステップS23:
そして、傾斜角算出部11は、読み込んだ加速度データS(S,S,S)から、すでに説明した処理により、傾斜角(ピッチ角p及びロール角r)を求める。
Step S22:
Next, when the control signal is supplied from the magnetic measurement data determination unit 12, the tilt angle calculation unit 11 reads the acceleration data S (S x , S y , S z ) from the acceleration sensor 3.
Step S23:
Then, the tilt angle calculation unit 11 obtains the tilt angle (pitch angle p and roll angle r) from the read acceleration data S (S x , S y , S z ) by the processing already described.

ステップS24:
次に、磁気測定データ判定部12は、磁気測定データバッファ13において、磁気センサ2から供給される磁気測定データM(M,M,M)を、この磁気測定データM(M,M,M)を測定した時点のピッチ角p及びロール角rが対応する領域に書き込んで記憶させる。
Step S24:
Next, in the magnetic measurement data buffer 13, the magnetic measurement data determination unit 12 converts the magnetic measurement data M (M x , M y , M z ) supplied from the magnetic sensor 2 into the magnetic measurement data M (M x , (M y , M z ) is measured and written in the area corresponding to the pitch angle p and roll angle r at the time of measurement.

ステップS25:
そして、オフセット算出部14は、すでに第1の実施形態において説明したように、オフセットOの算出を行う。
ステップS26:
次に、オフセット有効性判定部17は、新たに算出したオフセットOと、オフセット記憶部16に記憶されているオフセットOn−1とのいずれが真値に近いかを判定し、より近いほうのオフセットOを、オフセット記憶部16に書き込んで記憶させる。
Step S25:
Then, the offset calculation unit 14 calculates the offset O as already described in the first embodiment.
Step S26:
Next, the offset validity judging unit 17, and the offset O n the newly calculated, either an offset O n-1 stored in the offset storage unit 16 determines whether close to the true value, rather closer Are stored in the offset storage unit 16.

ステップS27:
磁気測定データ処理部15は、磁気センサ2から供給される磁気測定データM(M,M,M)から、オフセットOを減算し、磁気校正データM(Mfx,Mfy,Mfz)として、方位角計測部4に対して出力する。
ステップS28:
方位角計測部4は、磁気測定データ校正装置1から供給される磁気校正データM(Mfx,Mfy,Mfz)が供給されると、傾斜角算出部11から傾斜角(ピッチ角p及びロール角r)を読み込み、方位角θを求める。
Step S27:
The magnetic measurement data processing unit 15 subtracts the offset O from the magnetic measurement data M (M x , M y , M z ) supplied from the magnetic sensor 2, and magnetic calibration data M f (M fx , M fy , M fz ) is output to the azimuth measuring unit 4.
Step S28:
When the magnetic calibration data M f (M fx , M fy , M fz ) supplied from the magnetic measurement data calibration device 1 is supplied, the azimuth measuring unit 4 receives the tilt angle (pitch angle p) from the tilt angle calculation unit 11. And the roll angle r) are read to determine the azimuth angle θ.

また、図1における磁気測定データ校正装置1、及び図7における磁気測定データ校正装置1Aの機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより磁気測定データMの校正処理を行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。   Further, a program for realizing the functions of the magnetic measurement data calibration apparatus 1 in FIG. 1 and the magnetic measurement data calibration apparatus 1A in FIG. 7 is recorded on a computer-readable recording medium, and the program recorded on this recording medium is recorded. May be read into a computer system and executed to calibrate the magnetic measurement data M. Here, the “computer system” includes an OS and hardware such as peripheral devices.

また、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。
また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間の間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含むものとする。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。
Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used.
The “computer-readable recording medium” refers to a storage device such as a flexible medium, a magneto-optical disk, a portable medium such as a ROM and a CD-ROM, and a hard disk incorporated in a computer system. Furthermore, the “computer-readable recording medium” dynamically holds a program for a short time like a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line. In this case, a volatile memory in a computer system serving as a server or a client in that case, and a program that holds a program for a certain period of time are also included. The program may be a program for realizing a part of the functions described above, and may be a program capable of realizing the functions described above in combination with a program already recorded in a computer system.

以上、この発明の実施形態を図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。   The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes design and the like within a scope not departing from the gist of the present invention.

1,1A…磁気測定データ校正装置 2…磁気センサ 3…加速度センサ 4…方位角計測部 10…測定データ入力部 11…傾斜角算出部 12…磁気測定データ判定部 13…磁気測定データバッファ 14,14A…オフセット算出部 14A_1…共分散行列計算部 14A_2…共分散行列更新部 14A_3…誤差関数計算部 14A_4…オフセット残差計算部 14A_5…オフセット更新部 14A_6…記憶部 15…磁気測定データ処理部 16…オフセット記憶部 17…オフセット有効性判定部 21…X軸方向磁気検出部 22…Y軸方向磁気検出部 23…Z軸方向磁気検出部 31…X軸加速度検出部 32…Y軸加速度検出部 33…Z軸加速度検出部   DESCRIPTION OF SYMBOLS 1,1A ... Magnetic measurement data calibration apparatus 2 ... Magnetic sensor 3 ... Acceleration sensor 4 ... Azimuth angle measurement part 10 ... Measurement data input part 11 ... Inclination angle calculation part 12 ... Magnetic measurement data determination part 13 ... Magnetic measurement data buffer 14, DESCRIPTION OF SYMBOLS 14A ... Offset calculation part 14A_1 ... Covariance matrix calculation part 14A_2 ... Covariance matrix update part 14A_3 ... Error function calculation part 14A_4 ... Offset residual calculation part 14A_5 ... Offset update part 14A_6 ... Storage part 15 ... Magnetic measurement data processing part 16 ... Offset storage unit 17 ... Offset validity determination unit 21 ... X-axis direction magnetic detection unit 22 ... Y-axis direction magnetic detection unit 23 ... Z-axis direction magnetic detection unit 31 ... X-axis acceleration detection unit 32 ... Y-axis acceleration detection unit 33 ... Z-axis acceleration detector

Claims (6)

互いに直交する3つの測定軸を有し、測定軸方向の地磁気を測定する軸センサからなる磁気センサから出力される前記測定軸毎の地磁気の測定結果である磁気測定データのオフセットを求め、前記磁気測定データを補正する磁気測定データ校正装置であり、
加速度センサから供給される加速度データからロール角及びピッチ角を求める傾斜角算出部と、
前記ロール角の角度範囲と前記ピッチ角の角度範囲との組合せ毎に、当該組合せに対応した磁気測定データを記憶させる領域が設けられた磁気測定データバッファと、
磁気センサから供給される磁気測定データを、当該磁気測定データの測定時に検出された前記ロール角及び前記ピッチ角に対応する前記領域に対して書き込んで記憶させる磁気測定データ判定部と、
前記磁気測定データから前記オフセットを所定の計算により求めるオフセット算出部と、
オフセット算出部の求めたオフセットである算出オフセットと、現在使用しているオフセットである設定オフセットのいずれが確からしいかを、前記磁気測定データバッファに記憶された磁気データを用いて判定し、確からしいと判定されたオフセットを新たな設定オフセットとするオフセット有効性判定部と
を備えることを特徴とする磁気測定データ校正装置。
An offset of magnetic measurement data, which is a measurement result of the geomagnetism for each of the measurement axes, is output from a magnetic sensor having three measurement axes orthogonal to each other and measuring the geomagnetism in the measurement axis direction. It is a magnetic measurement data calibration device that corrects measurement data,
An inclination angle calculation unit for obtaining a roll angle and a pitch angle from acceleration data supplied from an acceleration sensor;
A magnetic measurement data buffer provided with an area for storing magnetic measurement data corresponding to the combination of the angular range of the roll angle and the angular range of the pitch angle;
Magnetic measurement data determination unit for writing and storing magnetic measurement data supplied from a magnetic sensor in the region corresponding to the roll angle and the pitch angle detected when measuring the magnetic measurement data;
An offset calculating unit for obtaining the offset from the magnetic measurement data by a predetermined calculation;
Using the magnetic data stored in the magnetic measurement data buffer, it is determined whether the calculated offset, which is the offset obtained by the offset calculation unit, or the set offset, which is the currently used offset, is likely. And an offset validity determination unit that uses the determined offset as a new set offset.
前記オフセット算出部が、
測定された磁気測定データの前記測定軸毎の磁気測定データと、前回求められたオフセットとの差分から誤差関数を求める誤差関数計算部と、
前記誤差関数及び前回求められた共分散行列からオフセット残差を算出するオフセット残差計算部と、
前回の前記磁気測定データの測定時に設定した前記設定オフセットに対し、前記オフセット残差を加算し、前記算出オフセットを算出するオフセット更新部と、
測定された前記磁気測定データを用い、以前に測定された前記磁気測定データを母集団とする磁気測定データの共分散行列を更新し、測定された前記磁気測定データを前記母集団に加えて新たな共分散行列を生成する共分散行列更新部と
を備えることを特徴とする請求項1に記載の磁気測定データ校正装置。
The offset calculation unit
An error function calculation unit for obtaining an error function from the difference between the magnetic measurement data for each measurement axis of the measured magnetic measurement data and the previously obtained offset;
An offset residual calculation unit for calculating an offset residual from the error function and the previously obtained covariance matrix;
An offset update unit that calculates the calculated offset by adding the offset residual to the set offset set at the time of the previous measurement of the magnetic measurement data;
Using the measured magnetic measurement data, update the covariance matrix of the magnetic measurement data with the previously measured magnetic measurement data as a population, and add the measured magnetic measurement data to the population to newly The magnetic measurement data calibration device according to claim 1, further comprising: a covariance matrix updating unit that generates a covariance matrix.
前記オフセット算出部が、
前記領域に書き込まれている磁気測定データと仮のオフセットとの差分をそれぞれの測定軸毎に算出して二乗して領域毎に加算し、この加算結果を前記磁気測定データバッファに磁気測定データが記憶されている全ての領域で加算し、この加算結果が最小となる前記仮のオフセットを前記算出オフセットとする
ことを特徴とする請求項1に記載の磁気測定データ校正装置。
The offset calculation unit
The difference between the magnetic measurement data written in the area and the temporary offset is calculated for each measurement axis, squared, added for each area, and the addition result is stored in the magnetic measurement data buffer. 2. The magnetic measurement data calibration apparatus according to claim 1, wherein addition is performed in all the stored areas, and the temporary offset that minimizes the addition result is used as the calculated offset.
前記オフセット有効性判定部が、
前記磁気測定データから算出した前記算出オフセットと、前記磁気測定データバッファに記憶されている磁気データとの差分の標準偏差である第1の標準偏差を求め、また現在使用している前記設定オフセットと、前記磁気測定データバッファに記憶されている磁気データとの差分の標準偏差である第2の標準偏差を求め、前記第1の標準偏差と前記第2の標準偏差とを比較し、比較結果により前記算出オフセット及び前記設定オフセットのいずれを、新たな設定オフセットとするかの判定を行う
ことを特徴とする請求項1から請求項3のいずれか一項に記載の磁気測定データ校正装置。
The offset validity determination unit
A first standard deviation which is a standard deviation of a difference between the calculated offset calculated from the magnetic measurement data and the magnetic data stored in the magnetic measurement data buffer is obtained, and the currently used set offset A second standard deviation which is a standard deviation of the difference from the magnetic data stored in the magnetic measurement data buffer is obtained, the first standard deviation is compared with the second standard deviation, and the comparison result is obtained. 4. The magnetic measurement data calibration apparatus according to claim 1, wherein a determination is made as to which of the calculated offset and the set offset is a new set offset. 5.
互いに直交する3つの測定軸を有し、測定軸方向の地磁気を測定する軸センサからなる磁気センサと、
互いに直交する3つの測定軸を有し、測定軸方向の加速度を測定する加速度センサと、
前記磁気センサから出力される前記測定軸毎の地磁気の測定結果である磁気測定データのオフセットを求め、前記磁気測定データを補正する磁気測定データ校正部と、
前記磁気測定データ校正装置から出力される、前記磁気測定データを校正した磁気校正データから方位角を算出する方位角計測部と
を備え、
加速度センサから供給される加速度データからロール角及びピッチ角を求める傾斜角算出部と、
前記ロール角の角度範囲とピッチ角の角度範囲との組合せ毎に、当該組合せに対応した磁気測定データを記憶させる領域が設けられた磁気測定データバッファと、
磁気センサから供給される磁気測定データを、当該磁気測定データの測定時に検出された前記ロール角及び前記ピッチ角に対応する前記領域に対して書き込んで記憶させる磁気測定データ判定部と、
前記磁気測定データから前記オフセットを所定の計算により求めるオフセット算出部と、
オフセット算出部の求めたオフセットである算出オフセットと、現在使用しているオフセットである設定オフセットのいずれが確からしいかを、前記磁気測定データバッファに記憶された磁気データを用いて判定し、確からしいと判定されたオフセットを新たな設定オフセットとするオフセット有効性判定部と
を備えることを特徴とする方位角計測装置。
A magnetic sensor having three measurement axes orthogonal to each other and including an axis sensor for measuring geomagnetism in the measurement axis direction;
An acceleration sensor having three measurement axes orthogonal to each other and measuring acceleration in the measurement axis direction;
Obtaining a magnetic measurement data offset that is a measurement result of the geomagnetism for each measurement axis output from the magnetic sensor, and correcting the magnetic measurement data;
An azimuth measuring unit that calculates an azimuth from magnetic calibration data calibrated from the magnetic measurement data output from the magnetic measurement data calibration device, and
An inclination angle calculation unit for obtaining a roll angle and a pitch angle from acceleration data supplied from an acceleration sensor;
A magnetic measurement data buffer provided with an area for storing magnetic measurement data corresponding to each combination of the roll angle angle range and the pitch angle angle range;
Magnetic measurement data determination unit for writing and storing magnetic measurement data supplied from a magnetic sensor in the region corresponding to the roll angle and the pitch angle detected when measuring the magnetic measurement data;
An offset calculating unit for obtaining the offset from the magnetic measurement data by a predetermined calculation;
Using the magnetic data stored in the magnetic measurement data buffer, it is determined whether the calculated offset, which is the offset obtained by the offset calculation unit, or the set offset, which is the currently used offset, is likely. An azimuth angle measuring apparatus comprising: an offset validity determining unit that sets the determined offset as a new set offset.
互いに直交する3つの測定軸を有し、測定軸方向の地磁気を測定する軸センサからなる磁気センサから出力される前記測定軸毎の地磁気の測定結果である磁気測定データのオフセットを求め、前記磁気測定データを補正する、加速度センサから供給される加速度データからロール角及びピッチ角を求める傾斜角算出部と、前記磁気測定データから前記オフセットを所定の計算により求めるオフセット算出部と、オフセット算出部の求めたオフセットである算出オフセットと、現在使用しているオフセットである設定オフセットのいずれが確からしいかを、前記磁気測定データバッファに記憶された磁気データを用いて判定し、磁気測定データを前記磁気センサから取得する磁気測定データ判定部と、確からしいと判定されたオフセットを新たな設定オフセットとするオフセット有効性判定部とからなる磁気測定データ校正装置に用いられるバッファであり、
前記ロール角の角度範囲と前記ピッチ角の角度範囲との組合せ毎に、当該組合せに対応した磁気測定データを記憶させる領域が設けられ、前記磁気測定データ判定部により、磁気センサから供給される磁気測定データが、当該磁気測定データの測定時に検出された前記ロール角及び前記ピッチ角に対応する前記領域に対して書き込まれる
ことを特徴とするバッファ。
An offset of magnetic measurement data, which is a measurement result of the geomagnetism for each of the measurement axes, is output from a magnetic sensor having three measurement axes orthogonal to each other and measuring the geomagnetism in the measurement axis direction. An inclination calculation unit that corrects measurement data, obtains a roll angle and a pitch angle from acceleration data supplied from an acceleration sensor, an offset calculation unit that obtains the offset from the magnetic measurement data by a predetermined calculation, and an offset calculation unit It is determined by using the magnetic data stored in the magnetic measurement data buffer whether the calculated offset that is the calculated offset or the set offset that is currently used is likely, and the magnetic measurement data is New magnetic measurement data determination unit to be acquired from sensor and offset determined to be probable A buffer for use in a magnetic measurement data correcting device comprising the offset validity judging unit to set offset,
For each combination of the angle range of the roll angle and the angle range of the pitch angle, an area for storing the magnetic measurement data corresponding to the combination is provided, and the magnetism supplied from the magnetic sensor by the magnetic measurement data determination unit Measurement data is written to the area corresponding to the roll angle and the pitch angle detected when measuring the magnetic measurement data.
JP2011272274A 2011-12-13 2011-12-13 Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer Pending JP2013124871A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011272274A JP2013124871A (en) 2011-12-13 2011-12-13 Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011272274A JP2013124871A (en) 2011-12-13 2011-12-13 Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer

Publications (1)

Publication Number Publication Date
JP2013124871A true JP2013124871A (en) 2013-06-24

Family

ID=48776213

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011272274A Pending JP2013124871A (en) 2011-12-13 2011-12-13 Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer

Country Status (1)

Country Link
JP (1) JP2013124871A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015169619A (en) * 2014-03-10 2015-09-28 旭化成エレクトロニクス株式会社 Magnetic data correction device and correction parameter creation device
CN105716594A (en) * 2016-01-29 2016-06-29 中国船舶重工集团公司第七一〇研究所 Plane six-point calibration method of compass

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015169619A (en) * 2014-03-10 2015-09-28 旭化成エレクトロニクス株式会社 Magnetic data correction device and correction parameter creation device
CN105716594A (en) * 2016-01-29 2016-06-29 中国船舶重工集团公司第七一〇研究所 Plane six-point calibration method of compass

Similar Documents

Publication Publication Date Title
US8437970B2 (en) Restoring and storing magnetometer calibration data
US7844415B1 (en) Dynamic motion compensation for orientation instrumentation
CN103941309B (en) Geomagnetic sensor calibration device and method thereof
US9151610B2 (en) Validating calibrated magnetometer data
KR101485142B1 (en) Method and system for a self-calibrated multi-magnetometer platform
CN103575293B (en) A kind of magnetometer deflection bearing calibration and magnetometer
KR20130143576A (en) Apparatuses and methods for estimating the yaw angle of a device in a gravitational reference system using measurements of motion sensors and a magnetometer attached to the device
CN103299247B (en) Apparatus and method for dynamic tracking and compensation of magnetic near field
US20240045001A1 (en) System and method for fast magnetometer calibration using gyroscope
JP2004525348A (en) Monitoring the accuracy of the electronic compass
JP2006113019A (en) Triaxial type electronic compass, and azimuth detecting method using same
RU2717566C1 (en) Method of determining errors of an inertial unit of sensitive elements on a biaxial rotary table
JP2019120587A (en) Positioning system and positioning method
TWI452263B (en) Geomagnetic detection device
JP2013072643A (en) Magnetic measurement data calibration device and azimuth angle measurement device
JP2005195376A (en) Azimuth measuring method, and azimuth measuring instrument
KR102908805B1 (en) How to calibrate a gyrometer fitted to an object
Šipoš et al. Improvement of electronic compass accuracy based on magnetometer and accelerometer calibration
JP2013124871A (en) Magnetic measurement data calibration apparatus, azimuth angle measurement device, and buffer
JP6097500B2 (en) Magnetic measurement data calibration device and azimuth angle measurement device
WO2017090360A1 (en) Sensor error calculation device, attitude angle calculation device, sensor error calculation method, and attitude angle calculation method
US11079224B2 (en) Offset derivation device, offset calculation device, and azimuth sensor
JP2012103207A (en) Output correction circuit of magnetic sensor, output correction method of magnetic sensor, and azimuth angle measurement device
JP5374422B2 (en) Magnetic field detector
KR101928231B1 (en) Offset detection device and azimuth angle sensor