You are on page 1of 19

Faculty of Engineering and Quantity Surveying

(FEQS)
EEE 2117 Introduction to Control Systems

Lab Report
Experiment 1: Setting Up a Control Problem

Name : Risci Taran


ID : I16010376
Program : DMEI
Course Code : EEE2117
Session : AUG 2018
Lecturer : Dr. Jeyagopi Raman

1
Table of Content

No. Title Page

Introduction 3-5

1.

Results 6-10

2.

3. Discussion 11-17

4. Conclusion 17

5. References 17

2
Objectives
1. To explore the fundamental functions of a MATLAB and the basics of MATLAB
programming.
2. To understand the process of block diagram reduction and create transfer function,
convert transfer function to state space and vice versa and solve the transfer function of
the block diagram using various build in command.

Theory
When a number of elements are combined together to form a system to produce desired output
then the system is referred as control system. As this system controls the output, it is so referred.
Each element connected to the system has its own effect on the output. A control system is a
system of devices or set of devices, that manages, commands, directs or regulates the behavior of
other devices or systems to achieve desired results. There are various types of control system but
all of them are created to control outputs. There are two main types of control systems​ :
➢ Open loop control system
➢ Closed loop control system

1. Open loop control system


A control system in which the control action is totally independent of output of the system then it
is called open loop control system. Manual control system is also an open loop control system. In
open loop control systems, output is not fed-back to the input. So, the control action is
independent of the desired output.

Examples of Open Loop Control Systems is Automatic Washing Machine This machine runs
according to the pre-set time irrespective of washing is completed or not.

3
2. Closed loop control system
Control system in which the output has an effect on the input quantity in such a manner that the
input quantity will adjust itself based on the output generated is called closed loop control
system. Open loop control system can be converted in to closed loop control system by providing
a feedback. This feedback automatically makes the suitable changes in the output due to external
disturbance. In this way closed loop control system is called automatic control system.

The block diagram of closed loop control system in which feedback is taken from output and fed
in to input.
Examples of Closed Loop Control System is An Air Conditioner. An air conditioner functions
depending upon the temperature of the room.

The main feature of control system is, there should be a clear mathematical relation between
input and output of the system. When the relation between input and output of the system can be
represented by a linear proportionality. In this subject, we will be converting the actual diagram
into model diagram to find equations to check for the stability of a system. By finding the
equations we can change the input and processing values to get a desired output. Since it is
mainly consist of calculation it will be reliable to use ​MATLAB​ software when it comes to solve
the equations.

MATLAB is a fourth-generation programming language and numerical analysis environment.


Uses for MATLAB include matrix calculations, developing and running algorithms, creating
user interfaces (UI) and data visualization. A function is a group of statements that together
perform a task. In MATLAB, functions are defined in separate files. The name of the file and of
the function should be the same. Functions operate on variables within their own workspace,

4
which is also called the local workspace, separate from the workspace you access at the
MATLAB command prompt which is called the base workspace. Functions can accept more than
one input arguments and may return more than one output arguments. MATLAB is used in every
facet of computational mathematics. Following are some commonly used mathematical
calculations where it is used most commonly :
➢ Dealing with Matrices and Arrays
➢ 2-D and 3-D Plotting and graphics
➢ Linear Algebra
➢ Algebraic Equations
➢ Non-linear Functions
➢ Statistics
➢ Data Analysis
➢ Calculus and Differential Equations
➢ Numerical Calculations
➢ Integration
➢ Transforms
➢ Curve Fitting
➢ Various other special functions

Following are the basic features of MATLAB :


It is a high-level language for numerical computation, visualization and application development.
It also provides an interactive environment for iterative exploration, design and problem solving.
It provides vast library of mathematical functions for linear algebra, statistics, Fourier analysis,
filtering, optimization, numerical integration and solving ordinary differential equations.
It provides built-in graphics for visualizing data and tools for creating custom plots.
MATLAB's programming interface gives development tools for improving code quality
maintainability and maximizing performance. It provides tools for building applications with
custom graphical interfaces. It provides functions for integrating MATLAB based algorithms
with external applications and languages such as C, Java, .NET and Microsoft Excel.

5
Results

No. Command Output


1.3.1 >> y=(3*(4)+(4^2)-6)/(6^(1/2)+pi) y=
(a)
3.9348
(b) >> y=(4*7+8)^2/(sqrt(7)+3^(1/4)) y=

327.1219
1.3.2 >> A=[-5 1 0;0 -2 1;0 0 1] A=
(a)
-5 1 0
0 -2 1
0 0 1

>> B=[0;0;1] B=

0
0
1

>> C=[-1 1 0] C=

-1 1 0

>> D=[0] D=

>> x=inv(A)*B x=

0.1000
0.5000
1.0000
(b) >> y=C*inv(A) y=

0.2000 -0.4000 0.4000

6
1.3.3 >>n=1
(a) >>d=[1 4 1]
>>margin(n,d)

(b) >>n=[20 20]


>>d=[1 8 3]
>>margin(n,d)

7
1.3.4 >> z1=10+i*12 ans =
(a) >> z2=3+i*4
>> z3=i*9 -18.0000 +76.0000i
>> z1*z2

(b) >> (z1*z3)/z2 ans =

1.4400 +28.0800i
(c) >> z3*conj(z1) ans =

1.0800e+02 + 9.0000e+01i
1.3.5 >> y1=log10(20)+exp(-2)+tan(pi/6) y1 =
(a)
2.0137
(b) >>y2=(exp(3)*log10(5)*4^5)/(7*cos(pi y2 =
/3))
4.1075e+03
1.4.1 >>n= [5]; A=
(a) >>d= [1 4 5];
>> tf(n.d) -4 -5
>>[A,B,C,D]=tf2ss(n,d) 1 0

B=

1
0

C=

0 5

D=

>>[n,d]= ss2tf(A,B,C,D); ans = 5


>>tf(n,d)
-----------------
s^2 + 4 s + 5

8
(b) >>n= [8]; A=
>> d= [1 5 6 4]; -5 -6 -4
>> tf(n.d)
1 0 0
>>[A,B,C,D]=tf2ss(n,d)
0 1 0

B=
1
0

C=

0 0 8

D=

>>[n,d]= ss2tf(A,B,C,D); ans =


>>tf(n,d) 8
--------------------------
s^3 + 5 s^2 + 6 s + 4

(c >>n= [1 1]; A=
>>d= [ 1 4 8 9]; -4 -8 -9
>> tf(n.d) 1 0 0
>> [A,B,C,D]=tf2ss(n,d) 0 1 0
B=
1
0
0
C=
0 1 1
D=
0

[n,d]= ss2tf(A,B,C,D); ans =


tf(n,d) s+1
--------------------------
s^3 + 4 s^2 + 8 s + 9

9
1.4.2 >> n1=10; ans =
(a) >>d1=1;
>>n2=1; 10 s^2 + 80 s + 220
>>d2=[1,0]; ---------------------------------
>>n3=1; s^3 + 73 s^2 + 310 s + 1000
>>d3=[1,3];
>>n4=[1,4]; Continuous-time transfer function.
>>d4=[1,10];
>>n5=4;
>>d5=1;
>>n6=10;
>>d6=1;
>>n7=conv(n1,n2);
>>d7=conv(d1,d2);
>>[n8,d8]=feedback(n7,d7,n5,d5,+1);
>>[n9,d9]=parallel(n3,d3,n4,d4);
>>n10=conv(n8,n9);
>>d10=conv(d8,d9);
>>[n11,d11]=feedback(n10,d10,n6,d6)
;
>>tf(n11,d11)

(b) >> ans =


[n12,d12]=feedback(n1,d1,n5,d5,+1);
>> [n13,d13]=parallel(n2,d2,n12,d12); -10 s + 39
>> tf(n13,d13) ----------
39 s

Continuous-time transfer function.

10
Discussion / Theoretical Calculations

11
12
13
14
15
16
17
These are the theoretical calculations that I have done to compare my values with the values
given by Matlab. In a nutshell, all of the final answers are the same, a few of them expressed by
Matlab in a different form but showing the same value. To solve the first part of the questions, I
made use of the Matlab function library symbols such as “[ ], ( ), ;, ^, /, *,’pi’,‘sqrt’ and more.
Other than that, this experiment also allowed me to recall the ways to input and compute
matrices, make use of the built-in ‘conj’ function to determine the conjugate of a matrix, and also
the ‘inv’ function to determine the inverse function of a matrix in few seconds. By doing this
activity I also managed to learn determining the magnitude and phase angle of an open loop
transfer function which can be expressed in graphs, given in my results. Another thing that I
learned is that Matlab requires the bases of logs in the inputs, otherwise a wrong answer will be
given. I also learned another 2 interesting functions which converts state space representation
into transfer function and vice versa. Finally, I found that the reduction of block diagrams was
the most fun of all as it involves a long sequence of inputs. There was no error in the outputs by
Matlab.

Conclusion

In a nutshell, Matlab is a very powerful tool that can be used to compute mathematical
calculations. The fundamental functions in the Matlab were simple and user-friendly and at the
same time a lot of complex things which took my time like when done manually such as
reduction of block diagrams could be done very fast. I really love using Matlab as it’s fun and it
gives reliable answers and it’s really fast. All of this were made possible by the intelligence of
Matlab which comes with various built in functions to ease calculations.

References
1. https://whatis.techtarget.com/definition/control-system
2. https://www.electrical4u.com/control-system-closed-loop-open-loop-control-system/
3. http://cimss.ssec.wisc.edu/wxwise/class/aos340/spr00/whatismatlab.htm
4. https://whatis.techtarget.com/definition/MATLAB

18
19

You might also like