Correction method and device for magnetic encoder and magnetic encoder
By acquiring the system's operating temperature and using the mapping relationship for temperature compensation and angle correction, the problem of inaccurate angle measurement by the magnetic encoder under temperature changes is solved, achieving higher accuracy and stability.
Patent Information
- Application Number
- CN202211542902.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-12-02
AI Technical Summary
Magnetic encoders have poor angle measurement accuracy under temperature changes. Existing compensation measures have high requirements for the temperature coefficient and consistency of Hall sensors, which leads to inaccurate measurements.
By acquiring the system's operating temperature, temperature compensation is performed by matching the corresponding mapping relationship using the target relation library. Temperature and angle ranges are divided, multiple mapping relationships are established, and angle correction is carried out.
This improves the angle measurement accuracy and precision of the magnetic encoder at different temperatures, and reduces errors caused by temperature changes.
Smart Images

Figure CN115824032B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control technology, and in particular to a method, apparatus and magnetic encoder for calibration. Background Technology
[0002] Magnetic encoders derive rotational position information by detecting changes in magnetic fields, providing precise angle measurements. They are widely used in non-contact rotary position sensing, rotary switches, and brushless DC motor position control. Compared to optical encoders, magnetic encoders offer advantages such as strong environmental tolerance, small size, lightweight design, and high reliability, making them suitable for harsh environments with high levels of dust, oil, and water.
[0003] A magnetic encoder mainly consists of a Hall sensor, a magnetic code disk, a signal processing circuit, and a main structure. The output voltage of the Hall sensor is proportional to the magnetic field, and its output voltage varies significantly with temperature. This severely affects the detection accuracy of the magnetic encoder under varying temperature conditions, limiting its application range. Currently, constant current sources are generally used to compensate for the Hall sensor's temperature under corresponding temperature conditions. However, this method requires high precision in the Hall sensor's temperature coefficient and consistency, and it does not compensate for the magnets in the measurement system. Without compensation, accurate rotational position information cannot be obtained, resulting in poor angle measurement accuracy. Summary of the Invention
[0004] This invention provides a method, apparatus, and magnetic encoder for calibration, which addresses the shortcomings of existing magnetic encoders where temperature affects angle measurement accuracy.
[0005] This invention provides a method for calibrating a magnetic encoder, comprising:
[0006] After confirming that the target magnetic encoder is in operation, obtain the system operating temperature;
[0007] A first mapping relationship corresponding to the system's operating temperature is matched based on the target relational database;
[0008] Based on the first mapping relationship, temperature compensation is performed on the first rotation angle of the target magnetic encoder to determine the second rotation angle;
[0009] The target relation library corresponds to the target magnetic encoder; the first mapping relationship includes the correspondence between the actual value of the rotation angle and the measured value of the rotation angle within the system operating temperature range; the first rotation angle is the rotation angle collected by the target magnetic encoder at the system operating temperature; the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature.
[0010] According to a magnetic encoder calibration method provided by the present invention, after determining that the target magnetic encoder is in a working state and obtaining the system operating temperature, the method further includes:
[0011] If it is determined that the system operating temperature fails to match the target relational database, N temperature points are set within the system operating temperature range to obtain N+1 temperature intervals.
[0012] If the system operating temperature is determined to be within the target temperature range, a second mapping relationship corresponding to the target temperature range is determined.
[0013] Wherein, the target temperature range is one of the temperature ranges; N is a positive integer, and the larger the value of N, the closer the Hall potential output by the target magnetic encoder is to linear.
[0014] According to a magnetic encoder calibration method provided by the present invention, when the system operating temperature is determined to be within a target temperature range, a second mapping relationship corresponding to the target temperature range is determined, including:
[0015] M angle points are set within the rotation angle range corresponding to the target temperature range to obtain M+1 rotation angle ranges;
[0016] Based on the measured value of the target rotation angle and the actual value of the target rotation angle, the second mapping relationship corresponding to each of the rotation angle intervals is determined;
[0017] Wherein, the target rotation angle measurement value includes the rotation angle measurement values corresponding to the starting angle point and the ending angle point in the rotation angle interval, respectively; the target rotation angle actual value includes the rotation angle actual value corresponding to the starting angle point and the ending angle point in the rotation angle interval, respectively; M is a positive integer, and the larger the value of M, the closer the system operating temperature change of the target magnetic encoder is to linear.
[0018] According to a magnetic encoder calibration method provided by the present invention, the step of performing temperature compensation on a first rotation angle of the target magnetic encoder based on a first mapping relationship to determine a second rotation angle includes:
[0019] Based on the first mapping relationship and the first rotation angle, determine the angle compensation amount;
[0020] The second rotation angle is determined based on the first rotation angle and the angle compensation amount.
[0021] According to a magnetic encoder calibration method provided by the present invention, determining the angle compensation amount based on the first mapping relationship and the first rotation angle includes:
[0022] If it is determined that the first rotation angle is within the target rotation angle range, the target mapping relationship corresponding to the target rotation angle range is selected from the first mapping relationship;
[0023] The angle compensation amount is determined based on the first rotation angle and the target mapping relationship.
[0024] According to a magnetic encoder calibration method provided by the present invention, the first mapping relationship includes the second mapping relationship.
[0025] According to the magnetic encoder calibration method provided by the present invention, the second mapping relationship is obtained by formula (1):
[0026]
[0027] Where θ is the measured rotation angle within the rotation angle interval [θa, θ(a+1)]. Δθ is the angle compensation amount requiring temperature compensation at θ. θ(a) and θ(a+1) are the actual target rotation angle values corresponding to the rotation angle interval [θa, θ(a+1)]. Δθa is the difference between the measured target rotation angle value at θ(a) and the actual target rotation angle value. Δθ(a+1) is the difference between the measured target rotation angle value at θ(a+1) and the actual target rotation angle value.
[0028] The present invention also provides a calibration device for a magnetic encoder, comprising:
[0029] The temperature acquisition module is used to acquire the system operating temperature when it is determined that the target magnetic encoder is in working condition;
[0030] A temperature association module, connected to the temperature acquisition module, is used to match a first mapping relationship corresponding to the system operating temperature based on a target relational database;
[0031] A calibration module, connected to the temperature association module, is used to perform temperature compensation on the first rotation angle of the target magnetic encoder according to the first mapping relationship, so as to determine the second rotation angle;
[0032] The target relation library corresponds to the target magnetic encoder; the first mapping relationship includes the correspondence between the actual value of the rotation angle and the measured value of the rotation angle within the system operating temperature range; the first rotation angle is the rotation angle collected by the target magnetic encoder at the system operating temperature; the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature.
[0033] The present invention also provides a magnetic encoder, comprising a Hall sensor and a magnetic code disk arranged in a stacked manner from bottom to top along a central axis, and a signal processing circuit for signal processing, the signal processing circuit being used to perform the calibration method of the magnetic encoder as described in any of the preceding claims.
[0034] According to a magnetic encoder provided by the present invention, the Hall sensor is a switch-type Hall sensor.
[0035] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the correction method of the magnetic encoder as described above.
[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the correction method of the magnetic encoder as described above.
[0037] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the correction method of the magnetic encoder as described above.
[0038] The magnetic encoder calibration method, apparatus, and magnetic encoder provided by this invention, when directly calibrating based on system operating temperature, utilize a first mapping relationship corresponding to the system operating temperature to calibrate the first rotation angle obtained by measuring the target magnetic encoder, and output the calibrated second rotation angle as the angle measurement result. This mapping relationship can reduce the difference between the actual and measured values of the rotation angle at different operating temperatures, avoid errors caused by temperature throughout the measurement process, and improve the precision and accuracy of angle measurement. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating the calibration method for the magnetic encoder provided by the present invention;
[0041] Figure 2 This is a partial flowchart of the first method for correcting a magnetic encoder provided by the present invention.
[0042] Figure 3 This is a schematic diagram of the second part of the calibration method for a magnetic encoder provided by the present invention;
[0043] Figure 4 This is a schematic diagram of the third part of the calibration method for the magnetic encoder provided by the present invention.
[0044] Figure 5 This is a schematic diagram of the third part of the calibration method for the magnetic encoder provided by the present invention.
[0045] Figure 6 This is a schematic diagram illustrating the principle of the magnetic encoder calibration method provided by the present invention;
[0046] Figure 7 This is a schematic diagram of the structure of the magnetic encoder calibration device provided by the present invention;
[0047] Figure 8 This is a schematic diagram of the magnetic encoder provided by the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0049] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more.
[0050] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” are intended to include the plural forms.
[0051] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0052] Figure 1 This is a schematic flowchart of the magnetic encoder calibration method provided by the present invention. Figure 1As shown, the magnetic encoder calibration method provided in this embodiment of the invention includes: step 101, obtaining the system operating temperature when it is determined that the target magnetic encoder is in a working state.
[0053] It should be noted that the execution subject of the magnetic encoder calibration method provided in this embodiment of the invention is the magnetic encoder calibration device disposed in the magnetic encoder.
[0054] The application scenario of the magnetic encoder calibration method provided in this application embodiment is that after the magnetic encoder measurement system starts working, the angle position is compensated according to the temperature change of both the magnetic encoder and the magnetic field, so that the magnetic encoder outputs a precise rotation angle.
[0055] Specifically, in step 101, when the magnetic encoder calibration device determines that the target magnetic encoder is in working condition, it can receive the system operating temperature inside the entire encoder in real time, which is collected by the temperature sensor built into the target magnetic encoder during the operation of the magnetic encoder.
[0056] Step 102: Match the first mapping relationship corresponding to the operating temperature of the system according to the target relation library.
[0057] The target relation library corresponds to the target magnetic encoder. The first mapping relationship includes the correspondence between the actual rotation angle value and the measured rotation angle value within the system's operating temperature range.
[0058] It should be noted that the relational database is a mapping relationship that includes the magnetic encoders that have undergone temperature compensation via the magnetic encoder's calibration device when calibrating for different operating temperatures. Each magnetic encoder's relational database is uniquely identified by its corresponding encoder's identification information.
[0059] Therefore, before step 102, the identification information of the target magnetic encoder can be used to query and filter out the target relational database corresponding to the target magnetic encoder from the relational database.
[0060] Specifically, in step 102, the magnetic encoder calibration device uses the system operating temperature obtained in step 101 as retrieval information to perform a query and match in the target relational database, and the result is divided into two types: successful match and failed match.
[0061] A successful match indicates that the current system operating temperature matches the information stored in the target relation library. This means that the magnetic encoder calibration device has performed a calibration task with the same device type and operating temperature as the target magnetic encoder. In the corresponding historical calibration task, the rotation angle measurement value at that operating temperature was calibrated according to the corresponding first mapping relationship, and the output angle data was close to the actual rotation angle value. Therefore, the first mapping relationship corresponding to the historical calibration task can be extracted from the target relation library.
[0062] A matching failure occurs when the current system operating temperature cannot be matched with any information in the locally stored target relation library. This indicates that the magnetic encoder's calibration device has not yet compensated for similar temperatures. It is necessary to first perform a calibration procedure to obtain the corresponding first mapping relationship, and then carry out temperature compensation work based on the obtained mapping relationship.
[0063] Step 103: Based on the first mapping relationship, perform temperature compensation on the first rotation angle of the target magnetic encoder to determine the second rotation angle.
[0064] Wherein, the first rotation angle is the rotation angle acquired by the target magnetic encoder at the system operating temperature. The second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature.
[0065] Specifically, in step 103, the magnetic encoder correction device uses the mapping relationship matched in step 102 to correct the first rotation angle measured by the current system operating temperature, and then corrects it to a second rotation angle that is close to or equal to the actual value of the rotation angle, which is then output by the target magnetic encoder.
[0066] In this embodiment of the invention, when direct correction is performed based on the system operating temperature, the first rotation angle obtained by measuring the target magnetic encoder is corrected using a first mapping relationship corresponding to the system operating temperature. The corrected second rotation angle is then output as the angle measurement result. This mapping relationship can reduce the difference between the actual and measured values of the rotation angle at different operating temperatures, avoid errors caused by temperature throughout the measurement process, and improve the precision and accuracy of angle measurement.
[0067] Figure 2 This is a partial flowchart of the first method for correcting a magnetic encoder provided by the present invention. Figure 2As shown, based on any of the above embodiments, after obtaining the system operating temperature when it is determined that the target magnetic encoder is in a working state, the method further includes: step 201, in the case that it is determined that the system operating temperature fails to match the target relational library, setting N temperature points within the system operating temperature range to obtain N+1 temperature intervals.
[0068] Wherein, N is a positive integer, and the larger the value of N, the closer the Hall potential output by the target magnetic encoder is to linear.
[0069] Specifically, after step 101, the magnetic encoder calibration device uses the system operating temperature of the target magnetic encoder obtained in step 101 as retrieval information to perform a query and match in the target relational database. When it is determined that the query result is a match failure, it enters the calibration procedure in step 201 and uses N temperature points to divide the system operating temperature range of the target magnetic encoder into N+1 temperature intervals.
[0070] Wherein, N is a positive integer greater than or equal to 0. This embodiment of the invention does not impose a specific limit on the number N of temperature points.
[0071] Preferably, the larger the value of N, the finer the division of the system operating temperature range of the target magnetic encoder. While covering as many operating temperatures as possible, it also allows the change trend of the Hall potential at the output of the target magnetic encoder to approach linear change. The relationship between the Hall potential at the output of the target magnetic encoder and the system operating temperature is expressed as follows:
[0072] E H =K(0)Iβ(1-β) H T)
[0073] Among them, E H Let K(0)(1-β) be the Hall potential output by the target magnetic encoder. H T) is the Hall sensitivity, I is the constant current of the target magnetic encoder, and T is the system operating temperature of the target magnetic encoder.
[0074] It can be seen that, since the temperature difference between the operating temperatures of adjacent systems is very small, the Hall potential at the output of the target magnetic encoder will be closer to linear when the temperature change is relatively small.
[0075] Step 202: If the system operating temperature is determined to be within the target temperature range, determine the second mapping relationship corresponding to the target temperature range.
[0076] The target temperature range is one of the temperature ranges.
[0077] Specifically, in step 202, the magnetic encoder calibration device uses the system operating temperature of the target magnetic encoder to query the predefined temperature range, takes the current system operating temperature range as the target temperature range, and outputs the correspondence between the actual value of the rotation angle and the measured value of the rotation angle within the rotation angle range corresponding to the target temperature range as the corresponding second mapping relationship.
[0078] In this embodiment of the invention, when the system operating temperature is not directly used for correction, the system operating temperature range is divided into multiple temperature intervals by setting multiple temperature points. When the system operating temperature corresponding to the target magnetic encoder matches the target temperature interval, a second mapping relationship corresponding to that target temperature interval is established. Then, the first rotation angle obtained by measuring the target magnetic encoder is corrected using the second mapping relationship, and the corrected rotation angle is output as the angle measurement result. This refinement of the temperature range ensures relatively stable measurement errors, allowing for segmented correction of angle errors and achieving stable temperature compensation.
[0079] Figure 3 This is a schematic diagram of the second part of the calibration method for the magnetic encoder provided by the present invention. For example... Figure 3 As shown, based on any of the above embodiments, the part of the process corresponding to step 202, that is, when it is determined that the system operating temperature is within the target temperature range, determines the second mapping relationship corresponding to the target temperature range, includes: step 301, setting M angle points within the rotation angle range corresponding to the target temperature range to obtain M+1 rotation angle ranges.
[0080] Wherein, M is a positive integer, and the larger the value of M, the closer the system operating temperature change of the target magnetic encoder is to linear.
[0081] It should be noted that the rotation angle range corresponding to each temperature range is between 0° and 360°.
[0082] Specifically, in step 301, the magnetic encoder calibration device uses M angle points to divide the rotation angle range corresponding to the target temperature range where the system operating temperature of the target magnetic encoder is located into M+1 rotation angle ranges.
[0083] Where M is a positive integer greater than or equal to 0. This embodiment of the invention does not impose a specific limit on the number M of angle points.
[0084] Preferably, the larger the value of M, the finer the division of the rotation angle range corresponding to any temperature range of the target magnetic encoder. While covering as many rotation angles as possible, the smaller the angle change, the closer the temperature compensation result is to linear.
[0085] Step 302: Based on the measured value of the target rotation angle and the actual value of the target rotation angle, determine the first mapping relationship corresponding to each of the rotation angle intervals.
[0086] The target rotation angle measurement value includes the rotation angle measurement values corresponding to the starting angle point and the ending angle point in the rotation angle interval, respectively; the target rotation angle actual value includes the rotation angle actual value corresponding to the starting angle point and the ending angle point in the rotation angle interval, respectively.
[0087] It should be noted that the target rotation angle measurement includes the rotation angle measurement corresponding to the starting angle point θ(a) in any rotation angle interval [θa, θ(a+1)], and the rotation angle measurement corresponding to the ending angle point θ(a+1).
[0088] The actual value of the target rotation angle includes the actual value of the rotation angle θ(a) of the starting angle point in any rotation angle interval [θa, θ(a+1)], and the actual value of the rotation angle θ(a+1) of the ending angle point.
[0089] Specifically, in step 302, the magnetic encoder calibration device establishes a second mapping relationship corresponding to any rotation angle interval by using the measured value of the target rotation angle and the actual value of the target rotation angle corresponding to any rotation angle interval.
[0090] In this embodiment of the invention, when the system operating temperature corresponding to the target magnetic encoder matches the target temperature range, the rotation angle range corresponding to the target temperature range is divided into multiple rotation angle intervals by setting multiple angle points. A second mapping relationship is established using the measured value of the target rotation angle and the actual value of the target rotation angle corresponding to each rotation angle interval. Furthermore, the mapping relationship is used to correct the first rotation angle obtained by measuring the target magnetic encoder, so that the corrected second rotation angle is output as the angle measurement result. This refinement of the rotation angle range ensures relatively stable measurement errors, allowing for segmented correction of angle errors and achieving stable temperature compensation.
[0091] Figure 4 This is a schematic diagram of the third part of the calibration method for the magnetic encoder provided by the present invention. For example... Figure 4 As shown, based on any of the above embodiments, the part of the process corresponding to step 103, namely, performing temperature compensation on the first rotation angle of the target magnetic encoder based on the first mapping relationship to determine the second rotation angle, includes: determining the angle compensation amount based on the first mapping relationship and the first rotation angle.
[0092] Specifically, in step 401, the magnetic encoder correction device substitutes the first rotation angle measured at the current system operating temperature into the obtained mapping relationship to calculate the angle compensation amount corresponding to the current system operating temperature.
[0093] Step 402: Determine the second rotation angle based on the first rotation angle and the angle compensation amount.
[0094] Specifically, in step 402, the magnetic encoder correction device subtracts the calculated angle compensation amount from the first rotation angle to calculate a second rotation angle that is close to or the same as the actual value of the rotation angle.
[0095] This invention, based on the first rotation angle obtained by measuring the target magnetic encoder, calculates and outputs a temperature-compensated second rotation angle using an angle compensation amount corresponding to the system's operating temperature. This achieves corresponding compensation for the rotation angle affected by temperature changes in the magnetic encoder and magnetic field, improving the precision and accuracy of angle measurement.
[0096] Figure 5 This is a schematic diagram of the third part of the calibration method for the magnetic encoder provided by the present invention. For example... Figure 5 As shown, based on any of the above embodiments, the part of the process corresponding to step 401, namely, determining the angle compensation amount based on the first mapping relationship and the first rotation angle, includes: step 501, when it is determined that the first rotation angle is within the target rotation angle range, filtering out the target mapping relationship corresponding to the target rotation angle range from the first mapping relationship.
[0097] Specifically, in step 501, the magnetic encoder calibration device uses the first rotation angle to query the predefined rotation angle interval, takes the rotation angle interval where the currently measured first rotation angle is located as the target rotation angle interval, and selects a set of target mapping relationships corresponding to the target rotation angle interval from multiple sets of mapping relationships that integrate multiple rotation angle intervals.
[0098] Step 502: Determine the angle compensation amount based on the first rotation angle and the target mapping relationship.
[0099] Specifically, in step 502, the magnetic encoder correction device substitutes the first rotation angle into the derived target mapping relationship and calculates the angle compensation amount corresponding to the temperature compensation of the measured rotation angle under the current system operating temperature.
[0100] In this embodiment of the invention, when matching a first rotation angle to a target rotation angle range, a target mapping relationship corresponding to the target rotation angle range is selected from the first mapping relationships corresponding to multiple ranges. Then, the first rotation angle obtained by measuring the target magnetic encoder is corrected using the target mapping relationship, and the corrected second rotation angle is output as the angle measurement result. By refining the temperature range, the measurement error can be kept relatively stable, and the angle error can be corrected in segments, achieving stable temperature compensation.
[0101] Based on any of the above embodiments, the first mapping relationship includes the second mapping relationship.
[0102] Specifically, the first mapping relationship maintained in real time in the target relational database by the magnetic encoder correction device can also be obtained by constructing a second mapping relationship.
[0103] This invention can directly divide the system operating temperature range into multiple temperature intervals by setting multiple temperature points. When the system operating temperature corresponding to the target magnetic encoder matches the target temperature interval, a mapping relationship corresponding to the target temperature interval is established as the first mapping relationship acquisition method, and the stored target relationship library is updated. Then, the first rotation angle obtained by measuring the target magnetic encoder is corrected using the mapping relationship, and the corrected rotation angle is output as the angle measurement result. By refining the temperature range, the measurement error can be kept relatively stable, and the angle error can be corrected in segments, achieving stable temperature compensation.
[0104] Based on any of the above embodiments, the second mapping relationship is obtained through formula (1):
[0105]
[0106] Where θ is the measured rotation angle within the rotation angle interval [θa, θ(a+1)]. Δθ is the angle compensation amount requiring temperature compensation at θ. θ(a) and θ(a+1) are the actual target rotation angle values corresponding to the rotation angle interval [θa, θ(a+1)]. Δθa is the difference between the measured target rotation angle value at θ(a) and the actual target rotation angle value. Δθ(a+1) is the difference between the measured target rotation angle value at θ(a+1) and the actual target rotation angle value.
[0107] Specifically, after determining the first rotation angle θ, the correction device of the magnetic encoder can perform the following calculation using the second mapping relationship corresponding to the rotation angle interval [θa, θ(a+1)] where θ is located:
[0108]
[0109] Where θ is the measured rotation angle within the rotation angle interval [θa, θ(a+1)]. Δθ is the angle compensation amount requiring temperature compensation at θ. θ(a) and θ(a+1) are the actual target rotation angle values corresponding to the rotation angle interval [θa, θ(a+1)]. Δθa is the difference between the measured target rotation angle value at θ(a) and the actual target rotation angle value. Δθ(a+1) is the difference between the measured target rotation angle value at θ(a+1) and the actual target rotation angle value.
[0110] Figure 6 This is a schematic diagram illustrating the principle of the magnetic encoder calibration method provided by this invention. Figure 2 As shown, multiple rotation angle intervals are divided within the rotation angle range (0°-360°) corresponding to each angle point on the X-axis, and the first and second rotation angles are indicated by the angle information on the Y-axis. Taking this as an example, the specific implementation process of temperature compensation through angle compensation is as follows:
[0111] When the first rotation angle θ on the solid line is determined to be in the range [θ0, θ1], the angle compensation amount Δθ is calculated according to the above formula:
[0112]
[0113] Subtracting the angle compensation amount Δθ from the first rotation angle θ yields the second rotation angle θ′, and its calculation formula is shown below:
[0114] θ′=θ-Δθ
[0115] The second rotation angle θ′ lies within the dashed lines, exhibiting a linear relationship of Y=X, ensuring that the output second rotation angle is equal to the measured rotation angle value.
[0116] This invention constructs a second mapping relationship, so that the correction process of each rotation angle measurement value in the corresponding interval is associated with the previous interval, thereby realizing segmented correction of multiple rotation angle intervals to different degrees and achieving the accuracy and stability of temperature compensation.
[0117] Figure 7 This is a schematic diagram of the structure of the magnetic encoder calibration device provided by the present invention. Based on any of the above embodiments, such as... Figure 7 As shown, the device includes: a temperature acquisition module 710, a temperature correlation module 720, and a calibration module 730, wherein:
[0118] The temperature acquisition module 710 is used to acquire the system operating temperature when it is determined that the target magnetic encoder is in working condition.
[0119] The temperature association module 720 is connected to the temperature acquisition module 710 and is used to match the first mapping relationship corresponding to the system operating temperature according to the target relationship library.
[0120] The calibration module 730, connected to the temperature association module 720, is used to perform temperature compensation on the first rotation angle of the target magnetic encoder according to the first mapping relationship, so as to determine the second rotation angle.
[0121] The target relational database corresponds to the target magnetic encoder. The first mapping relationship includes the correspondence between the actual rotation angle value and the measured rotation angle value within the system's operating temperature range. The first rotation angle is the rotation angle acquired by the target magnetic encoder at the system's operating temperature. The second rotation angle is the rotation angle output by the target magnetic encoder at the system's operating temperature.
[0122] Specifically, the temperature acquisition module 710, the temperature correlation module 720, and the calibration module 730 are electrically connected in sequence.
[0123] When the temperature acquisition module 710 determines that the target magnetic encoder is in working condition, it can receive the system operating temperature inside the entire encoder in real time, which is collected by the temperature sensor built into the target magnetic encoder during the operation of the magnetic encoder.
[0124] The temperature association module 720 uses the system operating temperature obtained in the temperature acquisition module 710 as retrieval information to perform a query and match in the target relational database. The results are divided into two types: successful match and failed match.
[0125] A successful match indicates that the current system operating temperature matches the information stored in the target relation library. This means that the magnetic encoder calibration device has performed a calibration task with the same device type and operating temperature as the target magnetic encoder. In the corresponding historical calibration task, the rotation angle measurement value at that operating temperature was calibrated according to the corresponding first mapping relationship, and the output angle data was close to the actual rotation angle value. Therefore, the first mapping relationship corresponding to the historical calibration task can be extracted from the target relation library.
[0126] The correction module 730 uses the mapping relationship matched by the temperature correlation module 720 to correct the first rotation angle measured by the current system operating temperature, and then corrects it to a second rotation angle that is close to or equal to the actual value of the rotation angle before outputting it by the target magnetic encoder.
[0127] Optionally, the device further includes a temperature partitioning module and a mapping relationship establishment module, wherein:
[0128] The temperature division module is used to set N temperature points within the system's operating temperature range to obtain N+1 temperature intervals when it is determined that the system's operating temperature fails to match the target relational database.
[0129] The mapping relationship establishment module is used to determine a second mapping relationship corresponding to the target temperature range when the system operating temperature is determined to be within the target temperature range.
[0130] The target temperature range is one of the temperature ranges. N is a positive integer, and the larger the value of N, the closer the Hall potential output by the target magnetic encoder is to linear.
[0131] Optionally, the mapping relationship establishment module includes an angle division unit and a mapping relationship establishment unit, wherein:
[0132] An angle division unit is used to set M angle points within the rotation angle range corresponding to the target temperature range, resulting in M+1 rotation angle ranges.
[0133] The mapping relationship establishment unit is used to determine the second mapping relationship corresponding to each of the rotation angle intervals based on the measured value of the target rotation angle and the actual value of the target rotation angle.
[0134] The target rotation angle measurement value includes the rotation angle measurement values corresponding to the starting angle point and the ending angle point within the rotation angle interval. The actual target rotation angle value includes the actual rotation angle values corresponding to the starting angle point and the ending angle point within the rotation angle interval. M is a positive integer, and the larger the value of M, the closer the system operating temperature change of the target magnetic encoder is to linear.
[0135] Optionally, the correction module 730 includes a compensation determination unit and a correction unit, wherein:
[0136] The compensation determination unit is used to determine the angle compensation amount based on the first mapping relationship and the first rotation angle.
[0137] A correction unit is used to determine the second rotation angle based on the first rotation angle and the angle compensation amount.
[0138] Optionally, the compensation determination unit includes a mapping relationship filtering subunit and a compensation determination subunit, wherein:
[0139] The mapping relationship filtering subunit is used to filter out the target mapping relationship corresponding to the target rotation angle range from the first mapping relationship when it is determined that the first rotation angle is within the target rotation angle range.
[0140] The compensation determination subunit is used to determine the angle compensation amount based on the first rotation angle and the target mapping relationship.
[0141] Optionally, the first mapping relationship includes the second mapping relationship.
[0142] Optionally, the second mapping relationship is obtained through formula (1):
[0143]
[0144] Where θ is the measured rotation angle within the rotation angle interval [θa, θ(a+1)]. Δθ is the angle compensation amount requiring temperature compensation at θ. θ(a) and θ(a+1) are the actual target rotation angle values corresponding to the rotation angle interval [θa, θ(a+1)]. Δθa is the difference between the measured target rotation angle value at θ(a) and the actual target rotation angle value. Δθ(a+1) is the difference between the measured target rotation angle value at θ(a+1) and the actual target rotation angle value.
[0145] The magnetic encoder calibration device provided in this embodiment of the invention is used to execute the magnetic encoder calibration method of the present invention. Its implementation method is the same as that of the magnetic encoder calibration method provided in this invention, and it can achieve the same beneficial effects. It will not be described again here.
[0146] In this embodiment of the invention, when direct correction is performed based on the system operating temperature, the first rotation angle obtained by measuring the target magnetic encoder is corrected using a first mapping relationship corresponding to the system operating temperature. The corrected second rotation angle is then output as the angle measurement result. This mapping relationship can reduce the difference between the actual and measured values of the rotation angle at different operating temperatures, avoid errors caused by temperature throughout the measurement process, and improve the precision and accuracy of angle measurement.
[0147] Figure 8 This is a schematic diagram of the magnetic encoder provided by the present invention. Based on any of the above embodiments, such as... Figure 8 As shown, the magnetic encoder includes a Hall sensor 810 and a magnetic code disk 820 arranged on the same central axis and stacked from bottom to top, as well as a signal processing circuit 830 (810, 820, 830) for signal processing. The signal processing circuit 830 is used to perform the correction method of the magnetic encoder as described in any of the above.
[0148] Specifically, the magnetic encoder consists of a Hall sensor 810, a magnetic code disk 820, and a signal processing circuit 830. The magnetic encoder can detect the rotation angle of the shaft being measured. Based on this rotation angle, it can calculate the position and speed of the object connected to the shaft (e.g., the shaft of a motor). When measuring the rotation angle, the Hall sensor 810, along with the rotation of the magnetic code disk 820, outputs two sinusoidal voltage signals with a 90° phase difference. The sinusoidal signal leading by 90° is designated as a sin signal, and the sinusoidal signal lagging by 90° is designated as a cos signal. These two voltage signals are then converted from analog to digital to obtain digital signals. The angle value of the encoder's magnetic code disk 820 (i.e., the shaft being measured) is then decoded from the two digital signals, and this angle value is corrected. Wherein:
[0149] The Hall sensor 810 is used to convert a changing magnetic field into a change in output voltage.
[0150] The magnetic code disk 820 refers to a digital encoder for measuring angular displacement. The magnetic code disk 820 can receive the second rotation angle output by the signal processing circuit 830 and display the measured angle at the front end.
[0151] The signal processing circuit 830 is an integrated circuit containing a calibration device for a magnetic encoder. It can use the temperature of the operating environment of the Hall sensor 810 and other magnetic sensing elements within the magnetic encoder as the system operating temperature of the entire measurement system, and perform temperature compensation on the resulting system operating temperature. This corrects the first rotation angle measured under this temperature to a second rotation angle. Temperature compensation can be applied to the entire measurement system, not just the Hall element itself.
[0152] In this embodiment of the invention, when direct correction is performed based on the system operating temperature, the first rotation angle obtained by measuring the target magnetic encoder is corrected using a first mapping relationship corresponding to the system operating temperature. The corrected second rotation angle is then output as the angle measurement result. This mapping relationship can reduce the difference between the actual and measured values of the rotation angle at different operating temperatures, avoid errors caused by temperature throughout the measurement process, and improve the precision and accuracy of angle measurement.
[0153] Based on any of the above embodiments, the Hall sensor 810 is a switch-type Hall sensor.
[0154] Specifically, the Hall sensor 810 can be a switching Hall sensor consisting of a voltage regulator, Hall element, differential amplifier, Schmitt trigger, and output stage. This type of sensor can output a digital value, enabling temperature compensation for magnetic encoders and magnetic fields, entirely based on digital circuitry and independent of analog circuitry.
[0155] This invention utilizes digital signals acquired by a switch-type Hall effect sensor to perform subsequent arithmetic and logical operations. It is applicable to all stages of magnetic encoder design and analysis. Even with simple design techniques and low cost, the digital circuitry can provide good accuracy and precision, improving the fineness and accuracy of angle measurements.
[0156] On the other hand, the present invention also provides an electronic device, which may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The processor can call logical instructions in the memory to execute a magnetic encoder calibration method, the method comprising: acquiring the system operating temperature when it is determined that the target magnetic encoder is in an operating state; matching a first mapping relationship corresponding to the system operating temperature according to a target relation library; and performing temperature compensation on a first rotation angle of the target magnetic encoder based on the first mapping relationship to determine a second rotation angle; wherein the target relation library corresponds to the target magnetic encoder; the first mapping relationship includes the correspondence between actual rotation angle values and measured rotation angle values within the system operating temperature range; the first rotation angle is the rotation angle acquired by the target magnetic encoder at the system operating temperature; and the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature.
[0157] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the magnetic encoder calibration method provided by the above methods. The method includes: obtaining the system operating temperature when it is determined that the target magnetic encoder is in a working state; matching a first mapping relationship corresponding to the system operating temperature according to a target relation library; and performing temperature compensation on a first rotation angle of the target magnetic encoder based on the first mapping relationship to determine a second rotation angle; wherein the target relation library corresponds to the target magnetic encoder; the first mapping relationship includes the correspondence between the actual value of the rotation angle and the measured value of the rotation angle within the system operating temperature range; the first rotation angle is the rotation angle collected by the target magnetic encoder at the system operating temperature; and the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature.
[0159] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for correcting a magnetic encoder provided by the methods described above. This method includes: when it is determined that a target magnetic encoder is in a working state, acquiring the system operating temperature; matching a first mapping relationship corresponding to the system operating temperature according to a target relation library; and performing temperature compensation on a first rotation angle of the target magnetic encoder based on the first mapping relationship to determine a second rotation angle; wherein the target relation library corresponds to the target magnetic encoder; the first mapping relationship includes a correspondence between actual rotation angle values and measured rotation angle values within the system operating temperature range; the first rotation angle is the rotation angle acquired by the target magnetic encoder at the system operating temperature; and the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature.
[0160] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A calibration method for a magnetic encoder, characterized in that, include: After confirming that the target magnetic encoder is in operation, obtain the system operating temperature; A first mapping relationship corresponding to the system's operating temperature is matched based on the target relational database; Based on the first mapping relationship, temperature compensation is performed on the first rotation angle of the target magnetic encoder to determine the second rotation angle; The target relation library corresponds to the target magnetic encoder; the first mapping relationship includes the correspondence between the actual value and the measured value of the rotation angle within the system operating temperature range; the first rotation angle is the rotation angle collected by the target magnetic encoder at the system operating temperature; the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature. If the system operating temperature fails to match the target relational database, N temperature points are set within the system operating temperature range to obtain N+1 temperature intervals. If the system operating temperature is within the target temperature interval, M angle points are set within the rotation angle range corresponding to the target temperature interval to obtain M+1 rotation angle intervals. Based on the target rotation angle measurement value and the target rotation angle actual value, a second mapping relationship is determined corresponding to each of the rotation angle intervals. The target temperature interval is one of the temperature intervals. The target rotation angle measurement value includes the rotation angle measurement values corresponding to the start angle point and the end angle point in the rotation angle interval, respectively. The target rotation angle actual value includes the rotation angle actual values corresponding to the start angle point and the end angle point in the rotation angle interval, respectively. N is a positive integer, and M is a positive integer. The second mapping relationship is used to correct the first rotation angle.
2. The calibration method for a magnetic encoder according to claim 1, characterized in that, Furthermore, the larger the value of N, the closer the Hall potential output by the target magnetic encoder is to linear.
3. The calibration method for a magnetic encoder according to claim 2, characterized in that, Furthermore, the larger the value of M, the closer the system operating temperature change of the target magnetic encoder is to linear.
4. The calibration method for a magnetic encoder according to any one of claims 1, characterized in that, The step of performing temperature compensation on the first rotation angle of the target magnetic encoder based on the first mapping relationship to determine the second rotation angle includes: Based on the first mapping relationship and the first rotation angle, determine the angle compensation amount; The second rotation angle is determined based on the first rotation angle and the angle compensation amount.
5. The calibration method for a magnetic encoder according to claim 4, characterized in that, The step of determining the angle compensation amount based on the first mapping relationship and the first rotation angle includes: If it is determined that the first rotation angle is within the target rotation angle range, the target mapping relationship corresponding to the target rotation angle range is selected from the first mapping relationship; The angle compensation amount is determined based on the first rotation angle and the target mapping relationship.
6. The calibration method for a magnetic encoder according to claim 4 or 5, characterized in that, The first mapping relationship includes the second mapping relationship.
7. The calibration method for a magnetic encoder according to claim 6, characterized in that, The second mapping relationship is obtained through formula (1): Wherein, θ is the measured value of the rotation angle within the rotation angle interval [θa, θ(a+1)], Δθ is the angle compensation amount that needs to be compensated for temperature at θ, θ(a) and θ(a+1) are the actual values of the target rotation angle corresponding to the rotation angle interval [θa, θ(a+1)], Δθa is the difference between the measured value of the target rotation angle at θ(a) and the actual value of the target rotation angle, and Δθ(a+1) is the difference between the measured value of the target rotation angle at θ(a+1) and the actual value of the target rotation angle.
8. A calibration device for a magnetic encoder, characterized in that, include: The temperature acquisition module is used to acquire the system operating temperature when it is determined that the target magnetic encoder is in working condition; A temperature association module, connected to the temperature acquisition module, is used to match a first mapping relationship corresponding to the system operating temperature based on a target relational database; A calibration module, connected to the temperature association module, is used to perform temperature compensation on the first rotation angle of the target magnetic encoder according to the first mapping relationship, so as to determine the second rotation angle; The target relation library corresponds to the target magnetic encoder; the first mapping relationship includes the correspondence between the actual value and the measured value of the rotation angle within the system operating temperature range; the first rotation angle is the rotation angle collected by the target magnetic encoder at the system operating temperature; the second rotation angle is the rotation angle output by the target magnetic encoder at the system operating temperature. The temperature division module is used to set N temperature points within the system's operating temperature range to obtain N+1 temperature intervals when it is determined that the system's operating temperature fails to match the target relational database. The mapping relationship establishment module is used to, when the system operating temperature is determined to be within a target temperature range, set M angle points within the rotation angle range corresponding to the target temperature range to obtain M+1 rotation angle ranges; based on the measured value of the target rotation angle and the actual value of the target rotation angle, determine a second mapping relationship corresponding to each of the rotation angle ranges; the target temperature range is one of the temperature ranges; the measured value of the target rotation angle includes the measured values of the rotation angles corresponding to the starting angle point and the ending angle point in the rotation angle range; the actual value of the target rotation angle includes the actual values of the rotation angles corresponding to the starting angle point and the ending angle point in the rotation angle range; N is a positive integer, and M is a positive integer; the second mapping relationship is used to correct the first rotation angle.
9. A magnetic encoder, comprising Hall sensors and magnetic code disks stacked on a central axis from bottom to top, and a signal processing circuit for signal processing, characterized in that, The signal processing circuit is used to perform the correction method of the magnetic encoder as described in any one of claims 1 to 7.
10. The magnetic encoder according to claim 9, characterized in that, The Hall sensor is a switch-type Hall sensor.
Citation Information
Patent Citations
Two Hall magnetoelectric encoders and angle value temperature drift compensation method thereof
CN112067023A
Low-temperature-drift linear Hall amplification circuit and temperature compensation method thereof
CN114094952A