An incremental encoder and hall encoder interface circuit and fault protection circuit

CN122776701APending Publication Date: 2026-09-18YANGZHOU SHUGUANG PHOTOELECTRICITY AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610976708.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

然而,这两种信号传输方式给硬件设计带来了兼容性问题

Benefits of technology

[0032] The beneficial effects of this invention are as follows: This invention provides an interface circuit for a differentially compatible single-ended input incremental encoder and a Hall encoder. This interface circuit eliminates the need for designing two sets of circuits, switching between differential and single-ended inputs via an analog switching circuit. When the motor feedback encoder uses differential transmission, the MCU sets the corresponding single-ended control pin low; if single-ended transmission is used, the MCU sets the corresponding single-ended control pin high. This method offers high flexibility. Furthermore, the design of a fault detection circuit significantly reduces software development costs and the complexity of protection algorithms, improving the system's real-time performance and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122776701A_ABST
    Figure CN122776701A_ABST
Patent Text Reader

Abstract

An incremental encoder and Hall encoder interface circuit and fault protection circuit are disclosed, relating to the fields of motor control, industrial automation, and sensor signal processing. It includes a differential receiver unit, a first analog switch unit, a second analog switch unit, a fault detection and protection unit, and an MCU. The MCU is electrically connected to the differential receiver unit, the first analog switch unit, the second analog switch unit, and the fault detection and protection unit. The interface circuit of this invention eliminates the need for two sets of circuits, switching between differential input and single-ended input via an analog switch circuit. When the motor feedback encoder uses differential transmission, the MCU sets the corresponding single-ended control pin low; if single-ended transmission is used, the MCU sets the corresponding single-ended control pin high. This method offers high flexibility. Furthermore, the inclusion of a fault detection circuit significantly reduces software development costs and the complexity of the protection algorithm, improving the system's real-time performance and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of motor control, industrial automation, and sensor signal processing technology, specifically to an incremental encoder and Hall encoder interface circuit and fault protection circuit. Background Technology

[0002] In modern servo drive systems, real-time and accurate acquisition of the motor rotor's position and speed information is a prerequisite for achieving high-performance closed-loop control (such as vector control, FOC). Currently, incremental encoders and Hall encoders are widely used as the main feedback elements in many low-cost industrial applications. Among them, the Hall encoder signal provides the servo drive with the motor's position information when it is first powered on, and after the motor starts running, the rotor position can be accurately measured using only the incremental encoder signal.

[0003] In practical engineering applications, transmission methods are categorized into single-ended and differential transmission based on factors such as system transmission distance, interference resistance, and cost. Single-ended signals use ground (GND) as the reference level, resulting in simple and inexpensive interface circuits, making them suitable for short-distance, low-noise environments. Differential signals, on the other hand, utilize the voltage difference between two signal lines for logical judgment, exhibiting extremely high common-mode rejection ratio (CMRR), effectively resisting electromagnetic interference in long-distance transmission, and are the mainstream choice in industrial settings. However, these two signal transmission methods introduce compatibility issues for hardware design. Existing servo drivers typically only have a single type of receiving interface. When the sensor type of the user's equipment does not match the driver interface (e.g., the driver only supports differential input, while the sensor is single-ended output), direct compatibility becomes a challenge.

[0004] In addition, incremental encoders and Hall encoders are connected to the servo drive feedback interface via cables. During use, it is inevitable that: the assembly or debugging personnel will not connect the plug securely, or the cable will be broken or short-circuited. This will cause the motor to fail to operate normally, and in severe cases, it will cause high-risk accidents such as motor runaway or burnout of the driver power module.

[0005] In summary, a solution is needed for a receiving circuit and a feedback anomaly detection circuit with encoder differentially compatible single-ended input. Summary of the Invention

[0006] The purpose of this invention is to provide an incremental encoder and Hall encoder interface circuit and fault protection circuit, which can effectively solve the problems in the background art.

[0007] The technical solution to achieve the above objective is: an incremental encoder and Hall encoder interface circuit and fault protection circuit, characterized in that it includes a differential receiver unit, a first analog switch unit, a second analog switch unit, a fault detection and protection unit, and an MCU; the MCU is electrically connected to the differential receiver unit, the first analog switch unit, the second analog switch unit, and the fault detection and protection unit respectively. The differential receiver unit is used to electrically connect the incremental encoder and the Hall encoder. Both the incremental encoder and the Hall encoder have single-ended and differential output modes. The differential receiver unit converts the differential signal or single-ended signal output by the incremental encoder and the Hall encoder into a single-ended level signal that can be recognized by the MCU. The first analog switch unit is used to electrically connect the negative terminal signal of the incremental encoder and switch the circuit working mode according to the control signal output by the MCU to adapt to differential signal input or single-ended signal input. The second analog switch unit is used to electrically connect to the negative terminal signal of the Hall encoder and switch the circuit operating mode according to the control signal output by the MCU to adapt to differential signal input or single-ended signal input. The fault detection and protection unit is electrically connected to the output of the differential receiver unit and the incremental encoder respectively. The fault detection and protection unit collects the incremental encoder fault signal through the incremental encoder, collects the Hall encoder fault signal through the Hall level signal output by the differential receiver unit, and feeds back the fault signal to the MCU.

[0008] Furthermore, the first analog switch unit includes a four-channel analog switch U5 and a capacitor C26. Pin 1 of analog switch U5 is used to connect to the A- port of the incremental encoder; pins 2, 3, and 9 of analog switch U5 are connected to a 2.5V power supply; pins 5, 6, and 13 of analog switch U5 are connected to the output port of the MCU, and the signal is Single_ABZ.

[0009] Pin 4 of analog switch U5 is connected to the B-port of the incremental encoder; pin 7 of analog switch U5 is grounded; pin 8 of analog switch U5 is connected to the Z-port of the incremental encoder; pin 14 of analog switch U5 is connected to a 3.3V DC regulated power supply and one end of capacitor C26, and the other end of capacitor C26 is grounded.

[0010] Furthermore, the second analog switch unit includes a four-channel analog switch U6 and a capacitor C27. Pin 1 of the analog switch U6 is used to connect to the U-port of the Hall encoder; pin 4 of the analog switch U6 is used to connect to the V-port of the Hall encoder; and pin 8 of the analog switch U6 is used to connect to the W-port of the Hall encoder.

[0011] Pins 2, 3, and 9 of analog switch U6 are connected to a 2.5V power supply; pin 7 of analog switch U6 is grounded; pins 5, 6, and 13 of analog switch U6 are connected to the output port of the MCU, with the signal being Single_UVW; pin 14 of analog switch U6 is connected to a 3.3V DC regulated power supply and one end of capacitor C27, with the other end of capacitor C27 grounded.

[0012] Furthermore, the differential receiver unit includes an incremental encoder input signal conditioning circuit, an incremental encoder four-channel differential receiver circuit, a Hall encoder input signal conditioning circuit, and a Hall encoder four-channel differential receiver circuit; the incremental encoder input signal conditioning circuit includes an incremental encoder A-phase signal conditioning circuit, an incremental encoder B-phase signal conditioning circuit, and an incremental encoder Z-phase signal conditioning circuit; the Hall encoder input signal conditioning circuit includes a Hall encoder U-phase signal conditioning circuit, a Hall encoder V-phase signal conditioning circuit, and a Hall encoder W-phase signal conditioning circuit.

[0013] Furthermore, the incremental encoder A-phase signal conditioning circuit includes resistors R3, R7, and R10, capacitors C2, C4, and C28, interface A+IN, and interface A-IN. The first terminal of resistor R3 is connected to the A+ port of the incremental encoder, and the second terminal of resistor R3 is connected to the first terminal of resistor R7, the first terminal of capacitor C28, and interface A+IN. The second terminal of resistor R3 is also connected to the first terminal of capacitor C2, and the second terminal of capacitor C2 is grounded. The first terminal of resistor R10 is connected to the A- port of the incremental encoder, and the second terminal of resistor R10 is connected to the second terminal of capacitor C28, the second terminal of R7, and interface A-IN. The second terminal of resistor R10 is also connected to the first terminal of capacitor C4, and the second terminal of capacitor C4 is grounded.

[0014] The incremental encoder B-phase signal conditioning circuit includes resistors R16, R20, and R18, capacitors C9, C12, and C30, and interfaces B+IN and B-IN. The first terminal of resistor R16 is connected to the B+ port of the incremental encoder. The second terminal of resistor R16 is connected to the first terminal of resistor R18, the first terminal of capacitor C30, and interface B+IN. The second terminal of resistor R16 is also connected to the first terminal of capacitor C9, and the second terminal of capacitor C9 is grounded. The first terminal of resistor R20 is connected to the B- port of the incremental encoder. The second terminal of resistor R20 is connected to the second terminal of capacitor C30, interface B-IN, and the second terminal of resistor R18. The second terminal of resistor R20 is also connected to the first terminal of capacitor C12, and the second terminal of capacitor C12 is grounded.

[0015] The incremental encoder Z-phase signal conditioning circuit includes resistors R29, R33, and R31, capacitors C17, C19, and C32, and interfaces Z+IN and Z-IN. The first terminal of resistor R29 is connected to the Z+ port of the incremental encoder. The second terminal of resistor R29 is connected to the first terminal of resistor R31, the first terminal of capacitor C32, and interface Z+IN. The second terminal of resistor R29 is also connected to the first terminal of capacitor C17, and the second terminal of capacitor C17 is grounded. The first terminal of resistor R33 is connected to the Z- port of the incremental encoder. The second terminal of resistor R33 is connected to the second terminal of capacitor C32, interface Z-IN, and the second terminal of resistor R31. The second terminal of resistor R33 is also connected to the first terminal of capacitor C19, and the second terminal of capacitor C19 is grounded.

[0016] Furthermore, the Hall encoder U-phase signal conditioning circuit includes resistors R4, R11, and R8, capacitors C3, C5, and C29, and interfaces U+IN and U-IN. The first terminal of resistor R4 is connected to the U+ port of the Hall encoder, and the second terminal of resistor R4 is connected to the first terminal of resistor R8, the first terminal of capacitor C29, and interface U+IN. The second terminal of resistor R4 is also connected to the first terminal of capacitor C3, and the second terminal of capacitor C3 is grounded. The first terminal of resistor R11 is connected to the U- port of the Hall encoder, and the second terminal of resistor R11 is connected to the second terminal of capacitor C29, interface U-IN, and the second terminal of resistor R8. The second terminal of resistor R11 is also connected to the first terminal of capacitor C5, and the second terminal of capacitor C5 is grounded.

[0017] The Hall encoder V-phase signal conditioning circuit includes resistors R17, R21, and R19, capacitors C10, C13, and C31, and interfaces V+IN and V-IN. The first terminal of resistor R17 is connected to the V+ port of the Hall encoder. The second terminal of resistor R17 is connected to the first terminal of resistor R19, the first terminal of capacitor C31, and interface V+IN. The second terminal of resistor R17 is also connected to the first terminal of capacitor C10, and the second terminal of capacitor C10 is grounded. The first terminal of resistor R21 is connected to the V- port of the Hall encoder. The second terminal of resistor R21 is connected to the second terminal of capacitor C31, interface V-IN, and the second terminal of resistor R19. The second terminal of resistor R21 is also connected to the first terminal of capacitor C13, and the second terminal of capacitor C13 is grounded.

[0018] The Hall encoder W-phase signal conditioning circuit includes resistors R30, R34, and R32, capacitors C18, C20, and C33, and interfaces W+IN and W-IN. The first terminal of resistor R30 is connected to the W+ port of the Hall encoder. The second terminal of resistor R30 is connected to the first terminal of resistor R32, the first terminal of capacitor C33, and interface W+IN. The second terminal of resistor R30 is also connected to the first terminal of capacitor C18, and the second terminal of capacitor C18 is grounded. The first terminal of resistor R34 is connected to the W- port of the Hall encoder. The second terminal of resistor R34 is connected to the second terminal of capacitor C33, interface W-IN, and the second terminal of resistor R32. The second terminal of resistor R34 is also connected to the first terminal of capacitor C20, and the second terminal of capacitor C20 is grounded.

[0019] Furthermore, the incremental encoder four-channel differential receiver circuit includes a differential receiver U1, resistors R5, R6, R9, and capacitors C1, C6, C7, and C8. Pin 16 of differential receiver U1 is connected to a 3.3V DC regulated power supply and also to one end of capacitor C1, with the other end of capacitor C1 grounded. Pin 8 of differential receiver U1 is grounded. Pin 3 of differential receiver U1 is connected to one end of resistor R5, and the other end of resistor R5 is connected to one end of capacitor C8, serving as the MCU_A signal output terminal. The MCU_A signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C8 is grounded. Pin 5 of differential receiver U1 is connected to one end of resistor R6, and the other end of resistor R6 is connected to one end of capacitor C7, serving as the MCU_B signal output terminal. The MCU_B signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C7 is grounded. Pin 11 of differential receiver U1 is connected to one end of resistor R9, and resistor R9... The other end is connected to one end of capacitor C6 and serves as the MCU_Z signal output terminal. The MCU_Z signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C6 is grounded. Pin 4 of differential receiver U1 is connected to a 3.3V DC regulated power supply, and pin 12 of differential receiver U1 is grounded.

[0020] Pin 2 of differential receiver U1 is connected to interface A+IN in the incremental encoder input signal conditioning circuit; pin 1 of differential receiver U1 is connected to interface A-IN in the incremental encoder input signal conditioning circuit; pin 6 of differential receiver U1 is connected to interface B+IN in the incremental encoder input signal conditioning circuit; pin 7 of differential receiver U1 is connected to interface B-IN in the incremental encoder input signal conditioning circuit; pin 10 of differential receiver U1 is connected to interface Z+IN in the incremental encoder input signal conditioning circuit; pin 9 of differential receiver U1 is connected to interface Z-IN in the incremental encoder input signal conditioning circuit.

[0021] Furthermore, the Hall encoder four-channel differential receiver circuit includes a differential receiver U2, resistors R22, R25, R26, and capacitors C11, C14, C15, and C16. Pin 16 of differential receiver U2 is connected to a 3.3V DC regulated power supply and also to one end of capacitor C11, with the other end of capacitor C11 grounded. Pin 8 of differential receiver U2 is grounded. Pin 3 of differential receiver U2 is connected to one end of resistor R22, and the other end of resistor R22 is connected to one end of capacitor C16 as the HALL_U signal output terminal, which is connected to the input terminal of the MCU. The other end of capacitor C16 is grounded. Pin 5 of differential receiver U2 is connected to one end of resistor R25, and the other end of resistor R25 is connected to one end of capacitor C15 as the HALL_V signal output terminal, which is connected to the input terminal of the MCU. The other end of capacitor C15 is grounded. Pin 11 of differential receiver U2... One end of resistor R26 is connected to pin 4, and the other end of resistor R26 is connected to one end of capacitor C14 and serves as the HALL_W signal output terminal. The HALL_W signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C14 is grounded. Pin 4 of differential receiver U2 is connected to a 3.3V DC regulated power supply, and pin 12 of differential receiver U2 is grounded.

[0022] Pin 2 of differential receiver U2 is connected to interface U+IN in the Hall encoder input signal conditioning circuit; pin 1 of differential receiver U2 is connected to interface U-IN in the Hall encoder input signal conditioning circuit; pin 6 of differential receiver U2 is connected to interface V+IN in the Hall encoder input signal conditioning circuit; pin 7 of differential receiver U2 is connected to interface V-IN in the Hall encoder input signal conditioning circuit; pin 10 of differential receiver U2 is connected to interface W+IN in the Hall encoder input signal conditioning circuit; pin 9 of differential receiver U2 is connected to interface W-IN in the Hall encoder input signal conditioning circuit.

[0023] Furthermore, the fault detection and protection circuit includes an incremental encoder feedback disconnection fault detection circuit, a Hall encoder feedback fault detection circuit, and a total fault output module.

[0024] The incremental encoder feedback disconnection fault detection circuit includes a four-channel optocoupler B1, resistors R37, R38, R39, R41, R42, R44, R40, R43, and R45, capacitors C21, C22, and C23, and diodes D1, D2, and D3.

[0025] Pin 1 of optocoupler B1 is connected to one end of resistor R37 and one end of capacitor C21. The other end of resistor R37 is connected to the A+ port of the incremental encoder, and the other end of capacitor C21 is connected to the A- port of the incremental encoder. Pin 2 of optocoupler B1 is connected to the A- port of the incremental encoder and one end of resistor R38. The other end of resistor R38 is connected to the A+ port of the incremental encoder.

[0026] Pin 3 of optocoupler B1 is connected to one end of resistor R39 and one end of capacitor C22. The other end of resistor R39 is connected to the B+ port of the incremental encoder, and the other end of capacitor C22 is connected to the B- port of the incremental encoder. Pin 4 of optocoupler B1 is connected to the B- port of the incremental encoder and one end of resistor R41. The other end of resistor R41 is connected to the B+ port of the incremental encoder.

[0027] Pin 5 of optocoupler B1 is connected to one end of resistor R42 and one end of capacitor C23. The other end of resistor R42 is connected to the Z+ port of the incremental encoder, and the other end of capacitor C23 is connected to the Z- port of the incremental encoder. Pin 6 of optocoupler B1 is connected to the Z- port of the incremental encoder and one end of resistor R44. The other end of resistor R44 is connected to the Z+ port of the incremental encoder.

[0028] Pins 16, 14, and 12 of optocoupler B1 are connected to a 3.3V DC regulated power supply; pin 15 of optocoupler B1 is connected to one end of resistor R40 and the cathode of diode D1, with the other end of resistor R40 grounded; pin 13 of optocoupler B1 is connected to one end of resistor R43 and the cathode of diode D2, with the other end of resistor R43 grounded; pin 11 of optocoupler B1 is connected to one end of resistor R45 and the cathode of diode D3, with the other end of resistor R45 grounded.

[0029] Furthermore, the Hall encoder feedback fault detection circuit includes a three-input OR gate chip U3, a three-input NAND gate chip U4, capacitors C24 and C25, and diodes D4 and D5. Pin 1 of chip U3 is connected to the HALL-V interface in the four-channel differential receiver circuit of the Hall encoder; pin 2 of chip U3 is grounded; pin 3 of chip U3 is connected to the HALL-W interface in the four-channel differential receiver circuit of the Hall encoder; pin 6 of chip U3 is connected to the HALL-U interface in the four-channel differential receiver circuit of the Hall encoder; pin 5 of chip U3 is connected to a 3.3V DC regulated power supply and one end of C24, and the other end of capacitor C24 is grounded; pin 4 of chip U3 is connected to the negative terminal of diode D4.

[0030] Pin 1 of chip U4 is connected to the HALL-V interface in the four-channel differential receiver circuit of the Hall encoder; pin 2 of chip U4 is grounded; pin 3 of chip U4 is connected to the HALL-W interface in the four-channel differential receiver circuit of the Hall encoder; pin 6 of chip U4 is connected to the HALL-U interface in the four-channel differential receiver circuit of the Hall encoder; pin 5 of chip U4 is connected to a 3.3V DC regulated power supply and one end of capacitor C25, the other end of capacitor C25 is grounded; pin 4 of chip U4 is connected to the negative terminal of diode D5.

[0031] The fault output module connects the positive terminals of diodes D1, D2, D3, D4, and D5 together to form the fault output signal terminal ENCODE_FAULT. The fault output signal terminal ENCODE_FAULT is connected to the input terminal of the MCU.

[0032] The beneficial effects of this invention are as follows: This invention provides an interface circuit for a differentially compatible single-ended input incremental encoder and a Hall encoder. This interface circuit eliminates the need for designing two sets of circuits, switching between differential and single-ended inputs via an analog switching circuit. When the motor feedback encoder uses differential transmission, the MCU sets the corresponding single-ended control pin low; if single-ended transmission is used, the MCU sets the corresponding single-ended control pin high. This method offers high flexibility. Furthermore, the design of a fault detection circuit significantly reduces software development costs and the complexity of protection algorithms, improving the system's real-time performance and security. Attached Figure Description

[0033] Figure 1 This is a system schematic diagram of the present invention; Figure 2 This is a circuit diagram of the signal conditioning circuit for phase A of an incremental encoder. Figure 3This is a circuit diagram of the B-phase signal conditioning circuit for an incremental encoder.

[0034] Figure 4 This is a circuit diagram of the Z-phase signal conditioning circuit for an incremental encoder.

[0035] Figure 5 The circuit diagram is for the U-phase signal conditioning circuit of the Hall encoder.

[0036] Figure 6 The circuit diagram is for the V-phase signal conditioning circuit of the Hall encoder.

[0037] Figure 7 The circuit diagram is for the W-phase signal conditioning circuit of the Hall encoder.

[0038] Figure 8 This is the circuit diagram of the first analog switch unit;

[0039] Figure 9 This is the circuit diagram for the second analog switch unit;

[0040] Figure 10 This is a circuit diagram of a four-channel differential receiver circuit for an incremental encoder.

[0041] Figure 11 The circuit diagram is for a four-channel differential receiver circuit for a Hall encoder. Figure 12 This is a circuit diagram for a fault detection and protection circuit. Detailed Implementation

[0042] like Figure 1-12 As shown, the present invention discloses an incremental encoder and Hall encoder interface circuit and fault protection circuit, characterized in that it includes a differential receiver unit, a first analog switch unit, a second analog switch unit, a fault detection and protection unit, and an MCU; the MCU is electrically connected to the differential receiver unit, the first analog switch unit, the second analog switch unit, and the fault detection and protection unit respectively. The differential receiver unit is used to electrically connect the incremental encoder and the Hall encoder. Both the incremental encoder and the Hall encoder have single-ended and differential output modes. The differential receiver unit converts the differential signal or single-ended signal output by the incremental encoder and the Hall encoder into a single-ended level signal that can be recognized by the MCU. The first analog switch unit is used to electrically connect the negative terminal signal of the incremental encoder and switch between two different circuit operating modes according to the control signal output by the MCU. The two circuit operating modes are respectively adapted to the signal input of the differential output incremental encoder and the single-ended output incremental encoder. The second analog switch unit is used to electrically connect the negative terminal signal of the Hall encoder and switch between two different circuit operating modes according to the control signal output by the MCU. The two circuit operating modes are respectively adapted to the signal input of the differential output Hall encoder and the single-ended output Hall encoder. The fault detection and protection unit is electrically connected to the output of the differential receiver unit and the incremental encoder respectively. The fault detection and protection unit collects the incremental encoder fault signal through the incremental encoder, collects the Hall encoder fault signal through the Hall level signal output by the differential receiver unit, and feeds back the fault signal to the MCU.

[0043] like Figure 8 As shown, the first analog switch unit includes a four-channel analog switch U5 (SN74HC4066PWR) and a capacitor C26. Pin 1 of analog switch U5 is used to connect to the A-port of the incremental encoder; pins 2, 3, and 9 of analog switch U5 are connected to a 2.5V DC power supply; pins 5, 6, and 13 of analog switch U5 are connected in parallel to the output port of the MCU, with the signal being Single_ABZ.

[0044] Pin 4 of analog switch U5 is connected to the B-port of the incremental encoder; pin 7 of analog switch U5 is grounded; pin 8 of analog switch U5 is connected to the Z-port of the incremental encoder; pin 14 of analog switch U5 is connected to one end of a 3.3V DC regulated power supply and capacitor C26, with the other end of capacitor C26 grounded. C26 is used to filter (or decouple) the power supply of analog switch U5, filtering out power supply noise and ensuring the stability of the operating voltage of analog switch U5.

[0045] like Figure 9As shown, the second analog switch unit includes a four-channel analog switch U6 (SN74HC4066PWR) and a capacitor C27. Pin 1 of analog switch U6 is connected to the U-port of the Hall encoder; pin 4 of analog switch U6 is connected to the V-port of the Hall encoder; pin 8 of analog switch U6 is connected to the W-port of the Hall encoder; pins 2, 3, and 9 of analog switch U6 are connected to a 2.5V DC power supply; pin 7 of analog switch U6 is grounded; pins 5, 6, and 13 of analog switch U6 are connected in parallel to the output port of the MCU, with the signal being Single_UVW; pin 14 of analog switch U6 is connected to a 3.3V DC regulated power supply and one end of capacitor C27, with the other end of capacitor C27 grounded. C27 is used to filter (or decouple) the power supply terminal of analog switch U6, filtering out power supply noise and ensuring the stability of the operating voltage of analog switch U6.

[0046] During operation, taking the ABZ signal of an incremental encoder as an example, when an external differential output incremental encoder is connected, the MCU outputs Single_ABZ at a low level, the internal analog switch of U5 is open, and A−, B−, and Z− are not connected to the 2.5V bias. The differential signal is processed by the external differential receiving circuit.

[0047] When the external encoder is a single-ended output incremental encoder, the MCU outputs Single_ABZ at a high level, and the corresponding channel of U5 is turned on. By switching the on-resistance, A−, B−, and Z− are biased to the 2.5V reference level, which, together with the single-ended signals A+, B+, and Z+, completes the acquisition.

[0048] The second analog switch unit U6 performs the same switching logic on the negative terminal of the Hall UVW encoder, controlled by Single_UVW.

[0049] The MCU internally stores the input mode configuration parameters for incremental encoders and Hall encoders respectively, which can be set independently on site. The MCU outputs corresponding control signals based on these parameters to achieve automatic switching between differential and single-ended input modes.

[0050] The differential receiver unit includes an incremental encoder input signal conditioning circuit, an incremental encoder four-channel differential receiver circuit, a Hall encoder input signal conditioning circuit, and a Hall encoder four-channel differential receiver circuit. The incremental encoder input signal conditioning circuit includes an incremental encoder A-phase signal conditioning circuit, an incremental encoder B-phase signal conditioning circuit, and an incremental encoder Z-phase signal conditioning circuit. The Hall encoder input signal conditioning circuit includes a Hall encoder U-phase signal conditioning circuit, a Hall encoder V-phase signal conditioning circuit, and a Hall encoder W-phase signal conditioning circuit.

[0051] like Figure 2 As shown, the incremental encoder A-phase signal conditioning circuit includes resistors R3, R7, R10, capacitors C2, C4, C28, interface A+IN, and interface A-IN. The first terminal of resistor R3 is connected to the A+ port of the incremental encoder. The second terminal of resistor R3 is connected to the first terminal of resistor R7, the first terminal of capacitor C28, and interface A+IN. The second terminal of resistor R3 is also connected to the first terminal of capacitor C2, and the second terminal of capacitor C2 is grounded. The first terminal of resistor R10 is connected to the A- port of the incremental encoder. The second terminal of resistor R10 is connected to the second terminal of capacitor C28, interface A-IN, and the second terminal of resistor R7. The second terminal of resistor R10 is also connected to the first terminal of capacitor C4, and the second terminal of capacitor C4 is grounded.

[0052] During operation, R3 and C2, and R10 and C4 respectively form a first-order low-pass filter to filter out common-mode high-frequency interference in the signal; C28 is a differential-mode filter capacitor used to filter out differential-mode interference; R7 is a line matching resistor, which can suppress signal reflection and avoid overshoot and ringing phenomena in the waveform.

[0053] like Figure 3 As shown, the incremental encoder B-phase signal conditioning circuit includes resistors R16, R20, and R18, capacitors C9, C12, and C30, interface B+IN, and interface B-IN. The first terminal of resistor R16 is connected to the B+ port of the incremental encoder. The second terminal of resistor R16 is connected to the first terminal of resistor R18, the first terminal of capacitor C30, and interface B+IN. The second terminal of resistor R16 is also connected to the first terminal of capacitor C9, and the second terminal of capacitor C9 is grounded. The first terminal of resistor R20 is connected to the B- port of the incremental encoder. The second terminal of resistor R20 is connected to the second terminal of capacitor C30, interface B-IN, and the second terminal of resistor R18. The second terminal of resistor R20 is also connected to the first terminal of capacitor C12, and the second terminal of capacitor C12 is grounded.

[0054] like Figure 4 As shown, the incremental encoder Z-phase signal conditioning circuit includes resistors R29, R33, R31, capacitors C17, C19, C32, interface Z+IN, and interface Z-IN. The first terminal of resistor R29 is connected to the Z+ port of the incremental encoder. The second terminal of resistor R29 is connected to the first terminal of resistor R31, the first terminal of capacitor C32, and interface Z+IN. The second terminal of resistor R29 is also connected to the first terminal of capacitor C17, and the second terminal of capacitor C17 is grounded. The first terminal of resistor R33 is connected to the Z- port of the incremental encoder. The second terminal of resistor R33 is connected to the second terminal of capacitor C32, interface Z-IN, and the second terminal of resistor R31. The second terminal of resistor R33 is also connected to the first terminal of capacitor C19, and the second terminal of capacitor C19 is grounded.

[0055] like Figure 5 As shown, the Hall encoder U-phase signal conditioning circuit includes resistors R4, R11, R8, capacitors C3, C5, C29, interface U+IN, and interface U-IN. The first end of resistor R4 is connected to the U+ port of the Hall encoder, and the second end of resistor R4 is connected to the first end of resistor R8, the first end of capacitor C29, and interface U+IN. The second end of resistor R4 is also connected to the first end of capacitor C3, and the second end of capacitor C3 is grounded. The first end of resistor R11 is connected to the U- port of the Hall encoder, and the second end of resistor R11 is connected to the second end of capacitor C29, interface U-IN, and the second end of resistor R8. The second end of resistor R11 is also connected to the first end of capacitor C5, and the second end of capacitor C5 is grounded.

[0056] like Figure 6As shown, the Hall encoder V-phase signal conditioning circuit includes resistors R17, R21, R19, capacitors C10, C13, and C31, and interfaces V+IN and V-IN. The first end of resistor R17 is connected to the V+ port of the Hall encoder, and the second end of resistor R17 is connected to the first end of resistor R19, the first end of capacitor C31, and interface V+IN. The second end of resistor R17 is also connected to the first end of capacitor C10, and the second end of capacitor C10 is grounded. The first end of resistor R21 is connected to the V- port of the Hall encoder, and the second end of resistor R21 is connected to the second end of capacitor C31, interface V-IN, and the second end of resistor R19. The second end of resistor R21 is also connected to the first end of capacitor C13, and the second end of capacitor C13 is grounded.

[0057] like Figure 7 As shown, the Hall encoder W-phase signal conditioning circuit includes resistors R30, R34, R32, capacitors C18, C20, C33, interface W+IN, and interface W-IN. The first end of resistor R30 is connected to the W+ port of the Hall encoder. The second end of resistor R30 is connected to the first end of resistor R32, the first end of capacitor C33, and interface W+IN. The second end of resistor R30 is also connected to the first end of capacitor C18, and the second end of capacitor C18 is grounded. The first end of resistor R34 is connected to the W- port of the Hall encoder. The second end of resistor R34 is connected to the second end of capacitor C33, interface W-IN, and the second end of resistor R32. The second end of resistor R34 is also connected to the first end of capacitor C20, and the second end of capacitor C20 is grounded.

[0058] The working principle of the incremental encoder B-phase signal conditioning circuit, the incremental encoder Z-phase signal conditioning circuit, the Hall encoder U-phase signal conditioning circuit, the Hall encoder V-phase signal conditioning circuit, and the Hall encoder W-phase signal conditioning circuit is the same as that of the incremental encoder A-phase signal conditioning circuit, and will not be repeated here.

[0059] like Figure 10As shown, the incremental encoder four-channel differential receiver circuit includes differential receiver U1 (MS2575), resistors R5, R6, R9, and capacitors C1, C6, C7, and C8. Pin 16 of differential receiver U1 is connected to a 3.3V DC regulated power supply and also to one end of capacitor C1. The other end of capacitor C1 is grounded. Capacitor C1 is used to filter power supply noise, stabilize the power supply voltage, and ensure stable operation of the differential receiver. Pin 8 of differential receiver U1 is grounded. Pin 3 of differential receiver U1 is connected to one end of resistor R5. The other end of resistor R5 is connected to one end of capacitor C8 and serves as the MCU_A signal output. The MCU_A signal output is connected to the input of the MCU. The other end of capacitor C8 is grounded. Pin 5 of differential receiver U1 is connected to one end of resistor R6. The other end of resistor R6 is connected to one end of capacitor C7 and serves as the MCU_B signal output. The MCU_B signal output is connected to the input of the MCU. The other end of capacitor C7 is grounded. Pin 11 of differential receiver U1 is connected to one end of resistor R9. The other end of resistor R9 is connected to one end of capacitor C6 and serves as the MCU_Z signal output. The signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C6 is grounded; pin 4 of differential receiver U1 is connected to a 3.3V DC regulated power supply, and pin 12 of differential receiver U1 is grounded.

[0060] Pin 2 of differential receiver U1 is connected to interface A+IN in the incremental encoder input signal conditioning circuit; pin 1 of differential receiver U1 is connected to interface A-IN in the incremental encoder input signal conditioning circuit; pin 6 of differential receiver U1 is connected to interface B+IN in the incremental encoder input signal conditioning circuit; pin 7 of differential receiver U1 is connected to interface B-IN in the incremental encoder input signal conditioning circuit; pin 10 of differential receiver U1 is connected to interface Z+IN in the incremental encoder input signal conditioning circuit; pin 9 of differential receiver U1 is connected to interface Z-IN in the incremental encoder input signal conditioning circuit.

[0061] like Figure 11As shown, the Hall encoder four-channel differential receiver circuit includes differential receiver U2 (MS2575), resistors R22, R25, R26, and capacitors C11, C14, C15, and C16. Pin 16 of differential receiver U2 is connected to a 3.3V DC regulated power supply and also to one end of capacitor C11. The other end of capacitor C11 is grounded. Capacitor C11 is used to filter power supply noise, stabilize the power supply voltage, and ensure stable operation of the differential receiver. Pin 8 of differential receiver U2 is grounded. Pin 3 of differential receiver U2 is connected to one end of resistor R22. The other end of resistor R22 is connected to one end of capacitor C16 and serves as the HALL_U signal output. The HALL_U signal output is connected to the input of the MCU. The other end of capacitor C16 is grounded. Pin 5 of differential receiver U2 is connected to one end of resistor R25. The other end of resistor R25 is connected to one end of capacitor C15 and serves as the HALL_V signal output. The HALL_V signal output is connected to the input of the MCU. The other end of capacitor C15 is grounded. Pin 11 of differential receiver U2 is connected to one end of resistor R26. Resistor R26... The other end is connected to one end of capacitor C14 and serves as the HALL_W signal output terminal. The HALL_W signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C14 is grounded. Pin 4 of differential receiver U2 is connected to a 3.3V DC regulated power supply, and pin 12 of differential receiver U2 is grounded.

[0062] Pin 2 of differential receiver U2 is connected to interface U+IN in the Hall encoder input signal conditioning circuit; pin 1 of differential receiver U2 is connected to interface U-IN in the Hall encoder input signal conditioning circuit; pin 6 of differential receiver U2 is connected to interface V+IN in the Hall encoder input signal conditioning circuit; pin 7 of differential receiver U2 is connected to interface V-IN in the Hall encoder input signal conditioning circuit; pin 10 of differential receiver U2 is connected to interface W+IN in the Hall encoder input signal conditioning circuit; pin 9 of differential receiver U2 is connected to interface W-IN in the Hall encoder input signal conditioning circuit.

[0063] The following example uses the A-phase signal of the incremental encoder in a four-channel differential receiver circuit; the other channels operate in the same way.

[0064] When an external differential signal is input, the logic output is achieved by the high and low levels of A+ and A-: when A+ is high and A- is low, receiver U1 outputs a high level; when A+ is low and A- is high, receiver U1 outputs a low level.

[0065] When an external single-ended signal is input, A- is fixed at a reference level of 2.5V; when A+ is 5V, the voltage difference between the two ends is 2.5V, and the receiver U1 outputs a high level; when A+ is 0V, the voltage difference between the two ends is -2.5V, and the receiver U1 outputs a low level.

[0066] The receiver U1 output terminal is connected in series with resistor R5 and in parallel with capacitor C8 to form a first-order RC filter network: resistor R5 serves to limit current and match impedance, and capacitor C8 filters out high-frequency noise and spike interference from line coupling to ground. The standard signal after filtering and shaping is finally input to the MCU.

[0067] like Figure 12 As shown, the fault detection and protection circuit includes an incremental encoder feedback disconnection fault detection circuit, a Hall encoder feedback fault detection circuit, and a total fault output module.

[0068] The incremental encoder feedback disconnection fault detection circuit includes a four-channel optocoupler B1 (TLP290-4), resistors R37, R38, R39, R41, R42, R44, R40, R43, and R45, capacitors C21, C22, and C23, and diodes D1, D2, and D3.

[0069] Pin 1 of optocoupler B1 is connected to one end of resistor R37 and one end of capacitor C21. The other end of resistor R37 is connected to the A+ port of the incremental encoder, and the other end of capacitor C21 is connected to the A- port of the incremental encoder. Pin 2 of optocoupler B1 is connected to the A- port of the incremental encoder and one end of resistor R38. The other end of resistor R38 is connected to the A+ port of the incremental encoder. Pin 3 of optocoupler B1 is connected to one end of resistor R39 and one end of capacitor C22. The other end of resistor R39 is connected to the B+ port of the incremental encoder, and the other end of capacitor C22 is connected to the B- port of the incremental encoder. Pin 4 of optocoupler B1 is connected to the B- port of the incremental encoder and one end of resistor R41. The other end of resistor R41 is connected to the B+ port of the incremental encoder. Pin 5 of optocoupler B1 is connected to one end of resistor R42 and one end of capacitor C23. One end of the capacitor C23 is connected to the Z+ port of the incremental encoder, and the other end of the resistor R42 is connected to the Z- port of the incremental encoder. Pin 6 of the optocoupler B1 is connected to the Z- port of the incremental encoder and one end of the resistor R44, and the other end of the resistor R44 is connected to the Z+ port of the incremental encoder. Pins 16, 14, and 12 of the optocoupler B1 are connected to a 3.3V DC regulated power supply. Pin 15 of the optocoupler B1 is connected to one end of the resistor R40 and the cathode of the diode D1, and the other end of the resistor R40 is grounded. Pin 13 of the optocoupler B1 is connected to one end of the resistor R43 and the cathode of the diode D2, and the other end of the resistor R43 is grounded. Pin 11 of the optocoupler B1 is connected to one end of the resistor R45 and the cathode of the diode D3, and the other end of the resistor R45 is grounded.

[0070] This unit uses the A-phase signal of an incremental encoder as an example to explain the working principle. Resistor R37 is the optocoupler input current limiting resistor, and resistor R38 is the signal detection resistor, which is used to collect the loop status of the A+ and A- differential signals to determine whether the line is broken.

[0071] When A+ is disconnected, A- is disconnected, or both are disconnected simultaneously, the front end of the bidirectional optocoupler cannot form an effective current loop, the potentials of A+ and A- tend to be the same, and the corresponding bidirectional optocoupler of optocoupler B1 is cut off and does not conduct; resistor R40 is a pull-down resistor, at this time, the potential of pin 15 of the bidirectional optocoupler is pulled low, and the circuit is judged to be in a fault state.

[0072] If the A+ and A- lines are connected normally and the signal loop is open, the corresponding bidirectional optocoupler of optocoupler B1 will work normally and conduct, and its pin 15 will output a high level, indicating that the line is working normally.

[0073] The Hall encoder feedback fault detection circuit includes a three-input OR gate chip U3 (SN74LVC1G332DBVR), a three-input NAND gate chip U4 (SN74LVC1G10DBVR), capacitors C24 and C25, and diodes D4 and D5. Pin 1 of chip U3 is connected to the HALL-V signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 2 of chip U3 is grounded; pin 3 of chip U3 is connected to the HALL-W signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 6 of chip U3 is connected to the HALL-U signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 5 of chip U3 is connected to a 3.3V DC regulated power supply and one end of capacitor C24, with the other end of capacitor C24 grounded; pin 4 of chip U3 is connected to the cathode of diode D4.

[0074] Pin 1 of chip U4 is connected to the HALL-V signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 2 of chip U4 is grounded; pin 3 of chip U4 is connected to the HALL-W signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 6 of chip U4 is connected to the HALL-U signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 5 of chip U4 is connected to a 3.3V DC regulated power supply and one end of capacitor C25, the other end of capacitor C25 is grounded; pin 4 of chip U4 is connected to the cathode of diode D5.

[0075] The Hall encoder outputs the following level combinations under normal conditions: 001, 010, 011, 100, 101, 110. All 0s (000) and all 1s (111) are abnormal output states. This circuit detects the "000" abnormal state through a three-input OR gate U3 and the "111" abnormal state through a three-input NAND gate U4. Specifically, Hall signals HALL_U, HALL_V, and HALL_W are connected to pins 6, 1, and 3 of the OR gate U3, respectively. When all three inputs are low (000), pin 4 of U3 outputs a low level as a fault signal. Hall signals HALL_U, HALL_V, and HALL_W are also connected to pins 6, 1, and 3 of the NAND gate U4, respectively. When all three inputs are high (111), pin 4 of U4 outputs a low level as a fault signal.

[0076] The fault output module interconnects the anodes of diodes D1, D2, D3, D4, and D5 to form the fault output signal terminal ENCODE_FAULT, which is then connected to the input terminal of the MCU.

[0077] Regardless of whether the incremental encoder branch or the Hall encoder branch fails, as long as either branch outputs a low-level fault signal, the diode will conduct, pulling the overall fault signal ENCODE_FAULT low.

[0078] The main fault signal is connected to the MCU's IO port, and the MCU monitors the level change in real time. When a falling edge from high to low is detected, it is determined that the encoder has a feedback fault, and the fault information is reported and the system is controlled to stop, thus realizing hardware fault protection.

Claims

1. An incremental encoder and Hall encoder interface circuit and fault protection circuit, characterized in that, It includes a differential receiver unit, a first analog switch unit, a second analog switch unit, a fault detection and protection unit, and an MCU; the MCU is electrically connected to the differential receiver unit, the first analog switch unit, the second analog switch unit, and the fault detection and protection unit respectively. The differential receiver unit is used to electrically connect the incremental encoder and the Hall encoder. Both the incremental encoder and the Hall encoder have single-ended and differential output modes. The differential receiver unit converts the differential signal or single-ended signal output by the incremental encoder and the Hall encoder into a single-ended level signal that can be recognized by the MCU. The first analog switch unit is used to electrically connect the negative terminal signal of the incremental encoder and switch the circuit working mode according to the control signal output by the MCU to adapt to differential signal input or single-ended signal input. The second analog switch unit is used to electrically connect to the negative terminal signal of the Hall encoder and switch the circuit operating mode according to the control signal output by the MCU to adapt to differential signal input or single-ended signal input. The fault detection and protection unit is electrically connected to the output of the differential receiver unit and the incremental encoder respectively. The fault detection and protection unit collects the incremental encoder fault signal through the incremental encoder, collects the Hall encoder fault signal through the Hall level signal output by the differential receiver unit, and feeds back the fault signal to the MCU.

2. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 1, characterized in that, The first analog switch unit includes a four-channel analog switch U5 and a capacitor C26. Pin 1 of the analog switch U5 is used to connect to the A-port of the incremental encoder; pins 2, 3, and 9 of the analog switch U5 are connected to a 2.5V power supply. Pins 5, 6, and 13 of analog switch U5 are connected to the output port of the MCU, and the signal is Single_ABZ; Pin 4 of analog switch U5 is connected to the B-port of the incremental encoder; pin 7 of analog switch U5 is grounded; pin 8 of analog switch U5 is connected to the Z-port of the incremental encoder; pin 14 of analog switch U5 is connected to a 3.3V DC regulated power supply and one end of capacitor C26, and the other end of capacitor C26 is grounded.

3. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 1, characterized in that, The second analog switch unit includes a four-channel analog switch U6 and a capacitor C27. Pin 1 of the analog switch U6 is used to connect to the U-port of the Hall encoder; pin 4 of the analog switch U6 is used to connect to the V-port of the Hall encoder; and pin 8 of the analog switch U6 is used to connect to the W-port of the Hall encoder. Pins 2, 3, and 9 of analog switch U6 are connected to a 2.5V power supply. Pin 7 of analog switch U6 is grounded. Pins 5, 6, and 13 of analog switch U6 are connected to the output port of the MCU, with the signal being Single _UVW. Pin 14 of analog switch U6 is connected to a 3.3V DC regulated power supply and one end of capacitor C27, with the other end of capacitor C27 grounded.

4. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 1, characterized in that, The differential receiver unit includes an incremental encoder input signal conditioning circuit, an incremental encoder four-channel differential receiver circuit, a Hall encoder input signal conditioning circuit, and a Hall encoder four-channel differential receiver circuit. The incremental encoder input signal conditioning circuit includes an incremental encoder A-phase signal conditioning circuit, an incremental encoder B-phase signal conditioning circuit, and an incremental encoder Z-phase signal conditioning circuit. The Hall encoder input signal conditioning circuit includes a Hall encoder U-phase signal conditioning circuit, a Hall encoder V-phase signal conditioning circuit, and a Hall encoder W-phase signal conditioning circuit.

5. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 4, characterized in that, The incremental encoder A-phase signal conditioning circuit includes resistors R3, R7, R10, capacitors C2, C4, C28, interface A+IN, and interface A-IN. The first terminal of resistor R3 is connected to the A+ port of the incremental encoder. The second terminal of resistor R3 is connected to the first terminal of resistor R7, the first terminal of capacitor C28, and interface A+IN. The second terminal of resistor R3 is also connected to the first terminal of capacitor C2, and the second terminal of capacitor C2 is grounded. The first terminal of resistor R10 is connected to the A- port of the incremental encoder. The second terminal of resistor R10 is connected to the second terminal of capacitor C28, the second terminal of resistor R7, and interface A-IN. The second terminal of resistor R10 is also connected to the first terminal of capacitor C4, and the second terminal of capacitor C4 is grounded. The incremental encoder B-phase signal conditioning circuit includes resistors R16, R20, R18, capacitors C9, C12, C30, interface B+IN, and interface B-IN. The first terminal of resistor R16 is connected to the B+ port of the incremental encoder. The second terminal of resistor R16 is connected to the first terminal of resistor R18, the first terminal of capacitor C30, and interface B+IN. The second terminal of resistor R16 is also connected to the first terminal of capacitor C9, and the second terminal of capacitor C9 is grounded. The first terminal of resistor R20 is connected to the B- port of the incremental encoder. The second terminal of resistor R20 is connected to the second terminal of capacitor C30, interface B-IN, and the second terminal of resistor R18. The second terminal of resistor R20 is also connected to the first terminal of capacitor C12, and the second terminal of capacitor C12 is grounded. The incremental encoder Z-phase signal conditioning circuit includes resistors R29, R33, R31, capacitors C17, C19, C32, interface Z+IN, and interface Z-IN. The first terminal of resistor R29 is connected to the Z+ port of the incremental encoder. The second terminal of resistor R29 is connected to the first terminal of resistor R31, the first terminal of capacitor C32, and interface Z+IN. The second terminal of resistor R29 is also connected to the first terminal of capacitor C17, and the second terminal of capacitor C17 is grounded. The first terminal of resistor R33 is connected to the Z- port of the incremental encoder. The second terminal of resistor R33 is connected to the second terminal of capacitor C32, interface Z-IN, and the second terminal of resistor R31. The second terminal of resistor R33 is also connected to the first terminal of capacitor C19, and the second terminal of capacitor C19 is grounded.

6. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 5, characterized in that, The Hall encoder U-phase signal conditioning circuit includes resistors R4, R11, R8, capacitors C3, C5, C29, interface U+IN, and interface U-IN. The first terminal of resistor R4 is connected to the U+ port of the Hall encoder. The second terminal of resistor R4 is connected to the first terminal of resistor R8, the first terminal of capacitor C29, and interface U+IN. The second terminal of resistor R4 is also connected to the first terminal of capacitor C3, and the second terminal of capacitor C3 is grounded. The first terminal of resistor R11 is connected to the U- port of the Hall encoder. The second terminal of resistor R11 is connected to the second terminal of capacitor C29, interface U-IN, and the second terminal of resistor R8. The second terminal of resistor R11 is also connected to the first terminal of capacitor C5, and the second terminal of capacitor C5 is grounded. The Hall encoder V-phase signal conditioning circuit includes resistors R17, R21, R19, capacitors C10, C13, C31, interface V+IN, and interface V-IN. The first terminal of resistor R17 is connected to the V+ port of the Hall encoder. The second terminal of resistor R17 is connected to the first terminal of resistor R19, the first terminal of capacitor C31, and interface V+IN. The second terminal of resistor R17 is also connected to the first terminal of capacitor C10, and the second terminal of capacitor C10 is grounded. The first terminal of resistor R21 is connected to the V- port of the Hall encoder. The second terminal of resistor R21 is connected to the second terminal of capacitor C31, interface V-IN, and the second terminal of resistor R19. The second terminal of resistor R21 is also connected to the first terminal of capacitor C13, and the second terminal of capacitor C13 is grounded. The Hall encoder W-phase signal conditioning circuit includes resistors R30, R34, R32, capacitors C18, C20, C33, interface W+IN, and interface W-IN. The first terminal of resistor R30 is connected to the W+ port of the Hall encoder. The second terminal of resistor R30 is connected to the first terminal of resistor R32, the first terminal of capacitor C33, and interface W+IN. The second terminal of resistor R30 is also connected to the first terminal of capacitor C18, and the second terminal of capacitor C18 is grounded. The first terminal of resistor R34 is connected to the W- port of the Hall encoder. The second terminal of resistor R34 is connected to the second terminal of capacitor C33, interface W-IN, and the second terminal of resistor R32. The second terminal of resistor R34 is also connected to the first terminal of capacitor C20, and the second terminal of capacitor C20 is grounded.

7. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 6, characterized in that, The incremental encoder four-channel differential receiver circuit includes differential receiver U1, resistors R5, R6, R9, and capacitors C1, C6, C7, and C8. Pin 16 of differential receiver U1 is connected to a 3.3V DC regulated power supply and also to one end of capacitor C1, with the other end of capacitor C1 grounded. Pin 8 of differential receiver U1 is grounded. Pin 3 of differential receiver U1 is connected to one end of resistor R5, and the other end of resistor R5 is connected to one end of capacitor C8, serving as the MCU_A signal output. The MCU_A signal output is connected to the input of the MCU, and the other end of capacitor C8 is grounded. Pin 5 of differential receiver U1 is connected to one end of resistor R6, and the other end of resistor R6 is connected to one end of capacitor C7, serving as the MCU_B signal output. The MCU_B signal output is connected to the input of the MCU, and the other end of capacitor C7 is grounded. Pin 11 of differential receiver U1 is connected to one end of resistor R9, and resistor R9... The other end is connected to one end of capacitor C6 and serves as the MCU_Z signal output terminal. The MCU_Z signal output terminal is connected to the input terminal of the MCU, and the other end of capacitor C6 is grounded. Pin 4 of differential receiver U1 is connected to a 3.3V DC regulated power supply, and pin 12 of differential receiver U1 is grounded. Pin 2 of differential receiver U1 is connected to interface A+IN in the incremental encoder input signal conditioning circuit; pin 1 of differential receiver U1 is connected to interface A-IN in the incremental encoder input signal conditioning circuit; pin 6 of differential receiver U1 is connected to interface B+IN in the incremental encoder input signal conditioning circuit; pin 7 of differential receiver U1 is connected to interface B-IN in the incremental encoder input signal conditioning circuit; pin 10 of differential receiver U1 is connected to interface Z+IN in the incremental encoder input signal conditioning circuit; pin 9 of differential receiver U1 is connected to interface Z-IN in the incremental encoder input signal conditioning circuit.

8. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 4, characterized in that, The Hall encoder four-channel differential receiver circuit includes differential receiver U2, resistors R22, R25, R26, and capacitors C11, C14, C15, and C16. Pin 16 of differential receiver U2 is connected to a 3.3V DC regulated power supply and also to one end of capacitor C11, with the other end of capacitor C11 grounded. Pin 8 of differential receiver U2 is grounded. Pin 3 of differential receiver U2 is connected to one end of resistor R22, and the other end of resistor R22 is connected to one end of capacitor C16, serving as the HALL_U signal output. The HALL_U signal output is connected to the input of the MCU, and the other end of capacitor C16 is grounded. Pin 5 of differential receiver U2 is connected to one end of resistor R25, and the other end of resistor R25 is connected to one end of capacitor C15, serving as the HALL_V signal output. The HALL_V signal output is connected to the input of the MCU, and the other end of capacitor C15 is grounded. Pin 11 of differential receiver U2 is connected to resistor R26. One end of the resistor R26 is connected to one end of the capacitor C14 and serves as the HALL_W signal output terminal. The HALL_W signal output terminal is connected to the input terminal of the MCU, and the other end of the capacitor C14 is grounded. Pin 4 of the differential receiver U2 is connected to a 3.3V DC regulated power supply, and pin 12 of the differential receiver U2 is grounded. Pin 2 of differential receiver U2 is connected to interface U+IN in the Hall encoder input signal conditioning circuit; pin 1 of differential receiver U2 is connected to interface U-IN in the Hall encoder input signal conditioning circuit; pin 6 of differential receiver U2 is connected to interface V+IN in the Hall encoder input signal conditioning circuit; pin 7 of differential receiver U2 is connected to interface V-IN in the Hall encoder input signal conditioning circuit; pin 10 of differential receiver U2 is connected to interface W+IN in the Hall encoder input signal conditioning circuit; pin 9 of differential receiver U2 is connected to interface W-IN in the Hall encoder input signal conditioning circuit.

9. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 1, characterized in that, The fault detection and protection circuit includes an incremental encoder feedback disconnection fault detection circuit, a Hall encoder feedback fault detection circuit, and a total fault output module. The incremental encoder feedback disconnection fault detection circuit includes a four-channel optocoupler B1, resistors R37, R38, R39, R41, R42, R44, R40, R43, and R45, capacitors C21, C22, and C23, and diodes D1, D2, and D3. Pin 1 of optocoupler B1 is connected to one end of resistor R37 and one end of capacitor C21. The other end of resistor R37 is connected to the A+ port of the incremental encoder, and the other end of capacitor C21 is connected to the A- port of the incremental encoder. Pin 2 of optocoupler B1 is connected to the A- port of the incremental encoder and one end of resistor R38. The other end of resistor R38 is connected to the A+ port of the incremental encoder. Pin 3 of optocoupler B1 is connected to one end of resistor R39 and one end of capacitor C22. The other end of resistor R39 is connected to the B+ port of the incremental encoder, and the other end of capacitor C22 is connected to the B- port of the incremental encoder. Pin 4 of optocoupler B1 is connected to the B- port of the incremental encoder and one end of resistor R41, while the other end of resistor R41 is connected to the B+ port of the incremental encoder. Pin 5 of optocoupler B1 is connected to one end of resistor R42 and one end of capacitor C23. The other end of resistor R42 is connected to the Z+ port of the incremental encoder, and the other end of capacitor C23 is connected to the Z- port of the incremental encoder. Pin 6 of optocoupler B1 is connected to the Z- port of the incremental encoder and one end of resistor R44. The other end of resistor R44 is connected to the Z+ port of the incremental encoder. Pins 16, 14, and 12 of optocoupler B1 are connected to a 3.3V DC regulated power supply. Pin 15 of optocoupler B1 is connected to one end of resistor R40 and the negative terminal of diode D1, with the other end of resistor R40 grounded; Pin 13 of optocoupler B1 is connected to one end of resistor R43 and the negative terminal of diode D2, with the other end of resistor R43 grounded; Pin 11 of optocoupler B1 is connected to one end of resistor R45 and the negative terminal of diode D3, with the other end of resistor R45 grounded.

10. The incremental encoder and Hall encoder interface circuit and fault protection circuit according to claim 1, characterized in that, The Hall encoder feedback fault detection circuit includes a three-input OR gate chip U3, a three-input NAND gate chip U4, capacitors C24 and C25, and diodes D4 and D5. Pin 1 of chip U3 is connected to the HALL-V signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 2 of chip U3 is grounded; pin 3 of chip U3 is connected to the HALL-W signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 6 of chip U3 is connected to the HALL-U signal output terminal of the Hall encoder four-channel differential receiver circuit; pin 5 of chip U3 is connected to a 3.3V DC regulated power supply and one end of capacitor C24, with the other end of capacitor C24 grounded; pin 4 of chip U3 is connected to the cathode of diode D4. Pin 1 of chip U4 is connected to the HALL-V signal output terminal of the four-channel differential receiver circuit of the Hall encoder; pin 2 of chip U4 is grounded; pin 3 of chip U4 is connected to the HALL-W signal output terminal of the four-channel differential receiver circuit of the Hall encoder; pin 6 of chip U4 is connected to the HALL-U signal output terminal of the four-channel differential receiver circuit of the Hall encoder; pin 5 of chip U4 is connected to a 3.3V DC regulated power supply and one end of capacitor C25, the other end of capacitor C25 is grounded; pin 4 of chip U4 is connected to the negative terminal of diode D5. The fault output module connects the positive terminals of diodes D1, D2, D3, D4, and D5 together to form the fault output signal terminal ENCODE_FAULT. The fault output signal terminal ENCODE_FAULT is connected to the input terminal of the MCU.