Transcript Slide 1

Regulacija sustava tri elastično
spregnute mase
Opća teorija sustava
Sustav od tri elastično spregnute mase
2
3
Regulacija po stanju primjenom metode podešavanja
polova
Yref
U
To Workspace6
To Workspace7
R* u
Step1
1
s
B* u
Matrica R
Matrica B
Matrica K
Integrator
A* u
K* u
Matrica A
x&  Ax  Bu
Xsys
To Workspace3
C* u
Matrica C
Yout
To Workspace5
A=[0 1 0 0 0 0
-(k1+k12)/m1 0 k12/m1 0 0 0
0 0 0 1 0 0
k12/m2 0 -(k12+k23)/m2 0 k23/m2 0
0 0 0 0 0 1
0 0 k23/m3 0 -(k2+k23)/m3 0]
B=[0
0
0
0
0
1/m3]
u  Kx  v
v  Ryd
C=[1 0 0 0 0 0]
p=[-1 -1.2 -1.3 -1.4 -1.5 -1.6];
K=place(A,B,p)
% polovi regulatora
% matrica pojacanja regulatora
R = -inv(C*inv(Ar)*B)
4
% regulacija stanja tromasenog sustava
clear all
clc
close all
T=20;
k1=1; k12=1.3; k23=1.7; k2=1;
m1=1; m2=2; m3=3;
% konstante opruga
% mase
A=[0 1 0 0 0 0
-(k1+k12)/m1 0 k12/m1 0 0 0
0 0 0 1 0 0
k12/m2 0 -(k12+k23)/m2 0 k23/m2 0
0 0 0 0 0 1
0 0 k23/m3 0 -(k2+k23)/m3 0]
B=[0
0
0
0
0
1/m3]
figure(1)
subplot(231),
plot(tout,Xsys(:,1),'b',tout,Yref(:,1),
ylabel('x_1 [m]','FontSize',14),
xlabel('t [s]','FontSize',14);
subplot(232), plot(tout,Xsys(:,3), 'b',
ylabel('x_3 [m]','FontSize',14),
xlabel('t [s]','FontSize',14);
subplot(233), plot(tout,Xsys(:,5), 'b',
ylabel('x_5 [m]','FontSize',14),
xlabel('t [s]','FontSize',14);
subplot(234), plot(tout,Xsys(:,2), 'b',
ylabel('x_2 [m/s]','FontSize',14),
xlabel('t [s]','FontSize',14);
subplot(235), plot(tout,Xsys(:,4), 'b',
ylabel('x_4 [m/s]','FontSize',14),
xlabel('t [s]','FontSize',14);
subplot(236), plot(tout,Xsys(:,6), 'b',
ylabel('x_6 [m/s]','FontSize',14),
xlabel('t [s]','FontSize',14);
'r--', 'linewidth',3),
'linewidth',3),
'linewidth',3),
'linewidth',3),
'linewidth',3),
'linewidth',3),
C=[1 0 0 0 0 0]
% *********
x01 = 0.0; x02 = 0; x03 = 0; x04 = 0; x05 = 0; x06 = 0;
X0=[x01+0.0 x02 x03 x04 x05 x06]; % pocetni uvjeti sustava
%-----B: Linear Regulator -----p=[-1 -1.2 -1.3 -1.4 -1.5 -1.6];
K=place(A,B,p)
% polovi regulatora
figure(2)
subplot(221),
plot(tout,U(:,1), 'linewidth',2),
ylabel('u_1 [N]','FontSize',14,'FontName','Times'),
xlabel('t [s]','FontSize',14);
subplot(222),
plot(tout,Yout(:,1), 'b', 'linewidth',3),
ylabel('y [m]','FontSize',14),
xlabel('t [s]','FontSize',14);
% matrica pojacanja regulatora
Ar=A-B*K;
R = -inv(C*inv(Ar)*B)
Ystac = 1;
% referentno stanje pozicije prve mase
%-----E: Linear Regulator------sim('trimassobs01')
% simulink model
5
1
2
0.4
x5 [m]
0.6
1
0.5
0.2
0
2
1.5
x3 [m]
x1 [m]
0.8
2.5
0
10
0
20
0
0.15
0.1
t [s]
0
20
0.4
0.4
0.3
0.3
0.2
0
10
20
t [s]
0.1
0.05
10
0
20
x6 [m/s]
x4 [m/s]
0.2
x2 [m/s]
10
t [s]
0.25
0
1
0.5
t [s]
0
1.5
0.2
0.1
0
10
t [s]
20
0
0
10
20
t [s]
6
15
1
0.8
y [m]
u1 [N]
10
5
0
-5
0.6
0.4
0.2
0
5
10
t [s]
15
20
0
0
5
10
15
20
t [s]
7
Regulacija po izlaznoj varijabli primjenom
observera stanja
x&  Ax  Bu
y  Cx
Yref
In1
Yout
Out1
To Workspace2
To Workspace
3-mass system
& Ax
ˆ
ˆ  Bu  L(y  Cx
ˆ)
x
In1
In1
Out1
Out1
Step
In2
In2
Observer
Regulator
u  Kx  v
v  Ryd
U
To Workspace1
Xobs
To Workspace4
8
Dinamika sustava u prostoru stanja
1
B* u
In1
Matrica B
1
s
Integrator
C* u
1
Out1
Matrica C
Xsys
A* u
To Workspace4
Matrica A
x&  Ax  Bu
y  Cx
A=[0 1 0 0 0 0
-(k1+k12)/m1 0 k12/m1 0 0 0
0 0 0 1 0 0
k12/m2 0 -(k12+k23)/m2 0 k23/m2 0
0 0 0 0 0 1
0 0 k23/m3 0 -(k2+k23)/m3 0]
B=[0
0
0
0
0
1/m3]
C=[1 0 0 0 0 0]
9
Observer stanja
1
In1
L* u
Matrica C2
2
B* u
In2
Matrica B
1
s
Integrator
C* u
Matrica C
Yobs
To Workspace3
1
Out1
A* u
Matrica A
& Ax
ˆ
ˆ  Bu  L(y  Cx
ˆ)
x
pobs=[-1 -2 -3 -4 -5 -6];
% polovi observera
LL=place(A',C',pobs);
L=LL'
% matrica pojacanja observera
10
Regulator stanja
1
R* u
1
In1
Out1
Gain R
Matrica A1
K* u
u  Kx  v
2
In2
v  Ryd
p=[-1 -1.2 -1.3 -1.4 -1.5 -1.6];
K=place(A,B,p)
% polovi regulatora
% matrica pojacanja regulatora
R = -inv(C*inv(Ar)*B)
11
% output regulacija primjenom observera stanja tromasenog sustava
clear all
clc
close all
T=20;
k1=1; k12=1.3; k23=1.7; k2=1;
m1=1; m2=2; m3=3;
% konstante opruga
% mase
A=[0 1 0 0 0 0
-(k1+k12)/m1 0 k12/m1 0 0 0
0 0 0 1 0 0
k12/m2 0 -(k12+k23)/m2 0 k23/m2 0
0 0 0 0 0 1
0 0 k23/m3 0 -(k2+k23)/m3 0]
B=[0
0
0
0
0
1/m3]
C=[1 0 0 0 0 0]
% *********
x01 = 0.0; x02 = 0; x03 = 0; x04 = 0; x05 = 0; x06 = 0;
X0=[x01+0.0 x02 x03 x04 x05 x06];
% pocetni uvjeti sustava
X0_obs=[x01 x02 x03 x04 x05 x06];
% pocetni uvjeti observera
%-----B: Linear Regulator plus Observer------p=[-1 -1.2 -1.3 -1.4 -1.5 -1.6];
% polovi regulatora
pobs=[-1 -2 -3 -4 -5 -6];
% polovi observera
K=place(A,B,p)
LL=place(A',C',pobs);
L=LL'
% matrica pojacanja regulatora
% matrica pojacanja observera
Ar=A-B*K;
R = -inv(C*inv(Ar)*B)
Ystac = 1;
% referentno stanje pozicije prve mase
%-----E: Linear Regulator------sim('trimassobs01')
% simulink model
12
figure(1)
subplot(231), plot(tout,Xsys(:,1), 'b', tout,Xobs(:,1), 'r:', tout,Yref(:,1), 'g--', 'linewidth',3),
ylabel('x_1 [m]','FontSize',14), xlabel('t [s]','FontSize',14);
subplot(232), plot(tout,Xsys(:,3), 'b', tout,Xobs(:,3), 'r:', 'linewidth',3),
ylabel('x_3 [m]','FontSize',14), xlabel('t [s]','FontSize',14);
subplot(233), plot(tout,Xsys(:,5), 'b', tout,Xobs(:,5), 'r:', 'linewidth',3),
ylabel('x_5 [m]','FontSize',14), xlabel('t [s]','FontSize',14);
subplot(234), plot(tout,Xsys(:,2), 'b', tout,Xobs(:,2), 'r:', 'linewidth',3),
ylabel('x_2 [m/s]','FontSize',14), xlabel('t [s]','FontSize',14);
subplot(235), plot(tout,Xsys(:,4), 'b', tout,Xobs(:,4), 'r:', 'linewidth',3),
ylabel('x_4 [m/s]','FontSize',14), xlabel('t [s]','FontSize',14);
subplot(236), plot(tout,Xsys(:,6), 'b', tout,Xobs(:,6), 'r:', 'linewidth',3),
ylabel('x_6 [m/s]','FontSize',14), xlabel('t [s]','FontSize',14);
figure(2)
subplot(221), plot(tout,U(:,1), 'linewidth',2),
ylabel('u_1 [N]','FontSize',14,'FontName','Times'), xlabel('t [s]','FontSize',14);
subplot(222), plot(tout,Yout(:,1), 'b', tout,Yobs(:,1), 'r:', 'linewidth',3),
ylabel('y, y_{obs} [m]','FontSize',14), xlabel('t [s]','FontSize',14);
13
1
2
0.4
x5 [m]
0.6
1
0.5
0.2
0
2
1.5
x3 [m]
x1 [m]
0.8
2.5
0
5
10
15
0
20
0
5
10
15
0
20
0.35
0.4
0.3
0.35
0.1
x6 [m/s]
x4 [m/s]
x2 [m/s]
0.15
0.2
0.15
0.1
0.05
t [s]
20
0
15
20
15
20
0.25
0.2
0.15
0.1
0.05
15
10
0.3
0.25
10
5
t [s]
0.2
5
0
t [s]
0.25
0
1
0.5
t [s]
0
1.5
0.05
0
5
10
t [s]
15
20
0
0
5
10
t [s]
14
15
1
0.8
y, yobs [m]
u1 [N]
10
5
0
-5
0.6
0.4
0.2
0
5
10
t [s]
15
20
0
0
5
10
15
20
t [s]
15