Method and device for detecting position of rotor of brushless direct current motor and electronic equipment
By converting Hall sensor outputs to analog voltage signals using a comparator and DAC, the method reduces MCU port usage, optimizing circuit layout, and ensures accurate rotor position detection in brushless DC motors, addressing the IO resource challenge and enhancing system reliability.
Patent Information
- Application Number
- CN202411201501.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-29
AI Technical Summary
The excessive use of MCU ports for rotor position detection in brushless DC motors leads to increased microcontroller package size, higher procurement costs, and limited resource space for other system components, posing a challenge in high-integration and cost-sensitive applications.
A method and device utilizing a comparator and digital-to-analog converter to convert Hall sensor outputs into analog voltage signals, reducing the need for multiple IO ports by integrating them into a single comparator circuit, allowing precise timing and position detection with reduced IO resource usage.
This approach efficiently processes Hall sensor outputs, saving IO ports, minimizing electromagnetic interference, and optimizing circuit layout, while ensuring accurate rotor position detection and control strategies like FOC, enhancing system reliability and flexibility.
Smart Images

Figure CN119070671A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control, and in particular to a method, device and electronic equipment for detecting the rotor position of a brushless DC motor. Background Art
[0002] In the current three-phase brushless motor control system, Hall sensors are key components used to accurately detect the rotor position. Their signals are usually monitored through specific functions of the motor control chip, such as using the capture mode of the TIMER or directly capturing the edge of the signal change through the interrupt mechanism of the IO port. For systems that implement sensored FOC (Field-Oriented Control) or similar sinusoidal wave control strategies, additional interface circuits or multi-channel TIMERs are often required to enhance signal processing capabilities and ensure accurate tracking and control of the rotor position.
[0003] Regardless of the technical path adopted, the above method inevitably relies 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 the IO interrupt mechanism is relied upon, these ports must support edge-triggered interrupts to ensure timely response to signal changes.
[0004] Under this situation, the IO resources occupied by the MCU when monitoring the rotor position has become a consideration that cannot be ignored. With the increasing maturity and high integration trend of brushless motor drive technology, as well as the market's increasingly stringent requirements for cost control, the IO resource usage is directly related to many aspects of system design. Specifically, the increase in IO resources often leads to an increase in the required microcontroller package size, which in turn places higher requirements on PCB layout, routing design, and overall circuit board optimization. At the same time, the increase in IO resource usage by the brushless motor system also limits the resource space that can be provided to customers or other parts of the system. As a result, some projects face the dilemma of choosing a microcontroller with a higher IO count to meet demand, which undoubtedly increases the cost of chip procurement. Summary of the invention
[0005] The embodiment of the present application provides a method and device 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, an embodiment of the present application provides a method for detecting a rotor position of a brushless DC motor, the method comprising:
[0007] The stator of the brushless mainstream motor is provided with three Hall sensors: the first Hall sensor, the second Hall sensor and the third Hall sensor, and the MCU microcontroller is provided with 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] Wherein, the method comprises:
[0010] The MCU is used to query the voltage value of the next target rotor position according to the current rotor position when determining the current rotor position, set the reference voltage value according to 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;
[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 reaches the next target rotor position, and clears the count value of the timer;
[0012] If a timer overflow interrupt is detected, the MCU determines that an abnormality occurs in the brushless DC motor.
[0013] In a second aspect, an embodiment of the present application provides a device for detecting a rotor position of a brushless DC motor, the device comprising:
[0014] A setting unit, configured to determine a voltage value of the current target rotor information according to the previous position information when determining the previous rotor position, set a reference voltage value according to the voltage value of the current target rotor information, configure the reference voltage value in a register of the mode converter, and start a timer to start timing;
[0015] a determination unit, 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;
[0016] The overflow unit is used to determine that an abnormality occurs in the brushless DC motor if a timer overflow interrupt is detected.
[0017] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0018] In a fourth aspect, an embodiment of the present application provides an electronic device, which 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, wherein the MCU has a built-in comparator and a digital-to-analog converter.
[0019] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0020] An innovative comparator circuit design is used 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, where the proportional differences of each resistor ensure that different Hall output combinations can be mapped to unique voltage values. These voltage values are then directed to the MCU's built-in comparator non-inverting input port, realizing the conversion from digital logic state to analog voltage signal.
[0021] At the inverting input of the comparator, this application integrates the output of the DAC (digital-to-analog converter), allowing the system to flexibly set the reference voltage threshold. Through real-time comparison of the voltages at the in-phase and inverting ends of the comparator, once the preset conditions are met, the comparator interrupt can be triggered, and the TIMER can be optionally started synchronously for precise timing. This mechanism not only realizes real-time monitoring of the rotor position, but also accurately captures the time difference of the Hall commutation, providing key data support for advanced control strategies such as rotary wave control or FOC (field-oriented control).
[0022] The design strategy of this application significantly reduces the IO resources required by the MCU. By converting the digital signal that originally required three independent IO ports to be processed into a single analog voltage signal for processing, it not only directly saves two valuable IO ports, but also effectively shortens the digital signal transmission path and reduces the risk of electromagnetic interference that may be introduced by long-distance wiring. This design optimization not only improves the overall reliability of the system, but also provides greater flexibility for subsequent circuit layout and wiring. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 It is a schematic diagram of the system architecture provided by the embodiment of the present application;
[0025] Figure 2is a flow chart of a method for detecting the rotor position of a brushless DC motor provided in an embodiment of the present application;
[0026] Figure 3 It is a structural schematic diagram of a device for detecting the rotor position of a brushless DC motor provided by the present application;
[0027] Figure 4 This is another structural schematic diagram of a device for detecting the rotor position of a brushless DC motor provided by the present application. DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0029] Figure 1 An exemplary system architecture of the method for detecting the rotor position of a brushless DC motor that can be applied to the present application is shown.
[0030] like Figure 1 As shown, 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), and the MCU has a built-in comparator and DAC (Digital to Analog Converter). Hall sensor 1, Hall sensor 2 and Hall sensor 3 are arranged on the stator of the brushless DC motor, and the arrangement method may be that the three Hall sensors are arranged on the stator at equal intervals, that is, the angle interval between two adjacent Hall sensors is 120 degrees, or the arrangement method may be that the three Hall sensors are distributed at 60 degrees, that is, the angle interval between Hall sensor 1 and Hall sensor 2 is 60 degrees, and the angle interval between Hall sensor 2 and Hall sensor 3 is 60 degrees.
[0031] The connection relationship of the above-mentioned components is 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 principles of the system architecture of this application include:
[0033] Reading Hall sensor signals: The MCU reads the signals connected to the three Hall sensors through its I / O port. These signals are expressed in the form of high or low levels. The level signals of the three Hall sensors are converted into analog voltage signals through resistors. The voltage value after the three voltage signals are superimposed reflects the current position of the rotor. Different voltage values correspond to different current positions of the rotor. The MCU determines the current position of the rotor through a built-in algorithm or lookup table based on the combination of Hall sensor signals read. Based on the current rotor position and the 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 through the DAC and to determine whether the rotor has reached the target position through a comparator.
[0034] The MCU sends instructions to the DAC through 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 of 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 as the negative input voltage of the comparator.
[0036] The MCU configures its internal timer module, sets the timer's initial value, frequency division factor, counting mode and other parameters to start timing. This timer is used to monitor the time required for the rotor to reach the target position. After the configuration is completed, the MCU starts the timer and starts timing.
[0037] The MCU's interrupt controller continuously monitors the comparator's interrupt signal. When the comparator's positive input (from the Hall sensor or some processed result of the 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 phase sequence of the motor). At the same time, the MCU clears the count value of the timer to prepare 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 the timer overflow interrupt. Motor speed calculation: RPM = F*60 / PP, RPM is the actual motor speed in revolutions per minute, F is the motor's electrical cycle frequency, and PP is the number of motor 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 coefficient. For example, when the minimum speed of the motor is 60rpm and the motor is a 1-pole motor, the timer period that needs to be configured is calculated as follows. First, the motor's electrical cycle frequency is calculated using the above formula, f = 1Hz, so the timer frequency can be set to be greater than 1Hz.
[0040] The MCU responds to the timer overflow interrupt and executes the interrupt service routine. In the interrupt service routine, the MCU determines that the brushless DC motor has not reached the target position within the expected time and regards it as an abnormality. The MCU may then take protective measures, such as shutting down, reporting errors, resetting control parameters, etc., 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 when abnormal conditions occur, thereby improving the operating reliability and efficiency of the motor.
[0042] In some embodiments of the present application, upon power-on, the MCU measures a voltage value at the positive input terminal of the comparator;
[0043] The MCU determines the initial position of the rotor according to the measured voltage value.
[0044] Among them, in order to ensure that the analog voltage generated by the Hall sensor output and the resistor network is stable, the MCU will wait for a preset delay time before performing the measurement. The voltage at the positive input of the comparator is sampled by using the MCU's built-in analog-to-digital converter (ADC, if the comparator output can be sampled by the ADC) or directly by reading the comparator input pin (if the MCU supports analog voltage reading). If the MCU does not have the function of directly reading analog voltage, it can be completed by software simulation (such as switching the IO to input mode at a fixed time 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 the preset voltage threshold or voltage range, which is determined in advance based on the corresponding relationship between the Hall sensor output combination and the rotor position. Through table lookup 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 position of the rotor can be accurately inferred.
[0045] In some embodiments of the present application, the MCU records the interval duration between two adjacent comparator interrupt events, and calculates the rotation speed of the brushless DC motor according to the interval duration.
[0046] First, during the initialization phase of the MCU, configure the comparator interrupt as a valid interrupt source and set the corresponding interrupt priority and interrupt vector. Write an interrupt service routine that will be called each time the comparator triggers an interrupt. The ISR must contain code to handle interrupt events, including recording the timestamp of the interrupt. Define two variables (such as lastInterruptTime and currentInterruptTime) in the MCU's memory to store the timestamps of the last and current interrupts. 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 the time value to currentInterruptTime, and assign the old value of currentInterruptTime to lastInterruptTime to update the timestamp record.
[0047] In the ISR or main loop (depending on the specific implementation), calculate the difference between currentInterruptTime and lastInterruptTime to get the interval between two adjacent comparator interrupt events (usually in microseconds or milliseconds). To ensure the accuracy of the calculation, check whether the timestamp is updated as expected to avoid incorrect calculations due to system delays or interrupt loss.
[0048] In a brushless DC motor, the rotation speed of the rotor (i.e., the speed) is proportional to the frequency of the signal generated by the Hall sensor, which in turn is directly related to the interval length between adjacent interrupt events. Therefore, the speed can be calculated by multiplying the inverse of the interval length by a constant related to the number of motor pole pairs and the Hall sensor layout.
[0049] Assume the speed is N (unit: rpm), the interval time is T (unit: seconds), and the number of motor pole pairs is P, then the 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, according to the interval time obtained in step 3 and the known motor parameters, the above speed calculation formula is executed to obtain the real-time speed of the motor.
[0050] The calculated speed data is output to the host computer or display device through the serial port, CAN bus or other communication interface to monitor the running status of the motor. In the system requiring closed-loop control, the speed data is used as a feedback signal, compared with the set value, and the control parameters of the motor (such as voltage, current, etc.) are adjusted through PID or other control algorithms to achieve precise speed control.
[0051] In some embodiments of the present application, the MCU is configured with a mapping relationship between voltage values and rotor positions, and voltage values of six target rotor positions are marked.
[0052] Among them, understand the output mode of the Hall sensor of the 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. According to the design and application requirements of the motor, identify 6 target rotor positions. These positions may be key points in the motor rotation process, such as commutation points or balance points. Determine the voltage range of the Hall sensor at different output states by connecting a resistor network to the Hall sensor output and measuring it with a voltmeter or oscilloscope. According to the measured voltage range, set one or more voltage thresholds for each target rotor position. These thresholds should be able to clearly distinguish different rotor positions and consider a certain margin to cope with voltage fluctuations and noise. Define a mapping table in the MCU's memory that contains the mapping relationship between each voltage threshold or voltage range and the corresponding rotor position. Fill the mapping table based on the voltage thresholds and rotor positions determined in step 2. 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 startup code, write an initialization function to load and verify the mapping table. Make sure the mapping table is correctly loaded into memory before the program is executed. Use the ADC to periodically sample the voltage value at the positive input of the comparator. Filter and denoise the sampled value to improve the accuracy of the measurement. 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 variable 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 to perform actual operation tests. Observe whether the rotor position detection is accurate and make adjustments as needed. Based on the test results, optimize the voltage threshold, filtering algorithm, and matching logic to improve the stability and reliability of the system.
[0055] The following will be combined with the attached Figure 2, the method for detecting the rotor position of a brushless DC motor provided in the embodiment of the present application is described in detail. Among them, the device for detecting the rotor position of a brushless DC motor in the embodiment of the present application can be Figure 1 The MCU shown.
[0056] See also Figure 2 , which is a flow chart of a method for detecting the rotor position of a brushless DC motor according to an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0057] S201, MCU is used to query the voltage value of the next target rotor position according to the current rotor position when determining the current rotor position, set the reference voltage value according to the voltage value of the next target rotor position, and write the reference voltage value in the register of the digital-to-analog converter to 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 reaches the next target rotor position and clears the count value of the timer.
[0059] S203: If a timer overflow interrupt is detected, the MCU determines that an abnormality occurs in the brushless DC motor.
[0060] The method embodiments provided in the above embodiments are Figure 1 The device embodiments in the embodiment belong to the same concept, and their implementation process is detailed in the method embodiment, which will not be repeated here.
[0061] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0062] See also Figure 3 , which shows a schematic diagram of the structure of a device for detecting the rotor position of a brushless DC motor provided by an exemplary embodiment of the present application, hereinafter referred to as device 3. The device 3 can be implemented as all or part of the MCU through software, hardware or a combination of both. The device 3 includes: a setting unit 301, a determination unit 302, and an overflow unit 303.
[0063] A setting unit 301 is used to determine the voltage value 302 of the current target rotor information according to the previous position information when determining the last rotor position, and to set a reference voltage value according to the voltage value of the current target rotor information, and to configure the reference voltage value in the register of the mode converter, and start the timer to start timing;
[0064] A determination unit 303 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;
[0065] The overflow unit is used to determine that an abnormality occurs in the brushless DC motor if a timer overflow interrupt is detected.
[0066] In one or more possible embodiments, it further includes:
[0067] A measuring unit, used to measure the voltage value of the positive input terminal of the comparator when powered on;
[0068] The MCU determines the initial position of the rotor according to the measured voltage value.
[0069] In one or more possible embodiments, it further includes:
[0070] The recording unit is used to record the interval duration between two adjacent comparator interruption events, and calculate the rotation speed of the brushless DC motor according to the interval duration.
[0071] In one or more possible embodiments, the three Hall sensors are distributed at equal intervals of 120 degrees, or at 60 degrees.
[0072] In one or more possible embodiments, it further includes:
[0073] The configuration unit is used to configure the mapping relationship between the voltage value and the rotor position, and the voltage values marked with 6 target rotor positions.
[0074] It should be noted that, when the device 3 provided in the above embodiment performs the method for detecting the rotor position of a brushless DC motor, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, 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 the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0075] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0076] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific execution process. Figure 2 The specific description of the illustrated embodiment will not be repeated here.
[0077] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction 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] See also Figure 4 , is a schematic diagram of a structure of a device for detecting the rotor position of a brushless DC motor provided in an embodiment of the present application. Figure 4 As shown, the device 400 for detecting the rotor position of a brushless DC motor (hereinafter referred to as the device 400 ) 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 realize the connection and 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 the control device.
[0081] Among them, the processor 401 may include one or more processing cores. The processor 401 uses various interfaces and lines to connect the various parts of the entire device 400, and executes various functions and processes data of the device 400 by running or executing instructions, programs, code sets or instruction sets stored in the memory 404, and calling data stored in the memory 404. Optionally, the processor 401 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 401 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 401, and it can be implemented separately through a chip.
[0082] Among them, the memory 404 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 404 includes a non-transitory computer-readable storage medium. The memory 404 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 404 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 404 may also be optionally at least one storage device located away from the aforementioned processor 401. As Figure 4 As shown, the memory 404 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program.
[0083] exist Figure 4 In the device 400 shown in FIG. 1 , the processor 401 may be used to call an application program stored in the memory 404 and specifically execute the following steps: Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.
[0084] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0085] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for detecting the rotor position of a brushless DC motor, characterized in that: The stator of the brushless mainstream motor is provided with three Hall sensors: the first Hall sensor, the second Hall sensor and the third Hall sensor, and the MCU microcontroller is provided with a comparator and a digital-to-analog converter; 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; Wherein, the method comprises: The MCU is used to query the voltage value of the next target rotor position according to the current rotor position when determining the current rotor position, set the reference voltage value according to 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; If a comparator interrupt event is detected before the timer overflows, the MCU determines that the actual rotor position of the brushless DC motor reaches the next target rotor position, and clears the count value of the timer; If a timer overflow interrupt is detected, the MCU determines that an abnormality occurs in the brushless DC motor.
2. The method according to claim 1, characterized in that Also includes: When power is turned on, measuring the voltage value of the positive input terminal of the comparator; The MCU determines the initial position of the rotor according to the measured voltage value.
3. The method according to claim 1, characterized in that Also includes: The interval duration between two adjacent comparator interrupt events is recorded, and the rotation speed of the brushless DC motor is calculated according to the interval duration.
4. The method according to claim 1, characterized in that: The three Hall sensors are distributed at equal intervals of 120 degrees or 60 degrees.
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 is marked with voltage values of six target rotor positions.
6. A device for detecting the rotor position of a brushless DC motor, characterized in that: include: A setting unit, configured to determine a voltage value of the current target rotor information according to the previous position information when determining the previous rotor position, set a reference voltage value according to the voltage value of the current target rotor information, configure the reference voltage value in a register of the mode converter, and start a timer to start timing; a determination unit, 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; The overflow unit is used to determine that an abnormality occurs in the brushless DC motor 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, and the computer program is suitable for being loaded by the processor and executing the steps of any one of claims 1 to 5.
8. An electronic device, characterized in that: include: 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, and the MCU is used to perform the steps 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
Motor driver of washing machine
JP2002315387A
Method and device for redundant analysis of hall-sensors in position determination of electric motors
WO2009077414A1
