Analysis of CSTR Temperature Control with PID, MPC & Hybrid MPC-PID Controller

. This paper presents an analysis of the continuous stirred tank reactor (CSTR) temperature control with the Proportional-Integral-Derivative (PID) Controller, Model Predictive Controller (MPC) and Hybrid-Model Predictive Controller-Proportional Integral Derivative Controller (MPC-PID). It is the main goal of this project to find a suitable improvement strategy for the system's stability and accuracy to be more stable. By creating a model, the control system is implemented for all the above mentioned control methods and so comparative analysis is carried out to find the best control method for CSTR. Simulation data inspector is used to compare the performance of different types of control systems: PID, MPC and MPC-PID. It has been observed that the hybrid MPC-PID has a more effective control action than a PID controller; with some tuning, the MPC controller can maintain the temperature within a reference or set point range. The control and simulation toolbox is used to construct the model predictive control method in LabVIEW platform. The performance of controllers is measured in terms of settling time, rise time and percentage of overshoot. Finally, a comparative overview of PID, MPC and Hybrid MPC-PID controllers on system performance is presented and discussed.


Introduction
A Continuous Stirred Tank Reactor (CSTR) is a system with an exothermic reactor that exhibits highly nonlinear behavior, for example, the abundance of stable conditions [1].Fig. 1 below shows the system of CSTR.Continuous Stirred Tank Reactors are widely used in the chemical plants and food industries.To test new control algorithms, CSTR is a challenging plant with process variables like reactor temperature and manipulation variables like coolant flow rate.Real reactors, on the other hand, can be dangerous and expensive to operate.As a result of the heating system's high reliance on thermal induction, maintaining precise system control is never easy.Since it's a dynamic, ever-changing system, it is difficult to realize proper control of the system.The most critical aspect of any control system is its design.There are numerous controller kinds, which might be either traditional or intelligent.Model Predictive Control (MPC) is extensively regarded as the industry standard for resolving some of the most difficult control problems encountered in the processing industry.MPC is a very effective optimal control method capable of performing well for nonlinear systems Complex nonlinear systems can pose a challenge for basic PID controllers.Control mechanisms for the CSTR have been developed in this study.PID controllers are well-suited for non-linear process control.Instinctively hybrid MPC-PID systems have maximum applications when the plant goes through transition or shows non-linear behaviour and when the plant structure is unknown [2].The cstr in this project works on chemical and thermal energy and is a composite and dynamic system so the outlet temperature of the liquid in the reactor is constantly changing.The reactor outlet temperature of the liquid should be between 100 o C to 300 o C when it is taken for further processing.

PID controller
Feedback controllers such as proportional-integralderived (PID) controllers are widely employed in a wide range of control applications.Because its primary goal is to keep the process as close as feasible to the desired set point while minimising errors, a PID controller analyses the error between its input process variable and that target value before taking appropriate action to bring the process' error down as low as possible.Actions are taken based on current errors, summation of mistakes, and error conversion rate.The Proportional term replies based on current error.Using these three parameters together, the process can be fine-tuned to achieve the desired outcome.PID's equation is presented below [3].
The PID controller returns a Process Variable (PV), an average of its three corrective terms such as Proportional, Integral and Derivative.

MPC controller
Model predictive control is becoming even more important and widespread because of its ability to handle  2 below describes the receding horizon control approach [4].Due to the inherent complexity of the chemical process it is usually problematic to obtain a precise model.
System dynamics with nonlinear dynamics can only be accurately predicted by using linear dynamic models in the MPC control scheme.System models that can forecast future output values on a defined time horizon, known as the prediction horizon, are explicitly used in model predictive control.

Fig. 2. Receding Horizon Control
The control algorithm is as follows: 1.When a new value of the controlled variable y (t+k) is collected at each sample, it is reported on the prediction interval P (k = 1,... P).This estimate is based on the control variable u (t + k )'s instantaneous values on the control horizon of k = 1,...... M, where M<=P. 2. r (t+k) is the projection of the intended projector to be followed by the system response as a reference point.3. u (t + k) is calculated in a way that reduces the cost function of future actions.4. The plant is subsequently subjected to the optimal control, and the yield is measured.The early phases of the model for subsequent iterations are derived from these data of plant conditions.
The Receding Horizon Strategy dictates that the steps 1 to 4 must be performed at each sample.

Mathematical model of CSTR
The rate of reaction of non linear dynamic model can be given as, where ℜx = Consumption rate of reactant X Total mass balance (kg/s): Component A balance (kmol A/s): Reactor energy balance (J/s): The heat transfer rate of a jacket water system with a jacket temperature Tj is affected by the temperature gradient between the jacket and the surrounding water.
The dynamic model of jacket is For a given density and heat capacity, time derivative in Eqs. ( 4), ( 5) and ( 6) can be taken out of the equations and replaced with the physical parameters (8).The variables Vr and Vj can be eliminated from the derivatives if the reactor volume and the jacket volume remain constant.As a result, equation ( 4) is reduced to, The differential equations ( 5) and ( 6) reduce to the following: .In order to mimic the dynamic response of CSTR, we will employ these two basic equations.Without controllers, the system will behave in a "open loop" manner.There is no change in flow of cold water in this situation.Using the "close loop" method, a temperature controller regulates the flow of cold water into the reactor to keep it at a constant temperature.
To solve these two equations, it is necessary to specify all the parameters and variables except two (C x and Tr).Fig. 3 shows the Simulink model for CSTR system derived from eqn (10) and eqn (11).Table I gives the parameter values for CSTR Model [6].

Simulation & analysis
A controller is a tool for regulating a dynamic system so as to accomplish a desired behavior.The goal is to reduce undershoots and overshoots from the system and generate output signals from systems that are close to the set point value and maintain the accuracy and stability of the system.Control systems for CSTR are designed using a combination of PID, MPC, and MPC-PID.The figure above shows the output response of a PID controlled CSTR system, where we can observe the output temperature equal to the desired temperature and give good accuracy as well as an overshoot of about 21% which is fine but can be / should be reduced for more stability.

Temperature Control using MPC Controller
Fig. 6.Temperature Control using MPC Controller Fig. 7. Output for MPC Controller Fig. 6 shows a Simulink model of the MPC controlled CSTR system.The desired temperature is set at a set-point of 100 o C. The output of the system is shown in Fig. 7.In Fig. 6, we can observe that the output temperature is close to the desired temperature.This gives a difference of about 1.8 o C which is acceptable but not completely accurate.Also, we can observe an overshoot of about 40% which should be reduced for better stability.

Temperature Control using Hybrid MPC-PID Controller
Fig. 8 states the flow chart of the system flow when designing the proposed Hybrid MPC-PID controller [7].MPC controller is fed together to the CSTR system so that the error is minimized.The desired temperature is set at 100 o C. The output response of the hybrid MPC-PID controlled CSTR system is shown in Fig. 10.In Fig. 10, we can observe that the output temperature value is equal to the desired temperature value and given good accuracy as well as we can see that the overshoot is reduced to 9% which is superior to the other two controllers we have seen and discussed previously.So the proposed controller gives better stability than others, as well as if we are concern about rise time and settling time, the given controller gives satisfactory results.As can be seen, the MPC was made to have 10 samples for the prediction and 10 samples for the control.In   In Fig. 15 and 16, the VI has two parts.The first part is to make sure the system is ready for MPC by getting all of the user's MPC parameters.The second stage makes sure that the MPC scheme's control actions work.

Hybrid MPC-PID Controlled CSTR in LabVIEW
Following figures illustrates the proposed Hybrid MPC-PID control scheme for controlling the CSTR temperature in LabVIEW.Fig. 17

Results & conclusion
To analyze the performance of the proposed controller, the system is simulated using MATLAB / SIMULINK.The controller parameter values for the simulation are given in the table below: The primary goal of this analysis was to integrate an MPC and a PID controller in order to manage the outlet liquid temperature of a CSTR and to pick the optimal model using a system identification technique.MPC and PID controllers significantly enhanced performance in our analysis.While the PID controller assisted in maintaining a reasonable level of liquid temperature in the CSTR, the system remained unstable.In order to improve our system's performance and stability, we incorporated an MPC controller together with a PID controller.
The PID controller's design and implementation can be modified to eliminate overshoots and undershoots and to ensure that the output is near to the target set point value.
The MPC controller assisted us in achieving optimal performance for our system by minimising overshoot, rising time, and settling time.MPC can aid in the development of more effective control measures for nonlinear or dynamic systems whose reaction is not stable.
The primary goal of the hybrid MPC-PID design approach and implementation was to determine whether the control system could be enhanced by keeping a stable temperature level.The Hybrid MPC-PID scheme's results demonstrate that performance of the system can be increased with All these schemes are also implemented in LabVIEW.The system has minor fluctuations with PID scheme in real time while MPC has comparatively higher overshoot but Hybrid MPC-PID controller has stable output with comparatively lower overshoot of around 7-8%.Only thing is system requires more settling time in real-time system.For the creation and implementation of MPC controllers, the control and simulation toolbox includes pre-built MPC blocks.
By changing the values of parameters such as feed concentration and feed temperature for the same given system, PID and Hybrid MPC-PID controllers give better results while MPC controller give sluggish and incomplete responses.

F=
Flowrate of feed   = Concentration of reactant X in reactor Vr = Volume of Reactor k0 = Preexponential factor Ae = Activation energy Tr = Reactor Temperature Tc = Coolent Temperature ∆ = Heat of reaction Four nonlinear ordinary differential equations form dynamic model of reactor and jacket [5].

Fig. 4 .
Fig. 4. Temperature Control using PID Controller Fig. 4 above shows a Simulink model of a PID controlled CSTR system.The desired temperature is set at a set-point of 100 o C. The output of the system is given in Fig. 5.

Fig. 8 .
Fig. 8. Block diagram of Hybrid MPC-PID Controller Use the model to predict future plant responses, which are utilised to fine-tune control signals.This new control signal is generated by an internal model, which is based on the prediction horizon (Np) and the system control horizon (Nc).Further tuning and refinement is required before controller performance is considered satisfactory.

Fig. 11
Fig. 11 below shows the Front Panel of PID Controlled CSTR.

Fig. 12
Fig. 12 below shows the Block Diagram of PID Controlled CSTR.As we have discussed earlier in the MATLAB simulation and design of CSTR model, the model of CSTR is presented here in LabVIEW using Control and Simulation Loop with same those equations.In Fig. 12 as we can see, the model is controlled using PID Controller with Tc (Coolant Temperature) as the process variable.

Fig. 12 .
Fig. 12. Block Diagram of PID Controlled CSTR Fig. 13, you can see how controller output constraints and cost function parameters can be set up.As can be seen in the Fig 13, for the given set-point of 100 o C we can observe the real time output of 100 o C with overshoot of around 48% with no fluctuations and maintaining good stability.

Fig. 15 .
Fig. 15.Block Diagram of MPC Controlled CSTR below shows the front panel of Hybrid MPC-PID Controlled CSTR.As we can see in the Fig.17 , for the given set-point of 100 o C we can observe the real time output of 100.5 o C which further reaches to 100 o C smoothly and steadily by the time.With overshoot of around 7 to 8% which is lesser than the conventional PID controlled and MPC controlled methods by maintaining its stability and accuracy to a great extent.

Fig. 17 .
Fig. 17.Front Panel of Hybrid MPC-PID Controlled CSTR Fig. 15 & 16 shows the block diagram of MPC scheme that is explained already in previous method that further connects with PID scheme in fig 18.The Controlled output of MPC and PID together is given to the CSTR plant/model so as to maintain the temperature of reactor as shown in Fig 18.
nonlinear multivariable process models and constraints on inputs, states, and output.It uses open loop restricted optimization of limited horizon criteria for receding horizon control.Fig.

Table 1 .
Parameter values of CSTR model Fig. 3. Simulink Model of CSTR