Position correction method and device of magnetic encoder

By separating and storing multi-turn and single-turn position information in the magnetic encoder and correcting the position when the power is restored, the problem of position information loss after power is solved, and fast and accurate position acquisition is achieved, improving system accuracy and reliability , reduce maintenance needs.

CN119197615APending Publication Date: 2024-12-27JUNCHUANG (XIAMEN) AUTOMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411349375.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The position information of the magnetic encoder is lost after power outage, resulting in inaccurate position after restart, affecting system accuracy and reliability. Existing solutions such as battery backup and mechanical memory have problems with reliability and maintenance costs.

Method used

By dividing the position information of the magnetic encoder into multiple turns absolute values ​​and single turns absolute values, and then comparing the difference value during power recovery to correct position information, determining the change of the absolute values ​​of multiple turns, and adjusting the number of turns to obtain accurate Location.

Benefits of technology

It realizes rapid acquisition of accurate position information during power recovery, improves system accuracy and reliability, reduces maintenance requirements, and avoids the complexity and cost of battery use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119197615A_ABST
    Figure CN119197615A_ABST
Patent Text Reader

Abstract

A position correction method and device of a magnetic encoder are used for correcting position information obtained at the moment when the magnetic encoder is powered on, and comprises the following steps: obtaining a first multi-turn absolute value and a first single-turn absolute value stored when the magnetic encoder is powered off; acquiring position information of the magnetic encoder at the power-on moment, wherein the position information comprises a second single-loop absolute value; comparing an absolute value of a difference value between the first single-turn absolute value and the second single-turn absolute value with a set threshold value, and determining whether the multi-turn absolute value changes in a period after the magnetic encoder is powered off and before the magnetic encoder is powered on according to a comparison result; if so, taking the first multi-turn absolute value and the second single-turn absolute value as actual position information of the magnetic encoder at the power-on moment; if yes, adding one to or subtracting one from the number of turns of the first multi-turn absolute value to obtain a second multi-turn absolute value, and taking the second multi-turn absolute value and the second single-turn absolute value as actual position information of the magnetic encoder at the moment of power-on, accurate position information can be obtained immediately when power is recovered, and precision and reliability are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of magnetic encoders, and in particular to a position correction method and device for a magnetic encoder. Background Art

[0002] A magnetic encoder is a sensor that uses magnetic field changes to achieve precise position detection. It can convert mechanical position into precise digital signals for various applications that require position feedback and control. Magnetic encoders are usually integrated inside servo motors. After the motor is powered off, its position may change due to the following factors:

[0003] 1. External factors: The motor may be subjected to external forces during power failure, such as mechanical vibration, causing its position to shift slightly.

[0004] 2. Mechanical connection: The motor may be connected to external devices through mechanical connections such as gears, belts, sprockets, etc. These connections may cause position changes during power outages due to wear.

[0005] Therefore, when the motor is powered on again, its position may not be consistent with the position when the power was turned off, resulting in a mismatch between the value after power on and the actual position, affecting the accuracy and reliability of the system. Since the magnetic encoder obtains position information by reading changes in the magnetic field, during normal operation, the encoder will update the current position information in real time. When the power is disconnected, when the motor is affected by external factors during the power outage, its position may change, and this change will not be remembered. When the power is turned on again, the magnetic encoder can only collect the position information of a single turn, so the magnetic encoder cannot know how many turns the motor has rotated before and during the power outage, resulting in inaccurate final absolute current position. In order to improve the reliability, accuracy, continuity and safety of the system, it is necessary for the magnetic encoder to be able to memorize the position of multiple turns after power failure.

[0006] At present, the common implementation methods on the market are mainly the following:

[0007] 1. Battery backup: There are built-in batteries in a separate battery box outside the motor, which is connected to the motor via a cable. These batteries power the encoder's key circuits and memory when the main power is off to prevent data loss. Although this method can keep the current position memory valid after power failure, the battery life is limited and needs to be replaced and checked regularly. If the battery is not replaced in time, data loss may occur, increasing maintenance costs. In addition, battery performance may be affected by the environment, temperature, humidity, etc. Under extreme conditions, it may fail, which is a potential risk of battery failure. At the same time, the battery increases the size of the encoder, which may not meet the needs in space-constrained applications.

[0008] 2. Mechanical memory: Through special mechanical design, such as using permanent magnets and mechanical position markers, to physically "remember" the position when the power is off. This method is limited by accuracy and may have large position errors. In addition, mechanical parts are easily affected by factors such as wear, vibration, and pollution. Long-term use may lead to reduced reliability, and the cost of designing and manufacturing mechanical memory systems is also higher.

[0009] Therefore, in view of the above-mentioned problems, it is very necessary to develop a method that enables the magnetic encoder to reliably memorize the position when the power is off, while ensuring safety, reducing maintenance requirements, and not adding additional costs. Summary of the invention

[0010] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art and to propose a position correction method and device for a magnetic encoder, which can obtain accurate position information when the magnetic encoder is powered on, ensure safety, reduce maintenance requirements, and will not increase additional costs.

[0011] The present invention adopts the following technical solution:

[0012] A position correction method for a magnetic encoder is used to correct the position information obtained at the moment the magnetic encoder is powered on. The position information of the magnetic encoder is divided into a multi-turn absolute value and a single-turn absolute value and stored separately. The multi-turn absolute value is the product of the number of turns and the maximum value of a single turn. The correction method includes the following:

[0013] Obtain the first multi-turn absolute value and the first single-turn absolute value stored when the magnetic encoder is powered off; obtain the position information at the moment the magnetic encoder is powered on, which includes the second single-turn absolute value;

[0014] The absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is compared with a set threshold value, and whether the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder is determined according to the comparison result. If not, the first multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on; if so, the number of turns of the first multi-turn absolute value is increased by one or decreased by one to obtain the second multi-turn absolute value, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on.

[0015] The threshold is set to half of the maximum value of a single turn; the absolute value of the difference between the absolute value of the first single turn and the absolute value of the second single turn is compared with the set threshold, and whether the absolute value of the first multi-turn changes during the period after the magnetic encoder is powered off and before it is powered on is determined according to the comparison result, specifically:

[0016] If the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder; if the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, the multi-turn absolute value does not change during the period between power-off and power-on of the magnetic encoder.

[0017] When the multi-turn absolute value changes between the period after the magnetic encoder is powered off and before it is powered on, if the first single-turn absolute value is greater than the second single-turn absolute value, the number of turns of the first multi-turn absolute value is reduced by one to obtain the second multi-turn absolute value; if the first single-turn absolute value is less than the second single-turn absolute value, the number of turns of the first multi-turn absolute value is increased by one to obtain the second multi-turn absolute value.

[0018] The method also includes comparing the first single-turn absolute value with the second single-turn absolute value, and determining the change direction of the actual position information of the magnetic encoder according to the comparison result.

[0019] When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, if the first single-turn absolute value is greater than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves clockwise relative to the position before power-off.

[0020] When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, if the first single-turn absolute value is less than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves counterclockwise relative to the position before power-off.

[0021] When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, if the first single-turn absolute value is greater than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves counterclockwise relative to the position before power-off, and the number of turns of the first multi-turn absolute value is added by one to obtain the second multi-turn absolute value.

[0022] When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, if the first single-turn absolute value is less than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves clockwise relative to the position before power-off, and the number of turns of the first multi-turn absolute value is reduced by one to obtain the second multi-turn absolute value.

[0023] A position correction device for a magnetic encoder, comprising:

[0024] A memory, which divides the position information of the magnetic encoder into multi-turn absolute values ​​and single-turn absolute values ​​for storage respectively, wherein the multi-turn absolute value is the product of the number of turns and the maximum value of a single turn;

[0025] The data acquisition module acquires the first multi-turn absolute value and the first single-turn absolute value stored when the magnetic encoder is powered off; acquires the position information at the moment the magnetic encoder is powered on, which includes the second single-turn absolute value;

[0026] The correction module compares the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value with a set threshold value, and determines whether the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder according to the comparison result. If not, the first multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on; if so, the number of turns of the first multi-turn absolute value is increased by one or decreased by one to obtain the second multi-turn absolute value, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on.

[0027] The memory is configured to store multi-turn absolute values ​​in high bits and single-turn absolute values ​​in low bits, and the actual number of bits allocated to the high and low bits of the memory is determined by the resolution of the magnetic encoder.

[0028] It can be seen from the above description of the present invention that, compared with the prior art, the present invention has the following beneficial effects:

[0029] 1. In the present invention, by obtaining the single-turn absolute value at the moment of power-off and the moment of power-on and comparing it with the set threshold, it is determined according to the comparison result whether the multi-turn absolute value changes during the period after the magnetic encoder is powered off and before it is powered on, and then the position information at the moment of power-on is corrected to ensure that accurate position information can be obtained immediately when power is restored, ensuring accuracy and reliability.

[0030] 2. In the present invention, if the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than a set threshold, the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder, and then the first single-turn absolute value and the second single-turn absolute value are compared to determine the number of turns of the first multi-turn absolute value plus or minus one to obtain the second multi-turn absolute value; if the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, the multi-turn absolute value does not change during the period between power-off and power-on of the magnetic encoder, and the calculation method is simple and easy to implement.

[0031] 3. The present invention also includes comparing the first single-turn absolute value with the second single-turn absolute value, and determining the direction of change of the actual position information of the magnetic encoder according to the comparison result, that is, determining whether the actual position of the magnetic encoder moves clockwise or counterclockwise compared to before the last power failure.

[0032] 4. In the present invention, after the power is restored, there is no need for time-consuming recalibration or reference point search, and the machine can quickly return to normal state. This is crucial for reducing downtime and improving production efficiency, and is suitable for situations requiring high-precision position control, avoiding errors introduced due to incorrect position information and ensuring the accuracy of position information.

[0033] 5. The present invention can be applied to safety-critical systems such as elevators, rail transit, and aerospace. The power-off retention function of the position information can prevent potential dangerous situations caused by loss or error of position information. There is no need to install batteries, and there is no need to consider regular maintenance and checking of battery status, which reduces hardware costs and complexity, and there is no need to worry about installing a battery box affecting space and aesthetics. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 The clockwise change of the position of the magnetic encoder of the present invention at the moment of power-off and power-on Figure 1 (The absolute value of multiple turns does not change).

[0035] Figure 2 The clockwise change of the position of the magnetic encoder of the present invention at the moment of power-off and power-on Figure 2 (The absolute value of multiple turns does not change).

[0036] Figure 3 The counterclockwise change of the position of the magnetic encoder of the present invention at the moment of power off and power on Figure 1 (The absolute value of multiple turns does not change).

[0037] Figure 4 The counterclockwise change of the position of the magnetic encoder of the present invention at the moment of power off and power on Figure 2 (The absolute value of multiple turns does not change).

[0038] Figure 5 This is a schematic diagram of the clockwise change of the position of the magnetic encoder of the present invention at the moment of power-off and power-on (the absolute value of multiple turns changes).

[0039] Figure 6 This is a schematic diagram of the counterclockwise change in position of the magnetic encoder of the present invention at the moment of power-off and power-on (the absolute value of multiple turns changes).

[0040] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. DETAILED DESCRIPTION

[0041] The present invention is further described below through specific implementation modes.

[0042] A position correction method for a magnetic encoder is used to correct the position information obtained when the magnetic encoder is powered on. The encoder divides its position information into multi-turn absolute values ​​and single-turn absolute values ​​in advance and stores them separately. The multi-turn absolute value is the product of the number of turns and the maximum value of a single turn.

[0043] The data storage structure of the magnetic encoder is usually stored in the form of binary or Gray code, where the position information is the main part of the encoder data and is used to represent the absolute position of the encoder. The number of bits of the magnetic encoder is usually between 12 and 32 bits. In the present invention, a 64-bit memory is selected as an example, and the multi-turn position and single-turn position in the encoder data storage structure are stored separately. One part stores the low-order single-turn absolute position information and only reads the position information within one turn. The remaining part stores the high-order multi-turn absolute position information, which is used to detect and store the position information of multiple complete turns. The actual number of bits allocated to the high and low bits is determined by the resolution of the encoder, such as:

[0044] When the encoder is 17 bits, the high and low bits are allocated as follows:

[0045] High position: multi-turn absolute value Low: Single lap absolute value Bit17~bit63 Absolute value of bit0 to bit16

[0046] When the encoder is 23 bits, the high and low bits are allocated as follows:

[0047] High position: multi-turn absolute value Low: Single lap absolute value Bit23~bit63 Bit0~bit22

[0048] When the encoder is 32 bits, the high and low bits are allocated as follows:

[0049] High position: multi-turn absolute value Low: Single lap absolute value Bit31~bit63 Bit0~bit31

[0050] The present invention performs soft origin marking in advance: selecting an appropriate mechanical zero point, mapping the current position of the magnetic encoder to a register, setting the register to "zero", and flexibly adjusting the value of the position setting register. In this step, a magnetic encoder only needs to be successfully marked once, without repeated marking, thereby improving efficiency.

[0051] The correction method of the present invention comprises the following steps:

[0052] S1 obtains the first multi-turn absolute value and the first single-turn absolute value stored when the magnetic encoder is powered off; obtains the position information at the moment the magnetic encoder is powered on, which includes the second single-turn absolute value.

[0053] In this step, the position record at the moment of power failure includes recording the position information of the multi-turn absolute value and the single-turn absolute value, which are respectively the first multi-turn absolute value S and the first single-turn absolute value B. Where S = A*M, A represents the number of turns, M is the maximum value M of the single-turn absolute value, and the value of half a turn is M / 2. Then D = S+B, and D is the total absolute value of the magnetic encoder.

[0054] During the power failure, the position of the motor in a single turn may change. When the change is compared with the half turn, there are different situations, the change is ≤ (M / 2), or the change X> (M / 2).

[0055] At the moment the magnetic encoder is powered on, the real-time position of multiple turns cannot be read, that is, the absolute value of multiple turns cannot be obtained. Only the absolute value of a single turn can be obtained, which is assumed to be the second single turn absolute value B1.

[0056] S2 compares the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value with a set threshold value, and determines whether the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder based on the comparison result. If not, the first multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on; if so, the number of turns of the first multi-turn absolute value is increased by one or decreased by one to obtain the second multi-turn absolute value, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on.

[0057] In this embodiment, the threshold value is set to half of the maximum value of a single turn, that is, half a turn M / 2. In practical applications, the threshold value is not limited to this and can be adjusted according to actual needs. The absolute value C of the difference between the first single turn absolute value B1 and the second single turn absolute value B1 = |B1-B|, then the absolute value C of the multi-turn changes after the magnetic encoder is powered off and before it is powered on, which includes the following situations:

[0058] The first case: If the absolute value C of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold value M / 2, that is, C>(M / 2), then the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder. The number of turns of the first multi-turn absolute value is added or subtracted by one to obtain the second multi-turn absolute value S1, that is, S1=(A+1)*M, or S1=(A-1)*M, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment of power-on of the magnetic encoder. That is, the total absolute value D1 of the magnetic encoder is D1=S1+B1=(A+1)*M+B1, or the total absolute value D1 of the magnetic encoder is D1=S1+B1=(A-1)*M+B1.

[0059] Specifically, the first single-turn absolute value is compared with the second single-turn absolute value to determine the second multi-turn absolute value S1. If the first single-turn absolute value is greater than the second single-turn absolute value, the number of turns of the first multi-turn absolute value is increased by one to obtain the second multi-turn absolute value S1, that is, S1 = (A + 1) * M. If the first single-turn absolute value is less than the second single-turn absolute value, the number of turns of the first multi-turn absolute value is reduced by one to obtain the second multi-turn absolute value S1, that is, S1 = (A-1) * M.

[0060] The second case: if the absolute value C of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold value M / 2, C≤(M / 2), then the multi-turn absolute value does not change during the period between power-off and power-on of the magnetic encoder, that is, only the single-turn absolute value changes, and the second multi-turn absolute value of the magnetic encoder is the same as the first multi-turn absolute value, and the second multi-turn absolute value S1=S=A*M. The total absolute value D1=S+B1=A*M+B1 of the magnetic encoder.

[0061] In this embodiment, it is defined that the absolute value of the encoder increases counterclockwise and the absolute value decreases clockwise, and also includes comparing the first single-turn absolute value with the second single-turn absolute value, and determining the direction of change of the actual position information of the magnetic encoder according to the comparison result.

[0062] The specific situations include the following:

[0063] 1) When the absolute value C of the difference between the first single-turn absolute value B and the second single-turn absolute value B1 is less than or equal to the set threshold, and in the counterclockwise direction, the first single-turn absolute value B is greater than the second single-turn absolute value B1, then the actual position of the encoder at the moment of power-on is clockwise relative to the position before power-off. This situation corresponds to the multi-turn absolute value in the previous text. There is no change in the period between power-off and power-on of the magnetic encoder. For example:

[0064] See also Figure 1 The left picture shows the position corresponding to the absolute value B of the first single turn at the moment of power failure, which is located on the left side of the zero point. The right picture shows the position corresponding to the absolute value B1 of the second single turn at the moment of power failure, which is also located on the left side of the zero point, and the distance between the position corresponding to B1 and the zero point is smaller than the distance between the position corresponding to B and the zero point. It can be seen that at the moment of power failure, the actual position of the magnetic encoder moves clockwise compared to the last time before power failure.

[0065] See also Figure 2 The left picture shows the position corresponding to the absolute value B of the first single turn at the moment of power failure, which is located on the right side of the zero point. The right picture shows the position corresponding to the absolute value B1 of the second single turn at the moment of power-on, which is also located on the right side of the zero point, and the distance between the position corresponding to B1 and the zero point is smaller than the distance between the position corresponding to B and the zero point. It can be seen that at the moment of power-on, the actual position of the magnetic encoder moves clockwise compared to the last time before power failure.

[0066] 2) When the absolute value C of the difference between the first single-turn absolute value B and the second single-turn absolute value B1 is less than or equal to the set threshold, and the first single-turn absolute value B is less than the second single-turn absolute value B1, the actual position of the encoder at the moment of power-on is counterclockwise relative to the position before power-off. Example:

[0067] See also Figure 3The left picture shows the position corresponding to the absolute value B of the first single turn at the moment of power failure, which is located on the left side of the zero point. The right picture shows the position corresponding to the absolute value B1 of the second single turn at the moment of power failure, which is also located on the left side of the zero point, and the distance between the position corresponding to B1 and the zero point is greater than the distance between the position corresponding to B and the zero point. It can be seen that at the moment of power failure, the actual position of the magnetic encoder moves counterclockwise compared to the last time before power failure.

[0068] See also Figure 4 The left picture shows the position corresponding to the absolute value B of the first single turn at the moment of power failure, which is located on the right side of the zero point. The right picture shows the position corresponding to the absolute value B1 of the second single turn at the moment of power-on, which is also located on the right side of the zero point, and the distance between the position corresponding to B1 and the zero point is greater than the distance between the position corresponding to B and the zero point. It can be seen that at the moment of power-on, the actual position of the magnetic encoder moves counterclockwise compared to the last time before power failure.

[0069] 3) When the absolute value C of the difference between the first single-turn absolute value B and the second single-turn absolute value B1 is greater than the set threshold, if the first single-turn absolute value B is less than the second single-turn absolute value B1, the actual position of the encoder at the moment of power-on moves clockwise relative to the position before power-off.

[0070] See also Figure 5 , the left picture shows the position of the first single-turn absolute value B at the moment of power failure, which is located on the left side of the zero point, and the right picture shows the position of the second single-turn absolute value B1 at the moment of power-on, which is located on the right side of the zero point. It can be seen that at the moment of power-on, the actual position of the magnetic encoder moves clockwise compared to the last time it was powered off. In this case, the multi-turn absolute value corresponding to the previous text changes during the period after the magnetic encoder is powered off and before it is powered on, and the total absolute value of the magnetic encoder is D1=S1+B1=(A-1)*M+B1.

[0071] 4) When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, if the first single-turn absolute value is greater than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves counterclockwise relative to the position before power-off.

[0072] See also Figure 6 , the left picture shows the position of the first single-turn absolute value B at the moment of power failure, which is located on the right side of the zero point, and the right picture shows the position of the second single-turn absolute value B1 at the moment of power-on, which is located on the left side of the zero point. It can be seen that at the moment of power-on, the actual position of the magnetic encoder moves counterclockwise compared to the last time it was powered off. This situation corresponds to the change of the multi-turn absolute value in the previous text between the time when the magnetic encoder is powered off and before it is powered on. The total absolute value of the encoder is: D = S1 + B1 = (A + 1) * M + B1.

[0073] The present invention uses a method of position comparison within half a turn, so that even if the position of the motor changes during power failure, the actual positions of multiple turns and single turns of the motor can still be accurately obtained after the magnetic encoder is powered on.

[0074] Based on this, the present invention further proposes a position correction device for a magnetic encoder, which adopts the above-mentioned position correction method for a magnetic encoder, comprising:

[0075] The memory divides the position information of the magnetic encoder into multi-turn absolute values ​​and single-turn absolute values ​​for storage. The multi-turn absolute value is the product of the number of turns and the maximum value of a single turn. The memory is configured to store multi-turn absolute values ​​in high bits and single-turn absolute values ​​in low bits. The actual number of bits allocated to the high and low bits of the memory is determined by the resolution of the magnetic encoder.

[0076] The data acquisition module acquires the first multi-turn absolute value and the first single-turn absolute value stored when the magnetic encoder is powered off; and acquires the position information of the magnetic encoder at the moment of power-on, which includes the second single-turn absolute value.

[0077] The correction module compares the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value with a set threshold value, and determines whether the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder according to the comparison result. If not, the first multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on; if so, the number of turns of the first multi-turn absolute value is increased by one or decreased by one to obtain the second multi-turn absolute value, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on.

[0078] The data acquisition module and the correction module are used to execute step S1 and step S2 of the above-mentioned method for position correction of a magnetic encoder.

[0079] Application examples:

[0080] Take a 23-bit magnetic encoder as an example, its resolution is 2^23. The absolute value of a single turn is the number of pulses in one turn, that is, the number of pulses in one turn is: 2^23 = 8,388,608. The number of pulses in half a turn is: 4,194,304. When the motor rotates, each time a pulse is detected, the magnetic encoder will increase by 1 and store it in the memory. If the motor is powered off after rotating more than 2 turns, the operation is as follows:

[0081] Get the current location information at the moment of power failure, such as:

[0082] The absolute value of the multi-turn read at the high position is: 2*8,388,608=16,777,216;

[0083] The absolute value of a single circle read at the low bit is: 8,388,600.

[0084] Assume that the motor jitters during a power outage and the position of the motor changes.

[0085] At the moment of power-on, obtain the single-turn position information:

[0086] The absolute value of the single turn read at the low position is 100 pulses. Since the magnetic encoder can read the real-time position of a single turn but cannot read the real-time position of multiple turns.

[0087] Judgment of the current actual position:

[0088] Take the absolute value: |100 (the absolute value of a single turn at the moment of power-on) - 8,388,600 (the absolute value of a single turn at the moment of power outage)| = 8,388,500, and it is greater than half of the turn value of 4,194,304. Since: B1 < B, that is, 100 < 8,388,600. It can be seen that at the moment of power-on, compared with before the previous power outage, the actual position of the magnetic encoder has moved counterclockwise. And the positions of multiple turns and single turn have changed simultaneously, indicating that one turn has been completed. So the position of multiple turns has changed. At this time, the number of multiple turns of the actual current position of the magnetic encoder is:

[0089] A + 1 = 2 + 1 = 3 turns;

[0090] The absolute value of multiple turns is: 3 * 8,388,608 = 25,165,824 pulses;

[0091] The absolute value of a single turn is: 100 pulses;

[0092] The total absolute value of the encoder is the sum of the absolute value of multiple turns and the absolute value of a single turn: The total absolute value of the current position = 25,165,824 + 100 = 25,165,924 pulses.

[0093] In this way, the multi-turn position memory of the motor after a power outage can be accurately judged.

[0094] In the present invention, for terms such as "first", "second", "third", etc., they are only used to distinguish similar objects and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For the description, the orientation or positional relationship indicated by "up", "down", "left", "right", "front" and "back" is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and does not indicate or imply that the device referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the protection scope of the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0095] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0096] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.

Claims

1. A method for correcting the position of a magnetic encoder, used to correct the position information obtained when the magnetic encoder is powered on, characterized in that: The position information of the magnetic encoder is divided into multi-turn absolute values ​​and single-turn absolute values ​​for storage respectively. The multi-turn absolute value is the product of the number of turns and the maximum value of a single turn. The correction method includes the following: Acquire the first multi-turn absolute value and the first single-turn absolute value stored when the magnetic encoder is powered off; acquire the position information at the moment the magnetic encoder is powered on, which includes the second single-turn absolute value; The absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is compared with a set threshold value, and whether the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder is determined according to the comparison result; if not, the first multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on; if so, the number of turns of the first multi-turn absolute value is increased by one or decreased by one to obtain a second multi-turn absolute value, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information at the moment the magnetic encoder is powered on.

2. A method for position correction of a magnetic encoder as claimed in claim 1, characterized in that: The threshold is set to half of the maximum value of a single turn; the absolute value of the difference between the first single turn absolute value and the second single turn absolute value is compared with the set threshold, and whether the first multi-turn absolute value changes during the period after the magnetic encoder is powered off and before it is powered on is determined according to the comparison result, specifically: If the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, the multi-turn absolute value changes during the period after the magnetic encoder is powered off and before it is powered on; if the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, the multi-turn absolute value does not change during the period after the magnetic encoder is powered off and before it is powered on.

3. A method for position correction of a magnetic encoder as claimed in claim 1, characterized in that: When the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder, if the first single-turn absolute value is greater than the second single-turn absolute value, the number of turns of the first multi-turn absolute value is subtracted by one to obtain the second multi-turn absolute value; if the first single-turn absolute value is less than the second single-turn absolute value, the number of turns of the first multi-turn absolute value is increased by one to obtain the second multi-turn absolute value.

4. A method for position correction of a magnetic encoder as claimed in claim 1, characterized in that: The method further includes comparing the first single-turn absolute value with the second single-turn absolute value, and determining a change direction of actual position information of the magnetic encoder according to the comparison result.

5. A method for position correction of a magnetic encoder as claimed in claim 4, characterized in that: When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, if the first single-turn absolute value is greater than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves clockwise relative to the position before power-off.

6. A method for position correction of a magnetic encoder as claimed in claim 4, characterized in that: When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is less than or equal to the set threshold, if the first single-turn absolute value is less than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves counterclockwise relative to the position before power-off.

7. A method for position correction of a magnetic encoder as claimed in claim 4, characterized in that: When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, if the first single-turn absolute value is greater than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves counterclockwise relative to the position before power-off, and the number of turns of the first multi-turn absolute value is added by one to obtain the second multi-turn absolute value.

8. A method for position correction of a magnetic encoder as claimed in claim 4, characterized in that: When the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value is greater than the set threshold, if the first single-turn absolute value is less than the second single-turn absolute value, the actual position of the encoder at the moment of power-on moves clockwise relative to the position before power-off, and the number of turns of the first multi-turn absolute value is subtracted by one to obtain the second multi-turn absolute value.

9. A position correction device for a magnetic encoder, characterized in that: include A memory, which divides the position information of the magnetic encoder into multi-turn absolute values ​​and single-turn absolute values ​​for storage respectively, wherein the multi-turn absolute value is the product of the number of turns and the maximum value of a single turn; A data acquisition module is used to acquire the first multi-turn absolute value and the first single-turn absolute value stored when the magnetic encoder is powered off; and to acquire the position information of the magnetic encoder at the moment of powering on, which includes the second single-turn absolute value; The correction module compares the absolute value of the difference between the first single-turn absolute value and the second single-turn absolute value with a set threshold value, and determines whether the multi-turn absolute value changes during the period between power-off and power-on of the magnetic encoder according to the comparison result; if not, the first multi-turn absolute value and the second single-turn absolute value are used as the actual position information of the magnetic encoder at the moment of power-on; if so, the number of turns of the first multi-turn absolute value is increased by one or decreased by one to obtain the second multi-turn absolute value, and the second multi-turn absolute value and the second single-turn absolute value are used as the actual position information of the magnetic encoder at the moment of power-on.

10. A position correction device for a magnetic encoder as claimed in claim 9, characterized in that: The memory is configured to store the multi-turn absolute value in a high-order bit and the single-turn absolute value in a low-order bit, and the actual number of bits allocated to the high-order bit and the low-order bit of the memory is determined by the resolution of the magnetic encoder.