【正文】
r, after entering the elevator, passengers can choose to which a layer, and then the elevator according to the passengers choose to judge which floor, continue to run. Through the singlechip 2 microputer to control the elevator in the rising process only in response to the rising call, drop in the process only response to declining call. The normal operation of the elevator is realized by singlechip microputer control. of the overall design diagram Fig. 1 overall plans 3Analysis of design principles keyboard matrix circuit Because the circuits required button more in order to save the MCU I/O port, the choice of determinant keyboard matrix. This circuit is used in 4 * 4 keyboard matrix. The circuit shown in Figure 2, the is connected to the P1 ports of the singlechip, singlechip scanning method used to row and column to distinguish these 16 buttons which key is pressed, and the label read accumulator inside A, and then can be controlled by SCM elevator operation according to each button function. The following will each button function explain: S1: a building to call button, the button press said a building with elevator upstairs to SCM, and the signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 S2: two buildings to the call button, the button press said the two floor elevator upstairs to, and the MCU will this signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 3 S4: on the third floor to the call button, the button press said the third floor has take the elevator upstairs to SCM, and the signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 S6: four floor to the call button, the button is pressed four floor elevator upstairs to, and the MCU will this signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 S8: five floor to the call button, the button press said the four floor elevator upstairs to, and the MCU will this signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 S10: six floor to the call button, the button is pressed the elevator downstairs said people should, and SCM will this signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 S12: Elevator internal selection to the two floor button, the button is pressed said elevator passengers going to the two floor, SCM according to the signal control elevator。 S14: Elevator internal selection to the four floor button, the button is pressed said elevator passengers going to the four floor, SCM according to the signal control elevator。 S16: Elevator internal selection to the six floor button, the button is pressed said elevator passengers going to the six floor, SCM according to the signal control elevator。 The main program mainly includes: The judge passengers into the elevator selection which floor, to control the elevator operation according to the judgement of the situation。 The call request elevator response only in the running process of the same direction。 The door has a delay to ensure passengers out of / into the elevator。s enthusiastic guidance, believe that we have entered a new stage. Reference [1] Shi Lei Cheung Kwok Keung Altium Designer 8 Chinese circuit design, Tsinghua University press, 2021 8 [2] Li Zhaoqing. Singlechip microputer principle and Interface Technology ( Third Edition ). Beihang University press, 2021 [3] Zhang Daming. Single chip microputer control technology and its application [ M ] . Beijing: Mechanical Industry Press, 2021 9 基于單片機(jī)控制的電梯控制器 摘 要: 本設(shè)計(jì)基于單片機(jī)來(lái)控制電器中各部分的使用,采用數(shù)碼管來(lái)實(shí)時(shí)顯示樓層的位置及方向,利用兩個(gè)發(fā)光二極管來(lái)代替電機(jī),通過(guò)單片機(jī)控制發(fā)光管的亮和滅來(lái)實(shí)現(xiàn)電機(jī)的正反轉(zhuǎn),通過(guò)定時(shí)器延時(shí)來(lái)校驗(yàn)電梯的位置。各大城市建筑物在不斷向高層化發(fā)展。 電梯已不僅是一種生產(chǎn)環(huán)節(jié)中的重要設(shè)備 ,更是一種人們頻繁乘用的交通運(yùn) 輸設(shè)備 。用 PLC 控制的電梯性能可靠、穩(wěn)定,但是造價(jià)太高。 2 總體設(shè)計(jì)方案 設(shè)計(jì)思路 本次設(shè)計(jì)的 基本 思想是采用 AT89s51 單片機(jī)作為核心, 利用其豐富的 I/O 接口與外圍電路配合進(jìn)行控制。采用行列式鍵盤(pán)矩陣作為外呼內(nèi)選電路,由于是 6 層樓,故選用 4 4 矩陣鍵盤(pán)。通過(guò)單片機(jī)控制電梯在上升過(guò)程中只響應(yīng)上升呼叫,下降過(guò)程中只響應(yīng)下降呼叫。 總體設(shè)計(jì)框圖 如圖 1 所示 10 圖 1 總體方案圖 3 設(shè)計(jì)原理分析 鍵盤(pán)矩陣電路的設(shè)計(jì) 由于本電路所 需按鍵較多為了節(jié)省單片機(jī)的 I/O 口,故選用行列式鍵盤(pán)矩陣。電路如圖 2 所示, 是接單片機(jī)的 P1 端口,單片機(jī)采用行和列掃描法來(lái)判別這 16 個(gè)按鍵中哪個(gè)鍵按下,并將其標(biāo)號(hào)讀入累加器 A 里面,然后可根據(jù)每個(gè)按鍵的功能來(lái)通過(guò)單片機(jī)控制電梯的運(yùn)行。時(shí)鐘電路如圖 3(右)所示:晶 振采用的是 12MHZ 的, XATL2 和 XATL1 分別為單片機(jī)的 18 和 19 腳。 為單片機(jī)的 P2 口作為輸出口用且輸出低電平有效。 L3 滅表示電梯關(guān)門(mén),電梯運(yùn)行時(shí) L1 和 L2 必須有一個(gè)亮,來(lái)表示電梯的上行和下行。從而來(lái)控制電梯的運(yùn)行。整個(gè)軟件設(shè)計(jì)包括一下幾部分: ⑴ 初始化程序使數(shù)碼管顯示“ 1”表示電梯處在一樓,并且使 L3 燈亮表示電梯開(kāi)門(mén)等 待人進(jìn)入電梯; ⑵ 主程序主要包括: ① 判斷乘客進(jìn)入電梯后選擇去哪一層,根據(jù)判斷情況來(lái)控制電梯運(yùn)行; ② 電梯在運(yùn)行過(guò)程中要不斷的掃描鍵盤(pán),從而來(lái)判斷各樓層有無(wú)呼叫請(qǐng)求,; ③ 電梯在運(yùn)行過(guò)程中只響應(yīng)同方向的呼叫請(qǐng)求; ④ 實(shí)時(shí)顯示電梯所在位置及運(yùn)行狀態(tài)(上行 /下行); ⑤開(kāi)關(guān) 門(mén)有一定的延時(shí)來(lái)保證乘客走出 /進(jìn)入電梯; 軟件流程圖如圖 6 所示: R31 0 KR41 0 KR51 0 K R60 .2 KR70 .2 KR80 .2 KP 0 . 0P 0 . 1P 0 . 25VL1L2L3 14 圖 6 4 總結(jié)與體會(huì) 通過(guò)這次基于單片機(jī)的綜合實(shí)習(xí),讓我對(duì)以前所學(xué)的知識(shí)有了綜合的應(yīng)用。我發(fā)現(xiàn)我需要了解,和學(xué)習(xí)的知識(shí)很多。發(fā)現(xiàn)了,僅僅有理論知識(shí)是不夠的,理論與應(yīng)用之間存在著相當(dāng)大的差距。通過(guò)這次實(shí)習(xí),也讓我學(xué)到了很多課本當(dāng)中學(xué)不到的東西。在實(shí)習(xí)當(dāng)中,也發(fā)揚(yáng)了我們的團(tuán)隊(duì)精神,與合作能力。 參考文獻(xiàn) [1] 石磊 張國(guó)強(qiáng) . Altium Designer 中文電路設(shè)計(jì) d39。tjA shfP39。cdPq 9JWKf wvGt YM*Jgamp。 QA9wkxFyeQ^! djsXuyUP2kNXpRWXm Aamp。849Gx^Gj qv^$UE9wEwZQcUE%amp。 gTXRm 6X4NGpP$vSTTamp。MuWFA5uxY7JnD6YWRr Wwc^vR9CpbK!zn%Mz849Gx^Gj qv^$UE9wEwZQcUE% amp。gTXRm 6X4NGpP$vSTTamp。MuWFA5ux^Gj qv^$UE9wEwZQcUE% amp。gTXRm 6X4NGpP$vSTTamp。MuWFA5uxY7JnD6YWRr Wwc^vR9CpbK! zn%Mz849Gx^Gj qv^$UE9wEwZQcUE%amp。 gTXRm 6X4NGpP$vSTTamp。 849Gx^Gj qv^$UE9wEwZQcUE%amp。 gTXRm 6X4NGpP$vSTTamp。 MuWFA5uxY7JnD6YWRrWwc^vR9CpbK! zn% Mz849Gx^Gj qv^$UE9wEwZQcUE%amp。 gTXRm6X4NGpP$vSTTamp。 MuWFA5ux^Gj qv^$UE9wEwZQcUE%amp。 gTXRm6X4NGpP$vSTTamp。 MuWFA5uxY7JnD6YWRr Wwc^vR9CpbK!zn%Mz849Gx^Gj qv^$UE9wEwZQcUE% amp。gTXRm 6X4NGpP$vSTTamp。 6a*CZ7H$dq8Kqqf HVZFedswSyXTyamp。 UE9aQGn8xp$Ramp。 qYpEh5pDx2zVkumamp。 ksv*3t nGK8!z89Am YWpazadNuKNamp。849Gx^Gj qv^$UE9wEwZQcUE%a