基于FPGA的六层电梯控制系统课程设计打印终稿(7)

2019-03-05 22:38

基于FPGA 的六层电梯控制系统

if waitcnt=’2’ then waitcnt<=0 mylift<=doorclose; else mylift<=doorwait4; end if;

;

when doorclose =>

doorlight<='0'; --电梯门关

if udsig='0' then --电梯处于上升模式

if position=6 then if

stoplight=\

and

fuplight=\

fdnlight=\

udsig<='1';mylift<=doorclose;

else udsig<='1';mylift<=down; end if;

elsif position=5 then if

stoplight=\

and

fuplight=\

fdnlight=\

udsig<='0';mylift<=doorclose; elsif stoplight(6)='1' or fdnlight(6)='1' then udsig<='0';mylift<=up;

else udsig<='1';mylift<=down; end if;

elsif position=4 then if

stoplight=\

and

fuplight=\

fdnlight=\

udsig<='0';mylift<=doorclose; elsif

stoplight(5)='1'

or

stoplight(6)=

'1'

fdnlight(6)='1' or fdnlight(5)='1' then

25

and

and

and

or

基于FPGA 的六层电梯控制系统

udsig<='0';mylift<=up;

else udsig<='1';mylift<=down; end if;

elsif position=3 then if

stoplight=\

and

fuplight=\

and

fdnlight=\

udsig<='0';mylift<=doorclose; elsif

stoplight(4)='1'

or

stoplight(5)='1'

or

stoplight(6)= '1' or fdnlight(6)='1' or fdnlight(5)='1' or fdnlight(4)='1' then

udsig<='0';mylift<=up;

else udsig<='1';mylift<=down; end if;

elsif position=2 then if

stoplight=\

and

fuplight=\

and

fdnlight=\

udsig<='0';mylift<=doorclose; elsif

stoplight(3)='1'

or

stoplight(4)='1'

or

stoplight(5)='1' or stoplight(6)= '1' or fdnlight(6)='1' or fdnlight(5)='1' or fdnlight(4)='1' or fdnlight(3)='1' then udsig<='0';mylift<=up;

else udsig<='1';mylift<=down; end if;

elsif position=1 then if

stoplight=\

and

fuplight=\

and

fdnlight=\

udsig<='0';mylift<=doorclose; else udsig<='0';mylift<=up; end if;

26

基于FPGA 的六层电梯控制系统

end if;

elsif udsig='1' then

if position=1 then if

stoplight=\

and

fuplight=\

and

fdnlight=\

udsig<='0';mylift<=doorclose;

else udsig<='0'; mylift<=up; end if;

elsif position=2 then if

stoplight=\

and

fuplight=\

fdnlight=\

udsig<='1';mylift<=doorclose; elsif stoplight(1)='1' or fuplight(1)='1' then

udsig<='1';mylift<=down;

else udsig<='0'; mylift<=up; end if;

elsif position=3 then if

stoplight=\

and

fuplight=\

fdnlight=\

udsig<='1';mylift<=doorclose; elsif

stoplight(1)='1'

or

stoplight(2)='1'

fuplight(1)='1' or fuplight(2)='1' then

udsig<='1';mylift<=down;

else udsig<='0'; mylift<=up; end if;

elsif position=4 then if

stoplight=\

and

fuplight=\

fdnlight=\

udsig<='1';mylift<=doorclose;

27

and

and

or

and

基于FPGA 的六层电梯控制系统

elsif stoplight(1)='1' or stoplight(2)='1' or

stoplight(3)='1' or fuplight(1)='1' or fuplight(2)='1' or fuplight(3)='1' then

udsig<='1';mylift<=down;

else udsig<='0'; mylift<=up; end if;

elsif position=5 then if

stoplight=\

and

fuplight=\

and

fdnlight=\

udsig<='1';mylift<=doorclose; elsif

stoplight(1)='1'

or

stoplight(2)='1'

or

stoplight(3)='1' or stoplight(4)='1' or fuplight(1)='1' or fuplight(2)='1' or fuplight(3)='1' or fuplight(4)='1' then

udsig<='1';mylift<=down;

else udsig<='0'; mylift<=up; end if;

elsif position=6 then if

stoplight=\

and

fuplight=\

and

fdnlight=\

udsig<='1';mylift<=doorclose; else udsig<='1'; mylift<=down; end if; end if; end if;

when up => position<=position+1;pos:=pos+1; if position <6 and( stoplight(pos)='1' or fuplight(pos)='1') then

mylift<=stop;

elsif pos=6 and (stoplight(pos)='1' or fdnlight(pos)='1')

28

基于FPGA 的六层电梯控制系统

then

mylift<=stop; else mylift<=doorclose; end if;

when down =>

position<=position-1; pos:=pos-1; if position>1 and (stoplight(pos)='1' or fdnlight(pos)='1') then mylift<=stop;

elsif pos=1 and (stoplight(pos)='1' or fuplight(pos)='1') then mylift<=stop; else mylift<=doorclose; end if;

when stop => mylift<=dooropen; when dooropen => doorlight<='1'; if udsig='0' then

if position<6 and (stoplight(position)='1' or fuplight(position)='1') then clearup<='1';

else clearup<='1';cleardn<='1'; end if;

elsif udsig='1' then

if position>1 and (stoplight(position)= '1' or fdnlight(position)='1') then cleardn<='1';

else clearup<='1';cleardn<='1'; end if; end if;

mylift<=doorwait1; end case; end if;

29


基于FPGA的六层电梯控制系统课程设计打印终稿(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:时尚买手店合作经营协议

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: