A Practical Uniﬁed Algorithm of P-IMC Type

: The paper presents a practical algorithm of the proportional-internal model control (P-IMC) type that can be applied to control a wide class of processes: Stable proportional processes, integral processes and some unstable processes. The P-IMC algorithm is a suitable combination between the P 0 -IMC algorithm and the P 1 -IMC algorithm, which are characterized by a too weak and a too strong impact of the tuning gain on the control action, respectively. The overall controller has ﬁve parameters: A tuning parameter K , three model parameters (steady-state gain, settling time, and time delay) and a process feedback gain used only for integral or unstable processes, to turn them into a compensated process (stable and of proportional type). For a step setpoint, the initial value of the compensated process input is approximately K times its ﬁnal value. Furthermore, for K = 1, the compensated process input is close to a step shape (step control principle). These properties enable a human operator to check and adjust online the model parameters. Due to its control performance, robustness to modeling error, and capability to be easily tuned and applied for all industrial processes, the P-IMC algorithm could be a viable alternative to the known PID algorithm. Numerical simulations are given to highlight the performance and the ﬂexibility of the algorithm.


Introduction
In spite of all recent advances in control technology, the old proportional-integral-derivative (PID) algorithm is still by far the most widely used in practice due to its simplicity, feasibility, and capacity to control almost all plant types [1][2][3]. However, for many complex processes, especially with overshoot, time delay, non-minimum phase, and/or non-linear characteristics, the PID algorithm cannot achieve good and very good control performances. Also, there is not a simple unified procedure for tuning controller parameters [4][5][6][7][8].
According to the IMC principle, an accurate control can be achieved if a suitable model of the process is encapsulated in the control system structure [9][10][11][12][13]. Despite their many advantages, the algorithms of the IMC-type have not become a convincing practical alternative to PID algorithm [14][15][16] because there is no simple model structure for all types of process. Over the past 10-20 years, many PID tuning methods have been developed by applying IMC techniques for processes of low order plus time delay [17][18][19]. However, the control performance derived by implementing IMC-based PID algorithms is usually weaker than that obtained by using genuine IMC algorithms (especially for processes with large time delay).
We have presented in 2017 and 2018 two unified control algorithms [20,21] of P0-IMC type and P1-IMC type, respectively, whose bloc-diagrams are illustrated in Figures 1 and 2, where G P (s) is the process transfer function, G M (s) is the transfer function of the compensated process model, K M is the model steady-state gain, K f is the process feedback gain, K is the tuning gain, Y is the  The direct feedback path of the process, characterized by the gain K f , is used only for integral and some unstable processes, in order to convert the original process P into a stable proportional process P0 (with the gain K P 0 bounded and nonzero), called compensated process. The process compensation technique has been firstly used in [22,23] for unstable processes, and in [24] for stable integral processes. For stable proportional processes, the feedback gain K f is fixed to zero, so that the compensated process and the original process are one and the same, and the control variables C and U are identical. The compensated process models in Figures 1 and 2 have, respectively, the transfer functions G M (s) = K M e −τ M s (T 1 s + 1)(T 2 s + 1) , and G M (s) = K M e −τ M s (T 1 s + 1) 2 .
The algorithms P0-IMC and P1-IMC have five parameters: A tuning parameter K (with standard value 1), a process feedback gain K f (with standard value 0), and three model parameters (steady-state gain K M , settling time T sM , and time delay τ M ). The lag time constants T 1 in models (1) and (2) are, respectively, given by where T s95 is the model settling time.
For both closed-loop control systems, the steady-state error to a step reference or disturbance is zero. In addition, if the process is of integral type, the steady-state error to a ramp disturbance is zero.
Because of the initial sluggishness of the process and process model, the initial value of the control system response c(t) to a unit step setpoint is for both control algorithms On the other hand, since the steady-state error to a step setpoint is zero, the final value of the control system response c(t) is the reverse of the steady-state gain of the compensated plant: Therefore, for a compensated process model with K M = K P 0 , the initial value of c(t) is K times its final value: Since the model of the compensated plant is stable and of proportional type, both algorithms are unified and quasi-universal, in the sense that they have a unique form (as the PID algorithm) and may be used to control almost all industrial plants: Stable plants of proportional type (with or without overshoot, time delay and oscillations, of minimum or non-minimum phase), integral plants, and unstable plants.
The model parameters can be experimentally identified using the compensated plant response to a step input, and can be easily adjusted online. Also, by setting a suitable tuning gain K, the closed-loop control system can have good performance even if the model parameters are not accurately known.
The proposed control algorithm is of P-IMC type, and provides an adequate trade-off between the algorithms P0-IMC and P1-IMC, ensuring a moderate impact of the tuning gain K on the control action. In most practical applications, it is not desirable to use large values of the gain K (larger than 10) to avoid an excessive noise amplification and a very sharp-shrill form of the controller output c(t) to a step setpoint or disturbance. The P0-IMC algorithm can lead to such undesirable situations when the parameters of the compensated plant are inaccurately selected (K M >> K P 0 or τ M >> τ P 0 or T s >> T sP 0 ) and the tuning gain K has a weak influence on the control action [20]. On the contrary, such situations are not possible by using the P1-IMC algorithm, characterized by a strong influence of K on the control action [21]. By using the new proposed algorithm, the best control performance is usually obtained for 1 < K < 5, and the response c(t) to a step reference is smoother than the response of the first algorithm and sharper than the one of the second algorithm. Also, for K =1, the new algorithm preserves the step control principle, which states that "the control response c(t) to a step setpoint is close to a step form if the dynamic model of the compensated plant has a high accuracy". By a simple analysis of the deviation of the response c(t) from the step function, the model parameters can be suitably adjusted online. Section 2 presents the theoretical basis of the P-IMC algorithm in continuous and discrete-time, and how it can be used to control stable proportional processes, integral processes, and some unstable processes in a coherent framework. In addition, the conditions for a bumpless transfer between the MANUAL, COMPENSATORY, and AUTOMATIC modes are given in discrete-time. Section 3 presents an experimental method of identifying the model parameters for all process types. A simple procedure which enables a human operator to verify online if the model parameters have suitable values and to adjust them is given in Section 4. Section 5 presents a two-degree of freedom variant of the algorithm. Using MATLAB/SIMULINK environments, some numerical applications are given in Section 6 to show the control performance, the robustness with respect to parameter uncertainty, and how the algorithm can be implemented to control various types of process. Conclusions and future research are presented in Section 7.

P-IMC Algorithm Design
As mentioned in the previous section, the impact of the tuning gain K on the control action is too weak for the P0-IMC algorithm and too strong for the P1-IMC algorithm. Consequently, a fast control system response to a step setpoint or disturbance is achieved with a control signal c(t) too sharp (for K large) and too smooth (for K small), respectively. We show further that the proposed algorithm satisfactorily solves this problem.
The block diagram of the Pα-IMC algorithm (or, more simple, P-IMC algorithm) is shown in Figure 3, where the transfer functions of the compensated process model and internal controller are: with The Pα-IMC algorithm reduces to the first algorithm in Figure 1 for α = 0 and T 2 = 2T 1 , and to the second algorithm in Figure 2 for α = 1 and T 2 = T 1 . By setting K = 1, the internal controller (8) becomes purely proportional, and all three control algorithms (for α = 0, α = 1, and 0 < α < 1) are identical.
The following theorems are valid for a stable closed-loop control system of P-IMC type having the structure in Figure 3. Theorem 1. The steady-state error of an asymptotically stable control system with P-IMC controller is zero for any step setpoint or disturbance.
Proof. Since the compensated process is of proportional type, it suffices to prove that the transfer function G CE (s) between the output C and the input E is of integral type (i.e., it has a pole at the origin). This is true because and Theorem 2. The initial and final values of the control response c(t) of a P-IMC controller to a unit step setpoint does not depend on the weighting coefficient α: In addition, if K M = K P 0 , then Proof. Because of the initial sluggishness of the process and model, we have (see Figure 3) On the other hand, according to Theorem 1, we have y(∞) = 1, therefore According to Theorem 2, if K = 1 and K M = K P 0 , the initial and final values of the response c(t) to a unit step reference are equal to each other, that is c(0 + ) = c(∞). Moreover, the P-IMC algorithm satisfies the step control principle: Theorem 3. If K = 1 and the model of the compensated process is perfect, then the control response c(t) of a P-IMC controller to a unit step setpoint is a perfect step of magnitude 1/K M .
Proof. We only need to show that the transfer function G CR (s) is equal to 1/K M . According to (10), we have Assume further that the compensated process is of P*-type (proportional and having a monotone and bounded step response) and consider the model (7) with For a given γ, the parameters of the model (7) can be experimentally determined by using the compensated plant response y(t) to a step input c, as follows: where the computed values of the function β(γ) are showed in Table 1, and T tr is the transient time of the response y(t) (without time delay); more precisely, where τ P 0 is the time delay of the compensated plant, and T sP 0 the settling time of the compensated plant (when the response y reaches 95% or 98% of its final value).
For practical reasons, we will consider that the parameters of the compensated plant model are K M , τ M , and T s . As shown in [20] for α = 0 and in [21] for α = 1, if the tuning gain K is suitably selected, then an estimation of the model parameters with an error less than 15% does not significantly diminish the control performance. We claim that this robustness property is also satisfied for 0 < α < 1. To get the discrete-time control algorithm, let us denote by T the sampling period and by l M the integer ratio of the model time delay to the sampling period: Moreover, let us denote The discrete-time equivalent of the model (7) has the approximate transfer function which leads to the difference equation Similarly, the discrete-time equivalent of the internal controller (8) has the approximate transfer function and the difference equation From the controller structure in Figure 3, the difference Equation (22) of the compensated process model and the difference Equation (24) of the internal controller, we get the following discrete-time control algorithm: where e 0 , u 0 , and y 0 are, respectively, the values of e, u, and y before switching to AUTOMATIC mode.

Remark 1.
To have a bumpless transfer (without suddenly changing the process input u) for any initial error e 0 = 0, the following settings must be made before switching to AUTOMATIC mode: By replacing the equation a bumpless transfer is achieved only for e 0 = 0. For e 0 = 0, the control variables c and u modify to diminish the error as in the case of a step reference of magnitude e 0 .
For K f = 0, the overall controller C in Figure 3 has three distinct operating modes: AUTOMATIC, MANUAL, and COMPENSATORY. Note that in MANUAL and COMPENSATORY modes, the human operator can directly change the original process input u and the compensated process input c, respectively. Before switching to COMPENSATORY mode, characterized by the equation y 0 and c need to be automatically initialized to the current values of y and u, respectively. For K f = 0, the MANUAL and COMPENSATORY modes coincide.

Remark 2.
For integral or unstable processes, the model addresses the compensated process. The feedback gain K f is selected to get a stable proportional compensated process.

Remark 3.
For an integral process, the compensated process response y(t) to a ramp disturbance v and fixed c (see Figure 3) is bounded. As a result, since the controller with the transfer function G CE (s) given by (10) is of integral type (see the proof of Theorem 1), the steady-state error is zero for a ramp disturbance added to the plant output.

Remark 4.
In practical applications, due to the process nonlinearities and model inaccuracy, the closed-loop response c(t) to a step setpoint is not a perfect step for K = 1. By comparing the current response c(t) with the step form, the human operator can online check the accuracy of the model parameters and suitably adjust them.

Remark 5.
The impact of the tuning gain K on the control action is stronger for larger α. This is illustrated in Figures 4 and 5 for the process G P (s) = e −5s (10s + 1) 2 , G M (s) = G P (s), K f = 0, K = 2 and four values of α. The control algorithms with α = 0.2 and α = 0.6 are medium variants between the extreme variants with α = 0 and α = 1, where the control action with respect to K is too weak and too strong, respectively. Notice that the closed-loop control system is stable for α = 0, α = 0.2, α = 0.6, and α = 1 if 0 < K < ∞, 0 < K < 87.6, 0 < K < 11.1, and 0 < K < 5.78, respectively.

Remark 6.
A simpler control algorithm can be designed by using the first order internal controller where The time constants T 5 can be experimentally identified from the compensated plant response to a step input, as follows: with T tr given by (15). Notice that Theorems 1-3 are also valid for this internal controller.
The discrete-time internal controller has the transfer function where Therefore, the discrete-time control algorithm has the equations Based on several real-time control simulations, we can claim that the control performance and the robustness of this controller are comparable with those of the second order internal controller (25).

Setting the Controller Parameters
The tuning gain K is used by the human process operator to get a stronger/weaker control action. As a rule, the feedback gain K f is selected to be zero for stable proportional processes.

•
For a proportional process of P*-type (of minimum phase and without overshoot), the model parameters (steady-state gain K M , settling time T sM and time delay τ M ) can be experimentally determined from the step response of the process (starting the test from steady-state behaviour and without disturbance action during the test). For many slow industrial processes under various unknown disturbances, it is more practical to operate with T sM95 instead of T sM98 .

•
For a stable proportional process of non-minimum phase and without overshoot, if [0, t 0 ] is the time interval where the process step response y(t) has the sign opposite to that of the final value, the model parameters are determined by approximating the process P with a processP having the step responseȳ(t) such thatȳ(t) = 0 for t ≤ t 0 andȳ(t) = y(t) for t ≥ t 0 ; therefore, • For a stable proportional process of minimum phase and with overshoot at the time t 1 (with or without oscillations), the model parameters are determined by approximating the process P with a processP having the step responseȳ(t) such thatȳ(t) = y(t) for t ≤ t 1 , andȳ(t) = y(t 1 ) for t ≥ t 1 ; therefore, Since the model steady-state gain K M is larger than the steady-state gain K P of the original process, the closed-loop response c(t) to a step setpoint has a smaller initial value c(0 + ) to diminish or vanish the overshoot of the closed-loop system response.

•
For a stable proportional process of non-minimum phase and with overshoot at the time t 1 (with or without oscillations), if [0, t 0 ] is the time interval where the plant step response y(t) has the sign opposite to that of the final value, then the model parameters are determined by approximating the process P with a processP having the step responseȳ(t) such thatȳ(t) = 0 for t ≤ t 0 ,ȳ(t) = y(t) for t 0 ≤ t ≤ t 1 , andȳ(t) = y(t 1 ) for t ≥ t 1 ; therefore, • For an integral or unstable process, the model parameters are experimentally identified from the compensated process response y(t) to a step input c (with K f = 0 and the controller in COMPENSATORY mode). For an integral process, the compensated process is usually of P*-type for small values of K f , becoming faster or even oscillatory for large values of K f . It is recommended to select a large K f , but not so large to generate overshoot in the step response of the compensated process.

Online Adjustment of the Model Parameters
According to the step control principle (see Theorem 3), for K = 1 and a perfect compensated process model, the control response c(t) to a step setpoint has a step shape. The deviation of the control response c(t) from the step form offers information about how the human operator can adjust the model parameters. For process (31) and model (7) with    With regard to the closed-loop responses c(t) to a unit step setpoint in the case K = 1, the following observations are valid for compensated processes of minimum phase and without overshoot.

•
If the initial value c(0 + ) differs from the final value c(∞) (see Figure 6 for K M = 0.5 and K M = 2), then K M needs to be multiplied by the ratio c(0 + )/c(∞).

•
If τ M differs from the compensated process time delay τ P 0 (see Figure 7 for τ M = 1 and τ M = 9), the response c(t) has a deviation from the step form starting from the time t = min{τ P 0 , τ M }. For Figure 8 for T sM = 43 and T sM = 65), the response c(t) has a deviation from the step form starting from the time t = τ M . For K P 0 > 0, the deviation is positive if T sM < T sP 0 , and negative if T sM > T sP 0 .
In conclusion, if K = 1 and the closed-loop system response c(t) to a step setpoint is predominantly larger/smaller than the step function of magnitude c(∞), then the respective model parameter needs to be suitably augmented/diminished. As a general recommendation, it is better to choose K M > K P 0 than K M < K P 0 , τ M > τ P 0 than τ M < τ P 0 , and T sM > T sP 0 than T sM < T sP 0 . For example, if K M ≈ K P 0 and τ M ≈ τ P 0 , then the control performance for T sM >> T sP 0 and the best tuning gain K (which is greater than 1) is better than that for T sM << T sP 0 and the best K (which is less than 1).

Two-Degree of Freedom Algorithm
In order to slow down the reference signal, a low pass pre-filter with can be used. Choosing the time constant where T s95 is the settling time of the closed-loop response y(t) to a step reference for T F = 0, the control responses c(t) and u(t) to a step reference have a slower start variation, but that does not cause a significant increase of the settling time of the response y(t).

Illustrative Tests
The control algorithm Pα-IMC with α = 0.2 provides a suitable combination between the algorithm with α = 0 ( Figure 1) and the algorithm with α = 1 (Figure 2). The tests in this section were performed with the algorithm Pα-IMC for i.e., for and where In this case, the discrete-time control algorithm (25) has the particular form: where (47)
From the process response to a unit step input (Figure 9), one may estimate the following model parameters: Since the process is of proportional type, one selects K f = 0, in which case the control variables c and u coincide. From the responses y(t) and u(t) to a unit step reference in Figures 10 and 11, it follows that the control action is suitable for K = 2.4, slow for K = 1, too slow for K = 0.5 and strong for K = 5. The closed-loop control system remains stable for 0 < K < 376.
Since the control response u(t) for K = 1 is close to a step function (Figure 11), one can say that the model parameters have been accurately identified, and the model type (43) describes satisfactory the process dynamic.    Figures 12-14 illustrate the responses y(t) to a unit step reference for K = 2.4 and various K M , τ M and T sM , respectively. Notice that the three closed-loop control systems are stable for K M > 0.406, for τ M > 0 and for T sM > 16.5, respectively. Figures 15-17 illustrate the responses y(t) for various model parameters and a suitable tuning gain K. One can see that if K has an appropriate value, the control performance is preserved even for a wrong setting of the model parameters. The fact that the responses A (where the wrong parameter is greater) are better than the responses C (where the wrong parameter is less) confirms the recommendation in Section 4, that it is better to choose K M > K P than K M < K P , τ M > τ P than τ M < τ P , and T sM > T sP than T sM < T sP . In addition, the best tuning gain K is greater than 1 for all responses A and less than 1 for all responses C.       Figure 18 illustrates the closed-loop responses y(t) to a unit step reference for a PI control algorithm with

Remark 7.
in the following cases: A (K = 0.7 and the suitable T i = 32), B (K = 0.5 and the suitable T i = 24) and C (K = 0.3 and the suitable T i = 18). One can see that the best response in Figure 10 (obtained with the proposed algorithm for the suitable K = 2.4) is better than the best response B in Figure 18 (obtained with the PI algorithm). Remark 8. According to Figure 10, the settling time of the closed-loop response y(t) to a step reference for the suitable K = 2.4 is T s95 ≈ 40. Using a reference pre-filter with the time constant (see Section 5) the responses y(t) and u(t) in Figures 10 and 11 turn into the responses in Figures 19 and 20, respectively. The responses y(t) in Figure 19 are comparable with those in Figure 10, whereas the responses u(t) in Figure 20 have a start variation slower and a maximum value (for K > 1) less than those in Figure 11.
From the unit step process response in Figure 21, one gets (see Section 3) KP ≈ 2, τP = 9, t 1 = 32, therefore K M = KP ≈ 2, τ M = τP = 9, T sM = T sP ≈ t 1 = 32. Figures 22 and 23 show the responses y(t) and u(t) to a unit step setpoint for the same three values of K. The response y(t) for K = 0.33 is satisfactory for the given oscillatory process. Notice that the control system is stable for 0 < K < 1.5.
According to (40) and the unit step process response in Figure 24, we get KP = 1.23, t 0 = 10, t 1 = 35, therefore K M = KP = 1.23, τ M = t 0 = 10, T sM = T sP ≈ t 1 = 35. Figures 25 and 26 show the responses y(t) and u(t) to a unit step setpoint for the same three values of K. Clearly, the best response y(t) is obtained for K = 1.4. The control system is stable for 0 < K < 3.4.
For 0 < K f < 0.45, the compensated process is of P*-type (Figure 27), with a monotone and bounded response to a step input. Choosing K f = 0.4, the compensated process model has the parameters The responses y(t), c(t), and u(t) to a unit step setpoint are respectively shown for the same three values of K in Figures 28-30. The response y(t) for K = 3.3 ( Figure 28) is very good for the given integral process. Since the control response c(t) for K = 1 is close to a step shape (Figure 29), the model type (43) describes with sufficient accuracy the compensated process sluggishness. The closed-loop control system is stable for 0 < K < 110.
Using a negative feedback path with 0.667 < K f < 0.75, the process turns into a compensated process of P*-type having a monotone and bounded response to a step input (Figure 32). By selecting K f = 0.74, the model of the compensated process has the following parameters: The responses y(t), c(t), and u(t) to a unit step setpoint are shown in Figures 33-35 for the same three values of K. Since the control response c(t) is close to a step shape for K = 1 (Figure 34), the model (43) describes with accuracy the compensated process dynamic. The closed-loop control system is stable for 0 < K < 410.

Conclusions
The paper addresses a practical unified control algorithm which, due to the control performance, robustness to modeling error and process uncertainties, and capacity to be easily tuned and used for all industrial plants, could be a real alternative to the known PID algorithm.
The proposed algorithm is a suitable trade-off between the known P0-IMC algorithm and P1-IMC algorithm, which provide a too weak and a too strong impact of the tuning gain K on the control action, respectively. The P-IMC algorithm is better than the PID algorithm with respect to both the tuning procedure simplicity and the control performance (especially for processes of non-minimum phase or/and with time delay), and is more efficient than the IMC algorithm due to the stronger and safer influence of the component P on the control action.
The algorithm has five parameters: The process feedback gain K f (used to turn integral or unstable processes into a stable proportional compensated process), the tuning gain K (used to adjust the control intensity), and three parameters of the compensated process model: Steady-state gain, time delay, and settling time. All parameters of the P-IMC algorithm can be determined experimentally. By choosing a suitable K, the reference tracking performance is satisfactory even for a large uncertainty of the model parameters. However, as a general recommendation, it is desirable that the value of a parameter of the compensated process model to be selected equal or larger than its real value. For such a larger selection, the best tuning gain K is usually more than 1, and the control performance is better than for a smaller selection (when the best K is less than 1).
There is a simple procedure to check and correct online the model parameters through simple visual analysis of the shape of the internal controller response to a step reference. This procedure is based on the step control principle, which states that for K = 1 and a perfect model, the internal controller response to a step reference has a step shape. Thus, by analyzing the deviation of the internal controller response from the step shape, the model parameters can be suitably adjusted to improve the model accuracy.
If the steady-state gains of the model and the compensated process are equal to each other, the initial value of the internal controller response to a step reference is K times its final value. This feature enables the human operator to select the tuning gain K and understand better its role in the control action.
Since the proposed P-IMC algorithm can be implemented in practice only in discrete-time, it is designed in both continuous-time and discrete-time.
For α = 0.2 and γ = 1 (i.e., T 1 = T 2 ), the P-IMC algorithm has been tested in real time, with excellent results, in laboratory and field conditions. In the future, interesting comparative research and control applications based on the P-IMC algorithm could be made in chemistry and allied engineering fields.