【正文】
至一層。 同時(shí)有上升和下降請(qǐng)求的仿真波形 從前面所有的仿真波形來(lái)看,電梯的的運(yùn)行 情況 完全符合它的運(yùn)行規(guī)則,電梯的位置變化合情合理 。 第三節(jié) 本設(shè)計(jì)的擴(kuò)展性 三層電梯控制器的設(shè)計(jì)很簡(jiǎn)單,但在實(shí)際應(yīng)用中 ,電梯往往不止三層,因此考慮 設(shè)計(jì)的擴(kuò)展性十分重要。 本設(shè)計(jì) 在信號(hào)定義時(shí) 就 使 用了二進(jìn)制向量,而 非 整數(shù) , 并且使用狀態(tài)機(jī)的設(shè)計(jì)方法,因此 擴(kuò)展性較好。 如果要實(shí)現(xiàn) n層電梯的控制,首先要在 實(shí)體的端口 定義中添加相應(yīng)的增加樓層的上身、下降和停站請(qǐng)求端口,而指示燈只 要把 其數(shù)組寬度由 3 downto 1 改為 n downto 1 就可以了。 在電梯的關(guān)門狀態(tài)中,應(yīng)把 position=3 改為 position=n,關(guān)鍵是修改 position=2 的部分,如果按照原方法把每層羅列,則隨著樓層的增加,程序會(huì)非常復(fù)雜,所以得尋求各 32 中間層的共性。 解決 方法 是,首先定義一個(gè)全局向量 abc 為 std_logic_vector(n downto 1), abc 的 賦值 為 abc= (pos=39。139。,others=39。039。)。在電梯的上升模式時(shí), 如果有本層請(qǐng)求信號(hào),則電梯開(kāi)門;如果沒(méi)有任何請(qǐng)求信號(hào),則 電梯停在當(dāng)前層;否則 用 stoplight 和 fuplight 與全局變量 abc 作比較,如果 stoplight 或 fuplight 比abc 大,則說(shuō)明更高層還有上升 或停站請(qǐng)求,電梯需繼續(xù)上升;如果 abc 更大,則用 abc 與 fdnlight 作比較,如果 fdnlight 更大,則說(shuō)明更高層有下降請(qǐng)求,電梯繼續(xù)上升,否則電梯下降。電梯處在下降模式時(shí) ,同原理分析判定下一狀態(tài)。這樣可以大大簡(jiǎn)化程序,但要注意的是 abc 向量作為判斷依據(jù),需實(shí)時(shí)更新 ,可以單獨(dú)寫一個(gè)進(jìn)程,觸發(fā)時(shí)鐘周期要設(shè)置得很小 。 在電梯的上升狀態(tài) 和 開(kāi)門狀態(tài)中,把 3改為 n, 在信號(hào)燈控制進(jìn)程中加入其它按鍵觸發(fā)指示燈的語(yǔ)句 。 第四節(jié) 本章小結(jié) 本章對(duì) VHDL 源程序進(jìn)行了仿真,分別對(duì)只有一個(gè)上升請(qǐng)求,只有一個(gè)下降請(qǐng)求,有多個(gè)下降請(qǐng)求,有多個(gè)停站請(qǐng)求,只有二樓有下降請(qǐng)求,同時(shí)有上升和下降請(qǐng)求這六種基本情況進(jìn)行了驗(yàn)證。 并且分析了此設(shè)計(jì)的擴(kuò)展方法,即新定義一個(gè)全局變量,在電梯處在中間某層時(shí),用它與 fuplight,fdnlight,stoplight 作比較,來(lái)判定電梯接下來(lái)是上升、下降還是停止。 33 第五章 硬件測(cè)試 第一節(jié) 程序的下載實(shí)現(xiàn) 在驗(yàn)證仿真波 形無(wú)誤后,可以把程序下載到實(shí)驗(yàn)箱上進(jìn)行觀察,進(jìn)一步驗(yàn)證其功能的實(shí)現(xiàn)情況。首先需要鎖引腳 ,我選用了模式三,各引腳的鎖定如表 。 表 引腳的鎖定 端口 結(jié)構(gòu)圖上的信號(hào)名 引腳號(hào) 結(jié) 論 34 在本學(xué)期做畢業(yè)設(shè)計(jì)的過(guò)程中,我學(xué)習(xí)了 VHDL 語(yǔ)言的基本語(yǔ)法, 熟悉了MAX+plus II的 VHDL文本設(shè)計(jì)流程全過(guò)程, 掌握了 三層電梯控制器的設(shè)計(jì)方法,及它 的仿真和硬件測(cè)試。 經(jīng)過(guò)多次改進(jìn), 本設(shè)計(jì)實(shí)現(xiàn)了三層電梯的基本功能, 電梯的的運(yùn)行 情況 完全符合它的運(yùn)行規(guī)則,電梯的位置變化合情合理。 本次三層電梯控制器的設(shè)計(jì)采用VHDL 語(yǔ)言 , 源程序經(jīng) MAX+plus II 軟件仿真,目標(biāo)器件選用 CPLD 器件。 本設(shè)計(jì) 代碼具有良好的可讀性 和 可 移植性 , 運(yùn)用了有限狀態(tài)機(jī)的設(shè)計(jì)方法,使得它靈活、簡(jiǎn)單、運(yùn)算速度快、可靠性高 ,并且此設(shè)計(jì)具有 良 好的擴(kuò)展性。 本文中設(shè)計(jì)的電梯控制器 以 CPLD 為實(shí)現(xiàn)載體,以 VHDL 為描述語(yǔ)言實(shí)現(xiàn)了電梯的升降舒適感和運(yùn)行的可靠性, 相信在以后的智能建筑中 會(huì) 得到廣泛的應(yīng)用和 推廣 致 謝 35 畢業(yè)設(shè)計(jì)順利完成了,在此次實(shí)踐過(guò)程中,我學(xué)到了很多東西。 感謝學(xué)校 給予 我 此次機(jī)會(huì),提供實(shí)驗(yàn)場(chǎng)所。 本課題在選題及研究過(guò)程中 都 得到 了朱治國(guó) 老師的悉心指導(dǎo)。 朱 老師多次詢問(wèn) 設(shè)計(jì) 進(jìn)程, 并 幫助我開(kāi)拓研究思路,精心點(diǎn)撥、熱忱鼓勵(lì)。 他 一絲不茍的作風(fēng),嚴(yán)謹(jǐn)求實(shí)的態(tài)度, 孜孜不倦的授業(yè)精神 , 不但教我如何完成畢業(yè)設(shè)計(jì),還 教我 不怕麻煩,注意細(xì)節(jié)的做人法則, 使 我 終生受益。 再就 是 感謝和我一起做畢業(yè)設(shè)計(jì) 的同學(xué),在 他們 的 幫助下,我才能順利地完成此次設(shè)計(jì)。 36 參考文獻(xiàn) [ 1] EDA 技術(shù)實(shí)用教程 /潘松,黃繼業(yè)編著 . –2 版 . –北京:科學(xué)出版社, 2021 [ 2] 李軍法 , Design of the lift operation controller based on CPLD, 陜西西16746236( 2021) 07005903 附 錄 37 一、英文原文: 1 Introduction Motivation The original motivation for the Universal Serial Bus (USB) came from several considerations, two of the most important being: ? Easeofuse The lack of flexibility in reconfiguring the PC had been acknowledged as the Achilles’ heel to its further deployment. The bination of userfriendly graphical interfaces and the hardware and software mechanisms associated with newgeneration bus architectures have made puters less confrontational and easier to reconfigure. However, from the end user’s point of view, the PC’s I/O interfaces, such as serial/parallel ports, keyboard/mouse/joystick interfaces, etc., did not have the attributes of plugandplay. ? Port Expansion The addition of external peripherals continued to be constrained by port availability. The lack of a bidirectional, lowcost, lowtomid speed peripheral bus held back the creative proliferation of peripherals such as storage devices, answering machines, scanners, PDA’s, keyboards, and mice. Existing interconnects were optimized for one or two point products. As each new function or capability was added to the PC, a new interface had been defined to address this need. Initially, USB provided two speeds (12 Mb/s and Mb/s) that peripherals could use. As PCs became increasingly powerful and able to process larger amounts of data, users needed to get more and more data into and out of their PCs. This led to the definition of the USB specification in 2021 to provide a third transfer rate of 480 Mb/s while retaining backward patibility. In 2021, with wireless technologies being more and more capable, Wireless USB was introduced to provide a new cable free capability to USB. USB is the most successful PC peripheral interconnect ever defined and it has migrated heavily into the CE and Mobile segments. In 2021 alone over 2 billion USB 38 devices were shipped and there are over 6 billion USB products in the installed base today. End users “know” what USB is. Product developers understand the infrastructure and interfaces necessary to build a successful product. USB has gone beyond just being a way to connect peripherals to PCs. Printers use USB to interface directly to cameras. PDAs use USB connected keyboards and mice. The USB OnTheGo definition provides a way for two dual role capable devices to be connected and negotiate which one will operate as the “host.” USB, as a protocol, is also being picked up and used in many nontraditional applications such as industrial automation. Now, as technology innovation marches forward, new kinds of devices, media formats, and large inexpensive storage are converging. They require significantly more bus bandwidth to maintain the interactive experience users have e to expect. HD Camcorders will have tens of gigabytes of storage that the user will want to move to their PC for editing, viewing, and archiving. Furthermore existing devices like still image cameras continue to evolve and are increasing their storage capacity to hold even more unpressed images. Downloading hundreds or even thousands of 10 MB, or larger, raw images from a digital camera will be a time consuming process unless the transfer rate is increased. In addition, user applications demand a higher performance connection between the PC and these increasingly sophisticated peripherals. USB addresses this need by adding an even higher transfer rate to match these new usages and devices.