Motor control method and vehicle

By performing dual verification and count value management on Hall signals, the problems of timing disorder and false protection caused by abnormal Hall sensor signals in BLDC motor control are solved, and the stable and efficient operation of the motor and system stability in complex environments are achieved.

CN121124628APending Publication Date: 2025-12-12HYCET TRANSMISSION SYST (JIANGSU) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511426225.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing BLDC motor control strategies are prone to motor timing errors and torque fluctuations due to abnormal or interference-induced Hall sensor signals, and frequent false protection failures, affecting system availability and driving safety.

Method used

By introducing a dual verification mechanism for Hall signals, the system time and signal status are used to determine the interference and rationality of the signal, and the invalid count value of the Hall signal is compared with a preset threshold to determine whether to restart the control system, thus ensuring signal reliability and system stability.

Benefits of technology

It significantly reduces the probability of false protection caused by momentary faults, enhances the motor's continuous operation capability and overall stability under non-ideal operating conditions, and improves the system's anti-interference capability and the rigor of control logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121124628A_ABST
    Figure CN121124628A_ABST
Patent Text Reader

Abstract

The invention provides a motor control method and a vehicle, and relates to the technical field of motor control. According to the method, a current Hall signal of a Hall sensor is obtained, and whether the Hall sensor is in a fault state is determined; if the Hall sensor is not in the fault state, whether the motor is controlled to work based on the current Hall signal is determined according to first system time corresponding to the current Hall signal and the signal state of the current Hall signal; if the Hall sensor is in the fault state, updating the Hall signal invalid count value, and determining whether to control the control system of the motor to restart or not based on the updated Hall signal invalid count value and the first preset threshold value, thereby avoiding the problems of control errors and frequent error protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor control technology, and in particular to a motor control method and a vehicle. Background Technology

[0002] In new energy vehicles, brushless direct current motors (BLDC) are widely used as key drive components in critical scenarios such as gear shifting mechanisms, clutch drives, and lubrication systems. Hall effect sensors, as the core component for rotor position detection in BLDC motors, are essential for ensuring the efficient and stable operation of the motor, as their signals are highly accurate and stable.

[0003] In related technologies, BLDC motors typically rely directly on Hall signals provided by Hall sensors for commutation. In case of a problem, power-off protection or power reduction protection is used directly.

[0004] However, directly using the aforementioned Hall signals for commutation can easily lead to motor timing errors and torque fluctuations. Moreover, when problems occur, the above-mentioned handling method is prone to triggering false protection, causing frequent system interruptions, reduced availability, and even driving safety risks. Summary of the Invention

[0005] This application provides a motor control method and a vehicle to solve the problems of control errors and frequent false protection in existing motor control strategies.

[0006] In a first aspect, embodiments of this application provide a method for controlling a motor, including: Acquire the current Hall signal of the Hall sensor and determine whether the Hall sensor is in a fault state; If the Hall sensor is not in a fault state, then based on the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, it is determined whether to control the motor to work based on the current Hall signal. If the Hall sensor is in a faulty state, the invalid count value of the Hall signal is updated, and based on the updated invalid count value of the Hall signal and the first preset threshold, it is determined whether to restart the control system of the motor.

[0007] In this embodiment, when the Hall sensor does not report a fault, the first system time and signal state are introduced as the basis for judgment. This allows for double verification of the Hall signal, effectively filtering out abnormal signals and ensuring that only truly reliable signals are used for motor control. This avoids control errors and ensures stable and efficient motor operation. For confirmed fault states, a mechanism is used to update the invalid Hall signal count and compare it with a first preset threshold to determine whether to restart the motor control system. This allows the system to withstand brief, intermittent transient faults rather than immediately performing drastic operations such as restarting. This mechanism can significantly reduce the probability of false protection due to transient faults and enhance the motor's continuous operation capability and overall stability under non-ideal operating conditions.

[0008] In one possible implementation, determining whether to control the motor based on the current Hall signal, according to the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, includes: Based on the first system time corresponding to the current Hall signal, determine whether the current Hall signal is an interference signal; If it is determined that the current Hall signal is not an interference signal, then based on the signal state of the current Hall signal, it is determined whether the current Hall signal is a reasonable signal; If the current Hall signal is determined to be a valid signal, then the motor operation is controlled based on the current Hall signal.

[0009] In this embodiment, the validity of a signal can be evaluated from a time perspective using the first system time, thereby effectively identifying instantaneous glitches caused by electromagnetic interference that do not conform to the motor's operating rules in terms of time sequence. This mechanism directly filters out unreliable noise signals at the source. Based on this, the rationality of the signal is further determined. This progressive verification process, which first judges whether there is interference (i.e., timeliness) and then judges whether it is rational (i.e., logic), ensures that only signals that pass both the timeliness and logic checks are ultimately used for motor control. This process avoids the potential oversights of a single judgment criterion, forming a double guarantee and making motor control decisions more rigorous and reliable.

[0010] In one possible implementation, determining whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal includes: Obtain the second system time corresponding to the previous reasonable Hall signal; Determine whether the time difference between the first system time and the second system time is greater than a preset difference threshold; If the time difference is greater than the preset difference threshold, then the current Hall signal is determined not to be an interference signal. If the time difference is less than or equal to the preset difference threshold, then the current Hall signal is determined to be an interference signal.

[0011] Here, if the time interval between the current Hall signal and the previous reasonable Hall signal is too short (i.e., the time difference is less than or equal to the difference threshold), the current signal is determined to be interference. This discrimination method can effectively identify and filter out transient glitches with abnormally high frequencies. This mechanism ensures that the control logic will not respond to these high-frequency noises that are not physically governed, thus avoiding control errors caused by false triggering at the source. Specifically, by introducing a comparison between the time difference and a preset difference threshold, the process of determining whether a signal is interference can be transformed into a precise and repeatable mathematical comparison process. This time-parameter-based quantitative judgment method avoids subjective arbitrariness, making the standard for identifying interference signals uniform, objective, and predictable. In one possible implementation, after determining whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal, the method further includes: If it is determined that the current Hall signal is an interference signal, then proceed to the step of updating the invalid count value of the Hall signal; If it is determined that the current Hall signal is not an interference signal, the invalid count value of the Hall signal is cleared to zero, and the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal.

[0012] In this embodiment, once the current signal is determined to be an interference signal, the system jumps to the step of updating the invalid count value of the Hall signal. This design can accumulate and count isolated, instantaneous interference events, allowing the system to quantify the frequency of interference. Only when the count value exceeds a preset threshold is a persistent fault confirmed, thus effectively distinguishing between accidental interference and real faults, avoiding unnecessary system-level protection triggered by a single interference, and improving the system's anti-interference capability and stability. Furthermore, when the current signal is determined not to be an interference signal, the invalid count value of the Hall signal is cleared to zero. This not only resets the fault accumulation state, indicating that the system has received a valid signal again and the interference period has ended, but also provides a clean starting point for subsequent processes. After clearing the count, the system jumps to the rationality judgment step, ensuring that valid signals can smoothly enter the next stage of logic verification, thereby forming a complete and continuous reliable signal processing chain and ensuring the coherence of the control logic.

[0013] In one possible implementation, after determining whether the current Hall signal is a valid signal based on the signal state of the current Hall signal, the method further includes: If the current Hall signal is determined to be an unreasonable signal, then the unreasonable Hall signal count value is updated; Detect whether the unreasonable count value of the Hall signal is greater than the second preset threshold; If the unreasonable count value of the Hall signal is less than or equal to the second preset threshold, after an interval of a preset time threshold, a new Hall signal is acquired again, and based on the new Hall signal, the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal. If the unreasonable count value of the Hall signal exceeds the second preset threshold, the control system for the motor will restart.

[0014] This embodiment of the application, after determining that a signal is unreasonable, updates the unreasonable count value of the Hall signal, which can accumulate isolated logic error events, providing the system with a quantitative basis for distinguishing between transient logic errors and persistent logic failures. Based on this, by comparing the count value with a second preset threshold, a graded response can be implemented: attempting recovery when the value is below the threshold, and performing a restart when the value is above the threshold. This mechanism can effectively prevent drastic system reactions triggered by single or accidental errors, improving fault tolerance.

[0015] In one possible implementation, determining whether the current Hall signal is a valid signal based on the signal state of the current Hall signal includes: Detect whether the current Hall signal state is reasonable; If the current Hall signal state is reasonable, then based on the current Hall signal, the previous reasonable Hall signal, and the motor direction, detect whether the current Hall signal state transition sequence is reasonable; If the current Hall signal's state transition sequence is reasonable, then the current Hall signal is determined to be a reasonable signal.

[0016] In this embodiment, when detecting whether a Hall signal is a valid signal, the first step is to check whether the signal state itself is valid (i.e., static verification), and then to check whether the state transition sequence is valid (i.e., dynamic verification). This progressive structure constitutes a dual security barrier, ensuring that the evaluation of the signal not only focuses on the validity of its instantaneous value, but also deeply verifies the logical correctness of its changes over time. Compared to a single verification dimension, this can more comprehensively and accurately identify various potential anomalies, significantly reducing the probability of misjudgment.

[0017] In one possible implementation, detecting whether the state transition sequence of the current Hall signal is reasonable based on the current Hall signal, the previous reasonable Hall signal, and the motor direction includes: Based on the motor direction of rotation, determine the standard state transition sequence table corresponding to the motor direction of rotation; Based on the aforementioned reasonable Hall signal and the standard state transition sequence table, determine the standard signal state under the standard transition sequence. If the current Hall signal is the same as the standard signal state, then the state transition sequence of the current Hall signal is determined to be reasonable; If the current Hall signal is different from the standard signal state, then the state transition sequence of the current Hall signal is determined to be unreasonable.

[0018] Here, by comparing the current Hall signal with the standard signal state derived from the previous reasonable signal and the standard sequence table, errors can be directly and effectively detected where the signal value itself is legal, but the transition sequence does not conform to the expected current rotation direction (e.g., a reverse transition sequence during forward rotation). These timing logic errors caused by strong interference or sensor failure are extremely subtle, and this method provides a targeted detection means, ensuring the correctness of the signal from a timing logic perspective. Furthermore, by introducing a standard state transition sequence table as a comparison benchmark, the judgment of transition rationality can be transformed from a complex logical analysis into a simple table lookup and comparison operation. This mechanism ensures that the judgment process is entirely based on preset, definite physical laws, eliminating the uncertainty of subjective assumptions or approximate estimations, thereby ensuring a high degree of objectivity, consistency, and accuracy in the judgment results.

[0019] In one possible implementation, determining whether to restart the control system for controlling the motor based on the updated Hall signal invalid count value and a first preset threshold includes: If the updated invalid Hall signal count is less than or equal to the first preset threshold, then the motor is controlled to work based on the previous reasonable Hall signal. If the updated Hall signal invalid count value is greater than the first preset threshold, the control system controlling the motor will restart.

[0020] Here, a clear hierarchical response mechanism is established by comparing the updated invalid Hall signal count with a first preset threshold. When the count value does not exceed the threshold, a fault-tolerant control strategy based on historical signals is adopted; when the count value exceeds the threshold, a restart measure is taken. This design enables the system to distinguish between intermittent and persistent faults, avoiding overreaction to transient interference, thereby maximizing the continuous operation of the system and optimizing availability while ensuring safety.

[0021] In one possible implementation, the restart of the control system for the motor includes: Control the motor to perform a software restart operation and update the software restart counter value; If the software restart count value is greater than the third preset threshold, the motor is controlled to perform a hardware restart.

[0022] This application clearly distinguishes between two levels of restart operations: software restart and hardware restart. It introduces a software restart count and a third preset threshold as quantification criteria for level switching. This design allows the system to apply different levels of recovery measures sequentially and step-by-step based on the severity of the fault, avoiding the indiscriminate use of the most thorough (and potentially most impactful) hardware restart regardless of the severity of the fault. This makes the fault recovery strategy more precise and targeted. Through a process of prioritizing software restarts, quantifying the count, and using hardware restarts as a fallback, an intelligent restart strategy can be constructed, progressing from minor to major faults and escalating step-by-step. This aims to restore the system at the lowest possible cost while ensuring effective handling of deep hardware faults, thereby comprehensively improving the system's fault tolerance and self-recovery capabilities.

[0023] Secondly, embodiments of this application provide a motor control device, including: The acquisition module is used to acquire the current Hall signal of the Hall sensor and determine whether the Hall sensor is in a fault state. The control module is used for: If the Hall sensor is not in a fault state, then based on the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, it is determined whether to control the motor to work based on the current Hall signal. If the Hall sensor is in a faulty state, the invalid count value of the Hall signal is updated, and based on the updated invalid count value of the Hall signal and the first preset threshold, it is determined whether to restart the control system of the motor.

[0024] Thirdly, embodiments of this application provide a vehicle including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the motor control method as described in any of the first aspects.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the motor control method as described in any of the first aspects.

[0026] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0027] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application; Figure 2 This is a schematic flowchart of a motor control method provided in an embodiment of this application; Figure 3 This is a flowchart illustrating the process of determining whether to control the motor operation based on the current Hall signal, provided in another embodiment of this application. Figure 4 This is a flowchart illustrating a control method for a motor where the Hall sensor is not in a fault state, according to an embodiment of this application. Figure 5 This is a schematic flowchart of a motor control method for a Hall sensor in a fault state according to an embodiment of this application; Figure 6 This is a schematic flowchart of a motor control method provided in another embodiment of this application; Figure 7 This is a schematic diagram of the structure of a motor control device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a vehicle provided in one embodiment of this application. Detailed Implementation

[0030] The present application will be described more clearly below with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the function of the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.

[0031] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0032] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0033] In the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0034] Furthermore, the term "multiple" mentioned in the embodiments of this application should be interpreted as two or more.

[0035] BLDC motors typically rely directly on Hall signals from Hall sensors for commutation. In case of a problem, power-off or power-reduction protection is used. However, the applicant has found that the vehicle operating environment is complex and variable, with significant electromagnetic interference and mechanical vibration. This leads to significant limitations in the aforementioned control strategy: Firstly, when the Hall sensor does not report a hardware fault but the output signal exhibits slight abnormalities or transient interference, the control system directly uses the Hall signal for commutation, which can easily cause motor control timing errors and torque fluctuations. Secondly, when the control system detects a fault reported by the Hall sensor, it typically uses power-off or power-reduction protection. This fault handling mode struggles to avoid false protection caused by transient interference, resulting in unnecessary and frequent system interruptions and reduced vehicle availability. More importantly, sudden power loss or performance limitations during driving can itself pose new safety risks and affect driving safety. To avoid control errors and frequent false protection, a new motor control method needs to be considered.

[0036] To avoid control errors and frequent false protection, in the embodiments of this application, when the Hall sensor does not report a fault, a first system time and signal state are introduced as the basis for judgment to perform double verification on the Hall signal, thereby effectively filtering out abnormal signals, avoiding control errors, and ensuring the smooth and efficient operation of the motor. For confirmed fault states, a mechanism is used to update the invalid count value of the Hall signal and compare it with a first preset threshold to determine whether to restart the motor control system, so that the system can tolerate short-term, intermittent instantaneous faults, thereby significantly reducing the probability of false protection caused by instantaneous faults and enhancing the motor's continuous operation capability and overall stability under non-ideal operating conditions.

[0037] First refer to Figure 1 , Figure 1The illustration schematically depicts an application scenario provided according to an embodiment of this application, involving a brushless DC motor 101. The brushless DC motor 101 incorporates a Hall sensor 102 and a controller 103. The Hall sensors are mounted on the stator of the motor, typically three in number, arranged at 120-degree angles to each other. When the magnet (N or S pole) of the motor rotor rotates past the Hall sensor, the Hall sensor senses the change in the magnetic field and outputs a high-level or low-level electrical signal (i.e., a Hall signal) to the controller 103, enabling the controller to control the brushless DC motor to perform commutation based on the Hall signal.

[0038] In motor control applications: the Hall sensor outputs a Hall signal and stores it in a register so the controller can read the Hall signal from the register. The register also contains a fault flag bit to store a fault flag when the Hall sensor malfunctions. The controller can determine if the Hall sensor is in a fault state by checking if a fault flag is stored in the fault flag bit. If the Hall sensor is not in a fault state, the controller can determine whether to control the motor based on the current system time (i.e., the first system time) and the signal state of the Hall signal. If the Hall sensor is in a fault state, the controller can update the Hall signal invalid count value and, based on the updated Hall signal invalid count value and a first preset threshold, determine whether to restart the motor control system.

[0039] The following is combined Figure 1 Application scenarios, refer to Figures 2-6 This application describes a motor control method according to exemplary embodiments thereof. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Rather, the embodiments of this application can be applied to any applicable scenario.

[0040] It should be noted that the embodiments of this application can be applied to vehicles equipped with brushless DC motors, that is, the motor control method provided by the exemplary embodiments of this application can be executed on the brushless DC motor of the vehicle.

[0041] refer to Figure 2 , Figure 2 This is a schematic flowchart illustrating a motor control method provided in an embodiment of this application. Figure 2 As shown, the method in the embodiments of this application may include: Step 201: Obtain the current Hall signal of the Hall sensor and determine whether the Hall sensor is in a fault state.

[0042] Hall sensors are typically three, arranged at 120-degree angles to each other. At the current moment, the Hall signals output by each Hall sensor together constitute the current Hall signal. In this embodiment, the current Hall signal can be represented in the form (HALL_A, HALL_B, HALL_C). Here, HALL_A represents the Hall signal output by the first Hall sensor, HALL_B represents the Hall signal output by the second Hall sensor, and HALL_C represents the Hall signal output by the third Hall sensor.

[0043] Here, the Hall signals output by each Hall sensor are essentially either high-level or low-level signals. For example, the current Hall signal can be (001), meaning the first and second Hall sensors output low-level signals, and the third Hall sensor outputs a high-level signal. Here, 1 represents a high-level signal, and 0 represents a low-level signal.

[0044] The current Hall signal can be stored in a register for the controller to read. The register also contains a fault flag bit to indicate when a Hall sensor malfunctions. When any Hall sensor malfunctions, the fault flag bit in the register stores the fault flag. For example, the fault flag can be "1", meaning it is set to 1 when a Hall sensor malfunctions. When the Hall sensor is not malfunctioning, the fault flag bit is set to 0. The controller determines whether the Hall sensor is in a fault state by reading the fault flag bit in the register.

[0045] Step 202: If the Hall sensor is not in a fault state, determine whether to control the motor to work based on the current Hall signal according to the first system time corresponding to the current Hall signal and the signal state of the current Hall signal.

[0046] Considering the complex and variable operating environment of vehicles, with significant electromagnetic interference and mechanical vibration, even if the Hall sensor is not faulty, the current Hall signal may still exhibit slight anomalies or transient interference. To avoid control malfunctions caused by these minor anomalies or transient interference, this application embodiment performs a double verification of the current Hall signal based on the system time corresponding to the current Hall signal and the signal state of the current Hall signal, in order to detect whether the current Hall signal is accurate and reliable. Based on the confirmation that the current Hall signal is accurate and reliable, the motor can be controlled to operate accordingly.

[0047] In this embodiment, when detecting whether the Hall signal is accurate and reliable, two aspects can be considered: first, whether the current Hall signal is an interference signal; and second, whether the current Hall signal is a valid signal. On the one hand, due to the influence of motor speed, there is a certain time difference between two adjacent accurate and reliable Hall signals. Therefore, this embodiment can detect whether the current Hall signal is an interference signal based on the system time corresponding to the Hall signal (i.e., the generation time of the Hall signal).

[0048] On the other hand, the validity of a Hall signal can be determined by considering both its static state and dynamic transition sequence, based on the signal state of the Hall signal. It is understandable that a Hall signal is considered valid only when both its static state and dynamic transition sequence are valid.

[0049] Based on the determination that the current Hall signal is not an interference signal and is a reasonable signal, the embodiments of this application can control the motor to work based on the current Hall signal.

[0050] Step 203: If the Hall sensor is in a fault state, update the invalid Hall signal count value, and determine whether to restart the motor control system based on the updated invalid Hall signal count value and the first preset threshold.

[0051] In this embodiment of the application, before executing the motor control method, a Hall signal invalidity count value can be preset to count cases where the Hall signal is invalid. The initial value of the Hall signal invalidity count value can be 0.

[0052] If the Hall sensor malfunctions during the motor control process, the current Hall signal is determined to be invalid. In this case, the invalid Hall signal count is incremented by 1 to update the count. Simultaneously, considering the current invalid Hall signal, it can be cleared from the register to prevent invalid data from occupying storage space.

[0053] When the updated Hall signal invalid count value is greater than the first preset threshold, it can be determined that the Hall signal has been invalid for several consecutive cycles. At this time, the motor control system can be restarted so that the motor can resume operation.

[0054] When the updated Hall signal invalid count value is less than or equal to the first preset threshold, considering that the current fault may be an intermittent instantaneous fault, the motor control system is not restarted to avoid triggering false protection due to the instantaneous fault.

[0055] It is important to note that when the Hall sensor is in a faulty state, after updating the invalid Hall signal count value and clearing the invalid Hall signal in the register, the fault flag in the fault flag bit of the register can be cleared at the same time to prepare for the motor control of the next cycle.

[0056] In this embodiment, when the Hall sensor does not report a fault, the first system time and signal state are introduced as the basis for judgment. This allows for double verification of the Hall signal, effectively filtering out abnormal signals and ensuring that only truly reliable signals are used for motor control. This avoids control errors and ensures stable and efficient motor operation. For confirmed fault states, a mechanism is used to update the invalid Hall signal count and compare it with a first preset threshold to determine whether to restart the motor control system. This allows the system to withstand brief, intermittent transient faults rather than immediately performing drastic operations such as restarting. This mechanism can significantly reduce the probability of false protection due to transient faults and enhance the motor's continuous operation capability and overall stability under non-ideal operating conditions.

[0057] Next, the specific implementation method for determining whether to control the motor based on the current Hall signal, according to the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, will be described in detail. See details. Figure 3 : Step 301: Determine whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal.

[0058] Due to the influence of motor speed, there is a certain time difference between two adjacent Hall signals. Based on this, embodiments of this application can determine whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal.

[0059] This application explicitly introduces a judgment step based on the first system time, which can evaluate the validity of the signal from a time dimension. This step effectively identifies instantaneous glitches caused by electromagnetic interference and other factors that do not conform to the motor's operating rules in terms of time sequence, and eliminates them in the control logic. This mechanism directly filters out unreliable noise signals at the source, providing cleaner and more reliable signal input for subsequent control decisions.

[0060] Specifically, in this embodiment, the second system time corresponding to the previous reasonable Hall signal can be obtained first; then, it can be determined whether the time difference between the first system time and the second system time is greater than a preset difference threshold; if the time difference is greater than the preset difference threshold, it can be determined that the current Hall signal does not belong to the interference signal; if the time difference is less than or equal to the preset difference threshold, it can be determined that the current Hall signal belongs to the interference signal.

[0061] Here, the previous reasonable Hall signal refers to the previous Hall signal that is not an interference signal and is a reasonable signal, that is, an accurate and reliable Hall signal.

[0062] The preset difference threshold can be determined based on the motor speed. Specifically, first, the theoretical time difference is determined based on the motor speed. Then, the theoretical time difference is calibrated based on the actual test data of the motor to determine the preset difference threshold. The preset difference threshold is greater than the theoretical time difference.

[0063] The formula for calculating the theoretical time difference can be expressed as: .

[0064] in, This represents the theoretical time difference.

[0065] Understandably, if the time difference between the current Hall signal and the previous accurate and reliable Hall signal is less than or equal to the aforementioned difference threshold, the Hall signal is determined to be changing too rapidly, and in this case, the current Hall signal is very likely to be an interference spike. Therefore, in this embodiment, when the time difference is less than or equal to the difference threshold, the current Hall signal is determined to be an interference signal. Conversely, when the time difference is greater than the difference threshold, the current Hall signal is determined not to be an interference signal.

[0066] Here, if the time interval between the current Hall signal and the previous reasonable Hall signal is too short (i.e., the time difference is less than or equal to the difference threshold), the current signal is determined to be interference. This discrimination method can effectively identify and filter out transient glitches with abnormally high frequencies. These signals are typical interference characteristics because their rate of change far exceeds the normal physical operating limits of the motor. This mechanism ensures that the control logic will not respond to these high-frequency noises that are not physically governed, thus avoiding control errors caused by false triggering at the source. By introducing a comparison between the time difference and a preset difference threshold, the subjective judgment of whether a signal is an interference signal is transformed into a precise and repeatable mathematical comparison process. This quantitative judgment method based on time parameters avoids subjective arbitrariness, making the identification standard for interference signals uniform, objective, and predictable.

[0067] Step 302: If it is determined that the current Hall signal is not an interference signal, then based on the signal state of the current Hall signal, determine whether the current Hall signal is a reasonable signal.

[0068] Considering that even if the current Hall signal is not an interference signal, there may still be situations such as a short circuit or open circuit in the Hall sensor power supply or signal line, strong electromagnetic interference to the Hall sensor, or intermittent failure, which could cause the current Hall signal to become abnormal. Therefore, this embodiment of the application, after determining that the current Hall signal is not an interference signal, further judges whether the current Hall signal is a reasonable signal based on the signal state, in order to ensure that the Hall signal used to control the motor is an accurate and reliable Hall signal and avoid control errors.

[0069] When the power supply or signal line of the Hall sensor is short-circuited or open-circuited, the signal state of the Hall signal will be unreasonable. When the Hall sensor is subjected to strong electromagnetic interference or intermittent failure, the transition sequence of the Hall signal state may be abnormal. Therefore, in this embodiment, the Hall signal is detected as a reasonable signal mainly from two aspects: whether the signal state is reasonable and whether the transition sequence of the signal state is reasonable.

[0070] Specifically, the system checks whether the current Hall signal state is reasonable. If the current Hall signal state is reasonable, the system checks whether the current Hall signal state transition sequence is reasonable based on the current Hall signal, the previous reasonable Hall signal, and the motor direction. If the current Hall signal state transition sequence is reasonable, the system determines that the current Hall signal is a reasonable signal.

[0071] Here, the current Hall signal state is considered reasonable only when it falls within a preset reasonable state. The preset reasonable state varies depending on the installation location of the Hall sensors. For example, with three Hall sensors installed at 120-degree intervals, reasonable Hall signal states could include (001), (010), (011), (100), (101), and (110). All other signal states are unreasonable. For instance, (000) and (111) are both unreasonable signal states.

[0072] If the current Hall signal state belongs to any of the above 6 reasonable states, then the current Hall signal state is determined to be reasonable; otherwise, the current Hall signal state is determined to be unreasonable.

[0073] This application's embodiments first detect whether the signal state itself is reasonable (i.e., static verification), and then detect whether the state transition sequence is reasonable (i.e., dynamic verification). This progressive structure constitutes a double security barrier, ensuring that the evaluation of the signal not only focuses on the validity of its instantaneous value, but also deeply verifies its logical correctness over time. Compared to a single verification dimension, this can more comprehensively and accurately identify various potential anomalies, significantly reducing the probability of misjudgment.

[0074] The step of detecting whether the current Hall signal state is reasonable is mainly used to determine whether the signal state belongs to a preset reasonable state (for example, for a Hall sensor installed at 120 degrees, invalid states such as 000 and 111 are excluded). This step can directly and quickly identify hard faults caused by sensor power failure, open circuit or short circuit of signal line, etc., and prevent these fundamentally erroneous signals from entering subsequent processes, providing a basic and critical safety guarantee for the system.

[0075] After the static verification above is passed, a further judgment on the rationality of the state transition sequence based on motor direction is introduced. This mechanism can effectively identify errors where the state value itself is legal, but the transition sequence does not conform to the motor rotation logic (e.g., jumping directly from 101 to 010). These types of errors are usually caused by strong electromagnetic interference or intermittent sensor failures and are extremely insidious. Through this dynamic verification, the system can ensure that the Hall signal sequence strictly follows physical laws, thereby guaranteeing the absolute correctness of the motor commutation timing and avoiding torque fluctuations or loss of synchronization caused by logical timing errors.

[0076] Here, a progressive judgment method combining static value verification and dynamic jump logic verification is used to construct a hierarchical and comprehensive signal rationality evaluation system, which can simultaneously deal with hard faults and hidden logical errors, fundamentally ensuring the logical correctness and reliability of Hall signals used for motor control.

[0077] In some embodiments, when detecting whether the current Hall signal state transition sequence is reasonable, a standard state transition sequence table corresponding to the motor direction can be determined first based on the motor direction; then, based on the previous reasonable Hall signal and the standard state transition sequence table, the standard signal state under the standard transition sequence is determined; if the current Hall signal is the same as the standard signal state, the current Hall signal state transition sequence is determined to be reasonable; if the current Hall signal is different from the standard signal state, the current Hall signal state transition sequence is determined to be unreasonable.

[0078] Here, the motor direction can be forward or reverse. Different motor directions correspond to different standard state transition sequence tables. These standard state transition sequence tables contain the standard transition sequence corresponding to the Hall signals. In this embodiment, the previous or next standard signal state adjacent to the previous reasonable Hall signal can be determined from the standard state transition sequence table. If the current Hall signal state is the same as the aforementioned standard signal state, then the current Hall signal's state transition sequence is determined to be reasonable; otherwise, the current Hall signal's state transition sequence is determined to be unreasonable.

[0079] Here, by introducing a standard state transition sequence table as the benchmark for comparison, the judgment of the rationality of the transition is transformed from a complex logical analysis into a simple table lookup and comparison operation. This mechanism ensures that the judgment process is entirely based on pre-set, definite physical laws, eliminating the uncertainty of subjective assumptions or approximate estimations, thereby ensuring the high objectivity, consistency, and accuracy of the judgment results.

[0080] The aforementioned judgment method explicitly uses motor direction as the input parameter for determining the standard jump sequence table. This means that the rationality verification dynamically adapts to the current motor operating command (forward / reverse). This ensures that the final reversing control logic is completely synchronized and matched with the driver's steering commands (such as acceleration, deceleration, and reversing), fundamentally avoiding control mismatch, efficiency reduction, or operational instability caused by mismatch between signal timing and steering intention.

[0081] The embodiments of this application employ a lookup table, prediction, and comparison mechanism, which can provide an objective, accurate, and synchronous method for judging the rationality of the Hall signal transition sequence. This method can accurately identify hidden timing errors, thereby ensuring the high accuracy and reliability of motor commutation control.

[0082] Step 303: If the current Hall signal is determined to be a valid signal, then the motor operation is controlled based on the current Hall signal.

[0083] Once the current Hall signal is determined to be a valid signal, the motor can be controlled based on the current Hall signal.

[0084] This application's embodiments design a progressive verification process that first determines whether there is interference (timeliness), and then determines whether it is reasonable (logic). This hierarchical structure ensures that only signals that pass both the timeliness and logic checks are ultimately used for motor control. This process avoids the potential oversights of a single judgment criterion, forming a double guarantee and making the basis for control decisions more rigorous and reliable.

[0085] This two-stage judgment mechanism, which combines anti-interference filtering with logical rationality verification, can construct a systematic signal quality assessment process, thereby significantly improving the reliability and accuracy of Hall signals used for motor control and laying a solid foundation for the smooth and efficient operation of the motor.

[0086] Based on the above embodiments, the motor control method will be further described for scenarios where the Hall sensor is not in a faulty state. See details below. Figure 4 : Step 401: Determine whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal.

[0087] The specific implementation method of step 401 is detailed in the above embodiments and will not be repeated here.

[0088] Step 402: If it is determined that the current Hall signal is an interference signal, then proceed to the step of updating the invalid count value of the Hall signal.

[0089] If it is determined that the current Hall signal is an interference signal, then the current Hall signal is determined to be invalid. At this time, the invalid Hall signal can be cleared, and the process can jump to the step of updating the invalid Hall signal count value to update the invalid Hall signal count value.

[0090] Step 403: Based on the updated Hall signal invalid count value and the first preset threshold, determine whether to restart the motor control system.

[0091] After jumping to update the invalid count value of the Hall signal, the next step is executed sequentially, namely, based on the updated invalid count value of the Hall signal and the first preset threshold, it is determined whether to restart the control system of the motor.

[0092] Here, if the updated Hall signal invalid count value is less than or equal to the first preset threshold, the control system that does not control the motor will restart, and the motor will be controlled to work based on the previous reasonable Hall signal.

[0093] When the Hall signal is determined to be an interference signal, that is, the time difference between the Hall signal and the previous reasonable Hall signal is small, it can be determined that the motor does not need to perform a new commutation operation. Therefore, the embodiments of this application can continue to control the motor operation based on the previous reasonable Hall signal to ensure the smooth operation of the motor.

[0094] Step 404: If it is determined that the current Hall signal is not an interference signal, the invalid count value of the Hall signal is cleared to zero, and the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal.

[0095] Here, the Hall signal invalid count value is used to characterize the number of consecutive invalid Hall signals. Once it is determined that the current Hall signal is not an interference signal, the Hall signal invalid count value can be cleared to zero.

[0096] Once it has been determined that the Hall signal is not an interference signal, it can be further checked whether the current Hall signal is a legitimate signal. See the above embodiments for details, which will not be repeated here.

[0097] Step 405: If the current Hall signal is determined to be a valid signal, then the motor operation is controlled based on the current Hall signal.

[0098] After jumping to execute the step of determining whether the current Hall signal is a reasonable signal based on the current Hall signal status, the next step is executed sequentially. That is, if the current Hall signal is determined to be a reasonable signal, then the motor is controlled to work based on the current Hall signal.

[0099] Here, if the current Hall signal is determined to be a valid signal, the valid Hall signal and its corresponding system time can be stored to provide a benchmark for the detection of the Hall signal in the next cycle.

[0100] In this embodiment, once the current Hall signal is determined to be an interference signal, the system jumps to the step of updating the invalid count value of the Hall signal. This design can accumulate and count isolated, instantaneous interference events, enabling the system to quantify the frequency of interference. Only when the count value exceeds a preset threshold is a persistent fault confirmed, thereby effectively distinguishing between accidental interference and real faults, avoiding unnecessary system-level protection triggered by a single interference, and improving the system's anti-interference capability and stability.

[0101] When it is determined that the current Hall signal is not an interference signal, clearing the invalid count value of the Hall signal to zero not only resets the fault accumulation state, indicating that the system has received a valid signal again and the interference period has ended, but also provides a clean starting point for subsequent processes. After clearing, the process jumps to the rationality judgment step, ensuring that valid signals can smoothly enter the next stage of logic verification, thereby forming a complete and continuous reliable signal processing chain and ensuring the coherence of the control logic.

[0102] Here, by introducing a counting update and clearing mechanism for interference signals and clarifying the subsequent process jump path, we can achieve quantitative management of interference events, ensure the smooth processing of valid signals, and thus build a rigorous, efficient and highly reliable branch decision-making process.

[0103] In some embodiments, see Figure 4 After determining whether the current Hall signal is a valid signal, it may also include: Step 406: If the current Hall signal is determined to be an unreasonable signal, then update the unreasonable Hall signal count value.

[0104] In this embodiment, a Hall signal unreasonableness count value is pre-set to characterize the number of times the Hall signal is an unreasonable signal. The initial value of the Hall signal unreasonableness count value can be 0. When the current Hall signal is determined to be an unreasonable signal, the Hall signal unreasonableness count value can be incremented by 1 to update the Hall signal unreasonableness count value.

[0105] Step 407: Detect whether the unreasonable count value of the Hall signal is greater than the second preset threshold.

[0106] Here, the value of the second preset threshold can be determined according to the actual situation, and this application embodiment does not impose specific limitations on it.

[0107] Step 408: If the unreasonable count value of the Hall signal is less than or equal to the second preset threshold, after an interval of a preset time threshold, a new Hall signal is acquired again, and based on the new Hall signal, the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal.

[0108] If the unreasonable count value of the Hall signal is less than or equal to the second preset threshold, the Hall sensor may experience a momentary malfunction. To avoid frequent false protection, this embodiment does not directly perform a restart operation. Instead, after a preset time threshold interval, a new Hall signal is acquired and the current Hall signal is re-detected to determine whether it is a reasonable signal, until a reasonable Hall signal is determined, or until the unreasonable count value of the Hall signal is greater than the second preset threshold.

[0109] This embodiment of the application can reread the latest Hall signal from the register after a preset time threshold interval, and reacquire a new Hall signal. It should be noted that the Hall sensor stores the Hall signal in the register at set intervals for the controller to recall. The duration of the set interval is less than the aforementioned preset time threshold. The specific values ​​of the set interval and the preset time threshold can be determined according to actual conditions, and this embodiment does not impose specific limitations on them. Although the Hall sensor stores the Hall signal in the register at set intervals, the controller always performs motor control based on the reasonable signal detected by the signal.

[0110] Here, when detecting whether the current Hall signal is a reasonable signal, it has been determined that the time difference between the current Hall signal and the previous reasonable Hall signal is greater than the difference threshold, that is, the motor may need to perform a new commutation operation. Therefore, the embodiments of this application cannot use the previous reasonable Hall signal to control the motor to avoid affecting the normal commutation of the motor. Instead, a new Hall signal is acquired in order to obtain a reasonable Hall signal.

[0111] Step 409: If the unreasonable count value of the Hall signal is greater than the second preset threshold, the control system for controlling the motor will be restarted.

[0112] When the unreasonable count value of the Hall signal exceeds the second preset threshold, it is determined that multiple unreasonable Hall signals have been generated continuously. At this time, the possibility of a momentary fault can be ruled out. In this embodiment of the application, the control system of the motor is restarted so that the motor can return to normal operation.

[0113] Here, when the control system for the motor restarts, it can first control the motor to perform a software restart operation and update the software restart counter value; if the software restart counter value is greater than a third preset threshold, then it controls the motor to perform a hardware restart. For details on the specific implementation, please refer to the following embodiments, which will not be elaborated here.

[0114] In this embodiment, after determining that a signal is unreasonable, the unreasonable count value of the Hall signal is updated, thereby accumulating isolated logic error events and providing the system with a quantitative basis for distinguishing between transient logic errors and persistent logic failures. Then, by comparing the unreasonable count value with a second preset threshold, a graded response can be achieved.

[0115] In this process, when an unreasonable count value does not exceed the second preset threshold, a new Hall signal is acquired after a preset time threshold interval, and the process returns to the judgment state. This retry mechanism provides the system with an opportunity to recover itself after encountering transient strong interference or brief sensor malfunctions. By resampling after the delay, it is possible to avoid the interference period, acquire the correct signal, and thus restore normal control without interrupting motor operation, maximizing the continuity of system functions.

[0116] When unreasonable count values ​​accumulate and exceed the second preset threshold, the motor control system restarts. This allows the system to decisively restart when it confirms a substantial fault in the sensor that cannot be automatically recovered (such as internal sensor damage, permanent short circuit in the signal line, etc.), thus preventing the motor from losing synchronization, being damaged, or causing a safety accident due to continuous incorrect commutation, thereby forming the final barrier for system safety.

[0117] This application embodiment constructs a progressive processing strategy for situations where signal logic is unreasonable, from attempting self-recovery to final safety protection, through a process of counting evaluation, delayed retry, and over-threshold restart. While striving to maintain system continuity, it ensures system safety after fault escalation.

[0118] The following is combined Figure 5 This paper introduces the motor control strategy for scenarios where the Hall sensor is in a faulty state.

[0119] Step 501: If the Hall sensor is in a fault state, update the invalid Hall signal count value.

[0120] The specific implementation method of step 501 is detailed in the above embodiments and will not be repeated here.

[0121] Step 502: If the updated Hall signal invalid count value is less than or equal to the first preset threshold, then control the motor to work based on the previous reasonable Hall signal.

[0122] Considering that the motor has mechanical inertia and the rotor position will not change abruptly in a very short time, in this embodiment of the application, when the Hall sensor is in a fault state and the invalid count value of the updated Hall signal is less than or equal to the first preset threshold, the previous reasonable Hall signal is used to control the motor to maintain the motor operation.

[0123] In this embodiment, when the invalid count value does not exceed a first preset threshold, the motor is controlled to operate based on the last known correct Hall signal. This is essentially a short-term fault-tolerant operation strategy. It utilizes the mechanical inertia of the motor to maintain basic control during brief signal anomalies using the last known correct position information, aiming to smoothly navigate the brief disturbance period or attempt to allow the system to recover itself, thus avoiding unnecessary operational interruptions.

[0124] Step 503: If the updated Hall signal invalid count value is greater than the first preset threshold, the control system for controlling the motor is restarted.

[0125] When the updated Hall signal invalid count value is greater than the first preset threshold, it can be determined that the Hall signal has been invalid for several consecutive cycles. At this time, the motor control system can be restarted so that the motor can resume operation.

[0126] When the invalid count exceeds a first preset threshold, the motor control system restarts. This mechanism establishes the objective boundary where a fault escalates from fault-tolerant to requiring intervention. The restart operation is a safety protection measure that clears any erroneous states that may exist in the controller, effectively preventing the motor from completely losing synchronization, becoming uncontrollable, or being damaged due to continuous invalid signals, thereby ensuring the ultimate safety and reliability of the system.

[0127] This application embodiment constructs an intelligent response strategy that matches the severity of a fault by using threshold comparison as the core judgment. This strategy can maintain operation during minor faults and take decisive final protection measures when the fault escalates, thereby achieving an optimal balance between system availability and reliability.

[0128] In some embodiments, when the control system for controlling the motor restarts, the motor can first be controlled to perform a software restart operation and update the software restart count value; if the software restart count value is greater than a third preset threshold, the motor can be controlled to perform a hardware restart.

[0129] If the software restart count is less than or equal to the third preset threshold, the subsequent hardware restart steps will not be executed. Instead, the system will wait for the next motor control cycle to start so that the motor control strategy for the next cycle can be executed.

[0130] Here, the control software restarts the motor, which involves resetting the controller's program logic or related drive modules. This process is rapid and has no impact on the power supply to the hardware circuitry. This is a lightweight fault recovery method that effectively resolves software-level faults caused by program crashes or data corruption, while minimizing disruption and interruption time to the overall system operation, thus facilitating rapid functional recovery.

[0131] When multiple software restarts fail (i.e., the software restart count exceeds the third preset threshold), a hardware restart is performed. Here, a hardware restart typically refers to powering off and then on the motor driver or Hall sensor power module, clearing hardware-level latch states or errors. This provides a fundamental recovery mechanism for resolving deep hardware failures caused by unstable power supplies, chip deadlocks, etc., serving as the final safeguard in the fault handling chain and ensuring the system's ultimate reliability and ability to recover even after a severe failure.

[0132] For example, embodiments of this application can perform a power-off and power-on operation on the Hall sensor to achieve a hardware restart.

[0133] This application embodiment constructs an intelligent restart strategy that progresses from light to heavy and upgrades step by step through a process of prioritizing software restart, counting and quantifying, and using hardware restart as a fallback. While striving to restore the system at the lowest cost, it also ensures effective handling of deep hardware failures, thereby comprehensively improving the system's fault tolerance and self-recovery capabilities.

[0134] Next, combined Figure 6 The motor control method provided in the embodiments of the present invention will be described in general.

[0135] It should be noted that the motor control method provided in this application embodiment is executed periodically during motor operation to achieve motor control.

[0136] First, read the Hall signal and fault flag bit in the internal register of the Hall sensor; Next, based on the fault flag bit, it can be determined whether the Hall sensor is in a faulty state; In a scenario where the Hall sensor is determined to be faulty, the current Hall signal is filtered out, the fault flag of the Hall sensor is cleared, and the invalid Hall signal count is incremented by 1. Next, it is detected whether the invalid count value of the Hall signal is greater than the first preset threshold; If the invalid count value of the Hall signal is less than or equal to the first preset threshold, the motor is controlled to work based on the previous reasonable Hall signal. If the invalid count value of the Hall signal is greater than the first preset threshold, the motor control software will be restarted, and the software restart count value will be incremented by 1. Next, check whether the software restart count value is greater than the third preset threshold; If the software restart count value is less than or equal to the third preset threshold, the remaining steps will not be executed, and the system will wait for the next control cycle to begin. If the software restart count value is greater than the third preset threshold, the Hall sensor power restart will be triggered.

[0137] If it is determined that the Hall sensor is not in a faulty state, read the system time corresponding to the current Hall signal and compare it with the system time corresponding to the previous reasonable Hall signal; If the time difference between the two systems is less than or equal to the preset difference threshold, then proceed to the steps described above: filtering out the current Hall signal, clearing the fault flag of the Hall sensor, and incrementing the invalid Hall signal count by 1. If the time difference between the two systems is greater than the preset difference threshold, the invalid count value of the Hall signal will be cleared to zero. Then, based on the motor rotation direction, it is compared with the previous reasonable Hall signal, and the current Hall signal is checked to see if it is reasonable; If the current Hall signal is reasonable, then update the reasonable Hall signal and its corresponding system time. This Hall signal and its corresponding system time can be used as the new previous reasonable Hall signal to provide a detection benchmark for the next Hall signal. Next, the motor is controlled based on the reasonable Hall signal.

[0138] If the current Hall signal is unreasonable, increment the unreasonable Hall signal count by 1. Next, it is detected whether the unreasonable count value of the Hall signal is greater than the second preset threshold; If the unreasonable count value of the Hall signal is less than or equal to the second preset threshold, wait for the preset time threshold, read the latest Hall signal in the register again, and jump to execute the step of comparing the current reasonable Hall signal with the previous reasonable Hall signal according to the motor direction, and checking whether the current Hall signal is reasonable. If the Hall signal count value is greater than the second preset threshold, the process will jump to the step of triggering the motor control software to restart and incrementing the count value by 1, and then execute the subsequent steps in sequence.

[0139] This application embodiment constructs a motor control method with real-time signal quality monitoring and multi-level intelligent decision-making. In the absence of faults, the method ensures the purity and reliability of the commutation signal through dual verification of effectiveness (anti-interference) and rationality (prevention of logical errors), thereby guaranteeing the smooth, efficient and low-noise operation of the motor from the source.

[0140] In the event of signal anomalies or malfunctions, a multi-level processing strategy, including historical value fault tolerance and delayed retries, is employed to maintain power output without the driver's awareness, avoiding sudden shutdowns caused by momentary interference or minor faults, thus greatly enhancing system availability. For persistent faults, a progressive response, from software restart to hardware restart, is triggered by preset thresholds, effectively differentiating the nature of the fault, recovering at minimal cost, and providing a final solution for deeper hardware problems, thus forming a comprehensive barrier from fault tolerance to safety protection.

[0141] In new energy vehicles, when the Hall sensors of the shift motor, clutch motor, and lubrication motor malfunction, the above-mentioned handling measures can quickly respond and restore normal operation without the driver's awareness, avoiding limited vehicle power output or even power loss, thus ensuring the vehicle's safety and stability.

[0142] Figure 7 This is a schematic diagram of the structure of a motor control device provided in one embodiment of this application. Figure 7 As shown, the motor control device provided in this embodiment may include: an acquisition module 701 and a processing module 702.

[0143] The acquisition module 701 is used to acquire the current Hall signal of the Hall sensor and determine whether the Hall sensor is in a fault state. Control module 702 is used for: If the Hall sensor is not in a fault state, then based on the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, it is determined whether to control the motor to work based on the current Hall signal. If the Hall sensor is faulty, the invalid Hall signal count is updated, and based on the updated invalid Hall signal count and the first preset threshold, it is determined whether to restart the motor control system.

[0144] In one possible implementation, the control module 702 is specifically used for: Based on the first system time corresponding to the current Hall signal, determine whether the current Hall signal is an interference signal; If it is determined that the current Hall signal is not an interference signal, then based on the signal state of the current Hall signal, determine whether the current Hall signal is a reasonable signal; If the current Hall signal is determined to be a valid signal, then the motor operation will be controlled based on the current Hall signal.

[0145] In one possible implementation, the control module 702 is specifically used for: Obtain the second system time corresponding to the previous reasonable Hall signal; Determine whether the time difference between the first system time and the second system time is greater than a preset difference threshold; If the time difference is greater than the preset difference threshold, then the current Hall signal is determined not to be an interference signal. If the time difference is less than or equal to the preset difference threshold, then the current Hall signal is determined to be an interference signal.

[0146] In one possible implementation, the control module 702 is further configured to: If it is determined that the current Hall signal is an interference signal, then proceed to the step of updating the invalid count value of the Hall signal; If it is determined that the current Hall signal is not an interference signal, the invalid count value of the Hall signal is cleared to zero, and the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal.

[0147] In one possible implementation, the control module 702 is further configured to: If the current Hall signal is determined to be an unreasonable signal, then update the unreasonable Hall signal count value; Detect whether the unreasonable count value of the Hall signal exceeds the second preset threshold; If the unreasonable count value of the Hall signal is less than or equal to the second preset threshold, after an interval of a preset time threshold, a new Hall signal is acquired again, and based on the new Hall signal, the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal. If the unreasonable count value of the Hall signal exceeds the second preset threshold, the control system for the motor will restart.

[0148] In one possible implementation, the control module 702 is specifically used for: Check whether the current Hall signal state is reasonable; If the current Hall signal state is reasonable, then based on the current Hall signal, the previous reasonable Hall signal, and the motor direction, detect whether the current Hall signal state transition sequence is reasonable; If the current Hall signal's state transition sequence is reasonable, then the current Hall signal is determined to be a reasonable signal.

[0149] In one possible implementation, the control module 702 is specifically used for: Based on the motor direction of rotation, determine the standard state transition sequence table corresponding to the motor direction of rotation; Based on the above reasonable Hall signal and standard state transition sequence table, determine the standard signal state under the standard transition sequence; If the current Hall signal is the same as the standard signal, then the state transition sequence of the current Hall signal is considered reasonable. If the current Hall signal is different from the standard signal state, then the state transition sequence of the current Hall signal is determined to be unreasonable.

[0150] In one possible implementation, the control module 702 is specifically used for: If the updated Hall signal invalid count value is less than or equal to the first preset threshold, then the motor is controlled to work based on the previous reasonable Hall signal. If the updated Hall signal invalid count value is greater than the first preset threshold, the control system controlling the motor will restart.

[0151] In one possible implementation, the control module 702 is specifically used for: Control the motor to perform a software restart operation and update the software restart counter value; If the software restart count value is greater than the third preset threshold, the motor will be controlled to perform a hardware restart.

[0152] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0153] Figure 8 This is a schematic diagram of the structure of a vehicle provided in one embodiment of this application. Figure 8 As shown, the vehicle 800 in this embodiment includes a processor 810 and a memory 820, wherein the memory 820 stores a computer program 821 that can run on the processor 810. When the processor 810 executes the computer program 821, it implements the steps in any of the above method embodiments, for example... Figure 2 Steps 201 to 203 are shown. Alternatively, when processor 810 executes computer program 821, it implements the functions of each module in the above-described device embodiments, for example... Figure 7 The functions of modules 701 to 702 are shown.

[0154] An embodiment of this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described motor control method.

[0155] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for controlling an electric motor, characterized in that, include: Acquire the current Hall signal of the Hall sensor and determine whether the Hall sensor is in a fault state; If the Hall sensor is not in a fault state, then based on the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, it is determined whether to control the motor to work based on the current Hall signal. If the Hall sensor is in a faulty state, the invalid count value of the Hall signal is updated, and based on the updated invalid count value of the Hall signal and the first preset threshold, it is determined whether to restart the control system of the motor.

2. The motor control method according to claim 1, characterized in that, The step of determining whether to control the motor to operate based on the current Hall signal, according to the first system time corresponding to the current Hall signal and the signal state of the current Hall signal, includes: Based on the first system time corresponding to the current Hall signal, determine whether the current Hall signal is an interference signal; If it is determined that the current Hall signal is not an interference signal, then based on the signal state of the current Hall signal, it is determined whether the current Hall signal is a reasonable signal; If the current Hall signal is determined to be a valid signal, then the motor operation is controlled based on the current Hall signal.

3. The motor control method according to claim 2, characterized in that, The step of determining whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal includes: Obtain the second system time corresponding to the previous reasonable Hall signal; Determine whether the time difference between the first system time and the second system time is greater than a preset difference threshold; If the time difference is greater than the preset difference threshold, then the current Hall signal is determined not to be an interference signal. If the time difference is less than or equal to the preset difference threshold, then the current Hall signal is determined to be an interference signal.

4. The motor control method according to claim 2 or 3, characterized in that, After determining whether the current Hall signal is an interference signal based on the first system time corresponding to the current Hall signal, the method further includes: If it is determined that the current Hall signal is an interference signal, then proceed to the step of updating the invalid count value of the Hall signal; If it is determined that the current Hall signal is not an interference signal, the invalid count value of the Hall signal is cleared to zero, and the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal.

5. The motor control method according to claim 2 or 3, characterized in that, After determining whether the current Hall signal is a valid signal based on the signal state of the current Hall signal, the method further includes: If the current Hall signal is determined to be an unreasonable signal, then the unreasonable Hall signal count value is updated; Detect whether the unreasonable count value of the Hall signal is greater than the second preset threshold; If the unreasonable count value of the Hall signal is less than or equal to the second preset threshold, after an interval of a preset time threshold, a new Hall signal is acquired again, and based on the new Hall signal, the process jumps to the step of determining whether the current Hall signal is a reasonable signal based on the signal state of the current Hall signal. If the unreasonable count value of the Hall signal exceeds the second preset threshold, the control system for the motor will restart.

6. The motor control method according to claim 2 or 3, characterized in that, Determining whether the current Hall signal is a valid signal based on the current signal state of the Hall signal includes: Detect whether the current Hall signal state is reasonable; If the current Hall signal state is reasonable, then based on the current Hall signal, the previous reasonable Hall signal, and the motor direction, detect whether the current Hall signal state transition sequence is reasonable; If the current Hall signal's state transition sequence is reasonable, then the current Hall signal is determined to be a reasonable signal.

7. The motor control method according to claim 6, characterized in that, The step of detecting whether the state transition sequence of the current Hall signal is reasonable based on the current Hall signal, the previous reasonable Hall signal, and the motor direction includes: Based on the motor direction of rotation, determine the standard state transition sequence table corresponding to the motor direction of rotation; Based on the aforementioned reasonable Hall signal and the standard state transition sequence table, determine the standard signal state under the standard transition sequence. If the current Hall signal is the same as the standard signal state, then the state transition sequence of the current Hall signal is determined to be reasonable; If the current Hall signal is different from the standard signal state, then the state transition sequence of the current Hall signal is determined to be unreasonable.

8. The motor control method according to any one of claims 1-3, characterized in that, The step of determining whether to restart the control system for the motor based on the updated invalid Hall signal count and a first preset threshold includes: If the updated invalid Hall signal count is less than or equal to the first preset threshold, then the motor is controlled to work based on the previous reasonable Hall signal. If the updated Hall signal invalid count value is greater than the first preset threshold, the control system controlling the motor will restart.

9. The motor control method according to claim 8, characterized in that, The restart of the control system for the motor includes: Control the motor to perform a software restart operation and update the software restart counter value; If the software restart count value is greater than the third preset threshold, the motor is controlled to perform a hardware restart.

10. A vehicle comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the motor control method as described in any one of claims 1 to 9.

Citation Information

Cited By

  • BLDC motor turn number anti-interference calculation method and system based on dynamic time window verification

    CN122001247A

  • A Method and System for Calculating the Anti-interference Count of BLDC Motors Based on Dynamic Time Window Verification

    CN122001247B