Data-Based Tuning of PID Controllers: A Combined Model-Reference and VRFT Method Data-Based Tuning of PID Controllers: A Combined Model-Reference and VRFT Method

This chapter presents a novel data-based proportional-integral-derivative (PID) control- ler tuning method that can be applied to stable, integrating, and unstable plants. The tuning method is developed under the virtual reference feedback tuning (VRFT) design framework, where the reference model of VRFT is coordinately optimized with the controller on the basis of the model-reference (MR) criterion to ensure the validity of the VRFT approach. In the proposed MR-VRFT method, a set of closed-loop plant data are directly exploited without resorting to a process model. Because of its closed-loop tuning capability, the MR-VRFT method can be applied online to improve (retune) existing underperforming controllers. Moreover, the tuning method includes a robust- ness specification based on the maximum sensitivity that enables the designer to explic-itly address the trade-off between performance and robustness. Simulation studies, including the application to an unstable biochemical reactor, are presented to demonstrate the effectiveness of MR-VRFT method.


Introduction
Proportional-integral-derivative (PID) controllers have been the most widely used process control technique for many decades in the chemical process industry. Although a PID controller has only three adjustable parameters, the optimization of these parameters in the absence of a systematic procedure is not a trivial task. It has been reported that numerous controllers are poorly tuned in practice [1]. A typical category of methods for tuning PID controllers is based on the model-based design approach. With the availability of plant models, both analytic and empirical rules can be applied for PID design; see Ref. [2] for an extensive collection of methods. With the development of engineering technologies, industrial plants are becoming more and more complex, and therefore, modeling and identifying industrial plants are more challenging and demand considerable engineering effort. Furthermore, the performance of model-based controllers is highly dependent on the model accuracy. The model-based methods can give satisfactory PID design when the controlled plant dynamics are reasonably described by the low-order models, but the effectiveness of these methods degrades for complex and/or higher-order process dynamics owing to the inevitable modeling error.
An attractive approach to relieving the efforts of identifying a complicated process and mitigating the drawback of a plant-model mismatch is to design controllers directly from plant input-output data without the intermediate step of model identification. In the past two decades, a number of data-based control design methods have been developed; see Ref. [3] for a brief survey of the existing data-based control methods. Virtual reference feedback tuning (VRFT) [4,5] is a one-shot discrete-time controller tuning method that only needs a set of plant input-output data to compute the controller parameters. Under the VRFT framework, the controller tuning problem is transformed into a controller parameter identification problem through introducing the virtual reference signal with a predefined reference model. The controller parameters are then obtained by solving an optimization problem formulated to minimize the VRFT criterion, that is, the deviation between the virtual controller output and actual plant input. The closed-loop behavior with the controller designed by VRFT is determined by the reference model. It is critical but not an easy step to properly determine a reference model because the plant model is unknown. However, VRFT is basically studied as an identification problem, and how to determine the optimal reference model is not addressed in traditional VRFT methods. Recently, VRFT has been extended to the design of continuous-time PID controllers [6][7][8][9][10] and, to determine the reference model appropriately, the parameter in the reference model was optimized by evaluating the VRFT criterion. In fact, the original objective of VRFT is to search the optimal controller parameters which minimize a model-reference (MR) criterion. The VRFT criterion shares with the MR criterion the same minimizer only when the adopted controller structure allows a perfect model matching [5]. However, the PID controller may not belong to the ideal controller set that allows a perfect model matching. The reference model determined by minimizing the VRFT criterion does not guarantee an effective model-reference control and therefore the performance of the designed PID controller becomes unpredictable.
To solve this problem, a novel model-reference VRFT (MR-VRFT) method is presented in this chapter. The PID controller is designed with VRFT based on an optimal reference model determined by minimizing the MR criterion, and consequently, the design objective of modelreference control can be effectively achieved. The MR-VRFT method can be applied to stable, integrating, and unstable plants by choosing appropriate reference model structures. The proposed design method includes robustness consideration that allows the designer to deal with the trade-off between control performance and system robustness by specifying a desired robustness level in terms of the maximum sensitivity.
The rest of this chapter is organized as follows. Section 2 presents the PID controller design based on VRFT approach. Section 3 presents the specification of the reference model and proposed MR-VRFT method. Section 4 summarizes the controller tuning procedures. Section 5 presents several simulation examples showing the effectiveness of the proposed method. Finally, concluding remarks are presented in Section 6.

PID controller design based on VRFT approach
Consider the feedback control system shown in Figure 1, which consists of a plant G(s) and a PID controller C(s) given by where K C , τ I , and τ D denote the proportional gain, the integral time, and the derivative time of the controller, respectively. Assume that the plant G(s) is unknown and only a set of inputoutput data, u(t) and y(t), collected during an experiment on the plant is available for tuning the PID controller. The target of control design in the proposed method is assigned via a reference model, M(s), that describes the desired closed-loop transfer function of the system shown in Figure 1. The control objective is the minimization of the following model-reference (MR) criterion: where W(s) is a user-specified weighting function.
Because G(s) is unknown, the minimization of J MR cannot be performed. The traditional approach is to identify a model of G(s) using a set of input-output data of the plant and then minimize J MR by replacing G(s) with its model. However, this renders modeling difficult and introduces inevitable modeling error. The VRFT approach [5] avoids the procedure of model identification by creating a virtual reference signalr t ð Þ from the measured output y(t):R  whereR s ð Þ and Y(s) is the Laplace transform ofr t ð Þ and y(t), respectively. Such a reference signal is called "virtual" because it was not used to generate y(t). As Y(s) is considered to be the desired output of the closed-loop system when the reference signal is specified byR s ð Þ, the corresponding controller's output can be calculated bỹ When the plant is fed by the measured input signal u(t), it generates y(t) as the output. Therefore, a controller that shapes the closed-loop transfer function to the reference model is one that generates u(t) or its Laplace transform U(s) when the error signal is given byR s ð Þ À Y s ð Þ, as depicted in Figure 2. The model-reference control design is then transformed into the problem of searching for a controller to minimize the difference between U(s) andŨ s ð Þ given in Eq. (4).
Minimizing the difference between U(s) andŨ s ð Þ can be formulated in the frequency domain to minimize the difference between U(jω) andŨ jω ð Þ in a frequency range [0, ω max ]. Choosing ω i , i ¼ 1, 2, ⋯, n, such that 0 < ω 1 < ω 2 < ⋯ < ω n ¼ ω max . The PID parameters are obtained by solving The frequency responses of U(jω i ) and Y(jω i ) at selected frequency points ω i (i = 1, 2,…, n) can be evaluated by performing discrete Fourier transform for plant input and output measurements, which can be efficiently calculated using the fast Fourier transform (FFT) algorithm.
The sampling rate to collect plant data must be large enough so that significant plant information is not lost. The frequency ω max denotes the upper bound of the frequency range for the minimization problem, and it is closely related to the controller design. Because the controller usually operates under the critical frequency, ω max can be specified as the critical frequency, ω c , at which the phase angle of GC(jω) equals Àπ. Based on the reference model M(s), the critical frequency can be calculated according to the following equation: After algebraic calculations, Eq. (8) is recast as where Re(A) and Im(A) denote the real matrix (or vector), and the elements are the real and imaginary parts of a complex matrix (or vector) A, respectively. Eq. (11) can be solved by the least-squares method as which is used to obtain the parameters of the PID controller according to Eq. (7).

Specification of the reference model and MR-VRFT method
The reference model must be specified prior to calculation of the PID parameters using Eq. (13). The specification of the reference model is crucial to the performance of the resulting closed-loop system. Basically, the condition M 0 ð Þ ¼ 1 should be satisfied to achieve an offset-free tracking. In addition, other conditions should be imposed on the reference model when the controlled plant is integrating or unstable. Here, the reference models for stable, integrating, and unstable plants are presented.
For stable plants, the reference model can be specified as For integrating plants, the following asymptotic tracking constraint must be satisfied to enable the step-load disturbances to be counteracted to eliminate the offset.
In this case, the reference model for integrating plants is chosen as should have zeros at unstable poles of the plant to guarantee the internal stability of the closed-loop system [11]. When the plant has an unstable pole up, the following condition should be satisfied: Therefore, the reference model for unstable plants can be chosen as where α must be determined so that Eq. (17) is satisfied. In the reference models, θ is related to the apparent time delay of the plant, and λ is an adjustable parameter to manage the trade-off between control performance and system robustness.
The peak value of the sensitivity function (maximum sensitivity), M S , defined in the following, has been widely used as a measure of system robustness.
As the maximum sensitivity decreases, the closed-loop system becomes more robust. The use of the maximum sensitivity as a robustness measure is advantageous because lower bounds for the gain and phase margins can be assured [1]. Because the plant is not known, M S can be evaluated on the basis of the reference model as follows: Therefore, the parameter λ can be selected to match a designer-specified robustness level in terms of the maximum sensitivity. For a given value of the reference model parameter r, where r ¼ θ for stable and integrating plants and r ¼ θ; α f g for unstable plants, the following correlated robust design criterion provides the required value of λ to achieve a specified value of M S .
Eq. (24) is valid for 1 ≤ α=θ ≤ 10. With the robust design criterion, the value of λ can be determined conveniently.
When a desired value of M S is specified, the optimal solution given in Eq. (13) is a function of the reference model parameter r, that is, p * ¼ p * r ð Þ. As pointed out before, it is unreasonable to determine the reference model without information on the controlled plant. To determine the reference model appropriately, we propose for the first time that the reference model parameter r is optimized by minimizing the model-reference criterion given in Eq. (2). Namely, the proposed method seeks an appropriate reference model, which is most achievable for the controlled plant under the desired robustness level, to design the PID controller in the framework of VRFT.
Given a value of the reference model parameter r, the corresponding PID controller parameter p * r ð Þ can be calculated and a PID controller C s; p * r ð Þ ð Þis the result. The virtual reference signalR r s ð Þ that has to be applied in a closed loop employing the PID controller C s; p * r ð Þ ð Þto obtain u(t) and y(t) (the available data for controller design) as the closed-loop response can be calculated byR Therefore, the closed-loop transfer function resulting from C s; p * r ð Þ ð Þcan be expressed by and its frequency response can be obtained as follows: A model-reference criterion based on the framework of VRFT for PID controller design is then defined by where the weighting function can be simply chosen as W jω i ð Þ ¼ 1= jω i ð Þ. The optimal reference model parameter, r * , is determined by solving the following minimization problem: and its corresponding solution p * r * ð Þ is the optimal PID controller parameter proposed by the MR-VRFT method.

Controller tuning procedure
The MR-VRFT method directly utilizes closed-loop plant data for controller tuning without requiring a priori knowledge of the plant and the existing (possibly roughly tuned) controller. For stable plants, open-loop data can also be used for controller tuning. Suppose that the existing control system has been brought to a steady state and a closed-loop test is applied. We recommend using a set-point step test because it is the simplest and most commonly used test in process control applications. The plant input u(t) and output y(t) are collected during the set-point change until a new steady state is reached. It is noted that u(t) and y(t) represent deviation variables and are defined on the basis of the original steady state.
In sum, the proposed MR-VRFT method for tuning PID controllers can be implemented as follows: Step 1. Collect the plant data, u(t) and y(t), from a plant test and calculate their frequency responses, U(jω i ) and Y(jω i ). To calculate Y(jω i ), the output y(t) is decomposed into y t ð Þ ¼ Δy t ð Þ þ y s , where Δy t ð Þ and y s represent the transient part and the final steady-state value of y(t), respectively. The Fourier transforms of y(t) at discrete frequencies ω i are then obtained by where ΔY jω i ð Þ can be calculated by applying the FFT to Δy t ð Þ. Similar procedures apply to the calculation of U(jω i ) from u(t).
Step 2. Set the prescribed searching range of r and the desired level of system robustness in terms of M S . The recommended values for M S are typically within the range 1:2 < M S < 2:0 [12]. However, specifying a higher value of M S is required for particular unstable plants (e.g., those that involve a large time delay).
Step 3. Solve the minimization problem given in Eq. (29) by iteration. For each chosen r, perform the following steps.
1. Calculate the corresponding λ using the robust design criterion and specify the reference model M(s).
Repeat (1) to (4) for other values of r in the searching range until the minimal J MR-VRFT is identified.
Step 4. Obtain the PID controller parameters from p * corresponding to the optimal value of r, i.e., p * r * ð Þ.

Illustrative examples
Simulation examples are presented to demonstrate the effectiveness of the MR-VRFT method for PID controller tuning. In each example, the closed-loop plant data, u(t) and y(t), were generated by introducing a step change in the set point of an initial (existing) closed-loop system ( Figure 1). To implement the proposed method, a priori knowledge of the existing controller settings is not required. Therefore, the effectiveness of the MR-VRFT method, proposed as a closed-loop tuning method, is not affected by the existing controller parameters used for generating the closed-loop data, as confirmed by the following example.
In all simulations, the PID controller was implemented as follows to avoid the derivative kick: The derivative filter parameter γ was set to 0.1. Two metrics were used to evaluate the controller performance. The integrated absolute error (IAE) is defined as To evaluate the required control effort, the total variation (TV) of the manipulated input u was calculated: TV is an effective measure of the "smoothness" of a signal and should be as small as possible [13].

Example 1: stable plant
Consider a fifth-order plant given by the following transfer function: To illustrate that the effectiveness of the MR-VRFT method is unaffected by the plant data used for controller design, three sets of plant data, that is, one set of open-loop step response data and two sets of closed-loop data generated by initially poorly tuned PID controllers, collected with a sampling interval of 0.1, were separately used to implement the MR-VRFT method. As illustrated in Figure 3, the first set of closed-loop data (initial tuning 1: K C ¼ 0:4, τ I ¼ 10, and τ D ¼ 1) exhibited a sluggish set-point step response whereas the second set of closed-loop data (initial tuning 2: K C ¼ 0:4, τ I ¼ 4, and τ D ¼ 0:5) exhibited an oscillatory response. Using the reference model given in Eq. (14) with the desired level of robustness set as M S = 1.58, the resulting three PID controllers are summarized in Table 1, where the controller parameters obtained by the MR-VRFT are almost indistinguishable in spite of different plant data used for controller design. Furthermore, the resulting closed-loop system has M S = 1.59, which is close to the design value. Figure 4 shows the closed-loop responses for the initial and retuned (MR-VRFT) controllers for a unit step set-point change at t = 0 and a unit step load disturbance at t = 150. Control performance can be improved significantly using the MR-VRFT method, regardless of the initial controller parameters used for collecting the closed-loop data.
We compared the proposed PID design method with the model-based design method of Skogestad internal model control (SIMC) [13]. In the SIMC method, the plant in Eq. (34) was approximated as a second-order plus time delay (SOPTD) model: The controller parameters were obtained as K C ¼ 0:278, τ I ¼ 5, and τ D ¼ 1:2. The resulting closed-loop system also has M S = 1.59, which facilitated a comparison of controller performance for controllers with the same level of robustness. The closed-loop response for the PID controller tuned by SIMC method is also shown in Figure 4. The values of IAE and TV for the controllers are presented in Table 2. Figure 4 shows that the proposed PID controller provides faster set-point response and disturbance attenuation than the SIMC PID controller, demonstrating the superior performance of MR-VRFT method.

Example 2: integrating plant
Consider the following integrating plant: To implement the MR-VRFT method, an initial control system with a roughly tuned PID controller (K C ¼ 0:3, τ I ¼ 10, and τ D ¼ 1) was considered for generating closed-loop data, with a sampling interval of 0.05.
Using the reference model given in Eq. (16) with the design target M S = 1.62, we determined the optimal θ value to be θ * ¼ 2:98 (λ ¼ 6:75). The corresponding PID controller parameters are K C ¼ 0:209, τ I ¼ 17:4, and τ D ¼ 2:29, and the resulting closed-loop system has an M S value nearly identical to the design target. Figure 5 shows the closed-loop responses for the initial and retuned (MR-VRFT) controllers for a unit step set-point change at t = 0 and a step-load disturbance of magnitude 0.1 at t = 120. The response for the initial controller is rather oscillatory. In fact, the initial closed-loop system has an M S value of 3.92, indicating poor robustness. Control performance can be considerably improved after the retuning using the MR-VRFT method.
The proposed PID controller was compared with the SIMC PID controller which was tuned using the following model: The SIMC controller parameters were obtained as K C ¼ 0:177, τ I ¼ 25:5, and τ D ¼ 1:41. The resulting closed-loop system also has M S = 1.62. The closed-loop response for the PID controller tuned by SIMC method is also shown in Figure 5. The values of IAE and TV for the controllers are presented in Table 2. Clearly, the proposed MR-VRFT method provides favorable control performance, especially for disturbance rejection, compared with the model-based method of SIMC.
In practice, plant data are inevitably corrupted by measurement noise. Figure 6 shows closedloop plant data that were corrupted by Gaussian white noise with a variance of 0.005; the data were used to tune the controller by the MR-VRFT method. The optimal θ value was determined to be θ * ¼ 2:99 (λ ¼ 6:77), and the resulting controller parameters were K C ¼ 0:211,  Data-Based Tuning of PID Controllers: A Combined Model-Reference and VRFT Method http://dx.doi.org/10.5772/intechopen.75835 τ I ¼ 18:2, and τ D ¼ 2:21. By comparing the controller parameters obtained under noise conditions with those obtained under noise-free conditions, no dramatic change is observed, which verifies the applicability of the MR-VRFT method under realistic conditions. Moreover, simulation results show that fast sampling of plant data could reduce the sensitivity of the MR-VRFT method to the effect of measurement noise.

Example 3: unstable plant
Consider the following third-order delayed unstable plant studied in Lee et al. [14]: An initial closed-loop system with a roughly tuned PID controller (K C ¼ 2, τ I ¼ 20, and τ D ¼ 1) was assumed to generate plant data for controller design. The sampling interval was chosen as 0.1. We applied the MR-VRFT method to design the PID controller using the reference model given in Eq. (18), with an assigned M S value of 2.25. The optimal reference model parameter was determined to be r * ¼ θ * ; α * f g¼ 1:389; 8:033 f gwith λ ¼ 2:09. The corresponding PID controller parameters are K C ¼ 3:98, τ I ¼ 9:79, and τ D ¼ 1:86, and the resulting closed-loop system has M S = 2.20, which is close to the design target. To show the advantage of the MR-VRFT method over the previous VRFT method, the reference model parameter was also determined by minimizing the following VRFT criterion for comparison: The result was obtained as r * ¼ θ * ; α * f g¼ 1:481; 9:645 f gwith λ ¼ 2:41. The corresponding PID controller parameters are K C ¼ 3:49, τ I ¼ 11:7, and τ D ¼ 1:77, and the resulting closedloop system has M S = 2.07, which deviates from the design target. When a closed-loop system has an M S value closer to the design target, the closed-loop system matches the reference model better. By comparing the M S value of the closed-loop systems resulting from the MR-VRFT and VRFT methods, it clearly indicates that the MR-VRFT method achieves a more effective model-reference control design than the VRFT method does. Figure 7 shows closedloop responses for the initial and MR-VRFT controllers for a unit step set-point change at t = 0 and a unit step load disturbance at t = 50. The control performance evidently improves considerably after the retuning using the MR-VRFT method.
The proposed PID controller was compared with two PID controllers tuned by the modelbased method of Lee et al. [14] on the basis of the following first-order and second-order models, respectively: Both models provide accurate approximations; however, the second-order model is more accurate.
The control systems using the model-based controllers were tuned to have the same robustness level of M S = 2.2. The PID settings are shown in Table 2 and the resulting closed-loop responses are shown in Figure 7. The values of IAE and TV for all of the controllers are presented in Table 2. As evident from the results in Table 2 and Figure 7, the proposed MR-VRFT method performs better than the model-based design method with respect to both set-point tracking and disturbance rejection. In addition, the model-based controller based on the second-order model provides better performance than that based on the first-order model, which indicates that the model-based design method requires an accurate process model to obtain improved PID settings. Because the availability of accurate process models cannot be guaranteed, the proposed data-based method provides an obvious advantage in controller design.

Example 4: application of a biochemical reactor
The biochemical reactor plays a major role in most of the biotechnological and chemical industries. The MR-VRFT method was applied to the nonlinear biochemical reactor studied by Vivek and Chidambaram [15]. The bioreactor modeling equations are as follows.
Biomass balance : Substrate balance :  where x 1 is the biomass concentration, x 2 is the substrate concentration, x 2f is the substrate feed concentration, and D is the dilution rate. The yield Y is assumed to be a constant. The model parameters used for the simulation were The nonlinear process has three steady-state operating points for a dilution rate of 0.3 h À1 . An unstable operating region with a steady-state value of (x 1s , x 2s ) = (0.9951, 1.5122) is considered. The dilution rate is the manipulated variable used to control the biomass concentration at the unstable steady state. A time delay of 1 h is assumed in the measurement of x 1 .
Vivek and Chidambaram [15] calculated the PID parameters (see Table 2) on the basis of the following identified unstable first-order plus time delay model: An initial closed-loop system with the PID controller proposed by Vivek and Chidambaram [15] was considered to generate the plant data required to tune the controller. The MR-VRFT method was applied to retune the PID controller by introducing a step change of 10% in the set point of x 1 . To simulate realistic conditions, Gaussian white noise, with a standard deviation of 0.005, was added to the measurements as the measurement noise. The noisy closed-loop data collected with a sampling interval of 0.01 h are shown in Figure 8. Using the reference model given in Eq. (18) with the design target M S = 2.6, the optimal reference model parameter was determined to be r * ¼ θ * ; α * f g¼ 1:084; 3:736 f gwith λ ¼ 0:966, and the corresponding PID controller parameters are shown in Table 2. The proposed controller was compared with the initial model-based controller by simulating the nonlinear model equations of the bioreactor. Figure 9 shows the closed-loop responses to a step change of 20% in the set point at t = 0, followed by a step disturbance of 4 g/L in the substrate   feed concentration x 2f at t = 20 h. The corresponding values of IAE and TV, as presented in Table 2, clearly indicate that the retuned control system using the MR-VRFT method outperforms the initial control system. The proposed controller shows a rapid attenuation of the disturbance. The overshoot in the set-point response for the proposed controller is moderately large, but the response is less oscillatory with a shorter settling time compared to that of Vivek and Chidambaram [15] (i.e., the initial controller). It is noted that the excessive overshoot can be reduced by applying the set-point weighting to the proportional mode of a PID controller. Figure 10 shows the closed-loop responses of the controllers when a 30% increase in the process parameters k m and k 1 has occurred. The response for the controller of Vivek and Chidambaram [15] became highly oscillatory compared with that of the proposed controller, indicating the superior robust performance of the proposed controllers. This example demonstrates that the MR-VRFT method is promising for industrial applications.

Conclusions
In this chapter, a novel and systematic data-based PID design method based on combined model-reference and virtual reference feedback tuning is presented. With the optimized reference model using the model-reference criterion, the optimal PID controller can be efficiently designed in the framework of VRFT. By choosing an appropriate structure of the reference model, the proposed MR-VRFT method applies to a wide variety of process dynamics and deals with stable, integrating, and unstable processes using the same unified procedure. Simulation studies show that PID controllers designed by the MR-VRFT method fulfill the user-defined robustness specification, indicating that an effective model-reference control design is achieved, and they also exhibit favorable control performance when compared to the model-based PID controllers. Therefore, the MR-VRFT method is a promising PID controller design method for industrial application, and it can be used to improve the performance of existing underperforming PID controllers through the retuning of the controller parameters using routine operating data.