Positioning method and device, electronic equipment and storage medium

By combining multiple magnetic field data into magnetic field vectors and determining the target reference vector based on similarity matching, the nonlinear response and signal susceptibility to interference in the application of Hall sensor linear encoder is solved, and a high-precision and robust positioning effect is achieved.

CN120212836APending Publication Date: 2025-06-27BEIJING XIAOMI ROBOT TECH CO LTD

Patent Information

Application Number
CN202510379369.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

There are problems of nonlinear response and signal susceptibility to interference in Hall sensor linear encoder applications, and the lack of effective solutions leads to insufficient measurement accuracy.

Method used

By obtaining multiple magnetic field data, combining them into magnetic field vectors, and determining the target reference vector based on the similarity between the magnetic field vector and each reference vector in the mapping relationship, thereby determining the current position of the magnet. This method uses the data collected by multiple magnetic field sensors to integrate it into multi-dimensional magnetic field vectors to match overall similarity, and improve positioning accuracy and robustness.

Benefits of technology

It effectively improves the accuracy and robustness of the positioning method, and can maintain high-precision positioning in noisy environments, solving the problems of nonlinear response and signal susceptibility to interference in the application of Hall sensor linear encoder.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120212836A_ABST
    Figure CN120212836A_ABST
Patent Text Reader

Abstract

The invention provides a positioning method and device, electronic equipment and a storage medium. According to the embodiment of the invention, a plurality of magnetic field data collected by a plurality of magnetic field sensors are firstly acquired, and then the plurality of magnetic field data are combined into a magnetic field vector; and then, according to the similarity between the magnetic field vector and each reference vector in the mapping relation, determining a target reference vector corresponding to the magnetic field vector in the mapping relation, thereby determining the current position of the magnet on the preset track according to reference positions which are pre-calibrated in the mapping relation and are in one-to-one correspondence with the reference vectors. On the basis, the magnetic field data collected by different sensors can be directly and fully utilized in the same calculation process, and the positioning accuracy of the method and the robustness in the noise environment are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of positioning, and in particular, to a positioning method, apparatus, electronic device, and storage medium. Background Art

[0002] As an important device for measuring linear displacement, linear encoders are widely used in fields such as industrial automation and robotics. Although traditional optical encoders have high precision, they have high costs and strict requirements for the working environment. In contrast, linear encoders based on Hall sensors have become a potential alternative due to their simple structure, low cost, and strong anti-interference ability.

[0003] In recent years, in view of problems such as the non-linear response of Hall sensors and the susceptibility of signals to interference, there is still a lack of effective solutions in related technologies. Summary of the Invention

[0004] To overcome the problems existing in related technologies, the present disclosure provides a positioning method, apparatus, electronic device, and storage medium.

[0005] In a first aspect of the present disclosure, a positioning method is provided, and the method includes:

[0006] Obtain a plurality of magnetic field data, and combine the plurality of magnetic field data into a magnetic field vector, where the plurality of magnetic field data are respectively collected by a plurality of magnetic field sensors at known positions in space, and a movable magnet is also deployed in the space;

[0007] Determine a target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, where the mapping relationship represents the mapping relationship between the reference vector and the reference position;

[0008] Determine the reference position corresponding to the target reference vector in the mapping relationship as the current position of the magnet in the space.

[0009] Optionally, the determining a target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship includes:

[0010] Determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the cosine similarity between the magnetic field vector and each reference vector in the mapping relationship.

[0011] Optionally, the method further includes:

[0012] Determine a plurality of preset positions within the space, and determine the original vector corresponding to each preset position, where the original vector includes the magnetic field vector composed of the magnetic field data collected by the plurality of magnetic field sensors when the magnet is at the preset position;

[0013] For each preset position, perform normalization processing on the original vector corresponding to the preset position based on a preset normalization algorithm, and calibrate the normalization result of the original vector as the reference vector corresponding to the preset position in the mapping relationship;

[0014] The determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the angular similarity between the magnetic field vector and each reference vector in the mapping relationship includes:

[0015] Based on the normalization method, perform normalization processing on the magnetic field vector, and determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the dot product of the normalized magnetic field vector and each reference vector in the mapping relationship.

[0016] Optionally, the normalization method includes Euclidean normalization;

[0017] And / or, the determining a plurality of preset positions within the space and determining the original vector corresponding to each preset position includes:

[0018] Control the magnet to displace in a preset orbit within the space at a preset step length, and after each displacement, determine the original vector corresponding to the current position.

[0019] Optionally, the magnet is used to move along a preset orbit, and the plurality of magnetic field sensors are arranged parallel to the preset orbit;

[0020] And / or, the plurality of magnetic field sensors include a plurality of linear Hall sensors with the same orientation.

[0021] Optionally, the determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship includes:

[0022] Sort the reference vectors in the mapping relationship according to the order of the similarity between each reference vector in the mapping relationship and the magnetic field vector from large to small to obtain a reference vector sequence;

[0023] Take the Nth reference vector in the reference vector sequence as the target reference vector corresponding to the magnetic field vector, where N is a positive integer and less than the total number of reference vectors in the mapping relationship.

[0024] Optionally, the magnet is disposed on a transmission member of a joint actuator of a mechanical device. The transmission member is configured to move relative to a housing of the joint actuator along a preset track. The magnet is assembled on the transmission member, and the plurality of magnetic field sensors are assembled on the housing;

[0025] The method further includes:

[0026] Determine a moving stroke of the transmission member relative to the housing according to a current position of the magnet in the space.

[0027] A second aspect of the present disclosure provides a positioning device, the device includes:

[0028] A data combination module, configured to obtain a plurality of magnetic field data and combine the plurality of magnetic field data into a magnetic field vector. Wherein, the plurality of magnetic field data are respectively collected by a plurality of magnetic field sensors at known positions in the space, and a movable magnet is also deployed in the space;

[0029] A vector matching module, configured to determine a target reference vector corresponding to the magnetic field vector in the mapping relationship according to a similarity between the magnetic field vector and each reference vector in the mapping relationship. Wherein, the mapping relationship represents a mapping relationship between a reference vector and a reference position;

[0030] A magnet positioning module, configured to determine a reference position corresponding to the target reference vector in the mapping relationship as a current position of the magnet in the space.

[0031] Optionally, when the vector matching module is configured to determine a target reference vector corresponding to the magnetic field vector in the mapping relationship according to a similarity between the magnetic field vector and each reference vector in the mapping relationship, it is specifically configured to:

[0032] Determine a target reference vector corresponding to the magnetic field vector in the mapping relationship according to a cosine similarity between the magnetic field vector and each reference vector in the mapping relationship.

[0033] Optionally, the device further includes a calibration module:

[0034] Determine a plurality of preset positions in the space and determine an original vector corresponding to each preset position. Wherein, the original vector includes a magnetic field vector composed of magnetic field data collected by the plurality of magnetic field sensors when the magnet is located at the preset position;

[0035] For each preset position, perform normalization processing on the original vector corresponding to the preset position based on a preset normalization algorithm, and calibrate a normalization result of the original vector as a reference vector corresponding to the preset position in the mapping relationship;

[0036] When the vector matching module is used to determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the angular similarity between the magnetic field vector and each reference vector in the mapping relationship, it is specifically used for:

[0037] Based on the normalization method, normalize the magnetic field vector, and determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the dot product of the normalized magnetic field vector and each reference vector in the mapping relationship.

[0038] Optionally, the normalization method includes Euclidean normalization; and / or, when the calibration module is used to determine multiple preset positions in the space and determine the original vector corresponding to each preset position, it is specifically used for:

[0039] Control the magnet to displace at a preset step length on a preset track in the space, and after each displacement, determine the original vector corresponding to the current position.

[0040] Optionally, the magnet is used to move along a preset track, and the multiple magnetic field sensors are arranged parallel to the preset track; and / or, the multiple magnetic field sensors include multiple linear Hall sensors with the same orientation.

[0041] Optionally, when the vector matching module is used to determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, it is specifically used for:

[0042] Sort the reference vectors in the mapping relationship according to the order of the similarity between each reference vector in the mapping relationship and the magnetic field vector from large to small, and obtain a reference vector sequence;

[0043] Take the Nth reference vector in the reference vector sequence as the target reference vector corresponding to the magnetic field vector, where N is a positive integer and less than the total number of reference vectors in the mapping relationship.

[0044] Optionally, the magnet is arranged on a transmission part of a joint actuator of a mechanical device, the transmission part is used to move relative to the housing of the joint actuator along a preset track, the magnet is assembled on the transmission part, and the multiple magnetic field sensors are assembled on the housing;

[0045] The device further includes a measurement module, which is used for:

[0046] Determine the moving stroke of the transmission part relative to the housing according to the current position of the magnet in the space.

[0047] A third aspect of the present disclosure provides a computer program product, including computer programs / instructions, which, when executed by a processor, implement the method described in the first aspect.

[0048] A fourth aspect of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect is implemented.

[0049] A fifth aspect of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0050] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0051] In the embodiments of the present disclosure, multiple magnetic field data collected by multiple magnetic field sensors are first obtained, and then the multiple magnetic field data are combined into a magnetic field vector. Then, according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, the target reference vector corresponding to the magnetic field vector is determined in the mapping relationship, so that the current position of the magnet on the preset track is determined according to the reference position pre-calibrated in the mapping relationship and corresponding to the reference vector one by one. Based on this, the magnetic field data collected by different sensors can be directly and fully utilized in the same calculation process, effectively improving the positioning accuracy of the method and the robustness in a noisy environment.

[0052] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings herein are incorporated into the specification and form a part of the present disclosure, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.

[0054] Figure 1 It is a schematic structural diagram of a joint actuator shown in some exemplary embodiments.

[0055] Figure 2 It is a schematic structural diagram of a joint actuator shown in some exemplary embodiments.

[0056] Figure 3 It is a flowchart of a positioning method shown in some exemplary embodiments.

[0057] Figure 4 It is a block diagram of a positioning device shown in some exemplary embodiments.

[0058] Figure 5It is a hardware structure diagram of an electronic device shown by some exemplary embodiments. Detailed implementation manners

[0059] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0060] As described in the background art, in recent years, in view of problems such as the non-linear response and the susceptibility of signals to interference existing in Hall sensors, there is still a lack of a better solution in the related art, and the measurement accuracy of linear encoders is still not high enough.

[0061] In view of this, the present disclosure provides a positioning method, device, electronic device, and storage medium.

[0062] Next, the exemplary application scenarios of the embodiments of the present disclosure will be described in order from the largest scenario to the smallest.

[0063] First, mechanical devices such as robots and machine tools usually have moving components, and these moving components can be controlled by joint actuators to move. Figure 1 It is a schematic cross-sectional structure diagram of a joint actuator in an exemplary embodiment of the present disclosure. Figure 2 It is a schematic exploded structure diagram of a joint actuator (direct drive linear servo actuator) in an exemplary embodiment of the present disclosure. As Figure 1 、 Figure 2 shown, the joint actuator 1 includes a housing 11, a drive motor 12, and a transmission member 13. The drive motor 12 is assembled in the housing 11. The drive motor 12 includes a stator part 121 and a rotor part 122. The rotor part 122 includes an output shaft 123 and a motor magnet 124. The transmission member 13 is movably assembled in the housing 11, and the transmission member 13 is threadedly connected to the output shaft 123 to perform a telescopic movement along the axial direction of the output shaft 123 as the output shaft 123 rotates (converting the rotation of the nut into the linear movement of the screw). Among them, the stator part 121 can be fixedly assembled in the housing 11, and the rotor part 122 can rotate relative to the stator part.

[0064] In the process of controlling a robot, it is often necessary to obtain the feedback of the displacement of the transmission member 13 along the axial direction of the output shaft 123, that is, to confirm as accurately as possible the current position of the transmission member 13. The accuracy of this positioning will greatly affect the control efficiency of the robot. Therefore, a magnet 14 can be installed on the transmission member 13 ("installation" means keeping the relative position between the transmission member 13 and the magnet 14 fixed). The joint actuator 1 further includes a drive control board 15 and a magnetic field sensor 151 (i.e., a magnetic field sensor, Figure 1 , 2 as shown in the joint actuator 1, including four magnetic field sensors). The magnetic field sensor 151 obtains the low-speed end position feedback according to the magnet 14. The magnetic field sensor 151 and / or the encoder 152 are arranged on the drive control board 15 to improve the integration and control convenience of the joint actuator 1. The above circuit for positioning can be called a linear encoder (linear encoder).

[0065] The relationship between the reading of a single magnetic field sensor and the position of the magnet is non-monotonic because the distribution of the magnetic field intensity changing with position has periodicity or symmetry, and the magnetic field sensor may not be able to accurately measure the magnetic field intensity in all directions, resulting in the output signal of the same sensor may correspond to multiple different positions of the magnet in space. In summary, how to accurately position the magnet based on a magnetic field sensor (such as a Hall sensor) has become an important entry point for improving the control accuracy of the robot (of course, including other scenarios where displacement needs to be measured).

[0066] Since it is impossible to use an explicit mathematical expression to describe the mapping relationship between the data collected by the magnetic field sensor and the position of the magnet (that is, there is no analytical relationship between the two), it is usually possible to list reference values to achieve the positioning of the magnet. In the related positioning mechanism, the method usually estimates the magnet position by processing the data of multiple magnetic field sensors step by step: for example, first determine the position interval by comparing the magnitude relationship between the data of each sensor (for example, if three magnetic field sensors A, B, and C are deployed on a straight line, and if the reading of B is the largest, C is the second, and A is the smallest, then it can be considered that the projection of the magnet on this straight line is between B and C and closer to B, then a corresponding table can be preset, and this table records the corresponding relationship between the reading of B and the position of the magnet), and then perform one-dimensional data matching within this interval (that is, take a magnetic field data and match the closest reference data in the sub-mapping relationship corresponding to this position interval. At this time, these reference data are actually distributed in one-dimensional space). In this phased processing method, each processing stage can only utilize part of the information dimension of the sensing data, and when matching, if only the data of part of the sensors are used, the measurement result is extremely vulnerable to noise interference.

[0067] Next, the embodiments of the present disclosure will be described in detail.

[0068] The first aspect of the present disclosure provides a positioning method. Please refer to Figure 3 , which may include steps S301 to S303.

[0069] Step S301: Obtain a plurality of magnetic field data, and combine the plurality of magnetic field data into a magnetic field vector, where the plurality of magnetic field data are respectively collected by a plurality of magnetic field sensors at known positions in space, and a movable magnet is also deployed in the space.

[0070] Among them, the magnet can be any substance with magnetism, such as neodymium magnet, electromagnet, etc.; the magnetic field sensor can be a linear Hall sensor, a magnetoresistive sensor, etc., and each magnetic field sensor can be made based on different principles. The space can refer to the space in the housing 11 of the above-mentioned joint actuator 1, or any other space. The magnet can move in the space, that is, it can move relative to the above-mentioned plurality of magnetic field sensors.

[0071] Optionally, the magnet can have a preset trajectory, that is, it is used to move along a preset trajectory (i.e., it can move relative to the plurality of magnetic field sensors along a preset track), such as the axial direction of the output shaft 123 described above. Based on this, the preparation cost of the reference data can be lower, and a controllable mapping relationship can be ensured between the data collected by each sensor and each position on the trajectory (i.e., it is not easy to appear unexpected discrete values). Regarding the magnetic field sensors, the plurality of magnetic field sensors can be arranged parallel to the above-mentioned preset track to obtain higher measurement accuracy: because when the magnet moves on the preset track, the readings of each sensor will have a more rigorous relationship of increase and decrease, and the corresponding data at different positions will have a large difference and are not easy to be mis-matched; in addition, similarly, the plurality of magnetic field sensors can include a plurality of linear Hall sensors with the same orientation. For example, the z-axis of the Hall sensor (a single Hall sensor is usually used to measure the magnetic field strength component on the z-axis) can be perpendicular to the above-mentioned preset track.

[0072] Next, taking Figure 1 , 2Taking the described four-Hall sensor array (i.e., magnetic field sensor 151) as an example, the embodiments will be described. The principles involved are still applicable to sensor arrays with other quantities and layouts. First, the measured values of the four Hall sensors can be denoted as x1, x2, x3, x4 in a preset order. Then, in S301, the measured values of the four Hall sensors are combined into a vector in the preset order (i.e., according to the correspondence between the multiple magnetic field data and the multiple magnetic field sensors, the multiple magnetic field data are combined into a magnetic field vector such that the data collected by the same Hall sensor appears at a preset position in the vector); for example, based on the readings of the above four Hall sensors, a magnetic field vector X = [x1, x2, x3, x4] can be exemplarily obtained.

[0073] Step S302: Determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, where the mapping relationship represents the mapping relationship between the reference vector and the reference position.

[0074] There can be various schemes for calculating the similarity. For example, similarity metrics based on direction / angle such as cosine similarity and dot product similarity (or distance-based similarity metrics such as Euclidean distance and Manhattan distance, or other metrics such as Pearson correlation coefficient, Hamming distance, and Jaccard similarity) can be used to characterize the similarity relationship between two vectors.

[0075] Among them, the similarity metrics based on direction / angle can better reduce the computing power overhead of the method.

[0076] For example, the step of determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship may include: determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the cosine similarity between the magnetic field vector and each reference vector in the mapping relationship. This embodiment enables the present solution to effectively improve the reliability and positioning accuracy of the magnetic field positioning system in a noisy environment through the improvement of the data representation method and the optimization of the matching algorithm without increasing the hardware complexity.

[0077] The mapping relationship stores reference vectors corresponding to at least one reference position, and the reference vectors can be pre-calibrated before the method is executed. For example, the method may further include: determining a plurality of preset positions in the space and determining the original vector corresponding to each preset position, where the original vector includes the magnetic field vector composed of the magnetic field data collected by the multiple magnetic field sensors when the magnet is at the preset position.

[0078] Next, the original vectors can be directly stored to reduce the computational pressure during the calibration process (this advantage is more effective when the number of preset positions is extremely large). Alternatively, the original vectors can be normalized according to a preset method and then the normalized results can be stored. That is, for each preset position, the original vector corresponding to the preset position can be normalized based on a preset normalization algorithm, and the normalized result of the original vector can be calibrated as the reference vector corresponding to the preset position in the mapping relationship. Generally speaking, the normalization methods can include L1 norm normalization, L2 norm normalization, etc. (the L2 norm is also called the Euclidean norm, and L2 norm normalization is also called Euclidean normalization). Among them, L2 norm normalization is more commonly used in the calculation of cosine similarity because the L2 norm (Euclidean length) naturally defines the direction of the vector, which can completely eliminate the scale differences of different vectors and only retain their direction characteristics; at the same time, there is a direct relationship between the cosine similarity obtained after L2 normalization and the square of the Euclidean distance, which is convenient for subsequent processing of data. However, any normalization method can be applied in the embodiments provided in the present disclosure.

[0079] In this case, the determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the angular similarity between the magnetic field vector and each reference vector in the mapping relationship may include: normalizing the magnetic field vector based on the normalization method, and determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the dot product of the normalized magnetic field vector and each reference vector in the mapping relationship. In other words, since the cosine similarity can be regarded as the dot product of the normalized results of two vectors after the two vectors are normalized, the normalization process of the original vector can be completed during the calibration process. Thus, in subsequent use, it is not necessary to normalize the vectors stored in the mapping relationship again, but only to normalize the current magnetic field vector, and then calculate the dot product operation result of the normalized result of the magnetic field vector and the vectors stored in the mapping relationship. This implementation method improves the data representation method and optimizes the matching algorithm, significantly reducing the computational overhead of the method during the subsequent application process of the method, thus greatly improving the execution speed of the method, and enabling the method to be applied to hardware operation units with lower computing power.

[0080] Further, during the pre - performed calibration process, the determining a plurality of preset positions in the space and determining the original vector corresponding to each preset position may include: controlling the magnet to displace on a preset track in the space at a preset step size, and determining the original vector corresponding to the current position after each displacement.

[0081] That is, n position points (n is a positive integer, and each position point is a preset position) can be evenly divided on the entire travel of the magnet (i.e., the preset track), denoted as p1, p2, …, p n . The number of divided positions n can be determined by the expected resolution. For example, if the expected resolution is one-thousandth of the entire travel, then n = 1000 can be set. Then, a displacement control device (such as a high-precision displacement device) can be used to make the magnet be in each position p i in turn, and record the measurement value vectors of the four Hall sensors Then, the modulus (such as the Euclidean norm) of the vector corresponding to each position can be calculated and recorded, so as to obtain n vector moduli |X (1) |, |X (2) |, …, |X (n) | corresponding to n preset positions respectively. Then, the unit vector corresponding to each position can be calculated and recorded, and n unit vectors corresponding one-to-one to n preset positions can be obtained and each unit vector in these unit vectors and the corresponding p i are stored in the mapping relationship. After such operations, the unit vectors corresponding to the magnet at each position p i can be obtained, that is, with the following expectation: when the collected magnetic field vector is the same as , the magnet is on p . i .

[0082] It should be noted that the multiple optional details shown above can be applied simultaneously and achieve better cooperation effects, or different exemplary detail combinations can be selected according to the advantages and focuses of different embodiments. In the embodiment of using the Euclidean normalization algorithm for normalization, using the cosine similarity to evaluate the similarity, and normalizing the original vector and then storing it in the mapping relationship, the example in the above text can be implemented by the following steps for S302

[0083] After obtaining the magnetic field vector X, the modulus of the vector X (i.e., the Euclidean norm) can be calculated: Then, this modulus can be used to normalize the magnetic field vector to obtain a unit vector: Then, in the mapping relationship, a reference vector matching can be found. In this process, exemplarily, and the cosine similarity between each unit vector among the n calibrated unit vectors can be calculated (here the unit vector is the normalization result corresponding to the original vector, that is, the above reference vector). For example, and the dot product between each reference vector can be taken As the cosine similarity (or dot product similarity) between each reference vector; when the original vector and the magnetic field vector are normalized in the Euclidean normalization manner, the result of this dot product calculation can be directly used as the cosine similarity).

[0084] In actual situations, the ideal condition that the "collected magnetic field vector is the same as" mentioned above generally does not hold, and the change of the magnetic field vector obtained by the magnet at different positions is not linear, or even not analytic (that is, it is difficult to express the corresponding relationship between the magnetic field vector and the magnet position in the form of a mathematical expression and regression statistics cannot be performed). Therefore, a reference position corresponding to a certain reference vector with a relatively high matching degree between can be taken as the reference position corresponding to (i.e., the current position of the magnet). In other words, determining the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship may include: sorting the reference vectors in the mapping relationship according to the order of the similarity between each reference vector in the mapping relationship and the magnetic field vector from large to small to obtain a reference vector sequence; taking the Nth reference vector in the reference vector sequence as the target reference vector corresponding to the magnetic field vector, where N is a positive integer and less than the total number of reference vectors in the mapping relationship (there is generally no association between N and n above). When N is 1, the reference vector with the highest matching degree is taken as the target reference vector.

[0085]

[0086] Step S303: Determine the reference position corresponding to the target reference vector in the mapping relationship as the current position of the magnet in the space.

[0087] For example, the unit vector with the largest cosine similarity between can be selected as the target reference vector, and then the calibration position p * corresponding to the most similar unit vector is taken out in S303 as the estimation of the magnet position. Thus, the method is fully adapted to the above application scenario and can directly obtain the magnet position estimation based on multiple magnetic field data in the case of lacking an analytical relationship.

[0087] In addition, the process described above is not the only implementation method. For example, in the above-described embodiment of "using the Nth reference vector in the reference vector sequence as the target reference vector corresponding to the magnetic field vector", it is not necessarily directly taking the Nth reference vector as the target reference vector corresponding to the magnetic field vector. Instead, the first M reference vectors in the sequence (M is a positive integer; both M and n above are only used algebraically, and there may be no association between the two, or there may be a positive correlation) can be taken as candidate vectors. Then, after averaging the reference positions corresponding to each of the obtained candidate vectors according to weights, the obtained average position is used as the target reference vector (for example, when M is taken as 2, the middle position of the reference positions corresponding to the two candidate vectors can be taken as the current position of the magnet in the space). There can also be additional limiting conditions for the candidate vectors. For example, the similarity between each of the candidate vectors needs to meet a preset condition (such as the cosine similarity being greater than a first threshold) to avoid adding too much noise to the calculation process. This application method is more effective when the value of n above is larger (i.e., the calibration accuracy is higher), or when there is a lack of a reference vector with a similarity greater than a second threshold to the magnetic field vector among the current multiple reference vectors.

[0088] After obtaining the position of the magnet, the next step of calculation can be carried out based on the position of the magnet. For example, in the Figure 1 , Figure 2 corresponding scenario described above, the magnet is provided on a transmission member of a joint actuator of a mechanical device. The transmission member is used to move relative to the housing of the joint actuator along a preset track. The magnet is assembled on the transmission member, and the multiple magnetic field sensors are assembled on the housing. Then, the method further includes: determining the moving stroke of the transmission member relative to the housing according to the current position of the magnet in the space. In other words, at this time, based on the current position of the magnet, it is possible to accurately and quickly determine how much the moving stroke of the transmission member of the current joint actuator is, which is convenient for the next step of precise motion control.

[0089] In summary, the present solution innovatively integrates the data collected by multiple magnetic field sensors into a multi-dimensional magnetic field vector, and realizes direct matching by calculating the overall similarity between this vector and all reference vectors in the preset mapping relationship. Based on this, the present solution can synchronously process the complete data information of all magnetic field sensors (instead of using different data in different steps), thereby realizing the full utilization of information. Specifically, the present solution extends the originally one-dimensional reference data to a high-dimensional space matching the number of sensors, significantly increasing the distribution sparsity of the reference data. To understand vividly, if four magnetic field sensors are used and the reference readings of the sensors corresponding to one thousand reference positions are preset, then the above one thousand reference data will be sparsely distributed in a four-dimensional space, while in the scheme of step-by-step matching of each data, these one thousand reference data are actually distributed on a one-dimensional number axis with a high density and a high probability of false matching. This dimensional expansion enables the system to maintain the positioning accuracy through the overall matching characteristics of the multi-dimensional vector even if there is noise interference in part of the sensor data, effectively improving the robustness and matching fault tolerance ability of the system in a noisy environment, and further greatly improving the positioning accuracy.

[0090] Corresponding to the embodiments of the foregoing method, the present disclosure also provides embodiments of a device and a terminal to which the device is applied.

[0091] A second aspect of the present disclosure provides a positioning device. Please refer to Figure 4 , the device includes:

[0092] A data combination module 401, configured to obtain a plurality of magnetic field data and combine the plurality of magnetic field data into a magnetic field vector, wherein the plurality of magnetic field data are respectively collected by a plurality of magnetic field sensors at known positions in space, and a movable magnet is also deployed in the space;

[0093] A vector matching module 402, configured to determine a target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, wherein the mapping relationship represents the mapping relationship between the reference vector and the reference position;

[0094] A magnet positioning module 403, configured to determine the reference position corresponding to the target reference vector in the mapping relationship as the current position of the magnet in the space.

[0095] Optionally, when the vector matching module is configured to determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, it is specifically configured to:

[0096] Determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the cosine similarity between the magnetic field vector and each reference vector in the mapping relationship.

[0097] Optionally, the device further includes a calibration module:

[0098] Determine a plurality of preset positions within the space, and determine the original vector corresponding to each preset position, where the original vector includes the magnetic field vector composed of the magnetic field data collected by the plurality of magnetic field sensors when the magnet is at the preset position;

[0099] For each preset position, perform normalization processing on the original vector corresponding to the preset position based on a preset normalization algorithm, and calibrate the normalization result of the original vector as the reference vector corresponding to the preset position in the mapping relationship;

[0100] When the vector matching module is used to determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the angular similarity between the magnetic field vector and each reference vector in the mapping relationship, it is specifically used for:

[0101] Based on the normalization method, perform normalization processing on the magnetic field vector, and determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the dot product of the normalized magnetic field vector and each reference vector in the mapping relationship.

[0102] Optionally, the normalization method includes Euclidean normalization; and / or, when the calibration module is used to determine a plurality of preset positions within the space and determine the original vector corresponding to each preset position, it is specifically used for:

[0103] Control the magnet to displace at a preset step length on a preset track within the space, and determine the original vector corresponding to the current position after each displacement.

[0104] Optionally, the magnet is used to move along a preset track, and the plurality of magnetic field sensors are arranged parallel to the preset track; and / or, the plurality of magnetic field sensors include a plurality of linear Hall sensors with the same orientation.

[0105] Optionally, when the vector matching module is used to determine the target reference vector corresponding to the magnetic field vector in the mapping relationship according to the similarity between the magnetic field vector and each reference vector in the mapping relationship, it is specifically used for:

[0106] Sort the reference vectors in the mapping relationship according to the order of the similarity between each reference vector in the mapping relationship and the magnetic field vector from large to small, to obtain a reference vector sequence;

[0107] Take the Nth reference vector in the reference vector sequence as the target reference vector corresponding to the magnetic field vector, where N is a positive integer and less than the total number of reference vectors in the mapping relationship.

[0108] Optionally, the magnet is disposed on a transmission member of a joint actuator of a mechanical device. The transmission member is configured to move relative to a housing of the joint actuator along a preset track. The magnet is assembled on the transmission member, and the plurality of magnetic field sensors are assembled on the housing;

[0109] The device further includes a measurement module, configured to:

[0110] Determine a moving stroke of the transmission member relative to the housing according to a current position of the magnet in the space.

[0111] For the implementation processes of the functions and actions of each module in the above device, refer to the implementation processes of the corresponding steps in the above method for details, which will not be elaborated herein.

[0112] A third aspect of the present disclosure provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the method described in the first aspect is implemented.

[0113] For the device embodiments and the computer program product embodiments, since they basically correspond to the method embodiments, refer to the partial descriptions of the method embodiments for the relevant parts. In addition, the device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present disclosure. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0114] In a fourth aspect, the embodiments of the positioning device provided by the present disclosure can be applied to an electronic device. Please refer to Figure 5 , which exemplarily shows a hardware schematic diagram of an electronic device. For example, the device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0115] The device 500 may include one or more of the following components: a processing component 501, a memory 502, a power component 503, a multimedia component 504, an audio component 505, an input / output (I / O) interface 506, a sensor component 507, and a communication component 508.

[0116] The processing component 501 generally controls the overall operation of the device 500, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 501 may include one or more processors 509 to execute instructions to complete all or part of the steps of the above-described methods. In addition, the processing component 501 may include one or more modules to facilitate the interaction between the processing component 501 and other components. For example, the processing component 501 may include a multimedia module to facilitate the interaction between the multimedia component 504 and the processing component 501.

[0117] The memory 502 is configured to store various types of data to support the operation of the device 500. Examples of such data include instructions for any application or method operating on the device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 502 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0118] The power component 503 provides power to various components of the device 500. The power component 503 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 500.

[0119] The multimedia component 504 includes a screen that provides an output interface between the device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 504 includes a front camera and / or a rear camera. When the device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each of the front camera and the rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0120] The audio component 505 is configured to output and / or input audio signals. For example, the audio component 505 includes a microphone (MIC) that is configured to receive external audio signals when the device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 502 or transmitted via the communication component 508. In some embodiments, the audio component 505 further includes a speaker for outputting audio signals.

[0121] The input / output (I / O) interface 506 provides an interface between the processing component 501 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.

[0122] The sensor component 507 includes one or more sensors for providing an assessment of the state of various aspects of the device 500. For example, the sensor component 507 can detect the on / off state of the device 500, the relative positioning of components, such as the display and keypad of the device 500. The sensor component 507 can also detect a change in the position of the device 500 or a component of the device 500, the presence or absence of user contact with the device 500, the orientation or acceleration / deceleration of the device 500, and the temperature change of the device 500. The sensor component 507 can also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 507 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 507 can further include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0123] The communication component 508 is configured to facilitate communication between the device 500 and other devices in a wired or wireless manner. The device 500 can access a wireless network based on communication standards, such as WiFi, 2G or 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 508 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 508 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0124] In an exemplary embodiment, the device 500 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the positioning method of the above electronic device.

[0125] In a fifth aspect, in an exemplary embodiment of the present disclosure, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory 502 including instructions, and the above instructions can be executed by a processor 509 of the device 500 to complete the positioning method of the above electronic device. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0126] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain implementations, multitasking and parallel processing are also possible or may be advantageous.

[0127] Those skilled in the art will readily conceive of other implementations of the present disclosure after considering the specification and practicing the invention herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not claimed in the present disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0128] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the figures, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

[0129] The above are only the preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.

Claims

1. A positioning method, characterized in that: The method comprises: Acquire a plurality of magnetic field data, and combine the plurality of magnetic field data into a magnetic field vector, wherein the plurality of magnetic field data are respectively acquired by a plurality of magnetic field sensors at known positions in a space, and a movable magnet is also deployed in the space; Determining a target reference vector corresponding to the magnetic field vector in the mapping relationship according to a similarity between the magnetic field vector and each reference vector in the mapping relationship, wherein the mapping relationship represents a mapping relationship between a reference vector and a reference position; The reference position corresponding to the target reference vector in the mapping relationship is determined as the current position of the magnet in the space.

2. The positioning method according to claim 1, characterized in that: The determining, in the mapping relationship, a target reference vector corresponding to the magnetic field vector according to the similarity between the magnetic field vector and each reference vector in the mapping relationship comprises: According to the cosine similarity between the magnetic field vector and each reference vector in the mapping relationship, a target reference vector corresponding to the magnetic field vector is determined in the mapping relationship.

3. The positioning method according to claim 2, characterized in that: The method further comprises: Determine a plurality of preset positions in the space, and determine an original vector corresponding to each preset position, wherein the original vector includes a magnetic field vector composed of magnetic field data collected by the plurality of magnetic field sensors when the magnet is located at the preset position; For each preset position, normalize the original vector corresponding to the preset position based on a preset normalization algorithm, and calibrate the normalized result of the original vector as the reference vector corresponding to the preset position in the mapping relationship; The determining, in the mapping relationship, a target reference vector corresponding to the magnetic field vector according to the angular similarity between the magnetic field vector and each reference vector in the mapping relationship comprises: Based on the normalization method, the magnetic field vector is normalized, and according to the dot product of the normalized magnetic field vector and each reference vector in the mapping relationship, the target reference vector corresponding to the magnetic field vector is determined in the mapping relationship.

4. The positioning method according to claim 3, characterized in that: The normalization method includes Euclidean normalization; And / or, determining a plurality of preset positions in the space and determining an original vector corresponding to each preset position includes: The magnet is controlled to move on a preset track in the space according to a preset step length, and after each displacement, an original vector corresponding to the current position is determined.

5. The positioning method according to claim 1, characterized in that: The determining, in the mapping relationship, a target reference vector corresponding to the magnetic field vector according to the similarity between the magnetic field vector and each reference vector in the mapping relationship comprises: Sorting the reference vectors in the mapping relationship according to the order of the similarity between each reference vector in the mapping relationship and the magnetic field vector from large to small to obtain a reference vector sequence; The Nth reference vector in the reference vector sequence is used as the target reference vector corresponding to the magnetic field vector, wherein N is a positive integer and is less than the total number of reference vectors in the mapping relationship.

6. The positioning method according to claim 1, characterized in that: The magnet is arranged on a transmission member of a joint actuator of a mechanical device, the transmission member is used to move along a preset track relative to a housing of the joint actuator, the magnet is mounted on the transmission member, and the plurality of magnetic field sensors are mounted on the housing; the method further comprises: The moving stroke of the transmission member relative to the housing is determined according to the current position of the magnet in the space.

7. The positioning method according to claim 1, characterized in that: The magnet is used to move along a preset track, and the plurality of magnetic field sensors are arranged parallel to the preset track; and / or, The plurality of magnetic field sensors include a plurality of linear Hall sensors having the same orientation.

8. A positioning device, characterized in that: The device comprises: A data combination module, used for acquiring a plurality of magnetic field data and combining the plurality of magnetic field data into a magnetic field vector, wherein the plurality of magnetic field data are respectively collected by a plurality of magnetic field sensors at known positions in a space, and a movable magnet is also deployed in the space; a vector matching module, configured to determine a target reference vector corresponding to the magnetic field vector in the mapping relationship according to a similarity between the magnetic field vector and each reference vector in the mapping relationship, wherein the mapping relationship represents a mapping relationship between a reference vector and a reference position; The magnet positioning module is used to determine the reference position corresponding to the target reference vector in the mapping relationship as the current position of the magnet in the space.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Position detection device, system, method, and program

    CN114910102A

  • Permanent magnet synchronous linear motor displacement measurement method and device, computer and medium

    CN116518836A

  • Positioning method and device based on specific electromagnetic field relation mapping and medium

    CN119001556A

  • Object positioning method and apparatus, electronic device, storage medium, and program

    WO2022179013A1

Cited By

  • Magnetic positioning system and method based on magnetic field sensor array

    CN121232288A