際際滷

際際滷Share a Scribd company logo
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
1
b袖i tpl鱈nl箪 thuyt 速iukhint湛速辿ng
則b袖i :
Chohth竪ng速iukhint竪c速辿速辿ngc測nh-hnhv:(hnh1)
Y捉ucu:
1. X息y d湛ngs測速奪kh竪i cutr坦cv袖h袖mtruyn速孫t c存cphnt旦
2. Xt 脱n速nhhth竪ngv袖tnhqu存trnhqu存速辿(b損ngph-測ngph存ps竪Tustin) khi b叩
quakh息uPID v袖ng他t b叩kh息uW4(p) .
3. Khi c達b辿PID , c達W4(p) xt 脱n速nhhth竪ngb損ngMatlab, c担th:
a, c他t b叩W4(p) tmc存cthams竪c単ab辿PID 速smax <=15% .
b,b叩PID , gi歎l孫i W4(p) tmTd 速cht l-樽nghth竪ngt-測ng速竪i t竪t .
c, c達PID , c達W4(p) x存c速nhc存cthams竪速 smax <=10% .
- nh達m 13 c達c存cs竪liu :
R =10 K , R1 =145 K , C1 = 26mF
H袖mtruyn速孫t 速辿ngc測:
1.. 2
++
=
pTpTT
k
W
mem
m
dc v鱈i km = 6,5 ; Tm = 0,3 sec; Te =
0,15 sectac達:
13,0045,0
5,6
2
++
=
pp
Wdc =W3(p)
- Kh息uK則1 c達h袖mtruynnh-sau:
W1(p) =
177,3
5,14
11
1
+
=
+ ppT
K
-
101,0
25
)(2
+
=
p
pW
B袖i l袖m
1. X息y d湛ngs測速奪cu tr坦chth竪ng:
- s測速奪cutr坦chth竪ng速-樽cvnh-hnhs竪2 trong速達c存ch袖mtruyn速孫t 速揃
速-樽ctnhv袖hs竪ph其nh奪i Kf = KpaKft =0,125*0,25 = 0.03125
+ nguy捉nl箪 l袖mvicc単ahth竪ng:
2.Xt 脱n 速nh hth竪ngv袖 tnh qu存 trnh qu存 速辿:
- khi b叩kh息uPID v袖ng他t b叩W4(p) tac達s測速奪cutr坦cnh-sau:
(Hnhvs竪3)
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
2
Hth竪ngg奪mhai kh息uqu存ntnhv袖m辿t kh息udao速辿ngm孫chph其nh奪i c達hs竪b損ng
0.03125 .
- xt kh息uqu存ntnh: W1(p)=
)(
)(
177,3
5,14 1
pE
pY
p
=
+
thp=
1
12
+
-
Z
Z
T
v袖otac達: )(.)(..)(.)(. 11111 ZEBZEZBZYAZYZ ++=
trong速達:
T
TB
T
TA
+
=
+
-=
54,7
5,14
54,7
54,7
1
1
Ph-測ngtrnhsai ph息nc達d孫ng:
][]1[][]1[ 11111 kEBkEBkYAkY +++=+
- t-測ngt湛xt v鱈i kh息uqu存ntnh:
101.0
25
)(2
+
=
p
pW =
)(
)(
1
2
pY
pY
thay p=
1
12
+
-
Z
Z
T
v袖o
tac達:
)(.)(..)(.)(. 1112222 ZYBZYZBZYAZYZ ++= (1)
trong速達:
T
TB
T
TA
+
=
+
-=
02.0
.25
02.0
02.0
2
2
Ph-測ngtrnhsai ph息nc達d孫ng:
][]1[][]1[ 1212222 kYBkYBkYAkY +++=+ (2)
則竪i v鱈i kh息udao速辿ng:
)(
)(
13.0045.0
5.6
)(
2
23
pY
pY
pp
pW =
++
= tac達:
Thay p =
1
12
+
-
Z
Z
T
v袖o:
( )
33
2
3
22
3
2
3
1.2.5.6
)(
1
1
1
.
2
.3.0)
1
1
.
2
(045.0
5.6
)(
CZBZA
ZZT
ZW
Z
Z
TZ
Z
T
ZW
++
++
=
+
+
-
+
+
-
=
Trong速達:
TTC
TB
TTA
6.018.0
36.02
6.018.0
2
3
2
3
2
3
-+=
-=
++=
Ph-測ngtrnh速孫i s竪:
)()(.2)([5.6)()().(. 222
22
33
2
3 ZYZZYZYZTZYCZZYBZZYA ++=++
Ph-測ngtrnhsai ph息nt-測ng速-測ngl袖:
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
3
3222
2
33 /])[]1[.2]2[(5.6][]1[.(]2[ AkYkYkYTkYCkYBkY +++++-+-=+
Vy ph-測ngtrnhsai ph息nm束t其hth竪ngtheoph-測ngph存ps竪Tustinl袖:
322233
1212222
11111
/]))1[][*2]1[(***5.6]1[*][*(]1[
][*]1[*][*]1[
][*]1[*][*]1[
][*03125.0][
AkYkYkYTTkYCkYBkY
kYBkYBkYAkY
kEBkEBkYAkY
kYUkE
-++++---=+
+++=+
+++=+
-=
則tnhqu存trnhqu存速辿c単ahth竪ngtad誰ngMatlab速kimtraxemhth竪ngc達脱n
速nhhay kh束ng:
nh-sau:
>> w1=tf([14.5],[3.77 1]);
Transfer function:
14.5
----------
3.77 s+ 1
>> w2=tf([25],[.01 1])
Transfer function:
25
----------
0.01 s+ 1
>> w3=tf([6.5],[0.04 .3 1])
Transfer function:
6.5
--------------------
0.045 s^2 + 0.3 s+ 1
Transfer function:
2356,25
-----------------------------------------------------
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
4
0,001697s^4 + 0,1814 s^3 + 1,2161s^2 + 4,08 s+ 1
>> k= 0.03125;
>> wk=feedback(wh,k)
Transfer function:
2356,25
-----------------------------------------------------------------------
0,01697s^4 + 0,1814 s^3 + 1,2167s^2 + 4,48s+51,78
>> step(wk)
tac達速ctnhqu存速辿nh-sau:
tnh qu存 trnh qu存 速辿b損ngph-測ngph存p TUSTIN:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
include<stdlib.h>
float T,a1a,a2,a3,b1,b2,b3,c3,u;
float y1[640] , y2[640] , y[640] , e[640] ;
int gt , gm, i , k;
voidmain()
{
cout<< nTinh qua trinh qua do he thong;
cout<<nnhap buoc tinh T=; cin>>T;
y[0] = 0; y[1]= 0; y1[0] = 0; y2[0] = 0;
for(k=0; k<=630; k++)
{
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
5
;/]))1[][*2]1[(***5.6]1[*][*(]1[
];[*]1[*][*]1[
];[*]1[*][*]1[
];[*03125.0][
322233
1212222
11111
AkYkYkYTTkYCkYBkY
kYBkYBkYAkY
kEBkEBkYAkY
kYUkE
-++++---=+
+++=+
+++=+
-=
cout<< nttk=%3d y=%6.2f ,k,y[k] ;
delay(1) ;
}
getch() ;
gd= DETECT;
initgraph(&gd,&gm,c:borlandc++bgi) ;
setlinestyle(0,0,3) ;
setbkcolor(0) ; setcolor(4) ;
outtextxy(160,30,PHUONG PHAP SO TUSTIN) ;
outtextxy(150,40,(He khong on dinh)) ;
outtexexy(20,450,0) ;
setcolor(5) ;
rectangle(2,2,637,477) ;
setcolor(1) ;
for (i = i ; i<=10 ; i++)
{
line(64*i, 5, 64*i,15) ;
line(64*i + 32, 5, 64*i + 32, 10) ;
line(64*i, 475, 64*i, 464) ;
line(64*i + 32475, 64*i + 32 , 468) ;
line(5, 48*i, 10 , 48*i) ;
}
setcolor(2) ;
moveto(1,477) ;
for (k=0 ;k<= 630 ; k++)
{
lineto(k, 479  (int)(10*y[k]/1.6)) ;
}
outtextxy(580, 470  (int)(10*y[k]/1.6),y(t)) ;
outtextxy(455, 450  (int)(10*y[k]/1.6),Tin hieu ra) ;
getch() ;
closegraph() ;
return(0) ;}
3. Khi c達b辿PID v袖 c達kh息u W4(p) :
a, khi b叩kh息uW4(p) tac達s測速奪kh竪i c単ah th竪ngnh-sau:
Khi m他cn竪i tipb辿PID
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
6
Tad誰ngMatlab速iuchnhc存cthams竪c単ab辿PID 速chhth竪ng脱n速nh:
- Khi b辿PID m他cn竪i tiptac達c存cthams竪hiuchnh速overshoot kh束ngqu存
15% l袖:
KP =0.01 ;KD = 0.1 ; KI = 0.5 ; tac達速奪th stepnh-sau:
Tathy overshoot b損ng9.74% , risetimeb損ng1.9 (sec) v袖settingtimeb損ng6.35
(sec)
Nh-vy cht l-樽nghth竪ng速孫t y捉ucu.
Khi b辿PID m他ch巽nh樽p:
W2(P) W3(P)W1(P)
Kf
PID
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
7
Tac達速ctnhqu存速辿nh-sau:
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
8
Hth竪ng脱n速nhv鱈i c存cthams竪nh-sau: Kp=0,01 ; Ki = 0,008 ; Kd= 0;
b辿PID 2 c達:Kp=0,01 ; Ki = 0,005 ; Kd= 0,01
b, Khi b叩PID ly W4(p) tac達s測速奪kh竪i nh-sau:
hiuchnhdnTdtac達: v鱈i Td= 20 速ctnhqu存 速辿c単ahth竪ngnh-sau:
Ch-測ngtrnhMatlab:
>> Td=20;
>> W0=tf(8.5,[1.105 1])
Transfer function:
14.5
-----------
3.77 s+ 1
>> W1=tf(25,[.01 1])
Transfer function:
25
----------
0.01 s+ 1
>> W2=tf(6.5,[.045 .03 1])
Transfer function:
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
9
6.5
----------------------
0.045 s^2 + 0.03 s+ 1
>> W3=tf([Td0 0],[Td1])
Transfer function:
20 s^2
--------
20 s+ 1
>> W12k=feedback(W1*W2,W3)
Transfer function:
3250 s+ 162.5
-----------------------------------------------
0.009 s^4 + 0.9064 s^3 + 3251 s^2 + 20.04 s+ 1
>> W012k=feedback(W0*W12k,.03125)
Transfer function:
27625 s+ 1381
----------------------------------------------------------------
0.009945 s^5 + 1.011 s^4 + 3593 s^3 + 3273 s^2 + 884.4 s+ 44.16
>> step(W012k)
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
10
Nhnxt : Tathy Overshoot =14,5% , settingTime= 46 sec  cht l-樽ngh
th竪ngt-測ng速竪i t竪t .
則奪thi Nyquist c単ahh谷nh-sau:
>> nyquist(W0*W12k)
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
11
c) Khi c達c其b辿PID v袖kh息uW4 tahiuchnhc存cthams竪速hc達sMAX <=10%
S測速奪kh竪i :
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
12
Taxhiuchnhc存cthams竪c単ab辿PID v袖Td 速h速孫t 速-樽ccht l-樽ngtheoy捉ucu
:
Tavm孫chtrongSIMULINK nh-sau:
thay 速脱i c存cthams竪c単ab辿PID v袖Td , chohth竪ngch孫y , 谷c旦as脱chnhc単a
MATLABtag但:
>> plot(HUY); grid
tac達d孫ngqu存速辿nh-sau:
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
13
V鱈i c存cthams竪c単ab辿PID nh-sau: KP = 10 ; KI = 5; KD = 5 ;
v袖Td = 0,001 tathy cht l-樽nghth竪ng速揃速孫t y捉ucu(overshoot = 0 % ; th棚i gian
x存clpnh叩(10 sec).
4) Xt kh其n即ng速iukhin速-樽cv袖quans存t 速-樽cc単ahth竪ng
Tac達h袖mtruync単ahth竪ngnh-sau:
>> Wpid=tf(10)+tf(5,[1 0])+tf([5 0],1)
Transfer function:
5 s^2 + 10 s+ 5
----------------
s
>> W1=tf(14.5,[3.77 1])
Transfer function:
14.5
-----------
3.77 s+ 1
>> W2=tf(25,[.01 1])
Transfer function:
25
----------
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
14
0.01 s+ 1
>> Wdc=tf(6.5,[.045 .3 1])
Transfer function:
6.5
---------------------
0.045 s^2 + 0.3 s+ 1
>> W3=tf(.001,[.001 1])
Transfer function:
0.001
-----------
0.001 s+ 1
>> W1k=feedback(W2*Wdc,W3)
Transfer function:
0.1625 s+ 162.5
-----------------------------------------------------------
4.5e-007 s^4 + 0.000498 s^3 + 0.04831 s^2 + 0.311 s+ 1.163
>> Wh=Wpid*W1*W1k
Transfer function:
6.906 s^3 + 6920 s^2 + 1.382e004 s+ 6906
------------------------------------------------------------------------------
4.972e-007 s^6 + 0.0005507 s^5 + 0.05388 s^4 + 0.392 s^3 + 1.596 s^2 + 1.163 s
>> Wk=feedback(Wh,.03125)
Transfer function:
6.906 s^3 + 6920 s^2 + 1.382e004 s+ 6906
--------------------------------------------------------------------------------
4.972e-007 s^6 + .0005507 s^5 + 0.05388 s^4 + 0.6078 s^3 + 217.8 s^2 + 433 s+
215.8
Vy tac達ph-測ngtrnh速ctnhc単ahl袖:
s6
+1107,6s5
+10,8.104
s4
+12,2.105
s3
+43,8.107
s2
+87,07.107
s+43,4.107
=0
Tad誰ngMatLab速tnhmatrn速iukhinnh-sau:
>> A=[-1107.6 1 0 0 0 0;-10.8*10^4 0 1 0 0 0;-12.5*10^5 0 0 1 0 0;-43.8*10^7 0 0 0
1 0;-
87.08*10^7 0 0 0 0 1;-43.4*10^7 0 0 0 0 0]
A =1.0e+008 *
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
15
-0.0000 0.0000 0 0 0 0
-0.0011 0 0.0000 0 0 0
-0.0125 0 0 0.0000 0 0
-4.3800 0 0 0 0.0000 0
-8.7080 0 0 0 0 0.0000
-4.3400 0 0 0 0 0
>> B=[0;0;6.906;6920;1.382e004;6906]
B=
1.0e+004 *
0
0
0.0007
0.6920
1.3820
0.6906
>> P=[BA*BA^2*BA^3*BA^4*BA^5*B]
P=
1.0e+013 *
0 0 0.0000 -0.0000 0.0000 -0.0000
0 0.0000 0.0000 -0.0000 0.0000 -0.0010
0.0000 0.0000 0.0000 -0.0000 -0.0002 0.0219
0.0000 0.0000 0.0000 -0.0003 0.0313 -3.2440
0.0000 0.0000 0 -0.0006 0.0632 -6.5435
0.0000 0 0 -0.0003 0.0316 -3.2770
>> det(P)
ans=
5.2854e+029
Tathy det(P) kh存c0 vy Rank(P) =6 hay hth竪ng速iukhin速-樽cho袖nto袖n.
Taxt tnhquans存t 速-樽cc単ahth竪ng:
>> C=[1 0 0 0 0 0]
C =
[1 0 0 0 0 0]
ans=
B袖i tp l鱈n: LT則KT則
Sinh vi捉n : T畉 Vn Ti畉n_
DHDI7TH
16
1
0
0
0
0
0
>> A'
ans=
1.0e+008 *
-0.0000 -0.0011 -0.0125 -4.3800 -8.7080 -4.3400
0.0000 0 0 0 0 0
0 0.0000 0 0 0 0
0 0 0.0000 0 0 0
0 0 0 0.0000 0 0
0 0 0 0 0.0000 0
>> L=[C' A'*C' (A')^2*C' (A')^3*C' (A')^4*C' (A')^5*C']
L =
1.0e+015 *
0.0000 -0.0000 0.0000 -0.0000 0.0011 -1.1220
0 0.0000 -0.0000 0.0000 -0.0000 0.0011
0 0 0.0000 -0.0000 0.0000 -0.0000
0 0 0 0.0000 -0.0000 0.0000
0 0 0 0 0.0000 -0.0000
0 0 0 0 0 0.0000
>> det(L)
ans=
1
Tathy det(L) kh存c0 , vy hth竪ngquans存t 速-樽cho袖nto袖n.

More Related Content

bai-tap-lon-ly-thuyet-dieu-khien-tu-dong-pdf

  • 1. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 1 b袖i tpl鱈nl箪 thuyt 速iukhint湛速辿ng 則b袖i : Chohth竪ng速iukhint竪c速辿速辿ngc測nh-hnhv:(hnh1) Y捉ucu: 1. X息y d湛ngs測速奪kh竪i cutr坦cv袖h袖mtruyn速孫t c存cphnt旦 2. Xt 脱n速nhhth竪ngv袖tnhqu存trnhqu存速辿(b損ngph-測ngph存ps竪Tustin) khi b叩 quakh息uPID v袖ng他t b叩kh息uW4(p) . 3. Khi c達b辿PID , c達W4(p) xt 脱n速nhhth竪ngb損ngMatlab, c担th: a, c他t b叩W4(p) tmc存cthams竪c単ab辿PID 速smax <=15% . b,b叩PID , gi歎l孫i W4(p) tmTd 速cht l-樽nghth竪ngt-測ng速竪i t竪t . c, c達PID , c達W4(p) x存c速nhc存cthams竪速 smax <=10% . - nh達m 13 c達c存cs竪liu : R =10 K , R1 =145 K , C1 = 26mF H袖mtruyn速孫t 速辿ngc測: 1.. 2 ++ = pTpTT k W mem m dc v鱈i km = 6,5 ; Tm = 0,3 sec; Te = 0,15 sectac達: 13,0045,0 5,6 2 ++ = pp Wdc =W3(p) - Kh息uK則1 c達h袖mtruynnh-sau: W1(p) = 177,3 5,14 11 1 + = + ppT K - 101,0 25 )(2 + = p pW B袖i l袖m 1. X息y d湛ngs測速奪cu tr坦chth竪ng: - s測速奪cutr坦chth竪ng速-樽cvnh-hnhs竪2 trong速達c存ch袖mtruyn速孫t 速揃 速-樽ctnhv袖hs竪ph其nh奪i Kf = KpaKft =0,125*0,25 = 0.03125 + nguy捉nl箪 l袖mvicc単ahth竪ng: 2.Xt 脱n 速nh hth竪ngv袖 tnh qu存 trnh qu存 速辿: - khi b叩kh息uPID v袖ng他t b叩W4(p) tac達s測速奪cutr坦cnh-sau: (Hnhvs竪3)
  • 2. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 2 Hth竪ngg奪mhai kh息uqu存ntnhv袖m辿t kh息udao速辿ngm孫chph其nh奪i c達hs竪b損ng 0.03125 . - xt kh息uqu存ntnh: W1(p)= )( )( 177,3 5,14 1 pE pY p = + thp= 1 12 + - Z Z T v袖otac達: )(.)(..)(.)(. 11111 ZEBZEZBZYAZYZ ++= trong速達: T TB T TA + = + -= 54,7 5,14 54,7 54,7 1 1 Ph-測ngtrnhsai ph息nc達d孫ng: ][]1[][]1[ 11111 kEBkEBkYAkY +++=+ - t-測ngt湛xt v鱈i kh息uqu存ntnh: 101.0 25 )(2 + = p pW = )( )( 1 2 pY pY thay p= 1 12 + - Z Z T v袖o tac達: )(.)(..)(.)(. 1112222 ZYBZYZBZYAZYZ ++= (1) trong速達: T TB T TA + = + -= 02.0 .25 02.0 02.0 2 2 Ph-測ngtrnhsai ph息nc達d孫ng: ][]1[][]1[ 1212222 kYBkYBkYAkY +++=+ (2) 則竪i v鱈i kh息udao速辿ng: )( )( 13.0045.0 5.6 )( 2 23 pY pY pp pW = ++ = tac達: Thay p = 1 12 + - Z Z T v袖o: ( ) 33 2 3 22 3 2 3 1.2.5.6 )( 1 1 1 . 2 .3.0) 1 1 . 2 (045.0 5.6 )( CZBZA ZZT ZW Z Z TZ Z T ZW ++ ++ = + + - + + - = Trong速達: TTC TB TTA 6.018.0 36.02 6.018.0 2 3 2 3 2 3 -+= -= ++= Ph-測ngtrnh速孫i s竪: )()(.2)([5.6)()().(. 222 22 33 2 3 ZYZZYZYZTZYCZZYBZZYA ++=++ Ph-測ngtrnhsai ph息nt-測ng速-測ngl袖:
  • 3. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 3 3222 2 33 /])[]1[.2]2[(5.6][]1[.(]2[ AkYkYkYTkYCkYBkY +++++-+-=+ Vy ph-測ngtrnhsai ph息nm束t其hth竪ngtheoph-測ngph存ps竪Tustinl袖: 322233 1212222 11111 /]))1[][*2]1[(***5.6]1[*][*(]1[ ][*]1[*][*]1[ ][*]1[*][*]1[ ][*03125.0][ AkYkYkYTTkYCkYBkY kYBkYBkYAkY kEBkEBkYAkY kYUkE -++++---=+ +++=+ +++=+ -= 則tnhqu存trnhqu存速辿c単ahth竪ngtad誰ngMatlab速kimtraxemhth竪ngc達脱n 速nhhay kh束ng: nh-sau: >> w1=tf([14.5],[3.77 1]); Transfer function: 14.5 ---------- 3.77 s+ 1 >> w2=tf([25],[.01 1]) Transfer function: 25 ---------- 0.01 s+ 1 >> w3=tf([6.5],[0.04 .3 1]) Transfer function: 6.5 -------------------- 0.045 s^2 + 0.3 s+ 1 Transfer function: 2356,25 -----------------------------------------------------
  • 4. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 4 0,001697s^4 + 0,1814 s^3 + 1,2161s^2 + 4,08 s+ 1 >> k= 0.03125; >> wk=feedback(wh,k) Transfer function: 2356,25 ----------------------------------------------------------------------- 0,01697s^4 + 0,1814 s^3 + 1,2167s^2 + 4,48s+51,78 >> step(wk) tac達速ctnhqu存速辿nh-sau: tnh qu存 trnh qu存 速辿b損ngph-測ngph存p TUSTIN: #include<iostream.h> #include<conio.h> #include<graphics.h> include<stdlib.h> float T,a1a,a2,a3,b1,b2,b3,c3,u; float y1[640] , y2[640] , y[640] , e[640] ; int gt , gm, i , k; voidmain() { cout<< nTinh qua trinh qua do he thong; cout<<nnhap buoc tinh T=; cin>>T; y[0] = 0; y[1]= 0; y1[0] = 0; y2[0] = 0; for(k=0; k<=630; k++) {
  • 5. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 5 ;/]))1[][*2]1[(***5.6]1[*][*(]1[ ];[*]1[*][*]1[ ];[*]1[*][*]1[ ];[*03125.0][ 322233 1212222 11111 AkYkYkYTTkYCkYBkY kYBkYBkYAkY kEBkEBkYAkY kYUkE -++++---=+ +++=+ +++=+ -= cout<< nttk=%3d y=%6.2f ,k,y[k] ; delay(1) ; } getch() ; gd= DETECT; initgraph(&gd,&gm,c:borlandc++bgi) ; setlinestyle(0,0,3) ; setbkcolor(0) ; setcolor(4) ; outtextxy(160,30,PHUONG PHAP SO TUSTIN) ; outtextxy(150,40,(He khong on dinh)) ; outtexexy(20,450,0) ; setcolor(5) ; rectangle(2,2,637,477) ; setcolor(1) ; for (i = i ; i<=10 ; i++) { line(64*i, 5, 64*i,15) ; line(64*i + 32, 5, 64*i + 32, 10) ; line(64*i, 475, 64*i, 464) ; line(64*i + 32475, 64*i + 32 , 468) ; line(5, 48*i, 10 , 48*i) ; } setcolor(2) ; moveto(1,477) ; for (k=0 ;k<= 630 ; k++) { lineto(k, 479 (int)(10*y[k]/1.6)) ; } outtextxy(580, 470 (int)(10*y[k]/1.6),y(t)) ; outtextxy(455, 450 (int)(10*y[k]/1.6),Tin hieu ra) ; getch() ; closegraph() ; return(0) ;} 3. Khi c達b辿PID v袖 c達kh息u W4(p) : a, khi b叩kh息uW4(p) tac達s測速奪kh竪i c単ah th竪ngnh-sau: Khi m他cn竪i tipb辿PID
  • 6. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 6 Tad誰ngMatlab速iuchnhc存cthams竪c単ab辿PID 速chhth竪ng脱n速nh: - Khi b辿PID m他cn竪i tiptac達c存cthams竪hiuchnh速overshoot kh束ngqu存 15% l袖: KP =0.01 ;KD = 0.1 ; KI = 0.5 ; tac達速奪th stepnh-sau: Tathy overshoot b損ng9.74% , risetimeb損ng1.9 (sec) v袖settingtimeb損ng6.35 (sec) Nh-vy cht l-樽nghth竪ng速孫t y捉ucu. Khi b辿PID m他ch巽nh樽p: W2(P) W3(P)W1(P) Kf PID
  • 7. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 7 Tac達速ctnhqu存速辿nh-sau:
  • 8. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 8 Hth竪ng脱n速nhv鱈i c存cthams竪nh-sau: Kp=0,01 ; Ki = 0,008 ; Kd= 0; b辿PID 2 c達:Kp=0,01 ; Ki = 0,005 ; Kd= 0,01 b, Khi b叩PID ly W4(p) tac達s測速奪kh竪i nh-sau: hiuchnhdnTdtac達: v鱈i Td= 20 速ctnhqu存 速辿c単ahth竪ngnh-sau: Ch-測ngtrnhMatlab: >> Td=20; >> W0=tf(8.5,[1.105 1]) Transfer function: 14.5 ----------- 3.77 s+ 1 >> W1=tf(25,[.01 1]) Transfer function: 25 ---------- 0.01 s+ 1 >> W2=tf(6.5,[.045 .03 1]) Transfer function:
  • 9. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 9 6.5 ---------------------- 0.045 s^2 + 0.03 s+ 1 >> W3=tf([Td0 0],[Td1]) Transfer function: 20 s^2 -------- 20 s+ 1 >> W12k=feedback(W1*W2,W3) Transfer function: 3250 s+ 162.5 ----------------------------------------------- 0.009 s^4 + 0.9064 s^3 + 3251 s^2 + 20.04 s+ 1 >> W012k=feedback(W0*W12k,.03125) Transfer function: 27625 s+ 1381 ---------------------------------------------------------------- 0.009945 s^5 + 1.011 s^4 + 3593 s^3 + 3273 s^2 + 884.4 s+ 44.16 >> step(W012k)
  • 10. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 10 Nhnxt : Tathy Overshoot =14,5% , settingTime= 46 sec cht l-樽ngh th竪ngt-測ng速竪i t竪t . 則奪thi Nyquist c単ahh谷nh-sau: >> nyquist(W0*W12k)
  • 11. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 11 c) Khi c達c其b辿PID v袖kh息uW4 tahiuchnhc存cthams竪速hc達sMAX <=10% S測速奪kh竪i :
  • 12. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 12 Taxhiuchnhc存cthams竪c単ab辿PID v袖Td 速h速孫t 速-樽ccht l-樽ngtheoy捉ucu : Tavm孫chtrongSIMULINK nh-sau: thay 速脱i c存cthams竪c単ab辿PID v袖Td , chohth竪ngch孫y , 谷c旦as脱chnhc単a MATLABtag但: >> plot(HUY); grid tac達d孫ngqu存速辿nh-sau:
  • 13. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 13 V鱈i c存cthams竪c単ab辿PID nh-sau: KP = 10 ; KI = 5; KD = 5 ; v袖Td = 0,001 tathy cht l-樽nghth竪ng速揃速孫t y捉ucu(overshoot = 0 % ; th棚i gian x存clpnh叩(10 sec). 4) Xt kh其n即ng速iukhin速-樽cv袖quans存t 速-樽cc単ahth竪ng Tac達h袖mtruync単ahth竪ngnh-sau: >> Wpid=tf(10)+tf(5,[1 0])+tf([5 0],1) Transfer function: 5 s^2 + 10 s+ 5 ---------------- s >> W1=tf(14.5,[3.77 1]) Transfer function: 14.5 ----------- 3.77 s+ 1 >> W2=tf(25,[.01 1]) Transfer function: 25 ----------
  • 14. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 14 0.01 s+ 1 >> Wdc=tf(6.5,[.045 .3 1]) Transfer function: 6.5 --------------------- 0.045 s^2 + 0.3 s+ 1 >> W3=tf(.001,[.001 1]) Transfer function: 0.001 ----------- 0.001 s+ 1 >> W1k=feedback(W2*Wdc,W3) Transfer function: 0.1625 s+ 162.5 ----------------------------------------------------------- 4.5e-007 s^4 + 0.000498 s^3 + 0.04831 s^2 + 0.311 s+ 1.163 >> Wh=Wpid*W1*W1k Transfer function: 6.906 s^3 + 6920 s^2 + 1.382e004 s+ 6906 ------------------------------------------------------------------------------ 4.972e-007 s^6 + 0.0005507 s^5 + 0.05388 s^4 + 0.392 s^3 + 1.596 s^2 + 1.163 s >> Wk=feedback(Wh,.03125) Transfer function: 6.906 s^3 + 6920 s^2 + 1.382e004 s+ 6906 -------------------------------------------------------------------------------- 4.972e-007 s^6 + .0005507 s^5 + 0.05388 s^4 + 0.6078 s^3 + 217.8 s^2 + 433 s+ 215.8 Vy tac達ph-測ngtrnh速ctnhc単ahl袖: s6 +1107,6s5 +10,8.104 s4 +12,2.105 s3 +43,8.107 s2 +87,07.107 s+43,4.107 =0 Tad誰ngMatLab速tnhmatrn速iukhinnh-sau: >> A=[-1107.6 1 0 0 0 0;-10.8*10^4 0 1 0 0 0;-12.5*10^5 0 0 1 0 0;-43.8*10^7 0 0 0 1 0;- 87.08*10^7 0 0 0 0 1;-43.4*10^7 0 0 0 0 0] A =1.0e+008 *
  • 15. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 15 -0.0000 0.0000 0 0 0 0 -0.0011 0 0.0000 0 0 0 -0.0125 0 0 0.0000 0 0 -4.3800 0 0 0 0.0000 0 -8.7080 0 0 0 0 0.0000 -4.3400 0 0 0 0 0 >> B=[0;0;6.906;6920;1.382e004;6906] B= 1.0e+004 * 0 0 0.0007 0.6920 1.3820 0.6906 >> P=[BA*BA^2*BA^3*BA^4*BA^5*B] P= 1.0e+013 * 0 0 0.0000 -0.0000 0.0000 -0.0000 0 0.0000 0.0000 -0.0000 0.0000 -0.0010 0.0000 0.0000 0.0000 -0.0000 -0.0002 0.0219 0.0000 0.0000 0.0000 -0.0003 0.0313 -3.2440 0.0000 0.0000 0 -0.0006 0.0632 -6.5435 0.0000 0 0 -0.0003 0.0316 -3.2770 >> det(P) ans= 5.2854e+029 Tathy det(P) kh存c0 vy Rank(P) =6 hay hth竪ng速iukhin速-樽cho袖nto袖n. Taxt tnhquans存t 速-樽cc単ahth竪ng: >> C=[1 0 0 0 0 0] C = [1 0 0 0 0 0] ans=
  • 16. B袖i tp l鱈n: LT則KT則 Sinh vi捉n : T畉 Vn Ti畉n_ DHDI7TH 16 1 0 0 0 0 0 >> A' ans= 1.0e+008 * -0.0000 -0.0011 -0.0125 -4.3800 -8.7080 -4.3400 0.0000 0 0 0 0 0 0 0.0000 0 0 0 0 0 0 0.0000 0 0 0 0 0 0 0.0000 0 0 0 0 0 0 0.0000 0 >> L=[C' A'*C' (A')^2*C' (A')^3*C' (A')^4*C' (A')^5*C'] L = 1.0e+015 * 0.0000 -0.0000 0.0000 -0.0000 0.0011 -1.1220 0 0.0000 -0.0000 0.0000 -0.0000 0.0011 0 0 0.0000 -0.0000 0.0000 -0.0000 0 0 0 0.0000 -0.0000 0.0000 0 0 0 0 0.0000 -0.0000 0 0 0 0 0 0.0000 >> det(L) ans= 1 Tathy det(L) kh存c0 , vy hth竪ngquans存t 速-樽cho袖nto袖n.