Self-calibration method for magnetic encoder, and method for calibrating motor and angle detection value
The self-calibration method for magnetic encoders addresses high calibration costs by creating a lookup table using low-pass filtering and reference points, reducing the need for optical encoders and enhancing detection accuracy.
Patent Information
- Application Number
- JP2025524386
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-10-24
- Filing Date
- 2023-05-16
- Publication Date
- 2025-10-16
AI Technical Summary
The calibration cost of magnetic encoders is high due to the need for additional expensive optical encoders, increasing hardware and time costs.
A self-calibration method for magnetic encoders that uses low-pass filtering and reference points to create a calibration lookup table without requiring an optical encoder, utilizing a signal processing circuit with filters, comparison modules, and subtraction to achieve accurate calibration values.
Reduces calibration costs by eliminating the need for optical encoders, improving detection data linearity, and enabling accurate calibration through a calibration reference table.
Smart Images

Figure 2025534559000001_ABST
Abstract
Description
[Technical Field]
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to a Chinese patent application filed with the China Patent Office on October 24, 2022, bearing application number 202211298641.0 and entitled "Method for self-calibration of magnetic encoder and motor," the entire contents of which are incorporated herein by reference.
[0002] The present application relates to the technical field of performing detection processing on rotation angles, and more specifically to a self-calibration method for a magnetic encoder, a motor, and a method for calibrating an angle detection value. [Background technology]
[0003] Motors that require closed-loop control of the rotation angle or rotation speed, such as servo motors, are typically equipped with encoders, such as magnetic or optical encoders. Optical encoders are generally more accurate than magnetic encoders, but are also generally more expensive. When a magnetic encoder is installed in a motor, it is usually necessary to calibrate the magnetic encoder. A conventional method involves adding a highly accurate optical encoder for calibration, and the optical encoder and the magnetic encoder to be calibrated detect the rotation angle of the same rotating shaft, and then calibrating the detection value of the magnetic encoder using the highly accurate output value of the optical encoder.
[0004] For example, patent document CN114001768A discloses a self-calibration device for a magnetoelectric encoder, in which a drive motor and a high-precision encoder (e.g., an optical encoder) are added to calibrate the detection accuracy of the magnetoelectric encoder, and the output angles of the high-precision encoder corresponding to each output angle of the magnetoelectric encoder are recorded to obtain a calibration table, and then the angle deviation of the magnetoelectric encoder is calibrated based on the calibration table.
[0005] The drive motor and high precision encoder increase the hardware and time costs required to calibrate the magnetic encoder, thus increasing the overall cost of calibrating the magnetic encoder. Summary of the Invention [Problem to be solved by the invention]
[0006] SUMMARY OF THE INVENTION The present application aims to provide a method for self-calibration of a magnetic encoder to solve the technical problem in the prior art that the calibration cost of a magnetic encoder is relatively high. [Means for solving the problem]
[0007] In order to achieve the above objectives, the technical solutions adopted in this application are as follows:
[0008] A method for self-calibrating a magnetic encoder for detecting a rotation angle of a rotary shaft is provided, The rotary shaft rotates at a constant speed, and the magnetic encoder detects a rotation angle θ of the rotary shaft. det(ij) where i and j are positive integers and θ det(ij) represents the jth detected value in the ith period, Detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) Obtain θ filt(ij) is θ det(ij) and one-to-one correspondence, m reference points θ in 360° ref(n) and set up each reference point θ ref(n) The closest detected value θ det(ij-n) where n and m are positive integers, and 1≦n≦m, m≧2, θ det(ij-n) is the reference point θ of the i-th period ref(n) represents the detected value closest to θ det(ij-n) The filtering value θ corresponding to filt(ij-n) To select, Calibration value θ cal(i-n) =θ filt(ij-n) -θ det(ij-n)Calculate θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of Each reference point θ ref(n) p periods of θ cal(i-n) The target calibration value θ cal(n) θ ref(n) is θ cal(n) where p is a positive integer and p≧2; and Each reference point θ ref(n) and the corresponding target calibration value θ cal(n) and storing the values in one-to-one correspondence to obtain a calibration look-up table.
[0009] Preferably, each reference point θ ref(n) p periods of θ cal(i-n) is low-pass filtered to obtain the target calibration value θ cal(n) get.
[0010] Preferably, in the process of collecting the detection values θdet(i), the rotation speed of the rotary shaft is between 1000 RPM and 5000 RPM.
[0011] Preferably, θ ref(1) =0, θ ref(n+1) =θ ref(n) +2K, where K is a positive integer.
[0012] Preferably, the detected value θ det(ij) and reference point θ ref(n) are all expressed in binary, and the detected value θ det(ij) and the binary number 2K-1 are added together to get θ index(ij) θ index(ij) and each reference point θ ref(n) and are compared with each reference point θ ref(n) The closest detected value θ det(ij-n) is found.
[0013] Preferably, K=4, and the detected value θ det(ij) and reference point θ ref(n) The number of binary bits is 8 or more.
[0014] Preferably, after constructing the calibration reference table, the magnetic encoder detects a rotation angle θ of the rotary shaft. det(x) where x is a positive integer and the detected value θ det(x) The calibration lookup table is searched based on the corresponding target calibration value θ cal(n) and obtain the calibration value θcor(x)=θ det(x) +θ cal(n) Calculate.
[0015] Preferably, in the method for self-calibrating a magnetic encoder, data calculation is realized by a hardware description language.
[0016] The present application further provides a motor, the motor being provided with a magnetic encoder and a signal processing circuit, the magnetic encoder being fixed to a stator of the motor, a magnet being provided on an output shaft of the motor, the magnetic encoder being used to detect a rotation angle of the magnet, and the signal processing circuit constructing the calibration lookup table based on a self-calibration method of the magnetic encoder.
[0017] Preferably, the signal processing circuit includes a first filter, a comparison module, a storage module, a correspondence module, a subtractor, and a second filter, and the storage module stores m reference points θ ref(n) and the magnetic encoder stores the detected value θ det(ij) and the detected value θ det(ij) is input to the first filter for low-pass filtering, and then the filtered value θ filt(ij) and the comparison module obtains the detected value θ for each period. det(ij) and each reference point θ ref(n) and compare each reference point θ ref(n) The closest detected value θ det(ij-n) and the correspondence module finds θ det(ij-n) The filtering value θ corresponding to filt(ij-n) Find θ filt(ij-n) and θ det(ij-n)is input to the subtractor and subtracted to obtain the calibration value θ cal(i-n) and obtain p periods of θ cal(i-n) is input to the second filter for low-pass filtering, and then the reference point θ ref(n) The target calibration value θ corresponding to cal(n) get.
[0018] Preferably, the magnetic encoder is located on one axial side of the magnet along the output shaft of the motor.
[0019] The present application further provides a method for calibrating an angle detection value, comprising: The detected angle value changes periodically, and θ det(ij) represents the jth detected value in the ith period, where i and j are both positive integers. Detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) θ filt(ij) is θ det(ij) and one-to-one correspondence, m reference points θ in 360° ref(n) and set up each reference point θ ref(n) The closest detected value θ det(ij-n) where n and m are positive integers, and 1≦n≦m, m≧2, θ det(ij-n) is the reference point θ of the i-th period ref(n) represent the detected value closest to where θ ref(1) =0, θ ref(n+1) =θ ref(n) +2K, where K is a positive integer, and the detected value θ det(ij) and reference point θ ref(n) are all expressed in binary, and the detected value θ det(ij) and the binary number 2K-1 are added together to get θ index(ij) θ index(ij) and each reference point θ ref(n) are compared with each other and the reference point θ ref(n) The closest detected value θ det(ij-n) To be found, θ det(ij-n) The filtering value θ corresponding to filt(ij-n) To select, Calibration value θ cal(i-n) =θ filt(ij-n) -θ det(ij-n) Calculate θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of Each reference point θ ref(n) p periods of θ cal(i-n) The target calibration value θ cal(n) Obtain θ ref(n) is θ cal(n) where p is a positive integer and p≧2; and Each reference point θ ref(n) and the corresponding target calibration value θ cal(n) and storing the values in one-to-one correspondence to obtain a calibration look-up table.
[0020] Preferably, θ is expressed in binary. index(ij) and θ ref(n) are divided into a comparison part and a margin part, where a bit that is 1 in 2K binary numbers is a division reference bit, the division reference bit and bits higher than the division reference bit belong to the comparison part, and bits lower than the division reference bit belong to the margin part; θ index(ij) and one of the reference points θ ref(n) Compared with θ index(ij) The comparison part of this θ ref(n) Compare with the comparison part of.
[0021] Preferably, each reference point θ ref(n) p periods of θ cal(i-n) is low-pass filtered to obtain the target calibration value θ cal(n) get.
[0022] Preferably, K=4, and the detected value θ det(ij) and reference point θ ref(n) The number of binary bits is 8 or more.
[0023] Preferably, the method for calibrating the angle detection value realizes data calculation using a hardware description language. [Effects of the Invention]
[0024] The beneficial effects of the self-calibration method for a magnetic encoder according to the present invention are as follows: Compared with the prior art, the self-calibration method for a magnetic encoder according to the present invention has the following advantages: det(ij) The linearity of the detection data can be improved by performing low-pass filtering on the filtered value θ filt(ij) is the detected value θ det(ij) This can be considered as the result of linear calibration, and θ cal(i-n) is the reference point θ ref(n) For each reference point, there are p calibration values corresponding to p periods, and by performing equalization processing on the p calibration values, a relatively accurate target calibration value θ cal(n) , which allows the corresponding target calibration value θ for each reference point to be obtained. cal(n) can be obtained, thereby forming a calibration reference table and eliminating the need to add an expensive optical encoder as a calibration reference, thereby reducing the calibration cost of the magnetic encoder.
[0025] In order to more clearly explain the technical solutions in the embodiments of the present application, the following briefly introduces the drawings that need to be used in the description of the embodiments or prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can also obtain other drawings based on these drawings without paying any creative labor. [Brief explanation of the drawings]
[0026] [Figure 1] 1 is a schematic diagram illustrating the arrangement of a motor and a magnetic encoder according to an embodiment of the present application. [Figure 2] 1 is a schematic diagram illustrating the principle of a self-calibration method for a magnetic encoder according to an embodiment of the present application. [Figure 3]1 is a schematic diagram illustrating the principle of a first filter according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0027] In order to clarify the technical problems, technical solutions, and advantageous effects of the present application, the present application will be described in more detail below with reference to the drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the present application.
[0028] It should be noted that when an element is referred to as being "fixed" or "mounted" on another element, it may be directly or indirectly located on the other element. When an element is referred to as being "connected" to another element, it may be directly or indirectly connected to the other element.
[0029] It should be understood that the orientations or positional relationships indicated by the terms "length," "width," "up," "down," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inside," "outside," etc. are based on the orientations or positional relationships shown in the drawings and are intended merely to simplify the description and explanation of the present application, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore should not be construed as limitations on the present application.
[0030] Additionally, the terms "first" and "second" are for descriptive purposes only and cannot be understood to indicate or imply relative importance or the number of the indicated technical features. Thus, a feature qualified with "first" or "second" may explicitly or implicitly include one or more of the feature. In the description of this application, "plurality" means two or more, unless otherwise specified.
[0031] 1 and 2, a motor according to an embodiment of the present application will be described. The motor is provided with a magnetic encoder and a signal processing circuit, the magnetic encoder is fixed to a stator of the motor, a magnet is provided on the output shaft (i.e., the rotating shaft) of the motor, the magnetic encoder is used to detect the rotation angle of the magnet, and the signal processing circuit builds a calibration lookup table based on a self-calibration method of the magnetic encoder.
[0032] Regarding the position of the magnetic encoder relative to the magnet, the magnetic encoder according to the present application may adopt an on-axis detection method or an off-axis detection method, which are two different methods of magnetic induction detection in the field.
[0033] Preferably, the magnetic encoder according to the present application employs an on-axis detection method, and the magnetic encoder is located on one axial side of the magnet along the output shaft of the motor in order to obtain high angle detection accuracy.
[0034] The signal processing circuit includes a first filter, a comparison module, a storage module, a correspondence module, a subtractor, and a second filter, and the storage module stores m reference points θ ref(n) The magnetic encoder stores the detected value θ det(ij) and the detected value θ det(ij) is input to the first filter for low-pass filtering, and then the filtered value θ filt(ij) The comparison module obtains the detected value θ det(ij) and each reference point θ ref(n) and compare each reference point θ ref(n) The closest detected value θ det(ij-n) and the corresponding module is θ det(ij-n) The filtering value θ corresponding to filt(ij-n) Find θ filt(ij-n) and θ det(ij-n) is input to the subtractor and subtracted to obtain the calibration value θ cal(i-n) and obtain p periods of θ cal(i-n) is input to the second filter for low-pass filtering, and then the reference point θref(n) The target calibration value θ corresponding to cal(n) The reference point θ ref(n) and the target calibration value θ cal(n) If these are stored in one-to-one correspondence, a calibration look-up table is obtained.
[0035] Hereinafter, a self-calibration method for a magnetic encoder according to an embodiment of the present application will be described. The rotating shaft rotates at a constant speed, and the magnetic encoder detects the rotation angle of the rotating shaft, θ det(ij) where i and j are positive integers and θ det(ij) represents the jth detected value in the ith period, Detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) θ filt(ij) is θ det(ij) and one-to-one correspondence, m reference points θ in 360° ref(n) and set up each reference point θ ref(n) The closest detected value θ det(ij-n) where n and m are positive integers, and 1≦n≦m, m≧2, θ det(ij-n) is the reference point θ of the i-th period ref(n) represents the detected value closest to θ det(ij-n) The filtering value θ corresponding to filt(ij-n) To select, Calibration value θ cal(i-n) =θ filt(ij-n) -θ det(ij-n) Calculate θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of Each reference point θ ref(n) p periods of θ cal(i-n) The target calibration value θ cal(n) θ ref(n) is θ cal(n) where p is a positive integer and p≧2; and Each reference point θ ref(n)and the corresponding target calibration value θ cal(n) and the calibration reference table is obtained by storing the calibration reference table in one-to-one correspondence.
[0036] The beneficial effects of the self-calibration method for a magnetic encoder according to the present invention are as follows: Compared with the prior art, the self-calibration method for a magnetic encoder according to the present invention has the following advantages: det(ij) The linearity of the detection data can be improved by performing low-pass filtering on the filtered value θ filt(ij) is the detected value θ det(ij) This can be considered as the result of linear calibration, and θ cal(i-n) is the reference point θ ref(n) For each reference point, there are p calibration values corresponding to p periods, and by performing equalization processing on the p calibration values, a relatively accurate target calibration value θ cal(n) , which allows us to obtain for each reference point the corresponding target calibration value θ cal(n) This eliminates the need to create a calibration reference table and add an expensive optical encoder as a calibration reference, thereby reducing the calibration cost of the magnetic encoder.
[0037] Referring to FIG. 3, the detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) Before filtering, the detected value θ det(ij) contains a nonlinear deviation, and after passing through the low-pass filtering of the first filter, the nonlinear deviation can be removed or reduced so as to approach ideal linearity as much as possible. The first filter can be an existing low-pass filter.
[0038] During the process of uniform rotation of the rotating shaft, the detected value θdet(i) collected by the magnetic encoder changes periodically, and the frequency of the change coincides with the rotation speed of the rotating shaft.
[0039] θ det(ij)represents the j-th detected value in the i-th period, for example, θ det(23) represents the third detected value in the second period. filt(ij) is θ det(ij) and have a one-to-one correspondence, for example, θ det(23) The filtering value corresponding to θ filt(23) It is expressed as θ det(ij-n) is the reference point θ of the i-th period ref(n) represents the detected value closest to θ det(2j-5) is the reference point θ of the second period ref(5) represents the closest detected value to the filtered value θ filt(2j-5) is θ det(2j-5) corresponds to θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of the cal(2-5) is the reference point θ ref(5) represents the calibration value of the second period of θ cal(2-5) =θ filt(2j-5) -θ det(2j-5) . Reference point θ ref(5) The calibration values of the p periods are θ cal(1-5) , θ cal(2-5) , , θ cal(p-5) These p calibration values are then equalized to obtain the target calibration value θ cal(5) Then, θ ref(5) and θ cal(5) and may be stored in a calibration look-up table in one-to-one correspondence.
[0040] Specifically, each reference point θ ref(n) p periods of θ cal(i-n) is low-pass filtered to obtain the target calibration value θ cal(n) That is, we obtain the θ of p periods. cal(i-n) is input to the second filter and low-pass filtered, and then the reference point θ ref(n) The target calibration value θ corresponding to cal(n) is obtained.
[0041] In the self-calibration process of the magnetic encoder, as the rotating shaft rotates at a constant speed, the nonlinear deviation contained in the detection value θdet(i) becomes a signal with a frequency equal to the rotation speed, and the higher the rotation speed, the higher the signal frequency. After low-pass filtering, the nonlinear deviation can be removed or reduced, resulting in a relatively accurate detection result. In the self-calibration process of the magnetic encoder, it is preferable that the rotation speed of the rotating shaft is not too low to prevent large fluctuations in the rotation speed from affecting detection accuracy, and it is also preferable that the rotation speed of the rotating shaft is not too high to prevent excessive requirements on the system clock frequency from increasing hardware costs and calculation costs.
[0042] Preferably, the detected value θ det(i) During the collection process, the rotation speed of the rotating shaft is between 1000 RPM and 5000 RPM. When the rotation speed of the rotating shaft is within this range, the rotation speed of the rotating shaft is stable and relatively accurate detection accuracy can be achieved.
[0043] The comparison module is the reference point θ ref(n) The closest detected value θ det(ij-n) To make it easier to find the distribution of reference points, we define θ ref(1) =0, θ ref(n+1) =θ ref(n) The rule is set as +2K, where K is a positive integer. The advantage of doing so is that when 2K is expressed in binary, only one bit is 1 and the other bits are 0. In this case, each reference point is divided into two parts, a comparison part (higher bits) and a margin part (lower bits), at the bit that is 1, and the bit that is 1 belongs to the comparison part. Detected value θ det(ij) is also divided into a comparison part (higher bits) and a margin part (lower bits), and the detected value θ det(ij) The comparison part and the reference point θ ref(n) and the comparison part of
[0044] Furthermore, the detected value θ det(ij) and reference point θ ref(n) Both are expressed in binary, and the detected value θ det(ij)and the binary number 2K-1 are added together to get θ index(ij) θ index(ij) and each reference point θ ref(n) are compared to each reference point θ ref(n) The closest detected value θ det(ij-n) The detected value θ det(ij) and the binary number 2K-1 are added, which corresponds to "rounding off" the decimal number, and 2K-1 is the detected value θ det(ij) After the addition, if there is no carry, the comparison part of the noise value ymix does not change, and it corresponds to "rounding off". If there is a carry, the detection value θ det(ij) 1 is added to the comparison part, which corresponds to "five entries."
[0045] Preferably, K=4, and the detected value θ det(ij) and reference point θ ref(n) The number of binary bits is 8 or more. det(ij) And the number of binary bits of the reference point may be 8, 12, 16, 20, 24, 28 or 32, etc.
[0046] An example of reference points is shown in Table 1. [Table 1]
[0047] In the example shown in Table 1, 2K=16, K=4, and the detected value θ det(ij) The number of binary bits at the reference point is 8, and the detected value θ det(ij) The upper 4 bits of the reference point are the comparison part, and the lower 4 bits are the margin part. The binary number of 2K-1 is expressed as 00001000. The first detection value θ det(i1) If is 00010001 (17 in decimal), then θ index(i1) =θ det(i1) +2K-1=00010001+00001000=00011001, and θ index(i1) By comparing the upper 4 bits of the second detection value θ with the upper 4 bits of the reference point, the closest value 00010000 (decimal 16) can be quickly found. det(i2) If is 00011101 (29 in decimal), then θ index(i2) =θdet(i2) +2K-1=00011101+00001000=00100101, and θ index(i2) By comparing the upper four bits of this with the upper four bits of the reference point, we can quickly find the closest 00100000 (32 in decimal).
[0048] In some examples, the most significant 4 bits of each reference point are its sequence number, and θ index(ij) The most significant four bits of the seq_number can be compared with the sequence number of each reference point to quickly find the closest reference point.
[0049] Note that the units of the reference points shown in Table 1 are not degrees, and the given numerical values do not directly indicate angles in degrees. For convenience of binary representation, 360° is represented by 2R, where R is a positive integer. For example, if R = 8, 256 (100000000 in binary) represents 360°, 128 (10000000 in binary) represents 180°, and 16 (00010000 in binary) represents 22.5°. In this example, the number of binary storage bits is 8, and 256 (100000000 in binary) represents 360°. However, 100000000 overflows to 00000000, which is considered to be 360° and 0° overlapping. Therefore, in practice, 00000000 may be used to represent 360° or 0°.
[0050] After the calibration look-up table is constructed, in the actual detection operation, the magnetic encoder detects the rotation angle of the rotary shaft as a detected value θ det(x) where x is a positive integer and the detected value θ det(x) The calibration lookup table is searched based on the corresponding target calibration value θ cal(n) and obtain the calibration value θ cor(x) =θ det(x) +θ cal(n) Calculate.
[0051] Preferably, the method for self-calibrating a magnetic encoder realizes data calculation using a hardware description language.
[0052] To achieve high calculation speed, one embodiment of the present application employs a hardware description language (HDL), and the magnetic encoder self-calibration method can implement data calculations using the HDL. It should be understood that the magnetic encoder self-calibration method can also implement data calculations using other methods. The HDL applied in the present application may be VHDL (Very-High-Speed Integrated Circuit Hardware Description Language (LanCuaCe)) or Verilog HDL. Compared to calculations using a microprocessor (MCU), an integrated circuit ultimately generated using a HDL has a significant advantage in terms of fast parallel calculation speed. In mathematical calculations, HDLs tend to perform general multiplication or division between arbitrary numbers with a relatively large number of data bits in an integrated circuit at relatively slow speeds, resulting in excessive hardware costs. Therefore, the present application avoids complex multiplication and division calculations as much as possible. Furthermore, HDLs implement multiplication and division by powers of two using shift operations, resulting in relatively fast calculation speeds for multiplication and division by powers of two.
[0053] Modules as defined herein may be embodied in hardware or software.
[0054] The present application further provides a method for calibrating an angle detection value, comprising: The detected angle value changes periodically, and θ det(ij) represents the jth detected value in the ith period, where i and j are both positive integers. Detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) θ filt(ij) is θ det(ij) and one-to-one correspondence, m reference points θ in 360° ref(n) and set up each reference point θ ref(n) The closest detected value θ det(ij-n) where n and m are positive integers, and 1≦n≦m, m≧2, θ det(ij-n) is the reference point θ of the i-th periodref(n) represents the detected value closest to where θ ref(1) =0, θ ref(n+1) =θ ref(n) +2K, where K is a positive integer, and the detected value θ det(ij) and reference point θ ref(n) are all expressed in binary, and the detected value θ det(ij) and the binary number 2K-1 are added together to get θ index(ij) θ index(ij) and each reference point θ ref(n) and are compared with each reference point θ ref(n) The closest detected value θ det(ij-n) To be found, θ det(ij-n) The filtering value θ corresponding to filt(ij-n) To select, Calibration value θ cal(i-n) =θ filt(ij-n) -θ det(ij-n) Calculate θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of Each reference point θ ref(n) p periods of θ cal(i-n) The target calibration value θ cal(n) θ ref(n) is θ cal(n) where p is a positive integer and p≧2; and Each reference point θ ref(n) and the corresponding target calibration value θ cal(n) and storing the values in one-to-one correspondence to obtain a calibration look-up table.
[0055] Preferably, θ is expressed in binary. index(ij) and θ ref(n) are respectively divided into a comparison part and a margin part, where a bit that is 1 in 2K binary numbers is a split reference bit, the split reference bit and bits higher than the split reference bit belong to the comparison part, and bits lower than the split reference bit belong to the margin part; θ index(ij) and one of the reference points θ ref(n) Compared with θ index(ij)The comparison part of this θ ref(n) Compare with the comparison part of.
[0056] For example, when K=4, 2K is represented as 00010000, and the fifth bit counting from the left (lower bit) is 1, and this bit is used as the division reference bit. det(ij) , θ index(ij) , θ ref(n) The upper 4 bits of are the comparison part, and the lower 4 bits are the margin part. The binary number of 2K-1 is expressed as 00001000. Referring to Table 1, if the detected value θdet(i1) is 00010001 (17 in decimal), then θ index(i1) =θ det(i1) +2K-1=00010001+00001000=00011001, and θ index(i1) By comparing the upper four bits of this with the upper four bits of the reference point, we can quickly find the closest 00010000 (decimal 16).
[0057] The division here may be virtual, and there is no need to perform actual division calculations.
[0058] The above are only preferred embodiments of the present application, and do not limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application should be included within the protection scope of the present application. [Explanation of symbols]
[0059] 10: motor, 11: rotating shaft, 20: magnet, 30: magnetic encoder, 40: subtractor.
Claims
1. A self-calibration method for a magnetic encoder for detecting a rotation angle of a rotary shaft, comprising: The rotary shaft rotates at a constant speed, and the magnetic encoder detects a rotation angle θ of the rotary shaft. det(ij) where i and j are positive integers and θ det(ij) represents the jth detected value in the ith period, Detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) θ filt(ij) is θ det(ij) and one-to-one correspondence, m reference points θ in 360° ref(n) and set up each reference point θ ref(n) The closest detected value θ det(ij-n) where n and m are positive integers, and 1≦n≦m, m≧2, θ det(ij-n) is the reference point θ of the i-th period ref(n) represents the detected value closest to θ det(ij-n) The filtering value θ corresponding to filt(ij-n) To select, Calibration value θ cal(i-n) =θ filt(ij-n) -θ det(ij-n) Calculate θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of Each reference point θ ref(n) p periods of θ cal(i-n) The target calibration value θ cal(n) θ ref(n) is θ cal(n) where p is a positive integer and p≧2; and Each reference point θ ref(n) and the corresponding target calibration value θ cal(n) and storing the values in one-to-one correspondence to obtain a calibration look-up table. A self-calibration method for a magnetic encoder, comprising:
2. Each reference point θ ref(n) p periods of θ cal(i-n) is low-pass filtered to obtain the target calibration value θ cal(n) 2. The method for self-calibrating a magnetic encoder according to claim 1, wherein:
3. 2. The method for self-calibrating a magnetic encoder according to claim 1, wherein in the process of collecting the detection value θdet(i), the rotation speed of the rotating shaft is between 1000 RPM and 5000 RPM.
4. θ ref(1) =0, θ ref(n+1) =θ ref(n) 2. The method for self-calibrating a magnetic encoder according to claim 1, wherein +2K, K is a positive integer.
5. Detected value θ det(ij) and reference point θ ref(n) are all expressed in binary, and the detected value θ det(ij) and the binary number 2K-1 are added together to get θ index(ij) θ index(ij) and each reference point θ ref(n) and are compared with each reference point θ ref(n) The closest detected value θ det(ij-n) The method for self-calibrating a magnetic encoder according to claim 4, wherein:
6. K=4, detection value θ det(ij) and reference point θ ref(n) 6. The self-calibration method for a magnetic encoder according to claim 5, wherein the number of binary bits is 8 or more.
7. After constructing the calibration look-up table, the magnetic encoder detects the rotation angle θ of the rotary shaft. det(x) where x is a positive integer and the detected value θ det(x) The calibration lookup table is searched based on the corresponding target calibration value θ cal(n) and obtain the calibration value θcor(x) = θ det(x) +θ cal(n) 7. The self-calibration method for a magnetic encoder according to claim 1, wherein the following is calculated:
8. 7. The self-calibration method for a magnetic encoder according to claim 1, wherein data calculations are realized using a hardware description language.
9. A motor, The motor is provided with a magnetic encoder and a signal processing circuit, the magnetic encoder is fixed to a stator of the motor, a magnet is provided on an output shaft of the motor, the magnetic encoder is used to detect a rotation angle of the magnet, and the signal processing circuit constructs the calibration lookup table based on the self-calibration method for a magnetic encoder according to any one of claims 1 to 8.
10. The signal processing circuit includes a first filter, a comparison module, a storage module, a correspondence module, a subtractor, and a second filter, and the storage module stores m reference points θ ref(n) and the magnetic encoder stores the detected value θ det(ij) and the detected value θ det(ij) is input to the first filter for low-pass filtering, and then the filtered value θ filt(ij) and the comparison module obtains the detected value θ for each period. det(ij) and each reference point θ ref(n) and compare each reference point θ ref(n) The closest detected value θ det(ij-n) and the correspondence module finds θ det(ij-n) The filtering value θ corresponding to filt(ij-n) Find θ filt(ij-n) and θ det(ij-n) is input to the subtractor and subtracted to obtain the calibration value θ cal(i-n) and obtain p periods of θ cal(i-n) is input to the second filter for low-pass filtering, and then the reference point θ ref(n) The target calibration value θ corresponding to cal(n) 10. The motor according to claim 9, wherein:
11. A method for calibrating an angle detection value, comprising: The detected angle value changes periodically, and θ det(ij) represents the jth detected value in the ith period, where i and j are both positive integers. Detected value θ det(ij) is low-pass filtered to obtain the filtered value θ filt(ij) θ filt(ij) is θ det(ij) and one-to-one correspondence, m reference points θ in 360° ref(n) and set up each reference point θ ref(n) The closest detected value θ det(ij-n) where n and m are positive integers, and 1≦n≦m, m≧2, θ det(ij-n) is the reference point θ of the i-th period ref(n) represents the detected value closest to where θ ref(1) =0, θ ref(n+1) =θ ref(n) +2K, where K is a positive integer, and the detected value θ det(ij) and reference point θ ref(n) are all expressed in binary, and the detected value θ det(ij) and the binary number 2K-1 are added together to get θ index(ij) θ index(ij) and each reference point θ ref(n) and are compared with each reference point θ ref(n) The closest detected value θ det(ij-n) To be found, θ det(ij-n) The filtering value θ corresponding to filt(ij-n) To select, Calibration value θ cal(i-n) =θ filt(ij-n) -θ det(ij-n) Calculate θ cal(i-n) is the reference point θ ref(n) represents the calibration value of the i-th period of Each reference point θ ref(n) p periods of θ cal(i-n) The target calibration value θ cal(n) θ ref(n) is θ cal(n) where p is a positive integer and p≧2; and Each reference point θ ref(n) and the corresponding target calibration value θ cal(n) and storing the values in one-to-one correspondence to obtain a calibration look-up table.
10. A method for calibrating an angle detection value, comprising:
12. θ in binary index(ij) and θ ref(n) are divided into a comparison part and a margin part, where a bit that is 1 in 2K binary numbers is a division reference bit, the division reference bit and bits higher than the division reference bit belong to the comparison part, and bits lower than the division reference bit belong to the margin part; θ index(ij) and one of the reference points θ ref(n) Compared with θ index(ij) The comparison part of this θ ref(n) 12. The method for calibrating an angle detection value according to claim 11, wherein the comparison part of the angle detection value is compared with the comparison part of the angle detection value.
13. Each reference point θ ref(n) p periods of θ cal(i-n) is low-pass filtered to obtain the target calibration value θ cal(n) 12. The method for calibrating an angle detection value according to claim 11, wherein:
14. K=4, detection value θ det(ij) and reference point θ ref(n) 12. The method for calibrating an angle detection value according to claim 11, wherein the number of binary bits is 8 or more.
15. 15. The method for calibrating an angle detection value according to claim 11, wherein the method realizes data calculations using a hardware description language.
Citation Information
Patent Citations
Winding integrated magnetoelectric encoder and independent calibration method thereof
CN111750903A
Self-calibration device of magnetoelectric encoder
CN114001768A
Signal error correction method, magnetic encoder and optical encoder
CN114910112A
Rotation angle detector and rotation control device
JP2004340873A
Method and apparatus for detecting amplitude of sinusoidal wave
JP2008304305A