Control Lab Project Report
Control Lab Project Report
Project Title:-
MATLAB-Simulink model of the liquid level
control system with PID controller.
Subject:-
Linear Control System
2
Supervised By:-
Sir Adnan Rasheed
Group Members:-
Danyal Qamar (BEET-023R19-08)
Areeb Waqar (BEET-0223R19-09)
M Umair Altaf (BEET-023R19-10)
Department:-
BSc Electrical Engineering
Semester:-
5th
3
1:-Introduction
MATLAB:
MATLAB is a proprietary multi-paradigm
programming language and numeric computing environment
developed by Math Works. MATLAB allows matrix
manipulations, plotting of functions and data, implementation of
algorithms, creation of user interfaces, and interfacing with
programs written in other languages. It is a programming
platform designed specifically for engineers and scientists to
analyze and design systems and products that transform our
world. The heart of MATLAB is the MATLAB language, a
matrix-based language allowing the most natural expression of
computational mathematics.
5
Simulink:
Simulink is a MATLAB-based graphical programming
environment for modeling, simulating and analyzing multi domain
dynamical systems. Its primary interface is a graphical block
diagramming tool and a customizable set of block libraries.
PID Controller:
“The PID controller is by far the most common control
algorithm. Most feedback loops are controlled by this algorithm or
minor variations of it. It is implemented in many different forms, as a
stand-alone controller or as part of a DDC (Direct Digital Control)
package. Many thousands of instrument and control engineers
worldwide are using such controllers in their daily work.
8
Where:
Pout: Proportional term of output
Kp: Proportional gain, a tuning parameter
Ki: Integral gain, a tuning parameter
Kd: Derivative gain, a tuning parameter
e: Error = SP − PV
t: Time or instantaneous time (the present)
MV: Manipulated variable
Feedback Control:
The success of feedback control is because this system makes
everything faster, more precise and less sensitive to disturbances. The
open loop control, regarding its simplicity, it’s only advised in system
9
when the outputs and inputs are known and in which there is no
disturbance associated.
In system with feedback control there is a big disadvantage which
is the probability of the system get unstable, for that the correct
controller must be chosen, and it must be perfect for the system that is
being monitored.
The basic structure of conventional feedback control systems is
using a block diagram representation. The purpose is to make the
variable y follows the Set-point r. For that, the variable u is manipulated
at the command of the controller. The variable d is considered as
disturbances. The disturbance may be any factor that influences the
process variable.
Integral term:
The integral influence is proportional to the variation of the
error on time. The integral term is given by:
The most important benefit is that this term eliminates the steady-state
error, but it has a disadvantage which is the fact that the stability of the
system is affected to. Regarding the upper equation we can conclude that
this integral term depends on pass values of the error
Derivative term:
The derivative term is proportional to the rate of change of the
error, as we can see on the equation below.
The derivative term is given by:
11
The liquid level control system has been modeled taking into account
the change in the liquid level, which results from the difference between
the inlet flow rate and outlet flow rate of the liquid in the tank.
The characteristic equation of the obtained transfer function,
simply the denominator of this function, is first order. Therefore, the
dynamic behavior of the system is defined in form of time constant.
When the calculated the resistance of the liquid level system R and the
16
APPLICATION:
The liquid level set whose experimental setup has been constituted on a
prototype and its DAQs are shown in Fig.
Figure: (a) The liquid level control system with computer-controlled and (b)
DAQs
communication protocol is used to transfer the data from the DAQ cards
to the PC. The DAQ cards are fed by Mean weal power supply of 24 V
DC and 100 W. The computer-based PID control algorithm is carried
out over the DAQ SCADA program developed by the authors.
The liquid level in the tank is sensed through Foxboro
differential pressure transmitter. The transmitter has a measurement
range of 0-6.6 kPa. The high pressure input of the transmitter PH is
connected to the bottom side of the cylindrical tank
PH = Patm+ Pliquid
Also, the low pressure input of the transmitter PL is left open to
the atmospheric pressure
PL = Patm
Since both the top of the tank and the low pressure input of the
transmitter are left open to the atmospheric pressure, the transmitter
output changes depending on the height of the liquid level in the tank
Pdifference =PH – PL = Pliquid
Water is used as the process variable to be controlled in the
system. The specific gravity of water is about 998.2 kg/m3 at 1 atm and
20°C. The laboratory temperature, in which there exists the experimental
set, is about 20°C.
18
Sum:
The Sum block performs addition or subtraction on its inputs. The
Add, Subtract, Sum of Elements, and Sum blocks are identical blocks.
This block can add or subtract scalar, vector, or matrix inputs. It can also
collapse the elements of a signal and perform a summation.
19
Gain:
The Gain block multiplies the input by a constant value (gain).
The input and the gain can each be a scalar, vector, or matrix.You
specify the value of gain in the Gain parameter.
The Multiplication parameter lets you specify element-wise or matrix
multiplication. For matrix multiplication, this parameter also lets you
indicate the order of the multiplicands.
Integrator:
The Integrator block outputs the value of the integral of its input signal
with respect to time. Simulink treats the Integrator block as a dynamic
system with one state. The block dynamics are given by:
x(t)y(t)=u(t)=x(t) x(t0)=x0
u is the block input.
y is the block output.
x is the block state.
x0 is the initial condition of x.
20
Derivation:
The Derivative block approximates the derivative of the input
signal u with respect to the simulation time t. You obtain the
approximation of
du/dt,
By computing a numerical difference Δu/Δt, where Δu is the change in
input value and Δt is the change in time since the previous simulation
(major) time step.
ADD:
The Sum block performs addition or subtraction on its inputs.
This block can add or subtract scalar, vector, or matrix inputs. It can also
collapse the elements of a single input vector.
You specify the operations of the block with the List of Signs parameter.
Plus (+), minus (-), and spacer (|) characters indicate the operations to be
performed on the inputs.
21
Transfer function:
The Transfer function block models a linear system by a
transfer function of the Laplace-domain variable s. The block can model
single-input single-output (SISO) and single-input multiple-output
(SIMO) systems.
Scope:
The Scope block displays its input with respect to simulation
time. The Scope block can have multiple axes (one per port); all axes
have a common time range with independent y-axes. The Scope allows
you to adjust the amount of time and the range of input values displayed.
You can move and resize the Scope window and you can modify the
Scope's parameter values during the simulation.
23
4:-Process
The process to make liquid level control system with PID controller is
described below step by step:
Open the Simulink library in MATLAB.
Then we add our required components from library to our workspace.
These components are:
Step
Sum
Gain(kp)
Gain(ki)
Gain(kd)
Integrator
Derivative
Add
Transfer function
Scope
Then connect all the components.
After connecting all the components run the program.
Then the output graph shows on new window.
Then we find the step response, pole zero’s map, bode plot, impulse
response.
24
5:-Final Circuit
The final circuit that we have designed using Simulink is given below
25
6:-Outputs
The outputs that we obtained from our projects are explained
below according to their graph.
Step response:
Impulse response:
Bode diagram:
28
7:-Conclusion
In this study, modeling and application of a computer
controlled liquid level tank system was executed for practical
applications of conventional PID control method. The results of the
experimental studies were clearly carried out the fundamental control
algorithms on the liquid level process. By means of the DAQ-SCADA
software containing a visual and flexible interface, the process could be
controlled by the computer-based control structures and analyzed under
the different operating conditions in detail.
For next studies, other control algorithms would be
applied on the installed liquid level process. Then the results of these
algorithms would be compared with each other as simulation results and
experimental results.