Method, device and storage medium for calculating absolute position of infinite rotation of motor

By reading the number and value of the historical multi-turn overflow, combined with the data of the power-on state encoder, the target overflow count is calculated to determine the initial absolute position of the motor, which solves the problem of inaccurate position calculation caused by artificial rotation after power outage, and realizes accurate absolute position recording and calculation.

CN114665757BActive Publication Date: 2025-03-14SHENZHEN YAKO AUTOMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210141437.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-03-14
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

In the prior art, if the motor is turned artificially after power off, the encoder value may overflow when powered on again, resulting in inaccurate calculation of the absolute position of the motor.

Method used

By reading the historical multi-turn overflow times and historical multi-turn values ​​in the drive, and combining the multi-turn values ​​and single-turn values ​​of the power-on state encoder, the target overflow times are calculated, and the initial absolute position of the motor is determined. This method updates the absolute position during each control cycle until the driver is powered off.

Benefits of technology

It realizes that after the motor is turned off, the absolute position of the motor is accurately recorded and calculated, avoiding position calculation errors caused by overflow of multiple turns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114665757B_ABST
    Figure CN114665757B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium for calculating the absolute position of an infinitely rotating motor, including: when the driver is in a power-on state, reading the historical multi-turn overflow times and historical multi-turn values, and reading the multi-turn values ​​and single-turn values ​​of the encoder in the power-on state, based on the historical multi-turn values ​​and multi-turn values, if it is determined that the motor shaft has been rotated after power failure, then based on the historical multi-turn values, the historical multi-turn overflow times, the multi-turn values ​​and the preset multi-turn upper limit value, the target overflow times are calculated, based on the single-turn value, the multi-turn value, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow times, the initial absolute position of the motor is determined, when the driver is in a running state, reading the single-turn value of the current control cycle, calculating the encoder position increment based on the single-turn value of the current control cycle and the single-turn value of the power-on state, and determining the absolute position of the motor based on the initial absolute position and the encoder position increment. The present application solves the technical problem that the absolute position of the motor is inaccurately calculated due to the rotation of the motor shaft after power failure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of servo motors, and in particular to a method, device and storage medium for calculating the absolute position of an infinitely rotating motor. Background Art

[0002] In industrial manufacturing, AC permanent magnet synchronous motors are required to drive equipment. In order to achieve precise position and speed control of the motor, the motor must be equipped with an encoder. High-precision absolute encoders can detect the single-turn and multi-turn values ​​of the motor. However, both the single-turn and multi-turn values ​​have upper limits in value. When the multi-turn value upper limit is exceeded, the multi-turn value will overflow and start counting from 0 again. Furthermore, after the system is powered off, if the motor shaft is rotated by external force, the encoder multi-turn value may overflow. When the driver is powered on, the actual multi-turn value is still calculated according to the previously saved overflow number and multi-turn value, which leads to inaccurate calculation of the absolute position of the motor. Summary of the invention

[0003] The main purpose of the present application is to provide a method, device and storage medium for calculating the absolute position of a motor with infinite rotation, aiming to solve the technical problem in the prior art that the absolute position of the motor may be inaccurately calculated due to excessive rotation of the motor shaft after power failure.

[0004] To achieve the above-mentioned purpose, the present application provides a method for calculating the absolute position of a motor with infinite rotation, which is applied to an infinite rotation absolute value servo device, and the method for calculating the absolute position of a motor with infinite rotation includes:

[0005] When the driver is in a power-on state, reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver, and reading the multi-turn values ​​and single-turn values ​​of the power-on state encoder;

[0006] Based on the historical multi-turn value and the multi-turn value, if it is determined that the motor shaft has been rotated after power failure, a target overflow number in a power-on state is calculated based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder, and a preset multi-turn upper limit value;

[0007] Determine the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow number;

[0008] When the driver is in operation, reading the multi-turn value and the single-turn value of the encoder of the current control cycle;

[0009] Calculate the absolute position of the motor in the current control period based on the single-turn value of the encoder in the current control period, the single-turn value of the encoder in the power-on state, and the initial absolute position of the motor;

[0010] If the driver is not in the power-off state, return to the execution step: read the single-turn value of the encoder of the current control cycle to determine the absolute position of the motor in the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the previous control cycle and the absolute position of the motor in the previous control cycle until the driver is in the power-off state.

[0011] The present application also provides a motor infinite rotation absolute position calculation system, the motor infinite rotation absolute position calculation system is a virtual device, and the motor infinite rotation absolute position calculation system includes:

[0012] A power-on reading module, used for reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver when the driver is in a power-on state, and reading the multi-turn values ​​and single-turn values ​​of the encoder in the power-on state;

[0013] A first calculation module is configured to calculate a target overflow number in a power-on state based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder, and a preset multi-turn upper limit value if it is determined that the motor shaft has been rotated after power failure based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder, and a preset multi-turn upper limit value;

[0014] An initial absolute position determination module, used to determine the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow number;

[0015] An operation reading module is used to read the multi-turn value and the single-turn value of the encoder of the current control cycle when the driver is in the operation state;

[0016] A current absolute position determination module, used to calculate the absolute position of the motor in the current control period based on the single-turn value of the encoder in the current control period, the single-turn value of the encoder in the power-on state and the initial absolute position of the motor;

[0017] A loop determination module is used to return to the execution step if the driver is not in a power-off state: reading the single-turn value of the encoder of the current control cycle to determine the absolute position of the motor in the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the previous control cycle and the absolute position of the motor in the previous control cycle until the driver is in a power-off state.

[0018] The present application also provides a motor infinite rotation absolute position calculation device, which is a physical device, and includes: a memory, a processor, and a motor infinite rotation absolute position calculation program stored in the memory, and the motor infinite rotation absolute position calculation program is executed by the processor to implement the steps of the motor infinite rotation absolute position calculation method as described above.

[0019] The present application also provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores a motor infinite rotation absolute position calculation program, and the motor infinite rotation absolute position calculation program is executed by a processor to implement the steps of the motor infinite rotation absolute position calculation method as described above.

[0020] The present application provides a method, device and storage medium for calculating the absolute position of an infinite rotation of a motor. The present application first reads the historical multi-turn overflow times and historical multi-turn values ​​of a memory in the driver when the driver is in a power-on state, and reads the multi-turn value and single-turn value of a power-on state encoder. Then, based on the historical multi-turn value and the multi-turn value, if it is determined that the motor shaft has been rotated after power failure, the target overflow times in the power-on state are calculated based on the historical multi-turn value of the memory, the historical multi-turn overflow times in the memory, the multi-turn value of the encoder and a preset multi-turn upper limit value, and further , based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow number, determine the initial absolute position of the motor, and then when the driver is in the running state, read the multi-turn value and single-turn value of the encoder of the current control period, and then calculate the absolute position of the motor in the current control period based on the single-turn value of the encoder of the current control period, the single-turn value of the encoder in the power-on state and the initial absolute position of the motor, and finally, if the driver is not in the power-off state, return to the execution step: read the single-turn value of the encoder of the current control period, with Based on the single-turn value of the current control cycle and the single-turn value of the previous control cycle and the absolute position of the motor in the previous control cycle, the absolute position of the motor in the current control cycle is determined until the driver is in a power-off state, thereby realizing that when the driver is in a power-on state, the multi-turn value of the memory and the multi-turn value of the encoder are used to determine whether the driver has been manually rotated before power-on, that is, after power-off, so as to re-update the target overflow number of the multi-turn value, and then calculate the absolute position taking the target overflow number into consideration, so as to accurately obtain the initial absolute position of the motor in the power-on state. Further, when the driver is in a running state, the absolute position of the motor in the current control cycle is determined according to the single-turn value of the current control cycle and the single-turn value of the encoder in the power-on state, as well as the initial absolute position of the motor and the encoder position increment. In addition, in each subsequent control cycle, the absolute position of the motor in the current control cycle and the previous control cycle and the single-turn value are directly calculated to obtain the absolute position of the motor in the current control cycle until the driver is in a power-off state, so that even after the system is powered off, the driver is manually rotated, and the absolute position of the motor when it rotates infinitely can be accurately recorded. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 This is a flow chart of the first embodiment of the method for calculating the absolute position of an infinitely rotating motor of the present application;

[0024] Figure 2 This is a flow chart of a second embodiment of the method for calculating the absolute position of an infinitely rotating motor of the present application;

[0025] Figure 3 This is a flow chart of a third embodiment of the method for calculating the absolute position of an infinitely rotating motor of the present application;

[0026] Figure 4 This is a schematic diagram of the structure of a motor infinite rotation absolute position calculation device in the hardware operating environment involved in the embodiment of the present application;

[0027] Figure 5 This is a schematic diagram of the functional modules of the motor infinite rotation absolute position calculation system of this application.

[0028] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0029] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0030] The present application embodiment provides a method for calculating the absolute position of a motor with infinite rotation. In the first embodiment of the method for calculating the absolute position of a motor with infinite rotation, refer to Figure 1 , the method for calculating the absolute position of the motor with infinite rotation includes:

[0031] Step S10, when the driver is in a power-on state, reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver, and reading the multi-turn value and single-turn value of the power-on state encoder;

[0032] In this embodiment, it should be noted that the infinite rotation absolute position calculation method of the motor is applied to an infinite rotation absolute value servo device, which includes a driver, a motor and an encoder connected to the motor shaft, wherein the driver includes a memory and a core processor CPU, wherein the encoder is used to obtain the multi-turn value and the single-turn value of the motor, and the CPU is used to count the number of overflows when the current multi-turn value reaches the preset multi-turn upper limit value, and store the overflow number and the multi-turn value in the memory, and in addition, the infinite rotation absolute value servo device also includes a battery, which is used to power the encoder after the power supply of the encoder is powered off. The encoder cannot save the current actual multi-turn value after power failure, so in order to still obtain the current actual multi-turn value after power failure, the encoder needs to be powered by an external battery.

[0033] Wherein, after the step of reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver when the driver is in the power-on state, and reading the multi-turn values ​​and single-turn values ​​of the power-on state encoder, the method for calculating the absolute position of infinite rotation of the motor further includes:

[0034] Step A10: If the historical multi-turn value is equal to the multi-turn value, it is determined that the motor shaft has not been rotated after power failure, and the historical multi-turn overflow number is used as the target overflow number.

[0035] In this embodiment, specifically, if the historical multi-turn value is equal to the multi-turn value, it is determined that the motor shaft has not been artificially rotated after power failure, and the historical multi-turn overflow number stored in the memory is directly used as the target overflow number.

[0036] Step S20, based on the historical multi-turn value of the memory and the multi-turn value of the encoder, if it is determined that the motor shaft has been rotated after power failure, then based on the historical multi-turn value of the memory, the historical multi-turn overflow times of the memory, the multi-turn value of the encoder and a preset multi-turn upper limit value, a target overflow times in the power-on state is calculated;

[0037] In this embodiment, specifically, the historical multi-turn value is compared with the multi-turn value. If the historical multi-turn value is not equal to the multi-turn value, it proves that the motor shaft has been rotated after power failure, and then the historical multi-turn value of the memory, the multi-turn value of the encoder and the preset multi-turn upper limit value are compared and analyzed to determine the target overflow number of the power-on state based on the analysis result. This overcomes the technical problem that if the driver is artificially rotated after power failure, the actual multi-turn value is still calculated according to the previously saved overflow number and multi-turn value after the driver is powered on, resulting in errors.

[0038] Among them, the step of calculating the target overflow count in the power-on state based on the historical multi-turn value of the memory, the historical multi-turn overflow count of the memory, the multi-turn value of the encoder, and the preset multi-turn upper limit value includes:

[0039] Step S21, comparing and analyzing the historical multi-turn value of the memory, the multi-turn value of the encoder, and the preset multi-turn upper limit value;

[0040] Step S22, if then the target overflow count is Z = Z1;

[0041] Step S23, if and Y1 > Y, then the target overflow count is Z = Z1 + 1;

[0042] Step S24, if and Y1 < Y, then the target overflow count is Z = Z1 - 1;

[0043] Among them, Y1 is the historical multi-turn value of the memory, Y is the multi-turn value of the encoder, N is the preset multi-turn upper limit value, Z is the target overflow count, and Z1 is the historical multi-turn overflow count of the memory.

[0044] In this embodiment, specifically, if then it proves that the absolute value of the difference between the historical multi-turn value and the multi-turn value is relatively small. Furthermore, the historical overflow count in the memory is used as the target overflow count. Further, if then the historical multi-turn value and the multi-turn value are further compared. If the historical multi-turn value is greater than the multi-turn value, it proves that there is an artificial positive rotation of the driver after power-off. Furthermore, the historical overflow count is incremented by 1 to obtain the target overflow count. If the historical multi-turn value is less than the multi-turn value, it proves that there is an artificial reverse rotation of the driver after power-off. Furthermore, the historical overflow count is decremented by 1 to obtain the target overflow count.

[0045] Step S30, determining the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value, and the target overflow count;

[0046] In this embodiment, specifically, first, based on the multi-turn value of the encoder, the preset multi-turn upper limit value, and the target overflow count, the actual multi-turn value in the power-on state is calculated. Furthermore, based on the actual multi-turn value in the power-on state, the single-turn value, and the preset single-turn upper limit value, the initial absolute position of the motor is determined.

[0047] Among them, the step of determining the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value, and the target overflow count includes:

[0048] Step S31, calculating the actual multi-turn value in the power-on state based on the multi-turn value of the encoder, the preset multi-turn upper limit value and the target overflow number;

[0049] In this embodiment, specifically, the actual multi-turn value of the motor is determined based on the multi-turn value of the current encoder, the preset multi-turn upper limit value and the number of overflows, wherein the actual multi-turn value in the power-on state = the preset multi-turn upper limit value * the target number of overflows + the multi-turn value, and the current actual multi-turn value is obtained by taking the number of overflows of the multi-turn value into consideration, so that the absolute position of the motor can be accurately obtained based on the current actual multi-turn value.

[0050] Step S32, determining the initial absolute position of the motor based on the actual multi-turn value in the power-on state, the preset single-turn upper limit value and the single-turn value.

[0051] In this embodiment, specifically, the initial absolute position of the motor=actual multi-turn value in the power-on state*preset single-turn upper limit value+single-turn value.

[0052] Step S40, when the driver is in operation, reading the multi-turn value and the single-turn value of the encoder of the current control cycle;

[0053] In this embodiment, specifically, after power-on, the driver enters the running state. During the running process, the single-turn value of the current control cycle is obtained. In addition, the multi-turn value of the current control cycle encoder is also read, wherein the current control cycle is a preset time period. During the running process, there are multiple control cycles, for example, each 100us can be regarded as a control cycle.

[0054] Step S50, calculating the absolute position of the motor in the current control period based on the single-turn value of the encoder in the current control period, the single-turn value of the encoder in the power-on state, and the initial absolute position of the motor;

[0055] In this embodiment, specifically, when the driver is in the first control cycle of the running state, the single-turn value of the power-on state encoder is used as the initial single-turn value, and then the difference between the single-turn value of the current control cycle and the initial single-turn value is calculated, and then the difference and the preset single-turn upper limit value are compared and analyzed to determine the encoder position increment of the current control cycle based on the analysis result, and further, based on the initial absolute position of the motor and the encoder position increment, the absolute position of the motor in the current control cycle is calculated.

[0056] Step S60, if the driver is not in the power-off state, return to the execution step: read the single-turn value of the encoder of the current control cycle to determine the absolute position of the motor in the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the previous control cycle and the absolute position of the motor in the previous control cycle until the driver is in the power-off state.

[0057] In this embodiment, specifically, after the absolute position corresponding to the first control cycle is calculated, if the driver is not in a power-off state, that is, the driver is still in a running state, the execution step is returned to: reading the single-turn value of the encoder of the current control cycle, that is, continuing to read the single-turn value of the encoder of the current control cycle, and then calculating the encoder position increment of the current control cycle (the second control cycle) based on the single-turn value of the current control cycle and the single-turn value of the previous control cycle. Further, based on the encoder position increment of the current control cycle and the absolute position of the motor in the previous control cycle, the absolute position of the motor in the current control cycle is calculated by a preset position calculation method, wherein the preset position calculation method is P=P1+Δx, Δx is the encoder position increment of the current control cycle, P1 is the absolute position of the motor in the previous control cycle, and P is the absolute position of the motor in the current control cycle. Then, in each control cycle during the operation of the driver, the absolute position of the motor in the previous control cycle and the encoder position increment of the current control cycle are directly used to calculate the absolute position of the motor in the current control cycle until the driver is in a power-off state, thereby reducing the amount of CPU calculation during operation.

[0058] The embodiment of the present application provides a method, device and storage medium for calculating the absolute position of infinite rotation of a motor. The embodiment of the present application first reads the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver when the driver is in the power-on state, and reads the multi-turn value and single-turn value of the power-on state encoder. Then, based on the historical multi-turn value and the multi-turn value, if it is determined that the motor shaft has been rotated after power failure, the target overflow times of the power-on state are calculated based on the historical multi-turn value of the memory, the historical multi-turn overflow times of the memory, the multi-turn value of the encoder and the preset multi-turn upper limit value. Further, based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow times, the initial absolute position of the motor is determined. Then, when the driver is in the running state, the multi-turn value and single-turn value of the encoder of the current control cycle are read. Then, based on the single-turn value of the encoder of the current control cycle, the single-turn value of the power-on state encoder and the initial absolute position of the motor, the absolute position of the motor in the current control cycle is calculated. Finally, if the driver is not in the power-off state, the execution step of reading the single-turn value of the encoder of the current control cycle is returned. The value is used to determine the absolute position of the motor in the current control cycle based on the single-turn value of the current control cycle, the single-turn value of the previous control cycle, and the absolute position of the motor in the previous control cycle until the driver is in a power-off state, thereby realizing that when the driver is in a power-on state, the multi-turn value of the memory and the multi-turn value of the encoder are used to determine whether the driver has been manually rotated before power-on, that is, after power-off, so as to re-update the target overflow number of the multi-turn value, and then calculate the absolute position taking the target overflow number into consideration, so as to accurately obtain the initial absolute position of the motor in the power-on state. Further, when the driver is in a running state, the absolute position of the motor in the current control cycle is determined according to the single-turn value of the current control cycle and the single-turn value of the encoder in the power-on state, as well as the initial absolute position of the motor and the encoder position increment. In addition, in each subsequent control cycle, the absolute position of the motor in the current control cycle and the previous control cycle and the single-turn value are directly calculated to obtain the absolute position of the motor in the current control cycle until the driver is in a power-off state, so that even after the system is powered off, the driver is manually rotated, and the absolute position of the motor when it rotates infinitely can be accurately recorded.

[0059] Further, refer to Figure 2 Based on the first embodiment of the present application, in another embodiment of the present application, the step of calculating the absolute position of the motor in the current control period based on the single-turn value of the encoder in the current control period, the single-turn value of the encoder in the power-on state and the initial absolute position of the motor includes:

[0060] Step B10, calculating the encoder position increment of the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the power-on state encoder;

[0061] In this embodiment, specifically, the single-turn value difference between the single-turn value of the current control cycle encoder and the single-turn value of the power-on state encoder is calculated, and then the single-turn value difference and the preset single-turn upper limit value are compared and analyzed, and the encoder position increment is determined according to the analysis result corresponding to the single-turn value difference.

[0062] Wherein, the step of calculating the encoder position increment of the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the power-on state encoder includes:

[0063] Step B11, calculating the single-turn value difference between the single-turn value of the current control cycle encoder and the single-turn value of the power-on state encoder;

[0064] Step B12, determining the encoder position increment based on the single-turn value difference and the preset single-turn upper limit value.

[0065] Wherein, the step of determining the encoder position increment based on the single-turn value difference and the preset single-turn upper limit value comprises:

[0066] like Then Δx=Δx1-M;

[0067] like Then Δx=Δx1+M;

[0068] like Then Δx=Δx1;

[0069] Among them, Δx1 is the single-turn value difference, M is the preset single-turn upper limit value, and Δx is the encoder position increment.

[0070] Step B20, determining the absolute position of the motor in the current control cycle based on the initial absolute position of the motor and the encoder position increment.

[0071] In this embodiment, specifically, based on the initial absolute position of the motor and the encoder position increment, the absolute position of the motor in the current control cycle is calculated, and the calculation formula is P=P1+Δx, Δx is the encoder position increment. The absolute position of the motor in the current control cycle is directly calculated using the initial absolute position of the motor and the encoder position increment of the current control cycle, which greatly reduces the amount of CPU calculations during operation and improves equipment operation efficiency.

[0072] Further, refer to Figure 3Based on the first embodiment of the present application, in another embodiment of the present application, after the step of calculating the target overflow number of the power-on state based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder and the preset multi-turn upper limit value, the motor infinite rotation absolute position calculation method includes:

[0073] Step C10, when the driver is in operation, obtaining a multi-turn value of the encoder of the current control cycle;

[0074] Step C20, calculating the multi-turn value difference between the multi-turn value of the current control period encoder and the multi-turn value of the power-on state encoder;

[0075] Step C30, determining the number of multi-turn overflows in the current control cycle based on the multi-turn value difference and the preset multi-turn upper limit value;

[0076] Step C40, if the driver is not in the power-off state, return to the execution step: obtain the multi-turn value of the encoder of the current control cycle, and determine the number of multi-turn overflows of the current control cycle based on the multi-turn value of the current control cycle and the multi-turn value of the previous control cycle and the preset multi-turn upper limit value, until the driver is in the power-off state, and store the multi-turn overflow number and the multi-turn value in the memory.

[0077] In this embodiment, it should be noted that when the driver is in the running state, it is necessary to record the multi-turn value of the encoder of the current control cycle of the running state. Specifically, in the first control cycle when the driver enters the running state, the multi-turn value of the encoder of the current control cycle (first control cycle) is obtained in real time, and then the multi-turn value difference between the multi-turn value of the encoder of the current control cycle and the multi-turn value of the encoder of the power-on state is calculated. Further, the multi-turn value difference and the preset multi-turn upper limit are compared and analyzed to determine the number of multi-turn overflows of the current control cycle, and the number of multi-turn overflows of the current control cycle is stored in the memory. Then, when the driver is still in the running state, the multi-turn value of the encoder of the current control cycle (second control cycle) continues to be read, and then the number of multi-turn overflows of the current control cycle is determined according to the multi-turn value of the encoder of the current control cycle and the multi-turn value of the encoder of the previous control cycle (first control cycle). The above steps are repeated until the driver is in the power-off state.

[0078] For example, the multi-turn value of the encoder in the current control cycle is Y1, and the multi-turn value of the encoder in the previous control cycle is Y2. Let Δy = Y1-Y2. If Then the overflow times Z of multiple cycles are increased by 1. Then the overflow times Z minus 1, if Then the overflow number Z remains unchanged after running multiple circles.

[0079] In addition, it should be noted that step C10 and step A40 are performed simultaneously, that is, when the driver is in the running state, the multi-turn value and single-turn value of the encoder of the current control cycle are obtained, and the single-turn value is used to calculate the absolute position of the motor. The purpose of recording the multi-turn value is to store the multi-turn value in the running state and the number of multi-turn overflows in the memory, so that the multi-turn overflow number and multi-turn value in the memory can be directly read when the power is turned on next time.

[0080] Reference Figure 4 , Figure 4 It is a structural diagram of a motor infinite rotation absolute position calculation device in the hardware operating environment involved in the embodiment of the present application.

[0081] like Figure 4 As shown, the motor infinite rotation absolute position calculation device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0082] Optionally, the motor infinite rotation absolute position calculation device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WIFI interface).

[0083] Those skilled in the art will understand that Figure 4 The structure of the motor infinite rotation absolute position calculation device shown in the figure does not constitute a limitation on the motor infinite rotation absolute position calculation device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0084] like Figure 4As shown, the memory 1005 as a computer storage medium may include an operating network communication module and a motor infinite rotation absolute position calculation program. The operating device is a program for managing and controlling the hardware and software resources of the motor infinite rotation absolute position calculation device, and supports the operation of the motor infinite rotation absolute position calculation program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the motor infinite rotation absolute position calculation system.

[0085] exist Figure 4 In the motor infinite rotation absolute position calculation device shown, the processor 1001 is used to execute the motor infinite rotation absolute position calculation program stored in the memory 1005 to implement the steps of any of the above-mentioned motor infinite rotation absolute position calculation methods.

[0086] The specific implementation of the motor infinite rotation absolute position calculation device of the present application is basically the same as the various embodiments of the motor infinite rotation absolute position calculation method described above, and will not be repeated here.

[0087] In addition, please refer to Figure 5 , Figure 5 : is a functional module diagram of the motor infinite rotation absolute position calculation system of the present application. The present application also provides a motor infinite rotation absolute position calculation system, the motor infinite rotation absolute position calculation system includes a driver, a memory and an encoder, and the motor infinite rotation absolute position calculation system includes:

[0088] A power-on reading module, used for reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver when the driver is in a power-on state, and reading the multi-turn values ​​and single-turn values ​​of the encoder in the power-on state;

[0089] A power-on reading module, used for reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver when the driver is in a power-on state, and reading the multi-turn values ​​and single-turn values ​​of the encoder in the power-on state;

[0090] A first calculation module is configured to calculate a target overflow number in a power-on state based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder, and a preset multi-turn upper limit value if it is determined that the motor shaft has been rotated after power failure based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder, and a preset multi-turn upper limit value;

[0091] An initial absolute position determination module, used to determine the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow number;

[0092] A running reading module, configured to read the multi-turn value and single-turn value of the encoder in the current control cycle when the driver is in a running state;

[0093] A current absolute position determination module, configured to calculate the absolute position of the motor in the current control cycle based on the single-turn value of the encoder in the current control cycle, the single-turn value of the encoder in the power-on state, and the initial absolute position of the motor;

[0094] A loop determination module, configured to, if the driver is not in a power-off state, return to execute the steps of: reading the single-turn value of the encoder in the current control cycle, and determining the absolute position of the motor in the current control cycle based on the single-turn value in the current control cycle, the single-turn value in the previous control cycle, and the absolute position of the motor in the previous control cycle, until the driver is in a power-off state.

[0095] Optionally, the first calculation module is further configured to:

[0096] Compare and analyze the historical multi-turn value of the memory, the multi-turn value of the encoder, and the preset multi-turn upper limit value;

[0097] If Then the target overflow count is Z = Z1;

[0098] If And Y1 > Y, then the target overflow count is Z = Z1 + 1;

[0099] If And Y1 < Y, then the target overflow count is Z = Z1 - 1;

[0100] Wherein, Y1 is the historical multi-turn value of the memory, Y is the multi-turn value of the encoder, N is the preset multi-turn upper limit value, Z is the target overflow count, and Z1 is the historical multi-turn overflow count of the memory.

[0101] Optionally, the initial absolute position determination module is further configured to:

[0102] Calculate the actual multi-turn value in the power-on state based on the multi-turn value of the encoder, the preset multi-turn upper limit value, and the target overflow count;

[0103] Determine the initial absolute position of the motor based on the actual multi-turn value in the power-on state, the preset single-turn upper limit value, and the single-turn value.

[0104] Optionally, the second calculation module is further configured to:

[0105] Calculate the encoder position increment in the current control cycle based on the single-turn value in the current control cycle and the single-turn value of the encoder in the power-on state;

[0106] The absolute position of the motor in the current control cycle is determined based on the initial absolute position of the motor and the encoder position increment.

[0107] Optionally, the second calculation module is further used for:

[0108] Calculate the single-turn value difference between the single-turn value of the current control period encoder and the single-turn value of the power-on state encoder;

[0109] The encoder position increment is determined based on the single-turn value difference and the preset single-turn upper limit value.

[0110] Optionally, the second calculation module is further used for:

[0111] like Then Δx=Δx1-M;

[0112] like Then Δx=Δx1+M;

[0113] like Then Δx=Δx1;

[0114] Among them, Δx1 is the single-turn value difference, M is the preset single-turn upper limit value, and Δx is the encoder position increment.

[0115] Optionally, the motor infinitely rotates the absolute position calculation system:

[0116] If the historical multi-turn value is equal to the multi-turn value, it is determined that the motor shaft has not been rotated after power failure, and the historical multi-turn overflow number is used as the target overflow number.

[0117] Optionally, the motor infinitely rotates the absolute position calculation system:

[0118] When the driver is in operation, obtaining a multi-turn value of the encoder of the current control cycle;

[0119] Calculate the multi-turn value difference between the multi-turn value of the current control period encoder and the multi-turn value of the power-on state encoder;

[0120] Determine the number of multi-turn overflows in the current control cycle based on the multi-turn value difference and the preset multi-turn upper limit value;

[0121] If the driver is not in a power-off state, return to the execution step: obtain the multi-turn value of the encoder of the current control cycle, and determine the number of multi-turn overflows of the current control cycle based on the multi-turn value of the current control cycle and the multi-turn value of the previous control cycle and the preset multi-turn upper limit value, until the driver is in a power-off state, and store the multi-turn overflow number and the multi-turn value in the memory.

[0122] The specific implementation of the motor infinite rotation absolute position calculation system of the present application is basically the same as the various embodiments of the motor infinite rotation absolute position calculation method described above, and will not be repeated here.

[0123] An embodiment of the present application provides a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of the method for calculating the absolute position of infinite rotation of a motor as described in any of the above.

[0124] The specific implementation of the computer-readable storage medium of the present application is basically the same as the embodiments of the above-mentioned method for calculating the absolute position of infinite rotation of a motor, and will not be repeated here.

[0125] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A method for calculating the absolute position of a motor with infinite rotation, characterized in that: The method for calculating the absolute position of an infinitely rotating motor is applied to an infinitely rotating absolute value servo device, which includes a driver, a motor, and an encoder connected to the motor shaft. The method for calculating the absolute position of an infinitely rotating motor includes: When the driver is in a power-on state, reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver, and reading the multi-turn values ​​and single-turn values ​​of the power-on state encoder; If it is determined that the motor shaft has been rotated after power failure based on the historical multi-turn value of the memory and the multi-turn value of the encoder, a target overflow number in a power-on state is calculated based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder and a preset multi-turn upper limit value; The step of calculating the target overflow number of the power-on state based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder and the preset multi-turn upper limit value comprises: Comparing and analyzing the historical multi-turn value of the memory, the multi-turn value of the encoder and the preset multi-turn upper limit value; like Then the target overflow number is Z = Z1; like And Y1>Y, then the target overflow number is Z=Z1+1; If and Y1 < Y, then the target overflow count is Z = Z1 - 1; Wherein, Y1 is the historical multi-turn value of the memory, Y is the multi-turn value of the encoder, N is the preset multi-turn upper limit value, Z is the target overflow number, and Z1 is the historical multi-turn overflow number of the memory; Determine the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow number; When the driver is in operation, reading the multi-turn value and the single-turn value of the encoder of the current control cycle; Calculate the absolute position of the motor in the current control period based on the single-turn value of the encoder in the current control period, the single-turn value of the encoder in the power-on state, and the initial absolute position of the motor; The step of calculating the absolute position of the motor in the current control period based on the single-turn value of the encoder in the current control period, the single-turn value of the encoder in the power-on state and the initial absolute position of the motor comprises: Calculating the encoder position increment of the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the power-on state encoder; Wherein, the step of calculating the encoder position increment of the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the power-on state encoder includes: Calculate the single-turn value difference between the single-turn value of the current control period encoder and the single-turn value of the power-on state encoder; Determining the encoder position increment based on the single-turn value difference and the preset single-turn upper limit value; The step of determining the encoder position increment based on the single-turn value difference and the preset single-turn upper limit value comprises: like Then Δx=Δx1-M; like Then Δx=Δx1+M; like Then Δx=Δx1; Wherein, Δx1 is the single-turn value difference, M is the preset single-turn upper limit value, and Δx is the encoder position increment; Determining the absolute position of the motor in the current control cycle based on the initial absolute position of the motor and the encoder position increment; If the driver is not in the power-off state, return to the execution step: read the single-turn value of the encoder of the current control cycle to determine the absolute position of the motor in the current control cycle based on the single-turn value of the current control cycle and the single-turn value of the previous control cycle and the absolute position of the motor in the previous control cycle until the driver is in the power-off state.

2. The method for calculating the absolute position of a motor with infinite rotation according to claim 1, characterized in that: The step of determining the initial absolute position of the motor based on the single-turn value of the encoder, the multi-turn value of the encoder, the preset multi-turn upper limit value, the preset single-turn upper limit value and the target overflow number includes: Calculate the actual multi-turn value in the power-on state based on the multi-turn value of the encoder, the preset multi-turn upper limit value and the target overflow number; The initial absolute position of the motor is determined based on the actual multi-turn value in the power-on state, the preset single-turn upper limit value and the single-turn value.

3. The method for calculating the absolute position of a motor with infinite rotation according to claim 1, characterized in that: After the steps of reading the historical multi-turn overflow times and historical multi-turn values ​​of the memory in the driver when the driver is in the power-on state, and reading the multi-turn values ​​and single-turn values ​​of the power-on state encoder, the method for calculating the absolute position of infinite rotation of the motor further includes: If the historical multi-turn value is equal to the multi-turn value, it is determined that the motor shaft has not been rotated after power failure, and the historical multi-turn overflow number is used as the target overflow number.

4. The method for calculating the absolute position of a motor with infinite rotation according to claim 1, characterized in that: After the step of calculating the target overflow number of the power-on state based on the historical multi-turn value of the memory, the historical multi-turn overflow number of the memory, the multi-turn value of the encoder and the preset multi-turn upper limit value, the motor infinite rotation absolute position calculation method includes: When the driver is in operation, obtaining a multi-turn value of the encoder of the current control cycle; Calculate the multi-turn value difference between the multi-turn value of the current control period encoder and the multi-turn value of the power-on state encoder; Determine the number of multi-turn overflows in the current control cycle based on the multi-turn value difference and the preset multi-turn upper limit value; If the driver is not in a power-off state, return to the execution step: obtain the multi-turn value of the encoder of the current control cycle, and determine the number of multi-turn overflows of the current control cycle based on the multi-turn value of the current control cycle and the multi-turn value of the previous control cycle and the preset multi-turn upper limit value, until the driver is in a power-off state, and store the multi-turn overflow number and the multi-turn value in the memory.

5. A device for calculating the absolute position of a motor with infinite rotation, characterized in that: The motor infinite rotation absolute position calculation device includes: a memory, a processor, and a motor infinite rotation absolute position calculation program stored in the memory, and the motor infinite rotation absolute position calculation program is executed by the processor to implement the steps of the motor infinite rotation absolute position calculation method as claimed in any one of claims 1 to 4.

6. A storage medium, the storage medium being a computer-readable storage medium, characterized in that: The computer-readable storage medium stores a motor infinite rotation absolute position calculation program, and the motor infinite rotation absolute position calculation program is executed by a processor to implement the steps of the motor infinite rotation absolute position calculation method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for processing output signals of composite incremental encoder

    CN105720869A

  • Multi-pole motor magnetic pole position detection method based on incremental photo-electricity encoder.

    CN106301105A