[b]Preface[/b] Due to the emergence of production automation and various automatic control and sequential control equipment, motors are required to frequently operate in various modes such as frequent starting, braking, forward and reverse transmission, intermittent operation and variable load. The operating requirements of motors are getting higher and higher. At the same time, since motors are connected to supporting machinery, when a motor fails, it often affects the production system. Therefore, effective protection of motors is an important task to ensure the normal operation of the production system. With the development of science and technology, electronic protection devices have been gradually used in motor protection devices. In foreign countries, electronic protection devices have been widely used in power systems and motor protection devices, and they have also begun to be promoted in China [1]. The advantages of electronic protection devices are: they are basically composed of stationary components. They have fast operating speed, no mechanical displacement and wear, and their accuracy and lifespan are generally higher than those of contact relays. They are resistant to shock and vibration and have good reliability. In addition, electronic circuits have low operating power and high sensitivity. Digital signal processors (DSPs) have streamlined operation functions and a structure that completes multiplication in a single cycle. Systems composed of them can perform spectrum analysis in real time. The MAX126 high-speed 14-bit A/D converter with multiplexer and sample-and-hold circuit is ideal for motor signal acquisition. To achieve reliable motor protection, an intelligent motor protector based on the TMS320LF2407 is proposed, providing comprehensive detection and protection against common faults such as overload, light load, imbalance, phase loss, overvoltage, and undervoltage . 1. System Basic Principles and Design Concept Motors often experience abnormal operating states. These abnormal states include: overload, locked rotor, short circuit, light load, imbalance, phase loss, overvoltage, undervoltage, and leakage current. Motor protection is based on the detection of three-phase voltages UA, UB, UC, three-phase currents IA, IB, IC, and leakage current IL. The specific process is as follows: (1) Set various parameters and send control signals from the PC; (2) Sample the three-phase voltage, three-phase current and leakage current to obtain real-time values; (3) Use the FFT algorithm to process and calculate the data to obtain the effective values of the three-phase voltage and current, active power, reactive power and power factor; (4) Determine whether the motor is in an abnormal operating state; (5) Send the data to the display part through the RS-485 interface and display it on the LCD. The hardware block diagram of the system is shown in Figure 1. The CPU is the TMS320LF2407 from TI. Its rich hardware resources are fully utilized in the system. With a small number of peripheral devices, it constitutes a complete and easy-to-use system. [align=left] 2 System Hardware Design 2.1 TMS320LF2407 The TMS320LF2407 is also called a DSP controller. It is designed by TI specifically for the control of motors, inverters, robots, CNC machine tools and other devices [2-4]. The TMS320LF2407 employs high-performance static CMOS technology, reducing the supply voltage to 3.3V and decreasing the controller's power consumption. Its 30MIPS execution speed shortens the instruction cycle to 33ns (30MHz), thereby improving the controller's real-time control capabilities. It includes two event manager modules, EVA and EVB, enabling: three-phase inverter control; symmetrical and asymmetrical PWM waveforms; three capture units; and a 16-channel A/D converter. The event manager module is suitable for controlling AC induction motors, brushless DC motors, switched reluctance motors, stepper motors, multi-stage motors, and inverters. 2.2 Interface Circuit between TMS320LF2407 and MAX126 Although the TMS320LF2407 chip contains dual 10-bit A/D conversion modules, it can only sample and convert two input channels simultaneously, which does not meet the requirement of simultaneous multi-channel sampling in motor monitoring systems. The MAX126 is a high-speed 14-bit successive approximation A/D conversion chip manufactured by Maxim Integrated, with four synchronous sample-and-hold circuits that can simultaneously sample signals from four channels. This system samples 7 signals, so two MAX126 chips are used, both of which operate in group A multiplexer, 4-channel sampling, with a conversion time of 12ms. The interface circuit between the DSP and MAX126 is shown in Figure 2 [5]. The MAX126 can be controlled to work normally through different I/O operations. 2.3 Display Circuit The display circuit is based on AT89S52, and the liquid crystal display module adopts MGLS240128T. The interface circuit is shown in Figure 3. The data bus DB0~DB7 of the liquid crystal display module controller T6963C is connected to the P0 port of AT89S52. The read/write control signals RD/WD of T6963C are controlled by the external ROM read/write control signals RD/WD of AT89S52. CE is the chip select signal, controlled by P2.7 of AT89S52. It is enabled when the level is low. C/D is the register select signal. A low level input indicates that the data is being read or written; a high level input indicates that the command is being written and the status of T6963C is being read. 2.4 Communication Circuit This system adopts a bus-type distributed network structure. The network structure is shown in Figure 4. Each protector forms an RS485 communication bus via MAX485. The PC and the RS485 bus are connected via an RS232/RS485 converter card. The PC provides a user-friendly interface, allowing administrators to modify parameters. Administrators can send control commands to each protector through the interface. The protector can receive commands from the host, drive the electrical equipment to close or trip according to the commands, measure various electrical parameters, and transmit the electrical parameters to the display module for display. The display uses an LCD module to display the electrical parameters. The interface circuit between each protector and the 485 bus is shown in Figure 5. The MAX485 chip is an RS485 chip. The two control terminals are controlled by two I/O ports of the DSP, and another I/O port is responsible for selecting the data transmission direction. 2.5 Protection Action Circuit The execution circuit of all protection circuits is shown in Figure 6, mainly accomplished by the switching of relays. If a motor fault occurs, the DSP chip generates a low level, causing the optocoupler to conduct, thereby activating the relay and protecting the motor. 3 System Software Design With a hardware platform in place, corresponding software must be designed to maximize its effectiveness. Due to the flexibility of software, it can be modified or added to according to system requirements; therefore, the level of system intelligence largely depends on the rationality of the software structure and the comprehensiveness of its functions. The DSP part of the protector is programmed in C language, and the control software mainly consists of control programs, display programs, and communication programs. 4.1 Control Program The intelligent motor protector detects the current and voltage in the circuit, calculates and analyzes them to achieve various protection functions, and displays the circuit parameters and records fault status in real time. This system uses the internal timer interrupt of the TMS320LF2407 to start the A/D conversion. With the initial sampling frequency set to 2.56KHz, the sampling interval is 390.625ms, meaning the A/D converter is triggered once every 390.635ms. After the 12-channel A/D conversion of the MAX126 is completed, an interrupt request signal is sent to the XINT1 pin of the DSP. The flowchart of the control program is shown in Figure 7. 4.2 Interrupt Program The function of the interrupt program is to sample and store the sampled data. In motor protection systems, the next step after storing data is to perform FFT analysis on the voltage and current sampled values of each phase. Therefore, the following two issues should be noted when storing data: (1) Although the voltage and current sampled data are discrete real number sequences, after FFT, they become FFT complex number sequences. Therefore, the voltage and current real number sequences after A/D conversion are generally regarded as complex number sequences with zero imaginary part, and complex numbers are stored in continuous memory space, with the real part first and the imaginary part last. (2) The input and output sequences of FFT have a "forward-reverse" or "reverse-forward" relationship. Therefore, in order to simplify subsequent calculations, the indirect addressing method of "reverse carry plus index" is generally adopted when storing sampled data. The instruction in the DSP is *BR0+. The flowchart of the interrupt part is shown in Figure 8. 4.3 Display program The flowchart of the display part is shown in Figure 9. 4.4 Communication program The communication part is mainly composed of two parts: 1. 485 communication between PC and DSP; 2. RS485 communication between DSP and AT89S52. The PC part is programmed using LabVIEW. LabVIEW provides a powerful VISA (Virtual Instrument Software Architecture) library to complete the connection between the computer and the instrument, enabling program control of the instrument. The AT89S52 receives data from the DSP and displays it on the LCD. The communication protocol between them is F0+10datas+0F, that is, first check if the start signal F0 is received. If so, receive 11 data. Then check if the last data is 0F. If not, discard the data and re-receive. 4 Experimental Results Partial results of the system test are shown in Table 1. Table 1 Parameter Detection Results The actual values of the motor voltage and current during the test were 220V and 10A. According to the measurement results, the voltage and current measurement accuracy of the three phases A, B, and C all met the requirements. 5 Conclusion The intelligent motor protector based on TMS320LF2407 proposed in this paper makes full use of the DSP resources and uses a small number of peripheral components to form a complete, high-performance, low-cost and practical system, ensuring the reliable operation of the production system and providing a practical way to achieve low-cost development and upgrading of motor protection equipment. This protector has a promising future in motor protection. [b]References[/b] [1] Huang Qun, Deng Hui. Generator protection device based on PIC16 microcontroller[J]. Computer and Digital Engineering, 2000, 28(5): 52-54. [2] Liu Heping, Wang Weijun, Jiang Yu et al. Development and application of TMS320LF240x DSP C language[M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003. [3] Liu Heping, Yan Liping, Zhang Xuefeng et al. Structure, principle and application of TMS320LF240x DSP[M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002. [4] Zhang Yun, Xie Liping, Xiong Hongyan. DSP controller and its application[M]. Beijing: Machinery Industry Press, 2001. [5] Yuan Chun, Yuan Guozhou, Yu Shouyi. Application of DSP and MAX125/126 in power parameter measurement[J]. Computer and Information Technology, 2001, 1: 41-43. Edited by: He Shiping