Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

UNIVERSITY OF TECHNOLOGY

CONRTOL AND SYSTEM ENGINEERING


DEPARTMENT

MECHATRONICS BRANCH

4 th Stage

EXP.(6)

“digital state – space model”

Wasan shakir
Obiectives:
1-to study how to converts transfer function to state-space
representation
2-to converts continuous state-space to digital state-space
Introduction:
There are several different ways to describe a system of linear
differential equations.Where x is an n by 1 vector representing the state
(commonly position and velocity variables in mechanical systems), u is
a scalar representing the input (commonly a force or torque in
mechanical systems), and y is a scalar representing the output. The
matrices A (n by n), B (n by 1), and C (1 by n) determine the
relationships between the state and input and output variables. Note that
there are n first-order differential equations. State space representation
can also be used for systems with Multiple- Inputs-Multiple-Outputs
(MIMO). In the conventional control theory, only the input, output and
error signals are considered important; the analysis and design of
control systems are carried out using transfer function, together with a
variety of graphical techniques such as root locus plots and Nyqist
plots. The unique characteristic of conventional control theory is that it
is based on the input-output relation of the system, or the transfer
function.The main disadvantage of conventional control theory is that,
it is applicable only to linear time-invariant systems having a single
input and single output. It is powerless for time-varying systems,
nonlinear systems and multiple-input-output systems.
Producer:
“Zoh”
sysf=feedback(sys,1)
figure(1)
step(sysf)
%producer2
[a,b,c,d]=tf2ss(n,d)
%producer3
[az,bz,cz,dz]=c2dm(a,b,c,d,0.5,'zoh')
[nd,dd]=ss2tf(az,bz,cz,dz);
Sysz=tf(nd,dd,0.5);
Syszf = feedback(Sysz,1)
%producer4
[numz,dumz]=tfdata(Syszf,'v');
figure(2)
dstep(numz,dumz)
“Foh”
%producer3
[az,bz,cz,dz]=c2dm(a,b,c,d,0.5,'foh')
[nd,dd]=ss2tf(az,bz,cz,dz);
Sysz=tf(nd,dd,0.5);
Syszf = feedback(Sysz,1)
%producer4
[numz,dumz]=tfdata(Syszf,'v');
figure(2)
dstep(numz,dumz)
az =
0.6023 -0.3700 0
0.4021 0.8999 0
0.1089 0.4827 1.0000
bz =
0.3016
0.1926
0.0607
cz =
1.0000 1.5100 0.1770
dz =
0.2754
Syszf =
0.2754 z^3 - 0.08593 z^2 - 0.3171 z + 0.1457
--------------------------------------------
1.275 z^3 - 2.588 z^2 + 1.876 z - 0.545
Sample time: 0.5 seconds
Discrete-time transfer function.

“Tustin”
%producer3
[az,bz,cz,dz]=c2dm(a,b,c,d,0.5,'tustin')
[nd,dd]=ss2tf(az,bz,cz,dz);
Sysz=tf(nd,dd,0.5);
Syszf = feedback(Sysz,1)
%producer4
[numz,dumz]=tfdata(Syszf,'v');
figure(2)
dstep(numz,dumz)
az =
0.6097 -0.3702 0
0.4024 0.9074 0
0.1006 0.4769 1.0000
bz =
0.4024
0.1006
0.0252
cz =
1.1176 1.2972 0.1770
dz =
0.2794
Syszf =
0.2794 z^3 - 0.1186 z^2 - 0.2705 z + 0.1275
-------------------------------------------
1.279 z^3 - 2.636 z^2 + 1.949 z - 0.5747
Sample time: 0.5 seconds
Discrete-time transfer function.

>>

“Matched”
%producer3
[az,bz,cz,dz]=c2dm(a,b,c,d,0.5,'matched')
[nd,dd]=ss2tf(az,bz,cz,dz);
Sysz=tf(nd,dd,0.5);
Syszf = feedback(Sysz,1)
%producer4
[numz,dumz]=tfdata(Syszf,'v');
figure(2)
dstep(numz,dumz)
az =

0.7511 1.0000 0
-0.1266 0.7511 0.2529
0 0 1.0000
bz =

0
1.0153
0.2491
cz =

0.1444 0.5777 0
dz =

0
Syszf =

0.5865 z^2 - 0.844 z + 0.2756


----------------------------------
z^3 - 1.916 z^2 + 1.349 z - 0.4151
Sample time: 0.5 seconds
Discrete-time transfer function.

>>
Discussion :
1-
n=[1 -1];
d=[1 1 0.3];
sys=tf(n,d,0.1)
[N,D]=tfdata(sys,'v')
[A,B,C,D]=tf2ss(N,D)

sys =
z-1
-------------
z^2 + z + 0.3
Sample time: 0.1 seconds
Discrete-time transfer function.
N=
0 1 -1
D=
1.0000 1.0000 0.3000
A=
-1.0000 -0.3000
1.0000 0
B=
1
0
C=
1 -1
D=
0
>>

2-
n=[79 916 1000];
d1=conv([1 10],[1 10]);
d2=conv([1 0],[1 10]);
d=conv(d1,d2);
sys=tf(n,d);
sysf=feedback(sys,1)
step(sysf);
[a,b,c,d]=tf2ss(n,d)
sysc=ss(a,b,c,d)
[ac,bc,cc,dc]=c2dm(a,b,c,d,0.5,'zoh')
[nd,dd]=ss2tf(ac,bc,dc,cc);
79 s^2 + 916 s + 1000
--------------------------------------
s^4 + 30 s^3 + 379 s^2 + 1916 s + 1000

Continuous-time transfer function.

a=
-30 -300 -1000 0
1 0 0 0
0 1 0 0
0 0 1 0
b=
1
0
0
0
c=
0 79 916 1000
d=
0
sysc =
a=
x1 x2 x3 x4
x1 -30 -300 -1000 0
x2 1 0 0 0
x3 0 1 0 0
x4 0 0 1 0
b=
u1
x1 1
x2 0
x3 0
x4 0
c=
x1 x2 x3 x4
y1 0 79 916 1000
d=
u1
y1 0
Continuous-time state-space model.
ac =
0.0236 0.6738 5.0535 0
-0.0051 -0.1280 -0.8422 0
0.0008 0.0202 0.1247 0
0.0009 0.0271 0.2828 1.0000
bc =
-0.0051
0.0008
0.0009
0.0002
cc =
0 79 916 1000
dc =
0

3-
A=[0 1;-4 -2];
B=[0;2];
C=[1 0];
D=[0]
[AD,BD,CD,DD]=c2dm(A,B,C,D,0.1,'foh')
sys=ss(AD,BD,CD,DD,0.1)
step(sys)

You might also like