




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
电子技术课程设计报告书课题名称洗衣机控制器的设计姓 名学 号院、系、部专 业电子信息工程指导教师2010年 11 月 25日 洗衣机控制器的设计1 设计目的(1) 熟悉集成电路的引脚安排。 (2)掌握各芯片的逻辑功能及使用方法。(3)了解面包板结构及其接线方法。(4)了解洗衣机控制器的组成及工作原理。(5)熟悉洗衣机控制器的设计与制作。(6)运用hvdl语言完成洗衣机控制器的编程。2 设计思路(1)设计洗衣机控制器电路。(2)设计可预置时间(10-30分钟)的定时模块。(3)设计洗衣机运作模块,控制洗衣机的进水,洗衣,放水,脱水运转。 (4)设计分频模块,为洗衣机提供秒时钟。(5)设计译码模块,完成对时间(分)的二进制译码和led管的动态扫描。(6)设计电源电路和按键判别电路。(7)设计显示电路,完成对剩余时间和工作状态的显示3 设计过程 3.1 方案论证 洗衣机控制器的整体框图如下(图一)所示:分频模块显示电路键盘电路 fpga芯片洗衣机运作模块译码模块总控制器电源时钟(1k)图 一(洗衣机控制器原理框图)工作原理:1、开启电源后,洗衣机进入总控模块的时间设定模式,由7段led灯显示所设定时间;2、时间设定后,启动洗衣机,进入洗衣机运转模式,即启动洗衣机运转模块,同时屏蔽总控模块总时间(time_all)信号。每次自动洗衣时间由总控模块自动分配。七段led灯轮换显示工作模式(进水=1,洗衣=2,放水=3,脱水=4)和剩余时间。3、3次自动洗衣完成后,洗衣机进入待机模式,七段led灯灭,再次等待时间设定。电路设计 洗衣机控制器主要电路如图所示:ep1k30tc144-3上下 uln2803是高电压大电流达林顿晶体管阵列,用于高电压大电流负载。74ls138为动态扫描译码电路,可基于该电路扩展led显示为最高8位动态。增加了vcc所接上拉电阻,为led显示提供足够的驱动电流。key为机械开关,只针对单个按键进行合键判别,无对应行列扫描。led为自带数字字库显示器,从而简化ep1k30tc144-3译码模块,只需数据输入和扫描程序。 电源模块: 该电路由变压线圈trans1对输入220v电压进行变压,后经桥式电路,将交流电压变为直流电压。后又由lm2575开关型稳压器件,对out端经桥式电路和电容整形后的电压进行稳压,为ep1k30tc144-3,led提供稳定电压。电路中接入电解电容c2对电源起退偶和输出滤波作用,涤纶电容c3与out端电解电容并联,用于消除高频干扰。水位传感器(附):该水位传感器省略了传感器输出,仅对输出信号进行整形放大。ep1k30tc144-3流程框图设定洗衣时间(timeall) 进 水waterh=0? n洗涤 ntime1=0?放水 nwaterl=0?脱水 ntime2=0? yep1k30tc144-3内置vhdl程序:-洗衣机运转模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity washer_base isport(clk,clk_s,start,cs:in std_logic;-cs为异常判断信号线 timer1,timer2:in std_logic_vector(4 downto 0);-洗衣时间4/5,脱水时间1/5 vib_l,vib_r,over:out std_logic);end washer_base;architecture behav of washer_base istype states is(water_in,wash,water_out,dry,waiting);signal state:states;signal timer_1,timer_2:std_logic_vector(4 downto 0);signal water_h,water_l,water_door,working:std_logic; -高低水位判断signal min:std_logic_vector(4 downto 0); signal vibl,vibr:std_logic;beginstates_switch:process(clk,start) -洗衣状态转换beginif startevent and start=1 then stateif water_h=0 then state=wash;else stateif timer_1=00000 then state=water_out;else stateif water_l=0 then state=dry;else stateif timer_2=00000 then state=waiting;else stateif cs=0 then state=water_in;else statestate=waiting; end case;end if;end process states_switch; download:process(start)beginif startevent and start=1 then timer_1=timer1;timer_2=timer2;end if;end process; count:process(clk_s) - 计时 variable sec:std_logic_vector( 5 downto 0);beginif state=wash then min=timer_1+timer_2;if clk_sevent and clk_s=1 then if sec=111111 then sec:=000100;timer_1=timer_1-1;else sec:=sec+1;end if;end if;elsif state=dry then if clk_sevent and clk_s=1 then if sec=111111 then sec:=000100;timer_2=timer_2-1;else sec:=sec+1;end if;end if;end if;end process count;vib_l=vibl;vib_r=vibr; -连接洗衣机正反转信号与输出端口wash_run:process(clk_s)variable run_time:std_logic_vector(4 downto 0);beginif clk_sevent and clk=1 and cs=1 then run_time:=run_time+1;if run_time17 then vibr=1;vibl=0;else run_time then vibl=1;vibr=0;end if;end if;end behav;-分频模块library ieee;use ieee.std_logic_unsigned.all;use ieee.std_logic_1164.all;entity fre_div isport(clk,cs:in std_logic; clk_s:out std_logic);end entity;architecture bhv of fre_div issignal clks:std_logic;beginclk_s=clk; -定义秒时钟信号,消除尖峰脉冲process(clk,cs)variable counter:std_logic_vector(9 downto 0); -最高1k分频为1beginif cs=1 then if clkevent and clk=1 then if counter=1000 then counter:=counter+1; else counter:=0000000000;end if; if counter=500 then clks=500 then clks=0; end if; end if;end if;end process;end bhv;-总控模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity ctr isport(clk,clk_s,key_u,key_d,ok:in std_logic; time_1,time_2:out std_logic_vector(4 downto 0); cs,start:out std_logic); architecture bhv of ctr issignal timeall: std_logic_vector(5 downto 0); -最高30分钟定时signal time1,time2: std_logic_vector(4 downto 0);begintime_1=time1;time_2=time2;download:process(key_u,key_d) -时间设定分配variable counter:std_logic_vector(5 downto 0);beginif key_uevent and key_u=0 then counter:=counter+1;timeall=30 then counter:=counter;end if;elsif key_devent and key_d=0 then counter:=counter-1; timeall=counter;end if;end process download;starting:process(clk,ok)variable couter:std_logic_vector(3 downto 0);beginif clkevent and clk=1 then if ok=1 then cs=1;time1=timeal/4;time2=timeall-time1;end if;if counter4 then counter=counter+1; start_r=4 and couter9 then start_r=1; counter=counter+1;else start_r=0;end if;end if;end process starting;start=start_r;end bhv;-译码模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity con isport(clk,clk_s:in std_logic; data:out std_logic_vector(8 downto 0); wela:out std_logic_vector(2 downto 0); -动态扫描位 time_all:in std_logic_vector(5 downto 0); architecture bhv of con issignal timeall: std_logic_vector(8 downto 0);signal counter:std_logic_vector(2 downto 0);-动态扫描位寄存wela=counter;process(clk,time_all)beginif clkevent and clk=1 then timeall(5 downto 0)=time_all;counter:=counter+1;if clk_s=1 then data=timeall;else data=0;end if;end if;end process;end bhv;ep1k30tc144-3工作原理: 开启电源后,洗衣机进入时间设定模式,由“上”(对应信号key_u)和“下”(对应信号key_d)对时间进行调整,最小10分钟,最大30分钟。设定好时间后,按下“启动/停止”(对应信号ok),总控模块将时间载入timeall寄存器,并对每个时间段进行计算分配,洗衣机进入运转模式,由启动信号(start)上升沿载入单次洗衣时间,下降沿启动洗衣机运转。在运转模式下,led由译码模块对剩余总时间(timeall)进行每秒灭/亮显示(clk_s电平决定),运转模块依据洗衣机水位(water_h/water_l)和单步剩余时间(time_1/time_2)作为状态机状态跳转条件。执行完洗衣步骤后,状态机跳回等待状态,等待总控模块再次载入单步洗衣时间,片选信号(cs)和启动信号(start)启动洗衣机。 该控制器忽略了部分输入引脚电气特性。系统调试结果:1、 利用max plus 2对fpga芯片编程,连接模块之间信号线,选定芯片输入/输出引脚,针对ep1k30tc144-3芯片仿真。仿真中运转模块调试出现问题未能完全解决,故无法给出模块搭建好后的整体波形信号仿真图。2、 组建ep1k30tc144-3外围电路。3、 调试电源电路,选定电容,变压线圈型号、参数。4、
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 年会策划活动方案模板图(3篇)
- 嘉兴多人团建活动方案策划(3篇)
- 泸州水下施工方案(3篇)
- 中职对口考试题库及答案
- 艺术鉴赏考试题库及答案
- 小学文明用语题目及答案
- 小区绿化及环保设施建设合同
- 看假文盲有感700字15篇
- 元宵节作文500字左右20258篇范文
- 农村环境保护和可持续发展的合作合同
- 2025-2030年中国动力耳鼻喉科手术器械行业市场现状供需分析及投资评估规划分析研究报告
- 2025至2030中国建筑防腐行业发展趋势与前景分析报告
- 2025年重庆市中考化学试卷真题(含标准答案)
- 社会化服务项目方案投标文件技术方案
- 电石中控岗位操作规程
- 造型基础-全套教案课件
- 幕墙密封胶相容性检测
- 如何清洁头皮可促进头发生长
- 班主任安全管理培训
- 药品生产企业药品安全信用评价指标及评分标准
- 台州市水处理发展有限公司化工废水处理工程项目环评报告
评论
0/150
提交评论