Improved Continuous-Cycling Method for PID Autotuning

: An improved continuous-cycling method is proposed for the autotuning of the proportional–integral–derivative (PID) controller. The proposed method can identify the frequency response of the process at a preset phase angle without a modeling error. Moreover, it provides an exact frequency response even if a static disturbance is present. The proposed method is an improved version of the continuous-cycling method. The gain of the proportional controller in the continuous-cycling method is updated to obtain the continuous-cycling status automatically. To guarantee the preset phase angle of the frequency response, we place a phase shifter in the form of a time delay after the proportional controller. The results of simulation and experimental studies show that the proposed method can provide an exact frequency response even under static disturbance conditions and can be applied to real processes.


Introduction
Numerous modeling methods for proportional-integral-derivative (PID) autotuning have been developed since the original relay feedback method was proposed [1][2][3][4]. The original relay feedback method has limitations in that it shows modeling errors due to the harmonics of the relay signal and it is structurally impossible to assign a preset phase angle to the frequency response model. Moreover, it cannot manipulate the static disturbance in a systematic way, resulting in severe modeling errors or cycling failure.
Many researchers have tried to overcome the limitations of the original relay feedback method. Modified relay feedback methods using a six-level signal and a saturated relay signal were proposed to reduce the modeling error of the identified frequency response by reducing the harmonics [5,6]. Several relay feedback methods combined with an artificial time delay, a hysteresis, or a two-channel relay were developed to obtain the frequency response of the process corresponding to a preset phase angle [7][8][9][10][11][12]. Some relay feedback methods moved the reference value for switching the relay on/off to guarantee the same accuracy of the model even under static disturbance conditions [11][12][13][14][15][16]. Furthermore, an improved relay feedback method was developed to estimate the frequency response data of the process with better accuracy by removing the effects of measurement noises and disturbances [17] using a disturbance estimator and a noise magnitude estimator. All the previous relay feedback methods mentioned above are modifications of the relay feedback method. All of them still failed to completely remove the harmonics. Additionally, they have shortcomings in that the user must wait until the process converges to a steady state before conducting the relay test. Otherwise, the wrong deviation variables for the relay test are assigned and, as a result, a severely asymmetric limit cycle or cycling failure is obtained.
Low-order plus time-delay models have been identified from the relay feedback method [18][19][20][21][22]. The modeling methods using a curvature factor [18] and an input-biased relay [19] suffer from the effects of the harmonics, resulting in unavoidable modeling errors. The other methods based on an asymmetrical limit cycle [20] and a shape factor [21] have shortcomings in that they have to solve non-linear equations in an iterative manner. Moreover, all the methods [18][19][20][21][22] are inherently sensitive to plant-model structural mismatch and uncertainties such as disturbances and noises because the frequency information included in the limit cycle of the relay feedback test mainly concentrates on the zero and ultimate frequency.
Various process identification methods have been proposed to find high-order process models from closed-loop tests of relay feedback [12,[23][24][25]. Even though the process identification methods and tuning methods based on multiple frequencies can provide better performances, they require heavier data processing and their implementations are more difficult compared to previous simple PID autotuning methods.
In this study, we propose an improved continuous-cycling method for the automatic tuning of the PID controller. The proportional gain of the proportional controller is automatically updated to obtain the continuous-cycling status. To guarantee the preset phase angle of the frequency response, we place a phase shifter in the form of a time delay after the proportional controller, as was done in [7] and [12]. The proposed method can identify the frequency response of the process at a preset phase angle without modeling error. It theoretically provides an exact frequency response even if a static disturbance is present or the initial status is not a steady state. Therefore, the user does not need to wait until the process converges to a steady state before conducting the proposed autotuning method. Furthermore, it is straightforward to obtain the exact first-order plus time-delay model without solving non-linear equations when there are no disturbances and the initial status is a steady state. We demonstrate numerically and experimentally that the proposed method can provide an exact frequency response even under static disturbance conditions, and can be applied to real processes.

Proposed Autotuning Method
Figures 1 and 2 show a schematic diagram and a typical response for the proposed method. The proposed method is composed of a proportional controller, a continuouscycler, and a phase shifter. The proportional gain of the proportional controller is automatically adjusted by the proposed continuous-cycler to derive the overall process to a continuous-cycling status.
Subsequently, the following characteristic equation for the continuous-cycling status is obtained.
1 + k c G(iω)e − iθ ps ω = 0 (1) Thus, the frequency response data of the process can be easily obtained as in Equation (2): where k c , ω, and θ ps denote the proportional gain, the frequency, and the time delay at the continuous-cycling status, respectively. PA set is a preset phase angle specified by the user. G(0) is the frequency response of the zero frequency. u p and y p are the peak values of the process input and process output, respectively. u v and y v are the valley values of the process input and process output, respectively.
The phase shifter in Figure 1 plays a role in guaranteeing the preset phase angle of PA set by adjusting the time delay (θ ps ) every cycle according to Equation (3). As shown in Equation (4), the amplitude ratio of the frequency response data is 1/k c .
The proposed autotuning method with the continuous-cycler and the phase shifter goes through the following steps to obtain the continuous-cycling and the preset phase angle. cycler, and a phase shifter. The proportional gain of the proportional controller is automatically adjusted by the proposed continuous-cycler to derive the overall process to a continuous-cycling status.
Subsequently, the following characteristic equation for the continuous-cycling status is obtained.  Thus, the frequency response data of the process can be easily obtained as in Equation (2): where , , and denote the proportional gain, the frequency, and the time delay at the continuous-cycling status, respectively. is a preset phase angle specified by the user. (0) is the frequency response of the zero frequency. and are the peak values of the process input and process output, respectively. and are the valley values of the process input and process output, respectively.
The phase shifter in Figure 1 plays a role in guaranteeing the preset phase angle of by adjusting the time delay ( ) every cycle according to Equation (3). As shown in Equation (4), the amplitude ratio of the frequency response data is 1/ .
The proposed autotuning method with the continuous-cycler and the phase shifter goes through the following steps to obtain the continuous-cycling and the preset phase angle.
[Step 1.1] Set the lower and upper limits of the saturator, equivalently setting the limits of the control output for the sake of safety. Set the initial proportional gain ( ) of [Step 1.1] Set the lower and upper limits of the saturator, equivalently setting the limits of the control output for the sake of safety. Set the initial proportional gain (k c ) of the proportional controller to a very large value (e.g., 1000) to get the initial fully saturated cycle from 5 s to 14 s as in Figure 2. Set the preset phase angle (PA set ) of the frequency response data of the process and the setpoint of the proportional controller in accordance with the operator request. Run the proportional controller.
[Step 1.2] At the second peak of the process output, set the proportional gain (k c ) of the proportional controller to Equation (11) using the following equations: Processes 2021, 9,509 4 of 20 where T on and T o f f represent the time length corresponding to the lower and the upper saturation limits of the initial cycle, respectively, as shown in Figure 2. ω = 2π/ T on + T o f f is the frequency. a 1 and b 1 are the Fourier coefficients of the sine signal and the cosine signal of the fundamental frequency when the process input of the initial cycle is represented by the Fourier series. Then, u amplitude corresponds to the amplitude of process input (u(t)). y amplitude denotes the amplitude of the process output (y(t)) as shown in Figure 2. AI is an index of asymmetry defined by Equation (10). k c,0 is the initial value of the proportional gain for the next step. b 1 = 0, a 1 = 2(u max − u min )/π, and AI = 1 in the case that the process input is symmetric (equivalently, T on = T o f f ). Then, k c,0 = 1.6 × 2 × (u max − u min )/ π × y amplitude .
2 × (u max − u min )/ π × y amplitude is the same as the ultimate gain obtained by the describing function analysis [12] from the symmetric relay feedback signals. Therefore, roughly speaking, the initial value k c,0 is chosen by 1.6 times the ultimate gain. In the case that the process input is asymmetric, the initial value k c,0 proportional to AI, as in Equation (11), is recommended to compensate for the phenomenon that u amplitude /y amplitude decreases as AI increases.
[Step 2.1] In the case of controller output saturation, decrease the proportional gain according to the proposed continuous-cycler as in Equation (13). The continuous-cycler would derive the cycling out of the saturation region automatically by decreasing the proportional gain.
where T s,lower,k and T s,upper,k are the time lengths corresponding to the lower and upper saturation limits of the k-th cycle, respectively, as shown in Figure 3. Lower and upper limit saturation mean that the process input is at the lower limit and the upper limit, respectively. Therefore, T s,lower,k and T s,upper,k are determined by measuring the time length that the process input is at the lower limit and the upper limit, respectively. k c,k is the proportional gain of the k-th cycle. P k is the period of the k-th cycle. In the case of controller output saturation, the proposed continuous-cycler in Equation (13) reduces the proportional gain in proportion to the square of the saturation portion within one period to derive the cycling out of the saturation.
[ Step 2.2] In the case of no controller output saturation, the proposed continuouscycler in Equation (14) decreases the proportional gain if the amplitude (a k ) of the process output in the present cycle is greater than the amplitude (a k−1 ) of the process output in the previous cycle, as shown in Figure 4, and vice versa to derive the cycling into a continuouscycling status automatically. a k and a k−1 are obtained by measuring the difference between the valley value and the peak value of the process output.
Decreasing the constant α makes the convergence pattern of the proportional gain more stable but slower via less weighting on the ratio of the present and the previous peak values. The proportional gain does not change when the present peak and the previous peak are the same. α = 0.3 is recommended in this paper based on extensive simulation results. [ Step 3] Set the time delay as θ k = (π + PA set )/ω k , ω k = 2π/P k to guarantee the preset phase angle of PA set . [ Step 4] Repeat [Steps 2-3] at each cycle until a continuous-cycling status is obtained. [ Step 5] Estimate the frequency response data of the process corresponding to the cycling frequency using Equation (2), and the frequency response corresponding to the zero frequency using Equation (5).
Decreasing the constant makes the convergence pattern of the proportio more stable but slower via less weighting on the ratio of the present and the previo values. The proportional gain does not change when the present peak and the p peak are the same. = 0.3 is recommended in this paper based on extensive sim results. ) and the present cycle ( , , and , , ). , , = , , + , , . [ Step 3] Set the time delay as = ( + )/ , ω = 2π/ to guarantee the preset phase angle of . [Step 4] Repeat [Steps 2-3] at each cycle until a continuous-cycling status is obtained. [Step 5] Estimate the frequency response data of the process corresponding to the cycling frequency using Equation (2), and the frequency response corresponding to the [Step 6.1] If you want to use only G(iω) to tune the PID controller, calculate the tuning parameters of the PID controller using the ZN tuning rule or the gain-phase margin tuning rule [1,12].
Processes 2021, 9, 509 6 of 20 [Step 6.2] If you want to use both G(iω) and G(0) to tune the PID controller, obtain the first-order plus time-delay model using the model reduction method [12] in Equations (15)- (17). In addition, calculate the tuning parameters of the PID controller using the IMC or ITAE tuning rules for the first-order plus time-delay model [12].
where k, τ, and θ are the gain, time constant, and time delay of the first-order plus timedelay model. The proposed autotuning method has remarkable advantages compared to previous relay feedback approaches. It guarantees the preset phase angle of the obtained frequency response data (G(iω)) of the process, as shown in Equation (3). Moreover, it theoretically provides exact frequency response data (G(iω) and G(0)) of the process without any modeling errors because it uses a proportional controller to obtain the continuous-cycling status. The first-order plus time-delay model can be analytically obtained without solving nonlinear equations, and the first-order plus time-delay model is also exact because it is based on exact frequency responses (G(iω) and G(0)). Note that when the describing function analysis method is used to estimate the frequency response from the relay feedback test, the modeling error due to the harmonic terms of the relay feedback signal can be up to 5-18% for the first-order plus time-delay model even in ideal cases of no uncertainties and disturbances [22]. Furthermore, the proposed method still provides exact frequency response data G(iω) of the process even under static disturbances or setpoint changes because static disturbances cannot affect the continuous-cycling. Meanwhile, static disturbances can severely distort the shape of the relay feedback signal, resulting in unacceptable modeling errors. Finally, changing the PID controller to the P controller of the proposed method is straightforward and simple. It is especially difficult to determine the deviation variables to apply the relay feedback method [1] if the initial state of the process is not a steady state. An incorrect definition of the deviation variables can severely distort the shape of the relay feedback signal, resulting in unacceptable modeling errors.

Simulation Study
Several processes were simulated to demonstrate the performance of the proposed autotuning method and compare it with the relay feedback method [1]. Figures 5-8 show typical responses of the first-order plus time-delay process of G(s) = exp(−θs)/(s + 1) for the proposed autotuning method and the conventional relay feedback method [1]. A step input disturbance of 1.5 enters at the beginning of the autotuning methods in this case. Tables 1 and 2 show the estimates of the proposed method and the relay feedback method [1]. As shown in Figures 5-8, the proposed method successfully derives the process to a continuous-cycling status in a stable manner. In addition, the relay feedback method [1] shows significant modeling errors in estimating the frequency response data of the process. In contrast, our method provides the exact ultimate frequency (ω u ) and the ultimate gain (k u ) of the process for all the cases with various process parameters and static disturbances. While the proposed method shows remarkable advantages, the only shortcoming is that the convergence rate of the proposed method is slower, as much as about two or three cycles compared with that of the relay feedback method [1].  process output (y) process input (u) Figure 8. Response of the relay feedback method [1] combined with the time delay [7] for the first-order plus time-delay process with θ = 0.5 and PA set = −3π/4.  Tables 3 and 4 show the typical responses of the high-order plus time-delay process of G(s) = exp(−θs)/(s + 1) 5 and the estimates of the proposed method and the relay feedback method [1]. A step input disturbance of 2.0 enters at the beginning of the autotuning methods and the process output is contaminated by uniformly distributed random noise between −0.05 and +0.05. Hysteresis of 0.05 is used in finding the peak values of the process output in noisy environments. That is, it is concluded that the peak value is found if the present value is smaller than the previous maximum (peak candidate) values by as much as two times the hysteresis. The proposed method provides a stable convergence to a continuous-cycling status for the high-order plus time-delay process and an exact frequency response data of the process for all the cases, whereas the relay feedback method [1] cannot remove modeling errors due to the static disturbance in estimating the frequency response data.      Tables 5 and 6 show the typical responses of the non-minimum phase process of G(s) = exp(−θs)(−0.2s + 1)/(s + 1) 3 and the estimates of the proposed method and the relay feedback method [1]. A step input disturbance of 2.0 enters at the beginning of the autotuning methods and the process output is contaminated by uniformly distributed random noise between −0.05 and +0.05. Hysteresis of 0.05 is used in finding the peak values of the process output in noisy environments. For all the cases, the proposed method provides a stable convergence to a continuous-cycling status for the nonminimum phase process and exact frequency response data of the process. The relay feedback method [1] suffers from modeling errors in estimating the frequency response data.        Tables 7 and 8 show the typical responses of the integr cess of ( ) = (−0.1 )/ ( + 1) and the unstable process of ( ) = 2 (3 − 1)( + 1), and the estimates of the proposed autotuning method and the r back method [1]. In this case, there are no disturbances or measurement noise. process output (y) process input (u) Figure 16. Response of the relay feedback method [1] combined with the time delay [7] for the non-minimum phase process with θ = 0.1 and PA set = −3π/4. Tables 7 and 8 show the typical responses of the integrating process of G(s) = exp(−0.1s)/s(s + 1) and the unstable process of G(s) = 2exp(−0.2s)/(3s − 1)(s + 1), and the estimates of the proposed autotuning method and the relay feedback method [1]. In this case, there are no disturbances or measurement noise.

Figures 17-20 and
Processes 2021, 9,509 The proposed method successfully provides a stable continuous-cycling ultimate frequency response, while the relay feedback method [1] cannot remo eling error due to the harmonics of the relay signal.      Figure 18. Response of the relay feedback method [1] for the integrating process and PA set = −π.
Processes 2021, 9,509      The proposed method successfully provides a stable continuous-cycling and an exact ultimate frequency response, while the relay feedback method [1] cannot remove the modeling error due to the harmonics of the relay signal.

Experimental Study
The performance of the proposed autotuning method for a liquid level control system is demonstrated in Figure 21. The liquid level control system is composed of three tanks. The output (controlled variable, process variable) and input (manipulated variable, controller output) of the process are the liquid level of the third tank and the opening percent of the valve, respectively. An LS programmable logic controller (PLC) composed of XGK-CPUE for CPU, XGF-AD43 (LS ELECTRIC Co., Ltd, Anyang-si, Gyeonggi-do, South Korea) for AD converter, XGF-DC4A for DA converter, and XGL-CH2A for serial communication is used for data acquisition. The autotuning algorithms are implemented in a laptop computer using a commercial supervisory control and data acquisition (SCADA) software called PROMONICON (version: 1.0.2, TBB, PSE Laboratory, Kyungpook National University, Daegu, South Korea, www.tbb-automation.com). The computer is connected with PLC through RS232C communication. The scan time for the autotuning algorithms is 0.1 s.

Experimental Study
The performance of the proposed autotuning method for a liquid level control system is demonstrated in Figure 21. The liquid level control system is composed of three tanks. The output (controlled variable, process variable) and input (manipulated variable, controller output) of the process are the liquid level of the third tank and the opening percent of the valve, respectively. An LS programmable logic controller (PLC) composed of XGK-CPUE for CPU, XGF-AD43 (LS ELECTRIC Co., Ltd, Anyang-si, Gyeonggi-do, South Korea) for AD converter, XGF-DC4A for DA converter, and XGL-CH2A for serial communication is used for data acquisition. The autotuning algorithms are implemented in a laptop computer using a commercial supervisory control and data acquisition (SCADA) software called PROMONICON (version: 1.0.2, TBB, PSE Laboratory, Kyungpook National University, Daegu, South Korea, www.tbb-automation.com). The computer is connected with PLC through RS232C communication. The scan time for the autotuning algorithms is 0.1 s. Figure 21. Liquid level control system. Figure 22 shows the convergence pattern of the proposed autotuning method and Tables 9 and 10 show the ultimate gain and ultimate period (frequency response data) obtained by the proposed method and the relay feedback method [1] and the tuning parameters of the PID controllers calculated by the ZN tuning method [12] on the basis of the ultimate data. Note that defining the reference values ( , ) of the deviation variables cannot be accurate because the initial state is not a steady state. Therefore, the relay feedback method [1] shows asymmetric behavior, as shown in Figure 23, resulting in the wrong ultimate data. Figure 24 shows the control performance of the PID controllers tuned by the proposed autotuning method and the relay feedback method [1] in the case that a step input disturbance of 10 enters at 42 min. The experimental results confirm that the proposed autotuning method has no problems that prevent it from being applied to real plants.  Figure 22 shows the convergence pattern of the proposed autotuning method and Tables 9 and 10 show the ultimate gain and ultimate period (frequency response data) obtained by the proposed method and the relay feedback method [1] and the tuning parameters of the PID controllers calculated by the ZN tuning method [12] on the basis of the ultimate data. Note that defining the reference values u re f , y re f of the deviation variables cannot be accurate because the initial state is not a steady state. Therefore, the relay feedback method [1] shows asymmetric behavior, as shown in Figure 23, resulting in the wrong ultimate data. Figure 24 shows the control performance of the PID controllers tuned by the proposed autotuning method and the relay feedback method [1] in the case that a step input disturbance of 10 enters at 42 min. The experimental results confirm that the proposed autotuning method has no problems that prevent it from being applied to real plants.

Conclusions
An improved continuous-cycling method combined with a phase shifter was proposed for PID autotuning. It successfully solved the harmonics problem of the previous relay feedback approaches completely because it is based on the continuous-cycling method. Moreover, the proposed method guaranteed the preset phase angle of the frequency response by introducing the phase shifter in the form of a time delay. Furthermore, it still provided an exact frequency response of the process under static disturbance conditions because it is a modification of the continuous-cycling method. Simulation and experimental studies successfully demonstrated that the proposed method can provide an exact frequency response even under static disturbance conditions, and it showed no problems in being applied to real processes.

Conclusions
An improved continuous-cycling method combined with a phase shifter was proposed for PID autotuning. It successfully solved the harmonics problem of the previous relay feedback approaches completely because it is based on the continuous-cycling method. Moreover, the proposed method guaranteed the preset phase angle of the frequency response by introducing the phase shifter in the form of a time delay. Furthermore, it still provided an exact frequency response of the process under static disturbance conditions because it is a modification of the continuous-cycling method. Simulation and experimental studies successfully demonstrated that the proposed method can provide an exact frequency response even under static disturbance conditions, and it showed no problems in being applied to real processes.