DEPARTMENT OF MECHATRONICS
ENGINEERING
     UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
                     PESHAWAR
     MTE-328L CONTROLL SYSTEMS LAB, 6th SEMESTER
                       LAB REPORT 4
     SUBMITTED BY:     TAIMOOR KHAN
     REG NO.:          20PWMCT0739
     SUBMITTED TO:     PROFF DR. RYAZ AKBAR SHAH
    SUBMISSION DATE:   05-04-2023
     LAB TITLE  “INTRODUCTION TO CONTROL SYSTEM
                      TOOLBOX”
LAB REPORT RUBRICS:
2
LAB NO.4
   LAB TILTLE
      “INTRODUCTION TO CONTROL SYSTEM TOOLBOX”
OBJECTIVES
    How to create create Transfer Function model of different systems .
    To know about the representation of the system in MATLAB.
    To know about the step and impulse response of a system.
    To know about the linear System Analyzer.
THEORY
TRANSFER FUNCTION
A transfer function represents the relationship between the output signal of a control system and
the input signal, for all possible input values.[1]
A transfer function is a convenient way to represent a linear, time-invariant system in terms of its
input-output relationship. It is obtained by applying a Laplace transform
Advantages
Transfer function is a mathematical representation that describes how an input signal is
transformed into an output signal in a system.
The transfer function provides important information about the system's frequency response,
stability, and performance.
                                      IN LAB TASKS
SIMPLE TRANSFER FUNCTION
COMMANDS
           num = [5 4 1];
            den = [1 2 4];
           final = tf(num,den)
                                                 3
COMMANDS
zeta = 0.25;
w0 = 3;
h = tf(w0^2,[1,2*zeta*w0,w0^2])
                                  4
Transfer function of the DC motor
If we want to create the transfer function of aDC motor directly so we can do so
 COMMANDS
        s = tf('s');
       sys_tf = 1.5/(s^2+14*s+40.02)
                                               5
Parallel connection of systems
Parallel connections of the system can be solved by two ways
1.Simple addition method
2.Parallel command method
1.Simple addition method
 COMMAND
num1= [1 2];
dnum1=[2 1 3];
sys1=tf(num1, dnum1)
num2= [1];
dnum2=[1 1];
sys2=tf(num2, dnum2)
fsys= (sys1+sys2)
                                              6
2.Parallel command method
 COMMAND
       num1= [1 2];
       dnum1=[2 1 3];
       sys1=tf(num1, dnum1)
       num2= [1];
       dnum2=[1 1];
       sys2=tf(num2, dnum2)
       sys= parallel(sys1,sys2)
From above figure it is clear that the result of both methods are same so we can use any of that.
                                                 7
Series connection of systems
Series connections of the system can be solved by two ways
1.Simple multiplication method
2.Series command method
1.Simple multiplication method
 COMMAND
       a= [1 2];
       b=[2 1 3];
       sys1=tf(a,b)
       c= [1];
       d=[1 1];
       sys2=tf(c,d)
       fsys= (sys1*sys2)
                                              8
2.Series command method
 COMMAND
       a= [1 2];
       b=[2 1 3];
       sys1=tf(a,b)
       c= [1];
       d=[1 1];
       sys2=tf(c,d)
       sys= series(sys1,sys2)
From the above figure it is clear that the transfer function will be same in both cases
                                                 9
ZERO POLE GAIN COMMAND
     It creates a continuous-time zero-pole-gain model
     With zeros and poles specified as vectors and the scalar value of gain
K is called the gain.
    COMMAND
             z=[5 2 7]
             p=[-4 -1 -9];
            k=6;
        zpk=zpk(z,p,k)
STEP INPUT FUNCTION
Step input function is used to generate step response of LTI systems.
Y=step(sys,t)
Plot(t,y)
 COMMAND
                                               10
IMPULSE INPUT FUNCTION
Impulse input function is used to generate impulse response of LTI systems.
 y=impulse(sys,t)
 Plot(t,y)
                                              11
LINEAR SYSTEM ANALYZER
We have made the system in the simulink and analyze it which is shown below;
                                             12
                       POST LAB TASKS
TASK 1
 COMMAND
   clear all
   m=[2];
   n=[1];
   o=[1 1];
   p=[1 2];
   tf1=tf(o,p);
   j=[1];
   k=[1 10];
   tf2=tf(j,k);
   r=[1 0 1];
   s=[1 4 4];
   tf3=tf(r,s);
   a=[1 1];
   b=[1 6];
   tf4= tf(a,b);
   fsys=tf1+tf2+tf3
   d=feedback(n,tf4)
   e=feedback(tf1,tf3+tf4)
   h=feedback(tf2+tf3,m)
   g=feedback(tf1+tf2+tf3,n)
                               13
SIMULINK DESIGN
PLOT
                  14
TASK 2
 COMMAND
clear all
t=0:0.1:15;
r=[2 5 1];
s=[1 2 3];
tf1=tf(r,s);
g=[5 10];
h=[1 10];
tf2=tf(g,h);
fsys=feedback(tf1,tf2)
sgnal=step(fsys,t)
plot(t,sgnal)
PLOT
SIMULINK DESIGN
                         15
PLOT
REFERENCES
 1. https://www.electrical4u.com
                                   16