You are on page 1of 66

Trang 1

LUN VN TT NGHIP I HC
TI: NGHIN CU V THIT K B KHI NG MM
CHO NG C KHNG NG B 3 PHA
Sinh vin thc hin Cn b hng dn:

Nguyn Phi Cng (1063853) Nguyn Vn Khanh
Trn Quc Vit (1063935)

CN TH 8/5/2010
Chuong I: TNG QUT
1.1. T VN
Nhng thnh tu ca khoa hc v k thut c nhiu ng dng rt ln
trong cuc sng cng nh trong cng nghip hin nay. em n cho chng ta
v s nhng thnh qu to ln nh ng dng iu khin cc thit b in, ng c
in nh qut v ng c bm..
Ni dung chnh ca ti m chng em thc hin l NGHIN CU V
THIT K B KHI NG MM CHO NG C KHNG NG B 3
PHA.
ng c khng ng b ba pha c dng rng ri trong cng nghip, v
chng c cu trc n gin, lm vic vi tin cy, nhng c nhc im l
dng in khi ng ln, gy ra st p trong li in.V vy ti ca chng
em l phi nghin cu v thit k b khi ng mm iu khin sao cho c th
lm hn ch dng in khi ng , ng thi iu chnh tng m men m my
mt cch hp l, cho nn cc chi tit ca ng c chu dn nn v c kh t
hn, tng tui th lm vic an ton cho ng c. Ngoi vic trnh dng nh
trong khi khi ng ng c, cn lm cho in p ngun n nh hn khng gy
nh hng xu n cc thit b khc trong li in.
1.2. TM QUAN TRNG CA VN
ng dng ca b khi ng mm c ngha rt ln v rt quan trng trong
cng nghip v n tit kim in nng rt ln, tng tui th lm vic ca ng c
hot ng v khng nh hng n cc thit b khc trong li in khi ng c
vn hnh.ng dng ny rt c gi tr iu khin in p t vo ng c s
gim dng khi ng xung cn 1.5 n 3 ln dng nh mc, ph thuc vo
ch ti v khi ng c c ng trc tip vo li in dng khi ng ca
ng c khng ng b s rt ln t 5 n 7 ln ng nh mc.iu ny gy
nh hng rt ln n cc thit b dng in khc nht l khi cng sut li b
gii hn hay cui ng dy c st p ln.C th tng dn in p theo mt
chng trnh thch hp in p tng tuyn tnh t mt gi tr xc nh n in
p nh mc.

Trang 2
1.3. GII HN VN
ti NGHIN CU V THIT B KHI NG MM CHO NG
C KHNG 3 PHA c th gii quyt c vn gim dng khi cho ng
c khi khi ng v iu khin in p u cc ng c nhng vn hn ch l
cha th nghin cu su hn na nhng tnh nng thc ca b khi ng mm
c bn trn th trng hin nay nh: bo v qu nhit cho ng c, tch hp
hnh thc giao tip mng kiu Modbus, iu khin kt hp vi contactor ni tt
khi iu khin xong trnh tn hao nhit, c cc ng vo ra a chc nng.
Do thi gian thc hin ti ny ch trong 6 tun,vi kin thc cng cn hn
ch nn cng gp nhiu kh khn trong qu trnh thc hin.Nhng chng em
c gn hon thnh tt ti ny.
Nhm thc hin nghin cu ti vi nhng c im chnh sau y:
Thit k mch iu khin trong b khi ng mm
Lp trnh bng vi iu khin AT89S52
Thit k mch ng lc
1.4. MC CH NGHIN CU
ti chng em tm hiu v ng c khng ng b 3 pha v nghin cu
v thit k b khi ng mm. Mc ch thc hin ca ti l nghin cu
nguyn l v thit k mch in t cng nh tm hiu v tp lnh ca vi iu
khin lp trnh iu khin ng c.
Trong qu trnh thc hin ti ny cng c nhiu sai st hy vng qu thy
thng cm v b qua,chng em xin chn thnh cm n qu thy.
Trang 3
CHNG 2. C S L THUYT
2.1. NG C KHNG NG B BA PHA
2.1.1 i cng v ng c khng ng b
ng c khng ng b ba pha do kt cu n gin, lm vic chc chn,
s dng v bo qun thun tin, gi thnh r nn c s dng rng ri trong nn
kinh t quc dn, nht l loi cng sut di 100 kW.
ng c in khng ng b rto lng sc cu to n gin nht nht l
loi rto lng sc c nhm) nn chim mt s lng kh ln trong loi ng c
cng sut nh v trung bnh. Nhc im ca ng c ny l iu chnh tc
kh khn v dng in khi ng ln thng bng 6-7 ln dng in nh mc.
b khuyt cho nhc im ny, ngi ta ch to ng c khng ng b rto
lng sc nhiu tc v dng rto rnh su, lng sc kp h dng in khi
ng, ng thi tng mmen khi ng ln.
ng c in khng ng b rto dy qun c th iu chnh tc c tc
trong mt chng mc nht nh, c th to mt mmen khi ng ln m
dng khi ng khng ln lm, nhng ch to c kh hn so vi vi loi rto
lng sc, do gi thnh cao hn, bo qun cng kh hn.
Trang 4
ng c in khng ng b c sn xut theo kiu bo v IP23 v kiu
kn IP44. Nhng ng c in theo cp bo v IP23 dng qut gi hng tm t
hai u rto ng c in. Trong cc ng c rto lng sc c nhm th cnh
qut nhm c c trc tip ln vnh ngn mch. Loi ng c in theo cp
bo v IP44 thng nh vo cnh qut t ngoi v my thi gi mt
ngoi v my, do tn nhit c km hn do vi loi IP23 nhng bo dng
my d dng hn.
Hin nay cc nc sn xut ng c in khng ng b theo dy tiu
chun. Dy ng c khng ng b cng sut t 0,55-90 KW k hiu l K theo
tiu chun Vit Nam 1987-1994 c ghi trong bng 10-1 (Trang 228 TKM).
Theo tiu chun ny, cc ng c in khng ng b trong dy iu ch to
theo kiu IP44.
Ngoi tiu chun trn cn c tiu chun TCVN 315-85, quy nh dy cng
sut ng c in khng ng b rto lng sc t 110 kW-1000 kW, gm
c cng sut sau: 110,160, 200, 250, 320, 400, 500, 630, 800 v 1000 kW.
K hiu ca mt ng c in khng ng b rto lng sc c ghi theo
k hiu v tn gi ca dy ng c in, k hiu v chiu cao tm trc quay, k
hiu v kch thc lp t d trc v k hiu v s trc.
2.1.2. Nguyn l lm vic ca ng c khng ng b
ng c khng ng b ba pha c hai phn chnh: stato (phn tnh) v
rto (phn quay). Stato gm c li thp trn c cha dy qun ba pha.
Khi u dy qun ba pha vo li in ba pha, trong dy qun s c cc
dng in chy, h thng dng in ny tao ra t trng quay, quay vi tc :
p
f
n
1
1
* 60
Trong :
-f
1
: tn s ngun in
-p: s i cc t ca dy qun
Trang 5
Phn quay, nm trn trc quay bao gm li thp rto. Dy qun rto bao
gm mt s thanh dn t trong cc rnh ca mch t, hai u c ni bng hai
vnh ngn mch.
2
n
n
2
n
1
1
n
s
1
N1
dt
F
dt
F
T trng quay ca stato cm ng trong dy rto sc in ng E, v dy
qun stato kn mch nn trong c dng in cha. S tc dng tng h gia
cc thanh dn mang dng in vi t trng ca my to ra cc lc in t F
t
tc
dng ln thanh dn c chiu xc nh theo quy tc bn tay tri.
Tp hp cc lc tc dng ln thanh dn theo phng tip tuyn vi b mt
rto to ra mmen quay rto. Nh vy, ta thy in nng ly t li in c
bin thnh c nng trn trc ng c. Ni cch khc, ng c khng ng b l
mt thit b in t, c kh nng bin in nng ly t li in thnh c nng
a ra trn trc ca n. Chiu quay ca rto l chiu quay ca t trng, v vy
ph thuc vo th t pha ca in p li t trn dy qun stato. Tc ca
rto n
2
l tc lm vic v lun lun nh hn tc t trng v ch trong
trng hp mi xy ra cm ng sc in ng trong dy qun rto. Hiu s
tc quay ca t trng v rto c c trng bng mt i lng gi l h s
trt s:
1
2 1
n
n n
s

Trang 6
Khi s=0 ngha l n
1
=n
2
, tc rto bng tc t trng, ch ny gi
l ch khng ti l tng (khng c bt c sc cn no ln trc). ch
khng ti thc, s 0 v c mt t sc cn gi, ma st do bi
Khi h s trt bng s=1, lc rto ng yn (n
2
=0), momen trn trc
bng momen m my.
H s trt ng vi ti nh mc gi l h s trt nh mc. Tng ng
vi h s trt ny gi tc ng c gi l tc nh mc.
Tc ng c khng ng b bng:
) 1 ( *
1 2
s n n
Mt c im quan trng ca ng c khng ng b l dy qun stato
khng c ni trc tip vi li in, sc in ng v dng in trong rto c
c l do cm ng, chnh v vy ngi ta cng gi ng c ny l ng c cm
ng.
Tn s dng in trong rto rt nh, n ph thuc vo tc trt ca
rto so vi t trng:
1
1
2 1 1 2 1
2
*
* 60
) ( * *
60
* f s
n
n n n p n n
p f

ng c khng ng b c th lm vic ch my pht in nu ta


dng mt ng c khc quay n vi tc cao hn tc ng b, trong khi cc
u ra ca n c ni vi li n. N cng c th lm vic c lp nu trn
u ra ca n c kch bng cc t in.
ng c khng ng b c th cu to thnh ng c mt pha. ng c
mt pha khng th t m my c, v vy khi ng ng c mt pha cn
c cc phn t khi ng nh t in, in tr
Khi nam chm in quay ( tc n1 vng/ pht ) lm ng sc t quay ct
qua cc cnh ca khung dy cm ng gy nn sc in ng E trn khung dy.
Sc in ng E sinh ra dng in I chy trong khung dy. V dng in I nm
Trang 7
trong t trng nn khi t trng quay lm tc ng ln khung dy mt lc in
t F. Lc in t ny lm khung dy chuyn ng vi tc n vng/ pht.

2.1.3. Cu to
a) Phn tnh (Stato)
Stato c cu to gm v my,li st v dy qun
V my
V my c tc dng c nh li st v dy qun, khng dng lm mch
dn t.
Thng v my c lm bng gang. i vi my c cng sut tng i
ln ( 1000kW ) thng dng thp tm hn li lm thnh v my. Tu theo
cch lm ngui my m dng v cng khc nhau.
Li st
Li st l phn dn t. V t trng i qua li st l t trng quay nn
gim tn hao li st c lm bng nhng l thp k thut in p li. Khi ng
knh ngoi li st nh hn 90 mm th dng c tm trn p li. Khi ng knh
ngoi ln hn th dng nhng tm hnh rqut (hnh 2) ghp li.
Dy qun
Dy qun stator c t vo cc rnh ca li st v c cch in tt vi
li st.
b)Phn quay (roto)
Rotor c 2 loi chnh : rotor kiu dy qun v rotor kiu lng sc.
Rotor dy qun :
Rto c dy qun ging nh dy qun ca stator. Dy qun 3 pha ca rto
thng u hnh sao cn ba u kia c ni vo vnh trt thng lm bng
ng t c nh mt u trc v thng qua chi than c th u vi mch in
bn ngoi. c im l c th thng qua chi
than a in tr ph hay sut in ng ph vo mch in rto ci thin tnh
nng m my, iu chnh tc hoc ci thin h s cng sut ca my. Khi my
lm vic bnh thng dy qun rotor c ni ngn mch. Nhc im so vi
Trang 8
ng c rotor lng sc l gi thnh cao, kh s dng mi trng khc nghit,
d chy n .
Rotor lng sc :
Kt cu loi dy qun ny rt khc vi dy qun stator. Trong mi rnh ca
li st rotor t vo thanh dn bng ng hay nhm di ra khi li st v c
ni tt li hai u bng hai vnh ngn mch bng ng hay nhm lm thnh
mt ci lng m ngi ta quen gi l lng sc.
c ) Khe h khng kh
V rotor l mt khi trn nn khe h u. Khe h trong my in khng
ng b rt nh hn ch dng in t ha ly t li v nh vy mi c th
lm cho h s cng sut ca my cao hn.
2.1.4 ng dng :
ng c khng ng b l loi my in xoay chiu ch yu dng lm ng
c in. Do kt cu n gin, lm vic chc chn, hiu sut cao, gi thnh h nn
ng c khng ng b l loi my c dng rng ri Trong i sng hng
ngy,ng c khng ong b ngy cng chim mt v tr quan trng vi nhiu
ng dng trong cng nghip, nng nghip va trong i
sng hang ngay.
ng dng ca ng c khng ng b
Ngy nay, cc h thng truyn ng in c s dng rt rng ri trong
cc thit b hoc dy chuyn sn xut cng nghip, trong giao thng vn ti,
trong cc thit b in dn dng, . .
. c tnh c khong 50% in nng sn xut ra c tiu th bi cc h
thng truyn ng in.
H truyn ng in c th hot ng vi tc khng i hoc vi tc
thay i c. Hin nay khong 75 . 80% cc h truyn ng l loi hot ng
vi tc khng i.
Vi cc h thng ny, tc ca ng c hu nh khng cn iu khin tr
cc qu trnh khi ng v hm. Phn cn li, l cc h thng c th iu chnh
c tc phi hp c tnh ng c v c tnh ti theo yu cu. Vi s
pht trin mnh m ca k thut bn dn cng sut ln v k thut vi x l, cc
Trang 9
h iu tc s dng k thut in t ngy cng c s dng rng ri v l cng
c khng th thiu trong qu trnh t ng ha.
ng c khng ng b c nhiu u im nh: kt cu n gin, lm vic
chc chn, hiu sut cao, gi thnh h, c kh nng lm vic trong mi trng
c hi hoc ni c kh nng chy n cao. V nhng u im ny nn ng c
khng ng b c ng dng rt rng ri trong cc ngnh kinh t quc dn vi
cng sut t vi chc n hng nghn kW. Trong cng nghip, ng c khng
ng b thng c dng lm ngun ng lc cho cc my cn thp loi va v
nh, cho cc my cng c cc nh my cng nghip nh . . . Trong nng
nghip, c dng lm my bm hay my gia cng nng sn phm. Trong i
sng hng ngy, ng c khng ng b ngy cng chim mt v tr quan trng
vi nhiu ng dng nh: qut gi, ng c trong t lnh, my quay da,. . . Tm
li, cng vi s pht trin ca nn sn xut in kh ha v t ng ha, phm vi
ng dng ca ng c khng ng b ngy cngrng ri.
So vi my in DC, vic iu khin my in xoay chiu gp rt nhiu
kh khn bi v cc thng s ca my in xoay chiu l cc thng s bin i
theo thi gian, cng nh bn cht phc tp v mt cu trc my ca ng c in
xoay chiu so vi my in mt chiu.
Cho nn vic tch ring iu khin gia moment v t thng c th iu
khin c lp i hi mt h thng c th tnh ton cc nhanh v chnh xc trong
vic qui i cc gi tr xoay chiu v cc bin n gin . V vy, cho n gn
y, phn ln ng c xoay chiu lm vic vi cc ng dng c tc khng i
do cc phng php iu khin trc y dng cho my in thng t v c
hiu sut km. ng c khng ng b cng khng trnh khi nhc im ny.
Nhng kh khn trong vic ng dng ng c xoay chiu chnh l lm th
no c th d dng iu khin c tc ca n nh vic iu khin ca
ng c DC. V vy, mt tng v vic bin i mt my in xoay chiu
thnh mt my in mt chiu trn phng din iu khin ra i. y chnh
l iu khin vector. iu khin vector s cho php iu khin t thng v
moment hon ton c lp vi nhau thng qua iu khin gi tr tc thi ca
dng (ng c tip dng) hoc gi tr tc thi ca p (ng c tip p).
Trang 10
iu khin vector cho php to ra nhng phn ng nhanh v chnh xc ca
c t thng v moment trong c qu trnh qu cng nh qu trnh xc lp ca
my in xoay chiu ging nh my in mt chiu. Cng vi s pht trin ca
k thut bn dn v nhng b vi x l c tc nhanh v gi thnh h, vic ng
dng ca iu khin vector ngy cng c s dng rng ri trong nhiu h
truyn ng v tr thnh mt tiu chun cng nghip.Vi s pht trin nhanh
chng, ngnh cng nghip t ng lun i hi s ci tin thng xuyn ca cc
loi h truyn ng khc nhau. Nhng yu cu ci tin ct yu l tng tin cy,
gim kh nng tiu th in nng, gim thiu chi ph bo dng, tng chnh
xc v tng kh nng iu khin phc tp. V vy, nhng h truyn ng vi
ng c in mtchiu ang dn thay th bi nhng h truyn ng ng c
xoay chiu s dng iu khin vector. Bi v, l do chnh s dng rng ri
ng c in mt chiu trc kia l kh nng iu khin c lp t thng v
moment lc nu cng nh cu trc h truyn ng kh n gin. Tuy nhin,
chi ph mua v bo tr ng c cao, c bit khi s lng my in phi dng
ln. Trong khi , cc ng dng thc t ca l thuyt iu khin vector c
thc hin t nhng nm 70 vi cc mch iu khin lin tc. Nhng cc mch
lin tc khng th p ng c s i hi phi chuyn i tc thi ca h quy
chiu quay do iu ny i hi mt khi lng tnh ton trong mt thi gian
ngn.
S pht trin ca nhng mch vi x l lm thay i vic ng dng ca l
thuyt iu khin vector. Kh nng ti u trong iu khin qu ca iu khin
vector l nn mng cho s pht trin rng ri ca cc h truyn ng xoay chiu
(v gi thnh ca ng c xoay chiu rt r hn so vi ng c mt chiu).
Ngoi nhng pht trin trong iu khin vector, mt s pht trin ng ch
khc chnh l vic ng dng mng neural (neural networks) v logic m (fuzzy
logic) vo iu khin vector ang l nhng ti nghin cu mi trong nghin
cu h truyn ng. Hai k thut iu khin mi ny s to nn nhng ci tin
vt bc cho h truyn ng ca my in xoaychiu trong mt tng lai gn.
Trang 11
2.2 MCH CHNH LU CU
2.2.1 S mch chnh lu :
S chnh lu cu mt pha
Cu chnh lu mt pha gm 2 thyristor (T) v 2 Diode (T) chia lm hai nhm :
- Nhm Anode chung : T1,T3
- Nhm cathod chung :T2,T4.
in p pha th cp ca bin p (xoay chiu)
-
U
2
=U
m
sin t = U
m
sin
gc l gc m ca thyristor cho dng chy qua.
2.2.2 Hot ng ca s
Trng hp ti l ng c (c sc in E).
-
na chu k dng in p ngun xoay chiu u
2
=U
m
sin t.T1,T2 ch dn sau
thi im v l mi ca u
2
(t) > E
d

cho in p trn van l dng U
ak
= U
2
(t)-E
d
>0 v m van, im
- t = , pht xung vo cng G van T1,T2 lm chng dn, t lm
xut hin dng in ti i
d
. n na chu k sau, ti thi im +
Trang 12
Hnh 2-1 :S chnh lu cu 1 pha
T
1
T
3
T
2
T
4
U
2
= U
m
.sin t U

L
p
(Cathode)
(Anode)
I
d
cho xung pht voo cc khin G ca T3,T4 m chung, lc ny c hai
kh nng xy ra :
a. Khi dng ti qua T1,T2 thi im + cha tr v 0 ngay do tnh im
cm ca mch dng ti vn tn ti v chuyn sang cho 2 : T3,T4 van va m, ta c
dng in lin tc vi mi thi im.
b. Khi dng ti qua T1,T2 gim v 0 (c hai kh li) trc khi T3,T4 m.
Ta c dng in gin on,v c thi im dng in i
d
=0.C 4 van u khng dn
in.Ranh gii gia hai ch ny goi l ti hn, gc iu khin tng ng gi l
gc iu khin ti hn.
2.2.3 Trng thi lm vic ca mch chnh lu :
Trng thi mch khi T1,T2 dn dng :
Trng thi mch khi T1,T2 dn dng :
Qu trnh dng pha : theo nh lut Kirchop
i
2
= iT
1
iT
4
(2.1)
p chnh lu :
u
d
= UdA udc (2.2)
Mch cu mt pha to ra in p chnh lu hai xung.Thnh phn hai ca n c
bin bng bin ca hiu in p pha.
Trang 13
Hnh 2-2 :Trng thi mch khi T
1
v T
2
dn dng
T
1
T
2
u = u

A-u

C
Ti
I
d
(Cathode)
(Anode)
i
2
u
1
u
2
u

A
u

C
Khi cu lm vic lun c mt thyristor,mt T ca nhmm anode mt T ca nhm
cathod cng ng cho dng chy qua.
2.2.4 Ga tr trung bnh ca in p chnh lu:
in p trung bnh do nhm anode:
U
d
=

+


) 1 (cos sin
1 1
m
m c
U
XdX U dX U
(2.3)
U
d
= ) 1 (cos
2
+

U (2.4)
Vi O< < in p chnh lu trung bnh iu khin thay i trong khong
0 < U
d
( ) < + U

2

(2.5)
Quan h U
d
( ) ca (2.4) nh hnh 2-3 :
Quan h U

( )
Trang 14
U

( )(v)
(rad)
0
2U
d0
Hnh 2-3 : Quan h U

( )
Dng quan mi thyristor :
iT = id =
Rdt
Ldia
R
E
R
sim U
m

dng trung bnh chy qua mi thyristor:


IT=

,
_



.
2
sin
1
2
1
2
1 Id
d
dt
di
X E U
R
idd
m
(2.6)
Tr hiu dng dng qua cun th cp m ba:
I2 =

1
2
1
0
2
Id d Id (2.7)
in p ngc cc i t ln SCR bng bin in p ngun U
m
.
Gia tr cc i ca in p ngc c trn mi thyristor.
U
ngmax
=
m
U U
2
2 (2.8)
2.2.5 CC TRNG THI DNG P CA MCH CHNH LU :
Mch cu mt pha c khong dn dng l :
=

p
2
C gc kch ban u l:

0
=
0
2

p


a.Trng thi dng lin tc:
Phng trnh cn bng p ca mch :
R
id
+ L
sin
m
U E
dt
di
+
(2.9)
Gii phng trnh vi phn trn c :
id= idxl + idtd
idxl l thnh phn dng xc lp.
idtd l thnh phn dng in t do.
Trng thi xc lp:
idxl =
R
E
Z
U
m
) sin( (2.10)
Trong :
Trang 15
Z =
2 2 2
L R + l tng tr mch ti.
=arctg
R
L
l gc lch pha gia dng v p ngun.
T Z v ,biu thc dng c vit li :
idxl =
R
E
R
U
m
) sin( cos (2.11)
Khi =
0
= th id =Id
o
:
idtd =

g
L
R
L
Rt
Ae Ae Ae
cot
0



Ia
0
= id =


g m
Ae
R
E
R
U
cot
) cos(

+
A =

g
m
e
R
E
R
U
Ia
cot
0
cos

+
ia=
[ ] [ ]

'

+ )
0
sin( cos
cot )
0
(
)
0
sin( cos
0
1



m
U E
g a
e
m
U E RIa
R
(2.12)
Tr trung bnh dng Id:
Id =

1
1
]
1

0
0
sin
2
1
2
1
Ia
Ia
m
d L Ed U idd
Trong :


0
0
0
Ia
Ia
d L
Nn :
Id= ( )

2
. 1 cos
2
2
2

+
R
E
U
R
(2.13)
p chnh lu trung bnh:
Ud =

) 1 (cos
2
sin
1
2
U d U
m
(2.14)
b. Trng thi dng gin on:
Trang 16
C nhng khng thi gian t dng i
d
=0.Nguyn nhn L trong h thng qu nh
hoc dng phn ng ng c i
d
=0.Nng lng tch lu trn cun khng L khng
d duy tr tnh lin tc ca dng i
d
khi dng i
d
gim qua tr s 0.
Khi i
d
gim trc khi m :
L sin
m d
d
U Ri E
dt
di
+ + (
0

0 +
) (2.15)
n gin cho php tnh, cho R
u
=0
L
sin
m
d
U E
dt
di
+
i
d
=

0
) sin (
1
d E U
L
m
i
d
=
) ( ) cos (cos
0 0

+
L
E
L
U
m

(2.16)
Khi =
0
+ = + -> id=0


m
U
E
=

+ ) cos( cos
0 0
(2.17)
Vi
U
m
=
2
2U l bin p pha th cp my bin p
Tr trung bnh ca dng in chnh lu phn ng.
id = ) cos (cos
0


L
U
m
+
) (
0


L
E
Ia =
o
o
d i
L
pU
d
m

2

Ia =
( )
1
]
1

+ +
2
sin sin cos
2
6
2
0



o
o
m
L
U
(2.18)
Trong :
P=2 l s xung trong mt chu k

0
=
L = X l tr khng mch phn ng ng c.
Trang 17
Nh vy vng dng in gin on, c tnh c rt dc v n ph thuc vo in
khng ca ng c, in khng ca ng c cng ln vng gin on cng nh.
c.Trng thi bin lin tc :
L ranh gii gia vng dng in gin on v vng lin tc.


cos sin
2
)
2
cos( cos
0 0
p
p
p
p
blt

+

(2.19)
T (2.11) v (2.12), tr trung bnh dng bin lin tc :
Ia =

'

+ +
1
]
1

+ + ) sin( )
2
sin( )
2
cos( cos
2
0 0 0 0

p p p L
pU
m
(2.20)
Sau khi rt gn c :
I
blt
=



sin
2
sin
2
cos
2
sin
2
L
U
L
U
m m

,
_

(2.21)

2
cos
blt


L
U
I
m
blt

2
sin
m Sin
2
+ cos
2
=1
2 2
2 2
1
1
1
]
1

+
1
1
1
]
1

L
U
I
m
blt blt

= 1 (2.22)
Nh vy ch bin lin tc, c tuyn bin l Ellip vi cc trc l trc ca
c tnh c. rng vng dng in gin on s gim nu ta tng in cm L v
tng s pha chnh lu.
d.Trng thi trung dn:
S mch xay ra trung dn
Trang 18
Hnh 2-4 :S mch khi xy ra trung dn
T
1
L
ba
I
d
i
2
u
2
T
3
iT
2
iT
1
Gi thit T1v T2 ang dn.
Khi
1
= cho xung m T3.Do in cm cm my bin p L
ba
0 nn dng iT3
khng th t ngt tng t 0 n I
d
v dng T1,T2,T3.Hin tng ny gi l trong
dn hay hin tng chuyn mch.Tring dn xy ra gy ngn mch u cc th cp
my bin p
T s thay th khi chuyn mch, vit c :
L
ba
= sin
2
2 1
m ba
U u
dt
diT
L
dt
diT

IT
1
= I
d
iT
2
=> 2L
ba
sin
2
m
U
dt
di

sin sin
2
p L
U
dt
di
ba
m

i
2
=
) cos (cos
sin
sin
sin


ba
m
ba
m
L
p
U
d
L
p
U
(2.23)
khi = th dng I
2
=0, bt u chuyn mch.
Khi = + th i
2
= I
d
, qu trnh chuyn mch kt thc.
I
d
=
)] cos( [cos
sin

+
ba
m
L
p
U
(2.24)
Trang 19
t: I
m
=
ba
m
L
p
U

sin
l bin dng in qua my bin p.
==> =

,
_

m
d
I
I
ar cos cos
(2.15)
l gc trung dn (chuyn mch)
e. in p ri trong qu trnh trung dn:
in p ri trn in cm (mt pha) ca m
ba
U

= L
ba

dt
di
2

in p trung bnh trong qu trnh trung dn.
U

d u
L

+
1
Khi =
0
= 0 th dng chy qua vng chuyn mch chnh l dng I
d
= +
U

=

+

d ba ba
I L di L
1 1
2
(2.26)
X = L
ba
l in khng trn pha xy ra trung dn ca m
ba
.
P= 2 L s xung /chu k ca cu chnh lu mt pha.
U

=
d ba
I X

1
Nh vy in khng ca m
ba
v khi dng in chnh lu cng ln th st p do
qu trnh trung dn cng ln.
f. Ch nghch lu ph thuc :
in p trung bnh ca chnh lu cu mt pha iu khin bn phn c dng
U
d
= U
do
cos , trong :
U
do
= m
U
p
p

sin
Ph thuc vo s chnh lu, in p ngun cung cp cho BCL, gc
iu khin.

V nguyn tc (theo l thuyt tnh tn) gc c th bin thin t 0 n
tc U
d
bin thin t +U
do
n -U
do
, nhng thc t khi > /2U
d
< 0 th khng
Trang 20
thc hin c vic cp dng i
d
cho ph ti v SCR ch cho dng chy theo mt
chiu duy nht t Anode n Cathod.
ng c chuyn t ch ng c (U
d
> 0, U
d
> E) sang ch my pht (U
d
<0,E >/ U
d
/ ) pht nng lng vo ngun xoay chiu ch ny gi l ch
nghch lu ph thuc.

iu kin thc hin ch nghch lu ph thuc :
+ o u ni dy ng c (o chiu E ) hoc i chiu t thng.
+ Tr tuyt i ca U
d
trong na chu k / U
d
/<E.
+ Gc m > /2.
ng c pht nng lng khi E > U
d
.Qu trnh chuyn mch phi trc qu
trnh chuyn mch t nhin :
max
+ + .
Trong 5 l gc phc hi tnh kh t nhin.
gc gii hn :
max
+ -
Trang 21
2.3 VI IU KHIN AT89S52
2.3.1 PHN CNG CA AT89S52 :
MCS-52 l mt h IC vi iu khin c sn xut bi hng Intel. Cc IC
tiu biu ca h ny l 8031 v 8051. Cc sn phm MCS-51 thch hp cho
nhng ng dng iu khin. Vic x l trn byte v cc php ton s hc cu
trc d liu nh c thc hin bng nhiu ch truy xut d liu nhanh trn
RAM ni. Tp lnh cung cp mt bng tin dng nhng lnh s hc 8 bit gm c
lnh nhn v lnh chia. N cung cp nhng h tr m rng on-chip dng cho
nhng bin 1 bit nh l kiu d liu ring bit cho php qun l v kim tra bit
trc tip trong iu khin v nhng h thng logic i hi s dng lun l.
8952 l mt vi iu khin 8 bit, ch to theo cng ngh CMOS cht lng
cao, cng sut thp vi 4KB PEROM (flash programmable and erasable read
only memory). Thit b ny c ch to bng cch s dng k thut b nh
khng bc hi mt cao ca ATMEL v tng thch vi chun cng nghip
MCS-51
TM
v tp lnh v cc chn ra. Cc c tnh ca AT89S52 c tm tt
nh sau :
- Tng thch vi nhng sn phm MCS -51
TM
- 4KB PEROM on chip
- 256 byte RAM ni
- Tn s hot ng t 0 n 24MHz
- Ba mc kha b nh lp trnh
- 4 port xut nhp 8 bit
Trang 22
- 2 b timer/counter 16 bit
- 8 ngun ngt
- Knh ni tip lp trnh c
- 210 bit c a ch ha
- Mt b x l lun l (x l trn bit)
- 64 Kbyte khng gian b nh chng trnh m rng
- 64 Kbyte khng gian b nh d liu m rng
- B nhn/chia 4s
- Ch ch cng sut thp v ch gim cng sut
Trang 23
VCC
GND
P0.0 P0.7 P2.0 P2.7
PORT 0 DRIVE PORT 2 DRIVE
RAM ADDR.
REGISTER
RAM
PORT 0
LATCH
PORT 2
LATCH
FLASH
B
REGISTER
ACC
STACK
POINTER
PROGRAM
ADDRESS
REGISTER
BUFFER
PC
INCREME
NTER
PROGRAM
COUNTER
DPTR
TMP2 TMP1
ALU
PSW
INTERRUPT, SERIAL
PORT,
AND TIMER BLOCKS
PORT 1
LATCH
PORT 3
LATCH
OSC
INSTRUCTION
REGISTER
TIMING
AND
CONTROL
P1.0 P1.7 P3.0 P3.7
PORT 1 DRIVE PORT 3 DRIVE
PSEN
ALE/PROG
EA / V PP
RST
S O KHOI
8951
Sau y l bng so snh cc IC thuc h MSC 51 v 89S52 :
Trang 24
VCC
GND
P0.0 P0.7 P2.0 P2.7
PORT 0 DRIVE PORT 2 DRIVE
RAM ADDR.
REGISTER
RAM
PORT 0
LATCH
PORT 2
LATCH
FLASH
B
REGISTER
ACC
STACK
POINTER
PROGRAM
ADDRESS
REGISTER
BUFFER
PC
INCREMEN
TER
PROGRAM
COUNTER
DPTR
TMP2 TMP1
ALU
PSW
INTERRUPT, SERIAL
PORT,
AND TIMER BLOCKS
PORT 1
LATCH
PORT 3
LATCH
OSC
INSTRUCTION
REGISTER
TIMING
AND
CONTROL
P1.0 P1.7 P3.0 P3.7
PORT 1 DRIVE PORT 3 DRIVE
PSEN
ALE/PROG
EA / V PP
RST
S KHI 8952

MCU ROM RAM TIMER
8051 4K MROM 128 byte 2
8031 0 K 128 byte 2
8751 4 K EPROM 128 byte 2
8052 8 K MROM 256 byte 3
8032 0 K 256 byte 3
8752 8K EPROM 256 byte 3
8952 8K EEPROM 256 byte 3
M t cc chn ca AT89S52:
AT89S52 : c 40 chn


S Chn AT89S52
Trang 25
VCC
9
18
19 29
30
31
1
2
3
4
5
6
7
8
21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
39
38
37
36
35
34
33
32
RST
XTAL2
XTAL1 PSEN
ALE/PROG
EA/VPP
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
P3.0/RXD
P3.1/TXD
P3.2/INTO
P3.3/INT1
P3.4/TO
P3.5/T1
P3.6/WR
P3.7/RD
P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7
20
40
Port 0 :
T chn 324 39, c hai chc nng. Nu ta s dng b nh chng trnh trong th
Port 0 l I/O port a dng. Nu s dng b nh ngoi (ROM chng trnh,
RAM) th Port 0 c tc dng nh b hp knh a ch v d liu AD04 AD7.
Trong chu k nhn lnh th Port 0 chnh l a ch byte thp. N cng nhn byte
m trong lc lp trnh cho EPROM.
Port 1 :
T chn 14 8, c chc nng I/O 8 bit a dng dng giao tip vi thit b ngoi
vi nu cn. N cng nhn byte a ch thp trong khi lp trnh EPROM v trong
khi kim tra EPROM.
Port 2 :
T chn 214 28, c hai chc nng. C th dng Port 2 nh l mt I/O a dng
hoc l byte cao ca bus a ch i vi cc thit k dng b nh m rng
(A84 A15). Port 2 cng nhn a ch byte cao trong lc lp trnh cho EPROM v
trong lc kim tra cho EPROM.
Port 3 :
L mt port cng dng kp trn cc chn 104 17. Ngoi chc nng l port xut
nhp hai chiu, cc chn ca port 3 c cc chc nng c bit khc nh sau :
Trang 26
Bng M T Chc Nng Ca Port3
PEN: (Program store Enable)
L chn 29. N l tn hiu iu khin cho php b nh chng trnh m
rng v thng c ni n chn OE (Output Enable) ca mt EPROM cho
php c cc byte m lnh.

PSEN s mc thp trong chu k nhn lnh. Cc m nh phn ca chng trnh
c c t ROM ngoi qua bus d liu v c cht vo thanh ghi lnh ca
8951 gii m lnh. Khi thi hnh chng trnh trong ROM ni PSEN s mc
th ng (mc cao).
ALE/PROG : (address latch enable)
Tn
hiu ra ALE trn chn 30 tng hp vi cc vi x l 8085, 8088, 8086. 8951
dng ALE mt cch tng t cho vic gii knh cc bus a ch v d liu. Khi
port 0 dng trong ch chuyn i ca n : va l bus d liu va l byte thp
ca bus a ch, ALE l tn hiu cht a ch vo thanh ghi bn ngoi trong
na u ca chu k b nh. Sau , cc ng port 0 dng xut hoc nhp d
liu trong na sau ca chu k b nh.
Cc xung tn hiu ALE c tn s bng 1/6 ln tn s dao ng trn chip v c th
c dng lm ngun xung nhp cho cc phn khc ca h thng. Nu xung nhp
Trang 27
Bit Tn Chc nng
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
RXD
TXD
INT0
INT1
T0
T1
WR
RD
Nhp d liu cho port ni tip
D liu pht cho port ni tip
Ngt 0 bn ngoi
Ngt 1 bn ngoi
Ng vo ca timer/couter 0
Ng vo ca timer/couter 1
Xung ghi b nh d liu ngoi
Xung c b nh d liu ngoi
trn 8951 l 12MHz th ALE c tn s 2MHz. Ch ngoi tr khi thi hnh lnh
MOVX, mt xung ALE b mt. Chn ny cng c dng lm ng vo cho xung
lp trnh cho EEPROM trong 8951.
EA/Vpp : (External Access)
Tn hiu vo EA trn chn 31 thng c mc ln cao (+5V ) hoc mc thp
(GND). Nu mc cao, 8951 thi hnh chng trnh t ROM ni trong khong
a ch 4Kbyte. Nu mc thp, chng trnh ch c thi hnh t b nh m
rng. Ngi ta cn dng EA lm lm chn cp in p +12V khi lp trnh cho
EEPROM trong 8951.
RST : (reset)
Ng vo RST trn chn s 9 l ng reset ca 8951. Khi tn hiu ny c
a ln mc cao (trong t nht hai chu k my), cc thanh ghi bn trong 8951
c ti nhng gi tr thch hp khi ng h thng.
XTAL1 v XTAL2 :
Cc chn X1 (chn 19) v chn X2 (chn 18) dng ni vi thch anh bn
ngoi to xung nhp cho 8951 hot ng. Tn s ca thch anh thng l 12MHz.
Vcc v Vss :
Chn Vcc (chn 40) dng cp ngun dng (+5V) v chn Vss (chn
20) c ni vi mass.
Cu Trc I/O Port :
Trang 28
D Q
Port
latch
Cht
ghi
Vcc
Chn
port
Chn
c
in tr
ko ni
Read latch
Cu Trc I/O Port
Cu trc I/O ports c hai phn : cht port v chn port. Mun c trng
thi chn port ang nng ti th c trng thi cht port. a cht port ln 1 lm
fet tt th chn port mi iu khin c bi ng I/O. Khi s dng port 0 nh
cng a dng th phi c in tr ko ln ngun (10K ).
T Chc B Nh :
8951 c b nh theo cu trc Harvard : c nhng vng b nh ring bit cho
chng trnh v d liu. C chng trnh v d liu c th bn trong, d vy
chng c th m rng bng cc thnh phn ngoi ln n ti a 64KB b nh
chng trnh v 64KB b nh d liu.
B nh bn trong bao gm ROM v RAM trn chip, RAM trn chip bao
gm nhiu phn : phn lu tr a dng, phn lu tr a ch ha tng bit, cc
bank thanh ghi v cc thanh ghi chc nng c bit.
Ram a dng : (General Purpose RAM)
Vng RAM ny gm 80 byte t a ch 30H4 7FH (Vng General Purpose
RAM) v 32 byte t a ch 00H4 2FH (vng cc thanh ghi).
Vng cc bank thanh ghi c th truy xut tng t nh vng General
Purpose RAM, tuy nhin n cn c s dng cho cc mc ch khc. Mi a
Trang 29
00
FF
0000
FFFF FFFF
0000
Code
memory
Enabled
via PSEN
Data
memory
Enabled
via RD
and WR
memory
Khng gian b
nh 8951
ch trong vng RAM a dng u c th c truy xut t do dng cch nh a
ch trc tip hoc gin tip.
Ram a ch ho tng bit : (bit addressable RAM )
8951 c 210 bit c a ch ha, trong 128 bit l cc a ch 20H n 2FH
v phn cn li l trong cc thanh ghi chc nng c bit.
tng truy xut tng bit ring r bng phn mm l mt c tnh tin li ca vi
iu khin ni chung. Cc bit c th c t, xa, AND, OR, vi mt lnh
n. Hn na, cc port I/O cng c a ch ha tng bit lm n gin phn
mm xut nhp tng bit.
C 128 bit c a ch ha a dng cc byte 20H n 2FH. Cc a ch ny
c truy xut nh cc byte hoc nh cc bit ph thuc vo lnh c dng.
V d : t bit 55H ta dng lnh sau : SETB 55H
Bit 55H th 5 thuc byte 2AH, nu x l theo byte chui lnh sau cng c tc
dng tng t nh lnh trn :
MOV A,2AH
ORL A,#00100000B
MOV A,2AH
Cc bank thanh ghi : (register banks)
32 bytes thp nht ca b nh ni l dnh cho cc bank thanh ghi. Chng
c chia lm 4 bank (bao gm cc bank 0, 1, 2, 3). B lnh ca 8951 h tr 8
thanh ghi (R04 R7) v theo mc nh (sau khi reset h thng) cc thanh ghi ny
cc a ch 00H 4 07H (bank 0). Tuy nhin bank thanh ghi tch cc c th thay
i bng cch thay i trng thi ca hai bit chn bank thanh ghi (RS0, RS1)
trong thanh ghi PSW.
Cc Thanh Ghi C Chc Nng c Bit : (Special function registers)
Cc thanh ghi ni ca 8951 c xem nh mt phn ca RAM trn chip.
V th mi thanh ghi u c mt a ch. 8951 cung cp 21 thanh ghi c chc
nng c bit (SFRs).
Trang 30
P2
SCON
TH0
TL1
TL0
DPH
Hu ht cc thanh ghi c chc nng c bit c truy xut theo cch nh v a
ch trc tip. Mt s trong chng va c th truy xut theo bit va c th truy
xut theo byte.
Thanh ghi trng thi chng trnh : (PSW)
Bit
K
hiu
a
ch
ngha
PSW.7 CY D7H C nh
PSW.6 AC D6H C nh ph
PSW.5 F0 D5H C 0
PSW.4 RS1 D4H Bit 1 chn Bank thanh ghi.
PSW.3 RS0 D3H
Bit 0 chn Bank thanh ghi. 00=bank 0 :
a ch 00H4 07H 00=bank1 : a ch
08H4 0FH 10=bank2 : a ch
08H4 17H 11=bank3 : a ch
18H4 1FH
PSW.2 OV D2H C trn.
Thanh ghi PSW (Program Status Word) c a ch ti D0H cha cc bit
trng thi c tm tt nh sau :
Carry flag (PSW.7) k hiu l CY, bit a ch l D7H. C carry c set
ln 1 nu c nh bit 7 trong php ton cng hay c mn bit 7 trong php
ton tr.
Auxiliary carry flag (PSW.6) l c nh ph, k hiu AC v c a ch
D6H. Khi cng s BCD (Binary Code Decimal) c AC set ln 1 nu c nh bit
3 sang bit 4 hay nu kt qu ca 4 bit thp c gi tr trong khong 0AH4 0FH.
C zero (Flag 0) : c zero c ln 1 nu kt qu cc php tnh l 0. C
ny rt thun tin cho cc ng dng ca ngi dng.
Trang 31
RS0 v RS1 l 2 bit dng xc nh bank thanh ghi hot ng. Chng b xo v
0 sau khi reset h thng v c th c thay i bi phn mm nu cn thit.
V d : cc lnh sau y s xc nh s dng bank thanh ghi 3 sau a
ni dung ca R7 vo thanh ghi A.
SETB RS1
SETB RS0
MOV A,R7
C bo trn (Overflow Flag) : c bo trn (OV) b tc ng sau mt lnh
cng hoc tr nu c mt php ton b trn. Khi cng hay tr cc s c du, phn
mm c th kim tra bit ny xc nh kt qu c nm trong tm xc nh hay
khng. Khi cc s khng c du c cng, c OV c th c b qua. Cc kt
qu ln hn +127 hoc nh hn 128 s set bit OV. V d php cng sau b trn
v set bit OV :
15+127=142
Kt qu l mt s c du 116, khng phi kt qu ng v vy c OV
c set.
Bit kim tra chn l (Parity bit) : Bit parity k hiu l P s t ng set ln 1 hoc
v 0 mi chu k my thit lp pariry chn vi thanh ghi tch ly A. S cc bit
1 trong thanh ghi A cng vi bit P lun l s chn. Nu thanh ghi A cha
10010100B th P s l 1. Bit parity s dng rt thng xuyn trong cc chng
trnh lin quan n port ni tip thm bit parity trc khi truyn hoc kim tra
bit parity sau khi nhn d liu.
Thanh ghi B :
Thanh ghi B a ch F0H, c s dng cng vi thanh ghi A cho cc
php ton nhn v chia. B cng c a ch ha tng bit.
Thanh ghi SP : (stack pointer )
Thanh ghi SP l mt thanh ghi 8 bit a ch 81H. N cha a ch ca
byte d liu hin hnh trn nh ca ngn xp. Cc lnh trn ngn xp bao gm
Trang 32
thao tc ct d liu vo ngn xp v ly d liu ra khi ngn xp. Lnh ct d
liu vo ngn xp s lm tng SP trc khi ghi d liu, lnh ly d liu ra khi
ngn xp s c d liu v gim SP.
Thanh ghi DPTR : (data pointer)
L thanh ghi 16 bit thng s dng lm con tr b nh ngoi (ROM,
RAM). DPTR c th chia lm hai thanh ghi :
DPL (a ch 82H ) : byte thp
DPH (a ch 83H ) : byte cao
V d lnh sau y s c nh data ngoi a ch 1000H vo thanh ghi A :
MOV
DPTR,#1000H
MOVX A,@DPTR
Cc thanh ghi cng ngoi vi :
Cc cng xut nhp (I/O ports) ca 8951 bao gm port 0 ti a ch 80H ;
port 1 ti a ch 90H ; port 2 ti a ch A0H v port ti a ch B0H. Tt c cc
port u c a ch ha tng bit. iu cung cp mt kh nng giao tip
thun li.
Thanh ghi Timer :
8951 c hai b nh thi/m (Timer/couter) 16 bit c dng cho vic nh thi
hoc m s kin. Timer 0 c a ch 8AH (TL0, byte thp) v 8CH (TH0, byte
cao ). Timer1 c a ch 8BH (TL1, byte thp ) v 8DH (TH1, byte cao). Vic
vn hnh timer c set bi thanh ghi TMOD a ch 89H v thanh ghi iu
khin Timer TCON a ch 88H, ch c thanh ghi TCON c a ch ho tng
bit.
Thanh ghi port ni tip SIO : (serial port register)
8951 c mt port ni tip trn chip dng cho vic thng tin vi cc thit b u
cui (Terminal) hoc cc Modems hay cho vic giao tip vi cc IC khc m
chng c b phn giao tip ni tip (cc b chuyn i AD, cc thanh ghi
Trang 33
dch). Mt thanh ghi gi l b m d liu ni tip SBUF a ch 99H m
nhim c hai cng vic l truyn v nhn data. Khi truyn d liu th ghi SBUF,
khi nhn d liu th c SBUF. Cc mode hot ng khc nhau c lp trnh
thng qua thanh ghi TCON a ch 88H. Thanh ghi TCON c nh v a ch
tng bit.
Cc thanh ghi phc v ngt :
8951 c 5 ngun ngt vi hai mc u tin. Vic cho php ngt, cm ngt c
lp trnh thng qua thanh ghi iu khin ngt IE ti a ch 8AH. Cc mc u tin
c thit lp thng qua thanh ghi IP ti a ch 0B8H. C hai thanh ghi u
c a ch ha tng bit.
Thanh ghi iu khin cng sut ngun : (PCON)
Thanh ghi iu khin cng sut ngun PCON a ch 87H cha nhiu bit iu
khin. Chng c tm tt trong bng sau :
Bit K hiu ngha
7 SMOD Bit gp i tc baud, nu c set
th tc baud s tng gp i trong
cc mode 1, 2 v 3 ca port ni tip
6 - Khng nh ngha
5 - Khng nh ngha
4 - Khng nh ngha
3 GF1 C a dng bit1
2 GF0 C a dng bit0
1* PD H ngun (power down ), PD=1 vo
mode h ngun, thot khi bng reset
0* IDL Tm ngh (Idle mode) IDL =1 vo mode
ngh, thot khi bng tn hiu ngt hoc
reset
Trang 34
Opcode
Opcode
Opcode
D liu trc tip
a ch trc tip
a ch tc thi
2.3.2 Tm tt tp lnh :
Trong phn ny gii thiu cch t lnh ca 8951 thng qua s kim tra cc ch
v nhng v d tnh hung lp trnh lin quan. Cch t lnh ny ch ti u vi
nhng ng dng iu khin 8 bit. Trong 8951 c tt c 256 lnh c thc thi v
1 lnh khng nh ngha. Mt lnh c hoc 2 byte d liu hoc a ch c thm
vo. Ni chung 8951 c 139 lnh 1 byte, 92 lnh 2 byte v 24 lnh 3 byte.
nh a ch thanh ghi :
8951 c 8 thanh ghi c nh s t R0 n R7 m ta truy sut c vi n.
V d:ADD A, R5
nh a ch trc tip :
8951 c th truy sut bt k no trong RAM ni.
Vd :MOV A,5BH
nh a ch gin tip :
V d :MOV A,@R1
nh a ch tc thi :

V d :MOV A,#12
MOV DPTR,#2000H
nh a ch tng i :
Trang 35
Opcode
Opcode lch tng i
S dng trong lnh nhy khng hay c iu kin
Ni dung PC = PC hin hnh + offset b 2 c du
V d: SJMP 20H
nh v a ch tuyt i :
Thng s dng cho lnh ACALL, AJMP. Nhng lnh 2 bytes ny cho php r
nhnh trong trang 2K bytes ca b nh m bi s cung cp 11 bit thp ca a
ch ch trong opcode (A104 A8) v byte 2 ca lnh (A74 A0).
nh v a ch :
a ch di ch dng ch dng vi nhng lnh LCALL, LJMP. Nhng lnh 3
byte ny gm a ch ch 16 bit v m lnh 8 bit.
nh v a ch ch s :
nh v a ch ch s s dng mt thanh ghi nn (hoc b m chng trnh
hoc con tr d liu) v lch (b tch ly) trong vic hnh thnh a ch hiu
dng cho lnh JMP hoc MOVC.
+

=
V d : MOVC A,@A+<Thanh ghi c bn>\
TP LNH :
Trang 36
Opcode
ADDR 740
ADDR 104 8
lch
PC (hoc DPTR)
ACC a ch hiu dng
Thanh ghi c bn
Opcode
ADDR154 ADDR8 ADDR74 ADDR0
8951 c 255 lnh chia l 5 nhm. Thi gian thc thi ca cc lnh khng
ging nhau, c th l 1, 2, 3 hay 4 chu k my. Nu 8951 hot ng 12MHz th
mi chu k lnh s l 1s.

Nhng lnh v s hc :
V d : Lnh ADD A,<byte> c vit vi nhiu cch khc nhau
ADD A,7FH (nh a ch trc tip)
ADD A,@R0 (nh a ch gin tip)
ADD A,R7 (nh a ch thanh ghi)
ADD A,#127 (nh a ch tc thi)
Thi gian thc thi ca tt c nhng lnh s hc l 1 s ngoi tr lnh INC
DPTR l 2 s v cc lnh MUL AB v DIV AB l 4 s. Sau y l bng tm
tt cc lnh v s hc :
Mnemonic S hot ng Thi gian thc thi
ADD A,<byte> A = A + <byte> 1 s
ADDC A,<byte> A = A + <byte> + C 1 s
SUBB A,<byte> A = A - <byte> - C 1 s
INC A A = A + 1 1 s
INC <byte> <byte> = <byte> + 1 1 s
INC DPTR DPTR = DPTR + 1 2 s
DEC A A = A 1 1 s
DEC <byte> <byte> = <byte>-1 1 s
MUL AB B_A = A*B 4 s
DIV AB A = Int[A/B] 4 s
B = Mod[A/B]
DAA Decimal Adjust 1 s
Nhm lnh logic :
L nhng lnh biu din php ton lun l (AND, OR, XOR, NOT) trn
byte d liu hay trn bit.
Trang 37
V d : ANL A,#10000000B
Mnemonic S hot ng Thi gian thc thi
ANL A,<byte> A =A and <byte> 1 s
ANL <byte>,A <byte> = <byte> and A 1 s
ANL <byte>,#data <byte> = <byte> and #data 2 s
ORL A, <byte> A = A or <byte> 1 s
ORL <byte>,A <byte> = <byte> or A 1 s
ORL <byte>,#data <byte> = <byte> or #data 2 s
XRL A, <byte> A = A xor <byte> 1 s
XRL <byte>,A <byte> = <byte> xor A 1 s
XRL <byte>,#data <byte> = <byte> xor #data 2 s
CLR A A = 0, clear A 1 s
CPL A A = not A 1 s
RL A Quay ACC sang tri 1 bit 1 s
RLC A Quay ACC sang tri qua c C 1 s
RR A Quay ACC sang phi 1 bit 1 s
RRC A Quay ACC sang tri qua c C 1 s
SWAP A Hon chuyn gia hai nipbles 1 s
Nhm lnh truyn d liu :
a. Lnh truyn d liu RAM ni :
L nhng lnh chuyn d liu trong khng gian b nh ni thc thi trong
1 hoc hai chu k my.
Lnh MOV <des>,<src> cho php truyn d liu gia bt k RAM ni
hoc thanh ghi c bit no m khng qua ACC.
Mnemonic S hot ng Thi gian thc thi
MOV A,<src> A = <src> 1 s
MOV <des>,A <des> = A 1 s
MOV <des>,<src> <des> = <src> 2 s
Trang 38
MOV DPTR,#data16bit DPTR = #data16 bit 2 s
PUSH <scr> ct <scr> vo stack 2 s
POP <des> ly <des> t stack 2 s
XCH A,<byte> d liu ACC v <byte> 1 s
hon i nhau
XCHD A,Ri 4 bit thp ca ACC v Ri 1 s
hon i nhau
b. Lnh truyn d liu RAM ngoi :
Nhng lnh truyn d liu m chuyn d liu gia b nh trong v b nh
ngoi dng a ch gin tip. a ch gin tip c nh r bng cch dng 1
byte a ch (@Ri c th l R0 hoc R1)hoc hai byte a ch (@DPTR).
rng Mnemonic S hot ng Thi gian
a ch thc thi
8 bits MOVX A,@Ri c RAM ngoi @Ri 2 s
8 bits MOVX @Ri,A vit RAM ngoi @Ri 2 s
16 bits MOVX A,@DPTR c RAM ngoi @DPTR 2 s
16 bits MOVX @DPTR,A vit RAM ngoi @DPTR 2 s
c. Bng tm kim :
Hai lnh truyn d liu thch hp cho c bng tm kim trong b nh
chng trnh. Khi chng ta truy xut b nh chng trnh, bng tm kim ch c
th c c nhng khng cp nht. Lnh MOVC dng c PC hoc DPTR nh
l thanh ghi nn v ACC nh l lch.
Mnomonic S hot ng Thi gian thc
thi( s)
MOVC A,@A+DPTR c b nh chng trnh ti
(A+DPTR)
2
MOVC A,@A+PC c b nh trng trnh ti
(A+PC)
2
Trang 39
Lnh BOOLEAN :
Cc bit c th c t hoc xa bng lnh n. S iu khin cc bit
ring l chung cho nhiu thit b I/O, bao gm xut ra relay, motor solenoid,
ledhoc nhp t cng tc hoc t ch im trng thi.
Mnemonic S hot ng Thi gian thc thi ( s )
ANL C,bit C = C AND bit 2
ANL C,/bit C = C AND /bit 2
ORL C,bit C = C OR bit 2
ORL C,/bit C = C OR /bit 2
MOV C,bit C = bit 1
MOV bit,C bit = C 2
CLR C C = 0 1
CLR bit bit = 0 1
SETB C C = 1 1
SETB bit bit = 1 1
CPL C C = not C 1
CPL bit bit = 1 1
JC rel nhy n rel nu C = 1 2
JNC rel nhy n rel nu C =0 2
JB bit,rel nhy n rel nu bit = 1 2
JNB bit,rel nhy n rel nu bit = 0 2
JBC bit,rel nhy n rel nu bit = 1 2
v xa bit = 0
Lnh r nhnh chng trnh :
a, Lnh r nhnh khng iu kin :
Mnemonic s hot ng thi gian thc thi
( s )
JMP addr nhy n a ch addr 2
JMP @A+DPTR nhy n a ch A+DPTR 2
Trang 40
CALL addr gi chng trnh con ti addr 2
RET tr v chng trnh con 2
RETI tr v t ngt 2
NOP khng lm g c 1
b, Lnh r nhnh c iu kin :
Mnemonic S hot ng Thi gian thc
thi
( s )
JZ rel nhy nu A = 0 2
JNZ rel nhy nu A 0 2
CJNE A,<byte>,rel gim v nhy nu <byte> 0 2
CJNE <byte>,#data,rel nhy nu <byte> #data 2
2.3.3 Hot ng ca Timer :
1. Gii Thiu :
8951 c hai b Timet 16 bit v mi b c 4 ch hot ng. Timer c
dng to khong dng, m s kin hay nh tc baud cho port ni tip.
Mi timer l b m xung clock 16 bit, v vy bit th 16 hay tng cui cng chia
tn s xung clock cho 65536 (2
16
). Cc timer ny c t mode lm vic v iu
khin bng phn mm thng qua cc thanh ghi chc nng c bit.
Bng di y lit k cc thanh ghi chc nng c bit s dng cho hot ng
timer :
SFR Chc nng a ch a ch ha tng bit
Trang 41
TCON
TMOD
TL0
TL1
TH0
TH1
iu khin
Chn mode
Byte thp timer 0
Byte thp timer 1
Byte cao timer 0
Byte cao timer 1
88H
89H
8AH
8BH
8CH
8DH
C
Khng
Khng
Khng
Khng
Khng
Thanh Ghi TMOD :
a ch 81H, khng truy xut bit, cha hai nhm 4 bit dng thit lp ch
lm vic cho timer 1 v timer 0.
Tm Tt Thanh Ghi TMOD
Bit Tn Timer M t
7 GATE 1 bit cng ; khi GATE =1 Timer ch m
khi v ch khi ng INT1 = 1
6 C/F 1 bit chn couter/timer C/F =1 : couter,
m bng xung Ck ngoi ng T1.
C/F = 0 :Timer,xung Ck trong t dao
ng ni.
5 M1 1 bit 1 chn mode
4 M2 1 bit 0 chn mode
3 GATE 0 bit cng, Timer ch m khi INT0 = 1
2 C/F 0 bit chn couter/timer
1 M1 0 bit 1 chn mode
0 M0 0 bit 0 chn mode.
Chn mode :
M2 M1 Mode M t
0 0 0 Timer 13 bit, (tng hp 80487)
0 1 1 Timer 16 bit
1 0 2 Timer 8 bit t ng khi np
1



1



3



Timer tch bit:
Timer 0 : TL0 l b m 8 bit iu
khin bng cc bit chn mode Timer 0
TH0 l b m 8 bit iu khin bng cc
Trang 42
bit chn mode Timer1.
Thanh Ghi TCON :
Thanh ghi ny cha cc trng thi v cc bit iu khin cho timer 0 v
timer 1. Bn bit cao trong TCON c dng bt tt hay bao trn cho timer.
Bn bit thp trong TCON khng c tc dng g i vi cc timer, tuy nhin
chng c s dng pht hin v khi u cho cc ngt ngoi.
Bit K hiu /ch bit M t
TCON.7 TF1 8FH
C bo trn Timer 1. phn cng t TF1 = 1 khi
timer trn ; xa bng mm hoc bng cng (khi
c ngt qua Timer 1).
TCON.6 TR1 8EH Bit iu khin ON/OFF Timer 1
TR1 = 1 : chy; TR1 = 0 : dng.
TCON.5 TF0 8DH C bo trn Timer 0.
TCON.4 TR0 8CH iu khin ON/OFF Timer 0.
TCON.3 IE1 8BH
C cnh ngt 1 bn ngoi. t bi phn cng khi
pht hin mt cnh xung INT1 ; xo bng mm
hoc bng cng.
TCON.2 IT1 8AH
Kiu c ngt 1 bn ngoi. t/xa bng mm
ngt ngoi tc ng mc thp /cnh xung.
TCON.1 IE0 89H C cnh ngt 0 bn ngoi.
TCON.0 IT0 88H C kiu ngt 0 bn ngoi.
Cc Ch Lm Vic Ca Timer :
Ch timer 13 bit :
Trang 43
tng thch vi 8048 (tin thn ca 8951). 3 bit cao ca TLx (TL0
hoc TL1) khng dng. Ch hot ng ny thng khng c s dng trong
cc thit k mi.
Ch timer 16 bit :
Hot ng nh timer 16 bit y . C bo trn l bit TFx trong TCON c
th c hoc ghi bng phn mm. MSB ca gi tr trong cc thanh ghi l bit 7
ca THx v LSB l bit 0 ca TLx. Cc thanh ghi timer TLx/THx c th c c
hoc ghi bt c lc no bng phn mm.
Ch t ng np li 8 bit :
TLx hat ng nh mt timer 8 bit, trong khi THx vn gi nguyn gi
tr np li. Khi s m trn t FFH n 00H, khng nhng t c timer m cn
np gi tr THx vo TLx. Ch ny rt thng dng v s trn timer xy ra sau
nhng khong thi gian nht nh v tun hon mt khi khi ng TMOD v
THx.
Ch tch timer :
Timer 0 tch thnh hai timer 8 bit (TL0 v TH0), TL0 c c bo trn l
TF0 v TH0 c c bo trn l TF1. Timer 1 ngng ch 3, nhng c th khi
ng bng cch chuyn sang ch khc. Gii hn duy nht l c bo trn TF1
khng cn b tc ng khi timer 1 b trn v n c ni ti TH0. Khi timer 0
Trang 44
TLx
(5 bit)
THx
(8 bit)
TFx
Xung nhp
timer
C bo trn
TLx
(8 bit)
THx
(8 bit)
TFx
Xung nhp
timer
C bo trn
TLx
(8 bit)
TFx
C bo trn
THx
(8 bit)
Np li
Xung nhp
timer
ch 3, c th cho timer 1 chy v ngng bng cch chuyn n ra ngoi v
vo ch 3. N vn c th c s dng bi port ni tip nh b to tc
baud hoc n c th c s dng bng bt c cch no khng cn ngt (v n
khng cn c ni ti TF1).
Ngun To Xung Clock :
C hai ngun to xung nhp c th c, c chn bng cch ghi vo bit
C/T (Counter/Timer) trong TMOD khi khi ng timer. Mt ngun xung nhp
dnh cho nh khong thi gian, ci khc dnh cho m s kin.
nh khong thi gian :
Nu C/T = 0, hot ng timer lin tc c chn v timer c dng cho
vic nh khong thi gian. Lc , timer ly xung nhp t b dao ng trn chip.
B chia 12 c thm vo gim tn s xung nhp n gi tr thch hp cho
Trang 45
TL1 TH1
TL0 TF0
C bo trn
TH0 TF1
C bo trn
Xung nhp timer
Xung nhp timer
1/12 F
OSC
Xung nhp
timer
B dao ng
trong chip
12
Thch
anh
Chn T0
hoc chn T1
C/T
0:(ln) nh khong thi gian
1:(xung) m s kin
Ngun to xung clock
phn ln cc ng dng. Nh vy thch anh 12 MHz s cho tc xung nhp
timer 1MHz. Bo trn timer xy ra sau mt s (c nh) xung nhp, ph thuc
vo gi tr ban u c np vo cc thanh ghi timer TLx/THx.
m s kin :
Nu C/T = 1, timer ly xung nhp t ngun bn ngoi. Trong hu ht cc
ng dng, ngun bn ngai ny cung cp cho timer mt xung khi xy ra mt s
kin, timer dng m s kin. S s kin c xc ng bng phn mm
bng cch c cc thanh ghi TLx/THx v gi tr 16 bit trong cc thanh ghi ny
tng thm 1 cho mi s kin.
Ngun xung nhp ngoi c t thay i chc nng ca cc chn port 3 :
P3.4 hay T0 dng lm ng vo to xung nhp bn ngoi cho timer 0.
P3.5 hay T1 dng lm ng vo to xung nhp bn ngoi cho timer 1.
Trong cc ng dng b m, cc thanh ghi timer c tng thm 1 tng ng vi
cnh xung ca tn hiu ng vo bn ngoi Tx. Mi timer mt 2 chu k my
nhn ra mt chuyn tip t 1 xung 0, do tn s ngoi ti a l 500KHz (gi
s hot ng 12MHz).
Thit lp ban u v truy xut timer :
Cc timer thng c thit lp ban u mt ln u chng trnh
t ch hot ng ng. Sau , trong thn chng trnh timer c khi
ng v dng, cc bit c c kim tra v xa, cc thanh ghi timer c cp
nhp theo yu cu ca chng trnh ng dng. TMOD l thanh ghi u tin c
thit lp v n t ch hot ng.
Phng php n gin nht bt u (cho chy), v dng cc timer l
dng cc bit iu khin chy : TRx trong TCON. TRx b xa sau khi reset h
thng. Nh vy, cc timer theo mc nhin l b cm (b dng). TRx c t ln
1 bng phn mm cho timer chy.
Mt phng php khc iu khin cc timer l dng bit GATE trong
TMOD v ng vo bn ngoi INTx. t GATE = 1 cho php timer s c iu
Trang 46
khin bng INTx. Vic ny hu dng cho vic o rng xung nh sau : Gi s
INT0 mc thp nhng cc xung mc cao trong khong thi gian o.
Khi ng timer 0 ch 1 (ch timer 16 bit), vi TL0/TH0 =
0000H, GATE = 1 v TR0 = 1. Khi INT0 mc cao, timer c m cng v
c cp xung nhp 1 MHz (nu 8951 hat ng tn s 12 MHz). Khi INT0
xung thp, timer b ng cng v thi khong ca xung tnh bng s l s
m c trong TL0/TH0. (C th lp trnh INT0 to ra mt ngt khi n
xung mc thp).
2.3.4 Hot ng ca port ni tip:
8951 c 1 port ni tip c th hot ng nhiu ch trn 1 dy tn s
rng. Chc nng ca port ni tip l thc hin chuyn i d liu ra t song song
Trang 47
Xung nhp
timer
Cc thanh ghi timer
0 : (ln) : timer dng
1 : (xung) : timer chy
TRx
Cho chy v dng cc timer
0 : (ln)
1 : (xung)
0 : (ln)
1 : (xung)
B dao
ng
trong chip
12
TL1 TH1 TF1
12 MHz
C/T
TR1
GATE
T1
P3.5
INT1
Timer 1 hat ng ch 1
sang ni tip v t ni tip sang song song cho d liu vo. Truy xut phn cng
n port ni tip qua cc chn TXD (P3.0) v RXD (P3.1). Hai thanh ghi chc
nng c bit cung cp truy xut phn mm n port ni tip l SBUF (a ch
99H) v SCON (a ch 98H). B m port ni tip (SBUF) thc s l hai b
m. Vit vo SBUF : np d liu s c pht, c SBUF : truy xut d liu thu
c. y l thanh ghi ring bit, thanh ghi ch pht v thanh ghi ch thu.
Thanh ghi iu khin port ni tip SCON :
Ch hot ng ca thanh ghi port ni tip c t bng cch ghi vo
thanh ghi ch port ni tip SCON. Thanh ghi ny c th truy xut tng bit, n
cha cc bit trng thi v cc bit iu khin. Cc bit iu khin dng thit lp ch
hot ng cho port ni tip v cc bit trng thi ch s chm dt s truyn
hoc nhn k t. Trc khi s dng port ni tip phi khi ng SCON cho
ng ch .
Bng tm tt hot ng thanh ghi SCON
Bit K hiu a ch M t
SCON.7 SM0 9FH Bit 0 ca ch port ni tip
SCON.6 SM1 9EH Bit 1 ca ch port ni tip
SCON.5 SM2 9DH Bit 2 ca ch port ni tip. Cho php
truyn thng a x l trong cc mode 2 v 3
khng b tc ng nu bit thu th 9 thu
c l 0.
SCON.4 REN 9CH Cho php b thu. Phi t ln 1 thu
SCON.3 TB8 9BH Bit 8 pht, bit th 9 pht trong cc ch 2
v 3 c t/xo bng mm.
SCON.2 RB8 9AH Bit 9 thu, bit th 9 thu c.
SCON.1 TI 99H C ngt pht. t ln 1 kt thc pht,
xo bng mm.
SCON.0 RI 98H C ngt thu, t ln 1 kt thc thu, xo
bng mm.
Cc ch hot ng :
Trang 48
Port ni tip c 4 ch hot ng c th la chn bng cch vit cc s 0
hoc 1 vo cc bit SM0 v SM1 trong thanh ghi SCON. Sau y l bng tm tt
cc ch hot ng :
SM0 SM1 Mode M T Baudrate
0 0 0 Thanh ghi dch C nh (fck/12)
0 1 1 UART 8 bit Thay i (t bng timer 1)
1 0 2 UART 9 bit C nh (fck/32 hoc fck/64)
1 1 3 UART 9 bit Thay i (t bng Timer1)
V d : khai bo SIO l 1 UART 8 bit baudate thay i c cho php thu
v t c ngt pht ln 1 :
MOV SCON,# 01010010B
2.3.5 Hot ng ngt
Ngt l s xy ra mt iu kin, mt s kin m n gy ra treo tm thi
chng trnh trong khi iu kin c phc v bi mt chng trnh khc.
Chng trnh ny gi l chng trnh phc v ngt (ISR). Khi ISR c thc thi
xong, chng trnh chnh tip tc ch m n tm dng. Nh vy ngt c th
xy ra bt c lc no v bt c ni u trong chng trnh chnh. Cc ngt
ng vai tr quan trng trong thit k v ci t cc ng dng vi iu khin.
Chng cho h thng p ng mt cch bt ng b vi s kin v gii quyt s
kin trong khi mt chng trnh khc ang thc thi.
T Chc Ngt Trong 8951 :
Trang 49
C/tr chnh
C/tr chnh C/tr chnh
ISR
8951 c 5 ngun ngt : Ngt bng tn hiu ngoi qua ng INT0 (ngt
ngoi INT0 ) ; Ngt bng tn hiu ngoi qua ng INT1 (ngt ngoi INT1 ) ;
Ngt khi timer 0 trn (ngt timer 0), c bo trn TF0 ; Ngt khi timer 1 trn (ngt
timer 1), c bo trn TF1 ; Ngt khi SIO pht/thu xong 1k t (ngt SIO), c TI
pht, c RI thu.
Khi c hai hoc nhiu ngt ng thi, hoc mt ngt xy ra khi mt ngt
khc ang ang phc v, c c hai s tun t hi vng v s u tin hai mc
dng xc nh vic thc hin cc ngt. Vic hi tun t th c nh nhng u
tin ngt th c th lp trnh c.
Cho Php V Cm Ngt :
Mi ngun ngt c cho php hoc cm ngt thng qua thanh ghi chc
nng c bit IE (a ch A8H) c a ch ha tng bit. Chc nng ca tng bit
trong thanh ghi IE nh sau :
Bng tm tt thanh ghi IE
Bit K hiu a ch M t (1 :cho php ; 0 : cm)
IE.7 EA AFH Cho php/cm ton b
IE.6 - AEH Khng nh ngha
IE.5 ET2 ADH Cho php ngt Timer 2 (8952)
IE.4 ES ACH Cho php ngt SIO
IE.3 ET1 ABH Cho php ngt Timer 1
IE.2 EX1 AAH Cho php ngt INT1
IE.1 ET0 A9H Cho php ngt Timer 0
IE.0 EX0 A8H Cho php ngt INT0
V d : Khai bo cho php 3 ngun ngt : INT0, INT1, TIMER 0 :
MOV IE, #87H
Cho php ngt INT0 :SETB EX0
Cm ngt INT0 : CLR EX0
u Tin Ngt :
Mi ngun ngt c lp trnh ring vo mt trong hai mc u tin qua
thanh ghi chc nng c bit IP (Interrupt Priority) c a ch ha tng bit,
a ch B8H.
Trang 50
Bng tm tt thanh ghi IP
Bit K hiu a ch M t (1 :cho php ; 0 : cm)
IP.7 - - Khng nh ngha
IP.6 - - Khng nh ngha
IP.5 PT2 BDH u tin ngt Timer2 (8052)
IP.4 PS BCH u tin ngt SIO
IP.3 PT1 BBH u tin ngt Timer 1
IP.2 PX1 BAH u tin ngt INT1
IP.1 PT0 B9H u tin ngt Timer0
IP.0 PX0 B8H u tin ngt INT0
V d : Khai bo cho php ngt INT0, Timer 0 vi ngt Timer0 u tin
hn
MOV IE,#83H

Hi vng tun t :
Nu c hai ngt cng u tin ng thi, s hi vng tun t xc nh ci no
c phc v trc tin.
Th t u tin ca cc ngun ngt cng cp nh sau :
INT0
TIMER 0
INT1
TIMER 1
SIO
TIMER 2

V d : Khai bo INT0, INT1, Timer 0 theo th t u tin :
Trang 51
MOV IE,#87H
MOV IP,#05H
Cc c ch bo ngt :
Ngt C V tr bit trong thanh ghi
INT0
IE0 TCON.1
INT1
IE1 TCON.3
Timer1 TF1 TCON.7
Trang 52
Timer0 TF0 TCON.5
SIO TI SCON.1
SIO RI SCON.0
X L Ngt :
Khi ngt xy ra v c CPU chp nhn, chng trnh chnh b ngt qung.
Nhng hot ng sau xy ra :
Lnh hin hnh hon tt thc thi.
Ct PC vo ngn xp (stack).
Trng thi ngt hin hnh c ct bn trong.
Cc ngt b chn mc ngt.
Np vo PC a ch vector ca ISR.
ISR thc thi.
ISR hon tt bng lnh RETI. iu ny lm ly li gi tr c ca PC t ngn xp
v ly li trng thi c, thc thi chng trnh tip tc ch m n b dng.
Cc vector ngt :
Khi chp nhn ngt, gi tr np vo PC c gi l vector ngt. N l a ch bt
u ca chng trnh phc v ngt. Cc vector ngt c gi tr nh sau :
Ngt C a ch vector
Reset h thng RST 0000H
INT0
IE0 0003H
Timer0 TF0 000BH
INT1
IE1 0013H
Timer 1 TF1 001BH
SIO TI hoc RI 0023H
Timer 2 TF2 hoc EXF2 002BH
- Chiu di cho mi on chng trnh cho ISR l 8 byte.
- Cc a ch vector nm u chng trnh.
Trang 53
- Khi CPU c np vector ngt ca ngun ngt tng ng th cc c bo ngt
s c xa bng phn cng. Tr trng hp ngt SIO, phn cng khng xa cc
c ny (TI, RI).
- Khi x l ngt qua pht thu : khi mun pht th phi cm thu.
2.4 Triac
2.4.1 Gii thiu v triac
TRIAC (vit tt ca TRIode for Alternating Current) l phn t bn dn gm
nm lp bn dn, to nn cu trc p-n-p-n nh thyristor theo c hai chiu gia
cc cc T1 v T2, do c th dn dng theo c hai chiu gia T1 v T2.
TRIAC c th coi tng ng vi hai thyristor u song song song ngc.
c tnh Volt-Ampere ca TRIAC bao gm hai on c tnh gc phn t
th nht v th ba (h trc Descartes), mi on u ging nh c tnh thun
ca mt thyristor.
TRIAC c th iu khin cho m dn dng bng c xung dng (dng i vo
cc iu khin) ln xung m (dng i ra khi cc iu khin). Tuy nhin xung
dng iu khin m c nhy km hn, ngha l m c TRIAC s cn
mt dng iu khin m ln hn so vi dng iu khin dng. V vy trong
thc t m bo tnh i xng ca dng in qua TRIAC th s dng dng
in m l tt hn c.
K hiu Triac
Trang 54
CHNG 3 NI DUNG CHNH
3.1 S khi ca b khi ng mm cho ng c khng ng
b 3 pha
Trang 55
Khi iu khin Mch cng sut ng c AC
Mch zero crossing
3.1.1 S nguyn l mch ngun
Hnh 3.1
3.1.2 S nguyn l mch cng sut
Trang 56
R 2
2 2 0
A _ 1
Q 1
B T 1 3 8
L 1
V C C
R 3
3 3 0
U 1
M O C 3 0 2 1
1
2
6
4
A _ 2
Q 2
2 N 1 0 6 9
R 5
2 , 2 k
N
D 4
D I O D E + C 5
2 2 0 0 u F
C 6
1 0 4
D 3
D I O D E
R 1 5
3 3 0
+ C 4
2 2 0 0 u F
D 1
D I O D E
D 2
D I O D E
V C C
D 5
L E D
L 1 _ 1
U 8
L M 7 8 0 5 / T O
1
2
3
V I N
G
N
D
V O U T
N
R 1
1 0 K
U 2
4 N 3 5
1 6
2
5
4
R 6
4 0 0
U 3
4 N 3 5
1 6
2
5
4
L 1
z e r o
V C C
Hnh 3.2
3.1.3 S nguyn l mch zero crossing
Hnh 3.3
3.1.4 S mach nguyn l iu khin 1 pha
Trang 57
c
A _ 1
R 2
2 2 0
N
U 1 2
A T 8 9 S 5 3 _ 1
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1
8
1
9
2 0
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
3 0
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8
3 9
4 0
1
2
3
4
5
6
7
8
9
1 0
P 3 . 1 / T X D
P 3 . 2 / I N T 0
P 3 . 3 / I N T 1
P 3 . 4 / T 0
P 3 . 5 / T 1
P 3 . 6 / W R
P 3 . 7 / R D
X
T
A
L
2
X
T
A
L
1
G N D
P 2 . 0 / A 8
P 2 . 1 / A 9
P 2 . 2 / A 1 0
P 2 . 3 / A 1 1
P 2 . 4 / A 1 2
P 2 . 5 / A 1 3
P 2 . 6 / A 1 4
P 2 . 7 / A 1 5
P S E N
A L E / P R O G
E A / V P P
P 0 . 7 / A D 7
P 0 . 6 / A D 6
P 0 . 5 / A D 5
P 0 . 4 / A D 4
P 0 . 3 / A D 3
P 0 . 2 / A D 2
P 0 . 1 / A D 1
P 0 . 0 / A D 0
V C C
P 1 . 0 / T 2
P 1 . 1 / T 2 E X
P 1 . 2
P 1 . 3
P 1 . 4 / S S
P 1 . 5 / M O S I
P 1 . 6 / M I S O
P 1 . 7 / S C K
R
S
T
P 3 . 0 / R X D
V C C
Z e r o _ 1
C 2
C A P A C I T O R
R 1
1 0 K
U 3
4 N 3 5
1 6
2
5
4
R 6
4 0 0
S W 1 R e s e t
V C C
R 5
2 , 2 k Q 1
B T 1 3 8
L 1
Y 1
C R Y S T A L
V C C
+ C 1
1 0 u F
R 4
1 0 K
R 3
3 3 0
L 1
U 2
4 N 3 5
1 6
2
5
4
U 1
M O C 3 0 2 1
1
2
6
4
V C C
A _ 2
Z e r o _ 1
Q 2
2 N 1 0 6 9
C 3
C A P A C I T O R
A _ 1
V C C
Z E R O _ 1
Hnh 3.4
3.1.5 S nguyn l iu khin 3 pha
Trang 58
Hnh 3.5
Trang 59
U 1
M O C 3 0 2 1
1
2
6
4
+ C 1
1 0 u F
A _ 1
L 3
R 8
1 0 K
L 3
V C C
R 1 0
2 , 2 k
Q 2
2 N 1 0 6 9
R 9
3 3 0
L 1
V C C
U 4
A T 8 9 S 5 3
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1
8
1
9
2 0
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
3 0
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8
3 9
4 0
1
2
3
4
5
6
7
8
9
1 0
P 3 . 1 / T X D
P 3 . 2 / I N T 0
P 3 . 3 / I N T 1
P 3 . 4 / T 0
P 3 . 5 / T 1
P 3 . 6 / W R
P 3 . 7 / R D
X
T
A
L
2
X
T
A
L
1
G N D
P 2 . 0 / A 8
P 2 . 1 / A 9
P 2 . 2 / A 1 0
P 2 . 3 / A 1 1
P 2 . 4 / A 1 2
P 2 . 5 / A 1 3
P 2 . 6 / A 1 4
P 2 . 7 / A 1 5
P S E N
A L E / P R O G
E A / V P P
P 0 . 7 / A D 7
P 0 . 6 / A D 6
P 0 . 5 / A D 5
P 0 . 4 / A D 4
P 0 . 3 / A D 3
P 0 . 2 / A D 2
P 0 . 1 / A D 1
P 0 . 0 / A D 0
V C C
P 1 . 0 / T 2
P 1 . 1 / T 2 E X
P 1 . 2
P 1 . 3
P 1 . 4 / S S
P 1 . 5 / M O S I
P 1 . 6 / M I S O
P 1 . 7 / S C K
R
S
T
P 3 . 0 / R X D
Z e r o _ 1
U 2
4 N 3 5
1 6
2
5
4
A _ 1
R 6
4 0 0
Z e r o _ 2
L 2
R 1 4
1 0 K
J 6
P h a _ 3
1
2
C _ 1
R 5
2 , 2 k
V C C
J 2
P h a _ 1
1
2
N
C 3
C A P A C I T O R
R 1 6
2 , 2 k
L 2
L 2
Q 3
B T 1 3 8
U 9
M O C 3 0 2 1
1
2
6
4
L 1 Z E R O _ 1
Q 6
2 N 1 0 6 9
V C C
A _ 2
R 1 1
2 2 K
Z E R O _ 3
V C C
U 6
4 N 3 5
1 6
2
5
4
R 7
2 2 0
N
L 3
A _ 2
B _ 1
Z E R O _ 2
Z e r o _ 3
U 3
4 N 3 5
1 6
2
5
4
U 1 1
4 N 3 5
1 6
2
5
4
R 2
2 2 0
N
B _ 1
S W 1 R e s e t
L 1
V C C
Z e r o _ 2
J 4
P h a _ 2
1
2
B _ 2
C 2 C A P A C I T O R
N
R 1 7
2 2 K
N
Q 1
B T 1 3 8
R 1 2
2 2 0
B _ 2
R 1 3
3 3 0
U 5
M O C 3 0 2 1
1
2
6
4
C _ 2
Q 4
2 N 1 0 6 9
U 7
4 N 3 5
1 6
2
5
4
N
V C C
Q 5
B T 1 3 8
R 1
1 0 K
V C C
Z e r o _ 3
C _ 1
V C C
C _ 2
J 3
M O T O R 3 P H A
1
2
3
4
Z e r o _ 1
R 4
1 0 K
Y 1
C R Y S T A L
U 1 0
4 N 3 5
1 6
2
5
4
N
R 3
3 3 0
3.2 Nguyn l hot ca b khi ng mm

Thnh phn c bn ca b khi ng mm bao gm:
Khi iu khin
Khi pht hin im zero
Khi mch cng sut
ng c 3 pha.
Khi cp ngun cho tt c cc khi. Khi pht hin im zero (Zero crossing ) ca
cc pha hot ng v pht ra xung mc cao mi khi in p i du cui bn
k cc pha ca n. Khi iu khin nhn tn hiu xung ny v tin hnh x l,
sau pht xung iu khin kch triac cho mch cng sut hot ng. Nh vy
ng c c iu khin.
3.2.1 Nguyn l to xung kch
Trang 60
N
R 1
1 0 K
U 2
4 N 3 5
1 6
2
5
4
R 6
4 0 0
U 3
4 N 3 5
1 6
2
5
4
L 1
z e r o
V C C

Mch to xung kch y thc cht l mch pht hin im zero (zero
crossing detector). C nhiu cch nhn bit im zero ca in AC v y l
cch nhn bit n gin vi chnh xc cao. B phn chnh ca mch bao gm
2 con Opto c kt ni nh mch trn. bn k dng U2 dn lm cho
Transtor trong Opto c kch dn, ng thi lm cho in th im C c
ko xung mc 0. U2 dn trong sut bn k dng v in th ti im C cng
lun mc 0. Ti thi im bn k dng ca AC qua dim zero. U2 ngng dn
v in th im C c y ln mc cao. Tng t nh vy khi AC chuyn
qua bn k m U3 dn, U2 ngng v tip tc pht ra xung mc cao mi khi AC
chuyn trng thi t bn k dng qua bn ky m v ngc li.
3.3.1 Kt qu t c
Trn l thuyt th chng em nghin cu tng i hon chnh v b khi
ng mm vi nhng tnh nng:
Hn ch dng khi ng ng c
iu khin tng p t t cho n khi t gi tri nh mc ca n
Bo v ng c, tng tui th cho ng c
C th kt hp vi nhng kh c in khc trnh qu nhit , qu ti cho
ng c.
Trn thc t chng em thit k thnh cng mch iu khin ng c
khng ng b 3 pha trong b khi ng mm v demo trn ba bng n
in v in th t c kt qu nh mong mun l hn ch dng khi
Trang 61
c
ng c nh b khi ng mm trn th trng hin nay.Nhng do khi chng
em demo trn ng c th gp s c ngoi mun lm chy mch iu khin
ca chng em. Do thi gian b hn ch chng em khng lm kip li mch
iu khin3 pha nn chng em phi bo co vi mch 1 pha.
ng dng ca b khi ng mm s c ng dng rt rng ri trong cng
nghip c bit l trong cc h thng bm, h thng qut, ng c c qun tnh
ln,bng chuynCc doanh nghip c th tit kim in nng rt ln v tng
tui th ng c khi s dng b khi ng mm. Tuy nhin b khi ng mm
m chng em nghin cu so vi b khi ng mm c bn trn th trng th
thit k ca chng em cn rt nhiu hn ch c v tnh nng v cht lng. Qua
thi gian tm hiu v nghin cu th chng em hiu bit rt nhiu v nhng
tnh nng v ng dng rt tuyt vi ca b khi ng mm c s dng trn th
trng hin nay.
3.3.2 Nhng hn ch
Qua kt qu t c cho thy ti nghin cu ca chng em cn rt nhiu
thiu st. Chng em ch mi c th nghin cu c b khi ng mm iu
khin khi ng ng c. Ngha l khi ng in thng vo li in ng c
khi ng trc tip, ng c s git mnh v dng khi ng s tng ln gp 7- 8
ln dng nh mc v gy ra st p gy nh hng xu n cc thit b in khc
ang hot ng trong li in. Cha gii c nhng vn m b khi ng
mm trn th trng lm c. hiu r v b khi ng mm th tm hiu
mc kho st tnh nng thc t ca b khi ng mm.
3.3.3 kho st tnh nng thc t ca b khi ng trn th trng
hin nay
Mt s b khi ng mm trn th trng hin nay:
B khi ng mm Sikostart 3RW 22
Khi ng mm Altistart 48
B khi ng mm SIRIUS 3WR..
Trang 62
Kho st b khi ng mm Altistart 48:
B khi ng mm Altistart 48
Cc c tnh tng qut:
Khi ng v hm mm ng c theo phng php iu khin mo-men
TCS
Bo v qu nhit cho ng c
Bo v cho ng c khi qua ti v non ti vi ngng bo v v thi
gian c th hiu chnh c, bo v trng hp Roto b kho, iu khin chiu
quay (th t pha)
ci t sn cc tham s ngm nh c th khi ng ngay
C th ci t thng s theo yu cu mt cch n gin qua mn hnh tch
hp sn hoc bng phn mm (Powersuite)
iu khin kt hp Contactor ni tt khi khi ng xong trnh tn hao
nhit
C th kt ni dng cu hnh kp (2 ng c)
Cc ng vo/ra a chc nng
C th khi ng v hm mm nhiu ng c (dng ni tng)
Tch hp hnh thc giao tip mng kiu Modbus
Trang 63
Giao tip mng kiu FIPIO, Profibus DP, DeviceNet, Ethernet.
ng dng:
H thng my bm:
Kh b cc hin tng qu p sut v p lc tc ng ln h thng.
Bo v chng vn hnh kh (khng ti), mt pha, o th t pha hoc
ngay c trong trng hp hin tng Roto b kt
Gim s pht nng ng c: t ng chuyn sang ch dng t nhin
khi lu lng bm gim xung mc thp
H thng my qut v my c qun tnh ln:
Khi ng mm, gim cng ca giy xch truyn ng hoc hin
tng trt dy cua-roa Hn ch hin tng qu dng v st p lc khi ng
Nhn bit c trng hp Roto quay ngc c qu trnh khi ng
thch hp.
Trang 64
PHN KT LUN
Qua thi gian thc hin ti lun vn NGHIN CU V THIT K B
KHI NG MM CHO NG C KHNG NG B 3 PHA.Cui cng
th chng em cng hon thnh ti ny. Chng em gii quyt tt mc ch
chnh ca ti l thit k b iu khin iu khin hn ch dng dng khi
ng ca ng c v khng gy ra hin tng st p cho li in gy nh
hng ti cc thit b khc ang vn hnh trong li in.Nhng vn cn nhng
vn hn ch m chng em vn cha gii quyt c nh:
Thit k mch bo v qu nhit cho ng c nh bo v qu ti,mt pha
iu khin kt hp vi contactor ni tt khi iu khin xong trnh tn
hao nhit.
Hng gii quyt:
Chng em s c gng nghin cu tm hiu qua nhiu ti liu khc phc
nhng hn ch vn cha gii quyt c v s hon chnh b khi ng mm v
hy vng n s c ng dng trong cng nghip nh b khi ng mm trn th
trng hin nay ang s dng.
Trong qu trnh thc hin ti ny chng em gp rt nhiu kh khn do
b hn ch v kin thc cng nh thi gian thc hin ti nhng nh s tn tnh
hng dn ca thy Nguyn Vn Khanh nn cui cng chng em hon thnh
n ng ti hn.Chng em rt chn thnh cm n thy.
Trang 65
TI LIU THAM KHO
[1] Trng Vn Tm, Gio trnh Mch in t. Th vin gio
trnh in t ca B gio dc v o to. a ch wed:
http://ebook.moet.gov.vn/?page=1.12&view=286.
[2] Nguyn Khc Nguyn Gio trnh thc tp Vi iu khin 8051. I HC
CN TH, nm 2009
[3] Phng Kim Khnh - Gio trnh thc tp Vi iu khin MSC 51. I hc
K Thut cng ngh TP.HCM
[4] Tng Vn On Vi iu khin 8051. Nh xut bn khao hc k thut, nm
2008.
[5] Nguyn Tng Cng, Phan Quc Thng Cu trc v lp trnh h Vi Diu
Khin.
[6] Trn Vn Thnh in t cng sut i Hc Bch Khoa H Ni, nm
2000.
[7] Nguyn Xun Ph Thit k mc in NXB Khoa Hc v K Thut
Trang 66