A method, device and electronic equipment for detecting the position of a rotor of a brushless direct current motor
By converting the Hall sensor output into an analog voltage signal for processing, the problem of excessive MCU port usage is solved, enabling accurate detection and efficient control of the brushless motor rotor position, and reducing system cost and electromagnetic interference risk.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI HUGE IC CO LTD
- Filing Date
- 2024-08-29
- Publication Date
- 2026-05-01
AI Technical Summary
In existing brushless motor control systems, the excessive number of MCU ports leads to a shortage of I/O resources, increases the microcontroller package size and chip procurement costs, and limits other resource space.
The design employs a comparator and digital-to-analog converter to convert the Hall sensor output into an analog voltage signal through a parallel resistor network, thereby reducing the MCU IO resource consumption. Rotor position detection is achieved through timer and comparator interrupts.
It achieves accurate rotor position detection, reduces MCU IO resource consumption, lowers the risk of electromagnetic interference, improves system reliability and layout flexibility, and reduces costs.
Smart Images

Figure CN119070671B_ABST
Abstract
Description
A method, apparatus, and electronic device for detecting the rotor position of a brushless DC motor. Technical Field
[0001] This application relates to the field of motor control, and more particularly to a method, apparatus, and electronic device for detecting the rotor position of a brushless DC motor. Background Technology
[0002] In current three-phase brushless motor control systems, Hall effect sensors are key components used to accurately detect rotor position. Their signals are typically monitored through specific functions of the motor control chip, such as using a timer's capture mode or directly capturing the edges of signal changes via I / O port interrupt mechanisms. For systems implementing field-oriented control (FOC) or similar sinusoidal control strategies, additional interface circuitry or multi-channel timers are often required to enhance signal processing capabilities and ensure accurate rotor position tracking and control.
[0003] Regardless of the technical approach used, the above methods inevitably rely on at least three independent input ports to receive signals from three Hall sensors. If the TIMER capture mode is selected, these three ports must be explicitly configured as capture ports to capture and process signal change events; if an I / O interrupt mechanism is used, these ports must support edge-triggered interrupts to ensure timely response to signal changes.
[0004] In this context, the I / O resources occupied by the MCU when monitoring rotor position have become a significant consideration. With the increasing maturity and high integration of brushless motor drive technology, coupled with increasingly stringent cost control requirements, I / O resource usage directly impacts multiple aspects of system design. Specifically, increased I / O resources often lead to larger microcontroller packages, placing higher demands on PCB layout, trace design, and overall circuit board optimization. Simultaneously, the increased I / O resource usage of brushless motor systems limits the available resources for customers or other parts of the system. Some projects thus face the dilemma of selecting microcontrollers with higher I / O counts to meet requirements, undoubtedly increasing chip procurement costs. Summary of the Invention
[0005] This application provides a method and apparatus for detecting the rotor position of a brushless DC motor, which can solve the problem of excessive MCU port usage in the prior art. The technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a method for detecting the rotor position of a brushless DC motor, the method comprising:
[0007] The stator of a mainstream brushless motor is equipped with three Hall sensors: a first Hall sensor, a second Hall sensor, and a third Hall sensor. The MCU microcontroller contains a comparator and a digital-to-analog converter.
[0008] The first Hall sensor is connected to the positive input terminal of the comparator through a first resistor, the second Hall sensor is connected to the positive input terminal of the comparator through a second resistor, the third Hall sensor is connected to the positive input terminal of the comparator through a third resistor, the digital-to-analog converter is connected to the negative input terminal of the comparator, the first terminal of the capacitor is connected to the positive input terminal of the comparator, and the second terminal of the capacitor is grounded.
[0009] The method includes:
[0010] The MCU is used to, when determining the current rotor position, query the voltage value of the next target rotor position based on the current rotor position, set a reference voltage value based on the voltage value of the next target rotor position, write the reference voltage value into the register of the digital-to-analog converter, and start a timer to begin timing;
[0011] If a comparator interrupt event is detected before the timer overflows, the MCU determines that the actual rotor position of the brushless DC motor has reached the next target rotor position and clears the count value of the timer to zero.
[0012] If a timer overflow interrupt is detected, the MCU determines that the brushless DC motor has malfunctioned.
[0013] Secondly, embodiments of this application provide a device for detecting the rotor position of a brushless DC motor, the device comprising:
[0014] The setting unit is used to determine the voltage value of the current target rotor information based on the previous position information when determining the previous rotor position, and to set a reference voltage value based on the voltage value of the current target rotor information, and to configure the reference voltage value in the register of the mode converter, and to start a timer to start timing;
[0015] The determining unit is configured to, if a comparator interrupt event is detected before the timer overflows, determine that the rotor has reached the current target rotor position, and clear the count value of the timer to zero.
[0016] An overflow unit is used to determine that the brushless DC motor has malfunctioned if a timer overflow interrupt is detected.
[0017] Thirdly, embodiments of this application provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.
[0018] Fourthly, embodiments of this application provide an electronic device that may include: an MCU, a first Hall sensor, a second Hall sensor, a third Hall sensor, a first resistor, a second resistor, a third resistor, and a capacitor. The MCU has a built-in comparator and a digital-to-analog converter.
[0019] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following:
[0020] An innovative comparator circuit design is employed to achieve accurate detection and efficient processing of the Hall sensor output state. This method cleverly connects the outputs of three Hall devices in parallel through a carefully designed resistor network. The proportional differences between the resistors ensure that different combinations of Hall outputs can be mapped to unique voltage values. These voltage values are then guided to the non-inverting input port of the comparator built into the MCU, realizing the conversion from digital logic state to analog voltage signal.
[0021] This application integrates the output of a DAC (digital-to-analog converter) at the inverting input of the comparator, enabling the system to flexibly set the reference voltage threshold. By comparing the voltages at the non-inverting and inverting inputs of the comparator in real time, a comparator interrupt can be triggered once a preset condition is met, and optionally, a TIMER can be synchronously started for precise timing. This mechanism not only achieves real-time monitoring of the rotor position but also accurately captures the time difference of Hall commutation, providing crucial data support for advanced control strategies such as vortex control or FOC (field-oriented control).
[0022] The design strategy of this application significantly reduces the I / O resources required by the MCU. By converting the digital signal that originally required three independent I / O ports into a single analog voltage signal for processing, not only are two valuable I / O ports directly saved, but the digital signal transmission path is also effectively shortened, reducing the risk of electromagnetic interference that may be introduced by long-distance traces. This design optimization not only improves the overall reliability of the system, but also provides greater flexibility for subsequent circuit layout and routing. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, 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.
[0024] Figure 1 is a schematic diagram of the system architecture provided in an embodiment of this application;
[0025] Figure 2 is a flowchart illustrating the method for detecting the rotor position of a brushless DC motor provided in an embodiment of this application;
[0026] Figure 3 is a schematic diagram of the structure of a device for detecting the rotor position of a brushless DC motor provided in this application;
[0027] Figure 4 is another structural schematic diagram of a device for detecting the rotor position of a brushless DC motor provided in this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0029] Figure 1 illustrates an exemplary system architecture for the method of detecting the rotor position of a brushless DC motor that can be applied to this application.
[0030] As shown in Figure 1, the system architecture may include: Hall sensor 1, Hall sensor 2, Hall sensor 3, resistor 1, resistor 2, resistor 3, capacitor, and MCU (Microcontroller Unit). The MCU has a built-in comparator and DAC (Digital to Analog Converter). Hall sensors 1, 2, and 3 are mounted on the stator of the brushless DC motor. They can be positioned at equal intervals (120 degrees between adjacent sensors) or at 60-degree intervals (60 degrees between sensors 1 and 2, and 60 degrees between sensors 2 and 3).
[0031] The connection relationships of the above components are as follows: Hall sensor 1 is connected to the positive input terminal of the comparator through resistor 1, Hall sensor 2 is connected to the positive input terminal of the comparator through resistor 2, Hall sensor 3 is connected to the positive input terminal of the comparator through resistor 3, the negative input terminal of the comparator is connected to the DAC, the first end of the capacitor is connected to the positive input terminal of the comparator, and the second end of the capacitor is connected to the negative input terminal of the comparator.
[0032] The operating principle of the system architecture in this application includes:
[0033] Reading Hall sensor signals: The MCU reads signals connected to three Hall sensors through its I / O ports. These signals are represented as high or low levels. The level signals from the three Hall sensors are converted into analog voltage signals by resistors. The voltage value obtained by superimposing the three voltage signals reflects the current position of the rotor; different voltage values correspond to different current rotor positions. Based on the combination of read Hall sensor signals, the MCU determines the current rotor position using a built-in algorithm or lookup table. Based on the current rotor position and a predetermined control strategy (such as the six-step commutation method), the MCU calculates or queries the voltage value required to reach the next target rotor position. This voltage value is used to generate a reference voltage via a DAC and a comparator to determine whether the rotor has reached the target position.
[0034] The MCU sends instructions to the DAC via an internal bus (such as I2C, SPI, etc.) or a dedicated register interface to configure its output to the required reference voltage value.
[0035] The MCU writes the calculated reference voltage value (i.e., the voltage value at the next target rotor position) into the corresponding register of the DAC. The DAC then generates a stable analog voltage output based on this value, which serves as the negative input voltage of the comparator.
[0036] The MCU configures its internal timer module, setting parameters such as the initial timer value, division factor, and counting mode to begin timing. This timer monitors the time required for the rotor to reach the target position. After configuration, the MCU starts the timer and begins timing.
[0037] The MCU's interrupt controller continuously monitors the comparator's interrupt signal. When the positive input of the comparator (a result of some processing of the Hall sensor or motor phase voltage, depending on the circuit design) is greater than or equal to the negative input (the reference voltage generated by the DAC), the comparator output changes, triggering an interrupt.
[0038] The MCU responds to the comparator interrupt and executes the interrupt service routine. In the interrupt service routine, the MCU confirms that the rotor has reached the target position and may perform corresponding control operations (such as switching the motor's phase sequence). Simultaneously, the MCU clears the timer's count value to zero, preparing for the next timing operation.
[0039] If the comparator interrupt does not occur within the predetermined time (i.e., within the time threshold set by the timer), the timer will overflow and trigger a timer overflow interrupt. Motor speed calculation: RPM = F * 60 / PP, where RPM is the actual motor speed in revolutions per minute, F is the motor's electrical cycle frequency, and PP is the number of pole pairs. Timer frequency calculation: f = sys_clk / (period * div), where f is the timer frequency, sys_clk is the system clock, period is the period value, and div is the division factor. For example, if the motor's minimum speed is 60 rpm and it is a 1-pole motor, the required timer period is calculated as follows: First, calculate the motor's electrical cycle frequency using the above formula, f = 1 Hz, then the timer frequency can be set to be greater than 1 Hz.
[0040] The MCU responds to the timer overflow interrupt and executes the interrupt service routine. Within the interrupt service routine, the MCU determines that the brushless DC motor failed to reach the target position within the expected time, considering this an anomaly. The MCU may then take protective measures, such as stopping the motor, issuing an error message, or resetting control parameters, to ensure the safe operation of the motor.
[0041] Through the above steps, the MCU can accurately control the rotor position of the brushless DC motor and respond promptly in case of abnormalities, thereby improving the motor's operational reliability and efficiency.
[0042] In some embodiments of this application, the MCU measures the voltage value at the positive input terminal of the comparator upon power-up;
[0043] The MCU determines the initial position of the rotor based on the measured voltage value.
[0044] To ensure the analog voltage generated by the Hall sensor output and the resistor network is stable, the MCU waits for a preset delay before performing the measurement. The voltage at the positive input of the comparator is sampled using the MCU's built-in analog-to-digital converter (ADC, if the comparator output can be sampled via the ADC) or directly by reading the comparator input pin (if the MCU supports analog voltage reading). If the MCU does not have a direct analog voltage reading function, it can be done through software simulation (e.g., periodically switching the I / O to input mode and measuring the high-level duration to estimate the voltage) or with the assistance of an external ADC chip. The sampled voltage value is stored in the MCU's memory for subsequent processing. The MCU compares the sampled voltage value with a preset voltage threshold or range, which is determined in advance based on the correspondence between Hall sensor output combinations and rotor positions. Using a lookup table or logical judgment, the MCU maps the voltage value to the corresponding rotor position. Since each voltage value uniquely corresponds to one or more Hall output combinations, the initial rotor position can be accurately inferred.
[0045] In some embodiments of this application, the MCU records the interval between two adjacent comparator interrupt events and calculates the speed of the brushless DC motor based on the interval.
[0046] First, during the MCU initialization phase, configure the comparator interrupt as a valid interrupt source and set the corresponding interrupt priority and interrupt vector. Write an interrupt service routine (ISR), which will be called each time the comparator triggers an interrupt. The ISR must contain code to handle the interrupt event, including recording the timestamp of the interrupt occurrence. Define two variables (e.g., `lastInterruptTime` and `currentInterruptTime`) in the MCU's memory to store the timestamps of the last and current interrupt occurrences. In the ISR, whenever a comparator interrupt occurs, first read the current system time (which can be obtained through the MCU's timer or real-time clock RTC), then assign this time value to `currentInterruptTime`, and assign the old value of `currentInterruptTime` to `lastInterruptTime` to update the timestamp record.
[0047] In the ISR or the main loop (depending on the specific implementation), the difference between currentInterruptTime and lastInterruptTime is calculated to obtain the interval between two adjacent comparator interrupt events (usually in microseconds or milliseconds). To ensure the accuracy of the calculation, the timestamp update should be checked to ensure it is performed as expected, avoiding erroneous calculations due to system latency or interrupt loss.
[0048] In a brushless DC motor, the rotor's rotational speed (i.e., rotational speed) is directly proportional to the frequency of the signal generated by the Hall sensor, which in turn is directly related to the interval between adjacent interrupt events. Therefore, the rotational speed can be calculated by multiplying the reciprocal of the interval by a constant related to the number of pole pairs of the motor and the Hall sensor layout.
[0049] Let the rotational speed be N (revolutions per minute), the interval duration be T (seconds), and the number of pole pairs of the motor be P. Then, the rotational speed calculation formula can be simplified to N = (60 * constant) / T. Note that the "constant" here needs to be determined based on the specific parameters of the motor and the configuration of the Hall sensor. In the MCU, based on the interval duration obtained in step three and the known motor parameters, the above rotational speed calculation formula is executed to obtain the real-time rotational speed of the motor.
[0050] The calculated motor speed data is output to a host computer or display device via serial port, CAN bus, or other communication interfaces to monitor the motor's operating status. In systems requiring closed-loop control, the speed data is used as a feedback signal, compared with the setpoint, and the motor's control parameters (such as voltage and current) are adjusted using PID or other control algorithms to achieve precise speed control.
[0051] In some embodiments of this application, the MCU is configured with a mapping relationship between voltage values and rotor positions, and voltage values marked with six target rotor positions.
[0052] This involves understanding the output patterns of the Hall sensors in a brushless DC motor (BLDC) at different rotor positions. Typically, three Hall sensors provide a set of binary codes, each corresponding to a specific rotor position. Based on the motor's design and application requirements, six target rotor positions are identified. These positions may be critical points in the motor's rotation, such as commutation points or equilibrium points. By connecting a resistor network to the Hall sensor outputs and measuring with a voltmeter or oscilloscope, the voltage range of the Hall sensors in different output states is determined. Based on the measured voltage ranges, one or more voltage thresholds are set for each target rotor position. These thresholds should clearly distinguish different rotor positions and account for a margin to handle voltage fluctuations and noise. A mapping table is defined in the MCU's memory, containing the mapping relationship between each voltage threshold or voltage range and the corresponding rotor position. The mapping table is populated based on the voltage thresholds and rotor positions determined in step two. Each entry may include one or more voltage thresholds (or ranges) and an index or enumeration value pointing to the rotor position.
[0053] In the MCU's startup code, write an initialization function to load and verify the mapping table. Ensure the mapping table is correctly loaded into memory before program execution. Use an ADC to periodically sample the voltage value at the positive input of the comparator. Filter and denoise the sampled values to improve measurement accuracy. Compare the processed voltage value with the threshold in the mapping table to find the matching rotor position. Update the rotor position status: Once the current rotor position is determined, update the status register or variables in the MCU to reflect the new position information.
[0054] Write unit test code to verify the correctness of the mapping table and the accuracy of the voltage matching logic. Integrate the MCU with the brushless DC motor and Hall sensor system for actual operation testing. Observe the accuracy of rotor position detection and adjust as needed. Based on the test results, optimize the voltage threshold, filtering algorithm, and matching logic to improve the system's stability and reliability.
[0055] The method for detecting the rotor position of a brushless DC motor provided in this application embodiment will be described in detail below with reference to Figure 2. The device for detecting the rotor position of a brushless DC motor in this application embodiment can be the MCU shown in Figure 1.
[0056] Please refer to Figure 2, which is a flowchart illustrating a method for detecting the rotor position of a brushless DC motor according to an embodiment of this application. As shown in Figure 2, the method of this embodiment may include the following steps:
[0057] S201, the MCU is used to query the voltage value of the next target rotor position based on the current rotor position when the current rotor position is determined, set the reference voltage value based on the voltage value of the next target rotor position, write the reference voltage value into the register of the digital-to-analog converter, and start the timer to start timing.
[0058] S202. If a comparator interrupt event is detected before the timer overflows, the MCU determines that the actual rotor position of the brushless DC motor has reached the next target rotor position and clears the timer count value to zero.
[0059] S203. If a timer overflow interrupt is detected, the MCU determines that the brushless DC motor has malfunctioned.
[0060] The method embodiments provided above and the device embodiments in Figure 1 belong to the same concept. The implementation process is detailed in the method embodiments and will not be repeated here.
[0061] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0062] Please refer to Figure 3, which shows a schematic diagram of a device for detecting the rotor position of a brushless DC motor according to an exemplary embodiment of this application, hereinafter referred to as device 3. Device 3 can be implemented as all or part of an MCU through software, hardware, or a combination of both. Device 3 includes: a setting unit 301, a determining unit 302, and an overflow unit 303.
[0063] Setting unit 301 is used to determine the voltage value 302 of the current target rotor information based on the previous position information when determining the previous rotor position, and to set a reference voltage value based on the voltage value of the current target rotor information, and to configure the reference voltage value in the register of the mode converter, and to start a timer to start timing;
[0064] The determining unit 303 is used to determine that the rotor has reached the current target rotor position if a comparator interrupt event is detected before the timer overflows, and then clear the count value of the timer to zero.
[0065] An overflow unit is used to determine that the brushless DC motor has malfunctioned if a timer overflow interrupt is detected.
[0066] In one or more possible embodiments, it also includes:
[0067] A measurement unit is used to measure the voltage value at the positive input terminal of the comparator when powered on;
[0068] The MCU determines the initial position of the rotor based on the measured voltage value.
[0069] In one or more possible embodiments, it also includes:
[0070] The recording unit is used to record the interval between two adjacent comparator interrupt events and to calculate the speed of the brushless DC motor based on the interval.
[0071] In one or more possible embodiments, the three Hall sensors are distributed at 120-degree intervals or at 60-degree intervals.
[0072] In one or more possible embodiments, it also includes:
[0073] The configuration unit is used to configure the mapping relationship between voltage values and rotor positions, as well as the voltage values marked with six target rotor positions.
[0074] It should be noted that the above-described embodiment of the device 3, when performing the method for detecting the rotor position of a brushless DC motor, is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the above functions. Furthermore, the device for detecting the rotor position of a brushless DC motor provided in the above embodiment and the method embodiment for detecting the rotor position of a brushless DC motor belong to the same concept, and their implementation process is detailed in the method embodiment, which will not be repeated here.
[0075] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0076] This application also provides a computer storage medium that can store multiple instructions. These instructions are adapted to be loaded by a processor and executed as described in the embodiment shown in FIG2 above. For details of the execution process, please refer to the specific description of the embodiment shown in FIG2, which will not be repeated here.
[0077] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by the processor to implement the method for detecting the rotor position of a brushless DC motor as described in the above embodiments.
[0078] Please refer to Figure 4, which is a structural schematic diagram of a device for detecting the rotor position of a brushless DC motor according to an embodiment of this application. As shown in Figure 4, the device 400 (hereinafter referred to as device 400) for detecting the rotor position of a brushless DC motor may include: at least one processor 401, at least one network interface 403, a memory 404, and at least one communication bus 402.
[0079] The communication bus 402 is used to enable communication between these components.
[0080] The network interface 403 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface) for communicating with control devices.
[0081] The processor 401 may include one or more processing cores. The processor 401 connects to various parts within the device 400 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 404, and by calling data stored in the memory 404. Optionally, the processor 401 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 401 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 401.
[0082] The memory 404 may include random access memory (RAM) or read-only memory. Optionally, the memory 404 may include a non-transitory computer-readable storage medium. The memory 404 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 404 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 404 may also be at least one storage device located remotely from the aforementioned processor 401. As shown in FIG4, the memory 404, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.
[0083] In the device 400 shown in Figure 4, the processor 401 can be used to call the application program stored in the memory 404 and specifically execute the method shown in Figure 2. The specific process can be referred to Figure 2, and will not be repeated here.
[0084] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0085] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A method for detecting the rotor position of a brushless DC motor, characterized in that, The stator of the brushless DC motor is equipped with three Hall sensors: a first Hall sensor, a second Hall sensor, and a third Hall sensor. The MCU (Microcontroller Unit) contains a comparator and a digital-to-analog converter (DAC). The first Hall sensor is connected to the positive input of the comparator via a first resistor, the second Hall sensor via a second resistor, and the third Hall sensor via a third resistor. The DAC is connected to the negative input of the comparator. The positive input of the comparator is also connected to the first terminal of a capacitor, and the second terminal of the capacitor is grounded. The method includes: when determining the current rotor position, the MCU queries the voltage value of the next target rotor position based on the current rotor position, sets a reference voltage value based on the voltage value of the next target rotor position, writes the reference voltage value into the register of the DAC, and starts a timer. If a comparator interrupt event is detected before the timer overflows, the MCU determines that the actual rotor position of the brushless DC motor has reached the next target rotor position and clears the timer count. If a timer overflow interrupt is detected, the MCU determines that the brushless DC motor has malfunctioned.
2. The method according to claim 1, characterized in that, Also includes: Upon power-up, the voltage at the positive input terminal of the comparator is measured; the MCU determines the initial position of the rotor based on the measured voltage value.
3. The method according to claim 1, characterized in that, Also includes: Record the interval between two adjacent comparator interrupt events, and calculate the speed of the brushless DC motor based on the interval.
4. The method according to claim 1, characterized in that, The three Hall sensors are distributed at 120-degree intervals or at 60-degree intervals.
5. The method according to claim 1, characterized in that, Also includes: The MCU is configured with a mapping relationship between voltage values and rotor positions, and voltage values marked with six target rotor positions.
6. A device for detecting the rotor position of a brushless DC motor, characterized in that, include: The setting unit is used to determine the voltage value of the current target rotor position based on the previous rotor position when the previous rotor position is determined, and to set a reference voltage value based on the voltage value of the current target rotor position, and to configure the reference voltage value in the register of the digital-to-analog converter, and to start a timer to start timing; The determining unit is used to determine that the rotor has reached the current target rotor position and clear the count value of the timer if a comparator interrupt event is detected before the timer overflows, based on the comparison between the synthesized voltage value generated by the collection of each Hall sensor through resistors and the reference voltage value; the overflow unit is used to determine that the brushless DC motor has malfunctioned if a timer overflow interrupt is detected.
7. A device for detecting the rotor position of a brushless DC motor, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed as described in any one of claims 1 to 5.
8. An electronic device, characterized in that, include: The MCU includes a first Hall sensor, a second Hall sensor, a third Hall sensor, a first resistor, a second resistor, a third resistor, and a capacitor. The MCU has a built-in comparator and a digital-to-analog converter. The MCU is used to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Brushless direct current permanent magnet motor electromechanical integration structure for electric automobiles
CN201414063Y
Brushless motor rotor position detection circuit based on Hall sensor
CN212935802U