Method for determining rotation angle of encoder, electronic equipment and storage medium

By designing the structure of the inner and outer circle and inductive components in the encoder, the design of the sensor component is used to generate an electric signal during the rotation of the raised part and the groove. Accuracy and user experience.

CN119334238APending Publication Date: 2025-01-21GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411546956.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The encoder has difficulties in the precise determination of rotation angle, which leads to possible deviations in the control system, affecting the stability and reliability of the equipment.

Method used

Design an encoder, which includes an inner ring and an outer ring. The outer ring is rotatably arranged on the outside of the inner ring, and multiple protrusions are provided on the inside of the outer ring or on the outside of the inner ring. Two adjacent protrusions are A groove is formed between them. The induction component is arranged on the inner ring or the outer ring without a protruding part, and partially extends into the groove. When the user rotates the encoder, the sensing component generates an electrical signal through deformation. By analyzing the waveform curve and pulse number of the electrical signal, the rotation angle of the encoder is accurately determined.

Benefits of technology

The accurate determination of the coder's rotation angle is achieved, the user experience is improved, and the stability and reliability of the device is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119334238A_ABST
    Figure CN119334238A_ABST
Patent Text Reader

Abstract

The invention relates to the field of encoders, in particular to a method for determining the rotation angle of an encoder, electronic equipment and a storage medium. The encoder comprises an inner ring and an outer ring, the outer ring is rotatably arranged on the outer side of the inner ring, a plurality of protruding parts are arranged on the inner side of the outer ring or the outer side of the inner ring, a groove is formed between every two adjacent protruding parts, a sensing assembly is arranged on the inner ring or the outer ring without the protruding parts, and the sensing assembly is arranged on the inner ring or the outer ring without the protruding parts. A part of the elastic part extends into the groove; the sensing assembly can convert the deformation quantity of the deformation into an electric signal, and the method comprises the following steps: in response to the rotation operation of a user on the encoder, obtaining the electric signal in the rotation operation process according to the deformation quantity of the sensing assembly, the plurality of convex parts can be used for respectively enabling the sensing assembly to deform; and determining the rotation angle of the encoder according to the electric signal in the rotation operation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of encoders, and more specifically, to a method for determining a rotation angle of an encoder, an electronic device, and a storage medium. Background Art

[0002] At the current stage of technological development, although encoders play a vital role in the fields of industrial automation and precision control, and they also appear in all aspects of life as knob switches, the precise determination of their rotation angles is still a major technical challenge. The angle measurement of encoders is often difficult to achieve the ideal accuracy. This may not only cause deviations in the control system, affecting the stability and reliability of the equipment, but may also cause inaccuracies or misjudgments during operation, bringing many inconveniences and poor experiences to users. Summary of the invention

[0003] An object of the present disclosure is to provide a method for determining the rotation angle of an encoder, which can accurately determine the rotation angle of the encoder and improve the user experience.

[0004] According to a first aspect of the present disclosure, a method for determining a rotation angle of an encoder is provided, the encoder comprising: an inner ring and an outer ring, the outer ring being rotatably arranged on the outer side of the inner ring, and a plurality of protrusions being arranged on the inner side of the outer ring or the outer side of the inner ring, a groove being formed between two adjacent protrusions, and a sensing component being arranged on the inner ring or the outer ring where the protrusions are not arranged, and partially extending into the groove; the method comprising:

[0005] In response to a user's rotation operation on the encoder, an electrical signal during the rotation operation is acquired according to the deformation amount of the sensing component, wherein during the rotation of the encoder, the plurality of protrusions can respectively cause the sensing component to deform;

[0006] The rotation angle of the encoder is determined based on the electrical signal during the rotation operation.

[0007] Optionally, determining the rotation angle of the encoder according to the electrical signal during the rotation operation includes:

[0008] Constructing a waveform curve of the electrical signal during the rotation operation and determining the number of pulses in the waveform curve, wherein the pulses represent changes in the electrical signal during the process of the induction component moving from one groove to another adjacent groove;

[0009] The rotation angle of the encoder is determined according to the number of pulses and a pre-stored first corresponding relationship, wherein the first corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

[0010] Optionally, the plurality of protrusions are sawtooth-shaped, and the sawtooths are of the same shape and size, and each sawtooth has a first inclined plane and a second inclined plane on both sides, and the first inclined plane and the second inclined plane have different slopes, and the determining the rotation angle of the encoder according to the electrical signal during the rotation operation includes:

[0011] Constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform curve and the slope of each pulse, wherein the pulse represents the change of the electrical signal during the process of the induction component moving from one groove to another adjacent groove;

[0012] The rotation direction and rotation angle of the encoder are determined according to the number of pulses, the slope of each pulse and a pre-stored second corresponding relationship, wherein the second corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

[0013] Optionally, determining the rotation direction and rotation angle of the encoder according to the number of pulses, the slope of the pulses and a pre-stored second corresponding relationship includes:

[0014] Respectively determine the slope of a first interval and a slope of a second interval of each pulse in the waveform, wherein the first interval is an interval from a trough to a peak in each pulse, and the second interval is an interval from a peak to a trough in each pulse;

[0015] determining a ratio of a slope of the first interval to a slope of the second interval for each pulse;

[0016] Determine a first pulse and a second pulse according to the ratio, wherein the first pulse and the second pulse correspond to different movement directions of the sensing component;

[0017] Determine the number of the first pulse and the second pulse respectively, and determine the rotation angle of the encoder in two directions according to the number of the first pulse, the second pulse and the second corresponding relationship;

[0018] The rotation direction and rotation angle of the encoder are determined according to the encoding rotation angles of the encoder in two directions.

[0019] Optionally, determining the first pulse and the second pulse according to the ratio includes:

[0020] comparing the ratio with a preset first ratio and a second ratio;

[0021] When the difference between the ratio and the first ratio is less than a threshold value, determining that the pulse corresponding to the ratio is a first pulse, wherein the first ratio is a ratio of a slope of a first interval to a slope of a second interval of a pulse generated by the encoder rotating in a first rotation direction;

[0022] When the difference between the ratio and the second ratio is less than a threshold value, the pulse corresponding to the ratio is determined to be the second pulse, wherein the second ratio is the ratio of the slope of the first interval of the pulse generated by the encoder rotating in the second rotation direction to the slope of the second interval.

[0023] Optionally, the plurality of protrusions are sawtooth-shaped, and the sawtooths are of the same shape and size, and each sawtooth has a first inclined plane and a second inclined plane on both sides, and the first inclined plane and the second inclined plane have different slopes, and the determining the rotation angle of the encoder according to the electrical signal during the rotation operation includes:

[0024] Constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform curve and the duration of each pulse, wherein the pulse represents the change of the electrical signal during the process of the induction component moving from one groove to another adjacent groove;

[0025] The rotation direction and rotation angle of the encoder are determined according to the number of pulses, the duration corresponding to each pulse and a pre-stored third corresponding relationship, wherein the third corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

[0026] Optionally, determining the rotation direction and rotation angle of the encoder according to the number of pulses, the duration corresponding to each pulse and a pre-stored third corresponding relationship includes:

[0027] Respectively determine a first duration corresponding to a first interval and a second duration corresponding to a second interval of each pulse in the waveform, wherein the first interval is an interval from a trough to a peak in each pulse, and the second interval is an interval from a peak to a trough in each pulse;

[0028] determining a ratio of the first duration to the second duration of each pulse;

[0029] Determine a first pulse and a second pulse according to the ratio, wherein the first pulse and the second pulse correspond to different movement directions of the sensing component;

[0030] Determine the number of the first pulse and the second pulse respectively, and determine the rotation angle of the encoder in two directions according to the number of the first pulse, the second pulse and the third corresponding relationship;

[0031] The rotation direction and rotation angle of the encoder are determined according to the encoding rotation angles of the encoder in two directions.

[0032] Optionally, determining the first pulse and the second pulse according to the ratio includes:

[0033] comparing the ratio with a preset third ratio and a fourth ratio;

[0034] When the difference between the ratio and the third ratio is less than a threshold value, determining that the pulse corresponding to the ratio is the first pulse, wherein the third ratio is a ratio of a first duration to a second duration of a pulse generated by the encoder in a first rotation direction;

[0035] When the difference between the ratio and the fourth ratio is less than a threshold value, the pulse corresponding to the ratio is determined to be the second pulse, wherein the fourth ratio is the ratio of the first duration to the second duration of the pulse generated by the encoder in the second rotation direction.

[0036] According to a second aspect of the present disclosure, an electronic device is provided, including a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the steps of any one of the methods described in the first aspect are implemented.

[0037] According to a third aspect of the present disclosure, there is provided a storage medium on which computer instructions are stored, and when the computer instructions are executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0038] One technical effect of the present disclosure is that a method for determining the rotation angle of an encoder is provided. The encoder may include: an inner ring and an outer ring, the outer ring is rotatably arranged on the outer side of the inner ring, and a plurality of protrusions are arranged on the inner side of the outer ring or the outer side of the inner ring, a groove is formed between two adjacent protrusions, and a sensing component is arranged on the inner ring or the outer ring without the protrusions, and partially extends into the groove. When the outer ring rotates, the plurality of protrusions can respectively cause the sensing component to deform, and the sensing component can convert the deformation amount of the deformation into an electrical signal. Based on the above encoder, the electrical signal in the rotation process can be obtained by responding to the user's rotation operation on the encoder, and the rotation angle of the encoder can be accurately determined by the electrical signal.

[0039] Other features and advantages of the embodiments of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the embodiments of the present disclosure.

[0041] Figure 1 It is one of the structural schematic diagrams of an encoder provided by the present application;

[0042] Figure 2 This is the second structural diagram of an encoder provided by the present application;

[0043] Figure 3 It is a flow chart of a method for determining the rotation angle of an encoder provided in the present application;

[0044] Figure 4 is a waveform curve of an electrical signal during a rotation operation of an embodiment provided by the present application;

[0045] Figure 5 It is a waveform curve of an electrical signal during a rotation operation of another embodiment provided by the present application. DETAILED DESCRIPTION

[0046] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0047] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0048] Techniques and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the techniques and equipment should be considered part of the specification.

[0049] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0050] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0051] In an embodiment of the present application, the encoder includes: an inner ring and an outer ring, the outer ring is rotatably arranged on the outside of the inner ring, and a plurality of protrusions are arranged on the inner side of the outer ring or the outer side of the inner ring, a groove 22 is formed between two adjacent protrusions, and the sensing component is arranged on the inner ring or the outer ring where the protrusions are not arranged, and partially extends into the groove 22. When the outer ring rotates, the plurality of protrusions can respectively cause the sensing component to deform, and the sensing component can convert the deformation amount of the deformation into an electrical signal.

[0052] In this embodiment, if Figure 1 to Figure 2As shown, the inner ring 1 and the outer ring 2 can rotate relative to each other, so that the multiple protrusions 21 can rotate relative to the sensing component 3, that is, each protrusion 21 can act on the sensing component 3 to achieve the purpose of setting multiple gears. The number of protrusions 21 can be set to dozens, hundreds, or even thousands according to actual needs. Each protrusion 21 is equivalent to a gear, so that the gears of the encoder can be sufficient. Compared with the encoder with more than a dozen gears in the prior art, the number of gears is greatly increased, thereby improving the accuracy of the encoder.

[0053] In the above structure, when the outer ring 2 rotates relative to the inner ring 1, multiple protrusions 21 pass through and act on the sensing component 3 in sequence, so that the sensing component 3 can undergo multiple deformation cycles and can continuously convert the change of the deformation amount in each cycle into the change of the electrical signal. Among them, one deformation cycle is one gear, so as to achieve the purpose of setting multiple gears. In practical applications, the cycle length of the deformation or the size of the deformation amount can also be controlled by setting the interval size between each protrusion 21, the shape of each protrusion 21 and other features. The specific design can be made according to actual needs, and this application does not limit this. In addition, the rotation angle of the encoder provided in this embodiment can be determined by the number of protrusions 21. For example, if there are N protrusions 21, then the change of the deformation amount in one cycle is detected, and the rotation angle is 360 / N.

[0054] In the above embodiment, the shape of the protrusion 21 can be designed as a triangular or arc-shaped protrusion to improve the smoothness of the rotation of the outer ring 2 and the inner ring 1, avoid the protrusion 21 and the sensing component 3 from getting stuck, and improve the reliability of the encoder. In addition, the outer ring 2 is rotatably arranged on the outside of the inner ring 1, which can be understood as the inner ring 1 is fixed and the outer ring 2 is rotatable relative to the inner ring 1, or the outer ring 2 is fixed and the inner ring 1 is rotatable relative to the outer ring 2. When the outer ring 2 rotates, it means rotating the outer ring 2 or the inner ring 1, so as to improve the flexibility of the encoder setting. The sensing component 3 is arranged on the inner ring 1 or the outer ring 2 without the protrusion 21, that is, if multiple protrusions 21 are arranged on the outside of the inner ring 1, the sensing component 3 is arranged on the outer ring 2, and if multiple protrusions 21 are arranged on the inner ring 1 of the outer ring 2, the sensing component 3 is arranged on the inner ring 1, so as to realize the deformation effect of multiple protrusions 21 on the sensing component 3. The elastic member can be a spring 32 or other objects that can undergo elastic deformation.

[0055] The above-mentioned encoder provided in the present application can not only provide multiple gears to improve its accuracy, but also enable the encoder to be miniaturized based on a relatively simple structure, thereby reducing the space occupied by the encoder and enabling it to be applied to products with high integration and requiring miniaturization.

[0056] In an example, Figure 1 to Figure 2As shown, the sensing component 3 includes a probe 31, an elastic member and a sensing device; the two ends of the elastic member are respectively connected to the probe 31 and the sensing device, the sensing device is fixed on the inner ring 1 or the outer ring 2, and the probe 31 is extended into the groove; when the outer ring 2 rotates, the multiple protrusions 21 can respectively deform the elastic member through the probe 31, and the sensing device can sense the deformation of the elastic member and convert the deformation into an electrical signal.

[0057] Specifically, in this embodiment, the probe 31 can be designed as a thin cylindrical shape, so that it can be inserted into the groove, so that each protrusion 21 can act on the probe 31 in turn. Based on the connection between the probe 31 and the elastic member, the protrusion 21 can realize the deformation of the elastic member by pushing the probe 31 to move, so that the sensing member senses the deformation of the elastic member and converts it into an electrical signal output, thereby realizing the deformation and conversion of the sensing component 3. Among them, the sensing device can sense the deformation of the elastic member based on electromagnetic induction, vibration induction, etc., and this application does not limit this.

[0058] Optionally, the accuracy of the encoder can be further improved by adjusting the thickness of the probe 31 or setting the maximum stroke of the top of the probe 31 to extend to the bottom of the groove.

[0059] Alternatively, if Figure 1 As shown, the sensing device is a vibration sensor 33, the elastic member is a spring 32, and the vibration sensor 33 is fixed on the inner ring 1 or the outer ring 2; the plurality of protrusions 21 can compress the spring 32 through the probe 31 respectively, and the vibration sensor 33 can sense the compression amount of the spring 32 and convert the compression amount into an electrical signal.

[0060] Specifically, in this embodiment, the sensing element adopts a vibration sensor 33, and the elastic element is set as a spring 32. The vibration sensor 33 is fixed on the outer ring 2 or the inner ring 1 without the protrusion 21, and the spring 32 and the probe 31 are connected in sequence so that the probe 31 can extend into the groove. When the outer ring 2 rotates relative to the inner ring 1, the end of the probe 31 moves along the contour of the protrusion 21, which will cause the compression of the spring 32, and a deformation cycle will be generated on the spring 32 every time the rotation stroke passes through a protrusion 21. Since the compression of the spring 32 is linearly proportional to the tension of the spring 32, the spring 32 will transmit this deformation or vibration to the vibration sensor 33, and the vibration sensor 33 can convert this deformation or vibration into electrical signals of different sizes.

[0061] In the above structure, the sensing form of the spring 32 and the vibration sensor 33 can simplify the structure of the sensing component 3, which is beneficial to the miniaturization design of the entire encoder.

[0062] Alternatively, if Figure 2As shown, the induction device includes a magnet 34 and a coil 35. The magnet 34 is fixed on the inner ring 1 or the outer ring 2, and the coil 35 is arranged on the elastic member. When the outer ring 2 rotates, the multiple protrusions 21 can respectively enable the elastic member to drive the coil 35 close to or away from the magnet 34 through the probe 31.

[0063] Specifically, in this embodiment, the induction member is composed of a coil 35 and a magnet 34, and the two ends of the elastic member are connected to the magnet 34 and the probe 31 respectively. When the coil 35 is fixed on the elastic member, the probe 31 is sequentially acted upon by the plurality of protrusions 21, so that the elastic member is deformed, and then the coil 35 fixed on the elastic member is driven to move, so that the distance between the coil 35 and the magnet 34 changes. Based on Lenz's law: the induced current has such a direction that the magnetic field of the induced current always hinders the change of the magnetic flux causing the induced current. When the deformation of the elastic member is large, the coil 35 is close to the magnet 34 to generate a larger magnetic flux; and when the deformation of the elastic member is small, the coil 35 is away from the magnet 34 to generate a smaller magnetic flux. One deformation cycle generates one cycle of magnetic flux change, which can cause the current or voltage of the coil 35 to change within one cycle, thereby achieving the purpose of converting the deformation amount into an electrical signal change.

[0064] In the above structure, the induction device is in the form of a coil 35 and a magnet 34, which can improve the accuracy of the encoder. It should be noted that other components such as the inner ring 1, the outer ring 2 and the probe 31 can be made of insulating materials to avoid affecting the induction of the coil 35 and the magnet 34. In addition, the connection between the elastic member and the probe 31 can be achieved through a structure such as a connecting block to facilitate the assembly of the components. Furthermore, the entire induction component 3 can be embedded in the inner ring 1 or the outer ring 2, and at least a part of the probe 31 can extend out of the inner ring 1 or the outer ring 2 and extend into the groove to further reduce the volume of the encoder.

[0065] Preferably, the inner ring 1 is fixed, the outer ring 2 is rotatably arranged on the outside of the inner ring 1, a plurality of protrusions 21 are evenly arranged on the side of the outer ring 2 facing the inner ring 1, the sensing component 3 is arranged inside the inner ring 1, and the probe 31 is partially extended to the bottom of the groove between two adjacent protrusions 21 on the outer ring 2, thereby further optimizing the structure of the entire encoder and improving its convenience in assembly and use.

[0066] Alternatively, if Figure 2 As shown, the elastic member and the coil 35 are provided as the same spring 32 .

[0067] Specifically, in one embodiment, the elastic member and the coil 35 can be designed as an integrated structure, that is, the elastic member is designed as the structure of the spring 32, and the spring 32 is used as the coil 35, so that the spring 32 is reused and the structure is further simplified. When the elastic member and the coil 35 are the same spring 32, based on Lenz's law, since rotation will cause deformation of the spring 32 (coil 35), and the compression amount of the spring 32 is different, the magnetic flux of the spring 32 is different, so the rotation will cause a change in the magnetic flux of the spring 32, because the change in magnetic flux will generate an induced electromotive force, and then generate an induced current.

[0068] In practical applications, the spring 32 (coil 35) has two pins for connecting external devices to realize the transmission of electrical signals. In addition, when the spring 32 is only used as an elastic member and the coil 35 is independently two parts, the coil 35 can be arranged inside or outside the spring 32.

[0069] In this embodiment, multiple protrusions 21 are evenly arranged along the inner side of the outer ring 2 or the outer side of the inner ring 1. The multiple protrusions 21 are evenly arranged so that the changes in the electrical signals of the sensing component 3 in each deformation cycle are the same or similar, which is convenient for identifying each gear position, and reduces the processing difficulty of the encoder and the production cost. Among them, the multiple protrusions 21 can be arranged at intervals or continuously, and this application does not limit this.

[0070] The present application embodiment provides a method for determining the rotation angle of an encoder, which can be applied to the above-mentioned encoder. Figure 3 As shown, the method includes steps S11-S13.

[0071] Step S11, in response to the user's rotation operation on the encoder, acquiring an electrical signal during the rotation operation according to the deformation amount of the sensing component, wherein during the rotation of the encoder, the plurality of protrusions can respectively cause the sensing component to deform.

[0072] In this embodiment, after the user rotates the encoder, the induction device moves between the grooves and will inevitably generate a corresponding electrical signal. Therefore, the electrical signal in this process can be obtained to confirm the subsequent rotation angle. In this embodiment, the electrical signal can be a voltage signal, a current signal, etc. It can be set according to actual needs.

[0073] Step S12, determining the rotation angle of the encoder according to the electrical signal during the rotation operation.

[0074] In this embodiment, when the encoder rotates, the electrical signal obtained by the sensing component is generated based on the deformation of the sensing component when it moves in the protrusions and grooves. Therefore, the rotation angle of the encoder can be determined based on the electrical signal during the rotation process. In this embodiment, the electrical signal during the rotation operation can reflect how many protrusions the sensing component has passed through. Because the setting method of the protrusions can be known in advance, the rotation angle corresponding to each protrusion can be determined separately. Based on the above method, the rotation angle of the encoder can be obtained.

[0075] In this embodiment, by responding to the user's rotation operation on the encoder, an electrical signal during the rotation process can be acquired, and the rotation angle of the encoder can be accurately determined through the electrical signal.

[0076] In an example of this embodiment, the rotation angle of the encoder is determined according to the electrical signal during the rotation operation, including: constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform curve, wherein the pulse represents the change in the electrical signal during the process of the sensing component moving from one groove to another adjacent groove; determining the rotation angle of the encoder according to the number of pulses and a pre-stored first corresponding relationship, wherein the first corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

[0077] In this embodiment, the waveform curve of the electrical signal during the rotation operation can be pre-constructed, such as Figure 4 As shown, the horizontal axis of the coordinate axis represents the time of the rotation operation process, and the vertical axis represents the size of the electrical signal. In this example, the electrical signal obtained during the rotation operation process can be constructed into a waveform curve. At the same time, the number of pulses in the waveform curve is determined. Each pulse in the waveform curve represents the change in the electrical signal during the process of the sensing component moving from one groove to another adjacent groove. Specifically, when the encoder is rotated by the user, the sensing component continuously moves from one groove to another. At the beginning, it will gradually compress from the groove along the raised portion, that is, gradually generate electrical signals, such as current or voltage. As the sensing component moves to the highest point of the raised portion, the electrical signal also reaches its highest point. Subsequently, as the sensing component gradually moves to another groove, the size of the electrical signal also decreases, forming a complete pulse cycle.

[0078] In this example, the correspondence between the number of pulses and the encoder rotation angle can be pre-stored, and the correspondence can be determined based on the number of protrusions. For example, in the encoder, there are 360 ​​protrusions, then the rotation angle corresponding to each protrusion is 1 degree, which is equivalent to the rotation angle corresponding to each pulse being 1 degree. Afterwards, the encoder rotation angle can be determined based on the number of pulses during the rotation process.

[0079] In one example of this embodiment, multiple protrusions are sawtooth-shaped, and each sawtooth has the same shape and size. Each sawtooth has a first inclined plane and a second inclined plane on both sides. The slopes of the first inclined plane and the second inclined plane are different. The rotation angle of the encoder is determined according to the electrical signal during the rotation operation.

[0080] Specifically, the shape of the protrusion 21 determines the size and change form of the deformation of the sensing component 3. In this embodiment, by designing multiple protrusions 21 to be serrated, it is not only beneficial to the movement of the sensing component 3 relative to the protrusion 21, but also can increase the change amount of the sensing component 3 in each deformation cycle, thereby improving the usability of the encoder. Among them, the deformation of the sensing component 3 can cause a part of the sensing component 3 to deform, so as to separate the deformed part from the sensing part, thereby reducing the difficulty of its processing and assembly. In addition, setting the shape and size of each sawtooth to be the same can facilitate the identification of each deformation cycle and improve the gear recognition accuracy.

[0081] Alternatively, if Figure 1 to Figure 2 As shown, each saw tooth has a first inclined surface and a second inclined surface on both sides, and the first inclined surface and the second inclined surface have different slopes.

[0082] Specifically, in this embodiment, the first inclined surface and the second inclined surface of each sawtooth have different slopes, so that when the outer ring 2 rotates forward or reversely relative to the inner ring 1, the vibration (deformation) waveform generated by the induction component 3 is different, and the waveform of the generated electrical signal is different. In this way, the purpose of determining the rotation direction can be achieved, the number of gears is further increased, and the accuracy of the encoder is improved.

[0083] In an example of this embodiment, determining the rotation angle of the encoder according to the electrical signal during the rotation operation includes: constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform curve and the slope of each pulse, wherein the pulse represents the change in the electrical signal during the process of the sensing component moving from one groove to another adjacent groove; determining the rotation direction and rotation angle of the encoder according to the number of pulses, the slope of each pulse and a pre-stored second corresponding relationship, wherein the second corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

[0084] In this embodiment, since the slopes of the two inclined surfaces of the protrusion are different, the time taken by the inductive device to pass through the two inclined surfaces will be different, resulting in different slopes of the pulses of the generated electrical signal. In this example, the slope interval of the waveform of the electrical signal generated when the inductive device passes through the two inclined surfaces can be pre-tested and stored. Later, when the encoder is rotated, the slope of the waveform curve of the electrical signal at the beginning of the rotation process can be determined, that is, Figure 5The slope after the time starts from 0, and the slope is compared with the interval of two pre-stored slopes to determine which inclined surface the encoder passes through first, thus determining the direction of rotation of the encoder. At the same time, based on the same method as the aforementioned embodiment, the correspondence between the number of pulses and the rotation angle of the encoder can be pre-stored, and the correspondence can be determined based on the number of protrusions. For example, in the encoder, there are 360 ​​protrusions, then the rotation angle corresponding to each protrusion is 1 degree, which is equivalent to the rotation angle corresponding to each pulse being 1 degree. Afterwards, the rotation angle of the encoder can be determined based on the number of pulses during the rotation process.

[0085] In an example of the present embodiment, the rotation direction and rotation angle of the encoder are determined according to the number of pulses, the slope of the pulses and a pre-stored second correspondence, including: respectively determining the slope of a first interval and the slope of a second interval of each pulse in the waveform curve, the first interval being the interval from a trough to a peak in each pulse, and the second interval being the interval from a peak to a trough in each pulse; determining the ratio of the slope of the first interval and the slope of the second interval of each pulse; determining the first pulse and the second pulse according to the ratio, wherein the moving directions of the sensing components corresponding to the first pulse and the second pulse are different; respectively determining the number of the first pulse and the second pulse, and determining the rotation angle of the encoder in two directions according to the number of the first pulse and the second pulse and the second correspondence; determining the rotation direction and rotation angle of the encoder according to the encoded rotation angles of the encoder in two directions.

[0086] In an example of the present embodiment, determining a first pulse and a second pulse according to a ratio includes: comparing the ratio with a preset first ratio and a second ratio; when the difference between the ratio and the first ratio is less than a threshold value, determining that the pulse corresponding to the ratio is a first pulse, wherein the first ratio is a ratio of a slope of a first interval of a pulse generated by the encoder rotating in a first rotation direction to a slope of a second interval; when the difference between the ratio and the second ratio is less than a threshold value, determining that the pulse corresponding to the ratio is a second pulse, wherein the second ratio is a ratio of a slope of a first interval of a pulse generated by the encoder rotating in a second rotation direction to a slope of a second interval.

[0087] In this example, if Figure 5As shown, each pulse can be divided into a first interval and a second interval, the first interval is the interval from trough to peak, that is, the interval from point 0 to point a, and the second interval is the interval from peak to trough, that is, the interval from point a to point b. Normally, the speed at which the user rotates the button will be within a certain interval. However, in order to avoid the problem that the user rotates the button too fast or too slow, resulting in the slope of the curve not being in the preset slope interval, the influence of the rotation speed can also be eliminated by calculating the ratio of the slopes of the two intervals in each pulse. In this embodiment, the ratio of the slopes of the two intervals in the two rotation directions of the encoder, that is, the first ratio and the second ratio, can be pre-tested and stored, so as to determine whether the type of the pulse is the first pulse or the second pulse based on the slope ratio of the actual electrical signal pulse waveform. When the difference between the slope ratio of the pulse waveform of the actual electrical signal and either the first ratio or the second ratio is within the preset threshold, it can be determined whether it is the first pulse or the second pulse. The first pulse and the second pulse are two types of pulses generated when the encoder rotates in opposite directions, such as Figure 5 As shown, bc and cd can be one of the first pulse and the second pulse respectively.

[0088] In actual situations, when the user rotates the encoder, it is possible that the encoder is not rotated in a single direction. Therefore, when determining the rotation direction and rotation angle of the encoder, the number of the first pulse and the second pulse can be determined respectively, and based on the correspondence between the number of pulses and the encoder rotation angle stored in advance, the rotation angles in the two directions can be determined respectively, and then the final rotation angle of the encoder can be determined. For example, "the rotation angle of the encoder in the first direction is 60 degrees, and the rotation angle in the second direction is 120 degrees", then the rotation direction and angle of the encoder is 60 degrees in the second direction.

[0089] In an example of this embodiment, the rotation angle of the encoder is determined according to the electrical signal during the rotation operation, including: constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform and the duration corresponding to each pulse, wherein the pulse represents the change in the electrical signal during the process of the sensing component moving from one groove to another adjacent groove; determining the rotation direction and rotation angle of the encoder according to the number of pulses, the duration corresponding to each pulse and a pre-stored third correspondence, wherein the third correspondence is the rotation angle of the encoder corresponding to each pulse.

[0090] In this embodiment, since the slopes of the two inclined surfaces of the raised portion are different, the time taken by the induction device to pass through the two inclined surfaces will be different. Later, during the rotation of the encoder, the time corresponding to the pulse of the electrical signal waveform at the beginning of the rotation process can be determined. Specifically, the time for the electrical signal to increase and decrease in each pulse can be determined respectively, so as to determine the direction according to the time. And based on the same method as the aforementioned embodiment, the correspondence between the number of pulses and the encoder rotation angle can be pre-stored, and the correspondence can be determined based on the number of raised portions. For example, in the encoder, 360 raised portions are provided, then the rotation angle corresponding to each raised portion is 1 degree, which is equivalent to the rotation angle corresponding to each pulse being 1 degree. Later, the rotation angle of the encoder can be determined based on the number of pulses during the rotation process.

[0091] In an example of the present embodiment, the rotation direction and rotation angle of the encoder are determined according to the number of pulses, the duration corresponding to each pulse and a pre-stored third correspondence, including: respectively determining the first duration corresponding to the first interval and the second duration corresponding to the second interval of each pulse in the waveform, the first interval being the interval from the trough to the peak in each pulse, and the second interval being the interval from the peak to the trough in each pulse; determining the ratio of the first duration and the second duration of each pulse; determining the first pulse and the second pulse according to the ratio, wherein the moving directions of the sensing components corresponding to the first pulse and the second pulse are different; respectively determining the number of the first pulse and the second pulse, and determining the rotation angle of the encoder in two directions according to the number of the first pulse, the second pulse and the third correspondence; determining the rotation direction and rotation angle of the encoder according to the encoded rotation angles of the encoder in two directions.

[0092] In an example of the present embodiment, determining the first pulse and the second pulse according to the ratio includes: comparing the ratio with a preset third ratio and a fourth ratio; when the difference between the ratio and the third ratio is less than a threshold value, determining the pulse corresponding to the ratio to be the first pulse, wherein the third ratio is a ratio of a first duration to a second duration of a pulse generated by the encoder in a first rotation direction; when the difference between the ratio and the fourth ratio is less than a threshold value, determining the pulse corresponding to the ratio to be the second pulse, wherein the fourth ratio is a ratio of the first duration to the second duration of a pulse generated by the encoder in a second rotation direction.

[0093] In this example, if Figure 5As shown, each pulse can be divided into a first interval and a second interval, the first interval is the interval from trough to peak, that is, the interval from point 0 to point a, and the second interval is the interval from peak to trough, that is, the interval from point a to point b. Normally, the speed at which the user rotates the button will be within a certain interval. However, in order to avoid the problem that the slope of the curve is not in the preset slope interval due to the user rotating the button too fast or too slow, the influence of the rotation speed can be eliminated by calculating the ratio of the duration of the two intervals in each pulse. In this embodiment, the ratio of the duration of the two intervals of the encoder in the two rotation directions, that is, the third ratio and the fourth ratio, can be pre-tested and stored, so as to determine whether the type of the pulse is the first pulse or the second pulse based on the slope ratio of the actual electrical signal pulse waveform. When the difference between the duration ratio of the pulse waveform of the actual electrical signal and any one of the third ratio or the fourth ratio is within the preset threshold, it can be determined whether it is the first pulse or the second pulse. The first pulse and the second pulse are two types of pulses generated when the encoder rotates in opposite directions, such as Figure 5 As shown, bc and cd can be one of the first pulse and the second pulse respectively.

[0094] In actual situations, when the user rotates the encoder, it is possible that the encoder is not rotated in a single direction. Therefore, when determining the rotation direction and rotation angle of the encoder, the number of the first pulse and the second pulse can be determined respectively, and based on the correspondence between the number of pulses and the encoder rotation angle stored in advance, the rotation angles in the two directions can be determined respectively, and then the final rotation angle of the encoder can be determined. For example, "the rotation angle of the encoder in the first direction is 60 degrees, and the rotation angle in the second direction is 120 degrees", then the rotation direction and angle of the encoder is 60 degrees in the second direction.

[0095] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, any one of the embodiments of the method for determining the rotation angle of the encoder is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0096] An embodiment of the present application also provides a storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, any one of the above-mentioned embodiments of the method for determining the rotation angle of the encoder is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0097] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0098] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0099] The embodiments of the present disclosure may be systems, methods and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present disclosure.

[0100] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0101] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0102] The computer program instructions for performing the operation of the embodiments of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the embodiments of the present disclosure.

[0103] Various aspects of the embodiments of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0104] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0105] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0106] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0107] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for determining the rotation angle of an encoder, characterized in that: The encoder comprises: an inner ring and an outer ring, the outer ring is rotatably arranged on the outer side of the inner ring, and a plurality of protrusions are arranged on the inner side of the outer ring or the outer side of the inner ring, a groove is formed between two adjacent protrusions, and the sensing component is arranged on the inner ring or the outer ring where the protrusions are not arranged, and partially extends into the groove; the method comprises: In response to a user's rotation operation on the encoder, an electrical signal during the rotation operation is acquired according to the deformation amount of the sensing component, wherein during the rotation of the encoder, the plurality of protrusions can respectively cause the sensing component to deform; The rotation angle of the encoder is determined based on the electrical signal during the rotation operation.

2. The method according to claim 1, characterized in that Determining the rotation angle of the encoder according to the electrical signal during the rotation operation includes: Constructing a waveform curve of the electrical signal during the rotation operation and determining the number of pulses in the waveform curve, wherein the pulses represent changes in the electrical signal during the process of the induction component moving from one groove to another adjacent groove; The rotation angle of the encoder is determined according to the number of pulses and a pre-stored first corresponding relationship, wherein the first corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

3. The method according to claim 1, characterized in that The plurality of protrusions are sawtooth-shaped, and the sawtooths are of the same shape and size, and each sawtooth has a first inclined plane and a second inclined plane on both sides, and the first inclined plane and the second inclined plane have different slopes, and the rotation angle of the encoder is determined according to the electrical signal during the rotation operation, including: Constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform curve and the slope of each pulse, wherein the pulse represents the change of the electrical signal during the process of the induction component moving from one groove to another adjacent groove; The rotation direction and rotation angle of the encoder are determined according to the number of pulses, the slope of each pulse and a pre-stored second corresponding relationship, wherein the second corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

4. The method according to claim 3, characterized in that Determining the rotation direction and rotation angle of the encoder according to the number of pulses, the slope of the pulses and a pre-stored second corresponding relationship includes: Respectively determine the slope of a first interval and a slope of a second interval of each pulse in the waveform, wherein the first interval is an interval from a trough to a peak in each pulse, and the second interval is an interval from a peak to a trough in each pulse; determining a ratio of a slope of the first interval to a slope of the second interval for each pulse; Determine a first pulse and a second pulse according to the ratio, wherein the first pulse and the second pulse correspond to different movement directions of the sensing component; Determine the number of the first pulse and the second pulse respectively, and determine the rotation angle of the encoder in two directions according to the number of the first pulse, the second pulse and the second corresponding relationship; The rotation direction and rotation angle of the encoder are determined according to the encoding rotation angles of the encoder in two directions.

5. The method according to claim 4, characterized in that The determining the first pulse and the second pulse according to the ratio comprises: comparing the ratio with a preset first ratio and a second ratio; When the difference between the ratio and the first ratio is less than a threshold value, determining that the pulse corresponding to the ratio is a first pulse, wherein the first ratio is a ratio of a slope of a first interval to a slope of a second interval of a pulse generated by the encoder rotating in a first rotation direction; When the difference between the ratio and the second ratio is less than a threshold value, the pulse corresponding to the ratio is determined to be the second pulse, wherein the second ratio is the ratio of the slope of the first interval of the pulse generated by the encoder rotating in the second rotation direction to the slope of the second interval.

6. The method according to claim 1, characterized in that The plurality of protrusions are sawtooth-shaped, and the sawtooths are of the same shape and size, and each sawtooth has a first inclined plane and a second inclined plane on both sides, and the first inclined plane and the second inclined plane have different slopes, and the rotation angle of the encoder is determined according to the electrical signal during the rotation operation, including: Constructing a waveform curve of the electrical signal during the rotation operation, and determining the number of pulses in the waveform curve and the duration of each pulse, wherein the pulse represents the change of the electrical signal during the process of the induction component moving from one groove to another adjacent groove; The rotation direction and rotation angle of the encoder are determined according to the number of pulses, the duration corresponding to each pulse and a pre-stored third corresponding relationship, wherein the third corresponding relationship is the rotation angle of the encoder corresponding to each pulse.

7. The method according to claim 6, characterized in that Determining the rotation direction and rotation angle of the encoder according to the number of pulses, the duration corresponding to each pulse and a pre-stored third corresponding relationship includes: Respectively determine a first duration corresponding to a first interval and a second duration corresponding to a second interval of each pulse in the waveform, wherein the first interval is an interval from a trough to a peak in each pulse, and the second interval is an interval from a peak to a trough in each pulse; determining a ratio of the first duration to the second duration of each pulse; Determine a first pulse and a second pulse according to the ratio, wherein the first pulse and the second pulse correspond to different movement directions of the sensing component; Determine the number of the first pulse and the second pulse respectively, and determine the rotation angle of the encoder in two directions according to the number of the first pulse, the second pulse and the third corresponding relationship; The rotation direction and rotation angle of the encoder are determined according to the encoding rotation angles of the encoder in two directions.

8. The method according to claim 7, characterized in that The determining the first pulse and the second pulse according to the ratio comprises: comparing the ratio with a preset third ratio and a fourth ratio; When the difference between the ratio and the third ratio is less than a threshold value, determining that the pulse corresponding to the ratio is the first pulse, wherein the third ratio is a ratio of a first duration to a second duration of a pulse generated by the encoder in a first rotation direction; When the difference between the ratio and the fourth ratio is less than a threshold value, the pulse corresponding to the ratio is determined to be the second pulse, wherein the fourth ratio is the ratio of the first duration to the second duration of the pulse generated by the encoder in the second rotation direction.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.