A Fault Diagnosis Method for Hall Sensors in a Brushless DC Motor
By calculating the sum of HALL values and delay judgment of Hall sensors, combined with bitwise calculation, fault diagnosis of Hall sensors in brushless DC motors is achieved, false alarm problems are solved, and diagnostic accuracy is improved.
Patent Information
- Application Number
- CN202310817840.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-07-04
AI Technical Summary
In the prior art, there is a lack of effective Hall sensor fault diagnosis scheme in brushless DC motors, which are prone to single diagnosis errors and lead to false alarms.
By reading the position signal of the Hall sensor, obtaining the HALL value, calculating the HALL sum value, and performing delay judgment and cumulative counting, combining bitwise operation to diagnose fault types to avoid false alarms.
Accurately diagnose the fault type of Hall sensor, avoiding single diagnosis errors, and improving the reliability and accuracy of the diagnosis.
Smart Images

Figure CN116992368B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of brushless DC motor control, and particularly relates to a method for fault diagnosis of Hall sensors in a brushless DC motor. Background Art
[0002] The brushless DC motor overcomes the congenital defects of the brushed DC motor and replaces the mechanical commutator with an electronic commutator. Therefore, the brushless DC motor not only has the good speed regulation performance of the DC motor, but also has the advantages of simple structure, no commutation spark, reliable operation and easy maintenance of the AC motor. There is a Hall sensor in the brushless DC motor, and there are few solutions for fault diagnosis of the Hall sensor in the prior art. Summary of the Invention
[0003] The purpose of the present invention is to provide a method for fault diagnosis of Hall sensors in a brushless DC motor, which can diagnose the faults of the Hall sensors in the brushless DC motor, determine which Hall sensors have faults and the types of faults, and perform a delay judgment operation to avoid false alarms caused by single diagnosis errors.
[0004] To solve the above technical problems, the technical solution of the present invention is: a method for fault diagnosis of Hall sensors in a brushless DC motor, comprising the following steps:
[0005] S1. Read the position signals of all Hall sensors to obtain their corresponding HALL values; among them, when the position signal of the Hall sensor is read, its corresponding HALL value is sent, and each Hall sensor is assigned HALL values k1, k2...k m , and satisfy k1 = ak2, k2 = ak3...k m-1 = ak m , k1, k2...k m , a are all positive integers, a≥2; in this cycle, add the HALL values of all Hall sensors to obtain the initial value primary_hall of the HALL sum;
[0006] S2. In any other cycle, add the HALL values of all Hall sensors to obtain the HALL sum value new_hall;
[0007] S3. Judge whether the new_hall in the current cycle is equal to the HALL sum value actual_hall stored in the previous cycle. If not, enter S4; if equal, it is considered that the brushless DC motor stops rotating at this time, and the diagnosis ends;
[0008] S4. Judge whether new_hall is within the effective range [k m , k1 + k2 +... + km-1 Within [ ], if it is, then go to S5; if not, then go to S6;
[0009] S5. Set the hall error cumulative count to 0, assign the value of new_hall to actual_hall, store the value of new_hall and the corresponding HALL values of each Hall sensor as a set of data in the HALL total value history array hallHistory, and enter S6; where the hall error cumulative count is the statistical value of the number of Hall sensor errors in the diagnosis.
[0010] S6. Store new_hall in hallHistory, increment the hall error cumulative count by 1. When the hall error cumulative count reaches the first threshold, perform the Hall sensor fault type diagnosis.
[0011] S7. Take out n sets of data from hallHistory in reverse order, perform bitwise operations on the n sets of data, and accumulate the counts for the corresponding bits of each Hall sensor to obtain the count values for the corresponding bits of each Hall sensor, and determine the fault type of the corresponding Hall sensor according to the calculated values.
[0012] Specifically, S6 is as follows:
[0013] S61. Determine whether the hall error cumulative count is less than the first threshold. If it is, then enter S62; if not, then enter S7.
[0014] S62. Determine whether the hall error cumulative count is 0. If it is, then store new_hall in hallHistory and enter S63; if not, then enter S64.
[0015] S63. Increment the hall error cumulative count by 1.
[0016] S64. Determine whether the hall error cumulative count reaches the first threshold. If it is, then enter S7; if not, then consider the detection as an error and re - execute S64.
[0017] Specifically, S7 is as follows:
[0018] S71. Take out n sets of data from hallHistory in reverse order;
[0019] S72. Determine whether the first set of data taken out is (k1 + k2+...+k m ). If it is, then perform a bitwise AND operation on the n sets of data, and accumulate the counts for the corresponding bits of each Hall sensor to obtain the count values for the corresponding bits of each Hall sensor, and enter S73; if not, then enter S74;
[0020] S73. Determine whether there is a certain count value equal to n. If so, the HALL sensor corresponding to this bit is open or shorted to the power supply; if not, the HALL sensor corresponding to this bit has no fault.
[0021] S74. Determine whether the first set of data retrieved is 0. If so, perform a bitwise AND operation after performing a bitwise exclusive OR operation on the n sets of data and (k1 + k2 +... + k m ) and accumulate the count for the corresponding bits of each Hall sensor respectively to obtain the count values of the corresponding bits of each Hall sensor, and enter S75;
[0022] S75. Determine whether there is a certain count value equal to n. If so, the HALL sensor corresponding to this bit is shorted to the ground; if not, the HALL sensor corresponding to this bit has no fault.
[0023] The number of Hall sensors is 3.
[0024] When k3 takes 1 and a takes 2, then k1 = 4 and k2 = 2.
[0025] The number of groups n of the retrieved data is 4.
[0026] Read the position signals of each Hall sensor respectively through the IO pins of the cpu. When the pin of the corresponding Hall sensor is at a high level, set the position to its corresponding HALL value.
[0027] The first threshold is 5 - 20.
[0028] There is also provided a brushless DC motor, including a memory, a controller, and a computer program stored on the memory and executable on the controller. When the controller executes the program, the steps of the method described in any one of the above are implemented.
[0029] There is also provided a memory of a brushless DC motor, on which a program is stored. When the program is executed by the controller, the steps of the method described in any one of the above are implemented.
[0030] Compared with the prior art, the beneficial effects of the present invention are:
[0031] The present invention performs fault diagnosis on the Hall sensors in the brushless DC motor, diagnoses which specific Hall sensors have faults and the types of faults that occur, and performs a delay judgment operation to avoid false alarms caused by single - diagnosis errors. Description of the Drawings
[0032] Figure 1 It is a flow schematic diagram of Embodiment 1 of the present invention;
[0033] Figure 2 It is a structural schematic diagram of the connection between the CPU and the Hall sensors in the embodiment of the present invention;
[0034] Figure 3(a) is the commutation sequence diagram of the Hall sensor when the brushless DC motor in the embodiment of the present invention rotates in reverse;
[0035] Figure 3(b) is the commutation sequence diagram of the Hall sensor when the brushless DC motor in the embodiment of the present invention rotates forward. Specific embodiments
[0036] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0037] The technical solution of the present invention is as follows:
[0038] Embodiment 1:
[0039] A fault diagnosis method for Hall sensors in a brushless DC motor, comprising the following steps:
[0040] S1. As shown in, read the position signals of all 3 Hall sensors to obtain their corresponding HALL values (assigning values bit by bit: A = 4, B = 2, C = 1), and it is considered that the pins of the corresponding Hall sensors are all at high level at this time; in this cycle, add the HALL values of all Hall sensors to obtain the initial value of the HALL sum, primary_hall, which is 7; Figure 1
[0041] S2. In any other cycle, add the HALL values of all 3 Hall sensors to obtain the HALL sum value, new_hall; when the pin of the corresponding Hall sensor is at high level, then assign the corresponding HALL value at this position
[0042] S3. Determine whether the new_hall in the current cycle is equal to the HALL sum value, actual_hall, stored in the previous cycle. If they are not equal, enter S4; if they are equal, it is considered that the brushless DC motor stops rotating at this time, and the diagnosis ends;
[0043] S4. Determine whether new_hall is within the effective range [1, 6]. If it is, enter S5; if not, enter S6;
[0044] S5. Set the hall error cumulative count to 0, assign the value of new_hall to actual_hall, store the value of new_hall and the corresponding HALL values of each Hall sensor as a set of data into the HALL total value history array hallHistory, and proceed to S6; where the hall error cumulative count is the statistical value of the number of Hall sensor errors in the diagnosis.
[0045] S6. Store new_hall into hallHistory, increment the hall error cumulative count by 1. When the hall error cumulative count reaches the first threshold, which is 8 in this embodiment, perform the Hall sensor fault type diagnosis.
[0046] S7. Sequentially retrieve 4 sets of data from the end of hallHistory, perform bitwise operations on the 4 sets of data, and accumulate the counts for the corresponding bits of each Hall sensor to obtain the count values for the corresponding bits of each Hall sensor, and determine the fault type of the corresponding Hall sensor based on the calculated values.
[0047] The specific content of S6 is as follows:
[0048] S61. Determine whether the hall error cumulative count is less than the first threshold. If so, proceed to S62; if not, proceed to S71.
[0049] S62. Determine whether the hall error cumulative count is 0. If so, store new_hall into hallHistory and then proceed to S63; if not, proceed to S64.
[0050] S63. Increment the hall error cumulative count by 1.
[0051] S64. Determine whether the hall error cumulative count has reached the first threshold. If so, proceed to S7; if not, consider the detection as an error and re - execute S64.
[0052] The specific content of S7 is as follows:
[0053] S71. Sequentially retrieve 4 sets of data from the end of hallHistory.
[0054] S72. Determine whether the first set of data retrieved is 7. If so, perform a bitwise AND operation on the 4 sets of data, and accumulate the counts for the corresponding bits of each Hall sensor to obtain the count values for the corresponding bits of each Hall sensor, and proceed to S73; if not, proceed to S74.
[0055] S73. Determine whether there is a count value of 4 for a certain bit. If so, the Hall sensor corresponding to this bit is open - circuited or short - circuited to the power supply; if not, the Hall sensor corresponding to this bit has no fault.
[0056] S74. Determine whether the first set of data retrieved is 0. If it is, perform a bitwise AND operation after performing a bitwise exclusive OR operation on the 4 sets of data and 7, and accumulate and count the corresponding bits of each Hall sensor to obtain the count values of the corresponding bits of each Hall sensor, then enter S75;
[0057] S75. Determine whether there is a count value of 4 for a certain bit. If so, the HALL sensor corresponding to this bit is shorted to ground; if not, the HALL sensor corresponding to this bit has no fault.
[0058] Embodiment 2:
[0059] A method for diagnosing faults of Hall sensors in a brushless DC motor, comprising the following steps:
[0060] S1. As shown in Figure 1 , read the position signals of all 3 Hall sensors to obtain their corresponding HALL values (assign values to bits: A = 8, B = 4, C = 2), and assume that the pins of the corresponding Hall sensors are all at high level at this time; in this cycle, add up the HALL values of all Hall sensors to obtain the initial value of the HALL sum, primary_hall, which is 14;
[0061] S2. In any other cycle, add up the HALL values of all 3 Hall sensors to obtain the HALL sum value, new_hall; when the pin of the corresponding Hall sensor is at high level, assign the corresponding HALL value to this position;
[0062] S3. Determine whether the new_hall in the current cycle is equal to the HALL sum value, actual_hall, stored in the previous cycle. If they are not equal, enter S4; if they are equal, it is considered that the brushless DC motor stops rotating at this time, and the diagnosis ends;
[0063] S4. Determine whether new_hall is within the effective range [2, 12]. If it is, enter S5; if not, enter S6;
[0064] S5. Set the hall error accumulation count to 0, assign the value of new_hall to actual_hall, store new_hall and its corresponding HALL values of each Hall sensor as a set of data in the HALL sum value history array hallHistory, and enter S6; among them, the hall error accumulation count is the statistical value of the number of Hall sensor errors in the diagnosis;
[0065] S6. Store new_hall in hallHistory, increment the hall error accumulation count by 1. When the hall error accumulation count reaches the first threshold, in this embodiment, the first threshold is 10, perform the diagnosis of the Hall sensor fault type;
[0066] S7. Take out 4 groups of data from hallHistory in reverse order, perform bitwise operations on the 4 groups of data, and accumulate and count the corresponding bits of each Hall sensor respectively to obtain the count values of the corresponding bits of each Hall sensor, and judge the fault type of the corresponding Hall sensor according to the calculated values.
[0067] The specific content of S6 is as follows:
[0068] S61. Judge whether the cumulative number of hall errors is less than the first threshold. If so, enter S62; if not, enter S71.
[0069] S62. Judge whether the cumulative number of hall errors is 0. If so, store new_hall in hallHistory and then enter S63; if not, enter S64.
[0070] S63. Increment the cumulative number of hall errors by 1.
[0071] S64. Judge whether the cumulative number of hall errors reaches the first threshold. If so, enter S7; if not, consider the detection as an error and re - execute S64.
[0072] The specific content of S7 is as follows:
[0073] S71. Take out 4 groups of data from hallHistory in reverse order.
[0074] S72. Judge whether the first group of data taken out is 14. If so, perform a bitwise AND operation on the 4 groups of data, and accumulate and count the corresponding bits of each Hall sensor respectively to obtain the count values of the corresponding bits of each Hall sensor, and enter S73; if not, enter S74.
[0075] S73. Judge whether there is a count value of 4 for a certain bit. If so, the HALL sensor corresponding to this bit is open - circuited or short - circuited to the power supply; if not, the HALL sensor corresponding to this bit has no fault.
[0076] S74. Judge whether the first group of data taken out is 0. If so, perform a bitwise AND operation after performing a bitwise XOR operation on the 4 groups of data and 14, and accumulate and count the corresponding bits of each Hall sensor respectively to obtain the count values of the corresponding bits of each Hall sensor, and enter S75.
[0077] S75. Judge whether there is a count value of 4 for a certain bit. If so, the HALL sensor corresponding to this bit is short - circuited to the ground; if not, the HALL sensor corresponding to this bit has no fault.
[0078] It should be understood that the sequence numbers of the steps in the above embodiments do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0079] Those skilled in the art can easily understand that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention should be included within the protection scope of the present invention.
Claims
1. A fault diagnosis method for Hall sensors in a brushless DC motor, characterized in that, Including the following steps: S1. Read the position signals of all Hall sensors to obtain their corresponding HALL values; among them, when the position signal of a Hall sensor is read, its corresponding HALL value is sent, and each Hall sensor is assigned HALL values k1, k2... k m , and satisfy k1 = ak2, k2 = ak3... k m-1 = ak m , k1, k2... k m , a are all positive integers, a ≥ 2; in this cycle, add the HALL values of all Hall sensors to obtain the initial value of the HALL sum, primary_hall; S2. In any other period, add up the HALL values of all Hall sensors to obtain the HALL total value new_hall; S3. Determine whether the new_hall in the current period is equal to the HALL total value actual_hall stored in the previous period. If not, go to S4; if equal, it is considered that the brushless DC motor has stopped rotating, and the diagnosis ends; S4. Determine whether new_hall is within the valid range [k m , k1 + k2 +... + k m-1 . If so, go to S5; if not, go to S6; S5. Set the hall error accumulation count to 0, assign the value of new_hall to actual_hall, store new_hall and its corresponding HALL values of each Hall sensor as a set of data into the HALL total value history array hallHistory, and enter S6; where the hall error accumulation count is the statistical value of the Hall sensor error count in the diagnosis; S6. Store new_hall into hallHistory, increment the hall error accumulation count by 1. When the hall error accumulation count reaches the first threshold, perform the Hall sensor fault type diagnosis; S7. Take out n sets of data from hallHistory in reverse order, perform bitwise operations on the n sets of data, and accumulate and count the corresponding bits of each Hall sensor respectively to obtain the count values of the corresponding bits of each Hall sensor, and judge the fault type of the corresponding Hall sensor according to the calculated values.
2. The fault diagnosis method of the Hall sensor in a brushless DC motor according to claim 1, characterized in that, The specific content of S6 is as follows: S61. Determine whether the hall error accumulation count is less than the first threshold. If so, enter S62; if not, enter S7; S62. Determine whether the hall error accumulation count is 0. If so, store new_hall into hallHistory and then enter S63; if not, enter S64; S63. Increment the hall error accumulation count by 1; S64. Determine whether the hall error accumulation count reaches the first threshold. If so, enter S7; if not, it is considered that the detection is incorrect, and S64 is executed again.
3. The fault diagnosis method of the Hall sensor in a brushless DC motor according to claim 1, characterized in that, The specific content of S7 is as follows: S71. Take out n sets of data from hallHistory in reverse order; S72. Determine whether the first set of data retrieved is (k1 + k2 +... + k m ). If so, perform a bitwise AND operation on the n sets of data, and accumulate and count the corresponding bits of each Hall sensor to obtain the count values of the corresponding bits of each Hall sensor, and proceed to S73; if not, proceed to S74; S73. Determine whether there is a count value of n for a certain bit. If so, the Hall sensor corresponding to this bit is open or shorted to the power supply; if not, the Hall sensor corresponding to this bit has no fault; S74. Determine whether the first set of data retrieved is 0. If it is, perform a bitwise AND operation after performing a bitwise XOR operation on the n sets of data and (k1 + k2 +... + k m ) and accumulate and count the corresponding bits of each Hall sensor respectively to obtain the count values of the corresponding bits of each Hall sensor, and then proceed to S75; S75. Determine whether there is a count value of n for a certain bit. If so, the Hall sensor corresponding to this bit is shorted to the ground; if not, the Hall sensor corresponding to this bit has no fault.
4. The fault diagnosis method of the Hall sensor in a brushless DC motor according to claim 1, characterized in that, The number of Hall sensors is 3.
5. The fault diagnosis method of a Hall sensor in a brushless DC motor according to claim 4, characterized in that, If k3 is taken as 1 and a is taken as 2, then k1 = 4 and k2 = 2.
6. The fault diagnosis method of the Hall sensor in a brushless DC motor according to claim 1, characterized in that, The number of groups of data taken out, n, is 4.
7. A fault diagnosis method for a Hall sensor in a brushless DC motor according to claim 1, characterized in that, Read the position signals of each Hall sensor through the IO pins of the cpu. When the pin of the corresponding Hall sensor is at a high level, the corresponding HALL value of this position is obtained.
8. A fault diagnosis method for a Hall sensor in a brushless DC motor according to claim 1, characterized in that, The first threshold is 5 - 20.
9. A brushless DC motor, comprising a memory, a controller, and a computer program stored on the memory and executable on the controller, characterized in that, When the controller executes the program, it realizes the steps of the method according to any one of claims 1 - 8.
10. A brushless DC motor memory, on which a program is stored, characterized in that, When the program is executed by the controller, it realizes the steps of the method according to any one of claims 1 - 8.
Citation Information
Patent Citations
Fault detection method for Hall position sensors
CN103424651A
System and Method for Ground Fault Detection Using Hall Effect Sensors
US20200241050A1