0% found this document useful (0 votes)
24 views6 pages

Experiment 3 State Variable Models

Uploaded by

m.farhan.digital
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views6 pages

Experiment 3 State Variable Models

Uploaded by

m.farhan.digital
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

CONTROL SYSTEM LABORATORY

Department of Electrical Engineering, UET, Lahore.

Experiment 3 State Variable Models

Objectives

1. To learn how to convert the transfer function of a system into state variable
representation and vice versa.
2. To learn how to simulate a system expressed in state variable form.

New MATLAB commands to learn in this experiment


MATLAB Command Description
tf2ss TF2SS Transfer function to state-space conversion.
[A,B,C,D] = TF2SS(NUM,DEN) calculates the state-space representation:
ss2tf SS2TF State-space to transfer function conversion.
[NUM,DEN] = SS2TF(A,B,C,D,iu) calculates the transfer function:
lsim LSIM(SYS,U,T) plots the time response of the LTI model SYS to the input
signal described by U and T. The time vector T consists of regularly spaced
time samples and U is a matrix with as many columns as inputs and whose i-th
row specifies the input value at time T(i).

Procedure

Section-1
 A feedback control system is shown below

R(s) Y(s) 2(s+1)(s+3)


G(s) with G(s) =
s(s+3) (s+4)

Figure 2.3 Athe


Determine unity feedback system
closed-loop transferwith two
function Y(s)/R(s) = G(s) / [1+G(s)].
cascaded blocks in the forward path.

Y(s)/R(s) =

Write the coefficients of the numerator and denominator polynomials N(s) and D(s)
respectively.
N(s) = [ ]

D(s) = [ ]

Write Matlab commands to determine the closed-loop transfer using the numerator
and denominator polynomials.
>>
>>
>>

Experiment 3 State Variable Models Page 1 of 6


CONTROL SYSTEM LABORATORY
Department of Electrical Engineering, UET, Lahore.

 Transfer function to state-space conversion can be accomplished as

[A, B, C, D] = tf2ss(num, den);

where, num and den are the numerator and denominator of the closed-loop transfer
function.

The following command will print the state-space model.

printsys(A, B, C, D);

Matrices A, B, C and D can be printed by entering the matrix name.

Write matrices of the state-space model returned by the Matlab.

A= B=

C= D=

 A system expressed in state-space can be converted to transfer function. Following


statement is used to convert the state-space representation of a system discussed before
into transfer function.

[num1, den1] = ss2tf(A, B, C, D);

Verify that the num1 and den1 are the same as num and den used in the first step of
this section.

N(s) of the transfer function =


D(s) of the transfer function =

num1 =
den1 =

Experiment 3 State Variable Models Page 2 of 6


CONTROL SYSTEM LABORATORY
Department of Electrical Engineering, UET, Lahore.

Section-2

 Time response of a system represented in state-space can be computed by using


function lsim. For this purpose, all four matrices (A, B, C, D) of a state-space model
along with initial conditions, a time vector (range of time) and an input vector are
required. RLC circuit shown below. In this model, state variables x1 and x2 are the
capacitor voltage and inductor current respectively and the output y is the resistor
voltage.

R = 3; L = 1; C = 0.5;
A = [0 –1/C; 1/L –R/L];
B = [1/C; 0];
C = [0 R];
D = [0];
x0 = [1 1]; % initial conditions.
t = [0:0.01:5]; % time range is 0 to 5 sec with an increment of 0.01 sec.
u = 0*t ; % zero input.
[y, x] = lsim(A, B, C, D, u, t, x0);

lsim function returns two parameters, output matrix y having one column and state
variable matrix x having two columns. Use size(y) and size(x) to see the number of
rows and columns in y and x.

Note: Number of rows in x and a y matrix is equal to the number of data points in
time vector t.

 Use following commands to observe the time response of the system defined in
previous step.

subplot(3, 1, 1); % divide the figure window into 3 rows and 1 column.
plot(t, x(:,1)); % plot the 1st state variable, column 1 of matrix x.
xlabel('time'); ylabel('x1');
subplot(3, 1, 2);
plot(t, x(:,2)); % plot the 2nd state variable, column 1 of matrix x.
xlabel('time'); ylabel('x2');
subplot(3, 1, 3);
plot(t, y); % plot the output y
xlabel('time'); ylabel('output (y)');

Sketch the state variables x1, x2 and the output y. Label all the curves appropriately.

Experiment 3 State Variable Models Page 3 of 6


CONTROL SYSTEM LABORATORY
Department of Electrical Engineering, UET, Lahore.

State variable x1 Vs time.

State variable x2 Vs time.

Output variable y Vs time.

 Change the system parameters R, L and C to generate four types of time response as
shown in the following table. Also, show the values of R, L and C and position of
poles for each type of response.

Experiment 3 State Variable Models Page 4 of 6


CONTROL SYSTEM LABORATORY
Department of Electrical Engineering, UET, Lahore.

Case Type of Response System Parameters Position of Poles


1 Overdamped R= L= C=
2 Critically Damped R= L= C=
3 Underdamped R= L= C=
4 Oscillatory R= L= C=

Sketch the output y (resistor voltage) for all four cases.

Case-1: Overdamped.

Case-2: Critically damped.

Case-2: Underdamped.

Case-4: Oscillatory.

Write your comments on this experiment.

……………………………………………………………………………………………

Experiment 3 State Variable Models Page 5 of 6


CONTROL SYSTEM LABORATORY
Department of Electrical Engineering, UET, Lahore.

……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………

Checked by: Date:

Experiment 3 State Variable Models Page 6 of 6

You might also like