Design of TMS320F2812 brushless DC motor control system
2026-04-06 06:03:02··#1
1. Introduction As is widely known, brushless DC motors combine the advantages of AC motors (simplicity, reliability, and ease of maintenance) with the advantages of DC motors (high efficiency, freedom from mechanical commutation limitations, good speed regulation, and ease of achieving large capacity and high speed). 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 The 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. [img=580,178]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147001.jpg[/img] 3 System Hardware Design Figure 2 shows the brushless DC motor control system based on 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 to detect the rotor's rotational position. Based on the rotor's position, it issues corresponding control words to change the current value of the PWM signal, thereby altering the conduction sequence of the power transistors in the DC motor drive circuit (full-bridge control circuit IGBT), thus controlling the motor's 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 registers, and by comparing the captured A and B pulse values, the current forward/reverse state and speed of the motor are determined. During system operation, the drive protection circuit detects the current system operating status. If an overcurrent or undervoltage condition occurs in the system, the PWM signal driver (IR2131) activates its internal protection circuit, latching the subsequent PWM signal output. Simultaneously, it pulls down the PDPINTA pin voltage of the TMS320F2812 controller through the FAULT pin, activating the DSP controller's power drive protection. At this time, the output pins of all EV modules will be set to a high-impedance state by hardware to protect the control system. The following mainly introduces the rotor position detection circuit, phase current detection circuit, drive circuit, system protection circuit, etc. in the system. [img=580,403]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147002.jpg[/img] 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 uses three photoelectric position sensors (Hall elements), which are made using the photoelectric effect and consist of a light shield that rotates with the motor rotor and a fixed light source and phototube. As the motor rotor rotates, the phototube intermittently receives light emitted from the light source, continuously turning on and off, thereby generating a series of "0" and "1" signals. These pulse signals are transmitted to the DSP through the I/O port. The DSP reads the status value of the Hall element to determine the current position of the rotor. Then, by changing the duty cycle of the PWM signal, the drive circuit is controlled to change the conduction sequence of the IGBTs, thereby achieving commutation control of the motor and adjusting the motor speed. The conduction sequence of the power transistors on the control bridge arm of the motor drive circuit is VQ1, VQ2→VQ2, VQ3→VQ3, VQ4→VQ4, VQ5→VQ5, VQ6→VQ6, VQ1 (two pairs 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. [img=580,321]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147003.jpg[/img] 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, and the signal 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. [img=580,362]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147004.jpg[/img] 3.3 Drive Circuit The motor controller drive circuit uses IR2131 (see Figure 5). IR2131/IR2132 is a driver that uses high-voltage, high-speed power MOSFETs and IGBTs. IR2131 can simultaneously control the conduction and cutoff of 6 power transistors. Through output ports H01, H02, and H03, the conduction and cutoff of the upper half-bridge VQ1, VQ5, and VQ6 in the three-phase full-bridge drive circuit are controlled respectively. Through output ports L01, L02, and L03, the conduction and cutoff of the lower half-bridge VQ4, VQ6, and VQ2 in the three-phase full-bridge drive circuit are controlled respectively, thereby realizing the control of 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, as well as 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 Isolation Circuit The signal isolation circuit isolates the control signals and drive signals between the control circuit and the drive circuit 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. [img=580,251]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147005.jpg[/img] 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 CD8128 and then input to the PDPINT pin through opto-isolation. When any fault condition occurs, CD8128 outputs a low level, and the PDPINT pin is also pulled low. At this time, the timer in the DSP immediately stops counting, and all PWM output pins are in a high-impedance state. At the same time, an interrupt signal is generated to notify the CPU that an abnormal condition has occurred. The whole process is completed automatically without program intervention, which is very useful for the rapid handling of various fault conditions. [img=580,329]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147006.jpg[/img] 4. System Communication with Host Computer The system uses an SCI interface to communicate with the host computer and RS-232 communication. Position parameters are given by the host computer, and parameters such as motor speed, current, and position feedback are simultaneously controlled and sent to the host computer for real-time display. The SPI interface enables serial driving of the digital tube display. Position parameters are set via a keyboard extended by 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. [img=580,220]http://cms.cn50hz.com/files/RemoteFiles/20090204/018147007.jpg[/img] 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%). Experimental results verify the effectiveness of this method.