Motor position detection method and system based on hall sensors
By performing state validity and timing anomaly detection on the three Hall sensor signals of the brushless DC motor of the electric scooter, faulty sensors are identified and virtual signals are generated, solving the problem of Hall sensor failure in complex environments and realizing stable operation and safe control of the motor.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INMOTION TECH CO LTD
- Filing Date
- 2025-08-07
- Publication Date
- 2026-06-19
AI Technical Summary
In complex environments, the Hall sensor of the brushless DC motor of electric scooter is prone to faults such as signal jamming, output drift, and momentary disconnection, which can lead to commutation timing disorder, affect the normal operation of the motor and threaten user safety.
By acquiring signals from three Hall sensors, the system performs state validity checks and timing anomaly detection, identifies the location of faulty sensors, generates virtual Hall signals based on the remaining normal sensors, reconstructs the signals using a phase compensation algorithm, and outputs torque control commands to achieve fault-tolerant commutation control.
It significantly improves the accuracy and comprehensiveness of fault detection, ensuring that the motor can still operate normally under single sensor failure, avoiding the impact of sudden torque changes on the motor and transmission system, and meeting real-time control requirements.
Smart Images

Figure CN120768166B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor position detection technology, and in particular to a motor position detection method and system based on a Hall sensor. Background Technology
[0002] Electric scooters typically use brushless DC motors with three Hall effect sensors arranged with a 120-degree phase difference for six-step commutation control, determining the commutation sequence by detecting the rotor magnetic pole position. However, electric scooters face complex and variable working environments in actual use, including frequent start-stop operations, road vibrations, temperature cycles, and electromagnetic interference.
[0003] In such a complex environment, Hall sensors are prone to various failure modes, including signal jamming, output drift, and momentary disconnection. These failures can directly lead to commutation timing disorder, and in severe cases, even cause motor stall, which not only affects the normal operation of electric scooters, but may also threaten the user's riding safety. Summary of the Invention
[0004] The main objective of this invention is to provide a motor position detection method and system based on Hall sensors. This 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 objectives, the present invention provides a motor position detection method based on a Hall sensor, comprising the following steps:
[0006] Acquire the three standard Hall status signals from the first Hall sensor, the second Hall sensor, and the third Hall sensor in the motor;
[0007] The three standard Hall state signals are subjected to state validity verification and timing anomaly detection to identify state anomaly events and timing anomaly events;
[0008] The location of the faulty Hall sensor is determined based on the state anomaly event and the timing anomaly event.
[0009] Based on the location of the faulty Hall sensor, phase compensation is performed on the signals of the remaining two normal Hall sensors to reconstruct the virtual Hall signal of the faulty Hall sensor.
[0010] The virtual Hall signal is combined with the normal Hall sensor signal to output torque control commands.
[0011] Optionally, in a first implementation of the first aspect of the present invention, the acquisition of the three standard Hall state signals from the first Hall sensor, the second Hall sensor, and the third Hall sensor in the motor includes:
[0012] Hardware clock synchronization is performed on the first Hall sensor, second Hall sensor and third Hall sensor of the motor to obtain three raw Hall signals;
[0013] The three original Hall signals are digitally filtered using a second-order low-pass filter to obtain three filtered Hall signals.
[0014] The amplitude of the three filtered Hall signals is normalized based on high-level and low-level thresholds to obtain three standard Hall state signals.
[0015] Optionally, in a second implementation of the first aspect of the present invention, the step of performing state validity verification and timing anomaly detection on the three standard Hall state signals to identify state anomaly events and timing anomaly events includes:
[0016] Establish a standard six-state logic table containing 001, 010, 011, 100, 101, and 110, and define the 000 state and the 111 state as invalid Hall states;
[0017] The current state combination of the three standard Hall state signals is matched and verified with the standard six-state logic table to identify logically invalid state events;
[0018] Based on the state transition sequence when the motor rotates forward and the reverse transition sequence when it rotates backward, the state transition of the three standard Hall state signals is verified for sequence legality, and jump transition abnormal events are identified.
[0019] The logical invalid state events and the jump transition abnormal events are continuously counted and statistically analyzed by an abnormal state counter to generate an abnormal state warning signal.
[0020] The effective state percentage of the three standard Hall state signals is statistically calculated. When the effective state percentage is lower than a preset percentage, an abnormal state event is determined by combining the abnormal state warning signal.
[0021] 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.
[0022] Optionally, in a third implementation of the first aspect of the present invention, the calculation of the state transition time interval and the timing anomaly detection of the three standard Hall state signals to identify timing anomaly events include:
[0023] The state transition time interval is calculated by recording the timestamps of two consecutive valid state transitions in the three standard Hall state signals.
[0024] The current speed of the motor is calculated in real time based on the state transition time interval to obtain the current speed, and the theoretical expected time interval is calculated based on the current speed.
[0025] The time series anomaly detection threshold is calculated by multiplying the theoretical expected time interval by the dynamic coefficient and adding the fixed compensation time.
[0026] By comparing the deviation between the state transition time interval and the theoretical expected time interval with the timing anomaly determination threshold, timeout anomaly events or premature anomaly events are identified, and statistical analysis is performed on the timeout anomaly events and premature anomaly events of multiple state transitions to determine the timing anomaly events.
[0027] Optionally, in a fourth implementation of the first aspect of the present invention, determining the location of the faulty Hall sensor based on the state anomaly event and the timing anomaly event includes:
[0028] 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 the phase compensation calculation model.
[0029] 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.
[0030] 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 for each Hall sensor.
[0031] Based on the state consistency score, the fault Hall sensor is determined and analyzed. When the state consistency score of any Hall sensor is lower than the first threshold and the state consistency scores of the other two Hall sensors are higher than the second threshold, the Hall sensor is determined to be a candidate fault Hall sensor.
[0032] By analyzing the abnormal patterns of the candidate faulty Hall sensors, the fault types are classified into signal jamming faults, output drift faults, and momentary disconnection faults. The confirmed faulty Hall sensors are then logically isolated to obtain the location of the faulty Hall sensors.
[0033] Optionally, in a fifth implementation of the first aspect of the present invention, the step of performing phase compensation on the signals of the remaining two normal Hall sensors based on the location of the faulty Hall sensor to reconstruct the virtual Hall signal of the faulty Hall sensor includes:
[0034] Based on the location of the faulty Hall sensor, the remaining two normal Hall sensors are determined, and the signals of the remaining two normal Hall sensors are combined using a logical XOR operation to obtain the basic reconstructed signal.
[0035] By analyzing the state transition 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 parameters and speed parameters.
[0036] The target phase compensation offset is calculated based on the rotor position parameters, the speed parameters, and the fault Hall sensor position. The target phase compensation offset is then XORed with the basic reconstruction signal to obtain the compensation Hall signal.
[0037] The matching degree of the compensated Hall signal with the historical normal state is verified. When the matching degree exceeds the preset value, the reconstruction is confirmed to be successful. A three-point smoothing filter is used to smooth the confirmed reconstructed compensated Hall signal to obtain the virtual Hall signal of the faulty Hall sensor.
[0038] Optionally, in a sixth implementation of the first aspect of the present invention, the step of calculating the target phase compensation offset based on the rotor position parameters, the rotational speed parameters, and the fault Hall sensor position, and performing a logical XOR operation between the target phase compensation offset and the basic reconstruction signal to obtain the compensation Hall signal, includes:
[0039] The physical position identifier of the faulty Hall sensor in the 120-degree phase arrangement is determined based on the position of the faulty Hall sensor, and the phase compensation reference angle relative to the remaining two normal Hall sensors is calculated based on the physical position identifier to obtain the reference phase offset.
[0040] The phase delay characteristics of the motor under the current operating state are analyzed using the rotor position parameters and the speed parameters to obtain the dynamic phase delay correction amount;
[0041] The target phase compensation offset is obtained by weighting and combining the reference phase offset with the dynamic phase delay correction.
[0042] After converting the target phase compensation offset into the corresponding logic level state, a logical XOR operation is performed with the basic reconstruction signal to obtain the compensation Hall signal.
[0043] Optionally, in a seventh implementation of the first aspect of the present invention, the step of combining the virtual Hall signal with the normal Hall sensor signal to output a torque control command includes:
[0044] The virtual Hall signal of the faulty Hall sensor is logically combined with the signals of the remaining two normal Hall sensors to obtain the commutation control signal group in the fault-tolerant operation mode.
[0045] Based on the commutation control signal group, the conduction state of the motor power switch is controlled and adjusted according to the six-step commutation timing logic to obtain the fault-tolerant commutation control timing.
[0046] The position detection error of the motor is obtained by comparing the deviation between the rotor position angle of the signal and the theoretical expected position angle. The position detection error is then used to compensate for the error in the normal operating current command to obtain an adaptive current compensation command.
[0047] A gradual current regulation method is used to smoothly integrate the adaptive current compensation command with the fault-tolerant commutation control timing to obtain the torque control command.
[0048] Optionally, in an eighth implementation of the first aspect of the present invention, the step of controlling and adjusting the conduction state of the motor power switch transistor based on the commutation control signal group according to a six-step commutation timing logic to obtain a fault-tolerant commutation control timing includes:
[0049] 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 the commutation state mapping relationship.
[0050] Based on the commutation state mapping relationship, the conduction sequence of the six power switches of the upper and lower bridge arms is arranged to generate a three-phase alternating conduction power switch conduction timing table.
[0051] A dead time interval is inserted during the transition between adjacent conduction states in the power switch conduction timing table, and current limiting protection is provided for the sudden current change at the moment of commutation to obtain a safe commutation timing control command.
[0052] By monitoring the virtual Hall signal, the safe commutation timing control command is verified in real time to obtain the fault-tolerant commutation control timing.
[0053] The present invention also provides a motor position detection system based on a Hall sensor, comprising:
[0054] The acquisition unit is used to acquire the three standard Hall status signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor;
[0055] An anomaly detection unit is used to perform state validity verification and timing anomaly detection on the three standard Hall state signals, and to identify state anomaly events and timing anomaly events.
[0056] The verification and analysis unit is used to determine the location of the faulty Hall sensor based on the abnormal state event and the abnormal timing event.
[0057] A phase compensation unit is used to perform phase compensation on the signals of the remaining two normal Hall sensors based on the location of the faulty Hall sensor, and reconstruct the virtual Hall signal of the faulty Hall sensor.
[0058] The output unit is used to combine the virtual Hall signal with the normal Hall sensor signal to output a torque control command.
[0059] In summary, the technical solution provided by this invention, through the establishment of a dual detection system of six-state logic table verification and adjacent state transition time interval detection, can simultaneously monitor Hall sensors in real time from both logical validity and timing rationality dimensions, significantly improving the accuracy and comprehensiveness of fault detection. The three-sensor cross-validation matrix constructed based on the 120-degree phase difference geometric constraint relationship can accurately identify the specific faulty sensor location through state consistency scoring, avoiding the fuzzy judgment problem in traditional methods. The reconstruction algorithm, employing logical XOR operation combined with dynamic phase compensation, 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. In single-sensor fault mode, the system can maintain normal six-step commutation control using the reconstructed signal, and ensure that the motor output performance is largely unaffected through an adaptive torque compensation algorithm. Through hardware clock synchronous acquisition and high-frequency signal processing, the system can complete fault detection and signal reconstruction within milliseconds, meeting the real-time requirements of motor control. Dynamically adjusting the detection threshold and compensation parameters according to the motor operating status 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 sudden torque changes on the motor and transmission system. Attached Figure Description
[0060] Figure 1 This 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;
[0061] Figure 2 This is a block diagram of a motor position detection system based on a Hall sensor according to an embodiment of the present invention.
[0062] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this invention clearer, the 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 merely illustrative and not intended to limit the invention.
[0064] Reference Figure 1 This embodiment provides a motor position detection method based on a Hall sensor, including the following steps:
[0065] S1, collects the three standard Hall status signals from the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor;
[0066] The system employs a sampling architecture based on a unified hardware master clock within the motor controller. By using a unified clock-driven sampling circuit, the outputs of the first, second, and third Hall sensors are sampled in parallel. A hardware phase-locked loop (PLL) mechanism is used to control the timestamp error of the three channels to within 1μs, effectively avoiding misjudgments of state combinations caused by signal acquisition time offsets. In practical engineering applications, this sampling process is set to a high-frequency rate of 50kHz to ensure sufficient Hall data points are acquired in each electrical cycle, even under high-dynamic conditions where the motor speed exceeds 3000rpm. To eliminate high-frequency interference noise mixed into the original Hall signal, a second-order low-pass filtering algorithm based on digital signal processing principles is introduced, with the filter cutoff frequency set to 2kHz. This allows for the filtering of high-frequency noise signals such as road vibration, electromagnetic induction disturbances, and environmental electrical noise, while maintaining the fundamental frequency Hall state change characteristics required for the six-step commutation of the BLDC motor. This enhances the system's ability to suppress signal interference and improves the accuracy of commutation triggering. After this digital filtering process, the obtained three Hall signal waveforms tend to be more stable in amplitude, with clearer edge transitions, exhibiting good amplitude dynamic characteristics and response consistency. Amplitude standardization processing is then performed on the three filtered Hall signals 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 higher than 3.5V are uniformly mapped to logic "1", signals lower than 1.5V are mapped to logic "0", and the uncertain region between 1.5V and 3.5V is marked as invalid to prevent misjudgment, thus obtaining three standard Hall state signals.
[0067] S2 performs state validity verification and timing anomaly detection on the three standard Hall state signals to identify state anomaly events and timing anomaly events;
[0068] Specifically, a six-state logic table based on the 120-degree phase distribution principle of a three-phase BLDC motor is established. H∈{001, 010, 011, 100, 101, 110} is defined as the standard valid state combination. 000 and 111 are explicitly defined as logically impossible invalid states, used to identify extreme cases where Hall signals simultaneously fail or simultaneously conduct. During motor operation, the level combination of the three standard Hall state signals in each sampling cycle is converted into a three-bit binary form and matched against the six-state logic table in real time. States not belonging to the standard set are identified through logical rules, thereby detecting logically invalid state events and marking them as potential fault symptoms. While ensuring the validity of the current state itself, the sequence validity of the state transition process is verified. Based on the standard commutation sequence of the motor in the forward direction (001→011→010→110→100→101→001) and the reverse sequence path in the reverse direction, the transition path between consecutive state combinations is tracked in real time. If a state jump is detected, such as jumping directly from 001 to 010 or from 110 to 011, it indicates that a valid intermediate transition is missing between states, constituting a jump transition anomaly. To enhance the statistical robustness of anomaly identification, an anomaly state counter is introduced to continuously count invalid logical states and jump transition anomalies. When the anomaly continuously exceeds a set threshold (e.g., occurring consecutively within three cycles), an anomaly state warning signal is immediately output, triggering the next-level fault-tolerant logic preparation. Based on the above logical analysis, the stability and reliability of the overall signal are evaluated from a statistical perspective. A valid state percentage statistical mechanism is designed to calculate the percentage of valid states among the three Hall signals within a unit time window (e.g., 100ms). When this percentage is lower than a preset threshold (e.g., 85%) and accompanied by an anomaly state warning signal, it is confirmed as a state anomaly event and used to define it as a systemic sensor fault symptom. Real-time calculation of the transition time interval T between adjacent states i and the interval T between the desired states e A comparison is made. The expected interval is dynamically adjusted based on the rotational speed, i.e., T = 60 / (6 × RPM), where RPM is estimated from the Hall signal frequency. If |T is found... i -T e |Exceeding the tolerance threshold ε=0.3×T e +2ms indicates either an early or late timing anomaly. Through the coordinated implementation of logic consistency verification and timing deviation detection, complex fault conditions such as signal short circuits, poor contact, misalignment caused by interference, and sensor response lag can be identified.
[0069] S3, determine the location of the faulty Hall sensor based on abnormal status events and abnormal timing events;
[0070] It should be noted that the logical dependency between Hall states is constructed based on the fixed 120-degree electrical phase difference between the three-phase windings of the brushless DC motor. Based on the spatial arrangement characteristics of Hall sensors H1, H2, and H3 symmetrically distributed along the rotor circumference, a Hall state cross-validation matrix is formed. This matrix is used to deduce the theoretical state of the third channel for any combination of state signals output from any two Hall channels, under known electrical angles and commutation sequences, thus establishing a phase compensation calculation model. When the detection system identifies an abnormal state event or timing abnormal event in the preceding steps, the cross-validation mechanism is triggered. H1, H2, or H3 are assumed to be fault channels in sequence. Under each assumption, the actual states observed by the remaining two Hall channels are input into the phase compensation model to derive the theoretical state of the third Hall signal. This theoretical state serves as one of the fault candidate verification results, and its consistency is evaluated by comparing it with the actual observation value of the channel within the current sampling period. Through multi-cycle comparison operations within a continuous sampling window, a state consistency score is obtained for each Hall channel under the assumed fault condition, thus forming a state consistency score set. Each score represents the degree of consistency between the channel and the expected geometric behavior within the current operating segment, providing a quantitative indication of the degree of anomaly. Fault judgment logic analysis is performed based on the state consistency scores. If the state consistency score of a Hall channel is lower than a preset first threshold (e.g., 0.7), while the scores of the other two channels are higher than a second threshold (e.g., 0.9), then that channel is identified as a candidate faulty Hall sensor for the current cycle. To clarify the nature of the fault, fault types are classified based on the candidate channel's historical state records and abnormal behavior patterns: if the channel's output level remains unchanged for multiple consecutive cycles and is maintained at a logic high or low level for a long period, it is identified as a "signal jamming" fault; if its state switching exhibits a regular delay rather than a jump, it is classified as an "output drift" fault; if its output intermittently fails or displays an invalid value of 000 / 111 during random cycles, it is determined to be a "momentary disconnection" fault. After determining the fault type, the faulty Hall sensor channel is isolated from the logic control path, meaning its input signal is blocked during control algorithm execution. The faulty Hall sensor location, fault type, and occurrence time, obtained through cross-validation, are simultaneously recorded in the fault diagnosis results.
[0071] S4. Based on the location of the faulty Hall sensor, phase compensation is performed on the signals of the remaining two normal Hall sensors to reconstruct the virtual Hall signal of the faulty Hall sensor.
[0072] Specifically, based on the confirmed location of the faulty Hall sensor, such as H1 fault, H2 and H3 are automatically identified as normal channels within the current cycle. The current state values of H2 and H3 are combined using a logical XOR operation to obtain 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. Since the motor's operating state changes dynamically, a simple logical XOR operation cannot completely and accurately reconstruct the commutation rhythm of the faulty channel. Therefore, by analyzing the state transition sequence between H2 and H3 in real time, the current electrical angle position and instantaneous speed of the motor rotor are estimated. This estimation process relies on the time interval between the previous state transition moment and the current state transition moment, as well as the known standard six-step commutation cycle. By differentiating the Hall state edge trigger time, a precise speed value is calculated, and combined with the state sequence, the current rotor angle position is reconstructed, establishing a time-position function describing the evolution law 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 the target phase compensation offset. This compensation is used to correct the phase lag or lead behavior between the basic reconstructed signal and the actual Hall channel under the current speed and angle conditions. The target phase compensation offset is then XORed with the basic reconstructed signal in logical encoding form to obtain the compensated Hall signal. To ensure sufficient reliability of the reconstruction result, the compensated Hall signal is compared with the historical normal Hall state trajectory stored before the fault occurred. A sliding window comparison method is used to evaluate the similarity level. When the matching degree 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 instantaneous jumps, a three-point smoothing filter is applied to the confirmed compensated Hall signal. This involves replacing the original value with the current value and the signal average of the two preceding and following moments, thereby generating a final virtual Hall signal with gradual variation characteristics, clean edges, and good continuity.
[0073] S5 uses a combination of virtual Hall effect signals and normal Hall effect sensor signals to output torque control commands for the motor.
[0074] In this process, the virtual Hall signal from the faulty Hall sensor is logically combined with the signals from the two remaining normal Hall channels to construct a three-bit standard format fault-tolerant Hall state input, arranged in 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 stage of the six-step commutation cycle of the motor. This commutation control signal group is input to the power switch drive module, which controls the conduction state of the upper and lower bridge arm power MOSFETs or IGBTs corresponding to each phase winding according to a preset six-step commutation timing table. This maintains the alternating energizing rhythm of the three-phase windings of the BLDC motor, ensuring the predictability of commutation events in the time domain and their logical integrity. Even if one of the three Hall channels is lost, the closed continuity of the drive control link can still be maintained, forming a fault-tolerant commutation control timing sequence that meets the commutation cycle requirements. During this process, the drive signals of all power devices are directly mapped from the current three-bit Hall combination to the commutation drive logic circuit. The system can enter the fault-tolerant commutation mode without interrupting operation or reducing speed. Since the reconstructed Hall signal is only an estimated value, it deviates from the actual rotor position due to factors such as speed disturbances, electrical angle deviations, and compensation errors. Therefore, an error compensation mechanism is introduced. The control algorithm continuously compares the difference between the rotor position angle derived from the virtual signal and the theoretical commutation reference angle of the motor to obtain the instantaneous position detection error. Based on this position error, the conventional current control command is adjusted to construct a current compensation function, which 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 the current waveform distortion caused by commutation delay or advance and maintaining the motor torque output within the desired range. To avoid the adverse effects of sudden system excitation changes caused by current compensation on drive stability, a gradual adjustment mechanism is introduced into the current control path. This involves using a slope limiter to confine the rate of change of the error compensation current within a smooth range, ensuring a smooth transition from the normal current command to the compensated current command without abrupt changes. 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, preventing vibration, noise, or drive instability caused by current disturbances. The final output is the motor's torque control command, featuring angle estimation correction and dynamic current compensation capabilities based on a three-Hall dual-channel fault-tolerant architecture. This ensures normal motor drive and torque output even in the event of a Hall single-point fault, while simultaneously guaranteeing the vehicle's operational stability and safety.
[0075] In one example, three standard Hall state signals from the first Hall sensor, the second Hall sensor, and the third Hall sensor in the motor are acquired, including:
[0076] Hardware clock synchronization is performed on the first Hall sensor, second Hall sensor and third Hall sensor of the motor to obtain three raw Hall signals;
[0077] A second-order low-pass filter is used to digitally filter the three original Hall signals to obtain three filtered Hall signals.
[0078] The amplitude of the three filtered Hall signals is normalized based on high-level and low-level thresholds to obtain three standard Hall state signals.
[0079] In this example, at the system architecture level, a parallel access design is first implemented for the three Hall sensors located at a 120-degree electrical phase difference in the BLDC motor. A unified hardware master clock mechanism is deployed within the controller, using a high-precision crystal oscillator time base to uniformly schedule all sampling events, enabling full hardware-level synchronization of the three sampling operations. A sampling process for the three ADC or GPIO channels, uniformly triggered by a timer interrupt, is constructed in the microcontroller or digital signal processor. This, combined with on-chip clock synchronization logic, ensures that the timestamp error of each Hall signal acquisition is strictly controlled within 1 microsecond, effectively avoiding misjudgments of state combinations due to sampling timing deviations. Considering that the operating speed of small motor systems such as electric scooters varies between hundreds and thousands of revolutions per minute, corresponding to electrical cycles as short as milliseconds or sub-milliseconds, the sampling frequency is set at a sufficiently high level. 50kHz is chosen as the reference frequency to ensure that at the highest speed, at least 80 data points are collected per electrical cycle, fully covering the entire process of Hall edge state changes. Digital filtering is performed on the three signals to suppress high-frequency noise components introduced by factors such as electromagnetic interference, temperature fluctuations, or mechanical vibration. A second-order low-pass filter is selected for digital filtering. This filter significantly suppresses high-frequency interference beyond the cutoff frequency range while ensuring signal response speed. Considering that the typical commutation frequency of a BLDC motor is within several hundred hertz, and that that of an electric scooter does not exceed 2kHz under common operating conditions, the filter cutoff frequency is set to 2kHz. This eliminates most high-frequency harmonics, spike interference, and digital jitter effects without losing commutation information. In practical engineering, the filter is implemented in software using IIR form or by using a dedicated hardware filtering module in a DSP to ensure that no additional processing delay is introduced during real-time sampling and to maintain the phase continuity of the signal on the time axis. Through this step, three filtered Hall signals are obtained. The amplitude of the three filtered Hall signals is normalized based on high-level and low-level thresholds, uniformly mapping the analog signals to standard digital logic level signals. High and low level judgment thresholds are set to distinguish the upper and lower limits of the filtered signal amplitude, avoiding oscillations caused by level uncertainty during the slow transition phase of the Hall signal edge. The system sets a high-level threshold of 3.5V and a low-level threshold of 1.5V. That is, when the voltage value of a certain filtered signal is higher than 3.5V, the channel is determined to be logic "1"; when the voltage is lower than 1.5V, it is determined to be logic "0"; and the range between 1.5V and 3.5V is determined to be invalid, thus avoiding interference with the control logic during level fluctuations or signal transients. This amplitude determination process is completed by a comparator circuit or programmed logic, and the determination result is updated to the state buffer table in the controller. The three Hall signals are converted into standard logic state streams H1, H2, and H3, each representing the high or low level state of the sensor within the current sampling period with 0 or 1, and are kept consistent with the actual rotor movement on the time axis.
[0080] In one example, state validity verification and timing anomaly detection are performed on three standard Hall state signals to identify state anomaly events and timing anomaly events, including:
[0081] Establish a standard six-state logic table containing 001, 010, 011, 100, 101, and 110, and define the 000 state and the 111 state as invalid Hall states;
[0082] The current state combination of the three standard Hall state signals is matched and verified with the standard six-state logic table to identify the invalid logic state event;
[0083] Based on the state transition sequence when the motor rotates forward and the reverse transition sequence when it rotates backward, the legality of the state transition sequence of the three standard Hall state signals is verified, and abnormal jump transition events are identified.
[0084] An abnormal state early warning signal is generated by continuously counting and statistically analyzing logical invalid state events and jump transition abnormal events through an abnormal state counter.
[0085] The effective state percentage of the three standard Hall state signals is statistically calculated. When the effective state percentage is lower than the preset percentage, an abnormal state event is determined by combining the abnormal state warning signal.
[0086] 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.
[0087] In this example, based on the 120-degree electrical angle distribution characteristics of the three-phase windings of a brushless DC motor (BLDC), a standard six-state logic table for Hall states is established. This table specifies that only six combinations of three-bit Hall signals are allowed: 001, 010, 011, 100, 101, and 110, corresponding to the six effective electrical angle segments within the six-step commutation cycle of the motor. All other combinations, including 000 and 111, are defined as logically invalid states because all three Hall signals are either all low or all high, which does not conform to the normal electrical angle distribution pattern. During motor operation, the system samples the current three Hall signals in real time and combines them into a three-bit binary code. This code is then matched and verified against the standard six-state logic table. When a combination is found not to belong to the six-state set, the sampling period is marked as a logically invalid state event and included in the raw data stream of the anomaly detection module. To investigate anomalies in the Hall signals at the state transition level, the continuous Hall state changes between sampling periods are time-tracked. Based on the standard state transition sequence during normal forward rotation of the motor, i.e., 001→011→010→110→100→101→001, the system compares each state transition with the previous state. If a state does not transition from the previous state along the standard path but instead skips a stage (e.g., jumping directly from 001 to 010 or from 100 to 001), it is marked as a jump transition anomaly. Similarly, in the reverse state of the motor, the reverse of the above sequence is used as the basis for legal judgment. Such anomalies are mostly caused by asynchronous Hall signal acquisition, level fluctuations, or signal interruptions. If not identified in time, they can lead to premature or delayed commutation, which in turn can cause motor vibration, overcurrent, or even loss of synchronization. To improve the system's response capability to occasional or continuous faults, an abnormal state counter mechanism is embedded in the detection logic. The system counts logical invalid state events and jump transition anomaly events that occur within a continuous time window. When the cumulative number of any type of anomaly exceeds a set threshold (e.g., more than 3 consecutive occurrences) in a continuous sampling period, an abnormal state warning signal is triggered. Simultaneously, the system incorporates statistical analysis methods during abnormal state identification, establishing a valid state percentage evaluation mechanism based on a time window. Within each 100ms sliding time interval, the system calculates the proportion of valid states belonging to the standard six states across all sampling periods. When this proportion consistently falls below a preset threshold (e.g., 85%) and a warning signal has been triggered, it determines that the current three Hall signals exhibit a decreasing or gradually deteriorating stability trend, formally confirming an abnormal state event. This confirmation information is then provided to the fault diagnosis module for fault location identification and type classification. Beyond logic and state-level verification, the system dynamically monitors the timing characteristics of the Hall signals. Specifically, it records the timestamps of all valid state transitions and calculates the time interval between two consecutive valid states to obtain the state transition time interval.The system estimates the theoretically expected interval for state transitions based on the motor's current operating speed and identifies timing anomalies by comparing the deviation between the actual and theoretical intervals. If the current interval is significantly greater than the theoretical value, it is determined to be a timeout anomaly; if it is significantly less than the theoretical value, it is determined to be an premature anomaly. Since the state transition cycle of a BLDC motor has a natural floating characteristic during acceleration and deceleration, the system introduces an adaptive tolerance band mechanism to consider dynamic speed fluctuations and control delays. For example, the error tolerance is set to 30% of the current expected cycle plus a fixed delay compensation constant of 2ms, thereby avoiding misjudging real acceleration behavior as an anomaly.
[0088] In one example, 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, including:
[0089] The state transition time interval is calculated by recording the timestamps of two consecutive valid state transitions in the three standard Hall state signals.
[0090] The current speed of the motor is calculated in real time based on the state transition time interval to obtain the current speed, and the theoretical expected time interval is calculated based on the current speed.
[0091] The threshold for judging time series anomalies is calculated by multiplying the theoretical expected time interval by the dynamic coefficient and adding the fixed compensation time.
[0092] By comparing the deviation between the state transition time interval and the theoretical expected time interval with the timing anomaly judgment threshold, timeout anomaly events or premature anomaly events are identified. Statistical analysis is then performed on multiple timeout anomaly events and premature anomaly events of state transitions to determine the timing anomaly events.
[0093] In this example, three standard Hall effect state signals are continuously monitored, and the timestamp information of each valid state transition is recorded in real time. A valid state transition refers to the change of the three-dimensional Hall effect state combination from one valid combination to the next, such as from 001 to 011, or from 110 to 100. This transition must satisfy the logical continuity of the state transition within the six-step commutation sequence, while excluding invalid states such as 000 or 111, and spurious changes caused by illegal jumps. Whenever the system identifies such a valid state transition, the current system clock time is recorded as a key time point, and the difference between this and the previously recorded timestamp is used to calculate the actual time interval of this state transition. This interval value is the actual response cycle of the motor during that commutation step. The current motor speed is calculated in real time based on the state transition time interval. The basic basis for speed calculation is that each cycle contains six commutation steps; therefore, the number of transitions per unit time is used to infer the revolutions per minute. Based on continuous valid state changes, the system estimates the current speed value in real time and dynamically updates it to enable it to respond to acceleration and deceleration processes. Based on this, the system calculates the expected time interval that the theoretical state transition should follow according to the currently estimated speed value. This time interval represents the ideal time distance between each commutation step at the current operating speed. Its calculation model is based on the motor structural parameters and Hall effect pattern, and can be dynamically updated with changes in speed, providing a benchmark value for judging 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 acceleration characteristics and adding a fixed compensation time, a timing anomaly judgment threshold is formed. This threshold is calibrated in engineering based on comprehensive factors such as motor response delay, electronic control sampling error, and external disturbances, and includes a proportional adjustment factor and a time constant compensation term. After threshold construction is completed, each time the system detects a state change, it subtracts the actual state transition time interval from the theoretical expected time interval to obtain the current state transition deviation value, and compares it with the judgment threshold: when the deviation value is greater than the timing anomaly judgment threshold and the actual time interval is significantly longer than the theoretical value, it is identified as a timeout anomaly event, indicating slow motor response, Hall signal loss, or sensor output delay; when the deviation value is less than the threshold but the actual time interval is much shorter than the theoretical value, it is identified as an early anomaly event, caused by level jitter, missampling, or interference signals. All identified anomalies are recorded in the anomaly log buffer, along with metadata such as anomaly type, occurrence time, and state number. To avoid a single misjudgment of an anomaly causing the system to mistakenly enter the fault tolerance process, an anomaly statistical analysis mechanism is established. By performing frequency statistics and trend fitting on timeout anomalies and early anomalies in continuous state transitions within a certain window (e.g., the most recent 10 times), it is determined whether the current timing anomaly has persistent, gradual, or sudden characteristics.When a timeout or premature event occurs within a specified window, exceeding a set threshold (e.g., 15%), and the average deviation time is greater than 1.5ms, the system is determined to be in a timing anomaly state. This state is then reported to the main control logic for response, such as initiating fault location, virtual signal generation, or entering a power limiting mode. Furthermore, this evaluation mechanism further subdivides the anomaly mode: a continuously increasing deviation value indicates a gradual failure; a sudden change only in a few cycles indicates a sudden interference anomaly; and random occurrences across multiple discontinuous cycles indicate intermittent timing instability.
[0094] In one example, the location of the faulty Hall sensor is determined based on abnormal state events and abnormal timing events, including:
[0095] 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.
[0096] When each of the first, second, and third Hall sensors fails, the corresponding theoretical Hall state is calculated using the phase compensation calculation model and the states of the remaining two Hall sensors, resulting in three sets of fault candidate verification results.
[0097] 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 for each Hall sensor.
[0098] The fault Hall sensor is determined by analyzing the state consistency score. When the state consistency score of any Hall sensor is lower than the first threshold and the state consistency scores of the other two Hall sensors are higher than the second threshold, the Hall sensor is determined to be a candidate fault Hall sensor.
[0099] By analyzing the abnormal patterns of candidate faulty Hall sensors, the fault types are classified into signal jamming faults, output drift faults, and momentary disconnection faults. The confirmed faulty Hall sensors are then logically isolated to obtain the location of the faulty Hall sensors.
[0100] In this example, based on the spatial installation relationship between the three Hall sensors—that is, their uniform electrical phase distribution along the circumference of the motor stator at 120 degrees—the output state of each sensor can be theoretically derived from the states of the other two sensors and a predetermined phase offset rule. Based on this constraint, a cross-validation matrix of the three Hall sensor states is constructed, and a phase compensation calculation model is built around this matrix to reconstruct and infer the output state using the signals from the other two channels in the event of missing data from any one Hall sensor. This model maps the Hall state combinations to the current electrical angle interval through encoding logic, and performs spatial symmetry calculations based on this, forming a theoretical state generation mechanism. That is, for any two known Hall sensor states, the model can derive the target level state that the third Hall sensor should present under an ideal commutation sequence. After completing the model construction, the system sequentially assumes H1, H2, or H3 as the current fault channel, and under each assumption, uses real-time data from the remaining two normal channels as input to the phase compensation calculation model to generate the theoretical state of the third Hall channel, obtaining three sets of candidate state verification results. At this point, the system compares the theoretical state output by the model with the actual observation state of the channel by the current acquisition system cycle by cycle. Through point-by-point consistency judgment, the ratio between the cumulative number of successful matches and the total number of comparisons is used to form the state consistency score of the channel, which is used to quantify the degree of deviation between the actual signal and the geometric logic derivation result. Based on the state consistency score, fault Hall sensor judgment analysis is performed. Based on the relative distribution characteristics of the score, selective judgment is made. That is, when the consistency score of a certain Hall channel is significantly lower than the first preset threshold (e.g., 0.7), and the scores of the other two channels are higher than the second stability threshold (e.g., 0.9), it is considered that the low-scoring channel shows a significant trend of deviating from normal logical behavior in the current operating state and has a high probability of failure. Therefore, it is initially identified as a candidate faulty Hall sensor. To clarify the fault type and perform in-depth classification of channel behavior, the system enters the abnormal pattern identification stage after confirming candidate channels. This involves extracting features from the channel's state change trajectory over a continuous period and performing matching analysis based on the following three typical patterns: If it maintains a constant high or low level for a prolonged period without significant response edge changes, it is identified as a signal jamming fault; if its state change rhythm exhibits systematic delays or slippage, with a significant deviation from the expected state switching time but still maintaining a relatively intact phase relationship, it is identified as an output drift fault; if its state exhibits periodic failures, intermittent all-zero states, or unpredictable jumps, displaying irregular fluctuations, it is defined as a momentary disconnection fault. The diagnosed faulty channel undergoes logical isolation processing, meaning that at the control level, the channel's signal is stripped from the calculation process for motor commutation control or angle estimation. Simultaneously, its logical state is frozen, and periodic sampling of its input data is stopped to prevent its erroneous signals from interfering with the judgment logic of the remaining two normal channels.This isolation mechanism, in conjunction with the redundant verification model, allows the system to continue operating while retaining some sensing capabilities, and provides a clean computational baseline for the virtual signal reconstruction algorithm.
[0101] In one example, phase compensation is performed on the signals of the remaining two normal Hall sensors based on the location of the faulty Hall sensor to reconstruct the virtual Hall signal of the faulty Hall sensor, including:
[0102] The remaining two normal Hall sensors are determined based on the location of the faulty Hall sensor, and the signals of the remaining two normal Hall sensors are combined using a logical XOR operation to obtain the basic reconstructed signal.
[0103] By analyzing the state transition 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 parameters and speed parameters.
[0104] The target phase compensation offset is calculated based on the rotor position parameters, speed parameters, and fault Hall sensor position. The target phase compensation offset is then XORed with the basic reconstruction signal to obtain the compensation Hall signal.
[0105] The matching degree of the compensated Hall signal and the historical normal state is verified. When the matching degree exceeds the preset value, the reconstruction is confirmed to be successful. A three-point smoothing filter is used to smooth the compensated Hall signal that has been successfully reconstructed to obtain the virtual Hall signal of the faulty Hall sensor.
[0106] In this example, the fault determination mechanism identifies a faulty Hall sensor (e.g., H1), immediately discards the data from that channel, and confirms H2 and H3 as valid channels within the current cycle. Based on the dual-channel residual structure, the system invokes redundancy combination rules, using a logical XOR operation to combine the current logic levels of the two normal channels, obtaining a binary result as the basic reconstruction signal. This logical combination is based on the fixed spatial electrical phase relationship between the three Hall sensors; that is, given the states of any two Hall sensors, the state of the third Hall sensor is necessarily affected by the phase difference between the first two, and this can be inferred through logical rules. The time series of state changes in the remaining two normal channels is analyzed to estimate the current electrical angle position of the rotor and its instantaneous operating speed. By monitoring the alternating rising and falling edges of H2 and H3, the system records the timestamps of state transitions and calculates the time interval between adjacent edges, obtaining the time required to complete one commutation cycle per unit time. Based on this, the current speed is estimated, and the current electrical angle range of the rotor is derived from the state combination and commutation sequence. The system takes rotor electrical angle parameters, instantaneous speed parameters, and the physical location of the faulty Hall sensor as inputs to enter the phase compensation model calculation stage. Since different Hall sensor installation angles correspond to 120-degree distributions on the electrical angle coordinate axis, when a Hall sensor is missing, the constructed basic reconstructed signal will have a fixed phase offset compared to the actual state. This offset needs to be adjusted based on the specific motor configuration and speed state. The system obtains the logical mapping offset corresponding to this offset angle under the current conditions through table lookup or real-time calculation, uses it as the target phase compensation offset, and applies this compensation amount again to the basic reconstructed signal through a logical XOR operation to generate a corrected compensated Hall signal. To verify the correctness of the compensated signal, the matching degree of this signal is compared with the valid states previously output by the fault channel in the motor's historical operating data. The compensated Hall signal is placed at the time sequence position corresponding to the historical state window, and compared point-by-point with historical states under the same speed conditions and similar electrical angle intervals. The number of matching hits within multiple commutation cycles is counted, and the matching degree percentage is calculated. When the matching degree exceeds the system's preset threshold (e.g., 95%), the current compensation model is considered successfully reconstructed under the current operating conditions, indicating that the compensated Hall signal generated by the logic combination and phase correction is reliable. After the reconstructed signal is confirmed, it is smoothed to eliminate signal discontinuities caused by compensation edge transitions, logic fluctuations, or short-term errors, thereby improving signal stability and anti-interference capability. The specific processing method is a three-point smoothing filter, which takes the signal state values corresponding to the current reconstruction point and the two time points before and after it as input, performs a moving average or median filtering operation to eliminate local spikes, abrupt changes, or edge jitter, forming a smooth, stable, and edge-controllable final virtual Hall signal.
[0107] In one example, the target phase compensation offset is calculated based on rotor position parameters, speed parameters, and the location of the fault Hall sensor. The target phase compensation offset is then XORed with the base reconfiguration signal to obtain the compensation Hall signal, including:
[0108] The physical position identifier of the faulty Hall sensor in the 120-degree phase arrangement is determined based on the location of the faulty Hall sensor, and the phase compensation reference angle relative to the remaining two normal Hall sensors is calculated based on the physical position identifier to obtain the reference phase offset.
[0109] The phase delay characteristics of the motor under the current operating state are analyzed using rotor position parameters and speed parameters to obtain the dynamic phase delay correction amount;
[0110] The target phase compensation offset is obtained by weighting and combining the reference phase offset and the dynamic phase delay correction.
[0111] After converting the target phase compensation offset into the corresponding logic level state, a logical XOR operation is performed with the basic reconstruction signal to obtain the compensation Hall signal.
[0112] In this example, the physical position identifier of the faulty Hall sensor in the 120-degree phase arrangement is determined based on the location of the faulty Hall sensor. For a three-Hall system, sensors H1, H2, and H3 are installed on the stator circumference at 120-degree intervals in a fixed spatial order, with each channel occupying the start, middle, and end positions in the electrical angle sequence, respectively. Based on the correspondence between the number and the installation position, the system assigns a clear physical position identifier to the current faulty channel, such as H1 corresponding to the 0-degree start, H2 to the 120-degree clockwise position, and H3 to the 240-degree direction. Based on the fixed phase difference between this position identifier and the remaining two normal channels, the system calculates the ideal trigger angle that the faulty channel should present in the complete signal sequence, i.e., the reference phase offset that the current basic reconstructed signal needs to compensate under ideal static conditions. This reference offset is only related to the sensor structural design, reflects the spatial geometric compensation relationship, and does not change dynamically with rotational speed or electrical angle; therefore, it participates in the compensation synthesis as a static correction component. In actual operation, the commutation rhythm of the motor is affected by multiple factors such as the evolution rate of the electrical angle, the delay in magnetic flux response, and the lag in control signal response, resulting in a positional deviation between the actual triggering time of the Hall 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 offset relationship between the Hall edge detection time difference and the ideal commutation rhythm, a dynamic phase delay model is established to quantify the current operating state. During the increase in speed, due to the cumulative effect of the control system response time, the Hall level transition delay, and the power device turn-on setup time, the edge of the Hall signal exhibits a certain tendency to shift backward, requiring a positive delay compensation. Conversely, when the speed decreases or the control system response is advanced, the signal triggers prematurely, and the compensation term needs to be adjusted in the negative direction. The reference phase offset and the dynamic phase delay correction are weighted and combined to form a target phase compensation offset that better matches the current operating conditions. This weighted model balances the weight distribution of static structural compensation and dynamic operational correction through preset coefficients. For example, in low-speed conditions where the static phase relationship dominates, the weight of the baseline compensation is increased; while in high-speed operation or high-frequency response environments, where the system relies more on the results of dynamic hysteresis analysis, the proportion of delay correction is increased. The final synthesized target phase compensation offset represents the correction angle required to be introduced into the basic reconstruction signal in the current cycle, ensuring that the logic level output accurately corresponds to the current Hall state edge in time. To convert this angle into a logic level form that the control circuit can recognize, an angle-to-state mapping logic is established. The state mode within the electrical angle region corresponding to the target offset angle is derived into a specific "high" or "low" level signal. That is, according to the commutation logic, at this angle position, if the fault channel is in the excitation range, it should be high; if it is in the non-conducting range, it should be low.This mapping is accomplished through table lookup or direct logical calculation based on the relationship between the current commutation step and electrical angle. The target state is used as a logical bit input to the XOR operation module, which performs a logical XOR operation with the basic reconstructed signal previously generated based on the combination of two normal channels. This introduces a dual correction result of spatial phase and time delay, thereby generating a compensated Hall signal containing both static and dynamic correction characteristics.
[0113] In one example, a combination of a virtual Hall effect signal and a normal Hall effect sensor signal is used to output torque control commands for the motor, including:
[0114] The virtual Hall signal of the faulty Hall sensor is logically combined with the signals of the remaining two normal Hall sensors to obtain the commutation control signal group in the fault-tolerant operation mode.
[0115] Based on the commutation control signal group, the conduction state of the motor power switch is controlled and adjusted according to the six-step commutation timing logic to obtain the fault-tolerant commutation control timing.
[0116] 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 for the error based on the position detection error to obtain the adaptive current compensation command.
[0117] By employing a progressive current regulation method, the adaptive current compensation command and the fault-tolerant commutation control timing are smoothly integrated to obtain the motor torque control command.
[0118] In this example, the virtual Hall signal from the faulty Hall sensor is logically combined with the signals from the remaining two normal Hall sensors. This combination of three signals forms a three-bit binary Hall status code, where each bit corresponds to the state of H1, H2, and H3 in the current sampling period. This status combination is the core input to the system's six-step commutation control logic. Under normal circumstances, the six valid Hall states correspond to the six commutation stages, their order depending on the rotor's rotation direction. When the virtual signal replaces the faulty channel and is logically combined with the normal channel signal, the system controls the on / off state of the motor's power bridge arm based on the current status code, thereby driving each phase winding to conduct alternately in sequence. This control process follows the conduction rules of the six-step commutation table, such as a specific state corresponding to the upper bridge arm being energized while the lower bridge arm is de-energized, thus forming a fault-tolerant commutation control timing sequence. During commutation control using virtual signals, because the signals are calculated rather than directly acquired, their timing characteristics have certain errors. This manifests as a phase shift between the reconstructed edge and the actual rotor position, causing the commutation timing to be earlier or later than the ideal electrical angle. To identify and correct this offset, the rotor position angle determined by the commutation control logic in 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, the speed information of the previous cycle, and the control rhythm. The difference between the two is the position detection error for this cycle, with its positive or negative sign representing commutation advance or lag, and its magnitude reflecting the degree of angle offset. Based on this position detection error, the system initiates an adaptive current compensation algorithm to adjust the amplitude of the current control command for the current cycle to correct torque fluctuations caused by commutation deviation. This adjustment method establishes a mapping relationship between the error function and the current output, gradually increasing the current compensation coefficient as the error increases, thereby increasing the excitation intensity or extending the excitation holding time, and thus compensating for the energy distribution imbalance caused by inaccurate commutation. 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's stable range. Because sudden changes in current commands can cause discontinuous excitation in the system, leading to motor vibration, increased noise, or current overshoot, a gradual current regulation mechanism is used to mitigate these current compensation commands. This mechanism is designed as a current slope limiter or a first-order low-pass smoothing module. By limiting the rate of change of current per unit time, the compensation command is smoothly transitioned into the execution path, ensuring the current output curve remains continuous in the time dimension and avoids sharp abrupt changes in the boundary region. This achieves the integration of the current modulation process and the commutation control timing. The system outputs the control signal, after error feedback modulation, gradual current regulation, and smoothing synthesis, as the torque control command for the current cycle to the inverter drive circuit, driving each power switch to conduct accordingly, thus achieving dynamic control of the stator winding current waveform and timing.
[0119] In one example, the conduction state of the motor power switch is controlled and adjusted according to a six-step commutation timing logic based on the commutation control signal group, resulting in a fault-tolerant commutation control timing sequence, including:
[0120] 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 the commutation state mapping relationship.
[0121] Based on the commutation state mapping relationship, the conduction sequence of the six power switches of the upper and lower bridge arms is arranged to generate a three-phase alternating conduction power switch conduction timing table.
[0122] A dead time interval is inserted during the transition between adjacent conduction states in the power switch conduction timing table, and current limiting protection is applied to the sudden current change at the moment of commutation to obtain a safe commutation timing control command.
[0123] By monitoring the virtual Hall signal, the safe commutation timing control command is verified in real time to obtain the fault-tolerant commutation control timing.
[0124] In this example, when the system detects a failure in one of the Hall signals, it generates a virtual Hall signal through a reconstruction algorithm. This virtual signal, along with two other normal Hall signals, forms a three-dimensional Hall state combination, representing the sensor's output at the current electrical angle. Based on this combination signal, the system establishes a six-step commutation logic mapping table according to the standard six-step commutation control principle. In this table, each Hall state combination (e.g., 001, 011, 010, 110, 100, 101) corresponds to a unique power switch conduction mode, determining which pair of phase windings needs to be energized, which pair of power devices should be on, and which pair should remain off. This mapping relationship reflects the correspondence between the winding current direction and the Hall state, ensuring that the stator excitation direction and the relative position of the rotor magnetic poles remain in phase during commutation, thereby generating 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 phases A, B, and C in a three-phase motor, respectively) 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 de-energized in each commutation step, forming a conduction path where current flows in from one phase and out from another, while leaving the remaining phase in a floating state, constructing a typical "two-conductor-one-floating" conduction structure. In the six-step commutation logic, this conduction state changes every 60 electrical degrees, that is, each time a valid Hall state transition occurs, the pair of conducting transistors switches accordingly. Through the alternating conduction control strategy, the stator winding forms a rotating magnetic field, driving the rotor to move continuously. To ensure that no damage caused by bridge arm short circuits or current surges occurs during this conduction switching process, a dead time is inserted at the boundary stage between the two sets of conduction state switching. The dead time, set to the level of a few microseconds, is the interval between the turn-off of the previous group of conducting devices and the turn-on of the next group. This is used to prevent cross-conduction between the upper and lower bridge arms during switching, thus preventing instantaneous short circuits on the DC bus. The system uses a hardware timer in conjunction with PWM edge synchronization logic to control this dead time, and dynamically adjusts it via software parameters to adapt to different power device turn-off speeds. Simultaneously, during commutation, the change in the winding magnetic field causes a sharp current surge. The system introduces a current-limiting protection mechanism: current-limiting judgment logic is activated during the switching window. If the current change slope exceeds a predetermined threshold, the current rise rate is suppressed by rapidly reducing the PWM duty cycle, limiting the conduction width, or enabling a soft-start strategy, effectively preventing damage to the MOSFET or IGBT due to overcurrent during commutation. To ensure the effectiveness of commutation compensation in Hall fault-tolerant mode, commutation state verification logic for the virtual Hall signal is introduced. After each commutation control signal input, the integrity of the three-dimensional state combination is re-evaluated and its consistency with historical states is verified.This verification process not only confirms whether the current commutation input conforms to the standard six-state set, but also verifies whether the commutation logic matches the recursive relationship of the previous state, such as whether the commutation sequence 001→011→010→110→100→101→001 is strictly followed during forward rotation. If a serious deviation or jump in the virtual signal output is found between the expected logic state and the virtual signal output, the system will trigger 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 cycle, and dynamically correcting the edge trigger point. This ensures that even under virtual signal input conditions, the control system can maintain the continuity and safety of the overall commutation rhythm. Through the above 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 to work in a timing control manner.
[0125] Reference Figure 2 This embodiment provides a motor position detection system based on a Hall sensor, including:
[0126] Acquisition unit 1 is used to acquire three standard Hall status signals from the first Hall sensor, the second Hall sensor, and the third Hall sensor in the motor;
[0127] Anomaly detection unit 2 is used to perform state validity verification and timing anomaly detection on the three standard Hall state signals, and to identify state anomaly events and timing anomaly events.
[0128] Verification and analysis unit 3 is used to determine the location of the faulty Hall sensor based on abnormal state events and abnormal timing events;
[0129] Phase compensation unit 4 is used to perform phase compensation on the signals of the remaining two normal Hall sensors based on the location of the faulty Hall sensor, and reconstruct the virtual Hall signal of the faulty Hall sensor.
[0130] Output unit 5 is used to combine virtual Hall signals with normal Hall sensor signals to output torque control commands for the motor.
[0131] In this embodiment, the specific implementation of each unit in the above system embodiment is described in the above method embodiment, and will not be repeated here.
[0132] The technical solution provided by this invention establishes a dual detection system of six-state logic table verification and adjacent state transition time interval detection, enabling real-time monitoring of Hall sensors from both logical validity and timing rationality dimensions, 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 can accurately identify the specific faulty sensor location through state consistency scoring, avoiding the fuzzy judgment problem in traditional methods. A reconstruction algorithm combining logical XOR operation and dynamic phase compensation 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. In single-sensor fault mode, the system can maintain normal six-step commutation control using the reconstructed signal, and the 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 within milliseconds, meeting the real-time requirements of motor control. Dynamically adjusting the detection threshold and compensation parameters according to the motor operating status allows the system to adapt to operating requirements under different speeds and load conditions. During fault mode switching, progressive current regulation and smooth fusion processing are employed to effectively avoid the impact of sudden torque changes on the motor and transmission system.
[0133] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, system, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, system, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, system, article, or method that includes that element.
[0134] 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 structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method of detecting a position of a motor based on a Hall sensor, characterized by, include: Acquire the three standard Hall status signals from the first Hall sensor, the second Hall sensor, and the third Hall sensor in the motor; The three standard Hall state signals are subjected to state validity verification and timing anomaly detection to identify state anomaly events and timing anomaly events; The location of the faulty Hall sensor is determined based on the state anomaly event and the timing anomaly event. Specifically, this includes: constructing a three-Hall sensor state cross-validation matrix based on the phase difference geometric constraint relationship of 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, second, and third Hall sensors 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 a state consistency score for each Hall sensor; faulty Hall sensor determination analysis is performed 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 higher than a second threshold, the Hall sensor is determined to be a candidate faulty Hall sensor; by analyzing the abnormal modes of the candidate faulty Hall sensors, the fault types are classified into signal jamming faults, output drift faults, and instantaneous disconnection faults, and the confirmed faulty Hall sensors are logically isolated to obtain the location of the faulty Hall sensor. Based on the location of the faulty Hall sensor, phase compensation is performed on the signals of the remaining two normal Hall sensors to reconstruct the virtual Hall signal of the faulty Hall sensor. The virtual Hall signal is combined with the normal Hall sensor signal to output torque control commands.
2. The Hall sensor-based motor position detection method of claim 1, wherein, The acquisition of three standard Hall state signals from the first Hall sensor, second Hall sensor, and third Hall sensor in the motor includes: Hardware clock synchronization is performed on the first Hall sensor, second Hall sensor and third Hall sensor of the motor to obtain three raw Hall signals; The three original Hall signals are digitally filtered using a second-order low-pass filter to obtain three filtered Hall signals. The amplitude of the three filtered Hall signals is normalized based on high-level and low-level thresholds to obtain three standard Hall state signals.
3. The Hall sensor-based motor position detection method of claim 1, wherein, The process of performing state validity 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 the 111 state as invalid Hall states; The current state combination of the three standard Hall state signals is matched and verified with the standard six-state logic table to identify logically invalid state events; Based on the state transition sequence when the motor rotates forward and the reverse transition sequence when it rotates backward, the state transition of the three standard Hall state signals is verified for sequence legality, and jump transition abnormal events are identified. The logical invalid state events and the jump transition abnormal events are continuously counted and statistically analyzed by an abnormal state counter to generate an abnormal state warning signal. The effective state percentage of the three standard Hall state signals is statistically calculated. When the effective state percentage is lower than a preset percentage, an abnormal state event is determined by combining the abnormal state warning signal. 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 calculation of the state transition time interval and the timing anomaly detection of the three standard Hall state signals are used to identify timing anomaly events, including: The state transition time interval is calculated by recording the timestamps of two consecutive valid state transitions in the three standard Hall state signals. The current speed of the motor is calculated in real time based on the state transition time interval to obtain the current speed, and the theoretical expected time interval is calculated based on the current speed. The time series anomaly detection threshold is calculated by multiplying the theoretical expected time interval by the dynamic coefficient and adding the fixed compensation time. By comparing the deviation between the state transition time interval and the theoretical expected time interval with the timing anomaly determination threshold, timeout anomaly events or premature anomaly events are identified, and statistical analysis is performed on the timeout anomaly events and premature anomaly events of multiple state transitions to determine the timing anomaly events.
5. The motor position detection method based on a Hall sensor according to claim 1, characterized in that, The step of performing phase compensation on the signals of the remaining two normal Hall sensors based on the location of the faulty Hall sensor to reconstruct the virtual Hall signal of the faulty Hall sensor includes: Based on the location of the faulty Hall sensor, the remaining two normal Hall sensors are determined, and the signals of the remaining two normal Hall sensors are combined using a logical XOR operation to obtain the basic reconstructed signal. By analyzing the state transition 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 parameters and speed parameters. The target phase compensation offset is calculated based on the rotor position parameters, the speed parameters, and the fault Hall sensor position. The target phase compensation offset is then XORed with the basic reconstruction signal to obtain the compensation Hall signal. The matching degree of the compensated Hall signal with the historical normal state is verified. When the matching degree exceeds the preset value, the reconstruction is confirmed to be successful. A three-point smoothing filter is used to smooth the confirmed reconstructed compensated Hall signal to obtain the virtual Hall signal of the faulty Hall sensor.
6. The motor position detection method based on a Hall sensor according to claim 5, characterized in that, The step of calculating the target phase compensation offset based on the rotor position parameters, the rotational speed parameters, and the fault Hall sensor position, and then performing a logical XOR operation between the target phase compensation offset and the basic reconstruction signal to obtain the compensation Hall signal includes: The physical position identifier of the faulty Hall sensor in the 120-degree phase arrangement is determined based on the position of the faulty Hall sensor, and the phase compensation reference angle relative to the remaining two normal Hall sensors is calculated based on the physical position identifier to obtain the reference phase offset. The phase delay characteristics of the motor under the current operating state are analyzed using the rotor position parameters and the speed parameters to obtain the dynamic phase delay correction amount; The target phase compensation offset is obtained by weighting and combining the reference phase offset with the dynamic phase delay correction. After converting the target phase compensation offset into the corresponding logic level state, a logical XOR operation is performed with the basic reconstruction signal to obtain the compensation Hall signal.
7. The motor position detection method based on a Hall sensor according to claim 1, characterized in that, The method of combining the virtual Hall signal with the normal Hall sensor signal to output a torque control command 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 the commutation control signal group in the fault-tolerant operation mode. Based on the commutation control signal group, the conduction state of the motor power switch is controlled and adjusted according to the six-step commutation timing logic to obtain the fault-tolerant commutation control timing. Based on the rotor position angle of the signal and the theoretical expected position angle, the position detection error of the motor is calculated, and the normal operating current command is compensated for the error based on the position detection error to obtain the adaptive current compensation command. A gradual current regulation method is used to smoothly integrate the adaptive current compensation command with the fault-tolerant commutation control timing to obtain the torque control command.
8. The motor position detection method based on a Hall sensor according to claim 7, characterized in that, The control and adjustment of the conduction state of the motor power switch transistor based on the commutation control signal group according to the six-step commutation timing logic yields a fault-tolerant commutation control timing sequence, 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 the commutation state mapping relationship. Based on the commutation state mapping relationship, the conduction sequence of the six power switches of the upper and lower bridge arms is arranged to generate a three-phase alternating conduction power switch conduction timing table. A dead time interval is inserted during the transition between adjacent conduction states in the power switch conduction timing table, and current limiting protection is provided for the sudden current change at the moment of commutation to obtain a safe commutation timing control command. By monitoring the virtual Hall signal, the safe commutation timing control command is verified in real time to obtain the fault-tolerant commutation control timing.
9. 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 according to any one of claims 1 to 8 include: The acquisition unit is used to acquire the three standard Hall status signals of the first Hall sensor, the second Hall sensor and the third Hall sensor in the motor; An anomaly detection unit is used to perform state validity verification and timing anomaly detection on the three standard Hall state signals, and to identify state anomaly events and timing anomaly events. The verification and analysis unit is 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 is used to perform phase compensation on the signals of the remaining two normal Hall sensors based on the location of the faulty Hall sensor, and reconstruct the virtual Hall signal of the faulty Hall sensor. The output unit is used to combine the virtual Hall signal with the normal Hall sensor signal to output a torque control command.