JP5035448B2 - Magnetic sensor control apparatus and method - Google Patents

Magnetic sensor control apparatus and method Download PDF

Info

Publication number
JP5035448B2
JP5035448B2 JP2011112959A JP2011112959A JP5035448B2 JP 5035448 B2 JP5035448 B2 JP 5035448B2 JP 2011112959 A JP2011112959 A JP 2011112959A JP 2011112959 A JP2011112959 A JP 2011112959A JP 5035448 B2 JP5035448 B2 JP 5035448B2
Authority
JP
Japan
Prior art keywords
magnetic data
point
magnetic
data
selection
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.)
Expired - Fee Related
Application number
JP2011112959A
Other languages
Japanese (ja)
Other versions
JP2011164115A (en
Inventor
伊吹 半田
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.)
Yamaha Corp
Original Assignee
Yamaha Corp
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 Yamaha Corp filed Critical Yamaha Corp
Priority to JP2011112959A priority Critical patent/JP5035448B2/en
Publication of JP2011164115A publication Critical patent/JP2011164115A/en
Application granted granted Critical
Publication of JP5035448B2 publication Critical patent/JP5035448B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は磁気センサ制御装置および方法に関する。   The present invention relates to a magnetic sensor control apparatus and method.

従来、移動体に搭載され、地磁気の方向を検出する3次元磁気センサが知られている。一般に3次元磁気センサは、磁界のベクトルを互いに直交する3方向の成分に分解してスカラー量を検出するための3つの磁気センサモジュールを備えている。3次元磁気センサの出力である磁気データは、そのような3つの磁気センサモジュールのそれぞれの出力の組み合わせからなるため、3成分を有する。磁気データを成分とするベクトルの方向と大きさが、3次元磁気センサが検出している磁界の方向と大きさである。3次元磁気センサの出力に基づいて地磁気の方向又は大きさを特定するとき、移動体の着磁成分を打ち消すために3次元磁気センサの出力を補正する処理が必要である。この補正処理の操作値はオフセットと呼ばれている。オフセットは3次元磁気センサが検出している移動体の着磁による磁界のベクトルを表しており、3次元磁気センサの出力である磁気データからオフセットが引き算されることによって移動体の着磁成分が打ち消される。磁気データを成分とする点を通る球面の中心を求めることによってオフセットを算出することができる。
ところで、磁気データを成分とする点の集合は現実には完全な球面にならない。なぜならば、3次元磁気センサの出力自体がガウス分布に従う測定誤差を有しているし、現実には完全に一様な磁界は存在しないためオフセットを算出するために必要な磁気データが蓄積される期間中に3次元磁気センサが測定している磁界が変動するし、3次元磁気センサの出力をディジタル値で取り出すまでの計算誤差があるからである。
従来の磁気センサのオフセット算出方法は、多数の磁気データを蓄積し、それらの統計処理によって、最も確からしいオフセットを算出するものであった(例えば特許文献1参照)。しかし、多数の磁気データの統計処理をする場合には、母集団となる磁気データ群の分布が満遍なく広く、特異な磁気データが母集団から排除されていなければ精度のよいオフセットを算出することができない。したがって、精度のよいオフセットを算出するには母集団をある程度選抜する必要もあり、結局のところ統計処理だけで精度のよいオフセットを算出することはできない。また、統計処理によって最も確からしい球面の中心を求める処理量は相当多く、時間と資源の消費が多い。
Conventionally, a three-dimensional magnetic sensor that is mounted on a moving body and detects the direction of geomagnetism is known. In general, a three-dimensional magnetic sensor includes three magnetic sensor modules for detecting a scalar quantity by decomposing a magnetic field vector into three orthogonal components. The magnetic data that is the output of the three-dimensional magnetic sensor has three components because it consists of a combination of the outputs of such three magnetic sensor modules. The direction and magnitude of the vector having magnetic data as the component are the direction and magnitude of the magnetic field detected by the three-dimensional magnetic sensor. When the direction or magnitude of geomagnetism is specified based on the output of the three-dimensional magnetic sensor, a process for correcting the output of the three-dimensional magnetic sensor is necessary to cancel the magnetization component of the moving body. The operation value of this correction process is called offset. The offset represents a magnetic field vector generated by magnetization of the moving body detected by the three-dimensional magnetic sensor, and the magnetizing component of the moving body is obtained by subtracting the offset from the magnetic data that is the output of the three-dimensional magnetic sensor. Be countered. An offset can be calculated by obtaining the center of a spherical surface that passes through a point having magnetic data as a component.
By the way, a set of points whose components are magnetic data is not a perfect sphere in reality. This is because the output of the three-dimensional magnetic sensor itself has a measurement error according to a Gaussian distribution, and in reality there is no completely uniform magnetic field, so magnetic data necessary for calculating the offset is accumulated. This is because the magnetic field measured by the three-dimensional magnetic sensor fluctuates during the period, and there is a calculation error until the output of the three-dimensional magnetic sensor is extracted as a digital value.
The conventional offset calculation method of a magnetic sensor is to accumulate a large number of magnetic data and calculate the most probable offset by their statistical processing (see, for example, Patent Document 1). However, when statistical processing of a large number of magnetic data is performed, it is possible to calculate an accurate offset if the distribution of the magnetic data group as a population is uniformly wide and unique magnetic data is not excluded from the population. Can not. Therefore, it is necessary to select a population to some extent in order to calculate an accurate offset, and after all, it is not possible to calculate an accurate offset only by statistical processing. In addition, the amount of processing for obtaining the most probable spherical center by statistical processing is considerable, and it consumes a lot of time and resources.

本発明は、オフセットの算出に統計処理を用いる必要のない磁気センサ制御装置、方法及びプログラムを提供することを目的とする。   It is an object of the present invention to provide a magnetic sensor control device, method, and program that do not require the use of statistical processing for offset calculation.

(1)上記目的を達成するための磁気センサ制御装置は、3次元磁気センサから順次出力される、3成分を有する複数の磁気データを入力する入力手段と、入力された複数の前記磁気データから、予め決められた4点選抜条件を満たす4つの前記磁気データを選抜する選抜手段と、選抜された4つの前記磁気データを成分とする4点から等距離にある点である中心点を算出する算出手段と、前記中心点の成分を前記磁気データのオフセットとして設定する設定手段と、を備える。
3次元磁気センサから順次出力される磁気データから、予め決められた4点選抜条件を満たす4つの磁気データを選抜し、選抜された4つの磁気データを成分とする4点から等距離にある点である中心点を算出することにより、オフセットの算出に統計処理を用いる必要がなくなるため、効率よくオフセットを算出することができる。尚、算出されたオフセットの信頼性を統計処理によって評価することも可能である。
(1) A magnetic sensor control device for achieving the above object includes an input means for inputting a plurality of magnetic data having three components, which are sequentially output from a three-dimensional magnetic sensor, and a plurality of the inputted magnetic data. A selection means for selecting the four magnetic data satisfying a predetermined four-point selection condition, and a center point which is a point equidistant from the four points having the selected four magnetic data as components. Calculating means; and setting means for setting a component of the center point as an offset of the magnetic data.
Four magnetic data satisfying a predetermined four-point selection condition are selected from magnetic data sequentially output from the three-dimensional magnetic sensor, and the points are equidistant from the four points having the selected four magnetic data as components. By calculating the center point that is, it is not necessary to use statistical processing for calculating the offset, so that the offset can be calculated efficiently. It is also possible to evaluate the reliability of the calculated offset by statistical processing.

(2)前記磁気センサ制御装置は、入力された複数の前記磁気データを格納するバッファをさらに備えてもよい。前記選抜手段は、n(n=2、3又は4)番目の前記磁気データを選抜する前に予め決められた所定の選抜条件を満たすn−1番目の前記磁気データを選抜し、n−1番目までの前記磁気データとして選抜されなかった前記磁気データを前記バッファから取得してn番目の前記磁気データの選抜候補としてもよい。
4点選抜条件を満たす4つの磁気データを、多数の磁気データから一度に選抜するためには選抜試行回数が大きくばらつき、選抜に要する最大処理量が膨大になる可能性がある。そこで、選抜条件を段階的に設定し、n番目の磁気データをある条件で選抜する前に別の選抜条件を満たすn−1番目の磁気データを選抜しておくことにより、選抜に要する最大処理量を低減することができる。さらに、n番目の磁気データをある条件で選抜するときに、n−1番目までの磁気データとして選抜されなかった磁気データを再び選抜候補とすることにより、オフセットを算出するために必要な磁気データの個数を低減することができる。その結果、磁気データのオフセットを算出するために必要な磁気データを収集するために必要となる、3次元磁気センサを搭載している移動体の操作量が低減されるし、オフセットの算出時間が短縮される。
(2) The magnetic sensor control device may further include a buffer for storing the plurality of input magnetic data. The selection means selects the (n−1) th magnetic data satisfying a predetermined selection condition before selecting the n (n = 2, 3 or 4) th magnetic data, and selects n−1. The magnetic data that has not been selected as the first magnetic data may be acquired from the buffer and may be selected as the nth magnetic data selection candidate.
In order to select four magnetic data satisfying the four-point selection condition from a large number of magnetic data at once, the number of selection trials greatly varies, and the maximum processing amount required for selection may become enormous. Therefore, the selection process is set in stages, and the n-1st magnetic data satisfying another selection condition is selected before the nth magnetic data is selected under a certain condition, whereby the maximum processing required for selection is performed. The amount can be reduced. Further, when selecting the n-th magnetic data under a certain condition, the magnetic data that has not been selected as the magnetic data up to the (n−1) -th magnetic data is set as a selection candidate again, so that magnetic data necessary for calculating the offset is obtained. Can be reduced. As a result, the amount of operation of the moving body equipped with the three-dimensional magnetic sensor required for collecting magnetic data necessary for calculating the offset of the magnetic data is reduced, and the offset calculation time is reduced. Shortened.

(3)前記選抜手段は、選抜候補の3つの前記磁気データを格納するための3つのデータ構造体に、入力された前記磁気データを格納しながら、3つの前記データ構造体に格納された3つの前記磁気データが予め決められた3点選抜条件を満たすまで、前記データ構造体を更新し、前記3点選抜条件を満たす3つの前記磁気データを選抜してもよい。
4点選抜条件を満たす4番目の磁気データを選抜する前に、3番目までの磁気データの選抜を済ませておくことにより、選抜に要する最大処理量を低減することができる。3番目の磁気データの選抜をする過程では、1つずつ磁気データが更新される、3つの磁気データを格納可能な3つのデータ構造体を用いることができる。磁気データを格納するためのデータ構造体は、例えば、磁気データの3成分を格納するための3つの変数を要素とする配列として定義することができる。
(3) The selection means stores the input magnetic data in the three data structures for storing the three magnetic data of the selection candidates, and stores them in the three data structures. The data structure may be updated until the three magnetic data satisfy a predetermined three-point selection condition, and the three magnetic data satisfying the three-point selection condition may be selected.
By selecting up to the third magnetic data before selecting the fourth magnetic data satisfying the four-point selection condition, the maximum processing amount required for selection can be reduced. In the process of selecting the third magnetic data, three data structures capable of storing three magnetic data, in which the magnetic data is updated one by one, can be used. A data structure for storing magnetic data can be defined as an array having, for example, three variables for storing three components of magnetic data.

(4)前記選抜手段は、最後に入力された前記磁気データを3つの前記データ構造体のいずれかに格納するとき、最後に入力された前記磁気データで更新されることによって3つの前記データ構造体に格納されている3つの前記磁気データを成分とする3点を通る円弧の弦の長さが延長され少なくとも短縮されないように1つの前記データ構造体を選択し、選択した前記データ構造体を、最後に入力された前記磁気データで更新してもよい。
3つの磁気データを成分とする3点を通る円は、最終的に求まるオフセットを成分とする点を中心とする球の断面円の円周になる。その断面円を正確なオフセットを成分とする点を中心とする球の断面円に近づけるためには、その断面円の面積が広く、その断面円を規定する3点が円周上で広い範囲に満遍なく分散していることが望ましい。したがって、3つの磁気データを成分とする3点を通る弦の長さは長い方が望ましい。そこで、最後に入力された磁気データを3つのデータ構造体のいずれかに格納するときには、3つのデータ構造体に格納されている3つの磁気データを成分とする3点を通る円弧の弦の長さがデータ構造体の更新によって長くなるように、更新対象となるデータ構造体が選択されることが望ましい。
(4) When the selection means stores the last input magnetic data in any of the three data structures, the selection means updates the last input magnetic data with the three data structures. The one data structure is selected so that the length of the chord of the arc passing through the three points including the three magnetic data stored in the body is extended and at least not shortened, and the selected data structure is The magnetic data inputted last may be updated.
A circle passing through three points having three magnetic data components is the circumference of a sphere cross-section centered on a point whose component is an offset finally obtained. In order to bring the cross-sectional circle closer to the cross-sectional circle of a sphere centered on a point having an accurate offset as a component, the area of the cross-sectional circle is large, and the three points that define the cross-sectional circle are wide on the circumference It is desirable to be evenly distributed. Accordingly, it is desirable that the length of the string passing through the three points having the three magnetic data components is longer. Therefore, when storing the last input magnetic data in any of the three data structures, the length of the chord of the arc passing through the three points whose components are the three magnetic data stored in the three data structures. It is desirable that the data structure to be updated is selected so that the length becomes longer due to the update of the data structure.

(5)前記選抜手段は、3つの前記データ構造体の更新回数が予め決められた所定回数を超えると3つの前記データ構造体をリセットしてもよい。
3点選抜条件を満たす3つの磁気データが選抜されている過程において2番目までの磁気データが選抜された後に磁気センサが存在している磁界が激変した場合などには、3点選抜条件を満たす磁気データがいつまでも入力されない可能性がある。このような問題を未然に防止するため、3つのデータ構造体の更新回数が予め決められた所定回数を超えたときには3つのデータ構造体をいったんリセットすることが望ましい。その結果、変化後の磁界について磁気データが3つの空のデータ構造体に格納されることになるため、3点選抜条件が満たされる3つの磁気データがいつまでも選抜されないという問題は起こらなくなる。
(5) The selection unit may reset the three data structures when the number of updates of the three data structures exceeds a predetermined number.
In the process of selecting three magnetic data satisfying the three-point selection condition, if the magnetic field in which the magnetic sensor exists is changed drastically after the second magnetic data is selected, the three-point selection condition is satisfied. Magnetic data may not be input indefinitely. In order to prevent such a problem, it is desirable to reset the three data structures once when the number of updates of the three data structures exceeds a predetermined number. As a result, since the magnetic data is stored in three empty data structures for the changed magnetic field, the problem that the three magnetic data satisfying the three-point selection condition are not selected indefinitely does not occur.

(6)前記3点選抜条件は、前記データ構造体に格納された3つの前記磁気データを成分とする3点を頂点とする三角形の正三角形に対する歪みに相関する条件を含んでもよい。
3つの磁気データを成分とする3点を通る円は、最終的に求まるオフセットを成分とする点を中心とする球の断面円の円周になる。その断面円を正確なオフセットを成分とする点を中心とする球の断面円に近づけるためには、その断面円を規定する3点が円周上で等間隔に分散していることが望ましい。したがって、3つの磁気データを成分とする3点を頂点とする三角形の正三角形に対する歪みに関して3点選抜条件を設定することが望ましい。3つの磁気データを成分とする3点を頂点とする三角形が正三角形であるとき、3点が円周上で等間隔に分散していることになる。
三角形の正三角形に対する歪みは三角形のいくつかの属性に着目して定義することができる。
(6) The three-point selection condition may include a condition that correlates with a distortion with respect to a regular triangle of a triangle having three points as vertices having three magnetic data stored in the data structure as components.
A circle passing through three points having three magnetic data components is the circumference of a sphere cross-section centered on a point whose component is an offset finally obtained. In order to make the cross-sectional circle close to the cross-sectional circle of a sphere centered on a point having an accurate offset as a component, it is desirable that the three points defining the cross-sectional circle are dispersed at equal intervals on the circumference. Therefore, it is desirable to set a three-point selection condition for the distortion of a triangular triangle having three points with three magnetic data as components. When a triangle whose apex is three points having three magnetic data components is a regular triangle, the three points are distributed at equal intervals on the circumference.
The distortion of a triangle with respect to a regular triangle can be defined by paying attention to some attributes of the triangle.

(7−9)例えば、前記3点選抜条件は、前記三角形の内角のばらつきが予め決められた所定範囲内にあることを含んでもよい。また例えば、前記3点選抜条件は、前記三角形の辺の長さのばらつきが予め決められた所定範囲内にあることを含んでもよい。また例えば、前記3点選抜条件は、前記三角形の重心から各頂点までの距離のばらつきが予め決められた所定範囲内にあることを含んでもよい。。
値のばらつきは数学的に任意に定義することができるが、条件判定に必要な計算量や処理時間や、条件判定の過程で得られた計算結果の再利用可能性などを勘案して定義することが望ましい。
(7-9) For example, the three-point selection condition may include that the variation in the internal angle of the triangle is within a predetermined range. Further, for example, the three-point selection condition may include that the variation in the length of the sides of the triangle is within a predetermined range. Further, for example, the three-point selection condition may include that a variation in distance from the center of gravity of the triangle to each vertex is within a predetermined range. .
Variations in values can be arbitrarily defined mathematically, but in consideration of the amount of computation and processing time required for condition determination, and the possibility of reusing calculation results obtained in the condition determination process. It is desirable.

(10)したがって、前記3点選抜条件は、下記の3行3列の対称行列Aの最大固有値に対する中間固有値の比が所定値以上であることを含むことが望ましい。

Figure 0005035448
ただし、
i(i=0,1,2)は前記三角形の各頂点であり、d3は前記三角形の重心である。 (10) Therefore, it is desirable that the three-point selection condition includes that the ratio of the intermediate eigenvalue to the maximum eigenvalue of the following 3-by-3 symmetric matrix A is not less than a predetermined value.
Figure 0005035448
However,
p i (i = 0, 1, 2) is each vertex of the triangle, and d 3 is the center of gravity of the triangle.

(11)前記4点選抜条件は、選抜候補の4つの前記磁気データを成分とする4点を頂点とする四面体の正四面体に対する歪みに相関する条件を含んでもよい。
4つの磁気データを成分とする4点は、最終的に求まるオフセットを成分とする点を中心とする球面を規定する。その球面を、正確なオフセットを成分とする点を中心とする球面に近づけるためには、その球面を規定する4点が球面上の広い範囲に満遍なく分散していることが望ましい。その球面を規定する4点が球面上で満遍なく分散しているとき、それらの4点を頂点とする四面体は正四面体となる。したがって、選抜候補の4つの磁気データを成分とする4点を頂点とする四面体の正四面体に対する歪みに関して4点選抜条件を設定することが望ましい。
四面体の正四面体に対する歪みは正四面体のいくつかの属性に着目して定義することができる。
(11) The four-point selection condition may include a condition that correlates with a distortion of a tetrahedron with four points as vertices having the four magnetic data as selection candidates as a vertex.
Four points having four magnetic data as components define a spherical surface centered on a point having the offset finally obtained as a component. In order to bring the spherical surface closer to a spherical surface centered on a point having an accurate offset as a component, it is desirable that the four points defining the spherical surface are uniformly distributed over a wide range on the spherical surface. When the four points that define the spherical surface are evenly distributed on the spherical surface, a tetrahedron with these four points as vertices is a regular tetrahedron. Therefore, it is desirable to set a four-point selection condition for the distortion of a tetrahedron with four points as vertices having four magnetic data components as selection candidates.
The distortion of a tetrahedron with respect to a regular tetrahedron can be defined by paying attention to some attributes of the regular tetrahedron.

(12−14)例えば、前記4点選抜条件は、前記四面体の各頂点の立体角のばらつきが予め決められた所定範囲内にあることを含んでもよい。また例えば、前記4点選抜条件は、前記四面体の各面の面積のばらつきが予め決められた所定範囲内にあることを含んでもよい。また例えば、前記4点選抜条件は、前記四面体の重心から各頂点までの距離のばらつきが予め決められた所定範囲内にあることを含んでもよい。
既に述べたとおり値のばらつきは数学的に任意に定義することができるが、条件判定に必要な計算量や処理時間や、条件判定の過程で得られた計算結果の再利用可能性などを勘案して定義することが望ましい。
(12-14) For example, the four-point selection condition may include a variation in solid angle of each vertex of the tetrahedron being within a predetermined range. Further, for example, the four-point selection condition may include that the variation in the area of each surface of the tetrahedron is within a predetermined range determined in advance. Further, for example, the four-point selection condition may include that a variation in distance from the center of gravity of the tetrahedron to each vertex is within a predetermined range determined in advance.
As already mentioned, the dispersion of values can be arbitrarily defined mathematically, but it takes into account the amount of computation and processing time required for condition judgment and the possibility of reusing the calculation results obtained in the condition judgment process. It is desirable to define

(15)したがって、前記4点選抜条件は、下記の3行3列の対称行列Bの各固有値のいずれか2組のそれぞれの比がそれぞれ予め決められた所定値より大きいことであることが望ましい。尚、1組の固有値の比のしきい値(所定値)の組み合わせを1通りだけ決めておいてもよいし、しきい値の組み合わせを複数通り決めておき、2組の固有値のそれぞれの比がいずれかの組み合わせに相当する2つのしきい値よりもそれぞれ大きいことを4点選抜条件としてもよい。

Figure 0005035448
ただし、
i(i=0,1,2)は前記四面体の各頂点であり、d4は前記四面体の重心である。 (15) Therefore, it is desirable that the four-point selection condition is that the ratio of any two sets of the eigenvalues of the following 3-by-3 symmetric matrix B is larger than a predetermined value. . Only one combination of threshold values (predetermined values) for the ratio of one set of eigenvalues may be determined, or a plurality of combinations of threshold values may be determined and the ratio of each of the two sets of eigenvalues. It is good also as 4 point selection conditions that each is larger than two threshold values corresponding to any combination.
Figure 0005035448
However,
p i (i = 0, 1, 2) is each vertex of the tetrahedron, and d 4 is the center of gravity of the tetrahedron.

尚、本発明に備わる複数の手段の各機能は、構成自体で機能が特定されるハードウェア資源、プログラムにより機能が特定されるハードウェア資源、又はそれらの組み合わせにより実現される。また、これら複数の手段の各機能は、各々が物理的に互いに独立したハードウェア資源で実現されるものに限定されない。また、本発明は、磁気センサ制御装置としてだけでなく、磁気センサ制御装置と3次元磁気センサとを組み合わせた磁気測定装置としても、磁気センサ制御方法としても、磁気センサ制御プログラムとしても特定可能である。   The functions of the plurality of means provided in the present invention are realized by hardware resources whose functions are specified by the configuration itself, hardware resources whose functions are specified by a program, or a combination thereof. The functions of the plurality of means are not limited to those realized by hardware resources that are physically independent of each other. The present invention can be specified not only as a magnetic sensor control device, but also as a magnetic measurement device combining a magnetic sensor control device and a three-dimensional magnetic sensor, as a magnetic sensor control method, and as a magnetic sensor control program. is there.

本発明の実施の形態に係るフローチャート。The flowchart which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係るブロック図。The block diagram which concerns on embodiment of this invention. 本発明の実施の形態に係るブロック図。The block diagram which concerns on embodiment of this invention. 本発明の実施の形態に係るフローチャート。The flowchart which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention. 本発明の実施の形態に係る模式図。The schematic diagram which concerns on embodiment of this invention.

以下、本発明の実施の形態を以下の順に説明する。
[1.全体説明]
1−1.基本原理
1−2.ハードウェア構成
1−3.ソフトウェア構成
[2.処理の流れ]
2−1.バッファ更新
2−2.1点目の選抜候補仮決定
2−3.2点目の選抜候補仮決定
2−4.3点目までの選抜
・3点の更新
・3点選抜条件
・選抜検証
・3点のリセット
2−5.4点目の選抜
・概要
・4点選抜条件
・方位球の算出
・方位球の検証
・オフセットの設定
Hereinafter, embodiments of the present invention will be described in the following order.
[1. Overall explanation]
1-1. Basic principle 1-2. Hardware configuration 1-3. Software configuration [2. Process flow]
2-1. Buffer update 2-2.1 point selection candidate tentative decision 2-3. Second point selection candidate tentative decision 2-4.3 selection up to 3rd point ・ 3 point update ・ 3 point selection condition ・ Selection verification ・3-point reset 2-5.4 Selection of the 4th point ・ Overview ・ 4-point selection conditions ・ Calculation of azimuth sphere ・ Verification of azimuth sphere ・ Offset setting

[1.全体概要]
1−1.基本原理
はじめに本実施形態が利用する基本原理について説明する。
本実施形態では、3次元磁気センサの出力に含まれる、それが搭載されている移動体の着磁成分を打ち消すためのオフセットを設定する。オフセットを求めるためには、3次元磁気センサの出力である磁気データを成分とするベクトル空間内の無数の点の集合である立体面に近似の球面を特定する。この球面を方位球の球面というものとする。方位球の中心点の成分がオフセットであり、その半径が磁界の強さである。3次元磁気センサの出力自体に計測誤差があるため、移動体が一定の磁界で回転しても、磁気データを成分とする点の集合は球面にはならない。本実施形態では、磁気データを成分とする4点を選抜し、選抜された4点から、それらを通る球面の中心点と半径とを求め、求めた球面の中心をオフセットとして設定する。この方法でオフセットに含まれる3次元磁気センサ自体の計測誤差による誤差を低減するためには、3次元磁気センサ自体の計測誤差が含まれている4つの磁気データを成分とする4点を、それら4点を通る球面上で広い範囲で満遍なく分散するように選抜することが重要である。以下、理解を容易にするため、2次元磁気センサに置き換えて捕捉説明する。
[1. Overall overview]
1-1. Basic Principle First, the basic principle used by the present embodiment will be described.
In the present embodiment, an offset for canceling the magnetization component of the moving body on which the three-dimensional magnetic sensor is mounted is set. In order to obtain the offset, a spherical surface that approximates a solid surface that is a collection of innumerable points in a vector space whose components are magnetic data that is output from a three-dimensional magnetic sensor is specified. This spherical surface is referred to as an azimuth spherical surface. The component of the center point of the azimuth sphere is an offset, and its radius is the strength of the magnetic field. Since there is a measurement error in the output itself of the three-dimensional magnetic sensor, even if the moving body rotates with a constant magnetic field, the set of points having magnetic data as a component does not become a spherical surface. In the present embodiment, four points having magnetic data as components are selected, and from the selected four points, the center point and radius of a spherical surface passing through them are obtained, and the obtained spherical center is set as an offset. In order to reduce the error due to the measurement error of the three-dimensional magnetic sensor itself included in the offset by this method, four points including four magnetic data containing the measurement error of the three-dimensional magnetic sensor itself as components It is important to select so that it is evenly distributed over a wide range on a spherical surface passing through four points. Hereinafter, in order to facilitate understanding, a description will be given by replacing it with a two-dimensional magnetic sensor.

図2は、2次元磁気センサの出力である磁気データを成分とする3点を通る方位円(実線)と、計測誤差がない理想2次元磁気センサの磁気データを成分とする無数の点の集合である真の方位円(破線)との関係を示している。2次元磁気センサの磁気データを成分とする3点がそれらを通る円周上の狭い範囲に分布しているとき、それらの3点から求まる方位円の中心(×)と、求めるべき理想2次元磁気センサの真の方位円の中心(+)との距離は、図2(A)に示すように大きくなる。これに対し、2次元磁気センサの磁気データを成分とする3点がそれらを通る円周上の広い範囲に満遍なく分布しているとき、それらの3点から求まる方位円の中心(+)と、求めるべき理想2次元磁気センサの真の方位円の中心(×)との距離は、図2(A)に示すように小さくなる。2次元磁気センサの磁気データを成分とする3点がそれらを通る円周で等間隔に分布しているとき、すなわちそれら3点を頂点とする三角形が正三角形になるとき、オフセットの誤差を最も小さくすることができる。   FIG. 2 shows an azimuth circle (solid line) that passes through three points whose components are magnetic data, which is the output of a two-dimensional magnetic sensor, and an infinite number of points, whose components are magnetic data of an ideal two-dimensional magnetic sensor that has no measurement error. It shows the relationship with the true azimuth circle (dashed line). When the three points whose components are magnetic data of a two-dimensional magnetic sensor are distributed in a narrow range on the circumference passing through them, the center of the azimuth circle (×) obtained from these three points and the ideal two-dimensional to be obtained The distance from the center (+) of the true azimuth circle of the magnetic sensor increases as shown in FIG. On the other hand, when three points whose components are magnetic data of a two-dimensional magnetic sensor are evenly distributed over a wide range on the circumference passing through them, the center (+) of the azimuth circle obtained from those three points, The distance from the center (x) of the true azimuth circle of the ideal two-dimensional magnetic sensor to be obtained is small as shown in FIG. When the three points whose components are magnetic data of the two-dimensional magnetic sensor are distributed at equal intervals around the circumference passing through them, that is, when the triangle having the three points as vertices becomes an equilateral triangle, the offset error is the most. Can be small.

3次元磁気センサでは、方位球を求めるために選抜される4点が、それらを頂点とする四面体が正四面体であるときに、オフセットの誤差を最も小さくすることができる。したがって、本実施形態では、磁気データを成分とする4点を、それらを頂点とする四面体の正四面体に対する歪みが特定のしきい値より小さくなるように選抜する。   In the three-dimensional magnetic sensor, when the tetrahedron having four points selected for obtaining the azimuth is a regular tetrahedron, the offset error can be minimized. Therefore, in the present embodiment, the four points having the magnetic data as components are selected so that the distortion of the tetrahedron having them as a vertex with respect to the regular tetrahedron is smaller than a specific threshold value.

ここで、予め4点を選抜し、選抜された4点を通る球面を求め、その球面からオフセットを求める本実施形態の方法と、5点以上の多数の点を通る立体面に近似の球面を統計的手法によって求め、その球面からオフセットを求める方法とを比較しておく。統計的手法を用いる方法では、磁気データを成分とする点が偏在していたり、母集団に特異な磁気データが含まれていれば、それらの点から求まる方位球の中心は真の方位球の中心から大きくずれる。したがって、統計的手法を用いてオフセットの誤差を低減しようとすれば、統計的手法によって方位球を求める母集団のばらつきを検証したり、母集団を選抜する必要がある。本実施形態の方法では、適正な4点を選抜することができれば、計算量の多い統計的手法を用いずとも、統計的手法を用いた方法によって得られるオフセットの精度に遜色のない精度のオフセットを求めることができる。   Here, four points are selected in advance, a spherical surface passing through the selected four points is obtained, and the method of this embodiment for obtaining an offset from the spherical surface, and a spherical surface approximate to a solid surface passing through a large number of five or more points. It is obtained by a statistical method and compared with a method for obtaining an offset from the spherical surface. In the method using the statistical method, if the points having magnetic data as a component are unevenly distributed or the magnetic population includes peculiar magnetic data, the center of the azimuth sphere obtained from these points is the true azimuth sphere. Deviation from the center. Therefore, if it is intended to reduce the offset error using a statistical method, it is necessary to verify the variation in the population for obtaining the bearing sphere using the statistical method, or to select the population. In the method of the present embodiment, if appropriate four points can be selected, an offset having an accuracy comparable to the offset accuracy obtained by the method using the statistical method can be used without using a statistical method having a large amount of calculation. Can be requested.

1−2.ハードウェア構成
図3は、本発明が適用される移動体の一例である携帯型電話機3の外観を示す模式図である。携帯型電話機3には3次元磁気センサ4が搭載されている。3次元磁気センサは互いに直交するx、y、zの3方向の磁界のベクトル成分を検出することによって磁界の方向及び強さを検出する。携帯型電話機3のディスプレイ2には、文字や画像の各種情報が表示される。例えば、ディスプレイ2には、地図と、方位を示す矢印や文字が表示される。
1-2. Hardware Configuration FIG. 3 is a schematic diagram showing an appearance of a mobile phone 3 which is an example of a mobile body to which the present invention is applied. A three-dimensional magnetic sensor 4 is mounted on the mobile phone 3. A three-dimensional magnetic sensor detects the direction and strength of a magnetic field by detecting vector components of magnetic fields in three directions of x, y, and z orthogonal to each other. Various information such as characters and images is displayed on the display 2 of the mobile phone 3. For example, the display 2 displays a map and an arrow or character indicating the direction.

図4は、本発明が適用される3次元磁気センサ4と磁気センサ制御装置1とを備える磁気測定装置を示すブロック図である。3次元磁気センサ4は、様々な移動体に搭載され、地磁気による磁界ベクトルのx方向成分、y方向成分、z方向成分をそれぞれ検出するx軸センサ30とy軸センサ32とz軸センサ34とを備えている。x軸センサ30、y軸センサ32、z軸センサ34は、いずれも磁気抵抗素子、ホール素子等で構成され、指向性のある1次元磁気センサであればどのようなものであってもよい。x軸センサ30、y軸センサ32及びz軸センサ34は、それぞれの感度方向が互いに直交するように固定されている。x軸センサ30、y軸センサ32及びz軸センサ34の出力は、時分割して磁気センサI/F(Inter Face)22に入力される。磁気センサI/F22では、x軸センサ30、y軸センサ32及びz軸センサ34からの入力が増幅された後にAD変換される。磁気センサI/F22から出力されるディジタルの磁気データは、バス5を介して磁気センサ制御装置1に入力される。   FIG. 4 is a block diagram showing a magnetic measurement device including the three-dimensional magnetic sensor 4 and the magnetic sensor control device 1 to which the present invention is applied. The three-dimensional magnetic sensor 4 is mounted on various moving bodies and includes an x-axis sensor 30, a y-axis sensor 32, and a z-axis sensor 34 that respectively detect an x-direction component, a y-direction component, and a z-direction component of a magnetic field vector due to geomagnetism. It has. The x-axis sensor 30, the y-axis sensor 32, and the z-axis sensor 34 are all configured by a magnetoresistive element, a Hall element, etc., and may be any one as long as it has directivity. The x-axis sensor 30, the y-axis sensor 32, and the z-axis sensor 34 are fixed so that their sensitivity directions are orthogonal to each other. Outputs of the x-axis sensor 30, the y-axis sensor 32, and the z-axis sensor 34 are time-divisionally input to a magnetic sensor I / F (Inter Face) 22. In the magnetic sensor I / F 22, input from the x-axis sensor 30, the y-axis sensor 32, and the z-axis sensor 34 is amplified and then AD converted. Digital magnetic data output from the magnetic sensor I / F 22 is input to the magnetic sensor control device 1 via the bus 5.

磁気センサ制御装置1は、CPU40とROM42とRAM44とを備えている所謂コンピュータである。CPU40は、例えば携帯型電話機3等の移動体の全体制御を司るプロセッサである。ROM42は、CPU40によって実行される磁気センサ制御プログラムや、移動体の機能を実現するための種々のプログラム、例えばナビゲーションプログラムが格納されている、不揮発性の記憶媒体である。RAM44はCPU40の処理対象となるデータを一時的に保持する揮発性の記憶媒体である。尚、磁気センサ制御装置1と3次元磁気センサ1とを1チップの磁気測定装置として構成することもできる。   The magnetic sensor control device 1 is a so-called computer including a CPU 40, a ROM 42, and a RAM 44. The CPU 40 is a processor that controls the entire mobile body such as the mobile phone 3. The ROM 42 is a non-volatile storage medium that stores a magnetic sensor control program executed by the CPU 40 and various programs for realizing the function of the moving body, for example, a navigation program. The RAM 44 is a volatile storage medium that temporarily holds data to be processed by the CPU 40. The magnetic sensor control device 1 and the three-dimensional magnetic sensor 1 can be configured as a one-chip magnetic measurement device.

1−3.ソフトウェア構成
図5は、磁気センサ制御プログラム90の構成を示すブロック図である。磁気センサ制御プログラム90は、ナビゲーションプログラム98に方位データを提供するためのプログラムであって、ROM42に格納されている。方位データは地磁気の方向を示す2次元ベクトルデータである。尚、方位データは3次元ベクトルデータとしてナビゲーションプログラム98に提供されてもよい。CPU40が磁気センサ制御プログラム90を実行するとき、CPU40、RAM44及びROM42は磁気センサ制御装置として機能する。磁気センサ制御プログラム90は、バッファ管理モジュール92、オフセット設定モジュール94、方位演算モジュール96等のモジュール群で構成されている。
1-3. Software Configuration FIG. 5 is a block diagram showing the configuration of the magnetic sensor control program 90. The magnetic sensor control program 90 is a program for providing azimuth data to the navigation program 98 and is stored in the ROM 42. The azimuth data is two-dimensional vector data indicating the direction of geomagnetism. The azimuth data may be provided to the navigation program 98 as three-dimensional vector data. When the CPU 40 executes the magnetic sensor control program 90, the CPU 40, the RAM 44, and the ROM 42 function as a magnetic sensor control device. The magnetic sensor control program 90 is composed of a module group such as a buffer management module 92, an offset setting module 94, and an azimuth calculation module 96.

バッファ管理モジュール92は、磁気センサ4から順次入力する磁気データをオフセット演算に用いるためにバッファに蓄積するプログラム部品であって、CPU40を入力手段として機能させる。磁気センサ4から順次入力される磁気データを順次選抜にかけ、選抜されなかった磁気データを廃棄することもできる。しかし、n点目(n=2,3)の選抜条件とn+k点目(k=1、2)の選抜条件とが異なれば、n点目として選抜されなかった磁気データであっても、n+k点目として選抜され得る。したがって、バッファ管理モジュール92が管理するバッファは、単に入力タイミングと処理タイミングのずれを緩衝するだけではなく、一度は選抜されなかった磁気データを再度選抜候補として利用可能にする目的でも利用される。尚、このバッファはハードウェアで構成されてもよいし、ソフトウェアで構成されてもよい。   The buffer management module 92 is a program component that stores magnetic data sequentially input from the magnetic sensor 4 in a buffer for use in offset calculation, and causes the CPU 40 to function as input means. The magnetic data sequentially input from the magnetic sensor 4 can be sequentially selected, and the magnetic data that has not been selected can be discarded. However, if the selection conditions for the nth point (n = 2, 3) and the selection conditions for the n + kth point (k = 1, 2) are different, even if the magnetic data is not selected as the nth point, n + k Can be selected as a point. Therefore, the buffer managed by the buffer management module 92 is used not only for buffering the difference between the input timing and the processing timing but also for the purpose of making magnetic data that has not been selected once available again as a selection candidate. The buffer may be configured by hardware or software.

オフセット設定モジュール94は、バッファ管理モジュール92によって保持されている磁気データから4つの磁気データを選抜し、選抜された4つの磁気データからオフセットを算出し、算出したオフセットを設定するプログラム部品であって、CPU40を選抜手段、算出手段及び設定手段として機能させる。   The offset setting module 94 is a program component that selects four magnetic data from the magnetic data held by the buffer management module 92, calculates an offset from the selected four magnetic data, and sets the calculated offset. The CPU 40 is caused to function as selection means, calculation means, and setting means.

方位演算モジュール96は、磁気センサ4から順次入力される磁気データと、設定されているオフセットとを用いて方位データを生成するプログラム部品である。具体的には、方位演算モジュール96は、3次元ベクトルデータである磁気データの各成分からオフセットデータの各成分を引き算して得られる3成分のうちの2成分又は3成分全部を方位データとして出力する。   The azimuth calculation module 96 is a program component that generates azimuth data using magnetic data sequentially input from the magnetic sensor 4 and a set offset. Specifically, the azimuth calculation module 96 outputs two or all three of the three components obtained by subtracting each component of the offset data from each component of the magnetic data that is three-dimensional vector data as azimuth data. To do.

ナビゲーションプログラム98は、目的地までの誘導経路を探索し、地図上に誘導経路を表示する周知のプログラムである。地図の認識のし易さから、地図は現実の方位に地図上の方位が一致するように画面表示される。したがって例えば、携帯型電話機3が回転すると、ディスプレイ2に表示される地図は地面に対して回転しないようにディスプレイ2に対して回転する。このような地図の表示処理に方位データが用いられる。もちろん、方位データは、単に南北東西を文字や矢印で表示するためにのみ用いられてもよい。   The navigation program 98 is a well-known program that searches for a guidance route to a destination and displays the guidance route on a map. For ease of map recognition, the map is displayed on the screen so that the orientation on the map matches the actual orientation. Therefore, for example, when the mobile phone 3 rotates, the map displayed on the display 2 rotates with respect to the display 2 so as not to rotate with respect to the ground. Direction data is used for such map display processing. Of course, the azimuth data may be used only for displaying the north-south-north-west with characters or arrows.

[処理の流れ]
2−1.バッファ更新
図6は、バッファ更新の処理の流れを示すフローチャートである。図6に示す処理は、オフセットの更新要求が発生したときにCPU40がバッファ管理モジュール92を実行することによって進行する。
ステップS100では、オフセットの算出に用いられる複数の磁気データを蓄積するためのバッファが初期化される。具体的には例えば、RAM44のバッファエリアに格納されているデータが削除される。
[Process flow]
2-1. Buffer Update FIG. 6 is a flowchart showing the flow of buffer update processing. The process shown in FIG. 6 proceeds when the CPU 40 executes the buffer management module 92 when an offset update request is generated.
In step S100, a buffer for storing a plurality of magnetic data used for offset calculation is initialized. Specifically, for example, data stored in the buffer area of the RAM 44 is deleted.

ステップS102では、磁気センサ4からの新たな磁気データの入力が待たれる。
磁気センサ4から新たな磁気データの入力があると、バッファの更新必要性が判定される(ステップS104)。携帯型電話機3がほとんど動いていない状況において、短い時間間隔で順次磁気センサ4から入力があると、連続入力される2つの磁気データを成分とする2点間の距離が近くなる。互いの距離が近い2点がオフセットを求めるために必要となる4点に含まれることは望まれない。また、磁気データを成分とする各点の距離が互いに近い複数の磁気データが限られた容量のバッファに格納されることは、メモリ資源の浪費であるし、無駄なバッファの更新処理を発生させる。そこで、バッファの更新必要性が次のように判定される。例えば、直前に入力された磁気データを成分とする点と最後に入力された磁気データを成分とする点との距離があるしきい値より小さければ、バッファの更新必要性がないと判定され、最後に入力された磁気データはバッファに格納されることなく破棄される。そうでない場合、バッファの更新必要性があると判定される。その結果例えば、図7に示す順序で磁気データの入力があったときには、黒丸で表された磁気データはバッファに格納されず、白丸で表された磁気データはバッファに格納されることになる。尚、図7では磁気データの入力順序が白丸及び黒丸の添え字で表されている。
In step S102, input of new magnetic data from the magnetic sensor 4 is awaited.
When new magnetic data is input from the magnetic sensor 4, it is determined whether the buffer needs to be updated (step S104). In the situation where the mobile phone 3 is hardly moving, if there is an input from the magnetic sensor 4 sequentially at short time intervals, the distance between two points having two magnetic data that are continuously input as components becomes close. It is not desirable that two points that are close to each other are included in the four points that are necessary for obtaining the offset. In addition, storing a plurality of magnetic data whose magnetic data components are close to each other in a buffer having a limited capacity is a waste of memory resources and causes unnecessary buffer update processing. . Therefore, the necessity for updating the buffer is determined as follows. For example, if the distance between the point having the magnetic data input immediately before and the point having the magnetic data input last as the component is smaller than a certain threshold value, it is determined that there is no need to update the buffer. The last input magnetic data is discarded without being stored in the buffer. Otherwise, it is determined that there is a need to update the buffer. As a result, for example, when magnetic data is input in the order shown in FIG. 7, the magnetic data represented by black circles is not stored in the buffer, and the magnetic data represented by white circles is stored in the buffer. In FIG. 7, the input order of magnetic data is represented by white circles and black circles.

上記の判定条件に加えてさらに次の条件を加えてバッファの更新要否を判定すると、キャリブレーションの成功確率を上げることができる。ここでバッファに格納されたNqmax個のデータ列をq0,q1,・・・qNmax-1とし、集合Qを、Q={qi| 0 ≦ I ≦ Nqmax-1}とする。
追加的な更新条件:あるしきい値qminに対し、磁気データを成分とする点qが、i < Nqなる全てのiについて||q-qi||2 > qminを満たすときに限り、最後の磁気データを格納してバッファを更新する。
If the following conditions are further added to the above determination conditions to determine whether or not the buffer needs to be updated, the probability of successful calibration can be increased. Here, it is assumed that N qmax data strings stored in the buffer are q 0 , q 1 ,... Q Nmax−1 , and the set Q is Q = {qi | 0 ≦ I ≦ N qmax −1}.
Additional update condition: For a certain threshold value q min , only when the point q having magnetic data as a component satisfies || qq i || 2 > q min for all i where i <N q . Store the last magnetic data and update the buffer.

尚、キャリブレーションの失敗とは、オフセットの更新要求が発生して磁気データの蓄積が開始された後に、蓄積された磁気データからはオフセットを求めることができなかった結果として、それまでに蓄積された磁気データを全て破棄することをいう。
バッファの更新必要性があると判定されると、バッファが更新される(ステップS106)。更新アルゴリズムは例えばFIFO(First In First Out)とする。
Note that the failure of calibration means that an offset update request is generated and magnetic data accumulation is started, and as a result that the offset cannot be obtained from the accumulated magnetic data, it is accumulated until then. It means to discard all magnetic data.
If it is determined that there is a need to update the buffer, the buffer is updated (step S106). The update algorithm is, for example, FIFO (First In First Out).

2−2.1点目の選抜候補仮決定
図1は、オフセット設定の処理の流れを示すフローチャートである。図1に示す処理は、オフセットの更新要求が発生したときにCPU40がオフセット設定モジュール94を実行することによって進行する。尚、オフセット設定モジュール94の実行によって以下に述べる処理が進行している時には、バッファ管理モジュール92による処理がマルチタスク環境で並行して進行している。
FIG. 1 is a flowchart showing a flow of offset setting processing. The processing shown in FIG. 1 proceeds when the CPU 40 executes the offset setting module 94 when an offset update request is generated. When the processing described below is progressing by executing the offset setting module 94, the processing by the buffer management module 92 is proceeding in parallel in the multitasking environment.

ステップS200では、選抜候補が全て破棄される初期化が実行される。具体的には、オフセット設定モジュール94によって宣言される、選抜候補を格納するための4つのデータ構造体p0、p1、p2、p3がリセットされるとともに、バッファも初期化される。データ構造体p0、p1、p2、p3には、追って説明があるように、4点目までが選抜されてオフセットが設定されるまで、選抜候補としての磁気データが格納される。それぞれのデータ構造体p0、p1、p2、p3は、磁気データの3成分を格納するための3つの変数からなる配列である。 In step S200, initialization for discarding all selection candidates is executed. Specifically, the four data structures p 0 , p 1 , p 2 and p 3 for storing selection candidates declared by the offset setting module 94 are reset and the buffer is also initialized. The data structures p 0 , p 1 , p 2 , and p 3 store magnetic data as selection candidates until the fourth point is selected and an offset is set, as will be described later. Each data structure p 0 , p 1 , p 2 , p 3 is an array of three variables for storing three components of magnetic data.

ステップS202では、前述したバッファの更新が待たれる。
バッファが更新されると、1点目の選抜候補が仮決定される(ステップS204)。すなわち、バッファ初期化(ステップS200)後に最初に入力された磁気データが1点目の選抜候補となる。1点目の選抜候補はデータ構造体p0に格納される。尚、1点目の選抜候補が格納されるデータ構造体p0は、追って説明があるように更新される可能性があるため、この処理では1点目の選抜候補が仮決定されているに過ぎない。
In step S202, the above-described buffer update is awaited.
When the buffer is updated, the first selection candidate is provisionally determined (step S204). That is, the magnetic data input first after the buffer initialization (step S200) is the first selection candidate. The first selection candidate is stored in the data structure p 0 . Since the data structure p 0 in which the first selection candidate is stored may be updated as described later, the first selection candidate is provisionally determined in this process. Not too much.

2−3.2点目の選抜候補仮決定
ステップS206では、再びバッファの更新が待たれる。
バッファが再び更新されると、2点目の選抜候補が仮決定される。すなわち、バッファ初期化(ステップS200)後に2番目に入力された磁気データが2点目の選抜候補となる。2点目の選抜候補はデータ構造体p1に格納される。尚、2点目の選抜候補が格納されるデータ構造体p1も、追って説明があるように更新される可能性があるため、この処理では2点目の選抜候補が仮決定されているに過ぎない。
2-3. Temporary Selection Candidate Selection for Second Point In step S206, buffer update is awaited again.
When the buffer is updated again, the second selection candidate is provisionally determined. That is, the second input magnetic data after buffer initialization (step S200) becomes the second selection candidate. The second selection candidate is stored in the data structure p 1 . Since the data structure p 1 in which the second selection candidate is stored may be updated as described later, the second selection candidate is temporarily determined in this process. Not too much.

2−4.3点目までの選抜
・3点の更新
ステップS210ではリセットカウンタがリセットされる。リセットカウンタは予め決められたカウント回数でカウントアップするように設定される。このリセットカウンタは、2点目の選抜候補の仮決定後に3点目の選抜候補が決定されずに、いつまでもオフセットの算出が完了しない問題が発生することを未然に防ぐために用いられている。具体的には、2点目の選抜候補の仮決定直後に携帯型電話機3が存在している磁界が激変したにもかかわらず、2点目までの選抜候補が更新されない場合には、3点目の選抜候補が決定されない可能性がある。後述するように選抜候補の3点を通る円の大きさが一定範囲内に収まっていて且つ3点を頂点とする三角形が所定条件を満たさない限り、3点目の選抜候補が決定されることがないにも関わらず、磁界の強さが激変すればそれらの条件が満たされないからである。
2-4.3 Selection up to the third point-Update of the three points In step S210, the reset counter is reset. The reset counter is set to count up at a predetermined count. This reset counter is used in order to prevent the occurrence of a problem that the calculation of the offset is not completed indefinitely without the third selection candidate being determined after the second selection candidate is provisionally determined. Specifically, if the magnetic field in which the mobile phone 3 exists immediately after the provisional determination of the second selection candidate is changed drastically, the selection candidates up to the second point are not updated. There is a possibility that the selection candidate of the eyes is not determined. As will be described later, the third selection candidate is determined unless the size of the circle passing through the three selection candidates falls within a certain range and the triangle having the three points as vertices does not satisfy the predetermined condition. This is because these conditions are not satisfied if the strength of the magnetic field changes drastically.

ステップS212及びステップS214では、新たな磁気データの入力があるとリセットカウンタがインクリメントされる。すなわち、2点目の選抜候補がステップS208で最初に仮決定された後に入力される磁気データの個数がカウントされる。
ステップS216では、再びバッファの更新が待たれる。
バッファが再び更新されると、ステップS218では、3点選抜条件によって選抜される候補として保持するため、最後に入力されバッファに最後に格納された磁気データを、現に存在している3点目までの選抜候補のいずれを更新して保持するべきかが決定される(尚、3点選抜条件を用いた選抜が実行されていなければ、2点目までの選抜候補が存在しているだけであるが、実行される処理内容は同じである)。すなわち、最後に入力されバッファに最後に格納された磁気データがいずれのデータ構造体p0、p1、p2に格納されるかが決定される。なぜならば、データ構造体p0、p1、p2は意味づけが次のように異なるデータ構造体だからである。
In steps S212 and S214, the reset counter is incremented when new magnetic data is input. That is, the number of magnetic data input after the second selection candidate is provisionally determined in step S208 for the first time is counted.
In step S216, buffer update is awaited again.
When the buffer is updated again, in step S218, it is held as a candidate to be selected according to the three-point selection condition, so that the magnetic data last input and stored last in the buffer is up to the third existing point. It is determined which of the selection candidates should be updated and retained (if selection using the three-point selection condition has not been executed, only selection candidates up to the second point exist) However, the processing content to be executed is the same). That is, it is determined in which data structure p 0 , p 1 , p 2 the magnetic data last input and stored last in the buffer is stored. This is because the data structures p 0 , p 1 , and p 2 have different meanings as follows.

データ構造体p0、p1、p2に格納される磁気データを成分とする3点は、それらが同一直線上にない限りにおいて、それらを通る円弧を一義的に規定する。データ構造体p0、p1はその円弧の両端の点の成分である磁気データを格納するデータ構造体として意味づけされている。データ構造体p2はその円弧の中間点の成分である磁気データを格納するデータ構造体として意味づけされている。したがって、3点目が選抜されるまで、3点目までの選抜候補を保持するために、最後に入力されバッファに最後に格納された磁気データがいずれのデータ構造体p0、p1、p2に格納されるかが決定されなければならない。 The three points whose components are magnetic data stored in the data structures p 0 , p 1 , and p 2 uniquely define an arc passing through them as long as they are not on the same straight line. The data structures p 0 and p 1 are meant as data structures that store magnetic data that are components of points at both ends of the arc. The data structure p 2 is meant as a data structure that stores magnetic data that is a component at the midpoint of the arc. Therefore, until the third point is selected, in order to hold the selection candidates up to the third point, the magnetic data last input and stored last in the buffer is any data structure p 0 , p 1 , p Whether it is stored in 2 must be determined.

ところで、データ構造体p0、p1、p2に対して意味づけがこのようにされているのは、次の理由による。選抜候補である3点は、選抜候補の4点を通る方位球の球面上に位置することになる。前述したとおり、方位球を求めるために用いられる4点が、それらの4点を通る球面上で広い範囲に満遍なく分散しているほど、オフセットの誤差は小さくなる。したがって、選抜候補である3点を通る円弧の弦の長さがある程度までは長いほど、オフセットの誤差は小さくなり、その弦の長さが短すぎるとオフセットの誤差が大きくなる。このため、選抜候補である3点を通る円弧の弦の長さがある程度までは長くなるように、磁気データがバッファに格納される度に、3点目までの選抜候補を更新することが望ましい。 By the way, the reason why the meaning is given to the data structures p 0 , p 1 and p 2 is as follows. The three selection candidates are located on the spherical surface of an azimuth sphere that passes through the four selection candidates. As described above, the offset error becomes smaller as the four points used for obtaining the azimuth sphere are evenly distributed over a wide range on the spherical surface passing through these four points. Accordingly, the longer the chord length of the arc passing through the three selection candidates is, the smaller the offset error becomes. If the chord length is too short, the offset error becomes larger. For this reason, it is desirable to update the selection candidates up to the third point each time the magnetic data is stored in the buffer so that the chord length of the arc passing through the three points that are selection candidates is increased to some extent. .

図8は選抜候補の3点の更新を説明するための模式図である。今、データ構造体p0、p1、p2に図8(B)に示す磁気データが格納されているものとする。(図8に示す1、4、5、6の各数字は、バッファへの格納順を管理するための数字であって、その数字でバッファ内で管理されている磁気データが各データ構造体に格納されていることを意味している。ここでは各数字で管理されている磁気データを磁気データ1、磁気データ4、磁気データ5、磁気データ6ということにする。)この状態では、選抜候補の3点を通る円弧の弦は、磁気データ1を成分とする点と磁気データ5を成分とする点とを結ぶ線分(破線)である。次に、磁気データ6がバッファに格納されたとする。このとき、3つの磁気データを成分とする3点が通る円弧の弦は、p0、p1、p2の定義によれば、p1に格納されている磁気データを成分とする点とp0に格納されている磁気データを成分とする点との距離として算出される。したがって、仮に、磁気データ6を成分とする点の、磁気データ1、4、5を成分とする3点とに対する位置関係が図8(A)に示す状態だとすれば、p0に格納されている選抜候補を更新しなければ、円弧の弦が長くなったという計算結果は得られない。また仮に、磁気データ6が円弧の弦を長くしない値である場合には、p2に格納されている選抜候補を更新しなければ、計算結果としては円弧の弦は短くなるため、p2に格納されている選抜候補を更新する必要がある。 FIG. 8 is a schematic diagram for explaining the update of three selection candidates. Now, it is assumed that the magnetic data shown in FIG. 8B is stored in the data structures p 0 , p 1 and p 2 . (The numbers 1, 4, 5, and 6 shown in FIG. 8 are numbers for managing the storage order in the buffer, and the magnetic data managed in the buffer by that number is stored in each data structure. Here, the magnetic data managed by each number is referred to as magnetic data 1, magnetic data 4, magnetic data 5, and magnetic data 6.) In this state, selection candidates The arc chord passing through the three points is a line segment (broken line) connecting a point having the magnetic data 1 as a component and a point having the magnetic data 5 as a component. Next, it is assumed that the magnetic data 6 is stored in the buffer. At this time, an arc chord through which three points having three magnetic data components pass is defined as p 0 , p 1 , and p 2 , and a point having the magnetic data stored in p 1 as a component and p It is calculated as a distance from a point having magnetic data stored in 0 as a component. Therefore, if the positional relationship between the point having the magnetic data 6 as a component and the three points having the magnetic data 1, 4, 5 as the component is in the state shown in FIG. 8A, it is stored in p 0. If the selected candidate is not updated, the calculation result that the chord of the arc has become long cannot be obtained. Also if, when the magnetic data 6 has a value which does not lengthen the arc chord, unless update the selection candidate stored in the p 2, to become shorter arc strings as the calculation result, the p 2 The stored selection candidates need to be updated.

3つの磁気データを成分とする3点が通る円弧の弦が更新毎に少なくとも短くならず最も効率よく伸張される条件は、次のように導かれる。バッファに最後に格納された磁気データをqとする。p0、p1、p2は、ここでは各データ構造体に格納されている磁気データとする。図9では、q、p0、p1、p2を成分とする点が黒丸で表され、それらの4点を通る方位球が実線で表され、p0、p1を通り線分p01に垂直な2つの面S0及びS1が破線で表されている。qによって、選抜候補である3点を通る円弧の弦が長くなる範囲は、面S0及びS1に挟まれ線分p01によって貫かれている空間の外側にqを成分とする点があるときである。このとき、次式(3)、(4)が成立する。

Figure 0005035448
A condition that the chord of the circular arc through which three points having three magnetic data components pass is updated at least efficiently without being shortened at each update is derived as follows. Let q be the last magnetic data stored in the buffer. Here, p 0 , p 1 , and p 2 are magnetic data stored in each data structure. In FIG. 9, points having q, p 0 , p 1 , and p 2 as components are represented by black circles, an azimuth sphere passing through these four points is represented by a solid line, passes through p 0 and p 1, and a line segment p 0. Two planes S 0 and S 1 perpendicular to p 1 are represented by broken lines. The range in which the chord of the arc passing through the three points that are candidates for selection becomes longer by q is a point having q as the component outside the space sandwiched between the planes S 0 and S 1 and penetrated by the line segment p 0 p 1 . When there is. At this time, the following expressions (3) and (4) hold.
Figure 0005035448

式(3)が成り立つ場合、p2をp1に更新し、新たにp1をqで更新することによって弦を延長することができる。式(4)が成り立つ場合、p2をp0に更新し、新たにp0をqで更新することによって弦を延長することができる。これらの何れでもない場合、p2をqで更新するが、弦は延長されない。 If equation (3) holds, the string can be extended by updating p 2 to p 1 and newly updating p 1 with q. If equation (4) holds, the string can be extended by updating p 2 to p 0 and newly updating p 0 with q. If neither of these, updating p 2 with q, but the strings are not extended.

ステップS220では、上記のようにして決定された、更新すべき選抜候補が、バッファに最後に格納された磁気データで更新される。その結果、例えば図8(B)に示す磁気データが格納されていたデータ構造体p0、p1、p2は、図8(C)に示すように更新される。このとき、選抜候補であった3点を通る円は、その円を含む平面に交わる平面に含まれる新たな円に更新される。またこの処理によって選抜候補であった3点を通る円の面積は大きくなる傾向がある。 In step S220, the selection candidate to be updated, determined as described above, is updated with the magnetic data stored last in the buffer. As a result, for example, the data structures p 0 , p 1 , and p 2 storing the magnetic data shown in FIG. 8B are updated as shown in FIG. 8C. At this time, the circle passing through the three points that are selection candidates is updated to a new circle included in the plane intersecting the plane including the circle. Also, this process tends to increase the area of a circle passing through the three points that were candidates for selection.

・3点選抜条件
ステップS222では、3つの選抜候補である磁気データが3点選抜条件の1つを満たしているかが判定される。3点の選抜条件は2つの観点から導かれている。第一の観点は、選抜候補である磁気データを成分とする3点がそれら3点を通る円周上で十分ばらついているか、すなわち、それら3点を頂点とする三角形が正三角形に近くなっているか、という観点である。したがって、第一の観点での選抜が実行されるときには、選抜候補である磁気データを成分とする3点を頂点とする三角形の正三角形に対する歪みが算定される。第二の観点は、選抜候補である磁気データを成分とする3点を通る円の面積が十分大きいか、という観点である。この3点を通る円の面積が小さいときは、これらの3点を通る方位球の球面上で3点が狭い範囲に分布しているか、正確なオフセットを算出するに当たって想定外の磁界が測定されていることになる。またこれらの3点を通る円の面積が大きすぎるときは、正確なオフセットを算出するに当たって想定外の磁界が測定されていることになる。したがって、第二の観点で選抜が実行されるときには、選抜候補である磁気データを成分とする3点を通る円の半径が算定される。尚、以下の説明では、第一の観点で選抜候補が選抜されるべきかを判定するための条件を単に3点選抜条件ともいい、第二の観点で選抜候補が選抜されるべきかを判定することを、3点選抜の検証ともいうものとする。
Three-point selection condition In step S222, it is determined whether the magnetic data that is the three selection candidates satisfies one of the three-point selection conditions. The three selection conditions are derived from two viewpoints. The first point of view is that the three points whose components are magnetic data that are candidates for selection are sufficiently dispersed on the circumference passing through these three points, that is, the triangle having the three points as vertices is close to an equilateral triangle. This is the point of view. Therefore, when selection from the first viewpoint is executed, the distortion with respect to a regular triangle of three points having apexes of magnetic data as selection candidates as components is calculated. The second point of view is whether the area of a circle passing through the three points whose components are magnetic data that are selection candidates is sufficiently large. When the area of the circle passing through these three points is small, an unexpected magnetic field is measured when calculating the exact offset or whether the three points are distributed in a narrow range on the spherical surface of the azimuth sphere passing through these three points. Will be. If the area of the circle passing through these three points is too large, an unexpected magnetic field is measured in calculating an accurate offset. Therefore, when selection is performed from the second viewpoint, the radius of a circle passing through three points whose components are magnetic data that are selection candidates is calculated. In the following description, the condition for determining whether a selection candidate should be selected from the first viewpoint is also simply referred to as a three-point selection condition, and it is determined whether the selection candidate should be selected from the second viewpoint. This is also referred to as verification of 3-point selection.

まず、ステップS222で適用される第一の観点から3点選抜条件を説明する。本実施形態では、図10に示すように選抜候補である磁気データを成分とする3点を頂点とする三角形の正三角形に対する歪みが、その三角形の重心d3を始点とし各頂点を終点とするベクトルの和を用いて表現される3行3列の対称行列の固有値によって評価される。三角形の重心d3は次式(5)によって求められる。

Figure 0005035448
First, the three-point selection condition will be described from the first viewpoint applied in step S222. In this embodiment, as shown in FIG. 10, the distortion with respect to the regular triangle of the triangle having three points as the vertices, the magnetic data of which is a candidate for selection, as the starting point, the centroid d 3 of the triangle as the starting point, and each vertex as the ending point. It is evaluated by the eigenvalues of a 3-by-3 symmetric matrix expressed using the sum of vectors. The center of gravity d 3 of the triangle is obtained by the following equation (5).
Figure 0005035448

第一の観点から導かれる3点選抜条件は、次式(6)によって定義される対称行列Aの固有値λA1、λA2、λA3のうち中間固有値λA2の最大固有値λA1に対する比が予め決められた所定のしきい値E0以上であることである。

Figure 0005035448
The three-point selection condition derived from the first viewpoint is that the ratio of the intermediate eigenvalue λ A2 to the maximum eigenvalue λ A1 among the eigenvalues λ A1 , λ A2 , and λ A3 of the symmetric matrix A defined by the following equation (6) The predetermined threshold value E 0 or more.
Figure 0005035448

式(6)は、pi=(pix,piy,piz),d3=(d3x,d3y,d3z)とすると式(7)のようにも書ける。

Figure 0005035448
ただし、以下の通りである。
Figure 0005035448
Figure 0005035448
Figure 0005035448
Figure 0005035448
Figure 0005035448
Figure 0005035448
Equation (6) can also be written as Equation (7) when pi = (pix, piy, piz), d 3 = (d3x, d3y, d3z).
Figure 0005035448
However, it is as follows.
Figure 0005035448
Figure 0005035448
Figure 0005035448
Figure 0005035448
Figure 0005035448
Figure 0005035448

対称行列Aの定義から、全ての固有値は非負実数である。計算誤差を考慮しなければ最小固有値λA3は0である。第一の観点から導かれた3点選抜条件は、上述したとおり、次式(14)で定義される評価量EAがしきい値E0に対して、EA≧E0を満たすことである。

Figure 0005035448
From the definition of the symmetric matrix A, all eigenvalues are non-negative real numbers. If the calculation error is not taken into consideration, the minimum eigenvalue λ A3 is zero. As described above, the three-point selection condition derived from the first viewpoint is that the evaluation amount E A defined by the following equation (14) satisfies E A ≧ E 0 with respect to the threshold value E 0 . is there.
Figure 0005035448

ところで、選抜候補である磁気データを成分とする3点を頂点とする三角形の正三角形に対する歪みは、その三角形の内角のばらつき、その三角形の辺の長さのばらつき、その三角形の重心から各頂点までの距離のばらつき、などによって定義することができる。さらに、これらのばらつきは、前述した対称行列Aの固有値を用いた評価量EAによって定義することができる。したがって、第一の観点から導かれる3点選抜条件は、選抜候補である磁気データを成分とする3点を頂点とする三角形の内角のばらつき、又は、その三角形の辺の長さのばらつき、又は、その三角形の重心から各頂点までの距離のばらつきが予め決められた所定範囲内にあることであるともいえる。 By the way, the distortion with respect to the regular triangle of the triangle whose vertex is the three points whose magnetic data is the candidate for selection is the variation of the internal angle of the triangle, the variation of the length of the side of the triangle, and the centroid of the triangle. It can be defined by the variation of the distance up to. Further, these variations can be defined by the evaluation amount E A using the eigenvalues of the symmetric matrix A described above. Therefore, the three-point selection condition derived from the first point of view is a variation in the internal angle of a triangle whose apex is the three points whose components are magnetic data as selection candidates, or a variation in the length of the side of the triangle, or It can also be said that the variation in distance from the center of gravity of the triangle to each vertex is within a predetermined range.

第一の観点から導かれた3点選抜条件が満たされなかった場合、リセットカウンタがカウントアップしているかが判定され(ステップS224)、カウントアップしていなければステップS216の処理に戻って、これまで説明した処理を繰り返す。すなわち、最後にバッファに格納された磁気データを新たな選抜候補とするための、データ構造体p0、p1、p2の更新処理が繰り返される。カウントアップしている場合、2点目の選抜候補の仮決定直後に携帯型電話機3が存在している磁界が激変しているなどの事情によって、3点目までの選抜がいつまでも完了しない可能性があるため、ステップS200の処理に戻ってバッファ及びデータ構造体p0、p1、p2が全てリセットされる。 If the three-point selection condition derived from the first viewpoint is not satisfied, it is determined whether the reset counter is counting up (step S224), and if not counting up, the process returns to step S216, Repeat the process described above. That is, the update process of the data structures p 0 , p 1 , and p 2 for making the magnetic data finally stored in the buffer as a new selection candidate is repeated. When counting up, the selection up to the third point may not be completed indefinitely due to a sudden change in the magnetic field in which the mobile phone 3 exists immediately after the temporary selection of the second selection candidate Therefore, returning to the process of step S200, the buffers and the data structures p 0 , p 1 and p 2 are all reset.

・選抜検証
第一の観点から導かれた3点選抜条件が満たされた場合、第一の観点で選抜された磁気データが第二の観点によって検証される(ステップS226)。この処理では、前述したとおり、選抜候補である磁気データを成分とする3点を通る円の半径が算定される。そのような半径を算定する様々な方法が知られているが、本実施形態では、全体の計算量を低減し、処理を高速化するため、対称行列Aの固有ベクトルを用いた方法が採用される。この方法を採用し、かつ対称行列Aの前述の固有値を算定する手法としてヤコビ法を採用すれば、全体の計算量が低減される。以下、具体的に説明する。
行列Aの固有ベクトルを基底とする座標系でp0、p1、p2を書き直すと、最小固有値λA3に対する固有ベクトルlA3の成分については各点について一定の値をとるので、ともに大きさ1で正規化された最大固有値λA1に対する固有ベクトルlA1及び中間固有値λA2に対する固有ベクトルlA2の成分のみに着目し、各点を2次元空間上の3点とみなせば、連立一次方程式により円の方程式を求めることができる。さらに具体的に説明する。
Selection Verification When the three-point selection condition derived from the first viewpoint is satisfied, the magnetic data selected from the first viewpoint is verified from the second viewpoint (step S226). In this process, as described above, the radius of a circle passing through three points whose components are magnetic data that are selection candidates is calculated. Various methods for calculating such a radius are known. In this embodiment, a method using the eigenvectors of the symmetric matrix A is adopted in order to reduce the overall calculation amount and speed up the processing. . If this method is employed and the Jacobian method is employed as a method for calculating the above eigenvalues of the symmetric matrix A, the total amount of calculation is reduced. This will be specifically described below.
When p 0 , p 1 , and p 2 are rewritten in the coordinate system based on the eigenvector of the matrix A, the component of the eigenvector l A3 with respect to the minimum eigenvalue λ A3 takes a constant value for each point. focusing only on the components of the eigenvector l A2 for eigenvector l A1 and the intermediate eigenvalue lambda A2 with respect to the maximum eigenvalue lambda A1 normalized, is regarded each point and three points on the two-dimensional space, the equation of the circle by simultaneous linear equations Can be sought. This will be described more specifically.

まず行列Lを次式(15)で定義する。行列Lは、ヤコビ法を用いて対称行列Aの前述の固有値を算定する過程で求まる。

Figure 0005035448
First, the matrix L is defined by the following equation (15). The matrix L is obtained in the process of calculating the above eigenvalues of the symmetric matrix A using the Jacobian method.
Figure 0005035448

点pi(0≦i≦2)に対し、次式(16)の一次変換を行い、p'iの第三成分を無視し、第一成分及び第二成分だけを用いればよい。

Figure 0005035448
For the point p i (0 ≦ i ≦ 2), the linear transformation of the following equation (16) is performed, the third component of p ′ i is ignored, and only the first component and the second component are used.
Figure 0005035448

したがって、次式(17)が導かれるが、右辺第三項は無視できるため、2次元空間内の3点p"0 = ( p'01 ,p'02 ), p"1 = ( p'11, p'12 ), p"2 = ( p'21, p'22 )を通る円を求めることに帰結される。

Figure 0005035448
Thus, although the following equation (17) is derived, for the right side third term can be ignored, 3 points in two-dimensional space p "0 = (p '01 , p' 02), p" 1 = (p '11 , p is resulting in '12), p "2 = (p' 21, p '22) to determine the circle passing through.
Figure 0005035448

円の中心点をc"3 = ( c'31, c'32 ) とすると、中心点を求める連立一次方程式は次式(18)である。

Figure 0005035448
When the center point of the circle c "3 = (c '31 , c' 32) and is, simultaneous linear equations for obtaining the center point is the following equation (18).
Figure 0005035448

c'3rは特に後に用いる必要のない値であるが、3元1次連立方程式を立てるために追加されている。最終的に半径r3は、次式(19)で算定されるc'3とp'0とのユークリッド距離として求まる。

Figure 0005035448
c ′ 3r is a value that does not need to be used in particular, but is added to establish a ternary linear simultaneous equation. The radius r 3 is finally obtained as the Euclidean distance between c ′ 3 and p ′ 0 calculated by the following equation (19).
Figure 0005035448

以上のようにして求められた、三点選抜条件を満たす3つの磁気データを成分とする3点を通る円の半径がしきい値rmaxからrminまでの範囲内であれば、合格とする。そうでない場合、不合格となってステップS200の処理に戻り、バッファ及びデータ構造体p0、p1、p2がリセットされる。 If the radius of the circle passing through the three points, whose components are the three magnetic data satisfying the three-point selection condition, determined as described above is within the range from the threshold value r max to r min , the test is accepted. . Otherwise, it fails and returns to the process of step S200, and the buffers and data structures p 0 , p 1 , p 2 are reset.

2−5.4点目の選抜
・概要
以上の処理によって3点目までが選抜された時点では、最終的に求まる方位円の十分に大きな断面円の円周上で十分にばらついて位置する3点が選抜されている。それらの3点を含む平面上にない1点を成分とする磁気データを用いてそれらの4点を通る球面の方程式を求めることはできる。しかし、4点目が無作為に選ばれたのでは、オフセットの誤差は小さくならない。そこで本実施形態では、オフセットの誤差を低減するために、複数の4点目の選抜候補に対して、最適な4点目の選抜が試行される。すなわち、バッファに格納されている磁気データを全て4点目の選抜候補とした選抜が試行される。バッファに空きが残っている場合には、全ての空きが埋まるまで4点目の選抜は実行されない(ステップS228)。4点目が選抜されるとき、図11に示されるように、3点目までの選抜候補としては決定されなかった磁気データ(仮決定されたがその後に棄却されたものも含まれる。)が、4点目の選抜候補として順次選抜にかけられる。図11では、バッファで磁気データの入力順を管理するための識別子が1〜qmaxまでの数字で示されている。小さい数字ほど、先に入力された磁気データが格納されるデータ構造体を表している。
2-5.4 Selection of the fourth point ・ Outline When the third point is selected by the above processing, the point is sufficiently scattered on the circumference of a sufficiently large cross-sectional circle of the azimuth circle finally obtained 3 A point is selected. Using the magnetic data whose component is one point that is not on the plane including those three points, an equation of a sphere passing through these four points can be obtained. However, if the fourth point is randomly selected, the offset error will not be reduced. Therefore, in the present embodiment, in order to reduce the error of the offset, the optimum fourth point selection is tried for a plurality of fourth point selection candidates. That is, selection is attempted using all the magnetic data stored in the buffer as fourth selection candidates. If there is an empty space in the buffer, the fourth selection is not executed until all the empty spaces are filled (step S228). When the fourth point is selected, as shown in FIG. 11, magnetic data that is not determined as a selection candidate up to the third point (including those temporarily determined but rejected thereafter) is included. Sequential selection is made as the fourth selection candidate. In FIG. 11, identifiers for managing the input order of magnetic data in the buffer are indicated by numbers from 1 to q max . A smaller number represents a data structure in which previously inputted magnetic data is stored.

・4点選抜条件
ステップS230では、既に選抜された3点を成分とする磁気データに対して、バッファに格納されている全ての磁気データが1つづつ順次組み合わせられ、4つの磁気データが4点選抜条件を満たしているかが順次判定され、バッファに格納されている磁気データのうちで4点選抜条件を満たすもののうち、最も評価が高い1つが4点目として選抜される。4点選抜条件は、選抜候補である磁気データを成分とする4点がそれら4点を通る球面上で十分ばらついているか、すなわち、図12に示したそれら4点を頂点とする四面体が正四面体に近くなっているか、という観点で4点目を選抜する条件である。したがって、選抜候補である磁気データを成分とする4点を頂点とする四面体の正四面体に対する歪みが算定される。四面体の正四面体に対する歪みは、その四面体の各頂点の立体角のばらつき、その四面体の面の面積のばらつき、その四面体の重心から各頂点までの距離のばらつき、などによって定義することができる。これらのばらつきは、その四面体の重心d4を始点とし各頂点を終点とするベクトルの和を用いて表現される3行3列の対称行列Bの固有値によって評価される。四面体の重心d4は次式(20)によって求められる。

Figure 0005035448
-Four-point selection condition In step S230, all magnetic data stored in the buffer are sequentially combined one by one with the magnetic data having the three selected points as components, and four magnetic data are obtained in four points. It is sequentially determined whether the selection condition is satisfied, and one of the magnetic data stored in the buffer that satisfies the four-point selection condition is selected as the fourth highest one. The four-point selection condition is that the four points whose components are magnetic data that are candidates for selection are sufficiently dispersed on the spherical surface passing through these four points, that is, the tetrahedron having the four points shown in FIG. This is a condition for selecting the fourth point from the viewpoint of whether it is close to a tetrahedron. Therefore, the distortion of a tetrahedron with four points as vertices having magnetic data as a selection candidate as a component is calculated. The distortion of a tetrahedron to a regular tetrahedron is defined by the variation in solid angle of each vertex of the tetrahedron, the variation in the area of the surface of the tetrahedron, the variation in the distance from the center of gravity of the tetrahedron to each vertex, etc. be able to. These variations are evaluated by the eigenvalues of the symmetric matrix B of 3 rows and 3 columns expressed using the sum of vectors having the center of gravity d 4 of the tetrahedron as the starting point and each vertex as the ending point. The center of gravity d 4 of the tetrahedron is obtained by the following equation (20).
Figure 0005035448

対称行列Bは次式で定義される。

Figure 0005035448
The symmetric matrix B is defined by the following equation.
Figure 0005035448

対称行列Bの最大固有値λB3に対する最小固有値λB1の比が大きいほど、四面体の正四面体に対する歪みが小さい、すなわち、その四面体の各頂点の立体角のばらつき、その四面体の面の面積のばらつき、その四面体の重心から各頂点までの距離のばらつきのいずれも小さいといえる。したがって、4点選抜条件は、次式(22)によって求まるEB1が最大になることである。

Figure 0005035448
The larger the ratio of the minimum eigenvalue λ B1 to the maximum eigenvalue λ B3 of the symmetric matrix B, the smaller the distortion of the tetrahedron with respect to the regular tetrahedron, that is, the variation in solid angle of each vertex of the tetrahedron, the surface of the tetrahedron It can be said that both the variation in area and the variation in the distance from the center of gravity of the tetrahedron to each vertex are small. Therefore, the 4-point selection condition is that E B1 obtained by the following equation (22) is maximized.
Figure 0005035448

バッファに格納されている全ての磁気データについてEB1が算出され、その最大値が確定した時点で、EB1が最大になる4点目の磁気データが最終的な選抜候補としてデータ構造体p3に格納される。このようにして確定した最終的な4点目までの選抜候補である磁気データが格納されているp0、p1、p2、p3について、さらに別の評価量EB2が次式(23)によって求められる。

Figure 0005035448
E B1 is calculated for all the magnetic data stored in the buffer, and when the maximum value is determined, the fourth magnetic data that maximizes E B1 is the data structure p 3 as the final selection candidate. Stored in For p 0 , p 1 , p 2 , and p 3 in which magnetic data that are selection candidates up to the final fourth point determined in this way are stored, another evaluation amount E B2 is expressed by the following equation (23 ).
Figure 0005035448

尚、λB2は対称行列Bの中間固有値である。予め決められた所定のしきい値E2、E3に対し、次式(24)が満たされない場合、球面の方程式を求める際に大きな誤差が混入するおそれがあるため、ステップS200の処理に戻ってバッファ及びデータ構造体p0、p1、p2、p3が全てリセットされる。次式(24)が満たされる場合、4点目の選抜候補が最終的に選抜される。

Figure 0005035448
Λ B2 is an intermediate eigenvalue of the symmetric matrix B. If the following equation (24) is not satisfied with respect to the predetermined threshold values E 2 and E 3 determined in advance, there is a possibility that a large error may be mixed when obtaining the spherical equation, so the process returns to step S200. All the buffers and data structures p 0 , p 1 , p 2 , p 3 are reset. When the following equation (24) is satisfied, the fourth selection candidate is finally selected.
Figure 0005035448

ただし、2つのしきい値の1通りの組み合わせを用いて4点目の選抜が行われるよりも、2つのしきい値の組み合わせを2組以上設定し、次式(25)が全てのiに対して成り立たないときにバッファ及びデータ構造体p0、p1、p2、p3が全てリセットされる方が、キャリブレーションの失敗回数を減らすという観点で合理的である。

Figure 0005035448
However, rather than selecting the fourth point using one combination of two threshold values, two or more combinations of two threshold values are set, and the following equation (25) is set for all i On the other hand, when the buffer and the data structures p 0 , p 1 , p 2 , and p 3 are all reset when it does not hold, it is more reasonable from the viewpoint of reducing the number of calibration failures.
Figure 0005035448

・方位球の算出
以上の処理によって4点目までの磁気データが選抜されると、すなわち、p0、p1、p2、p3が確定すると、方位球の中心点及び半径が求められる(ステップS232)。方位球の中心点c4=(c4x、c4y、c4z)は次式によって求められる。c4rは特に後に用いられない値であるが、4元1次連立方程式を立てるために追加されている。

Figure 0005035448
Calculation of azimuth sphere When magnetic data up to the fourth point are selected by the above processing, that is, when p 0 , p 1 , p 2 , and p 3 are determined, the center point and radius of the azimuth sphere are obtained ( Step S232). The center point c 4 = (c 4x , c 4y , c 4z ) of the azimuth sphere is obtained by the following equation. c 4r is a value that is not particularly used later, but is added to establish a quaternary linear simultaneous equation.
Figure 0005035448

方位球の半径rは、c4とp0とのユークリッド距離として次式(27)によって求められる。

Figure 0005035448
The radius r of the azimuth sphere is obtained by the following equation (27) as the Euclidean distance between c 4 and p 0 .
Figure 0005035448

・方位球の検証
ステップS234では、算出された方位球の妥当性が検証される。方位球の半径が予め決められた所定の範囲内にない場合、算出された方位球の中心点はオフセットとして採用されず、ステップS200の処理に戻ってバッファ及びデータ構造体p0、p1、p2、p3が全てリセットされる。
-Verification of bearing ball In step S234, the validity of the calculated bearing ball is verified. If the radius of the azimuth sphere is not within a predetermined range, the calculated center point of the azimuth sphere is not adopted as an offset, and the process returns to step S200 to return to the buffer and data structures p 0 , p 1 , p 2 and p 3 are all reset.

本実施形態では、選抜された4つの磁気データだけではなく、さらにバッファに格納されている一部又は全部の磁気データを用いて方位球の妥当性が統計処理によって検証される。この検証は、オフセットの誤差のばらつきを小さくするためにはある程度有効であるが、必ずしも必要な処理ではない。この検証では、次式(28)によって評価量Sが求められ、予め決められた所定のしきい値Stに対し、S>Stである場合には、算出された方位球の中心点はオフセットとして採用されず、ステップS200の処理に戻ってバッファ及びデータ構造体p0、p1、p2、p3が全てリセットされる。そうでない場合には、次のようにオフセットが設定される。

Figure 0005035448
In the present embodiment, the validity of the azimuth sphere is verified by statistical processing using not only the selected four magnetic data but also a part or all of the magnetic data stored in the buffer. This verification is effective to some extent in order to reduce the variation in offset error, but is not necessarily a necessary process. In this verification, prompted evaluation amount S by the following equation (28), for a given threshold S t which is determined in advance, in the case of S> S t is the center point of the calculated orientation sphere The buffer and data structures p 0 , p 1 , p 2 , and p 3 are all reset without returning to the process of step S200. Otherwise, the offset is set as follows:
Figure 0005035448

・オフセットの設定
算出された方位球が妥当であった場合、ステップS236においてオフセットが設定される。すなわち、算出された方位球の中心点の各成分がオフセットの各成分として設定される。
-Offset setting When the calculated azimuth is valid, an offset is set in step S236. That is, each component of the calculated center point of the azimuth sphere is set as each component of the offset.

1:磁気センサ制御装置、4:3次元磁気センサ、90:磁気センサ制御プログラム、92:バッファ管理モジュール(入力手段)、94:オフセット設定モジュール(選抜手段、算出手段、設定手段) 1: magnetic sensor control device, 4: three-dimensional magnetic sensor, 90: magnetic sensor control program, 92: buffer management module (input means), 94: offset setting module (selection means, calculation means, setting means)

Claims (5)

3次元磁気センサから順次出力される、3成分を有する複数の磁気データを入力する入力手段と、
入力された複数の前記磁気データから、予め決められた4点選抜条件を満たす4つの前記磁気データを選抜する選抜手段と、
選抜された4つの前記磁気データを成分とする4点から等距離にある点である中心点を算出する算出手段と、
前記中心点の成分を前記磁気データのオフセットとして設定する設定手段と、
を備え、
前記4点選抜条件は、選抜候補の4つの前記磁気データを成分とする4点を頂点とする四面体の正四面体に対する歪みに相関する条件を含む、
磁気センサ制御装置。
Input means for inputting a plurality of magnetic data having three components sequentially output from a three-dimensional magnetic sensor;
A selection means for selecting four magnetic data satisfying a predetermined four-point selection condition from the plurality of input magnetic data;
Calculating means for calculating a center point which is a point equidistant from four points having the four selected magnetic data as components;
Setting means for setting the component of the center point as an offset of the magnetic data;
With
The four-point selection condition includes a condition that correlates with a distortion of a tetrahedron having four points as vertices having four magnetic data components as selection candidates.
Magnetic sensor control device.
前記4点選抜条件は、前記四面体の各頂点の立体角のばらつきが予め決められた所定範囲内にあることを含む、
請求項1に記載の磁気センサ制御装置。
The four-point selection condition includes that a variation in solid angle of each vertex of the tetrahedron is within a predetermined range.
The magnetic sensor control apparatus according to claim 1.
前記4点選抜条件は、前記四面体の各面の面積のばらつきが予め決められた所定範囲内にあることを含む、
請求項1に記載の磁気センサ制御装置。
The four-point selection condition includes that the variation of the area of each surface of the tetrahedron is within a predetermined range determined in advance.
The magnetic sensor control apparatus according to claim 1.
前記4点選抜条件は、前記四面体の重心から各頂点までの距離のばらつきが予め決められた所定範囲内にあることを含む、
請求項1に記載の磁気センサ制御装置。

The four-point selection condition includes that a variation in distance from the center of gravity of the tetrahedron to each vertex is within a predetermined range.
The magnetic sensor control apparatus according to claim 1.

前記4点選抜条件は、下記の3行3列の対称行列Bの各固有値のいずれか2組のそれぞれの比がそれぞれ予め決められた所定値より大きいことを含む、
請求項1〜4のいずれか一項に記載の磁気センサ制御装置。
Figure 0005035448
ただし、
i(i=0,1,2)は前記四面体の各頂点であり、d4は前記四面体の重心である。
The four-point selection condition includes that the ratio of each two sets of eigenvalues of the following 3 × 3 symmetric matrix B is larger than a predetermined value.
The magnetic sensor control apparatus as described in any one of Claims 1-4.
Figure 0005035448
However,
p i (i = 0, 1, 2) is each vertex of the tetrahedron, and d 4 is the center of gravity of the tetrahedron.
JP2011112959A 2011-05-20 2011-05-20 Magnetic sensor control apparatus and method Expired - Fee Related JP5035448B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011112959A JP5035448B2 (en) 2011-05-20 2011-05-20 Magnetic sensor control apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011112959A JP5035448B2 (en) 2011-05-20 2011-05-20 Magnetic sensor control apparatus and method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2005296610A Division JP4830441B2 (en) 2005-10-11 2005-10-11 Magnetic sensor control device, method and program

Publications (2)

Publication Number Publication Date
JP2011164115A JP2011164115A (en) 2011-08-25
JP5035448B2 true JP5035448B2 (en) 2012-09-26

Family

ID=44594927

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011112959A Expired - Fee Related JP5035448B2 (en) 2011-05-20 2011-05-20 Magnetic sensor control apparatus and method

Country Status (1)

Country Link
JP (1) JP5035448B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2568254A3 (en) * 2011-09-07 2015-02-18 Yamaha Corporation Soft iron effect offset correction in geomagnetism measurement apparatus

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005207799A (en) * 2004-01-21 2005-08-04 Nec Tokin Corp Stereoscopic image display system and stereoscopic navigation system
JP4448957B2 (en) * 2004-03-04 2010-04-14 旭化成エレクトロニクス株式会社 Magnetic measuring device and magnetic measuring method
JP2005265414A (en) * 2004-03-16 2005-09-29 Citizen Watch Co Ltd Electronic azimuth meter and recording medium
EP1793200A4 (en) * 2004-07-23 2012-01-04 Yamaha Corp Direction processor, direction processing method, direction processing program, direction measuring instrument, inclination offset correcting method, direction measuring method, direction sensor unit and portable electronic device
WO2006011238A1 (en) * 2004-07-29 2006-02-02 Yamaha Corporation Azimuth data arithmetic method, azimuth sensor unit, and mobile electronic device
EP1795864A4 (en) * 2004-09-29 2011-11-02 Amosense Co Ltd Magnetic sensor control method, magnetic sensor controller and portable terminal device
JP2006275524A (en) * 2005-03-28 2006-10-12 Citizen Watch Co Ltd Electronic azimuth meter and recording medium

Also Published As

Publication number Publication date
JP2011164115A (en) 2011-08-25

Similar Documents

Publication Publication Date Title
JP4830441B2 (en) Magnetic sensor control device, method and program
JP5040103B2 (en) Magnetic sensor control device, method and program
KR100837472B1 (en) Magnetic sensor control device
JP4844179B2 (en) Magnetic data processing apparatus, method and program
USRE44582E1 (en) Magnetic data processing device
KR101152095B1 (en) Magnetic data processing device, method, and computer readable storage medium
US20200257987A1 (en) Systems and methods for hybrid quantum-classical computing
JP5067155B2 (en) Magnetic data processing device, navigation device, magnetic data processing method, and magnetic data processing program
CN113808121A (en) Yarn sub-pixel level diameter measurement method and system
JP5035448B2 (en) Magnetic sensor control apparatus and method
JP5375394B2 (en) Magnetic data processing apparatus, magnetic data processing method, and magnetic data processing program
CN110443648B (en) Information delivery method and device, electronic equipment and storage medium
CN116702607A (en) BIM-FEM-based bridge structure digital twin body and method
CN111598941A (en) Method, device and equipment for measuring gradient of tower and storage medium
CN113436272B (en) Spherical refraction correction method for underwater stereoscopic vision system and electronic equipment
TWI406189B (en) Method for constructing triangular grids of point clouds
JP4899506B2 (en) Magnetic sensor control device, magnetic measurement device, offset setting method, and offset setting program
JP5375791B2 (en) Magnetic data processing apparatus, method and program
JP2011180097A (en) Processing unit, method, program for magnetic data, and magnetic measuring device
JP5453969B2 (en) Magnetic data processing apparatus, magnetic data processing method, and magnetic data processing program
JP2011089912A (en) Device, method and program of processing magnetic data
CN117782186A (en) Method and related device for determining optical axis angle precision of unmanned aerial vehicle detector
Dobramysl et al. Triangulation sensing: how cells recover a source from diffusing particles in three dimensions
JP2007327934A (en) Magnetic data processing device, method, and program
TWI320854B (en) Magnetic data processing device, magnetic data processing method, magnetic data processing program product, and magnetic measurement apparatus

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110520

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110520

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120605

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120618

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150713

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees