Magnetic compass ellipse fitting error compensation method based on OPTICS algorithm

文档序号:1813693 发布日期:2021-11-09 浏览:18次 中文

阅读说明:本技术 基于optics算法的磁罗盘椭圆拟合误差补偿方法 (Magnetic compass ellipse fitting error compensation method based on OPTICS algorithm ) 是由 缪玲娟 吴子昊 周志强 于 2021-07-27 设计创作,主要内容包括:本发明公开一种基于OPTICS算法的磁罗盘椭圆拟合误差补偿方法,步骤一、载体在水平方向上做圆周运动旋转一周,传感器采集载体右向和前向的磁场强度数据;步骤二、采用OPTICS算法对所述磁场强度数据进行预处理,将其中正常数据点和奇异误差点分开,并剔除奇异误差点;步骤三、找出x轴和y轴所述正常数据点中最大绝对值,并将所有正常数据点分别除以所述最大绝对值;步骤四、采用最小二乘法对处理完的数据进行椭圆拟合,并对拟合后的系数进行相应的逆变换得出椭圆参数;步骤五:根据所述椭圆参数,计算磁罗盘的硬磁、软磁干扰系数;步骤六:根据所述干扰系数和传感器的测量数据,反推出真实的磁场强度;步骤七:根据所述磁场强度和当地磁偏角得出载体的航向角。(The invention discloses a magnetic compass ellipse fitting error compensation method based on an OPTIC algorithm, comprising the following steps that firstly, a carrier rotates for a circle in a circular motion manner in the horizontal direction, and a sensor acquires magnetic field intensity data of the carrier in the right direction and the front direction; preprocessing the magnetic field intensity data by adopting an OPTIC algorithm, separating normal data points from singular error points, and removing the singular error points; step three, finding out the maximum absolute value of the normal data points in the x axis and the y axis, and dividing all the normal data points by the maximum absolute value respectively; performing ellipse fitting on the processed data by adopting a least square method, and performing corresponding inverse transformation on the fitted coefficient to obtain an ellipse parameter; step five: calculating the hard magnetic and soft magnetic interference coefficients of the magnetic compass according to the elliptical parameters; step six: reversely deducing the real magnetic field intensity according to the interference coefficient and the measurement data of the sensor; step seven: and obtaining the course angle of the carrier according to the magnetic field intensity and the local magnetic declination.)

1. A magnetic compass ellipse fitting error compensation method based on an OPTICS algorithm is characterized by comprising the following steps:

the method comprises the following steps that firstly, a carrier rotates for a circle in a circular motion in the horizontal direction, and a sensor acquires magnetic field intensity data of the carrier in the right direction and the front direction;

preprocessing the magnetic field intensity data by adopting an OPTIC algorithm, separating normal data points from singular error points, and removing the singular error points;

step three, finding out the maximum absolute values of the normal data points in the x axis and the y axis, and dividing all the normal data points by the maximum absolute values respectively to ensure that each point after processing is in an interval of [ -1,1 ];

performing ellipse fitting on the processed data by adopting a least square method, and performing corresponding inverse transformation on the fitted coefficient to obtain an ellipse parameter;

step five: calculating the hard magnetic and soft magnetic interference coefficients of the magnetic compass according to the elliptical parameters;

step six: according to the interference coefficient and the measurement data of the sensor, the real magnetic field intensity on the x axis and the y axis is reversely deduced;

step seven: and obtaining the course angle of the carrier according to the magnetic field intensity and the local magnetic declination.

2. The method for compensating for the fitting error of the magnetic compass ellipse based on the OPTIC algorithm as claimed in claim 1, wherein the data of the cluster with the longest data volume is selected as the normal data point in the second step, and the rest are used as the singular error points.

3. The method for magnetic compass ellipse fitting error compensation based on the OPTIC algorithm as claimed in claim 1, wherein said preprocessing the magnetic field strength data by the OPTIC algorithm specifically comprises the steps of:

(1) creating an ordered queue Q and a result queue O;

(2) if all the elements in the set D are processed, the algorithm operation is finished; otherwise, selecting an unprocessed core object p and adding the unprocessed core object p into the queue O;

(3) acquiring all epsilon neighborhood object points N of the p points, adding the N points into an ordered queue Q, and performing ascending arrangement on the queue Q according to an ascending mode of the reachable distance;

(4) if the ordered queue Q is empty, jumping to the step (2); otherwise, taking out the first data sample point Q from the queue Q for expansion, and storing the point Q into a result queue O; in particular implementation, the first data sample point q may be selected as the point with the smallest reachable distance;

(5) and (4) if the point Q is not the core point, jumping to the step (4), otherwise, acquiring all epsilon neighborhood object points N of the point Q, adding the points N into the ordered queue Q, arranging the queue Q in an ascending order according to the ascending order of the reachable distance, and jumping to the step (4).

4. The method of claim 3, wherein the preprocessing of the magnetic field strength data is followed by further classification of the clustering results.

5. The method for compensating the fitting error of the magnetic compass ellipse based on the OPTICS algorithm as claimed in claim 4, wherein the classification is carried out by the following method:

(1) if the result queue O is empty, finishing classification, otherwise, taking out the first element p of the queue;

(2) if the reachable distance of the point p is less than or equal to epsilon, adding the point p into the current cluster C; otherwise, jumping to the step (3);

(3) if the core distance of the point p is greater than epsilon, classifying the point p as a noise point; otherwise, a new cluster C is created, the point p is added into the new cluster C, and the step (1) is skipped.

Technical Field

The invention belongs to the field of magnetic compass ellipse fitting and error compensation, and particularly relates to a magnetic compass ellipse fitting error compensation method based on an OPTICS algorithm, which is used for improving the resolving precision of a carrier course angle.

Background

In the prior art, an Inertial Navigation System (INS) and a Global Navigation Satellite System (GNSS) are generally combined in a vehicle navigation technology, and the advantages of the two systems are combined to improve the accuracy of a system output result. However, in a scenario with poor or no satellite signals, the combined navigation system has poor or unobservable course angle error observability, resulting in divergence of course error. The magnetic compass does not need external input, only solves the current course angle according to the geomagnetic vector information measured by the sensor, has the advantages of small volume, high concealment, low price and the like, and is widely applied to the fields of spaceflight, navigation, vehicle navigation, pedestrian navigation and the like.

Although the magnetic compass has many advantages, in a practical use scenario, the magnetic field measured by the sensor includes, in addition to the geomagnetic field, interference magnetic fields such as hard magnetic interference and soft magnetic interference around the sensor, and these interference magnetic fields seriously affect the resolution accuracy of the heading angle. In addition, due to the influence of non-orthogonality and scale coefficient errors in the manufacturing process of the three axial directions of the sensor, the geomagnetic field intensity sensed by the sensor has certain errors, and if the errors are not compensated and corrected, the accuracy of a final course calculation result is directly influenced.

Aiming at the application scene of vehicle navigation, due to the constraint of vehicle kinematics, the change ranges of the roll angle and the pitch angle are small, so that only horizontal correction of a magnetic compass under a two-dimensional plane is needed. At present, in a two-dimensional plane, a twelve-position method, a twenty-four-position method, an ellipse fitting method and the like are commonly used as error compensation methods for a magnetic compass. The two methods are less applied in vehicle navigation, and the ellipse fitting method is more widely applied to the error correction of the magnetic compass of the vehicle navigation.

Most of the existing magnetic compass ellipse fitting and correcting algorithms are directly fitted by using original data obtained by measuring by a sensor, and according to the original data, the coefficient of an ellipse equation is calculated by using a least square method, so that a hard magnetic error coefficient and a soft magnetic error coefficient are obtained, and then compensation is carried out, and a correct course angle is obtained. However, in the measurement process, because the sensor is influenced by the surrounding environment and limited by the accuracy of the sensor, singular error points may appear in the original data set, and the singular error points obviously deviate from normal data in a coordinate system, so that the fitting accuracy in the later period is reduced, and further the resolving accuracy of the magnetic heading angle is reduced. Aiming at the problem, the existing magnetic compass ellipse fitting correction method directly using the original data cannot be well solved.

In order to process an original data set, a least square ellipse fitting algorithm based on a DBSCAN algorithm appears, real-time data of a magnetic compass can be compensated to eliminate singular error points, but the DBSCAN algorithm in the scheme only filters a single singular error point but does not filter a cluster of singular error points, precision protection of later-stage ellipse fitting is not comprehensive enough, in addition, two parameters in the DBSCAN algorithm, namely a field radius epsilon and a minimum field point number m which becomes a core object, greatly influence an algorithm result, and the two parameters need to be adjusted under different use scenes, so that the application scenes of the algorithm are very limited.

Disclosure of Invention

The invention discloses a magnetic compass ellipse fitting error compensation method based on an OPTICS algorithm, which can accurately and efficiently eliminate singular error points in an original data set and improve the fitting precision of the ellipse fitting algorithm and the resolving precision of a course angle.

The invention is realized by the following technical scheme.

A magnetic compass ellipse fitting error compensation method based on an OPTICS algorithm comprises the following steps:

the method comprises the following steps that firstly, a carrier rotates for a circle in a circular motion in the horizontal direction, and a sensor acquires magnetic field intensity data of the carrier in the right direction and the front direction;

preprocessing the magnetic field intensity data by adopting an OPTIC algorithm, separating normal data points from singular error points, and removing the singular error points;

step three, finding out the maximum absolute values of the normal data points in the x axis and the y axis, and dividing all the normal data points by the maximum absolute values respectively to ensure that each point after processing is in an interval of [ -1,1 ];

performing ellipse fitting on the processed data by adopting a least square method, and performing corresponding inverse transformation on the fitted coefficient to obtain an ellipse parameter;

step five: calculating the hard magnetic and soft magnetic interference coefficients of the magnetic compass according to the elliptical parameters;

step six: according to the interference coefficient and the measurement data of the sensor, the real magnetic field intensity on the x axis and the y axis is reversely deduced;

step seven: and obtaining the course angle of the carrier according to the magnetic field intensity and the local magnetic declination.

The invention has the beneficial effects that:

according to the invention, the original sensor data is rapidly classified by using the OPTIC clustering algorithm before the least square ellipse fitting algorithm, the singular error points in the data set are accurately identified and removed, the singular error points can be effectively prevented from polluting the original data set, and the fitting precision of the ellipse fitting algorithm and the resolving precision of the course angle are further improved. In addition, data normalization processing is carried out in the process of ellipse fitting by using a least square method, all sensor data are divided by corresponding maximum absolute values, and the numerical value is limited in an interval of [ -1,1] so as to prevent data storage errors caused by overlarge data quantity and ensure the calculation accuracy in the calculation process. Compared with the traditional DBSCAN algorithm, the method effectively avoids the influence of input parameters in the DBSCAN algorithm on the clustering result, enlarges the application range and enhances the use flexibility.

Drawings

FIG. 1 is a flow chart of the magnetic compass ellipse fitting error compensation method based on the OPTICS algorithm;

FIG. 2 is a flow chart of the preprocessing of raw data by the OPTIC algorithm in an embodiment of the present invention;

fig. 3 is a flowchart illustrating classification of clustering results according to an embodiment of the present invention.

Detailed Description

The present invention will be described in detail with reference to the accompanying drawings.

As shown in fig. 1, in the magnetic compass ellipse fitting error compensation method based on the OPTICS algorithm of the present embodiment, an xyz axis of a three-axis magnetic compass points to the right, front, and top directions of a carrier, respectively, and only error compensation in the horizontal direction of an x axis and a y axis is considered for a vehicle-mounted situation, based on which the method specifically includes the following steps:

step one, the carrier rotates for a circle in a circular motion in the horizontal direction, and the sensor acquires magnetic field intensity data H of the carrier in the right direction and the front directionxmAnd Hym

Preprocessing the magnetic field intensity data by adopting an OPTIC algorithm, separating normal data points from singular error points, and removing the singular error points; in this embodiment, an input parameter of the OPTICS algorithm is ═ 4.5, and m is 5; selecting the cluster of data with the longest data volume length as a normal data point, and taking the rest as singular error points;

the preprocessing of the magnetic field intensity data by adopting the OPTIC algorithm specifically comprises the following steps:

(1) creating an ordered queue Q and a result queue O;

(2) if all the elements in the set D are processed, the algorithm operation is finished; otherwise, selecting an unprocessed core object p and adding the unprocessed core object p into the queue O;

(3) acquiring all epsilon neighborhood object points N of the p points, adding the N points into an ordered queue Q, and performing ascending arrangement on the queue Q according to an ascending mode of the reachable distance;

(4) if the ordered queue Q is empty, jumping to the step (2); otherwise, taking out the first data sample point Q from the queue Q for expansion, and storing the point Q into a result queue O; in particular implementation, the first data sample point q may be selected as the point with the smallest reachable distance;

(5) and (4) if the point Q is not the core point, jumping to the step (4), otherwise, acquiring all epsilon neighborhood object points N of the point Q, adding the points N into the ordered queue Q, arranging the queue Q in an ascending order according to the ascending order of the reachable distance, and jumping to the step (4).

The method comprises the following steps of preprocessing the magnetic field intensity data and then classifying clustering results, and specifically comprises the following steps:

(1) if the result queue O is empty, finishing classification, otherwise, taking out the first element p of the queue;

(2) if the reachable distance of the point p is less than or equal to epsilon, adding the point p into the current cluster C; otherwise, jumping to the step (3);

(3) if the core distance of point p is greater than ε, then it is classified as a noise point. Otherwise, a new cluster C is created, the point p is added into the new cluster C, and the step (1) is skipped.

Step three, finding out the maximum absolute value H in the normal data points of the x axis and the y axisxmmaxAnd HymmaxAnd dividing all normal data points by the maximum absolute value respectively to ensure the H of each point after processingxmAnd HymAre all in the interval [ -1,1 [)]Internal;

in specific implementation, because the processed data has the characteristics of large data volume and large numerical value, the operation steps of squaring, cubing, summing and the like are required in the next least square method, which may cause that the register cannot normally store the data. Therefore, prior to the least squares method, H is found in all data pointsxmMaximum absolute value of (H)xmmaxAnd HymMaximum absolute value of (H)ymmaxAnd H for each data pointxmAnd HymAre respectively divided by HxmmaxAnd HymmaxI.e. bySo that H of each pointxmAnd HymAre all in the interval [ -1,1 [)]And finally, performing inverse transformation on the calculation result, thereby effectively avoiding the calculation problem possibly caused by overlarge numerical value.

Performing ellipse fitting on the processed data by adopting a least square method, and performing corresponding inverse transformation on the fitted coefficient to obtain an ellipse parameter;

the standard ellipse fitting results are shown in equation (1):

however, since the data processing is performed in step three, equation (1) is transformed as follows:

wherein the content of the first and second substances,

obtaining after inverse transformation:

step five: calculating the hard magnetic and soft magnetic interference coefficients of the magnetic compass according to the elliptical parameters;

wherein the content of the first and second substances,

step six: according to the interference coefficient and the measurement data H of the sensorxmAnd HymThe real magnetic field intensity H on the x axis and the y axis is reversely deducedxAnd Hy

Step seven: according to the magnetic field intensity Hx、HyAnd the local declination D to obtain the course angle of the carrier

In summary, the above description is only a preferred example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:自动化原位成像半球谐振陀螺仪装配装置及装配方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!