Geomagnetic sensor calibration system
The geomagnetic sensor calibration system uses an acceleration sensor to divide space into sections for efficient collection and estimation of independent correction data, addressing the complexity of existing methods and enhancing real-time calibration accuracy.
Patent Information
- Application Number
- JP2020157272
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-09-18
- Publication Date
- 2024-12-16
- Estimated Expiration
- 2040-09-18
AI Technical Summary
Existing geomagnetic sensor calibration methods require complex and inefficient processing to determine independence of correction data, especially when a large number of data points are needed, making real-time calibration impractical.
A geomagnetic sensor calibration system that utilizes an acceleration sensor to divide space into sections, determining the area the gravity vector belongs to, and stores output values of the geomagnetic sensor in these sections, enabling efficient collection of independent correction data through area determination and least squares method estimation.
Enables easy determination of independent correction data, allowing for accurate and efficient calibration of geomagnetic sensors even with a large number of data points, reducing processing complexity and improving real-time calibration capabilities.
Smart Images

Figure 0007599877000032 
Figure 0007599877000033 
Figure 0007599877000034
Abstract
Description
[Technical field]
[0001] The present invention relates to a calibration method and algorithm for a geomagnetic sensor mounted on a portable device or the like. [Background technology]
[0002] Conventionally, geomagnetic sensors have been widely used, primarily in portable devices, as a means of identifying the attitude and direction of a product by detecting the strength and direction of the surrounding magnetic field. In an ideal environment with no surrounding noise, the set of points obtained by converting the output value of a geomagnetic sensor for each attitude into distance describes a sphere centered on the origin of the sensor coordinate system, as shown in Figure 1(a).
[0003] In reality, however, the sensor output value is significantly affected by magnetic noise from magnetic materials inside and outside the product, and generally results in an ellipsoid with a shifted origin, as shown in Figure 1(b). As a result, it becomes impossible to accurately detect the strength and direction of the surrounding magnetic field. For this reason, it is essential that products equipped with geomagnetic sensors implement a process to correct the ellipsoid with a shifted origin to a sphere centered on the original origin.
[0004] Magnetic noise can be broadly divided into two types. The first type is magnetic noise caused by hard magnetic materials present near the sensor. This magnetic noise has the effect of shifting all sensor output values by a certain amount, causing the center of the sphere that should be drawn to deviate from the origin. This phenomenon is called the hard iron effect. To eliminate this effect, the host must estimate the amount of shift from the origin (hereafter referred to as the offset correction value) and correct the sensor output value to be based on the origin.
[0005] The other is magnetic noise caused by soft magnetic materials present near the sensor. This magnetic noise has the effect of expanding and contracting the sensor output value at different ratios depending on the direction, causing the spherical surface that should be drawn to become an ellipsoid. This phenomenon is called the soft iron effect. To eliminate this effect, it is necessary for the host side to estimate the shape of the ellipsoid drawn by the sensor output value and correct the ellipsoid to the original sphere (hereinafter referred to as spherical correction conversion).
[0006] To obtain each of the above correction values, it is necessary to manage the output values of the geomagnetic sensor when the product is oriented in all directions as data on the host side, and estimate the correction values based on the obtained data group using a method such as the least squares method. To estimate these correction values more accurately, it is necessary to distinguish as much independent data as possible on the host side, that is, the output values of the sensor in different orientations, and select the original data (hereafter referred to as correction data) for estimating the correction values. Methods and algorithms for this have been proposed in the past.
[0007] Patent Document 1 proposes a method in which an attitude detection sensor is installed in addition to a geomagnetic sensor, and when it is determined based on the output value of the attitude sensor that an attitude change of a predetermined angle or more has occurred, the output value of the geomagnetic sensor is used as correction data to estimate the offset correction value of the sphere. [Prior art documents] [Patent documents]
[0008] [Patent Document 1] JP 2012-242267 A Summary of the Invention [Problem to be solved by the invention]
[0009] However, in the method of Patent Document 1, the independence of the correction data is judged based on the relative angle change of the output value of the attitude detection sensor, so when there is a large number of correction data, the judgment of independence is very complicated. For example, when 100 independent correction data are required, it is necessary to check the relative angle for all 4950 combinations of selecting two out of 100, which is a very huge process. In addition, it is unrealistic to execute the above order of confirmation process every time a new output value is obtained from the geomagnetic sensor. [Means for solving the problem]
[0010] In view of the above, the present invention provides a geomagnetic sensor calibration system, A system for calibrating a device including a geomagnetic sensor and an acceleration sensor, comprising: When θφ of the spherical coordinate rθφ is divided into multiple intervals, The gravity vector detected by the acceleration sensor is Divided Which section Determine whether it belongs to section A determination unit; The gravity vector belongs to section of section Information and section a storage unit that stores the output values of the geomagnetic sensor corresponding to the respective values as measurement information in pairs; a correction estimation unit that estimates a correction value of the geomagnetic sensor based on the measurement information stored in the storage unit; a data correction unit that corrects the output value of the geomagnetic sensor based on the correction value estimated by the correction estimation unit; The present invention is characterized by having the following. In addition, the geomagnetic sensor calibration system according to the present invention comprises: A system for calibrating a device including a geomagnetic sensor and an acceleration sensor, comprising: an area determination unit that determines to which area in space the gravity vector detected by the acceleration sensor belongs; a storage unit that stores, as measurement information, area information of the area to which the gravity vector belongs and an output value of the geomagnetic sensor corresponding to each area, in a pair; a correction estimation unit that estimates a correction value of the geomagnetic sensor based on the measurement information stored in the storage unit; a data correction unit that corrects the output value of the geomagnetic sensor based on the correction value estimated by the correction estimation unit; having The area determined by the area determination unit is an area obtained by dividing a curved surface described by a gravity vector detected by the acceleration sensor at a predetermined interval. Effect of the Invention
[0011] According to the present invention, even when a large amount of correction data is required, the independence can be easily determined, and a group of independent correction data can be efficiently collected. [Brief description of the drawings]
[0012] [Figure 1] 5 is a diagram showing a difference in output value of a geomagnetic sensor depending on whether magnetic noise is present or not. [Diagram 2] 1 is a block diagram showing the internal configuration of a system according to an embodiment of the present invention. [Diagram 3] FIG. 4 is a diagram showing areas used by an area determination unit of the system according to one embodiment of the present invention. [Figure 4] FIG. 2 is a diagram showing a specific area configuration method of the system according to the embodiment of the present invention. [Diagram 5] 3 is a flowchart showing the operation of a system according to an embodiment of the present invention. [Figure 6] 1 is an external view of a distance measuring device according to an embodiment of the present invention; [Figure 7] FIG. 2 is a diagram showing a two-point distance measurement by a distance measuring device according to an embodiment of the present invention. [Figure 8] FIG. 2 is a diagram showing the configuration of an area determination unit of a distance measuring device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0014] (First embodiment) <Internal structure> Fig. 2 shows the internal configuration of a geomagnetic sensor calibration system 1 according to one embodiment of the present invention. As shown in Fig. 2, the geomagnetic sensor calibration system 1 is broadly composed of a sensor unit 10, a control unit 20, and a storage unit 30. As an apparatus in which the geomagnetic sensor calibration system 1 according to this embodiment is mounted, a distance measuring device 100 described later or the like is suitably used.
[0015] The sensor unit 10 is composed of a geomagnetic sensor 11 and an acceleration sensor 12. Each sensor is connected to the control unit 20 via a communication interface, and can output the output value of each sensor to the control unit 20 in real time.
[0016] The geomagnetic sensor 11 detects a vector (hereinafter, magnetic vector) that represents the strength and direction of the surrounding magnetic field, and outputs it to the control unit 20. As described above, the geomagnetic sensor 11 also detects magnetic noise caused by magnetic objects in the vicinity, so its output value is a vector in which the magnetic noise components are superimposed on the magnetic vector that is the original target of interest. This vector generally describes an ellipsoid (prolate spheroid) with the origin shifted by pointing the geomagnetic sensor 11 in all directions.
[0017] Acceleration sensor 12 detects a vector representing the direction of gravity applied to the sensor (hereinafter, gravity vector), and outputs it to control unit 20. Since acceleration sensor 12 also detects the magnitude and direction of acceleration accompanying its own motion, its output value is a vector in which the acceleration component is superimposed on the gravity vector, which is the desired vector to be known.
[0018] The geomagnetic sensor 11 and the acceleration sensor 12 are each fixed on the product. That is, the output value of each sensor changes in conjunction with the change in the product's attitude, and each sensor outputs an output corresponding to the product's attitude.
[0019] The control unit 20 is composed of a data acquisition unit 21, a filter processing unit 22, a region determination unit 23, a data input / output unit 24, a correction estimation unit 25, a data correction unit 26, and an accuracy evaluation unit 27. An example of the control unit 20 is a microcontroller (hereinafter referred to as MPU), and each component of the control unit 20 is a program that runs on the MPU. Note that each component of the control unit 20 may be realized by a program or circuit configuration that runs on an electrical component different from the MPU.
[0020] The data acquisition unit 21 acquires the output values from the geomagnetic sensor 11 and the acceleration sensor 12 via the communication interface. It is desirable to set the time interval for acquiring the output values of each sensor as short as possible. This makes it possible to capture minute changes in the output values of each sensor, and therefore to collect correction data efficiently.
[0021] The filter processing unit 22 performs a smoothing process on the output values of each sensor acquired by the data acquisition unit 21. In general, the output values of each sensor vary to some extent due to electrical noise, and therefore the validity of the output values cannot be obtained from a single acquired value alone. Therefore, it is necessary to smooth each output value by performing a filter process. An example of the filter process is a moving average filter.
[0022] In particular, as described above, the acceleration sensor 12 outputs an acceleration component that is superimposed on the acceleration component associated with its own motion, so the direction of gravity cannot be accurately determined as is. For this reason, a method of removing the acceleration component by applying a filter process such as a low-pass filter to the output value is widely used. In the following, it is assumed that the acceleration component is removed from the output value of the acceleration sensor 12 by the filter process unit 22, and only the gravity vector is extracted.
[0023] The area determination unit 23 determines which area in space the gravity vector, which is the output value of the acceleration sensor 12, belongs to. Here, the area in space is a virtually set area on a sphere drawn by the gravity vector, with the origin of the sensor coordinate system of the acceleration sensor 12 as the center. The details of this area will be described later, but by determining which area the gravity vector belongs to, the independence of the output value of the geomagnetic sensor 11 can be guaranteed. Note that although it has been described as a sphere drawn by the gravity vector, in reality, the output from the acceleration sensor 12 is subject to variation and noise superimposed thereon, and therefore may become a curved surface close to a sphere.
[0024] The data input / output unit 24 is connected to the storage unit 30 via a communication interface, and inputs and outputs data to and from the storage unit 30. The data to be input / output are the output value of the geomagnetic sensor 11 and the determination result of the area determination unit 23, and these data are stored in pairs as measurement information in the storage unit 30. All correction data for estimating the correction value is stored in the storage unit 30.
[0025] The correction estimation unit 25 estimates the shape of the ellipsoid drawn by the output values of the geomagnetic sensor 11 based on the group of correction data stored in the memory unit 30. Also, based on the estimated shape of the ellipsoid, the correction estimation unit 25 calculates the offset correction value and the coefficient of the spherical correction conversion described above.
[0026] The data correction unit 26 performs a correction process for the output value of the geomagnetic sensor 11 based on the offset correction value calculated by the correction estimation unit 25 and the coefficient of the spherical correction conversion. As a result, the output value of the geomagnetic sensor 11, which described an ellipsoid with the origin shifted due to the influence of magnetic noise, now describes a sphere centered on the original origin, making it possible to accurately detect the strength and direction of the surrounding magnetic field.
[0027] The accuracy evaluation unit 27 evaluates the validity of the data after correction by the data correction unit 26. If the result of the evaluation indicates that the correction error is large, it requests the correction estimation unit 25 to re-estimate the correction value. The data that has passed through the accuracy evaluation unit 27 is passed to the main control unit on the product side in which this system is implemented, and is used for detecting the attitude of the product, etc.
[0028] As described above, the storage unit 30 is a place where data can be freely stored and referenced from the control unit 20 via a communication interface, and is composed of a storage device such as a HDD, SSD, etc. All correction data groups for estimating correction values are stored in the storage unit 30, and all data can be retained even if power is cut off.
[0029] In the above, the storage unit 30 is configured to be outside the control unit 20, but this is not limited to the above. For example, if the MPU used as the control unit 20 has an internal storage area such as a data flash memory area, it may be configured to use the internal storage area as the storage unit 30.
[0030] Also, a configuration may be adopted in which variables are prepared to store the correction data groups in the RAM area on the MPU. However, since the data in the RAM area is lost when the power supply to the MPU is cut off, it is necessary to save all of the correction data groups stored in the variables while the power is on in the memory unit 30, a data flash memory area on the MPU, or the like.
[0031] <Method of configuring the area determination unit> The method of configuring the area determination unit 23 is described below. As described above, the geomagnetic sensor 11 and the acceleration sensor 12 are fixed on the product, and therefore output corresponding to the attitude of the product. Therefore, by acquiring the output value of the geomagnetic sensor 11 and the output value of the acceleration sensor 12 at the same timing, it is possible to make a one-to-one correspondence between the two as output values in the same attitude. This makes it possible to substitute the determination of the independence of the output value of the geomagnetic sensor 11 for the determination of the independence of the output value of the acceleration sensor 12.
[0032] Unlike the output value of the geomagnetic sensor 11, the output value of the acceleration sensor 12 is not affected by magnetic noise due to magnetic bodies present inside and outside the product. As described above, the acceleration components acting on the acceleration sensor 12 itself are removed by the filter processing unit 22, so the output value captures the gravity vector with the origin of the sensor coordinate system as the reference. In other words, by orienting the sensor in all directions, the output value of the acceleration sensor 12 describes a sphere with the origin of the sensor coordinate system as the center and the magnitude of gravity (gravitational acceleration) as the radius.
[0033] 3(a), a plurality of virtual regions R (R1, R2, ..., Rn) are defined by dividing the spherical surface described by the output value of the acceleration sensor 12 (i.e., the gravity vector). The size, shape, and number of divisions of these regions can be set arbitrarily, but as will be described later, it is desirable to set the number of divisions so that the size of the regions does not become too small.
[0034] As can be seen from the above definition, the end point of a gravity vector always exists on the above-mentioned sphere and belongs to one of the above-mentioned regions. Now, consider two gravity vectors G1 and G2 acquired at different times, and let the regions to which each gravity vector belongs be R1 and R2. If R1 and R2 are in different regions as shown in Figure 3(b), the gravity vectors G1 and G2 can be considered to be pointing in different directions, and the two gravity vectors can be determined to be independent.
[0035] On the other hand, as shown in Fig. 3(c), if R1 and R2 are in the same region, the gravity vectors G1 and G2 are regarded as pointing in the same direction, and it can be determined that the two gravity vectors are not independent. That is, by checking which region on the sphere the gravity vector belongs to, it is possible to determine the independence of the gravity vector. This is also the same as determining the independence of the output values of the geomagnetic sensor 11, as described above.
[0036] Therefore, the output value of the geomagnetic sensor 11 and information on the region to which the gravity vector acquired from the acceleration sensor 12 at the same timing belongs are paired and stored in the storage unit 30 and managed as data. Then, when a new output value is acquired from the geomagnetic sensor 11, it is possible to easily determine the independence of the data group stored in the storage unit 30 by checking to which region the gravity vector acquired at the same timing belongs.
[0037] When data belonging to the same area is obtained, the old data is overwritten with the new data. This ensures that one piece of data obtained based on the latest surrounding environment is always held in each area. Since the independence of all data in each area is guaranteed, the correction value can be accurately estimated by applying the least squares method or the like to all data (output values of the geomagnetic sensor 11) stored in the memory unit 30 as a correction data group.
[0038] As can be seen from the above, the number of independent correction data obtained by the above method is equal to the division number of the region. Therefore, it is necessary to determine the division number of the region based on the number of correction data required to estimate the correction value. When the least squares method is used as a means for estimating the correction value, the estimation accuracy generally improves as the number of independent correction data increases.
[0039] However, the more the number of divisions of the region, the smaller the size of each region, and as described later, the lower the probability that the gravity vector belongs to each region. That is, since the data of each region is less likely to be updated, there is a risk that the estimation accuracy of the correction value in a new environment will deteriorate. Therefore, it is desirable to determine the number of divisions in consideration of the number of correction data required for estimating the correction value so that the size of the region does not become too small.
[0040] In addition, the gravity vector moves around on the sphere according to the change in the product's posture, and if we assume that all locations on the sphere are visited with the same frequency, the larger the area, the higher the probability that the product belongs to that area. Conversely, the smaller the area, the lower the probability that the product belongs to that area, and the more difficult it is to obtain data for that area. In other words, in order to obtain data for each area equally, it is desirable to define each area so that its size is equal.
[0041] However, depending on the product, the gravity vector may not visit all locations on the sphere with the same frequency. For example, tablet devices are often used with the display facing up. Therefore, the gravity vector will visit the vicinity of the area indicated when the product is in use with the display facing up more frequently. In such a case, it is desirable to make it easier to obtain data by defining the size of the area near the direction indicated by the gravity vector when the product is in use smaller than the size of the area less frequently visited by the gravity vector, and defining the size of the area less frequently visited by the gravity vector relatively large.
[0042] In the above, the number of data items held for each region is one, but this is not limited. A configuration in which multiple data items are held for each region may also be used. The number of data items held for each region may also be variable. For example, as described above, when the size of a region is adjusted and defined according to the frequency with which the gravity vector visits, if the number of data items held for each region is limited to one, the larger the region, the less independent data items will be in its vicinity. Therefore, it is desirable to set the number of data items that can be held to be larger for larger regions.
[0043] When multiple data are stored in one region, it is desirable to check the independence of data belonging to the same region using a method other than the discrimination method based on the region containing the corresponding gravity vector (first method). This makes it possible to avoid storing non-independent data in the same region, and improve the estimation accuracy of the correction value. To check this independence, for example, it is sufficient to calculate the angle θ between two vectors by vector dot product calculation and check that it is equal to or greater than a predetermined angle (second method). Specifically, for two vectors r1 and r2, the angle θ can be calculated using the following formula.
number
[0044] In addition, in the above description, all the defined regions are used, but this is not the only possibility. It is also possible to use only a portion of the defined regions. For example, in the case of the above-mentioned tablet terminal, if data is stored even for regions where the gravity vector visits infrequently, the data for those regions will remain without being updated even if the surrounding environment changes, which may cause a risk of deteriorating the estimation accuracy of the correction value in the new environment. Therefore, the above risk can be avoided by storing data only for regions where the gravity vector visits frequently.
[0045] However, if the area used is too narrow, the entire image of the ellipsoid drawn by the output value of the geomagnetic sensor 11 cannot be captured, and the estimation accuracy of the correction value deteriorates. Therefore, it is necessary to secure a minimum area that can capture the entire image of the ellipsoid. For example, when making the estimation using the least squares method described later, it is desirable to secure an area in which the gravity vector draws at least a hemisphere.
[0046] A specific example of a method for configuring the above-mentioned area determination unit 23 is shown below. If the gravity vector obtained from the acceleration sensor 12 is taken as weight vector G, the weight vector G describes a sphere with the origin of the sensor coordinate system XYZ as its center and the absolute value |G| (gravitational acceleration) as its radius, and the end point of the weight vector G always exists on this sphere. Therefore, as shown in Fig. 4(a), consider a coordinate transformation from the sensor coordinate system XYZ to spherical coordinates rθφ, and express the gravity vector G in spherical coordinates rθφ.
[0047] The coordinate components of the gravity vector G in the sensor coordinate system XYZ are G x , G y , G z , the coordinate components in the spherical coordinate system rθφ are r G , θ G , φ G Then, the following relationship holds between the two:
number
[0048] As can be seen from the above equation, r G is constant because it is equal to the absolute value |G| of the gravity vector G. In this way, when using spherical coordinates rθφ, the point on the sphere drawn by the gravity vector G is expressed as the angle θ G , φ G It can be expressed as θ G , φ G The range of values that can be taken by is 0≦θ G ≦π, 0≦φ G ≦2π.
[0049] Here, θ G Divide the range of φ into 4 equal parts. G If we divide the range of θ into eight equal parts, the range of values that both can take is divided into intervals of width π / 4. To illustrate this situation, as shown in Figure 4(b), the surface of the sphere is G , φ G There are 32 regions spaced at intervals of π / 4. (section) These 32 regions are divided into (Section determination section) Area used in 23 (section) Define it as:
[0050] By associating one output value of the geomagnetic sensor 11 with each of the 32 regions, 32 independent correction data groups can be collected. That is, by acquiring the output value of the geomagnetic sensor 11 at the timing when the gravity vector G belongs to each of the 32 regions, the independence of the 32 correction data can be guaranteed. The correction data groups are stored and managed in the storage unit 30.
[0051] To determine which region the gravity vector G currently belongs to, use Equation 2 to calculate θ G , φ G Calculate each and θ G In which of the four equal intervals does φ belong? G It is sufficient to check which of the eight equal intervals θ belongs to by checking the correction data group stored in the storage unit 30. G , φ G The information can be managed by a table corresponding to the above.
[0052] As mentioned above, θ G , φ G If the range is divided equally into regions, the θ calculated by Eq. G , φ G By dividing by the respective division widths (in this embodiment, both are π / 4) and checking the integer parts of the results, it is possible to easily determine which interval the area belongs to, with the first interval being 0. In this way, by using the spherical coordinates rθφ, it is possible to easily define and determine the areas.
[0053] For the above example, an example of the correction data group stored in the storage unit 30 is shown in Table 1. Here, the i-th correction data is A i The X, Y, and Z components are expressed as x i , y i , z i Let us assume that. [Table 1]
[0054] In the above, θ G , φ G The ranges of θ are divided into 4 and 8 equal parts, respectively, but this is not limited to this. Depending on the number of correction data required to estimate the correction value, G , φ G The number of divisions of θ may be increased or decreased. G , φ G It is the product of the number of divisions. For example, θ G , φ G If the range is divided into 10 and 15, respectively, 150 correction data items can be obtained.
[0055] θ G , φ GThe division width does not necessarily have to be equal. As described above, the size of each region may be adjusted by expanding or contracting the width (angle) of the section depending on the frequency with which the gravity vector G occurs. Also, as described above, the number of data items held for each region does not have to be one, and a configuration in which multiple data items are held for each region is also possible. Also, as described above, it is not necessary to use all of the 32 regions, and only some of the regions may be used.
[0056] <Processing method of correction estimation part> The following describes the correction value estimation process executed by the correction estimation unit 25. Although an example using the least squares method is described as a correction value estimation method, the present invention is not limited to this. Any method may be used as long as it can accurately estimate the correction value.
[0057] As described above, the output value of the geomagnetic sensor 11 generally describes an ellipsoid with a shifted origin. In other words, the correction data group stored in the memory unit 30 by the processing of the area determination unit 23 is considered to represent all points on this ellipsoid.
[0058] Geometrically, ellipsoids are classified as quadratic surfaces, and their general expression is given by nine parameters a xx , a yy , a zz , a xy , a yz , a zx , a x , a y , a z This is expressed as follows:
number
[0059] Therefore, if all of the above nine parameters are found based on the group of correction data stored in the storage unit 30, the shape of the ellipsoid can be determined.
[0060] The correction data group stored in the memory unit 30 represents points on the above-mentioned ellipsoid, so all of the correction data Ai should satisfy Equation 3. However, as mentioned above, the output value of each sensor varies to some extent due to electrical noise, etc., so some of the correction data may be off the ellipsoid, i.e., may not satisfy Equation 3. Therefore, each correction data A i Consider the squared error from Equation 3, and determine the nine parameters so that the sum (cumulative error) is minimized. This method is called the least squares method.
[0061] i-th correction data A i (X, Y, Z components are x i , y i , z i For the above, the error from Eq. 3 is δ i This is expressed as Equation 4.
number
[0062] The square of the above error δ i 2 All correction data A i The sum of the errors is calculated for (i=1 to N), and the cumulative error Δ is defined as Equation 5.
number
[0063] It is necessary to determine nine parameters so that this Δ is minimized.
[0064] The above Δ is a quadratic function for each of the nine parameters, when each parameter is considered as a variable. In addition, since the quadratic coefficient of each parameter is guaranteed to be positive, the function is convex downwards, and there exists a minimum value for Δ for each parameter. Therefore, we consider the condition for Δ to be minimized for each parameter. That is, the partial differential coefficient of Δ for each parameter is zero. Therefore, we obtain the following nine conditional equations.
number
[0065] By expanding the above equation and rearranging it into a matrix, it can be summarized as follows:
number
[0066] Here, M is a 9×9 matrix and m is a 9×1 vector, which are defined as follows:
number
[0067] The inverse matrix M of the above matrix M -1 By multiplying both sides of Equation 7 from the left, we obtain the following equation, which contains the nine parameters a xx , a yy , a zz , a xy , a yz , a zx , a x , a y , a z can be solved.
number
[0068] These are the nine parameters that minimize the cumulative error Δ. The quadric surface of Equation 3 expressed by these nine parameters is the ellipsoid that best approximates the correction data group stored in the storage unit 30, that is, the shape of the ellipsoid drawn by the output values of the geomagnetic sensor 11.
[0069] However, because the shape of the ellipsoid is not clear in the formula 3, it is not possible to obtain the offset correction value and the spherical correction transformation. Therefore, below we will explain how to rewrite formula 3 into the following formula, which is well known as the standard form of an ellipsoid.
number
[0070] If we can rewrite it into the form of equation 10, we can find the center coordinates of the ellipsoid as x0', y0', and z0', and we can immediately calculate the offset correction value. In addition, each radius in the X', Y', and Z' axes directions is r x , r y , r z Therefore, it is possible to obtain the scaling information (conversion coefficients) required for the spherical correction conversion.
[0071] The left hand side of equation 3 can be rewritten in the following form, called a quadratic form:
number
[0072] Here, the matrix A, vectors x and b are defined as follows:
number
[0073] Also, the subscript t in the upper left corner of the letter represents the transpose operation on a matrix or vector.
[0074] Among the nine parameters, the off-diagonal elements of matrix A, a xy , a yz , a zx represents the rotation of the ellipsoid in three-dimensional space. The fact that these three parameters are not zero means that the radii of the ellipsoid are not aligned with the respective axis directions of the sensor coordinate system XYZ. In other words, to convert Equation 3 into Equation 10, it is necessary to find another coordinate system in which the radii of the ellipsoid are aligned with the respective axis directions (the off-diagonal elements of matrix A are zero), and transform into that coordinate system. This transformation is called the principal axis transformation.
[0075] The principal axis transformation can be obtained as follows. First, an eigenvalue problem for the matrix A in Equation 12 is solved. The eigenvalue problem is to find a pair of eigenvalue λ and eigenvector e that satisfy the following equation.
number
[0076] Generally, when matrix A is an N×N matrix, there are N pairs of eigenvalue λ and eigenvector e that satisfy formula 13. Since matrix A in formula 12 is a 3×3 matrix, there are three pairs of eigenvalue λ and eigenvector e. Therefore, the three eigenvalues are λ1, λ2, and λ3, and the eigenvectors corresponding to each eigenvalue are e1, e2, and e3. However, e1, e2, and e3 are normalized so that their lengths are 1.
number
[0077] Many algorithms have been proposed for calculating the above set of eigenvalue λ and eigenvector e on a program. In particular, the Jacobi method is known when matrix A is a symmetric matrix, and can be applied to matrix A in equation 12. In addition, when matrix A is a symmetric matrix, its eigenvalues λ are all real numbers, and it is known that the eigenvectors e corresponding to different eigenvalues λ are mutually orthogonal. In other words, the eigenvectors e1, e2, and e3 form an orthonormal system.
[0078] Based on the above, the three equations in Equation 14 can be summarized as follows:
number
[0079] Here, we define a matrix (e1e2e3) in which the eigenvectors e1, e2, and e3 are arranged horizontally, and denote it as T. As mentioned above, the eigenvectors e1, e2, and e3 form an orthogonal system, so T is an orthogonal matrix and represents a rotation transformation in three-dimensional space. Therefore, the inverse matrix of T is its own transpose matrix t T, and the following relationship holds:
number
[0080] In Equation 16, I is a unit matrix whose diagonal elements are all 1. Also, the transpose matrix t T is also obviously an orthogonal matrix, and represents a rotation transformation in three-dimensional space (the inverse rotation of T).
[0081] So, on both sides of Equation 15, t By multiplying by T, we get the following relationship:
number
[0082] That is, matrix A is the matrix T in which the eigenvectors e1, e2, and e3 are arranged horizontally, and its transpose matrix t Using T, it is possible to make it a diagonal matrix with eigenvalues λ1, λ2, and λ3 as diagonal components.
[0083] Using the relationships in Equation 16 and Equation 17, Equation 11 can be transformed as follows:
number
[0084] Here, x' and b' are defined by the following formulas.
number
[0085] As mentioned earlier, t Since T is an orthogonal matrix, Equation 19 represents the transformation from the sensor coordinate system XYZ to another coordinate system X'Y'Z' (a coordinate system obtained by rotating the sensor coordinate system XYZ).
[0086] As can be seen from the final form of Equation 18, when viewed from the coordinate system X'Y'Z', the off-diagonal elements of the matrix are zero. In other words, each radius of the ellipsoid is along the direction of each axis of the coordinate system X'Y'Z'. Therefore, in Equation 19, t We can see that T is the principal axis transformation we are looking for.
[0087] Therefore, by expanding and rearranging equation 18 with the components of x' being x1', x2', and x3' and the components of b' being b1', b2', and b3', we obtain the following equation.
number
[0088] Since Equation 20 is originally a transformation of the left side of Equation 3, Equation 3 can ultimately be expressed as the standard form of an ellipsoid in the coordinate system X'Y'Z' as follows.
number
[0089] Comparing Equation 21 with Equation 10, the center coordinates x0', y0', z0' of the ellipsoid and the radii r in the X', Y', and Z' directions are x , r y , r z can be seen to be given by the following equations, respectively:
number
[0090] As mentioned above, x0', y0', and z0' in Equation 22 are the center coordinates of the ellipsoid and correspond to the offset correction values, but because they are coordinate values seen from the coordinate system X'Y'Z', they need to be converted to coordinate values seen from the original sensor coordinate system XYZ. To do this, it is sufficient to perform an inverse transformation of the principal axis transformation in Equation 19. In other words, it is sufficient to convert from the coordinate system X'Y'Z' to the sensor coordinate system XYZ using the following equation obtained by multiplying both sides of Equation 19 by the matrix T from the left.
number
[0091] Therefore, the center coordinates x0, y0, z0 of the ellipsoid as viewed from the sensor coordinate system XYZ can be obtained by converting x0', y0', z0' in equation 22 using equation 23 as follows:
number
[0092] These x0, y0, and z0 are the offset correction values to be obtained.
[0093] The spherical correction transformation can be obtained as follows. The spherical surface that should be drawn by the output value of the geomagnetic sensor 11 expands and contracts along each axis direction of the coordinate system X', Y', and Z' due to the influence of magnetic noise. As a result, each radius is changed by r in Equation 22. x , r y , r z It is considered that the output value of the geomagnetic sensor 11 is the magnitude B of the magnetic field that the geomagnetic field surrounding the earth exerts on the device, if there is no magnetic noise or other magnetic material in the surroundings. e Draw a sphere with radius B. From this, by stretching and retracting in each axis direction of the coordinate system X'Y'Z', each radius is B e This scaling matrix S can be clearly expressed as follows:
number
[0094] Since the output value obtained from the geomagnetic sensor 11 is based on the sensor coordinate system XYZ, in order to perform spherical correction on this output value, (1) the output value must be converted to the coordinate system X'Y'Z', (2) it must be scaled in each axis direction of the coordinate system X'Y'Z' by the scaling matrix S, and (3) it must be converted back to the original sensor coordinate system XYZ. The above (1) to (3) can be expressed as the following equations.
number
[0095] Therefore, the spherical correction transformation P to be obtained is given by combining (1) to (3) in equation 26 as follows:
number
[0096] The execution timing of the above process executed by the correction estimation unit 25 can be set arbitrarily. For example, a specific operation by a user on a product in which this system is implemented may be used as a trigger, or the process may be executed every time new correction data is obtained from the geomagnetic sensor 11.
[0097] However, when the number of correction data required to estimate the correction value is not present in the memory unit 30, such as when the power is turned on for the first time, the correction value cannot be estimated accurately. Therefore, it is necessary to confirm that the predetermined number of correction data is present in the memory unit 30 before executing the correction value estimation.
[0098] When the storage unit 30 does not have the predetermined number of correction data, the correction values cannot be estimated, and therefore the offset correction values x0, y0, z0, and spherical correction transformation P are left undetermined. Therefore, initial values are given to the offset correction values x0, y0, z0, and spherical correction transformation P, and these are used as substitutes until the storage unit 30 stores the predetermined number of correction data.
[0099] The simplest example of the initial value is as follows:
number
[0100] In this case, the offset correction value is zero, and the spherical correction transformation P is an identity transformation of a unit matrix, so that the output value of the geomagnetic sensor 11 becomes the corrected output value as is.
[0101] The initial values of Equation 28 are merely examples and are not limited to these. For example, if the offset correction values x0, y0, z0 and the spherical correction transformation P can be predicted to some extent due to conditions such as the surrounding environment, those values may be used as the initial values.
[0102] The data correction unit 26 performs a correction process for the output value of the geomagnetic sensor 11 using the offset correction values x0, y0, z0 obtained by the correction estimation unit 25 and the spherical correction transformation P. Specifically, the output value of the geomagnetic sensor 11 before correction is calculated as x s , y s , z s , the corrected output value is x c , y c , z c Then, the correction process can be performed by the following formula.
number
[0103] This corrected output value x c , y c , z c describes a sphere centered on the origin of the sensor coordinate system of the geomagnetic sensor 11. Therefore, by using this corrected output value, it becomes possible to accurately detect the strength and direction of the surrounding magnetic field.
[0104] The corrected output value x obtained by Equation 29 c , y c , z c If the offset correction values x0, y0, z0 and the spherical correction transformation P estimated above are accurate, the original spherical surface will be drawn as described above. However, if the estimated correction values are inaccurate, or if the current correction values cannot be used for accurate correction due to changes in the surrounding environment, the corrected output value x c , y c , z c will again fall off the sphere.
[0105] Therefore, the accuracy evaluation unit 27 evaluates the corrected output value x c , y c , z c As mentioned above, the radius of the sphere is the magnitude of the magnetic field B that the Earth's magnetic field exerts on the device. e Therefore, the corrected output value x c , y c , z cis required to meet the following conditions:
number
[0106] Here, R thresh is the threshold of the allowable error. This value can be set arbitrarily based on the desired correction accuracy.
[0107] Corrected output value x c , y c , z c However, if the condition of Expression 30 is not satisfied, it is determined that the correction error is large, and a request is made to the correction estimation unit 25 to execute a correction value estimation process. Upon receiving the request, the correction estimation unit 25 estimates a correction value based on the latest correction data group.
[0108] In the above, the magnitude of the magnetic field B that the earth's magnetic field exerts on the device is e However, the spherical correction and the accuracy evaluation are performed based on this standard. For example, if it is not necessary for the geomagnetic sensor 11 to accurately detect the strength of the magnetic field and it is sufficient to detect only the direction of the magnetic field, the above-mentioned magnetic field magnitude B e Instead of x, any positive constant α may be substituted. As a result, the scaling matrix S in Equation 25 is scaled based on α, and the corrected output value x obtained by Equation 29 is c , y c , z c describes a sphere of radius α.
[0109] For example, in the embodiment described later, since it is not necessary to accurately detect the strength of the magnetic field, the magnitude B e Instead of the radius r of the ellipsoid shown in Eq. 22, x , r y , r z The maximum value of r z If it was, then B e =α=r z Then, the corrected output value x c , y c , zc is the radius r z In this case, B in Eq. 30 e Similarly, r z Then, the correction accuracy is within the tolerance R thresh You just need to check that the following is true.
[0110] In the above, the evaluation method in the accuracy evaluation unit 27 is based on the formula 30, but this is not limited to this. c , y c , z c Any other process may be used as long as the method can appropriately evaluate the validity of the above.
[0111] In addition, when it is determined that the correction error is large, the accuracy evaluation unit 27 requests the correction estimation unit 25 to execute the process of estimating the correction value, but this is not limited to the above. For example, it is also possible to warn the user through a user interface that the correction error is large, and execute the process of estimating the correction value based on the user's judgment.
[0112] <Control flow> The following describes the overall flow of the processing executed by the geomagnetic sensor calibration system 1. Fig. 5 shows an operation flowchart of the geomagnetic sensor calibration system 1. First, in step S1, the data acquisition unit 21 acquires output values from the geomagnetic sensor 11 and the acceleration sensor 12 at the same time. This processing is executed at regular time intervals.
[0113] The acquired output values of each sensor are smoothed by various filter processes in the filter processing unit 22. In particular, the output value of the acceleration sensor 12 has its acceleration component associated with its own motion removed, and only the gravity vector is extracted (step S2).
[0114] Next, in step S3, the area determination unit 23 determines which part of the entire defined area the gravity vector belongs to. The area information and the output value of the geomagnetic sensor 11 are paired and stored in the storage unit 30 via the data input / output unit 24 (step S4).
[0115] In step S5, it is confirmed how many pieces of correction data are stored in the storage unit 30. If the number is less than the number of pieces of data (assumed to be N) required for the correction value estimation process in the correction estimation unit 25, the process proceeds to step S10 described later.
[0116] If N or more correction data are present in the storage unit 30, in step S6, it is confirmed whether there is a request to execute a correction value estimation process. This execution request is issued by the accuracy evaluation unit 27 when it is determined in step S12 described below that the error in the correction result by the data correction unit 26 is large. If there is an execution request, the process proceeds to step S8 described below.
[0117] If there is no execution request, in step S7, it is confirmed whether the execution conditions for the correction process are satisfied. As described above, this condition can be set arbitrarily, and for example, a specific operation input by a user to an operation unit of a product in which this system is implemented can be cited. If this execution condition is not satisfied, the process proceeds to step S10 described later.
[0118] If the execution conditions of step S7 are satisfied or if it is determined in step S6 that an execution request has been made, the correction estimation unit 25 acquires a set of correction data from the storage unit 30 via the data input / output unit 24, and executes a correction value estimation process (step S8). As a result, the latest offset correction value and spherical correction transformation based on the set of correction data in the storage unit 30 are obtained.
[0119] In step S9, the offset correction value and the coefficient of the spherical correction conversion used in the data correction unit 26 are updated to the correction values obtained in step S8. After this, the data correction unit 26 corrects the output value of the geomagnetic sensor 11 based on the latest correction value obtained in step S8.
[0120] In step S10, the output value of the geomagnetic sensor 11 is corrected based on the latest offset correction value and the coefficient of the spherical correction conversion by the data correction unit 26. The output value after this correction describes a sphere with the origin of the sensor coordinate system of the geomagnetic sensor 11 as the center.
[0121] In step S11, the correction accuracy of the corrected output value obtained in step S10 is confirmed. If the correction accuracy is within a predetermined allowable error range, the process proceeds to step S13, which will be described later.
[0122] If the correction accuracy exceeds a predetermined allowable error range, a request to execute a correction value estimation process is issued to the correction estimation unit 25 (step S12). This execution request is referred to in step S6 as described above.
[0123] In step S13, the corrected output value obtained in step S10 is passed to the main control unit on the product side in which this system is implemented. The main control unit on the product side applies the corrected output value to detection of the product's attitude, etc. In the flowchart of FIG. 5, if the correction accuracy is within a predetermined allowable error range in step S11, the process proceeds to step S12 and step S1, and the corrected output value is not passed to the product side. However, the present invention is not limited to this, and the corrected output value may be passed to the product side even if the correction accuracy exceeds a predetermined allowable error range in step S11.
[0124] Thereafter, by repeating the above steps from step S1, it is possible to efficiently collect a group of independent correction data for the geomagnetic sensor 11, and also to improve the responsiveness of the correction values to changes in the product usage environment.
[0125] <Example: Distance measuring device> In the following, a distance measurement device 100 will be described as a specific embodiment of the geomagnetic sensor calibration system 1. The distance measurement device 100 is characterized in that it can measure the straight-line distance from the device to an object, as well as the distance between any two points in space.
[0126] 6 is a perspective view showing the appearance of the distance measurement device 100 according to this embodiment. A measurement unit 101 is provided on the top surface of the housing, which can measure the linear distance from the distance measurement device 100 to the object by projecting laser light toward the object and receiving reflected light from the object.
[0127] The front of the housing is provided with an operation unit 102 for measuring distances and changing various settings, and a display unit 103 for displaying measurement results and various setting items. The distance measuring device 100 is designed to be held in the user's hand, and the operation unit 102 and the display unit 103 are each positioned so that the user can easily operate the device and easily view the display when the device is held in the user's hand.
[0128] In addition, the distance measuring device 100 is equipped with a geomagnetic sensor and an acceleration sensor, and can detect its own orientation in space based on the output values of both sensors. When measuring the distance between two points, as shown in Fig. 7, the orientation detection function is used to grasp the orientations of the two target points when measuring them, and the angle ψ between the two orientation directions is calculated to measure the distance D between the two points.
[0129] Therefore, in order to grasp one's own posture, an accurate output value of the geomagnetic sensor is required. However, as described above, due to magnetic noise caused by magnetic materials existing around the geomagnetic sensor, the strength and direction of the surrounding magnetic field cannot be accurately detected with the output value as it is. In this respect, the geomagnetic sensor calibration system 1 according to the present invention can be applied.
[0130] In order to grasp the attitude in space, two independent directions that serve as absolute references in space are necessary. The two independent directions are generally the direction of the surrounding magnetic field measured by a geomagnetic sensor and the direction of surrounding gravity measured by an acceleration sensor. Therefore, in a system that performs control based on attitude information, such as the distance measuring device 100, mounting a geomagnetic sensor and an acceleration sensor is compatible with the configuration of the geomagnetic sensor calibration system 1 according to the present invention.
[0131] When measuring distance, the user points the top surface of the distance measuring device 100 toward the object in order to irradiate the object with laser light. When checking the measurement results or changing various settings, the user points the front surface toward the user's face so that the display unit 103 is easily visible.
[0132] On the other hand, the data acquisition unit 21 of the geomagnetic sensor calibration system 1 always acquires output values from each sensor at regular time intervals. That is, while the user is operating the distance measuring device 100, the geomagnetic sensor correction data for all directions based on the surrounding environment is updated and accumulated from time to time without the user even realizing it. That is, the correction data can be collected without requiring the user to consciously point the product in all directions.
[0133] As can be seen from the above configuration, the distance measuring device 100 according to this embodiment is often used with the display unit 103 facing up. Therefore, the probability of obtaining correction data when the display unit 103 faces downward is low, and even if it is obtained, it is difficult to update it, which is likely to deteriorate the responsiveness of the correction value to changes in the surrounding environment.
[0134] Therefore, it is desirable that the area determination unit 23 is configured to hold data only for an area where the gravity vector frequently visits, that is, the vicinity of the area indicated by the gravity vector when the display unit 103 faces upward, as shown in Fig. 8. This can improve the ability of the correction value to follow changes in the surrounding environment. Fig. 8 illustrates a state in which only data included in a hemispherical area centered on the gravity vector when the normal line of the display unit 103 faces the vertical direction is held.
[0135] The measurement operation performed by the user when measuring the distance between two points may be made to correspond to the execution condition of the correction value estimation process. This eliminates the need for the user to be aware of the correction value estimation process of the geomagnetic sensor. In addition, while operating (using) the distance measuring device 100, the correction data continues to be unconsciously updated according to the surrounding environment, and the correction value is updated every time the distance between two points is measured, thereby improving the ability to follow environmental changes.
[0136] The above execution conditions are merely examples and are not limiting. For example, as described above, the correction value estimation process may be executed every time an output value is obtained from each sensor. However, since the estimation process in the correction estimation unit 25 involves a large amount of calculation as described above and monopolizes the control of the MPU for a certain period of time, care must be taken to ensure that other processes are not affected.
[0137] According to the embodiment described above, it is not necessary to reacquire independent correction data when estimating a correction value as in the past. That is, it is possible to acquire correction data corresponding to each area while using the distance measuring device 100, and it is not necessary to request the user to consciously turn the product in all directions, which reduces the burden on the user. In addition, it is not necessary to implement a notification means such as a screen on the product that urges the user to reacquire correction data, which simplifies the device configuration.
[0138] The present invention is not limited to the above-described embodiments, and various modifications are possible without departing from the technical scope of the present invention. [Explanation of symbols]
[0139] 1 Geomagnetic sensor calibration system 10 Sensor section 11 Geomagnetic Sensor 12 Acceleration Sensor 20 Control section 21 Data Acquisition Section 22 Filter processing section 23 Area determination section 24 Data input / output section 25 Correction Estimation Section 26 Data correction section 27 Accuracy Evaluation Department 30 Storage section 100 Distance measuring device 101 Measuring section 102 Operation section 103 Display section
Claims
1. A system for calibrating a device including a geomagnetic sensor and an acceleration sensor, comprising: a section determination unit that, when θφ of the spherical coordinate rθφ is divided into a plurality of sections, determines to which of the divided sections the gravity vector detected by the acceleration sensor belongs; a storage unit that stores, as measurement information, section information of the section to which the gravity vector belongs and an output value of the geomagnetic sensor corresponding to each section, in pairs; a correction estimation unit that estimates a correction value of the geomagnetic sensor based on the measurement information stored in the storage unit; a data correction unit that corrects an output value of the geomagnetic sensor based on the correction value estimated by the correction estimation unit; A geomagnetic sensor calibration system comprising:
2. 2. The geomagnetic sensor calibration system according to claim 1, further comprising an accuracy evaluation unit that evaluates the validity of the output value corrected by the data correction unit.
3. 3. The geomagnetic sensor calibration system according to claim 1, wherein the output values of the acceleration sensor and the geomagnetic sensor, which are stored as a pair as the measurement information, are acquired at the same timing.
4. 4. A geomagnetic sensor calibration system as claimed in claim 1, characterized in that the section determined by the section determination unit is narrower in the vicinity of the direction indicated by the gravity vector when the device is in use than in other sections.
5. 5. The geomagnetic sensor calibration system according to claim 1, wherein the correction estimation unit estimates the correction value by using the measurement information included in a portion of the section.
6. 6. The geomagnetic sensor calibration system according to claim 1, wherein the correction estimation unit estimates the correction value based on an operational input by a user to the device.
7. The geomagnetic sensor calibration system according to claim 2, characterized in that when the accuracy evaluation unit evaluates that the output value corrected by the data correction unit does not meet a predetermined accuracy, it requests the correction estimation unit to execute an estimation process of the correction value.
8. A system used for calibrating a device equipped with a geomagnetic sensor and an acceleration sensor, comprising: an area determination unit that determines to which area in space a gravity vector detected by the acceleration sensor belongs; a storage unit that stores, as measurement information, area information of the area to which the gravity vector belongs and an output value of the geomagnetic sensor corresponding to each area, in a pair; a correction estimation unit that estimates a correction value of the geomagnetic sensor based on the measurement information stored in the storage unit; a data correction unit that corrects an output value of the geomagnetic sensor based on the correction value estimated by the correction estimation unit; having A geomagnetic sensor calibration system, wherein the area determined by the area determination unit is an area obtained by dividing a curved surface described by a gravity vector detected by the acceleration sensor at a predetermined interval.
Citation Information
Patent Citations
Magnetism detection device
JP2011252808A
Portable apparatus
JP2012242267A
Geomagnetism measuring device, geomagnetism measuring method, and geomagnetism measuring program
JP2013057552A
Magnetic measurement data calibration device and azimuth angle measurement device
JP2013072643A
Magnetic data correction device and correction parameter creation device
JP2015169619A
