版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、全自动电梯控制卢维彪1设计要求 设计一个层楼房全自动电梯控制电路,其功能如下: 每层楼电梯入口处设有上,下请求开关各,电梯内设有乘客到达层次的停站要求开关。 有电梯所处位置指示装置和电梯上行,下行状态批示装置。 电梯每秒升(降)一层楼。到达某一层楼时,指示该层次的灯发光,并一直保持到电梯到达新一层为止。 电梯到达有停站请求的楼层后,该层次的指示灯亮,经过.5S,电梯门自动打开,开门指示灯亮,开门5S后,电梯门自动关闭(开门指示灯灭),电梯继续运行。 能记忆电梯内外的所有请求信号,并按照电梯运行规则次第响应,每个请求信号保留至执行后撤除。 电梯运行规则,电梯处于上升模式时,只响应比电梯所在位置高
2、的层次的上楼请求信号,由下而上逐个执行,直到最后一个请示执行完毕。如更高层次有下楼请求,则直接升到有下楼请求的楼层接客,然后便进入下降模式。电梯处于下降模式时与之相反,仅响应比电梯所在位置低的楼层的下楼请求。电梯执行完所有的请求后,应停在最后所在的位置不变,等待新的请求。 开机(接通电源)时,电梯应停留在一楼,而各种上,下请求皆被清除。 2设计提示 用实验板上提供的按键开关作为上楼(3个)下楼(3个)请求,以及乘客进入电梯后,要求停靠楼层的开关。按键状态用发光二极管显示。 电梯所在楼层位置用数码管显示,另用二只发光二极管显示上行状态和下行状态。 利用发光二极管(只)作为开门指示,其时序如下图所
3、示。 电梯开门时间可以要求延长,每按一次延长键,自按键时开始延长5秒,可以连续使用。也可提前关门(按动关门键)。 电梯运行过程中,不断判断前进方向是否存在上楼请求或下楼请求信号,如到达某层后,上、下方均无请求,则电梯停在该层,中止运行。div2Hz模块(1000Hz2Hz分频器):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity div2Hz isport(clk:in std_logic; clkout:out std_logic);end div2Hz;architecture o
4、ne of div2Hz issignal count: std_logic_vector(8 downto 0);begin process beginwait until clk'event and clk='1' if count<500 then count<=count+1; clkout<='0' else count<=(others=>'0'); clkout<='1' end if;end process;end architecture one;Elevator模块(
5、控制器):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; entity elevator is port( clk: in std_logic; up1,up2,up3,stop1,stop2,stop3,stop4,down4,down3,down2: in std_logic; ddelay,dclose: in std_logic; upled,downled: out std_logic; floorled,nowfloor: out std_logic_vector(3 downto
6、0); dopenled: out std_logic_vector(5 downto 0);end elevator;architecture bhv of elevator is type state_type is (start,run,opendoor,dopenwait2,dopenwait3,dopenwait4,dopenwait5,dopenwait6,dopenwait7,dopenwait8,dopenwait9,dopenwait10,dclse,up,down,upwait1,upwait2,downwait1,downwait2,stop); signal state
7、 : state_type; signal upm,downm,stopm,dat: std_logic_vector(3 downto 0); -memmory of orders signal dclosem,ddelaym: std_logic;beginstate_trans: process (clk,up1,up2,up3,down4,down3,down2,stop1,stop2,stop3,stop4,upm,downm,stopm,dat,ddelay,dclose)variable position: integer range 0 to 4;beginif rising_
8、edge(clk) then if up1='1' then upm(0)<='1' end if; if up2='1' then upm(1)<='1' end if; if up3='1' then upm(2)<='1' end if; upm(3)<='0' if down4='1' then downm(3)<='1' end if; if down3='1' then downm(2)<
9、='1' end if; if down2='1' then downm(1)<='1' end if; downm(0)<='0' if stop1='1' then stopm(0)<='1' end if; if stop2='1' then stopm(1)<='1' end if; if stop3='1' then stopm(2)<='1' end if; if stop4='1
10、9; then stopm(3)<='1' end if; if dclose='1' then dclosem<='1' end if; if ddelay='1' then ddelaym<='1' end if; dat<= upm or downm or stopm; -orders from both inside and outside all saved case state iswhen start => if dat="0000" then sta
11、te <= start; -no order,no operation elsif position= 0 then position:=position+1; state <= run; end if;when run => -start working if position=1 then if stopm(0)='1' or upm(0)='1' then stopm(0)<='0' upm(0)<='0' state<= opendoor; elsif dat> "000
12、1" then state<= up; end if; elsif position=2 then if stopm(1)='1' or upm(1)='1' or downm(1)='1' then stopm(1)<='0' upm(1)<='0' downm(1)<='0' state<= opendoor; elsif dat> "0011" then state<= up; elsif dat< "00
13、10" then state<= down; end if; elsif position=3 then if stopm(2)='1' or upm(2)='1' or downm(2)='1' then stopm(2)<='0' upm(2)<='0' downm(2)<='0' state<= opendoor; elsif dat> "0111" then state<= up; elsif dat< "
14、;0100" then state<= down; end if; elsif position=4 then if stopm(3)='1' or downm(3)='1' then stopm(3)<='0' downm(3)<='0' state<= opendoor; elsif dat< "1000" then state<= down; end if; end if; when up => upled<='1' state&l
15、t;=upwait1; -1 second taken to go up when upwait1=> state<= upwait2;when upwait2=> upled<='0' position:=position+1; -reach a higher floor if position=2 and (upm>"0011" or stopm>"0011") and stopm(1)='0' and upm(1)='0' then state<= up; e
16、lsif position=3 and dat>"0111" and stopm(2)='0' and upm(2)='0' then state<= up; else state<= opendoor; end if;when down=> downled<= '1' state<= downwait1; -1 second taken to go downwhen downwait1=> state<= downwait2;when downwait2=> downle
17、d<= '0' position:=position-1; -reach a lower floor if position=3 and (downm<"0100" or stopm<"0100") and stopm(2)='0' and downm(2)='0' then state<= down; elsif position=2 and dat<"0010" and stopm(1)='0' and downm(1)='0
18、39; then state<= down; else state<= opendoor; end if;when opendoor=> -open door after 0.5 second if position=1 then stopm(0)<='0' upm(0)<='0' elsif position=2 then stopm(1)<='0' upm(1)<='0' downm(1)<='0' elsif position=3 then stopm(2)&l
19、t;='0' upm(2)<='0' downm(2)<='0' elsif position=4 then stopm(3)<='0' downm(3)<='0' end if; -orders from the opendoor_floor removed dopenled<="001100" if dclosem='1' then state<= dopenwait9; dclosem<='0' elsif ddel
20、aym='1' then state<= opendoor; ddelaym<='0' else state<= dopenwait2; end if;when dopenwait2=> if dclosem='1' then state<= dopenwait9; dclosem<='0' elsif ddelaym='1' then state<= opendoor; ddelaym<='0' else state<= dopenwait3;
21、 end if;when dopenwait3=> dopenled<="011110" state<= dopenwait4; when dopenwait4=> if dclosem='1' then state<= dopenwait9; dclosem<='0' elsif ddelaym='1' then state<= opendoor; ddelaym<='0' else state<= dopenwait5; end if;when dope
22、nwait5=> dopenled<="111111" state<= dopenwait6; when dopenwait6=> if dclosem='1' then state<= dopenwait9; dclosem<='0' elsif ddelaym='1' then state<= opendoor; ddelaym<='0' else state<= dopenwait7; end if;when dopenwait7=> dopen
23、led<="011110" state<= dopenwait8;when dopenwait8=> if dclosem='1' then state<= dopenwait9; dclosem<='0' elsif ddelaym='1' then state<= opendoor; ddelaym<='0' else state<= dopenwait9; end if;when dopenwait9=> dopenled<="0011
24、00" state<= dopenwait10; -display of the opendoor_ledswhen dopenwait10=> if dclosem='1' then state<= dopenwait9; dclosem<='0' elsif ddelaym='1' then state<= opendoor; ddelaym<='0' else state<= dclse; end if;when dclse=> dopenled<="
25、000000" if dat>"0000" then state<= run; else state<= stop; end if;when stop => if dat>"0000" then state<= run; elsif ddelaym='1' then state<= opendoor; ddelaym<='0' else state<= stop; end if; end case; end if;if position=1 then nowf
26、loor<="0001" floorled<="0001" elsif position=2 then nowfloor<="0010" floorled<="0010" elsif position=3 then nowfloor<="0011" floorled<="0100" elsif position=4 then nowfloor<="0100" floorled<="1000"
27、; else nowfloor<="0000" floorled<="0000" end if; -display of floor_ledsend process state_trans;end bhv;综合实现模块:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; entity finalctrol is port( clk: in std_logic; up1,up2,up3,stop1,stop2,stop3,stop4,down4,do
28、wn3,down2: in std_logic; ddelay,dclose: in std_logic; upled,downled: out std_logic; floorled,nowfloor: out std_logic_vector(3 downto 0); dopenled: out std_logic_vector(5 downto 0);end finalctrol;architecture arc of finalctrol is component div2Hz port(clk: in std_logic; clkout: out std_logic); end component; component elevator port( clk: in std_logic; up1,up2,up3,stop1,stop2,stop3,stop4,down4,down3,down2: in s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 染料生产工创新应用测试考核试卷含答案
- 家用电器产品维修工岗中技术实操考核试卷含答案
- 中药煎膏剂工岗中执行能力考核试卷含答案
- 综掘机司机安全素养测试考核试卷含答案
- 手持小型动力工具制作工操作能力模拟考核试卷含答案
- 2026年秋季小学班主任课间安全常态化管控课件
- 2025年鄄城县数学四年级下学期期末学业质量监测试题(含答案解析)
- 2026年秋季小学班主任新学期工作重点梳理课件
- 2025年邯郸市峰峰矿区数学四下期末监测模拟试题含解析
- 2026事业单位工勤技能-河南-河南园林绿化工二级(技师)历年参考题库含答案详解
- DZ/T 0125-1994煤田地质钻孔数据文件格式
- 光伏弱电安装合同范本
- 华为光芯片机考题库
- 《数字矿山课件》课件
- 《电机拖动学》课件
- 外墙保温装饰一体板施工方案
- IATF16949-2016体系管理质量手册(压铸铝合金)
- 统编版(2024新版)三年级上册道德与法治教学计划
- 字体设计(上海出版印刷高等专科学校)智慧树知到答案2024年上海出版印刷高等专科学校
- 9步达到财务自由
- 跨文化管理与全球化团队建设
评论
0/150
提交评论