You are on page 1of 8

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).

2009

THIT K MODUL M PHNG DNG TRONG TH NGHIM H THNG IU KHIN GIM ST - QUN L TRM TRN B TNG
DESIGNING A MODEL MODULE FOR TESTING BATCH CONCRETE MANAGEMENT MONITOR - CONTROL SYSTEM Ng Nh Khoa - Phm Ngc Phng
i hc Thi Nguyn
TM TT Trong bi bo ny, chng ti p trung vo vic thit k v xy dng modul m phng t vo/ra da trn vi iu khin nhng PsoC, phc v cho cng tc th nghim v hiu chnh h thng iu khin gim st v qun l trong cc trm trn btng kiu khng lin tc. Modul c chc nng gi lp ton b cc tn hiu vo/ra st thc t. c bit trong , cc u ra tng t gi lp tn hiu cm bin trng lng ca cc h cn nh lng nh lng ct liu, nh lng ximng, nh lng nc v ph gia c thit k c tnh ton n tc np ca tng thnh ph phi liu vo h cn nh lng m bo m phng st vi thc t. Qua th n nghim, v c bn modul p ng y cc yu cu ca cng tc th nghim h thng, chi ph thp v p dng hiu qu trong sn xut k c trong iu kin sn xut hng lot. ABSTRACT In this paper, we focus on designing and making an in/out model module based on embedded microprocessor PsoC for testing and adjusting batch concrete management monitor control systems. The module can simulate the entire in/out situations matching with real conditions. Especially, the outputs simulate loadcell signals of weight batching systems weight batching of soil and sand, cement, water and additives designed with due attention to the speed of loading the components into weight batching systems ensuring the match with reality. The test of this module has shown that, basically, it has fully met the requirements of system testing with low cost and effective application to production even mass production.

1. t vn Mi h thng iu khin trc khi a i lp t vo cc trm trn trong thc t u cn phi c chy th nghim v hiu chnh tng th h thng. Cng on ny bao gm cc khu: Th nghim tnh thng sut ca cc u vo s, chnh xc v tin cy ca cc u vo tng t; Kh nng hot ng ca cc thit b m cng sut (rle, contactor, vv) v s hot ng ca ton b cc thit b khi c lp t vo t iu khin; Phn mm iu khin; Phn mm qun l phi liu, nht k sn xut, qun l sn phm, vt t tiu hao v kho cng trng.

tin hnh cng tc th nghim cc h thng iu khin gim st v qun l trm trn btng theo m, c th tin hnh theo ba phng n:
73

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

Phng n 1: Lp t h thng iu khin trn thit b trm trn thc t hoc kt ni n cc khu chp hnh thc t v tin hnh th nghim. Phng n ny c hn ch v mt chi ph cao, khng ch ng hon ton trong ton b vic gi lp tham s. Phng n 2: Xy dng mt modul m phng vo/ra, modul c chc nng gi lp ton b cc tn hiu vo/ra st thc t. Phng n 3: Xy dng modul phn mm chy trn my tnh, c lp vi cc phn mm iu khin, gim st v qun l. Modul ny c chc nng gi lp cc d liu u vo cho h thng. Phng n th 3 ny ch ph hp cho vic kim tra v hiu chnh cc phn mm: phn mm iu khin trn PC v PLC, phn mm gim st v qun l trn PC. Qua phn tch cc phng n, chng ti la chn phng n th hai pht trin modul m phng phc v cho cng tc th nghim v hiu chnh h thng. y l phng n c tnh kinh v tham s gi lp rng v ch ng theo chng trnh iu t khin. Trong phm vi nghin cu ca bi bo ny, chng ti tp trung trnh by v mt s vn chnh trong vic thit k v xy dng mch in t m phng cc tn hiu u vo/ ra cho t iu khin bng mch nhng vi iu khin gi lp ton b tn hiu u vo (ngun p, dng, tn hiu logic) cho PLC theo chu trnh c lp trnh sn. Mch m phng da trn vi iu kh in nhng c th c lp trnh tham s ha cc tn hiu: u vo s: Gi lp cc tn hiu ca cc cng tc hnh trnh v ly tn hiu trc tip ti u vo I/O ca PLC. u vo tng t: Gi lp cc tn hiu ca u cn loadcell (c th la chn u vo dng hoc p) a n modul vo s EM231 ca PLC S7-200.

2. Xc nh bi ton m phng 2.1. i tng gi lp - trm trn btng Cc trm trn btng theo chu k c th c thit k khc nhau mt s khu chnh, l: (i) Kiu my trn s dng (my trn k iu turbin, my trn kiu hnh tinh, my trn kiu trc ngang); (ii) Cch cn ct liu (cn cng dn , ct khi x trc tip ln xe skip; cn c ng dn , ct khi x ln bng ti nh lng; cn cng dn , ct khi x ln bunke nh lng ph); (iii) Cch vn chuyn ct liu (bng ti, xe skip). Tuy nhin, v kha cnh bi ton iu khin, ta c th s dng mt m hnh tng qut cho cc kiu thit k trn. thun tin cho vic m t bi ton, chng ti s dng m hnh thit k nh sau. - My tr kiu hnh tinh, c m ng c trn (khng o chiu), ca x n t ximng c iu khin bng xilanh kh, c 2 cng tc hnh trnh xc nh trng thi; - 04 bunke c liu, mi bunke ct liu c sensor o m; ca x ct liu t c iu khin bng xilanh kh, c 2 cng tc hnh trnh xc nh trng thi; - Cn cng dn , ct khi x trc tip ln xe skip, h cn ct liu t ngay di v tr np liu cho xe skip, ton b xe skip c t trn gi cn c 4 loadcell;
74

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

- Vn chuyn ct liu bng xe skip, xe skip c ko bi ng c c o chiu; trn ng ray skip c 3 cng tc hnh trnh bo v tr ca xe: (1) v tr cn, (2) v tr cn trn sn sng liu vo bung trn v (3) v tr liu vo bung trn; - Bunke nh lng ximng s dng 3 loadcell, xi mng cp cho bunke nh lng t 1 trong 2 vt ti ng vi 2 silo cha 2 loi xi mng khc nhau. Cc ng c vt ti khng cn o chiu. - Cn cng dn nc v ph gia, dng 1 loadcell; S dng mt my bm nc t b v 1 my bm ph gia t thng cha ph gia ln silo nh lng. X nc v ph gia vo bung trn thng qua vic iu khin mt xilanh khi ng m ca x, c 2 cng tc hnh trnh xc nh trng thi ca x. - Trm trn c thit k c 2 ch lm vic: (1) Ch iu khin bng tay qua bn iu khin trn t; (2) Ch iu khin t ng. - H iu khin cho php nhp tham s m trn qua 3 phng php: (1) Qua phn mm gim st trn my tnh; (2) Qua bn iu khin trn t v (3) Qua mn hnh cng nghip TD200. 2.2. S khi h thng iu khin gim st trm trn btng Bn iu khin

Cm bin nh lng Cm bin trng thi

Giao tip PLC TD200

PC

B iu khin trung tm PLC Mch ng lc (T in)

Thit b chp hnh 1

Thit b chp hnh 2

Thit b chp hnh n

Hnh 1. S giao tip cc khi trong h thng iu khin

Trong : - PC: c ci t phn mm iu khin, gim st v qun l trm trn. Bn iu khin: La chn ch iu khin v cho php iu khin h thng ch bng tay. - PLC: B iu khin trung tm, trc tip iu khin h thng thng qua cc mch ng lc. Chng trnh iu khin chnh c thc thi trn y. C chc nng nhn lnh v gi thng tin gim st vi PC v TD200 qua ng truyn RS845. Thu nhn v chuyn i cc tn hiu t cc loadcell trng lng, sensor m, sensor trng thi.
75

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

- T ng lc: c lp t ton b cc thit b iu khin cho h thng - Cc thit b chp hnh: Cc ng c, cc van kh, - Cm bin: Cc loadcell trng lng v cc sensor xc nh m ca ct liu v cc cng tc hnh trnh xc nh trng thi ca cc c cu. S giao tip chi tit cc thnh phn trn c m t trong Hnh 2.
Sw ca x nc Sw ca x ximng Sw ca x b tng Sw np ct liu Sw ch np ct liu Sw ch cn ct liu Sw ca x ct liu 1 Sw ca x ct liu 2 Sw ca x ct liu 3 Sw ca x ct liu 4
Loadcell ct liu

Computer

RS232/ RS485

Upto 16 DI

ADC 12 (16) bit 8 AI


0-100 deg

12 bit

T mV 10-50 A B T

PLC S7 200
Up to 16 DO

TD 200

Xi lanh ca x 1

Vt ti 5, 6 T iu khin Motor (5), (6)

Loadcell ximng
T A T B

Xi lanh ca x 2 Xi lanh ca x 3

Motor (7)
T

Xe Skip
Bm nc

Xi lanh ca x 4
T

Motor (8)

Xi lanh ca x 11 Xi lanh ca x 12

1U

Motor (9)

Bm ph gia

Xi lanh ca x 13

Mixer Motor (10)

Hnh 2. S kt ni cc thnh phn trong h thng iu khin

2.3. S ghp ni h thng iu khin vi MODUL m phng

76

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

ADC EM 231

PLC S7-200

12 lines (digital): 4 lines (analog): 1. 2. 3. 4. Cn ct liu (1) Cn nc, PG (1) Cn ximng (1) o m (1) 1. 2. 3. 4. 5. 6. 7. 8. Van x liu (4) Bm ximng (2) Bm nc (1) Bm ph gia (1) c xe Skip (1) Van x ximng (1) Van x nc (1) Van x btng (1) 6 lines (digital): 1. 2. 3. 4. V tr xe Skip (3) Ca x ximng (1) Ca x nc (1) Ca x btng (1)

Simulator MODUL
Hnh 3. S ghp ni h thng iu khin vi MODUL m phng

3. Thit k modul m phng 3.1. La chn thit k Vi bi ton t ra chng ti la chn thit k mch m phng da trn vi iu khin 8 bit PSoC (Programmable System on Chip) ca hng Cypress [2] (Hnh bn). So vi cc vi iu khin 8 -bt tiu chun, cc chip PSoC c thm cc khi tng t v s lp trnh c kh nng lp trnh c, chng cho php vic thit lp mt s lng ln cc ngoi vi. Cc khi s cha mt s cc khi s nh hn c kh nng lp trnh c c th c cu hnh cho cc ng dng khc nhau. Cc kh analog c s dng cho i vic pht trin cc thnh phn analog nh cc b lc tng t, cc b so snh, cc b chuyn i ADC phn gii ti a 14 bt, cc b chuyn i DAC phn gii ti a 9 bt. C mt s h PSoC khc nhau cho php la chn theo yu c ca thit k. S khc nhau gia u cc h PSo C l s lng cc k h i A/D c th lp trnh c v s lng cc chn vo ra. Ph thuc vo cc h vi iu khin, PSoC c th c t 4 n 16 khi s v t 3 n 12 khi tng t c kh nng lp trnh c.

77

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

3.2. S nguyn l mch in modul m phng Modul c thit k bao gm: 08 u vo s cch ly. S dng cho 12 ng tn hiu s c lit k trong Hnh 3, trong 4 tn hiu bo kch hot van x liu c ghp song song to nn 1 tn hiu duy nht, ch th qu trnh cn ct liu; 2 tn hiu bo kch hot ng c vt ti ximng ghp song song to nn 1 tn hiu duy nht ch th qu trnh cn xim ng; 08 ra s cch ly, s dng cho 6 ng tn hi u s; 04 u ra u tng t, s dng cho 4 ng tn hiu tng t (Hnh 3); mn hin th LCD 16x2. S mch nguyn l ca modul c th hin trong Hnh 4.
D25 DIODE 5V C14 5V J13
28

5V JP10

0 0
LCD_D7 LCD_D6 LCD_D5 LCD_D4

103 U2 1 2 3 4 5 6 7 8 9 DATA6 DATA5 DATA4 SCLK/DATA8 10 11 12 13 27 26 25 24 23 22 21 20 19 18 17 16 15

INP1 INP2 INP3 INP4 INP5 INP6 INP7 INP8

9 8 7 6 5 4 3 2 1 trotreo 4.7K

DA4 DA2 OE1 LCD_RS LCD_D7 LCD_D5

P0.7 P0.5 P0.3 P0.1 P2.7 P2.5 P2.3 P2.1 SMP P1.7 P1.5 P1.3 P1.1

P0.6 P0.4 P0.2 P0.0 P2.6 P2.4 P2.2 P2.0 XRES P1.6 P1.4 P1.2 P1.0

DA3 DA1 LE2 LCD_RW LCD_E LCD_D6 LCD_D4 XRES DATA3 DATA2 DATA1 SDATA/DATA7

LCD_E LCD_RW LCD_RS

5V

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 LCD16x2

12V 12V 3 R30 1K R23 1K R22 R R5 1k R6 1k R7 1k R8 1k R9 1k 1 2

LS1 5 4

JP2 2 1 3 HEADER 3

VDD

D21 LED

D20 LED

D19 LED

D10 LED

D11 LED

D12 LED

D13 LED

D14 LED 3

RELAY SPDT LS3 5 4 1 2 RELAY SPDT LS4 5 3

JP3 2 1 3 HEADER 3_0

RL8

RL7

RL6

RL5

RL4

RL3

RL2

RL1

C3 C1 104 10u JP4 2 1 3 HEADER 3_0

GND

0
27443-PI OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 OUT8 5V INP1

J12 1 2 3 4 5 6 7 8 9 18 17 16 15 14 13 12 11 10 UNL2803 C12 RL1 RL2 RL3 RL4 RL5 RL6 RL7 RL8 12V

4 1 2 RELAY SPDT LS5 5 3 4 1 2 RELAY SPDT LS6 5 3

14

0
J16 1 2 4 1

JP5 2 1 3 HEADER 3_0

R10 1 + 2 100K

U4 6 5 4 2
20

C23 470u/25v

220V_in J17 1 2 4 -

4N35 U5 R11 + 2 100k C21 470u/25v 2 4N35 1 6 5 4 INP2 INP1 INP2 INP3 INP4 INP5 INP6 INP7 INP8 OE1 5 C20 470u/25v 2 4N35 4 INP3 2 3 4 5 6 7 8 9

1 3

0
U12 1D 2D 3D 4D 5D 6D 7D 8D 19 18 17 16 15 14 13 12 DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 DATA8
VCC

104

JP6 2 1 3 HEADER 3_0

220V_in J18 1 2 4 -

U6 R12 100K + 2 1 6

1Q 2Q 3Q 4Q 5Q 6Q 7Q 8Q

5V 1 2 VCC

3 1

RELAY SPDT SW1 3 RESET XRES 1 2 R21 10K RELAY SPDT LS8 5 GND 3 4 JP8 2 1 3 HEADER 3_0 4 LS7 5 JP7 2 1 3 HEADER 3_0

1 74HC573_INP OE 11 LE
GND 10

220V_in J19 1 2 4 -

13

U7 R13 100K + 2 C19 470u/25v 2 4N35


13

6 5 4 5V U8 INP4 D16

DIODE

220V_in J20 1 2 4 -

R15 100K + 2

1 C18 470u/25v 2 4N35

6 5 4 DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 DATA8 LE2 2 3 4 5 6 7 8 9 INP5

1 2 RELAY SPDT

20

U13 1D 2D 3D 4D 5D 6D 7D 8D

220V_in J21 1 2 4 -

U9 R16 100K + 2 C17 470u/25v 2 4N35


13

6 5 4 INP6

1Q 2Q 3Q 4Q 5Q 6Q 7Q 8Q

19 18 17 16 15 14 13 12

OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 OUT8

SDATA/DATA7 SCLK/DATA8 XRES GND VCC J22 1 2 3 4 5 10 9 8 7 6

LS9 5 3 4 1 2 C13 RELAY SPDT 1000u/25V

JP9 2 1 3 HEADER 3_0

1 74HC573_RELAY OE
GND

220V_in J24 1 2 4 -

VCC

11 U14 R18 + 2 100K 1 C16 470u/25v 2 4N35 U15 R17 100K 1 C15 470u/25v 2 4N35 6 6 5 4 INP7

LE

PROGRAMER

10

220V_in J25 1 2 4 1

0
12V 5V 5 4 INP8 JP1 3 2 1 DIODE D22 C10 1000u/5V C11 104 LED D23 R31 560R R32 1K

5V J26 1 2 3 4 5 6

+ 2

DA4 DA3 DA2 DA1

220V_in

D24 LED HEADER 6

0
POWER IN

Hnh 4. S mch nguyn l ca modul m phng 78

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

3.3. Cc thut ton chnh Bc 1: Kim tra tn hiu van x liu 1, nu c kch hot (mc tch cc) th tng gi tr u ra Analog1 vi dc k1 sau chuyn sang Bc 2. Nu van x liu 1 khng kch hot th chuyn sang Bc 2. Bc 2: Kim tra tn hiu van x liu 2, nu c kch hot th tng gi tr u ra Analog1 vi dc k2 sau chuyn sang Bc 3. Nu van x liu 2 khng kch hot th chuyn sang Bc 3. Bc 3: Kim tra tn hiu van x liu 3, nu c kch hot th tng gi tr u ra Analog1 vi dc k3 sau chuyn sang Bc 4. Nu van x liu 3 khng kch hot th chuyn sang Bc 4. Bc 4: Kim tra tn hiu van x liu 4, nu c kch hot th tng gi tr u ra Analog1 vi dc k4 sau chuyn sang Bc 5. Nu van x liu 4 khng kch hot th chuyn sang Bc 5. Bc 5: Kim tra tn hiu ng c xe Skip&Skip1, nu c kch hot th t u ra Skip1 = 0; t u ra Skip2 = 1 sau thi gian tr T1; sau chuyn sang Bc 6. Nu khng c kch hot th chuyn sang Bc 6. Bc 6: Kim tra tn hiu ng c Skip&Skip2, nu c kch hot th t u ra Skip2=0; t u ra Skip3=1 sau thi gian tr T2; sau chuy sang Bc 7. Nu n khng c kch hot th chuyn sang Bc 7. Bc 7: Kim tra tn hiu ng c Skip&Skip3, nu c kch hot th t u ra Skip3=0; t u ra Skip1=1 sau thi gian tr T3; sau chuyn sang Bc 8. Nu khng c kch hot th chuyn sang Bc 8. Bc 8: Kim tra tn hiu bm nc, nu c kch hot th tng gi tr u ra Analog2 vi dc k5 sau chuy sang Bc 9. Nu khng c kch hot th n chuyn sang Bc 9. Bc 9: Kim tra tn hi u bm ph gia, nu c kch hot th tng gi tr u ra Analog2 vi dc k6 sau chuy sang Bc 10. Nu khng c kch hot th n chuyn sang Bc 10. Bc 10: Kim tra tn hiu Van x nc, nu c kch hot th t u ra ca x nc =1; t u ra Ca x nc=0 sau thi gian tr T3; sau chuyn sang Bc 11. Nu khng c kch hot th chuyn sang Bc 11. Bc 11: Kim tra tn hiu Bm xi mng, n c kch hot th tng gi tr u ra u Analog3 vi dc k7 sau chuy sang Bc 12. Nu khng c kch hot th n chuyn sang Bc 12. Bc 12: Kim tra tn hiu van x xi mng, nu c kch hot th t u ra ca x ximng =1; t u ra Ca x ximng=0 sau thi gian tr T4 sau chuyn sang bc 13. Nu khng c kch hot th chuyn sang bc 13. Bc 13: Kim tra tn hiu Van x btng, nu c kch hot th t u ra ca x
79

TP CH KHOA HC V CNG NGH, I HC NNG - S 5(34).2009

Trong , cc dc ki (i=1..4) c xc nh ph thuc vo tc x ct liu [1] (c ht ct liu v din tch ca x); ki (i=5,6) c xc nh theo cng sut bm ca cc h thng bm nc (k5) v bm ph gia ( k6); k7 c xc nh theo cng sut h thng vt ti ximng. Cc b nh thi T1..T5 c xc lp theo quy trnh trn btng tng ng vi loi my trn c th [3]. 4. Kt qu v tho lun T thit k trn y, chng ti lp t th nghim modul m phng. Vic th nghim cho thy bn thit k mch m phng u vo cho t iu khin bng mch iu khin nhng c th a ra c cc tham s: Cc u vo s - gi lp cc tn hiu ca cc cng tc hnh trnh v ly tn hiu trc tip ti u vo I/O ca PLC v cc u vo tng t - gi lp cc tn hiu ca u cn loadcell a n modul vo s EM231 ca PLC. Qua qu trnh th nghim, hiu chnh v hon thin phn mm nhng, modul ny v c bn p ng y cc yu cu ca cng tc th nghim h thng, chi ph thp v p dng hiu qu trong sn xut. Cc tnh nng c bn ca modul ny gm: (i) Th nghim tnh thng sut ca cc u vo s, chnh xc v tin cy ca cc u vo tng t; (ii) Kh nng hot ng ca cc thit b m cng sut (rle, contactor, vv) v s hot ng ca ton b cc thit b khi c lp t vo t iu khin; (iii) Cc chc nng ca phn mm iu khin; v (iv) Th nghim cc tnh nng ca phn mm qun l phi liu, nht k sn xut, qun l sn phm, vt t tiu hao v kho cng trng. Trn thc t, tc x ct liu t cc bunke cha xung xe skip trong qu trnh cn cn ph thuc rt ng k vo cc yu t: (i) m ca ct liu; (ii) c ht ca ct liu v cao (lng) ct liu hin thi trong bunke. V th, tng cng kh nng m phng st thc t c a modul, cn pht trin thut ton thay tnh cc dc ki (i=1..4) l hm theo thi gian, m v c ht. Vn ny s tip tc c cp n trong cc nghin cu tip theo ca nhm. TI LIU THAM KHO [1] IU. M. Bazenov, Bch nh Thin, Trn Ngc T nh. Cng ngh B tng. Nxb Xy dng, H Ni, 2004. [2] CYPRESS MICROSYSTEMS. 8-Bit Programmable System-on-Chip (PSoC) Microcontrollers, 2002. [3] http://www.sicoma.biz/code/planetary.htm.

80