Title: Introduction and Implementation of Continuous Temperature PID Controller in Siemens PLCs Babak Rooholahi*1, M. Nabi Roohollahi2 , Alina Galyautdinova3. 1
Department of Electrical Engineering, University College of Engineering, Osmania University, Hyderabad, India;
[email protected] 2 Electrical Department, Enghelabe Eslami Technical College, Vocational University, Tehran, Iran. 3 Kazan National Research Technical University named after A.N.Tupolev - KAI (KNRTU-KAI), Kazan, Russia. ABSTRACT
Proportional-Integral-Derivative (PID) controllers can be found in all industries where feedback control and control loop exist. Siemens control systems which are very efficient and widely used in small, medium and big industries, play an essential role in automation technology. Understanding of the PID control algorithm, choosing an appropriate PID controller for a system, its designing and tuning always make a big challenge to implement it in industry. Programming with PID controller in Siemens PLCs is common in complicated and professional systems. A variety of PID controller designs for different kinds of systems form an outstanding advantage of Siemens control systems. In this article PID temperature control with continuous temperature controller FB58 (TCONT_CP) is studied. Implementation of the continuous temperature controller FB58 is discussed. FB58 (TCONT_CP) is one of the Siemens SIMATIC PID controllers, designed for S7300/400 PLCs to continuously control the temperature with continuous manipulated variable output or the option of influencing the manipulated value manually. The most important part of FB58 functioning is the addressing of analog Input and Output in this function block. Keywords: Continuous PID Control, FB58 (CONT_C), Feedback Control Loop, Temperature Control, Analog Signal, Programmable Logic Controller.
1.
INTRODUCTION
Control systems are used to minimize the consequences of process variations and environmental influences on the quality of process control. In industrial control, programmable logic controller (PLC) has the extremely wide range of applications [1]. PID controller is one of the earliest and best understood controllers which is incorporated in almost every industrial control application due to its efficiency and ease of implementation [2]. PID controller controls the process successfully even with the increased complexity. P, I and D are three parameters which have to be tuned manually or by some tuning techniques to design a PID controller. By adjusting these three gain values, the settling time, overshoot and rise time of the system can be controlled in order to obtain a desired system output. Even though many control systems using PID control have proved satisfactory, it still has a wide range of applications in industrial control [3]. PID controllers are professionally designed for different kinds of systems in Siemens PLCs. In SIMATIC step7 PID controllers are presented with different function blocks. FB58 is one of the function blocks which controls the temperature of the system. It has several parameters to perform professionally to control the temperature which will be discussed in this paper.
2.
PROGRAMMABLE LOGIC CONTROLLER A control system is a combination of components which senses, manages and regulates the behavior of another systems to produce the desired output. Automation or automatic control is the process where different methods or control systems are used to manage a process. Among different brands of control systems, Siemens control systems being professional have an essential role in automation industry. Control systems have been widely developed due to contribution of improvements in microelectronics and mathematical methods. One kind of these developed control systems in industry is programmable logic controller (PLC).
3.
PROPORTIONAL INTEGRAL DERIVATIVE CONTROLLER A closed loop control system or a feedback control system is a process in which the past information influences the present or future therefore the output is analyzed and corrected based on feedback. In a feedback control system information about performance is measured by sensors, this information in control algorithms is used to correct the performance of the system. PID controllers are the most often used closed loop controllers in industry because they have
only three control parameters P, I, D, and we can easily understand their physical meanings. It is beneficial because of their simplicity, robust nature, ease of implementation and design, and less number of tuning parameters [4]. The parallel PID Controller algorithm involves three separate parameters, Proportional, Integral and Derivative which are shown in Figure 1 in a process feedback control loop. The Proportional value determines the reaction to the current error, the Integral determines the reaction based on the sum of recent errors and the Derivative determines the reaction to the rate at which the error has been changing [5]. PID controller by adjusting the error itself, integral of the error and the derivative of the error as control variable (CV) tries to minimize the error.
Fig. 1. PID controller algorithm The PID control signal is a sum of three terms. It is possible to combine one, two or all the three parameters (by deactivating the other parameters of the parallel PID controller algorithm) to obtain the appropriate controller (P, I, PI, PD or PID controller) for the considered system. The process variable (PV) is measured by the sensors from the field; the reference value (the desired value) is called setpoint (SP), it is determined manually and set by the operator; the input to the process and the output of the PID controller are called manipulated variable (MV), control variable (CV) or control signal u(t); the difference between the process variable (PV) and the setpoint (SP) is the error signal (e(t) = PV – SP) which is continuously calculated by a PID controller. Mathematical descriptions of the parallel PID controller algorithm are shown in the following equations (1,2): or
𝑢𝑢(𝑡𝑡) = 𝐾𝐾𝑃𝑃 �𝑒𝑒(𝑡𝑡) +
1 𝑡𝑡 ∫ 𝑒𝑒(𝜏𝜏) 𝑑𝑑𝑑𝑑 𝑇𝑇𝐼𝐼 0 𝑡𝑡
+ 𝑇𝑇𝐷𝐷
𝑢𝑢(𝑡𝑡) = 𝐾𝐾𝑃𝑃 𝑒𝑒(𝑡𝑡) + 𝐾𝐾𝐼𝐼 ∫0 𝑒𝑒(𝜏𝜏) 𝑑𝑑𝑑𝑑 + 𝐾𝐾𝐷𝐷
𝑑𝑑𝑑𝑑(𝑡𝑡) 𝑑𝑑𝑑𝑑
�,
𝑑𝑑𝑑𝑑(𝑡𝑡) 𝑑𝑑𝑑𝑑
,
(1) (2)
where 𝐾𝐾𝑃𝑃 , 𝐾𝐾𝐼𝐼 and 𝐾𝐾𝐷𝐷 are the proportional gain, the integral gain and the derivative gain respectively. Rise time, overshoot, settling time and steady-state error are the main characteristics of the PID controller. By proper design and tuning of the PID gain values can be controlled and these characteristics can be optimized to achieve a desired system output. The Laplace transfer function of a PID controller is expressed in the equation (3): 𝐺𝐺𝑃𝑃𝑃𝑃𝑃𝑃 (𝑠𝑠) =
𝑈𝑈(𝑠𝑠) 𝐸𝐸(𝑠𝑠)
= 𝐾𝐾𝑃𝑃 �1 +
1
𝑇𝑇𝐼𝐼 𝑠𝑠
+ 𝑇𝑇𝐷𝐷 𝑠𝑠� ,
(3)
where 𝑈𝑈(𝑠𝑠) is the control signal, 𝐸𝐸(𝑠𝑠) is the error signal, 𝑠𝑠 is the variable of Laplace transfer function, 𝐾𝐾𝑃𝑃 is the proportional gain, 𝑇𝑇𝐼𝐼 and 𝑇𝑇𝐷𝐷 are the integral and derivative time constants respectively [6]. 3.1.
PID Controller Tuning Tuning is the process of computing and setting the optimal values of Kp, Ti or Ki and Td or Kd to get the desired performance of a control system [7]. Until the stability and short transient of the system are desirable, tuning of a PID controller is not easy. Ziegler-Nicholas method is one of the methods that is usually used to tune the PID controllers. In this method for manual tuning in online system, first all the gains should be set to zero (Kp = 0, Ti = ∞ and Td = 0). Increase the KP value until the constant oscillation of the output is obtained, this Kp value is denoted the ultimate (or critical) gain, Kpu. Note the value Kpu and the corresponding period of sustained oscillation, Ppu. The controller gains are now specified for P, PI and PID controllers as Table 1 [8]:
PID Type
Kp
Ti
Td
P
0.5*Kpu
∞
0
PI
0.45*Kpu
PID
0.6*Kpu
𝐏𝐏𝐏𝐏𝐏𝐏 𝟏𝟏. 𝟐𝟐 𝐏𝐏𝐏𝐏𝐏𝐏 𝟐𝟐
0 𝐏𝐏𝐏𝐏𝐏𝐏 𝟖𝟖
Table 1: Ziegler Nichols Recipe
Too much KI can be a cause of instability and too much KD will lead to overshoot in the system. A quick PID controller loop normally has a little overshoot to achieve the desired value very fast; but some systems cannot receive overshoot. In these systems a KP should be set remarkably less than half of the KP setting which provoked oscillation to make over-damp in the closed-loop system. The modified auto-tuning PID controller was implemented in a SIEMENS PLC, product family SIMATIC S7-300 and S7-400. FB58 is a Continuous Temperature PID controller which contains both self and auto tuning. Tuning features can be applied to activate or de-activate sub-functions or to adjust complete branches inactive.
4.
CONTINUOUS PID CONTROL IN SIMATIC S7 The controllers in SIMATIC S7 are totally programmed with their wide range of functions and characteristics for signal processing. A controller can be adjusted to a system by activating or deactivating the sub-functions required for the specific system. As a result the time and effort needed for configuration of the system is saved by eliminating unnecessary functions. All these steps are supported by the configuration features. All the controllers have an instance database (DB) which should be created application-specifically. When the Temperature continuous PID controller is used, this DB is created implicitly. The calculated outcomes and therefore the updated values of the process, manipulated variables (PV and LMN), status signals (limits) and the data required for cyclic calculation are stored in the corresponding instance DB which is made by the configuration tool or transferred to the process periphery. Both slow processes (temperatures, tank levels etc.) and very fast processes (flow rate, motor speed etc.) can be controlled without any restriction in terms of the type of process. Good control quality can be achieved only if the controller type suits your situation and adapts it to the time response of the process [9]. Figure 2 shows the names of the most important variables and the abbreviations of the parameters in a simple control loop with the continuous PID controller in SIMATIC S7.
Fig. 2. A simple control loop with the continuous PID controller in SIMATIC S7. The process variable (PV) used in PV_PER in the continuous PID controller is an analog variable (voltage, current, resistance etc.) digitized in SIMATIC Step 7 analog input module to be processed by the digital algorithm on the CPU. A common standard used in representing analog signals is when 4mA corresponds to the minimum signal level (1V) and 20mA the maximum (5V).
Digital control signals processed by the CPU are converted into the analog signal by SIMATIC Step 7 analog output module to control different field devices (actuators). This transformation of the data is opposite of the analog input interface performance and it is performed by a digital‐to‐analog (D/A) converter in the module. The function which converts the PV_PER to the floating-point format of -100 to +100 % is CRP_IN and it is calculated by (4): Output of CRP_IN = PV_PER ∗
100
27648
(4)
Table 2 shows the ranges and numerical values of CRP_IN conversion: Peripheral Value PV_PER
Process Value PV in %
32767
118,515
27648
100,000
1
0,003617
0
0,000
-1
–0,003617
-27648
–100,000
–32768
–118,519
Table 2. The ranges and numerical values of CRP_IN conversion The cyclic interrupt organization block OB35 (CYC_INT5) with the cycle of 100ms by default (which can be set at specific scan times, adjustable by the users) is preferred to implement the continuous PID controller in SIMATIC S7.
5.
CONTINUOUS TEMPERATURE PID CONTROLLER FB58 (TCONT_CP) Continuous temperature PID controller FB58 (TCONT_CP) is used to control the temperature process with continuous or pulsed control signals on SIMATIC STEP7. The capability of FB58 is based on the PID control algorithm including supplementary functions for temperature processes. To select a suitable configuration, the type of actuator used to influence the process variable is important. The desired PID controller can be achieved by setting the controller parameters with the parameter assignment tool to enable or disable subfunctions and adjusting the proper values for them to adapt the PID controller to the process. Apart from this capability, there is an option for FB58 to provide continuous manipulated variable output in PID controller process or manually forcing the manipulated value by the operator. The control response with temperature processes can be improved with a control zone and reduction of the P-action in case of a setpoint step change. This controller block also includes a self-tuning function for the PI/PID parameters [9, 10]. The operation schematic diagram of the continuous temperature PID controller FB58 (TCONT_CP) is shown in figure 3.
Fig. 3. Operation schematic diagram of FB58 (TCONT_CP) The controller output signal can operate in both analog manipulated values and pulse-duration modulated actuating signals. Only one kind of actuator can be controlled by the controller outputs which means that one controller can perform one action (e.g. heating or cooling). GAIN is to be set as a negative value in case the block is used for cooling. The previous action means that with the raise of process temperature (PV), the control variable (LMN), and as a result the cooling effect are increased. Setting the parameters and tuning the controller is performed by the parameter assignment user interface and stored in the relevant instance DB. The parameter assignment user interface is started by double-clicking on the relevant instance data block [10]. The FB58 (TCONT_CP) function block, the description of the instance data base and parameter assignment of FB58, the input default mode, number and name of each parameter are shown in Figures 4 and 5.
Fig. 4. FB58 function block and description of the parameter assignment and instance DB
Fig. 5. FB58 description of the parameter assignment and instance DB
6.
IMPLEMENTATION OF THE FB58 (TCONT_CP) To start the implementation the first step is device configuration and choosing the proper PLC CPUs series of S7 300 or 400. Then in the PLC programming part the new OB35 block is to be made. After opening the OB35 the PID TCONT_CP must be inserted in the program from the instructions tool box. In case of access restrictions of the TCONT_CP_DB (read-only because it is know-how protected), for all the parameters from the instance DB a new “Tag table” should be added to give the specified addresses, determine each parameter and save it with the given tag.
Fig. 6. Determining the tag and address of each parameter in a new “tag table”. In the FB58 (TCONT_CP) function block diagram only 19 out of 86 parameters of instance DB are indicated. They must be determined by the appropriate tags. Monitoring and modifying all the parameters is possible by using the “Watch table”. The tags from the “Tag table” should be used in the “Watch table” to determine each parameter and monitor it during the process. The proper addresses for analog input (PV_PER) and output (LMN_PER) of the FB58 function block are given in the tag table. PV_PER address is PIW4 (%IW4) and LMN_PER address is PQW22 (%QW22). Now by opening the simulation box and compiling and downloading the program to the simulator, the PID controller is ready to run. But before starting the simulation the configuration of the TCONT_CP_DB must be opened and set in three steps: 1. Creation of the system deviation to define the kinds of the process value, scaling of the factor and offset, and the dead band width of it; 2. Setting of the controller to define the sampling time, proportional gain, proportional action weighting, integral action, derivation action, control zone and etc.; 3. Setting of the manipulated variable to define LMN limits, LMN factor and offset, and details of pulse generator settings.
After this configuration everything is ready to implement, monitor and run. The TCON_CP is implemented by starting the simulator or CPU and monitoring OB35, tag table, watch table, TCONT_CP_DB configuration. After starting and monitoring the TCONT_CP_DB commissioning the figure of the FB58 performance will be displayed. Figures 7 and 8 indicate the implementation of the continuous temperature PID controller with the following features: cycle = 300ms, setpoint = 50, gain = 1, TI = 50s, TD = 20s, derivative factor = 6, process proportional gain = 0.5, delay time = 1s, recovery time = 50ms, PVPER_ON = true, MAN_ON = false, LMN_HLM = 100, LMN_LLM = 0, PV_FAC=1, PV_OFFS = 0, LMN_FAC = 1 and LMN_OFFS = 0.
Fig. 7. PID control of FB58 (TCON_CP)
Fig. 8. PID control of FB58 (TCON_CP)
7.
RESULT Owing to the essential function of temperature controllers in industry and the advantages of a PID controller Siemens has presented a practical and functional continuous temperature controller which is professionally designed to control the temperature for various kinds of systems. The temperature continuous PID controller FB58 (TCONT_CP) in Siemens PLCs studied in this paper has shown that the system is easily controlled by it. The variation of the controller respond is reasonable and not very different from the steady-state respond. As it is shown in the figures when the variation of the process value (PV) is close to the setpoint, the respond of the controller (manipulated value LMN) is near the constant value. Comparison of the outputs of PI, PD and PID controllers and analysis of their response speed to the variation of process variable show that PI controller has the minimum speed and PD and PID controllers respectively have the minimum and maximum speed of response to reach the maximum manipulated value.
8.
DISCUSSION AND CONCLUSIONS Due to successful implementation, wide accessibility and use of intelligibility PID control became an essential tool to control difficult processes. Good knowledge of the type and characteristic information of a system is essential to design and select the appropriate controller type best suited to the system and find the required static (P component) and dynamic (I and D components) parameters for tuning the controller to the time response of the system. Among a wide range of PLC producers, Siemens is distinguished by its professional and high quality industrial control systems. PID controller in Siemens PLCs has different function blocks such as continuous control FB41 (CONT_C), step control FB42 (CONT_S), continuous temperature control FB58 (TCONT_CP) and temperature step control FB59 (TCONT_S) to control different kinds of systems. PID controller, its tuning and designing have been studied, and the FB58 (TCONT_CP) as a professional continuous temperature PID controller has been discussed and implemented. Here the simulation of TIA Portal is used to demonstrate the performance of FB58. FB58 can be used for all kinds of temperature controlling systems by choosing the correct design and tune. To implement FB58 specifying the proper addressing and correct values of 86 inputs and outputs is essential. The perfect performance of TCONT_CP as the result of applying the standard structure of PID controller in Siemens PLCs in online and offline mode is presented.
9.
REFERENCES: [1]. Lin C, Liu M, Zhu J, Research on Fuzzy Adaptive PID Control Algorithm Based on Siemens PLCSIM, 3rd International Conference on Electric and Electronics (EEIC 2013), Atlantis Press 2013. [2]. Rania A. Fahmy, Ragia I. Badr, and Farouk A. Rahman, Adaptive PID Controller Using RLS for SISO Stable and Unstable Systems, Advances in Power Electronics, vol. 2014, Article ID 507142, 5 pages, 2014. [3]. Xue D, Chen Y Q, Atherton D P, Linear Feedback Control Analysis and Design with MATLAB, Springer-Verlag, London, UK, 2002. [4]. Bassi S J, Mishra M K, Omizegba E E, Automatic Tuning Of Proportional– Integral–Derivative (PID) Controller Using Particle Swarm Optimization (PSO) Algorithm, International Journal of Artificial Intelligence & Applications (IJAIA), vol. 2, No. 4, pp. 25-34, 2011. [5]. Shiller Z, Lu H H, Computation Of Path Constrained Time Optimal Motions With Dynamic Singularities, Journal of Dynamic Systems, Measurement and Control, vol. 114(1), 1998, pp. 34-40. [6]. Visioli A, Zhong Q C, Control of Integral Processes with Dead Time, Advances in Industrial Control, Springer-Verlag, London, 2011. [7]. Singh C, Genetic Algorithms Based PID controller Design, International Journal of Engineering Development and Research, vol 3(3), 2015. [8]. Copeland B R, The Design of PID Controllers using Ziegler Nichols Tuning, March 2008. [9]. Siemens, SIMATIC, Standard PID Control, Manual, 2003, pp. 1–256. [10]. Siemens, SIMATIC, PID Temperature Control, Manual, 12.2003, pp. 1–102.