Introduction
Brushless motors are widely used in industrial automation, drones, electric vehicles, and other fields due to their advantages such as high efficiency, low noise, and long lifespan. In the control of brushless motors, speed control is a critical issue. To achieve precise speed control, closed-loop control technology is commonly applied. This article will explore closed-loop control methods based on PWM signals and FG signals.
1. Problems Addressed by Closed-loop Control:
Inaccurate speed or unexpected stalling at low speeds due to fluctuations in external factors such as load and voltage. For NIDEC diaphragm pumps, due to individual differences in the pumps and variations in the pipelines conveying the medium, when applied in ultra-low flow scenarios, issues such as significant motor speed fluctuations, motor stall protection, and excessive flow fluctuations may occur due to reduced motor output torque at low PWM duty cycles. Closed-loop control can detect abnormal low speeds before motor stalling, promptly intervene with PWM to accelerate the motor in time, avoid stalling, and eliminate potential product quality issues for users during low-flow control.
2. Closed-loop Implementation Methods:
2.1 Hardware Preparation Connect the motor PWM signal and FG signal to the MCU's I/O pins, as shown in the figure below:

2.2 Software Control Algorithm For general speed control, it is sufficient to simply judge the FG frequency and adjust the PWM in real time, as shown in the figure below:
Adjusting the S and T values can change the final speed. Adjusting the n value can modify the closed-loop performance.
2.3 Other Closed-loop Control Methods The above is the simplest closed-loop control algorithm, whose basic idea is to adjust the duty cycle of the PWM signal based on changes in the FG signal. For applications requiring higher speed accuracy and sufficient MCU computing power, the following control methods can also be adopted:
2.3.1 PID Algorithm: The advantage of PID control is its high control accuracy, making it suitable for most linear systems. However, tuning PID parameters is relatively complex, and its effectiveness in controlling nonlinear systems is limited.
2.3.2 Fuzzy Control Algorithm: Fuzzy control is a control method based on fuzzy logic, suitable for nonlinear, uncertain, and complex systems.
3. Conclusion
Closed-loop control plays a significant role in the speed control of brushless motors. By combining PWM signals and FG signals, precise control of motor speed can be achieved. In practical applications, the appropriate control algorithm should be selected based on specific requirements, and control parameters should be optimized through experimental debugging to achieve the best control results.