Based on Siemens S7-200 series PLC and PID temperature control

This article describes the S7-200 series PLC-based smart temperature control system. The implementation of temperature control is described. The technology of serial communication between the host computer and PLC temperature monitoring system in VB environment is introduced. After on-site debugging, the system has the advantages of high reliability and convenient monitoring. Due to the ubiquity of PLC use in the industrial field, the system has a large range of uses.

Because PLC has the advantages of strong control ability, high reliability, flexible configuration, simple programming, convenient use and easy expansion, it has become the main means and automation control equipment in the field of industrial control today and in the future. Temperature control is one of the problems to be solved in industrial control systems in many industries. In some heat treatment industries, due to the use of simple temperature control instruments and temperature control circuits for control, there are shortcomings such as low control precision and large overshoot, which causes problems such as low product quality and waste of energy.

Based on the popularity of PLC in the field of industrial control and the importance of temperature control, a PLC-based intelligent temperature control system is designed, which has a wide application space. At the same time, because PLC has its own shortcomings, that is, the data processing and management ability is weak, can not provide a good user interface, thus hindering the tracking and monitoring of on-site temperature changes, and the computer can make up for this very well. Disadvantages. The master-slave real-time monitoring system consisting of computer and PLC can give full play to their respective advantages in industrial control and realize new functions such as decentralized control and centralized monitoring. This system adopts Siemens S7-200 series PLC, which is connected with computer through PLC serial communication. The monitoring interface is friendly and stable.

1 PLC temperature control system

In boiler temperature control systems, electric heating boilers are commonly used in the process control industry, and temperature control is also a focus of process control. The structure of the PLC temperature control system is shown in Figure 1. The PLC controls the heating and cooling of the furnace by heating rods and fans. The computer realizes the functions of target temperature setting, dynamic display, parameter setting, etc., thus realizing real-time temperature monitoring.

2 system composition

Signal processing, temperature adjustment and other functions. In temperature, a temperature control system generally has temperature signal acquisition, PLC temperature control system, moderate signal acquisition can use commonly used temperature sensors (thermocouples, thermal resistance). The signal detected by the temperature sensor is not a standard voltage (current) signal and cannot be sent directly to the A/D converter module. Therefore, the temperature signal collected by the temperature sensor is processed by the transmitter before being recognized by the A/D converter and converted into a corresponding digital signal. Select the corresponding temperature transmitter according to the temperature sensor used. The analog input/output hybrid module commonly used in S7-200 series PLC is EM235, EM235 is 4 analog input, 1 analog output. After the PLC processes the temperature signal, the current signal is output through the analog module, and the current signal can be used to control the power supply opening degree (ie, the conduction ratio in one week) through the voltage regulator, thereby controlling the output power of the power source. The heater adjusts the heating intensity according to the power output of the power source to achieve the temperature adjustment effect.

3 temperature PID control implementation

Control PID (proportional + integral + differential) algorithm control for analog signals. S7-200 series PLC has a special PID loop command, which is very convenient for PID control of analog quantity. The algorithm used by the PID instruction: (n SP is the given value of the nth sampling moment, n is the process variable value, MX is the integral term value). The PID instruction performs PID on the reference LOOP according to the input and configuration information in the table (TBL). Loop calculation. Before executing the PID instruction, a parameter list is to be established, and the parameters in Table 1 are generally initialized.

In the actual control process, both the given amount and the process quantity are engineering actual values, and their range of values ​​is different. Therefore, the actual value of the project must be standardized before the PID operation. After the PLC performs PID operation on the analog quantity, the control effect on the output is the standard value in the range of [0.0, 1]. The actual drive unit cannot be driven and must be converted into the actual value of the project.

Since the electric heating furnace has a large delay, the output value is 0.0~1.012 Kc positive double word, real I loop gain, positive and negative constant 16 Ts I sampling time, the unit is s, positive 20 TI I Integration time constant, in min, 24 Td I differential time constant, in min, positive control. Generally, three-stage control is adopted: In the first stage, the power supply is full-open at the beginning stage, and the thermal inertia is overcome with the maximum power output; the second stage, until the temperature reaches a certain value, the PID control is performed; the third stage is close to the set point. When the power supply opening degree is 0, a heat preservation phase is provided to adapt to the temperature hysteresis temperature rise. The program flow chart is shown in Figure 3. In the figure, X and Y are set according to the actual settings.

The adjustment of PID parameters is very important. There are many adjustment methods. There are two general categories: one is the theoretical calculation method. It is mainly based on the mathematical model of the system, and the controller parameters are determined through theoretical calculations. The second is the engineering setting method, which relies mainly on engineering experience and is directly carried out in the test of the control system, and the method is simple and easy to grasp. In engineering practice, it is difficult for the control system to establish an accurate mathematical model, so the engineering tuning method is generally adopted. The engineering tuning method of PID parameters mainly includes critical ratio method, reaction curve method and attenuation method. In this case, the critical scaling method is used. The tuning steps are as follows: (1) First select a sampling period that is short enough for the system to work; (2) Add only the proportional control link until the system has a critical oscillation in the input step response. The proportional amplification factor and the critical oscillation period at this time; (3) The parameters of the PID controller are calculated by a formula under a certain degree of control.

4 PLC and computer communication design

Because VB has powerful graphics processing function, the interface is highly visual, and the operation is simple and easy to implement. Therefore, VB is used to realize communication between the upper computer and the lower computer. The lower position is the S7-200 series PLC, and the upper computer is a computer connected to the PLC through the RS-232 serial port.

4.1 PLC program part

The S7-200 supports a variety of communication modes. In the free port communication mode, the user can use the reception completion interrupt, the transmission completion interrupt, the send command, and the receive command in the ladder program to complete communication between the S7-200 series PLC and the host computer.

Free port communication is disabled when the PLC's CPU is in STOP mode, and free port communication is only available when the CPU is in RUN mode. SMB30 (select port 0 here) is the free port mode control byte, which is used to set the communication parameters such as calibration mode, communication protocol and baud rate. The send command XMT initiates data transmission in the data buffer in free port mode. It can easily send 1~255 characters. If an interrupt program is connected to the send end event, port 0 will generate an interrupt event after the transmission is completed. It is also possible to monitor the change of the transmission completion status bit SM45. The receive command RCV can initialize the receive information service, receive the information through the designated communication port and store it in the data buffer. Port 0 generates an interrupt event 23 when the last character is received.

4.2 upper computer program part

VB has an MSComm control that manages serial communication. It can realize serial communication between PLC and computer by setting only a few main parameters. The computer adopts VB programming, mainly including monitoring interface, current temperature display, dynamic temperature curve display, parameter setting and communication with PLC. The communication parameter setting procedure is as follows:

MSComm1.CommPort = 1// Set the communication port to COM1

MSComm1.SetTIngs = "9600, n, 8, 1" / / baud rate 9600bps, no parity, 8 bits of data, 1 bit stop

MSComm1.InputLen = 8// read 8 bytes at a time

MSComm1.PortOpen= True//Open the communication port. The VB program on the computer side exchanges data with the S7-200 using the MSComm control, and collects temperature signals from the field through the free port communication program. And the host computer program can set the initial temperature and PID parameters, display the dynamic temperature curve.

5 Conclusion

This paper introduces the temperature controller composed of Siemens S7-200 series PLC, and expounds the serial communication technology of computer and PLC temperature control system under VB environment, and gives some programs. The example shows that the system has high reliability. Easy to monitor.

Right Angle DIP Centronic Connector

Right Angle DIP Centronic Connector.

Current Rating:5A
Dielectric Withstanding Voltage:1000V for one minute
Insulation Resistance:1000MΩ Min.(at 500V DC)
Contact Resistance:35mΩ Max.
Temperature:-55°C to +105°C

Right Angle DIP Centronic Connector

ShenZhen Antenk Electronics Co,Ltd , http://www.coincellholder.com

Posted on