Quadrature decoding circuit, micro-processing chip and encoder control system
Through the combination of modules in the orthogonal decoding circuit, the counting error problem caused by the susceptibility of the encoder signal is solved, and the accuracy of the encoder counting and the precise control of the encoder control system are realized.
Patent Information
- Application Number
- CN202422149429.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2034-09-02
AI Technical Summary
The A and B signals of the encoder are easily disturbed by external interference, resulting in inaccurate counting values, which in turn causes encoder counting errors.
The orthogonal decoding circuit is adopted, including the orthogonal decoding module, the recording module, the configuration module and the trigger module. By receiving the encoder's signal, the counting signal and the trigger signal are generated, the counting information is corrected according to the preset requirements, and the error of the encoder being rotated by one turn is eliminated.
The counting accuracy of the encoder is improved, the errors generated by rotating the encoder by one turn are eliminated, and the cumulative errors are not caused, and the precise control of the encoder control system is achieved.
Smart Images

Figure CN223141911U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of circuit control technology, and in particular, to a quadrature decoding circuit, a microprocessing chip, and an encoder control system. Background Art
[0002] Generally, an encoder usually generates three signals, A, B, and Z. Among them, the A and B signals are the phase signals of the encoder, usually forming an orthogonal signal pair, and their change order can be used to determine the rotation direction and speed of the motor. The Z signal is usually referred to as the "zero signal" or "index signal". This signal is activated at a specific position in each revolution of the encoder and is usually used to provide an absolute position reference point.
[0003] During the process of quadrature decoding of the A and B signals, the Z signal is usually only applied to find the zero point during the startup process. However, during the quadrature decoding process, the A and B signals are easily affected by external interference, resulting in pulse loss or increase, which will lead to inaccurate count values of the encoder, thus causing errors in the encoder count, and further causing control errors in intelligent devices using the encoder. Summary of the Utility Model
[0004] The present application provides a quadrature decoding circuit, a microprocessing chip, and an encoder control system to solve the problem that the A and B signals of the encoder are easily affected by external interference, resulting in inaccurate count values of the encoder.
[0005] On the one hand, the present application provides a quadrature decoding circuit, including a quadrature decoding module, a recording module, a configuration module, and a trigger module;
[0006] The input end of the quadrature decoding module is connected to the first output end of the encoder, and the output end is connected to the input end of the recording module, and is used to receive the first signal and the second signal output by the encoder, and generate a count signal and send it to the recording module;
[0007] The recording module is used to store the count information corresponding to the encoder based on the count signal;
[0008] The input end of the trigger module is connected to the second output end of the encoder, and the output end is connected to the input end of the configuration module, and is used to receive the third signal output by the encoder, and generate a trigger signal and send it to the configuration module;
[0009] The configuration module is connected to the recording module, and is used to obtain the count information based on the trigger signal, and when the count information meets the preset requirements, write the level width information carried by the trigger signal into the recording module, otherwise, clear the count information.
[0010] Direct error correction without complex calculations can be performed, and the error generated when the encoder rotates one circle can be eliminated, without causing cumulative errors, improving the counting accuracy of the incremental encoder signal.
[0011] In one embodiment, it further includes a storage module. The input end of the storage module is connected to the configuration module, and is used to obtain and store the level width information carried by the trigger signal when the configuration module receives the trigger signal.
[0012] In one embodiment, it further includes a filtering module. The filtering module is connected between the second output end of the encoder and the input end of the trigger module, and is used to perform filtering processing on the third signal.
[0013] In one embodiment, it further includes a filtering configuration module. The filtering configuration module is connected to the filtering module and is used to store filtering parameters; the filtering module is used to perform filtering processing on the third signal based on the filtering parameters.
[0014] In one embodiment, the filtering module includes:
[0015] A first resistor, one end of which is connected to the second output end of the encoder, and the other end is connected to the positive input end of the operational amplifier;
[0016] The negative input end of the operational amplifier is grounded in series with a second resistor, and the output end is connected to the input end of the trigger module.
[0017] In one embodiment, the filtering module further includes;
[0018] A first capacitor, connected between the second output end of the encoder and the output end of the operational amplifier;
[0019] A third resistor, one end of which is connected to the second output end of the encoder, and the other end is grounded;
[0020] A second capacitor, one end of which is connected to the positive input end of the operational amplifier, and the other end is grounded;
[0021] A fourth resistor, connected between the negative input end and the output end of the operational amplifier.
[0022] In one embodiment, the counting information includes a counting value and a counting direction;
[0023] The preset requirement is that the counting direction conforms to the first direction;
[0024] The configuration module is used to write the level width information carried by the trigger signal into the counting value when the counting direction conforms to the first direction.
[0025] In one embodiment, the triggering module includes a rising-edge triggering unit; the triggering signal includes a first sub-signal;
[0026] The configuration module is configured to obtain the counting direction based on the first sub-signal, and when the counting direction conforms to the first direction, write the level width information into the recording module; when the counting direction conforms to the second direction, clear the counting value to zero.
[0027] In one embodiment, the triggering module includes a falling-edge triggering unit; the triggering signal includes a second sub-signal;
[0028] The configuration module is configured to obtain the counting direction based on the second sub-signal, and when the counting direction conforms to the first direction, clear the counting value to zero, and when the counting direction conforms to the second direction, write the level width information into the recording module.
[0029] In a second aspect, the present application further provides a microprocessing chip, including the quadrature decoding circuit according to any one of the above embodiments.
[0030] In a third aspect, the present application further provides an encoder control system, including a motor device, where a motor and an encoder are arranged inside the motor device, and the microprocessing chip according to any one of the above embodiments is arranged inside the encoder.
[0031] The above-mentioned quadrature decoding circuit, microprocessing chip, and encoder control system can correct the counting error of the encoder based on the phase signal and zero-bit pulse signal generated by the encoder, eliminate the error generated when the encoder rotates one circle, and will not cause cumulative error, thereby improving the counting accuracy of the encoder. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0033] Figure 1 It is a schematic structural diagram of an encoder control system in an embodiment;
[0034] Figure 2 It is a schematic structural diagram of a quadrature decoding circuit in an embodiment;
[0035] Figure 3 It is a signal schematic diagram of a first signal, a second signal, and a third signal output by the encoder when the motor rotates in the clockwise direction CW and the counterclockwise direction CCW in an embodiment;
[0036] Figure 4Schematic diagram of an orthogonal decoding circuit including a rising edge trigger unit in an embodiment;
[0037] Figure 5 Schematic diagram of an orthogonal decoding circuit including a falling edge trigger unit in an embodiment;
[0038] Figure 6 Schematic diagram of an orthogonal decoding circuit including a register module in an embodiment;
[0039] Figure 7 Schematic diagram of an orthogonal decoding circuit including a filtering module in an embodiment;
[0040] Figure 8 Schematic diagram of a filtering module in an embodiment;
[0041] Figure 9 Schematic diagram of an orthogonal decoding circuit including a filtering configuration module in an embodiment.
[0042] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and more detailed descriptions will be given later. These drawings and text descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0043] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0044] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0045] Some exemplary embodiments of the present invention are described for the purpose of illustration. It should be understood that the present invention can be implemented in other ways not specifically shown in the drawings.
[0046] Please refer to Figure 1, in one embodiment, the present application provides an encoder control system 100, including a motor device. Inside the motor device, there is a motor 110 and an encoder 120. Inside the encoder 120, there is a microprocessing chip, and an orthogonal decoding circuit 130 is soldered on the microprocessing chip.
[0047] The motor 110 is a device that converts electrical energy into mechanical energy. The encoder 120 is a sensor used to detect the rotation position, speed, or direction of the motor 110 and convert mechanical motion into electrical signals.
[0048] The encoder control system 100 can be set in a control device, which refers to a mechanical device that needs to precisely control position, speed, acceleration, etc., such as intelligent robots, 3D printers, automated transmission systems, numerical control machine tools, intelligent driving cars, floor-sweeping robots, etc. Among them, intelligent robots can be applied to automated production lines, medical surgeries, precision assembly, etc. fields, and they usually use motors and encoders to achieve precise motion control; 3D printers rely on motors and encoders to control the movement of the print head and the extrusion of printing materials to ensure the printing accuracy and quality; in the manufacturing and warehousing industries, the conveyor belts of automated conveying systems usually use motors and encoders to control the conveying speed, direction, and position; numerical control machine tools need to precisely control the position and movement of the cutting tool and usually are equipped with motors and encoders to ensure the machining accuracy of the machine tool; the steering system and tire control system inside intelligent driving cars usually use motors and encoders to achieve precise control and position feedback of the vehicle.
[0049] Please refer to Figure 2 , the above-mentioned orthogonal decoding circuit 130 may include: an orthogonal decoding module 131, a recording module 132, a configuration module 133, and a trigger module 134;
[0050] The input end of the orthogonal decoding module 131 is connected to the first output end of the encoder, and the output end is connected to the input end of the recording module 132, and is used to receive the first signal and the second signal output by the encoder, generate a counting signal, and send it to the recording module 132;
[0051] The recording module 132 is used to store the counting information corresponding to the encoder based on the counting signal;
[0052] The input end of the trigger module 134 is connected to the second output end of the encoder, and the output end is connected to the input end of the configuration module 133, and is used to receive the third signal output by the encoder, generate a trigger signal, and send it to the configuration module 133;
[0053] The configuration module 133 is connected to the recording module 132, and is used to obtain count information based on a trigger signal. When the count information meets a preset requirement, the level width information carried by the trigger signal is written into the recording module 132. Otherwise, the count information is cleared.
[0054] As an example, the first signal may be the A-phase signal output by the encoder, and the second signal may be the B-phase signal output by the encoder. The A-phase signal and the B-phase signal are the phase signals of the encoder, and usually form a pair of orthogonal signals. Their change order can be used to determine the rotation direction and speed of the above-mentioned motor. Specifically: when the A-phase signal changes first and then the B-phase signal changes, it represents that the motor rotates clockwise; when the B-phase signal changes first and then the A-phase signal changes, it represents that the motor rotates counterclockwise.
[0055] According to the phase difference between the A-phase signal and the B-phase signal, the rotation speed and direction of the motor can be calculated.
[0056] The third signal may be the Z-phase signal. The Z-phase signal is usually called the zero-bit pulse signal. The Z-phase signal is activated at a specific position in each revolution of the encoder and is usually used to provide an absolute position reference point. By detecting the Z-phase signal, the position count can be reset so that the control system can accurately know the current position.
[0057] In an optional embodiment, the count information includes, for example, a count value and a count direction;
[0058] The preset requirement is that the count direction conforms to the first direction;
[0059] The configuration module 133 is used to write the level width information carried by the trigger signal into the count value when the count direction conforms to the first direction.
[0060] Among them, the quadrature decoding module 131 can obtain the count information of the encoder based on the received A-phase signal and B-phase signal, and generate a count signal based on the count information and send it to the recording module 132.
[0061] The specific process for the above-mentioned quadrature decoding module 131 to obtain the count value of the encoder may include: when the rising edge (from low to high) of the A-phase signal occurs, the current state of the B-phase signal will determine whether the count value increases or decreases: if the B-phase signal is high, the count value is incremented by 1; if the B-phase signal is low, the count value is decremented by 1.
[0062] The specific process for the above orthogonal decoding module 131 to obtain the counting direction of the encoder may include: It can be predetermined that the clockwise direction is the first direction. When the A-phase signal changes first and then the B-phase signal changes, it is determined that the motor rotates clockwise, and at this time, the counting direction of the encoder conforms to the first direction; when the B-phase signal changes first and then the A-phase signal changes, it is determined that the motor rotates counterclockwise, and at this time, the counting direction of the encoder does not conform to the first direction.
[0063] As an example, please refer to Figure 3 , which shows the signal schematic diagrams of the A-phase signal, B-phase signal, and Z-phase signal output by the encoder when the motor rotates in the clockwise direction CW and counterclockwise direction CCW. Among them, the level width information of the Z-phase signal indicates that the high-level width of the Z-phase signal is 2. When the motor rotates, the phase difference between the A-phase signal and B-phase signal generated by the encoder is fixed. When the Z-phase signal changes from low level to high level, it can be considered that the encoder just passes a pre-assumed specific position at this time, and this specific position can be regarded as an absolute position reference point, for example, set as the encoder rotating 0°.
[0064] If the clockwise direction CW is predetermined as the first direction and the counterclockwise direction CCW is determined as the second direction, then when the motor rotates in the counterclockwise direction CCW, the A-phase signal changes from low level to high level later than the B-phase signal. If there are interference signals in the external environment, the A-phase signal and B-phase signal may have pulse loss or increase, which will make the phase difference not fixed. At this time, the configuration module 133 can write the level width information 2 into the recording module 132 when receiving the first sub-signal, and clear the counting value when the counting direction conforms to the second direction to eliminate the error.
[0065] Please refer to Figure 4 , in an alternative embodiment, the trigger module 134 includes a rising edge trigger unit 1341; the trigger signal includes the first sub-signal;
[0066] The configuration module 133 is used to obtain the counting direction based on the first sub-signal, and write the level width information into the recording module 132 when the counting direction conforms to the first direction; clear the counting value when the counting direction conforms to the second direction.
[0067] When the rising edge trigger unit 1341 is adopted, the rising edge trigger unit 1341 can issue the first sub-signal at the rising edge position of the Z-phase signal, so that the configuration module 133 writes the level width information into the recording module 132 when the counting direction corresponding to the A-phase signal and B-phase signal conforms to the first direction; clear the counting value when the counting direction corresponding to the A-phase signal and B-phase signal conforms to the second direction to eliminate the error.
[0068] Please refer to Figure 5, in an alternative embodiment, the trigger module 134 includes a falling-edge trigger unit 1342; the trigger signal includes a second sub-signal;
[0069] The configuration module 133 is configured to obtain a counting direction based on the second sub-signal, clear the counting value when the counting direction conforms to the first direction, and write the level width information into the recording module 132 when the counting direction conforms to the second direction.
[0070] When the falling-edge trigger unit 1342 is adopted, the falling-edge trigger unit 1342 can issue a second sub-signal at the falling edge position of the Z-phase signal, so that the configuration module 133 writes the level width information into the recording module 132 when the counting directions corresponding to the A-phase signal and the B-phase signal conform to the first direction; when the counting directions corresponding to the A-phase signal and the B-phase signal conform to the second direction, the counting value is cleared to eliminate errors.
[0071] By adopting the above orthogonal encoding circuit, the counting error of the encoder can be corrected without complex calculations, the error generated by one revolution of the encoder can be eliminated, and cumulative errors will not be caused, thereby improving the counting accuracy of the encoder, and further enabling the control device applying the above encoder control system to achieve precise control of position, speed, acceleration, etc.
[0072] Please refer to Figure 6 , in an alternative embodiment, the orthogonal decoding circuit 130 may further include a register module 135. The input end of the register module 135 is connected to the configuration module 133 and is used to obtain and store the level width information carried by the trigger signal when the configuration module 133 receives the trigger signal.
[0073] Please refer to Figure 7 , in an alternative embodiment, the orthogonal decoding circuit 130 may further include a filtering module 136. The filtering module 136 is connected between the second output end of the encoder and the input end of the trigger module 134 and is used to perform filtering processing on the third signal.
[0074] Specifically, please refer to Figure 8 , the filtering module 136 may include: a first resistor R1, one end of which is connected to the second output end of the encoder and the other end of which is connected to the positive input end of the operational amplifier T; the negative input end of the operational amplifier T is connected to the ground in series with a second resistor R2, and the output end is connected to the input end of the trigger module 134.
[0075] Further, the filtering module 136 may further include: a first capacitor C1 connected between the second output terminal of the encoder and the output terminal of the operational amplifier T; a third resistor R3, one end of which is connected to the second output terminal of the encoder and the other end is grounded; a second capacitor C2, one end of which is connected to the positive input terminal of the operational amplifier T and the other end is grounded; and a fourth resistor R4 connected between the negative input terminal and the output terminal of the operational amplifier.
[0076] Wherein, the resistance value of the third resistor R3 or the first resistor R1 can be determined by the following formula:
[0077]
[0078] Wherein, R z can represent the third resistor R3 or the first resistor R1, Q is a preset value, and ω p represents the filtering parameter preset in the filtering module 136, that is, the filtering frequency, C1 represents the capacitance of the first capacitor C1, and C2 represents the capacitance of the second capacitor C2.
[0079] Please refer to Figure 9 , in an alternative embodiment, the quadrature decoding circuit 130 may further include a filtering configuration module 137. The filtering configuration module 133 is connected to the filtering module 136 and is used to store the filtering parameter; the filtering module 136 is used to filter the third signal based on the filtering parameter.
[0080] Wherein, the filtering parameter corresponding to the filtering module 136 can be determined by the following formula:
[0081]
[0082] Wherein, fm represents the maximum filtering parameter that can be set corresponding to the filtering module 136, n represents the maximum rotational speed, and Np represents the incremental encoder resolution, that is, the number of pulses output per revolution.
[0083] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not conflict, it should be considered as the scope described in this specification.
[0084] The above-described embodiments only represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. An orthogonal decoding circuit, characterized in that It includes an orthogonal decoding module, a recording module, a configuration module, and a triggering module; The input end of the orthogonal decoding module is connected to the first output end of the encoder, and the output end is connected to the input end of the recording module. It is used to receive the first signal and the second signal output by the encoder, generate a counting signal, and send it to the recording module; The recording module is used to store the counting information corresponding to the encoder based on the counting signal; The input end of the triggering module is connected to the second output end of the encoder, and the output end is connected to the input end of the configuration module. It is used to receive the third signal output by the encoder, generate a trigger signal, and send it to the configuration module; The configuration module is connected to the recording module. It is used to obtain the counting information based on the trigger signal, and when the counting information meets the preset requirements, write the level width information carried by the trigger signal into the recording module; otherwise, clear the counting information.
2. The circuit according to claim 1, wherein It further includes a register module, and the register module is connected to the configuration module. It is used to obtain and store the level width information carried by the trigger signal when the configuration module receives the trigger signal.
3. The circuit according to claim 1 or 2, characterized in that It further includes a filtering module, and the filtering module is connected between the second output end of the encoder and the input end of the triggering module. It is used to perform filtering processing on the third signal.
4. The circuit according to claim 3, wherein It further includes a filtering configuration module, and the filtering configuration module is connected to the filtering module. It is used to store filtering parameters; the filtering module is used to perform filtering processing on the third signal based on the filtering parameters.
5. The circuit according to claim 3, wherein The filtering module includes: A first resistor, one end of which is connected to the second output end of the encoder, and the other end is connected to the positive input end of the operational amplifier; The negative input end of the operational amplifier is grounded in series with a second resistor, and the output end is connected to the input end of the triggering module; A first capacitor, which is connected between the second output end of the encoder and the output end of the operational amplifier; A third resistor, one end of which is connected to the second output end of the encoder, and the other end is grounded; A second capacitor, one end of which is connected to the positive input end of the operational amplifier, and the other end is grounded; A fourth resistor, which is connected between the negative input end and the output end of the operational amplifier.
6. The circuit according to claim 1, wherein The counting information includes a counting value and a counting direction; The preset requirement is that the counting direction conforms to the first direction; The configuration module is used to write the level width information carried by the trigger signal into the counting value when the counting direction conforms to the first direction.
7. The circuit according to claim 6, characterized in that, The triggering module includes a rising edge triggering unit; the trigger signal includes a first sub-signal; The configuration module is used to obtain the counting direction based on the first sub-signal, and when the counting direction conforms to the first direction, write the level width information into the recording module; when the counting direction conforms to the second direction, clear the counting value.
8. The circuit according to claim 6, wherein The triggering module includes a falling edge triggering unit; the trigger signal includes a second sub-signal; The configuration module is used to obtain the counting direction based on the second sub-signal, clear the counting value when the counting direction conforms to the first direction, and write the level width information into the recording module when the counting direction conforms to the second direction.
9. A microprocessing chip, characterized in that, It includes the quadrature decoding circuit according to any one of claims 1-8.
10. An encoder control system, characterized in that, It includes a motor device, in which a motor and an encoder are arranged, and a microprocessing chip according to claim 9 is arranged inside the encoder.