Design and Research of PLC-based Temperature Control System
2026-04-06 06:21:20··#1
Abstract: This paper introduces the design and research of a temperature control system composed of Rockwell PLC. The external interface of PLC input/output control and the hardware and software design for display expansion are discussed. The communication and data processing technology between the PLC and PC are analyzed, and a partial program is given. Keywords: PLC, Temperature control, Resistance thermometry module, Communication0 Introduction With the development of electronic technology, programmable logic controllers (PLCs) have gradually evolved from simple logic quantity control to possess the functions of computer control systems. In modern industrial control, PLCs occupy a very important position; they can work with computers to form a complete control system. Temperature control is one of the problems that needs to be solved in industrial control systems in many industries. For example, most plastic extruders use simple temperature control instruments and temperature control circuits for control, which have disadvantages such as low control accuracy and large overshoot, making it difficult to produce high-quality plastic products [1]. Similar problems exist in some heat treatment industries. To this end, a more general temperature control system was designed. The specific system parameters or some components can be adjusted according to the different requirements of each industry. The system uses Rockwell SLC500 series PLC and is connected to the computer through PLC serial communication. The interface is user-friendly and the operation is stable. 1 System Composition There are generally two design schemes for PLC-based temperature control systems. One is to construct a dedicated RTD or thermocouple temperature module by expanding the PLC, and the other is to construct a general A/D conversion module by expanding the PLC [2]. 1.1 Expanding the RTD/Thermocouple Module In the SLC500 controller expansion module, there is a dedicated intelligent temperature module that integrates temperature acquisition and data processing—the RTD/resistance signal input module (1746-NR4). In this module, the analog temperature signal generates a corresponding 16-bit A/D digital value. Its resolution for the temperature signal transmitted by the resistance temperature detector (RTD) is approximately 1/8 degree. The controller can directly use the module's converted value in numerical processing without requiring further processing at the hardware level. The RTD temperature module is very convenient to use; simply connect the RTD to the module's terminals. No external transmitter or peripheral circuitry is needed. The temperature signal is acquired by the RTD, converted into an electrical signal, and directly sent to the temperature module. The thermocouple/millivolt input module (1746-NT4) functions similarly to the RTD/resistance signal input module (1746-NR4). The system is shown in Figure 1. [align=center] Figure 1 Temperature control system with extended temperature module[/align] 1.2 Extending a general-purpose A/D module In a PLC temperature control system, a temperature acquisition and processing system can be constructed using a general-purpose analog input/output hybrid module. General-purpose A/D conversion modules do not have temperature data processing capabilities. Therefore, the temperature signal acquired by the temperature sensor must undergo conversion, amplification, filtering, cold junction compensation, and linearization by external circuitry before it can be recognized by the A/D converter and converted into the corresponding digital signal. The commonly used analog input/output hybrid module in the SLC500 series PLC is a 2-channel differential input/2-channel voltage output module (1746-NIO4V), which has a 16-bit A/D conversion. A temperature control system built using an A/D conversion module not only requires external circuitry but also has relatively complex software and hardware design. The system is shown in Figure 2. [align=center] Figure 2 General-purpose A/D conversion module temperature control system[/align] 2 Input/Output Control Comparatively, the PLC temperature control system built using the 1746-NR4 temperature module has better control performance. In the input channels of the SLC500 controller, one RTD module can connect to a maximum of four RTD temperature sensors. The output channel is an analog output module (1746NIO4V), and its output signal is a voltage signal. The power supply opening degree (i.e., the conduction ratio in one cycle) can be controlled by the voltage regulator, thereby controlling the power supply output power. When the controlled object requires high temperature control accuracy, the SLC500 controller can use the PID instruction of the PLC itself to study the PID control algorithm [3]. The PID instruction of the SLC500 series PLC uses the following algorithm: Output = Kc[(E) + 1/Ti∫(E)dt + Td·D(PV)/Dt] + bias. When programming, after inputting the PID instruction, the address of the control block, process variable and control variable must be input. For the SLC500 PID instruction, the measurement range of both process variable (PV) and control variable (CV) is 0 to 16383. When using engineering units for input, the user's analog range must first be tuned to the digital measurement range of 0-16383. To achieve this, the numerical tuning instruction (SCP instruction) needs to be used before the PID instruction. The tuning principle is shown in Figure 3. [align=center] Figure 3 Numerical Tuning Principle[/align] After tuning the analog I/O range of the PID instruction, the user can input the applicable minimum and maximum engineering units. Process variables, deviations, setpoints, and dead zones will be displayed in engineering units on the PID data monitor. Figure 4 shows the PID instruction setting interface, and Table 1 describes the parameters of each PID instruction. [align=center] Figure 4 PID Module Online Parameter Setting and Flags[/align] Table 1 PID Module Parameter Description Generally, the control algorithm for temperature control systems can adopt segmented PID control, meaning that for most of the system's operation, PID control is used, and its parameters are measured from the temperature rise curve at 10% power supply opening. During the rising phase of the temperature response curve from the initial state to the setpoint, roughly three stages of control are used. First, the power supply is set to full opening to overcome thermal inertia with maximum power output; then, PID control is switched; when approaching the setpoint, the power supply opening is set to 0, providing a heat preservation stage to accommodate the lag temperature rise. Based on the above requirements, the parameters of the PID instruction can be set as shown in Table 2. Table 2 PID Module Parameter Setting The voltage signal range of the analog input module of the thermal resistance in the temperature control system is generally 0-4124. The SCP instruction sets it to engineering units of 0-16383 and puts its value into the memory address N7:38 of PV (process variable). The control output value is put into N7:39. Finally, the MOV instruction is used to transfer the process variable in N7:39 to the 1746NIO4V analog output module. The control effect is as follows: (1) When SP-PV≥50, the output value is the maximum value of 32767, which makes the voltage regulator open to the maximum, that is, to supply the heater with the maximum voltage, so that the temperature of the measured object rises rapidly. (2) When SP-PV>-30 and SP-PV<50, the output is the PID control output. This range is the range of PID parameter adjustment. (3) When SP-PV<-30, the output value is the minimum value of 0, the voltage regulator is open to zero, that is, heating stops. 3 Display Extension PLC control system display interface is relatively monotonous. Generally, the controller status is understood by observing the indicator lights on the control cabinet or the LED lights of the PLC. However, such display is not enough for temperature control system. Digital tube display or PC display is required. When using digital tube display, ZLG7289A chip[4] can be selected. It uses a 3-wire serial interface with the controller. It only needs to occupy 3 output points of SLC500 and can drive 8 LED digital display tubes. Through cascading, the number of digital display tubes can be expanded to realize multi-segment real-time temperature display. The connection between SLC500 and ZLG7289A is shown in Figure 5. [align=center] Figure 5 Interface between ZLG7289A and SLC500 and display[/align] In Figure 5, CS is the chip select input terminal. When this pin is low, it can send instructions to the chip; CLK is the clock input terminal; DATA is the serial data input terminal. Serial data is valid on the rising edge of clock CLK. Eight segment drive signals SEG are connected to the segment of each display, and eight bit drive signals DIG0-DIG7 are connected to the common cathode ground of the display respectively. SLC500 has an RS232 communication port, which can be connected to a PC through a dedicated cable. Through the configuration of Rsview32 software, the PC can dynamically display the temperature acquisition data transmitted by the PLC, and can also monitor multiple PLCs through the network. 4 PLC and PC Communication Design 4.1 Information Format of PLC Data Packet The SLC500 exchanges data with the host computer in binary byte data, which contains four main commands: read command, code: 01H; respond to read command, code: 41H; write command, code: 08H; respond to write command, code: 48H[5]. Therefore, the information format of the PLC data packet is shown in Figure 6: [align=center] Figure 6 Information Format of PLC Data Packet[/align] DST: One byte, the node number or file number of the information receiver; SRC: One byte, the node number of the information sender; CMD: One byte, command type such as 01H, 41H, 08H or 48H; STS: One byte, communication status, indicating whether there is an error or the type of error, 0 for no error; TNS: Two bytes, the business batch number of the information packet, which can be used as the identification number of this information; Addata: Address/number of bytes/data, the specific content is determined by different command types. The data communication between the PLC and the PC adopts the free port communication mode, with the parameters set to a baud rate of 9600bps, 8 bits of data per character, and no parity check. A master-slave communication protocol is adopted, with the PC as the master, only the PC has the right to actively send messages, and the PLC uses messages to receive data. The RSLogix500 software is used to configure the SLC500 serial port as follows: 1) Set the module for full duplex BSC (DF1 full duplex) 2) Set the module for embedded response 3) Set detect for automatic 4) Disable duplicate packet detect 5) Set the baud rate for 9600. 4.2 PC Program The PC is programmed using VB, mainly including the design of the monitoring interface, current temperature display, dynamic temperature curve display, temperature database management, parameter settings, and communication with the PLC. The communication parameter setting program is as follows: With MSComm1 //Communication parameter settings CommPort=1 //Communication port COM1 Settings="9600, n, 8, 1" //Baud rate 9600bps, no parity, 8-bit data, 1-bit stop InputLen=2 //Read 2 bytes at a time InputMode= comLnputModeBinary //Binary data format PortOpen=True //Open communication port End With The PC uses interrupt mode to receive the real-time temperature from the SLC500. When the serial port receives data, the VB communication control will trigger the OnComm event, and the data will be received and processed in the OnComm event program. A temperature data is 16 bits and two bytes. When the SLC500 transmits temperature data, the high and low bytes are reversed according to the message transmission format. Therefore, the VB program needs to process the received data and convert it into a temperature value for display according to the accuracy of the SLC500 temperature acquisition (1/8 degree) [6]. 5 Conclusion The system design uses the thermal resistance temperature acquisition module of the PLC. Under the control of the host computer, the temperature of the industrial site is collected and monitored in real time. The innovation of the author is that the Rockwell SLC500 controller is used to realize the design of the whole system and the real-time communication between the SLC500 controller and the computer serial port is programmed. Since the PLC can adapt to the harsh industrial site, its application range is very wide. References 1 Yin Xinzheng, Wang Weiming. Application of PLC in temperature control system of plastic extruder [J]. Plastics Industry, 2002(5): 65-69 2 Chen Shanlin. Temperature control system based on PLC special function module[J]. Journal of Instrumentation, 2004(8): 43-47 3 Qian Xiaolong. Intelligent electrical appliances and MicroLogix controller[M]. Machinery Industry Press, 2003: 67-73 4 Cai Jun. Design and implementation of intelligent traffic light control system[J]. Journal of Chongqing University of Posts and Telecommunications, 2004(3): 129-132 5 Guo Zongren. Programmable controller application system design and communication network technology[M]. People's Posts and Telecommunications Press, 2004: 126-134 6 Zhang Yang. Design and implementation of communication between S7-200 programmable controller and microcomputer[J]. Microcomputer Information, 2004(8): 13-15