AUTOTUNING OF PID CONTROLLER BY MEANS OF HUMAN MACHINE INTERFACE DEVICE

More and more control systems are based on industry microprocessors like PLC controllers (Programmable Logic Controller). The most commonly used control algorithm is PID (Proportional-Integral-Derivative) algorithm. Autotuning procedure is not available in every PLC. These controllers are typically used in cooperation with HMI (Human Machine Interface) devices. In the study two procedures of autotuning of the PID controller were implemented in the HMI device: step method and relay method. Six tuning rules for step methods and one for relay method were chosen. The autotuning procedures on simulated controlled object and PLC controller without build-in autotuning were tested. The object of control was first order system plus time delay.


Introduction
PID algorithm is the most widely used control algorithm in the industry. The record shows near 90% control systems employ PID (Proportional-Integral-Derivative) algorithm [1], [2]. PID algorithm implemented in industry microprocessors, e.g. PLC, is called PID controller [3]. Currently, the most popular industrial microprocessor-based devices are PLC (Programmable Logic Controller). Many controller manufacturers (e.g. ABB, Allen-Bradley, General Electric, Honeywell, Omron, Siemens, Toshiba, Yokogawa, etc.) offer a PID algorithm as function block in their devices. Some of the manufacturers decide to introduce series of improvements of PID algorithm. Typical examples include techniques for mode switches and anti-windup [3], [4]. Despite the popularity of the PID algorithm, not every controller manufacturers provide procedure to tune the controller parameters, i.e. autotuning. The main task of autotuner is to identify the controlled object. The controlled object is often called the plant. The identification process reveals the dynamic and static behaviour of the plant. This behaviour determines the controller parameters. There are two major autotuning procedures implemented in PLC. These are relay and step methods. If there is no build-in autotuning procedure, the operator has to do the identification sand election of controller parameters by himself.
To facilitate the handling of control system of single machine or technological process touch operating panels HMI (Human Machine Interface) are used. On the Polish automation market, the most popular HMI devices are Pro-face panels. At the beginning, the HMI panels had only two tasks: to display information that came from PLC (e.g. the state of discrete output or temperature measurement) and to transmit input information to PLC (e.g. set the state of discrete output or setpoint temperature). Modern HMI panels, in addition to tasks related to process control, perform following functions: the gateway that makes communication between different automation devices easier, generates alarms based on events, sampling data, reporting and historical data collection. They can not only be complementary to the PLC, but also they can replace the PLC in the realization of some functionality. Controller tuning is a good example.
The goal of our study was to implement in the HMI the automatic procedure of controller tuning. The assumption was that the program would identify controlled object and calculated controller parameters on the basis of identification results. Controlled object, also called the plant, described by transfer functionG(s) (1) was simulated using Matlab&Simulink. It was the first order plus time delay system, which is typical example of thermal system [5]. It was assumed that value of parameters of controlled object were as follows: k=0, 8 where: k -plant proportional gain, T -time constant, -delay or lag time.

Materials and methods
The PLC controller realized the PID algorithm described by equation (2). Which is the most commonly implemented form of PID. This form is labeled ISA, dependent or gain-dependent form. The ISA is used in numerous controllers, e.g., GE VersaMaxPLC (PID ISA function block), Siemens S7-300 (FB41 function block), and Allen-Bradley PLC-5 (PID function block) [4], [6], [7]. In our research we use PID algorithm without derivative term, so TD=0.
Matlab&Simulinkwas generating setpoint y0 and plant output y signals, which were transmitted to the PLC through the DAQ board. On the basis of setpointy0 and controlled object output y signals, the PLC was calculating the control signal u and sending it back to Matlab&Simulink.
The HMI panel supervised control process, displayed actual values of the measurements and archived those values in the internal memory. The autotuning procedure was initialized by operator through the HMI. We implemented two versions of procedure: relay and step.
Relay method, also labelled as sustained oscillation, was based on the procedure available at EFTRONIK XS controller [8]. The procedure had several stages:  Operator (user) declares maximum umax and minimum umin permissible values of control signal u, setpointy0, and time of experiment.  Program switches controller to the manual mode.  Program analyses value of plant output signal y. If 0 yy  then u=umax, else u=umin.
 After identification stage, program determines two parameters: ultimate gain KU and ultimate period TU. These parameters are used to calculate the controller parameters according to Aström-Hägglund rule (3). Program sends parameters KP and TI to the controller and switches it to the automatic mode.
0, 45 1, 2 The second procedure was based on step method. This method is used among others in SIPART DR 22 controller [9], [8]. The scheme of the procedure is:  Operator declares the amplitude of excitation of control signal u.  Program switches controller to the manual mode.  Program changes the control signal u by the u value. Controlled object reacts on the excitation and trends to new steady state.
 Program analyses the changes of y signal and calculates lag time  as the time counted from the start of experiment to the moment when the value of y will change by 5%.  Program still analyses the changes of y signal and calculates time constant Tas the time counted from the determination of lag time  to the moment when plant output y will reach new steady state. New steady state is reached when the changes of the value of the next three samples of y will be smaller than 10%.
 Program calculates proportional gain k as the ratio of changes of plant output signal y to the changes of control signal u.  Controller parameters are calculated according to the following tuning rules: Chien 0% overshoot (4), Chien 20% overshoot (5), Cohen-Coon (6), Hey (7), Oppelt (8), Ziegler-Nichols (9). We chose them from O'Dwyer's book [10].  Program asks the operator to choose one of the six controller parameters sets. Program sends parameters KP and TI to the controller and switches it to the automatic mode.
where: x1, x2 -is the additional coefficients according to table 1.
Both of two autotuning procedures were tested to evaluate control performance. Two control performance indexes: IAE (10) and ISE (11) were used. Smaller value of each index means better control performance.

Results
In the relay procedure, dynamic and static behaviour of plant were described by two parameters: ultimate gain KU, and ultimate period TU. We received the following values: KU =4,01 and TU=7,54s.
In the step procedure, program determined three parameters that describe plant dynamics: plant proportional gain k, time constant T, and lag time . The following values: k=0,75, T=7,25s, and =4s were received. By comparing these estimated values with true values (i. e. k=0,8, T=9s, and =3s) error of estimation can be calculated: 6, 19, and 33% for plant proportional gain, time constant and lag time respectively.
On the basis of estimated plant parameters, program determined several sets of PI controller parameters, i.e. proportional gain KP and reset time TI according to (3)(4)(5)(6)(7)(8)(9). Values of controller parameters, as well as values of performance indexes for each tuning rule are presented in table 2. Relay procedure and step procedure were tested with the same experiment scheme. The setpoint value y0 changed every 40s in the range of 32-78%. Fig. 2. shows the signals of setpoint y0, plant output y, and control u measured during tests. Cohen-Coon was the best tuning rule among all six rules tested in step method (it has the smallest values of performance indexes). Tuning rules Chien 20% overshootand Hay had IAE values 22 and 25% higher than the best rule. The greatest value of IAE index for the Oppelt's rule was observed and the value was 162% higher than the Cohen-Coon's rule. The rule of Cohen-Coon had also the lowest ISE index. Rules Chien 20% overshootandZiegler-Nichols were worse (i.e. they had higher value of ISE) by approximately 7%. For Chien 0% overshootandHay rules performance index ISE was higher by approximately 15%. The worst control performance was related to the Oppelt's rule and the value of ISE was 110% higher than for the rule of Cohen-Coon. The rule of Aström-Hägglund, used in the relay method provided comparable control performance with the best step method. In this method control performance indexes were higher by 6% (IAE) and 7% (ISE).
The analysis of transient responses ( fig. 2.) shows that the controller parameters obtained by rules of Oppelt and Chien 0% overshoot do not guarantee the achievement of setpoint within the assumed time of 40s. Therefore, they should be applied to processes where cannot be any overshoots and slow reaching of setpoint is permissible. This is caused by too slow effect of integral action of the controller. The reset time TI was equal to 13,3 and 16s for rules of Oppelt and Chien 0% overshoot. The controller parameters obtained by rule of Ziegler-Nicholsalso had reset time equal to 13,3s, but higher value of proportional gain KP made transient response faster.

Conclusion
In the study implementation of two PID autotuning procedures in HMI device was presented. HMI panel can play a role of universal tuning PID controllers tools, especially for those without built-in autotuning function. Six tuning rules for step method and one for relay method were used. The experiment exposed differences in the values of control performance indexes. Therefore, the effectiveness of the autotuning procedure depends not only on the accuracy of controlled object identification, but also on the tuning rule. The step procedure requires the development of more accurate way to estimate lag time and time constant. The problem may also be a long time of experiment in the case of identification of a plant with a long time constant. The relay method seems to be easier to implement, but offers only one set of control parameters. For simulated plant, with characteristic similar to thermal system, the control performance of control system tuned by relay method was slightly worse than the control performance of system tuned by step method. The difference between control performance indexes was less than 7%. For this reason, we suggest control engineers to try the relay method at the first place.