A method and system for controlling the position of a rotor in the event of a hall sensor failure
By driving the rotary wheel motor to rotate and statistically analyzing signal changes when the Hall sensor fails, and then reconstructing the initial position using a normal sensor, the problem of lost closed-loop control caused by Hall sensor failure is solved, achieving precise position control of the motor and improving system adaptability.
Patent Information
- Application Number
- CN202611692628.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-29
- Publication Date
- 2026-11-27
AI Technical Summary
In motor control systems, Hall sensor failures can disrupt the closed-loop feedback circuit, making it impossible to stop the machine for replacement. This results in poor system adaptability, especially in applications where it is inconvenient to disassemble or install Hall sensors or where there are strict requirements for continuous system operation, making it impossible to maintain normal operation.
By driving the rotary motor to rotate one revolution, the Hall signal after software filtering is obtained, the number of signal changes is counted, the faulty sensor is identified, and the initial position is reconstructed using the signals from the remaining normal sensors. Combined with the motor drive steps, closed-loop position control is achieved.
Without replacing the faulty Hall sensor, the closed-loop control capability was restored, reducing system maintenance costs, improving operational robustness and adaptability, and ensuring accurate positioning of the system in the event of sensor failure.
Smart Images

Figure CN123184529A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of motor control technology and relates to a method and system for controlling the position of a wheel in the event of a Hall sensor failure. Background Technology
[0002] In motor control systems, position feedback is a crucial element for achieving precise closed-loop control. Hall effect sensors, due to their simple structure, low cost, and fast response, are widely used as position feedback devices for motor rotors or related moving parts. Typically, the Hall sensor is mounted on a stationary disk, while a magnet used to trigger the signal is mounted on a rotating turntable. As the turntable rotates, the magnet passes the Hall sensor, causing the sensor to output high and low level signals. By decoding these signals, the system can determine the current angle or position of the turntable, thereby driving the motor to achieve precise positioning.
[0003] Existing technology discloses a fault detection method for Hall position sensors. This method controls motor rotation and observes changes in the Hall signal array to make a comprehensive judgment, thereby locating the faulty Hall sensor. Compared to methods that only detect simple fault modes such as all high or all low levels, this method has the advantages of low false alarm rate and simple and practical detection method. However, the core of this existing technical solution lies in the detection and location of faults so that users can replace faulty sensors in a timely and accurate manner. Its technical approach is based on the premise that repair must be carried out after detection.
[0004] However, in practical applications, in systems using Hall effect sensors for position feedback control of motor rotation, the closed-loop feedback circuit will be immediately disrupted if one or more Hall effect sensors fail. Due to protection or logic deficiencies, traditional systems are often forced to switch from closed-loop control to open-loop control. For applications where it is inconvenient to disassemble or install Hall effect sensors or where continuous system operation is strictly required, it is impossible to stop the system to replace the faulty sensor. This leads to the system having to degrade its operation or even shut down, severely challenging the system's adaptability. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for controlling the position of a rotating wheel in the event of a Hall sensor failure, so as to solve the problems of inconvenient disassembly and assembly of Hall sensors or strict requirements for continuous system operation, inability to stop the machine to replace the faulty sensor, and poor system adaptability in application scenarios.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for controlling the position of a wheel in the event of a Hall sensor failure, comprising the following steps: After the system is powered on, the drive wheel motor drives the turntable to rotate one revolution; acquires the Hall signals of each Hall sensor after software filtering, and counts the number of changes between 0 and 1 of each Hall signal; If the number of changes in a Hall signal is less than a given number, then the Hall sensor is considered faulty. Based on the fault diagnosis results, the initial position of the wheel is determined using the signal from at least one Hall sensor that is determined to be normal. Based on the initial position, combined with the number of motor drive steps and / or the signal value of the normal Hall sensor, the wheel motor is controlled to drive the wheel to the target position.
[0007] Furthermore, acquiring the Hall signals from each Hall sensor after software filtering includes: The time parameters used in software filtering are determined in the following way: During the system debugging phase, the drive wheel motor drives the turntable to rotate at a constant speed, and the time for each Hall signal to sense the magnet is tested. One-third of the sensing time of the magnet is taken as the time parameter for software filtering, and the Hall signals used subsequently are all Hall signals filtered by this software.
[0008] Furthermore, the given number of times is selected in the following manner: Count the number of times e changes between 0 and 1 in the normal Hall sensor when the wheel rotates one revolution; set the given number th as th=e-2.
[0009] Furthermore, determining the initial position of the wheel using signals from at least one Hall sensor that is determined to be normal includes: Based on the fault diagnosis results, find the unique location point Hall signal value determined by the signal combination of at least one normal Hall sensor; The rotary motor is driven to rotate until the unique positioning point Hall signal value is detected, and the position corresponding to the positioning point is taken as the initial position.
[0010] Furthermore, the method of determining the initial position of the wheel using signals from at least one Hall sensor that is determined to be normal also includes: When the combination of signals from all normal Hall sensors cannot determine a unique positioning point, the initial position is determined by combining the number of rotation steps of the stepper motor between the two positions.
[0011] Furthermore, when the drive wheel motor generates a two-phase, dual-four-beat drive signal for driving the wheel motor, the duration of each high-level step of the drive signal is subdivided and controlled by using a cosine curve function lookup table or direct calculation.
[0012] Furthermore, determining that the Hall sensor is faulty includes: The number of changes is compared with the given number. If the number of changes is less than the given number, the Hall sensor is determined to be faulty; if the number of changes is greater than or equal to the given number, the Hall sensor is determined to be normal.
[0013] Secondly, the present invention provides a wheel position control system for situations where a Hall sensor fails, the system comprising: The fault detection module is used to drive the rotary motor to rotate the turntable one revolution after the system is powered on, acquire the Hall signals of each Hall sensor after software filtering, count the number of changes between 0 and 1 of each Hall signal, and determine that the Hall sensor is faulty when the number of changes of a Hall signal is less than a given number. The initial position determination module is used to determine the initial position of the wheel based on the fault determination result and using the signal from at least one Hall sensor that is determined to be normal. The motor control module is used to control the wheel motor to drive the wheel to the target position based on the initial position and the number of motor drive steps or the signal value of the normal Hall sensor.
[0014] Thirdly, the present invention provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described.
[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described.
[0016] Compared with the prior art, the present invention has the following technical effects: The rotary wheel position control method provided by this invention in the case of Hall sensor failure first drives the rotary wheel motor to rotate the turntable one revolution after the system is powered on, which can actively trigger the signals of all positioning points, providing a complete Hall signal sample for fault self-diagnosis; by acquiring the Hall signal after software filtering and counting the number of changes between 0 and 1, signal glitches can be effectively filtered out, avoiding level misjudgment caused by high frequency interference, thereby accurately reflecting the physical response process of each sensor channel; By comparing the statistically obtained number of changes with a given threshold, the faulty sensor channel can be objectively and quantitatively identified, avoiding the uncertainty of relying on human experience. Based on the fault identification result, the initial position positioning logic is reconstructed using only the signals of the remaining normal Hall sensors. This enables the unique determination of the absolute position of the wheel even under complex fault combinations where some sensors fail, thus restoring the benchmark for closed-loop control without replacing the faulty hardware. By combining this initial position with the number of motor drive steps and / or the signal values of normal Hall sensors for joint control, the wheel motor can still smoothly and accurately drive the wheel to any target position under fault conditions, maintaining the closed-loop control capability and positioning accuracy of the system.
[0017] Ultimately, this invention achieves the technical effect of closed-loop control of the wheel position without replacing the faulty Hall sensor, greatly reducing system maintenance costs and significantly improving the system's robustness and adaptability in the event of sensor failure. Attached Figure Description
[0018] Figure 1 This is a flowchart of the wheel position control method under Hall sensor failure conditions according to the present invention.
[0019] Figure 2 This is a schematic diagram of the sine and cosine lookup table data curves used in the subdivision control of the PWM drive signal in an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] The present invention will now be described in further detail with reference to the accompanying drawings: Example 1, see Figure 1 In one embodiment of the present invention, a method for controlling the position of a wheel in the event of a Hall sensor failure is provided. This method is used to automatically detect the failure state of the Hall sensor after the system is powered on, and after identifying the faulty sensor, to use the remaining normally functioning Hall sensors to accurately locate the initial position of the wheel, thereby achieving closed-loop position control.
[0023] Specifically, the wheel position control method for Hall sensor failure of the present invention includes the following steps: S1: After the system is powered on, the drive wheel motor rotates the turntable one revolution. The system acquires the Hall signals from each Hall sensor after software filtering and counts the number of changes between 0 and 1 for each Hall signal.
[0024] S2: If the number of changes in one Hall signal is less than the given number, then the Hall sensor is determined to be faulty.
[0025] S3: Based on the fault diagnosis results, use the signal from at least one Hall sensor that is determined to be normal to determine the initial position of the rotor.
[0026] S4: Based on the initial position, combined with the number of motor drive steps and / or the signal value of the normal Hall sensor, control the wheel motor to drive the wheel to the target position.
[0027] In step S1, a complete rotation is first performed, instructing the rotary motor to drive the turntable to complete a 360° mechanical rotation. This iterative motion ensures that each normally functioning Hall sensor has at least one opportunity to sense all the magnets, thus outputting a complete signal sequence containing multiple high and low level transitions. If a Hall sensor fails to respond correctly to the approach of a magnet due to hardware damage or other reasons, its output signal will not produce the expected multiple transitions during this full rotation.
[0028] The acquired raw Hall signals are processed. First, the Hall signals are software filtered, with the microprocessor using timed sampling and logical judgment to filter out extremely short-duration spike pulses. The filtered signal accurately reflects the relative positional relationship between the magnet and the sensor, thus eliminating noise glitches introduced by vibration, electromagnetic interference, etc. Next, characteristic statistics are performed on the filtered signal, recording the total number of times the signal level changes from 0 to 1 and from 1 to 0 during one rotation. This number of changes directly reflects the activity level of the sensor in sensing the magnet and responding. For magnets and sensors arranged according to preset rules, the theoretical number of changes per rotation is fixed, and the statistical value of the number of changes provides a direct and quantitative basis for subsequent fault diagnosis.
[0029] In step S2, based on the number of changes in each Hall signal counted in step S1, a binary classification of fault and non-fault states is performed. This classification process is completed through a single numerical comparison. Specifically, a given number is preset or dynamically calculated within the system. This given number represents the minimum number of changes the sensor should achieve under normal operating conditions. The actual number of changes for each Hall signal is logically compared with this given number. If the measured number of changes for a certain signal is less than the given number, it indicates that the sensor is sluggish or completely unresponsive throughout the entire rotation stroke, and its signal activity is significantly lower than expected. Therefore, the system determines that the Hall sensor in that signal is faulty and may mark it as an unreliable signal source. Conversely, if the number of changes reaches or exceeds the given number, the sensor is considered to be functioning normally. Through this quantitative comparison and judgment method, fault detection is automated and objective, eliminating the need for human observation and judgment.
[0030] In step S3, after step S2 identifies a faulty sensor, the original complete encoding table is missing some bits, resulting in multiple different locations potentially corresponding to the same incomplete signal combination. The position recognition logic is reconstructed based on the number of remaining normal Hall sensors and their physical layout on the fixed plate. The basis for this determination is that even after some sensors fail, there is still at least one position point whose corresponding set of signal combinations output by normal sensors is unique across the entire circumference. Step S4 performs the position-finding operation by driving the wheel motor to rotate and monitoring the signal combinations of these normal sensors in real time. When the detected signal combination perfectly matches a preset unique identifier combination, the specific reference position is considered found and set as the initial position of the wheel.
[0031] In step S4, the initial position successfully established in step S3 is used as the reference for all subsequent position control, and the normal closed-loop position control process begins. The control wheel motor performs incremental or decremental movement based on the number of drive steps; that is, the stepper motor is driven to rotate the corresponding number of steps according to the step difference between the target position and the initial position. Simultaneously, to further ensure accuracy and correct accumulated errors, the system continuously monitors the signal values of the normal Hall sensors during movement. Whenever the turntable passes a position point defined by the normal sensor, the signal value provides absolute position verification information. The system can use this information to perform real-time correction of the step-based open-loop drive, ensuring that the motor can accurately and without overshoot drive the turntable to the target position.
[0032] This invention provides a method for controlling the position of a rotating wheel in the event of a Hall sensor failure. By immediately driving the wheel to rotate one revolution upon system power-up, it replaces the passive waiting mode for the fault to occur, ensuring comprehensive fault identification. Software filtering of the Hall signal and counting of its transitions replaces coarse level state detection with quantified indicators, eliminating noise interference and accurately capturing the sensor's response capability. Fault determination is achieved by comparing the quantified indicators with dynamically set or preset thresholds, realizing a high degree of automation and objectivity in the diagnostic process. Immediately after fault determination, the system transitions to an initial position reconstruction process based on a combination of normal sensor signals, and in most cases, locks the initial position to a unique value, solving the problem of absolute position loss after partial sensor failure. Finally, by integrating absolute position verification based on normal sensor signals with incremental motion control based on the number of driving steps, a reliable closed-loop control system is constructed under fault conditions, restoring the accuracy and stability of position control.
[0033] The acquisition of Hall signals from each Hall sensor after software filtering includes: the time parameter used for software filtering is determined in the following way: during the system debugging phase, the drive wheel motor drives the turntable to rotate at a constant speed, and the time for each Hall signal to sense the magnet is tested; 1 / 3 of the time for sensing the magnet is taken as the time parameter for software filtering, and the Hall signals used subsequently are all Hall signals after software filtering.
[0034] Specifically, during the commissioning phase before the system is officially put into operation, the system will first drive the rotary motor to rotate at a rated constant speed. During this process, high-speed timed sampling is used to measure the duration from when the magnet approaches and begins to output a high level to when the magnet moves away and the output becomes low. This duration is called the Hall signal sensing time. The length of this sensing time directly depends on the motor speed and the physical dimensions of the magnet and sensor. After acquiring the sensing time, one-third of this value is taken and used as a time constant parameter, which is then fixed or set in the system's software filtering logic. In subsequent normal use and fault diagnosis, the microprocessor continuously acquires the level of the Hall signal pin. When a level change occurs, only when the level change remains stable for more than this software filtering time parameter is it recognized as a valid signal change; any pulse with a duration shorter than this parameter is considered a signal glitch or interference and is filtered out.
[0035] By using one-third of the induction time as the filtering time parameter, the filtering window is ensured to be both wider than the interference pulse width, effectively filtering out narrow pulse glitches caused by contact bounce or electromagnetic interference, thus guaranteeing the quality of the input signal and ensuring that the subsequent statistical count of 0 and 1 changes truly reflects the magnet's induction; and much smaller than the normal signal pulse width, preventing the filtering out of valid induction signals as glitches, ensuring the signal's authenticity and integrity. Furthermore, since this parameter is measured and calculated from the motor's actual operating conditions, it automatically matches the motor speed regardless of its variation, eliminating the need to adjust the filtering circuit parameters separately for systems with different speeds.
[0036] The given number is selected by counting the number of times e changes between 0 and 1 of the normal Hall sensor when the wheel rotates once; and setting the given number th to th=e-2.
[0037] Specifically, the given number th is a dynamically determined correlation value based on the current actual sensor layout and the number of magnets in the system. Under a normal operating condition, or theoretically deduced from the design parameters, the number of magnets that a normal Hall sensor passes in front of it during one rotation of the wheel is fixed, thus the number of changes e between 0 and 1 in its output is a fixed value. In actual operation, this value e can be obtained by averaging multiple normal channels or by directly taking the theoretical maximum value. In this embodiment, the given number th is set to e-2, which allows for a certain degree of signal loss or statistical error, providing a tolerance range. If the number of changes of a Hall sensor is lost by one or two transition edges due to occasional interference or slight contact problems, as long as the number of changes is still greater than or equal to th, it will not be misjudged as a fault. Through this dynamically correlated and tolerant threshold setting strategy, a balance is achieved between strictly judging true faults and tolerating transient disturbances, greatly reducing the probability of false fault reports and improving the robustness and reliability of fault diagnosis.
[0038] The step of determining the initial position of the wheel using signals from at least one Hall sensor that is determined to be normal includes: finding a unique positioning point Hall signal value determined by the combination of signals from at least one normal Hall sensor based on the fault determination result; driving the wheel motor to rotate until the unique positioning point Hall signal value is detected, and taking the position corresponding to the positioning point as the initial position.
[0039] Specifically, after identifying which Hall sensors have failed, the system immediately initiates an initial position search process. First, the system maintains a complete mapping table for fault-free conditions, such as Table 1 in the specific implementation. This table defines all combinations of Hall sensor signal values corresponding to each positioning point. Based on the current fault mask, the system dynamically removes the columns corresponding to the faulty sensors from this complete mapping table, resulting in a new, incomplete mapping table composed of the remaining normal sensor signals. Next, the system performs a uniqueness analysis on this incomplete mapping table, searching the entire set of positioning points around the circumference to find a positioning point whose corresponding combination of normal sensor signals is unique in the incomplete mapping table and does not repeat with any other positioning point's signal combination. This unique signal combination is the unique Hall signal value found for that positioning point. Then, the system instructs the rotary motor to begin rotating in a certain direction. During this process, the system no longer focuses on the faulty sensors but concentrates all its attention on continuously acquiring and comparing the signal combinations of the normal sensors. Once the combination of normal sensor signals acquired and filtered in real time perfectly matches the Hall signal value of the unique positioning point, it indicates that the turntable of the wheel has been driven to the specific, known positioning point.
[0040] When Hall sensor A is determined to be faulty, leaving only Hall sensors B and C functioning normally, a lookup table reveals that the combination of Hall signals B and C corresponding to the 144° positioning point is 10, and this combination is unique across the entire circumference. Based on this, the system locks the 144° position as the initial positioning target. Subsequently, the system drives the rotary wheel motor to rotate. When Hall sensor B is detected to be at a high level (1) and Hall sensor C at a low level (0), it is determined that the 144° position has been found, and this current physical position is immediately established as the initial position reference for subsequent control logic. This method directly utilizes the uniqueness of the remaining normal sensor signal combinations in physical space, successfully resolving the multi-position ambiguity problem caused by information loss and achieving absolute positioning.
[0041] The method of determining the initial position of the wheel using at least one signal from a Hall sensor that is determined to be normal further includes: when the combination of signals from all normal Hall sensors cannot determine a unique positioning point, determining the initial position by combining the number of rotation steps of the stepper motor between the two positions.
[0042] Specifically, this implementation addresses a more extreme failure scenario: if too many Hall sensors fail simultaneously, it becomes impossible to find any location point with a unique signal fingerprint on the circumference using only the signal combinations from the remaining normal sensors. In this case, the system switches to a composite positioning mode that incorporates motion travel. The system still attempts to find a relatively unique signal feature; for example, it first selects a location point from the incomplete mapping table with the least variation in the normal sensor signal combination or the easiest to identify as an intermediate anchor point. The drive motor rotates until the signal combination of this intermediate anchor point is detected. At this point, although the system has reached a known intermediate position, due to the non-uniqueness of the signal combination, the system does not know which of the many identical signal points on the circle it is located at. Starting from this intermediate anchor point, the drive motor rotates forward or backward an additional predetermined number of steps, less than the distance between two adjacent location points, so that the turntable moves to a pre-agreed, uniquely identifiable final position, and this position is used as the initial position.
[0043] Taking the extreme case where Hall sensors A and B both fail, leaving only Hall sensor C functioning normally, Hall sensor C only outputs a 1 at the 288° position. However, directly searching for this 1 signal makes it impossible for the system to distinguish whether the current position is indeed 288° or some other possible interference signal point. Therefore, the system's positioning strategy is changed: first, it continues to rotate forward; if Hall sensor C is not detected as 1 for an extended period, it continues to rotate forward; when Hall sensor C is detected as 1, it is considered that the anchor point at the 288° position has been found; then, the system immediately drives the motor to continue rotating forward for a predetermined number of steps, which corresponds precisely to the arc distance from the 288° position to the 0° position. After traversing this number of steps, the system considers itself to have accurately reached the 0° position and establishes this point as the initial position. Through this combined signal anchoring and step-based orientation strategy, this invention successfully extends the positioning capability to the harsh fault conditions where only a single sensor is functioning normally, greatly improving the system's robustness and survivability.
[0044] When generating a two-phase, dual-four-step PWM drive signal to drive the rotary motor, the duration of each high-level step of the PWM drive signal is subdivided and controlled by using a cosine curve function lookup table or direct calculation.
[0045] Specifically, subdividing the stepper motor drive is to improve its operational quality and make the rotation of the turntable smoother. The system generates a two-phase, dual-four-step PWM wave, which controls the current of the two-phase windings of the stepper motor through drive circuits such as an H-bridge. By using a cosine curve function lookup table or direct calculation, the duration of the high level of each step of the two-phase, dual-four-step motor PWM drive signal is subdivided, making the current waveform flowing through the motor windings approximate an ideal sine and cosine stepped wave, thus uniformly subdividing the motor's step angle into multiple smaller microsteps. This technique enables the rotor of the turntable to achieve near-continuous smooth rotation in space, greatly reducing the vibration and noise of traditional stepper motors during low-frequency operation, and preventing resonance phenomena that may occur at specific speeds, making the movement of the turntable during positioning and locating smoother and quieter.
[0046] The method of counting the number of changes between 0 and 1 in each Hall signal includes: if the number of changes is greater than 4, then the Hall sensor is determined to be normal.
[0047] Example 2: A method for controlling the position of a wheel in the event of a Hall sensor failure. Step 1: Five positions are evenly distributed around the rotating wheel, with each position spaced 72° apart. These positions are 0°, 72°, 144°, 216°, and 288°. Three Hall effect sensors are mounted on the fixed plate of the rotating wheel, and three magnets are mounted on the rotating disk. The disk and fixed plate are overlapped. The Hall effect sensing status when the rotating wheel motor rotates to the five positions is shown in Table 1. "1" indicates that the Hall effect sensor senses the magnet, and "0" indicates that the Hall effect sensor does not sense the magnet.
[0048] Table 1 Correspondence between Hall signal status and rotor position
[0049] The Hall ABC state between two adjacent positions is "000". The stepper motor requires 200 steps to complete one revolution, which takes 10 seconds. Tests showed that the time it takes for each Hall signal to sense the magnet is 150ms. Therefore, the time parameter for the Hall signal software filter is set to 50ms to prevent false detections due to signal jitter.
[0050] Step two: Upon system power-up, first drive the rotary motor to rotate one revolution clockwise to determine the fault state of the Hall sensor. Assuming the initial position is 0°, the rotary motor will rotate one revolution clockwise: The state of Hall signal A changes as follows: 0->0->1->0->1->0->1->0->0->0; The state of Hall signal B changes as follows: 1->0->1->0->1->0->0->0->0->0; The Hall signal C changes state as follows: 1->0->1->0->0->0->0->0->0->1->0.
[0051] The state transitions of the three Hall signals are all 6 times per rotation. In this embodiment, the number of changes for a normal Hall sensor is e=6, and th=4 is calculated from the given number th=e-2. The Hall sensor is considered normal if the number of state transitions of the Hall signal is greater than or equal to the given number th (i.e., greater than or equal to 4), and faulty if the number of state transitions is less than the given number th.
[0052] Step 3: There are a total of 8 possible scenarios for Hall sensor malfunctions: A malfunction, B / C normal; B malfunction, A / C normal; C malfunction, A / B normal; A / B malfunction, C normal; A / C malfunction, B normal; B / C malfunction, A normal; all three channels (A / B / C) malfunction; all three channels (A / B / C) normal.
[0053] (1) If Hall A fails, then according to Table 1, the 144° position can be determined as the initial position of rotation by the Hall B and C signals. Drive the motor to rotate forward and detect the Hall B and C signals. When they are “10”, it is considered that the system has found the 144° position. Then drive the motor to rotate backward and detect the Hall B and C signals. When they are “11”, it is considered that the 72° position has been found. Then drive the motor to rotate backward for 40 steps (the stepper motor rotates 200 steps in one revolution, with 5 uniform positions and 40 steps between two positions), and then position it at 0°. (2) If Hall B fails, the 72° position can be determined as the initial position of rotation based on the Hall A and C signals according to Table 1. Drive the motor to rotate forward and detect the Hall A and C signals. When they are “11”, it is considered that the system has found the 72° position. Then drive the motor to rotate backward and detect the Hall A and C signals. When they are “01”, it is considered that the 0° position has been found. (3) If Hall C fails, the 0° position can be determined from Hall A and B signals according to Table 1. Drive the motor to rotate forward and detect Hall A and B signals. When they are “01”, it is considered that the 0° position has been found. (4) If Hall A and B fail. Since one rotation of the stepper motor is 200 steps, there are 40 steps between two adjacent positioning points; when only one Hall is normal, its continuous low-level interval is divided into two segments of about 120 steps (long segment) and about 40 steps (short segment), so the number of steps for half a rotation, 100 steps, is taken as the threshold for distinguishing between long and short low-level intervals. Drive the motor to rotate forward, drive the motor to rotate forward and continuously monitor the Hall C signal, and record the number of steps of continuous low level; when it is detected that Hall C jumps from 0 to 1, and the continuous low level before the rising edge exceeds 100 steps, the jump position is determined to be the 288° position; then drive the motor to rotate forward for another 40 steps to position to 0°.
[0054] (5) If Hall A and C are faulty, only Hall B is normal. Drive the motor to rotate forward and continuously monitor the Hall B signal, and record the number of consecutive low levels. When Hall B is detected to jump from low level 0 to high level 1, and the consecutive low levels before the jump exceed 100 steps, the jump position is determined to be the 0° position. (6) If Hall B and C are faulty, only Hall A is normal. Drive the motor to rotate forward and continuously monitor the Hall A signal, recording the number of consecutive low-level steps; when it is detected that Hall A jumps from low level 0 to high level 1, and the consecutive low level before the jump exceeds 100 steps, the jump position is determined to be the 72° position; then drive the motor to rotate in reverse for 40 steps to position to 0°. (7) If Hall A, B, and C are all faulty, then the current position is considered to be the 0° position; (8) If Hall A, B, and C are all normal, drive the motor to rotate forward. The position where the Hall A, B, and C signals are detected as “011” is the 0° position.
[0055] Step four, the specific method for subdividing the PWM1 and PWM2 drive signals of the two-phase dual four-step motor into 200 subdivisions is as follows: The system control clock is 20MHz. The time for the motor to rotate one full 360° is 10s, with a total of 200 steps. Each step takes 50ms, and 1,000,000 20MHz clock cycles are required for one rotation. The clock cycles for each step are divided into 200 equal parts. The high-level duration of the two-phase dual four-step motor drive signals PWM1 and PWM2 within each drive time period is implemented using sine and cosine curve function lookup tables. The sine and cosine lookup table data curves are shown below. Figure 2 As shown (the shortest number of high-pulse clocks is set to 200, and the longest number of high-pulse clocks is set to 4700).
[0056] In another embodiment of the present invention, a wheel position control system for Hall sensor failure is provided, which can be used to implement the above-mentioned wheel position control method for Hall sensor failure. Specifically, the wheel position control system for Hall sensor failure includes: The fault detection module is used to drive the rotary motor to rotate the turntable one revolution after the system is powered on, acquire the Hall signals of each Hall sensor after software filtering, count the number of changes between 0 and 1 of each Hall signal, and determine that the Hall sensor of a certain Hall signal is faulty when the number of changes of a certain Hall signal is less than a given number.
[0057] The initial position determination module is used to determine the initial position of the rotor based on the fault determination result and using at least one Hall sensor signal that is determined to be normal.
[0058] The motor control module is used to control the wheel motor to drive the wheel to the target position based on the initial position, combined with the number of motor drive steps and / or the signal value of the normal Hall sensor.
[0059] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0060] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of a wheel position control method in the event of a Hall sensor failure.
[0061] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the wheel position control method in the above embodiment regarding Hall sensor failure.
[0062] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0063] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0064] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0065] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for controlling the position of a wheel in the event of a Hall sensor failure, characterized in that, Includes the following steps: After the system is powered on, the drive wheel motor drives the turntable to rotate one revolution, acquires the Hall signals of each Hall sensor after software filtering, and counts the number of changes between 0 and 1 of each Hall signal; If the number of changes in a Hall signal is less than a given number, then the Hall sensor is considered faulty. Based on the fault diagnosis results, the initial position of the wheel is determined using the signal from at least one Hall sensor that is determined to be normal. Based on the initial position, combined with the number of steps driven by the motor or the signal value of the normal Hall sensor, the rotary wheel motor is controlled to drive the rotary wheel to the target position.
2. The method for controlling the position of a wheel in the event of a Hall sensor failure according to claim 1, characterized in that, The acquisition of the Hall signals from each Hall sensor after software filtering includes: During the system debugging phase, the drive wheel motor drives the turntable to rotate at a constant speed, and the time for each Hall signal to sense the magnet is tested. One-third of the sensing time of the magnet is taken as the time parameter for software filtering, and the Hall signals used subsequently are all Hall signals filtered by this software.
3. The method for controlling the position of a wheel in the event of a Hall sensor failure according to claim 1, characterized in that, The given number is selected in the following manner: Count the number of times e changes between 0 and 1 in the normal Hall sensor when the wheel rotates one revolution; set the given number th as th=e-2.
4. The method for controlling the position of a wheel in the event of a Hall sensor failure according to claim 1, characterized in that, The method of determining the initial position of the wheel using signals from at least one Hall sensor that is determined to be normal includes: Based on the fault diagnosis results, find the unique location point Hall signal value determined by the signal combination of at least one normal Hall sensor; The drive wheel motor rotates until a unique positioning point Hall signal value is detected, and the position corresponding to that positioning point is taken as the initial position.
5. The method for controlling the position of a wheel in the event of a Hall sensor failure according to claim 4, characterized in that, The method of determining the initial position of the wheel using signals from at least one Hall sensor that is determined to be normal also includes: When the combination of signals from all normal Hall sensors cannot determine a unique positioning point, the initial position is determined by combining the number of rotation steps of the stepper motor between the two positions.
6. The method for controlling the position of a wheel in the event of a Hall sensor failure according to claim 1, characterized in that, When the drive wheel motor generates a two-phase, double four-beat drive signal to drive the wheel motor, the duration of each high-level step of the drive signal is subdivided and controlled by using a cosine curve function lookup table or direct calculation.
7. The method for controlling the position of a wheel in the event of a Hall sensor failure according to claim 1, characterized in that, The determination of the fault of the Hall sensor includes: The number of changes is compared with the given number. If the number of changes is less than the given number, the Hall sensor is determined to be faulty; if the number of changes is greater than or equal to the given number, the Hall sensor is determined to be normal.
8. A wheel position control system in case of Hall sensor failure, characterized in that, The system for performing the method according to any one of claims 1 to 7, the system comprising: The fault detection module is used to drive the rotary motor to rotate the turntable one revolution after the system is powered on, acquire the Hall signals of each Hall sensor after software filtering, count the number of changes between 0 and 1 of each Hall signal, and determine that the Hall sensor is faulty when the number of changes of a Hall signal is less than a given number. The initial position determination module is used to determine the initial position of the wheel based on the fault determination result and using the signal from at least one Hall sensor that is determined to be normal. The motor control module is used to control the wheel motor to drive the wheel to the target position based on the initial position and the number of motor drive steps or the signal value of the normal Hall sensor.
9. A computing device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 7.
