You are on page 1of 14

1

Trng i hc Cng nghip Tp. H Ch Minh


Khoa Cng ngh in t
Bmn in t t ng

Bi ging
Hng dn th nghim iu khin t ng (B sung)
Bin son: ThS. Hunh Minh Ngc

Lu hnh ni b
Tp. H Ch Minh , thng 4/2013

Bi 1: Kho st h thng iu khin t ng dng Matlab.


Bn c xem gio trnh th nghim iu khin t ng ca
ngh in t.
Bi 2: Thit k h thng iu khin t ng dng Matlab.
Bn c xem gio trnh th nghim iu khin t ng ca
ngh in t.
Bi 3: Kho st v m phng h thng iu khin t
Simulink.
Bn c xem gio trnh th nghim iu khin t ng ca
ngh in t.

Khoa Cng

Khoa Cng
ng dng
Khoa Cng

Bi 3: Kho st v m phng h thng t ng dng Simulink.


B sung:
3.3.3. M phng h thng iu khin: ng c mt chiu, h thng con lc
ngc.
Mo ta he con lac ngc
He con lac ngc hnh ve. He gom co thanh cng va xe tren o thanh c treo.
Xe di chuyen tren ng ray ti phai hay trai, phu thuoc vao lc tac ong vao xe.
Thanh ch co mot bac t do (quay quanh iem treo). Nhiem vu ieu khien chnh la gi
con lac can bang thang ng va xe trong pham vi ng ray.
1.Mo hnh hoa
Mo hnh toan he con lac ngc tren xe :

Hnh 9.56: He con lac ngc

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

3
Gia s khoi lng vat nang tap trung gia con lac.
Xem xet con lac tren xe minh hoa hnh 9.56. Chung ta ky hieu la goc so vi
phng thang ng, L=2l , m va J la chieu dai, khoi lng va moment quan tnh tam
trong lng con lac; M the hien khoi lng xe, va G the hien tam trong lng con lac.
Toa o theo truc hoanh va truc tung cua con lac c cho bi :

x=X +
y=

L
sin = X + l sin
2

(4.1)

L
cos = l cos
2

(4.2)

Fy
G

Fx
fx

mg

Fx
Fy

Mg
Fy/2

Fy/2

Hnh 9.57: S o than t do cua he con lac ngc tren xe.


S o than t do cua xe va con lac c minh hoa hnh 9.57, trong o Fx va Fy the
hien lc phan ng tai iem truc. Xem xet con lac ngc trc. Tong lc ta co cac
phng trnh sau :

Fx = mX&& + ml&& cos ml& 2 sin

(4.3)

Fy mg = ml&&sin ml& 2 cos

(4.4)

Fy l sin Fx l cos = J&&

(4.5)

Xem xet lc phng ngang tac ong len xe, ta co la :

MX&& = f x Fx

(4.6)

Thay (4.6) vao (4.3), ta c :

( M + m) X&& + ml (cos )&& ml (sin )& 2 = f x

(4.7)

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

4
S dung (4.3), (4.4), (4.5) va tnh toan rut gon , ta at c :

mX&& cos +

4 &&
ml mg sin = 0
3

(4.8)

Phng trnh (4.7) va (4.8) mo ta ong lc hoc he con lac ngc .


.

nh ngha bien trang thai x1 = , va x 2 =


Ta suy ra :

&& =

g sin aml& 2 sin cos a cos . f x


4l
aml (cos ) 2
3

( M + m) g sin ml& 2 sin cos cos . f x


hay : && =
4l ( M + m)
ml (cos ) 2
3

trong o chung ta a thay

J=

mL2
1
, va a =
12
M +m

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

(4.9)

5
V tr xe :

f + ml[sin( )& 2 cos( )&&]


X&& = x
M +m
4
4
f x + ml sin( )& 2 mg sin( ) cos( )
3
&& = 3
hay : X
4
( M + m) m(cos ) 2
3

(4.10)

trong o , thong so con lac la :


Khoi lng xe M=1 kg, khoi lng con lac m=0,1 kg, na chieu dai con lac l=0,5 m , gia toc
trong trng g=9,8 m/s2 .
Yeu cau : Tuyen tnh hoa he tai vi tr can bang = 0
Phng trnh (4.9) va (4.10) c dung mo ta ac tnh ong cua oi tng.
Phng trnh phi tuyen (4.7) va (4.8) mo ta he.
e ieu khien PID ta phai tuyen tnh hoa he tai vi tr can bang = 0 . Gia s goc u nho e
chung ta xap x sin = , cos =1 va & 2 =0. Khi o thay cac xap x nay vao (4.7) va (4.8) ta co

( M + m) X&& + ml&& = f x (4.11)


mX&& +

4 &&
ml = mg. (4.12)
3

Trc tien chung ta tm ham truyen cua he con lac ngc. Lay bien oi Laplace hai ve (4.11) va
(4.12) vi ieu khien au zero ta c:

( M + m) s 2 . X ( s ) + mls 2 ( s ) = u (4.13)

ms 2 X ( s ) +

4
mls 2 ( s ) = mg ( s ) (4.14)
3

V (s ) la goc lech so vi phng thang ng, nh la ham cua trang thai X(s). Giai phng trnh
(4.14) ta c

g 4.l
X ( s ) = 2 . ( s ) (4.15)
3
s
Thay phng trnh (4.15) vao (4.13), ta c:

g 4.l
( M + m) 2 s 2 . ( s ) + mls 2 ( s) = U ( s ) (4.16)
3
s
Sap xep lai ta c ham truyen sau:

( s)
=
U (s)

1
(4.17)
4( M + m)l 2
(ml
).s + ( M + m) g
3

Bieu dien he dang khong gian trang thai, ta at

x1
x
2

x3
x 4

=
= &
=x
= x&

(4.18)

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

4
u mg
(4.19)
X&& = 3
1
( 4 M + m)
3
( M + m ) g u
&& =
(4.20)
4l ( M + m)
ml
3
Phng trnh tuyen tnh hoa co the c bieu dien nh sau:

x&1 = x 2

( M + m) g
1
x1
.u
x& 2 =

(4 / 3).l ( M + m) ml
(4 / 3).l ( M + m) ml
(4.21)

x& 3 = x 4

mg
4

x& 4 =
x1 +
.u

(1 / 3)(4 M + m)
( 4 M + m)
Viet lai (4.21) di dang ma tran:

( M + m) g
x&1 4
l ( M + m) ml
x& 2 3
x& =
0
3
mg
x&
4 1

( 4 M + m)
3

1 0 0
0

1
0 0 0 x1

x
l ( M + m) ml
2 +

.u (4.22)
3

0 0 1 x3

4
0 0 0 x 4

( 4 M + m)

V ta xet v tr xe va v tr goc cua con lac, ngo ra nh sau:

x1

y1 (t ) 1 0 0 0 x 2 0

=
+ .u (4.23)
y 2 (t ) 0 0 1 0 x3 0
x
4
Thay gia tr M=1 kg; m=0,1 kg;l=0,5m;g=9,8m/s2 vao (4.22), ta c:

x&1 0

x& 2 15,78
x& = 0
3
x& 0,717
4

1 0 0 x1 0

0 0 0 x 2 1,463
+
.u (4.24)
0 0 1 x3 0

0 0 0 x 4 0,975

Yeu cau : Tuyen tnh hoa he tai vi tr can bang = 0 . Tm phng trnh trang thai mo ta he
dang lien tuc. iu khin PID lien tc.
Tp tin .m sau s tm hm truyn con lc ngc: htconlac.m
M=1
m=0.1
g=9.8

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

7
l=0.5
numplant=[0 1]
denplant=[(m*l-4*(M+m)*l/3)
g=tf(numplant,denplant)

(M+m)*g]

Lnh Matlab:
>> htconlac
M=
1

m=
0.1000

g=
9.8000

l=
0.5000

numplant =
0

denplant =
-0.6833

0 10.7800

Transfer function:

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

8
-1
-----------------0.6833 s^2 - 10.78
>>
p ng xung:
>>impulse(g)

Tp tin .m dung tnh ton m hnh khng gian trng thi: ptttconlac.m
M=1
m=0.1
l=0.5
g=9.8
a21=(M+m)*g/((4*l*(M+m)/3)-m*l)
a41=(-3*m*g/(4*M+m))
A=[0 1 0 0;a21 0 0 0;0 0 0 1;a41
B=[0;-1/(4*l*(M+m)/3-m*l);0;4/(4*M+m)]
C=[1 0 0 0;0 0 1 0]
D=[0;0]
hpttt=ss(A,B,C,D)

0]

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

hay
M=1
m=0.1
l=0.5
g=9.8
A=[0 1 0 0;
(M+m)*g/(4*l*(M+m)/3-m*l) 0 0 0;
0
0 0 1;
-3*m*g/(4*M+m) 0 0 0]
B=[0;-1/(4*l*(M+m)/3-m*l);0;4/(4*M+m)]
C=[1 0 0 0;0 0 1 0]
D=[0;0]
pttt=ss(A,B,C,D)

>> ptttconlac
M=
1

m=
0.1000

l=
0.5000

g=
9.8000

a21 =
15.7756

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

10
A41 =
-0.7171

A=
0 1.0000
15.7756
0

0
0

-0.7171

0
0

1.0000
0

B=
0
-1.4634
0
0.9756

C=
1

D=
0
0

Continuous-time model.
>>
S Simulink:

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

11

Step: gi tr t l 0.
Lc a vo xe c them vo nh nhiu xung .

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

12

B iu khin PID:
Gpid(s)=kp+ki/s+kd.s

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

13

Kp=1,Ki=1
Kd=0
V tr gc theta:

V tr xe x:

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc

14

3.4. Kim tra nh gi

Hng dn th nghim iu khin t ng (b sung)-Hunh Minh Ngc