ISA Transactions
journal homepage: www.elsevier.com/locate/isatrans
Design of nonlinear PID controller and nonlinear model predictive controller for
a continuous stirred tank reactor
J. Prakash ∗ , K. Srinivasan
Department of Instrumentation Engineering, Madras Institute of Technology, Anna University, Chennai-44, India
It should be noted that the grade of membership should be To account for plant model mismatch and unmeasured
disturbances, a simple unmeasured disturbance estimator similar
N
X to the dynamic matrix control scheme is incorporated as follows:
hi (z (k)) ∈ [0, 1] and hi (z (k)) = 1. (12)
i=1 yc (k + j/k) = y(k + j/k) + d(k + j/k) (17)
where
3. Nonlinear PID controller (N-PID) design using local linear
models d(k + j/k) = d(k/k) = (ym (k) − y(k)) for j = 1, . . . , Np . (18)
In the above Eq. (18), ym (k) represents the measured output
In this section, the design of local PID controllers on the basis at the kth instant and y(k) represents the model output at the
of local linear models, which were described in the previous kth instant. Given a future setpoint trajectory yr (k + j/k), (j =
section, is discussed. Further, the method to combine the local 1, . . . , Np ), the nonlinear model predictive controller design
PID controller outputs yielding a global controller output has been problem can be formulated as:
outlined. The global controller output u(k) has been determined by
the following rules: u(k/k) .min
. . u(k + Nc − 1/k) J (19)
Rule i (i = 1 : N ) where,
If z1 (k) is Mi,1 and . . . and zg (k) is M1,g then Np
X
J = [E (k + j/k)]T WE [E (k + j/k)]
K c ,i (Kc ,i ∗ Td,i )
ui (k) = Kc ,i (e(k) − e(k − 1)) + T e(k) + j =1
T r ,i T Nc −1
X
× (e(k) − 2 ∗ e(k − 1) + e(k − 2)) + ui (k − 1) (13) + [1u(k + j/k)]T Wu [1u(k + j/k)]
j =0
where, T is the sampling time. It should be noted that PID
E (k + j/k) = yr (k + j/k) − yc (k + j/k) (20)
controller could be designed to satisfy the stability, performance,
and robustness criteria for each local linear model. Kc ,i , Tr ,i and 1u(k + j/k) = u(k + j/k) − u(k + j − 1/k). (21)
Td,i are the proportional gain, integral time and derivative time Subject to the following constraints
values of the ith PID controllers determined using standard optimal
PID tuning methods. The global controller output is described by a uL ≤ u(k + j/k) ≤ uH for j = 0, . . . , Nc − 1 (22)
fusion of all linear PID controller outputs.
yL ≤ yc (k + j/k) ≤ yHfor j = 1, . . . , Np (23)
1u(k + Nc /k) = 1u(k + Nc + 1/k)
4. Nonlinear model predictive controller using local linear
models (F-NMPC) = · · · 1u(k + Np − 1/k) = 0̄. (24)
The resulting constrained optimization problem can be solved
In the proposed N-MPC formulation, at every sampling instant
using any standard optimization technique.
the fuzzy dynamic model (Refer Eqs. (7) and (8)) is used for
predicting the future behavior of the plant over a finite number
of future time steps, say Np which is called prediction horizon. 5. Nonlinear model predictive controller using first principle
A set of Nc future manipulated input moves {u(k/k), u(k + (analytical) model–A-NMPC
1/k) . . . u(k + Nc − 1/k)}(where Nc is called the control horizon)
are determined by constrained optimization with the objective of The objective of the A-NMPC is to calculate a set of future
minimizing the predicted deviation of the process output from control moves (Control horizon) by minimization of a cost function
the target over the prediction horizon as well as minimizing the on a moving finite horizon (Prediction horizon). The optimization
expenditure of control effort in driving the process output to target, problem is solved on-line, based on the predictions obtained
from a nonlinear model. It is possible to use different empirical
subject to pre-specified operating constraints. The proposed F-
nonlinear models for predictions in the controller, but the most
NMPC is implemented in a moving horizon framework, that is,
attractive approach is to use the first principle models [21]). In the
only u(k/k) is implemented at each sampling instant and the
analytical model based N-MPC formulation, given a sequence of
optimization is repeated at each sampling instant based on the
future control moves {u(k/k) · · · u(k + 1/k) · · · u(k + Nc − 1/k)},
updated information from the plant.
a Np step ahead output prediction using the first principle model
The fuzzy dynamic model developed in the Section 2 can
could be written as follows:
be used recursively to obtain multi-step prediction. Given a
sequence of future control moves {u(k/k) · · · u(k + 1/k) · · · u(k x(k + j + 1|k) = x(k + j|k)
+ Nc − 1/k)}, a Np step ahead output prediction can be written Z (k+j+1)T
F x(τ ), u(k + j|k), d̄ dτ ;
as follows: +
(k+j)T
N
j = 0, 1, . . . .Np − 1
X
x(k + j + 1/k) = hi z (k + j)[Φi [(x(k + j/k)) − x̄i ] (25)
i =1 y(k + j + 1/k) = Cx(k + j + 1/k); for j = 0, 1, . . . , NP − 1. (26)
+ Γu,i (u(k + j/k) − ūi ) + x̄i ] for j = 0, . . . , Nc − 1 (14)
To account for plant model mismatch and unmeasured distur-
N
X bances, a simple unmeasured disturbance estimator similar to the
x(k + j + 1/k) = hi z (k + j)[Φi [[x(k + j/k)] − x̄i ] dynamic matrix control scheme is incorporated as follows:
i =1
+ Γu,i (u(k + Nc − 1/k) − ūi ) + x̄i ] yc (k + j/k) = y(k + j/k) + d(k + j/k) (27)
uL ≤ u(k + j/k) ≤ uH for j = 0, . . . , Nc − 1 (32) Operating point: 3 (qc = 103, C̄A = 0.0989 and T̄ = 438.7763)
2.2479e−001 −3.4252e−003
y ≤ yc (k + j/k) ≤ y
L
for j = 1, . . . , Np
H
(33) Φ3 =
1.3333e+002 1.5012
1u(k + Nc /k) = 1u(k + Nc + 1/k)
1.3074e−004
= · · · 1u(k + Np − 1/k) = 0̄. Γ3 = .
(34) −9.2643e−002
The resulting constrained optimization problem can be solved
Operating point: 4 (qc = 106, C̄A = 0.1110 and T̄ = 436.3091)
using any standard optimization technique.
2.8071e−001 −3.5731e−003
Φ4 =
6. Continuous stirred tank reactor (CSTR) 1.2254e+002 1.5270
1.3038e−004
The first principle model of the continuous stirred tank system Γ4 = .
−9.0506e−002
and the operating point data (Refer Table 1) as specified in the
paper titled Fuzzy Model Predictive Control by Huang et al. [19] Operating point: 5 (qc = 109, C̄A = 0.1254 and T̄ = 433.6921)
have been used in this simulation study. In the process considered
3.3941e−001 −3.7084e−003
for simulation study, an irreversible, exothermic reaction A → B Φ5 =
1.1123e+002 1.5504
occurs in constant volume reactor that is cooled by a single coolant
1.2913e−004
stream. The process is modeled by the following equations:
Γ5 = .
−8.8085e−002
dCA (t ) q(t )
−E
= (CA0 (t ) − CA (t )) − k0 CA (t ) exp (35)
dt V RT (t ) C =
1 0
.
0 1
dT (t ) q(t ) (−1H )k0 CA (t )
−E
= (T0 (t ) − T (t )) − exp
dt V ρ Cp RT (t ) For the CSTR process considered for the simulation study Senthil
et al. [13] has shown that the linear dynamic model is not able
ρc Cpc
−hA
+ qc (t ) 1 − exp (Tc0 (t ) − T (t )) . (36) to capture the dynamic behavior of the CSTR process, whereas the
ρ Cp V qc (t )ρ Cp fuzzy dynamic model is able to capture the dynamic nonlinearity
The state x(t ) and input u(t ) vectors are given by x(t ) = [CA ; T ] adequately.
and u(t ) = [qc ].
7.2. Nonlinear PID controller (N-PID) design for CSTR process
7. Simulation studies
In this work, we have intended to interpolate five PID controller
In all the simulation runs, the process is simulated using the outputs. That is, for each local linear model described in the
nonlinear first principle model (Eqs. (35) and (36)). The true previous subsection, a PID controller has been designed. In order
state variables are computed by solving the nonlinear differential to prevent a sharp spike in the controller output, at the time
equations using differential equation solver in Matlab 6.5. of step change in the setpoint, the derivative of the measured
J. Prakash, K. Srinivasan / ISA Transactions 48 (2009) 273–282 277
Fig. 1. Servo response of CSTR with F-NMPC, N-PID, and A-NMPC (a) Process output (b) Controller output.
output has been used in the control law instead of a derivative Table 2 provides the values of the second-order transfer
of the error. That is, PV derivative type PID controller form has function model parameters such as process gain, damping factor
been implemented in this work (P and I on setpoint error and and un-damped natural frequency at different operating points.
D on Process Variable). Further, the tuning parameters of each The IMC based PID tuning procedure will yield the following
PID controller have been determined using the IMC [23] tuning controller parameters:
rules proposed by Morari and Zafiriou, [24]. The process transfer 2ξi 2ξi 1
function relating the reactor concentration to the coolant flow rate K c ,i = ; Tr ,i = ; Td,i = .
ωn,i Ki λ ωn,i 2ξi ωn,i
at all operating points has been found to be of the form:
It should be noted that using the model parameters reported in
Ki Table 2, we have obtained the controller parameters of each local
Gi (s) = ∀ i = 1 : 5.
s2 + 2ξi ωn,i s + ωn2,i PID controller. The PID controllers’ parameters at five different
278 J. Prakash, K. Srinivasan / ISA Transactions 48 (2009) 273–282
Table 2
Damping factor and un-damped natural frequency at different operating points.
Table 3
PID controllers’ parameters at different operating points.
Operating point Kc ,i Tr , i Td , i
119.4321
At qc = 97, C̄A = 0.0795, T̄ = 443.4566 λ
0.3367 0.1926
92.6928
At qc = 100, C̄A = 0.0885, T̄ = 441.1475 λ
0.2973 0.2546
67.4294
At qc = 103, C̄A = 0.0989, T̄ = 438.7763 λ
0.2491 0.3601
43.2812
At qc = 106, C̄A = 0.1110, T̄ = 436.3091 λ
0.1876 0.5792
19.1813
At qc = 109, C̄A = 0.1254, T̄ = 433.6921 λ
0.1037 1.3124
Table 4 NMPC schemes for CSTR have been developed with the sampling
ISE values of F-NMPC, N-PID, and A-NMPC for setpoint tracking.
time of 0.083 min, prediction horizon of NP = 5, and control
Sampling instants interval A-NMPC F-NMPC N-PID horizon of Nc = 1.The error weighting matrix and the controller
10 ≤ k ≤ 49 2.52e–05 3.68e–05 5.07e–05 weighting matrix used in the N-MPC formulation are WE =
50 ≤ k ≤ 79 8.84e–05 9.42e–05 1.47e–04 1e4 and WU = 0. The following constraints on the manipulated
80 ≤ k ≤ 120 1.55e–05 2.67e–05 3.10e–05 input (coolant flow rate) are imposed 95 < qc < 108.
Fig. 4. Servo and regulatory responses of CSTR with F-NMPC, A-NMPC and N-PID (a) Process output (b) Controller output.
Fig. 5. Servo response of CSTR with N-PID for various values of filter time constant (a) Process output (b) Controller output.
be provided by the operating region membership functions, and 7.5. Servo-regulatory performance
(ii) state propagation calculations of each model using the appro-
priate matrices and a weighted average of the local linear model Simulation studies have been carried out to demonstrate
outputs. Since, it is not necessary to carry out numerical integra- the disturbance rejection capability of the proposed F-NMPC
tion of nonlinear differential equations; the proposed F-NMPC ap- formulation based on local linear models, analytical model based
proach has better implementation capabilities than the A-NMPC NMPC (A-NMPC) and N-PID Controller at nominal and at shifted
approach. Note that the computation time of the F-NMPC for even operated points.
higher-order problems will be always less demanding, in compar- A step change in the feed temperature of magnitude 2 ◦ K (from
ison to that of the rigorous model based NMPC(A-NMPC). 350 ◦ K to 352 ◦ K) has been introduced at the 10th sampling
280 J. Prakash, K. Srinivasan / ISA Transactions 48 (2009) 273–282
Fig. 6. Servo response of CSTR with F-NMPC for various values of prediction horizon (a) Process output (b) Controller output.
Fig. 7. Performance of N-PID in the presence of measurement noise (a) Process output (b) Controller output.
instants and the value has been maintained upto the 110th PID and F-NMPC) are able to reject the disturbance quickly and
sampling instants and is then brought back to 350 ◦ K. (Refer Fig. 3). bring the reactor concentration back to the nominal value of
The ISE values are computed for A-NMPC, F-NMPC and N-PID and the setpoint. This part of the simulation demonstrates that the
are reported in Table 5. The ISE value of F-NMPC and A-NMPC have controllers are able to reject the disturbance at the nominal
been found to be considerably less than that of N-PID for the servo-
operating point.
regulatory performance case also. The following observation can be
drawn from the simulation studies • With the disturbance being persistent, a step change in the
• From 10th sampling instants to 70th sampling instants of setpoint has been introduced at 70th sampling instant and it
Fig. 4(a), it can be inferred that the controllers (A-NMPC, N- can be noted that both the controllers are able to maintain the
J. Prakash, K. Srinivasan / ISA Transactions 48 (2009) 273–282 281
Fig. 8. Performance of F-NMPC in the presence of measurement noise (a) Process output (b) Controller output.
Table 6
Mean and standard deviation of the true value of the controlled variable for various values of alpha.
Alpha Sampling instants interval F-NMPC µ (σ ) N-PID µ (σ )
concentration at the setpoint, as evident from 70th sampling type (lamda 0.5 and 1.5). For lamda value equal to 0.25, it can
instants to 110th sampling instants of Fig. 4(a). be observed that controller output was found to be aggressive, as
• At 110th sampling instants a simultaneous step change in the compared to other values of lamda (Refer Fig. 5(b)).
setpoint (Refer Fig. 4(a)) as well as a step change in the feed
temperature (Fig. 3) has been introduced and it can be inferred 7.7. Performance of F-NMPC for various values of prediction horizon
that the performance of the controllers has been found to be
satisfactory. This part of the simulation demonstrates that the In order to assess the effect of the prediction horizon, we
controllers are able to reject the disturbance as well as maintain have performed simulation studies for various values of prediction
the process variable at the setpoint. It should be noted that the horizon. The closed loop responses to step changes in the setpoint
performance of F-NMPC is found to be better than A-NMPC and and for various values of prediction horizon are shown in Fig. 6.
N-PID. In all the simulation runs, a control horizon of 1 is used. For the
process considered for simulation study the prediction horizon
seems not to have appreciable effect as shown in Fig. 6. The
7.6. Performance of N-PID for various values of filter time constant
setpoint tracking performance has been found to be almost the
same for all the values of prediction horizon.
In order to show the tradeoff between performance and
robustness of the proposed nonlinear PID control scheme, we 7.8. Performance of N-PID and F-NMPC in the presence of measure-
performed simulation studies for various values of filter time ment noise
constant (lamda). The closed loop responses for step changes in
the setpoint for various values of lamda are shown in Fig. 5(a). The performances of the proposed N-PID and F-NMPC control
The manipulated variable profiles for various values of filter time schemes in the presence of measurement noise are shown in
constants are shown in Fig. 5(b). It should be noted that we have Figs. 7 and 8 respectively. In both the control schemes, Gaussian
used single tuning parameter (lamda) for all the local controllers. white noise of mean zero and standard deviation of 0.0012 mol/l
However, for each local controller appropriate values of filter has been added to the true value of the process variable (reactor
constant can be chosen. As we increase the value of lamda, it was concentration). A digital first order filter has been used to filter
observed that the responses have been found to be of over-damped the noisy process measurement and the control calculations are
282 J. Prakash, K. Srinivasan / ISA Transactions 48 (2009) 273–282
performed based on the filtered value of the process variable, in [5] Prakash J, Senthil R. Design of observer based nonlinear model predictive
case of N-PID and F-NMPC. From the Figs. 7 and 8, the performance controller for a continuous stirred tank reactor. Journal of Process Control
2008;18:504–14.
of both the control schemes has been found to be satisfactory. [6] Dougherty Danielle, Cooper Doug. A practical multiple model adaptive
The mean and the standard deviation of the true value of the strategy for multivariable model predictive control. Control Engineering
measured variable (concentration) for various values of alpha have Practice 2003;11:649–64.
[7] Narendra KS, Balakrishnan J. Adaptive control using multiple models. IEEE
been reported in Table 6. As we reduce the value of alpha, the Transactions on Automatic Control 1997;4(2):171–87.
controller action of both the control schemes has been found to be [8] Wojsznis WK, Blevins TL. Evaluating PID adaptive techniques for industrial
smooth and the standard deviation of the controlled variable has implementation. In: Proceedings of the 2002 American control conference.
2002. p. 1151–5.
been found to be less. [9] Tan W, Marquez HJ, Chen T, Liu J. Multi-model analysis and controller
design for nonlinear processes. Computers & Chemical Engineering 2004;28:
8. Conclusions 2667–75.
[10] Gao Ruiyao, O’dywer Aidan, Coyle Eugene. A Nonlinear PID control for
CSTR using local model networks. In: Proceedings of 4th world congress on
In this paper, the authors have proposed a simple and intelligent control and automation. 2002. p. 3278–82.
straightforward procedure for designing a Nonlinear PID control [11] Galan Omar, Romagnoli, Palazoglu Ahmet. Real-time implementation of multi-
linear model-based control strategies-An application to a bench-scale pH
(N-PID) scheme and Nonlinear Model Predictive Control scheme neutralization reactor. Journal of Process Control 2004;14:571–9.
(F-NMPC) using local linear models for the CSTR process, which [12] Takagi T, Sugeno M. Fuzzy identification of systems and its applications to
exhibits significant variation in the damping factor and un- modeling and control. IEEE Transactions on Systems Man Cybernetics 1985;
15:116–32.
damped natural frequency. From the extensive simulation studies, [13] Kuipers B, Astrom K. The composition and validation of heterogeneous control
it can be concluded that the proposed controllers have good laws. Automatica 1994;30(2):233–49.
setpoint tracking, disturbance rejection capabilities at nominal [14] Aufderheide B, Bequette BW. Extension of dynamic matrix control to multiple
models. Computers and Chemical Engineering 2003;27:1079–96.
and shifted operated points and robustness properties. Further, [15] Tian Z, Hoo KA. Multiple model-based control of the Tennessee–Eastman
the performance of the proposed nonlinear model predictive process. Industrial & Engineering Chemistry Research 2005;44:3187–202.
control scheme using local linear models, has been compared [16] Özkan Leyla, Kothare MV. Stability analysis of a multi-model predictive control
algorithm with application to control of chemical reactors. Journal of Process
with nonlinear model predictive control using an analytical model.
Control 2006;16:81–90.
From the extensive simulation study, it can be concluded that the [17] Krishnapura VG, Jutan Arthur. A neural adaptive controller. Chemical
proposed F-NMPC helps to reduce the number of computations Engineering Science 2000;55:3803–12.
needed, compared to the analytical model based NMPC. The [18] Nahas EP, Henson MA, Seborg DE. Nonlinear internal model control strategy
for neural network models. Computers and Chemical Engineering 1992;
proposed model based control scheme (F-NMPC) can be considered 16(12):1039–57.
as an alternative to analytical model based control scheme (A- [19] Huang YL, Lou HH, Gong JP, Edgar Thomas. Fuzzy model predictive control.
NMPC). IEEE Transaction on Fuzzy Systems 2000;8:5–77.
[20] Babuska R, Verbruggen H. Fuzzy set methods for local modeling and
identification in multi-model approaches to modeling and control. London:
Taylor and Francis Limited; 1997. p. 75–100.
References
[21] Minh Tran, Dimitrios K. Varvarezos Mohamad Nasir The importance of first-
principles model-based steady-state gain calculations in model predictive
[1] Johansen T, Murray-Smith R. Multiple model approaches to modeling and control—a refinery case study. Control Engineering Practice 2005;13(8):
control. London: Taylor and Francis Limited; 1997. 1369–82.
[2] Xue ZK, Li SY. Multi-model modeling and predictive control based on Local [22] Senthil R, Janarthanan K, Prakash J. Nonlinear state estimation using
model networks. Control and Intelligent Systems 2006;34(2):105–12. fuzzy kalman filter. Industrial Engineering Chemistry Research 2006;45:
[3] Arslan E, Camurdan MC, Palazoglu A, Arkun Y. Multi-model scheduling control 8678–8688.
of nonlinear systems using gap metric. Industrial & Engineering Chemistry [23] Panda Rames C, Yu Cheng-Ching, Huang Hsiao-Ping. PID tuning rules for
Research 2004;43:8275–83. SOPDT system: Review and some new results. ISA Transactions 2004;43(2):
[4] Boling Jari M, Seborg Dale E, Hespanha JP. Multi-model adaptive control of a 283–295.
simulated pH neutralization process. Control Engineering Practice 2007;15: [24] Morari, Zafiriou. Robust process control. Englewood Cliffs (NJ): Prentice Hall;
663–72. 1989.