Design of a brushless DC motor control system based on TMS320F2812
2026-04-06 07:36:55··#1
1. Introduction As is widely known, brushless DC motors combine the advantages of AC motors (simplicity, reliability, and ease of maintenance) with the high efficiency, lack of mechanical commutation limitations, good speed regulation, and ease of achieving large capacity and high speeds of DC motors. TI's TMS320F2812 digital signal processor (DSP) possesses the architecture required for high-speed signal processing and digital functions, as well as the peripherals needed to provide a single-chip solution for motor control applications. A fully digital motor control system based on the TMS320F2-812 greatly simplifies hardware design, improves system reliability, reduces costs, and has a promising future for the widespread application of brushless DC motors. Therefore, a fully digital permanent magnet brushless DC motor control scheme based on the TMS320F2812 is proposed. 2. System Design Scheme This system design adopts a three-phase Y-type permanent magnet square wave brushless motor PWM control scheme, with two-by-two energization. Figure 1 shows the block diagram of the control system. It employs fully digital three-loop control. The current loop uses a PI controller, and the speed loop uses an integral separation PID control algorithm with limited integral reduction. Its output polarity determines the forward and reverse directions, thus enabling four-quadrant operation of the motor. The position loop uses a PI controller. The inverter uses full-bridge PWM modulation. 3. System Hardware Design Figure 2 shows the brushless DC motor control system based on the TMS320F2812. The TMS320F2812 is used as the controller to process the acquired data and send control commands. The TMS320F2812 controller first captures the high-speed pulse signals from the Hall elements H1, H2, and H3 on the DC motor through three I/O ports, detects the rotor's rotational position, and issues corresponding control words based on the rotor's position to change the current value of the PWM signal. This, in turn, changes the conduction sequence of the power transistors in the DC motor drive circuit (full-bridge control circuit IGBT), thereby controlling the motor speed and direction of rotation. The motor's encoder signals A and B are captured through the CAP1 and CAP2 ports of the TMS320F2812 DSP controller. The captured data is stored in a register. By comparing the captured A and B phase pulse values, the current forward/reverse state and speed of the motor are determined. During system operation, the drive protection circuit detects the current operating status of the system. If an overcurrent or undervoltage condition occurs in the system, the PWM signal driver (IR2131) activates its internal protection circuit, latches the subsequent PWM signal output, and simultaneously pulls down the PDPINTA pin voltage of the TMS320F2812 controller through the FAULT pin, activating the power drive protection of the DSP controller. At this time, the output pins of all EV modules will be hardware-set to a high-impedance state, thereby protecting the control system. The following mainly introduces the rotor position detection circuit, phase current detection circuit, drive circuit, and system protection circuit in the system. 3.1 Rotor Position Detection Circuit When controlling the brushless DC motor, the DSP controller sends the corresponding control word according to the current rotation position of the rotor, and controls the motor by changing the duty cycle of the PWM pulse signal. The rotor position of the brushless DC motor is detected by a position sensor. The system design employs three photoelectric position sensors (Hall elements), which utilize the photoelectric effect. These sensors consist of a light-shielding plate that rotates with the motor rotor, a stationary light source, and phototubes. As the motor rotor rotates, the phototubes intermittently receive light emitted from the light source, continuously switching on and off, thus generating a series of "0" and "1" signals. These pulse signals are transmitted to the DSP via the I/O port. The DSP reads the state values of the Hall elements to determine the current position of the rotor. The PWM signal duty cycle is then changed to control the drive circuit, altering the IGBT conduction sequence to achieve commutation control of the motor and adjust its speed. The conduction sequence of the power transistors on the motor drive circuit control bridge arm is VQ1, VQ2→VQ2, VQ3→VQ3, VQ4→VQ4, VQ5→VQ5, VQ6→VQ6, and VQ1 (two transistors are energized). Each time the motor rotor rotates, H1, H2, and H3 will exhibit six states: 10l→100→110→010→011→00l. The DSP sends a corresponding control word for each state, changing the motor's energizing phase sequence to achieve continuous motor operation. Figure 3 shows the control principle diagram of the motor drive circuit. 3.2 Phase Current Detection Circuit The current feedback channel consists of a Hall element, an operational amplifier, and an A/D converter. The current feedback uses a magnetically balanced Hall element with a turns ratio of 1:1000. The output of this element is a current signal, which is relatively weak. It must be converted into a voltage signal by a precision resistor and then amplified to obtain a bipolar current signal. Because the input range of the A/D conversion unit in the DSP is 0~3.3V (unipolar), a circuit needs to be designed to convert the bipolar signal into a unipolar signal before sending it to the A/D converter. Figure 4 shows the circuit schematic. 3.3 Drive Circuit The motor controller drive circuit uses an IR2131 (see Figure 5). The IR2131/IR2132 is a driver that uses high-voltage, high-speed power MOSFETs and IGBTs. The IR2131 can simultaneously control the on/off state of six power transistors. Output ports H01, H02, and H03 control the on/off state of the upper half-bridge transistors VQ1, VQ5, and VQ6 in the three-phase full-bridge drive circuit, respectively. Output ports L01, L02, and L03 control the on/off state of the lower half-bridge transistors VQ4, VQ6, and VQ2 in the three-phase full-bridge drive circuit, respectively, thereby controlling the motor speed and forward/reverse rotation. 3.4 System Protection Circuit In the brushless DC motor control system, the protection circuit plays a crucial role, protecting the core component DSP from high-voltage and overcurrent surges, and also protecting the motor drive circuit from damage. The entire system's protection circuit mainly consists of three parts: circuit isolation, signal isolation, and drive protection. 3.4.1 Signal Isolation Circuit The signal isolation circuit isolates the control and drive signals between the control and drive circuits using an opto-isolator, enabling signal transmission between different voltages, as shown in Figure 6. This isolation circuit provides opto-isolation between the DSP's six PWM output signals and the IGBT, and also performs drive and level conversion functions. 3.4.2 Protection Circuit To ensure the safe and reliable operation of the power conversion circuit and motor drive circuit in the system, the TMS320F2812 also provides a PDPINT input signal, which can be used to easily implement various protection functions of the servo system. Figure 7 shows the specific implementation circuit. Various fault signals are synthesized by the CD8128 and then input to the PDPINT pin via opto-isolation. When any fault condition occurs, the CD8128 outputs a low level, and the PDPINT pin is also pulled low. At this time, the timer in the DSP immediately stops counting, all PWM output pins are in a high-impedance state, and an interrupt signal is generated simultaneously to notify the CPU of an abnormal situation. The entire process is completed automatically without program intervention, which is very useful for the rapid handling of various fault conditions. 4. System Communication with Host Computer The system uses an SCI interface to communicate with the host computer and RS-232 communication. The host computer provides the position input, and parameters such as motor speed, current, and position feedback are simultaneously controlled and sent to the host computer for real-time display. An SPI interface is used to serially drive the digital tube display. The position input is set via a keyboard extended with digital I/O, and displayed on the digital tube. 5. Experimental Results Based on the hardware circuit, two experimental results are obtained through software programming, as shown in Figure 8. Figure 8(a) shows the system tracking characteristic curve under conventional PID control; Figure 8(b) shows the experimental curve under fuzzy PID system tracking characteristics. 6. Conclusion The digital servo system designed using the TMS320F2812 as its core solves the problems of PWM signal generation, motor speed feedback, and motor current feedback in servo systems. It conveniently implements protection functions, greatly simplifies system hardware design, improves system reliability, reduces the size of the servo system, and lowers costs (by approximately 20%). The experimental results verify the effectiveness of this method.