Design of a DSP-based brushless DC motor control system
2026-04-06 06:07:13··#1
Abstract: This paper introduces the design and implementation of a brushless DC motor control system based on the high-performance TMS320F2812 DSP chip. The main components of the system hardware circuit, the motor control strategy, and the software structure are included. Experiments show that the system has a simple and compact structure, high control accuracy, and good static and dynamic performance. Keywords: Brushless DC motor; TMS320F2812; Control system Experimental results show that the system has a simple and compact structure, high control precision, and good dynamic and static characteristics. Key Words: brushless DC motor; TMS320F2812; control system 1. Introduction Brushless DC motors replace the mechanical brushes and commutator in traditional DC motors with electronic commutators. Therefore, they not only retain the advantages of high operating efficiency and good speed regulation of DC motors, but also possess the advantages of simple structure, reliable operation, and convenient maintenance of AC motors. Due to the lack of mechanical commutation limitations, they are easy to achieve large capacity and high speed, and are currently widely used in aerospace, military, CNC, metallurgy, and medical device fields. The TMSF2812 DSP is a newly launched fixed-point digital signal processor based on the TMS320C2xx core from TI. The device integrates a variety of advanced peripherals and has flexible and reliable control and communication modules. It can completely realize the control and communication functions of a motor control system using a single chip, simplifying and modularizing the motor control system, and providing a good platform for the implementation of applications in motors and other motion control fields. This paper designs and implements a brushless DC motor control system based on the TI TMS320F2812 DSP chip. The entire system has a compact structure and complete functions. 2. System Hardware Design The hardware block diagram of the system is shown in Figure 1. It can be seen that it basically includes a DSP control board with the TMS320F2812 DSP as the core, a matching power drive board, and a brushless DC motor. [align=center] Figure 1 System Hardware Block Diagram[/align] 2.1 Control Part Hardware Design The control board is based on the TMS320F2812, plus some peripheral circuits and interfaces. The main functions implemented are receiving and executing control commands, receiving and processing speed signals, receiving and converting current sampling signals, and executing speed closed-loop and current closed-loop control algorithms. The motor control mainly uses two dedicated motor control peripherals on the F2812 chip—EVA and EVB. A general-purpose timer T1, in conjunction with a PWM generator, generates six PWM signals required to drive the power devices. Three motor Hall sensor signals are input to the capture unit via a GPIO interface to obtain the positions of the three rotors, thereby controlling the motor commutation and calculating the motor speed. Two 12-bit AD modules convert and store the phase current signal Iphase and the input speed regulation voltage signal Vref, serving as feedback signals for the current loop and reference signals for the speed loop, respectively. The on-chip general-purpose input/output interface (GPIO) connects to the power drive section, outputting start/stop signals, forward/reverse signals, emergency braking signals, etc., while receiving input protection signals, fault signals, etc. The on-chip SCI module enables communication with the computer, receiving control commands from the host computer. The hardware structure of the control section is shown in Figure 2. [align=center]Figure 2 Control Board Circuit Block Diagram[/align] 2.2 Power Drive Section Hardware Design The hardware circuit of the power drive section mainly consists of a pre-driver chip and six power MOSFETs. It processes the commutation information transmitted from the control section and isolates and amplifies the PWM signal, controlling the conduction and cutoff of the power MOSFETs to control the motor's operating state and speed. In addition, there are auxiliary circuits such as a power supply circuit, current detection circuit, overcurrent protection and emergency braking circuit, as well as interface circuits with the motor and control board. The pre-driver chip uses the IR2131 MOSFET driver chip from IR Corporation, which features high integration, high reliability, high speed, overcurrent and undervoltage protection, and convenient debugging. The IR2131 has internal overcurrent, overvoltage, and undervoltage protection. The power drive circuit uses a 24V power supply. The connection between the drive circuit and the motor adopts a three-phase full-bridge configuration, and the motor operates in a three-phase six-state mode. The commutation elements are controlled so that only two phases of the motor are conducting at any given time. The PWM modulation method is soft chopping, meaning that the lower bridge arm power transistor remains on during conduction, while the switching of the upper bridge arm power transistor is determined by the PWM signal. The power switching transistors use HITACHI's integrated power switching device 6AM15, which integrates three N-type MOSFETs and a P-type MOSFET to form a three-phase full-bridge power switching circuit. Compared to using six discrete MOSFETs, this method improves integration, reduces circuit board area, and increases reliability. Each MOSFET has a built-in ultra-fast recovery diode, which provides reverse freewheeling during MOSFET off-state. The power drive circuit block diagram is shown in Figure 3. [align=center] Figure 3 Power Main Circuit Block Diagram[/align] 3. System Control Strategy and Software Design 3.1 System Control Strategy From the mathematical model of the brushless DC motor, it can be seen that its speed is basically proportional to the voltage, and its torque is basically proportional to the phase current. To achieve control accuracy and dynamic performance, this system uses a dual-closed-loop speed control system for both speed and current. The current loop uses a PI regulator, and the speed loop uses an integral separation PI control algorithm with limited integral weakening. It has good starting and anti-interference performance, which can meet the needs of this system. The control system block diagram is shown in Figure 4. [align=center] Figure 4 Brushless DC motor speed and current closed-loop control system[/align] In this control scheme, the signal of the Hall sensor is applied to the capture unit terminal of TMS320F2812. The capture terminal is set as an I/O port, and then the potential of the capture unit is acquired. According to the potential of the capture unit, it can be determined which range the motor is in. The motor running speed can be calculated according to the time of two captures. This speed is used as the feedback quantity of the speed reference value, and then after speed PI regulation, the reference current Iref can be obtained. In addition, the phase current Iphase signal can be obtained through the current detection circuit. This signal is converted by A/D and used as the feedback quantity of the reference current Iref. After current PI regulation, the output quantity is used to adjust the duty cycle of the output PWM signal. This PWM signal is connected to the drive terminal. In this way, the conduction time of the MOSFET can be adjusted according to the motor running condition to achieve the purpose of controlling the motor speed. 3.2 Software Design According to the control strategy of the system, it can be concluded that the entire control system software consists of a main program and an INT3 interrupt service subroutine. The flowchart is shown in Figure 5. [align=center] Figure 5 System Software Flowchart[/align] The software adopts a modular design. In the main program, the initialization module is executed, which mainly completes the setting of the system clock, watchdog, GPIO, T3 interrupt, various control registers of the event manager and their interrupts, as well as the initialization of variables in the software. After the initialization is completed, the system enters a loop to wait for the T3 interrupt. In the INT3 interrupt service routine, the following modules are mainly executed: (1) A/D conversion module: the A/D conversion of the phase current is completed using the A/D conversion unit inside the DSP. (2) Commutation control module: the commutation of the power MOSFET is controlled according to the commutation logic based on the state of the three captured Hall sensors. (3) PWM waveform generation module: the PWM waveform generator of the DSP's internal event manager module is set to the continuous ascending counting mode of the general timer T1, corresponding to a PWM frequency of 20kHz, and the counting period is set to 50μs. Then the comparison register values of the three full comparison units are refreshed according to the duty cycle of the current loop output. Meanwhile, by looking up the table, the ACTR (full comparison action control register) value corresponding to the current commutation pointer is obtained and sent to the ACTR register to complete the definition of the PWM1 to PWM6 pin states. (4) Digital PID module: This module implements the digital PID algorithm to adjust and calculate the speed error and current error, and control the duty cycle of the PWM signal. 4. Conclusion: In order to verify and analyze the performance of the control system, we used a rare earth permanent magnet brushless DC motor developed by Maxon Precision Motor Company as a prototype for testing. The prototype has a rated power of 150W and a rated speed of 10000n/s. The results show that the brushless DC motor control system implemented by TMS320F2812 has a simple structure and is easy to implement complex control laws to improve system performance. The use of square wave and PWM mode is conducive to reducing torque fluctuation and improving low-speed performance, and can achieve good control accuracy, dynamic performance and a wide speed range, and realize real-time control. At the same time, the system structure is simple, the operation is reliable, and it has high application value. The innovation of the author of this paper: The brushless DC motor control system is constructed based on the new high-performance DSP device TMS320F2812. A dual closed-loop speed control strategy based on speed and current is adopted, with the speed loop employing an integral separation PI control algorithm that weakens the integral upon encountering a limit. The integrated power element 6AM15 is used as the power switching device. References: 1. Yao Jia, Liu Gang, Fang Jiancheng. High-speed, high-precision brushless DC motor control system for controlling torque gyroscopes. Microcomputer Information, 2005, 9-1: 3-5. 2. Zhang Chen. Principles and Applications of Brushless DC Motors. Beijing: Machinery Industry Press, 1996. 3. Su Kuifeng, Lü Qiang. Principles and Development of TMS320F2812. Beijing: Electronic Industry Press, 2006. 4. BLDC3-1 system documentation: sensored control of 3phase brushless DC motor. Houston, Tex, 2005.