Incremental encoder circuit abnormality diagnosis method and diagnostic device
The two sets of encoder modules in the microcontroller unit process the differential signals output by the incremental encoder, and detect the consistency of signal direction in real time, solving the motor shutdown caused by the abnormal differential signal of the incremental encoder in electric vehicles, real-time diagnosis of line abnormalities and redundant signal output, and improving the reliability and safety of the system.
Patent Information
- Application Number
- CN202110118387.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-01-28
AI Technical Summary
In the power chain of existing electric vehicles, abnormal differential signal output by incremental encoder will cause motor operation errors or shutdowns, causing safety hazards.
The two sets of encoder modules in the microcontroller unit process the two differential signals output by the incremental encoder, detect the consistency of the signal direction in real time, judge the line abnormality, and ensure that the motor continues to operate through the redundant signal output in abnormal situations.
Real-time diagnosis and abnormal handling of incremental encoder output lines is realized, reducing the chance of motor downtime and improving the reliability and safety of electric vehicles.
Smart Images

Figure CN114814653B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a diagnostic method and a diagnostic device for an incremental encoder, and in particular to a diagnostic method and a diagnostic device for diagnosing whether an output circuit of an incremental encoder of a motor is abnormal. Background Art
[0002] In existing electric vehicle powertrain applications, motors are generally used as drivers. When the motor performs field-oriented control (FOC), a control architecture with position feedback is usually adopted to consider the control performance of the electric vehicle. Therefore, the correctness of the motor encoder signal will directly affect the control performance of the motor, and is therefore crucial.
[0003] At present, the common electric vehicles in related technologies mainly use incremental encoders to realize motor position feedback control. Figure 1 , which is a schematic diagram of a motor driver of related art.
[0004] like Figure 1 As shown, the incremental encoder 11 will output an A / B phase differential signal (differential signal), where the A / B phase differential signal includes an A signal, signal, B signal and The motor driver 12 receives two pairs of differential signals through two sets of internal differential line receivers 121 (i.e., one set of differential line receivers 121 receives the A signal and signal, another set of differential line receivers 121 receives the B signal and Signal), and respectively filter the noise of the received differential signals to generate two sets of single-ended signals. Figure 1 In the figure, these two sets of single-ended signals are represented by PGA and PGB.
[0005] like Figure 1 As shown, the motor driver 12 simultaneously receives the two pairs of differential signals through two sets of internal XOR logic circuits 122 (ie, one set of XOR logic circuits receives the A signal and signal, another set of XOR logic circuits receives the B signal and signal) to detect disconnection and generate a corresponding error signal ( Figure 1 It is represented by two PGLoss in the figure).
[0006] Next, the motor driver 12 transmits the generated two sets of single-ended signals PGA and PGB to the encoder module 131 inside the micro control unit 13, whereby the encoder module 131 can calculate the signal count (Counter) information and the signal direction (Direction) information based on the signal comparison of the two sets of single-ended signals PGA and PGB. Further, the micro control unit 13 can calculate the direction, angle and speed of the motor through the above information, and calculate the position feedback control parameters of the motor, and control the motor.
[0007] In the above structure, the motor driver 12 needs to be additionally provided with the differential line receiver 121 and the XOR logic circuit 122, which increases the production cost. In addition, when the differential signal output by the incremental encoder 11 is found to be abnormal (such as poor contact of the output line, disconnection, short circuit or signal interference, etc.), the above structure will cause the motor to operate incorrectly or stop immediately, causing harm to the machine using the motor (for example, causing an electric vehicle to stop suddenly while driving at high speed).
[0008] In view of this, the diagnostic architecture used in the relevant technology needs to be further improved. Summary of the invention
[0009] The main purpose of the present invention is to provide a method and device for diagnosing abnormality of the circuit of an incremental encoder, which can detect abnormality of the output circuit of the incremental encoder in real time and provide redundant signal output when the output circuit is abnormal.
[0010] In order to achieve the above-mentioned purpose, the circuit abnormality diagnosis method of the incremental encoder of the present invention is applied to a motor driver connected to the incremental encoder and the motor, the motor driver includes a microcontroller unit having at least a first encoder module and a second encoder module, the incremental encoder outputs an A signal, signal, B signal and signal, where The signal is the reverse signal of signal A. The signal is the reverse signal of the B signal, and the diagnostic method mainly includes the following steps: the first encoder module detects the One of the signals, and the B signal and The first differential signal composed of one of the signals is calculated to obtain a first signal information group, wherein the first signal information group includes a first signal count and a first signal direction; the second encoder module is used according to the A signal and One of the signals, and the B signal and The microcontroller calculates a second signal information group based on a second differential signal composed of one of the signals, wherein the second signal information group includes a second signal count and a second signal direction; the microcontroller calculates a first parameter information group based on the first signal information group, and calculates a second parameter information group based on the second signal information group, wherein the first parameter information group includes a first signal speed, a first signal angle and a first signal direction, and the second parameter information group includes a second signal speed, a second signal angle and a second signal direction; the microcontroller determines whether the first signal direction is consistent with the second signal direction, and when the first signal direction is consistent with the second signal direction, determines that the multiple external wires between the incremental encoder and the motor are all normal, and calculates the position feedback control parameters of the motor according to the first signal information group calculated by the first differential signal or the second signal information group calculated by the second differential signal; and, the microcontroller executes when the first signal direction is inconsistent with the second signal direction. The following steps are performed: calculating the first signal acceleration based on the first signal speed and determining whether the first signal acceleration is greater than an acceleration threshold, determining that at least one of the plurality of differential signals received by the first encoder module is abnormal when the first signal acceleration is greater than the acceleration threshold, and calculating the position feedback control parameter of the motor based on the second signal information group calculated and obtained by the second differential signal; calculating the second signal acceleration based on the second signal speed and determining whether the second signal acceleration is greater than the acceleration threshold, determining that at least one of the plurality of differential signals received by the second encoder module is abnormal when the second signal acceleration is greater than the acceleration threshold, and calculating the position feedback control parameter of the motor based on the first signal information group calculated and obtained by the first differential signal; and when the first signal direction is inconsistent with the second signal direction, the first signal acceleration is not greater than the acceleration threshold, and the second signal acceleration is not greater than the acceleration threshold, determining that the speed feedback signal is abnormal and ending the diagnosis. .
[0011] In order to achieve the above-mentioned purpose, the circuit abnormality diagnosis device of the incremental encoder of the present invention comprises at least a micro control unit connected to the incremental encoder and the motor, and the incremental encoder output comprises an A signal, signal, B signal and The incremental encoder provides an A signal via a first path and provides a signal, providing a B signal via a third path, and providing a signal, wherein a first resistor is connected between the first path and the second path, and a second resistor is connected between the third path and the fourth path. The signal is the reverse signal of signal A. The signal is an inverse signal of the B signal, and the micro control unit includes:
[0012] The first encoder module has two input terminals connected to the first path and the third path respectively, and receives the A signal from the first path and the third path and One of the signals and the B signal and a first differential signal composed of one of the signals to calculate a first signal information group, the first signal information group including a first signal count and a first signal direction;
[0013] The second encoder module has two input terminals connected to the second path and the fourth path respectively, and receives the A signal and the One of the signals and the B signal and a second difference of one of the signals to calculate a second signal information set, the second signal information set including a second signal count and a second signal direction; and
[0014] a diagnostic unit, receiving a first signal information group from an output end of the first encoder module and receiving the second signal information group from an output end of the second encoder module, calculating a first parameter information group based on the first signal information group and calculating a second parameter information group based on the second signal information group, wherein the first parameter information group includes a first signal speed, a first signal angle and a first signal direction, and the second parameter information group includes a second signal speed, a second signal angle and a second signal direction;
[0015] The diagnostic unit determines whether at least one of the multiple external wires connecting the incremental encoder to the motor driver has a line abnormality based on the first parameter information group and the second parameter information group, or determines whether a speed feedback signal of the motor is abnormal, and calculates the position feedback control parameter of the motor through the first signal information group calculated based on the first differential signal transmitted by the normal wire among the multiple external wires or the second signal information group calculated based on the second differential signal.
[0016] Compared with the related art, the present invention uses the two sets of encoder modules already in the microcontroller unit to determine whether the directions of the two sets of differential signals are consistent, and can detect in real time whether there are abnormalities in the multiple external wires used by the incremental encoder to connect the motor driver without adding additional hardware. In addition, when the present invention determines that one of the multiple external wires at the output end of the incremental encoder has a line abnormality, the motor can still continue to run through a normal set of differential signal redundant operations, reducing the chance of motor shutdown. In this way, the robustness and availability of electric vehicles can be improved, and the danger caused by the electric vehicle losing power at high speed can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 FIG. 1 is a schematic diagram of a motor driver according to the related art.
[0018] Figure 2FIG. 1 is a schematic diagram of a motor driver according to a first embodiment of the present invention.
[0019] Figure 3 This is the first specific embodiment of the diagnostic schematic diagram of the present invention.
[0020] Figure 4 FIG. 1 is a schematic diagram of signal counting and signal direction according to a first specific embodiment of the present invention.
[0021] Figure 5 This is the first specific embodiment of the diagnostic flowchart of the present invention.
[0022] Figure 6 This is a first specific embodiment of the signal diagram of the present invention.
[0023] Figure 7 This is the second specific embodiment of the diagnostic flowchart of the present invention.
[0024] Figure 8 FIG. 1 is a schematic diagram of a signal rotation speed, a signal angle and a signal direction according to a first specific embodiment of the present invention.
[0025] Fig. 9 FIG. 1 is a schematic diagram of a first specific embodiment of the redundancy effect of the present invention.
[0026] Description of reference numerals:
[0027] 11…Incremental encoder
[0028] 12…Motor driver
[0029] 121…Differential line receiver
[0030] 122…XOR logic circuit
[0031] 13…Micro control unit
[0032] 131…Encoder module
[0033] 2…Incremental encoder
[0034] 21…First external wire
[0035] 22…Second external wire
[0036] 23…Third external conductor
[0037] 24…Fourth external wire
[0038] 3…Motor driver
[0039] 31…First Path
[0040] 32…Second Path
[0041] 33…Third Path
[0042] 34…The Fourth Path
[0043] 4…Micro control unit
[0044] 41…First encoder module
[0045] 411…First input terminal
[0046] 412… Second input terminal
[0047] 413…Output
[0048] 42…Second encoder module
[0049] 421…First input
[0050] 422… Second input
[0051] 423…Output
[0052] 43…Diagnostic unit
[0053] 5…Motor
[0054] 50…Acceleration threshold
[0055] 61…First signal speed
[0056] 62…First signal angle
[0057] 63…First signal direction
[0058] 71…Second signal speed
[0059] 72…Second signal angle
[0060] 73…Second signal direction
[0061] 81…First signal count
[0062] 82…First signal direction
[0063] 83…First signal acceleration
[0064] 91…Second signal count
[0065] 92…Second signal direction
[0066] 93…Second signal acceleration
[0067] S10~S22、S30~S46…diagnosis and output steps DETAILED DESCRIPTION
[0068] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0069] The present invention discloses a circuit abnormality diagnosis device for an incremental encoder (hereinafter referred to as a diagnosis device in the specification). In one embodiment, the diagnosis device refers to a motor driver with modified internal circuits. Specifically, the diagnosis device is mainly implemented by a microcontroller unit inside the motor driver.
[0070] See also Figure 2 , which is a schematic diagram of a motor driver of the first specific embodiment of the present invention. Figure 2 A motor driver 3 is disclosed, wherein an input end of the motor driver 3 is electrically connected to an output end of an incremental encoder 2 through a plurality of external wires to receive a plurality of differential signals output by the incremental encoder 2. Furthermore, an output end of the motor driver 3 is electrically connected to a motor 5 to control the operation of the motor 5 by referring to calculated parameters (such as rotation speed, angle, direction, etc.).
[0071] like Figure 2 As shown, the motor driver 3 has at least a micro control unit (MCU) 4 inside, and the micro control unit 4 has at least two sets of encoder modules (Encoder Module) inside. Figure 2 The embodiment is based on the first encoder module 41 and the second encoder module 42 as an example, but is not limited to two sets. In addition, at least one diagnostic unit 43 is also running inside the micro control unit 4, which can be implemented in the form of firmware or physical circuit.
[0072] One of the technical features of the present invention is that the microcontroller unit 4 analyzes the differential signal received from the incremental encoder 2 through the diagnostic unit 43 to determine whether there are any abnormalities (such as disconnection, short circuit, interference, etc.) in the multiple external wires between the output end of the incremental encoder 2 and the input end of the motor driver 3. By analyzing the differential signal output by the incremental encoder 2, the technical solution of the present invention can detect in real time whether there are any abnormalities in the line between the output end of the incremental encoder 2 and the input end of the motor driver 3.
[0073] Furthermore, the present invention processes two sets of differential signals output by the incremental encoder 2 respectively through the first encoder module 41 and the second encoder module 42. Therefore, when the circuit of the output end of the incremental encoder 2 is abnormal and one set of differential signals received by the micro control unit 4 is erroneous, the micro control unit 4 can still control the motor 5 to continue to run through another set of normal differential signals, thereby reducing the chance of the motor 5 stopping. If the diagnostic system of the present invention (i.e., the modified motor driver 3) is applied to an electric vehicle, the robustness and availability of the electric vehicle can be effectively improved, and the danger caused by the electric vehicle losing power at high speed can be avoided.
[0074] In one embodiment, the first encoder module 41 and the second encoder module 42 are quadrature encoder pulse (QEP) modules, wherein the output signal of the first encoder module 41 can be represented as QEPA, and the output signal of the second encoder module 42 can be represented as QEPB, but not limited thereto.
[0075] Please also see Figure 3 , is a first specific embodiment of the diagnostic schematic diagram of the present invention. Figure 3 As shown, the output end of the incremental encoder 2 in the present invention is connected to the first encoder module 41 and the second encoder module 42 in the micro control unit 4 through multiple external wires and multiple paths inside the motor driver 3, wherein the first encoder module 41 receives the first differential signal output by the incremental encoder 2, and the second encoder module 42 receives the second differential signal output by the incremental encoder 2. Figure 2 As shown, in this embodiment, when the multiple external wires at the output end of the incremental encoder 2 are normal, the first differential signal includes the A signal and the B signal from the incremental encoder 2, and the second differential signal includes the Signal and Specifically, the The signal is the inverse signal of signal A, and the The signal is the reverse signal of the B signal, and the reverse signal refers to a signal with the same frequency and amplitude but opposite direction, which will be described in detail later.
[0076] Specifically, when one or more external wires at the output end of the incremental encoder 2 are abnormal, the signal composition of the first differential signal and / or the second differential signal may be different, which will be described in detail later.
[0077] The incremental encoder 2, by A signal, signal, B signal and The multiple differential signals constituted by the signals are all common technical means in the technical field related to motor control, and will not be elaborated here.
[0078] At Figure 2 In the embodiment, the first encoder module 41 has a first input terminal 411, a second input terminal 412 and an output terminal 413, and the second encoder module 42 has a first input terminal 421, a second input terminal 422 and an output terminal 423. The motor driver 3 also has a first path 31, a second path 32, a third path 33 and a fourth path 34 for signal transmission, wherein the first path 31 is connected to the first input terminal 411 of the first encoder module 41, the second path 32 is connected to the first input terminal 421 of the second encoder module 42, the third path 33 is connected to the second input terminal 412 of the first encoder module 41, and the fourth path 34 is connected to the second input terminal 422 of the second encoder module 42. The first encoder module 41 and the second encoder module 42 output the analyzed information to the diagnostic unit 43 and the rear-end motor 5 through the output terminals 413 and 423 respectively.
[0079] like Figure 2 As shown, the motor driver 3 further includes a first resistor 35 and a second resistor 36, wherein the first resistor 35 is connected between the first path 31 and the second path 32, and the second resistor 36 is connected between the third path 33 and the fourth path 34. Through the arrangement of the first resistor 35 and the second resistor 36, the microcontroller unit 4 of the present invention can determine whether any external wire connected between the incremental encoder 2 and the motor driver 3 has a line abnormality through the two sets of signal directions calculated by the two sets of differential signals, which will be described in detail later.
[0080] In the present invention, the output end of the incremental encoder 2 is connected to multiple input ends of the motor driver 3 through at least four external wires. More specifically, the incremental encoder 2 is connected to the first path 31 inside the motor driver 3 through the first external wire 21 to provide the A signal to the first input end 411 of the first encoder module 41 via the first path 31, and is connected to the second path 32 inside the motor driver 3 through the second external wire 22 to provide the A signal to the first input end 411 of the first encoder module 41 via the first path 31. The A signal is connected to the first input terminal 421 of the second encoder module 42, connected to the third path 33 inside the motor driver 3 through the third external wire 23 to provide the B signal to the second input terminal 412 of the first encoder module 41 through the third path 33, and connected to the fourth path 34 inside the motor driver 3 through the fourth external wire 24 to provide the B signal through the fourth path 34. The signal is sent to the second input terminal 422 of the second encoder module 42.
[0081] In the present invention, the first encoder module 41 continuously receives the first differential signal (i.e., continuously receives the A signal and the B signal via the first path 31 and the third path 33), and continuously calculates and obtains the first signal information group based on the first differential signal. Similarly, the second encoder module 42 continuously receives the second differential signal (i.e., continuously receives the A signal and the B signal via the second path 32 and the fourth path 34). Signal and signal), and continuously calculates and obtains a second signal information group based on the second differential signal. In one embodiment, the first signal information group at least includes a first signal count (Counter) and a first signal direction (Direction) related to the motor 5, and the second signal information group at least includes a second signal count and a second signal direction related to the motor 5.
[0082] Specifically, the first encoder module 41 calculates the first signal count and the first signal direction through the potential level of the received A signal and the B signal (i.e., represented as 0 or 1 in the waveform), the potential change according to the time sequence, and the potential change frequency. The second encoder module 42 calculates the first signal count and the first signal direction through the received Signal and The second signal count and the second signal direction are calculated based on information such as the potential level of the signal, the potential change in time sequence, and the potential change frequency.
[0083] Please also see Figure 4 , which is a first specific embodiment of the schematic diagram of signal counting and signal direction of the present invention. Figure 4 Taking the first differential signal (i.e., the A signal and the B signal) as an example, it is explained how the first encoder module 41 calculates the first signal count and the first signal direction based on the first differential signal. In addition, the second encoder module 42 can calculate the second differential signal based on the same logic to generate the second signal count and the second signal direction, which will not be repeated below.
[0084] like Figure 4 As shown in (a), since the A signal and the B signal will have periodic changes in potential over time, the first encoder module 41 can continuously record the potential changes of the A signal and the B signal in time sequence. Figure 4 In the embodiment (a), the A signal and the B signal change their potential in the order of (0,0), (1,0), (1,1), (0,1) in the timing sequence. In this regard, those skilled in the art can understand that the first encoder module 41 can record the potential change sequence of (0,0), (1,0), (1,1), (0,1) as the signal of the forward rotation of the motor 5.
[0085] like Figure 4As shown in (b), whenever a clock passes and at least one of the A signal and the B signal has a potential change, the first encoder module 41 will increase the first signal count by one. In addition, when the A signal and the B signal change from the above-mentioned potential change sequence of (0,0), (1,0), (1,1), (0,1) to the potential change sequence of (0,1), (1,1), (1,0), (0,0), the first encoder module 41 determines that the motor 5 has turned (become reverse), and therefore records the direction of the first signal as reverse. The figure shows the direction of forward and reverse rotation with high and low. Similarly, when the A signal and the B signal change again to the potential change sequence of (0,0), (1,0), (1,1), (0,1), the first encoder module 41 determines that the motor 5 has turned again (become forward), and therefore records the direction of the first signal as forward rotation again.
[0086] In the above manner, the first encoder module 41 can calculate the signal composition in the continuously received first differential signal to continuously obtain the first signal count (whether it is increased by one) and the first signal direction (forward or reverse). Similarly, in the above manner, the second encoder module 42 can calculate the continuously received second differential signal to continuously obtain the second signal count and the second signal direction, which will not be described in detail below.
[0087] Then, if Figure 3 As shown, the micro control unit 4 uses the first signal information group including the first signal count and the first signal direction calculated by the first encoder module 41, and the second signal information group including the second signal count and the second signal direction calculated by the second encoder module 42 as input parameters of the diagnosis unit 43. In this way, the diagnosis unit 43 can calculate the first parameter information group related to the motor 5 based on the first signal information group, and calculate the second parameter information group related to the motor 5 based on the second signal information group. In one embodiment, the first parameter information group at least includes the first signal speed, the first signal angle and the first signal direction related to the motor 5, and the second parameter information group at least includes the second signal speed, the second signal angle and the second signal direction related to the motor 5, but is not limited thereto.
[0088] One of the technical features of the present invention is that the micro control unit 4 compares the contents of the first parameter information group and the second parameter information group through the diagnostic unit 43, thereby determining whether the first parameter information group calculated based on the first differential signal (corresponding to the A signal and the B signal received from the first path 31 and the third path 33) and the second parameter information group calculated based on the second differential signal (corresponding to the A signal and the B signal received from the second path 32 and the fourth path 34) are equivalent to each other. Signal and When the diagnostic unit 43 determines after the comparison that the information of the first parameter information group is inconsistent with the information of the second parameter information group, it can be determined that one of the first differential signal and the second differential signal is abnormal.
[0089] More specifically, the diagnostic unit 43 in the present invention can mainly judge whether the first parameter information group is consistent with the second parameter information group, and judge whether at least one of the multiple external wires 21-24 between the output end of the incremental encoder 2 and the input end of the motor driver 3 has a line abnormality, or judge whether the motor 5 has a speed feedback signal abnormality, but it is not limited to this. In addition, when the diagnostic unit 43 judges that at least one of the multiple external wires 21-24 has a line abnormality, a group of normal signal information groups can be calculated based on the signals transmitted by the normal multiple wires among the multiple external wires 21-24, and the position feedback control parameters of the motor 5 are calculated based on the normal signal information group.
[0090] For example, while referring to Figure 2 Since the first resistor 35 is connected between the first path 31 and the second path 32, when the first external wire 21 connected to the first path 31 has a line abnormality, the A signal cannot be provided to the first path 31, and the incremental encoder 2 outputs In addition to being provided to the second encoder module 42 via the second path 32, the signal is also provided to the first encoder module 41 via the first resistor 35 along the first path 31. Similarly, when a line abnormality occurs in the second external wire 22 connected to the second path 32, The signal cannot be provided to the second path 32 , and the A signal output by the incremental encoder 2 is provided to the first encoder module 41 via the first path 31 , and is also provided to the second encoder module 42 along the second path 32 via the first resistor 35 .
[0091] Similarly, since the second resistor 36 is connected between the third path 33 and the fourth path 34, when the third external wire 23 connected to the third path 33 has a line abnormality, the B signal cannot be provided to the third path 33, and the incremental encoder 2 outputs In addition to being provided to the second encoder module 42 via the fourth path 34, the signal is also provided to the first encoder module 41 via the second resistor 36 along the third path 33. Similarly, when the fourth external wire 24 connected to the fourth path 34 has a line abnormality, The signal cannot be provided to the fourth path 34 , and the B signal output by the incremental encoder 2 is provided to the first encoder module 41 via the third path 33 , and is also provided to the second encoder module 42 along the fourth path 34 via the second resistor 36 .
[0092] As described above, by setting the first resistor 35 and the second resistor 36, when the first parameter information group is inconsistent with the second parameter information group, it means that the two encoder modules 41 and 42 of the micro control unit 4 have not correctly received the preset signal composition of the first differential signal and the second differential signal, that is, they have not correctly received the A signal, signal, B signal and At least one of the signals can therefore be judged that at least one of the multiple external wires 21-24 between the output end of the incremental encoder 2 and the input end of the motor driver 3 has a line abnormality such as a break, a short circuit, or interference.
[0093] In one embodiment, the diagnostic unit 43 of the micro control unit 4 mainly compares the first signal direction in the first parameter information group with the second signal direction in the second parameter information group to determine whether the directions of the first differential signal and the second differential signal are consistent. In addition, the diagnostic unit 43 mainly determines that one of the first differential signal and the second differential signal is abnormal when the first signal direction and the second signal direction are inconsistent.
[0094] When the diagnostic unit 43 determines that one of the first differential signal and the second differential signal is abnormal, it will further find the normal signal count and the normal signal direction from the first signal information group (including the first signal count and the first signal direction) and the second signal information group (including the second signal count and the second signal direction) through an internal judgment mechanism (to be described in detail later), and output the normal signal count and the normal signal direction to the motor control architecture of the diagnostic unit 43. In this way, the motor control architecture in the diagnostic unit 43 can calculate the position feedback control parameters of the motor 5 based on the normal signal count and the normal signal direction, and control the motor 5 to achieve redundant output.
[0095] Through the diagnostic device of the present invention, the microcontroller unit 4 can calculate and compare the two sets of differential signals through the two sets of encoder modules 41, 42 and the diagnostic unit 43, thereby determining whether there is a line abnormality between the output end of the incremental encoder 2 and the input end of the motor driver 3. When an abnormality occurs, the microcontroller unit 4 can also immediately find the normal differential signal, and input the normal signal count / normal signal direction calculated based on the normal differential signal into the motor control architecture of the diagnostic unit 43. In this way, the diagnostic device of the present invention can achieve redundant output of differential signals, thereby continuously controlling the operation of the motor 5 when the line is abnormal, avoiding the shutdown of the motor 5 due to partial line abnormality to improve the reliability of the system.
[0096] See also Figure 5 , which is the first specific embodiment of the diagnostic flowchart of the present invention. Figure 5 The present invention discloses a method for diagnosing abnormality of a circuit of an incremental encoder (hereinafter referred to as a diagnostic method for simplicity). In one embodiment, the diagnostic method is applied to Figure 2 The motor driver 3 and the micro control unit 4 are shown.
[0097] like Figure 5 As shown, the diagnostic method is that during the operation of the motor 5 (i.e., during the operation of the electric vehicle using the motor 5), the first encoder module 41 in the micro control unit 4 continuously receives the first differential signal output by the incremental encoder 2, and the second encoder module 42 in the micro control unit 4 continuously receives the second differential signal output by the incremental encoder 2 (step S10). As mentioned above, based on the diagnostic device of the present invention, the first differential signal received by the first encoder module 41 mainly includes the A signal and One of the signals and the B signal and The second differential signal received by the second encoder module 42 mainly includes the A signal and the One of the signals and the B signal and A combination of one of the signals (depending on whether the connected external wire is normal or abnormal).
[0098] Next, the first encoder module 41 calculates a first signal information group including a first signal count and a first signal direction based on the first differential signal (step S12), and the second encoder module 42 calculates a second signal information group including a second signal count and a second signal direction based on the second differential signal (step S14).
[0099] After step S12 and step S14, the micro control unit 4 inputs the first signal information group and the second signal information group into the diagnosis unit 43 respectively, and the diagnosis unit 43 calculates the first parameter information group based on the first signal information group, and calculates the second parameter information group based on the second signal information group (step S16). As mentioned above, the first parameter information group at least includes the first signal speed, the first signal angle and the first signal direction related to the motor 5, and the second parameter information group at least includes the second signal speed, the second signal angle and the second signal direction related to the motor 5.
[0100] How to calculate the parameter information group (ie, signal speed, signal angle and signal direction) based on the signal information group (ie, signal count and signal direction) is a common technical means in the motor-related technical field and will not be elaborated here.
[0101] After step S16, the micro control unit 4 compares the first signal direction in the first parameter information group with the second signal direction in the second parameter information group through the diagnosis unit 43, thereby determining whether the directions of the first differential signal and the second differential signal are consistent (step S18). Specifically, the micro control unit 4 determines whether the first signal direction is consistent with the second signal direction in step S18.
[0102] In one embodiment, the micro control unit 4 can preset the first differential signal to be applied to the motor control architecture of the diagnostic unit 43, that is, the diagnostic unit 43 is preset to control the motor 5 based on the first signal information group obtained by calculating the first differential signal, wherein the first signal information group at least includes the first signal count and the first signal direction. If the micro control unit 4 determines in step S18 that the first signal direction is consistent with the second signal direction, it means that the first differential signal and the second differential signal are both normal (that is, all external wires 21-24 between the output end of the incremental encoder 2 and the motor driver 3 are normal). In this case, the micro control unit 4 directly applies the first differential signal to the motor control architecture of the diagnostic unit 43. Thereby, the diagnostic unit 43 can calculate the position feedback control parameters of the motor 5 based on the first signal information group calculated by the first differential signal (step S20), and control the motor 5.
[0103] In another embodiment, the micro control unit 4 can be preset to apply the second differential signal to the motor control architecture of the diagnostic unit 43, that is, the diagnostic unit 43 is preset to control the motor 5 based on the second signal information group calculated by the second differential signal, wherein the second signal information group at least includes a second signal count and a second signal direction. In this embodiment, if the first signal direction is consistent with the second signal direction, the micro control unit 4 will apply the second differential signal to the motor control architecture of the diagnostic unit 43, so that the diagnostic unit 43 calculates the position feedback control parameters of the motor 5 based on the second signal information group calculated by the second differential signal, and controls the motor 5.
[0104] If the micro-control unit 4 determines in step S18 that the first signal direction is inconsistent with the second signal direction, it means that one of the first differential signal and the second differential signal is abnormal (i.e., at least one of the plurality of external wires 21-24 between the output end of the incremental encoder 2 and the motor driver 3 is abnormal). In one embodiment, if the line of the output end of the incremental encoder 2 is abnormal, it means that the micro-control unit 4 has received the A signal output by the incremental encoder 2, signal, B signal and At least one of the signals will be abnormal, that is, it will not be the expected signal combination. In this case, the micro control unit 4 uses the internal judgment mechanism to determine that the first differential signal is abnormal, or the second differential signal is abnormal (to be described in detail later). In addition, the micro control unit 4 inputs the signal count and signal direction calculated based on the normal set of the first differential signal and the second differential signal into the motor control architecture of the diagnostic unit 43, so that the diagnostic unit 43 calculates the position feedback control parameters of the motor 5 through the pair of normal signal counts and signal directions (step S22), and controls the motor 5.
[0105] It can be seen from the above description that the technical solution of the present invention can be that the first encoder module 41 calculates the first differential signal as the control basis of the motor 5, and the second encoder module 42 calculates the second differential signal as the control basis of the motor 5. When the first differential signal or the second differential signal received by the micro control unit 4 is abnormal, the diagnosis unit 43 can still control the motor 5 by calculating the signal count and signal direction based on another pair of normal differential signals, thereby achieving a redundancy effect, and the motor 5 does not need to be shut down.
[0106] See also Figure 6 , which is a first specific embodiment of the signal schematic diagram of the present invention.
[0107] first, Figure 6 (a) shows all signals (including A signal, signal, B signal and Signal) are normal. Figure 6 (a) It can be seen that when all signals are normal, signal A (phase) will lead signal B. The signal (phase) will lead signal, and the frequencies of signal A and signal B will be consistent. Signal and The frequency of the signal will be consistent, signal A and The signal is reverse, and the B signal and The signal is inverted.
[0108] Figure 6 (b) shows the situation that the first external wire 21 of the incremental encoder 2 for outputting the A signal is broken, while the other external wires 22-24 are connected normally. Figure 6 (b) It can be seen that when the first external wire 21 for outputting the A signal is disconnected, the corresponding transmitted A signal will become lagging behind the B signal, but The signal will still lead Specifically, when the first external wire 21 is disconnected, the first encoder module 41 cannot receive the A signal from the incremental encoder 2, but receives the A signal transmitted from the first resistor 35 along the first path 31. Signal.
[0109] Figure 6 (c) shows the situation that the first external wire 21 of the incremental encoder 2 for outputting the A signal is short-circuited, and the other external wires 22-24 are connected normally. Figure 6 (c) It can be seen that when the first external wire 21 for outputting the A signal is short-circuited, the corresponding transmitted A signal will be abnormal (taking the continuous no signal as an example in the figure). The signal will still lead signal, and the frequencies of signal A and signal B become inconsistent.
[0110] Figure 6 (d) shows that the first external wire 21 of the incremental encoder 2 for outputting the A signal is temporarily disturbed, while the other external wires 22-24 are connected normally. Figure 6 (d) It can be seen that when the first external wire 21 for outputting the A signal is temporarily disturbed, the corresponding transmitted A signal will temporarily produce a signal abnormality (the figure takes the A signal suddenly increasing a pulse as an example). The signal will still lead signal, and the frequencies of signal A and signal B become temporarily inconsistent.
[0111] from Figure 6 As can be seen from FIG. 1 , when any of the external wires 21-24 connecting the incremental encoder 2 and the motor driver 3 has a line abnormality (such as a break, short circuit or interference), at least one of the signals received by the micro control unit 4 will change (i.e., different from Figure 6 (a)). In the present invention, the first encoder module 41 and the second encoder module 42 calculate the first signal information group and the second signal information group based on the first differential signal and the second differential signal respectively, and the diagnosis unit 43 determines whether the two sets of signal information groups are consistent, thereby confirming whether the two sets of differential signals received by the micro control unit 4 are normal. Specifically, the A signal, signal, B signal and When the signals are normal, the comparison results of the first signal information group and the second signal information group will be consistent, otherwise the comparison results will be inconsistent.
[0112] In another embodiment, after receiving the first signal information group and the second signal information group, the diagnosis unit 43 first calculates the first parameter information group based on the first signal information group, and calculates the second parameter information group based on the second signal information group, and then determines whether the first parameter information group is consistent with the second parameter information group, thereby confirming whether the two sets of differential signals received by the micro control unit 4 are normal. However, the above is only one specific implementation example of the present invention, but is not limited thereto.
[0113] Figure 6 The following is mainly an example of the situation where the first external wire 21 of the incremental encoder 2 is disconnected, short-circuited or interfered with. signal, B signal or When the second external wire 22, the third external wire 23 and the fourth external wire 24 of the signal are disconnected, short-circuited or interfered, the corresponding waveform will also produce Figure 6 The signal changes shown.
[0114] In the aforementioned Figure 5 In the embodiment, the diagnosis unit 43 in the micro control unit 4 mainly determines whether the first differential signal or the second differential signal is abnormal by the first signal direction in the first parameter information group and the second signal direction in the second parameter information group. In another embodiment, the micro control unit 4 can further determine whether the first differential signal or the second differential signal is abnormal by the first signal speed and the first signal angle in the first parameter information group and the second signal speed and the second signal angle in the second parameter information group, thereby further improving the accuracy of diagnosis and avoiding misjudgment.
[0115] See also Figure 7 , which is a second specific embodiment of the diagnostic flowchart of the present invention. Figure 5 Similar to the embodiment shown in FIG. 1 , in this embodiment, the microcontroller unit 4 continuously receives the first differential signal output by the incremental encoder 2 through the first encoder module 41, and continuously receives the second differential signal output by the incremental encoder 2 through the second encoder module 42 in the microcontroller unit 4, and the first encoder module 41 continuously calculates the first signal information group based on the first differential signal, and the second encoder module 42 continuously calculates the second signal information group based on the second differential signal (step S30). As described above, based on the diagnostic device of the present invention, the first differential signal includes the A signal and One of the signals and the B signal and The second differential signal includes the A signal and the One of the signals and the B signal and A combination of one of the signals, the first signal information group includes a first signal count and a first signal direction, and the second signal information group includes a second signal count and a second signal direction.
[0116] Similarly, after step S30, the micro control unit 4 inputs the first signal information group and the second signal information group into the diagnosis unit 43, and the diagnosis unit 43 calculates the first parameter information group based on the first signal information group, and calculates the second parameter information group based on the second signal information group (step S32). As mentioned above, the first parameter information group at least includes the first signal speed, the first signal angle and the aforementioned first signal direction related to the motor 5, and the second parameter information group at least includes the second signal speed, the second signal angle and the aforementioned second signal direction related to the motor 5.
[0117] Next, the micro control unit 4 compares the first signal direction in the first parameter information group with the second signal direction in the second parameter information group through the diagnostic unit 43 to determine whether the first signal direction is consistent with the second signal direction (step S34). Specifically, the micro control unit 4 determines whether the direction of the first differential signal received by the first encoder module 41 is consistent with the direction of the second differential signal received by the second encoder module 42 based on whether the first signal direction is consistent with the second signal direction.
[0118] because The signal is the inverse signal of signal A, and The signal is the inverse signal of the B signal. Therefore, if all output lines of the incremental encoder 2 are normal, the first differential signal received by the first encoder module 41 will include the A signal and the B signal, and the second differential signal received by the second encoder module 42 will include Signal and signal, and the directions of the first differential signal and the second differential signal will be consistent (that is, the direction of the first signal will be consistent with the direction of the second signal).
[0119] In this embodiment, if it is determined in step S34 that the first signal direction is consistent with the second signal direction, the micro control unit 4 further determines whether the first signal angle in the first parameter information group is consistent with the second signal angle in the second parameter information group through the diagnostic unit 43 (step S36). Moreover, when it is determined that the first signal angle is consistent with the second signal angle, the micro control unit 4 applies the first differential signal to the motor control architecture of the diagnostic unit 43 to enable the diagnostic unit 43 to calculate the position feedback control parameter of the motor 5 based on the first signal information group calculated and generated corresponding to the first differential signal (step S38).
[0120] It is worth mentioning that if the micro-control unit 4 is preset to calculate the position feedback control parameter of the motor 5 based on the second differential signal, then in the above step S38, the micro-control unit 4 applies the second differential signal to the motor control architecture of the diagnosis unit 43, so that the diagnosis unit 43 calculates the position feedback control parameter of the motor 5 based on the second signal information group calculated and generated corresponding to the second differential signal, instead of using the second differential signal. Figure 7 The following are limited to those shown.
[0121] If it is determined in step S36 that the first signal angle is inconsistent with the second signal angle, the micro control unit 4 determines that one of the first differential signal and the second differential signal is abnormal. At this time, the micro control unit 4 finds out which pair of differential signals of the first differential signal and the second differential signal is abnormal and which pair of differential signals is normal through the diagnosis unit 43, and calculates the position feedback control parameters of the motor 5 based on the signal information group calculated by the normal differential signal.
[0122] In one embodiment, the micro control unit 4 determines in step S36 that the first signal angle is inconsistent with the second signal angle when the angle difference between the first signal angle and the second signal angle is greater than or equal to a preset angle error threshold (e.g., 5 degrees). Furthermore, the micro control unit 4 determines that the first signal angle is consistent with the second signal angle when the angle difference between the first signal angle and the second signal angle is less than the angle error threshold.
[0123] It is worth mentioning that the angle difference caused by the short circuit or disconnection of the external wire will increase with time. Different motors have different angle error tolerance ranges according to their characteristics during operation, and the angle of the motor is roughly positively correlated with the output torque (Nm). Therefore, this characteristic can be used to determine the angle error threshold corresponding to the motor used (for example, the angle error threshold can be calculated based on the 10% range of the motor's torque error), and the first signal angle and the second signal angle can be determined based on the calculated angle error threshold to determine whether they are consistent.
[0124] Specifically, the torque calculation formula of the permanent magnet synchronous motor is as follows: T = 1.5*(P / 2)*(λ*iq+(Ld-Lq)*id*iq), where P is the number of motor poles, λ is the torque constant, id / iq is the rotor d / q axis current, and Ld / Lq is the rotor d / q axis inductance. The above parameters can be obtained separately through motor feedback, and the calculated motor torque is used to calculate the aforementioned angle error threshold. If the angle difference between the first signal angle and the second signal angle is less than the calculated angle error threshold, the micro control unit 4 will not determine that the first signal angle is inconsistent with the second signal angle, so it will not directly determine that the first differential signal or the second differential signal is abnormal. However, the above is only one of the specific implementation examples of the present invention, but is not limited to the above description.
[0125] In this embodiment, if the micro-control unit 4 determines in step S34 that the first signal direction is inconsistent with the second signal direction (i.e., the direction of the first differential signal is inconsistent with the direction of the second differential signal), or in step S36 that the first signal angle is inconsistent with the second signal angle, the micro-control unit 4 further calculates the first signal acceleration based on the first signal speed in the first parameter information group, and calculates the second signal acceleration based on the second signal speed in the second parameter information group through the diagnosis unit 43. In addition, the micro-control unit 4 determines whether the first signal acceleration is greater than a preset acceleration threshold (step S40), and determines whether the second signal acceleration is greater than the acceleration threshold (step S42).
[0126] If it is determined in step S40 that the first signal acceleration is greater than the acceleration threshold (i.e., representing that the speed changes rapidly in an instant), the micro control unit 4 may determine that the first external wire 21 or the third external wire 23 between the incremental encoder 2 and the motor driver 3 (i.e., the line used to connect from the outside to the first path 31 or the third path 33 inside the motor driver 3) is a line abnormality, and causes the first differential signal to be abnormal. At this time, the micro control unit 4 applies the second differential signal to the motor control architecture of the diagnostic unit 43, so that the diagnostic unit 43 calculates the position feedback control parameters of the motor 5 based on the second signal information group calculated and obtained corresponding to the second differential signal (step S44).
[0127] If it is determined in step S40 that the first signal acceleration is not greater than the acceleration threshold, but then in step S42 it is determined that the second signal acceleration is greater than the acceleration threshold, the micro control unit 4 may determine that the second external wire 22 or the fourth external wire 24 between the incremental encoder 2 and the motor driver 3 (i.e., the line used to connect from the outside to the second path 32 or the fourth path 34 inside the motor driver 3) is a line abnormality, and causes the second differential signal to be abnormal. At this time, the micro control unit 4 applies the first differential signal to the motor control architecture of the diagnostic unit 43, so that the diagnostic unit 43 calculates the position feedback control parameters of the motor 5 based on the first signal information group calculated and obtained corresponding to the first differential signal (step S38).
[0128] It is worth mentioning that if the microcontroller unit 4 determines that the first signal direction is inconsistent with the second signal direction, or the first signal angle is inconsistent with the second signal angle after comparison by the diagnostic unit 43, but the first signal acceleration is not greater than the acceleration threshold, and the second signal acceleration is not greater than the acceleration threshold, it means that the current abnormal condition does not belong to one of the aforementioned short circuit, disconnection or interference. At this time, the microcontroller unit 4 will determine that the state of the motor 5 is abnormal in the speed feedback signal (step S46), and control the motor 5 to stop rotating. However, the above abnormal state is only one embodiment of the present invention, but is not limited to the above.
[0129] In one embodiment, the micro control unit 4 in step S40 mainly instructs the diagnosis unit 43 to calculate the first signal acceleration by the following first formula: In step S42, the diagnosis unit 43 is mainly instructed to calculate the second signal acceleration by the following second formula: Furthermore, in this embodiment, the acceleration threshold used by the micro control unit 4 may be: where ω 1 is the first signal speed, ω 2 is the second signal speed, t(k) is the second sampling time, t(k-1) is the first sampling time, T max is the maximum torque of the motor, and J is the total inertia of the motor. It should be noted that, since the acceleration of the motor is directional, the motor torque may also have negative values in some applications. The purpose of the present invention is only to determine the degree of signal deviation by the magnitude of acceleration and to estimate the angle error threshold by the motor torque. Therefore, the first signal acceleration, the second signal acceleration and the acceleration threshold formula are calculated by taking absolute values.
[0130] Since the maximum torque and inertia of the motor 5 can be determined after the motor 5 used in the electric vehicle is determined, the acceleration threshold can be regarded as a known parameter for the micro control unit 4 in the diagnosis device of the present invention.
[0131] It is worth mentioning that in this embodiment, the micro control unit 4 can mainly use 0.1 microsecond (ms) as a time unit (ie, the second time minus the first time is 0.1 ms) or a time interval as a diagnosis frequency, but it is not limited thereto.
[0132] See also Figure 8 , which is a first specific embodiment of the schematic diagram of the signal rotation speed, signal angle and signal direction of the present invention. Figure 8 This is used to explain the influence on the above-mentioned signal direction, signal angle and signal rotation speed when the differential signal received by the microprocessor 4 is abnormal.
[0133] Figure 8(a) is used to show the situation when the first external wire 21 of the incremental encoder 2 used to output the A signal is broken. Figure 8 As shown in (a), when the A signal preset to be received by the micro control unit 4 is abnormal due to line disconnection (ie, the first differential signal is abnormal, at this time, the A signal received by the first resistor 35 is signal and the B signal received through the third path 33), will cause the first signal speed 61 calculated based on the first differential signal to decrease, the first signal angle 62 calculated based on the first differential signal to reverse, and the first signal direction 63 calculated based on the first differential signal to reverse. At the same time, due to signal, B signal and The external wires 22-24 corresponding to the signal are all normal (ie, the second differential signal is normal, which includes the signal received through the second path 32). signal and received through the fourth path 34 signal), so the second signal speed 71, the second signal angle 72 and the second signal direction 73 calculated based on the second differential signal will all maintain normal waveforms.
[0134] The above is only one specific embodiment of the present invention, and the micro control unit 4 presets the received signal, B signal or When the signal is abnormal due to line disconnection, the signal composition of the first differential signal or the second differential signal will change, and the signal speed, signal angle and signal direction can be judged based on the same method as above, which will not be repeated here.
[0135] Figure 8 (b) is used to show the situation when the first external wire 21 of the incremental encoder 2 for outputting the A signal is short-circuited. Figure 8 As shown in (b), when the A signal preset to be received by the micro control unit 4 is abnormal due to a line short circuit (ie, the first differential signal is abnormal, at this time, the A signal received by the first resistor 35 is signal and the B signal received through the third path 33), will cause the first signal speed 61 calculated based on the first differential signal to decrease, the first signal angle 62 calculated based on the first differential signal to stagnate, and the first signal direction 63 calculated based on the first differential signal to continuously jump between the forward and reverse directions. Signal and The signals are normal (ie, the second differential signal is normal, including Signal and signal), so the second signal speed 71, the second signal angle 72 and the second signal direction 73 generated based on the second differential signal will all maintain normal waveforms.
[0136] Figure 8 (c) is used to show the situation when the first external wire 21 of the incremental encoder 2 for outputting the A signal is subjected to a short-term interference. Figure 8 As shown in (c), when the A signal received by the micro control unit 4 is temporarily abnormal due to line interference (i.e., the first differential signal is temporarily abnormal), it will cause an instantaneous and temporary decrease in the first signal speed 61 calculated based on the first differential signal, a temporary error in the first signal angle 62 calculated based on the first differential signal, and a temporary reversal of the first signal direction 63 calculated based on the first differential signal. However, the aforementioned abnormality only occurs for a short period of time, and the rest of the time points are normal waveforms. Similarly, due to Signal and The signals are all normal (ie, the second differential signal is normal), so the second signal rotation speed 71, the second signal angle 72 and the second signal direction 73 calculated based on the second differential signal all maintain normal waveforms.
[0137] As described above, since the diagnostic device of the present invention receives and processes the first differential signal through the first encoder module 41, and receives and processes the second differential signal through the second encoder module 42, when any of the two differential signals is abnormal, the micro control unit 4 can continue to control the motor 5 through the redundant output without causing the motor 5 to stop. In this way, the reliability of the system can be effectively improved.
[0138] See also Fig. 9 , which is a first specific embodiment of a schematic diagram of the redundancy effect of the present invention. Fig. 9 As shown in (a), if the motor is controlled by the control architecture of the related art (i.e., Figure 1 If the line for outputting the A signal at the output end of the incremental encoder is disconnected at a certain time, the microcontroller unit will stop calculating the signal count and will not be able to continue to detect the signal direction. Therefore, the motor is forced to stop.
[0139] like Fig. 9 (b) As shown in the upper part, if the diagnostic device of the present invention (such as Figure 2 , Figure 3 As shown), when the first external wire 21 for outputting the A signal at the output end of the incremental encoder 2 is disconnected at a certain time, the first differential signal received by the first encoder module 41 will include The A signal and the B signal are generated, and the first signal count 81 calculated based on the first differential signal begins to produce an abnormality. However, the second differential signal received by the second encoder module 42 is still the expected signal composition (i.e., including Signal and signal). Therefore, the second signal count 91 calculated based on the second differential signal will continue to be normal. In addition, although the first signal direction 82 calculated by the first encoder module 41 based on the first differential signal will begin to be abnormal, the second signal direction 92 calculated by the second encoder module 42 based on the second differential signal will also continue to be normal.
[0140] like Fig. 9 As shown in (b), when the micro control unit 4 determines that one of the first differential signal and the second differential signal is abnormal after comparison, the first signal acceleration 83 and the second signal acceleration 93 can be calculated by the method described above, and after comparison, it is found that the first signal acceleration 83 is greater than or equal to the acceleration threshold 50 (such as Fig. 9 (b) shows a dotted line), the second signal acceleration 93 is still continuously less than the acceleration threshold 50. In this way, the micro control unit 4 can confirm that the first differential signal is abnormal, while the second differential signal is normal.
[0141] By this, Fig. 9 (b) As shown in the lower half, the micro control unit 4 can apply the second differential signal to the control architecture of the motor 5 (i.e., use the second signal count 91 and the second signal direction 92 on which the second differential signal is calculated as the basis for the calculation and control of the motor 5), and discard the first signal count 81 and the first signal direction 82 (i.e., discard the first differential signal), thereby achieving a redundant output effect, thereby keeping the motor 5 running continuously when the A signal is disconnected.
[0142] The above description is only a preferred specific example of the present invention, which does not limit the claims of the present invention. Therefore, all equivalent changes made using the content of the present invention are similarly included in the scope of the present invention and are hereby stated.
Claims
1. A method for diagnosing abnormality of an incremental encoder circuit, applied to a motor driver connected to an incremental encoder and a motor, the motor driver comprising a microcontroller unit having at least a first encoder module and a second encoder module, the incremental encoder outputting an A signal, a signal, a B signal and a signal, where the The signal is the reverse signal of the A signal. The signal is the inverse signal of the B signal, and the diagnostic method comprises the following steps: a) the first encoder module generates a signal based on the A signal and the One of the signals and the B signal and the A first signal information group is obtained by calculating a first differential signal composed of one of the signals, wherein the first signal information group includes a first signal count and a first signal direction; b) the second encoder module generates a signal based on the A signal and the The B signal and the A second signal information set is obtained by calculating a second differential signal composed of one of the signals, wherein the second signal information set includes a second signal count and a second signal direction; c) the micro control unit calculates a first parameter information group based on the first signal information group, and calculates a second parameter information group based on the second signal information group, wherein the first parameter information group includes a first signal speed, a first signal angle, and the first signal direction, and the second parameter information group includes a second signal speed, a second signal angle, and the second signal direction; d) the micro control unit determines whether the direction of the first signal is consistent with the direction of the second signal, and when the direction of the first signal is consistent with the direction of the second signal, determines that the plurality of external wires between the incremental encoder and the motor driver are normal, and calculates a position feedback control parameter of the motor according to the first signal information group calculated based on the first differential signal or the second signal information group calculated based on the second differential signal; and e) the micro control unit performs the following steps when the first signal direction is inconsistent with the second signal direction: e1) calculating a first signal acceleration based on the first signal speed and determining whether the first signal acceleration is greater than an acceleration threshold, determining that at least one of the differential signals received by the first encoder module is abnormal when the first signal acceleration is greater than the acceleration threshold, and calculating the position feedback control parameter of the motor according to the second signal information group obtained by calculating based on the second differential signal; e2) calculating a second signal acceleration based on the second signal rotation speed and determining whether the second signal acceleration is greater than the acceleration threshold, determining that at least one of the differential signals received by the second encoder module is abnormal when the second signal acceleration is greater than the acceleration threshold, and calculating the position feedback control parameter of the motor according to the first signal information group obtained by calculation based on the first differential signal; and e3) When the direction of the first signal is inconsistent with the direction of the second signal, the acceleration of the first signal is not greater than the acceleration threshold, and the acceleration of the second signal is not greater than the acceleration threshold, it is determined that the speed feedback signal is abnormal and the diagnosis is terminated.
2. The diagnostic method of claim 1, wherein the step e1 is to calculate the first signal acceleration using a first formula, and the step e2 is to calculate the second signal acceleration using a second formula, wherein the first formula is: The second formula is: Wherein ω1 is the first signal speed, ω2 is the second signal speed, t(k) is the second sampling time, and t(k-1) is the first sampling time.
3. The diagnostic method as claimed in claim 1, wherein the acceleration threshold is: Where T max is the maximum torque of the motor, and J is the total inertia of the motor.
4. The diagnostic method as claimed in claim 1, wherein the step d comprises the following steps: d1) when the direction of the first signal is consistent with the direction of the second signal, determining whether the angle of the first signal is consistent with the angle of the second signal; d2) when the first signal angle is consistent with the second signal angle, calculating the position feedback control parameter of the motor according to one of the first signal information group calculated based on the first differential signal and the second signal information group calculated based on the second differential signal; and d3) When the first signal angle is inconsistent with the second signal angle, it is determined that the line is abnormal or the signal is abnormal.
5. The diagnostic method as described in claim 4, wherein the step d1 is to determine that the first signal angle and the second signal angle are inconsistent when the angle difference between the first signal angle and the second signal angle is greater than or equal to an angle error threshold, and to determine that the first signal angle and the second signal angle are consistent when the angle difference between the first signal angle and the second signal angle is less than the angle error threshold, wherein the angle error threshold is calculated based on a 10% range of the torque error of the motor.
6. The diagnostic method as claimed in claim 4, wherein step d3 comprises the following steps: d31) when the directions of the first signal angle and the second signal angle are inconsistent, calculating a first signal acceleration based on the first signal rotation speed, determining whether the first signal acceleration is greater than an acceleration threshold, determining that at least one of the differential signals received by the first encoder module is abnormal when the first signal acceleration is greater than the acceleration threshold, and calculating the position feedback control parameter of the motor according to the second signal information group obtained by calculating based on the second differential signal; d32) calculating a second signal acceleration based on the second signal rotation speed, determining whether the second signal acceleration is greater than the acceleration threshold, determining that at least one of the differential signals received by the second encoder module is abnormal when the second signal acceleration is greater than the acceleration threshold, and calculating the position feedback control parameter of the motor according to the first signal information group obtained by calculation based on the first differential signal; and d33) When the first signal angle is inconsistent with the second signal angle, the first signal acceleration is not greater than the acceleration threshold, and the second signal acceleration is not greater than the acceleration threshold, it is determined that the speed feedback signal is abnormal and the diagnosis is terminated.
7. The diagnostic method of claim 6, wherein the step d31 is to calculate the first signal acceleration using a first formula, and the step d32 is to calculate the second signal acceleration using a second formula, wherein the first formula is: The second formula is: And the acceleration threshold is: Where ω1 is the first signal speed, ω2 is the second signal speed, t(k) is the second sampling time, t(k-1) is the first sampling time, T max is the maximum torque of the motor, and J is the total inertia of the motor.
8. A circuit abnormality diagnosis device for an incremental encoder, comprising at least a motor driver connected to an incremental encoder and a motor, the motor driver having a microcontroller unit, the incremental encoder outputting an A signal, a signal, a B signal and a signal, wherein the incremental encoder provides the A signal via a first path inside the motor driver and provides the signal, providing the B signal via a third path, and providing the signal, wherein a first resistor is connected between the first path and the second path, a second resistor is connected between the third path and the fourth path, and the The signal is the reverse signal of the A signal. The signal is the inverse signal of the B signal, wherein the micro control unit includes: A first encoder module has two input terminals connected to the first path and the third path respectively, and based on the A signal received from the first path and the third path and the One of the signals and the B signal and the a first differential signal composed of one of the signals to calculate a first signal information set, wherein the first signal information set includes a first signal count and a first signal direction; A second encoder module has two input terminals connected to the second path and the fourth path respectively, and based on the A signal received from the second path and the fourth path and the One of the signals and the B signal and the a second differential signal composed of one of the signals to calculate a second signal information set, wherein the second signal information set includes a second signal count and a second signal direction; and a diagnostic unit, receiving the first signal information group from an output end of the first encoder module, and receiving the second signal information group from an output end of the second encoder module, the diagnostic unit calculating a first parameter information group based on the first signal information group, and calculating a second parameter information group based on the second signal information group, wherein the first parameter information group includes a first signal speed, a first signal angle, and the first signal direction, and the second parameter information group includes a second signal speed, a second signal angle, and the second signal direction; The diagnostic unit determines, based on the first parameter information group and the second parameter information group, that at least one of the multiple external wires connecting the incremental encoder to the motor driver has a line abnormality, or determines that a speed feedback signal of the motor is abnormal, and calculates a position feedback control parameter of the motor by calculating the first signal information group obtained by calculating the first differential signal transmitted by a normal wire among the external wires or the second signal information group obtained by calculating the second differential signal.
9. The diagnostic device as claimed in claim 8, wherein the line abnormalities of the external wires include disconnection, short circuit or interference, wherein when the external wire is disconnected, the phase of the corresponding transmitted signal will change, when the external wire is short-circuited, the corresponding transmitted signal will be abnormal, and when the external wire is interfered, the corresponding transmitted signal will be temporarily abnormal.
10. The diagnostic device as claimed in claim 8, wherein when the external wire connected to the first path has a line abnormality, the The signal is also provided to the first encoder module along the first path via the first resistor; When the external wire connected to the second path has a line abnormality, the A signal is provided to the second encoder module via the first resistor along the second path at the same time; When the external wire connected to the third path has a line abnormality, the The signal is also provided to the first encoder module via the second resistor along the third path; and When a line abnormality occurs in the external wire connected to the fourth path, the B signal is simultaneously provided to the second encoder module along the fourth path via the second resistor.
Citation Information
Patent Citations
Diagnosing method and diagnosing device for abnormal cable connection of incremental encoder
US11290151B1