A quasi-universal practical IMC algorithm

ABSTRACT The control algorithm incorporates a process feedback path of pure proportional type (only for integral-type or unstable processes), a process model of second order plus time delay and a realizable second-order internal controller which has not a tuning filter time constant as usual in the classical IMC design, but a tuning gain with standard value 1, that can be used by the human operator to get a strong or weak control action. The model parameters (steady-state gain, time delay and transient time) can be easily experimentally determined and can be online verified and corrected. The algorithm is practical and quasi-universal because it is easily tunable, has a unique form and can be applied to almost all process types: stable proportional processes (with or without time delay, with or without overshoot, of minimum or nonminimum phase), integral processes and even some unstable processes. The proposed algorithm is better than the proportional-integral-derivative (PID) algorithm (which is also quasi-universal and practical) due to its robustness, high control performance (especially for processes with time delay) and simple experimental procedure for determining the controller parameters. Some applications are presented to highlight the main features of the algorithm and the tuning procedure for all process types.


Introduction
The internal model control (IMC) approach involves a process model embedded in the controller structure. In its standard and advanced variants, the IMC was introduced and thoroughly studied in 1982 by Garcia and Morari [1] and in 1986 by Rivera et al. [2], but similar concepts have been used previously by other researchers [3,4]. The classical IMC method offers advanced control procedures that can be applied with very good performance to any process with known model, but the found particular control algorithm cannot be used for other processes. Thus, the controller complexity depends mainly on the complexity of the process model and the control system performance stated by the designer [5][6][7][8][9][10]. For these reasons, the control algorithms of IMC type are not widely used in current industrial practice.
On the other hand, hundreds of significant papers have been written in the last decades on the proportional-integral-derivative (PID) control algorithm, which is the most widely used in practice. It is well known that the IMC design can provide robustness and control performance better than the PID design, especially for processes with large time delay. For some particular processes of low order, without time delay or with time delay approximated by a low-order series expansion, the IMC design can lead to a PID controller structure (or an ideal PID controller cascaded with a firstor second-order filter) and an intuitive procedure for tuning the PID controller [11][12][13][14][15][16]. Certainly, an IMC-based PID algorithm leads to weaker control performance than a genuine IMC algorithm. This is the first starting point of our paper.
The configuration of a standard IMC system is shown in Figure 1 [1][2][3][4][5], where G P (s) is the process transfer function, G M (s)process model transfer function, G i (s)internal controller transfer function, Y(s)controlled variable, U(s)control variable, R(s)reference (setpoint) variable, E(s)error variable and V (s)disturbance variable. For both equivalent diagrams A and B, the transfer function between the controlled variable Y and the reference variable R has the expression while the transfer function between the controlled variable Y and the disturbance variable V is Under the assumption that the internal controller gain is the inverse of the model gain, that is it follows that CONTACT Vasile Cirtoaje vcirtoaje@upg-ploiesti.ro According to this result, even if the process model is imperfect, the steady-state value of the controlled variable y is equal to the steady-state value of the reference r whatever the steady-state value of the disturbance v. In addition, it is possible to design an overall IMC controller without concern for the closed-loop system stability, but only for the control performance [1,4,5]. An ideal control system suppresses completely the disturbance effect on the controlled variable and forces it to track instantaneously the reference. This is possible if and only if the transfer function of the internal controller G i (s) is the inverse of the model transfer function G M (s), i.e.
Indeed, if this condition is satisfied, then therefore, y(t) = r(t) for any reference r(t) and disturbance v(t). Thus, to design an ideal control system, it is not necessary to have a perfect model. Unfortunately, no controller can perfectly invert the process dynamic model. Therefore, the classical IMC design methodology seeks to find a more accurate process model and an approximate proper inverse of the process model. As a consequence, the control algorithms designed by this methodology have a form which depends on the process model. On the other hand, for a perfect model, it follows from Equation (1) that hence, The paper presents a quasi-universal and practical approach of the IMC method, in which the model has a unique structure (of second order plus time delay) irrespective of the controlled process type. This is possible because the model addresses the compensated process, which is always stable and of proportional type (with the steady-state gain finite and nonzero or, equivalently, with no pole and zero at the origin). Such a control technique based on process compensation has been introduced in [17] for unstable processes (under the name of "modified IMC"), in [18] for integral-type processes, and in [19] for unstable integral processes.
The proposed algorithm is quasi-universal because it has a unique form and can be used to control almost all process types: stable processes of proportional type (with or without time delay, with or without overshoot, of minimum or nonminimum phase), integral processes and unstable processes. The model parameters (steady-state gain, time delay and transient time) can be experimentally determined from the compensated process response to a step input, and can be verified and adjusted online; in addition, by setting a suitable tuning gain K, the control performance can be good or very good even if the model parameters have no accurate values. The use of the tuning gain K (with standard value 1) instead of a filter time constant (as usual) is also a practical feature of the presented algorithm.
Using MATLAB/SIMULINK environment, six numerical applications for different process types are presented to show the performance and the tuning procedure of the control algorithm.

Primary form of the control algorithm
A model of second order with two lag time constants plus time delay has the transfer function where K M is the model steady-state gain, t M is the model time delay, and T 1 and T 2 are the model time constants satisfying For g = 1, the two lag time constants are equal to each other [20], whereas for g = 0, the model becomes of first order. In this paper, we will consider the middle case with g = 1/2. For a stable proportional-type process with the step response y(t) monotonic and finite (called P1-type), the model parameters K M , t M , T 1 and T 2 can be easily experimentally determined as follows: where K P is the process steady-state gain, t Pthe process time delay, and T trPthe transient time of the response y(t) (which does not include the time delay); more precisely, where t 1 is the settling time (when the response is approximately 98% of its steady-state value): y t 1 ð Þ % 0:98y 1 ð Þ: Note that a first-order plus time delay model is too simple to describe with sufficient accuracy the process sluggishness, whereas a third-order plus time delay model is too complicated to be used to increase the model accuracy. For the internal controller, we have chosen the inverse of the model transfer function where the filter time constants T 3 and T 4 are introduced to make the internal controller realizable (with a number of poles equal to the number of zeros). These time constants need to be lower bounded to avoid excessive noise amplification and to accommodate to the modelling error. In the classical IMC design, these filter time constants are equal to each other and considered as tuning parameter (used by the process human operator to modify the intensity of the control action). Using the substitution a new practical tuning parameter (the gain K with the standard value 1) is introduced. Thus, the internal controller (14) becomes Because the relation (3) is satisfied, therefore the steady-state error is zero for a step reference or disturbance. On the other hand, since G M (s) and G P (s) are strictly proper, it follows from Figure 1 that the initial value u(0 + ) of the closed-loop control system response u(t) to a unit step reference is Also, since the steady-state error is zero, the final value of u(t) is equal to the inverse of the process steady-state gain: Therefore, the magnitude coefficient M of the closedloop control system response u(t) to a unit step reference, defined as the ratio between the initial value u (0 + ) and the final value u(1), has the expression When the human operator increases/decreases the tuning gain K, the control action becomes stronger/ weaker. According to (10) and (11), one may consider that the model parameters are the gain K M , the time delay t M and the transient time T trM .
In the particular case K = 1, the internal controller (16) is purely proportional: In this case, according to (18) and (19), the initial and final values of the control response u(t) to a unit step reference are u(0 + ) = 1/K M and u(1) = 1/K P . If K M and K P are equal to each other, then u(0 + ) = u(1). In addition, for a perfect model with G M (s) = G P (s), it follows from (8) and (21) that therefore, the ideal control response u id (t) to a unit step reference is a step function of magnitude 1/K P . For a perfect model and K > 0, having in view (8) and (16), the ideal control response u id (t) to a unit step reference has the expression where (24) Figure 2 shows this ideal response for K M = 1 and T trM = 84, when The response u id (t) is increasing on (0, 1) for 0 < K 1, is decreasing on (0, 1) for 1 K 4, and is decreasing on (0, t 0 ] and increasing on [t 0 , 1) for K > 4, where For K = 1, the response u id (t) given by (22) is a step function of magnitude 1/K M . Actually, due to the model inaccuracy, the form of the closed-loop system response u(t) to a step reference is not a perfect step function. By comparing the response u(t) with the ideal response in step form, the human operator can verify online if the model parameters have appropriate values, and can adjust these parameters to improve the model accuracy. So, if the initial value u(0 + ) is larger/ smaller than its final value u(1), then the model gain K M needs to be proportionally increased/decreased to have K M % K P . Then, for K M % K P , analyzing the new response u(t) to a step reference, if u(t) is larger/ smaller than u(0 + ) in a time range t > t M , then the model parameter T trM needs to be increased/decreased.
In its primary (standard) form, used to control stable proportional-type processes (with or without time delay, with or without overshoot, of minimum or nonminimum phase), the algorithm has four parameters: The discrete-time equivalent of the continuous model (9) with T 2 = 2T 1 has the discrete transfer function where T is the sampling period, and l M is the integer value of the ratio between the model time delay and the sampling period; that is, The discrete-time equivalent of the continuous internal controller (16) has the discrete transfer function The discrete-time primary form of the control algorithm has the equations where Example 2.1: Consider the proportional process with the transfer function From the process unit step response in Figure 3, it follows the process model parameters Figures 4 and 5 show the closed-loop system responses y(t) and u(t) to a unit step reference for K = 0.5, 1, 2.5, 8. A good control performance is achieved for K = 2.5. The control response u(t) is too strong for and too weak for K = 0.5, when For K = 1, the response u(t) is close to a step function; this confirms that the model parameters have been suitably chosen. Note that the closed-loop system is stable for all positive K < 3600. Figures 6-8 show the closed-loop system responses y(t) to a unit step reference for K = 2.5 and different values of the model gain K M , model time delay t M and model transient time T trM , respectively. All these responses show that the control performance is robust with respect to the model parameters K M , t M and T trM . The closed-loop control system is respectively stable for K M > 0.54, for all t M > 0, and for T trM > 6. Figures 9-11 show the closed-loop system responses y(t) to a unit step reference for the best values of the tuning parameter K and various values of the model parameters K M , t M and T trM , respectively. The control performance remains good even for wrong values of the model parameters. Moreover, we claim that the control      performance is better for K M > K P than for K M < K P , for t M > t P than for t M < t P , and for T trM > T trP than for T trM < T trP .
The response A in Figure 9 shows that for the wrong value K M = 2.5, if the process-operator selects K = 11, then the control system performance is even better than the one obtained for K M = 2 and K = 2.5 (response B). The closed-loop system with K M = 2.5 is stable for K < 4600. Figure 10 shows that for the wrong value t M = 9, by choosing K = 25 (response A), the control system performance is better than the one obtained for t M = 6 and K = 2.5 (response B). Note that the closed-loop system with t M = 9 is stable for K < 240. Figure 11 shows that for the wrong value T trM = 70, if the process-operator chooses K = 7 (response A), then the control system performance is comparable with the one obtained for T trM = 54 and K = 2.5 (response B). The closed-loop system with T trM = 70 is stable for K < 3400.
Using the designed controller, the control performance is better than the one achieved using a PI controller with the transfer function This follows immediately from Figure 12, where are depicted the responses y(t) to a unit step reference for K R = 0.1, 0.2, 0.3 and the best values of the integral time constant T i , namely T i = 6.2, 10, 16, respectively.
Remark 2.1: The proposed algorithm can be also used to control stable proportional-type processes with overshoot. Let P be a such process, whose input step response has the maximum value at the time t 0 . In order to choose the model parameters, this process (with or without oscillations) is approximated by a processP of P1 type (with the unit step response monotonic and finite), whose step responseỹ t ð Þ remains constant (at its maximum value) for t t 0 (Figures 13 and 16). From the step responseỹ t ð Þ, we can easily choose the steady-state gainK P , the time delay t P and the transient timẽ Thus, the model parameters are SinceK P > K P , the closed-loop system response u(t) to a step reference has a smaller initial value, namely which reduces the overshoot of the closed-loop system response y(t).
By suitably modifying the tuning gain K, a good control system response to a step reference can be obtained.    Example 2.2: Consider the following non-oscillatory process with overshoot From the process unit step responseỹ t ð Þ in Figure 13, it follows thatK The closed-loop system responses y(t) and u(t) to a unit step reference are shown in Figures 14 and 15 for K = 0.25, 1, 4. The control variable u(t) is too strong for K = 4when u(0 + ) = K/K M % 2, and too weak for K = 0.25when u(0 + ) = K/K M % 0.125. Note that the system is stable for all K > 0.

Example 2.3: Consider the oscillatory process with overshoot
From the process unit step response in Figure 16, it follows thatK The closed-loop system responses y(t) and u(t) to a unit step reference for three different values of the tuning gain K are shown in Figures 17 and 18. The control response u(t) is too strong for K = 0.4when u(0 + ) % 0.2, and too weak for K = 0.1when u(0 + ) % 0.05. The control system is stable for K < 2.5.

Remark 2.2:
The proposed algorithm can be also used to control stable proportional-type processes of nonminimum phase. To control a stable nonminimumphase process, we will consider that the process time delay includes the interval where the sign of the process step response is opposite to the sign of the final value.

Example 2.4: Consider the nonminimum-phase process
From the process unit step response shown in Figure 19, it follows the model parameters :   Figures 20 and 21 show the closed-loop system responses y(t) and u(t) to a unit step reference for three values of the tuning gain K. The best response is achieved for K = 10. The closed-loop system is stable for K < 36.6.

Extended form of the control algorithm
The algorithm can be extended to control integral-type processes and unstable processes. The main idea is to turn the original process into a stable process of proportional type (called the compensated process) by means of a feedback path of pure proportional type, as shown in Figure 22.
As a rule, for an integral-type process, the step response of the compensated process has zero overshoot for small values of the feedback gain K f , and nonzero overshoot for large values of K f . A suitable variant is to choose the gain K f as large as possible such that the overshoot of the step response of the compensated process remains zero. Then, for selected K f , the model parameters K M , t M and T trM are determined from the compensated process response y(t) to a step change of the input c. If K = 1 and the model parameters have appropriate values, then the closed-loop control system response c(t) to a step reference is close to a step function.
Note that the steady-state error is zero for a step and even for a ramp disturbance added to the process output. Figure 19. Process response to a unit step input.    According to Equations (36)-(40) and the controller structure in Figure 22, the discrete-time control algorithm has the following equations: where y 0 is the value of y just before switching to automatic mode. Notice that for K f = 0, the extended control algorithm (44) reduces to the primary form (36). Let u 0 and e 0 be the values of u and e before switching to automatic mode, and To have a bumpless transfer only for e 0 = 0, the following settings are needed to be made before switching to automatic mode: To have a bumpless transfer for any e 0 6 ¼ 0, it needs in addition to replace the equation f k = e k + x k in (44) with In automatic mode, a bumpless transfer should be achieved whenever the human operator changes a parameter of the control algorithm.
A practical controller needs to have three operating modes: AUTOMATIC, MANUAL and COMPENSA-TORY. In COMPENSATORY and MANUAL modes, the human operator can directly set any value for the compensated process input c and the controlled process input u, respectively. Before switching to COMPENSA-TORY mode (from MANUAL or AUTOMATIC mode), the variable c should be set to the value of u. For K f = 0, the MANUAL and COMPENSATORY modes are the same.

Example 3.1: Consider the integral-type process
Using a negative feedback path with 0 < K f < 0.65, the integral-type process turns into a compensated process of proportional type whose response y to a unit step input c is monotonic and bounded (Figure 23). Choosing K f = 0.6, it follows that For K f = 0.6 and K = 1, 3, 8, the closed-loop control system responses y(t), c(t) and u(t) to a unit step reference are shown in Figures 24-26. The control variables c(t) and u(t) are too strong for K = 8, when   For K = 1, the control response c(t) is close to a step function. The closed-loop system is stable for K < 1140.
For K f = 0.6 and K = 3, the closed-loop system response y(t) to the ramp disturbance v(t) = t/10 is shown in Figure 27.
For K f = 0.5, from the compensated process response to a unit step input in Figure 23, it follows that K M ¼ 1:925; t M ¼ 7; T trM ¼ 100 À 7 ¼ 93: Setting K = 25, the system response y(t) to a unit step reference ( Figure 28) is even better than the response obtained for K f = 0.6 and K = 3 ( Figure 24). The closed-loop system is stable for K < 4500.

Example 3.2: Consider the unstable process
Using a feedback path with K f = ¡2.13, the unstable process turns into a stable compensated process whose response y to a unit step input c is monotonic and bounded ( Figure 29). From this compensated process response, it follows that The closed-loop system responses to a unit step reference are shown in Figures 30-32  If K = 1, then the control response c(t) is close to a step function. The closed-loop system is stable for K < 460.
Remark 3.1: A similar but simpler control algorithm can be obtained by replacing the second-order internal controller (16) with the first-order controller    where For a perfect model, the ideal control response u id1 (t) to a unit step reference has the expression The response u id1 (t) is monotonic for all K > 0 (increasing for K < 1, decreasing for K > 1, in step form for K = 1). The discrete-time equivalent of the internal controller has the transfer function where The discrete-time control algorithm has the following equations: Based on many real-time control simulations on software and physical processes (in laboratory and two refineries), we may state that the robustness and control performance of this algorithm are comparable with the ones of the control algorithm with secondorder internal controller.

Summary of rules for choosing the controller parameters
For a proportional process of P1 type (with the step response monotonic and finite), the model parameters   (steady-state gain K M , time delay t M and transient time T trM ) can be easily determined from the process step response (always starting from an initial steady-state behaviour). These parameters can be verified and corrected online by analyzing the deviation of the controller response u(t) to a reference step for K = 1 from the step shape. So, if the initial value u(0 + ) is greater/smaller than its final value u(1), then K M needs to be proportionally augmented/diminished. Then, for K M % K P , analyzing the new response u(t) to a step reference, if u (t) is greater/smaller than u(0 + ) in a time range t > t M , then T trM needs to be augmented/diminished. For a proportional process with overshoot (with or without oscillations) or of nonminimum phase, the model parameters are determined by approximating the process with one of P1 type. For a process with overshoot, if the step response has the maximum value at time t 0 , then the response is assumed to remain constant at its maximum value for t t 0 . For a nonminimum-phase process, we assume that the time delay includes the time interval where the sign of the process step response is opposite to the sign of the final value.
For an integral or unstable process, the model parameters are determined by turning the process into a compensated process of P1 type, using a suitable feedback process gain K f . For an integral-type process, it is recommended to choose the gain K f as large as possible such that the step response of the compensated process has zero overshoot. Then, for selected K f , the model parameters K M , t M and T trM are determined from the compensated process response y(t) to a step change of the input c. If K = 1 and the model parameters have appropriate values, then the form of the closed-loop system response c(t) to a step reference is close to a step shape.
To have a stronger/weaker control action, the process operator increases/decreases the tuning gain K (with the standard value 1).

Future research
For many practical applications, it is not recommended to use high values (larger than 10) of the tuning gain K, which lead to a very sharp form of the controller output to a step reference. Such situations can appear, for instance, by using an inaccurate process model with K M > K P (Figures 9) or t M > t P (Figure 10). To avoid such cases, we propose as future research a more general control algorithm whose structure is illustrated in Figure 33, where a 2 [0, 1] and The initial and final values of the closed-loop system response c(t) to a unit step reference are the same as those from the presented control algorithm (where a = 0), namely Note that for a = 1, the internal controller has the transfer function G i (1, s) = 1/K M . We claim that for any fixed K, K > 1, the control action is stronger for larger a. Therefore, in the case a 6 ¼ 0, the best performance of the control system will be achieved for a smaller value of the tuning gain K than for a = 0. In our opinion, a = 0.2 is a suitable value to get robust and high control performance.

Conclusions
The proposed quasi-universal practical algorithm incorporates a process feedback block of pure proportional type, a process model of second order plus time delay, and a realizable internal controller of second order. By means of the process feedback path, if the original process is of integral-type or unstable, then it is turned into a stable compensated process of proportional type.
In its extended form, the proposed algorithm has five parameters: three model parameters (the model steady-state gain K M , the model time delay t M and the transient time T trM of the model response to a step input), a tuning gain K with standard value 1 (which can be easily used by the human process operator to increase or decrease the magnitude of the control action) and a process feedback gain K f (which is zero for stable processes of proportional type). The industrial use of the proposed algorithm will have an instructive effect on the process operators, who need to know the main dynamic parameters of the processes or compensated processes: the steady-state gain, the time delay and the transient time of the step response.
If the model steady-state gain K M is equal to the compensated process steady-state gain K P , then the internal controller response c(t) to a step reference has the initial value K times larger than its final value. Furthermore, if the dynamic model of the compensated process has a high accuracy, then the internal controller response c(t) for K = 1 is close to a step form. By analyzing the deviation of this response from the ideal step form, the model parameters can be easily adjusted online to improve the model accuracy. The practical feature of the control algorithm follows from the following considerations: whatever the process to be controlled, the control algorithm has the unique form (44); the algorithm has a tuning gain K (with standard value 1) instead of a tuning filter time constant (as usual in the IMC design), which achieves a natural trade-off between closedloop performance and robustness to model uncertainties; the controller parameters can be easily determined from the step response of the process (or compensated process), and can be verified and adjusted online; in addition, due to the tuning gain K, it is not necessary to estimate with high accuracy the model parameters in order to have good control performance (as shown in the simulation Example 2.1, it is better to select K M > K P than K M < K P , t M > t P than t M < t P , and T trM > T trP than T trM < T trP ); as the PID algorithm, the proposed control algorithm is quasi-universal because it can be applied to control almost all process types: proportional processes (with or without time delay, with or without overshoot, with or without oscillation, of minimum or nonminimum phase), integral processes, stable or unstable processes.
The main original contributions of the paper are the following: an extension of the proposed algorithm to control all or almost all industrial processes; an experimental procedure of tuning the controller parameters much simpler than the procedures used for the PID controllers; the use of a tuning gain with standard value 1 instead of a filter time constant that is usually used in the classical IMC design; the use of the process transient time as model parameter (together with the process steady-state gain and process time delay); a design of the discrete-time control algorithm as a set of difference equations which can be easily implemented on a real time controller; a design of the conditions of bumpless transfer between the three controller modes: MANUAL, COMPENSATORY and AUTOMATIC; a proposal to generalize and improve the control algorithm in order to avoid some unusual situations where the controller output to a step reference has a very sharp shape.
Due to its robustness, high control performance (especially for the processes with time delay) and tuning procedure simplicity, the proposed control algorithm is better than the popular PID algorithm. In addition, for integral-type processes, the proposed algorithm achieves zero steady-state error for a ramp disturbance added to the process output.

Disclosure statement
No potential conflict of interest was reported by the author.