Offset calculation device, azimuth angle sensor, electronic equipment, and offset calculation method
Patent Information
- Application Number
- JP2024523340
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Filing Date
- 2024-09-02
- Publication Date
- 2025-02-04
AI Technical Summary
Existing offset calculation methods for azimuth sensors are inefficient due to long calibration times and high power consumption, requiring users to perform complex movements to detect maximum and minimum magnetic field values, which can lead to inaccurate results and user inconvenience.
The offset calculation device selects specific data points in a three-axis coordinate system, calculates virtual data points, and adjusts them to minimize distance from a virtual offset point, allowing for rapid and continuous offset cancellation without extensive user movement or long calibration times.
This method reduces calibration time, power consumption, and user effort while maintaining accuracy, enabling efficient and convenient offset correction for azimuth sensors.
Abstract
Description
Offset calculation device, azimuth angle sensor, electronic device, and offset calculation method
[0001] The present disclosure relates to an offset calculation device, an azimuth angle sensor, an electronic device, and an offset calculation method.
[0002] An azimuth sensor (geomagnetic sensor) measures the azimuth angle by detecting the direction of the geomagnetic field. However, the geomagnetic field to be measured is very weak. Therefore, in order to accurately detect the azimuth angle, it is necessary to detect the true geomagnetic field by canceling out offsets caused by magnetic fields present in the surrounding environment (such as magnetic fields generated inside a set equipped with the azimuth sensor or magnetic fields generated by powerful magnets placed around the azimuth sensor) or offsets caused by the performance of the azimuth sensor itself.
[0003] The offset of the azimuth angle sensor changes constantly both in time and space. Therefore, in order to detect the azimuth angle with high accuracy, it is necessary to continuously cancel the offset of the azimuth angle sensor at high speed.
[0004] There are two offset correction methods: a method in which the user intentionally performs manual correction, and a method in which the user automatically performs correction without the user's intention. Considering the improvement of user convenience and the improvement of the accuracy of the azimuth angle sensor, it is desirable to adopt the latter method.
[0005] An example of the related prior art is disclosed in Patent Document 1 by the applicant of the present application.
[0006] JP 2016-133343 A
[0007] The prior art of Patent Document 1 discloses a point collection method for drawing a magnetic sphere in addition to an offset correction calculation method, which is a core technology for magnetic calibration. This prior art has excellent calibration accuracy and is still used by many vendors.
[0008] However, in the above-mentioned conventional technology, magnetic calibration (offset calculation using a unique correction formula) is performed after extracting sensor data from six points evenly spread across a three-axis coordinate system (preferably the maximum and minimum values of each of the three axes plus one arbitrary point), which poses the problem of long calibration execution times and high power consumption.
[0009] Furthermore, to extract maximum and minimum values that are somewhat separated for each of the three axes, the user must move the azimuth sensor widely (for example, in a figure-eight motion). Recently, there are systems that perform magnetic calibration by extracting points obtained by a figure-eight motion from the user's daily movements. However, to obtain high-quality calibration results, a wide range of points obtained by a figure-eight motion is still required, and a magnetic calibration technology that uses simpler movements has been desired.
[0010] The offset calculation device disclosed in this specification selects, as a first data point, any one of a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system; selects, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selects, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; and calculates, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a plane defined by the first data point, the second data point, and the third data point. a point that is at least 100 mm away from the origin is selected as a fourth data point, and a first virtual data point, a second virtual data point, and a third virtual data point are derived by uniformly translating the first data point, the second data point, and the third data point so that the fourth data point coincides with the origin; a virtual offset point is derived that minimizes the sum of the distances between the first virtual data point, the second virtual data point, and the third virtual data point and a curved surface that passes through the origin; and an offset value of the magnetic detection data is derived by translating the virtual offset point so as to restore the translation amount.
[0011] The offset calculation device disclosed in this specification selects, as a first data point, any one of a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system; selects, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selects, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; selects, as a fourth data point, one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point; a point that is a fourth distance or more away from each of the third data point and the fourth data point is selected as a fifth data point; a first virtual data point, a second virtual data point, a third virtual data point, and a fourth virtual data point are derived by uniformly translating the first data point, the second data point, the third data point, and the fourth data point so as to align the fifth data point with the origin; a virtual offset point is derived that minimizes the sum of the distances between a curved surface that passes through the origin and each of the first virtual data point, the second virtual data point, the third virtual data point, and the fourth virtual data point; and an offset value of the magnetic detection data is derived by translating the virtual offset point so as to restore the amount of the translation.
[0012] Furthermore, for example, the offset calculation method disclosed in this specification includes the steps of selecting, as a first data point, any one of a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system, and selecting, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selecting, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; and selecting, as a third data point, one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point. The method includes the steps of: selecting a distant point as a fourth data point; deriving a first virtual data point, a second virtual data point, and a third virtual data point by uniformly translating the first data point, the second data point, and the third data point so as to align the fourth data point with the origin; deriving a virtual offset point that minimizes the sum of the distances between a curved surface passing through the origin and the first virtual data point, the second virtual data point, and the third virtual data point; and deriving an offset value of the magnetic detection data by translating the virtual offset point so as to restore the translation amount.
[0013] Still other features, elements, steps, advantages, and characteristics will become more apparent from the detailed description that follows and the accompanying drawings related thereto.
[0014] According to the present disclosure, magnetic calibration can be performed more easily.
[0015] FIG. 1 is a block diagram showing the overall configuration of an azimuth angle sensor 1. FIG. 2 is a flowchart showing a first embodiment of offset calculation processing. FIG. 3 is an XYZ coordinate space diagram showing the first embodiment of offset calculation processing. FIG. 4 is a flowchart showing a first example of data search processing. FIG. 5 is a diagram showing an example of selection of a third data point. FIG. 6 is a diagram showing an example of selection of a fourth data point. FIG. 7 is a flowchart showing a second example of data search processing. FIG. 8 is a flowchart showing a second embodiment of offset calculation processing. FIG. 9 is an XYZ coordinate space diagram showing maximum and minimum values of three axes. FIG. 10 is an external view of a smartphone. FIG. 11 is an external view of a tablet terminal. FIG. 12 is an external view of a smartwatch.
[0016] 1 is a block diagram showing the overall configuration of an azimuth angle sensor 1. The azimuth angle sensor 1 of this example configuration has a magnetic detection unit 10, an offset correction unit 20, an offset calculation unit 30, and an azimuth angle calculation unit 40.
[0017] The magnetic detection unit 10 (corresponding to a magnetic detection device) includes a magnetic sensor 10X that detects magnetism in the X-axis direction, a magnetic sensor 10Y that detects magnetism in the Y-axis direction, and a magnetic sensor 10Z that detects magnetism in the Z-axis direction, and generates three-axis magnetic detection data (Hx, Hy, Hz). Note that the magnetic detection elements of the magnetic sensors 10X, 10Y, and 10Z may be, for example, Hall elements or MR (magnetoresistance) elements. The X-axis, Y-axis, and Z-axis may be designed to be perpendicular to one another.
[0018] The offset correction unit 20 (corresponding to an offset correction device) corrects the magnetic detection data (Hx, Hy, Hz) using the offset values (=offset components (Hx0, Hy0, Hz0) included in the three-axis magnetic detection data (Hx, Hy, Hz)) calculated by the offset calculation unit 30. Through the offset correction process, Hx←Hx-Hx0, Hy←Hy-Hy0, and Hz←Hz-Hz0 are obtained.
[0019] The offset calculation unit 30 (corresponding to an offset calculation device) constantly monitors the offset-corrected magnetic detection data (Hx, Hy, Hz) and successively updates the offset values (Hx0, Hy0, Hz0) of the magnetic detection unit 10. The offset calculation process (offset update process) will be described in detail later.
[0020] The azimuth angle calculation unit 40 (corresponding to an azimuth angle calculation device) generates azimuth angle data So from the offset-corrected magnetic detection data (Hx, Hy, Hz).
[0021] In this figure, the offset correction unit 20, the offset calculation unit 30, and the azimuth angle calculation unit 40 are depicted as independent processing blocks, but these processing blocks can be implemented in a unified manner using a CPU (central processing unit) or a DSP (digital signal processor), etc.
[0022] 2 and 3 are a flowchart and an XYZ coordinate space diagram, respectively, showing a first embodiment of the offset calculation process in the offset calculation unit 30. Unless otherwise specified, each step in FIG. 2 is executed by the offset calculation unit 30. Below, the process will be described in detail step by step, mainly with reference to FIG. 2 and also with reference to FIG. 3 as needed.
[0023] First, in step S1, the offset values (Hx0, Hy0, Hz0) are set or updated. The initial values are (0, 0, 0).
[0024] Next, in step S2, the three-axis magnetic detection data (Hx, Hy, Hz) is constantly acquired and its offset is corrected (Hx←Hx-Hx0, Hy←Hy-Hy0, Hz←Hz-Hz0). Note that step S2 is mainly executed by the offset correction unit 20.
[0025] Next, in step S3, the offset-corrected magnetic detection data (Hx, Hy, Hz) is referenced and the first to fourth data points P1 to P4 (or the first to fifth data points P1 to P5) are constantly searched for using a predetermined algorithm. The data search process in step S3 will be described in detail later.
[0026] In step S4, it is determined whether the data search process in step S3 is complete. If the determination is YES, the flow proceeds to step S5, and if the determination is NO, the flow returns to step S3.
[0027] If a negative determination is made in step S4, the flow loops between steps S3 and S4. That is, prior to executing the offset calculation processes in steps S5 to S7, the data search process in step S3 continues until a group of data points that are appropriate as reference targets (=a group of data points that are considered to be relatively evenly distributed in the XYZ coordinate space centered on offset point C, which will be described later) is gathered.
[0028] On the other hand, if the answer is yes in step S4, in step S5, as the first step of the offset calculation process, the fourth data point P4 (or the fifth data point P5) obtained in the data search process in step S3 is translated to the origin O (0,0,0), and the other three points (or four points) are also translated in the same way.
[0029] When the fourth data point P4 is translated to the origin O, three virtual data points are derived: a first virtual data point P1′, a second virtual data point P2′, and a third virtual data point P3′. When the fifth data point P5 is translated to the origin O, four virtual data points are derived: a first virtual data point P1′, a second virtual data point P2′, a third virtual data point P3′, and a fourth virtual data point P4′.
[0030] In the offset calculation process of this embodiment (hereinafter, for convenience, this may be referred to as "four-point correction"), only four (or five) data points are actually used for calculation. Therefore, it is sufficient for the offset calculation unit 30 to have registers for a total of four (or five) points, which makes it possible to significantly reduce the circuit scale or software code size compared to a conventional configuration (hereinafter, for convenience, this may be referred to as "seven-point correction") that requires six (or seven) or more data points.
[0031] In step S6, a virtual offset point C' is calculated that minimizes the sum of the distances between the surface H passing through the origin O and each of the virtual data points P1' to P3' (or virtual data points P1' to P4'). Specifically, when the virtual data point Pi' is (Hxi', Hyi', Hzi') (i = 1 to 3 in the example shown in the figure) and the virtual offset point C' is (Hx0', Hy0', Hz0'), a virtual offset point C' is derived that minimizes the value of the function FH of the surface H expressed by the following equation (1).
[0032]
[0033] The function FH of the curved surface H expressed by the above equation (1) is derived on the assumption that a spherical surface of radius r centered at the virtual offset point C' passes through the origin O (r = |OC'|).
[0034] Finally, in step S7, the first data point P1 to the fourth data point P4 (or the first data point P1 to the fifth data point P5) are cleared, and the virtual offset point C' is translated to return the previous translation to its original position, thereby deriving the original offset point C (Hx0, Hy0, Hz0) (corresponding to the offset value of the magnetic detection unit 10).
[0035] Thereafter, the flow returns to step S1, and the above series of processes are repeated. As a result, the offset of the azimuth angle sensor 1, which constantly changes in time and space, is quickly and continuously canceled, making it possible to detect the azimuth angle with high accuracy.
[0036] <Data Search Process (First Example)> Fig. 4 is a flowchart showing a first example of the data search process in step S3 (see Fig. 2 above). Unless otherwise specified, it is assumed that the execution subject of each step in Fig. 4 is the offset calculation unit 30.
[0037] When this flow starts, in step S11, any one point of the multiple pieces of magnetic detection data sequentially acquired as data points in a three-axis coordinate system is selected as a first data point P1 (Hx1, Hy1, Hz1). For example, in step S11, magnetic detection data obtained immediately after starting up the azimuth sensor 1 or immediately after pressing the magnetic calibration start button may be immediately selected as the first data point P1 (Hx1, Hy1, Hz1).
[0038] Next, in step S12, one point from the plurality of magnetic detection data that is at least the first distance d1 away from the first data point P1 is selected as the second data point P2 (Hx2, Hy2, Hz2). That is, the second data point P2 is selected so that the following equation (2) is satisfied:
[0039]
[0040] Next, in step S13, from among the multiple magnetic detection data, one point that is at least a second distance d2 away from the straight line L defined by the first data point P1 and the second data point P2 is selected as the third data point P3 (Hx3, Hy3, Hz3).
[0041] FIG. 5 is a diagram showing an example of selection of the third data point P3.
[0042] As shown in this figure, in step S13, for example, a vector P1P2 connecting the first data point P1 and the second data point P2, and a vector P1P3 connecting the first data point P1 and one point of the multiple magnetic detection data (= candidate point for the third data point P3) are derived, and the third data point P3 is selected so that the following equation (3) holds.
[0043]
[0044] Note that the symbol "x" in the above equation is the symbol for cross product operation, and the left side of the above equation corresponds to the length of the perpendicular line dropped from the third data point P3 to the straight line L (i.e., the distance between the straight line L and the third data point P3).
[0045] Also, for example, in step S13, a point that is at least the second distance d2 away from each of the first data point P1 and the second data point P2 may be selected as the third data point P3. That is, the third data point P3 may be selected so that the following equations (4a) and (4b) hold.
[0046]
[0047] In the above formulas (4a) and (4b), the second distance d2 may be d2=d1, but strictly speaking, it is desirable to set it to d2=√5×d1 / 2 or more.
[0048] Furthermore, to prevent the third data point P3 from being selected on the straight line L defined by the first data point P1 and the second data point P2, an additional condition may be imposed that when the angle formed by the vectors P1P2 and P1P3 is θ1 and the angle formed by the vectors P2P1 and P2P3 is θ2, both θ1 and θ2 are acute angles (0°<θ1<90° and 0°<θ2<90°).
[0049] θ1 and θ2 are expressed by the following equations (5a) and (5b), respectively.
[0050]
[0051] Returning to FIG. 4, the description of the flowchart continues.
[0052] In step S14, from among the multiple magnetic detection data, one point that is at least a third distance d3 away from the plane S defined by the first data point P1, the second data point P2, and the third data point P3 is selected as the fourth data point P4 (Hx4, Hy4, Hz4).
[0053] FIG. 6 is a diagram showing an example of selection of the fourth data point P4.
[0054] As shown in the figure, in step S14, for example, a vector MP4 is derived that connects the center of gravity M ((Hx1+Hx2+Hx3) / 3, (Hy1+Hy2+Hy3) / 3, (Hz1+Hz2+Hz3) / 3) of the triangle defined by the first data point P1, the second data point P2, and the third data point P3, and one point of the multiple magnetic detection data (= a candidate point for the fourth data point P4). Then, if the dot product of vector MP4 and the normal unit vector n0 of plane S is equal to or greater than the third distance d3, that point is selected as the fourth data point P4. That is, the fourth data point P4 is selected so that the following equation (6) is established:
[0055]
[0056] Note that the symbol "." in the above equation is the dot product operation symbol, and the left side of the above equation corresponds to the length of the perpendicular line dropped from the fourth data point P4 to the plane S (i.e., the distance between the plane S and the fourth data point P4).
[0057] Furthermore, the normal unit vector n0 can be derived by the following equation (7).
[0058]
[0059] Also, for example, in step S14, without deriving the center of gravity M mentioned above, at least one vector PiP4 (where i = 1 to 3) may be derived that connects at least one of the first data point P1, the second data point P2, and the third data point P3 with one point of the multiple magnetic detection data (= candidate point for the fourth data point P4), and if the dot product of at least one vector PiP4 and the normal unit vector n0 of the plane S is equal to or greater than the third distance d3, that point may be selected as the fourth data point P4.
[0060] In this way, in the above series of data search processes, rather than deriving the maximum and minimum values (six points in total) for each of the three axes, a method is adopted in which a first data point P1 and a second data point P2 that are a certain distance apart from each other are selected from multiple magnetic detection data to derive a straight line L, a third data point P3 that is a certain distance apart from the straight line L to derive a plane S, and a fourth data point P4 that is a certain distance apart from the plane S in the vertical direction to derive a three-dimensional surface (sphere).
[0061] This method reduces the amount of work required to search for data points for magnetic calibration, which in turn reduces the software's weight, allowing it to run on microcomputers with lower power consumption.
[0062] Furthermore, by adopting this method, there is almost no need for the user to move the azimuth angle sensor 1 in a large motion (for example, in a figure-eight motion), which improves user convenience.
[0063] Furthermore, the above-described series of data search processes can reduce the risk of obtaining inappropriate offset calculation results from a group of data points that are unevenly distributed locally, making it possible to reduce the number of data points without impairing the accuracy of the azimuth angle sensor 1.
[0064] At least one of the first distance d1, second distance d2, and third distance d3 described above may be selectable depending on the strength of the geomagnetic field at the current location (generally 20 to 80 μT, 40 to 50 μT in Japan).
[0065] <Data Search Process (Second Example)> Figure 7 is a flowchart showing a second example of the data search process in step S3 (see Figure 2 above). The second example in this figure is based on the first example (Figure 4 above), but adds step S15 for selecting a fifth data point P5. Therefore, redundant explanations of steps S11 to S14 will be omitted, and the explanation will focus on step S15.
[0066] After the fourth data point P4 is selected in step S14, in step S15, one point from the plurality of magnetic detection data that is at least a fourth distance d4 away from each of the first data point P1, the second data point P2, the third data point P3, and the fourth data point P4 is selected as a fifth data point P5 (Hx5, Hy5, Hz5). That is, the fifth data point P5 may be selected so that the following equations (8a), (8b), (8c), and (8d) hold true.
[0067]
[0068] The fifth data point P5 is treated as a reference data point that is translated to the origin O (0,0,0) in the offset calculation process described above (especially step S5 in FIG. 2). In this way, any point that is not one of the first data point P1, the second data point P2, the third data point P3, and the fourth data point P4 may be selected as the reference data point.
[0069] Furthermore, the fourth distance d4 may be selected according to the magnitude of the geomagnetism at the current location, similar to the first distance d1, the second distance d2, and the third distance d3.
[0070] <Considerations on achieving both high speed and high accuracy> Incidentally, the seven-point correction and four-point correction explained so far each have advantages and disadvantages in use.
[0071] For example, seven-point correction has the advantage of high offset calculation accuracy, but it also has disadvantages such as requiring the user to make unnatural movements (e.g., figure-eight movements), making it difficult to collect Z-axis data points in a three-axis coordinate system, and taking a relatively long time to determine the data points.
[0072] On the other hand, four-point correction has the advantages that offset calculation is possible from the user's daily actions (for example, checking a watch), data points are easily collected, and the time required to determine a data point is relatively short. However, with four-point correction, the offset calculation accuracy may be lower than with seven-point correction.
[0073] Therefore, in products and applications that selectively adopt either seven-point correction or four-point correction, it is difficult to achieve both high speed and high accuracy in the offset calculation process. For example, in a product that requires rapid offset correction of the azimuth angle sensor, if seven-point correction is adopted, the offset calculation process may not be completed in time. In contrast, if four-point correction is adopted, the offset calculation time is significantly reduced, but problems may arise in the offset calculation accuracy.
[0074] In view of the above considerations, a second embodiment of the offset calculation process that can achieve both high speed and high accuracy will be proposed below.
[0075] <Offset Calculation Process (Second Embodiment)> Fig. 8 is a flowchart showing a second embodiment of the offset calculation process. Note that unless otherwise specified, it is assumed that the execution subject of each step in Fig. 8 is the offset calculation unit 30.
[0076] When this flow starts, in step S21, it is determined whether a certain time has elapsed since the start of this flow. If the determination here is NO, the flow proceeds to step S22. On the other hand, if the determination is YES, this flow is terminated for the purpose of reducing power consumption.
[0077] If the determination in step S21 is NO, the process proceeds to step S22, where data points necessary for the offset calculation process are acquired. In particular, from the start of this flow until the four-point correction is completed, the process proceeds to step S21, where data points necessary for the four-point correction are acquired (see FIGS. 4 to 7).
[0078] After the data points are acquired in step S22, it is determined in step S23 whether the four-point correction is complete. If the determination is NO, the flow proceeds to step S24. On the other hand, if the determination is YES, the flow proceeds to step S30.
[0079] If the determination in step S23 is NO, then in step S24 it is determined whether four data points have been collected. If the determination here is YES, the flow proceeds to step S25. On the other hand, if the determination is NO, the flow returns to step S21. In other words, steps S21 to S24 are repeatedly looped until the data points required for four-point correction are collected.
[0080] If the determination in step S24 is YES, the calculation process for four-point correction is performed in step S25. The calculation process in step S24 is the same as that in the first embodiment (steps S5 to S7 in FIG. 2 and FIG. 3). Therefore, a duplicated description will be omitted.
[0081] After the four-point correction calculation process is performed in step S25, a determination is made in step S26 as to whether the offset value calculated in the previous calculation process satisfies a predetermined first application determination condition (described in detail below). That is, in step S26, a determination is made as to whether the derivation of the offset value by the four-point correction was successful. If the determination here is YES, the flow proceeds to step S27. On the other hand, if the determination is NO, the flow proceeds to step S29. As a result, the collected data points are cleared (discarded) as being unsatisfactory, and the flow returns to step S21.
[0082] If the answer is YES in step S26, the offset value calculated by the four-point correction is set in step S27.
[0083] Thereafter, in step S28, a flag is set to indicate that the four-point correction has been completed. With this flag set, a YES determination is made in step S23.
[0084] In step S29, the data points collected for the four-point correction are cleared (discarded), and the flow returns to step S21. However, the data points collected for the four-point correction may also be used for the seven-point correction. In this case, step S29 may be skipped.
[0085] After the four-point correction is completed and the flow returns to step S21, a process of acquiring data points necessary for seven-point correction is performed in step S22. More specifically, in step S22, a data point search process is performed with reference to the offset-corrected magnetic detection data (Hx, Hy, Hz) to acquire six maximum and minimum values for each of the three axes and one arbitrary point other than these.
[0086] 9 is an XYZ coordinate space diagram showing the maximum and minimum values of the three axes. In the example shown in this figure, the maximum value of the X-axis component is Hx(max), and the corresponding maximum X-axis data point is Pa(Hx(max), *, *). On the other hand, the minimum X-axis component is Hx(min), and the corresponding minimum X-axis data point is Pb(Hx(min), *, *).
[0087] Although not explicitly shown in this figure, maximum and minimum data points exist for the maximum value Hy(max) and minimum value Hy(min) of the Y-axis component, as well as the maximum value Hz(max) and minimum value Hz(min) of the Z-axis component, for each axis, as described above.
[0088] Returning to Figure 8, the description of this flow will continue. After the data point acquisition process is performed in step S22, it is determined in step S23 whether or not the four-point correction has been completed. If the four-point correction has been completed, a YES determination is made in this step. Therefore, the flow proceeds to step S30.
[0089] If the determination in step S23 is YES, then in step S30 it is determined whether seven data points have been collected. If the determination is YES, the flow proceeds to step S31. On the other hand, if the determination is NO, the flow returns to step S21. In other words, steps S21 to S23 and S30 are repeatedly looped until the data points required for the seven-point correction are collected.
[0090] If the answer is YES in step S30, a seven-point correction calculation process is performed in step S31. The calculation process in step S31 is basically the same as that in the first embodiment (steps S5 to S7 in FIG. 2 and FIG. 3), except that the number of data points is increased from four to seven.
[0091] Briefly, in step S31, after deriving the offset value by four-point correction, virtual data points P1' to P6' are derived by uniformly translating each of the data points P1 to P7 so that a reference data point P7, which is arbitrarily selected from the data points P1 to P7 including the maximum and minimum values of each axis of the three-axis coordinate system, coincides with the origin O. Next, a virtual offset point C' is calculated that minimizes the sum of the distances between the curved surface H1 that passes through the origin O and the virtual data points P1' to P6' (see equation (1) above). Then, the virtual offset point C' is translated to restore the amount of the translation, thereby deriving the offset value C of the magnetic detection data.
[0092] In order to clearly distinguish between the offset value derived by four-point correction and the offset value derived by seven-point correction, the former may be referred to simply as the "offset value" and the latter as the "second offset value" below.
[0093] After the seven-point correction calculation process is performed in step S31, a determination is made in step S32 as to whether the second offset value calculated in the previous calculation process satisfies a predetermined second application determination condition (described in detail below). That is, in step S32, a determination is made as to whether the derivation of the second offset value by the seven-point correction was successful. If the determination is YES, the flow proceeds to step S33. On the other hand, if the determination is NO, the flow proceeds to step S29. As a result, the collected data points are cleared (discarded) as being unsatisfactory, and the flow returns to step S21.
[0094] If the determination in step S32 is YES, the second offset value calculated by the seven-point correction is set in step S33, and then the series of steps is terminated.
[0095] According to the above flow, four-point correction, which takes a short time to execute, is performed first. After the offset value is successfully derived by the four-point correction, seven-point correction is subsequently attempted to further improve the accuracy of the azimuth angle sensor 1. If the second offset value is successfully derived by the seven-point correction, the offset value derived by the four-point correction is discarded, and the second offset value newly derived by the seven-point correction is updated (overwritten) as the true offset value.
[0096] On the other hand, if the derivation of the second offset value using seven-point correction is not successful within a certain period of time after the derivation of the offset value using four-point correction, the set offset value derived using four-point correction is not discarded but is maintained as is.
[0097] In this way, by utilizing both of the two algorithms, the advantages of both the four-point correction and the seven-point correction can be enjoyed, thereby enabling offset calculation processing that can achieve both high speed and high accuracy.
[0098] This flow can be started not only when the azimuth angle sensor 1 is started, but also when a change occurs in the environmental magnetic field, etc. For example, when a deterioration in azimuth accuracy is detected, the offset value based on the four-point correction and the second offset value based on the seven-point correction may be re-derived.
[0099] <Offset Value Application Determination Conditions> In the offset calculation process ( FIG. 8 ) of the second embodiment, it is desirable to determine in step S26 that the derivation of the offset value using four-point correction has been successful as quickly as possible. Therefore, the first application determination condition in step S26 should be set relatively lenient. On the other hand, in step S32, it is desirable to increase the accuracy of the second offset value using seven-point correction as much as possible. Therefore, the second application determination condition in step S32 should be set stricter than the first application determination condition in step S26. Of course, the above-mentioned first and second application determination conditions can be set arbitrarily depending on the surrounding environment and product form.
[0100] For example, if the sensor output value is X = (x, y, z) and the offset value obtained by the correction calculation is X = (x, y, z), the magnitude of magnetism M calculated from the sensor output value X is expressed by the following equation (9).
[0101]
[0102] In the process of determining whether the offset value X0 is applicable, it may be determined whether the difference (M-M0) between the magnitude of the magnetic field M and the magnitude of the geomagnetic field M0 (where M0>0) around the sensor is within a predetermined tolerance range. Note that the magnitude of the geomagnetic field M0 may be set to a known value in advance, or may be set to an average value calculated from past sensor output values.
[0103] For example, the first application determination condition in step S26 may be set as M0-α<M<M0+α (where α>0), while the second application determination condition in step S32 may be set as M0-α+β<M<M0+α-β (where α>β>0).
[0104] 10 to 12 are external views showing examples of electronic devices (a smartphone 100, a tablet terminal 200, and a smartwatch 300) equipped with the azimuth angle sensor 1. By incorporating the azimuth angle sensor 1 described above as an electronic compass in each device, the direction in which the user is facing can be accurately detected. In particular, by using a GPS (global positioning system) in conjunction with an electronic compass, it is possible to improve the positioning accuracy of a map application or a navigation application.
[0105] The azimuth angle sensor 1 described above can also be mounted on a watch or other wearable device.
[0106] <Summary> The various embodiments described above will be summarized below.
[0107] The offset calculation device disclosed in this specification selects, as a first data point, any one of a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system; selects, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selects, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; and selects, as a third data point, one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point. a point is selected as a fourth data point, and the first, second, and third data points are uniformly translated so as to align the fourth data point with the origin, thereby deriving a first virtual data point, a second virtual data point, and a third virtual data point; a virtual offset point is derived at which the sum of the distances between a surface passing through the origin and each of the first, second, and third virtual data points is minimized; and the virtual offset point is translated so as to restore the amount of the translation, thereby deriving an offset value of the magnetic detection data (first configuration).
[0108] The offset calculation device disclosed in this specification selects, as a first data point, any one of a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system; selects, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selects, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; selects, as a fourth data point, one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point; a first virtual data point, a second virtual data point, a third virtual data point, and a fourth virtual data point are derived by uniformly translating the first data point, the second data point, the third data point, and the fourth data point so as to align the fifth data point with the origin; a virtual offset point is derived at which the sum of the distances between a surface passing through the origin and each of the first virtual data point, the second virtual data point, the third virtual data point, and the fourth virtual data point is minimized; and the virtual offset point is translated so as to restore the amount of translation to derive an offset value of the magnetic detection data (second configuration).
[0109] Furthermore, the offset calculation device according to the first or second configuration may be configured (third configuration) to derive a vector connecting the center of gravity of a triangle defined by the first data point, the second data point, and the third data point with one point of the plurality of magnetic detection data, and select that point as the fourth data point if the dot product of the vector and the normal unit vector of the plane is equal to or greater than the third distance.
[0110] Furthermore, the offset calculation device according to the first or second configuration may be configured (fourth configuration) to derive at least one vector connecting at least one of the first data point, the second data point, and the third data point with one point of the plurality of magnetic detection data, and if the dot product of the at least one vector and the normal unit vector of the plane is equal to or greater than the third distance, select that point as the fourth data point.
[0111] Furthermore, in an offset calculation device having any of the first to fourth configurations, at least one of the first distance, the second distance, and the third distance may be configured to be selected according to the strength of the geomagnetic field at the current location (fifth configuration).
[0112] Furthermore, the offset calculation device according to any one of the first to fifth configurations may be configured (sixth configuration) to derive the offset value, and then, for the magnetic detection data, uniformly translate each of N (where N≧7) data points including the maximum and minimum values of each axis of the three-axis coordinate system so that a reference data point arbitrarily selected from the data points is aligned with the origin, thereby deriving (N−1) virtual data points excluding the reference data point, and then calculate a virtual offset point at which the sum of the distances between each virtual data point and a curved surface passing through the origin is minimum, and translate the virtual offset point so as to restore the translation amount, thereby deriving a second offset value for the magnetic detection data.
[0113] The offset calculation device according to the sixth configuration may be configured (seventh configuration) such that, if the derivation of the second offset value is successful within a predetermined time after the derivation of the offset value, the second offset value is overwritten as the offset value, and if the derivation of the second offset value is not successful within the predetermined time, the offset value is maintained.
[0114] In the offset calculation device according to the seventh configuration, the conditions for determining whether the derivation of the second offset value has been successful may be stricter than the conditions for determining whether the derivation of the offset value has been successful (eighth configuration).
[0115] The offset calculation device according to any one of the sixth to eighth configurations may be configured (ninth configuration) to re-derive the offset value and the second offset value when deterioration of azimuth accuracy is detected.
[0116] Furthermore, for example, the azimuth angle sensor disclosed in this specification is configured (tenth configuration) to include a magnetic detection device configured to generate the magnetic detection data of three axes, an offset calculation device having any of the first to ninth configurations configured to derive the offset value of the magnetic detection data, an offset correction device configured to correct the offset value of the magnetic detection data, and an azimuth angle calculation device configured to generate azimuth angle data from the corrected magnetic detection data.
[0117] Furthermore, for example, the electronic device disclosed in this specification has a configuration (eleventh configuration) that includes an azimuth angle sensor according to the tenth configuration.
[0118] Furthermore, for example, the offset calculation method disclosed in this specification includes the steps of selecting any one point from a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system as a first data point, selecting one point from the plurality of magnetic detection data that is a first distance or more away from the first data point as a second data point, selecting one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point as a third data point, and selecting one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point as a fourth data point. a step of selecting the fourth data point as a data point; a step of deriving a first virtual data point, a second virtual data point, and a third virtual data point by uniformly translating the first data point, the second data point, and the third data point so as to align the fourth data point with the origin; a step of deriving a virtual offset point at which the sum of the distances between a surface passing through the origin and the first virtual data point, the second virtual data point, and the third virtual data point is minimum; and a step of translating the virtual offset point so as to restore the translation amount, thereby deriving an offset value of the magnetic detection data (twelfth configuration).
[0119] <Other Modifications> In addition to the above-described embodiments, the various technical features disclosed in this specification can be modified in various ways without departing from the spirit of the technical creation. In other words, the above-described embodiments should be considered to be illustrative and not restrictive in all respects, and the technical scope of the present disclosure is defined by the claims, and should be understood to include all modifications that fall within the meaning and scope equivalent to the claims.
[0120] 1 Azimuth angle sensor 10 Magnetic detection unit 10X, 10Y, 10Z Magnetic sensor (X axis, Y axis, Z axis) 20 Offset correction unit 30 Offset calculation unit 40 Azimuth angle calculation unit 100 Smartphone 200 Tablet terminal 300 Smartwatch C Offset point C' Virtual offset point d1 to d4 First distance to fourth distance H Curved surface L Straight line M Center of gravity O Origin P1 to P5 First data point to fifth data point P1' to P4' First virtual data point to fourth virtual data point S Plane
Claims
1. selecting an arbitrary one of the plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system as a first data point; selecting, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selecting, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; selecting, as a fourth data point, one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point; deriving a first virtual data point, a second virtual data point, and a third virtual data point by uniformly translating the first data point, the second data point, and the third data point so as to align the fourth data point with an origin; deriving a virtual offset point that minimizes a sum of distances between the surface passing through the origin and the first virtual data point, the second virtual data point, and the third virtual data point; an offset calculation device that translates the virtual offset point so as to return the translational movement to its original value, thereby deriving an offset value of the magnetic detection data.
2. selecting an arbitrary one of the plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system as a first data point; selecting, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selecting, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; selecting, as a fourth data point, one point from the plurality of magnetic detection data that is a third distance or more away from a plane defined by the first data point, the second data point, and the third data point; selecting, as a fifth data point, one point that is a fourth distance or more away from each of the first data point, the second data point, the third data point, and the fourth data point among the plurality of magnetic detection data; deriving a first virtual data point, a second virtual data point, a third virtual data point, and a fourth virtual data point by uniformly translating the first data point, the second data point, the third data point, and the fourth data point so as to align the fifth data point with an origin; deriving a virtual offset point that minimizes a sum of distances between a surface passing through the origin and the first virtual data point, the second virtual data point, the third virtual data point, and the fourth virtual data point; an offset calculation device that translates the virtual offset point so as to return the translational movement to its original position, thereby deriving an offset value of the magnetic detection data;
3. 3. The offset calculation device according to claim 1, further comprising: a vector that connects a center of gravity of a triangle defined by the first data point, the second data point, and the third data point with one of the plurality of magnetic detection data points; and if an inner product of the vector and a normal unit vector of the plane is equal to or greater than the third distance, the one point is selected as the fourth data point.
4. 3. The offset calculation device according to claim 1, further comprising: a step of deriving at least one vector connecting at least one of the first data point, the second data point, and the third data point with one of the plurality of magnetic detection data points; and selecting the one point as the fourth data point if an inner product of the at least one vector and a normal unit vector of the plane is equal to or greater than the third distance.
5. 3. The offset calculation device according to claim 1, wherein at least one of the first distance, the second distance, and the third distance is selected depending on the magnitude of geomagnetic field at the current location.
6. 3. The offset calculation device according to claim 1 or 2, wherein after deriving the offset value, a reference data point is arbitrarily selected from N (where N≧7) data points including the maximum and minimum values of each axis of the three-axis coordinate system, and each data point is uniformly translated to align the reference data point with an origin, thereby deriving (N-1) virtual data points excluding the reference data point, and a virtual offset point is calculated such that a sum of distances between a curved surface passing through the origin and each virtual data point is minimized, and a second offset value of the magnetic detection data is derived by translating the virtual offset point so as to return the translation amount to its original value.
7. 7. The offset calculation device according to claim 6, wherein, when derivation of the second offset value is successful within a predetermined time after derivation of the offset value, the second offset value is overwritten as the offset value, and when derivation of the second offset value is not successful within the predetermined time, the offset value is maintained.
8. The offset calculation device according to claim 7 , wherein a condition for determining whether the derivation of the second offset value has been successful is stricter than a condition for determining whether the derivation of the offset value has been successful.
9. The offset calculation device according to claim 6 , further comprising: a re-deriving unit that re-derives the offset value and the second offset value when deterioration of azimuth accuracy is detected.
10. a magnetic detection device configured to generate the magnetic detection data; 3. The offset calculation device according to claim 1, configured to derive the offset value of the magnetic detection data; an offset correction device configured to correct the offset value of the magnetic detection data; an azimuth angle calculation device configured to generate azimuth angle data from the corrected magnetic detection data; An azimuth angle sensor comprising:
11. An electronic device comprising the azimuth angle sensor according to claim 10.
12. selecting an arbitrary one of a plurality of magnetic detection data sequentially acquired as data points in a three-axis coordinate system as a first data point; selecting, as a second data point, one point from the plurality of magnetic detection data that is a first distance or more away from the first data point; selecting, as a third data point, one point from the plurality of magnetic detection data that is a second distance or more away from a straight line defined by the first data point and the second data point; selecting, as a fourth data point, one point from the plurality of magnetic detection data, the point being a third distance or more away from a plane defined by the first data point, the second data point, and the third data point; deriving a first virtual data point, a second virtual data point, and a third virtual data point by uniformly translating the first data point, the second data point, and the third data point so as to make the fourth data point coincident with an origin; deriving a virtual offset point that minimizes a sum of distances between a surface passing through the origin and the first virtual data point, the second virtual data point, and the third virtual data point; deriving an offset value of the magnetic detection data by translating the virtual offset point so as to return the translation amount to an original value; The offset calculation method comprises: