Design of a feedback linearizing controller for a CSTR reactor

The design of a controller for a chemical reactor was studied. Based on the input-output feedback linearization, the controller was designed for a situation where the output of the system is the concentration. The reaction in the reactor is of the first-order type. First, the reactor is modeled and presented, and then a controller for this system is designed. The control system was implemented in Simulink MATLAB. The simulation results show that the designed controller is able to control the concentration in a wide range and its performance is desirable for changing either the disturbances or the set point.


Introduction
In the chemical industry, there are three kinds of chemical reactors used: Continuous stirred-tank reactors CSTR, packed bed reactors (PBR), and continuous tubular reactors or plug flow reactors (CTR or PFR).Controlling these reactors is usually one of the most problematic cases in the chemical industry units, especially when the reaction is exothermic type (producing heat) with a high reaction rate [1] [2] [3], increasing the temperature by only one degree Celsius can increase the reaction rate by 10% [4].This increase is enough to significantly change the conversion of materials in the reactor and even the efficiency of the reactor [5].
Moreover, in exothermic reactors, an increase in the reaction rate is expected due to a temperature rise that will cause an instability in the response of the reactor unless the heat generated is quickly removed which ensures that the reactor temperature returns to its required value.However, the reactor can be considered perfectly stable when a 10% increase in heat generated corresponds to a 10% increase in heat removed.But if the heat generated is much faster than the heat removed, the reactor becomes unstable, and a control system is required and is very necessary to maintain the desired operating conditions [4] [6].
Continuous stirred-tank reactors (CSTRs) are commonly used for the production of chemicals in the different chemical and food industries.However, controlling this type of controller represents a challenging problem because of the heat effect of the reactions, the nonlinear behavior, the time delay of the responses, etc. [7], where designing and implementing the CSTR controller become more difficult in the case of external disturbance and system uncertainty [8].Since the high non-linearity of the dynamic system, zero dynamics, and relative degrees are the more challenging problems in the controlling CSTR reactor type [9].
In the CSTR reactor, the high nonlinearity appears if the reaction is an exothermic type, and therefore its steadystate behavior is very sensitive to changes in system parameters.Therefore, with this CSTR system, the using of classical control theory and traditional control methods such as PID led to problems such as frequent adjustments of controllers and sometimes instability of the control system due to rapid changes in process parameters [10].PID controller can function properly when the process is operating near its stable equilibrium point.This is a rare case [11] [12], since nearly all chemical processes are inherently nonlinear.Therefore, these problems have led to the development and implementation of nonlinear control strategies for chemical processes by many researchers, where different control approaches have been introduced by many of the research papers that focused on the CSTR system, where many parameters of reaction process were studied as concentration, temperature, reaction rate, and pressure concentration [13].
A model-based controller is urgently needed in these reactors to achieve rapid response and adequate performance, as well as to increase the efficiency and quality of the output product [14].This type of control strategy was applied primarily for time-delayed chemical processes [14], and this has led to extensive research on the design of model-based controllers for chemical processes [1].
Kumar used a single loop of PID controller type based on a dynamical model that coupled inverse response with a double integrating modeling approach where he derived the controller parameters by using internal model controller IMC [15].This approach enhanced the performance of the CSTR controller and gave better results when compared with other works [16].Begum et al. developed an approach for PID controllers of analytical tuning rules as a function of maximum sensitivity, the process was assumed as an unstable case.This approach is applied to two CSTR systems, where the parameters of the controller were derived by of H2 minimization theory and IMC method [6].
A predictive control method with three controllers and three filters was applied by Bhaskaran and Rao for controlling the CSTR reactor [17], where they used the unstable CSTR model for the designed filters and controllers, the predictive method, internal model controller scheme, and a direct synthesis method.The approach has shown better performance compared to other studies [18].
In this paper, a general method for linearizing the input-output feedback of the MIMO system is discussed, and then the control rule for the system is obtained.In order to control a single stage of the CSTR system, the design controlling of the CSTR model was implemented by using MATLAB/SIMULINK and the performance of the CSTR system was shown based on the simulation results.

Modeling of the reactor
In this section, we will model the CSTR reactor.In the reactor, a first-order irreversible exothermic reaction takes place.The reactor is cooled by a coolant flow [19].The inlet temperature of this flow is varied by the controller and the inlet temperature changes along the cooling coil.The reactor model is as follows: Accumulation = Input + Production -Consumption -Output Energy Balance Equation: Since the temperature of the coolant changes along the coil, we first write down the corresponding enthalpy changes for a small element along the coil and determine the temperature distribution of the fluid.The enthalpy changes can then be determined along the entire length of the coil.
To determine the temperature of the coolant flow at the outlet, replace x with the length of the coil: Now we write the energy balance for the system: (5) Equations 1 and 2 now give the following equations for the system: The system equations are made dimensionless with the following definitions: Then, rewrite the above equations as follows: In the above equations, the constants are as follows: Da = 3, β = 1.5, γ = 22.9, H = 2.55, uF = 1 uc is the dimensionless temperature of the cooling jacket, which is the input to the system controller.T0 = 350 K; CA0 = 1 mol/lit; E/R = 10 4 Now define the system in the affine form: x =f(x)+g(x)u y=h(x) The output of the system is considered x1, and the system control is done on it to the output concentration reaches the desired value and the control objective can be achieved.In this paper, a powerful tool is used to analyze nonlinear systems, namely input-output feedback linearization.According to this method, the chemical reactor system is precisely linearized, and then a linear controller is designed for the new system [20].
In this paper, a general method for linearizing the input-output feedback of the MIMO system is discussed, and then the control rule for the system is obtained.Consider the tracking control problem for the following nonlinear system:

𝑦 = ℎ(𝑥)
The objective of the control is to have the system output y(t) follow the desired path yd(t).The first step is to derive the system output to get the control input: If Lgi hj=0, a higher-order derivative must be calculated until the coefficient of u is not zero, yielding the following equation: Thus, in this case, the relative degree of the system is rj, for which we have L gi Lf rj-1 hj≠0.This process can be repeated for all system outputs.Thus: Where we have: If E(x) is a nonsingular matrix, u can be obtained: So a new linear relation is obtained between the output y and the new input v. [ The new output depends only on the new single input, so a unique controller has been designed for each subsystem that can track the output yd(t).

Implementation of the above linearization method on the equations of the CSTR reactor
According to the method proposed in the paper, we first derive from the output until the control input appears in it: In the first derivative, Lgh(x) = 0 and this means that u does not appear in it.Thus, we obtain the higher-order derivative of the output: If we replace x _2 with its equivalent term in the system equation, we have: In this case, Lg Lf h(x)≠0.Thus, the term u appears in the second derivative of the output, and the relative degree of the system is 2, which means that both system variables appear in the output and since the relative degree is equal to the number of system states, the system is the minimum phase and the zero dynamics is irrelevant.In other words, the internal stability of the system is established.Let us now design the controller [23].
We follow the procedure of the article and consider the input coefficient, LgLfh(x), as follows: The linear relationship between the new input and the output is now as follows:

𝑦̈= 𝑣
If we replace y ̈ with its definition for y and rewriting it in terms of uc, we have: We define the new input as follows: Where e = yyd.
k1 and k2 are the adjustable parameters of the controller which change the convergence and the tracking rate.They are chosen from the dynamic error equation, which is as follows: This is a linear differential equation with constant coefficients in the form α 2 + k2α +k1 = 0.The parameters k1 and k2 must be chosen so that the real part of the roots of the equation is on the left of the axis to achieve the convergence objective of the tracking error [21].

Simulation
The scheme of the system implementation in Simulink is shown in Figure 2. The MATLAB block of the first actually function plays the role of the controller; it takes the desired output and the value of the controller parameter and returns the corresponding action control to the system.As you can see from Figure 2, we have considered a physical constraint to control the action that enters the planet, otherwise, the system parameters could not be found [22].

Simulation results
We first consider the desired output value of 0.9 and then examine the effects of the parameters k1 and k2 on the system output [23].

Output concentration changes with time
In the case where yd = 0.9 and enters the controller as a constant block and we want the concentration to reach this desired value, by choosing the values k1 = 1 and k2 = 20, we obtain the concentration output as follows: Figure 3. System output response when the input signal is constant Figure 3 shows that 45 seconds after starting the process, we reached the desired concentration value and the controller was able to achieve the control objective of setting the output to the set value.

Temperature changes with time
The trend of changes in reactor output temperature shows that this controller was able to reach the desired value of reactor output temperature after a certain time.As you can see, the action control is more intense and faster at the beginning, and this action becomes slower with time.Since the reaction is exothermic and a lot of heat is released at the beginning of the reaction, the coolant must be able to absorb this extra heat to avoid damaging the process.From the above figures, it can be seen that the smaller the parameter k2, the shorter the time to reach the desired response.Since the value of the output concentration is often not constant, the output of the control loop must be able to track a specific path, which we examine here to see a sine wave: yd = 0.9 + 0.05sin(t) Figure 8. System output response track to a sinusoidal input signal As shown in the figure above, the system output was able to track the reference signal well.

Conclusion
In this study, the input-output feedback linearizing controller for the processing system of the CSTR reactor was simulated using MATLAB Simulink to reduce the permanent error and increase the temperature stability.The results show that the controller could respond well to changes and eliminate disturbances.

Figure 1 .
Figure 1.Schematic diagram of the CSTR reactor

Figure 2 .
Figure 2. Schematic diagram of the algorithm

Figure 4 .
Figure 4. Trend of reactor temperature changes5.3.Action control changes with time