Prediction of PID control model on PLC

PID (Proportional Integral Derivative) is a control algorithm that mostly used in industry. However, users have never known what the PID model that used inside the PLC. By knowing the PID model that used in PLC, users will have more choice in determining the more appropriate tuning algorithm. Also, users can use MATLAB to perform analysis and can implement it to PLC. Through OPC Server (Object Linking and Embedding for Process Control Server) as a software interface, programs on a windows operating system can communicate with industry devices universally. PID model prediction method is done by comparing the output of the plant controlled by PID model in PLC and PID model in SIMULINK MATLAB using OPC Server intermediaries. Based on comparison result in graph and analysis using integral error method, PLC M221 using Parallel PID model and PLC S7-1200 using Ideal PID model.


Introduction
PID (Proportional Integral Derivative) is a control algorithm that mostly used in industry because of its good performance and relatively easy to tune its parameters [1,2].There are three forms of PID models in general, namely series, parallel, and ideal.PLC (Programmable logic controller) is a control device that is often used in the industry because it is relatively easy to program, durable and can be integrated with other industrial devices [3,4].PID in industry is implemented using PLC hardware [5][6][7].Each PLC brand uses a different PID model [8].The differences PID model making each output between different brands PLC not the same although using the same plant.In practice, the user never knows the PID model used on the PLC.By knowing the PID model used, the user will have more choice in determining the more appropriate tuning algorithm.Also, by knowing PID model in PLC, user can use MATLAB to analyze and implement the analysis results to PLC.
PLC can be integrated with MATLAB application that works on windows operating system [9][10][11][12].MATLAB (Matrix Laboratory) is a program used to perform engineering and mathematical computations as well as modeling and simulating the SIMULINK environment [13][14][15].The advantages of integrating PLC and MATLAB directly are reducing complexity, minimizing manually entering data, simplifying system maintenance, facilitating plant modeling/simulation processes, no need to install additional hardware on the PC, and cost savings.In the absence of additional hardware then there is no need to change the I/O analog to digital or vice versa, since all I/O is in digital form.This paper will explain prediction of the PID model used in PLC with virtual plant in MATLAB.Some researcher that uses MATLAB analysis results to be used or compared to the results in the PLC.Comparative results with MATLAB and PLC provide findings on various performance parameters in the application of shell and tube type heat exchanger control systems [16,17].Comparison of MPC controls using OPC and MATLAB servers as OPC clients and PID control on PLC on the implementation of heating water tank systems [18][19][20].In the design of multivariable process control, a tool has been created to convert the Simulink model to automatically generated code in C/C++ and implementation directly on the PLC [15], [21].The conventional SCADA can enhanced further more with PLC as well as NI-OPC server significantly through the experimental validation procedure of a simple cascade control system through a number of architectures (PLC, SCADA, OPC, internet) [9].Through realization in PLC  ISSN: 1693-6930 TELKOMNIKA Vol.17, No. 1, February 2019: 529-536 530 can used to prove that improvement performance of traditional PID obtained from parameters self-tuning PID [22][23][24][25].The system is design in MATLAB/Simulink and the software communicates with PLC using Kepware OPC which allows communication between multi-vendor devices without any restrictions [26].

PID Control
PID Control is a control loop feedback mechanism that mostly used in industrial control systems.PID control calculates an error value and applies correction based on proportional, integral, and derivative terms.There are 3 types of PID controllers; they are series PID, parallel PID, and ideal PID as shown in ( 1), (2), and (3).The parameters of each type of PID controller have an influence on the control signal generated.
The series PID model is usually called the interacting form, because the value of derivative time affects the integral part, so this part interacts with each other.The Ziegler-Nichols PID rules tuning were developed for this controller algorithm.The parallel PID model is one that is commonly used because it has a proportional value, pure integral action.In the Ideal PID model, proportional, integral, and derivative actions do not interact with each other in the time domain.The Cohen-Coon and Lambda PID tuning rules were designed for this algorithm [27].

Research Method
PLC is a controller in which there is a PID controller.Each PLC from various vendors provides PID controllers with different models.In this paper will be compared PID model of two different PLC brand with intermediary OPC Server and MATLAB.PLC will be used as PID controller.PID model testing process on PLC will be done by comparing the output of virtual plant after PID controlled on PLC and output after PID controlled on MATLAB, with the help of OPC Server.MATLAB SIMULINK is used to create a virtual plant from second order system and as a comparison of the PID model.After all the testing that had been done, user will have more choice in determining more appropriate tuning algorithm.Also, by knowing PID model in PLC, user can use MATLAB to analyze and implement the analysis results to PLC.
The OPC Server application used is KepserverEx v6.For the communication configuration diagram between PLC, OPC Server, and MATLAB used in the comparison simulation process shown in Figure 1.For configuration of PID controller on PLC and MATLAB with OPC Server interface device used in this paper is shown in Figure 2.While the configuration for PID in MATLAB is shown in Figure 3.The two block diagrams shown in Figure 2 and Figure 3, are made similar, because for the process of comparison between the two systems must have the same state.The process is the setpoint goes into the OPC, the PID output goes to the OPC, and the outputs (feedback) go to OPC.Plant made in the form of a virtual plant.In this paper virtual plant created in SIMULINK application.The second order plant used plant mass-spring-damper.

Results and Analysis
This section shows the simulation results in the output graph from the virtual plant after being controlled by PLC PID and MATLAB PID.For comparison use parallel PID MATLAB and ideal PID MATLAB to compare result with PLC PID to know PID model used in PLC.For PLC M221 from Schneider produces a comparison of output graph as shown in Figure 4 using PID parameters in Table 1.The first PID parameters are obtained by using auto-tune in PLC M221.
Next use the second PID parameter to ensure the simulation results in PLC M221.The second PID parameter is shown in Table 2 and the results are shown in Figure 5.For PLC S7-1200 from Siemens produces a graph of output graph as shown in Figure 6, with PID parameter as in Table 3 obtained by using auto-tune PLC S7-1200.Next result with second PID parameter on PLC S7-1200.The second PID parameter is shown in Table 4 and the results are shown in Figure 7.      5. From the results of data analysis using integral error method, it is concluded that PLC M221 uses parallel PID model and PLC S7-1200 using Ideal PID model.It is because the total integral error difference when PID PLC M221 compare to parallel PID MATLAB is smaller than the total integral error difference when PID TELKOMNIKA ISSN: 1693-6930  Prediction of PID control model on PLC (Erwani Merry Sartika)

533
PLC M221 compare to ideal PID MATLAB.As well as the total integral error difference when PID PLC S7-1200 compare to ideal PID MATLAB is smaller than the total integral error difference when PID PLC S7-1200 compare to parallel PID MATLAB.To further convince the conclusion of PID control method prediction on PLC then tested at real plant.The real plant used in the simulation is the third order RLC plant.The RLC circuit is realized in the PCB as shown in Figure 8.The equation of the transfer function of the real plant is as show in (4) For simulation results using PLC M221 with real plant results output comparison graph as show in Figure 9 with parameter of PID used as show in Table 6.The result of integral error method between PLC M221 and parallel PID is 274.178whereas with ideal PID is 292.736.
These results are increasingly assured that the PID model on the PLC S7-1200 use the parallel PID model.As for the simulation results using PLC S7-1200 with real plant results the output comparison graph as in Figure 10 with parameter PID used as in Table 7.The result of integral error method between PLC S7-1200 with parallel PID is 519.638whereas with ideal PID is 407.065.These results are increasingly assured that the PID model on the PLC S7-1200 use the ideal PID model.For the results of the whole analysis is shown in Table 8.

Conclusion
PID model predictions method have been successfully used by comparing the output of the plant controlled by PID model in PLC and PID model in SIMULINK MATLAB using OPC Server intermediaries.Based on comparison result in graph and analysis using integral error method, PLC M221 is predicted using Parallel PID model and PLC S7-1200 using Ideal PID model.By knowing the PID model used, user will have more choice in determining the more appropriate tuning algorithm.By knowing PID model in PLC, user can use MATLAB/Simulink to analyze and implement the analysis results to PLC.

Figure 4 .Figure 5 .Figure 6 .
Figure 4. Comparison of output of M221 and MATLAB for mass-spring-damper plant with first PID paramete

Figure 7 .
Figure 7.Comparison of output S7-1200 and MATLAB for mass-spring-damper plant with second PID parameter

Figure 8 .
Figure 8. Realization of 3 rd order RLC circuit on PCB

Table 3 .
The First PID Parameters used for Comparison of Mass-spring-damper Plant for PLC S7-1200

Table 4 .
The second PID Parameters used for Comparison of Mass-spring-damperPlant PLC S7-1200

Table 5 .
The Results of Data Analysis using Integral Error Method (mass-spring-damper plant)

Table 6 .
PID Parameters used for Comparison of Real Plant for M221 PLC

Table 8 .
The Result of Data Analysis using Integral Error Method (Real Plant)