Online Tuning Diagnosis of Proportional Integral Derivative Controller based on IEC 61499 Function Blocks

Controller performance is a crucial aspect of industrial processes; hence, it is critical to maintaining optimal controller performance conditions. Bad controller performance can be caused by poor proportional integral derivative (PID) controller tuning those results in aggressive and sluggish controllers’ behavior. Correct diagnosis of poor controller tuning becomes vital so that it can adequately handle the controller. This study designs several function blocks for online diagnosis of poor PID controller tuning based on the IEC 61499 standard. The design of the function blocks began with design the method used for diagnosing a poor controller tuning. The procedure was based on autocorrelation function (ACF), comparison of signal to noise ratio (SNR) estimation, and idle index. The function blocks were validated with first order plus delay time (FOPDT) processes, which had aggressive, sluggish, or well-tuned behavior. The function blocks were implemented on a Fluid Catalytic Cracking (FCC) plant and industrial data with various process faults to evaluate its capability to diagnose a poor controller tuning. The developed function block can precisely analyze a poor controller tuning on FCC plant and 8 of 10 industrial data. It showed that the function blocks could diagnose a poor controller tuning correctly if the oscillation were regular.


INTRODUCTION
Bad controller performance can have a negative impact on industry profitability. A study on 26000 samples of PID controllers [1] has shown that only about one-third of the controllers have a good performance. Several causes possibly can degrade controller performance over time, i.e., changes in the characteristic of the material being used, modifications of operating points, and changes in the status of the plant equipment [2]. Therefore, it is important to maintain the controller performance in its optimal condition. Improper controller tuning has been one of the common problems in industrial processes. Inappropriate controller tuning problems can be distinguished into sluggish and aggressive behavior of the control loop. Too conservative tuning would make a sluggish controller behavior, resulting in unsatisfactory disturbance rejection ability and setpoint tracking ability [3]. On the other hand, too tight tuning would make an aggressive controller behavior, leading to an oscillatory control loop and destroys loop stability [3]. In a process control plant, e.g., an oil refinery, chemical plant, paper mill, there are typically between 500 and 5000 control loops [1]. Most controllers are tuned only in the commissioning stage and then never again because it is too time-consuming to keep each controller properly tuned [3]. Automatic detection and diagnosis of poor controller tuning can make the operator aware of a poorly tuned controller. Thus, the controller can be optimized more efficiently.
Hagglund [4] proposed a performance index for automatic detection of sluggish control loops, suitable for both online and offline applications. The underlying idea is based on the characteristics of sluggish control loops when it responds to a step load disturbance. Comparing to a welltuned controller, a sluggish tuned controller has a long period where the correlation between process output and controller signal increments is positive. The idle index describes the relationship between the positive and negative correlation between the controller output and measurement signal increments. A controller is considered a sluggish controller if the value of the idle index is positive close to 1. However, a negative value of idle index close to -1 is obtained both in well and aggressive tuned controller. The idle index is not robust when it comes to real noisy data. Kuehl and Horch [5] proposed a data pre-treatment procedure to compute idle index under realistic conditions. The procedure includes steady-state detection, signal filtering, and signal quantization. However, these procedures require several parameters which cannot be set automatically. Both the method proposed by Hagglund and Kuehl and Horch only address the sluggish controller tuning issues. Thus, it cannot detect the aggressive one. An aggressive tuned controller can be identified by detecting the presence of linear oscillation. Dewa, Wardana, and Hawibowo [6] developed a linear oscillation diagnosis method based on the combination of Variational Mode Decomposition (VMD) proposed by [7]. The advanced diagnosis method is based on the VMD-based oscillation detection method [8], nonlinearity detection [9], and linear oscillation quantification [10]. Generally, a programmable controller is a digital computer used to handle automation processes in the industry. Its syntax and semantics are regulated through International Electrotechnical Commission (IEC) standard. The development of a distributed automation system, where the intelligence is decentralized and embedded into distributed software components, has brought out the IEC 61499 standard for designing the distributed system [11]. The IEC 61499 provides notation and architecture complementary to the previous standard by modeling a function block with event-based execution [11].

PROPOSED METHODS
The proposed method is based on the combination of oscillation detection developed by [13], oscillation quantification developed by [10], and sluggish controller detection developed by [4]. The main algorithm is shown in Figure 1. The details of each method are described subchapters below.

Oscillation detection method
The method proposed by [13] used the regularity of the zero crossings of autocovariance function (ACF) to determine the presence of oscillation. The ACF is described as measuring the linear dependence between the variable at different time lags [14]. It is used for oscillation detection because it can reduce white noise in the signal. At time lags greater than zero, the white noise is equal to zero. Furthermore, the ACF of an oscillating signal is oscillating at the same period as the oscillatory signal. The zero-crossing of ACF is identified by detecting the time lags of ACF when the values of ACF are zero. The intervals between two zero crossings are then evaluated to determine the period of oscillation, as where is the oscillation period, is total of zero crossing, and ∆ is the interval between two zero crossing. The final step on oscillation detection is the evaluation of the oscillation regularity. It is an indicator that the oscillation has a regular pattern and can be obtained as where r is the regularity and is the standard deviation of the period [13]. The standard deviation of the period is defined as twice of the standard deviation of the zerocrossing interval. An oscillation is detected if there are more than 8 zero crossing in ACF and the regularity is more than 1.

Oscillation quantification method
The oscillation quantification is based on the assumption that the oscillation is linear. Linear oscillation can be caused by poor controller tuning or external harmonic disturbance. Oscillation due to poor controller tuning has a stochastic behavior of the ACF, while oscillation due to external harmonic disturbance is deterministic [10]. Theoretically, the differences between ACF peaks are equal to zero if the oscillation is due to external harmonic disturbance. The confidence interval is used to check if the differences between the peak values are significant, as in: where ∝ is the confidence interval and N is the number of sample data [10]. If there are significant differences between the peak values, then the oscillation is due to poor controller tuning. Estimation of Signal to Noise Ratio (SNR) is used as an additional test to confirm if the oscillation is due to controller tuning. Here, SNR is estimated from the ACF and then compared to the SNR estimated from the power spectrum. External Disturbance Index (EDI) is defined as the ratio between SNR calculated from ACF and SNR estimated from the power spectrum [6]. Based on the simulation, the external harmonic signal has an EDI value less than 1. Thus, EDI values of more than 1 imply that oscillation due to controller tuning.

Sluggish controller detection method
If there is no oscillation detected in the signal, then the controller's chances are well-tuned, or the controller is sluggishly tuned. As proposed by [4], the idle index is used to check if the controller is sluggish. In this case, the Idle index is calculated recursively to give a more convenient result for online applications. An idle index of more than 0.4 implies that the controller is sluggish. However, it is important to note that this procedure assumes that the process gain is positive and the load disturbances are in steps.

RESULTS AND DISCUSSION
Designing the function blocks is done using Eclipse 4DIAC-IDE [14] for implementing IEC 61499 standard. The diagnosis methods are developed into 14 function blocks, as shown in Table I. Each function block is connected to the build IEC 61499 application ( Figure 2). For the application to run online, this paper implemented a moving window technique into the diagnosis method. Data is exchanged using a message queue telemetry transport (MQTT) protocol to support the publisher-subscriber paradigm. Data stored in a comma-separated values (csv) file is sent one by one using Python to the 4DIAC application. This study uses a personal computer, an AMD Ryzen 3 3200 U 2.66 GHz processor with 8 GB RAM.  The designed function blocks are validated with first order plus delay time (FOPDT) [16] process, which has a block diagram as shown in Figure 3. Here, the FOPDT process is tuned using the Tyreus-Luyben equation to obtain a welltuned behavior of the controller. After that, the PID parameters are then adjusted using trial and error to make the controller sluggish and aggressive. The parameters of each controller condition are shown in Table 2.  Validation results show that the function blocks could diagnose a poor controller tuning on FOPDT processes correctly and are listed in Table 3. Oscillation was detected in the aggressive controller. In contrast, it was not detected in both the sluggish and well-tuned controller. The idle index in the sluggish tuned controller was far close to 1 compared to the idle index in the well-tuned controller. This concluded that the designed function blocks give valid results to diagnose poor PID controller tuning. This study also presents 13 data that have various process faults to implementing the designed function blocks. The data are obtained from multiple resources, i.e., fluid catalytic cracking (FCC) simulator as developed by [17] and the industrial data published at [18] and [19]. These data include various process faults that are already known. The implementation results are then compared to the actual faults to evaluate the capability of the function blocks in diagnosing poor controller tuning. FCC is a process in the refinery plant used to producing gasoline, liquid petroleum gas, and light gas by cracking long-chain hydrocarbon molecules into shorter ones [17].
There is a regenerator and reactor used in the process. It is important to control the differential pressure between regenerator and reactor to maintain the product quality. The control loop of the differential pressure is used to implement the function blocks. Collecting data from FCC simulation begin with tuning its controller using the relay autotune method. It results in a sluggish, aggressive, and well-adjusted controller, as plotted in Figure 4. The results of the diagnosis implementation to FCC data correspond to the actual condition. Table 4 shows this information.  The details of the industrial data are listed in Table 5 with a running index from 1 to 10. Data 1 to 3 are data collected from [18] the others are data collected from [19]. The diagnosis results are shown in Table 6. Based on the result, there are two incorrect diagnoses, i.e., data 2 and data 3. Incorrect result in data 2 is caused by the slow change in the setpoint from time to time. This can happen since data 2 are the slave controller from a cascade loop. It should be excluded from the analysis because an idle index can diagnosis correctly only if there is a step load disturbance, not a setpoint change. Thus, detecting the step load disturbance before evaluating the idle index can prevent the idle index from giving incorrect results. The incorrect result in data 3 was caused by the diagnosis method's inability to detect valve stiction. Valve stiction can cause a nonlinear oscillation, which cannot be distinguished from linear change using this paper's method. As shown in the results, instability is detected but is interpreted as oscillation due to controller tuning. Implementation of a nonlinearity test before oscillation quantification can solve this problem.  The purpose of this implementation is to know the function blocks' capability when facing various process faults. The false results show that the proposed method still needs improvement when applied to the real industrial data. Furthermore, the method cannot diagnose multiple oscillations since no decomposition method is used in this work. Multiple oscillations are known when the regularity of oscillation is less than 1. For example, data 7 has multiple oscillations with a regularity of 0.5 ( Figure 5). The cause of oscillation could not be diagnosed since the method only diagnoses oscillation with a regularity of more than 1. Thus, oscillation with regularity less than one will be interpreted as no oscillation. In data 7, this would not be a problem since data 7 do not have controller tuning issues. However, it will give a false positive if one of the multiple oscillations is due to controller tuning. Considering that multiple oscillations are common in real industrial data; it is recommended to add the decomposition method. It is a method to separate a single oscillation into multiple oscillations. Then, the diagnosis method can be implemented on each of the oscillations.

CONCLUSIONS
This work has designed 14 function blocks based on IEC 61499 to diagnose poor PID controller tuning. The diagnosis method is based on combining several existing methods, including oscillation detection method using the regularity of zero crossings of ACF, oscillation quantification method using differences of peak values of ACF and SNR estimation, and sluggish detection method using an idle index. The validation results show that the function blocks can diagnose a poor controller tuning correctly. The implementation results show that the function blocks can precisely analyze a poor controller tuning on 8 of 10 industrial data. This function blocks design can be developed as a human-machine interface to give useful information to the operator. However, the function blocks cannot provide a correct diagnosis if the oscillations are not regular. For future work, oscillation decomposition and step disturbance detection can be added to the function block for completing diagnosis method.