版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
.z.---.可修编.东北石油大学课程设计课程课程EDA技术课程设计题目洗衣机控制器院系电子科学学院专业班级电子信息工程学生**学生**指导教师2014年3月7日-.z.东北石油大学课程设计任务书课程EDA技术课程设计题目洗衣机控制器专业电子信息工程**主要容、基本要求、主要参考资料等主要容:设计一个洗衣机控制器,要求洗衣机有正转、反转、暂停三种状态。设定洗衣机的工作时间,要洗衣机在工作时间完成:定时启动正转20秒暂停10秒反转20秒暂停10秒定时未到回到“正转20秒暂停10秒……”,定时到则停止,同时发出提示音。基本要求:1、设计一个电子定时器,控制洗衣机作如下运转:定时启动正转20秒暂停10秒反转20秒暂停10秒定时未到回到“正转20秒暂停10秒……”,定时到则停止;2、若定时到,则停机发出音响信号;3、用两个数码管显示洗涤的预置时间(分钟数),按倒计时方式对洗涤过程作计时显示,直到时间到停机;洗涤过程由“开始”信号开始;4、三只LED灯表示“正转”、“反转”、“暂停”三个状态。主要参考资料:[1]松著.EDA技术实用教程(第二版).:科学,2005.[2]康华光主编.电子技术基础模拟部分.:高教,2006.[3]阎石主编.数字电子技术基础.:高教,2003.完成期限指导教师专业负责人2014年-.z.-.可修编.一、设计思想1.基本原理洗衣机控制器的设计主要是定时器的设计。由一片FPGA和外围电路构成了电器控制部分。FPGA接收键盘的控制命令,控制洗衣机的进水、排水、水位和洗衣机的工作状态、并控制显示工作状态以及设定直流电机速度、正反转控制、制动控制、起停控制和运动状态控制。对芯片的编程采用模块化的VHDL(硬件描述语言)进行设计,设计分为三层实现,顶层实现整个芯片的功能。顶层和中间层多数是由VHDL的元件例化语句实现。中间层由无刷直流电机控制、运行模式选择、洗涤模式选择、定时器、显示控制、键盘扫描、水位控制以及对直流电机控制板进行速度设定、正反转控制、启停控制等模块组成,它们分别调用底层模块。定时到2.设计框图定时到停止暂停10s反转20s暂停10s正转20s定时启动停止暂停10s反转20s暂停10s正转20s定时启动定时没到定时没到图1设计框图用两位数码管预置洗涤时间(分钟数),洗涤过程在送入预置时间后开始运转,洗涤中按倒计时方式对洗涤过程作计时显示,用LED表示电动机的正、反转,如果定时时间到,则停机并发出音响信号。二、设计步骤和调试过程1、模块设计和相应模块代码洗衣机控制器电路主要有五大部分组成,包括:减法计数器、时序控制电路、预置时间和编码电路、数码管显示、译码器组成。(1)预设时间和编码电路:本模块将输入的四位时间信号编码成八位二进制数输出到减法计数器电路。library
ieee;
use
ieee.std_logic_1164.all;
use
ieee.std_logic_unsigned.all;
entity
settime
is
port
(
load:in
std_logic;
time_input:in
std_logic_vector(3
downto
0);
time_set:out
std_logic_vector(7
downto
0)
);
end
settime;
architecture
settime
of
settime
is
signal
p1:std_logic_vector(7
downto
0);
begin
process(load)
begin
if(load'event
and
load='1')
then
case
time_input
is
when
"0000"=>p1<="00000000";
when
"0001"=>p1<="00000001";
when
"0010"=>p1<="00000010";
when
"0011"=>p1<="00000011";
when
"0100"=>p1<="00000100";when
"0101"=>p1<="00000101";when
"0110"=>p1<="00000110";when
"0111"=>p1<="00000111";
when
"1000"=>p1<="00001000";when
"1001"=>p1<="00001001";when
others=>p1<="00000000";end
case;
end
if;end
process
time_set<=p1;
end
settime;
图2预设时间和编码仿真用K1、K2、K3、K4给time_input输入一个二进制数0111,让load有效,输出time_set为00000111。(2)减法计数器模块:由于洗衣机有工作时间,必须要一模块来控制它的工作时间围,当洗衣机开始工作后,减法计数器即会实现减数功能,直到时间减到零,洗衣机便停止工作。当出现系统运行结束信号time_over时,蜂鸣器报警洗衣机工作结束。libraryieee;use
ieee.std_logic_1164.all;
use
ieee.std_logic_unsigned.all;
entity
counter
is
port
(
clk,start:in
std_logic;
time_set:in
std_logic_vector(7
downto
0);
time_remain:buffer
std_logic_vector(7
downto
0);
time_over:buffer
std_logic
);
end
counter;
architecture
counter
of
counter
is
begin
process(clk)variable
time_second:integer
range
0
to
59
:=59;
begin
if(clk'event
and
clk='1')
then
if(start='0')
then
if(time_remain(7
downto
0)=0)
then
time_remain<=time_set;else
time_remain(7
downto
4)<=time_remain(3
downto
0);
time_remain(3
downto
0)<=time_set(3
downto
0);end
if;
time_second:=59;
time_over<='1';
else
if(time_over='1')
then
if(time_second=0
and
time_remain(7
downto
0)=0)
then
time_over<='0';else
if(time_second=0)
then
if(time_remain(3
downto
0)=0)
thentime_remain(7
downto
4)<=time_remain(7
downto
4)-1;
time_remain(3
downto
0)<="1001";time_second:=59;else
time_remain(7
downto
4)<=time_remain(7
downto
4);
time_remain(3
downto
0)<=time_remain(3
downto
0)-1;
time_second:=59;
end
if;else
time_second:=time_second-1;
end
if;
end
if;end
if;
end
if;
end
if;end
process;
end
counter;
图3减法计数器模块源仿真(3)数码管显示模块:根据课程设计要求,必须将洗衣机的工作状态及工作时间在数码管和指示灯上显示出来,此模块是用来控制洗衣机的工作状态及工作的频率,并把工作状态及工作时间显示出来。a,b,c,d,e,f,g分别对应数码管的七段,minute和second分别位选两个数码管,显示十位和个位。library
ieee;
use
ieee.std_logic_1164.all;
use
ieee.std_logic_unsigned.all;
entity
showtime
is
port
(
time_remain:in
std_logic_vector(7
downto
0);
clk:in
std_logic;
minute,second:out
std_logic;
a,b,c,d,e,f,g:out
std_logic
);
end
showtime;
architecture
showtime
of
showtime
is
signal
temp:std_logic_vector(6
downto
0);
signal
bcd:std_logic_vector(3
downto
0);
signal
choose:std_logic;
begin
process(clk)
begin
if(clk'event
and
clk='1')
then
choose<=not
choose;
if(choose='1')
then
minute<='0';second<='1';
bcd<=
time_remain(7
downto
4);
else
minute<='1';second<='0';
bcd<=
time_remain(3
downto
0);
end
if;
end
if;
end
process;
process(bcd)
begin
case
bcd
is
when
"0000"=>temp<="1111110";
when
"0001"=>temp<="0110000";when
"0010"=>temp<="1101101";
when
"0011"=>temp<="1111001";
when
"0100"=>temp<="0110011";
when
"0101"=>temp<="1011011";
when
"0110"=>temp<="1011111";
when
"0111"=>temp<="1110000";
when
"1000"=>temp<="1111111";
when
"1001"=>temp<="1111011";
when
others=>temp<="1111011";
end
case;
a<=temp(6);b<=temp(5);c<=temp(4);d<=temp(3);e<=temp(2);f<=temp(1);g<=temp(0)
end
process
end
showtime图4数码管模块仿真(4)时序电路模块:接收运行起止信号,安排电机运行状态并编码输出library
ieee;
use
ieee.std_logic_1164.all;
use
ieee.std_logic_unsigned.all;
entity
analyse
is
port
(
clk,start,time_over:in
std_logic;
out_1,out_2:out
std_logic
);
end
analyse;
architecture
analyse
of
analyse
is
begin
process(clk)
variable
state:std_logic;
variable
wash_time:integer:=0;
variable
wait_time:integer:=0;
begin
if(clk'event
and
clk='1')
then
if(start='0')
then
wash_time:=0;
wait_time:=0;
state:='0';
out_1<='0';out_2<='0';
else
if(time_over='1')
then
if(wash_time=20)
then
if(wait_time=10)
then
wash_time:=0;
state:=not
state;
else
wait_time:=wait_time+1;
end
if;
else
wash_time:=wash_time+1;
wait_time:=0;
end
if;
end
if;
if
(wash_time=20)
then
out_1<='0';out_2<='0';
else
if(state='0')
then
out_1<='1';out_2<='0';
else
out_1<='0';out_2<='1';
end
if;
end
if;
end
if;
end
if;
end
process;
end
analyse;图5时序电路模块仿真:(5)译码器模块:接收电机运行状态信号,译码后实时控制电机的正传、反转和暂停。library
ieee;
use
ieee.std_logic_1164.all;
entity
move
is
port
(
out_1,out_2:in
std_logic;
REV,RUN,PAUSE:buffer
std_logic
);
end
move;
architecture
move
of
move
is
signal
choose:std_logic_vector(1
downto
0);
begin
choose(1)<=out_1;choose(0)<=out_2;
process(choose)
begin
case
choose
is
when
"00"=>REV<='0';RUN<='0';PAUSE<='1';
when
"10"=>REV<='0';RUN<='1';PAUSE<='0';
when
"01"=>REV<='1';RUN<='0';PAUSE<='0';
when
others=>REV<='0';RUN<='0';PAUSE<='0';
end
case;
REV<=out_2;RUN<=out_1;PAUSE<=not(out_1
or
out_2);
end
process;
end
move;图6译码器模块仿真:2、仿真及仿真结果分析当预置号时间,启动start,数码管显示预置时间,电机开始以正转=>暂停=>反转=>暂停为周期进行循环,一个周期正好费时一分钟,一个周期结束,数码管显示减一,依次循环,直至数码管显示时间为零,洗衣结束。图7总体仿真3、实验调试结果电路设计完成以后,按照预定设计,输入相应数据,三只LED灯按照设定时间规律间断性亮起,数码管也显示输入时间并按减数计时产生相应的数字显示,直到到达预定时间停止工作显示零,实验设计达到预期效果。三、结论及心得体
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- (2026年)预防艾滋病、梅毒和乙肝母婴传播及反歧视培训试卷
- 可变电容器装校工岗后能力考核试卷含答案
- 起重工安全行为水平考核试卷含答案
- 有机宝石检验员创新实践模拟考核试卷含答案
- 银行客户业务员安全宣传竞赛考核试卷含答案
- 汽车饰件制造工创新意识水平考核试卷含答案
- 客车给水员技术基础考核试卷含答案
- 苯乙烯类热塑性弹性体(SBCs)装置操作工班组考核评优考核试卷含答案
- 漆器制胎工岗位安全培训考核试卷含答案
- 景区运营管理师安全行为测试考核试卷含答案
- 2026学校入团考试题库(附答案解析)
- 2026年10月自考04842产品系统化设计押题及答案(北京)
- 2026年招标采购从业人员《招标采购专业理论与法律基础(初级)》考试真题(含解析)
- 高考688个高频词汇
- 【答案】《人工智能与创新》(南开大学)章节期末中国大学慕课答案
- 悬臂吊起重机技术说明书
- 2025 中国过敏性休克急救指南(中文版)完整原文 + 肾上腺素使用规范
- 班长在班组管理实践中的核心作用与能力提升
- 2026年4月自考00164劳动经济学试题及答案
- 某铝业厂电解操作规范制度
- 水电部门采购制度
评论
0/150
提交评论