Three-phase brushless DC fan control system based on MCU and FOC
Through the three-phase brushless DC fan control system based on MCU and FOC, single-resistor sampling and adaptive position observer are adopted, combined with dual-resistor current reconstruction technology, which solves the problems of large torque pulsation, high noise, low efficiency and high FOC technology cost of traditional brushless fan control systems, and realizes low-cost, efficient and reliable fan control.
Patent Information
- Application Number
- CN202510893119.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-16
AI Technical Summary
Traditional brushless fan control systems have problems such as large torque pulsation, high noise, low efficiency, high FOC technology cost, and large resource consumption. They are difficult to cope with sudden load changes and achieve precise torque control.
A three-phase brushless DC fan control system based on MCU and FOC is adopted. The LCP067AK31EV8 MCU of Lingxin Microelectronics and the FOC algorithm are used. In combination with single-resistor sampling, adaptive position observer and dual-resistor current sampling, zero-speed closed-loop starting and heavy-load starting with and without wind are achieved. The CPU resource utilization of the FOC algorithm is reduced, and the system reliability is improved through multiple fault protection mechanisms.
It achieves low-cost, low-torque ripple, low-noise, and high-efficiency fan control, can control current quantization error at extremely low speeds, and improves system reliability and stability through a multi-level protection mechanism.
Smart Images

Figure CN120658162A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control technology, and in particular to a three-phase brushless DC fan control system based on MCU and FOC. Background Art
[0002] Traditional brushless fan control technology has numerous drawbacks. It primarily employs square-wave control (six-step commutation), relies on Hall sensors to detect rotor position, and uses square-wave drive to achieve commutation. This solution suffers from high torque pulsation, noticeable noise (especially at low speeds), and low efficiency, severely impacting fan lifespan and heat dissipation stability. Furthermore, conventional PID speed control struggles with sudden load changes (such as changes in wind resistance caused by dust accumulation), exhibits poor dynamic response, and cannot achieve precise torque control.
[0003] Existing FOC technology also faces application bottlenecks. Open-source FOC algorithms (such as SimpleFOC) consume a lot of STM32 resources, making them difficult to adapt to the real-time requirements of cooling fans. High-end FOC solutions (such as TI's DRV series chips) are expensive and rely on specialized hardware, making them unsuitable for low-cost cooling fans. Summary of the Invention
[0004] The present application provides a three-phase brushless DC fan control system based on MCU and FOC to solve the problems of large torque pulsation, high noise, low efficiency in existing control systems, and high cost and large resource occupation of existing FOC technology.
[0005] The first aspect of the present application provides a three-phase brushless DC fan control system based on MCU and FOC, including: a current sampling module, an MCU control module, a PWM drive module, an interrupt module, and a control protection module, wherein the sampling module is used to convert analog signals into digital signals and input them into the MCU control module, including current sampling and voltage sampling; the MCU control module is used to execute the FOC algorithm to generate PWM waves based on the ARM Cortex-M0 core, integrating a hardware divider and a CORDIC coprocessor, wherein the FOC algorithm includes Clarke transformation, Park transformation, current loop PI regulation, speed loop PI regulation and SVPWM generation; the PWM drive module is used to control the three-phase inverter according to the generated PWM wave; the interrupt module is used to implement the main algorithm execution operation and state machine switching of the MCU control module; the control protection module is used to monitor the control system status in real time, and execute corresponding protection measures when a fault occurs.
[0006] Optionally, the sampling module includes current sampling and voltage sampling, wherein the current sampling includes a bus current sampling circuit and a phase current sampling circuit, wherein the bus current adopts a single resistor sampling, and the phase current sampling adopts a dual resistor sampling principle. When the three lower bridge arms are turned on at the same time, two of the phase currents are collected through the freewheeling diode, and the other phase current is calculated based on the instantaneous sum of the three-phase currents being zero; the voltage sampling is bus voltage sampling.
[0007] Optionally, the MCU control module includes: a coordinate conversion module, a speed loop controller, a current loop controller, and a space vector pulse width modulation module, wherein the coordinate conversion module is used to convert the three-phase current into d-axis and q-axis currents in a rotating coordinate system through Clark transformation and Park transformation; the speed loop controller is an outer loop, used to compare the given speed and the actual speed feedback value, and adjust the given value of the output current inner loop through the PID controller; the current loop controller is an inner loop, used to derive the d-axis and q-axis components of the target voltage vector through the PID controller according to the output result of the speed loop controller, and then convert them into 、 axis component; the space vector pulse width modulation module is used according to the 、 The axis component determines the sector where the voltage vector is located, selects the working vector, calculates the vector action time and the switching points of the three-phase inverter switching devices, and generates a PWM wave.
[0008] Optionally, the PID controller includes a speed loop PID controller and a current loop PID controller. The speed loop PID controller is used to compare the set speed with the actual speed feedback value and adjust the output current inner loop set value through proportional and integral operations to achieve precise control of the fan speed. The current loop PID controller is used to compare the current set value output by the speed loop with the actual current feedback value and derive the d and q axis components of the target voltage vector through proportional and integral operations to achieve real-time regulation and control of the motor current. Optionally, the interrupt module includes: a TIM1 brake interrupt, a TIM1 CC5 interrupt, and a SysTick interrupt. The TIM1 brake interrupt is used to shut down the PWM output to implement hardware protection. It is triggered when a hardware overcurrent is detected and has an interrupt priority of 0. The TIM1 CC5 interrupt is used to execute the FOC inner loop control algorithm after the sampled data processing is completed, including state machine selection and jump. The interrupt frequency is consistent with the PWM switching cycle and has a priority of 1. The SysTick interrupt is used to execute the FOC outer loop control, detect protection mechanisms, and user functions. The interrupt frequency is 10kHz and has a priority of 3.
[0009] Optionally, the state machine is mainly executed and jumped in the TIM1 CC5 interrupt, and the states include: IDLE, INIT, STOP, START, PRECHARGE, TRACK, IDENTIFY, PARAMIDENT, OPENLOOP, CLOSEDLOOP, BRAKE, FAULT and WAIT.
[0010] Optionally, the control protection module includes: overcurrent protection, hardware overcurrent protection, current limiting protection, over-voltage and under-voltage protection, phase loss protection, overtemperature protection, stall protection, startup failure protection, and continuous startup failure protection.
[0011] Optionally, the adaptive position observer is independently developed by Lingxin Microelectronics LCP067AK31EV8, which is used to estimate the rotor position in sensorless mode and supports zero-speed starting and heavy-load starting with and against wind.
[0012] The second embodiment of the present application provides a three-phase brushless DC fan control method based on MCU and FOC, and the specific steps are as follows: collecting bus current and bus voltage through single-resistor sampling, collecting two-phase current when the three-phase lower bridge arm is freewheeling using the dual-resistor sampling principle, and reconstructing the third-phase current based on the three-phase current sum being zero; converting the three-phase current into d and q axis currents in a rotating coordinate system through Clark transformation and Park transformation, the speed loop PID controller compares the given speed with the actual speed feedback and outputs the d and q axis current given values, the current loop PID controller compares the d and q axis current given values with the actual values, and outputs the d and q axis components of the target voltage vector; converting the target voltage vector into the d and q axis currents through IPark inverse transformation 、 Axis components, input space vector Pulse Width Modulation The module determines the sector where the voltage vector is located, calculates the vector action time and the switching point of the three-phase inverter, and generates a PWM wave to drive the motor. It also monitors the control system status in real time and triggers corresponding protection when a fault occurs.
[0013] The beneficial effects achieved by adopting the above-mentioned present invention are as follows: The embodiment of the present application is based on the MCU and FOC algorithm of Lingxin Microelectronics LCP067AK31EV8, adopts a single-resistor sampling sensorless motor control solution, and is equipped with a self-developed adaptive position observer to achieve zero-speed closed-loop starting and heavy-load starting with or without wind. It does not require calibration of each unit, thus reducing mass production costs. It uses the chip's built-in hardware divider and Cordic coprocessor to reduce the CPU resource usage of the FOC algorithm, solving the problem of high resource consumption of open source algorithms. At the same time, it uses dual-resistor current sampling and three-phase current reconstruction technology to control current quantization errors at extremely low speeds. It also uses multiple types of fault protection mechanisms to improve system reliability. This solves the problems of large torque pulsation, high noise, low efficiency, and high cost and resource usage of existing FOC technology in existing control systems.
[0014] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which: Figure 1 This is a structural diagram of a three-phase brushless DC fan control system based on MCU and FOC according to an embodiment of the present application; Figure 2 A flowchart of an interruption provided according to an embodiment of the present application; Figure 3 A flowchart of each state of a state machine provided according to an embodiment of the present application; Figure 4 A flowchart of overcurrent protection provided according to an embodiment of the present application; Figure 5 This is a schematic diagram of Lingxin Microelectronics provided according to an embodiment of the present application.
[0016] Figure 6 The present invention provides a flowchart of a three-phase brushless DC fan control method based on MCU and FOC according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0018] The following describes a three-phase brushless DC fan control system based on MCU and FOC according to an embodiment of the present application with reference to the accompanying drawings. In response to the problems of large torque pulsation, high noise, low efficiency, high cost and large resource occupation in the existing control system mentioned in the above background technology, the present application provides a three-phase brushless DC fan control system based on MCU and FOC. In this system, based on the MCU and FOC algorithm of Lingxin Microelectronics LCP067AK31EV8, a single-resistor sampling sensorless motor control scheme is adopted, and a self-developed adaptive position observer is used to achieve zero-speed closed-loop starting and heavy-load wind and headwind starting, without the need for calibration of each unit, thereby reducing mass production costs; the chip's built-in hardware divider and Cordic coprocessor are used to reduce the CPU resource occupancy rate of the FOC algorithm, solving the problem of high resource consumption of open source algorithms, and at the same time, through dual-resistor current sampling and three-phase current reconstruction technology, the current quantization error is controlled at extremely low speeds; through multiple types of fault protection mechanisms, the system reliability is improved. Thus, the problems of large torque pulsation, high noise, low efficiency, high cost and large resource occupation in the existing control system are solved.
[0019] Specifically, Figure 1 This is a structural diagram of a three-phase brushless DC fan control system based on MCU and FOC provided in an embodiment of the present application.
[0020] like Figure 1 As shown, the three-phase brushless DC fan control system 10 based on MCU and FOC includes: a sampling module 100 , an MCU control module 200 , a PWM drive module 300 , an interrupt module 400 , and a control and protection module 500 .
[0021] Among them, the sampling module 100 is used to convert analog signals into digital signals and input them into the MCU control module, including current sampling and voltage sampling; the MCU control module 200 is used to execute the FOC algorithm to generate PWM waves based on the ARM Cortex-M0 core, integrating a hardware divider and a CORDIC coprocessor, wherein the FOC algorithm includes Clarke transformation, Park transformation, current loop PI regulation, speed loop PI regulation and SVPWM generation; the PWM drive module 300 is used to control the three-phase inverter according to the generated PWM wave; the interrupt module 400 is used to implement the main algorithm execution operation and state machine switching of the MCU control module; the control protection module 500 is used to monitor the control system status in real time and execute corresponding protection measures when a fault occurs.
[0022] It can be understood that the embodiment of the present application provides real-time data support for the FOC algorithm through the current sampling module; the MCU control module uses the ARM Cortex-M0 core and hardware divider, CORDIC coprocessor to efficiently execute the core process of the FOC algorithm to ensure control accuracy and computing efficiency; the PWM drive module accurately controls the three-phase inverter according to the generated PWM wave to form a closed-loop drive; the interrupt module ensures real-time system response by managing algorithm execution and state machine switching; the control protection module monitors and handles abnormalities in real time to improve system safety.
[0023] In an embodiment of the present application, the sampling module includes current sampling and voltage sampling, wherein the current sampling includes a bus current sampling circuit and a phase current sampling circuit, wherein the bus current is sampled using a single resistor, and the phase current sampling adopts a dual-resistance sampling principle. When the three lower bridge arms are turned on at the same time, two of the phase currents are collected through the freewheeling diode, and the other phase current is calculated based on the instantaneous sum of the three-phase currents being zero; the voltage sampling is bus voltage sampling.
[0024] Among them, the formula for the instantaneous sum of the three-phase current to be zero is: in, is the current value of phase A, is the current value of phase B, is the C phase current value.
[0025] Taking the three-phase brushless fan motor control as an example, when the motor is in the freewheeling phase of a certain PWM switching cycle, assuming that the power tubes of phases A and B of the lower bridge arm are turned on (phase C of the upper bridge arm is turned on), the current flows back through the freewheeling diodes of phases A and B, generating voltage signals on the sampling resistors of phases A and B. By collecting these two voltage values and converting them into current and , according to the relationship that the sum of the three-phase currents is zero, the C-phase current can be calculated. For example, if the sampling is =0.5A, =0.3A, then =-0.8A.
[0026] It is understood that the embodiments of the present application significantly reduce hardware cost and circuit complexity while ensuring control accuracy through a combined design of single-resistor bus current sampling and dual-resistor phase current sampling. Current sampling can monitor system power consumption and overcurrent risks in real time, and cooperate with the overcurrent protection circuit to achieve hardware-level fault blocking. Voltage sampling monitors the bus voltage through a resistor divider network, determines whether the voltage is within the safe range during the startup phase, and provides real-time warning of overvoltage and undervoltage faults during operation, ensuring stable operation of the system over a wide voltage range.
[0027] In the embodiment of the present application, the MCU control module includes: a coordinate conversion module, a speed loop controller, a current loop controller, and a space vector pulse width modulation module, wherein: The coordinate conversion module is used to convert the three-phase current into the d-axis and q-axis currents in the rotating coordinate system through Clark transformation and Park transformation; The speed loop controller is the outer loop, which is used to compare the given speed with the actual speed feedback value, and adjust the given value of the output current inner loop through the PID controller; The current loop controller is the inner loop, which is used to obtain the d and q axis components of the target voltage vector through the PID controller according to the output of the speed loop controller, and then inversely transform it into 、 Axis component; The space vector pulse width modulation module is used to 、 The axis component determines the sector where the voltage vector is located, selects the working vector, calculates the vector action time and the switching points of the three-phase inverter switching devices, and generates a PWM wave.
[0028] It should be noted that the formula for Clark transformation is: The formula for Park transformation is: in, , is the stationary coordinate system 、 Shaft current component, , are the d-axis and q-axis current components in the rotating coordinate system, is the rotation angle.
[0029] For example, when the fan needs to accelerate from 800rpm to 1500rpm, the coordinate conversion module converts the three-phase current ( =0.8A, =0.4A, then =-1.2A) is converted to the rotating coordinate system through Clark transformation and Park transformation =0.2A, =1.0A. The speed loop PID controller compares the given speed of 1500rpm with the actual speed of 850rpm and outputs the q-axis current given value of 1.8A. The current loop PID controller compares the current given value of 1.8A with the actual current value and calculates the target voltage vector =2V, =12V, which is converted to =1.7V, =11.9V. The space vector pulse width modulation module determines that the voltage vector is located in sector I and calculates the action time to be 42μs and 38μs respectively. The remaining time is filled with zero vectors, generating a PWM wave drive with a frequency of 20kHz.
[0030] It can be understood that the embodiments of the present application achieve high-precision, high-efficiency control of three-phase brushless DC fans through the coordinated design of coordinate transformation, dual-loop PI control, and space vector pulse width modulation. Coordinate transformation maps the current signal (abc) in the three-phase stationary coordinate system to the rotating coordinate system (dq), converting AC quantities into DC quantities and simplifying the control algorithm. The dual closed-loop structure of the speed loop and current loop forms a "speed-torque" cascade control. The outer speed loop uses PID to adjust the output current setpoint, while the inner current loop quickly tracks the current command, achieving a balance between dynamic response and steady-state accuracy. The space vector pulse width modulation module uses sector determination and vector synthesis to make the inverter output voltage closer to a sine wave, improving voltage utilization, reducing harmonic content, and minimizing motor iron loss and torque ripple.
[0031] In the embodiment of the present application, the PID controller includes a speed loop PID controller and a current loop PID controller, wherein: The speed loop PID controller is used to compare the given speed with the actual speed feedback value, and adjust the given value of the output current inner loop through proportional and integral operations to achieve precise control of the fan speed; The current loop PID controller is used to compare the current set value output by the speed loop with the actual current feedback value, and obtain the d and q axis components of the target voltage vector through proportional and integral operations to achieve real-time regulation and control of the motor current.
[0032] It is understandable that the embodiments of the present application utilize a dual-loop structure of a speed loop and a current loop, and achieve precise control and dynamic optimization of the fan speed and motor current through the coordinated design of proportional and integral operations. The speed loop, as the outer loop, compares the given speed with the actual speed feedback value, uses the proportional link to quickly respond to speed deviations, and the integral link to eliminate steady-state errors. The output is the given value of the current inner loop, ensuring that the fan can maintain a stable speed even when the load changes (such as wind resistance fluctuations). The current loop, as the inner loop, receives the current given value output by the speed loop and compares it with the actual current feedback value. The proportional link adjusts the current deviation in real time, and the integral link suppresses the current static error. The output is the d and q axis components of the target voltage vector, allowing the motor current to quickly track the command, effectively reducing the current harmonic content and improving motor efficiency.
[0033] In the embodiment of the present application, the interrupt module includes: TIM1 brake interrupt, TIM1 CC5 interrupt, SysTick interrupt, wherein, The TIM1 brake interrupt is used to shut down the PWM output to implement hardware protection. It is triggered when hardware overcurrent is detected, and the interrupt priority is 0. The TIM1 CC5 interrupt is used to execute the FOC inner loop control algorithm after the sampled data processing is completed, including state machine selection and jump. The interrupt frequency is consistent with the PWM switching cycle and the priority is 1; The SysTick interrupt is used to execute FOC outer loop control, detect protection mechanisms, and user functions. The interrupt frequency is 10kHz and the priority is 3.
[0034] Specifically, the interrupt flow chart is as follows Figure 2 shown.
[0035] For example, when the fan blades are stuck by foreign objects during fan operation, the bus current suddenly rises from 1.8A in normal operation to 4.2A. The hardware comparator detects that the sampling resistor voltage exceeds the overcurrent threshold and immediately triggers the TIM1 brake interrupt, turning off all PWM outputs to prevent the IGBT from burning out.
[0036] During normal operation, the TIM1 CC5 interrupt is triggered at a frequency of 20kHz. Each interrupt completes the Clark-Park transformation of the three-phase current sampling value, calculates the dq axis current, performs the current loop PI regulation, and outputs the PWM wave.
[0037] The SysTick interrupt detects the fan speed (for example, 1200 rpm) at a frequency of 10 kHz. When it detects that the speed is continuously lower than the set value (1000 rpm) and the current is greater than 1.5 times the rated value, the stall protection is triggered and the fan enters the FAULT state.
[0038] It can be understood that the embodiment of the present application ensures nanosecond response of overcurrent protection through the hardware direct path of TIM1 brake interrupt, reducing the risk of device damage; TIM1 CC5 interrupt is synchronized with the PWM cycle, so that the FOC inner loop control cycle error is less than 1%, the current loop response time is controlled within 50μs, and the torque pulsation is suppressed to ±3%; the low-frequency scheduling (10kHz) of SysTick interrupt balances computing resources and control requirements, avoiding MCU load overload caused by high-frequency interrupts.
[0039] In the embodiment of the present application, the state machine is mainly executed and jumped in the TIM1 CC5 interrupt, and the states include: IDLE, INIT, STOP, START, PRECHARGE, TRACK, IDENTIFY, PARAMIDENT, OPENLOOP, CLOSEDLOOP, BRAKE, FAULT and WAIT.
[0040] Specifically, the flow chart of each state of the state machine is as follows: Figure 3 shown.
[0041] Among them, IDLE represents the idle state; INIT indicates the initialization state, in which the PWM output is turned off, system parameters are initialized, and variables are cleared; STOP indicates the stop state, in which the bias of the current sampling amplifier is collected; START indicates the start state, in which the start signal and working voltage detection are started; PRECHARGE indicates the pre-charging state, in which pre-charging is realized; TRACK indicates the forward and reverse wind detection state, in which the belt speed re-casting judgment is realized; IDENTIFY indicates the identification state, in which the initial position and other identification functions are realized, the PWM output is turned on and the state is switched to the open-loop / closed-loop state; PARAMIDENT indicates the parameter identification state, in which offline parameter identification is realized; OPENLOOP indicates the open-loop state, in which open-loop control or open-loop startup is implemented; CLOSEDLOOP indicates the closed-loop state, in which closed-loop control, current inner-loop calculation, rotor position estimation, and FOC operation are implemented; BRAKE indicates the braking state, in which the braking process is performed when the machine is shut down; FAULT indicates an error state. After the system is protected, it jumps to this state machine and turns off the PWM output in this state. WAIT indicates the waiting state. After the system is protected, it waits for a certain period of time and then jumps to the initialization state to try to start again.
[0042] It is understandable that the embodiments of the present application use a state machine to break down complex control flows into independent and ordered state units. Each state has clear entry conditions and timeout thresholds, forming a fault self-detection mechanism. The hardware-level protection path of the FAULT state, combined with the intelligent restart strategy of the WAIT state, shortens recovery time when anomalies such as stalls and overcurrent occur, eliminating manual intervention.
[0043] In the embodiment of the present application, the control protection module includes: overcurrent protection, hardware overcurrent protection, current limiting protection, over-voltage and under-voltage protection, phase loss protection, overtemperature protection, stall protection, startup failure protection, and continuous startup failure protection.
[0044] Among them, overcurrent protection is achieved by triggering the TIM1 brake function through the MCU internal comparator (ACMP1) event, as follows: Figure 4As shown, the bus current flowing through the sampling resistor (R) generates a voltage, Vbus. This voltage is amplified by operational amplifiers OPA0 / 1 / 2 and then fed into the positive terminal of the comparator. The negative terminal of the comparator is connected to the output of the DAC (digital-to-analog converter). When the bus current exceeds a certain value, the voltage at the positive terminal of the comparator becomes higher than the voltage at the negative terminal. The MCU generates a TIM1 Break interrupt, disabling the PWM brake and thus implementing overcurrent protection.
[0045] Current limiting protection prevents the system from overload operation by limiting the speed loop output, that is, limiting the input of the q-axis current.
[0046] The over-voltage and under-voltage protection will detect the voltage in the Start state. If it is not within the over-voltage or under-voltage range, the motor will not start. In the running state, if the sampled voltage is lower than the set undervoltage or higher than the overvoltage threshold, an error will be reported and the machine will be shut down.
[0047] Phase loss protection means that when one or two phases of the three-phase power are missing during motor operation, the three-phase current reconstructed by sampling is unbalanced. The three-phase current imbalance is detected within a period of time (the time for triggering phase loss protection) and the phase loss protection mechanism is triggered.
[0048] Stall protection determines that the motor is stalled when the current amplitude is greater than a certain proportion of the rated current and the speed continues to fail to reach the set minimum speed.
[0049] Startup failure protection determines whether a startup has failed by detecting whether the motor's speed is below a set protection value within a certain startup time. Continuous startup failure protection is triggered multiple times, and the system can be set to shut down or restart as needed.
[0050] It can be understood that the embodiment of the present application establishes a multi-level, full-scenario fault detection and response mechanism through the control protection module, and constructs a full-dimensional safety protection system covering hardware overload, power supply anomaly, mechanical failure, etc. Overcurrent protection and hardware overcurrent protection form a double protection, quickly shutting down PWM to avoid power device burning and reducing the risk of device damage; current limiting protection prevents system overload by limiting q-axis current, and cooperates with over-voltage and under-voltage protection to monitor the input voltage in real time to ensure that the fan operates stably in a wide voltage range. Phase loss protection detects three-phase current imbalance and gives early warning of line faults to avoid winding burning caused by phase loss of the motor; stall protection is linked to start failure protection, and protection is triggered when the current suddenly rises and the speed continues to be lower than the threshold to prevent motor overheating caused by insufficient heat dissipation. Continuous start failure protection can customize the restart strategy to avoid the impact of frequent starts and stops on the power supply.
[0051] In the embodiment of the present application, the adaptive position observer is independently developed by Lingxin Microelectronics LCP067AK31EV8, which is used to estimate the rotor position in sensorless mode and supports zero-speed starting and heavy-load start-up with and against winds.
[0052] Specifically, if Figure 5 As shown, the LCP067AK31EV8 from LinkCore Microelectronics is based on a 32-bit ARM Cortex-M0 core with a maximum operating frequency of 108MHz and an operating voltage range of 2.0 to 5.5V. It has 64KB of built-in Flash and 10KB of SRAM. It integrates a hardware divider for Field-of-Current Operation (FOC) operations, a Cordic (Coordinate Rotation Digital Computer) coprocessor, operational amplifiers, comparators, and other analog peripherals. It also integrates a gate driver module, an LDO, and other modules.
[0053] It is understood that the embodiments of the present application, through the unique algorithm of the adaptive position observer, can accurately estimate the initial rotor position at zero speed, enabling direct closed-loop start of the motor and shortening startup time. In heavy-load and headwind scenarios, the observer adaptively adjusts the estimation strategy in real time, rapidly tracking rotor position changes, enhancing the motor's load capacity and backpressure tolerance, effectively avoiding stalls and ensuring stable fan operation. It also improves position estimation accuracy, reduces torque pulsation, and reduces operating noise to meet quiet requirements.
[0054] Next, a three-phase brushless DC fan control method based on MCU and FOC according to an embodiment of the present application is described with reference to the accompanying drawings.
[0055] like Figure 6 As shown, the three-phase brushless DC fan control method based on MCU and FOC includes the following steps: In step S101, the bus current and bus voltage are collected by single-resistor sampling, and the two-phase current is collected when the three-phase lower bridge arm is freewheeling using the dual-resistor sampling principle, and the third-phase current is reconstructed based on the zero sum of the three-phase currents.
[0056] It can be understood that the embodiment of the present application uses single-resistor bus sampling to save hardware costs, and dual-resistor phase current reconstruction saves sampling devices, which can reduce the overall circuit cost while adapting to the needs of low-cost cooling fans; the sampling accuracy controls errors and meets the strict requirements of the FOC algorithm for current feedback.
[0057] In step S102, the three-phase current is converted into d-axis and q-axis currents in the rotating coordinate system through Clark transformation and Park transformation. The speed loop PID controller compares the given speed with the actual speed feedback and outputs the d-axis and q-axis current given values. The current loop PID controller compares the d-axis and q-axis current given values with the actual values and outputs the d-axis and q-axis components of the target voltage vector.
[0058] It can be understood that the embodiment of the present application converts the three-phase current into d-axis and q-axis currents in a rotating coordinate system through Clark transformation and Park transformation, and combines the dual closed-loop control structure of the speed loop and current loop PID controller to achieve decoupling control of the motor torque and magnetic field, significantly improving the dynamic response capability and control accuracy of the system.
[0059] In step S103, the target voltage vector is converted into 、 Axis components, input space vector Pulse Width Modulation The module determines the sector where the voltage vector is located, calculates the vector action time and the switching point of the three-phase inverter, and generates a PWM wave to drive the motor.
[0060] It is understandable that the embodiment of the present application converts the d-axis and q-axis voltage components in the rotating coordinate system back to the stationary coordinate system through IPark inverse transformation, which is the space vector Pulse Width Modulation The module provides basic data; space vector Pulse Width Modulation By determining the sector in which the voltage vector resides and selectively synthesizing adjacent operating and zero vectors, the module optimizes the inverter's switching pattern, improving voltage utilization, reducing harmonic losses, and enhancing motor efficiency. Furthermore, by precisely calculating the vector action time and switching points, it effectively reduces torque ripple and operating noise, resulting in smoother and quieter fan operation. Furthermore, the flexible vector synthesis method enhances adaptability to diverse operating conditions. During heavy-load startups or sudden load changes, the output voltage can be rapidly adjusted, ensuring fast motor response and eliminating the risk of lost steps.
[0061] In step S104, the control system status is monitored in real time, and when a fault occurs, the corresponding protection is triggered.
[0062] Among them, protection includes overcurrent protection, hardware overcurrent protection, current limit protection, over-voltage and under-voltage protection, phase loss protection, overtemperature protection, stall protection, start failure protection, and continuous start failure protection.
[0063] It can be understood that the embodiments of the present application build an all-round, three-dimensional security protection network for the control system by combining real-time monitoring with a multi-level protection mechanism.
[0064] According to the embodiment of the present application, a three-phase brushless DC fan control method based on MCU and FOC is proposed. Based on the MCU and FOC algorithm of Lingxin Microelectronics LCP067AK31EV8, a single-resistor sampling sensorless motor control solution is adopted, and a self-developed adaptive position observer is used to achieve zero-speed closed-loop starting and heavy-load starting with and without wind. No calibration is required for each unit, reducing mass production costs. The chip's built-in hardware divider and Cordic coprocessor are used to reduce the CPU resource occupancy rate of the FOC algorithm, solving the problem of high resource consumption of open source algorithms. At the same time, dual-resistor current sampling and three-phase current reconstruction technology are used to control current quantization errors at extremely low speeds. Multiple types of fault protection mechanisms are used to improve system reliability. As a result, the problems of large torque pulsation, high noise, low efficiency, high cost and large resource usage of existing FOC technology in existing control systems are solved.
[0065] The following is a detailed description of a three-phase brushless DC fan control method based on MCU and FOC. When a 24V industrial cooling fan starts, it first samples the bus current using a single resistor: a 0.1Ω sampling resistor is connected in series with the bus circuit. When the fan is stationary, the bus current is approximately 0.2A, and the sampling resistor generates a voltage of 0.02V. Simultaneously, the bus voltage is sampled using 100kΩ and 10kΩ voltage dividers, converting the 24V voltage to 2.18V to confirm that the voltage is within the normal range. During the freewheeling phase, a dual-resistor sampling circuit connects a 0.05Ω resistor in series with each of the lower bridge arms of phases A and B. When the PWM control of the upper bridge arm, phase C, turns on, the freewheeling diodes in the lower bridge arms of phases A and B conduct, sampling a current of 0.3A for phase A and 0.2A for phase B. Since the sum of the three-phase currents is zero, the current of phase C is calculated to be -0.5A. This data is transmitted to the MCU in real time.
[0066] MCU converts the three-phase current ( =0.3A, =0.2A, =-0.5A) is converted to the stationary coordinate system by Clark transformation 、 The shaft current component is =0.3A, , the d and q axis current components in the rotating coordinate system are obtained by Park transformation: =0.43A, =0.16A, where the rotation angle is estimated by the adaptive position observer.
[0067] The given speed is 1200rpm, and the actual speed feedback is 0rpm (startup phase). The speed loop PID controller compares the given speed 1200rpm with the actual speed 0rpm and outputs the q-axis current given value of 1.2A. After comparing the actual value with the given value, the current loop PID controller calculates the target voltage vector =-0.5V, =10V. Set the target voltage vector =-0.5V, =10V is inversely transformed by IPark into =-5.43V, =8.41V.
[0068] Space Vector Pulse Width Modulation The module determines that the voltage vector is located in sector II and calculates the action time to be 35μs and 45μs, respectively, with the remaining time filled with zero vectors. It generates a 20kHz PWM wave to drive the three-phase inverter. The upper bridge arms A and B are disconnected, phase C is turned on, and the lower bridge arm A is disconnected, phase B is turned on. This starts the motor in open-loop mode, gradually increasing the speed to 300rpm before switching to closed-loop FOC control.
[0069] If dust clogs the fan blades during operation, the bus current surges from the normal 1.5A to 3.2A, exceeding the overcurrent threshold. The hardware comparator detects that the sampling resistor voltage exceeds 150mV, immediately triggering the TIM1 brake interrupt, shutting down all PWM outputs and entering the FAULT state. Simultaneously, the SysTick interrupt detects that the speed remains below 200rpm and the current exceeds 1.5 times the rated value, confirming a stall fault. The system waits 500ms in the WAIT state before attempting a restart. If the system fails to start three times in a row, the continuous start failure protection is triggered and the system shuts down to prevent motor overheating and burnout.
[0070] In summary, the embodiment of the present application adopts single-resistor bus sampling and dual-resistor phase current reconstruction technology for sampling, which reduces hardware costs while ensuring current sampling accuracy and providing accurate data support for the FOC algorithm; dual-loop PID control combined with Clark-Park transformation realizes decoupling regulation of motor torque and magnetic field, stabilizes speed control error, and shortens system response time. Pulse Width Modulation technology improves voltage utilization, reduces harmonic losses, and lowers operating noise, enhancing fan operation smoothness and quietness. Furthermore, a multi-level fault protection mechanism covers multiple fault types, effectively reducing maintenance costs and downtime risks, fully meeting the application requirements of efficient, reliable, and energy-saving industrial cooling fans.
[0071] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0072] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0073] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0074] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logical functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.
[0075] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
Claims
1. A three-phase brushless DC fan control system based on MCU and FOC, characterized in that: include: Sampling module, MCU control module, PWM drive module, interrupt module, control protection module, among which, The sampling module is used to convert analog signals into digital signals and input them into the MCU control module, including current sampling and voltage sampling; The MCU control module is used to generate PWM waves based on the ARM Cortex-M0 core, integrating a hardware divider and a CORDIC coprocessor, executing the FOC algorithm, wherein the FOC algorithm includes Clarke transformation, Park transformation, current loop PI regulation, speed loop PI regulation and SVPWM (space vector Pulse Width Modulation )generate; The PWM driving module is used to control the three-phase inverter according to the generated PWM wave; The interrupt module is used to implement the main algorithm execution operation and state machine switching of the MCU control module; The control and protection module is used to monitor the control system status in real time and execute corresponding protection measures when a fault occurs.
2. The three-phase brushless DC fan control system based on MCU and FOC according to claim 1, characterized in that: The sampling module includes current sampling and voltage sampling, wherein the current sampling includes a bus current sampling circuit and a phase current sampling circuit, wherein the bus current adopts a single resistor sampling, and the phase current sampling adopts a dual resistor sampling principle. When the three lower bridge arms are turned on at the same time, two phase currents are collected through the freewheeling diode, and the other phase current is calculated based on the instantaneous sum of the three-phase currents being zero; the voltage sampling is bus voltage sampling.
3. The three-phase brushless DC fan control system based on MCU and FOC according to claim 1, characterized in that: The MCU control module includes: a coordinate conversion module, a speed loop controller, a current loop controller, and a space vector pulse width modulation module, wherein: The coordinate conversion module is used to convert the three-phase current into d-axis and q-axis currents in a rotating coordinate system through Clark transformation and Park transformation; The speed loop controller is an outer loop, which is used to compare the given speed with the actual speed feedback value, and adjust the given value of the output current inner loop through the PID controller; The current loop controller is the inner loop, which is used to obtain the d and q axis components of the target voltage vector through the PID controller according to the output of the speed loop controller, and then inversely transform it into 、 Axis component; The space vector pulse width modulation module is used to 、 The axis component determines the sector where the voltage vector is located, selects the working vector, calculates the vector action time and the switching points of the three-phase inverter switching devices, and generates a PWM wave.
4. The three-phase brushless DC fan control system based on MCU and FOC according to claim 3 is characterized in that: The PID controller includes a speed loop PID controller and a current loop PID controller, wherein: The speed loop PID controller is used to compare the given speed with the actual speed feedback value, and adjust the given value of the output current inner loop through proportional and integral operations to achieve precise control of the fan speed; The current loop PID controller is used to compare the current set value output by the speed loop with the actual current feedback value, and obtain the d and q axis components of the target voltage vector through proportional and integral operations to achieve real-time regulation and control of the motor current.
5. The three-phase brushless DC fan control system based on MCU and FOC according to claim 1, characterized in that: The interrupt module includes: TIM1 brake interrupt, TIM1 CC5 interrupt, SysTick interrupt, among which, The TIM1 brake interrupt is used to shut down the PWM output to implement hardware protection. The triggering time is when the hardware overcurrent is detected. The interrupt priority is 0; The TIM1 CC5 interrupt is used to execute the FOC inner loop control algorithm after the sampled data processing is completed, including state machine selection and jump. The interrupt frequency is consistent with the PWM switching cycle and the priority is 1; The SysTick interrupt is used to execute FOC outer loop control, detect protection mechanisms and user functions, with an interrupt frequency of 10kHz and a priority of 3.
6. The three-phase brushless DC fan control system based on MCU and FOC according to claim 5, characterized in that: The state machine is mainly executed and jumped in the TIM1 CC5 interrupt, and the states include: IDLE, INIT, STOP, START, PRECHARGE, TRACK, IDENTIFY, PARAMIDENT, OPENLOOP, CLOSEDLOOP, BRAKE, FAULT and WAIT.
7. The three-phase brushless DC fan control system based on MCU and FOC according to claim 1, characterized in that: The control protection module includes: overcurrent protection, hardware overcurrent protection, current limiting protection, over-voltage and under-voltage protection, phase loss protection, overtemperature protection, stall protection, startup failure protection, and continuous startup failure protection.
8. The three-phase brushless DC fan control system based on MCU and FOC according to claim 1, characterized in that: It also includes an adaptive position observer, which is independently developed by Lingxin Microelectronics LCP067AK31EV8 and is used to estimate the rotor position in sensorless mode, supporting zero-speed starting and heavy-load starting with and against winds.
9. The three-phase brushless DC fan control method based on MCU and FOC according to claim 1, characterized in that: The specific steps are as follows: The bus current and bus voltage are collected by single-resistor sampling, and the two-phase current is collected during the freewheeling of the three-phase lower bridge arm using the dual-resistor sampling principle. The third-phase current is reconstructed based on the zero sum of the three-phase currents. The three-phase current is converted into d-axis and q-axis currents in the rotating coordinate system through Clark transformation and Park transformation. The speed loop PID controller compares the given speed with the actual speed feedback and outputs the d-axis and q-axis current given values. The current loop PID controller compares the d-axis and q-axis current given values with the actual values and outputs the d-axis and q-axis components of the target voltage vector. The target voltage vector is converted into 、 Axis components, input space vector Pulse Width Modulation The module determines the sector where the voltage vector is located, calculates the vector action time and the switching point of the three-phase inverter, and generates a PWM wave to drive the motor; Monitor the control system status in real time and trigger corresponding protection when a fault occurs.
Citation Information
Cited By
Highly integrated embedded motor control MCU chip and control system thereof
CN121635028A