CN116499349A - Magnetic encoder self-correction method, system, storage medium and electronic equipment - Google Patents
Magnetic encoder self-correction method, system, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN116499349A CN116499349A CN202310561990.5A CN202310561990A CN116499349A CN 116499349 A CN116499349 A CN 116499349A CN 202310561990 A CN202310561990 A CN 202310561990A CN 116499349 A CN116499349 A CN 116499349A
- Authority
- CN
- China
- Prior art keywords
- value
- hall signal
- signal pair
- hall
- intersection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000012937 correction Methods 0.000 title claims abstract description 47
- 238000012545 processing Methods 0.000 claims description 13
- 238000004364 calculation method Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 5
- 230000035945 sensitivity Effects 0.000 claims description 5
- 230000008859 change Effects 0.000 description 14
- 230000006870 function Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 238000013459 approach Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000005355 Hall effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000004907 flux Effects 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B7/00—Measuring arrangements characterised by the use of electric or magnetic techniques
- G01B7/003—Measuring arrangements characterised by the use of electric or magnetic techniques for measuring position, not involving coordinate determination
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B7/00—Measuring arrangements characterised by the use of electric or magnetic techniques
- G01B7/02—Measuring arrangements characterised by the use of electric or magnetic techniques for measuring length, width or thickness
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B7/00—Measuring arrangements characterised by the use of electric or magnetic techniques
- G01B7/30—Measuring arrangements characterised by the use of electric or magnetic techniques for measuring angles or tapers; for testing the alignment of axes
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01D—MEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
- G01D18/00—Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Transmission And Conversion Of Sensor Element Output (AREA)
Abstract
The application provides a self-correction method and device for a magnetic encoder, a storage medium and electronic equipment, and relates to the field of magnetic encoders. According to the method and the device, the second intersection point at the next moment is predicted on the basis of the first intersection point at the previous moment according to the real-time difference value and the real-time average value of each Hall signal pair, so that the value of the upcoming intersection point can be predicted in advance according to the actual value of the real-time Hall signal, the angle deviation of the magnetic encoder caused by the deviation of the Hall signal is corrected in advance, and the accuracy of the angle correction of the magnetic encoder can be improved relative to the angle correction by directly using the value of the first intersection point.
Description
Technical Field
The present disclosure relates to the field of magnetic encoders, and in particular, to a method and apparatus for self-correcting a magnetic encoder, a storage medium, and an electronic device.
Background
The magnetic encoder is a high-precision sensor for selecting a position or linear displacement of a vehicle, and is generally composed of a rotary or linear moving permanent magnet and a magnetic field sensor, wherein the magnetic field sensor can be a Hall sensor, the Hall sensor can convert magnetic field change into voltage change based on Hall effect, and the magnetic encoder is widely applied to the fields of robot control, machine tools, medical equipment and the like which need high-precision position measurement with the advantages of high resolution and high precision.
Based on the rotary magnetic encoder of the Hall sensor, the measured magnetic field value of three paths of Hall signals is a sine or cosine function, the precision of the magnetic encoder is related to each path of Hall signals, the Hall signals are sensitive to the interference of the magnetic field intensity, and when the magnetic field intensity of the permanent magnet changes, the waveform of the Hall signals is distorted, so that the measuring angle deviation of the magnetic encoder is influenced.
Aiming at the problem of angle deviation caused by the magnetic field intensity change of the permanent magnet, the method for correcting the cross point in the prior art comprises the steps of combining the Hall signals of three Hall sensors together, generating cross points between different paths of Hall signals, and realizing the correction of a magnetic encoder by measuring and calculating the cross points of the Hall signals, thereby reducing the angle deviation caused by the magnetic field intensity change.
However, the existing correction method using the cross point corrects according to the last cross point of two paths of hall signals, and the waveform of the hall signal with distortion is changed at any time, so that the method using the cross point to directly correct has hysteresis, and the angle correction of the magnetic encoder is not accurate enough.
Disclosure of Invention
The application provides a self-correction method, a device, a storage medium and electronic equipment for a magnetic encoder, wherein the value of a second intersection point at the next moment is predicted according to a real-time difference value and a real-time average value of each Hall signal pair, and the angle deviation of the magnetic encoder is corrected in real time according to the value of the second intersection point, so that the accuracy of angle correction can be improved.
In a first aspect, the present application provides a magnetic encoder self-correction method applied to a magnetic encoder, the magnetic encoder including at least three hall sensors, a permanent magnet, and a controller, the permanent magnet being configured to provide a magnetic field, the at least three hall sensors being configured to measure magnetic field strengths of the permanent magnet, respectively, and generate corresponding hall signals, the method comprising:
the controller acquires Hall signals generated by the at least three Hall sensors at the current moment, calculates a real-time difference value and a real-time average value of each Hall signal pair, and the Hall signal pairs are formed by combining the Hall signals in pairs;
if the difference value of the target Hall signal pair in the at least one Hall signal pair is smaller than a first threshold value, respectively acquiring the value of a first intersection point of each Hall signal pair, wherein the value of the first intersection point is the voltage amplitude of the intersection point of the Hall signal pair at the last moment;
Calculating the value of a second intersection point of each Hall signal pair based on the value of the first intersection point of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair, and correcting the angle deviation of the magnetic encoder based on the value of the second intersection point of each Hall signal pair, wherein the value of the second intersection point is the voltage amplitude of the predicted intersection point of the Hall signal pair at the next moment.
By adopting the technical scheme, the second intersection point at the next moment is predicted on the basis of the first intersection point at the previous moment according to the real-time difference value and the real-time average value of each Hall signal pair, so that the value of the upcoming intersection point can be predicted in advance according to the actual value of the real-time Hall signal as early as possible, the angle deviation of the magnetic encoder caused by the deviation of the Hall signal is corrected in advance, and the accuracy of the angle correction of the magnetic encoder can be improved relative to the angle correction of the magnetic encoder directly using the value of the first intersection point.
Optionally, the calculating the value of the second intersection of each hall signal pair based on the value of the first intersection of each hall signal pair and the real-time difference value and the real-time average value of each hall signal pair includes:
Calculating the value of the second intersection of each Hall signal pair by using an intersection prediction formula based on the value of the first intersection of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair;
the cross point prediction formula is as follows:
CPx=DTx*(CPSx-AVGx)/TH1+AVGx;
wherein CPx is the value of the second crossing point of the x-TH Hall signal pair, DTx is the real-time difference value of the x-TH Hall signal pair, CPSx is the value of the first crossing point of the x-TH Hall signal pair, AVGx is the real-time average value of the x-TH Hall signal pair, and TH1 is the set first threshold value.
By adopting the technical scheme, the real-time difference value of the Hall signal pair is used as the weighted value, the predicted value of the second intersection point approaches to the real-time average value of the Hall signal pair for the Hall signal pair with small real-time difference value, and the weighted prediction is carried out on the value of the second intersection point according to the real-time difference value of the Hall signal pair for the Hall signal pair with large difference value, so that the accuracy of the value prediction of the second intersection point can be improved.
Optionally, before calculating the value of the second intersection of each hall signal pair using the intersection prediction formula, the method further includes:
Judging whether the difference value of the Hall signal pair is smaller than a set second threshold value, wherein the set second threshold value is smaller than a set first threshold value;
and if the difference value of the Hall signal pair is smaller than the set second threshold value, taking the value of the first crossing point of the Hall signal pair as the value of the second crossing point of the Hall signal pair.
By adopting the technical scheme, when the difference value between each Hall signal pair is smaller than the second threshold value, the influence on the Hall signals is smaller, each Hall signal pair is in an error range, and at the moment, the value of the second intersection at the previous moment can be used as the value of the second intersection at the next moment, so that the calculation amount of real-time prediction can be reduced.
Optionally, the first threshold is a fixed value, and the value of the first threshold is determined by the noise level of the hall sensor, the sensitivity, the response speed and the precision requirement of the magnetic encoder.
By adopting the technical scheme, the value of the first threshold value is comprehensively considered from the dimension in practical application, so that the accuracy and the sensitivity of numerical value prediction of the second intersection point can be ensured.
Optionally, before the difference value of the at least one hall signal pair is smaller than the set first threshold, the method further includes: acquiring a real-time temperature of the permanent magnet and a first corresponding relation table of the magnetic field intensity of the permanent magnet changing along with the temperature, and dynamically adjusting the value of a set first threshold value based on the real-time temperature and the first corresponding relation table.
By adopting the technical scheme, the magnetic field intensity of the permanent magnet is sensitive to temperature, and the value of the first threshold value is dynamically adjusted according to the real-time temperature of the permanent magnet by a table look-up method, so that the correction accuracy of the magnetic encoder can be further improved.
Optionally, the correcting the angular deviation of the magnetic encoder based on the value of the second intersection of each hall signal pair includes:
acquiring a second corresponding relation table of the numerical value of the intersection point and the angle position of the magnetic encoder;
respectively obtaining the values of a plurality of crossing points of each Hall signal pair before the current moment, and calculating the root mean square value of the values of the crossing points of each Hall signal pair before the current moment;
obtaining a reference angle position of each Hall signal pair at the second intersection point based on the root mean square value and the second corresponding relation table;
obtaining a predicted angle position of each Hall signal pair at the second intersection point based on the value of the second intersection point and the second corresponding relation table;
correcting an angular deviation of the magnetic encoder based on the reference angular position and the predicted angular position.
By adopting the technical scheme, the corresponding reference angle position is obtained according to the root mean square value of the values of the plurality of crossing points before the current moment by the Hall signal pair, and the predicted angle position at the second crossing point is obtained by a table look-up mode, so that the predicted angle position is corrected on the basis of the Hall signal pair.
Optionally, the calculating the root mean square value of the crossing point of each hall signal pair before the current moment includes:
calculating the root mean square value of the numerical values of a plurality of crossing points before the current moment of each Hall signal pair by using a root mean square value calculation formula;
the root mean square value calculation formula is as follows:
wherein X is rms For the root mean square value, xi is the value of the i-th intersection point before the current time, and N is the number of intersection points before the current time.
By adopting the technical scheme, the noise influence when calculating the average value of the numerical values of a plurality of crossing points before the current moment can be reduced, and the error of the numerical value of the larger or smaller crossing point to the subsequent calculation result is reduced.
In a second aspect, the present application provides a magnetic encoder self-correction device, wherein the device comprises:
The Hall signal processing module is used for acquiring Hall signals generated by the at least three Hall sensors at the current moment by the controller, calculating the real-time difference value and the real-time average value of each Hall signal pair, and the Hall signal pairs are formed by combining the Hall signals in pairs;
the first intersection obtaining module is used for obtaining the value of a first intersection of each Hall signal pair if the difference value of the target Hall signal pair in the at least one Hall signal pair is smaller than a first threshold value, wherein the value of the first intersection is the voltage amplitude of the intersection of the Hall signal pair at the last moment;
and the second intersection correction module is used for calculating the value of the second intersection of each Hall signal pair based on the value of the first intersection of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair, and correcting the angle deviation of the magnetic encoder based on the value of the second intersection of each Hall signal pair, wherein the value of the second intersection is the voltage amplitude of the predicted intersection of the Hall signal pair at the next moment. In a third aspect, the present application provides a computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform any one of the methods described above.
In a third aspect, the present application provides a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method of any one of the preceding claims.
In a fourth aspect, the present application provides an electronic device comprising a processor, a memory for storing instructions, and a transceiver for communicating with other devices, the processor for executing the instructions stored in the memory to cause the electronic device to perform any one of the methods described above.
In summary, one or more technical solutions provided in the embodiments of the present application have the following technical effects or advantages: according to the real-time difference value and the real-time average value of each Hall signal pair, the second intersection point at the next moment is predicted on the basis of the first intersection point at the previous moment, so that the value of the upcoming intersection point can be predicted in advance according to the actual value of the real-time Hall signal as early as possible, the angle deviation of the magnetic encoder caused by the deviation of the Hall signal is corrected in advance, and the accuracy of the angle correction of the magnetic encoder can be improved relative to the angle correction by directly using the value of the first intersection point.
Drawings
FIG. 1 is a schematic diagram of a magnetic encoder according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a self-calibration method of a magnetic encoder according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a self-calibration device of a magnetic encoder according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to the disclosure in an embodiment of the present application.
Reference numerals illustrate: 100. a Hall signal processing module; 200. a first intersection acquisition module; 300. a second crossover point correction module; 400. an electronic device; 401. a processor; 402. a communication bus; 403. a user interface; 404. a network interface; 405. a memory.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present application, but not all embodiments.
In the description of embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described herein as "such as" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "or" for example "is intended to present related concepts in a concrete fashion.
In the description of the embodiments of the present application, the term "plurality" means two or more. For example, a plurality of systems means two or more systems, and a plurality of screen terminals means two or more screen terminals. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating an indicated technical feature. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The technical scheme provided by the application can be applied to a magnetic encoder scene, and is particularly applied to a magnetic rotary encoder.
Referring to fig. 1, a schematic diagram of a magnetic encoder is shown, in which a permanent magnet part generates a magnetic field change during rotation, a hall sensor detects a change of multi-level magnetic flux of a rotating permanent magnet uniformly arranged along a circumferential direction, an incremental pulse signal or an alternating magnetic flux signal is obtained, and the rotation angle position of the permanent magnet can be obtained through processing hall signals of a plurality of hall sensors.
In practice, the permanent magnet in the magnetic encoder is sensitive to temperature, when the temperature changes, the magnetic field intensity of the permanent magnet will change obviously, and when the magnetic encoder is reinstalled, the relative position between the permanent magnet and the hall sensor changes, so that the numerical value sensed by the hall sensor changes obviously, the accuracy of the magnetic encoder is affected obviously, and the magnetic encoder needs to be subjected to angle correction.
In the prior art, when the cross points among the Hall signals are used for correction, the previous history cross points are adopted for correction, but the method causes inaccuracy of the history cross points due to the change of waveforms of the Hall signals, and the correction error is larger; and the angle correction using the last historical intersection point is also inaccurate when a change in magnetic field strength occurs between the two intersection points.
Based on the problems, the embodiment of the application can timely monitor real-time changes of the multi-path Hall signals, simultaneously predict the cross point at the next moment on the basis of the cross point at the previous moment, and conduct angle correction according to the predicted cross point, so that the accuracy of angle correction of the magnetic encoder is improved.
It should be noted that, the implementation main body of the application is a magnetic encoder, the magnetic encoder comprises at least three hall sensors, a permanent magnet and a controller, the permanent magnet is used for providing a magnetic field, and the at least three hall sensors are respectively used for measuring the magnetic field intensity of the permanent magnet and generating corresponding hall signals.
Referring to fig. 2, a flow chart of a magnetic encoder self-correction method according to an embodiment of the present application is provided, and the method may be implemented by a computer program, may be implemented by a single chip microcomputer, or may be run on a magnetic encoder self-correction device based on von neumann system. The computer program may be integrated in the application or may run as a stand-alone tool class application. In the embodiment of the present application, a controller of a magnetic encoder is taken as an example, and specific steps of a self-correction method of the magnetic encoder are described in detail.
Step S10, the controller acquires Hall signals generated by at least three Hall sensors at the current moment, calculates real-time difference values and real-time average values of each Hall signal pair, and the Hall signal pairs are formed by combining the Hall signals in pairs.
The Hall sensor is manufactured according to the Hall effect, can detect the magnetic field intensity of the change generated by the permanent magnet and linearly output corresponding voltage signals, and can timely reflect the magnetic field intensity change detected by the Hall sensor, wherein the output voltage signals are Hall signals.
The hall signal pairs are formed by combining the hall signals in pairs, for example, three hall signals, namely a hall signal a, a hall signal B and a hall signal C, are obtained, and the hall signal pairs formed by the hall signal pairs are a hall signal pair AB, a hall signal pair AC and a hall signal pair BC. When the number of acquired hall signals is greater than three, the combination of the hall signal pairs is performed in the same manner.
The real-time difference value of the Hall signal pair is the absolute value of the difference value of the voltage amplitudes of the two paths of Hall signals in the Hall signal pair, and the real-time average value of the Hall signal pair is the average value of the voltage amplitudes of the two paths of Hall signals in the Hall signal pair.
Step S20, if the difference value of the target Hall signal pair in at least one Hall signal pair is smaller than a first threshold value, respectively acquiring the value of a first cross point of each Hall signal pair, wherein the value of the first cross point is the voltage amplitude of the cross point of the Hall signal pair at the last moment.
After calculating the real-time difference value of each Hall signal pair, judging whether the difference value of one target Hall signal pair is smaller than a preset first threshold value in real time, if the difference value of one target Hall signal pair is smaller than the first threshold value, indicating that the voltage amplitude difference of two paths of Hall signals of the target Hall signal pair is small, and meanwhile, the voltage amplitude difference of one path of Hall signal of the target Hall signal pair possibly becomes larger than that of one path of Hall signal of the other Hall signal pair, namely, the fluctuation of the Hall signal of the acquired Hall sensor due to the change of the magnetic field intensity is larger, and the angle of the magnetic encoder needs to be corrected through the prediction intersection point.
In one embodiment, it is determined whether the value of the first threshold value, which is required to perform angle correction, is a fixed value, where the value of the first threshold value is determined by the noise level of the hall sensor, the sensitivity of the magnetic encoder, the response speed, and the accuracy requirement.
The value of the first threshold is too small, and the magnetic encoder starts self-correction only for large fluctuation, so that the magnetic encoder is not sensitive enough and the response speed is slow; the magnetic encoder is sensitive and is easily affected by external interference and noise due to the fact that the value of the first threshold value is too large. Meanwhile, the magnetic encoder is used as a position measuring device and has precision requirement, so that the magnetic encoder needs to be determined according to the application scene of the actual magnetic encoder.
In another embodiment, whether the value of the first threshold value which needs to be subjected to angle correction is a dynamic value is judged, a real-time temperature of the permanent magnet and a first corresponding relation table of the magnetic field intensity of the permanent magnet changing along with the temperature are obtained, and the value of the set first threshold value is dynamically adjusted based on the real-time temperature and the first corresponding relation table.
In the actual operation of the magnetic encoder, the temperature of the permanent magnet is sensitive to the influence of the hall signal, so that the first threshold value can be dynamically adjusted according to the real-time temperature of the permanent magnet, a first relation table of the magnetic field intensity of the permanent magnet along with the temperature change can be obtained according to the curie law and a thermodynamic formula, the acquisition process is not repeated here, the corresponding relation between the magnetic field intensity of the permanent magnet and the temperature of the permanent magnet can be obtained, and the temperature of the permanent magnet can be obtained through a temperature sensor, so that the value of the first threshold value can be dynamically adjusted.
The first intersection point is the position of the intersection of the hall signal pair at the last moment, is the intersection point of the hall signal pair closest to the current moment, and the value of the first intersection point is the voltage amplitude value when two paths of hall signals at the intersection point intersect, and it is to be understood that if the phase angle of the intersection point changes due to the fact that the voltage amplitude value of one path of hall signal becomes larger, the value of the first intersection point also comprises the phase angle at the intersection point.
And step S30, calculating the value of a second intersection of each Hall signal pair based on the value of the first intersection of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair, and correcting the angle deviation of the magnetic encoder based on the value of the second intersection of each Hall signal pair, wherein the value of the second intersection is the voltage amplitude of the predicted intersection of the Hall signal pair at the next moment.
The specific way of calculating the value of the second intersection of each Hall signal pair is to calculate the value of the second intersection of each Hall signal pair by using an intersection prediction formula based on the value of the first intersection of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair;
The cross point prediction formula is as follows:
CPx=DTx*(CPSx-AVGx)/TH1+AVGx;
wherein CPx is the value of the second crossing point of the x-TH Hall signal pair, DTx is the real-time difference value of the x-TH Hall signal pair, CPSx is the value of the first crossing point of the x-TH Hall signal pair, AVGx is the real-time average value of the x-TH Hall signal pair, and TH1 is the set first threshold value.
In the calculation, the real-time difference value between the hall signal pairs is equal to the weighted value, and the predicted value of the second intersection point corresponding to the larger real-time difference value is also larger, and meanwhile, when the real-time difference value is gradually reduced, the value of the second intersection point gradually approaches to the real-time average value of the hall signal pairs, namely, two hall signals in the hall signal pairs are about to be intersected.
In one embodiment, it is determined whether the difference between the hall signal pairs is less than a set second threshold, the set second threshold being less than the set first threshold; and if the difference value of the Hall signal pair is smaller than the set second threshold value, taking the value of the first crossing point of the Hall signal pair as the value of the second crossing point of the Hall signal pair.
By introducing the second threshold value, when the real-time difference value between the Hall signal pairs is smaller than a smaller second threshold value, the two Hall signals in the Hall signal pairs are about to be crossed or just crossed, and the calculated amount of partial cross point prediction can be reduced through the setting.
Specifically, in one way of performing the angle correction, the correction method includes, but is not limited to, the following steps of correcting the angle deviation of the magnetic encoder based on the value of the second intersection of each hall signal pair: step S301, a second correspondence table between the values of the intersecting points and the angular positions of the magnetic encoder is obtained.
In the prior art in which the angular position of the magnetic encoder is determined by the value of the intersection point, the magnetic field direction of the stator side corresponding to the intersection point can be obtained from the sector installation position of the hall sensor, thereby corresponding to the angular position of the magnetic encoder of the stator side.
Step S302, respectively obtaining the values of a plurality of crossing points before the current moment of each Hall signal pair, and calculating the root mean square value of the values of the crossing points before the current moment of each Hall signal pair.
The reference angle position at the next crossing can be predicted by the values of a plurality of crossing points before the current moment on the basis of not considering the change of the rotation speed of the permanent magnet, and simultaneously the noise interference of the values of the larger or smaller crossing points is reduced by calculating the root mean square value. Wherein, root mean square value formula is:
Wherein X is rms For the root mean square value, xi is the value of the i-th intersection point before the current time, and N is the number of intersection points before the current time.
Step S303, based on the root mean square value and the second corresponding relation table, the reference angle position of each Hall signal pair at the second intersection point is obtained.
And obtaining the reference angle position of each Hall signal pair at a second intersection point in a table look-up mode, wherein the second intersection point is the position of each Hall signal pair when the Hall signal pair crosses at the next moment, and each Hall signal pair corresponds to one second intersection point.
Step S304, based on the value of the second intersection and the second corresponding relation table, the predicted angle position of each Hall signal pair at the second intersection is obtained.
The second relation corresponding table is stored in a memory of the magnetic encoder, and after the value of the intersection is obtained through prediction, the corresponding second relation corresponding table is called to obtain the predicted angle position.
Step S305 corrects the angular deviation of the magnetic encoder based on the reference angular position and the predicted angular position.
In one embodiment, the angular position of the magnetic encoder is adjusted with reference to the predicted angular position on the basis of the reference angular position such that the correction angle approaches the predicted angular position, and the adjustment weight is determined from the difference between the reference angular position and the predicted angular position.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Referring to fig. 3, a schematic structural diagram of a self-calibration device of a magnetic encoder according to an exemplary embodiment of the present application is shown. The apparatus may be implemented as all or part of an apparatus by software, hardware, or a combination of both. The apparatus includes a hall signal processing module 100, a first cross point acquisition module 200, and a second cross point correction module 300.
The hall signal processing module 100 is configured to obtain hall signals generated by at least three hall sensors at a current moment, calculate a real-time difference value and a real-time average value of each hall signal pair, and each hall signal pair is formed by combining two hall signals; the first cross point obtaining module 200 is configured to, if a difference value of a target hall signal pair existing in at least one hall signal pair is smaller than a set first threshold value, respectively obtain a value of a first cross point of each hall signal pair, where the value of the first cross point is a voltage amplitude of a cross point of the hall signal pair at a previous moment;
And a second cross point correction module 300 for calculating a value of a second cross point of each hall signal pair based on the value of the first cross point of each hall signal pair and the real-time difference and the real-time average value of each hall signal pair, and correcting the angular deviation of the magnetic encoder based on the value of the second cross point of each hall signal pair, the value of the second cross point being the voltage amplitude of the predicted cross point of the hall signal pair at the next moment.
On the basis of the above embodiment, as an alternative embodiment, the first intersection acquisition module 200 further includes: a first threshold determining unit and a first threshold adjusting unit, wherein:
the first threshold determining unit is used for setting the first threshold as a fixed value, and the value of the first threshold is determined by the noise level of the Hall sensor, the sensitivity of the magnetic encoder, the response speed and the precision requirement.
The first threshold value adjusting unit is used for acquiring a real-time temperature of the permanent magnet and a first corresponding relation table of the magnetic field intensity of the permanent magnet changing along with the temperature, and dynamically adjusting the value of the set first threshold value based on the real-time temperature and the first corresponding relation table.
On the basis of the above embodiment, as an alternative embodiment, the second intersection correction module 300 further includes: a cross point prediction unit and a cross point replacement unit, wherein:
A cross point prediction unit for calculating a value of a second cross point of each hall signal pair using a cross point prediction formula based on a value of a first cross point of each hall signal pair and a real-time difference value and a real-time average value of each hall signal pair;
the cross point prediction formula is:
CPx=DTx*(CPSx-AVGx)/TH1+AVGx;
wherein CPx is the value of the second crossing point of the xth Hall signal pair, DTx is the real-time difference value of the xth Hall signal pair, CPSx is the value of the first crossing point of the xth Hall signal pair, AVGx is the real-time average value of the xth Hall signal pair, and TH1 is the set first threshold value.
The cross point replacing unit is used for judging whether the difference value of the Hall signal pair is smaller than a set second threshold value, and the set second threshold value is smaller than a set first threshold value; and if the difference value of the Hall signal pair is smaller than the set second threshold value, taking the value of the first crossing point of the Hall signal pair as the value of the second crossing point of the Hall signal pair.
On the basis of the above embodiment, as an alternative embodiment, the second intersection correction module 300 further includes: an angle correction unit and a root mean square value calculation unit, wherein:
the angle correction unit is used for acquiring a second corresponding relation table of the numerical value of the intersection point and the angle position of the magnetic encoder;
Respectively acquiring the values of a plurality of crossing points of each Hall signal pair before the current moment, and calculating the root mean square value of the values of the crossing points of each Hall signal pair before the current moment;
obtaining a reference angle position of each Hall signal pair at a second intersection point based on the root mean square value and a second corresponding relation table;
obtaining a predicted angle position of each Hall signal pair at the second intersection point based on the value of the second intersection point and a second corresponding relation table;
the angular deviation of the magnetic encoder is corrected based on the reference angular position and the predicted angular position.
A root mean square value calculation unit for calculating root mean square values of a plurality of intersections before the current time of each hall signal pair using a root mean square value calculation formula;
the root mean square value calculation formula is:
wherein X is rms For the root mean square value, xi is the value of the i-th intersection point before the current time, and N is the number of intersection points before the current time.
It should be noted that: in the device provided in the above embodiment, when implementing the functions thereof, only the division of the above functional modules is used as an example, in practical application, the above functional allocation may be implemented by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the embodiments of the apparatus and the method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the embodiments of the method are detailed in the method embodiments, which are not repeated herein.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and execute the magnetic encoder self-correction method described in the embodiment shown in fig. 1 to fig. 3, and the specific execution process may be referred to in the specific description of the embodiment shown in fig. 1 to fig. 3, which is not repeated herein.
The application also discloses electronic equipment. Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to the disclosure in an embodiment of the present application. The electronic device 400 may include: at least one processor 401, at least one network interface 404, a user interface 403, a memory 405, and at least one communication bus 402.
Wherein communication bus 402 is used to enable connected communications between these components.
The user interface 403 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 403 may further include a standard wired interface and a standard wireless interface.
The network interface 404 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Wherein the processor 401 may include one or more processing cores. The processor 401 connects the various parts within the entire server using various interfaces and lines, performs various functions of the server and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 405, and invoking data stored in the memory 405. Alternatively, the processor 401 may be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 401 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 401 and may be implemented by a single chip.
The Memory 405 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 405 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 405 may be used to store instructions, programs, code sets, or instruction sets. The memory 405 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-described various method embodiments, etc.; the storage data area may store data or the like involved in the above respective method embodiments. The memory 405 may also optionally be at least one storage device located remotely from the aforementioned processor 401. Referring to fig. 4, an operating system, a network communication module, a user interface module, and an application program for magnetic encoder self-correction may be included in the memory 405 as a computer storage medium.
In the electronic device 400 shown in fig. 4, the user interface 403 is mainly used as an interface for providing input for a user, and obtains data input by the user; and processor 401 may be used to invoke an application program in memory 405 that stores a magnetic encoder self-correction, which when executed by one or more processors 401, causes electronic device 400 to perform the method as described in one or more of the embodiments above. It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided herein, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, such as a division of units, merely a division of logic functions, and there may be additional divisions in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some service interface, device or unit indirect coupling or communication connection, electrical or otherwise.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned memory includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a magnetic disk or an optical disk.
The foregoing is merely exemplary embodiments of the present disclosure and is not intended to limit the scope of the present disclosure. That is, equivalent changes and modifications are contemplated by the teachings of this disclosure, which fall within the scope of the present disclosure. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure.
This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a scope and spirit of the disclosure being indicated by the claims.
Claims (10)
1. A magnetic encoder self-correction method, characterized by being applied to a magnetic encoder, the magnetic encoder comprising at least three hall sensors, a permanent magnet and a controller, the permanent magnet being used for providing a magnetic field, the at least three hall sensors being respectively used for measuring the magnetic field strength of the permanent magnet and generating corresponding hall signals, the method comprising:
the controller acquires Hall signals generated by the at least three Hall sensors at the current moment, calculates a real-time difference value and a real-time average value of each Hall signal pair, and the Hall signal pairs are formed by combining the Hall signals in pairs;
if the difference value of the target Hall signal pair in the at least one Hall signal pair is smaller than a first threshold value, respectively acquiring the value of a first intersection point of each Hall signal pair, wherein the value of the first intersection point is the voltage amplitude of the intersection point of the Hall signal pair at the last moment;
Calculating the value of a second intersection point of each Hall signal pair based on the value of the first intersection point of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair, and correcting the angle deviation of the magnetic encoder based on the value of the second intersection point of each Hall signal pair, wherein the value of the second intersection point is the voltage amplitude of the predicted intersection point of the Hall signal pair at the next moment.
2. The method of claim 1, wherein calculating the value of the second intersection of each hall signal pair based on the value of the first intersection of each hall signal pair and the real-time difference and the real-time average value of each hall signal pair comprises:
calculating the value of the second intersection of each Hall signal pair by using an intersection prediction formula based on the value of the first intersection of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair;
the cross point prediction formula is as follows:
CPx=DTx*(CPSx-AVGx)/TH1+AVGx;
wherein CPx is the value of the second crossing point of the x-TH Hall signal pair, DTx is the real-time difference value of the x-TH Hall signal pair, CPSx is the value of the first crossing point of the x-TH Hall signal pair, AVGx is the real-time average value of the x-TH Hall signal pair, and TH1 is the set first threshold value.
3. The method of claim 1, wherein the calculating the value of the second crossing point of each hall signal pair using the crossing point prediction formula based on the value of the first crossing point of each hall signal pair and the real-time difference value and the real-time average value of each hall signal pair further comprises:
judging whether the difference value of the Hall signal pair is smaller than a set second threshold value, wherein the set second threshold value is smaller than a set first threshold value;
and if the difference value of the Hall signal pair is smaller than the set second threshold value, taking the value of the first crossing point of the Hall signal pair as the value of the second crossing point of the Hall signal pair.
4. The method of claim 1, wherein the set first threshold is a fixed value, and wherein the value of the set first threshold is determined by a noise level of the hall sensor, a sensitivity of the magnetic encoder, a response speed, and a precision requirement.
5. The method of claim 1, wherein the step of, if the difference between the at least one hall signal pair is less than the set first threshold value, further comprises:
acquiring a real-time temperature of the permanent magnet and a first corresponding relation table of the magnetic field intensity of the permanent magnet changing along with the temperature, and dynamically adjusting the value of a set first threshold value based on the real-time temperature and the first corresponding relation table.
6. The method of claim 1, wherein correcting the angular misalignment of the magnetic encoder based on the value of the second intersection of each hall signal pair comprises:
acquiring a second corresponding relation table of the numerical value of the intersection point and the angle position of the magnetic encoder;
respectively obtaining the values of a plurality of crossing points of each Hall signal pair before the current moment, and calculating the root mean square value of the values of the crossing points of each Hall signal pair before the current moment;
obtaining a reference angle position of each Hall signal pair at the second intersection point based on the root mean square value and the second corresponding relation table;
obtaining a predicted angle position of each Hall signal pair at the second intersection point based on the value of the second intersection point and the second corresponding relation table;
correcting an angular deviation of the magnetic encoder based on the reference angular position and the predicted angular position.
7. The method of claim 6, wherein said calculating the root mean square value of the number of intersections of each hall signal pair prior to the current time comprises:
Calculating the root mean square value of the numerical values of a plurality of crossing points before the current moment of each Hall signal pair by using a root mean square value calculation formula;
the root mean square value calculation formula is as follows:
wherein X is rms For the root mean square value, xi is the value of the i-th intersection point before the current time, and N is the number of intersection points before the current time.
8. A magnetic encoder self-correction apparatus, wherein the apparatus comprises:
the Hall signal processing module is used for acquiring Hall signals generated by the at least three Hall sensors at the current moment by the controller, calculating the real-time difference value and the real-time average value of each Hall signal pair, and the Hall signal pairs are formed by combining the Hall signals in pairs;
the first intersection obtaining module is used for obtaining the value of a first intersection of each Hall signal pair if the difference value of the target Hall signal pair in the at least one Hall signal pair is smaller than a first threshold value, wherein the value of the first intersection is the voltage amplitude of the intersection of the Hall signal pair at the last moment;
and the second intersection correction module is used for calculating the value of the second intersection of each Hall signal pair based on the value of the first intersection of each Hall signal pair and the real-time difference value and the real-time average value of each Hall signal pair, and correcting the angle deviation of the magnetic encoder based on the value of the second intersection of each Hall signal pair, wherein the value of the second intersection is the voltage amplitude of the predicted intersection of the Hall signal pair at the next moment.
9. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method of any one of claims 1 to 7.
10. An electronic device comprising a processor, a memory for storing instructions, and a transceiver for communicating with other devices, the processor for executing instructions stored in the memory to cause the electronic device to perform the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310561990.5A CN116499349A (en) | 2023-05-18 | 2023-05-18 | Magnetic encoder self-correction method, system, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310561990.5A CN116499349A (en) | 2023-05-18 | 2023-05-18 | Magnetic encoder self-correction method, system, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116499349A true CN116499349A (en) | 2023-07-28 |
Family
ID=87326670
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310561990.5A Pending CN116499349A (en) | 2023-05-18 | 2023-05-18 | Magnetic encoder self-correction method, system, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116499349A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118243156A (en) * | 2024-05-28 | 2024-06-25 | 兰德(吉林省)科创产业化集团有限公司 | Angle sensing encoder measurement system and method based on inductance transformer |
-
2023
- 2023-05-18 CN CN202310561990.5A patent/CN116499349A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118243156A (en) * | 2024-05-28 | 2024-06-25 | 兰德(吉林省)科创产业化集团有限公司 | Angle sensing encoder measurement system and method based on inductance transformer |
CN118243156B (en) * | 2024-05-28 | 2024-07-19 | 兰德(吉林省)科创产业化集团有限公司 | Angle sensing encoder measurement system and method based on inductance transformer |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110793430B (en) | Absolute electrical angle detection method, system and computer readable storage medium | |
CN109959400B (en) | Method and device for calculating absolute encoder parameters and terminal equipment | |
JP4240090B2 (en) | Encoder signal correction circuit | |
KR20160066509A (en) | Correction table generating apparatus, encoder, and correction table generating method | |
CN105928546A (en) | Encoder Signal Processor | |
CN116499349A (en) | Magnetic encoder self-correction method, system, storage medium and electronic equipment | |
WO2021128419A1 (en) | Magnetic encoder, absolute electrical angle measurement method and system, and readable storage medium | |
JP6386368B2 (en) | Rotary encoder, control method and control program for rotary encoder | |
JP6352540B2 (en) | Detection device, rotation angle detection device, detection method, and program | |
KR101192505B1 (en) | Phase detection device and position detection device | |
CN111089610B (en) | Signal processing method and device of encoder and related components | |
JP4794509B2 (en) | Device for detecting the rotational position of a rotating body using a resolver | |
JP6416983B1 (en) | Rotation axis angle calibration method and angle calibration program | |
JP2013019829A (en) | Physical quantity detection device, and inspection method of physical quantity detection device | |
KR20180114743A (en) | Absolute encoder, method for generating look-up table of sinusoidal wave, and method for detecting absolute angle using the same | |
CN115208247B (en) | Rotor position measuring method and device of motor | |
JP2021047033A (en) | Encoder and encoder control method | |
JP4529964B2 (en) | Simulation device, simulation method, and simulation program | |
RU83133U1 (en) | SPINDLE ASSEMBLY | |
JP5251768B2 (en) | Test apparatus and test method | |
KR102099936B1 (en) | Apparatus and method for correcting sensor | |
JP2002048595A (en) | Calibration method for sensor | |
CN115900775A (en) | Encoder, position compensation method and device thereof, and storage medium | |
CN113124908A (en) | Method and system for improving measurement precision of instrument | |
CN117589221A (en) | Encoder calibration method, device, upper computer and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |