Tuyen tap bao cao khoa hpc Hdi nghi Khoa hpc ky thuat Do ludng toan qudc Ian thfl IV Hd Ngi, 11-2005 \\SUQ DUNG MAX+PLUS II TRONG THIET KE CAC Bp DIEU KHIEN DONG CO DIEN TREN CO Sd PLIC CUA HANG ALTERA Phgm Tudn Thdnh Hgc vien ky tluidt qudn sif Tom tdt: Bdi hdo trinh bdy nhifng net ca bdn vd qui trinh trien khai ifng dung thifc te cdng nghe PLIC(Programmable Logic Integrated Circuit) mdi tnfdng thie't ke' tif dgng MAX+PLUSII (Multiple Array Matrix Programmable Logic User) cua hdng Altera Bdi hdo cdng gidi thieu mdt so ke't qud trien khai thifc te'khi xdy difng bd diiu khien ddng cff khdng dong bg pha vdi thiet hi dich Id EPM7128LC84-I5 Abstract: This article describes the main aspects and progress of apply in practice PLIC technology (Programmable Logic Integrated Circuit) on environment of automatic design MAX+PLUSII (Multiple Array Matrix Programmable Logic User) of firm Altera The article also introduces some results of apply in practice, set up die controler two-phase AC motors with the equipment desdnation EMP7128LC84-I5 I Md DAU Cling vdi hang Xilinx, cdng nghfi PLIC cua hang Altera va mfit sd hang khac da cd mdi sd nghifin cflu trien khai ung dung thuc tifin d nudc ta Tuy nhifin mfit sd nghifin cflu vfi xay dung cdc bd didu khidn ddng co difin dua trfin cdng nghe chua dugc dd cdp dfi'n nhidu Vific flng dung va lam chu cfing nghfi PLIC la dieu rat cdn thifi't, giup cho cdc nhd thifi't kfi' tifi't kifim dugc thdi gian va giam chi phf qua trinh thifi't ke, tao dugc cac giai phdp tfi'i uu giai quyfi't cac bai todn flng dung phflc tap Chi'nh vi vdy bdi bdo mufi'n gidi thifiu mfit sd ke't qua thuc hifin xdy dung bd didu khidn ddng co khdng ddng bd pha, la loai ddng co dugc sfl dung rdng rai cac hfi thdng truydn ddng bdm, trfin CO sd dd cd thd tridn khai thuc hifin tuong tu cho cdc loai ddng co khdc II.VE CONG NGHE PLIC CUA HANG ALTERA Cdu true PLIC dugc dua trfin cdc khai nifim co sd cua dai sd logic (dai sd Boole) vd chfla cdc phdn tfl logic sau: AND, OR, NOT, cac bd dfim, cac Triger dang D va T va cac bd nhan Theo cdng nghfi va cd'u true cua PLIC ngudi ta chia lam cac dang sau: [1] • • F P G A (Field Programmable Gate Array); E P L D ((E) EPROM technology-based complex Programmable Logic Devices); • C P L D ( C M O S FastFlassh complex Programmable Logic Devices); • M P L D (Maslz Programable Logic Devices) Phu thudc vdo cong nghfi chfi' tao PLIC, vific ndi day dugc thuc hifin bdng cdc ddy kim loai ndng chay hoac la bdng cde phdn tfl nhd Trong Irudng hop thfl nhd't PLIC dugc thuc hien theo cdng nghfi EEPROM, vdi loai cd cac hg 7000/E/S/A, MAX 9000A, cho phep khfing qua 100 chu trinh ghi-xoa Ddi vdi trudng hgp thfl hai (nap cd'u hinh bdt 820 ngudn) PLIC dugc thuc hifin theo cdng nghfi SRAMiSiadc Random Access Memory), dd'i vdi loai cd cdc hg FLEX 6000A, FLEX 8000A, FLEX lOK/KA/KB/KE vdi sd lugng chu trinh xod-nap khdng ban che' va cho phep qua tai true tifi'p ve cd'u hinh qua trinh Iam viec III HE THONG THIET KE MAX+PLUS II CUA ALTERA MAX+PLUS II la mdi trudng thifi't kfi' dfi dang thfch nghi vdi cdc yfiu cdu thifi't ke' cu thd, nd cd ddy du cdc khd nang di thie't kfi' cdc thifi't bi sd dd la: cac dang khac cua dau vao du an, tdng hgp logic, bifin dich vdi thdi gian cho trudc, md phdng theo chfle nang va midn thdi gian, chia du an thdnh timg phdn vd md phdng du dn trfin mdt so cdc IC, phdn tfch mifin thdi gian, tu ddng xac dinh ldi, thuc hifin nap ca'u hinh va kie'm nghiem trfin cac thifi't bi dfch (IC) MAX+PLUS II cho phep dua vao du an dudi dang cac Files hodc cac dang ngdn ngtt ldp trinh sau:[21 • AHDL (Altera Haraware Decripdon Language): Ddy Id ngdn ngtt md ta phdn cflng cua hang Altera; • EDIF (Electronit Design Interchange Format): Day la djnh dang chuan dd chuyfin giao du an cho cdc mfii trudng tu ddng hoa thifi't kfi' khdc; • Verilog HDL: la ngdn mifiu ta hfi thdng ciia mdi trudng (HDL); • VHDL (Very High Speed Integrated Hardware Decripdon Language): Ddy la ngdn ngfl md ta he thdng ddi vdi cac IC tdc dd tdc ddng nhanh, duoc cdng nhan tieu chua'n IEEE tfl ndm 1987; • OrCAD Ngodi MAX+PLUS II cd the sfl dung cac Files netlisl ciia hang Xilinx dd lam du an ddu vao, va cd thd tao la cdc Files ddu dang SDF (Standaid Delay Format) dd dam bao cho vific giao tifi'p vdi cac mdi Irudng tu ddng hod thie't ke' cua cac hang khac theo tifiu chudn cdng nghifip CAE (Computer Aided Engineering) Cac giai doan thiet ke MAX+PLUSII Qud Irinh tao mdt du an mdi tfl y tudng de'n hoan cd the dugc trinh bay ngdn ggn nhu sau: • • • • Tao File ciia du an mdi dudi dang graphic hoac text Chgn thifi't bi dfch (IC) bang tay, hoac chuong trinh se chgn tu dfing; Bien dich du an vfla tao bang trinh bifin dich Compiler; Mfi phdng va phdn tfch theo midn thdi gian nfi'u du an bien dich cdng va khdng cd ldi; Nap cdu hinh vao thifi't bi dfch da chgn nhd cdc tbiet bi nap MasterBIaster hoac Byte Blaster MV IV XAY DUNG BO DIEU KHIEN DONG CO DIEN DUNG CONG NGHE PLIC CUA ALTERA Phdn tdc gia trinh bay viec flng dung cfing nghfi PLIC va mdi trudng tuddng thifi't ke' MAX+PLUSII dd xdy dung bd didu khifin dfing co khfing ddng bd pha cd ghep ndi vdi may tfnh Trfin CO sd [3] cd'u tnic bd dieu khie'n bit ddng co khdng ddng bd pha thuc hifin mdi trudng MAX+PLUSII nhu hinh ve Thifi't bi didu khidn trfin hinh ve thuc hifin didu khie'n pha dfing co khdng dong bfi pha bdng phuong phap xung Khi dd se tao cac xung ludng cue ciia cdc difin ap pha cac cudn kfch tfl va cudn didu khien cung mdt ldn sd Thie't bi difiu khie'n se tao bifi'n logic so bg dau tifin SG, Q, Y, Z Trong dd bifi'n SG dam bao hudng quay cua ddng co, bifi'n Q xac dinh bien dd ciia phan difiu hoa 821 thfl nha't cua dien dp pha cudn difiu khidn Bifi'n Z xac dinh chu ky difin ap pha cudn kich tfl va cudn difiu khidn va cung vdi bifi'n Y (ddi vdi difiu khidn bifin do) dam bao dich pha khdng ddi 90 gitta dien ap didu khien va kfch tfl Ddng rd chay qua cac nhdnh van ciia bd khuyfi'ch dai xung cdng sud't thdi gian chuyen mach tfl che' ddng co sang che' dd ham va ngugc lai la kfi't qua cua vific thay ddi cua cac bifi'n logic SG, Z, YZ, Q De khdc phuc nhttng ddng rd dua vao bie'n logic LSG, LZ, LYZ, LQ va la cac ham ciia cac bie'n SG, Z, YZ, Q tuong flng He thd'ng cac bifi'n SG, Z, YZ, Q, LSG, LZ, LYZ, LQ la ddy dii cho phep thuc hifin phuong phap difiu khidn pha ddng co khdng ddng bd pha Ci vf du chung ta xem xet qui ludt chuydn mach khdng ddi xflng difiu khifin td hgp cac khoa chuyfi'n mach cua bfi khuyfi'ch dai xung cdng sud't Cdc ky hieu tren hlnh 1: • Ky0-Ky4- la bit code difiu khidn; • BFLP - khfi'i tao cdc bie'n logic; • BSMS- khd'i chia modul va da'u tfl code dieu khidn Khd'i cd chfle nang tifi'p nhan Ifl may tfnh hodc tfl may tao code n bit code dieu khie'n chia bit dau (tin hieu SG) va (n-1) bit modul code dieu khien; • BFLV - khd'i tao cdc bifi^n logic so bd ddu tien; • PWM- bd bifi'n ddi code rdng xung cd chfle nang lao bifi'n logic Q hoac QV ma dai ciia nd ty Ifi vdl modul code didu khidn; • DEAD-TIME - khd'i tao thdi gian chet, tao thdi gian gifl chdm cua transistors qua trinh chuyen mach cua chung Cac bifi^n logic dam bao didu kifin bao vfi khdi ddng rd ctia transistors dd la LSG, LQ (LQV),LZ, LYZ; • BFCLF- khd'i tao cac ham logic didu khifi'n, tao cac ham logic UL.U8 dd difiu khidn cac khoa chuyen mach ciia bp khuye'ch dai xung cdng sud't Hinh Sfl dien chuc nang bd dieu khien pha dpng co khdng ddng bd pha dugc thuc hien moi trudng MAX+PLUS II Code didu khidn Ky dugc nhan tfl may tfnh hoac tfl bd't ky mdt thifi't bi tao code nao Tfl didu khidn bit CW= dugc dua tdi bd khuye'ch dai xung cdng sud't vdi cac khoa chuydn mach la cac transistors dugc ndi vdi cdc cudn ddy ciia ddng ca nhu hlnh ve 822 rtj4"" Aw oy Hinh Ndi cac cudn day dgng co vdi bp khuye'ch dai xung cdng suat Ddng CO khdng ddng bd pha gdm cudn day difiu khidn OY va cudn kfch tfl OB, difin dp nudi cdc cudn day dd cd tan so bdng (thudng la 400 Hz), cdn bifin ihudng la khdc Bd khue'eh dai xung cdng suat gdm transistors (K31-K38) cd ldn sd chuyfi'n mach cao va dugc difiu khidn ddng thdi bdng tfl didu khien bit CW= Sau thuc hien bien dich cdng du an d hlnh 1, tifi'n hanh md phdng va nhdn dugc cac ke'l qua md phdng iheo bidu dd thdi gian nhu binh ve va vdi phuong phdp difiu khidn pha Name -t»SG itflSQ Q -&0 t*1 -c»Z -tôLZ I * VZ ã -EằLVZ ^-K^liO] DO - t f U8 •c#U7 -i*iJB Q -ftf US Q •tfUd IDms _Valiis u ^ Clock \ 0m; LJ i 0ms 3Dms \ T"" Dms \ nLJ\ U 1L -i#tJ2 -c*U1 i 1 Dms 1 101 Oms _J L_J ~] _J1 I t ! 1 ~n1 n J 1 n -i#U3 0ms 60ms ^ 1 1 j 1 r" (— 1 Hinh Ket qua md phdng su lam viec ciia bo dieu khien dong co khdng ddng bp pha SG=0,7=0 va y =0,25 (y la he sd dien day dp rpng xung) 823 30ms ^Oms Dm; -'-n 70ms SOms 90ms 101 1 1 1—1 -n I 1 |_ J 1 1 1 rn 11 L 1 1 ! 1 J 1, 1 -c»U5 -^ -n L_ ~\ p L r 1 r- _J _j 1 1 1 J u n II u J L_ n r 3=^1 1 1 1 1 1 1 1 1 1 1 Hinh Ke't qua mo phong su lam viec cua bp dieu khien dpng co khong dong bp pha SG=0,y=lvaSG=l,y=l Cufi'i Cling la nap cd'u hinh va kidm nghiem, lac gia chgn thifi't bi dfch la EMP7128LC84-15, nap cd'u hinh nhd thifi't bi nap Byte Blaster MV Vific lua chgn thie't bi dfch dugc dua trfin kinh nghiem cua mdt nhflng tac gia [4] la mflc sfl dung thifi't bi dfch (sfl dung sd cong Gates) tfl 60-80% Trong vf du nay, sau nap vao Ihie't bi dfch la EMP7128LC84-15 thi mflc dd sfl dung sd cdng la 76% Bd difiu khidn cung vdi mach ghep nd'i vdi mdy tfnh didu khidn ddng co khong ddng bd pha dugc Ihd hifin trfin hlnh ve Hinh Bo dieu khie'n ddng co khong dong bp pha thuc hien tren cong nghe PLIC cua hang Altera Qud trinh didu khidn dugc thuc hifin bdng code difiu khidn Ky nhan tfl may Ifnh ghep nd'i qua cdng song song Chuong trinh dam bao diing de difiu khidn dugc tdc gia vifi't tren ngdn ngfl Delphi va vdi giao dien bdng tie'ng Nga nhu hlnh ve 0,394 Bi.oaKM«yi,paET.i,HH o 50 1 0 iMWLliX^WMj Hinh Giao dien ciia chuong trinh dam bao va mo phdng qua trinh chuyen mach cua cac phan tfl chuyen mach he thdng khuye'ch dai xung cong sua't - dpng co Day la mdt chuong trinh diing dd lao code dieu khidn bit dugc xud't tfl cdng may m, qua trinh didu khifin va dao chidu dugc thuc hifin bdng cdc mil d'n Mdt nhiJng chfle nang ciia chuong trinh dam bao ndy la diing de md phdng va kiem tra cdc thudt loan didu khidn he khuyfi'ch dai xung cdng suat cua cdc loai ddng co ndi chung va dgng co khdng ddng bd pha ndi rifing V KET LUAN Bai bao da gidi thifiu cfing nghfi PLIC cua Altera vd qui trinh tridn khai flng dung trfin mdi Irudng tu ddng thifi't kfi" MAX+PLUS II thuc te Trong vi du minh boa tridn xdy dung cdc bfi didu khifi'n dfing va thudt todn dieu khien, xdy EPM7128LC84-I5, ciing vdi giao khai tren thuc te, tdc gia da chgn vao vific litig dung dd co khdng ddng bd pha Kfi't qua la tao dugc cd'u tnic dung cong Ihie'l bi didu khidn trfin vi mach dien dieu khien bdng may tfnh Tfl CO sd ke't qua hodn loan cd thd xdy dung cac bd didu khidn cac loai ddng co khac nhau, cung nhu thuc hien cac bai loan ludng vd xu ly tfn bifiu trfin cdng nghfi PLIC va mfii irudng tu ddng thifi't kfi' MAX+PLUS II cua hang Altera Tdi liiu tham khdo: [1] HJIMC fpiipMbi "Altera ": 3.ieMenmHaH Oasa, cucmcMa npoeKmuposanua u HSbiKu onucauuH annapamypbi.1 CmeiueuKo B.B - M.: MsdamejibCKuu doM "/Jod3Ka-XXl", 2002.-576 c [2] CucmcMbt aemoMaminiipoeauHOSO npoeKmupoeanua fpiipMbi Altera MAX + plus II u Quartus // Kpamxoe onucanue u caMoyiumejb./ KoMOJi06jl,.A hdmibK P.A., SoOeuKO A.A 0u.iiinnoeA.C - M.: HH PaduoCoipm 2002 325 c.: un [SJ.Honoe E.H., 0aM Tyan Txanb JIoaimecKud aemoMom ynpaenenuH acunxponnbiMU deyxfpasHbi.MU d6mamejia.Mu fpasosbiM cnocodoM ua ocuoee npoepa.MMupyeMbix lOFU^ecKux unmeppcuibHbix cxeM CdopmiK mpydoe XIVMesicdyHapodHOFonay^uomexnuiecKOPO ccMunapa "CoepeMcnubie mexuojiozuu e 3adaiax ynpaenenuH, aemoMOmiiKU u oOpaOonmu unfpop.vaiiuu ', A.iyiuma, 2005 [4].nono6 B.H OduoKpucma.ibnbiii MUKpoKOHmpon.nep sneKmpodeueame jied O.ieKmpomexuuKa, M 7,1994, c.30-34 ... ludng vd xu ly tfn bifiu trfin cdng nghfi PLIC va mfii irudng tu ddng thifi''t kfi'' MAX+PLUS II cua hang Altera Tdi liiu tham khdo: [1] HJIMC fpiipMbi "Altera ": 3.ieMenmHaH Oasa, cucmcMa npoeKmuposanua... che'' va cho phep qua tai true tifi''p ve cd''u hinh qua trinh Iam viec III HE THONG THIET KE MAX+PLUS II CUA ALTERA MAX+PLUS II la mdi trudng thifi''t kfi'' dfi dang thfch nghi vdi cdc yfiu cdu thifi''t... [2] CucmcMbt aemoMaminiipoeauHOSO npoeKmupoeanua fpiipMbi Altera MAX + plus II u Quartus // Kpamxoe onucanue u caMoyiumejb./ KoMOJi06jl,.A hdmibK P.A., SoOeuKO A.A 0u.iiinnoeA.C - M.: HH PaduoCoipm