Modern Control Project
Modern Control Project
30/2/2017 E.C
Table of Contents
Abstract........................................................................................................................................................................ 4
1.1 Introduction:.........................................................................................................................................................4
1.2 Problem of Statement..........................................................................................................................................5
1.3 General Objective..................................................................................................................................................5
1.4 Specific objective.....................................................................................................................................................5
1.5 Scope of the Project.................................................................................................................................................5
1.6 significance of project..............................................................................................................................................5
1.7 Limitations of the Project.........................................................................................................................................6
2. Literature Review......................................................................................................................................................6
2.1 Resistance and Capacitance of Liquid-Level Systems: -...........................................................................................6
2 .2 .Design of servo controller for two tank system....................................................................................................9
2.3 Design of observer and state feedback controller for two tank system...............................................................19
Conclusion.................................................................................................................................................................29
Reference: -...............................................................................................................................................................31
Abstract
The industrial application of Coupled Tank System (CTS) is widely used especially in chemical process
industries. The control of liquid level in tanks and flow between tanks is a problem in the process
technologies. An effort is made to keep the liquid level in the second tank constant. So, to have such
control over this process coupled tank system is mathematically modeled, state feedback constant K is
evaluated from desired performance characteristics such as percentage overshoot, settling time and
steady state error. The same way an observer constant gain K e is evaluated from the desired
performance characteristics. MATLAB is used to simulate and display the performance of the control
system. Finally, electronic design of the control system is done.
1.1 Introduction:
Liquid level control is needed in various industrial applications, e.g., in food processing, water
purification systems, filtration, pharmaceutical industries, etc. is well known that the state coupled two-
tank liquid level system. The state space approach is a generalized time domain method for modeling,
analyzing and designing a wide range of control systems and is particularly well suited to digital
computational technique.
In this project we shall present design methodology of closed loop control in state space domain
using state feedback gain matrix and observer gain matrix. This concept of technique is called pole
placement technique. It will be shown that if the system is completely state controllable and observable.
Design a servo controller for two tank system as well as design an observer and state feedback controller
for two tank system are presented below.
In many industrial applications, maintaining the appropriate liquid level in tanks is crucial for
operational efficiency and safety. Traditional methods of liquid level monitoring are often manual,
leading to inaccuracies, spills, or equipment damage. This project aims to develop an automated liquid
level control system that utilizes sensors and microcontrollers to provide precise control and monitoring
of liquid levels, thereby reducing human error and improving system reliability.
To design and implement an automated liquid level control system that ensures accurate
monitoring and control of liquid levels in storage tanks using modern sensing and control
technology
To investigate different types of sensors suitable for liquid level measurement (e.g., ultrasonic,
capacitive, float switches).
To design a microcontroller-based control system for processing sensor data and controlling
pumps or valves.
To develop a user interface for monitoring and controlling liquid levels in real-time.
To test and evaluate the performance of the developed system under various conditions to
ensure reliability and accuracy. Technology
The project will focus on a specific type of liquid (e.g., water or a similar non-corrosive
liquid) and may not account for corrosive or hazardous liquids.
The system may have limitations in scalability and may require modifications for large
industrial applications.
Environmental factors such as temperature variations may affect sensor accuracy and
system performance.
The prototype will not include advanced features such as remote monitoring or integration
with existing industrial systems
2. Literature Review.
Liquid Level Measurement Techniques: Review of existing literature on various liquid level
measurement technologies, such as float sensors, capacitive sensors, and ultrasonic
sensors, highlighting their advantages and disadvantages.
Control System Design: Overview of control theory as applied to liquid level systems,
discussing PID control and other control strategies used for maintaining desired liquid
levels.
Consider the flow through a short pipe connecting two tanks. The resistance R for liquid flow in such
a pipe or restriction is defined as the change in the level difference (the difference of the liquid levels of
the two tanks) necessary to cause a unit change in flow rate; that is: -
The capacitance C of a tank is defined to be the change in quantity of stored liquid necessary to
cause a unit change in the potential (head). The potential is the quantity that indicates the energy level
of the system.
The capacity (m3) and the capacitance (m2) are different. The capacitance of the tank is equal to its
cross- sectional area. So, as the cross-sectional area of tanks is constant, the capacitance is constant
whatever the head is.
The state variables are height of tank-1 h1 and height of tank-2 h2. The output is the height of tank-2 h2.
For
𝑑ℎ1
tank-1: -
𝑞𝑖𝑛 − 𝑞1
𝑑𝑡
= 𝐴1
=2
ℎ1−ℎ
𝑑ℎ1
Since : -
�
𝑞1
�1
ℎ1 − ℎ2
𝑞𝑖𝑛 − =
� 𝐴1 𝑑𝑡
�
1
∴ = − � 𝐴1
𝑑𝑡 𝐴
�
1
𝑅2
For S
tank-2: - ince :
𝑞𝑜
-
=
ℎ2
𝑞1 − 𝑞𝑜
= 𝐴2
𝑑ℎ2
𝑑𝑡
(ℎ1−ℎ2)
−
ℎ2 =
𝐴
𝑑ℎ2
𝑅1 2 𝑑𝑡
𝑅2
Therefore, the state space representation the above two interacting tank system is given by: -
− 1 1
1
[1 ]
�
ℎ
( ℎ1 ] + [𝐴1]
�
]𝑅𝐴
1 1 21 𝑅1 [ 𝑞𝑖 0
�𝑡
)
𝐴1
ℎ2
𝑦 = ℎ2 ℎ1
= [0 1] [ ]
ℎ2
Assuming: - 𝑅1 = 4, 𝑅2 = 8, 𝐴1 = 1, 𝐴2 = 0.5
𝑑ℎ1
−0.25 0.25 ℎ1 1
[𝑑ℎ ] = [ ] [ ] +[ ]𝑞
𝑑𝑡
0.5 −0.75 0 𝑖
2
𝑑
𝑡 ℎ2
𝑦 = [0 1]
= ℎ2 ℎ1
[ ]
ℎ2
Fig. Servo
system
Department of electro mechanical engineering
Assume that the reference input (step function) is applied at t = 0. Then, for t > 0, the system
dynamics can be described by Equations: -
𝑿̇ = 𝑨𝑿 + 𝑩𝑼 = (𝑨 − 𝑩𝑲)𝑿 + 𝑩𝑲𝟏𝒓
Whether the given system is controllable or not can be determined by checking the rank of the
controllability matrix. if the rank of the controllability matrix is equal to n (or in our case 2) or if
determinant of this matrix is different from zero, then the system is controllable.
𝑀𝑐 = [B ⋮ AB]
𝐴𝐵 = [
−0.25 0.25 ] ∗ [1]
0.5 −0.75 0
−0.25
𝐴𝐵 = [0.5 ]
1 −0.25]
Now: -
∴ 𝑀𝑐 = 0[ 0.5
|𝑀𝑐| = 0.5 ≠ 0
Since the determinant of the above controllable matrix is different from zero means that the rank is
full, hence the system is controllable.
𝐾 = [𝐾1 𝐾2]
We can obtain the feedback gain K by equating the determinant of |SI-(A-BK)| with the desired
characteristics polynomial equation. (i.e. using direct substitution method)
𝑆 0 −0.25 0.25 1
[𝑆𝐼 − (𝐴 − 𝐵𝐾)] = [ ]−([ ] − [ ] ∗ [𝐾1 𝐾2]) = 0
0 𝑆 0.5 −0.75 0
𝑆 + (𝐾1 + 0.25) 𝐾2 − 0.25
𝑑𝑒𝑡 [ −0.5 𝑆 + 0.75 ]=0
Step-3: - The desired location of closed loop poles is selected based on the required performance of the
system. Performance requirements are chosen as follow: -
𝜔𝑛
�
%𝑜𝑠 15
So now we can find the damping ration and natural frequency to get the desired closed-loop poles.
(− ln ( )) (− ln ( ))
100 100
⇒𝜁 = =
%𝑜𝑠 2
15 2
√(𝜋2 + (lN ( )) ) √(𝜋2 + (ln ( )) )
100 100
𝜻 = 𝟎. 𝟓𝟐
4 4
⇒ 𝜔𝑛 = =
𝜁 𝑇� 0.52 ∗ 1.5
𝝎𝒏 = 𝟓. 𝟏𝟔
⇒ 𝑆2 + 2𝜁𝜔𝑛𝑆 + 𝜔𝑛2 = 0
𝑲𝟏 = 𝟒. 𝟒 𝑲𝟐 = 𝟒𝟔. 𝟓𝟑
𝑋̇ = 𝐴𝑋 + 𝐵𝑈 = (𝐴 − 𝐵𝐾) + 𝐵𝐾1𝑟
𝑑ℎ1
−4.6500 −46.2845 ℎ1 46.5345
[ 𝑑𝑡
] 2= [ ] [ ] +[ ]𝑟
𝑑ℎ 0.5 −0.75 ℎ2 0
𝑑𝑡
ℎ1
= [0 1] [ ]
ℎ2
Department of electro mechanical engineering
MATLAB program: -
% Design of servo controller for two tank
system A=[ -0.25 0.25;0.5 -0.75];
B=[1;0];
C=[0 1];
D=[0];%by assuming R1=4, R2=8, C1=1, C2=0.5
eig(A); %stability test
[n,d]=ss2tf(A,B,C,D);
plant_G=tf(n,d);%plant transfer function
Mc=ctrb(A,B);
rank(Mc); %check the controllability
COMPUTER RESPONSE: -
ans =
-0.0670
-0.9330 since all the eigen values are negative, our system is stable
n =
0 0 0.5000
d =
plant_G =
0.5
s^2 + s + 0.0625
Mc =
1.0000 -0.2500
0 0.5000
ans =
Pc =
K =
4.4000 46.5345
Acl =
-4.6500 -46.2845
0.5000 -0.7500
Bn =
46.5345
0
plant_controlled =
A
=
x1 x2
x - -
Department of electro mechanical engineering
1 4.65 46.28
dx/dt = Ac x + Bc q
y = Cc x
To find the time solution, we solve the homogeneous system (assuming no input initially, i.e., q
= 0).
The general solution for the state vector x(t) = [h1(t), h2(t)]^T is given by:
1. Eigenvalues of A:
The eigenvalues of A are the roots of the characteristic polynomial s^2 + 0.5s + 0.125 = 0:
s = -0.25 ± 0.25i
x(t) = e^(-t / 4) * [[cos(t / 4), sin(t / 4)], [-sin(t / 4), cos(t / 4)]] * x(0)
This provides the time evolution of h1(t) and h2(t) in response to the initial conditions. If there is a c
continuous input q(t), a particular solution must also be added to this homogeneous solution.
x2 0.5 -0.75
B =
u1
x1 46.53
x2 0
C =
x1 x2
y1 0 1
D =
u1
y1 0
2.3 .Design of observer and state feedback controller for two tank system
𝑑ℎ1
−0.25 0.25 ℎ 1
[𝑑ℎ ] =[ ] [ 1] + [ ] 𝑞
𝑑𝑡
0.5 0 𝑖
−0.75
2
𝑑
𝑡 ℎ2
𝑦 = [0 1]
= ℎ2 ℎ1
[ ]
ℎ2
Since we already know that the system is controllable, we can only check its observability here.
Whether the given system is observable or not can be determined by checking the rank of the
observability matrix. if the rank of the observability matrix is equal to n (or in our case 2) or if the
determinant of this matrix is different from zero, then the system is state observable.
𝐶
𝑀 =[ ]
𝐶𝐴
−0.25 0.25 ]
�
𝐶𝐴 = [0.5000 −0.7500]
N
0 1
∴ 𝑀𝑜 = [ ]
ow: -
0.500 −0.7500
|𝑀𝑜| = −0.5 ≠ 0
Since the determinant of the above observability matrix is different from zero means that the rank is full,
therefore the system is state observable as well as controllable.
we have already found the state feedback gain from the servo-controller design, assuming the
performance parameters: -
= 1.5𝑠𝑒𝑐
𝑇 =
Settling time: -
4
�
�
𝜔𝑛
Steady state error: - less than 1%
We can obtain the feedback gain Ke by equating the determinant of |SI-(A-KeC)| with the desired
−0.75
𝑆 + 0.25 𝐾𝑒1 −
0.25
𝑑𝑒𝑡 [ ]=0
−0.5 𝑆 + (𝐾𝑒2 + 0.75)
Step-4: - Choosing the observer desired closed loop location at (S=-10) with a multiplicity of two.
⇒ (𝑆 + 10)(𝑆 + 10) = 0
190.375
�
=[ ]
�
Therefore, 𝐾
𝑒1
19
=[
�
�𝑒2
�
The dynamics of the observed-state feedback control system just designed can be
described by the following equations. For the plant: -
𝑑ℎ1
−0.25 0.25 ℎ1 1
[𝑑ℎ ] =[ ] [ ] +[ ]𝑞
𝑑𝑡
𝑦 = ℎ2
2
𝑑
𝑡
0.5 −0.75 0 𝑖
ℎ2
ℎ1
= [0 1] [ ]
ℎ2
Department of electro mechanical engineering
𝑑̃ℎ1
−0.25 0.25 190.375
ℎ̃
[ 𝑑𝑡 ] =[ [ ]−[ ]∗
1 𝑦 ] + [190.375]
[0 1] − [ ] ∗ [4.4 46.53]] [
0.5 −0.75 ̃ 19
�̃ 19 0
�
ℎ2
� �
�𝑡 �̃ℎ1 ℎ̃
−4.6500
𝑑𝑡 [ −236.6595 1
]+
190.375 ]𝑦
]= [
0.5 ̃ 19
�̃ ][
−19.7500
�
ℎ2
𝑑𝑡
ℎ̃
⇒ 𝑢 = −𝐾 [ 1
]
̃
2
ℎ̃
𝑢 = −[4.4 46.53] [ 1]
̃
2
𝒖(𝑺)
−𝒀(𝑺) = 𝑲(𝑺𝑰 𝑪 + 𝑩𝑲)−𝟏𝑲𝒆
− 𝑨 + 𝑲𝒆
𝑆 + 4.25 190.375
] []
−1
[ 236.66
] = 4.4 46.53 [
−0.5 𝑆 + 19.75 19
=
1721.82𝑆+5299.74
𝑆𝟐+24𝑆+210.2
MATLAB program: -
% Design of observer and state feedback controller for two tank
system A=[ -0.25 0.25;0.5 -0.75];
B=[1;0];
C=[0 1];
D=[0];%by assuming R1=4, R2=8, C1=1, C2=0.5
eig(A) %stability test
[n,d]=ss2tf(A,B,C,D);
plant_G=tf(n,d); %plant transfer function
Mc=ctrb(A,B);
Department of electro mechanical engineering
Mo=obsv(A,C);
rank(Mo); %check the observability
plant_control=ss(Acl,B,C,D);
step(plant_control) % Step response of controlled system
open_loop_tf=Obsv_Ctrb_G*plant_G;
M=feedback(open_loop_tf,1); %closed loop transfer function
COMPUTER RESPONSE: -
ans =
-0.0670
-0.9330
plant_uncontrolled =
A
= x x2
1
x - 0.
1 0.25 25
x 0 -
2 .5 0.75
B
u1
=
x 1
1
x 0
2
C
= x1
x2
y 0 1
1
Department of electro mechanical engineering
D =
u1
y10
n =
0 0 0.5000
d =
plant_G =
0.5
s^2 + s + 0.0625
Mc =
1.0000-0.2500
0 0.5000
ans =
K =
4.400046.5345
Mo =
0 1.0000
0.5000-0.7500
ans =
Ke =
190.3750
19.0000
Department of electro mechanical engineering
num =
1.0e+03 *
0 1.7218 5.2997
den =
1.000024.4000 210.1673
Obsv_Ctrb_G =
1722 s + 5300
860.9 s + 2650
M =
860.9 s + 2650
Fig. Simulink model of observer and state feedback controller design for two tanks
system
Conclusion
As we have observed from the simulation and result, tank-2 settling time is 1.5 sec and tank-1
settling time is 1.76 sec which is less than the tank-1. This implies that tank-2 reaches its steady state
before tank- 1 did which means tank-2s response is faster and gets filled first.
43 | P
age
Reference: -
Norman S. Nise,” modeling in time domain,” in control systems engineering, 6th edt,
California state polytechnic, panama, 2011, pp. 117-161
Norman S. Nise,” improving steady state error and transient response,” in control systems
engineering, 6th edt, California state polytechnic, panama, 2011, pp. 663-680
Katsuhiko ogata,”design of control systems in state space,” in modern control engineering,
4th
edt, university of Minnesota, 2002, pp. 826-910
Google.com/electronic design for feedback and observer controller