0% found this document useful (0 votes)
2 views

lab_1

The document provides an introduction to control engineering commands, detailing the structure and functions of linear time-invariant (LTI) systems in MATLAB. It outlines various methods for representing LTI systems, including transfer function, state-space, and their interconnections. Additionally, it includes example MATLAB programs demonstrating the implementation of these concepts.

Uploaded by

Hashua War
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

lab_1

The document provides an introduction to control engineering commands, detailing the structure and functions of linear time-invariant (LTI) systems in MATLAB. It outlines various methods for representing LTI systems, including transfer function, state-space, and their interconnections. Additionally, it includes example MATLAB programs demonstrating the implementation of these concepts.

Uploaded by

Hashua War
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA

Department of Electrical Engineering

Experiment 01:
Introduction to Control Engineering Commands
Control System:

A control system is an interconnection of components forming a system configuration that will provide
a desired system response. Hence, a control system is an arrangement of physical components
connected or related in such a manner as to command, regulate, direct, or govern itself or another
system. A control system provides an output or response for a given input or stimulus.

LTI model structures:

There are three basic forms to describe linear time-invariant (LTI) systems in MATLAB

Transfer function form:

Zero-pole-gain form:

State space model form:

1) Transfer Function:
H=tf(num, den)
H=zpk([], [-1, -2], 2)
2) RESIDUE: Partial-fraction expansion:
[R,P,K] = RESIDUE(B, A)
finds the residues, poles and direct term of a partial fraction expansion of the ratio of two polynomials
B(s)/A(s). If there are no multiple roots,
B(s) R(1) R(2) R(n)
---- = -------- + -------- + ... + -------- + K(s)
A(s) s - P(1) s - P(2) s - P(n)

Control Systems (EE352) Lab Instructor: P. P. Singh 1


NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA
Department of Electrical Engineering

Vectors B and A specify the coefficients of the numerator and denominator polynomials in descending
powers of s. The residues are returned in the column vector R, the pole locations in column vector P,
and the direct terms in row vector K.

3) TF2ZP: Transfer function to zero-pole conversion:


[Z,P,K] = TF2ZP(NUM,DEN)
finds the zeros, poles, and gains from a SIMO transfer function in polynomial form:
NUM(s)
H(s) = --------
DEN(s)
Vector DEN specifies the coefficients of the denominator in descending powers of s. The zero
locations are returned in the columns of matrix Z, with as many columns as there are rows in NUM.
The pole locations are returned in column vector P, and the gains for each numerator transfer function
in vector K.

4) SERIES: Series interconnection of the two LTI models.

SYS = SERIES(SYS1, SYS2, OUTPUTS1, INPUTS2) connects two LTI models

SYS1 and SYS2 in series such that the outputs of SYS1 specified by OUTPUTS1 are connected to the
inputs of SYS2 specified by INPUTS2.

5) PARALLEL: Parallel interconnection of two LTI models

Control Systems (EE352) Lab Instructor: P. P. Singh 2


NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA
Department of Electrical Engineering

[num,den]=parallel(num1,den1,num2,den2) this function gives parallel connection of two LTI


models. The arguments for the function are num1, num2 and den1, den2 that are the numerators and
denominators of the two function this function returns the num and den as the output.

6) FEEDBACK: Feedback connection of two LTI models

SYS = FEEDBACK(SYS1, SYS2) computes an LTI model SYS for the closed-loop feedback system.
To apply positive feedback, use the syntax

SYS = FEEDBACK(SYS1, SYS2, +1).

7) TF2SS: Transfer function to state-space conversion:-


[A, B, C, D] = TF2SS(NUM, DEN)
calculates the state-space representation:
ẋ = Ax + Bu
y = Cx + Du
of the system:
NUM(s)
H(s) = --------
DEN(s)

from a single input. Vector DEN must contain the coefficients of the denominator in descending
powers of s. Matrix NUM must contain the numerator coefficients. The A, B, C, D matrices are
returned in controller canonical form. This calculation also works for discrete systems.

Program # 1:

disp(‘………..’)
disp(‘Created by xxxx’)
disp(‘Reg#’)
num=[2 5 3 6]
den=[1 6 11 6]
[r,p,k]=residue(num,den)
[num,den]=residue(r,p,k)
printsys(num,den,'S')

Control Systems (EE352) Lab Instructor: P. P. Singh 3


NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA
Department of Electrical Engineering

Output :-

Program # 2:

m = 2;
b = 5;
k = 3;
num = [ 1 ];
den = [ m b k ];
tutorial_tf = tf(num, den)

Output:

Program # 3:

num=[2 5 3 6]
den=[1 6 11 6]
[z,p,k]=tf2zp(num,den)
disp('Zeros of the function is = ')
disp(z)
disp('Poles of the function is = ')
disp(p)
disp('Gain of the function is = ')
disp(k)

Control Systems (EE352) Lab Instructor: P. P. Singh 4


NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA
Department of Electrical Engineering

Output:-

Program # 4:
num1=[10]
den1=[1 2 10]
num2=[5]
den2=[1 5]
[num,den]=series(num1,den1,num2,den2)
printsys(num,den,'S')

Output

Program # 5:
num1=[10]
den1=[1 2 10]
num2=[5]
den2=[1 5]
[num,den]=parallel(num1,den1,num2,den2)
printsys(num,den,'S')

Output:-

Control Systems (EE352) Lab Instructor: P. P. Singh 5


NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA
Department of Electrical Engineering

Program # 6:

num1=[10 20 30 41 78 ]
den1=[1 2 10 47 58 41]
num2=[5 47 1 2 89 ]
den2=[1 5 41]
[num,den]=feedback(num1,den1,num2,den2)
printsys(num,den,'S')

Output:-

Program # 7:

num=[2 1 1 2]
den=[1 4 8 2]
[a,b,c,d]=tf2ss(num,den)
printsys(num,den,'S')

Output:-

Program# 8:

A=[-3, -1; 2, 0]; B=[1; 0]; C=[0, 1]; D=0;


HSS=ss(A,B,C,D)

Step response using the transfer function:

Control Systems (EE352) Lab Instructor: P. P. Singh 6


NATIONAL INSTITUTE OF TECHNOLOGY MEGHALAYA
Department of Electrical Engineering

Once the transfer function is entered into MATLAB it is easy to calculate the response to a step
input. To calculate the response to a unit step input, use

step(transfer function)

where transfer function is the name of the transfer function of the system.

For steps with magnitude other than one, calculate the step response using:

step(u * transfer function)

where u is the magnitude of the step and transfer function is the name of the transfer function of the
system.

Impulse response using the transfer function:

MATLAB can also plot the impulse response of a transfer function. Because the transfer function is
in the form of output over input, the transfer function must be multiplied by the magnitude of the
impulse. The syntax for plotting the impulse response is:

impulse(u * transfer function)

where u is the magnitude of the impulse and transfer function is the name of the transfer function of
the system.

Bode plot using the transfer function:

MATLAB’s bode command plots the frequency response of a system as a bode plot. The syntax for
the bode plot function in MATLAB is:

bode(transfer function)

where transfer function is the name of the transfer function system.

Root Locus plot using the transfer function:

rlocus(transfer function)

Control Systems (EE352) Lab Instructor: P. P. Singh 7

You might also like