JP2013088162A - State estimation apparatus - Google Patents

State estimation apparatus Download PDF

Info

Publication number
JP2013088162A
JP2013088162A JP2011226586A JP2011226586A JP2013088162A JP 2013088162 A JP2013088162 A JP 2013088162A JP 2011226586 A JP2011226586 A JP 2011226586A JP 2011226586 A JP2011226586 A JP 2011226586A JP 2013088162 A JP2013088162 A JP 2013088162A
Authority
JP
Japan
Prior art keywords
state
kalman filter
value
vector
state vector
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
JP2011226586A
Other languages
Japanese (ja)
Inventor
Ibuki Handa
伊吹 半田
Hideki Sato
秀樹 佐藤
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 JP2011226586A priority Critical patent/JP2013088162A/en
Publication of JP2013088162A publication Critical patent/JP2013088162A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Navigation (AREA)
  • Geophysics And Detection Of Objects (AREA)
  • Telephone Function (AREA)

Abstract

PROBLEM TO BE SOLVED: To enable the arithmetic operation of a nonlinear Kalman filter at high speed and with a reduced processing load.SOLUTION: A state estimation apparatus 3 comprises: a plurality of sensors including a three-dimensional magnetic sensor 70; a plurality of Kalman filters KF each estimating the state of a system by updating a state vector xby using the state vector xwith a plurality of state parameters representing the state of the system as elements and an observed value vector ywith output values from the plurality of sensors as elements; an initial value generator 200 which generates a plurality of initial vectors INI being different from each other and supplies the initial vectors to the plurality of Kalman filters KF as initial values of the state vector x; and a Kalman filter controller 400 which specifies a Kalman filter having highest estimation accuracy by evaluating the estimation accuracy of each of the plurality of Kalman filters KF and stops operating the other Kalman filters KF than the specified Kalman filter KF.

Description

本発明は、状態推定装置に関する。   The present invention relates to a state estimation device.

地磁気の向きや、物体の姿勢等を算出する場合、地磁気センサからの出力結果のみに基づいて算出するよりも、地磁気センサの他に加速度センサや角速度センサ等の異種の物理量を測定する複数のセンサの出力結果を統合して算出した方が、短時間で正確な値を求めることができる。   When calculating the direction of geomagnetism, the posture of an object, etc., multiple sensors that measure different physical quantities such as acceleration sensors and angular velocity sensors in addition to the geomagnetic sensor, rather than calculating only based on the output result from the geomagnetic sensor If the output results are integrated and calculated, an accurate value can be obtained in a short time.

異種の物理量を測定する複数のセンサの出力を統合し、動的システムの状態を推定する方法として、非線形カルマンフィルタを用いる方法が知られている。例えば、特許文献1には、3軸の角速度センサ及び3軸の加速度センサと非線形カルマンフィルタとを実装した姿勢角計測装置が開示されている。また、非特許文献1には、3軸角速度センサ、3軸加速度センサ、及び3軸地磁気センサからの出力信号を、拡張カルマンフィルタやアンセンテッド変換を用いたシグマポイントカルマンフィルタを用いて統合し、姿勢を推定する方法が開示されている。   A method using a nonlinear Kalman filter is known as a method for estimating the state of a dynamic system by integrating the outputs of a plurality of sensors that measure different physical quantities. For example, Patent Document 1 discloses a posture angle measurement device in which a triaxial angular velocity sensor, a triaxial acceleration sensor, and a nonlinear Kalman filter are mounted. In Non-Patent Document 1, output signals from a 3-axis angular velocity sensor, a 3-axis acceleration sensor, and a 3-axis geomagnetic sensor are integrated using an extended Kalman filter or a sigma point Kalman filter using unscented transformation, and the posture is integrated. An estimation method is disclosed.

一般的に、非線形カルマンフィルタは、動的システムの状態を表す複数の物理量の経時的な変化を推定する状態遷移モデルと、推定された動的システムの状態から、動的システムの有する複数のセンサが計測する値(観測値)を推定する観測モデルとを有する。そして、非線形カルマンフィルタは、推定された観測値と、複数のセンサが実際に測定する観測値との差分(観測残差)を用いて、動的システムの状態を表す複数の物理量を推定する値(状態変数)を要素とする状態ベクトルを逐次更新することにより、状態ベクトルの各要素の示す値を、実際の物理量(真値)に近づける。
このように、非線形カルマンフィルタは、状態ベクトルと、状態ベクトルに基づいて算出される観測残差とを用いて、状態ベクトルを逐次更新する演算であるため、状態ベクトルの初期値の要素が真値から乖離した値に設定された場合、状態ベクトルの各要素が真値に近い値に収束するまでに長時間を要することがあり、更には、状態ベクトルの各要素が真値とは異なる不正確な値に収束することも起こり得る。
In general, a nonlinear Kalman filter is composed of a state transition model that estimates changes over time in a plurality of physical quantities representing the state of a dynamic system, and a plurality of sensors that the dynamic system has based on the estimated state of the dynamic system. And an observation model for estimating a value to be measured (observed value). The nonlinear Kalman filter uses a difference (observation residual) between the estimated observation value and the observation value actually measured by the plurality of sensors to estimate a plurality of physical quantities representing the state of the dynamic system ( By sequentially updating the state vector having the state variable) as an element, the value indicated by each element of the state vector is brought close to the actual physical quantity (true value).
In this way, the nonlinear Kalman filter is an operation that sequentially updates the state vector using the state vector and the observation residual calculated based on the state vector, so that the initial value element of the state vector is changed from the true value. When set to a deviated value, it may take a long time for each element of the state vector to converge to a value close to the true value. It can also converge to a value.

特許文献2には、複数のカルマンフィルタに異なる初期値を与えて並列に動作させ、観測残差が最も少ないカルマンフィルタを用いて状態の推定を実行することで、真値から乖離した初期値が設定されることによる発散状態(状態ベクトルの要素が真値から大きく乖離した状態)を回避する技術が開示されている。   In Patent Document 2, different initial values are given to a plurality of Kalman filters to operate in parallel, and an initial value deviating from a true value is set by performing state estimation using a Kalman filter having the smallest observation residual. A technique for avoiding a divergent state (a state vector element greatly deviating from a true value) is disclosed.

特開平9−5104号公報Japanese Patent Laid-Open No. 9-5104 特開平4−169814号公報JP-A-4-169814

Wolfgang Gunthner, “Enhancing Cognitive Assistance Systems with Inertial Measurement Units”, Springer, 2008Wolfgang Gunthner, “Enhancing Cognitive Assistance Systems with Inertial Measurement Units”, Springer, 2008

ところで、観測残差にはノイズが重畳しているため、ある時刻で選択したカルマンフィルタが、次の時刻において最も観測残差が小さくなるとは限らない。従って、従来の技術のように、単に観測残差が最小になるカルマンフィルタを選択すると、不適切なものを選択してしまう可能性があるといった問題が存在する。
さらに、従来の技術のように、複数のカルマンフィルタを並列で動作させる場合、状態ベクトルを収束させる時間を短縮することができるが、処理負荷が増加する。すなわち、状態ベクトルが収束するまでの時間と処理負荷とはトレードオフの関係にあるといった問題があった。
By the way, since noise is superimposed on the observation residual, the Kalman filter selected at a certain time does not necessarily have the smallest observation residual at the next time. Therefore, there is a problem that, as in the conventional technique, if a Kalman filter that minimizes the observation residual is simply selected, an inappropriate one may be selected.
Furthermore, when a plurality of Kalman filters are operated in parallel as in the conventional technique, the time for convergence of the state vector can be shortened, but the processing load increases. That is, there is a problem that the time until the state vector converges and the processing load are in a trade-off relationship.

本発明は、上述した点に鑑みてなされたものであり、状態ベクトルを適切な値に高速に収束させるとともに、非線形カルマンフィルタの演算に係る処理負荷を低減させることを解決課題とする。   The present invention has been made in view of the above-described points, and it is an object of the present invention to converge the state vector to an appropriate value at high speed and reduce the processing load related to the calculation of the nonlinear Kalman filter.

上述した課題を解決するため、本発明に係る状態推定装置は、システムを観測して観測値を各々出力する複数のセンサと、前記システムの状態を表すための複数の状態変数を要素とする状態ベクトルと、前記複数のセンサから各々出力される観測値を要素とする観測値ベクトルとを用いて、前記状態ベクトルを更新することで、前記システムの状態を推定する複数のカルマンフィルタと、互いに異なる複数の初期ベクトルを生成し、複数の前記初期ベクトルのそれぞれを、前記状態ベクトルの初期値として前記複数のカルマンフィルタの各々に供給する初期値生成部と、前記複数のカルマンフィルタの推定精度を各々評価し、前記複数のカルマンフィルタのうち、推定精度が最も高いカルマンフィルタを特定し、特定したカルマンフィルタを除く他のカルマンフィルタの動作を停止させるカルマンフィルタ制御部と、を備えることを特徴とする。   In order to solve the above-described problem, a state estimation device according to the present invention includes a plurality of sensors that observe a system and output observation values, and a state that includes a plurality of state variables that represent the state of the system as elements. A plurality of different Kalman filters that estimate the state of the system by updating the state vector by using a vector and an observation value vector having observation values output from the plurality of sensors as elements. An initial value generation unit that supplies each of the plurality of initial vectors to each of the plurality of Kalman filters as an initial value of the state vector, and evaluates the estimation accuracy of the plurality of Kalman filters, Among the plurality of Kalman filters, a Kalman filter having the highest estimation accuracy is identified, and the identified Kalman filter is Ku, characterized in that it comprises a Kalman filter controller stops the operation of the other Kalman filters.

カルマンフィルタは、状態ベクトルと観測値ベクトルとを用いて、状態ベクトルを更新する演算を繰り返すことにより、状態ベクトルの各要素を真値に近い値に収束させ、システムの状態を推定する。従って、状態ベクトルの初期値(すなわち、初期ベクトル)の要素が真値から大きく乖離する場合には、状態ベクトルの各要素が真値に近い値に収束するまでに長時間を要することがあり、更には、状態ベクトルの各要素が真値とは異なる不正確な値に収束することも起こり得る。このような初期ベクトルが供給されるカルマンフィルタは、推定精度が低く、システムの状態を正確に推定することはできない。   The Kalman filter uses the state vector and the observation value vector to repeat the calculation for updating the state vector, thereby converging each element of the state vector to a value close to a true value and estimating the state of the system. Therefore, when the elements of the initial value of the state vector (that is, the initial vector) greatly deviate from the true value, it may take a long time for each element of the state vector to converge to a value close to the true value. Furthermore, each element of the state vector may converge to an inaccurate value different from the true value. The Kalman filter supplied with such an initial vector has a low estimation accuracy and cannot accurately estimate the state of the system.

この発明によれば、状態推定装置は、複数のカルマンフィルタに対して、互いに異なる複数の初期ベクトルをそれぞれ供給し、これら複数のカルマンフィルタを並列で動作させる。状態推定装置が互いに異なる複数の初期ベクトルを生成する場合、1つの初期ベクトルを生成する場合に比べて、真値に近い値を要素とする初期ベクトルが含まれる可能性が高い。真値に近い値を要素とする初期ベクトルが供給されるカルマンフィルタは、状態ベクトルの各要素が正確且つ高速に真値に収束させることができるため、システムの状態の推定精度も高い。
そして、状態推定装置は、複数のカルマンフィルタの中から、推定精度が最も高いカルマンフィルタを特定し、特定したカルマンフィルタにより状態推定を行うとともに、特定したカルマンフィルタ以外のカルマンフィルタを停止する。従って、本発明に係る状態推定装置によれば、正確且つ高速な状態推定が可能であるとともに、状態推定に係る処理負荷の低減が可能となる。
According to the present invention, the state estimation device supplies a plurality of different initial vectors to a plurality of Kalman filters, and operates the plurality of Kalman filters in parallel. When the state estimation device generates a plurality of different initial vectors, it is more likely that an initial vector having a value close to the true value as an element is included as compared with the case of generating one initial vector. A Kalman filter to which an initial vector whose elements are close to the true value is supplied can accurately and quickly converge each element of the state vector to the true value, so that the state accuracy of the system is high.
Then, the state estimation device identifies a Kalman filter having the highest estimation accuracy from among the plurality of Kalman filters, performs state estimation using the identified Kalman filter, and stops Kalman filters other than the identified Kalman filter. Therefore, according to the state estimation apparatus according to the present invention, accurate and high-speed state estimation is possible, and the processing load related to state estimation can be reduced.

また、上述した状態推定装置において、前記カルマンフィルタは、前記状態ベクトルと、前記観測値ベクトルとに基づいて観測残差を算出するとともに、前記状態ベクトルの推定誤差の共分散を算出し、前記カルマンフィルタ制御部は、前記複数のカルマンフィルタの各々が出力する前記観測残差に基づいて、前記状態ベクトルと前記システムの状態との誤差を評価する誤差評価値が最小となるカルマンフィルタを選択する観測残差比較部と、前記観測残差比較部によって選択されたカルマンフィルタが出力する前記状態ベクトルの推定誤差の共分散に基づいて、前記状態ベクトルの収束の程度を表す収束評価値を算出し、前記収束評価値が閾値以下であるか否かを判定する収束度判定部と、前記収束度判定部の判定結果が肯定である場合、前記観測残差比較部によって選択されたカルマンフィルタを、推定精度が最も高いカルマンフィルタであると特定し、特定したカルマンフィルタを除く他のカルマンフィルタの動作を停止させる、停止制御部と、を更に備えることが好ましい。   In the state estimation device described above, the Kalman filter calculates an observation residual based on the state vector and the observation value vector, calculates a covariance of the estimation error of the state vector, and performs the Kalman filter control. An observation residual comparison unit that selects a Kalman filter that minimizes an error evaluation value for evaluating an error between the state vector and the state of the system based on the observation residual output from each of the plurality of Kalman filters And calculating a convergence evaluation value representing the degree of convergence of the state vector based on the covariance of the estimation error of the state vector output by the Kalman filter selected by the observation residual comparison unit, and the convergence evaluation value is When the determination result of the convergence degree determination unit that determines whether or not the threshold value is equal to or less than the threshold value determination unit is positive, It is preferable to further include a stop control unit that identifies the Kalman filter selected by the observation residual comparison unit as the Kalman filter with the highest estimation accuracy and stops the operation of the other Kalman filters excluding the identified Kalman filter. .

この発明によれば、状態推定装置は、誤差評価値と収束評価値とを用いて、推定精度が最も高いカルマンフィルタを特定する。
誤差評価値は、観測残差に基づいて定められ、状態ベクトルの示す値と真値との誤差を表す値である。すなわち、誤差評価値が小さい場合、状態ベクトルの各要素は真値に近い値を示す。従って、誤差評価値が最小となるカルマンフィルタは、システムの状態を最も正確に推定するカルマンフィルタであると看做すことができる。
一方、収束評価値は、状態ベクトルの推定誤差の共分散に基づいて定められるものであり、状態ベクトルの収束の程度を表す値である。状態ベクトルが収束している場合、ある時刻において状態ベクトルの各要素が真値に近い値を示していれば、当該ある時刻以降においても状態ベクトルの各要素は真値に近い値を示す可能性が高い。すなわち、収束評価値が小さい場合、カルマンフィルタは安定的にシステムの状態を推定することができる。
このような、誤差評価値と、収束評価値とを用いることにより、ある時刻においてシステムの状態を最も正確に推定し、且つ、当該ある時刻以降も安定的にシステムの状態を推定することができるカルマンフィルタを特定することができる。すなわち、本発明に係る状態推定装置は、推定精度の最も高いカルマンフィルタを正確に特定し、正確且つ安定的な状態推定を行うことが可能になる。
According to this invention, the state estimation device specifies the Kalman filter with the highest estimation accuracy using the error evaluation value and the convergence evaluation value.
The error evaluation value is determined based on the observation residual and is a value representing an error between the value indicated by the state vector and the true value. That is, when the error evaluation value is small, each element of the state vector shows a value close to the true value. Therefore, the Kalman filter with the smallest error evaluation value can be regarded as a Kalman filter that most accurately estimates the state of the system.
On the other hand, the convergence evaluation value is determined based on the covariance of the state vector estimation error, and is a value representing the degree of convergence of the state vector. When the state vector has converged, if each element of the state vector shows a value close to the true value at a certain time, each element of the state vector may show a value close to the true value even after the certain time. Is expensive. That is, when the convergence evaluation value is small, the Kalman filter can stably estimate the system state.
By using such an error evaluation value and a convergence evaluation value, the system state can be estimated most accurately at a certain time, and the system state can be stably estimated after the certain time. A Kalman filter can be specified. That is, the state estimation device according to the present invention can accurately identify the Kalman filter with the highest estimation accuracy and perform accurate and stable state estimation.

また、上述した状態推定装置において、前記観測残差比較部は、前記観測残差のうち少なくとも一部の要素のノルムの、現在時刻から所定時間だけ過去の時刻までの所定期間における最大値を、前記複数のカルマンフィルタごとに算出し、算出した複数の前記最大値が最小となるカルマンフィルタを、前記誤差評価値が最小となるカルマンフィルタとして選択する、ことを特徴とすることが好ましい。   Further, in the state estimation device described above, the observation residual comparison unit calculates a maximum value in a predetermined period from a current time to a past time of a norm of at least some elements of the observation residual, Preferably, the calculation is performed for each of the plurality of Kalman filters, and the plurality of calculated Kalman filters that minimize the maximum value is selected as the Kalman filter that minimizes the error evaluation value.

誤差評価値は、観測残差に基づいて算出される値である。しかし、観測残差は、複数のセンサから各々出力される観測値を要素とする観測値ベクトルに基づいて算出されるベクトルであるため、ノイズが重畳する。
この発明によれば、観測残差のうち少なくとも一部の要素のノルムについて、所定期間における最大値を誤差評価値とする。従って、観測残差が観測ノイズ等により変動する場合であっても、ノイズによる影響を小さく抑えて誤差評価値を算出することができ、状態ベクトルの示す値と真値との誤差の大きさを正確に把握することが可能となる。
The error evaluation value is a value calculated based on the observation residual. However, since the observation residual is a vector calculated based on an observation value vector having observation values output from a plurality of sensors as elements, noise is superimposed.
According to this invention, regarding the norm of at least some elements of the observation residual, the maximum value in the predetermined period is set as the error evaluation value. Therefore, even when the observation residual fluctuates due to observation noise or the like, the error evaluation value can be calculated while suppressing the influence of noise, and the magnitude of the error between the value indicated by the state vector and the true value can be calculated. It becomes possible to grasp accurately.

また、上述した状態推定装置において、前記収束評価値は、前記状態ベクトルの推定誤差の共分散を表す行列のトレースである、ことを特徴とすることが好ましい。   In the state estimation apparatus described above, it is preferable that the convergence evaluation value is a matrix trace representing a covariance of the state vector estimation error.

一般的に共分散行列の固有値は、当該固有値に対応する固有ベクトル方向の分散の大きさを表す値である。従って、状態ベクトルの推定誤差の共分散のトレース(すなわち、共分散行列が有する複数の固有値の和)は、状態ベクトルの推定誤差の大きさを表す。
また、カルマンフィルタは、状態ベクトルを、初期状態から現在時刻に至る全ての状態ベクトルの値を考慮して更新する。従って、状態ベクトルの推定誤差の共分散も、初期状態から現在時刻に至る全ての共分散の値を考慮して更新される。よって、状態ベクトルの推定誤差の共分散のトレースが小さな値となる場合、状態ベクトルの推定誤差が小さな値で安定している状態(すなわち、状態ベクトルが収束している状態)であると看做すことができる。
本発明は、収束評価値として、状態ベクトルの推定誤差の共分散のトレースを採用したため、状態ベクトルが集束している状態であるか否かを正確に判定することが可能となる。
In general, the eigenvalue of the covariance matrix is a value representing the magnitude of variance in the eigenvector direction corresponding to the eigenvalue. Therefore, the state vector estimation error covariance trace (that is, the sum of a plurality of eigenvalues of the covariance matrix) represents the state vector estimation error magnitude.
The Kalman filter updates the state vector in consideration of all state vector values from the initial state to the current time. Therefore, the state vector estimation error covariance is also updated in consideration of all covariance values from the initial state to the current time. Therefore, when the state vector estimation error covariance trace has a small value, it is considered that the state vector estimation error is stable at a small value (that is, the state vector is converged). I can do it.
Since the present invention employs a state vector estimation error covariance trace as the convergence evaluation value, it is possible to accurately determine whether or not the state vector is in a focused state.

また、上述した状態推定装置において、前記カルマンフィルタ制御部が、前記他のカルマンフィルタを停止させる前は、前記複数のカルマンフィルタは、第1のデータ型を用いて演算を行い、前記カルマンフィルタ制御部が、前記他のカルマンフィルタを停止させた後は、前記カルマンフィルタ制御部によって特定されたカルマンフィルタは、前記第1のデータ型よりもデータサイズの大きな第2のデータ型を用いて演算を行うことを特徴とすることが好ましい。   Further, in the state estimation device described above, before the Kalman filter control unit stops the other Kalman filter, the plurality of Kalman filters perform calculation using a first data type, and the Kalman filter control unit After stopping the other Kalman filters, the Kalman filter specified by the Kalman filter control unit performs an operation using a second data type having a data size larger than that of the first data type. Is preferred.

この発明によれば、複数のカルマンフィルタが並列で動作するときは、これら複数のカルマンフィルタは、データサイズの小さな第1のデータ型を用いた演算を行う。従って、本発明に係る状態推定装置は、複数のカルマンフィルタを並列で動作させる場合の計算負荷を、低減することができる。
一方、この発明によれば、特定されたカルマンフィルタが単独で動作するときは、当該特定されたカルマンフィルタは、データサイズの大きな第2のデータ型を用いた演算を行う。従って、本発明に係る状態推定装置は、特定された1つのカルマンフィルタにより演算を行う場合に、高い精度でシステムの状態を推定することが可能となる。
According to the present invention, when a plurality of Kalman filters operate in parallel, the plurality of Kalman filters perform an operation using the first data type having a small data size. Therefore, the state estimation apparatus according to the present invention can reduce the calculation load when operating a plurality of Kalman filters in parallel.
On the other hand, according to the present invention, when the specified Kalman filter operates alone, the specified Kalman filter performs an operation using the second data type having a large data size. Therefore, the state estimation apparatus according to the present invention can estimate the state of the system with high accuracy when the calculation is performed by one specified Kalman filter.

本発明の実施形態に係る携帯機器の構成を示すブロック図である。It is a block diagram which shows the structure of the portable apparatus which concerns on embodiment of this invention. 携帯機器の外観を示す斜視図である。It is a perspective view which shows the external appearance of a portable apparatus. 本発明の実施形態に係る状態推定プログラムが実行されることにより実現される機能を表す、機能ブロック図である。It is a functional block diagram showing the function implement | achieved when the state estimation program which concerns on embodiment of this invention is performed. 本発明の実施形態に係る状態推定装置の動作を説明するためのフローチャートである。It is a flowchart for demonstrating operation | movement of the state estimation apparatus which concerns on embodiment of this invention. 初期姿勢を説明するための概念図である。It is a key map for explaining an initial posture. 初期姿勢を説明するための概念図である。It is a key map for explaining an initial posture. 初期姿勢を説明するための概念図である。It is a key map for explaining an initial posture. 本発明の実施形態に係るカルマンフィルタの機能を説明するための機能ブロック図である。It is a functional block diagram for demonstrating the function of the Kalman filter which concerns on embodiment of this invention.

<A.実施形態>
本発明の実施の形態について図面を参照して説明する。
<A. Embodiment>
Embodiments of the present invention will be described with reference to the drawings.

[1. 機器構成及びソフトウェア構成]
図1は、本発明の実施形態に係る携帯機器1のブロック図であり、図2は携帯機器1の外観を示す斜視図である。携帯機器1は、携帯機器1の姿勢の変化に応じて、携帯機器1が備える画面に表示される地図などの画像を回転させ、画像によって表される方位を現実空間の方位に追従させる機能を備える。この機能は、携帯機器1が備える各種センサの出力に基づいてカルマンフィルタの演算を行い、携帯機器1の姿勢または携帯機器1から見た地磁気の向き等を推定することによって実現される。
[1. Device configuration and software configuration]
FIG. 1 is a block diagram of a mobile device 1 according to an embodiment of the present invention, and FIG. 2 is a perspective view showing an appearance of the mobile device 1. The mobile device 1 has a function of rotating an image such as a map displayed on the screen included in the mobile device 1 in accordance with a change in the orientation of the mobile device 1 so that the orientation represented by the image follows the orientation of the real space. Prepare. This function is realized by performing a Kalman filter operation based on the outputs of various sensors included in the mobile device 1 and estimating the orientation of the mobile device 1 or the direction of geomagnetism viewed from the mobile device 1.

携帯機器1は、各種の構成要素とバスを介して接続され装置全体を制御するCPU10、CPU10の作業領域として機能するRAM(蓄積部)20、状態推定プログラム100等の各種のプログラムやデータを記憶したROM30、通信を実行する通信部40、画像を表示する表示部50、及びGPS部60を備える。
また、携帯機器1は、地磁気等の磁気を検出して磁気データqを出力する3次元磁気センサ70、加速度を検出して加速度データaを出力する3次元加速度センサ80、及び角速度を検出して角速度データgを出力する3次元角速度センサ90を備える。
The mobile device 1 stores various programs and data such as a CPU 10 that is connected to various components via a bus and controls the entire apparatus, a RAM (storage unit) 20 that functions as a work area of the CPU 10, and a state estimation program 100. ROM 30, a communication unit 40 that executes communication, a display unit 50 that displays an image, and a GPS unit 60.
The portable device 1 detects a magnetic field such as geomagnetism and outputs magnetic data q, a three-dimensional acceleration sensor 80 that detects acceleration and outputs acceleration data a, and detects an angular velocity. A three-dimensional angular velocity sensor 90 that outputs angular velocity data g is provided.

表示部50は、CPU10が状態推定プログラム100を実行することにより推定したシステムの状態に基づいて算出された地磁気の向きや携帯機器1の姿勢μ等を、矢印等の画像により表示する。
GPS部60は、GPS衛星からの信号を受信して携帯機器1の位置情報(緯度、経度)を生成する。
The display unit 50 displays the orientation of the geomagnetism calculated based on the state of the system estimated by the CPU 10 executing the state estimation program 100, the orientation μ of the portable device 1, and the like by an image such as an arrow.
The GPS unit 60 receives a signal from a GPS satellite and generates position information (latitude, longitude) of the mobile device 1.

3次元磁気センサ70は、地磁気を検出するためのセンサであり、X軸磁気センサ71、Y軸磁気センサ72、及びZ軸磁気センサ73を備える。各センサは、MI素子(磁気インピーダンス素子)、MR素子(磁気抵抗効果素子)などを用いて構成することができる。磁気センサI/F74は、各センサからの出力信号をAD変換して磁気データqを出力する。この磁気データqは、x軸、y軸およびz軸の3成分を有するベクトルとして表されるデータである。より具体的には、磁気データqは、3次元磁気センサ70と一体となって運動する携帯機器1に固定された座標系において、X軸磁気センサ71からの出力値がx軸成分として表され、Y軸磁気センサ72からの出力値がy軸成分として表され、Z軸磁気センサ73からの出力値がz軸成分として表されるベクトルデータである。
なお、3次元磁気センサ70は、携帯機器1に設けられるため、地磁気の他に、携帯機器1の部品が発する内部磁界と、携帯機器1の外部にある外部物が発する外部磁界とを検出する。但し、本実施形態では、外部磁界は無視できる程度に小さいものと想定する。
従って、磁気データqを用いて地磁気の向き及び大きさを算出するためには、磁気データqから、内部磁界を表す成分を減算する補正処理を行う必要がある。この補正処理において、減算される値(つまり、内部磁界を表す成分)を、3次元磁気センサ70のオフセットと呼ぶ。
The three-dimensional magnetic sensor 70 is a sensor for detecting geomagnetism, and includes an X-axis magnetic sensor 71, a Y-axis magnetic sensor 72, and a Z-axis magnetic sensor 73. Each sensor can be configured using an MI element (magnetic impedance element), an MR element (magnetoresistance effect element), or the like. The magnetic sensor I / F 74 performs AD conversion on the output signal from each sensor and outputs magnetic data q. The magnetic data q is data represented as a vector having three components of the x axis, the y axis, and the z axis. More specifically, the magnetic data q represents the output value from the X-axis magnetic sensor 71 as an x-axis component in a coordinate system fixed to the portable device 1 that moves integrally with the three-dimensional magnetic sensor 70. The output value from the Y-axis magnetic sensor 72 is represented as a y-axis component, and the output value from the Z-axis magnetic sensor 73 is vector data represented as a z-axis component.
Since the three-dimensional magnetic sensor 70 is provided in the mobile device 1, in addition to geomagnetism, an internal magnetic field generated by components of the mobile device 1 and an external magnetic field generated by an external object outside the mobile device 1 are detected. . However, in this embodiment, it is assumed that the external magnetic field is small enough to be ignored.
Therefore, in order to calculate the direction and magnitude of the geomagnetism using the magnetic data q, it is necessary to perform a correction process for subtracting the component representing the internal magnetic field from the magnetic data q. In this correction process, a value to be subtracted (that is, a component representing the internal magnetic field) is called an offset of the three-dimensional magnetic sensor 70.

3次元加速度センサ80は、X軸加速度センサ81、Y軸加速度センサ82、及びZ軸加速度センサ83を備える。各センサは、ピエゾ抵抗型、静電容量型、熱検知型などどのような検知方式であってもよい。加速度センサI/F84は、各センサからの出力信号をAD変換して加速度データaを出力する。この加速度データaは、3次元加速度センサ80と一体となって運動する携帯機器1に固定された座標系における慣性力と重力との合力を、x軸、y軸及びz軸の3成分を有するベクトルとして表すデータである。従って、携帯機器1が静止状態または等速直線運動状態にあれば、加速度データaは、携帯機器1に固定された座標系から見た重力加速度の大きさと方向とを示すベクトルデータとなる。   The three-dimensional acceleration sensor 80 includes an X-axis acceleration sensor 81, a Y-axis acceleration sensor 82, and a Z-axis acceleration sensor 83. Each sensor may be any detection method such as a piezoresistive type, a capacitance type, or a heat detection type. The acceleration sensor I / F 84 AD-converts output signals from each sensor and outputs acceleration data a. This acceleration data a has the three components x-axis, y-axis, and z-axis of the resultant force of inertia and gravity in the coordinate system fixed to the portable device 1 that moves integrally with the three-dimensional acceleration sensor 80. Data represented as a vector. Therefore, if the mobile device 1 is in a stationary state or a constant velocity linear motion state, the acceleration data a is vector data indicating the magnitude and direction of the gravitational acceleration as viewed from the coordinate system fixed to the mobile device 1.

3次元角速度センサ90は、X軸角速度センサ91、Y軸角速度センサ92、及びZ軸角速度センサ93を備える。角速度センサI/F94は、各センサからの出力信号をAD変換して角速度データgを出力する。角速度データgは、各軸の回りの角速度を示すベクトルデータである。   The three-dimensional angular velocity sensor 90 includes an X-axis angular velocity sensor 91, a Y-axis angular velocity sensor 92, and a Z-axis angular velocity sensor 93. The angular velocity sensor I / F 94 AD-converts output signals from the sensors and outputs angular velocity data g. The angular velocity data g is vector data indicating the angular velocity around each axis.

CPU10は、ROM30に格納されている状態推定プログラム100を実行することによって、携帯機器1の姿勢や磁気センサのオフセット等のシステムの状態を表す複数の物理量を推定する。すなわち、携帯機器1は、CPU10が状態推定プログラム100を実行することで、状態推定装置として機能する。   The CPU 10 estimates a plurality of physical quantities representing the state of the system such as the attitude of the mobile device 1 and the offset of the magnetic sensor by executing the state estimation program 100 stored in the ROM 30. That is, the portable device 1 functions as a state estimation device when the CPU 10 executes the state estimation program 100.

図3は、状態推定装置のうち、CPU10が状態推定プログラム100を実行することにより実現される機能を表す、機能ブロック図である。
図3に示すように、状態推定装置は、互いに異なる複数の初期ベクトルを出力する初期値生成部200、複数のカルマンフィルタを備えカルマンフィルタの演算を行うカルマンフィルタ部300、カルマンフィルタ部300の動作を制御するカルマンフィルタ制御部400、及び、カルマンフィルタ部300からの出力に基づいて出力情報を生成する出力情報生成部500を備える。
FIG. 3 is a functional block diagram showing functions realized by the CPU 10 executing the state estimation program 100 in the state estimation device.
As illustrated in FIG. 3, the state estimation device includes an initial value generation unit 200 that outputs a plurality of different initial vectors, a Kalman filter unit 300 that includes a plurality of Kalman filters and performs a Kalman filter operation, and a Kalman filter that controls the operation of the Kalman filter unit 300. An output information generation unit 500 that generates output information based on outputs from the control unit 400 and the Kalman filter unit 300 is provided.

カルマンフィルタ部300は、10個のカルマンフィルタKFを備え、各々のカルマンフィルタKFは、非線形カルマンフィルタの演算を行う。
なお、説明の便宜上、10個のカルマンフィルタKFを区別する場合、10個のカルマンフィルタを、それぞれ、KF[1]、KF[2]、…、KF[10]と表記する。また、10個のカルマンフィルタの中で、第m番目(mは、1≦m≦10を満たす自然数)のカルマンフィルタを、KF[m]と表記する。
The Kalman filter unit 300 includes ten Kalman filters KF, and each Kalman filter KF performs a nonlinear Kalman filter operation.
For convenience of description, when distinguishing the ten Kalman filters KF, the ten Kalman filters are denoted as KF [1], KF [2],..., KF [10], respectively. In addition, among the 10 Kalman filters, the m-th Kalman filter (m is a natural number satisfying 1 ≦ m ≦ 10) is denoted as KF [m].

10個のカルマンフィルタKF[1]〜KF[10]のそれぞれは、第1演算モードまたは第2演算モードのいずれかの演算モードで、非線形カルマンフィルタの演算を行う。
ここで、第1演算モードとは、CPU10及び状態推定プログラム100が対応可能な実数を表すデータ型の中で、データサイズの最も小さな第1のデータ型を用いて、非線形カルマンフィルタの演算を行うモードである。また、第2演算モードとは、第1のデータ型よりもデータサイズの大きな第2のデータ型を用いて、非線形カルマンフィルタの演算を行うモードである。すなわち、第2演算モードは、第1演算モードと比べ、演算の精度が高く、処理負荷が大きい演算モードである。
Each of the ten Kalman filters KF [1] to KF [10] performs a nonlinear Kalman filter operation in either the first operation mode or the second operation mode.
Here, the first calculation mode is a mode in which the nonlinear Kalman filter is calculated using the first data type having the smallest data size among the data types representing real numbers that can be handled by the CPU 10 and the state estimation program 100. It is. The second calculation mode is a mode in which a nonlinear Kalman filter is calculated using a second data type having a data size larger than that of the first data type. That is, the second calculation mode is a calculation mode in which the calculation accuracy is high and the processing load is large as compared with the first calculation mode.

非線形カルマンフィルタの演算とは、以下で説明する状態ベクトルx及び観測値ベクトルyを用いて算出される観測残差zに基づいて、状態ベクトルxを周期的に更新することにより、システムの状態を推定する演算である。なお、詳細は後述するが、観測残差zとは、観測値ベクトルyと、推定観測値ベクトルyとの差分である。
また、非線形カルマンフィルタの演算は、状態ベクトルの更新と同じ周期で、状態ベクトルxの推定誤差の共分散Pも更新する。
The calculation of the nonlinear Kalman filter is to estimate the state of the system by periodically updating the state vector x based on the observation residual z calculated using the state vector x and the observation value vector y described below. It is an operation to do. Although details will be described later, the observation residual z is a difference between the observed value vector y and the estimated observed value vector y .
The calculation of the nonlinear Kalman filter also updates the covariance P of the estimation error of the state vector x at the same cycle as the update of the state vector.

状態ベクトルxとは、複数の状態変数を要素とするベクトルである。状態ベクトルxの要素である複数の状態変数は、それぞれ、非線形カルマンフィルタが推定するシステムの状態を示す複数の物理量を表す。すなわち、状態ベクトルxは、非線形カルマンフィルタが推定するシステムの状態を表すベクトルである。
本実施形態は、状態ベクトルxの要素(状態変数)として、携帯機器1の姿勢μ、地磁気の強さr、地磁気の伏角φ、携帯機器1の角速度ω、角速度センサ91〜93のオフセット推定値b、及び磁気センサ71〜73のオフセット推定値cを採用し、これらを非線形カルマンフィルタの演算における推定の対象とする。
時刻T=kにおける状態ベクトルxは、以下の式(1)で表される。なお、各状態変数の右下に付された添え字「k」は、当該状態変数が時刻T=kにおける値であることを表す。

Figure 2013088162
The state vector x is a vector having a plurality of state variables as elements. A plurality of state variables, which are elements of the state vector x, respectively represent a plurality of physical quantities indicating a system state estimated by the nonlinear Kalman filter. That is, the state vector x is a vector representing the state of the system estimated by the nonlinear Kalman filter.
In this embodiment, as elements (state variables) of the state vector x, the attitude μ of the mobile device 1, the geomagnetic strength r, the geomagnetic dip angle φ, the angular velocity ω of the mobile device 1, and the offset estimated values of the angular velocity sensors 91 to 93. b O and the offset estimated value c O of the magnetic sensors 71 to 73 are adopted, and these are used as the targets of estimation in the calculation of the nonlinear Kalman filter.
The state vector x k at time T = k is expressed by the following equation (1). The subscript “k” attached to the lower right of each state variable indicates that the state variable is a value at time T = k.
Figure 2013088162

ここで、地磁気の強さrはスカラーであり、地磁気の伏角φはスカラーであり、角速度ωは3次元ベクトルであり、角速度センサのオフセット推定値bは3次元ベクトルであり、磁気センサのオフセット推定値cは3次元ベクトルである。
また、姿勢μは、クォータニオンを用いて表現される。クォータニオンとは、物体の姿勢(回転状態)を表す4次元数である。例えば、携帯機器1に固定された座標系の各軸と、地上に固定された座標系の各軸とが一致する姿勢μを基準姿勢と定義し、基準姿勢をμ=(0、0、0、1)と表現する。このとき、携帯機器1の任意の姿勢μは、基準姿勢に対して単位ベクトルρの方向を回転軸として角度ψだけ回転した姿勢として表現できる。回転後の姿勢μは、クォータニオンを用いて、式(2)で与えられる。

Figure 2013088162
Here, the geomagnetic strength r is a scalar, the geomagnetic dip angle φ is a scalar, the angular velocity ω is a three-dimensional vector, the angular velocity sensor offset estimate b O is a three-dimensional vector, and the magnetic sensor offset The estimated value c O is a three-dimensional vector.
In addition, the posture μ is expressed using quaternions. A quaternion is a four-dimensional number that represents the posture (rotation state) of an object. For example, a posture μ in which each axis of the coordinate system fixed to the portable device 1 and each axis of the coordinate system fixed on the ground coincide with each other is defined as a reference posture, and the reference posture is μ = (0, 0, 0). 1). At this time, the arbitrary posture μ of the mobile device 1 can be expressed as a posture rotated by an angle ψ with the direction of the unit vector ρ as the rotation axis with respect to the reference posture. The posture μ after rotation is given by Equation (2) using a quaternion.
Figure 2013088162

一方、観測値ベクトルyとは、3次元磁気センサ70から出力される磁気データq、3次元加速度センサ80から出力される加速度データa、及び、3次元角速度センサ90から出力される角速度データgを要素とするベクトルである。時刻T=kにおける観測値ベクトルyは式(3)で与えられる。

Figure 2013088162
On the other hand, the observed value vector y includes magnetic data q output from the three-dimensional magnetic sensor 70, acceleration data a output from the three-dimensional acceleration sensor 80, and angular velocity data g output from the three-dimensional angular velocity sensor 90. It is a vector as an element. Observation value vector y k at time T = k is given by equation (3).
Figure 2013088162

各々のカルマンフィルタKFは、非線形カルマンフィルタの演算の結果、周期的に算出される、状態ベクトルx、観測残差z、及び状態ベクトルの推定誤差の共分散Pを、出力する。なお、説明の便宜上、第m番目のカルマンフィルタKF[m]からの出力は、状態ベクトルx[m]、観測残差z[m]、状態ベクトルの推定誤差の共分散P[m]等のように、符号[m]を付して表記する。
また、詳細は後述するが、本実施形態では、各々のカルマンフィルタKFが出力する状態ベクトルxとは、厳密には、更新後の状態ベクトルx であり、各々のカルマンフィルタKFが出力する状態ベクトルの推定誤差の共分散Pとは、厳密には、更新後の状態ベクトルの推定誤差の共分散P である。
Each Kalman filter KF outputs a state vector x k , an observation residual z k , and a state vector estimation error covariance P k that are periodically calculated as a result of the operation of the nonlinear Kalman filter. For convenience of explanation, the output from the m-th Kalman filter KF [m] is a state vector x k [m], an observation residual z k [m], and a state vector estimation error covariance P k [m]. In this way, it is indicated with a symbol [m].
Although details will be described later, in the present embodiment, the state vector x k output from each Kalman filter KF is strictly the state vector x + k after update, and the state output from each Kalman filter KF. Strictly speaking, the vector estimation error covariance P k is the updated state vector estimation error covariance P + k .

初期値生成部200は、ROM30に格納された各種設定情報等に基づいて、互いに異なる10個の初期ベクトルINI[1]〜INI[10]を生成し、これらを出力する。
10個の初期ベクトルINI[1]〜INI[10]は、それぞれ、10個のカルマンフィルタKF[1]〜KF[10]に供給され、状態ベクトルxの初期値(すなわち、時刻T=0における状態ベクトルx)として適用される。
The initial value generation unit 200 generates ten different initial vectors INI [1] to INI [10] based on various setting information stored in the ROM 30, and outputs these.
The ten initial vectors INI [1] to INI [10] are supplied to the ten Kalman filters KF [1] to KF [10], respectively, and the initial value of the state vector x (that is, the state at time T = 0). Applied as vector x 0 ).

第m番目の初期ベクトルINI[m]は、姿勢μの初期値μ[m]、地磁気の強さrの初期値r[m]、地磁気の伏角φの初期値φ[m]、角速度ωの初期値ω[m]、角速度センサのオフセット推定値bの初期値bO,0[m]、及び磁気センサのオフセット推定値cの初期値cO,0[m]を要素として含み、以下の式(4)により示される。
なお、初期ベクトルINI[m]の各要素の生成方法については、後述する。

Figure 2013088162
The m-th initial vector INI [m] includes an initial value μ 0 [m] of the posture μ, an initial value r 0 [m] of the geomagnetic strength r, an initial value φ 0 [m] of the geomagnetic dip angle φ, Initial value ω 0 [m] of angular velocity ω, initial value b O, 0 [m] of offset estimated value b O of the angular velocity sensor, and initial value c O, 0 [m] of offset estimated value c O of the magnetic sensor It is included as an element and is shown by the following equation (4).
A method for generating each element of the initial vector INI [m] will be described later.
Figure 2013088162

カルマンフィルタ制御部400は、10個のカルマンフィルタKF[1]〜KF[10]からの出力値に基づいて、10個のカルマンフィルタKF[1]〜KF[10]の中で、推定精度が最も高いカルマンフィルタKF[Sel]を選択し、選択したカルマンフィルタKF[Sel]以外の9個のカルマンフィルタKFの動作を停止する制御を行う。   The Kalman filter control unit 400 has the highest estimation accuracy among the ten Kalman filters KF [1] to KF [10] based on the output values from the ten Kalman filters KF [1] to KF [10]. KF [Sel] is selected, and control is performed to stop the operations of the nine Kalman filters KF other than the selected Kalman filter KF [Sel].

なお、カルマンフィルタKFの推定精度とは、カルマンフィルタKFがシステムの状態をどの程度正確且つ安定的に推定しているかについて表す指標であり、具体的には、状態ベクトルxの示す値と状態ベクトルの真値との誤差の大きさを評価する値(誤差評価値)、及び、状態ベクトルxの収束の程度を表す値(収束評価値)により表現される指標である。そして、カルマンフィルタKFの推定精度が高い状態とは、状態ベクトルxの示す値と状態ベクトルの真値との誤差が小さく(つまり、誤差評価値が小さく)、且つ、状態ベクトルxが収束している(つまり、収束評価値が小さい)状態のことを意味する。ここで、「真値」とは、状態ベクトルxの各要素に対応する実際の物理量を表す値である。また、「状態ベクトルの真値」とは、状態ベクトルxの各要素に対応する実際の物理量を表す値(真値)を要素とするベクトルである。
状態ベクトルxの示す値と状態ベクトルの真値との誤差が小さい場合(つまり、状態ベクトルxの各要素が真値に近い正確な値を示す場合)、カルマンフィルタKFは、時刻T=kにおいて、システムを正確に推定していると看做すことができる。
また、状態ベクトルxが収束している場合、時刻T=kにおいて状態ベクトルxの各要素が真値に近い正確な値を示していれば、時刻T=k以降においても状態ベクトルxの各要素が真値に近い正確な値を示す可能性が高い。つまり、状態ベクトルxが収束している場合、カルマンフィルタKFは、システムの状態を安定的に推定していると看做すことができる。
The estimation accuracy of the Kalman filter KF is an index indicating how accurately and stably the system state is estimated by the Kalman filter KF. Specifically, the value indicated by the state vector x k and the state vector value (error evaluation value) for evaluating the magnitude of the error between the true value, and an index represented by a value representing the degree of convergence of the state vector x k (convergent evaluation value). The state where the estimation accuracy of the Kalman filter KF is high means that the error between the value indicated by the state vector x k and the true value of the state vector is small (that is, the error evaluation value is small), and the state vector x k converges. (That is, the convergence evaluation value is small). Here, the “true value” is a value representing an actual physical quantity corresponding to each element of the state vector x k . The “true value of the state vector” is a vector whose elements are values (true values) representing actual physical quantities corresponding to the elements of the state vector x k .
When the error between the value indicated by the state vector x k and the true value of the state vector is small (that is, when each element of the state vector x k indicates an accurate value close to the true value), the Kalman filter KF is time T = k Can be considered as accurately estimating the system.
Further, when the state vector x k has converged, if each element of the state vector x k indicates an accurate value close to a true value at time T = k, the state vector x can be changed even after time T = k. There is a high possibility that each element shows an accurate value close to the true value. That is, when the state vector xk has converged, it can be considered that the Kalman filter KF stably estimates the state of the system.

以下、カルマンフィルタ制御部400の詳細について説明する。
カルマンフィルタ制御部400は、状態ベクトルxの示す値と状態ベクトルの真値との誤差(誤差評価値)が最小のカルマンフィルタを選択する観測残差比較部420、状態ベクトルxが収束していると看做すことができるか否かを判定する収束度判定部440、及び、カルマンフィルタKFの動作を停止させる制御を行う停止制御部460を備える。
Details of the Kalman filter control unit 400 will be described below.
Kalman filter control unit 400, the state vector x error between the true value of the value and state vector indicated by k (error evaluation value) selects the smallest of the Kalman filter observation residual comparing unit 420, the state vector x k has converged A degree-of-convergence determination unit 440 that determines whether or not it can be considered, and a stop control unit 460 that performs control to stop the operation of the Kalman filter KF.

観測残差比較部420は、10個のピークモニタPM[1]〜PM[10]と、比較部422とを備える。
第m番目のピークモニタPM[m]は、以下の式(5)に示すように、第m番目のカルマンフィルタKF[m]が出力する観測残差z[m]を、時刻T=k−τから時刻T=kまでの所定期間モニターし、当該期間における観測残差z[m]のノルムの最大値を、誤差評価値MAX[m]として出力する。

Figure 2013088162
The observation residual comparison unit 420 includes ten peak monitors PM [1] to PM [10] and a comparison unit 422.
As shown in the following equation (5), the mth peak monitor PM [m] uses the observation residual z k [m] output from the mth Kalman filter KF [m] as time T = k−. Monitoring is performed for a predetermined period from τ 0 to time T = k, and the maximum value of the norm of the observation residual z k [m] in the period is output as the error evaluation value MAX z k [m].
Figure 2013088162

比較部422は、10個のピークモニタPM[1]〜PM[10]がそれぞれ出力する誤差評価値MAX[1]〜MAX[10]のうち、最小となる誤差評価値MAX[Sel]に対応するカルマンフィルタKF[Sel]を示す選択値Selを出力する(但し、Selは、1≦Sel≦10を満たす自然数)。
なお、観測残差比較部420は、カルマンフィルタ部300が観測残差z[1]〜z[10]の全てを出力する場合のみ、処理を実行する。例えば、CPU10は、カルマンフィルタ部300が、観測残差z[1]〜z[10]のうち1つの観測残差z[m]のみを出力する場合には、観測残差比較部420の動作を停止させる。
The comparison unit 422 has a minimum error evaluation value MAX z among the error evaluation values MAX z k [1] to MAX z k [10] output by the ten peak monitors PM [1] to PM [10]. The selected value Sel indicating the Kalman filter KF [Sel] corresponding to k [Sel] is output (where Sel is a natural number satisfying 1 ≦ Sel ≦ 10).
The observation residual comparison unit 420 executes the process only when the Kalman filter unit 300 outputs all of the observation residuals z k [1] to z k [10]. For example, CPU 10 is the Kalman filter unit 300, when outputting only one observation residuals z k [m] of the observation residuals z k [1] ~z k [ 10] the observed residual comparing unit 420 Stop the operation.

前述のとおり、観測残差zは、状態ベクトルxと観測値ベクトルyとを用いて算出される値であり、観測残差zに基づいて、状態ベクトルxの示す値と状態ベクトルの真値との誤差の大きさを表すことができる。しかし、観測値ベクトルyには、ノイズが重畳し、時刻Tの経過に伴い変動する値であるため、観測残差zも時刻Tの経過に伴い変動する。
そこで、観測残差比較部420は、観測残差z[m]を所定期間モニターし、所定期間における観測残差z[m]のノルムの最大値を誤差評価値MAX[m]として採用し、誤差評価値MAX[m]を用いて、状態ベクトルxの示す値と状態ベクトルの真値との誤差の大きさを評価する。
これにより、観測残差比較部420は、状態ベクトルxの示す値と真値との誤差の大きさを評価する際の、各種センサの測定誤差やノイズ等の影響を低減することができ、状態ベクトルxの示す値と状態ベクトルの真値との誤差が最小となるカルマンフィルタKFを、正しく選択することが可能となる。
As described above, the observation residual z k is a value calculated using the state vector x and the observation value vector y. Based on the observation residual z k , the value indicated by the state vector x and the true value of the state vector are calculated. The magnitude of the error from the value can be expressed. However, since noise is superimposed on the observed value vector y and is a value that varies with the passage of time T, the observation residual z k also varies with the passage of time T.
Therefore, the observation residual comparison unit 420 monitors the observation residual z k [m] for a predetermined period, and sets the maximum value of the norm of the observation residual z k [m] in the predetermined period as the error evaluation value MAX z k [m]. And using the error evaluation value MAX z k [m], the magnitude of the error between the value indicated by the state vector x k and the true value of the state vector is evaluated.
Thus, the observed residual comparing unit 420 can be reduced in evaluating the magnitude of the error between the value and the true value indicated by the state vector x k, the effects of measurement error or noise of the various sensors, the Kalman filter KF which the smallest error between the true value of the value indicated by the state vector x k and the state vector, it is possible to correctly select.

なお、本実施形態では、一定期間における観測残差z[m]のノルムの最大値を誤差評価値MAX[m]として採用するが、本発明はこのような形態に限定されるものではなく、観測残差z[m]の一部の要素のノルムの所定期間における最大値を誤差評価値として採用してもよい。例えば、観測残差比較部420は、観測残差z[m]を構成する要素のうち、観測値ベクトルyの磁気データqに対応する要素について一定期間モニターし、当該要素のノルムの最大値を誤差評価値として採用するものであってもよい。 In the present embodiment, the maximum value of the norm of the observation residual z k [m] in a certain period is adopted as the error evaluation value MAX z k [m]. However, the present invention is limited to such a form. Instead, the maximum value in a predetermined period of the norm of some elements of the observation residual z k [m] may be adopted as the error evaluation value. For example, the observation residual comparison unit 420 monitors, for a certain period, elements corresponding to the magnetic data q k of the observation vector y k among the elements constituting the observation residual z k [m], and determines the norm of the element's norm. The maximum value may be adopted as the error evaluation value.

また、本実施形態では、状態ベクトルxの示す値と状態ベクトルの真値との誤差の大きさを評価する値として、観測残差z[m]に基づいて定められる誤差評価値MAX[m]を用いるが、本発明はこれに限定するものではなく、誤差評価値MAX[m]以外であっても、状態ベクトルxの示す値と状態ベクトルの真値との誤差の大きさを評価することのできる値であれば、いかなる値を用いてもよい。 In the present embodiment, the error evaluation value MAX z determined based on the observation residual z k [m] is used as a value for evaluating the magnitude of the error between the value indicated by the state vector x k and the true value of the state vector. Although k [m] is used, the present invention is not limited to this. Even if the error evaluation value is not MAX z k [m], the error between the value indicated by the state vector x k and the true value of the state vector is used. Any value can be used as long as the value can be evaluated.

収束度判定部440は、10個のカルマンフィルタKF[1]〜KF[10]のそれぞれが出力する状態ベクトルの推定誤差の共分散P [1]〜P [10]のうち、選択値Selが示すカルマンフィルタKF[Sel]が出力する状態ベクトルの推定誤差の共分散P [Sel]のトレースTr(P [Sel])を、収束評価値として採用する。そして、収束度判定部440は、収束評価値Tr(P [Sel])が、閾値PTH以下であるか否かを判定し、判定結果を出力する。 The degree-of-convergence determination unit 440 selects among the covariances P + k [1] to P + k [10] of the estimation errors of the state vectors output from each of the ten Kalman filters KF [1] to KF [10]. The trace Tr (P + k [Sel]) of the covariance P + k [Sel] of the estimation error of the state vector output by the Kalman filter KF [Sel] indicated by the value Sel is adopted as the convergence evaluation value. Then, the convergence determination unit 440 determines whether or not the convergence evaluation value Tr (P + k [Sel]) is equal to or less than the threshold value P TH and outputs the determination result.

一般的に、共分散行列の固有値は、当該固有値に対応する固有ベクトル方向の分散の大きさを表す。また、ある行列のトレース(対角成分)は、当該ある行列の有する複数の固有値の和を表す。つまり、共分散行列のトレースは、当該共分散行列の全ての固有ベクトルの方向の分散の大きさの和を表す値である。従って、収束評価値Tr(P [Sel])によって、状態ベクトルxの推定誤差の大きさ、つまり状態ベクトルxの収束の程度を表すことができる。
一方、状態ベクトルxは、初期状態T=0から時刻T=k−1に至る全ての状態ベクトルx〜xk−1を考慮して、更新される値であるため、状態ベクトルの推定誤差の共分散P も、初期状態T=0から時刻T=k−1に至る全ての状態ベクトルの推定誤差の共分散P 〜P k−1を考慮した値となる。よって、収束評価値Tr(P [Sel])は、初期状態T=0から時刻T=k−1に至るまでの期間における、状態ベクトルx〜xk−1の推定誤差を考慮した値となる。つまり、収束評価値Tr(P [Sel])が小さな値となる場合、状態ベクトルxの推定誤差が小さな値で安定していると看做すことができる。例えば、時刻T=kにおいて、状態ベクトルxの各要素が真値に近い値を示していれば、時刻T=k以降においても、状態ベクトルxの各要素が真値に近い値を示す可能性が高い。
このような収束評価値Tr(P [Sel])を用いることにより、カルマンフィルタKF[Sel]の有する状態ベクトルxの収束の程度を評価することができる。そして、収束評価値Tr(P [Sel])が、閾値PTH以下である場合(すなわち、状態ベクトルxが収束していると看做すことができる場合)、カルマンフィルタKF[Sel]は、システムの状態の正確な推定を安定的に行っていると看做すことができる。
In general, the eigenvalue of the covariance matrix represents the magnitude of variance in the eigenvector direction corresponding to the eigenvalue. A trace (diagonal component) of a certain matrix represents the sum of a plurality of eigenvalues of the certain matrix. That is, the covariance matrix trace is a value representing the sum of the magnitudes of the variances in the direction of all eigenvectors of the covariance matrix. Therefore, the convergence evaluation value Tr (P + k [Sel] ), can be expressed magnitude of the estimation error of the state vector x k, that is, the degree of convergence of the state vector x k.
On the other hand, the state vector x k, taking into account all of the state vector x 0 ~x k-1, from the initial state T = 0 at time T = k-1, because it is a value to be updated, the estimation of the state vector The error covariance P + k is also a value that takes into account the covariances P + 0 to P + k−1 of the estimation errors of all state vectors from the initial state T = 0 to the time T = k−1. Therefore, the convergence evaluation value Tr (P + k [Sel] ) is in the period from the initial state T = 0 up to time T = k-1, using an estimation error of the state vector x 0 ~x k-1 Value. That is, if the convergence evaluation value Tr (P + k [Sel] ) becomes a small value can be regarded as an estimated error of the state vector x k is stable at a small value. For example, if each element of the state vector x k shows a value close to the true value at time T = k, each element of the state vector x can show a value close to the true value even after time T = k. High nature.
By using such a convergence evaluation value Tr (P + k [Sel]), the degree of convergence of the state vector x k of the Kalman filter KF [Sel] can be evaluated. When the convergence evaluation value Tr (P + k [Sel]) is equal to or less than the threshold value P TH (that is, when it can be considered that the state vector x k has converged), the Kalman filter KF [Sel] Can be regarded as stably performing an accurate estimation of the state of the system.

なお、本実施形態では、状態ベクトルxの収束の程度を表す収束評価値として、状態ベクトルの推定誤差の共分散P [Sel]のトレースTr(P [Sel])を採用するが、本発明はこれに限定するものではなく、収束評価値Tr(P [Sel])以外であっても、状態ベクトルxの収束の程度を表す値であれば、いかなる値を用いてもよい。
例えば、収束度判定部440は、状態ベクトルの推定誤差の共分散P [Sel]の最大固有値を収束評価値として採用してもよい。すなわち、収束度判定部440は、状態ベクトルの推定誤差の共分散P [Sel]の最大固有値が、予め定めた閾値以下であるか否かを判定するものであってもよい。この場合、状態ベクトルの推定誤差の共分散P [Sel]の最大固有値が、閾値以下であれば、状態ベクトルxの推定誤差が小さな値で安定している(つまり、状態ベクトルxが収束している)と看做すことができる。
In the present embodiment, as convergent evaluation value representing the degree of convergence of the state vector x k, employing the trace of the covariance P + k of the estimated error of the state vector [Sel] Tr (P + k [Sel]) However, the present invention is not limited to this, and any value other than the convergence evaluation value Tr (P + k [Sel]) may be used as long as the value represents the degree of convergence of the state vector x k. May be.
For example, the convergence determination unit 440 may employ the maximum eigenvalue of the state vector estimation error covariance P + k [Sel] as the convergence evaluation value. That is, the convergence determination unit 440 may determine whether or not the maximum eigenvalue of the state vector estimation error covariance P + k [Sel] is equal to or less than a predetermined threshold. In this case, if the maximum eigenvalue of the state vector estimation error covariance P + k [Sel] is less than or equal to the threshold, the state vector x k estimation error is stable at a small value (that is, the state vector x k Is converged).

なお、収束度判定部440は、カルマンフィルタ部300が共分散P [1]〜P [10]の全てを出力する場合のみ、処理を実行する。例えば、CPU10は、カルマンフィルタ部300が共分散P [1]〜P [10]のうち1個の共分散P [m]のみを出力する場合、収束度判定部440の動作を停止させる。 The convergence determination unit 440 executes processing only when the Kalman filter unit 300 outputs all of the covariances P + k [1] to P + k [10]. For example, when the Kalman filter unit 300 outputs only one covariance P + k [m] among the covariances P + k [1] to P + k [10], the CPU 10 operates the convergence degree determination unit 440. Stop.

停止制御部460は、収束度判定部440が出力する判定結果が閾値PTH以下である場合、比較部422が出力する選択値Selが示すカルマンフィルタKF[Sel]以外の9個のカルマンフィルタKFの動作を停止させる制御信号Ctrを出力する。 Stop control unit 460, the degree of convergence when the determination unit 440 a judgment result output is equal to or smaller than the threshold P TH, the operation of nine Kalman filter KF except Kalman filter KF [Sel] showing the selected value Sel the comparison unit 422 outputs A control signal Ctr for stopping is output.

出力情報生成部500は、カルマンフィルタ制御部400が選択したカルマンフィルタKF[Sel]から出力される状態ベクトルx[Sel]に基づいて、携帯機器1の姿勢や、携帯機器1から見た地磁気の向きなどの出力情報を生成する。
なお、出力情報生成部500は、カルマンフィルタ部300から、複数の状態ベクトルx[1]〜x[10]が出力されている場合には、出力情報の生成は行わず、カルマンフィルタ部300から、単一の状態ベクトルx[Sel]が出力される場合のみ、出力情報の生成を行う。
Based on the state vector x k [Sel] output from the Kalman filter KF [Sel] selected by the Kalman filter control unit 400, the output information generation unit 500 determines the orientation of the mobile device 1 and the geomagnetism direction viewed from the mobile device 1. Generate output information such as
The output information generation unit 500 does not generate output information when the plurality of state vectors x k [1] to x k [10] are output from the Kalman filter unit 300, and does not generate output information. Only when a single state vector x k [Sel] is output, output information is generated.

前述のとおり、非線形カルマンフィルタの演算は、時刻T=kにおける状態ベクトルxkを、観測残差zと時刻T=k−1における状態ベクトルxk−1とに基づいて算出する。すなわち、状態ベクトルxは、初期状態(時刻T=0)から時刻T=k−1に至る全ての状態ベクトルx〜xk−1を考慮して、更新される。従って、初期ベクトルINIが、時刻T=0における状態ベクトルの真値から大きく乖離した値に設定された場合、カルマンフィルタ演算処理を行っても、状態ベクトルxの示す値が状態ベクトルの真値に近い値に収束するまでに長い時間を要し、更には状態ベクトルxの示す値が状態ベクトルの真値に近づかないこともある。
これに対して、本実施形態に係る状態推定装置は、10個のカルマンフィルタKF[1]〜KF[10]に、互いに異なる10個の初期ベクトルINI[1]〜INI[10]を供給し、これら10個のカルマンフィルタKF[1]〜KF[10]を並列で動作させる。そして、状態推定装置は、推定精度が最も高いカルマンフィルタKF[Sel]を特定し、特定された1個のカルマンフィルタKF[Sel]から出力される状態ベクトルx[Sel]に基づいて、出力情報を生成する。
このように、本実施形態に係る状態推定装置は、10個の初期ベクトルINI[1]〜INI[10]のうち、時刻T=0における状態ベクトルの真値に近い値に設定された初期ベクトルINI[Sel]に基づいて動作するカルマンフィルタKF[Sel]により状態推定を行うため、状態ベクトルxの正確且つ高速な収束が可能となった。すなわち、本実施形態に係る状態推定装置によれば、正確且つ高速な状態推定を行うことが可能となる。
As described above, the calculation of the nonlinear Kalman filter calculates the state vector xk at time T = k based on the observation residual z k and the state vector x k−1 at time T = k−1. That is, the state vector x k, taking into account all of the state vector leading from the initial state (time T = 0) at time T = k-1 x 0 ~x k-1, is updated. Therefore, when the initial vector INI is set to a value greatly deviating from the true value of the state vector at time T = 0, the value indicated by the state vector x k becomes the true value of the state vector even if the Kalman filter calculation process is performed. It takes a long time to converge to a close value, and the value indicated by the state vector x k may not approach the true value of the state vector.
On the other hand, the state estimation apparatus according to the present embodiment supplies ten different initial vectors INI [1] to INI [10] to the ten Kalman filters KF [1] to KF [10], These ten Kalman filters KF [1] to KF [10] are operated in parallel. Then, the state estimation device identifies the Kalman filter KF [Sel] having the highest estimation accuracy, and outputs the output information based on the state vector x k [Sel] output from the identified one Kalman filter KF [Sel]. Generate.
As described above, the state estimation apparatus according to the present embodiment is the initial vector set to a value close to the true value of the state vector at time T = 0 among the ten initial vectors INI [1] to INI [10]. to perform the state estimation by the Kalman filter KF [Sel] which operates based on the INI [Sel], it enabled the accurate and fast convergence of the state vector x k. That is, according to the state estimation device according to the present embodiment, accurate and high-speed state estimation can be performed.

[2. 状態推定装置の処理フロー]
図4は、状態推定装置の動作を説明するためのフローチャートである。
このフローチャートに示される処理は、CPU10が、状態推定プログラム100を実行することにより実施される。
[2. Processing flow of state estimation device]
FIG. 4 is a flowchart for explaining the operation of the state estimation apparatus.
The processing shown in this flowchart is performed by the CPU 10 executing the state estimation program 100.

ステップS101において、CPU10は、初期ベクトル生成処理を実行する。具体的には、CPU10は、複数の初期ベクトルINI[1]〜INI[10]を生成する。
すなわち、CPU10は、ステップS101の初期ベクトル生成処理を実行することにより、初期値生成部200として機能する。
In step S101, the CPU 10 executes initial vector generation processing. Specifically, the CPU 10 generates a plurality of initial vectors INI [1] to INI [10].
That is, the CPU 10 functions as the initial value generation unit 200 by executing the initial vector generation process of step S101.

ステップS102において、CPU10は、カルマンフィルタ並列演算処理を実行する。具体的には、CPU10は、複数のカルマンフィルタKF[1]〜KF[10]の全てを用いて非線形カルマンフィルタの演算を実行することで、観測残差z[1]〜z[10]と状態ベクトルの推定誤差の共分散P [1]〜P [10]とを生成する。
なお、カルマンフィルタ並列演算処理において、CPU10は、第1のデータ型を用いて(第1演算モードにより)非線形カルマンフィルタの演算を行う。
In step S102, the CPU 10 executes a Kalman filter parallel calculation process. Specifically, the CPU 10 performs the operation of the nonlinear Kalman filter using all of the plurality of Kalman filters KF [1] to KF [10], thereby obtaining the observation residuals z k [1] to z k [10]. The state vector estimation error covariances P + k [1] to P + k [10] are generated.
In the Kalman filter parallel calculation process, the CPU 10 performs the calculation of the nonlinear Kalman filter using the first data type (in the first calculation mode).

カルマンフィルタ並列演算処理は、10個のカルマンフィルタKF[1]〜KF[10]を並列に動作させる処理であるため、処理負荷が大きい。
しかし、本実施形態に係る状態推定装置は、データサイズの最も小さな第1のデータ型を用いた第1演算モードによりカルマンフィルタ並列演算処理を行うため、処理負荷を大きく増加させることなく、並列処理を実行することができる。
Since the Kalman filter parallel calculation process is a process of operating ten Kalman filters KF [1] to KF [10] in parallel, the processing load is large.
However, since the state estimation apparatus according to the present embodiment performs the Kalman filter parallel calculation processing in the first calculation mode using the first data type having the smallest data size, the parallel processing can be performed without greatly increasing the processing load. Can be executed.

ステップS103において、CPU10は、観測残差比較処理を実行する。具体的には、CPU10は、ステップS102のカルマンフィルタ並列演算処理において生成された観測残差z[1]〜z[10]に基づいて、誤差評価値MAX[1]〜MAX[10]を算出することにより、状態ベクトルxの示す値と状態ベクトルの真値との誤差が最も小さなカルマンフィルタKF[Sel]を選択する。
すなわち、CPU10は、ステップS103の観測残差比較処理を実行することにより、観測残差比較部420として機能する。
In step S103, the CPU 10 executes an observation residual comparison process. Specifically, the CPU 10 determines the error evaluation values MAX z k [1] to MAX z k based on the observation residuals z k [1] to z k [10] generated in the Kalman filter parallel calculation processing in step S102. by calculating [10], the error between the true value of the values and the state vector indicating the state vector x k to select the smallest Kalman filter KF [Sel].
That is, the CPU 10 functions as the observation residual comparison unit 420 by executing the observation residual comparison processing in step S103.

ステップS104において、CPU10は、収束度判定処理を実行する。具体的には、CPU10は、ステップS102のカルマンフィルタ並列演算処理において生成された状態ベクトルの推定誤差の共分散P [Sel]に基づいて、収束評価値Tr(P [Sel])を算出し、収束評価値Tr(P [Sel])が閾値PTH以下であるか否かを判定する。
判定結果が肯定である場合(つまり、収束評価値Tr(P [Sel])が閾値PTH以下である場合)、CPU10は処理をステップS105に進める。一方、判定結果が否定である場合、CPU10は処理をステップS102に戻す。
すなわち、CPU10は、ステップS104の収束度判定処理を実行することにより、収束度判定部440として機能する。
In step S104, the CPU 10 executes a convergence determination process. Specifically, the CPU 10 calculates the convergence evaluation value Tr (P + k [Sel]) based on the covariance P + k [Sel] of the estimation error of the state vector generated in the Kalman filter parallel calculation process in step S102. It is calculated, and it is determined whether or not the convergence evaluation value Tr (P + k [Sel]) is equal to or less than the threshold value P TH .
When the determination result is affirmative (that is, when the convergence evaluation value Tr (P + k [Sel]) is equal to or less than the threshold value P TH ), the CPU 10 advances the process to step S105. On the other hand, when the determination result is negative, the CPU 10 returns the process to step S102.
That is, the CPU 10 functions as the convergence determination unit 440 by executing the convergence determination process in step S104.

ステップS105において、CPU10は、カルマンフィルタ停止処理を実行する。具体的には、CPU10は、カルマンフィルタKF[Sel]以外の9個のカルマンフィルタの動作を停止させる。
すなわち、CPU10は、ステップS105のカルマンフィルタ停止処理を実行することにより、停止制御部460として機能する。
In step S105, the CPU 10 executes a Kalman filter stop process. Specifically, the CPU 10 stops the operations of the nine Kalman filters other than the Kalman filter KF [Sel].
That is, the CPU 10 functions as the stop control unit 460 by executing the Kalman filter stop process in step S105.

なお、CPU10は、観測残差比較処理(ステップS103)及び収束度判定処理(ステップS104)を実行する間も、カルマンフィルタ並列演算処理を実施する。つまり、ステップS105のカルマンフィルタ停止処理において、CPU10が9個のカルマンフィルタの動作を停止させるまでは、CPU10は、10個のカルマンフィルタKF[1]〜KF[10]の全てを用いた非線形カルマンフィルタの並列演算を継続する。   Note that the CPU 10 also performs the Kalman filter parallel calculation process while executing the observation residual comparison process (step S103) and the convergence determination process (step S104). That is, in the Kalman filter stop process in step S105, the CPU 10 performs parallel calculation of the nonlinear Kalman filter using all the ten Kalman filters KF [1] to KF [10] until the CPU 10 stops the operation of the nine Kalman filters. Continue.

ステップS106において、CPU10は、カルマンフィルタ単独演算処理を実行する。具体的には、CPU10は、1個のカルマンフィルタKF[Sel]のみを用いて非線形カルマンフィルタの演算を行う。カルマンフィルタ単独演算処理において、CPU10は、第2のデータ型を用いる第2演算モードにより、カルマンフィルタKF[Sel]を動作させることで、非線形カルマンフィルタの演算を行う。
また、CPU10は、ステップS106のカルマンフィルタ単独演算処理において、カルマンフィルタKF[Sel]が周期的に更新する状態ベクトルxを逐次出力する。
すなわち、CPU10は、ステップS102のカルマンフィルタ並列演算処理と、ステップS106のカルマンフィルタ単独演算処理とを実行することにより、カルマンフィルタ部300として機能する。
In step S106, the CPU 10 executes a Kalman filter single calculation process. Specifically, the CPU 10 performs a nonlinear Kalman filter calculation using only one Kalman filter KF [Sel]. In the Kalman filter single calculation process, the CPU 10 calculates the nonlinear Kalman filter by operating the Kalman filter KF [Sel] in the second calculation mode using the second data type.
Further, CPU 10, in the Kalman filter alone processing of step S106, the Kalman filter KF [Sel] is sequentially outputs the state vector x k which periodically updated.
That is, the CPU 10 functions as the Kalman filter unit 300 by executing the Kalman filter parallel calculation process in step S102 and the Kalman filter single calculation process in step S106.

ステップS107において、CPU10は、出力情報生成処理を実行する。具体的には、CPU10は、ステップS106のカルマンフィルタ単独演算処理において出力された状態ベクトルxに基づいて、出力情報を生成する。本実施形態に係る状態推定装置の出力情報は、携帯機器1の姿勢μである。
CPU10は、ステップS107の出力情報生成処理を実行することにより、出力情報生成部500として機能する。
なお、本実施形態では、ステップS107の出力情報生成処理において、CPU10は、姿勢μを出力情報として生成するが、本発明はこれに限定されるものではなく、姿勢μ以外の値(例えば、3次元磁気センサ70のオフセット推定値c)を出力情報として生成してもよい。また、本実施形態では、CPU10は、状態ベクトルxのみに基づいて出力情報を生成するが、状態ベクトルx以外の情報(例えば、観測値ベクトルy)を用いて出力情報を生成しても構わない。例えば、CPU10は、磁気センサのオフセット推定値c及び磁気データqに基づいて、地上に固定された座標系における地磁気の向きを算出してもよい。
In step S107, the CPU 10 executes output information generation processing. Specifically, the CPU 10 generates output information based on the state vector x k output in the Kalman filter single calculation process in step S106. The output information of the state estimation device according to the present embodiment is the attitude μ of the mobile device 1.
The CPU 10 functions as the output information generation unit 500 by executing the output information generation processing in step S107.
In the present embodiment, in the output information generation process in step S107, the CPU 10 generates the posture μ as output information. However, the present invention is not limited to this, and values other than the posture μ (for example, 3 The offset estimated value c O ) of the dimensional magnetic sensor 70 may be generated as output information. In the present embodiment, the CPU 10 generates output information based only on the state vector x k, but generates output information using information other than the state vector x k (for example, the observed value vector y k ). It doesn't matter. For example, CPU 10, based on the offset estimate c O and magnetic data q of the magnetic sensor, may be calculated geomagnetic orientation in the coordinate system fixed on the ground.

ステップS106のカルマンフィルタ単独演算処理は、1個のカルマンフィルタKF[Sel]のみを動作させる処理であるため、処理負荷は、ステップS102のカルマンフィルタ並列演算処理に比べて小さい。一方、ステップS107の出力情報生成処理において生成される出力情報は、カルマンフィルタ単独演算処理において出力される状態ベクトルxに基づいて生成されるため、カルマンフィルタ単独演算処理の演算の精度は高いことが好ましい。
本実施形態では、CPU10は、第2のデータ型を用いる第2演算モードによりカルマンフィルタ単独演算処理を行うため、精度の高い状態ベクトルxを算出することができる。これにより、状態推定装置は、正確な出力情報を算出することが可能となる。
Since the Kalman filter single calculation process in step S106 is a process that operates only one Kalman filter KF [Sel], the processing load is smaller than the Kalman filter parallel calculation process in step S102. Meanwhile, the output information generated in the output information generation processing in step S107, because it is generated based on the state vector x k which is output in the Kalman filter alone processing, higher is preferably precision of calculation of the Kalman filter alone processing .
In the present embodiment, CPU 10 is the second operational mode using a second data type for performing Kalman filter alone operation processing, it is possible to calculate the high state vector x k precision. As a result, the state estimation device can calculate accurate output information.

次に、CPU10は、状態推定プログラム100を終了する終了条件を充足するか否かを判定する(ステップS108)。終了条件は、携帯機器1の仕様等に基づいて適宜定めればよい。例えば、携帯機器1の電源がオフ状態になることを終了条件としてもよい。終了条件を充足する場合、CPU10は、当該フローチャートに示す状態推定処理を終了する。一方、終了条件を充足しない場合、CPU10は、処理をステップS106に進める。   Next, the CPU 10 determines whether or not an end condition for ending the state estimation program 100 is satisfied (step S108). The termination condition may be determined as appropriate based on the specifications of the mobile device 1 and the like. For example, the end condition may be that the mobile device 1 is turned off. When the end condition is satisfied, the CPU 10 ends the state estimation process shown in the flowchart. On the other hand, when the end condition is not satisfied, the CPU 10 advances the process to step S106.

[3. 初期ベクトルの生成]
前述のとおり、初期値生成部200は、初期ベクトルINI[1]〜INI[10]を生成する。この初期ベクトルINI[1]〜INI[10]は、時刻T=0における状態ベクトルの真値に近い値を示すものが少なくとも1つ含まれるように生成すれば、どのような方法で生成しても構わない。
以下において、初期ベクトルINI[1]〜INI[10]の各要素の生成方法の一例を示す。
[3. Initial vector generation]
As described above, the initial value generation unit 200 generates initial vectors INI [1] to INI [10]. The initial vectors INI [1] to INI [10] can be generated by any method as long as the initial vectors INI [1] to INI [10] are generated so as to include at least one value indicating the true value of the state vector at time T = 0. It doesn't matter.
Hereinafter, an example of a method for generating each element of the initial vectors INI [1] to INI [10] will be described.

まず姿勢μの初期値μ[m]は、例えば、以下の式(6)のように設定することが可能である。

Figure 2013088162
First, the initial value μ 0 [m] of the posture μ can be set as in the following Expression (6), for example.
Figure 2013088162

ここで、式(6)に示した姿勢の初期値μ[m]の意味を、図5乃至図7を用いて説明する。なお、図5乃至図7は、理解を容易にするために、初期姿勢を、ティーポットの図形を用いて例示する。
まず、図5に示すように、初期値μ[1]を定める。初期値μ[1]は、どのような値に設定してもよいが、本実施形態では、式(6)に示すように基本姿勢(つまり、携帯機器1に固定された座標系の各軸と、地上に固定された座標系の各軸とが一致する姿勢)を、初期値μ[1]とする。
次に、図5に示すように、地上に固定された座標系におけるz軸を回転軸として、初期値μ[1]をそれぞれ90度、180度、270度回転させて3つの姿勢を生成し、これら3つの姿勢を、それぞれ、初期値μ[2]、μ[3]、μ[4]とする。
また、図6に示すように、地上に固定された座標系におけるy軸を回転軸として、初期値μ[1]をそれぞれ90度、180度、270度回転させて3つの姿勢を生成し、これら3つの姿勢を、それぞれ、初期値μ[5]、μ[6]、μ[7]とする。
同様に、図7に示すように、地上に固定された座標系におけるx軸を回転軸として、初期値μ[1]をそれぞれ90度、180度、270度回転させて3つの姿勢を生成し、これら3つの姿勢を、それぞれ、初期値μ[8]、μ[9]、μ[10]とする。
初期値生成部200は、以上に示した互いに異なる10個の初期値μ[1]〜μ[10]を生成し、それぞれ、初期ベクトルINI[1]〜INI[10]の要素とする。
Here, the meaning of the initial value μ 0 [m] of the posture shown in Expression (6) will be described with reference to FIGS. 5 to 7 illustrate the initial posture using a teapot figure for easy understanding.
First, as shown in FIG. 5, an initial value μ 0 [1] is determined. The initial value μ 0 [1] may be set to any value, but in this embodiment, as shown in Expression (6), each of the basic postures (that is, each coordinate system fixed to the mobile device 1) The posture in which the axis and each axis of the coordinate system fixed on the ground coincide) is defined as an initial value μ 0 [1].
Next, as shown in FIG. 5, the initial value μ 0 [1] is rotated by 90 degrees, 180 degrees, and 270 degrees, respectively, with the z axis in the coordinate system fixed on the ground as the rotation axis, and three postures are generated. These three postures are assumed to have initial values μ 0 [2], μ 0 [3], and μ 0 [4], respectively.
Further, as shown in FIG. 6, three postures are generated by rotating the initial value μ 0 [1] by 90 degrees, 180 degrees, and 270 degrees, respectively, with the y axis in the coordinate system fixed on the ground as the rotation axis. These three postures are set as initial values μ 0 [5], μ 0 [6], and μ 0 [7], respectively.
Similarly, as shown in FIG. 7, the initial value μ 0 [1] is rotated by 90 °, 180 °, and 270 °, respectively, with the x axis in the coordinate system fixed on the ground as the rotation axis, and three postures are generated. These three postures are set to initial values μ 0 [8], μ 0 [9], and μ 0 [10], respectively.
The initial value generation unit 200 generates more than ten initial value mu 0 mutually different as shown in [1] ~μ 0 [10] , respectively, as an element of the initial vector INI [1] ~INI [10] .

仮に、姿勢μの初期値μを、事前に定められた1つの固定値(例えば、μ=[0,0,0,1])に定める場合、初期値μは真の姿勢(真値)から最大で180度ずれることになる。
これに対して、本実施形態に係る初期値生成部200は、基本姿勢を90度ずつ回転させることで、10個の初期姿勢を定める。この場合、10個の初期姿勢のうち、真の姿勢に最も近い初期姿勢と、真の姿勢とのなす角度は、90度以下となる。従って、本実施形態に係る初期値生成部200は、携帯機器1がどのような姿勢であっても、真値に近い値となる初期値μ[m]を要素とする初期ベクトルINI[m]を生成することができる。
If the initial value μ 0 of the posture μ is set to one predetermined fixed value (for example, μ 0 = [ 0 , 0 , 0 , 1]), the initial value μ 0 is a true posture (true Value) is 180 degrees at the maximum.
In contrast, the initial value generation unit 200 according to the present embodiment determines ten initial postures by rotating the basic posture by 90 degrees. In this case, of the ten initial postures, the angle formed between the initial posture closest to the true posture and the true posture is 90 degrees or less. Therefore, the initial value generation unit 200 according to the present embodiment has an initial vector INI [m [m] whose initial value μ 0 [m] is a value close to the true value regardless of the posture of the mobile device 1. ] Can be generated.

次に、3次元磁気センサ70のオフセット推定値cの初期値cO,0について、生成方法の一例を述べる。
前述のとおり、磁気センサのオフセットは、携帯機器1に搭載された部品が発する内部磁界の方向及び大きさを、携帯機器1に固定された座標系において表現したベクトルである。内部磁界は、3次元磁気センサ70の検出対象である地磁気に比べて大きな磁界となる場合があり、内部磁界を無視した場合には、正確な地磁気の向きを算出することはできない。従って、地磁気の向きを正確に算出するためには、オフセットを正確に把握し、3次元磁気センサ70が出力する磁気データqから、オフセットを減算することが必要となる。
しかし、3次元磁気センサ70のオフセット推定値cの初期値cO,0に対して、事前に定められた固定値(例えば、原点[0,0,0]等)を適用する場合、磁気センサのオフセット推定値cの初期値cO,0が、磁気センサの真のオフセット(真値)から大きく乖離した値となる可能性が高い。
Next, an example of a method for generating the initial value c O, 0 of the offset estimated value c O of the three-dimensional magnetic sensor 70 will be described.
As described above, the offset of the magnetic sensor is a vector representing the direction and magnitude of the internal magnetic field generated by the component mounted on the mobile device 1 in the coordinate system fixed to the mobile device 1. The internal magnetic field may be a larger magnetic field than the geomagnetism that is the detection target of the three-dimensional magnetic sensor 70. If the internal magnetic field is ignored, it is not possible to calculate an accurate geomagnetic direction. Therefore, in order to accurately calculate the direction of geomagnetism, it is necessary to accurately grasp the offset and subtract the offset from the magnetic data q output from the three-dimensional magnetic sensor 70.
However, when a predetermined fixed value (for example, the origin [0, 0, 0] T ) is applied to the initial value c O, 0 of the offset estimated value c O of the three-dimensional magnetic sensor 70, There is a high possibility that the initial value c O, 0 of the offset estimated value c O of the magnetic sensor is a value greatly deviating from the true offset (true value) of the magnetic sensor.

本実施形態に係る初期値生成部200は、3次元磁気センサ70のオフセット推定値cの初期値cO,0[m]を、姿勢μの初期値μ[m]に基づいて算出する。
具体的には、本実施形態に係る初期値生成部200は、3次元磁気センサ70のオフセット推定値cの初期値cO,0[m]を、時刻T=0に3次元磁気センサ70が観測する磁気データq、姿勢の初期値μ[m]、式(9)に示すベクトルBg、及び、式(8)に示す行列B(μ)を用いて、以下に示す式(7)で与えられる値に設定する。ここで、行列B(μ)は、携帯機器1が姿勢μである場合に、地上に固定された座標系において表現されたベクトルを、携帯機器1に固定された座標系において表現するための座標変換を行う行列である。また、式(9)に示すベクトルBgは、地上に固定された座標系において携帯機器1を使用する地域の地磁気の向き及び大きさを表すベクトルである。なお、本実施形態では、地上に固定された座標系は、y軸が磁極北を向き、z軸が鉛直上を向くように定められることとする。
なお、ROM30には、位置情報と地磁気ベクトルBgとを対応づけて記憶したルックアップテーブルLUT2が記憶されている。初期値生成部200は、GPS部60で生成される位置情報に基づいてルックアップテーブルLUT2を参照して地磁気ベクトルBgを取得し、式(7)を演算することによって、磁気センサのオフセット推定値cの初期値cO,0[m]を得る。

Figure 2013088162
The initial value generation unit 200 according to the present embodiment calculates the initial value c O, 0 [m] of the offset estimated value c O of the three-dimensional magnetic sensor 70 based on the initial value μ 0 [m] of the posture μ. .
Specifically, the initial value generation unit 200 according to the present embodiment uses the initial value c O, 0 [m] of the estimated offset value c O of the three-dimensional magnetic sensor 70 as the three-dimensional magnetic sensor 70 at time T = 0. Using the magnetic data q 0 , the initial value μ 0 [m] of the posture, the vector Bg shown in Equation (9), and the matrix B (μ) shown in Equation (8), ) Is set to the value given by. Here, the matrix B (μ) is a coordinate for expressing a vector expressed in the coordinate system fixed on the ground in the coordinate system fixed to the mobile device 1 when the mobile device 1 is in the posture μ. This is the matrix that performs the conversion. A vector Bg shown in Expression (9) is a vector representing the direction and magnitude of geomagnetism in the area where the mobile device 1 is used in the coordinate system fixed on the ground. In the present embodiment, the coordinate system fixed on the ground is determined so that the y-axis faces the magnetic pole north and the z-axis faces vertically upward.
The ROM 30 stores a lookup table LUT2 that stores the positional information and the geomagnetic vector Bg in association with each other. The initial value generation unit 200 refers to the lookup table LUT2 based on the position information generated by the GPS unit 60, acquires the geomagnetic vector Bg, and calculates the offset value of the magnetic sensor by calculating Expression (7). the initial value c O of c O, 0 to obtain a [m].
Figure 2013088162

前述のとおり、10個の初期値μ[1]〜μ[10]の中には、真の姿勢に近い値となるものが含まれるため、10個の初期値cO,0[1]〜cO,0[10]の中には、磁気センサの真のオフセット(真値)に近い値となるものが含まれる。従って、本実施形態に係る初期値生成部200は、真のオフセットに近い値を有する3次元磁気センサ70のオフセット推定値cの初期値cO,0[m]を要素とする初期ベクトルINI[m]を生成することができる。 As described above, in the ten initial value μ 0 [1] ~μ 0 [ 10] , since include those a value close to the true position, 10 the initial value c O, 0 [1 ] To c O, 0 [10] include values that are close to the true offset (true value) of the magnetic sensor. Therefore, the initial value generation unit 200 according to the present embodiment has the initial vector INI having the initial value c O, 0 [m] of the offset estimated value c O of the three-dimensional magnetic sensor 70 having a value close to the true offset as an element. [M] can be generated.

地磁気の強さrの初期値r[1]〜r[10]、及び地磁気の伏角φの初期値φ[1]〜φ[10]は、例えば、GPS部60から供給される位置情報に基づいて生成することができる。これは、地球上の位置が特定できれば、その位置における地磁気の強さ及び伏角を知ることができるからである。具体的には、ROM30には、位置情報と地磁気の強さ及び伏角とを対応づけて記憶したルックアップテーブルLUT1が格納される。初期値生成部200は、ルックアップテーブルLUT1を参照して、位置情報に対応する地磁気の強さ及び伏角を、地磁気の強さrの初期値r[1]〜r[10]及び地磁気の伏角φの初期値φ[1]〜φ[10]として設定する。
なお、携帯機器1が衛星からの電波の届かない場所(例えば、地下街)にある場合には、GPS部60から位置情報が得られない。そのような場合には、携帯機器1が使われ得る地域の典型的な値を採用すればよい。その値もルックアップテーブルLUT1に格納されている。初期値生成部200は、位置情報の取得が不能な場合には、典型的な値をルックアップテーブルLUT1から読み出す。例えば、日本で販売された携帯機器1については、明石市の地磁気の強さ及び伏角に基づいて、地磁気の強さrの初期値r[1]〜r[10]、及び地磁気の伏角φの初期値φ[1]〜φ[10]を算出する。
Initial value r 0 [1] of the geomagnetic intensity r ~r 0 [10], and the initial value φ 0 [1] of the geomagnetic dip φ ~φ 0 [10], for example, is supplied from the GPS unit 60 It can be generated based on the position information. This is because if the position on the earth can be specified, the geomagnetic strength and the dip angle at that position can be known. Specifically, the ROM 30 stores a look-up table LUT1 that stores the positional information, the geomagnetic strength, and the dip angle in association with each other. The initial value generation unit 200 refers to the lookup table LUT1 and determines the geomagnetism strength and the dip angle corresponding to the position information, the initial values r 0 [1] to r 0 [10] of the geomagnetism strength r and the geomagnetism. Are set as initial values φ 0 [1] to φ 0 [10].
In addition, when the portable device 1 is in a place where radio waves from the satellite do not reach (for example, an underground shopping center), position information cannot be obtained from the GPS unit 60. In such a case, a typical value in a region where the mobile device 1 can be used may be adopted. The value is also stored in the lookup table LUT1. When the position information cannot be acquired, the initial value generation unit 200 reads a typical value from the lookup table LUT1. For example, for the mobile device 1 sold in Japan, the initial value r 0 [1] to r 0 [10] of the geomagnetism strength r and the geomagnetic dip angle based on the geomagnetism strength and the dip angle of Akashi City. calculates an initial value phi 0 of φ [1] ~φ 0 [10 ].

角速度ωの初期値ω[1]〜ω[10]は、例えば、携帯機器1が静止していることを仮定して、「0」に設定する。また、角速度センサのオフセット推定値bの初期値bO,0[1]〜bO,0[10]は、通常「0」近辺に調整されているため、「0」に設定する。 Angular velocity initial value omega 0 [1] of ω ~ω 0 [10], for example, assuming that the portable device 1 is stationary is set to "0". In addition, the initial value b O, 0 [1] to b O, 0 [10] of the estimated offset value b O of the angular velocity sensor is normally adjusted in the vicinity of “0”, and thus is set to “0”.

このように、本実施形態に係る状態推定装置は、真値に近い値を示すものが少なくとも1個は含まれるように、互いに異なる10個の初期ベクトルINI[1]〜INI[10]を生成し、10個のカルマンフィルタKF[1]〜KF[10]を並列動作させる。
従って、本実施形態に係る状態推定装置は、時刻T=0における状態ベクトルの真値に近い値を示す初期ベクトルINI[m]が供給されて動作するカルマンフィルタKF[m]により、状態ベクトルxを正確且つ高速に収束させることが可能となる。
As described above, the state estimation device according to the present embodiment generates ten different initial vectors INI [1] to INI [10] so that at least one of the values that are close to the true value is included. Ten Kalman filters KF [1] to KF [10] are operated in parallel.
Therefore, the state estimation apparatus according to the present embodiment is supplied with the initial vector INI [m] indicating a value close to the true value of the state vector at time T = 0, and the state vector x k is operated by the Kalman filter KF [m] that operates. Can be accurately and rapidly converged.

[4. 非線形カルマンフィルタによる演算]
次に、非線形カルマンフィルタの演算について説明する。
[4. Calculation using nonlinear Kalman filter]
Next, the calculation of the nonlinear Kalman filter will be described.

一般的に、カルマンフィルタは、動的システムの状態の経時的な変化を表す状態遷移モデルを用いて、ある時刻(時刻T=k−1)のシステムの状態を示す状態ベクトルxk−1から、単位時間が経過した後(時刻T=k)の状態ベクトルxを推定する。この推定値を、推定状態ベクトルx と称する。そして、カルマンフィルタは、各種センサからの出力を要素とする観測値ベクトルyと状態ベクトルxとの関係を表す観測モデルを用いて、推定状態ベクトルx から、観測値ベクトルyを推定する。この推定値を、推定観測値ベクトルy と称する。次に、カルマンフィルタは、推定観測値ベクトルy と、実際の観測値を要素とする観測値ベクトルyとの差分を観測残差zとして算出するとともに、観測残差zに基づいてカルマンゲインKを算出する。その後、カルマンフィルタは、観測残差z、カルマンゲインK、及び、推定状態ベクトルx を用いて、状態ベクトルxを更新し、更新後の状態ベクトルx を算出する。
カルマンフィルタは、以上のような状態ベクトルxの更新を繰り返す演算を行うことにより、状態ベクトルxの各要素を、実際の物理量を正確に表した値(真値)に近い正確な値へと近付ける。
In general, the Kalman filter uses a state transition model that represents a change in the state of a dynamic system over time, from a state vector x k−1 that indicates the state of the system at a certain time (time T = k−1), The state vector x k after the unit time has elapsed (time T = k) is estimated. This estimated value is referred to as an estimated state vector x k . The Kalman filter estimates the observation value vector y k from the estimated state vector x k using an observation model representing the relationship between the observation value vector y k and the state vector x k whose elements are outputs from various sensors. To do. This estimated value is referred to as an estimated observation value vector y k . Next, the Kalman filter estimated observed value vector y - and k, calculates the difference between the observed value vector y k to the actual observed value element as observed residuals z k, based on the observation residuals z k A Kalman gain Kk is calculated. Thereafter, the Kalman filter updates the state vector x k using the observation residual z k , the Kalman gain K k , and the estimated state vector x k , and calculates the updated state vector x + k .
The Kalman filter repeats the update of the state vector x k as described above, thereby converting each element of the state vector x k to an accurate value close to a value (true value) that accurately represents the actual physical quantity. Get closer.

なお、詳細は後述するが、本実施形態ではカルマンフィルタとして、非線形カルマンフィルタであるシグマポイントカルマンフィルタを用いる。シグマポイントカルマンフィルタとは、状態ベクトルxk−1の周囲に複数のシグマポイントχk−1を生成し、これらの複数のシグマポイントχk−1を状態遷移モデルに適用することで、単位時間経過後のシグマポイントχ を推定し、推定された複数のシグマポイントχ の平均を算出することにより、推定状態ベクトルx を求める演算である。従って、推定観測値ベクトルy は、厳密には、推定状態ベクトルx の周辺に存在する複数のシグマポイントχ に基づいて算出される。 Although details will be described later, in this embodiment, a sigma point Kalman filter which is a nonlinear Kalman filter is used as the Kalman filter. The sigma point Kalman filter generates a plurality of sigma points χ k-1 around the state vector x k−1 , and applies these plurality of sigma points χ k-1 to the state transition model. sigma points χ after - by calculating the average of k, the estimated state vector x - - estimates the k, estimated plurality of sigma points χ is a calculation for obtaining a k. Therefore, strictly speaking, the estimated observation value vector y k is calculated based on a plurality of sigma points χ k existing around the estimated state vector x k .

本実施形態における、非線形カルマンフィルタの状態遷移モデルは以下に示す式(10)で与えられ、観測モデルは以下に示す式(11)で与えられる。なお、本実施形態では、式(10)に現れる関数f及び式(11)に現れる関数hは、非線形の関数である。

Figure 2013088162
In this embodiment, the state transition model of the nonlinear Kalman filter is given by the following equation (10), and the observation model is given by the following equation (11). In the present embodiment, the function f appearing in Expression (10) and the function h appearing in Expression (11) are nonlinear functions.
Figure 2013088162

ここで、状態ベクトルxの次元を「dim(x)」と表し、観測値ベクトルyの次元を「dim(y)」と表す。本実施形態では、dim(x)=15であり、dim(y)=9である。また、式(10)に現れるプロセスノイズw及び式(11)に現れる観測ノイズvは、0を中心とするガウスノイズである。
式(10)は、時刻T=kにおける状態ベクトルxが、時刻T=k−1における状態ベクトルxk−1を関数fに代入して得られた値と、時刻T=k−1におけるプロセスノイズwk−1とを加算することにより推定されることを示している。
また、式(11)は、時刻T=kにおける観測値ベクトルyが、時刻T=kにおける状態ベクトルxを関数hに代入して得られる値と、時刻T=kにおける観測ノイズvとを加算することにより推定されることを示している。
なお、プロセスノイズwの共分散をQ、観測ノイズvの共分散をRと表す。
Here, the dimension of the state vector x k represents a "dim (x)", the dimensions of the observed value vector y k is represented as "dim (y)". In the present embodiment, dim (x) = 15 and dim (y) = 9. Further, the process noise w k appearing in the expression (10) and the observation noise v k appearing in the expression (11) are Gaussian noises centered on 0.
Equation (10) shows that the state vector x k at time T = k is obtained by substituting the state vector x k-1 at time T = k−1 for the function f, and at time T = k−1. It is shown that it is estimated by adding the process noise w k−1 .
Equation (11) shows that the observed value vector y k at time T = k is obtained by substituting the state vector x k at time T = k into the function h, and the observed noise v k at time T = k. It shows that it estimates by adding.
Incidentally, representing the covariance of the process noise w k Q k, the covariance of measurement noise v k and R k.

時刻T=kにおける観測残差zは、観測値ベクトルyと、推定観測値ベクトルy とに基づいて定められるベクトルであり、以下に示す式(12)で表される。カルマンフィルタは、以下の式(14)に示すように、観測残差z、推定状態ベクトルx 、及び、式(13)に示すカルマンゲインKを用いて、更新後の状態ベクトルx を算出する。また、カルマンフィルタは、以下の式(15)に示すように、状態ベクトルxの推定誤差の共分散Pを更新する。
ここで、P は、推定状態ベクトルx の推定誤差の共分散であり、P は、更新後の状態ベクトルx の推定誤差の共分散である。また、Pyy は、観測残差zの共分散であり、Pxy は、推定状態ベクトルx と、推定観測値ベクトルy との相互共分散行列である。

Figure 2013088162
The observation residual z k at time T = k is a vector determined based on the observed value vector y k and the estimated observed value vector y k, and is represented by the following equation (12). As shown in the following equation (14), the Kalman filter uses the observed residual z k , the estimated state vector x k , and the Kalman gain K k shown in equation (13) to update the state vector x +. k is calculated. Further, the Kalman filter updates the covariance P k of the estimation error of the state vector x k as shown in the following equation (15).
Here, P k is the covariance of the estimated error of the estimated state vector x k , and P + k is the covariance of the estimated error of the updated state vector x + k . P yy k is a covariance of the observation residual z k , and P xy k is a mutual covariance matrix of the estimated state vector x k and the estimated observation value vector y k .
Figure 2013088162

なお、推定観測値ベクトルy は、式(11)に示すように、状態遷移モデルを用いて算出された推定状態ベクトルx を、観測モデルに適用することで算出される値である。よって、推定観測値ベクトルy と実際のセンサ出力に基づく観測値ベクトルyとの差分である観測残差zに基づいて、推定状態ベクトルx と実際の物理量を正確に表した値(状態ベクトルの真値)との誤差の大きさを評価することが可能である。
式(14)に示すように、観測残差zを用いて、推定状態ベクトルx を、更新後の状態ベクトルx へと更新することにより、状態ベクトルxの各要素を真値に近い値へと近付けることができる。
Note that the estimated observation value vector y - k is a value calculated by applying the estimated state vector x - k calculated using the state transition model to the observation model, as shown in Expression (11). . Therefore, the estimated observed value vector y - based on the observation residuals z k which is a difference between the observed value vector y k based on actual sensor output and k, the estimated state vector x - was accurately represent the actual physical quantity and k It is possible to evaluate the magnitude of the error from the value (the true value of the state vector).
As shown in Expression (14), by using the observation residual z k , the estimated state vector x k is updated to the updated state vector x + k , so that each element of the state vector x k is true. You can get closer to the value.

本実施形態において、10個のカルマンフィルタKF[1]〜KF[10]は、アンセンテッド変換を用いたシグマポイントカルマンフィルタの演算を実行する。以下では、シグマポイントカルマンフィルタの演算について、具体的に説明する。   In the present embodiment, the ten Kalman filters KF [1] to KF [10] execute a sigma point Kalman filter operation using unscented transformation. Hereinafter, the calculation of the sigma point Kalman filter will be described in detail.

図8は、状態推定装置がカルマンフィルタKF[m]を実行することで実現される機能を表す機能ブロック図である。以下、図8を参照しつつ、カルマンフィルタKF[m]の動作について説明する。
なお、10個のカルマンフィルタKF[1]〜KF[10]の構成は同一であり、初期値生成部200からそれぞれ供給される初期ベクトルINI[1]〜INI[10]のみが相違する。
FIG. 8 is a functional block diagram showing functions realized by the state estimation device executing the Kalman filter KF [m]. Hereinafter, the operation of the Kalman filter KF [m] will be described with reference to FIG.
The ten Kalman filters KF [1] to KF [10] have the same configuration, and only the initial vectors INI [1] to INI [10] supplied from the initial value generation unit 200 are different.

遅延部301は、加算器311から出力される更新後の状態ベクトルx を、単位時間(時刻T=k−1から時刻T=kに相当する時間)だけ遅延させることで、状態ベクトルx k−1を生成し、これを、シグマポイント生成部302に対して出力する。なお、初回の演算(時刻T=0)では、遅延部301は、初期値生成部200が出力する初期値INI[m]を、状態ベクトルx k−1として採用する。
また、遅延部301は、減算器312から出力される更新後の状態ベクトルx の推定誤差の共分散P を単位時間遅延させることで、状態ベクトルx k−1の推定誤差の共分散P k−1を生成し、これを、シグマポイント生成部302に対して出力する。
The delay unit 301 delays the updated state vector x + k output from the adder 311 by a unit time (a time corresponding to time T = k from time T = k−1), so that the state vector x + k is delayed. + K−1 is generated and output to the sigma point generation unit 302. In the first calculation (time T = 0), the delay unit 301 employs the initial value INI [m] output from the initial value generation unit 200 as the state vector x + k−1 .
Further, the delay unit 301 delays the estimated error covariance P + k of the updated state vector x + k output from the subtractor 312 by unit time, thereby reducing the estimated error of the state vector x + k−1 . A covariance P + k−1 is generated and output to the sigma point generation unit 302.

シグマポイント生成部302は、「dim(x)」行「dim(x)」列の共分散行列P k−1及びQk−1を用いて、「2dim(x)+1」個のシグマポイントを生成する。具体的には、まず、複数のシグマポイントの平均に対して、平均のまわりのシグマポイントの広がりを表すスケーリングパラメータλを用いて、式(16)及び式(17)に示すベクトルσを定義する。

Figure 2013088162
The sigma point generation unit 302 uses “dim (x)” rows “dim (x)” columns of covariance matrices P + k−1 and Q k−1 to generate “2 dim (x) +1” sigma points. Is generated. Specifically, first, a vector σ k shown in Expression (16) and Expression (17) is defined using a scaling parameter λ representing the spread of sigma points around the average for a plurality of sigma points. To do.
Figure 2013088162

このとき、シグマポイント生成部302は、ベクトルσk−1と状態ベクトルx k−1とに基づいて、式(18)及び式(19)で示される「2dim(x)+1」個のシグマポイントχk−1を生成する。

Figure 2013088162
At this time, the sigma point generation unit 302 performs “2dim (x) +1” sigma expressed by the equations (18) and (19) based on the vector σ k−1 and the state vector x + k−1. Generate the point χ k−1 .
Figure 2013088162

状態遷移モデル部303は、式(20)に示すように、時刻T=k−1における「2dim(x)+1」個のシグマポイントχk−1(j)の各々を、状態遷移モデルに適用することで、時刻T=kにおける「2dim(x)+1」個のシグマポイントの推定値χ (j)を算出する。

Figure 2013088162
The state transition model unit 303 applies each of “2dim (x) +1” sigma points χ k−1 (j) at time T = k−1 to the state transition model, as shown in Expression (20). by estimate of "2dim (x) +1" number of sigma points at time T = k chi - calculating the k (j).
Figure 2013088162

次に、平均算出部304は、式(21)に示すように、時刻T=kにおける「2dim(x)+1」個のシグマポイントの推定値χ の平均値を計算することで、推定状態ベクトルx を算出する。

Figure 2013088162
Then, the average calculation unit 304, as shown in equation (21), the estimated value χ of "2dim (x) +1" number of sigma points at time T = k - to compute the average value of k, the estimated A state vector x - k is calculated.
Figure 2013088162

また、平均算出部304は、式(22)に示す、推定状態ベクトルx の推定誤差の共分散P を算出する。

Figure 2013088162
The average calculation unit 304, shown in equation (22), the estimated state vector x - calculates the k - covariance P of the estimation error of k.
Figure 2013088162

一方、観測モデル部305は、式(23)に示すように、時刻T=kにおける「2dim(x)+1」個のシグマポイントχ(j)の各々を、観測モデルに適用することにより、「2dim(x)+1」個の推定観測値γ(j)を算出する。

Figure 2013088162
On the other hand, the observation model unit 305 applies each of “2dim (x) +1” sigma points χ k (j) at time T = k to the observation model, as shown in Expression (23), “2 dim (x) +1” estimated observation values γ k (j) are calculated.
Figure 2013088162

そして、平均処理部306は、式(24)に示すように、「2dim(x)+1」個の推定観測値γ(j)の平均を演算することにより、推定観測値ベクトルy を算出する。

Figure 2013088162
Then, as shown in Expression (24), the average processing unit 306 calculates an average of “2dim (x) +1” estimated observation values γ k (j) to obtain an estimated observation value vector y k . calculate.
Figure 2013088162

次に、平均処理部306は、式(25)に示す観測残差の共分散Pyy を算出する。

Figure 2013088162
Next, the average processing unit 306 calculates an observation residual covariance P yy k shown in Expression (25).
Figure 2013088162

減算器307は、式(12)に示したように、観測値ベクトルyと、推定観測値ベクトルy との差分として、観測残差zを算出する。カルマンフィルタKF[m]は、この観測残差zを出力する。 The subtractor 307 calculates an observation residual z k as a difference between the observed value vector y k and the estimated observed value vector y k , as shown in Expression (12). The Kalman filter KF [m] outputs this observation residual z k .

カルマンゲイン付与部308は、式(26)に示す相互共分散行列Pxy を算出する。そして、カルマンゲイン付与部308は、式(13)に示したように、観測残差zの共分散Pyy と、相互共分散行列Pxy とに基づいて、カルマンゲインKを算出し、式(14)の右辺第2項(K)の演算を実行する。また、カルマンゲイン付与部308は、式(15)の右辺第2項(Kyy )の演算を実行する。

Figure 2013088162
The Kalman gain assigning unit 308 calculates a mutual covariance matrix P xy k shown in Expression (26). The Kalman gain applying unit 308, as shown in equation (13), calculates a covariance P yy k observation residuals z k, based on the cross-covariance matrix P xy k, the Kalman gain K k Then, the calculation of the second term (K k z k ) on the right side of Expression (14) is executed. In addition, the Kalman gain assigning unit 308 performs the calculation of the second term (K k P yy k K T k ) on the right side of Expression (15).
Figure 2013088162

加算器311は、式(14)に示したように、推定状態ベクトルx と、カルマンゲイン付与部308から出力される式(14)の右辺第2項(K)とを加算することにより、更新後の状態ベクトルx を算出する。カルマンフィルタKF[m]は、更新後の状態ベクトルx を出力する。 The adder 311, as shown in equation (14), the estimated state vector x - addition and k, equation output from the Kalman gain applying unit 308 the second term on the right side of (14) and (K k z k) Thus, the updated state vector x + k is calculated. The Kalman filter KF [m] outputs the updated state vector x + k .

減算器312は、式(15)に示したように、推定状態ベクトルx の推定誤差の共分散P と、カルマンゲイン付与部308から出力される式(15)の右辺第2項(Kyy )との差分として、更新後の状態ベクトルx の推定誤差の共分散P を算出する(すなわち、状態ベクトルの推定誤差の共分散Pを、P からP に更新する)。カルマンフィルタKF[m]は、更新後の状態ベクトルx の推定誤差の共分散P を出力する。 Subtractor 312, as shown in equation (15), the estimated state vector x - estimation error covariance P of k - k and, the second term of the right side of equation (15) output from the Kalman gain applying unit 308 As a difference from (K k P yy k K T k ), an updated state vector x + k estimation error covariance P + k is calculated (ie, the state vector estimation error covariance P k is P - is updated to P + k from k). The Kalman filter KF [m] outputs the covariance P + k of the estimation error of the updated state vector x + k .

次に、状態遷移モデル部303が行う演算で用いられる状態遷移モデルについて説明する。   Next, the state transition model used in the calculation performed by the state transition model unit 303 will be described.

本実施形態に係る状態遷移モデルにおいて、状態ベクトルxを構成する状態変数のうち、姿勢μについての状態遷移は、式(27)により定義される。式(27)は、時刻T=k−1における姿勢μk−1から、単位時間経過後の時刻T=kにおける姿勢μを推定する演算を表す。ここで、μ は、推定状態ベクトルx のうち、姿勢μを表す状態変数に対応する要素である。
なお、式(27)の右辺の演算子Ωは、式(28)により定義される。ここで、I3×3は3行3列の単位行列を表す。3次元ベクトルl=(l,l,l)に対して、演算子[l×]は、式(29)で定義される。また、測定時間間隔(時刻T=k−1から時刻T=kまでの間隔)をΔtで表し、時刻T=kにおける更新後の状態ベクトルx のうち角速度を表す状態変数に対応する要素をω で表したとき、演算子Ωを構成する成分Ψ は、式(30)で定義される。

Figure 2013088162
In the state transition model of the present embodiment, among the state variables that constitute the state vector x k, the state transitions for a posture μ is defined by the equation (27). Expression (27) represents an operation for estimating the posture μ k at time T = k after the elapse of the unit time from the posture μ k−1 at time T = k−1. Here, μ k is an element corresponding to the state variable representing the posture μ in the estimated state vector x k .
Note that the operator Ω on the right side of Expression (27) is defined by Expression (28). Here, I 3 × 3 represents a unit matrix of 3 rows and 3 columns. For the three-dimensional vector l = (l 1 , l 2 , l 3 ), the operator [l ×] is defined by equation (29). Further, the measurement time interval (interval from time T = k−1 to time T = k) is represented by Δt, and the element corresponding to the state variable representing the angular velocity in the state vector x + k after the update at time T = k. Is represented by ω + k , the component Ψ + k constituting the operator Ω is defined by the equation (30).
Figure 2013088162

式(2)に示すように、姿勢μは、クォータニオンで表現され、正規化条件||μ||=1が満たされる必要がある。しかし、シグマポイントカルマンフィルタを用いて状態ベクトルxを更新する場合、更新後の状態ベクトルx は、式(21)に示すように、シグマポイントの推定値χ (i)の平均として算出されるため、(更新前の)状態ベクトルx k−1のノルムと、更新後の状態ベクトルx のノルムとは、異なる値となることがある。従って、シグマポイントカルマンフィルタの演算を行う場合、(更新前の)状態ベクトルx k−1の要素である姿勢μ k−1のノルムと、更新後の状態ベクトルx の要素である姿勢μ のノルムとは、異なる値となる可能性が存在する。つまり、シグマポイントカルマンフィルタの演算を行う場合、姿勢μについての正規化条件が満たされなくなる可能性が存在する。
そこで、姿勢μに対して何らかの演算が行われるときには、演算後の結果をそのベクトル自身の大きさで正規化する。なお、より厳密に正規化条件を保つためには、状態ベクトルxを構成する要素のうち姿勢μについてはMRPs (modified Rodrigues parameters)を用いて前時刻との差分情報だけに限定し、カルマンフィルタの外部にある姿勢情報をカルマンフィルタから得られる差分情報に基づいて更新すればよい。
As shown in Expression (2), the posture μ is expressed by a quaternion, and the normalization condition || μ || = 1 needs to be satisfied. However, when the state vector x k is updated using the sigma point Kalman filter, the updated state vector x + k is an average of the estimated sigma point values χ k (i) as shown in the equation (21). Since it is calculated, the norm of the state vector x + k−1 (before update) may be different from the norm of the state vector x + k after update. Therefore, when performing the calculation of the sigma point Kalman filter, the norm of the posture μ + k−1 which is an element of the state vector x + k−1 (before update) and the posture which is an element of the state vector x + k after update. There is a possibility of a different value from the norm of μ + k . That is, when performing the sigma point Kalman filter calculation, there is a possibility that the normalization condition for the posture μ is not satisfied.
Therefore, when any calculation is performed on the posture μ, the result after the calculation is normalized by the size of the vector itself. In order to maintain the normalization condition more strictly, the posture μ k among elements constituting the state vector x k is limited to only the difference information from the previous time using MRPs (modified Rodrigues parameters), and the Kalman filter May be updated based on the difference information obtained from the Kalman filter.

地磁気の強さr及び地磁気の伏角φは、変化を予測することが難しい。そこで、本実施形態に係る状態遷移モデルでは、便宜上、時刻T=kにおける地磁気の強さr及び伏角φと、時刻T=k−1における地磁気の強さrk−1及び伏角φk−1とは等しい値であると仮定する。
同様に、角速度センサのオフセット推定値bは、変化を予測することが難しい。そこで、本実施形態に係る状態遷移モデルでは、便宜上、時刻T=kにおける角速度センサのオフセット推定値bO,Kと、時刻T=k−1における角速度センサのオフセット推定値bO,K−1とは等しい値であると仮定する。
It is difficult to predict changes in the geomagnetic strength r and the geomagnetic dip angle φ. Therefore, in the state transition model according to the present embodiment, for the sake of convenience, the geomagnetic strength r k and the dip angle φ k at time T = k, and the geomagnetic strength r k-1 and the dip angle φ k at time T = k−1. Assume that −1 is equal.
Similarly, the offset estimated value b O of the angular velocity sensor, it is difficult to predict changes. Therefore, in the state transition model of the present embodiment, for convenience, time T = offset estimate b O of the angular velocity sensor in k, K and the time T = offset estimate value of the angular velocity sensor in k-1 b O, K- 1 Are equal to each other.

携帯機器1の角速度ωは、携帯機器1の利用者による携帯機器1の動かし方に依存して変化するため、時刻T=k−1の角速度ωk−1を用いて、時刻T=kにおける角速度ωを定式化することは難しい。そこで、本実施形態に係る状態遷移モデルでは、便宜上、時刻T=kにおける角速度ωと、時刻T=k−1における角速度ωk−1とは等しいと仮定する。 Since the angular velocity ω of the mobile device 1 changes depending on how the user of the mobile device 1 moves the mobile device 1, the angular velocity ω k−1 at time T = k −1 is used at time T = k. It is difficult to formulate the angular velocity ω k . Therefore, in the state transition model according to the present embodiment, for convenience, it is assumed that the angular velocity ω k at time T = k is equal to the angular velocity ω k-1 at time T = k−1.

前述のとおり、磁気センサのオフセットは、携帯機器1の部品が発する内部磁界の方向及び大きさを携帯機器1に固定された座標系において表現したベクトルである。従って、携帯機器1の内部状態が一定である間は、磁気センサのオフセットも変化しない。一方、携帯機器1の内部状態が変化した場合、例えば、携帯機器1に搭載された部品を流れる電流の大きさが変化した場合や、携帯機器1に搭載された部品の着磁状況が変化した場合には、磁気センサのオフセットも変化する。すなわち、携帯機器1の内部状態は、携帯機器1の利用者による携帯機器1の操作や、携帯機器1の外部の環境等に依存して変化する。従って、磁気センサのオフセットが変化するタイミングや磁気センサのオフセットの変化量を予測することは困難であり、時刻T=k−1における磁気センサのオフセット推定値cO,K−1を用いて、時刻T=kにおける磁気センサのオフセット推定値cO,Kを定式化することは難しい。そこで、本実施形態に係る状態遷移モデルでは、便宜上、時刻T=kにおける磁気センサのオフセット推定値cO,Kと、時刻T=k−1における磁気センサのオフセット推定値cO,K−1とは等しいと仮定する。 As described above, the offset of the magnetic sensor is a vector expressing the direction and magnitude of the internal magnetic field generated by the components of the mobile device 1 in a coordinate system fixed to the mobile device 1. Therefore, the offset of the magnetic sensor does not change while the internal state of the mobile device 1 is constant. On the other hand, when the internal state of the mobile device 1 changes, for example, when the magnitude of the current flowing through the component mounted on the mobile device 1 changes, or the magnetization status of the component mounted on the mobile device 1 changes. In some cases, the offset of the magnetic sensor also changes. That is, the internal state of the mobile device 1 changes depending on the operation of the mobile device 1 by the user of the mobile device 1, the environment outside the mobile device 1, and the like. Therefore, it is difficult to predict the timing at which the offset of the magnetic sensor changes and the amount of change in the offset of the magnetic sensor, and using the estimated offset value c O, K-1 of the magnetic sensor at time T = k−1, It is difficult to formulate the estimated offset value c O, K of the magnetic sensor at time T = k. Therefore, in the state transition model of the present embodiment, for convenience, time T = offset estimate c O of the magnetic sensor in k, K and the time T = offset estimate value of the magnetic sensor in k-1 c O, K- 1 Are equal.

このように、本実施形態に係る状態遷移モデルでは、以下に示す式(31)のように、状態ベクトルxを構成する複数の状態変数のうち、姿勢μを表す状態変数以外は、前の時刻から変化しないという前提を置く。

Figure 2013088162
Thus, in the state transition model of the present embodiment, as shown in equation (31) shown below, among the plurality of state variables that constitute the state vector x k, except the state variable representing the orientation mu, previous Presuppose that it does not change from the time.
Figure 2013088162

なお、カルマンフィルタの演算においては、状態ベクトルxの各要素は、観測残差zに基づいて真値に近づくように更新される。従って、カルマンフィルタの演算において、式(31)に示された姿勢μ以外の値が全く変化しないわけではない。 In the Kalman filter calculation, each element of the state vector x k is updated so as to approach the true value based on the observation residual z k . Therefore, in the Kalman filter calculation, values other than the posture μ shown in Expression (31) do not necessarily change at all.

次に、観測モデル部305が行う演算で用いられる観測モデルについて説明する。   Next, the observation model used in the calculation performed by the observation model unit 305 will be described.

3次元角速度センサ90から出力される角速度データgの推定値γgyroは、角速度ωと、角速度センサのオフセット推定値bとを用いて、式(32)で与えられる。

Figure 2013088162
The estimated value γ gyro of the angular velocity data g output from the three-dimensional angular velocity sensor 90 is given by Expression (32) using the angular velocity ω and the estimated offset value b O of the angular velocity sensor.
Figure 2013088162

また、地上に固定された座標系において地磁気を表すベクトルBgは式(33)で与えられる。従って、3次元磁気センサ70から出力される磁気データqの推定値γmagは、磁気センサのオフセット推定値cと、式(8)で示した行列B(μ)とを用いて、式(34)で与えられる。

Figure 2013088162
Further, a vector Bg representing geomagnetism in a coordinate system fixed on the ground is given by Expression (33). Therefore, the estimated value γ mag of the magnetic data q output from the three-dimensional magnetic sensor 70 is obtained by using the offset estimated value c O of the magnetic sensor and the matrix B (μ) shown in the expression (8). 34).
Figure 2013088162

また、地上に固定された座標系において、重力加速度を表したベクトルを、重力加速度の大きさで正規化した3次元のベクトルGRVは、以下の式(35)で表される。従って、3次元加速度センサ80から出力される加速度データaの推定値γaccは、式(8)で示した行列B(μ)とベクトルGRVとを用いて、式(36)で与えられる。

Figure 2013088162
Further, in a coordinate system fixed on the ground, a three-dimensional vector GRV obtained by normalizing a vector representing gravitational acceleration with the magnitude of gravitational acceleration is represented by the following equation (35). Therefore, the estimated value gamma acc acceleration data a outputted from the three-dimensional acceleration sensor 80, using matrix B shown in equation (8) and (mu) and a vector G RV, given by equation (36).
Figure 2013088162

式(3)を式(12)の右辺第1項に代入し、式(32)、式(34)、及び式(36)を用いて式(12)の右辺第2項を表すことにより、式(12)を、以下の式(37)に変形することができる。このとき、観測残差zは、式(37)により算出される。

Figure 2013088162
By substituting Equation (3) into the first term on the right side of Equation (12) and expressing the second term on the right side of Equation (12) using Equation (32), Equation (34), and Equation (36), Equation (12) can be transformed into the following equation (37). At this time, the observation residual z k is calculated by Expression (37).
Figure 2013088162

[5. 結論]
以上に示したように、本実施形態に係る状態推定装置は、10個のカルマンフィルタKF[1]〜KF[10]に、互いに異なる10個の初期ベクトルINI[1]〜INI[10]を供給し、これら10個のカルマンフィルタKF[1]〜KF[10]を並列で動作させる。そして、状態推定装置は、推定精度が最も高いカルマンフィルタKF[Sel]を特定し、特定されたカルマンフィルタKF[Sel]により状態推定を行う。従って、本実施形態に係る状態推定装置は、状態ベクトルxを正確且つ高速に収束させることが可能であり、正確且つ高速な状態推定が可能となった。
[5. Conclusion]
As described above, the state estimation apparatus according to the present embodiment supplies ten different initial vectors INI [1] to INI [10] to the ten Kalman filters KF [1] to KF [10]. Then, these ten Kalman filters KF [1] to KF [10] are operated in parallel. Then, the state estimation device identifies the Kalman filter KF [Sel] having the highest estimation accuracy, and performs state estimation using the identified Kalman filter KF [Sel]. Therefore, the state estimation apparatus according to the present embodiment can accurately and rapidly converge the state vector xk , and can perform accurate and high-speed state estimation.

また、本実施形態に係る状態推定装置は、カルマンフィルタKFの推定精度を、誤差評価値MAX[m]及び収束評価値Tr(P [Sel])を用いて表現した。
誤差評価値MAX[m]は、状態ベクトルxの示す値と状態ベクトルの真値との誤差の大きさを評価する。従って、本実施形態に係る状態推定装置は、真値に近い正確な値を要素とする状態ベクトルxを有し、真値に短時間で状態ベクトルxを収束させることができるカルマンフィルタKF[Sel]を選択することが可能となった。
また、収束評価値Tr(P [Sel])は、状態ベクトルxの収束の程度を表す。従って、本実施形態に係る状態推定装置は、システムの状態の正確な推定を安定的に行うことのできるカルマンフィルタKF[Sel]を特定することが可能となった。
このように、本実施形態に係る状態推定装置は、カルマンフィルタKFの推定精度に基づいて特定された1個のカルマンフィルタKF[Sel]を用いて、システムの状態を推定するため、正確且つ高速な状態推定を行うことが可能となった。
Moreover, the state estimation apparatus according to the present embodiment expresses the estimation accuracy of the Kalman filter KF using the error evaluation value MAX z k [m] and the convergence evaluation value Tr (P + k [Sel]).
The error evaluation value MAX z k [m] evaluates the magnitude of the error between the value indicated by the state vector x k and the true value of the state vector. Therefore, the state estimation apparatus according to the present embodiment has a state vector x k whose elements are accurate values close to the true value, and can converge the state vector x k to the true value in a short time. [Sel] can be selected.
In addition, the convergence evaluation value Tr (P + k [Sel]) represents the degree of convergence of the state vector x k . Therefore, the state estimation apparatus according to the present embodiment can identify the Kalman filter KF [Sel] that can stably perform accurate estimation of the system state.
As described above, the state estimation apparatus according to the present embodiment estimates the state of the system using one Kalman filter KF [Sel] specified based on the estimation accuracy of the Kalman filter KF. Estimates can be made.

また、本実施形態に係る状態推定装置は、第1演算モードによりカルマンフィルタ並列演算処理を行うとともに、第2演算モードによりカルマンフィルタ単独演算処理を行う。
これにより、本実施形態に係る状態推定装置は、処理負荷を低減しつつ、正確且つ精度の高い状態推定を行うことが可能となった。
In addition, the state estimation device according to the present embodiment performs Kalman filter parallel calculation processing in the first calculation mode and performs Kalman filter single calculation processing in the second calculation mode.
Thereby, the state estimation apparatus according to the present embodiment can perform accurate and highly accurate state estimation while reducing the processing load.

<B.変形例>
本発明は上述した実施形態に限定されるものではなく、例えば、以下の変形が可能である。また、以下に示す変形例のうちの2以上の変形例を組み合わせることもできる。
<B. Modification>
The present invention is not limited to the above-described embodiments, and for example, the following modifications are possible. Also, two or more of the modifications shown below can be combined.

(1)変形例1
上述した実施形態では、カルマンフィルタKFは、シグマポイントカルマンフィルタの演算を実行したが、本発明はこれに限定するものではなく、カルマンフィルタKFは、拡張カルマンフィルタ等、シグマポイントカルマンフィルタ以外の非線形カルマンフィルタの演算を実行するものであってもよい。
本発明に係る状態推定装置は、複数のカルマンフィルタKFの中で、推定精度が最も高いカルマンフィルタKFを特定し、当該特定されたカルマンフィルタKFを用いてシステムの状態を推定する。そして、カルマンフィルタKFが、どのような非線形カルマンフィルタの演算を実行する場合であっても、最も推定精度の高いカルマンフィルタKFの状態ベクトルは、正確な値に高速に収束する。すなわち、本発明に係る状態推定装置は、カルマンフィルタKFが、どのような非線形カルマンフィルタの演算を実行するものであっても、正確且つ高速な状態推定を行うことができる。
(1) Modification 1
In the above-described embodiment, the Kalman filter KF executes the calculation of the sigma point Kalman filter. However, the present invention is not limited to this, and the Kalman filter KF executes the calculation of the nonlinear Kalman filter other than the sigma point Kalman filter, such as an extended Kalman filter. You may do.
The state estimation apparatus according to the present invention specifies a Kalman filter KF having the highest estimation accuracy from among a plurality of Kalman filters KF, and estimates a system state using the specified Kalman filter KF. Then, regardless of what nonlinear Kalman filter operation is performed by the Kalman filter KF, the state vector of the Kalman filter KF with the highest estimation accuracy converges to an accurate value at high speed. That is, the state estimation apparatus according to the present invention can perform accurate and high-speed state estimation regardless of what nonlinear Kalman filter operation is performed by the Kalman filter KF.

(2)変形例2
上述した実施形態及び変形例では、カルマンフィルタ部300は、10個のカルマンフィルタKF[1]〜KF[10]を備えるが、本発明はこのような形態に限定されるものではなく、カルマンフィルタ部300は、2個以上のカルマンフィルタKFを備えるものであればよい。この場合、初期値生成部200は、カルマンフィルタKFの個数に対応して、互いに異なる複数の初期ベクトルINIを生成するものであればよい。
なお、カルマンフィルタ部300が備えるカルマンフィルタKFの個数は、携帯機器1の処理性能を考慮して、適宜定めればよい。例えば、携帯機器1の処理性能が高い場合には、カルマンフィルタ部300は、10個よりも多くのカルマンフィルタKFを備えてもよい。この場合、状態ベクトルxを高速且つ正確に収束させることが可能となる。また、携帯機器1の処理性能が低い場合には、カルマンフィルタ部300は、10個よりも少ないカルマンフィルタを備えてもよい。この場合、カルマンフィルタ並列演算処理に係る処理負荷を軽減することができる。
(2) Modification 2
In the embodiment and the modification described above, the Kalman filter unit 300 includes ten Kalman filters KF [1] to KF [10]. However, the present invention is not limited to such a form, and the Kalman filter unit 300 includes: What is necessary is just to provide two or more Kalman filters KF. In this case, the initial value generation unit 200 only needs to generate a plurality of different initial vectors INI corresponding to the number of Kalman filters KF.
Note that the number of Kalman filters KF included in the Kalman filter unit 300 may be appropriately determined in consideration of the processing performance of the mobile device 1. For example, when the processing performance of the mobile device 1 is high, the Kalman filter unit 300 may include more than ten Kalman filters KF. In this case, the state vector x can be converged quickly and accurately. Further, when the processing performance of the portable device 1 is low, the Kalman filter unit 300 may include fewer than 10 Kalman filters. In this case, the processing load related to the Kalman filter parallel calculation processing can be reduced.

(3)変形例3
上述した実施形態及び変形例では、状態推定装置は、第1演算モードによりカルマンフィルタ並列演算処理を行うとともに、第2演算モードによりカルマンフィルタ単独演算処理を行うが、本発明は、状態推定装置の動作をこのような態様に限定するものではない。
例えば、状態推定装置は、カルマンフィルタ並列演算処理及びカルマンフィルタ単独演算処理の双方を、第1演算モードにより実行するものであってもよい。この場合、カルマンフィルタ単独演算処理に係る処理負荷を軽減することができる。
また、状態推定装置は、カルマンフィルタ並列演算処理及びカルマンフィルタ単独演算処理の双方を、第2演算モードにより実行するものであってもよい。この場合、状態推定装置は、精度の高い推定を行うことが可能となる。
(3) Modification 3
In the embodiment and the modification described above, the state estimation device performs the Kalman filter parallel calculation processing in the first calculation mode and performs the Kalman filter single calculation processing in the second calculation mode. It is not limited to such an embodiment.
For example, the state estimation device may execute both the Kalman filter parallel calculation process and the Kalman filter single calculation process in the first calculation mode. In this case, the processing load related to the Kalman filter single calculation process can be reduced.
The state estimation device may execute both the Kalman filter parallel calculation process and the Kalman filter single calculation process in the second calculation mode. In this case, the state estimation device can perform highly accurate estimation.

(4)変形例4
上述した実施形態及び変形例では、初期値生成部200は、初期ベクトルINIを構成する複数の状態変数のうち、姿勢μの初期値μ及び3次元磁気センサ70のオフセット推定値cの初期値cO,0を互いに異なる値に設定することで、互いに異なる複数の初期ベクトルINIを生成したが、本発明はこのような初期ベクトルINIの生成方法に限定するものではない。例えば、初期値生成部200は、初期ベクトルINIを構成する状態変数の全てについて、互いに異なる値に設定するものであってもよい。
(4) Modification 4
In the embodiment and the modification described above, the initial value generation unit 200 includes the initial value μ 0 of the posture μ and the initial estimated offset value c O of the three-dimensional magnetic sensor 70 among the plurality of state variables constituting the initial vector INI. A plurality of different initial vectors INI are generated by setting the value c O, 0 to be different from each other, but the present invention is not limited to such a method of generating the initial vector INI. For example, the initial value generation unit 200 may set all the state variables constituting the initial vector INI to different values.

(5)変形例5
上述した実施形態及び変形例では、状態推定装置は出力情報生成部500を備えるが、本発明はこのような構成に限定されるものではなく、状態推定装置は、出力情報生成部500を備えずに構成されてもよい。この場合、状態推定装置は、状態ベクトルxを出力するものであってもよい。また、この場合、状態推定プログラム100と連携する各種アプリケーションが、姿勢や地磁気の向き等の出力情報を生成してもよい。
(5) Modification 5
In the embodiment and the modification described above, the state estimation device includes the output information generation unit 500, but the present invention is not limited to such a configuration, and the state estimation device does not include the output information generation unit 500. May be configured. In this case, state estimation device may be designed to output a state vector x k. In this case, various applications that cooperate with the state estimation program 100 may generate output information such as the posture and the direction of geomagnetism.

(6)変形例6
上述した実施形態及び変形例では、携帯機器1は、3次元磁気センサ70、3次元加速度センサ80、及び、3次元角速度センサ90を備えたが、本発明はこのような形態に限定するものではなく、携帯機器1は、どのようなセンサを備えるものであってもよい。なお、観測値ベクトルyは、携帯機器1が備える複数のセンサからの出力値の全部または一部を要素とするように定めればよい。
本発明は、異種の物理量を測定する複数のセンサの出力を統合し、動的システムの状態を推定する非線形カルマンフィルタの演算において、正確且つ高速な状態推定を行うものである。従って、この発明によれば、状態推定装置がどのようなセンサを備える場合であっても、正確且つ高速な状態推定を行うことができる。
(6) Modification 6
In the embodiment and the modification described above, the mobile device 1 includes the three-dimensional magnetic sensor 70, the three-dimensional acceleration sensor 80, and the three-dimensional angular velocity sensor 90, but the present invention is not limited to such a form. The mobile device 1 may include any sensor. Note that the observed value vector y may be determined so that all or part of output values from a plurality of sensors included in the mobile device 1 are elements.
The present invention integrates the outputs of a plurality of sensors that measure different physical quantities, and performs accurate and high-speed state estimation in the calculation of a nonlinear Kalman filter that estimates the state of a dynamic system. Therefore, according to the present invention, accurate and high-speed state estimation can be performed regardless of what kind of sensor the state estimation apparatus includes.

(7)変形例7
上述した実施形態及び変形例では、状態ベクトルxを構成する状態変数として、式(1)に示した変数、すなわち、携帯機器1の姿勢μ、地磁気の強さr、地磁気の伏角φ、携帯機器1の角速度ω、角速度センサ91〜93のオフセット推定値b、及び磁気センサ71〜73のオフセット推定値cを採用し、これらを推定の対象としたが、本発明は、状態ベクトルxを式(1)に限定するものではない。
例えば、状態変数として、式(1)に示した変数のうちの一部を採用するものであってもよい。また、状態変数として、式(1)に示した変数以外の変数を採用するものであってもよい。
(7) Modification 7
In the embodiment and the modification described above, as the state variables constituting the state vector x, the variables shown in Expression (1), that is, the attitude μ of the mobile device 1, the geomagnetic strength r, the geomagnetic dip angle φ, the mobile device 1, the offset estimated value b O of the angular velocity sensors 91 to 93, and the offset estimated value c O of the magnetic sensors 71 to 73 are used as estimation targets. It is not limited to Formula (1).
For example, a part of the variables shown in Expression (1) may be adopted as the state variable. Further, a variable other than the variable shown in Expression (1) may be adopted as the state variable.

1…携帯機器、10…CPU、70…3次元磁気センサ、80…3次元加速度センサ、90…3次元角速度センサ、100…状態推定プログラム、200…初期値生成部、300…カルマンフィルタ部、KF…カルマンフィルタ、400…カルマンフィルタ制御部、420…観測残差比較部、440…収束度判定部、460…停止制御部、500…出力情報生成部。
DESCRIPTION OF SYMBOLS 1 ... Portable apparatus, 10 ... CPU, 70 ... Three-dimensional magnetic sensor, 80 ... Three-dimensional acceleration sensor, 90 ... Three-dimensional angular velocity sensor, 100 ... State estimation program, 200 ... Initial value production | generation part, 300 ... Kalman filter part, KF ... Kalman filter, 400 ... Kalman filter control unit, 420 ... observation residual comparison unit, 440 ... convergence degree determination unit, 460 ... stop control unit, 500 ... output information generation unit.

Claims (5)

システムを観測して観測値を各々出力する複数のセンサと、
前記システムの状態を表すための複数の状態変数を要素とする状態ベクトルと、前記複数のセンサから各々出力される観測値を要素とする観測値ベクトルとを用いて、前記状態ベクトルを更新することで、前記システムの状態を推定する複数のカルマンフィルタと、
互いに異なる複数の初期ベクトルを生成し、複数の前記初期ベクトルのそれぞれを、前記状態ベクトルの初期値として前記複数のカルマンフィルタの各々に供給する初期値生成部と、
前記複数のカルマンフィルタの推定精度を各々評価し、前記複数のカルマンフィルタのうち、推定精度が最も高いカルマンフィルタを特定し、特定したカルマンフィルタを除く他のカルマンフィルタの動作を停止させるカルマンフィルタ制御部と、
を備えることを特徴とする状態推定装置。
A plurality of sensors for observing the system and outputting observation values,
Updating the state vector using a state vector whose elements are a plurality of state variables for representing the state of the system and an observation value vector whose elements are observation values output from the plurality of sensors, respectively. A plurality of Kalman filters for estimating the state of the system;
An initial value generating unit that generates a plurality of different initial vectors and supplies each of the plurality of initial vectors to each of the plurality of Kalman filters as an initial value of the state vector;
A Kalman filter control unit that evaluates the estimation accuracy of the plurality of Kalman filters, specifies a Kalman filter having the highest estimation accuracy among the plurality of Kalman filters, and stops operations of other Kalman filters excluding the identified Kalman filter;
A state estimation device comprising:
前記カルマンフィルタは、
前記状態ベクトルと、前記観測値ベクトルとに基づいて観測残差を算出するとともに、前記状態ベクトルの推定誤差の共分散を算出し、
前記カルマンフィルタ制御部は、
前記複数のカルマンフィルタの各々が出力する前記観測残差に基づいて、前記状態ベクトルと前記システムの状態との誤差を評価する誤差評価値が最小となるカルマンフィルタを選択する観測残差比較部と、
前記観測残差比較部によって選択されたカルマンフィルタが出力する前記状態ベクトルの推定誤差の共分散に基づいて、前記状態ベクトルの収束の程度を表す収束評価値を算出し、前記収束評価値が閾値以下であるか否かを判定する収束度判定部と、
前記収束度判定部の判定結果が肯定である場合、前記観測残差比較部によって選択されたカルマンフィルタを、推定精度が最も高いカルマンフィルタであると特定し、特定したカルマンフィルタを除く他のカルマンフィルタの動作を停止させる、停止制御部と、
を備えることを特徴とする、請求項1に記載の状態推定装置。
The Kalman filter is
Calculating an observation residual based on the state vector and the observation value vector, and calculating a covariance of the estimation error of the state vector;
The Kalman filter control unit
An observation residual comparison unit that selects a Kalman filter that minimizes an error evaluation value for evaluating an error between the state vector and the state of the system, based on the observation residual output from each of the plurality of Kalman filters;
Based on the covariance of the estimation error of the state vector output by the Kalman filter selected by the observation residual comparison unit, a convergence evaluation value representing the degree of convergence of the state vector is calculated, and the convergence evaluation value is equal to or less than a threshold value A convergence determination unit that determines whether or not
When the determination result of the convergence determination unit is affirmative, the Kalman filter selected by the observation residual comparison unit is identified as the Kalman filter having the highest estimation accuracy, and the operations of other Kalman filters other than the identified Kalman filter are performed. A stop control unit for stopping;
The state estimation apparatus according to claim 1, comprising:
前記観測残差比較部は、
前記観測残差のうち少なくとも一部の要素のノルムの、現在時刻から所定時間だけ過去の時刻までの所定期間における最大値を、前記複数のカルマンフィルタごとに算出し、
算出した複数の前記最大値が最小となるカルマンフィルタを、前記誤差評価値が最小となるカルマンフィルタとして選択する、
ことを特徴とする、請求項2に記載の状態推定装置。
The observation residual comparison unit
Calculating a maximum value of a norm of at least some elements of the observation residual in a predetermined period from a current time to a past time for each of the plurality of Kalman filters;
A plurality of calculated Kalman filters that minimize the maximum value are selected as Kalman filters that minimize the error evaluation value;
The state estimation apparatus according to claim 2, wherein:
前記収束評価値は、前記状態ベクトルの推定誤差の共分散を表す行列のトレースである、
ことを特徴とする、請求項2または3に記載の状態推定装置。
The convergence evaluation value is a matrix trace representing the covariance of the estimation error of the state vector.
The state estimation apparatus according to claim 2 or 3, wherein
前記カルマンフィルタ制御部が、前記他のカルマンフィルタを停止させる前は、
前記複数のカルマンフィルタは、第1のデータ型を用いて演算を行い、
前記カルマンフィルタ制御部が、前記他のカルマンフィルタを停止させた後は、
前記カルマンフィルタ制御部によって特定されたカルマンフィルタは、前記第1のデータ型よりもデータサイズの大きな第2のデータ型を用いて演算を行う
ことを特徴とする、請求項1乃至4のうちいずれか1項に記載の状態推定装置。
Before the Kalman filter control unit stops the other Kalman filter,
The plurality of Kalman filters perform an operation using a first data type;
After the Kalman filter control unit stops the other Kalman filter,
The Kalman filter specified by the Kalman filter control unit performs an operation using a second data type having a data size larger than that of the first data type. The state estimation apparatus according to item.
JP2011226586A 2011-10-14 2011-10-14 State estimation apparatus Pending JP2013088162A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011226586A JP2013088162A (en) 2011-10-14 2011-10-14 State estimation apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011226586A JP2013088162A (en) 2011-10-14 2011-10-14 State estimation apparatus

Publications (1)

Publication Number Publication Date
JP2013088162A true JP2013088162A (en) 2013-05-13

Family

ID=48532233

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011226586A Pending JP2013088162A (en) 2011-10-14 2011-10-14 State estimation apparatus

Country Status (1)

Country Link
JP (1) JP2013088162A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018165618A (en) * 2017-03-28 2018-10-25 セイコーエプソン株式会社 Signal processing device, detection device, physical quantity measurement device, electronic apparatus and mobile body
WO2021166946A1 (en) * 2020-02-21 2021-08-26 株式会社東京測振 Estimation apparatus, vibration sensor system, method executed by estimation apparatus, and program
WO2022222889A1 (en) * 2021-04-19 2022-10-27 长沙智能驾驶研究院有限公司 Filter control method and apparatus, and device and computer storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018165618A (en) * 2017-03-28 2018-10-25 セイコーエプソン株式会社 Signal processing device, detection device, physical quantity measurement device, electronic apparatus and mobile body
WO2021166946A1 (en) * 2020-02-21 2021-08-26 株式会社東京測振 Estimation apparatus, vibration sensor system, method executed by estimation apparatus, and program
JP2021131361A (en) * 2020-02-21 2021-09-09 株式会社東京測振 Estimation apparatus, vibration sensor system, method executed by estimation apparatus, and program
WO2022222889A1 (en) * 2021-04-19 2022-10-27 长沙智能驾驶研究院有限公司 Filter control method and apparatus, and device and computer storage medium

Similar Documents

Publication Publication Date Title
US20140122015A1 (en) Attitude estimation method and apparatus
JP2013064695A (en) State estimating device, offset updating method, and offset updating program
CN104969030B (en) Inertial device, methods and procedures
EP2553392B1 (en) Calibrating sensor measurements on mobile devices
Pylvänäinen Automatic and adaptive calibration of 3D field sensors
US8374817B2 (en) Auto-calibration of orientation sensing systems
JP6191145B2 (en) Offset estimation apparatus and program
KR101922700B1 (en) Method and Apparatus for calculation of angular velocity using acceleration sensor and geomagnetic sensor
CN103299247B (en) For the dynamic tracing in magnetic near field and the equipment of compensation and method
Michel et al. Attitude estimation for indoor navigation and augmented reality with smartphones
JP5706576B2 (en) Offset estimation apparatus, offset estimation method, offset estimation program, and information processing apparatus
WO2011091083A1 (en) Apparatus and methodology for calibration of a gyroscope and a compass included in a handheld device
US20140222369A1 (en) Simplified method for estimating the orientation of an object, and attitude sensor implementing such a method
JP7025215B2 (en) Positioning system and positioning method
TW201428297A (en) Angular velocity estimation using a magnetometer and accelerometer
WO2021036085A1 (en) Inertial navigation system initial alignment method, apparatus, and electronic device
US11709056B2 (en) Method and device for magnetic field measurement by magnetometers
JP2013096724A (en) State estimation device
JP5678748B2 (en) Terminal device and geomagnetic environment determination program
JP2013122384A (en) Kalman filter and state estimation device
US20180180683A1 (en) Techniques for magnetometer calibration using selected measurements over time
JP2013088162A (en) State estimation apparatus
JP2013185898A (en) State estimation device
Li et al. An efficient method for tri-axis magnetometer calibration
US10648812B2 (en) Method for filtering the signals arising from a sensor assembly comprising at least one sensor for measuring a vector physical field which is substantially constant over time and in space in a reference frame