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
Our control objective is to control the fluid level
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
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
(3)
where
(4)
And finally, we obtain
(5)
Next, we take the first derivative of the error equation (2)
(6)
Since
(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
By increasing the parameter
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.