【正文】
ELSIF pos=4 AND (stoplight(pos)=39。 END IF。mylift=doorclose。 ELSE udsig=39。139。 ELSIF (stoplight(1)=39。139。mylift=up。139。139。139。 ELSE udsig=39。139。 ELSIF 29 (fdnlight(3)=39。139。 OR fuplight(3)=39。clearup=39。 THEN udsig=39。 END IF。 THEN IF position=4 THEN IF stoplight=0000AND fuplight=0000 AND fdnlight=0000 THEN udsig=39。039。139。 clearup=39。 ARCHITECTURE art OF fourfilft IS TYPE lift_stata IS (stopon1,dooropen,doorclose,doorwait1,doorwait2,doorwait3,doorwait4,up,down,stop)。 fuplight:BUFFER STD_LOGIC_VECTOR(4 DOWNTO 1)。 liftclk:IN STD_LOGIC。 END CASE。 WHEN st2= b_outputs=10。 由信號(hào) current_state 將當(dāng)前狀態(tài)值帶出此進(jìn)程,進(jìn)入進(jìn)程 COM COM: PROCESS(current_state, state_Inputs) 組合邏輯進(jìn)程 BEGIN CASE current_state IS 確定當(dāng)前狀態(tài)的狀態(tài)值 25 WHEN st0 =b_outputs = 00。139。 USE 。李老師 22 一絲不茍的作風(fēng),嚴(yán)謹(jǐn)求實(shí)的態(tài)度,孜孜不倦的授業(yè)精神,不但教我如何完成畢業(yè)設(shè)計(jì),還教我不怕麻煩,注意細(xì)節(jié)的做人法則,給以我終生受益無窮之道。類似的當(dāng)電梯上升狀態(tài)處于第 n 層的時(shí)候就要判斷比它高的層次的請(qǐng)求 ,當(dāng)電梯處于下降模式時(shí),就要判斷比該層低的層的請(qǐng)求。我們觀察 fdnlight 的變化顯示的是 8,轉(zhuǎn)換為二進(jìn)制就是“ 1000”, 20 正好是第四層的下降指示燈亮,在電梯到第四層響應(yīng)了下降請(qǐng)求后,下降指示燈就關(guān)閉,顯示的就是“ 0”。 圖 7 所示仿真的是在 2 層電梯外部有上升請(qǐng)求,也就是 f2upbutton 產(chǎn)生一個(gè)脈沖,可以看到電梯從一層上升到二層, position 信號(hào)由 1 變到 2, doorlight 信號(hào)邏輯’ 1’表示開門,’ 0’表示關(guān)門。 在狀態(tài)機(jī)進(jìn)程中,在電梯上升狀態(tài)中,通過對(duì)信號(hào)燈的判斷,決定下一個(gè)狀態(tài)是繼續(xù)上升還是停止;在電梯下降狀態(tài) 中,也是通過對(duì)信號(hào)燈的判斷,決定下一個(gè)狀態(tài)是繼續(xù)下降還是是停止;在電梯停止?fàn)顟B(tài)中,判斷是最復(fù)雜的,通過對(duì)信號(hào)的判斷,決定電梯是上升、下降還是停止。 “ 00”的時(shí)候?qū)?yīng)電梯的第一層, “ 11”的時(shí)候就對(duì)應(yīng)第四層。各個(gè)狀態(tài)之間的轉(zhuǎn)換條件可由上面的設(shè)計(jì)要求所決定。 15 (3)電梯每秒上升 (下降 )一層樓。 在二進(jìn)制編碼的狀態(tài)機(jī)中,狀態(tài)位 (B)與狀態(tài) (S)的數(shù)目之間的關(guān)系為B=log2S,如兩位狀態(tài)位就有 00, 01, 10, 11 四個(gè)不同狀態(tài),它們?cè)诓煌目刂菩盘?hào)下可以進(jìn)行狀態(tài)轉(zhuǎn)換,但如果各觸發(fā)器又沒有準(zhǔn)確地同時(shí)改變其輸出值,那么在狀 態(tài) 01 變到 10 時(shí)則會(huì)出現(xiàn)暫時(shí)的 11 或 00 狀態(tài)輸出,這類險(xiǎn)象可能使整個(gè)系統(tǒng)造成不可預(yù)測的結(jié)果。在設(shè)計(jì)過程中,如果希望輸出的信號(hào)具有寄存器 14 鎖存功能,則需要為此輸出寫第 3 個(gè)進(jìn)程,并把 clk 和 reset 信號(hào)放入敏感信號(hào)表中。 3 主控組合進(jìn)程 根據(jù) 外部輸入的控制信號(hào)(包括來自外部的和狀態(tài)機(jī)內(nèi)容的非主控進(jìn)程的信號(hào))或和當(dāng)前狀態(tài)值確定下一狀態(tài) next_state 的取值內(nèi)容,以及對(duì)外或?qū)?nèi)部其他進(jìn)程輸出控制信號(hào)的內(nèi)容。大多數(shù)實(shí)用的狀態(tài)機(jī)都是同步的時(shí)序電路,由時(shí)鐘信號(hào)觸發(fā)進(jìn)行狀態(tài)的轉(zhuǎn)換。 輸出信號(hào)由輸出譯碼器根據(jù)當(dāng)前狀態(tài)和輸入條件確定。除了輸人信號(hào)、輸出信號(hào)外,狀態(tài)機(jī)還包含一組寄存器記憶狀態(tài)機(jī)的內(nèi)部狀態(tài)。 電梯控制器可以通過多種方法進(jìn)行設(shè)計(jì),其中采用狀態(tài)機(jī)來實(shí)現(xiàn),思路比較清晰。如果采用硬件描述語言來完成電梯控制器的設(shè)計(jì),就可以克服 PLC 電梯的大部分缺點(diǎn)。 ( 6)后仿真(時(shí)序仿真)。 ( 3)功能仿真(前仿真)。 ( 4)系統(tǒng)設(shè)計(jì)與硬件結(jié)構(gòu)無關(guān),方便了工藝的轉(zhuǎn)換,也不會(huì)因工藝變化而使描述過時(shí)。 VHDL 主要用于描述數(shù)字系統(tǒng)的結(jié)構(gòu),行為,功能和接口。在科研方面:主要利用電路仿真工具 (EwB 或 PSPICE、 VLOL 等 )進(jìn)行電路設(shè)計(jì)與仿真;利用虛擬儀器進(jìn)行產(chǎn)品調(diào)試;將 O)LI)/ FPGA 器件的開發(fā)應(yīng)用到儀器設(shè)備中。但從 EDA 技術(shù)的幾個(gè)主要方面的內(nèi)容來看,可以理解為: EDA 技術(shù)是以大規(guī)??删幊踢壿嬈骷樵O(shè)計(jì)載體,以硬件描述語言為系統(tǒng)邏 輯描述的主要表達(dá)方式,以計(jì)算機(jī)、大規(guī)??删幊踢壿嬈骷拈_發(fā)軟件及實(shí)驗(yàn)開發(fā)系統(tǒng)為設(shè)計(jì)工具,通過有關(guān)的開發(fā)軟件,自動(dòng)完成用軟件的方式設(shè)計(jì)電子系統(tǒng)到硬件系統(tǒng)的一門新技術(shù)。 通過各樓層加裝的外招接口板采集所有外招信號(hào),電梯內(nèi)加裝的內(nèi)招接口板采集電梯的內(nèi)招信號(hào),電梯的控制柜中加裝的電梯狀態(tài)接口板采集電梯的目前狀態(tài):如口前樓層、運(yùn)行方向、電梯門狀態(tài)、電梯停止等信號(hào),通過串行總線送往群控主機(jī),群控主機(jī)根據(jù)采集到的信號(hào)作 派梯選澤,將派梯信號(hào)回送到外招接口板,由外招接口板將信號(hào)發(fā)送給電梯的外招板,完成派梯。這是由多種原因造成的。目前,我國電梯保有量已超過 100 萬臺(tái),且保持每年 20%的遞增速度,市場前景樂觀。上世紀(jì) 80 年代,國內(nèi)電梯行業(yè)基本應(yīng)用傳統(tǒng)的繼電器控制方式,電梯故障率很高。s development, the elevator use is more and moremon, from originally only in the mercial building, theguesthouse use, transited to in place use and so on the officebuilding, building of residence, and also unceasingly enhances to theelevator function request, correspondingly its control mode also indoes not stop changes. Regarding the elevator control, the traditionalmethod is uses the relay contact device control system to carry onthe control, along with the technical unceasing development, themicroputer is day by day widespread in elevator controlapplication, now entered the entire microputer control the time. The present era day by day increases along with the highriseconstruction with the architectural design scale enhancement, causesthe people more and more to be also high to the elevator request. Atpresent not only has been restricted in requests the elevator totravel by fast, fortable, manufacture firm, the decoration iselegant, the people to the elevator security reliability andmultipurpose were proposing the more and more high request, is facingthe control intellectualization direction for this elevator todevelop. But the elevator core is the elevator controller, the elevatorcontroller realization also has many center ways, such as PLC,monolithic integrated circuit, and so on In the before elevatorcontroller design, majority of all was uses PLC to realize, but PLCwas realizes the elevator control based on the periphery hardware,such design was very difficult to realize the elevatorintellectualization, had to realize the elevator intellectualization,had to select other design methods to plete to the elevatorcontroller design, but used the hardware description language toplete the elevator controller the design, could the very easyrealization elevator intelligence Essential character: Elevator controller, CPLD, VHDL conditionmachine 2 目 錄 目 錄 ....................................................... 0 1 緒論 ........................................................ 3 國內(nèi)外研究現(xiàn)狀及發(fā)展趨勢 ...................................... 3 電梯智能化及其實(shí)現(xiàn) ............................................ 3 接口層的實(shí)現(xiàn) .............................................. 4 群控策略的選擇 ............................................ 4 論文的主要工作及結(jié)構(gòu) .......................................... 5 2 EDA 技術(shù)及 VHDL 語言 .......................................... 5 EDA 技術(shù) ...................................................... 5 VHDL 語言 ..................................................... 6 3 四層電梯控制器的 VHDL 設(shè)計(jì) .................................... 7 PLC 電梯控制缺點(diǎn) .............................................. 8 電梯控制器流程 ................................................ 8 狀態(tài)機(jī)及其 VHDL 設(shè)計(jì) ......................................... 11 狀態(tài)機(jī)的基本結(jié)構(gòu)和功能 .................................... 12 一般狀態(tài)機(jī)的 VHDL 設(shè)計(jì) ..................................... 13 四層電梯控制器具體設(shè)計(jì) ....................................... 14 四層電梯控制器的功能及設(shè)計(jì)思路 ............................ 14 4 四層電梯控制器的調(diào)試及仿真 .................................. 17 程序修改調(diào)試 ................................................ 17 波形仿真 .............