Search

CN-122015919-A - Pulse position compensation method, device and storage medium of encoder

CN122015919ACN 122015919 ACN122015919 ACN 122015919ACN-122015919-A

Abstract

The application provides a pulse position compensation method, equipment and a storage medium of an encoder, which are used for periodically acquiring a pulse signal value of the encoder, subtracting a pulse signal value of a previous period from the pulse signal value of a current period in the process of acquiring the pulse signal in any period after a starting period to obtain an actual pulse increment value of the current period, acquiring a rotating speed value of the previous period, determining a theoretical pulse increment value of the current period according to the rotating speed value, subtracting the theoretical pulse increment value from the actual pulse increment value to obtain the pulse increment error value of the current period, determining a pulse compensation position of the current period according to the actual pulse increment value of the current period and the pulse signal value of the previous period if the pulse increment error value is smaller than a first threshold, and determining the pulse compensation position of the current period according to the theoretical pulse increment value if the pulse increment error value is larger than or equal to the first threshold, thereby enhancing signal fidelity and control accuracy of the encoder under strong interference.

Inventors

  • ZHANG RUNHONG
  • LI MING
  • LIN FENGDA

Assignees

  • 江门市蒙德电气股份有限公司

Dates

Publication Date
20260512
Application Date
20260213

Claims (10)

  1. 1. A method for compensating for pulse position of an encoder, comprising: Periodically acquiring a pulse signal value of an encoder; The process of acquiring the pulse signal value in any period after the initial period comprises the following steps: Subtracting the pulse signal value of the previous period from the pulse signal value of the current period to obtain an actual pulse increment value of the current period; acquiring a rotating speed value of the encoder in a previous period, and determining a theoretical pulse increment value of a current period according to the rotating speed value; Subtracting the theoretical pulse increment value from the actual pulse increment value to obtain a pulse increment error value of the encoder in the current period; If the pulse increment error value is smaller than a preset first threshold value, determining a pulse compensation position of the encoder in the current period according to the actual pulse increment value in the current period and a pulse signal value of the encoder in the previous period; Or if the pulse increment error value is greater than or equal to the first threshold value, determining a pulse compensation position of the encoder in the current period according to the theoretical pulse increment value.
  2. 2. The pulse position compensation method of claim 1, wherein said determining the pulse compensation position of the encoder in the current period based on the actual pulse increment value of the current period and the pulse signal value of the encoder in the previous period comprises: acquiring an actual pulse increment value of the encoder in a previous period, and calculating an average value between the actual pulse increment value of the current period and the actual pulse increment value of the previous period; if the average value is greater than or equal to a second threshold value, adding a sum value obtained by adding the pulse signal value of the previous period of the encoder and the average value to be used as a pulse compensation position of the encoder in the current period; Or if the average value is smaller than the second threshold value, taking the sum value of the pulse signal value of the encoder in the previous period and the actual pulse increment value of the current period as the pulse compensation position of the encoder in the current period; The second threshold is a first preset proportion of the first threshold.
  3. 3. The pulse position compensation method of claim 2, wherein the first predetermined ratio is one third.
  4. 4. The pulse position compensation method of claim 1 wherein said determining a pulse compensation position of said encoder at a current period based on said theoretical pulse increment value comprises: determining a pulse accumulated value of the encoder in a current period; If the pulse accumulated value in the current period is smaller than or equal to a second preset proportion of the pulse resolution of the encoder, adding the theoretical pulse increment value and the pulse accumulated value in the current period to obtain a sum value, and taking the sum value as a pulse compensation position of the encoder in the current period; or if the pulse accumulated value in the current period is larger than a second preset proportion of the pulse resolution, controlling the encoder to stop working and generating fault information; the pulse resolution is the minimum physical displacement value generated by the pulse signal.
  5. 5. The pulse position compensation method of claim 4, wherein the second predetermined ratio is one-half.
  6. 6. The pulse position compensation method of claim 4 wherein said determining a pulse accumulation value for the encoder at a current period comprises: determining a pulse accumulated value of the encoder in a last period; And adding the sum value obtained by adding the pulse accumulated value of the encoder in the last period and the theoretical pulse increment value of the current period to be used as the pulse accumulated value of the encoder in the current period.
  7. 7. The pulse position compensation method according to claim 6, characterized in that in the process of acquiring the pulse signal value in the start period, comprising the steps of: the pulse accumulation value in the start period is set to a zero value.
  8. 8. The pulse position compensation method of claim 6, wherein the pulse signal value is acquired in any period subsequent to the start period, further comprising the steps of: and if the pulse increment error value is smaller than the first threshold value, setting the pulse accumulated value in the current period to be zero.
  9. 9. An electronic device provided with a memory and a processor, the memory storing a computer program, characterized in that the processor implements the pulse position compensation method of the encoder of any of claims 1 to 8 when executing the computer program.
  10. 10. A computer readable storage medium, characterized in that the computer readable storage medium stores a processor executable program which when executed by a processor implements the pulse position compensation method of the encoder of any of claims 1 to 8.

Description

Pulse position compensation method, device and storage medium of encoder Technical Field The present application relates to the field of electrical automation technology, and in particular, to a method, an apparatus, and a storage medium for compensating a pulse position of an encoder. Background The encoder is used as a core feedback element of the servo system, and the accuracy of the output signal directly determines the position accuracy, the response speed and the system stability of the servo control. In practical industrial application, a servo system is often deployed in a severe environment with strong electromagnetic interference such as high radiation, high power frequency conversion and the like, pulse communication between an encoder and a driver is extremely easy to be interfered by noise, signal distortion or instantaneous loss is caused, and control abnormality and even safety accidents are further caused. The prior art scheme focuses on the filtering and physical structure shielding of the hardware layer, so as to reduce the interference receiving probability, however, the method can only attenuate but not eradicate the interference, and can not actively identify and reject noise at the signal layer, so that the method is difficult to accurately restore the real position and speed information from the polluted signal, and the control precision can not be ensured fundamentally. Therefore, how to actively eliminate transient interference from the signal processing algorithm level and ensure the intrinsic reliability of the feedback signal has become a key technical problem for improving the robustness and the accuracy of the industrial servo system. Disclosure of Invention The application aims to at least solve one of the technical problems in the prior art, and provides a pulse position compensation method, device and storage medium of an encoder, which can enhance the signal fidelity and control precision of the encoder under strong interference without increasing hardware cost. To achieve the above object, a first aspect of an embodiment of the present application provides a pulse position compensation method of an encoder, including: Periodically acquiring a pulse signal value of an encoder; the process of acquiring the pulse signal value in any period after the initial period comprises the following steps: Subtracting the pulse signal value of the previous period from the pulse signal value of the current period to obtain an actual pulse increment value of the current period; acquiring a rotating speed value of the encoder in the previous period, and determining a theoretical pulse increment value of the current period according to the rotating speed value; Subtracting the theoretical pulse increment value from the actual pulse increment value to obtain a pulse increment error value of the encoder in the current period; If the pulse increment error value is smaller than a preset first threshold value, determining a pulse compensation position of the encoder in the current period according to the actual pulse increment value in the current period and the pulse signal value of the encoder in the previous period; or if the pulse increment error value is greater than or equal to the first threshold value, determining the pulse compensation position of the encoder in the current period according to the theoretical pulse increment value. Further, in some embodiments, determining the pulse compensation position of the encoder at the current period based on the actual pulse increment value, the theoretical pulse increment value, and the pulse signal value of the encoder at the previous period includes: Acquiring an actual pulse increment value of the encoder in a previous period, and calculating an average value between the actual pulse increment value of the current period and the actual pulse increment value of the encoder in the previous period; If the average value is larger than or equal to a second threshold value, taking the sum value obtained by adding the pulse signal value of the encoder in the previous period and the average value as the pulse compensation position of the encoder in the current period; Or if the average value is smaller than the second threshold value, taking the sum value of the pulse signal value of the encoder in the previous period and the actual pulse increment value of the current period as the pulse compensation position of the encoder in the current period. Further, in some embodiments, the first predetermined ratio is one third. Further, in some embodiments, determining the pulse compensation position of the encoder at the current period based on the theoretical pulse increment value comprises: Determining a pulse accumulated value of the encoder in the current period; If the pulse accumulated value in the current period is smaller than or equal to a second preset proportion of the pulse resolution of the encoder, adding a sum value obtained by adding the the