Absolute position calculation method, device and equipment based on amr sensor array
The absolute position of the magnet is calculated by using an AMR sensor array, and the angle and sine/cosine standard deviation are calculated using the sensor output voltage value to determine the absolute position of the magnet. This solves the problem that AMR sensors cannot perform position measurement and achieves simple and accurate positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU LINGHOU ROBOT
- Filing Date
- 2022-12-26
- Publication Date
- 2026-04-24
Smart Images

Figure CN116182683B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor measurement technology, and in particular to a method, apparatus, and device for calculating the absolute position based on an AMR sensor array. Background Technology
[0002] For strongly magnetic metals with anisotropic properties, the change in magnetoresistance is related to the angle between the magnetic field and the current. When the external magnetic field makes a zero-degree angle with the built-in magnetic field of the magnet, the resistance does not change with the applied magnetic field; however, when the external magnetic field makes a certain angle with the built-in magnetic field of the magnet, the magnetization vector inside the magnet will shift, and the thin-film resistance will decrease. This characteristic is called the anisotropic magnetoresistive sensor (AMR).
[0003] Existing technical solutions using AMR sensors typically only measure angle information and cannot measure position; or they use AMR sensors in conjunction with magnetic scales, Wheatstone bridge signals, etc., to measure position, but the calculation methods and measuring devices are relatively complex and cannot achieve rapid positioning. Summary of the Invention
[0004] This invention provides an absolute position calculation method, device, and equipment based on an AMR sensor array to accurately locate the absolute position of a magnet in various motion scenarios such as rotation, straight lines, and curves, and the calculation method is simpler.
[0005] According to one aspect of the present invention, an absolute position calculation method based on an AMR sensor array is provided, characterized in that the AMR sensor array includes multiple AMR sensors, and the calculation method includes:
[0006] Obtain the equivalent voltage value corresponding to the output voltage value of each AMR sensor;
[0007] The angle between the AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor are determined based on the equivalent voltage value.
[0008] The AMR sensor closest to the magnet is determined based on the standard degree of the three largest sine and cosine values and the angle between the AMR sensor and the magnet.
[0009] The absolute position of the magnet in space is determined by the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet.
[0010] Optionally, obtaining the equivalent voltage value corresponding to the output voltage value of each AMR sensor includes:
[0011] The system receives the conversion voltage corresponding to the output voltage values of each AMR sensor from the analog-to-digital conversion module. The conversion voltage is the AMR sensor output voltage value after being calibrated and amplified by the analog-to-digital conversion module.
[0012] After data synchronization, the conversion voltages corresponding to multiple AMR sensors are normalized.
[0013] The equivalent voltage value corresponding to the output voltage value of the AMR sensor is calculated based on the conversion voltage and equivalent voltage calculation formulas for the AMR sensor.
[0014] Optionally, the equivalent voltage value corresponding to the AMR sensor output voltage value is calculated based on the conversion voltage and equivalent voltage calculation formulas for the AMR sensor, including:
[0015] Calculate the equivalent sinusoidal voltage value based on the converted voltage;
[0016] Calculate the equivalent cosine voltage value based on the converted voltage.
[0017] Optionally, determining the angle between the AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor based on the equivalent voltage value includes:
[0018] The angle between the AMR sensor and the magnet is determined based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the angle calculation formula.
[0019] The standard degree of the sine and cosine of the AMR sensor is determined based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the standard degree calculation formula of the sine and cosine.
[0020] Optionally, before determining the AMR sensor closest to the magnet based on the standard degrees of the three largest sine and cosine sensors and their angle values with the magnet, the process includes:
[0021] In the first clock cycle, the standard score of each sine and cosine is compared with the standard scores of other sine and cosine, and a score is calculated based on the comparison results;
[0022] In the second clock cycle, the scores of the standard scores of the sine and cosines compared with the standard scores of the other sine and cosines are added together to obtain the total score;
[0023] In the third clock cycle, the three largest sine and cosine standard scores are sorted from largest to smallest, and the corresponding AMR sensors and their angle values with the magnets are determined.
[0024] Optionally, the AMR sensors in the AMR sensor array are arranged along a fixed direction, with spacing between adjacent AMR sensors; the AMR sensor closest to the magnet is determined based on the AMR sensor corresponding to the standard degree of the three largest sine and cosine and its angle value with the magnet, including:
[0025] If the angle value corresponding to AMR sensor numbered N is positive and the angle value corresponding to AMR sensor numbered N+1 is negative, then the AMR sensor closest to the magnet is numbered N; if the above conditions are not met, the judgment continues.
[0026] If the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, and the angle value corresponding to the AMR sensor numbered N+2 is positive, then the AMR sensor closest to the magnet is numbered N+1.
[0027] The total number of AMR sensors is M, and the range of their numbers is 0 ≤ N ≤ M - 3.
[0028] Optionally, before determining the absolute spatial position of the magnet based on the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet, the process includes:
[0029] The absolute position of each AMR sensor is determined based on the center-to-center distance between adjacent AMR sensors.
[0030] Optionally, determining the absolute spatial position of the magnet based on the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet includes:
[0031] The absolute position of the AMR sensor is determined by the number of the AMR sensor closest to the magnet;
[0032] The distance between the actual position of the magnet and the absolute position of the AMR sensor is calculated based on the angle between the AMR sensor closest to the magnet and the magnet.
[0033] The absolute position of the magnet in space is determined by the distance between the actual position of the magnet and the absolute position of the AMR sensor, and by the absolute position of the AMR sensor.
[0034] According to another aspect of the present invention, an absolute position calculation device based on an AMR sensor array is provided, characterized in that it comprises:
[0035] The acquisition module is used to acquire the equivalent voltage value corresponding to the output voltage value of each AMR sensor;
[0036] The calculation module is used to determine the angle value between the corresponding AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor based on the equivalent voltage value.
[0037] The selection module is used to determine the AMR sensor closest to the magnet based on the standard degree of the three largest sine and cosine sensors and the angle between them and the magnet.
[0038] The absolute position calculation module is used to determine the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet.
[0039] According to another aspect of the present invention, an absolute position calculation device based on an AMR sensor array is provided, characterized in that the device comprises:
[0040] One or more processors;
[0041] Storage device for storing one or more programs;
[0042] When one or more programs are executed by one or more processors, the one or more processors implement the absolute position calculation method based on the AMR sensor array as described in any of the above embodiments.
[0043] The technical solution of this invention uses an array of multiple AMR sensors to convert the magnetic field strength at different positions of the magnet into voltage output. Based on the equivalent voltage value corresponding to the output voltage, the angle between the AMR sensor and the magnet and the corresponding standard degree of sine and cosine are calculated, and the AMR sensor closest to the magnet is determined. The absolute position of the magnet is determined based on the absolute position of the AMR sensor and the angle between the AMR sensor and the magnet. This enables precise positioning of the absolute position of the magnet in various motion scenarios such as rotation, straight lines, and curves, and the calculation method is simpler.
[0044] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1This is a flowchart of an absolute position calculation method based on an AMR sensor array provided in an embodiment of the present invention;
[0047] Figure 2 A trend graph showing the angle-position relationship between the AMR sensor and the magnet;
[0048] Figure 3 This is a flowchart of another absolute position calculation method based on an AMR sensor array provided in an embodiment of the present invention;
[0049] Figure 4 This is a flowchart of another method for calculating the absolute position based on an AMR sensor array provided in an embodiment of the present invention;
[0050] Figure 5 This is a flowchart of another method for calculating the absolute position based on an AMR sensor array provided in an embodiment of the present invention;
[0051] Figure 6 This is a schematic diagram of the structure of an AMR sensor array;
[0052] Figure 7 This is a schematic diagram of the structure of an absolute position calculation device based on an AMR sensor array provided in an embodiment of the present invention;
[0053] Figure 8 This is a schematic diagram of the structure of an electronic device that implements the absolute position calculation method based on an AMR sensor array according to an embodiment of the present invention. Detailed Implementation
[0054] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0056] This invention provides an absolute position calculation method based on an AMR sensor array, which can be executed by an AMR sensor array-based absolute position calculation device and is suitable for calculating the spatial absolute position of a magnet. The AMR sensor array includes multiple AMR sensors arranged in a straight line. When the magnet is in a predetermined direction of the AMR sensor array, for example, when the magnet is on the side directly opposite to the predetermined direction of the AMR sensor array (this predetermined direction can be the sensing side of the AMR sensor), the AMR sensor can sense the magnetic field of the magnet and convert the magnetic field strength of the magnet into a voltage output. Figure 1 This is a flowchart illustrating an absolute position calculation method based on an AMR sensor array, provided by an embodiment of the present invention. This method can be executed by an absolute position calculation device based on an AMR sensor array, which can be implemented in hardware and / or software, and can be integrated into a processor. See also... Figure 1 The method includes:
[0057] S101. Obtain the equivalent voltage value corresponding to the output voltage value of each AMR sensor.
[0058] Specifically, the AMR sensor is used to convert the magnetic field strength of a magnet into a voltage output. The equivalent voltage value corresponds one-to-one with the output voltage value of the AMR sensor. The equivalent voltage value can be obtained by processing the output voltage value of the AMR sensor using at least one of the following methods: amplification, analog-to-digital conversion, or conversion according to a preset rule.
[0059] S102. Determine the angle between the corresponding AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor based on the equivalent voltage value.
[0060] Specifically, the angle between the AMR sensor and the magnet ranges from -90° to 90°. The standardization of the sine and cosine curves is the same as the standardization of the sine and cosine curves; the larger the standardization value, the closer the corresponding sine and cosine curves are to the ideal waveform. A first correspondence and a second correspondence are pre-set. Based on the first correspondence and the equivalent voltage value corresponding to each AMR sensor, the angle between each AMR sensor and the magnet is calculated. Based on the second correspondence and the equivalent voltage value corresponding to each AMR sensor, the standardization of the sine and cosine curves of each AMR sensor is calculated.
[0061] S103. Determine the AMR sensor closest to the magnet based on the standard degree of the three largest sine and cosine sensors and the angle between them and the magnet.
[0062] Specifically, the standard values of the sine and cosines corresponding to each AMR sensor are sorted from largest to smallest. The standard values of the top three sine and cosines are taken as the three largest standard values. Based on the three largest standard values of the sine and cosines, the corresponding AMR sensor and its angle value with the magnet are selected, and the AMR sensor closest to the magnet is determined.
[0063] S104. Determine the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the AMR sensor closest to the magnet and the magnet.
[0064] Specifically, the absolute position of the AMR sensor is the location of each AMR sensor. The absolute position of the AMR sensor can be set according to the measurement needs. For example, the absolute position of the AMR sensor can be: the absolute position of AMR sensor numbered 0 is 0mm, the absolute position of AMR sensor numbered 1 is 10mm, and the absolute position of AMR sensor numbered 2 is 20mm. Figure 2 For a trend graph of the angle-position relationship between the AMR sensor and the magnet, see [link / reference]. Figure 2 It can be seen that within the range of -90° to 90° at the center point of the AMR sensor, the relationship between the position and angle of the magnet is similar to a linear relationship. Therefore, the absolute position of the magnet in space can be calculated based on the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet.
[0065] The technical solution of this embodiment uses an array of multiple AMR sensors to convert the magnetic field strength at different positions of the magnet into voltage output. Based on the equivalent voltage value corresponding to the output voltage, the angle value between the AMR sensor and the magnet and the corresponding standard degree of sine and cosine are calculated, and the AMR sensor closest to the magnet is determined. Since the magnet position and angle relationship exhibit a similar linear relationship within the -90° to 90° range at the center point of the AMR sensor, the absolute position of the magnet can be determined based on the absolute position of the AMR sensor and the angle value between the AMR sensor and the magnet. This enables precise positioning of the absolute position of the magnet in various motion scenarios such as rotation, straight lines, and curves, and the calculation method is simpler.
[0066] Figure 3 This is a flowchart of another absolute position calculation method based on an AMR sensor array provided by an embodiment of the present invention. Optionally, see [link to flowchart]. Figure 3 The method includes:
[0067] S201. Receive the conversion voltage corresponding to the output voltage value of each AMR sensor from the analog-to-digital conversion module. The conversion voltage is the AMR sensor output voltage value after being calibrated and amplified by the analog-to-digital conversion module.
[0068] Specifically, the analog-to-digital conversion module acquires the output voltage values of each AMR sensor, calibrates and amplifies them, and converts these values into digital signals before outputting them to the processor. The calibration of the AMR sensor output voltage values reduces deviations during data acquisition, making the data more accurate; the amplification of the AMR sensor output voltage values increases the millivolt-level voltage output from the AMR sensors to volt-level voltages, facilitating processor recognition and processing. The voltage conversion includes converting to sine and cosine voltages.
[0069] S202. After data synchronization, the conversion voltages corresponding to multiple AMR sensors are normalized.
[0070] Specifically, data synchronization means that when acquiring data from multiple AMR sensors, the processor only processes the data after all AMR sensor acquisitions are completed; otherwise, it waits until all data acquisitions are finished. Normalization is used to map the measurement scales of multiple AMR sensors to the same scale. Because different AMR sensors may obtain different data when measuring the same magnetic field strength due to differences in performance, making calculations difficult, it is necessary to normalize the conversion voltages corresponding to multiple AMR sensors to make their measurement scales the same, facilitating calculations. For example, the measurement scales of multiple AMR sensors can be limited to the range of 0-1.
[0071] S203. Calculate the equivalent voltage value corresponding to the output voltage value of the AMR sensor according to the conversion voltage and equivalent voltage calculation formula of the AMR sensor.
[0072] Specifically, the equivalent voltage value can include an equivalent sinusoidal voltage value and an equivalent cosine voltage value. The equivalent sinusoidal voltage value is calculated based on the conversion voltage corresponding to each AMR sensor. The formula for calculating the equivalent sinusoidal voltage value is as follows:
[0073] U sin =U off,sin +f gain ·k MR (H0, T)·sin(2·θ) (1)
[0074] Among them, U sin U is the equivalent sinusoidal voltage corresponding to the magnetic field strength. off,sin f is the zero-point offset voltage of the equivalent sinusoidal voltage. gain ·k MR denoted as voltage amplification factor, H0 as magnetic field strength, T as time, and sin(2·θ) as the converted sinusoidal voltage at angle θ.
[0075] The equivalent cosine voltage value is calculated based on the conversion voltage corresponding to each AMR sensor. The formula for calculating the equivalent cosine voltage value is as follows:
[0076] U cos =U off,cos +f gain ·k MR (H0,T)·cos(2·θ) (2)
[0077] Among them, U cos U is the equivalent cosine voltage corresponding to the magnetic field strength. off,cos f is the zero-point offset voltage of the equivalent cosine voltage. gain ·k MR Here, H0 is the voltage amplification factor, T is the magnetic field strength, and cos(2·θ) is the converted cosine voltage at angle θ.
[0078] S204. Determine the angle between the corresponding AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor based on the equivalent voltage value.
[0079] S205. Determine the AMR sensor closest to the magnet based on the standard degree of the three largest sine and cosine sensors and the angle between them and the magnet.
[0080] S206. Determine the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the AMR sensor closest to the magnet and the magnet.
[0081] The technical solution of this embodiment uses an array of multiple AMR sensors to convert the magnetic field strength at different positions of the magnet into voltage output. Based on the equivalent voltage value corresponding to the output voltage, the angle value between the AMR sensor and the magnet and the corresponding standard degree of sine and cosine are calculated, and the AMR sensor closest to the magnet is determined. Since the magnet position and angle relationship exhibit a similar linear relationship within the -90° to 90° range at the center point of the AMR sensor, the absolute position of the magnet can be determined based on the absolute position of the AMR sensor and the angle value between the AMR sensor and the magnet. This enables precise positioning of the absolute position of the magnet in various motion scenarios such as rotation, straight lines, and curves, and the calculation method is simpler.
[0082] Figure 4 This is a flowchart of another absolute position calculation method based on an AMR sensor array provided by an embodiment of the present invention. Optionally, see [link to flowchart]. Figure 4 The method includes:
[0083] S301. Obtain the equivalent voltage value corresponding to the output voltage value of each AMR sensor.
[0084] S302. Determine the angle between the AMR sensor and the magnet based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the angle calculation formula.
[0085] Specifically, dividing the formula for calculating the equivalent sinusoidal voltage by the formula for calculating the equivalent cosine voltage yields the angle calculation formula. Based on this formula, the angle between each AMR sensor and the magnet can be determined. The simplified angle calculation formula is as follows:
[0086]
[0087] Where θ is the angle between the AMR sensor and the magnet, and the value of θ can range from -90° to 90°.
[0088] S303. Determine the standard degree of the sine and cosine of the AMR sensor based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the standard degree calculation formula of the sine and cosine.
[0089] Specifically, the standard degrees of the sine and cosine waves corresponding to each AMR sensor can be calculated based on the equivalent sinusoidal voltage value, the equivalent cosine voltage value, and the standard degree calculation formulas for sine and cosine waves. The standard degree calculation formulas for sine and cosine waves are as follows:
[0090]
[0091] Where r is the standard degree of sine and cosine.
[0092] S304, In the first clock cycle, the standard value of each sine and cosine is compared with the standard values of other sine and cosine, and a score is calculated based on the comparison results.
[0093] Specifically, a clock cycle is the time required for the processor to perform one calculation step. In the first clock cycle, the standard scores of the sine and cosines corresponding to each AMR sensor are compared with those of other AMR sensors, and a score is calculated based on the comparison result. If the comparison result is greater than, the score is 1; if the comparison result is less than, the score is 0; if the comparison result is equal to, the standard score of the logically ordered sine and cosine is 1. Logically ordered means the standard score of the sine and cosine that comes first in the number sequence. For example, if the value of logically ordered sensor 1 is 10, and the value of sensor 2 is also 10, then comparing sensor 1 and sensor 2, sensor 1 has the higher logical order and receives 1 point, while sensor 2 receives no points.
[0094] S305, the second clock cycle, sums the scores of the standard scores of the sine and cosines compared with the standard scores of the other sine and cosines to obtain the total score.
[0095] Specifically, in the second clock cycle, the scores of the standard scores of the sine and cosines are added together with the scores of the standard scores of the other sine and cosines to obtain the total score. For example, assuming there are four standard scores of sine and cosines R1, R2, R3, and R4, R1 is compared with R2, R3, and R4 respectively, and three scores are obtained. The three scores are added together to obtain the total score of R1; R2 is compared with R1, R3, and R4 respectively, and three scores are added together to obtain the total score of R2, and so on, to obtain the total score of each standard score of sine and cosines.
[0096] S306, In the third clock cycle, sort the standard scores of sine and cosine from largest to smallest, select the three largest standard scores of sine and cosine, and determine the AMR sensor corresponding to the three largest standard scores of sine and cosine and the angle value between it and the magnet.
[0097] Specifically, in the third clock cycle, the three largest sine and cosine standard scores are sorted from largest to smallest, and the AMR sensors corresponding to the three largest sine and cosine standard scores are determined, along with the angle values between the AMR sensors and the magnets.
[0098] S307. If the angle value corresponding to the AMR sensor numbered N is positive and the angle value corresponding to the AMR sensor numbered N+1 is negative, then the AMR sensor numbered N is the closest to the magnet; if the above conditions are not met, the judgment continues.
[0099] Specifically, the total number of AMR sensors is M, and the value of the number N ranges from 0 to N to M-3. If the angle value corresponding to AMR sensor numbered N is positive (i.e., the angle value corresponding to AMR sensor numbered N is 0° to 90°), and the angle value corresponding to AMR sensor numbered N+1 is negative (i.e., the angle value corresponding to AMR sensor numbered N+1 is -90° to 0°), then the AMR sensor closest to the magnet is numbered N. If the above conditions are not met, for example, if the angle value corresponding to AMR sensor numbered N is negative and the angle value corresponding to AMR sensor numbered N+1 is positive, then the next step of judgment is performed.
[0100] It should be noted that when N = M-2, in the above step S209, if the angle value corresponding to the AMR sensor numbered N is positive and the angle value corresponding to the AMR sensor numbered N+1 is negative, then the AMR sensor numbered N that is closest to the magnet is also applicable.
[0101] S308. If the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, and the angle value corresponding to the AMR sensor numbered N+2 is positive, then the AMR sensor closest to the magnet is numbered N+1; where the total number of AMR sensors is M, and the value range of the number N is 0≤N≤M-3.
[0102] Specifically, if the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, and the angle value corresponding to the AMR sensor numbered N+2 is positive; that is, the angle values corresponding to the AMR sensors numbered N+1 and N+2 are between 0° and 90°, and the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, then the AMR sensor closest to the magnet is numbered N+1.
[0103] S309. Determine the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the AMR sensor closest to the magnet and the magnet.
[0104] The technical solution of this embodiment uses an array of multiple AMR sensors to convert the magnetic field strength at different positions of the magnet into voltage output. Based on the equivalent voltage value corresponding to the output voltage, the angle value between the AMR sensor and the magnet and the corresponding standard degree of sine and cosine are calculated, and the AMR sensor closest to the magnet is determined. Since the magnet position and angle relationship exhibit a similar linear relationship within the -90° to 90° range at the center point of the AMR sensor, the absolute position of the magnet can be determined based on the absolute position of the AMR sensor and the angle value between the AMR sensor and the magnet. This enables precise positioning of the absolute position of the magnet in various motion scenarios such as rotation, straight lines, and curves, and the calculation method is simpler.
[0105] Figure 5 This is a flowchart of another method for calculating the absolute position based on an AMR sensor array provided in this embodiment of the invention. Figure 6 This is a schematic diagram of the structure of an AMR sensor array, see [link / reference]. Figure 6 In the AMR sensor array, the AMR sensors are arranged along a fixed direction, with spacing between adjacent AMR sensors; optionally, see [link to relevant documentation]. Figure 5 The method includes:
[0106] S401: Receive the conversion voltage corresponding to the output voltage value of each AMR sensor from the analog-to-digital conversion module. The conversion voltage is the AMR sensor output voltage value after being calibrated and amplified by the analog-to-digital conversion module.
[0107] S402. After data synchronization, the conversion voltages corresponding to multiple AMR sensors are normalized.
[0108] S403. Calculate the equivalent voltage value corresponding to the output voltage value of the AMR sensor according to the conversion voltage and equivalent voltage calculation formula of the AMR sensor.
[0109] S404. Determine the angle between the AMR sensor and the magnet based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the angle calculation formula.
[0110] S405. Determine the standard degree of the sine and cosine of the AMR sensor based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the standard degree calculation formula of the sine and cosine.
[0111] S406, In the first clock cycle, the standard value of each sine and cosine is compared with the standard values of other sine and cosine, and a score is calculated based on the comparison results.
[0112] S407, the second clock cycle, sums the scores of the standard scores of the sine and cosines compared with the standard scores of the other sine and cosines to obtain the total score.
[0113] S408, the third clock cycle: sort the sine and cosine standard scores from largest to smallest, select the three largest sine and cosine standard scores, and determine the AMR sensor corresponding to the three largest sine and cosine standard scores and the angle between it and the magnet.
[0114] S409. If the angle value corresponding to AMR sensor numbered N is positive and the angle value corresponding to AMR sensor numbered N+1 is negative, then the AMR sensor closest to the magnet is numbered N; if the above conditions are not met, the judgment continues.
[0115] S410. If the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, and the angle value corresponding to the AMR sensor numbered N+2 is positive, then the AMR sensor closest to the magnet is numbered N+1; where the total number of AMR sensors is M, and the value range of the number N is 0≤N≤M-3.
[0116] S411. Determine the absolute position of each AMR sensor based on the center-to-center distance between adjacent AMR sensors.
[0117] Specifically, the center-to-center spacing of the AMR sensors can be set according to measurement needs. For example, the center-to-center spacing of the AMR sensors can be set to 10mm. The absolute position of the AMR sensor can be: number × center-to-center spacing, that is, the absolute position of AMR sensor numbered 0 is 0mm, the absolute position of AMR sensor numbered 1 is 10mm, the absolute position of AMR sensor numbered 2 is 20mm, and so on to obtain the absolute position of all AMR sensors.
[0118] S412. Determine the absolute position of the AMR sensor based on the number of the AMR sensor closest to the magnet.
[0119] Specifically, the absolute position of the AMR sensor is determined based on the number of the AMR sensor closest to the magnet. For example, assuming the number of the AMR sensor closest to the magnet is 5, the absolute position of the AMR sensor is 50mm.
[0120] S413. Calculate the distance between the actual position of the magnet and the absolute position of the AMR sensor based on the angle between the AMR sensor closest to the magnet and the magnet.
[0121] Specifically, the distance between the actual position of the magnet and the absolute position of the AMR sensor is calculated based on the angle between the AMR sensor closest to the magnet and the magnet. For example, assuming the AMR sensor closest to the magnet is numbered 5, and the angle value corresponding to AMR sensor number 5 is -45°, the absolute position of the AMR sensor can be determined to be 50mm. Based on the relationship between angle and position, the distance between the actual position of the magnet and the absolute position of the AMR sensor can be calculated to be -2.5mm.
[0122] S414. Determine the absolute position of the magnet in space based on the distance between the actual position of the magnet and the absolute position of the AMR sensor, and the absolute position of the AMR sensor.
[0123] Specifically, the absolute position of the magnet in space is determined based on the distance between the actual position of the magnet and the absolute position of the AMR sensor, and the absolute position of the AMR sensor. For example, assuming the distance between the actual position of the magnet and the absolute position of the AMR sensor is -2.5mm, and the absolute position of the AMR sensor is 50mm, then the absolute position of the magnet in space is 50-2.5=47.5mm.
[0124] The technical solution of this embodiment uses an array of multiple AMR sensors to convert the magnetic field strength at different positions of the magnet into voltage output. Based on the equivalent voltage value corresponding to the output voltage, the angle between the AMR sensor and the magnet, and the corresponding standard degree of sine and cosine, are calculated. The AMR sensor closest to the magnet is then identified. Since the magnet's position and angle exhibit a near-linear relationship within the -90° to 90° range at the center point of the AMR sensor, the absolute position of the magnet can be determined based on the absolute position of the AMR sensor and the angle between the AMR sensor and the magnet. This enables precise positioning of the magnet's absolute position in various motion scenarios, including rotation, linear motion, and curvature, and the calculation method is simpler. Furthermore, this method achieves an absolute position positioning accuracy of 22 micrometers and a repeatability accuracy of 5.5 micrometers, meeting various accuracy requirements in practical applications.
[0125] This invention also provides an absolute position calculation device based on an AMR sensor array. Figure 7 This is a schematic diagram of the structure of an absolute position calculation device based on an AMR sensor array provided in an embodiment of the present invention. See also... Figure 7 The device includes:
[0126] Module 1 is used to acquire the equivalent voltage value corresponding to the output voltage value of each AMR sensor;
[0127] Calculation module 2 is used to determine the angle value between the corresponding AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor based on the equivalent voltage value.
[0128] Select module 3 is used to determine the AMR sensor closest to the magnet based on the AMR sensor corresponding to the three largest sine and cosine standard degrees and the angle value between it and the magnet.
[0129] The absolute position calculation module 4 is used to determine the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the AMR sensor closest to the magnet and the magnet.
[0130] The absolute position calculation device based on an AMR sensor array provided in this embodiment obtains the equivalent voltage value corresponding to the output voltage value of each AMR sensor through an acquisition module. The calculation module calculates the angle value between the AMR sensor and the magnet and the standard degree of the sine and cosine of the corresponding AMR sensor based on the equivalent voltage value. The selection module determines the AMR sensor closest to the magnet based on the standard degree of the sine and cosine. Since the magnet position and angle relationship exhibit a near-linear relationship within the -90° to 90° range of the AMR sensor center point, the absolute position calculation module can determine the absolute position of the magnet based on the absolute position of the AMR sensor and the angle value between the AMR sensor and the magnet. This enables accurate positioning of the absolute position of the magnet in various motion scenarios such as rotation, straight lines, and curves, and the calculation method is simpler.
[0131] Figure 8 This is a schematic diagram of the structure of an electronic device that implements the absolute position calculation method based on an AMR sensor array according to an embodiment of the present invention, as shown below. Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0132] The electronic device 10 also includes an analog-to-digital converter module, which is used to acquire the output voltage of each AMR sensor for calibration and amplification, and convert the output voltage value of each AMR sensor into a digital signal, that is, output the converted voltage to the processor.
[0133] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0134] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the absolute position calculation method based on an AMR sensor array.
[0135] In some embodiments, the absolute position calculation method based on an AMR sensor array can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the absolute position calculation method based on an AMR sensor array described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the absolute position calculation method based on an AMR sensor array by any other suitable means (e.g., by means of firmware).
[0136] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0137] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0138] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0139] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0140] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0141] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0142] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0143] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for calculating the absolute position based on an AMR sensor array, characterized in that, The AMR sensor array includes multiple AMR sensors, and the calculation method includes: Obtain the equivalent voltage value corresponding to the output voltage value of each of the AMR sensors; The angle between the AMR sensor and the magnet and the standard degree of the sine and cosine of the AMR sensor are determined based on the equivalent voltage value. The AMR sensor closest to the magnet is determined based on the AMR sensor corresponding to the three largest standard degrees of the sine and cosine and the angle value between it and the magnet. The absolute position of the magnet in space is determined based on the absolute position of the AMR sensor closest to the magnet and the angle between the AMR sensor closest to the magnet and the magnet. The AMR sensors in the AMR sensor array are arranged along a fixed direction, with spacing between adjacent AMR sensors. Determining the AMR sensor closest to the magnet based on the AMR sensor corresponding to the three largest sine and cosine standard degrees and its angle with the magnet includes: If the angle value corresponding to the AMR sensor numbered N is positive, and the angle value corresponding to the AMR sensor numbered N+1 is negative, then the AMR sensor closest to the magnet is numbered N; if the above conditions are not met, the judgment continues. If the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, and the angle value corresponding to the AMR sensor numbered N+2 is positive, then the AMR sensor closest to the magnet is numbered N+1. The total number of AMR sensors is M, and the range of their numbers is 0 ≤ N ≤ M - 3.
2. The calculation method according to claim 1, characterized in that, The process of obtaining the equivalent voltage value corresponding to the output voltage value of each of the AMR sensors includes: The module receives the conversion voltage corresponding to the output voltage values of each of the AMR sensors output by the analog-to-digital conversion module. The conversion voltage is the AMR sensor output voltage value after being calibrated and amplified by the analog-to-digital conversion module. After data synchronization, the conversion voltages corresponding to the multiple AMR sensors are normalized. The equivalent voltage value corresponding to the output voltage value of the AMR sensor is calculated according to the conversion voltage and equivalent voltage calculation formulas corresponding to the AMR sensor.
3. The calculation method according to claim 2, characterized in that, The step of calculating the equivalent voltage value corresponding to the AMR sensor output voltage value according to the conversion voltage and equivalent voltage calculation formula corresponding to the AMR sensor includes: Calculate the equivalent sinusoidal voltage value based on the converted voltage; The equivalent cosine voltage value is calculated based on the converted voltage.
4. The calculation method according to claim 1, characterized in that, The step of determining the angle value between the AMR sensor and the magnet and the standard degree of the sine and cosine of the AMR sensor based on the equivalent voltage value includes: The angle between the AMR sensor and the magnet is determined based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the angle calculation formula. The standard degree of the sine and cosine of the AMR sensor is determined based on the equivalent voltage value corresponding to the conversion voltage of the AMR sensor and the standard degree calculation formula of the sine and cosine.
5. The calculation method according to claim 1, characterized in that, Before determining the AMR sensor closest to the magnet based on the standard values of the three largest sine and cosine values corresponding to the AMR sensor and its angle with the magnet, the process includes: In the first clock cycle, the standard value of each of the sine and cosines is compared with the standard values of the other sine and cosines, and a score is calculated based on the comparison results; In the second clock cycle, the scores of the standard values of the sine and cosines compared with the standard values of the other sine and cosines are added together to obtain the total score; In the third clock cycle, the three largest standard scores of the sine and cosine are sorted from largest to smallest, and the AMR sensor and its angle with the magnet corresponding to the three largest standard scores are determined.
6. The calculation method according to claim 1, characterized in that, Before determining the absolute spatial position of the magnet based on the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet, the process includes: The absolute position of each AMR sensor is determined based on the center-to-center distance between adjacent AMR sensors.
7. The calculation method according to claim 1, characterized in that, The step of determining the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the closest AMR sensor and the magnet includes: The absolute position of the AMR sensor is determined based on the number of the AMR sensor closest to the magnet; The distance between the actual position of the magnet and the absolute position of the AMR sensor is calculated based on the angle between the AMR sensor closest to the magnet and the magnet. The absolute position of the magnet in space is determined by the distance between the actual position of the magnet and the absolute position of the AMR sensor, and the absolute position of the AMR sensor.
8. An absolute position calculation device based on an AMR sensor array, characterized in that, include: The acquisition module is used to acquire the equivalent voltage value corresponding to the output voltage value of each of the AMR sensors; The calculation module is used to determine the angle value between the AMR sensor and the magnet and the standard degree of the sine and cosine of the AMR sensor based on the equivalent voltage value. The selection module is used to determine the AMR sensor closest to the magnet based on the AMR sensor corresponding to the three largest standard degrees of the sine and cosine and the angle value between it and the magnet. An absolute position calculation module is used to determine the absolute position of the magnet in space based on the absolute position of the AMR sensor closest to the magnet and the angle between the AMR sensor closest to the magnet and the magnet. In this configuration, the AMR sensors in the AMR sensor array are arranged along a fixed direction, with a spacing between adjacent AMR sensors. The selection module is configured to determine the AMR sensor closest to the magnet as numbered N if the angle value corresponding to the AMR sensor numbered N is positive and the angle value corresponding to the AMR sensor numbered N+1 is negative. If the above conditions are not met, the selection process continues. If the angle value corresponding to the AMR sensor numbered N+1 is greater than the angle value corresponding to the AMR sensor numbered N+2, and the angle value corresponding to the AMR sensor numbered N+2 is positive, then the AMR sensor closest to the magnet is numbered N+1. The total number of AMR sensors is M, and the range of their numbers is 0 ≤ N ≤ M - 3.
9. An absolute position calculation device based on an AMR sensor array, characterized in that, The device includes: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
Citation Information
Patent Citations
AMR array magnetic design for improved sensor flexibility and improved air gap performance
CN102066965A