Motor position detection method and system based on Hall sensor
By detecting the state legitimacy and timing anomalies of the three Hall sensor signals of the brushless DC motor of the electric scooter, identifying the fault location and generating a virtual signal, the failure problem of the Hall sensor in complex environments is solved, and stable operation and safe control of the motor are achieved.
Patent Information
- Application Number
- CN202511105484.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-07
AI Technical Summary
The Hall sensor of the brushless DC motor of an electric scooter is prone to faults such as signal jamming, output drift, and instantaneous disconnection in complex environments, resulting in disordered commutation timing, affecting the normal operation of the motor and threatening user safety.
By collecting signals from three Hall sensors, status legitimacy verification and timing anomaly detection are performed to identify the location of the faulty Hall sensor. A virtual Hall signal is generated based on the remaining normal Hall sensors, phase compensation is performed, the signal of the faulty Hall sensor is reconstructed, and a torque control command is output.
The accuracy and comprehensiveness of fault detection are significantly improved, ensuring that the motor can still operate normally in single-sensor fault mode, avoiding the impact of torque mutation on the motor and transmission system, and meeting real-time control requirements.
Smart Images

Figure CN120768166A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor position detection, and in particular to a motor position detection method and system based on a Hall sensor. Background Art
[0002] The brushless DC motors in electric scooters typically use three Hall sensors arranged with a 120-degree phase shift for six-step commutation control. This control determines the motor commutation timing by detecting the rotor's magnetic pole position. However, electric scooters face complex and changing operating environments during actual use, including frequent start-stop operations, road vibrations, temperature cycling, and electromagnetic interference.
[0003] In this complex environment, Hall sensors are prone to various failure modes, including signal stuck, output drift, and momentary disconnection. These failures will directly lead to commutation timing disorder, and in severe cases, even cause motor stalling, which not only affects the normal operation of the electric scooter, but also poses a threat to the user's driving safety. Summary of the Invention
[0004] The main purpose of the present invention is to provide a motor position detection method and system based on Hall sensors. The present invention can generate high-quality virtual Hall signals based on the remaining two normal sensors, ensuring a high degree of consistency between the reconstructed signal and the original signal, and effectively avoiding the impact of torque mutations on the motor and transmission system.
[0005] To achieve the above object, the present invention provides a motor position detection method based on a Hall sensor, comprising the following steps: Collecting three standard Hall state signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor; Performing state legitimacy inspection and timing anomaly detection on the three standard Hall state signals to identify state anomaly events and timing anomaly events; Determine the position of the faulty Hall sensor according to the abnormal state event and the abnormal timing event; Performing phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor to reconstruct a virtual Hall signal of the faulty Hall sensor; The virtual Hall signal is combined with a normal Hall sensor signal to output a torque control instruction.
[0006] Optionally, in a first implementation of the first aspect of the present invention, the step of collecting three standard Hall state signals of a first Hall sensor, a second Hall sensor, and a third Hall sensor in the motor includes: Perform hardware clock synchronization acquisition on the first Hall sensor, the second Hall sensor, and the third Hall sensor of the motor to obtain three original Hall signals; Performing digital filtering on the three original Hall signals using a second-order low-pass filter to obtain three filtered Hall signals; Amplitude normalization processing is performed on the three-channel filtered Hall signals based on a high-level threshold and a low-level threshold to obtain three-channel standard Hall state signals.
[0007] Optionally, in a second implementation of the first aspect of the present invention, performing state legitimacy verification and timing anomaly detection on the three standard Hall state signals to identify state anomaly events and timing anomaly events includes: Establish a standard six-state logic table containing 001, 010, 011, 100, 101, and 110, and define the 000 state and 111 state as invalid Hall states; Performing a match check between the current state combination of the three standard Hall state signals and the standard six-state logic table to identify a logic invalid state event; According to the state transition sequence when the motor rotates forward and the reverse transition sequence when the motor rotates reversely, the state transition of the three standard Hall state signals is sequence-validated to identify abnormal jump transition events; Continuously counting the logic invalid state event and the jump conversion abnormal event through an abnormal state counter to generate an abnormal state warning signal; Performing statistical calculations on the effective state ratios of the three standard Hall state signals, and determining a state abnormality event in combination with the abnormal state warning signal when the effective state ratio is lower than a preset percentage; The state transition time interval is calculated and timing anomaly detection is performed on the three standard Hall state signals to identify timing anomaly events.
[0008] Optionally, in a third implementation of the first aspect of the present invention, calculating the state transition time interval and performing timing anomaly detection on the three standard Hall state signals to identify a timing anomaly event includes: By recording the timestamps of two adjacent valid state transitions in the three standard Hall state signals, a state transition time interval is calculated; Calculating the current speed of the motor in real time according to the state transition time interval to obtain the current speed, and calculating a theoretical expected time interval based on the current speed; The theoretical expected time interval is multiplied by the dynamic coefficient and then added with the fixed compensation time to calculate the timing anomaly determination threshold; Compare the deviation value between the state transition time interval and the theoretical expected time interval with the timing anomaly determination threshold, identify timeout anomaly events or early anomaly events, and perform statistical analysis on the timeout anomaly events and early anomaly events of multiple state transitions to determine timing anomaly events.
[0009] Optionally, in a fourth implementation of the first aspect of the present invention, determining the position of the faulty Hall sensor according to the abnormal state event and the abnormal timing event includes: Based on the phase difference geometric constraint relationship, a three-Hall sensor state cross-validation matrix is constructed for the first Hall sensor, the second Hall sensor, and the third Hall sensor to obtain a phase compensation calculation model; When each of the first Hall sensor, the second Hall sensor, and the third Hall sensor fails, the corresponding theoretical Hall state is calculated using the phase compensation calculation model and the states of the remaining two Hall sensors to obtain three sets of fault candidate verification results; Compare and calculate the theoretical Hall states in the three groups of fault candidate verification results with the actually detected Hall states to obtain a state consistency score corresponding to each Hall sensor; Performing faulty Hall sensor determination analysis based on the state consistency score, determining that the Hall sensor is a candidate faulty Hall sensor when the state consistency score of any Hall sensor is lower than a first threshold and the state consistency scores of the remaining two Hall sensors are both higher than a second threshold; By analyzing the abnormal patterns of the candidate faulty Hall sensors, the fault types are classified into signal stuck fault, output drift fault and instantaneous disconnection fault, and the confirmed faulty Hall sensors are logically isolated to obtain the position of the faulty Hall sensors.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, performing phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor to reconstruct a virtual Hall signal of the faulty Hall sensor includes: Determine the remaining two normal Hall sensors according to the position of the faulty Hall sensor, and combine the signals of the remaining two normal Hall sensors using a logical exclusive OR operation to obtain a basic reconstructed signal; By analyzing the state conversion timing of the remaining two normal Hall sensors, the current electrical angle position and instantaneous speed of the motor rotor are calculated in real time to obtain the rotor position parameter and the speed parameter; Calculating a target phase compensation offset according to the rotor position parameter, the speed parameter, and the position of the faulty Hall sensor, and performing a logical exclusive OR operation on the target phase compensation offset and the basic reconstruction signal to obtain a compensated Hall signal; The compensating Hall signal is verified to match the historical normal state. When the matching degree exceeds the preset value, the reconstruction is confirmed to be successful. The compensating Hall signal confirmed to be successfully reconstructed is smoothed using a three-point smoothing filter to obtain a virtual Hall signal of the faulty Hall sensor.
[0011] Optionally, in a sixth implementation of the first aspect of the present invention, calculating a target phase compensation offset according to the rotor position parameter, the speed parameter, and the position of the faulty Hall sensor, and performing a logical exclusive OR operation on the target phase compensation offset and the basic reconstructed signal to obtain a compensated Hall signal includes: Determining a physical position identifier of the faulty Hall sensor in a 120-degree phase arrangement according to the position of the faulty Hall sensor, and calculating a phase compensation reference angle relative to the remaining two normal Hall sensors based on the physical position identifier to obtain a reference phase offset; Analyzing the phase delay characteristics of the motor in a current operating state using the rotor position parameter and the speed parameter to obtain a dynamic phase delay correction value; Performing a weighted combination of the reference phase offset and the dynamic phase delay correction to obtain a target phase compensation offset; The target phase compensation offset is converted into a corresponding logic level state and then subjected to a logic exclusive OR operation with the basic reconstruction signal to obtain a compensated Hall signal.
[0012] Optionally, in a seventh implementation of the first aspect of the present invention, the combining of the virtual Hall signal and the normal Hall sensor signal to output a torque control instruction includes: The virtual Hall signal of the faulty Hall sensor is logically combined with the signals of the remaining two normal Hall sensors to obtain a commutation control signal group in a fault-tolerant operation mode; Based on the commutation control signal group, the conduction state of the motor power switch tube is controlled and adjusted according to the six-step commutation timing logic to obtain a fault-tolerant commutation control timing; By comparing the deviation between the rotor position angle of the signal and the theoretical expected position angle, a position detection error of the motor is obtained, and error compensation is performed on the normal operating current instruction according to the position detection error to obtain an adaptive current compensation instruction; The adaptive current compensation instruction is smoothly integrated with the fault-tolerant commutation control timing by adopting a progressive current regulation method to obtain a torque control instruction.
[0013] Optionally, in an eighth implementation of the first aspect of the present invention, controlling and adjusting the conduction state of the motor power switch tube according to the six-step commutation timing logic based on the commutation control signal group to obtain a fault-tolerant commutation control timing includes: Establishing a six-step commutation logic mapping table according to the commutation control signal group, and mapping each Hall state combination to a specific power switch tube conduction mode to obtain a commutation state mapping relationship; Arranging the turn-on sequence of the six power switch tubes of the upper bridge arm and the lower bridge arm based on the commutation state mapping relationship to generate a turn-on timing table of the power switches of the three-phase alternating conduction; Inserting a dead time interval during the adjacent conduction state transition process of the power switch conduction timing table, and performing current limiting protection on the current mutation at the commutation moment to obtain a safe commutation timing control instruction; The safe commutation timing control instruction is verified in real time by monitoring the virtual Hall signal to obtain a fault-tolerant commutation control timing.
[0014] The present invention also provides a motor position detection system based on a Hall sensor, comprising: An acquisition unit, used for acquiring three standard Hall state signals of a first Hall sensor, a second Hall sensor, and a third Hall sensor in the motor; An anomaly detection unit, configured to perform state legitimacy inspection and timing anomaly detection on the three standard Hall state signals, and identify state anomaly events and timing anomaly events; A verification and analysis unit, configured to determine a location of a faulty Hall sensor based on the abnormal state event and the abnormal timing event; a phase compensation unit, configured to perform phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor, and reconstruct a virtual Hall signal of the faulty Hall sensor; The output unit is used to combine the virtual Hall signal with a normal Hall sensor signal to output a torque control instruction.
[0015] In summary, the technical solution provided by the present invention, through the establishment of a dual detection system consisting of a six-state logic table check and adjacent state transition time interval detection, can simultaneously monitor Hall sensors in real time from the perspectives of logical legitimacy and temporal rationality, significantly improving the accuracy and comprehensiveness of fault detection. A three-sensor cross-validation matrix constructed based on a 120-degree phase difference geometric constraint relationship can accurately identify the specific location of the faulty sensor through state consistency scoring, avoiding the fuzzy judgment problem in traditional methods. A reconstruction algorithm using a logical XOR operation combined with dynamic phase compensation can generate high-quality virtual Hall signals based on the remaining two normal sensors, ensuring high consistency between the reconstructed signal and the original signal. In single-sensor fault mode, the system can use the reconstructed signal to maintain normal six-step commutation control, and an adaptive torque compensation algorithm ensures that the motor output performance is largely unaffected. Through hardware clock synchronization acquisition and high-frequency signal processing, the system can complete fault detection and signal reconstruction in milliseconds, meeting the real-time requirements of motor control. Dynamic adjustment of detection thresholds and compensation parameters based on the motor's operating state enables the system to adapt to operating requirements under different speed and load conditions. During the fault mode switching process, progressive current regulation and smooth fusion processing are adopted to effectively avoid the impact of torque mutation on the motor and transmission system. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 1 is a schematic diagram of the steps of a motor position detection method based on a Hall sensor in one embodiment of the present invention; Figure 2 This is a structural block diagram of a motor position detection system based on a Hall sensor in one embodiment of the present invention.
[0017] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, 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 intended to limit the present invention.
[0019] Reference Figure 1 , this embodiment provides a motor position detection method based on a Hall sensor, comprising the following steps: S1, collecting three standard Hall state signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor; A sampling architecture based on a unified hardware master clock is constructed within the motor controller. Using a unified clock to drive the sampling circuit, the outputs of the first, second, and third Hall sensors are sampled in parallel. A hardware phase-locked mechanism is used to keep the timestamp error between the three channels within 1μs, effectively preventing misjudgment of state combinations due to signal acquisition time offset. In actual engineering applications, this sampling process is set at a high-frequency rate of 50kHz, ensuring sufficient Hall data points are acquired within each electrical cycle, even under highly dynamic conditions with motor speeds exceeding 3000rpm. To eliminate high-frequency interference noise from the raw Hall signals, a second-order low-pass filter algorithm based on digital signal processing principles is introduced with a cutoff frequency of 2kHz. This filter removes high-frequency noise such as road vibration, electromagnetic induction disturbances, and ambient electrical noise, while maintaining the fundamental frequency Hall state variation characteristics required for the BLDC motor's six-step commutation. This enhances the system's ability to suppress signal interference and improves commutation triggering accuracy. After this digital filtering process, the three Hall effect signal waveforms obtained have a more stable amplitude, clearer edge transitions, and good amplitude dynamic characteristics and response consistency. The three filtered Hall effect signals are amplitude-normalized based on high-level and low-level thresholds. By setting the high-level judgment threshold to 3.5V and the low-level judgment threshold to 1.5V, signals with amplitudes above 3.5V are uniformly mapped to a logical "1," signals below 1.5V are mapped to a logical "0," and the uncertain region between 1.5V and 3.5V is marked as invalid to prevent misjudgment, resulting in three standard Hall effect state signals.
[0020] S2, performs state legitimacy check and timing anomaly detection on the three-way standard Hall state signal to identify state anomaly events and timing anomaly events; Specifically, a six-state logic table based on the 120-degree phase distribution principle of the three-phase BLDC motor is established. H∈{001, 010, 011, 100, 101, 110} is set as the standard legal state combination. 000 and 111 are clearly defined as logically impossible invalid states to identify extreme situations where Hall signals are simultaneously ineffective or conducting. During motor operation, the level combination of the three standard Hall state signals within each sampling cycle is converted into a three-bit binary form and matched in real time with the six-state logic table. Logical rules are used to identify states that do not belong to the standard set, thereby detecting logically invalid state events and marking them as potential fault signs. Sequential legitimacy verification is performed on the state transition process, while ensuring the legality of the current state itself. Based on the standard commutation sequence (001→011→010→110→100→101→001) in the forward direction and the reverse sequence in the reverse direction, the transition paths between consecutive state combinations are tracked in real time. If state jumps are detected, such as a direct jump from 001 to 010 or from 110 to 011, it indicates the absence of a valid intermediate transition between states, constituting a jump transition anomaly event. To enhance the statistical robustness of anomaly identification, an abnormal state counter is introduced to continuously count logically invalid states and jump transition anomalies. When the number of anomalies exceeds a set threshold (e.g., occurring continuously within three cycles), an abnormal state warning signal is immediately output, triggering the preparation of lower-level fault-tolerant logic. Based on this logical analysis, the stability and reliability of the overall signal are statistically evaluated. A valid state ratio statistics mechanism is designed to calculate the percentage of valid states in the three Hall signals within a unit time window (e.g., 100ms). When this percentage falls below a preset threshold (e.g., 85%) and is accompanied by an abnormal state warning signal, a state anomaly event is identified and defined as a symptom of systemic sensor failure. Real-time calculation of the transition time interval T between adjacent states i , and the interval between it and the expected state is T e The expected interval is dynamically adjusted according to the speed, that is, T=60 / (6×RPM), where RPM is estimated from the Hall signal frequency. i -T e |Exceeds tolerance threshold ε=0.3×T e If the delay is +2ms, it is marked as an early or late timing anomaly event. Through the coordinated implementation of logic consistency verification and timing deviation detection, complex fault conditions such as signal short circuits, poor contact, misaligned conversion caused by interference, and sensor response hysteresis can be identified.
[0021] S3, determining the location of the faulty Hall sensor based on the abnormal state event and the abnormal timing event; It should be noted that the logical dependency between Hall states is established based on the fixed 120-degree electrical phase difference between the three-phase windings of the brushless DC motor. Based on the symmetrical spatial arrangement of Hall sensors H1, H2, and H3 along the rotor circumference, a Hall state cross-validation matrix is formed. This matrix allows the theoretical state of the third channel to be deduced for the combined state signals output by any two Hall channels, given a known electrical angle and commutation sequence, to establish a phase compensation calculation model. When the detection system identifies a state or timing anomaly in the preceding steps, the cross-validation mechanism is triggered. Channels H1, H2, or H3 are sequentially assumed to be faulty. Under each assumption, the actual states observed by the remaining two Hall channels are input into the phase compensation model to derive the theoretical third Hall signal state. This theoretical state serves as one of the fault candidate verification results and is compared with the actual observed values of that channel during the current sampling period to assess the consistency of their states. Through multi-cycle comparisons within a continuous sampling window, a state consistency score is derived for each Hall channel under its assumed fault condition. This score then forms a set of state consistency scores. Each score represents the degree of consistency with the channel's geometrically expected behavior within the current operating range, providing a quantitative indication of the degree of anomaly. Fault judgment logic is then analyzed based on the state consistency scores. If the state consistency score of a Hall channel falls below a preset first threshold (e.g., 0.7) while the scores of the other two channels are both above a second threshold (e.g., 0.9), the channel is identified as a candidate for a faulty Hall sensor in the current cycle. To clarify the nature of the fault, the candidate channel's historical state records and abnormal behavior patterns are used to categorize the fault type. If the channel's output level remains unchanged for multiple consecutive cycles, remaining at a logic high or low level for an extended period, it is identified as a "signal stuck" fault. If its state switching exhibits regular delays rather than jumps, it is classified as an "output drift" fault. If the output intermittently fails or displays an invalid value of 000 or 111 at random intervals, it is identified as a "momentary disconnection" fault. After determining the fault type, the faulty Hall effect sensor channel is isolated from the logic control path, effectively blocking its input signal during control algorithm execution. The faulty Hall effect sensor location, fault type, and occurrence time, determined through cross-validation, are then recorded in the fault diagnosis results.
[0022] S4, performing phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor to reconstruct a virtual Hall signal of the faulty Hall sensor; Specifically, based on the location of a confirmed faulty Hall effect sensor, such as H1, H2 and H3 are automatically identified as functioning channels within the current cycle. The current state values of H2 and H3 are combined using a logical exclusive-OR (XOR) operation to generate a basic reconstructed signal. This basic signal provides an approximate estimate of the level change trend of the missing channel based on the spatial phase structure of the BLDC motor. Due to the dynamic state of the motor, a simple logical exclusive-OR operation cannot fully and accurately restore the commutation rhythm of the faulty channel. Therefore, the current electrical angle position and instantaneous speed of the motor rotor are estimated by real-time analysis of the state transition sequence between H2 and H3. This estimation process relies on the time interval between the previous and current state transitions, as well as the known standard six-step commutation cycle. By differentiating the Hall effect edge trigger time, the precise speed value is calculated. Combined with the state sequence, the current rotor angle position is restored, and a time-position function is established to describe the evolution of the electrical angle phase. Based on the rotor position parameters, speed parameters, and the physical location of the faulty Hall channel, a preset spatial offset relationship is used to calculate a target phase compensation offset. This offset is used to correct any phase lag or lead between the base reconstructed signal and the actual Hall channel under the current speed and angle conditions. The target phase compensation offset, in logically coded form, is then XORed with the base reconstructed signal to generate a compensated Hall signal. To ensure the reliability of the reconstruction result, the compensated Hall signal is verified against a historical normal Hall state trajectory stored before the fault occurred. A sliding window comparison method is used to assess the similarity. When the match exceeds a set threshold (e.g., 95%), the reconstruction result is considered reliable and the virtual signal generation is confirmed to be successful. To improve signal stability and suppress transient jumps, the confirmed compensated Hall signal undergoes a three-point smoothing filter. This filter replaces the original value with the current value and the average of the two preceding and following signals. This generates a final virtual Hall signal with a slow-changing characteristic, clean edges, and good continuity.
[0023] S5 uses a combination of virtual Hall signal and normal Hall sensor signal to output the torque control command of the motor.
[0024] The virtual Hall signal from the faulty Hall sensor is logically combined with the signals from the two remaining healthy Hall channels to construct a three-digit standard format Hall state input for the fault-tolerant operating mode, arranged in the same order as the original Hall arrangement. This combined signal is encoded to generate a fault-tolerant commutation control signal group, which serves as the core control logic to determine the specific step of the motor's six-step commutation cycle. This commutation control signal group is input to the power switch driver module, which controls the conduction state of the upper and lower power MOSFETs or IGBTs corresponding to each phase winding according to a preset six-step commutation timing table. This maintains the alternating current flow rhythm of the BLDC motor's three-phase windings, ensuring predictable temporal and logical integrity of commutation events. Even if one of the three Hall signal channels is lost, the closed continuity of the drive control chain is maintained, resulting in a fault-tolerant commutation control sequence that meets the commutation cycle requirements. During this process, the drive signals for all power devices are directly mapped from the current three-digit Hall combination to the commutation drive logic circuit, allowing the system to enter fault-tolerant commutation mode without interrupting operation or reducing speed. Because the reconstructed Hall effect signal is only an estimate and deviates from the actual rotor position due to factors such as speed disturbances, electrical angle deviation, and compensation errors, an error compensation mechanism is introduced. The control algorithm continuously compares the difference between the current rotor position angle derived from the virtual signal and the motor's theoretical commutation reference angle to determine the instantaneous position detection error. Based on this position error, the conventional current control command is adjusted to construct a current compensation function. This function dynamically amplifies or attenuates the current amplitude to adapt to the deviation correction requirements. Through this compensation process, the system increases or decreases the current command intensity in real time when an error occurs, thereby compensating for current waveform distortion caused by delayed or advanced commutation and maintaining the motor torque output within the desired range. To prevent the adverse effects of sudden changes in system excitation caused by current compensation on drive stability, a progressive adjustment mechanism is introduced into the current control path. This mechanism uses a slope limiter to confine the rate of change of the error compensation current to a smooth interval, ensuring a step-free transition from the normal current command to the compensated current command. This adjustment result is then integrated with the fault-tolerant commutation control timing to ensure the continuity and smoothness of the torque control command output curve, avoiding vibration, noise, or drive instability caused by current disturbances. The final output is the motor's torque control command, which features angle estimation, correction, and dynamic current compensation based on three-Hall dual-channel fault tolerance. This allows for normal motor drive and torque output in the event of a single-point Hall failure, while ensuring the smoothness and safety of the vehicle's operation.
[0025] In one example, collecting three standard Hall state signals of a first Hall sensor, a second Hall sensor, and a third Hall sensor in a motor includes: The first, second and third Hall sensors of the motor are collected by hardware clock synchronization to obtain three original Hall signals; The three original Hall signals are processed by a second-order low-pass filter to obtain three filtered Hall signals. The three filtered Hall signals are processed by amplitude normalization based on high and low level thresholds to obtain three standard Hall state signals.
[0026] In this example, at the system architecture level, a parallel connection design is implemented for the three Hall sensors in the BLDC motor, arranged 120 degrees apart in electrical phase. A unified hardware master clock mechanism is implemented within the controller, using a high-precision crystal oscillator timebase to schedule all sampling events, achieving full hardware-level synchronization of the three sampling operations. A sampling process for the three ADCs or GPIO channels is implemented within the microcontroller or digital signal processor, triggered by a timer interrupt. On-chip clock synchronization logic ensures that the timestamp error for each Hall signal acquisition is strictly controlled within 1 microsecond, effectively preventing misjudgment of state combinations due to sampling timing deviations. Given that small motor systems such as electric scooters operate at speeds ranging from hundreds to thousands of revolutions per minute, corresponding to electrical cycles as short as milliseconds or sub-milliseconds, the sampling frequency is set sufficiently high, with a base frequency of 50kHz chosen to ensure at least 80 data points are collected per electrical cycle at maximum speed, fully covering the entire Hall edge state transition process. Digital filtering is performed on each of the three signals to suppress high-frequency noise introduced by factors such as electromagnetic interference, temperature fluctuations, and mechanical vibration. A second-order low-pass filter is used for digital filtering. This filter significantly suppresses high-frequency interference outside the cutoff frequency range while ensuring signal response speed. Considering that the typical commutation frequency of a BLDC motor is within a few hundred hertz, while that of an electric scooter typically does not exceed 2 kHz, the filter cutoff frequency is set to 2 kHz. This eliminates most high-frequency harmonics, spike interference, and digital jitter without losing commutation information. In practical applications, the filter is implemented using an IIR representation in software or a dedicated hardware filter module in a DSP. This ensures that no additional processing delay is introduced during real-time sampling and that phase continuity of the signal is maintained on the time axis. This step generates three filtered Hall signals. The amplitudes of the three filtered Hall signals are normalized based on high and low thresholds, mapping the analog signals to standard digital logic levels. High and low level thresholds are set to set upper and lower limits for the filtered signal amplitudes to avoid oscillation caused by level uncertainty during slow transitions of the Hall signal edges. The system sets a high-level threshold of 3.5V and a low-level threshold of 1.5V. This means that when the voltage of a filtered signal exceeds 3.5V, that channel is considered a logic "1"; when the voltage is below 1.5V, it is considered a logic "0"; and the range between 1.5V and 3.5V is considered inactive, thus preventing interference with the control logic during voltage swings or signal transients. This amplitude determination process is performed by a comparator circuit or programmed logic, and the results are updated in the controller's state cache. The three Hall signals are converted into standard logic state streams H1, H2, and H3, each representing the high and low level states of the sensor during the current sampling period as 0 or 1, and aligned with the actual rotor motion on the time axis.
[0027] In one example, three standard Hall effect state signals are checked for state legitimacy and timing anomaly is detected to identify abnormal state and timing events, including: Establish a standard six-state logic table containing 001, 010, 011, 100, 101, and 110, and define the 000 state and 111 state as invalid Hall states; The current state combination of the three standard Hall state signals is matched with the standard six-state logic table to identify the logically invalid state event; Based on the state transition sequence when the motor is rotating forward and the reverse transition sequence when the motor is rotating backward, the state transition sequence of the three standard Hall state signals is verified for legitimacy, and abnormal jump transition events are identified. The abnormal state counter continuously counts the logic invalid state events and jump conversion abnormal events to generate abnormal state warning signals; Perform statistical calculations on the effective state ratio of the three standard Hall state signals. When the effective state ratio is lower than the preset percentage, an abnormal state event is determined in combination with the abnormal state warning signal. The state transition time interval is calculated and timing anomaly detection is performed on three standard Hall state signals to identify timing anomaly events.
[0028] In this example, a standard six-state logic table for Hall-effect states is established based on the 120-degree electrical angle distribution of the three-phase winding of a brushless DC motor (BLDC). This table specifies only six permitted three-digit Hall signal combinations: 001, 010, 011, 100, 101, and 110, corresponding to the six valid electrical angle segments within the motor's six-step commutation cycle. All other combinations, including 000 and 111, are considered logically invalid because all three Hall signals are either low or high, which violates the normal electrical angle distribution. During motor operation, the system samples the three Hall signals in real time and combines them into a three-digit binary code. This code is then checked against the standard six-state logic table. If a combination does not fit within the set of six states, the sampling period is marked as a logically invalid state event and counted in the raw data stream of the anomaly detection module. To identify anomalies in Hall signal state transitions, the sequential Hall state changes between sampling periods are tracked. Based on the standard state transition sequence during normal forward motor operation (001 → 011 → 010 → 110 → 100 → 101 → 001), the system compares each state transition with the previous state. If a state transition does not follow the standard path from the previous state, but instead skips (for example, from 001 directly to 010 or from 100 directly to 001), it is flagged as a jump transition anomaly. Similarly, during reverse motor operation, the reverse of this sequence is used as the legality check criteria. Such anomalies are often caused by Hall signal acquisition asynchrony, level fluctuations, or signal interruptions. If not promptly identified, they can lead to premature or delayed commutation, causing motor vibration, overcurrent, or even loss of synchronism. To improve the system's responsiveness to occasional or continuous faults, an abnormal state counter mechanism is embedded in the detection logic. The system counts both logically invalid state events and jump transition anomalies occurring within a continuous time window. If the cumulative number of either type of anomaly exceeds a set threshold (e.g., three or more occurrences in a row) within consecutive sampling cycles, an abnormal state warning signal is triggered. At the same time, the system introduces statistical analysis methods in the process of abnormal state identification and establishes a valid state ratio evaluation mechanism based on a time window. The system counts the proportion of valid states belonging to the standard six states in all sampling cycles in each 100ms sliding time period. When this proportion continues to be lower than the preset threshold (such as 85%) and the early warning signal has been triggered, it is determined that the current three-way Hall signal has a trend of declining stability or gradual deterioration, forming a formal confirmation of the state abnormality event, and providing this confirmation information to the fault diagnosis module for fault location identification and type classification processing. In addition to the verification at the logic and state levels, the system dynamically monitors the timing characteristics of the Hall signal. In specific operations, the timestamps of all valid state transitions are recorded, and the time interval between two consecutive valid states is calculated to obtain the state transition time interval.The system estimates the theoretically expected interval between state transitions based on the motor's current operating speed and identifies timing anomalies by comparing the actual interval with the theoretical one. If the current interval is significantly greater than the theoretical value, it is considered a timeout anomaly; if it is significantly less than the theoretical value, it is considered an early anomaly. Because the state transition period of a BLDC motor naturally fluctuates during acceleration and deceleration, the system incorporates an adaptive tolerance band mechanism to account for dynamic speed fluctuations and control delays. For example, the error tolerance is set to 30% of the current expected period plus a fixed delay compensation constant of 2ms to avoid misinterpreting actual acceleration behavior as an anomaly.
[0029] In one example, the state transition time interval is calculated and timing anomaly detection is performed on three standard Hall state signals to identify abnormal timing events, including: By recording the timestamps of two adjacent valid state transitions in the three-way standard Hall state signal, the state transition time interval is calculated; The current speed of the motor is calculated in real time according to the state transition time interval to obtain the current speed, and the theoretical expected time interval is calculated based on the current speed; Multiply the theoretical expected time interval by the dynamic coefficient and add the fixed compensation time to calculate the timing anomaly judgment threshold; Compare the deviation value between the state transition time interval and the theoretical expected time interval and the timing anomaly judgment threshold to identify timeout anomaly events or early anomaly events, and perform statistical analysis on the timeout anomaly events and early anomaly events of multiple state transitions to determine the timing anomaly events.
[0030] In this example, three standard Hall effect state signals are continuously monitored, and the timestamp of each valid state transition is recorded in real time. A valid state transition refers to the change of the three-digit Hall effect state from one valid combination to the next, such as from 001 to 011, or from 110 to 100. This state transition must maintain logical continuity within the six-step commutation sequence, while excluding invalid states such as 000 or 111, as well as spurious transitions caused by illegal jumps. Whenever the system identifies a valid state transition, the current system clock time is recorded as a key time point and subtracted from the previously recorded timestamp to calculate the actual time interval for this state transition. This interval value is the actual response period of the motor between commutation steps. The current motor speed is calculated in real time based on the state transition interval. The speed calculation is based on the fact that each cycle contains six commutation steps. Therefore, the revolutions per minute can be inferred from the number of transitions per unit time. Based on the continuous valid state transitions, the system estimates the current speed in real time and dynamically updates it to ensure responsiveness to acceleration and deceleration. On this basis, the system calculates the expected time interval that theoretical state transitions should follow based on the current estimated speed. This time interval represents the ideal time interval between each commutation step at the current operating speed. Its calculation model is based on the motor structural parameters and the Hall arrangement principle. It can be dynamically updated as the speed changes and provides a reference value for determining commutation anomalies. To enhance the robustness of this judgment process, the system introduces a dynamic judgment boundary mechanism. By multiplying the theoretical expected time interval by a dynamic coefficient that matches the motor's acceleration characteristics and adding a fixed compensation time, a timing anomaly judgment threshold is formed. This threshold is calibrated based on a combination of factors such as motor response delay, electronic control sampling error, and external disturbances. It includes a proportional adjustment factor and a time constant compensation term. After establishing the thresholds, each time the system detects a state change, it subtracts the actual state transition interval from the theoretical expected interval to obtain the current state transition deviation value. This deviation is then compared with the judgment threshold. If the deviation value exceeds the timing anomaly judgment threshold and the actual interval is significantly longer than the theoretical value, it is considered a timeout anomaly, indicating a sluggish motor response, Hall signal loss, or sensor output delay. If the deviation value is less than the threshold but the actual interval is significantly shorter than the theoretical value, it is considered an early anomaly, caused by voltage jitter, missampling, or interference. All identified anomalies are recorded in the anomaly log buffer, along with metadata such as the anomaly type, occurrence time, and state number. To prevent a single anomaly misjudgment from causing the system to enter the fault-tolerant process, an anomaly statistical analysis mechanism is established. By analyzing the frequency of timeout anomalies and early anomaly events in consecutive state transitions within a specified window (e.g., the last 10), the system determines whether the current timing anomaly exhibits persistent, gradual, or sudden characteristics.If a timeout or early error event occurs within a specified window, exceeding a set threshold (e.g., 15%), and the average deviation duration exceeds 1.5ms, the system is deemed to have entered a timing anomaly state and reported to the main control logic for a response, such as initiating fault location, generating a virtual signal, or entering power limiting mode. The evaluation mechanism further subdivides the anomaly pattern. A persistent increase in the deviation value can be considered a progressive failure; sudden changes in individual cycles can be identified as a burst interference anomaly; and random occurrences across multiple, discontinuous cycles can be considered intermittent timing instability.
[0031] In one example, determining the location of a faulty Hall sensor based on abnormal state events and abnormal timing events includes: Based on the geometric constraint relationship of phase difference, a three-Hall sensor state cross-validation matrix is constructed for the first Hall sensor, the second Hall sensor and the third Hall sensor to obtain a phase compensation calculation model; When each of the first Hall sensor, the second Hall sensor, and the third Hall sensor fails, the corresponding theoretical Hall state is calculated using the phase compensation calculation model and the states of the remaining two Hall sensors to obtain three sets of fault candidate verification results; The theoretical Hall states in the three sets of fault candidate verification results are compared with the actual detected Hall states to obtain the state consistency score corresponding to each Hall sensor; Perform faulty Hall sensor determination analysis based on the state consistency score. When the state consistency score of any Hall sensor is lower than a first threshold and the state consistency scores of the other two Hall sensors are both higher than a second threshold, the Hall sensor is determined to be a candidate faulty Hall sensor. By analyzing the abnormal patterns of candidate faulty Hall sensors, the fault types are classified into signal stuck fault, output drift fault and instantaneous disconnection fault. The confirmed faulty Hall sensors are logically isolated and the location of the faulty Hall sensors is obtained.
[0032] In this example, the spatial arrangement of the three Hall sensors—uniformly spaced 120 degrees electrical phase along the circumference of the motor stator—allows the output state of each sensor to be theoretically inferred from the states of the other two sensors and a predetermined phase offset pattern. Based on this constraint, a state cross-validation matrix for the three Hall sensors is constructed. A phase compensation calculation model is built around this matrix. This matrix allows the output state to be reconstructed using the signals from the remaining two channels, even when any Hall sensor data is missing. This model uses encoding logic to map Hall state combinations to current electrical angle intervals and, based on this, calculates spatial symmetry, forming a theoretical state generation mechanism. For any two known Hall sensor states, the model can derive the target voltage level of the third Hall sensor under an ideal commutation sequence. After model construction, the system sequentially assumes H1, H2, or H3 as the faulty channel. Under each assumption, real-time data from the remaining two functioning channels is used as input into the phase compensation calculation model to generate the theoretical state of the third Hall channel, resulting in three sets of candidate state verification results. At this point, the system compares the theoretical state output by the model with the actual observed state of the channel by the current acquisition system on a cycle-by-cycle basis. Through point-by-point consistency judgment, the ratio of the cumulative number of successful matches to the total number of comparisons is calculated to form a state consistency score for the channel, which is used to quantify the degree of deviation between the actual signal and the result of geometric logic deduction. Faulty Hall effect sensors are determined and analyzed based on the state consistency score, and selective judgments are made based on the relative distribution characteristics of the score. That is, when the consistency score of a Hall effect channel is significantly lower than the first preset threshold (such as 0.7), and the scores of the other two channels are both higher than the second stability threshold (such as 0.9), the low-scoring channel is considered to show a trend of significant deviation from normal logical behavior in the current operating state and has a high probability of failure. It is therefore preliminarily identified as a candidate faulty Hall effect sensor. To identify the fault type and conduct a deep classification of channel behavior, the system enters the abnormal pattern recognition phase after confirming a candidate channel. This phase extracts features from the channel's state change trajectory over consecutive cycles and performs matching analysis based on the following three typical patterns: If a channel maintains a constant high or low level for an extended period without noticeable edge changes, it is considered a signal stuck fault; if its state change rhythm exhibits systematic delays or slippage, significantly offset from the expected state switching time, but maintains a largely intact phase relationship, it is identified as an output drift fault; and if its state exhibits periodic failures, intermittent all-zero states, or erratic jumps, exhibiting irregular fluctuations, it is defined as a transient disconnection fault. The confirmed faulty channel is logically isolated. This means that at the control level, the channel's signal is removed from the motor commutation control or angle estimation calculation process. Its logical state is frozen, and periodic sampling of its input data is stopped to prevent its erroneous signal from interfering with the judgment logic of the remaining two normal channels.The isolation mechanism cooperates with the redundant verification model to run, so that the system continues to run under the condition of retaining part of the sensing ability, and provides a clean calculation baseline for the virtual signal reconstruction algorithm.
[0033] In one example, the virtual Hall signal of the faulty Hall sensor is reconstructed by phase compensation of the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor, including: The remaining two normal Hall sensors are determined according to the position of the faulty Hall sensor, and the remaining two normal Hall sensor signals are combined by using logical exclusive OR operation to obtain a basic reconstruction signal; The current electrical angle position and instantaneous speed of the motor rotor are calculated in real time by analyzing the state transition timing of the remaining two normal Hall sensors, to obtain rotor position parameters and speed parameters; The target phase compensation offset is calculated according to the rotor position parameters, speed parameters and position of the faulty Hall sensor, and the target phase compensation offset is subjected to logical exclusive OR operation with the basic reconstruction signal to obtain a compensated Hall signal; The matching degree between the compensated Hall signal and the historical normal state is verified, and when the matching degree exceeds a preset value, it is confirmed that the reconstruction is successful, and the compensated Hall signal of the confirmed successful reconstruction is subjected to smoothing processing by using a three-point smoothing filter to obtain the virtual Hall signal of the faulty Hall sensor.
[0034] In this example, when the fault determination mechanism identifies a Hall effect sensor (such as H1) as faulty, the system immediately discards the data from that channel and confirms that H2 and H3 are the active channels in the current cycle. Based on the dual-channel residual structure, the system invokes redundant combination rules and combines the current logic levels of the two healthy channels using a logical exclusive-OR operation, yielding a binary result as the basis for the reconstructed signal. This logical combination is based on the fixed spatial electrical phase relationship between the three Hall effects. That is, if the states of any two Hall effects are known, the state of the third Hall effect is inevitably affected by the phase difference between the first two, and this can be inferred reversely using logical rules. The time series of state changes of the remaining two healthy channels is analyzed to estimate the current rotor electrical angle position and instantaneous speed. The system monitors the alternating rising and falling edges of H2 and H3, records the timestamps of state transitions, and calculates the time interval between adjacent edges to derive the time required to complete a commutation cycle per unit time. This is used to estimate the current speed, and the rotor's current electrical angle range is derived based on the state combination and commutation sequence. The system uses the rotor electrical angle parameters, instantaneous speed parameters, and the physical location of the faulty Hall effect sensor as inputs to calculate the phase compensation model. Because different Hall effect sensor installation angles correspond to 120-degree distributions on the electrical angle axis, when a Hall effect sensor is missing, the basic reconstructed signal has a fixed phase offset compared to the actual state. This offset is adjusted based on the specific motor configuration and speed. The system obtains the logical mapping offset corresponding to the offset angle under the current conditions through a table lookup or real-time calculation, uses this offset as the target phase compensation offset, and applies this offset to the basic reconstructed signal through a logical exclusive-OR operation to generate a corrected compensated Hall effect signal. To verify the correctness of the compensated signal, the signal is compared with the legitimate states previously output by the faulty channel in the motor's historical operating data. The compensated Hall effect signal is placed at the time sequence position corresponding to the historical state window and compared point by point with historical states within the same speed conditions and similar electrical angle range. The number of matches over multiple commutation cycles is counted, and the matching percentage is calculated. When the matching degree exceeds the system's preset threshold (e.g., 95%), the current compensation model is deemed to have been successfully reconstructed under the current operating conditions, indicating that the compensated Hall signal generated by the logic combination and phase correction is credible. After the reconstructed signal is confirmed to have passed, it is smoothed to eliminate signal discontinuities caused by compensation edge jumps, logic fluctuations, or short-term errors, thereby improving signal stability and anti-interference capabilities. The specific processing method is a three-point smoothing filter, which uses the signal state values corresponding to the current reconstruction point and the two time points before and after it as input, and performs a sliding average or median filtering operation to eliminate local spikes, mutations, or edge jitter, forming a smooth, stable, and edge-controllable final virtual Hall signal.
[0035] In one example, a target phase compensation offset is calculated based on a rotor position parameter, a speed parameter, and a faulty Hall sensor position, and a logical exclusive OR operation is performed on the target phase compensation offset and a basic reconstructed signal to obtain a compensated Hall signal, including: Determine the physical position identifier of the faulty Hall sensor in the 120-degree phase arrangement according to the position of the faulty Hall sensor, and calculate the phase compensation reference angle relative to the remaining two normal Hall sensors based on the physical position identifier to obtain a reference phase offset; The phase delay characteristics of the motor in the current operating state are analyzed using the rotor position parameters and speed parameters to obtain the dynamic phase delay correction value; Performing a weighted combination of the reference phase offset and the dynamic phase delay correction to obtain a target phase compensation offset; The target phase compensation offset is converted into a corresponding logic level state and then subjected to a logical exclusive OR operation with the basic reconstructed signal to obtain a compensated Hall signal.
[0036] In this example, the physical location of the faulty Hall effect sensor within the 120-degree phase arrangement is determined based on its position. For a three-Hall system, sensors H1, H2, and H3 are installed in a fixed spatial order, spaced 120 degrees apart, around the stator circumference. Each channel occupies the start, middle, and end of the electrical angle sequence. Based on the correspondence between the number and the installation position, the system assigns a clear physical location identifier to the faulty channel, such as H1 corresponding to the 0-degree starting point, H2 to the 120-degree clockwise position, and H3 to the 240-degree position. Based on the fixed phase difference between this location identifier and the remaining two functioning channels, the system calculates the ideal trigger angle that the faulty channel should exhibit in the complete signal sequence. This is the reference phase offset required to compensate for the current basic reconstructed signal under ideal static conditions. This reference offset is dependent solely on the sensor structural design, reflecting the spatial geometric compensation relationship and does not dynamically change with speed or electrical angle. Therefore, it serves as a static correction component in the compensation synthesis. During actual operation, the motor's commutation rhythm is affected by multiple factors, including the rate of electrical angle evolution, magnetic flux reaction delay, and control signal response lag. This can cause a positional offset between the actual triggering time of the Hall effect state and the theoretical value. Therefore, a dynamic phase delay correction mechanism is introduced. Based on the rotor position and speed parameters within the current cycle, the rate of change of the electrical angle phase over time is analyzed. Combining the relationship between the Hall edge detection time difference and the ideal commutation rhythm, a dynamic phase delay model is developed to quantify the current operating state. As speed increases, the Hall signal edge exhibits a certain degree of lag due to the cumulative effect of the control system response time, Hall level conversion delay, and the power device turn-on settling time. This requires a positive delay compensation. Conversely, when speed decreases or the control system responds prematurely, the signal triggers prematurely, requiring a negative compensation adjustment. A weighted combination of the baseline phase offset and the dynamic phase delay correction is used to generate a target phase compensation offset that better matches the current operating conditions. This weighted model balances the weights of static structural compensation and dynamic operational correction using preset coefficients. For example, at low speeds, where static phase relationships dominate, the baseline compensation is weighted more heavily. Meanwhile, at high speeds or high-frequency response, where the system relies more heavily on dynamic hysteresis analysis, the delay correction is weighted more heavily. The resulting target phase compensation offset represents the correction angle required to be introduced into the base reconstructed signal during the current cycle, ensuring that the logic output accurately corresponds to the expected Hall effect edge. To convert this angle into a logical level recognizable by the control circuit, an angle-to-state mapping logic is established. The state pattern within the electrical angle region corresponding to the target offset angle is deduced as a specific "high" or "low" level signal. Specifically, according to the commutation logic, at this angle position, if the fault channel is in the excitation range, the signal should be high, and if it is in the non-conducting range, the signal should be low.This mapping is accomplished through a table lookup or direct logical calculation based on the relationship between the current commutation step and the electrical angle. The target state is input as a logic bit into the XOR operation module, where it is XORed with the base reconstructed signal generated by combining the two normal channels. This introduces dual corrections for spatial phase and time delay, generating a compensated Hall signal that incorporates both static and dynamic correction characteristics.
[0037] In one example, a virtual Hall signal is combined with a normal Hall sensor signal to output a torque control command for a motor, including: The virtual Hall signal of the faulty Hall sensor is logically combined with the signals of the remaining two normal Hall sensors to obtain a commutation control signal group in a fault-tolerant operation mode; Based on the commutation control signal group, the conduction state of the motor power switch tube is controlled and adjusted according to the six-step commutation timing logic to obtain a fault-tolerant commutation control timing; By comparing the deviation between the rotor position angle of the signal and the theoretical expected position angle, the position detection error of the motor is obtained, and the normal operating current command is compensated according to the position detection error to obtain the adaptive current compensation command; A progressive current regulation method is used to smoothly merge the adaptive current compensation command with the fault-tolerant commutation control timing to obtain the torque control command of the motor.
[0038] In this example, the virtual Hall signal from the faulty Hall sensor is logically combined with the signals from the remaining two healthy Hall sensors. The three signals are combined into a three-bit binary Hall state code, with each bit corresponding to the state of H1, H2, and H3 in the current sampling cycle. This state combination serves as the core input to the system's six-step commutation control logic. Under normal circumstances, the six legal Hall states correspond to six commutation phases, the order of which depends on the direction of rotor rotation. After the virtual signal replaces the failed channel and is logically combined with the healthy channel signal, the system switches the motor's power bridge legs on and off based on the current state code, driving each phase winding to alternately conduct in sequence. This control process adheres to the conduction rules of the six-step commutation table, such as when a specific state corresponds to the upper bridge leg being energized and the lower bridge leg being disconnected. This creates a fault-tolerant commutation control sequence. However, when using virtual signals for commutation control, because the signals are generated by computation rather than directly acquired, their timing characteristics exhibit certain errors, manifesting as a phase offset between the reconstructed edge and the actual rotor position, causing the commutation timing to advance or lag behind the ideal electrical angle. To identify and correct this offset, the rotor position angle determined by the commutation control logic during the current cycle is compared with the ideal position angle. The former is obtained by mapping the Hall signal sequence, while the latter is derived from the theoretical commutation angle based on motor structural parameters, speed information from the previous cycle, and the control rhythm. The difference between the two is the position detection error for the current cycle. The positive and negative signs represent commutation advance or lag, respectively, and the magnitude reflects the degree of angle offset. Based on this position detection error, the system activates an adaptive current compensation algorithm, adjusting the amplitude of the current control command for the current cycle to correct for torque fluctuations caused by commutation deviation. This adjustment method establishes a mapping relationship between the error function and the current output. As the error increases, the current compensation coefficient is gradually increased, thereby increasing the excitation intensity or extending the excitation holding time, thereby compensating for the energy distribution imbalance caused by commutation inaccuracy. When constructing the adaptive compensation command, the system comprehensively considers factors such as the current load state, current response time, and power device conduction capability to ensure that the modulated current value operates within the system stability range. Because sudden changes in current commands can cause discontinuous excitation in the system, leading to motor vibration, increased noise, or current overshoot, such current compensation commands are mitigated using a gradual current regulation mechanism. This mechanism, designed as a current slope limiter or first-order low-pass smoothing module, limits the rate of current change per unit time, smoothly transitioning the compensation command into the execution path. This ensures that the current output curve remains continuous in time and does not experience sharp changes in boundary regions, thereby integrating the current modulation process with the commutation control timing. The system outputs the control signal, which undergoes error feedback modulation, gradual current regulation, and smooth synthesis, as the torque control command for the current cycle to the inverter drive circuit, driving each power switch to conduct accordingly, achieving dynamic control of the stator winding current waveform and timing.
[0039] In one example, based on the commutation control signal group, the conduction state of the motor power switch tube is controlled and adjusted according to the six-step commutation timing logic to obtain a fault-tolerant commutation control timing, including: A six-step commutation logic mapping table is established based on the commutation control signal group, and each Hall state combination is mapped to a specific power switch conduction mode to obtain a commutation state mapping relationship; The six power switch tubes of the upper bridge arm and the lower bridge arm are arranged in a conduction sequence based on the commutation state mapping relationship to generate a three-phase alternating conduction power switch conduction timing table; Insert a dead time interval during the adjacent conduction state transition process of the power switch conduction timing table, and perform current limiting protection on the current mutation at the commutation moment to obtain a safe commutation timing control instruction; By monitoring the virtual Hall signal, the safe commutation timing control instruction is verified in real time to obtain the fault-tolerant commutation control timing.
[0040] In this example, when the system detects a certain path failure in the Hall signal, a virtual Hall signal is generated through a reconstruction algorithm, and together with the other two normal Hall signals, it forms a three-bit Hall state combination, which represents the current sensor determination output at the electrical angle. Based on this set of combination signals, the system establishes a six-step commutation logic mapping table according to the standard six-step commutation control principle. In this mapping table, each Hall state combination (such as 001, 011, 010, 110, 100, 101) corresponds to a unique power switch conduction mode, which determines which pair of phase windings needs to be energized, which pair of power devices should be in the on state, and which group needs to remain off. This mapping relationship embodies the correspondence principle between winding current direction and Hall state, ensuring that the stator excitation direction and the relative position of the rotor magnetic pole always remain in phase during commutation, thereby forming a continuous electromagnetic torque output. Based on the commutation state mapping relationship, the conduction sequence of the six power switches (corresponding to the upper and lower bridge arms of the A, B, and C phases in the three-phase motor) is arranged to form a power switch conduction timing table covering a complete electrical cycle. This timing table defines which pair of bridge arms is energized and which pair is off at each commutation step, forming a conduction path where current flows from one phase and out of another, while the remaining phase is in a suspended state, creating a typical "two-conducting-one-suspended" conduction structure. In the six-step commutation logic, this conduction state changes every 60 electrical degrees, i.e., each time the Hall state legally jumps, the conduction tube pair also switches. Through the alternating conduction control strategy, a rotating magnetic field is formed in the stator windings, pushing the rotor to move continuously. To ensure that no damage occurs during the conduction switching process due to bridge arm short circuit or current surge, the system inserts a dead time at the boundary stage of the two conduction state switching. This dead time, which is a few microseconds, is a gap period after the closing of the previous conduction device and before the opening of the next conduction device, used to avoid cross conduction of the upper and lower bridge arms at the switching instant, thereby preventing instantaneous short circuit of the DC bus. The system uses hardware timers combined with PWM edge synchronization logic to control this dead time, and dynamically adjusts it through software parameters to adapt to different power device shutdown speeds. At the same time, due to the change of the winding magnetic field during commutation, the current will rise sharply, so the system introduces a current limiting protection mechanism, i.e., enabling current limiting judgment logic in the conduction switching window. If the current change slope exceeds the predetermined threshold, the system reduces the PWM duty cycle, limits the conduction width, or enables soft start strategy to suppress the current rise rate, effectively preventing MOS tube or IGBT damage due to overcurrent during commutation. To ensure the effectiveness of the compensation commutation behavior in the Hall fault-tolerant mode, a commutation state verification logic for the virtual Hall signal is introduced, i.e., after each commutation control signal input, the integrity of the three-bit state combination is judged and verified for consistency with the historical state.This verification process not only confirms whether the current commutation input conforms to the standard six-state set but also verifies that the commutation logic conforms to the recursive relationship of the previous state. For example, during forward rotation, the commutation sequence of 001 → 011 → 010 → 110 → 100 → 101 → 001 is strictly adhered to. If a significant deviation or jump between the virtual signal output and the expected logical state is detected, the system triggers the fault-tolerant verification logic to mark the current timing instruction and correct it by replacing it with the previous timing hold state, extending the current excitation period, and dynamically correcting the edge trigger point. This ensures that the control system maintains the consistency and safety of the overall commutation rhythm even under virtual signal input conditions. Through these steps, a set of safe commutation control instructions is output, covering the state changes of the upper and lower bridge arms at each stage, driving the power devices in a timing-controlled manner.
[0041] Reference Figure 2 , this embodiment provides a motor position detection system based on a Hall sensor, comprising: Acquisition unit 1, used to collect three standard Hall state signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor; Abnormality detection unit 2, used to perform state legitimacy inspection and timing abnormality detection on three-way standard Hall state signals, and identify abnormal state events and abnormal timing events; Verification and analysis unit 3, used to determine the location of the faulty Hall sensor based on the abnormal state event and the abnormal timing event; A phase compensation unit 4 is used to perform phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor, and reconstruct a virtual Hall signal of the faulty Hall sensor; The output unit 5 is used to combine the virtual Hall sensor signal with the normal Hall sensor signal to output the torque control instruction of the motor.
[0042] In this embodiment, for the specific implementation of each unit in the above system embodiment, please refer to the above method embodiment, which will not be repeated here.
[0043] The technical solution provided by the present invention utilizes a dual detection system consisting of a six-state logic table check and adjacent state transition time interval detection to simultaneously monitor Hall effect sensors in real time from both logical validity and temporal rationality perspectives, significantly improving the accuracy and comprehensiveness of fault detection. A three-sensor cross-validation matrix constructed based on a 120-degree phase difference geometric constraint allows precise identification of the specific faulty sensor location through state consistency scoring, avoiding the fuzzy judgment problem inherent in traditional methods. A reconstruction algorithm employing a logical exclusive-OR operation combined with dynamic phase compensation generates high-quality virtual Hall effect signals based on the remaining two functioning sensors, ensuring high consistency between the reconstructed and original signals. In single-sensor fault mode, the system maintains normal six-step commutation control using the reconstructed signal, while an adaptive torque compensation algorithm ensures that motor output performance is largely unaffected. Through hardware clock synchronization acquisition and high-frequency signal processing, the system completes fault detection and signal reconstruction within milliseconds, meeting the real-time requirements of motor control. Dynamic adjustment of detection thresholds and compensation parameters based on the motor's operating state enables the system to adapt to varying speed and load conditions. Progressive current regulation and smooth fusion processing during fault mode switching effectively mitigate the impact of sudden torque changes on the motor and transmission system.
[0044] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, system, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, system, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, system, article, or method comprising the element.
[0045] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A motor position detection method based on a Hall sensor, characterized in that: include: Collecting three standard Hall state signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor; Performing state legitimacy inspection and timing anomaly detection on the three standard Hall state signals to identify state anomaly events and timing anomaly events; Determine the position of the faulty Hall sensor according to the abnormal state event and the abnormal timing event; Performing phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor to reconstruct a virtual Hall signal of the faulty Hall sensor; The virtual Hall signal is combined with a normal Hall sensor signal to output a torque control instruction.
2. The motor position detection method based on the Hall sensor according to claim 1, characterized in that: The method of collecting three standard Hall state signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor includes: Perform hardware clock synchronization acquisition on the first Hall sensor, the second Hall sensor, and the third Hall sensor of the motor to obtain three original Hall signals; Performing digital filtering on the three original Hall signals using a second-order low-pass filter to obtain three filtered Hall signals; Amplitude normalization processing is performed on the three-channel filtered Hall signals based on a high-level threshold and a low-level threshold to obtain three-channel standard Hall state signals.
3. The motor position detection method based on a Hall sensor according to claim 1, characterized in that: The performing of state legitimacy inspection and timing anomaly detection on the three standard Hall state signals to identify state anomaly events and timing anomaly events includes: Establish a standard six-state logic table containing 001, 010, 011, 100, 101, and 110, and define the 000 state and 111 state as invalid Hall states; Performing a match check between the current state combination of the three standard Hall state signals and the standard six-state logic table to identify a logic invalid state event; According to the state transition sequence when the motor rotates forward and the reverse transition sequence when the motor rotates reversely, the state transition of the three standard Hall state signals is sequence-validated to identify abnormal jump transition events; Continuously counting the logic invalid state event and the jump conversion abnormal event through an abnormal state counter to generate an abnormal state warning signal; Performing statistical calculations on the effective state ratios of the three standard Hall state signals, and determining a state abnormality event in combination with the abnormal state warning signal when the effective state ratio is lower than a preset percentage; The state transition time interval is calculated and timing anomaly detection is performed on the three standard Hall state signals to identify timing anomaly events.
4. The motor position detection method based on a Hall sensor according to claim 3, characterized in that: The calculating of the state transition time interval and performing timing anomaly detection on the three standard Hall state signals to identify timing anomaly events include: By recording the timestamps of two adjacent valid state transitions in the three standard Hall state signals, a state transition time interval is calculated; Calculating the current speed of the motor in real time according to the state transition time interval to obtain the current speed, and calculating a theoretical expected time interval based on the current speed; The theoretical expected time interval is multiplied by the dynamic coefficient and then added with the fixed compensation time to calculate the timing anomaly determination threshold; Compare the deviation value between the state transition time interval and the theoretical expected time interval with the timing anomaly determination threshold, identify timeout anomaly events or early anomaly events, and perform statistical analysis on the timeout anomaly events and early anomaly events of multiple state transitions to determine timing anomaly events.
5. The motor position detection method based on Hall sensor according to claim 1, characterized in that: The determining of the position of the faulty Hall sensor according to the abnormal state event and the abnormal timing event includes: Based on the phase difference geometric constraint relationship, a three-Hall sensor state cross-validation matrix is constructed for the first Hall sensor, the second Hall sensor, and the third Hall sensor to obtain a phase compensation calculation model; When each of the first Hall sensor, the second Hall sensor, and the third Hall sensor fails, the corresponding theoretical Hall state is calculated using the phase compensation calculation model and the states of the remaining two Hall sensors to obtain three sets of fault candidate verification results; Compare and calculate the theoretical Hall states in the three groups of fault candidate verification results with the actually detected Hall states to obtain a state consistency score corresponding to each Hall sensor; Performing faulty Hall sensor determination analysis based on the state consistency score, determining that the Hall sensor is a candidate faulty Hall sensor when the state consistency score of any Hall sensor is lower than a first threshold and the state consistency scores of the remaining two Hall sensors are both higher than a second threshold; By analyzing the abnormal patterns of the candidate faulty Hall sensors, the fault types are classified into signal stuck fault, output drift fault and instantaneous disconnection fault, and the confirmed faulty Hall sensors are logically isolated to obtain the position of the faulty Hall sensors.
6. The motor position detection method based on a Hall sensor according to claim 1, characterized in that: The phase compensation of the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor to reconstruct a virtual Hall signal of the faulty Hall sensor includes: Determine the remaining two normal Hall sensors according to the position of the faulty Hall sensor, and combine the signals of the remaining two normal Hall sensors using a logical exclusive OR operation to obtain a basic reconstructed signal; By analyzing the state conversion timing of the remaining two normal Hall sensors, the current electrical angle position and instantaneous speed of the motor rotor are calculated in real time to obtain the rotor position parameter and the speed parameter; Calculating a target phase compensation offset according to the rotor position parameter, the speed parameter, and the position of the faulty Hall sensor, and performing a logical exclusive OR operation on the target phase compensation offset and the basic reconstruction signal to obtain a compensated Hall signal; The compensating Hall signal is verified to match the historical normal state. When the matching degree exceeds the preset value, the reconstruction is confirmed to be successful. The compensating Hall signal confirmed to be successfully reconstructed is smoothed using a three-point smoothing filter to obtain a virtual Hall signal of the faulty Hall sensor.
7. The motor position detection method based on a Hall sensor according to claim 6, characterized in that: The step of calculating a target phase compensation offset according to the rotor position parameter, the speed parameter, and the position of the faulty Hall sensor, and performing a logical exclusive OR operation on the target phase compensation offset and the basic reconstruction signal to obtain a compensated Hall signal includes: Determining a physical position identifier of the faulty Hall sensor in a 120-degree phase arrangement according to the position of the faulty Hall sensor, and calculating a phase compensation reference angle relative to the remaining two normal Hall sensors based on the physical position identifier to obtain a reference phase offset; Analyzing the phase delay characteristics of the motor in a current operating state using the rotor position parameter and the speed parameter to obtain a dynamic phase delay correction value; Performing a weighted combination of the reference phase offset and the dynamic phase delay correction to obtain a target phase compensation offset; The target phase compensation offset is converted into a corresponding logic level state and then subjected to a logic exclusive OR operation with the basic reconstruction signal to obtain a compensated Hall signal.
8. The motor position detection method based on a Hall sensor according to claim 1, characterized in that: The method of combining the virtual Hall sensor signal with the normal Hall sensor signal to output a torque control instruction includes: The virtual Hall signal of the faulty Hall sensor is logically combined with the signals of the remaining two normal Hall sensors to obtain a commutation control signal group in a fault-tolerant operation mode; Based on the commutation control signal group, the conduction state of the motor power switch tube is controlled and adjusted according to the six-step commutation timing logic to obtain a fault-tolerant commutation control timing; By comparing the deviation between the rotor position angle of the signal and the theoretical expected position angle, a position detection error of the motor is obtained, and error compensation is performed on the normal operating current instruction according to the position detection error to obtain an adaptive current compensation instruction; The adaptive current compensation instruction is smoothly integrated with the fault-tolerant commutation control timing by adopting a progressive current regulation method to obtain a torque control instruction.
9. The motor position detection method based on a Hall sensor according to claim 8, characterized in that: The control of adjusting the conduction state of the motor power switch tube according to the six-step commutation timing logic based on the commutation control signal group to obtain a fault-tolerant commutation control timing includes: Establishing a six-step commutation logic mapping table according to the commutation control signal group, and mapping each Hall state combination to a specific power switch tube conduction mode to obtain a commutation state mapping relationship; Arranging the turn-on sequence of the six power switch tubes of the upper bridge arm and the lower bridge arm based on the commutation state mapping relationship to generate a turn-on timing table of the power switches of the three-phase alternating conduction; Inserting a dead time interval during the adjacent conduction state transition process of the power switch conduction timing table, and performing current limiting protection on the current mutation at the commutation moment to obtain a safe commutation timing control instruction; The safe commutation timing control instruction is verified in real time by monitoring the virtual Hall signal to obtain a fault-tolerant commutation control timing.
10. A motor position detection system based on a Hall sensor, characterized in that: The steps for implementing the motor position detection method based on a Hall sensor as described in any one of claims 1 to 9 include: An acquisition unit, used for acquiring three standard Hall state signals of a first Hall sensor, a second Hall sensor, and a third Hall sensor in the motor; An anomaly detection unit, configured to perform state legitimacy inspection and timing anomaly detection on the three standard Hall state signals, and identify state anomaly events and timing anomaly events; A verification and analysis unit, configured to determine a location of a faulty Hall sensor based on the abnormal state event and the abnormal timing event; a phase compensation unit, configured to perform phase compensation on the remaining two normal Hall sensor signals based on the position of the faulty Hall sensor, and reconstruct a virtual Hall signal of the faulty Hall sensor; The output unit is used to combine the virtual Hall signal with a normal Hall sensor signal to output a torque control instruction.
Citation Information
Patent Citations
Hall position sensor fault emergency method
CN103414433A
Brushless DC motor driving system with conductive ring fault tolerance function
CN107241035A
Electric motor control device and electric power steering device
CN111295832A
Hall fault judgment method and system for one-way rotation control of motor
CN112468027A
Motor control device, control method and gate system
CN114884423A