CN109059960A - A kind of calibration method of three-dimensional electronic compass - Google Patents
A kind of calibration method of three-dimensional electronic compass Download PDFInfo
- Publication number
- CN109059960A CN109059960A CN201810789601.3A CN201810789601A CN109059960A CN 109059960 A CN109059960 A CN 109059960A CN 201810789601 A CN201810789601 A CN 201810789601A CN 109059960 A CN109059960 A CN 109059960A
- Authority
- CN
- China
- Prior art keywords
- axis
- data
- ellipsoid
- electronic compass
- soft
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004364 calculation method Methods 0.000 claims description 8
- 230000014509 gene expression Effects 0.000 claims description 7
- 239000011159 matrix material Substances 0.000 claims description 4
- 230000005389 magnetism Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008602 contraction Effects 0.000 description 1
- 239000000696 magnetic material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C25/00—Manufacturing, calibrating, cleaning, or repairing instruments or devices referred to in the other groups of this subclass
Landscapes
- Engineering & Computer Science (AREA)
- Manufacturing & Machinery (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Measuring Magnetic Variables (AREA)
Abstract
本发明涉及一种三维电子指南针的校准方法。将电子指南针在空间中做8字运动,采集磁传感器的三个轴读出的数据;然后将采集到的数据进行椭球拟合,得到椭球方程和球心坐标;之后再将拟合得到的椭球方程分别投影至三个坐标轴平面,分别求出三个平面上的椭圆的参数:α、b、长轴转角;最后根据所得的参数对新得到的数据进行校准。本发明方法使得电子指南针的校准过程更加灵活,精确度更高,满足野外运动的要求。
The invention relates to a method for calibrating a three-dimensional electronic compass. Move the electronic compass in a figure-of-eight motion in space, and collect the data read by the three axes of the magnetic sensor; then perform ellipsoid fitting on the collected data to obtain the ellipsoid equation and the coordinates of the center of the sphere; The ellipsoid equation is projected to the three coordinate axis planes respectively, and the parameters of the ellipse on the three planes are calculated respectively: α, b, major axis rotation angle; finally, the newly obtained data is calibrated according to the obtained parameters. The method of the invention makes the calibration process of the electronic compass more flexible and more accurate, and meets the requirements of field sports.
Description
技术领域technical field
本发明涉及一种三维电子指南针的校准方法。The invention relates to a method for calibrating a three-dimensional electronic compass.
背景技术Background technique
近年来,电子指南针广泛应用于导航、人体姿态测量等场景。由于GPS的信号在森林、密集建筑等地方十分微弱,所以通常需要电子指南针来辅助定位。In recent years, electronic compasses have been widely used in navigation, human body posture measurement and other scenarios. Since the GPS signal is very weak in places such as forests and dense buildings, an electronic compass is usually needed to assist in positioning.
电子指南针的工作原理是通过磁传感器测量某一方向上地磁的分量强度,确定该传感器与地磁的夹角,从而确定前进方位。然而地磁场属于弱磁场,由于电子指南针周围的磁性材料带来的硬磁干扰和软磁干扰会导致磁传感器的测量值偏离真值。此外,因为传感器本身制作的工艺问题,如轴不正交,也会导致磁传感器的测量值偏离真值。The working principle of the electronic compass is to measure the component strength of the geomagnetism in a certain direction through a magnetic sensor, determine the angle between the sensor and the geomagnetism, and then determine the heading. However, the earth's magnetic field is a weak magnetic field, and the hard magnetic interference and soft magnetic interference brought by the magnetic materials around the electronic compass will cause the measured value of the magnetic sensor to deviate from the true value. In addition, due to the process problems of the sensor itself, such as the non-orthogonal axis, the measured value of the magnetic sensor will also deviate from the true value.
如果只有地磁的作用,磁传感器三轴输出的数据对应到空间直角坐标系上应该是一个球心在原点的正球。然而,硬磁干扰会使得这个正球变成一个以硬磁干扰量为球心的正球。如果同时考虑地磁、硬磁和软磁的作用,上述正球会变成以硬磁干扰量为球心的椭球。轴不正交产生的干扰可以等效为软、硬磁干扰。因而在使用电子指南针之前需要进行校准,补偿其三轴读出的数据,使其落在球心在原点的正圆球球面上。If there is only the effect of geomagnetism, the data output by the three axes of the magnetic sensor should be a positive sphere whose center is at the origin corresponding to the space Cartesian coordinate system. However, the hard magnetic interference will make this true sphere become a true sphere with the hard magnetic interference as the center. If the effects of geomagnetism, hard magnetism and soft magnetism are considered at the same time, the above-mentioned positive sphere will become an ellipsoid with the hard magnetism as the center. The interference caused by non-orthogonal axes can be equivalent to soft and hard magnetic interference. Therefore, before using the electronic compass, it needs to be calibrated, and the data read out by its three axes should be compensated so that it falls on the perfect spherical surface whose center is at the origin.
现有的三维电子指南针的校准方法,或需要外部设备的帮助,或校准过程要求较高,且大都没有进行软磁补偿。难以满足野外行动的需要。The existing three-dimensional electronic compass calibration methods either require the help of external equipment, or have high requirements for the calibration process, and most of them do not perform soft magnetic compensation. Difficult to meet the needs of field operations.
发明内容Contents of the invention
本发明的目的在于提供一种三维电子指南针的校准方法,该方法将电子指南针在空间中做8字运动,即可对软硬磁干扰、轴不正交引起的误差干扰作出补偿,进行电子指南针的校准;该方法使得电子指南针的校准过程更加灵活,精确度更高,满足野外运动的要求。The purpose of the present invention is to provide a calibration method for a three-dimensional electronic compass. The method moves the electronic compass in a figure-of-eight motion in space, which can compensate the error interference caused by soft and hard magnetic interference and non-orthogonal axes, and perform electronic compass calibration. Calibration; this method makes the calibration process of the electronic compass more flexible and more accurate, and meets the requirements of field sports.
为实现上述目的,本发明的技术方案是:一种三维电子指南针的校准方法,将电子指南针在空间中做8字运动,采集磁传感器的三个轴读出的数据;然后将采集到的数据进行椭球拟合,得到椭球方程和球心坐标;之后再将拟合得到的椭球方程分别投影至三个坐标轴平面,分别求出三个平面上的椭圆的参数:α、b、长轴转角;最后根据所得的参数对新得到的数据进行校准。In order to achieve the above object, the technical solution of the present invention is: a calibration method of a three-dimensional electronic compass, which moves the electronic compass in a figure-of-eight movement in space, and collects the data read by the three axes of the magnetic sensor; then the collected data Perform ellipsoid fitting to obtain the ellipsoid equation and the coordinates of the center of the sphere; then project the fitted ellipsoid equation onto the three coordinate axis planes respectively, and obtain the parameters of the ellipse on the three planes: α, b, Major axis rotation angle; finally, the newly obtained data is calibrated according to the obtained parameters.
在本发明一实施例中,该方法具体实现步骤如下:In an embodiment of the present invention, the specific implementation steps of the method are as follows:
步骤S1:将电子指南针在空间中做8字运动,使得电子指南针采集到上、下、东、南、西、北八个方位即与空间直角坐标系的八个象限相对应的数据;Step S1: Make the electronic compass move in figures of eight in space, so that the electronic compass collects data corresponding to eight directions of up, down, east, south, west and north, that is, the eight quadrants of the spatial rectangular coordinate system;
步骤S2:进行椭球拟合,采用最小二乘法拟合法求出椭球的10个最佳参数A、B、C、D、E、F、G、I、J和椭球球心坐标(X0,Y0,Z0);椭球方程的一般表达式为:Step S2: Carry out ellipsoid fitting, and use the least square method to find the 10 best parameters A, B, C, D, E, F, G, I, J of the ellipsoid and the coordinates of the center of the ellipsoid (X0 ,Y0,Z0); the general expression of the ellipsoid equation is:
Ax2+By2+Cz2+Dxy+Exz+Fyz+Gx+Hy+Iz+J=0Ax 2 +By 2 +Cz 2 +Dxy+Exz+Fyz+Gx+Hy+Iz+J=0
分别令上式中的z=0、x=0、y=0,则可分别得椭球在XOY、XOZ、YOZ面上的投影方程:Respectively make z=0, x=0, y=0 in the above formula, then the projection equations of the ellipsoid on the XOY, XOZ, YOZ planes can be obtained respectively:
Ax2+By2+Dxy+Gx+Hy+J=0Ax 2 +By 2 +Dxy+Gx+Hy+J=0
Ax2+Cz2+Exz+Gx+Iz+J=0Ax 2 +Cz 2 +Exz+Gx+Iz+J=0
By2+Cz2+Fyz+Hy+Iz+J=0By 2 +Cz 2 +Fyz+Hy+Iz+J=0
步骤S3:根据椭球在XOY面上的投影方程:Ax2+By2+Dxy+Gx+Hy+J=0,求出XOY面上的椭圆的参数:长轴转角θx,y、αx,y和bx,y,计算公式如下:Step S3: According to the projection equation of the ellipsoid on the XOY surface: Ax 2 +By 2 +Dxy+Gx+Hy+J=0, calculate the parameters of the ellipse on the XOY surface: major axis rotation angle θx,y, αx,y and bx,y, the calculation formula is as follows:
其中,in,
G'=G·cos(θx,y)-H·sin(θx,y)G'=G·cos(θx,y)-H·sin(θx,y)
H'=G·sin(θx,y)+H·cos(θx,y)H'=G sin(θx,y)+H cos(θx,y)
A'=A·cos2(θx,y)-D·cos(θx,y)·sin(θx,y)+B·sin2(θx,y)A'=A·cos 2 (θx,y)-D·cos(θx,y)·sin(θx,y)+B·sin 2 (θx,y)
B'=A·sin2(θx,y)+D·cos(θx,y)·sin(θx,y)+B·cos2(θx,y)B'=A·sin 2 (θx,y)+D·cos(θx,y)·sin(θx,y)+B·cos 2 (θx,y)
同理可以求得椭球方程在XOZ面和YOZ面上各自的椭圆参数θx,z,αx,z,bx,z和θy,z,αy,z,by,z;In the same way, the respective elliptic parameters θx, z, αx, z, bx, z and θy, z, αy, z, by, z of the ellipsoid equation on the XOZ surface and YOZ surface can be obtained;
步骤S4:根据椭球球心坐标(X0,Y0,Z0)、以及步骤S3所求参数即可对磁传感器获取的数据进行软硬磁补偿校准。Step S4: According to the coordinates of the center of the ellipsoid (X0, Y0, Z0) and the parameters obtained in step S3, the soft and hard magnetic compensation calibration can be performed on the data obtained by the magnetic sensor.
在本发明一实施例中,所述步骤S4的具体实现过程如下:In an embodiment of the present invention, the specific implementation process of the step S4 is as follows:
步骤S41、消除硬磁干扰:硬磁的干扰使得磁传感器三轴输出的数据偏移固定量,该偏移固定量就是椭球球心(X0,Y0,Z0)到原点的偏离距离;对磁传感器的三轴受到的硬磁干扰进行硬磁补偿校准,就是将磁传感器的三轴读到的数据分别减去上述的偏移固定量,即为:Step S41, eliminate hard magnetic interference: hard magnetic interference causes the data output by the three axes of the magnetic sensor to shift by a fixed amount, which is the deviation distance from the center of the ellipsoid (X0, Y0, Z0) to the origin; The hard magnetic compensation calibration for the hard magnetic interference received by the three axes of the sensor is to subtract the above-mentioned offset fixed amount from the data read by the three axes of the magnetic sensor respectively, which is:
xe=xreading-X0xe=xreading-X0
ye=yreading-Y0ye=yreading-Y0
ze=zreading-Z0ze=zreading-Z0
其中,xreading、yreading、zreading分别是磁传感器X轴、Y轴和Z轴新读取的数据,xe,ye,ze是磁传感器三轴消除了硬磁干扰后的数据;Among them, xreading, yreading, and zreading are the data newly read by the magnetic sensor on the X-axis, Y-axis, and Z-axis respectively, and xe, ye, and ze are the data after the hard magnetic interference has been eliminated on the three axes of the magnetic sensor;
步骤S41、消除软磁干扰:分别对X轴-Y轴,X轴-Z轴,Y轴-Z轴进行软磁补偿校准;以X轴-Y轴的软磁补偿为例,根据所求得的XOY面上的椭圆的长轴转角θx,y,可得旋转矩阵R:Step S41. Eliminate soft magnetic interference: Carry out soft magnetic compensation calibration for X-axis-Y-axis, X-axis-Z-axis, and Y-axis-Z-axis respectively; The major axis rotation angle θx, y of the ellipse on the XOY plane of , the rotation matrix R can be obtained:
然后将消除硬磁干扰后的数据旋转至标准椭圆上,具体为:Then rotate the data after removing the hard magnetic interference to the standard ellipse, specifically:
然后将上述的数据拉伸至正圆上:具体为:Then stretch the above data to a perfect circle: specifically:
若αx,y>bx,y,有:If αx,y>bx,y, there are:
xc=xe0xc=xe0
若bx,y>αx,y,有:If bx,y>αx,y, there are:
yc=ye0yc=ye0
最后再将得到的数据xc,yc旋转回去,有:Finally, rotate the obtained data xc, yc back, there are:
其中,xc0,yc0即为软硬磁补偿校准后的数据;对X轴-Z轴,Y轴-Z轴的软磁补偿也是同样的道理,如此重复计算后可以得到六个数据,分别是:Among them, xc0 and yc0 are the calibrated data of soft and hard magnetic compensation; the same is true for soft magnetic compensation of X axis-Z axis and Y axis-Z axis. After repeated calculations, six data can be obtained, which are:
为了结果的精确性,对六个数据进行加权平均,得For the accuracy of the results, the weighted average of the six data is obtained
其中,xvalue,yvalue,zvalue为磁传感器三轴经过软硬磁校准的最终数据。Among them, xvalue, yvalue, and zvalue are the final data of the three-axis magnetic sensor after soft and hard magnetic calibration.
相较于现有技术,本发明具有以下有益效果:本发明中,对电子指南针的校准方法进行了创新:Compared with the prior art, the present invention has the following beneficial effects: In the present invention, the calibration method of the electronic compass is innovated:
1、校准过程无需倾角传感器等外部设备辅助,只需在空间中绕8字运动即可;1. The calibration process does not require the assistance of external equipment such as inclination sensors, and only needs to move around the figure 8 in space;
2、本发明采用最小二乘法拟合椭球,并考虑由于软硬磁干扰引起的椭球旋转和伸缩,对其进行补偿;其中软磁补偿方案是基于椭圆的长轴转角而实现的,比现有的3轴电子指南针校准技术效果更好;2. The present invention adopts the least square method to fit the ellipsoid, and considers the ellipsoid rotation and expansion and contraction caused by soft and hard magnetic interference, and compensates it; wherein the soft magnetic compensation scheme is realized based on the major axis rotation angle of the ellipse, compared to The existing 3-axis electronic compass calibration technology works better;
3、在消除软硬磁干扰的同时,本方法也一并消除了磁传感器轴不正交带来的误差干扰;3. While eliminating the soft and hard magnetic interference, this method also eliminates the error interference caused by the non-orthogonal axis of the magnetic sensor;
与现有的校准技术相比,本发明所得的结果更加精确,校准过程也更加灵活,在电子指南针领域具有广泛的应用前景。Compared with the existing calibration technology, the result obtained by the invention is more accurate, and the calibration process is more flexible, and has wide application prospects in the field of electronic compass.
附图说明Description of drawings
图1为三维电子指南针的校准过程图。Figure 1 is a diagram of the calibration process of a three-dimensional electronic compass.
图2为软磁对磁传感器三轴的干扰效果图。Figure 2 is a diagram of the interference effect of the soft magnetism on the three axes of the magnetic sensor.
图3为软磁对磁传感器X轴和Y轴的干扰效果图。Figure 3 is a diagram of the interference effect of the soft magnetism on the X-axis and Y-axis of the magnetic sensor.
具体实施方式Detailed ways
下面结合附图,对本发明的技术方案进行具体说明。The technical solution of the present invention will be specifically described below in conjunction with the accompanying drawings.
本发明提供了一种三维电子指南针的校准方法,将电子指南针在空间中做8字运动,采集磁传感器的三个轴读出的数据;然后将采集到的数据进行椭球拟合,得到椭球方程和球心坐标;之后再将拟合得到的椭球方程分别投影至三个坐标轴平面,分别求出三个平面上的椭圆的参数:α、b、长轴转角;最后根据所得的参数对进行数据校准。该方法具体实现步骤如下:The invention provides a method for calibrating a three-dimensional electronic compass. The electronic compass is moved in a figure-of-eight motion in space, and the data read by the three axes of the magnetic sensor are collected; then the collected data are fitted with an ellipsoid to obtain The spherical equation and the coordinates of the center of the sphere; then project the fitted ellipsoid equation onto the three coordinate axis planes respectively, and obtain the parameters of the ellipse on the three planes: α, b, and major axis rotation angle; finally, according to the obtained Parameter pairs for data calibration. The specific implementation steps of this method are as follows:
步骤S1:将电子指南针在空间中做8字运动,使得电子指南针采集到上、下、东、南、西、北八个方位即与空间直角坐标系的八个象限相对应的数据;Step S1: Make the electronic compass move in figures of eight in space, so that the electronic compass collects data corresponding to eight directions of up, down, east, south, west and north, that is, the eight quadrants of the spatial rectangular coordinate system;
步骤S2:进行椭球拟合,采用最小二乘法拟合法求出椭球的10个最佳参数A、B、C、D、E、F、G、I、J和椭球球心坐标(X0,Y0,Z0);椭球方程的一般表达式为:Step S2: Carry out ellipsoid fitting, and use the least square method to find the 10 best parameters A, B, C, D, E, F, G, I, J of the ellipsoid and the coordinates of the center of the ellipsoid (X0 ,Y0,Z0); the general expression of the ellipsoid equation is:
Ax2+By2+Cz2+Dxy+Exz+Fyz+Gx+Hy+Iz+J=0Ax 2 +By 2 +Cz 2 +Dxy+Exz+Fyz+Gx+Hy+Iz+J=0
分别令上式中的z=0、x=0、y=0,则可分别得椭球在XOY、XOZ、YOZ面上的投影方程:Respectively make z=0, x=0, y=0 in the above formula, then the projection equations of the ellipsoid on the XOY, XOZ, YOZ planes can be obtained respectively:
Ax2+By2+Dxy+Gx+Hy+J=0Ax 2 +By 2 +Dxy+Gx+Hy+J=0
Ax2+Cz2+Exz+Gx+Iz+J=0Ax 2 +Cz 2 +Exz+Gx+Iz+J=0
By2+Cz2+Fyz+Hy+Iz+J=0By 2 +Cz 2 +Fyz+Hy+Iz+J=0
步骤S3:根据椭球在XOY面上的投影方程:Ax2+By2+Dxy+Gx+Hy+J=0,求出XOY面上的椭圆的参数:长轴转角θx,y、αx,y和bx,y,计算公式如下:Step S3: According to the projection equation of the ellipsoid on the XOY surface: Ax 2 +By 2 +Dxy+Gx+Hy+J=0, calculate the parameters of the ellipse on the XOY surface: major axis rotation angle θx,y, αx,y and bx,y, the calculation formula is as follows:
其中,in,
G'=G·cos(θx,y)-H·sin(θx,y)G'=G·cos(θx,y)-H·sin(θx,y)
H'=G·sin(θx,y)+H·cos(θx,y)H'=G sin(θx,y)+H cos(θx,y)
A'=A·cos2(θx,y)-D·cos(θx,y)·sin(θx,y)+B·sin2(θx,y)A'=A·cos 2 (θx,y)-D·cos(θx,y)·sin(θx,y)+B·sin 2 (θx,y)
B'=A·sin2(θx,y)+D·cos(θx,y)·sin(θx,y)+B·cos2(θx,y)B'=A·sin 2 (θx,y)+D·cos(θx,y)·sin(θx,y)+B·cos 2 (θx,y)
同理可以分别求得椭球方程在XOZ面和在YOZ面上的投影椭圆的参数θx,z,αx,z,bx,z和θy,z,αy,z,by,z;In the same way, the parameters θx, z, αx, z, bx, z and θy, z, αy, z, by, z of the projected ellipse of the ellipsoid equation on the XOZ surface and on the YOZ surface can be obtained respectively;
步骤S4:根据椭球球心坐标(X0,Y0,Z0)、以及步骤S3所求参数即可对磁传感器获取的数据进行软硬磁补偿校准。所述步骤S4的具体实现过程如下:Step S4: According to the coordinates of the center of the ellipsoid (X0, Y0, Z0) and the parameters obtained in step S3, the soft and hard magnetic compensation calibration can be performed on the data obtained by the magnetic sensor. The concrete realization process of described step S4 is as follows:
步骤S41、消除硬磁干扰:硬磁的干扰使得磁传感器三轴输出的数据偏移固定量,该偏移固定量就是椭球球心(X0,Y0,Z0)到原点的偏离距离;对磁传感器的三轴受到的硬磁干扰进行硬磁补偿校准,就是将磁传感器的三轴读到的数据分别减去上述的偏移固定量,即为:Step S41, eliminate hard magnetic interference: hard magnetic interference causes the data output by the three axes of the magnetic sensor to shift by a fixed amount, which is the deviation distance from the center of the ellipsoid (X0, Y0, Z0) to the origin; The hard magnetic compensation calibration for the hard magnetic interference received by the three axes of the sensor is to subtract the above-mentioned offset fixed amount from the data read by the three axes of the magnetic sensor respectively, which is:
xe=xreading-X0xe=xreading-X0
ye=yreading-Y0ye=yreading-Y0
ze=zreading-Z0ze=zreading-Z0
其中,xreading、yreading、zreading分别是磁传感器X轴、Y轴和Z轴新读取的数据,xe,ye,ze是磁传感器三轴消除了硬磁干扰后的数据;Among them, xreading, yreading, and zreading are the data newly read by the magnetic sensor on the X-axis, Y-axis, and Z-axis respectively, and xe, ye, and ze are the data after the hard magnetic interference has been eliminated on the three axes of the magnetic sensor;
步骤S41、消除软磁干扰:分别对X轴-Y轴,X轴-Z轴,Y轴-Z轴进行软磁补偿校准;以X轴-Y轴的软磁补偿为例,根据所求得的XOY面上的椭圆的长轴转角θx,y,可得旋转矩阵R:Step S41. Eliminate soft magnetic interference: Carry out soft magnetic compensation calibration for X-axis-Y-axis, X-axis-Z-axis, and Y-axis-Z-axis respectively; The major axis rotation angle θx, y of the ellipse on the XOY plane of , the rotation matrix R can be obtained:
然后将消除硬磁干扰后的数据旋转至标准椭圆上,具体为:Then rotate the data after removing the hard magnetic interference to the standard ellipse, specifically:
然后将上述的数据拉伸至正圆上:具体为:Then stretch the above data to a perfect circle: specifically:
若αx,y>bx,y,有:If αx,y>bx,y, there are:
xc=xe0xc=xe0
若bx,y>αx,y,有:If bx,y>αx,y, there are:
yc=ye0yc=ye0
最后再将得到的数据xc,yc旋转回去,有:Finally, rotate the obtained data xc, yc back, there are:
其中,xc0,yc0即为软硬磁补偿校准后的数据;对X轴-Z轴,Y轴-Z轴的软磁补偿也是同样的道理,如此重复计算后可以得到六个数据,分别是:Among them, xc0 and yc0 are the calibrated data of soft and hard magnetic compensation; the same is true for soft magnetic compensation of X axis-Z axis and Y axis-Z axis. After repeated calculations, six data can be obtained, which are:
为了结果的精确性,对六个数据进行加权平均,得For the accuracy of the results, the weighted average of the six data is obtained
其中,xvalue,yvalue,zvalue为磁传感器三轴经过软硬磁校准的最终数据。Among them, xvalue, yvalue, and zvalue are the final data of the three-axis magnetic sensor after soft and hard magnetic calibration.
以下为本发明的具体实现过程。The following is the specific implementation process of the present invention.
本发明提供了一种便捷、精确三维电子指南针校准方法,该方法只需将电子指南针在空间中做8字运动,即可对软硬磁干扰、轴不正交引起的误差干扰作出补偿,进行电子指南针的校准。该方法使得电子指南针的校准过程更加灵活,精确度更高,满足野外运动的要求。The invention provides a convenient and accurate three-dimensional electronic compass calibration method, which can compensate the error interference caused by soft and hard magnetic interference and non-orthogonal axes by simply moving the electronic compass in a figure-of-eight movement in space. Calibration of electronic compass. This method makes the calibration process of the electronic compass more flexible and more accurate, and meets the requirements of field sports.
三维电子指南针的校准过程如图1所示:先将电子指南针在空间中做8字运动,采集磁传感器的三个轴读出的数据;然后将采集到的数据进行椭球拟合,得到椭球方程和球心坐标;之后再将拟合得到的椭球方程分别投影至三个坐标轴平面,分别求出三个平面上的椭圆参数:α、b和长轴转角;最后根据既得的参数对新的数据进行校准。整个过程校准过程无需额外的倾角传感器或其他设备辅助。The calibration process of the three-dimensional electronic compass is shown in Figure 1: first, the electronic compass is moved in a figure-of-eight movement in space, and the data read by the three axes of the magnetic sensor are collected; The spherical equation and the coordinates of the center of the sphere; then project the fitted ellipsoid equation onto the three coordinate axis planes respectively, and calculate the ellipse parameters on the three planes: α, b, and major axis rotation angle; finally, according to the obtained parameters Calibrate to new data. The entire calibration process does not require additional inclination sensors or other equipment assistance.
将电子指南针在空间中做8字运动,需尽量使电子指南针采集到上、下、东、南、西、北八个方位(和空间直角坐标系的八个象限相对应)的数据。这样拟合出来的椭球精确度更高。椭球方程的一般表达式为:To move the electronic compass in a figure-of-eight movement in space, it is necessary to make the electronic compass collect the data of the eight azimuths (corresponding to the eight quadrants of the space Cartesian coordinate system) of up, down, east, south, west, and north. The ellipsoid fitted in this way has higher accuracy. The general expression of the ellipsoid equation is:
Ax2+By2+Cz2+Dxy+Exz+Fyz+Gx+Hy+Iz+J=0Ax 2 +By 2 +Cz 2 +Dxy+Exz+Fyz+Gx+Hy+Iz+J=0
所述的椭球拟合过程,采用最小二乘法拟合法求出椭球的10个最佳参数A,B,C,D,E,F,G,I,J和椭球球心坐标(X0,Y0,Z0)。Described ellipsoid fitting process adopts the least square method fitting method to find out 10 optimal parameters A of ellipsoid, B, C, D, E, F, G, I, J and ellipsoid spherical center coordinates (X0 ,Y0,Z0).
得到椭球方程的一般表达式后,分别将椭球投影至空间直角坐标系的三个坐标平面:XOY面、XOZ面和YOZ面。以椭球投影至XOY面为例,只需将椭球一般表达式:After obtaining the general expression of the ellipsoid equation, project the ellipsoid to three coordinate planes of the space Cartesian coordinate system: XOY plane, XOZ plane and YOZ plane. Taking the projection of the ellipsoid to the XOY plane as an example, only the general expression of the ellipsoid is:
Ax2+By2+Cz2+Dxy+Exz+Fyz+Gx+Hy+Iz+J=0Ax 2 +By 2 +Cz 2 +Dxy+Exz+Fyz+Gx+Hy+Iz+J=0
中的x变量取0,即可得椭球在XOY面上的投影方程:The x variable in is set to 0, and the projection equation of the ellipsoid on the XOY surface can be obtained:
Ax2+By2+Dxy+Gx+Hy+J=0Ax 2 +By 2 +Dxy+Gx+Hy+J=0
以此类推,可以分别得到椭球在XOZ、YOZ面上的投影方程:By analogy, the projection equations of the ellipsoid on the XOZ and YOZ surfaces can be obtained respectively:
Ax2+Cz2+Exz+Gx+Iz+J=0Ax 2 +Cz 2 +Exz+Gx+Iz+J=0
和and
By2+Cz2+Fyz+Hy+Iz+J=0By 2 +Cz 2 +Fyz+Hy+Iz+J=0
在只有地磁的作用时,将电子指南针在空间中旋转一周,磁传感器三轴输出的数据对应到空间直角坐标系上是一个以原点为球心的正圆球。而软磁的干扰会使得该正球畸变成椭球,软磁的干扰效果如图2所示。以软磁对X轴和Y轴的干扰分析为例,如图3所示,如果只有地磁作用,磁传感器的X轴和Y轴在水面上旋转一周后,输出的数据对应到直角坐标系上是一个圆心在原点的正圆形,然而软磁的干扰将两轴的数据拉伸为椭圆,并将该椭圆旋转了一定的角度,即软磁干扰下的椭圆并非标准椭圆,它具有一定的长轴转角。为消除软磁干扰,需要将椭圆旋转回标准椭圆,然后按照长轴和短轴的比例,将椭圆拉伸为正圆。Z轴的软磁干扰和补偿校准亦同理。所以,若要对磁传感器的三轴输出的数据进行精准的软磁校准,就必须分别求出三个坐标平面上的椭圆参数:α、b、长轴转角θ。When there is only the effect of geomagnetism, rotate the electronic compass once in space, and the data output by the three axes of the magnetic sensor corresponds to a perfect sphere with the origin as the center on the space Cartesian coordinate system. However, the interference of soft magnetism will make the orthosphere distort into an ellipsoid, and the interference effect of soft magnetism is shown in Fig. 2 . Take the analysis of the interference of soft magnetism on the X-axis and Y-axis as an example, as shown in Figure 3, if there is only geomagnetic action, after the X-axis and Y-axis of the magnetic sensor rotate a circle on the water surface, the output data corresponds to the Cartesian coordinate system It is a perfect circle with the center at the origin, but the soft magnetic interference stretches the two-axis data into an ellipse and rotates the ellipse by a certain angle, that is, the ellipse under the soft magnetic interference is not a standard ellipse, it has a certain Major axis angle. In order to eliminate soft magnetic interference, it is necessary to rotate the ellipse back to the standard ellipse, and then stretch the ellipse into a perfect circle according to the ratio of the major axis to the minor axis. The same is true for the soft magnetic interference and compensation calibration of the Z axis. Therefore, in order to perform accurate soft magnetic calibration on the three-axis output data of the magnetic sensor, it is necessary to separately calculate the ellipse parameters on the three coordinate planes: α, b, and the major axis rotation angle θ.
获得三个坐标平面上的椭圆的方程一般表达式后,即可分别根据椭圆一般方程的参数求出每个坐标平面上的椭圆参数:α,b和长轴转角θ。以XOY面为例,三个参数的计算公式如下:After obtaining the general expressions of the equations of the ellipse on the three coordinate planes, the parameters of the ellipse on each coordinate plane can be obtained according to the parameters of the general equation of the ellipse: α, b and the major axis rotation angle θ. Taking the XOY surface as an example, the calculation formulas of the three parameters are as follows:
其中,in,
G'=G·cos(θx,y)-H·sin(θx,y)G'=G·cos(θx,y)-H·sin(θx,y)
H'=G·sin(θx,y)+H·cos(θx,y)H'=G sin(θx,y)+H cos(θx,y)
A'=A·cos2(θx,y)-D·cos(θx,y)·sin(θx,y)+B·sin2(θx,y)A'=A·cos 2 (θx,y)-D·cos(θx,y)·sin(θx,y)+B·sin 2 (θx,y)
B'=A·sin2(θx,y)+D·cos(θx,y)·sin(θx,y)+B·cos2(θx,y)B'=A·sin 2 (θx,y)+D·cos(θx,y)·sin(θx,y)+B·cos 2 (θx,y)
同理可以求得XOZ面和YOZ面上各自的参数θx,z,αx,z,bx,z和θy,z,αy,z,by,z。In the same way, the respective parameters θx, z, αx, z, bx, z and θy, z, αy, z, by, z of the XOZ surface and YOZ surface can be obtained.
上述步骤所求得的椭球的球心和每个坐标平面上的椭圆的三个参数(共九个)即为电子指南针的软硬磁补偿校准所必需的补偿系数。之后磁传感器获取的数据都必须经过软硬磁补偿校准,具体的校准方法如下:The center of the ellipsoid and the three parameters (nine in total) of the ellipse on each coordinate plane obtained in the above steps are the compensation coefficients necessary for the soft and hard magnetic compensation calibration of the electronic compass. Afterwards, the data acquired by the magnetic sensor must be calibrated by soft and hard magnetic compensation. The specific calibration method is as follows:
硬磁的干扰使得磁传感器三轴输出的数据偏移一个固定量,这个偏移量就是椭球球心(X0,Y0,Z0)到原点的偏离距离。以传感器的X轴读出的数据为例,新读出的数据是偏移了X0。The interference of the hard magnet causes the data output by the three axes of the magnetic sensor to deviate by a fixed amount, which is the distance from the center of the ellipsoid (X0, Y0, Z0) to the origin. Taking the data read by the X axis of the sensor as an example, the newly read data is offset by X0.
传感器的Y轴和Z轴读出的数据同理。对磁传感器的三轴受到的硬磁干扰进行硬磁补偿校准,就是将磁传感器的三轴读到的数据分别减去上述的偏移量,即为:The data read by the Y-axis and Z-axis of the sensor are the same. Hard magnetic compensation calibration for the hard magnetic interference received by the three axes of the magnetic sensor is to subtract the above-mentioned offset from the data read by the three axes of the magnetic sensor respectively, which is:
xe=xreading-X0xe=xreading-X0
ye=yreading-Y0ye=yreading-Y0
ze=zreading-Z0ze=zreading-Z0
其中,xreading,yreading,zreading分别是磁传感器X轴、Y轴和Z轴新读取的数据,X0,Y0,Y0是拟合后的椭球球心坐标,xe,ye,ze是磁传感器三轴消除了硬磁干扰后的数据。Among them, xreading, yreading, and zreading are the data newly read by the magnetic sensor on the X-axis, Y-axis, and Z-axis respectively; X0, Y0, and Y0 are the coordinates of the center of the ellipsoid after fitting; xe, ye, and ze are the three coordinates of the magnetic sensor Axis data after eliminating hard magnetic interference.
为消除软磁干扰,本方法中分别对X轴-Y轴,X轴-Z轴,Y轴-Z轴进行软磁补偿校准。以X轴-Y轴的软磁补偿为例,根据所求得的XOY面上的椭圆的长轴转角θx,y,可得旋转矩阵R:In order to eliminate soft magnetic interference, in this method, soft magnetic compensation calibration is performed on X-axis-Y-axis, X-axis-Z-axis, and Y-axis-Z-axis respectively. Taking the soft magnetic compensation of the X-axis and Y-axis as an example, according to the major axis rotation angle θx,y of the ellipse on the XOY surface obtained, the rotation matrix R can be obtained:
然后将消除硬磁干扰后的数据旋转至标准椭圆上,具体为:Then rotate the data after removing the hard magnetic interference to the standard ellipse, specifically:
然后将上述的数据拉伸至正圆上。具体为:Then stretch the above data to a perfect circle. Specifically:
若αx,y>bx,y,有:If αx,y>bx,y, there are:
xc=xe0xc=xe0
若bx,y>αx,y,有:If bx,y>αx,y, there are:
yc=ye0yc=ye0
最后再将得到的数据xc,yc旋转回去,有:Finally, rotate the obtained data xc, yc back, there are:
其中xc0,yc0即为软硬磁补偿校准后的数据。对X轴-Z轴,Y轴-Z轴的软磁补偿也是同样的道理,如此重复计算后可以得到六个数据,分别是:Among them, xc0 and yc0 are the data after soft and hard magnetic compensation calibration. The same is true for the soft magnetic compensation of the X-axis-Z-axis and Y-axis-Z axis. After such repeated calculations, six data can be obtained, which are:
为了结果的精确性,本方法中对六个数据进行加权平均,得For the accuracy of the results, in this method, the weighted average of the six data is obtained.
其中,xvalue,yvalue,zvalue为磁传感器三轴经过软硬磁校准的最终数据。Among them, xvalue, yvalue, and zvalue are the final data of the three-axis magnetic sensor after soft and hard magnetic calibration.
由于轴不正交的干扰和软硬磁干扰在数学上的效果等同,所以上述过程也消除了磁传感器轴不正交所带来的干扰。Since the non-orthogonal axis interference and the soft and hard magnetic interference are mathematically equivalent, the above process also eliminates the interference caused by the non-orthogonal axis of the magnetic sensor.
以上是本发明的较佳实施例,凡依本发明技术方案所作的改变,所产生的功能作用未超出本发明技术方案的范围时,均属于本发明的保护范围。The above are the preferred embodiments of the present invention, and all changes made according to the technical solution of the present invention, when the functional effect produced does not exceed the scope of the technical solution of the present invention, all belong to the protection scope of the present invention.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810789601.3A CN109059960B (en) | 2018-07-18 | 2018-07-18 | A kind of calibration method of three-dimensional electronic compass |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810789601.3A CN109059960B (en) | 2018-07-18 | 2018-07-18 | A kind of calibration method of three-dimensional electronic compass |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109059960A true CN109059960A (en) | 2018-12-21 |
CN109059960B CN109059960B (en) | 2021-08-31 |
Family
ID=64817174
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810789601.3A Active CN109059960B (en) | 2018-07-18 | 2018-07-18 | A kind of calibration method of three-dimensional electronic compass |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109059960B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110307857A (en) * | 2019-04-23 | 2019-10-08 | 深圳市趣创科技有限公司 | Compass calibration method, apparatus, computer equipment and storage medium |
CN110426057A (en) * | 2019-06-27 | 2019-11-08 | 华为技术有限公司 | A kind of method and magnetometer data calibrating installation of magnetometer data calibration |
CN111998848A (en) * | 2020-08-28 | 2020-11-27 | 北京信息科技大学 | Ground roll pointing determination method and device |
CN114723924A (en) * | 2022-03-23 | 2022-07-08 | 杭州易现先进科技有限公司 | Method, system, device and medium for positioning large-scene augmented reality |
CN114812532A (en) * | 2022-05-30 | 2022-07-29 | 天津云圣智能科技有限责任公司 | Magnetic compass parameter calibration method, unmanned aerial vehicle course angle determination method and device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103674000A (en) * | 2013-11-01 | 2014-03-26 | 武汉猎隼科技有限公司 | Real-time electronic compass calibration algorithm |
EP3139128A1 (en) * | 2015-09-01 | 2017-03-08 | STMicroelectronics Srl | A calibration method for magnetic field sensing devices, corresponding system, apparatus and computer program product |
CN106556384A (en) * | 2015-09-28 | 2017-04-05 | 高新兴科技集团股份有限公司 | A kind of compensation for calibrating errors method of the electronic compass in tubular video camera |
CN107390155A (en) * | 2017-09-25 | 2017-11-24 | 武汉影随科技合伙企业(有限合伙) | A kind of Magnetic Sensor calibrating installation and method |
CN107631723A (en) * | 2017-09-21 | 2018-01-26 | 重庆华渝电气集团有限公司 | A kind of method of Electromagnetic compass autodegauss compensation |
CN107870001A (en) * | 2017-11-27 | 2018-04-03 | 东南大学 | A Calibration Method of Magnetometer Based on Ellipsoid Fitting |
CN107894241A (en) * | 2017-12-07 | 2018-04-10 | 智灵飞(北京)科技有限公司 | A kind of unmanned plane magnetic sensor calibration method, unmanned plane based on ellipsoid fitting |
-
2018
- 2018-07-18 CN CN201810789601.3A patent/CN109059960B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103674000A (en) * | 2013-11-01 | 2014-03-26 | 武汉猎隼科技有限公司 | Real-time electronic compass calibration algorithm |
EP3139128A1 (en) * | 2015-09-01 | 2017-03-08 | STMicroelectronics Srl | A calibration method for magnetic field sensing devices, corresponding system, apparatus and computer program product |
CN106556384A (en) * | 2015-09-28 | 2017-04-05 | 高新兴科技集团股份有限公司 | A kind of compensation for calibrating errors method of the electronic compass in tubular video camera |
CN107631723A (en) * | 2017-09-21 | 2018-01-26 | 重庆华渝电气集团有限公司 | A kind of method of Electromagnetic compass autodegauss compensation |
CN107390155A (en) * | 2017-09-25 | 2017-11-24 | 武汉影随科技合伙企业(有限合伙) | A kind of Magnetic Sensor calibrating installation and method |
CN107870001A (en) * | 2017-11-27 | 2018-04-03 | 东南大学 | A Calibration Method of Magnetometer Based on Ellipsoid Fitting |
CN107894241A (en) * | 2017-12-07 | 2018-04-10 | 智灵飞(北京)科技有限公司 | A kind of unmanned plane magnetic sensor calibration method, unmanned plane based on ellipsoid fitting |
Non-Patent Citations (1)
Title |
---|
陈雷 等: "三轴磁传感器误差分析与校准", 《舰船电子工程》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110307857A (en) * | 2019-04-23 | 2019-10-08 | 深圳市趣创科技有限公司 | Compass calibration method, apparatus, computer equipment and storage medium |
CN110426057A (en) * | 2019-06-27 | 2019-11-08 | 华为技术有限公司 | A kind of method and magnetometer data calibrating installation of magnetometer data calibration |
CN110426057B (en) * | 2019-06-27 | 2021-08-20 | 华为技术有限公司 | Magnetometer data calibration method and magnetometer data calibration device |
CN111998848A (en) * | 2020-08-28 | 2020-11-27 | 北京信息科技大学 | Ground roll pointing determination method and device |
CN114723924A (en) * | 2022-03-23 | 2022-07-08 | 杭州易现先进科技有限公司 | Method, system, device and medium for positioning large-scene augmented reality |
CN114812532A (en) * | 2022-05-30 | 2022-07-29 | 天津云圣智能科技有限责任公司 | Magnetic compass parameter calibration method, unmanned aerial vehicle course angle determination method and device |
CN114812532B (en) * | 2022-05-30 | 2022-10-11 | 天津云圣智能科技有限责任公司 | Magnetic compass parameter calibration method and unmanned aerial vehicle course angle determination method and device |
Also Published As
Publication number | Publication date |
---|---|
CN109059960B (en) | 2021-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109059960B (en) | A kind of calibration method of three-dimensional electronic compass | |
Fang et al. | A novel calibration method of magnetic compass based on ellipsoid fitting | |
CN107024674B (en) | A fast on-site calibration method of magnetometer based on recursive least squares method | |
CN101887068B (en) | Calibration compensation method for triaxial vector sensor and biaxial vector sensor | |
CN103630137B (en) | A kind of for the attitude of navigational system and the bearing calibration of course angle | |
Li et al. | Magnetic sensors for navigation applications: an overview | |
CN104406610B (en) | A kind of magnetometer real time correction device and method | |
CN105806364B (en) | A kind of calibration method of mining slewing drilling machine inclinometer probe | |
CN103743413B (en) | Heeling condition modulated is sought northern instrument alignment error On-line Estimation and is sought northern error compensating method | |
JPWO2006035505A1 (en) | Magnetic sensor control method, control device, and portable terminal device | |
KR20200091709A (en) | Electronic apparatus and control method thereof | |
Wahdan et al. | Three-dimensional magnetometer calibration with small space coverage for pedestrians | |
CN103591949A (en) | Orthogonal compensation method for triaxial attitude measurement system non-orthogonal error | |
CN107024673B (en) | Three axis magnetometer total error scaling method based on gyroscope auxiliary | |
CN112461224B (en) | Magnetometer calibration method based on known attitude angle | |
CN116817896A (en) | Gesture resolving method based on extended Kalman filtering | |
CN108088431B (en) | A self-calibrating electronic compass and its calibration method | |
Bhatia et al. | Development of an analytical method for IMU calibration | |
Ali et al. | An improved personal dead-reckoning algorithm for dynamically changing smartphone user modes | |
Sun et al. | A quaternion-based sensor fusion approach using orthogonal observations from 9D inertial and magnetic information | |
CN114509071B (en) | Attitude measurement method for wind tunnel test model | |
CN116660579A (en) | Wind speed data correction method, system and device | |
CN115235465A (en) | A method for combined magnetic force/GNSS measurement of attitude angle | |
CN110095115B (en) | Carrier attitude and heading measurement method based on geomagnetic information update | |
Finch et al. | Effectiveness of model-based motion estimation from an inertial measurement unit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |