In this control engineering, process control, and control theory tutorial, we explain how to use feedback linearization to design a controller for controlling the fluid level in a tank or a reservoir. We will come up with a very elegant control algorithm that does not rely upon classical linearization that depends on computing the partial derivatives. Instead, we will design a control algorithm that will cancel the nonlinearities in the system. After the nonlinearities are canceled, we can use the classical linear control theory to design a controller. In fact, the controller will be nonlinear, however, the closed-loop system will become linear. This relatively simple but effective idea can be generalized to systems of tanks connected with each other and to several tanks controlled by several pumps. The feedback linearization approach has a number of advantages over the classical PID control. The most important advantage of this control algorithm is that it is global and it can guarantee asymptotic stability across a very large range of states and control inputs. On the other hand, the PID controller with fixed parameters usually does not perform well over a large range of states and control actions. It has to be tuned for specific and narrow ranges of states and control actions. However, the main disadvantage of feedback linearization is that it requires precise knowledge of the model parameters.
In this control tutorial, we also explain how to implement and simulate a feedback linearization controller for fluid level control in Simulink and MATLAB.
The YouTube tutorial accompanying this webpage is given below.
Problem Description and Feedback Linearization
We consider a tank filled with an incompressible fluid shown below.
We consider a tank with a cross-section area of A filled with an incompressible fluid. The fluid level at the time instant is . The input (volumetric) flow rate to the tank is denoted by . The output (volumetric) flow rate of the tank is denoted by . We assume that the output flow is passive (not actively controlled). We assume that the cross-section of the hole is much smaller than the cross-section A of the tank. We assume that we can control the input flow rate . This input flow rate is created and delivered by a pump.
Our control objective is to control the fluid level . Let the desired fluid level be denoted by . This is the set point for our control algorithm. The goal of the control algorithm is to make the actual fluid level to be as close as possible to the desired fluid level . We assume that the fluid level can be measured by using the fluid level sensor.
In our previous tutorial given here, we derived a nonlinear model of the fluid level inside of the tank. The nonlinear differential equation is given by
(1)
where is a constant that depends on the discharge constant and the gravitational acceleration constant.
The first step in deriving the feedback linearization algorithm is to define the control error. The control error is defined by the following equation
(2)
The goal of the control algorithm is to drive the control error as close as possible to zero. The control input that cancels the nonlinearity in (1) is defined as follows
(3)
where is a control parameter that is selected by the user. By substituting (3) in (1), we obtain
(4)
And finally, we obtain
(5)
Next, we take the first derivative of the error equation (2)
(6)
Since is constant, we have that . Consequently, from (6), we have
(7)
By substituting (5) in (7), we obtain
(8)
This equation represents the error dynamics. The last equation represents the closed loop dynamics. It should be observed that the closed-loop dynamics does not depend on the nonlinear terms. That is, the closed-loop dynamics is completely linearized despite the fact that the original system is nonlinear. The control algorithm (3) cancels the model nonlinearities. Also, it should be observed that the control algorithm is nonlinear, and the closed-loop system is linear!
From the equation (8), we can observe that for any positive value of , the closed-loop system is asymptotically stable.
By increasing the parameter we can have a faster convergence of the control error (faster response of the closed loop system). However, from (3) we can see that the larger values of produces a larger value of the control input. Due to the actuator saturation, this is not desirable. There should be a trade-off between the speed of convergence (response) and how large is the control input.
The block diagram of the feedback control system is shown below. This block diagram helps us to implement the control algorithms in Simulink and MATLAB. In this block diagram, we added a saturation and limit block. This block models the fact that a pump cannot produce a negative flow rate and that a pump cannot produce an infinite flow rate. That is, the flow rate is between 0 and some maximum value of the flow rate that the pump can physically deliver.