CH15_自动贩卖机实作
- 格式:ppt
- 大小:1.86 MB
- 文档页数:15


摘要: 本文介绍了自动售货机的基本原理以及工作流程,然后以一次交易过程为例,把交易过程分为几个程序块,然后分别对程序块进行编程。
具体说明了可编程序控制器在自动售货机中的作用。
程序涉及到了自动售货机工作的绝大部分过程。
利用PLC控制的自动售货机提高了系统的稳定性,保证自动售货机能够长期稳定运行。
关键词自动售货机;可编程序控制器;梯形图Abstract: This article introduced vending machine's basic principle as well as the work flow, then take a transaction process as examples, divides into several blocks the transaction process, then carries on the programming separately to the block. Explained the programmable controller's in vending machine function specifically. The procedure involved the vending machine work major part process. Enhanced system's stability using the PLC control's vending machine, the guarantee vending machine has been able the long-term stability movement.key word vending machine; Programmable controller; Trapezoidal chart目录.绪论 (1).1自动售货机的介绍 (4).1.1自动售货机功能分析 (4).1.1.1自动售货机的基本功能 (5)1.2 PLC的基本结构及原理................................................................................................. (5).1.3 PLC的选型原则 (5).2PLC系统设计............................................................................................ .7.2.1可编程序控制系统设计的基本原则 (7).2.1.1控制系统设计原则 (7).2.1.2控制系统设计的基本内容 (7).2.1.3控制系统设计的一般步骤........................................................................ .8.2.1.4程序设计的步骤. (8).3自动售货机PLC程序设计 (10).3.1仿真实验中售货机的分析 (10).3.2设计任务的确定 (10).3.3程序设计部分 (11).3.3.1程序设计说明 (11).3.3.2PLC程序设计 (11).3.4仿真界面与PLC (20).3.5数据连接 (24).3.5.1定义I/O设备 (24).3.5.2设计 (26).3.5.3运行 (30).4结束语 (31).参考文献................................................................................................... .32.致谢.. (33)绪论从自动售货机的发展趋势来看,它的出现是由于劳动密集型的产业构造向技术密集型社会转变的产物。
摘要随着科技的不断发展,PLC在工程中的应用大家有目共睹,PLC在各个领域已占得一席之地,并将有更好的发展。
我国人口数量庞大,自动售货机在人们的生活中扮演越来越重要的角色,从长远来看其具有广阔的发展空间。
本次设计的自动售货机为饮料自动售货机,贩卖的商品性质明确,适于放置在短时间人口流动比较大的地方,比如餐厅。
首先通过与单片机和液压等控制的对比,确定采用PLC来控制自动售货机,然后分析自动售货机的结构和工作原理,明白自动售货机的贩卖过程,以便为硬件的选择做准备。
通过自动售货机的功能分析作出硬件框图,根据硬件框图选择所需要的PLC、货币识别器、电动机和接触器。
根据I/O分配表对PLC选型,并画出外部接线图。
根据控制系统流程图编写符合自动售货机功能的程序。
如果购物后有剩余金额,则可按退币按钮退币。
梯形图的编写通过GX Developer来完成,完成梯形图后可以在三菱PLC仿真软件 GX Simulator 6c进行调试和仿真。
最后用MCGS作出组态效果。
组态仿真图中自动售货机包括按钮、指示灯、投币口、取物口、退币口等部分。
关键词:自动售货机;PLC;梯形图; MCGSABSTRACTWith the development of science and technology, the application of PLC in engineering everybody be obvious to people, PLC has occupied a space for one person in every field, and will have a better development. Because of the large number of population, the vending machine is playing a more and more important role in people's life, in the long run it has broad space for development. The design of the automatic vending machine for beverage vending machine, the nature of the goods sold in the clear, adapted to be placed in a short time population flow of relatively large areas, such as restaurant. First, by comparing with the single chip microcomputer and hydraulic control, and adopt PLC to control the vending machine, then analyzes the structure and working principle of automatic vending machines selling process, understand the vending machine, to prepare for the selection of hardware. Through vending machine function analysis to make the hardware block diagram, according to the hardware block diagram, select the desired PLC currency recognizer, motor and contactor. According to the I/O distribution list on the PLC selection, and draw the external wiring diagram. According to the flow chart of control system prepared with vending machine program. If the shopping after the remaining amount, then press the coin button coin. Trapezoidal chart compilation done by GX Developer, complete ladder diagram can be debugged and simulated in Mitsubishi PLC simulation software GX Simulator 6c. Finally, MCGS made the configuration effect. Configuration simulation diagram of the vending machine comprises a button, indicator light, the slot, fetching port, a coin refund part.Keywords: vending machine; PLC; ladder diagram; MCGS目录1 绪论51.1 自动售货机的研究背景与意义51.2 研究自动售货机的目的61.3 本设计研究的容62 自动售货机的功能分析72.1 自动售货机主控单元的确定72.1.1 PLC的部分功能72.1.2 确定自动售货机的主控单元为PLC82.2 自动售货机的售货方法92.3 自动售货机的空间结构102.4 自动售货机的功能102.5 自动售货机的购物使用流程123 自动售货机的硬件部分133.1 控制电路硬件组成框图133.2 确定自动售货机使用的PLC类型143.3 货币识别器选型163.3.1 硬币的识别原理173.3.2 纸币的识别原理173.4 自动售货机电机与其它选择184 自动售货机的软件设计204.1 自动售货机的控制系统流程图204.2 自动售货机的程序部分214.2.1 程序中用到的部分指令214.2.2 自动售货机的控制程序224.3 程序的调试部分304.3.1 GX Developer304.3.2 程序调试304.4 基于MCGS组态的自动售货机仿真324.4.1 建立组态画面324.4.2 设置各元件的参数33结论38参考文献39致39附录系统硬件连接图411 绪论1.1 自动售货机的研究背景与意义自动售货机最早出现在20世纪60年代的欧美,当时在美国的地铁系统中。
摘要自动贩卖机是能够根据投入的钱币自动付货的机器,它是商业自动化的常用设备,不受时间、地点的限制,能节省人力、方便交易。
现代的自动售货机的种类、结构和功能依出售的商品而异。
钱币装置是售货机的核心,其主要功能是确认投入钱币的金额,如果投入的金额达到购买物品的数值即发出售货信号,并找出余钱。
自动售货机自动输出顾客所要的商品。
因此,自动售货机在商业,食品行业越来越普及,更方便消费者购买自己所需的商品。
使用方便、可靠、节省人力的自动售货机将在社会生活中成为一种趋势。
本文详细介绍了自动售货机系统以AT81C51芯片为核心,运用汇编语言在keil软件上进行编写、编译,在proteus上进行仿真,并通过选择独立键盘按键和LED显示,实现自动售货机的货物选择,投币显示,出货,找零等功能。
本文并详细介绍了自动售货机系统的设计方案、硬件选择、软件规划和编写。
重点描述了自动售货机的工作原理、系统设计和软件编程。
关键词:自动售货机;AT89C51;LCD显示;AbstractTrades machine is automatically can pay the goods automatically according to the investment money the machine, it is the commercial automation commonly used equipment, the time, the place limit, cannot save the manpower, the convenience transaction. The modern vending machine's type, the structure and the function depend on the sell the commodity, but different. The money installment is vending machine's core, its major function is confirms the investment money the amount, if invests the amount achieves the purchase goods the value namely to send out the vending signal, and discovers the extra money. The vending machine outputs the commodity which automatically the customer wants. Therefore, the vending machine in the trade, food profession is getting more and more popular, a more convenient consumer purchases the commodity which one need. The easy to operate, reliable, the economical manpower's vending machine will become one tendency in the social life.This article introduced in detail the vending machine system take AT81C51 chip as the core, the utilization assembly language carries on the compilation, the translation on the keil software, carries on the simulation on proteus, and demonstrated through the choice independent keyboard pressed key and LED, realizes vending machine's cargo choice, throws the coin to demonstrate, produces goods, gives change and so on functions. This article and introduced the vending machine system's design proposal, the hardware select, the software plan and the compilation in detail. Described vending machine's principle of work, the system design and the software programming with emphasis.Key words: Vending Machines;AT89C51;LCD Display;目录摘要 (I)Abstract........................................................................................... I I 第一章绪论.. (1)1.1 课题背景 (1)1.2 课题任务及要求 (2)1.3课题内容及安排 (2)第二章自动售货机的总体概括 (3)2.1自动售货机介绍 (3)2.2自动售货机的研究意义 (4)第三章硬件介绍 (5)3.1 单片机的介绍 (5)3.1.1 AT89C51的介绍 (6)3.1.2单片机复位电路的介绍 (10)3.1.3时钟电路的介绍 (11)3.2 LED的介绍 (12)3.2.1 LED基本信息 (12)3.2.2 LED发光原理 (13)3.3.3 TC1602介绍 (13)3.3 keil软件介绍 (16)3.3.1 keil c μVision2功能 (17)3.3.2 keil c的基本操作 (18)3.4 proteus软件介绍 (25)3.4.1 PROTEUS软件的特点 (26)3.4.2 proteus实现仿真 (27)3.4.3PROTEUS软件基本操作 (28)第四章自动售货机的系统结构 (34)4.1自动售货机的总体系统结构 (34)4.2 自动售货过程的控制子系统简述 (35)第五章自动售货机的功能介绍 (37)5.1 自动售货机的功能简介 (37)5.2 实现自动售货机的功能的设计思路 (38)第六章硬件接口电路 (39)6.1投币系统 (39)6.1.2货币累加的实现 (40)6.2 货物选择系统 (40)6.2.1 独立式键盘按键的识别 (40)6.2.2 键盘的编码 (40)6.2.3 货物选择系统的程序流程图: (41)6.3 出货系统 (41)6.3.1 出货功能的描叙 (41)6.3.2出货程序流程图 (42)6.4 找钱系统的描述及流程图 (42)第七章设计仿真 (44)7.1仿真电路 (44)7.2 proteus仿真图 (44)参考文献 (48)致谢 (49)附录 (50)总结 (68)第一章绪论1.1 课题背景自动售货机又称自动售货亭是能根据投入的钱币自动付货的机器,是商业化常用设备。
自动售货机的系统结构1.1自动售货机的系统概述自动售货机是集光、机、电一体化的独立机构,它只需要顾客投币和按购物键选择即可自动售货及退找零钱,其工作程序如下图1.1图1.1 自动售货机工作时序图售货机的工作原理是:(1)从投币口送入货币,然后通过传感器采集数据、识别器判断货币的真伪并判别面值。
(2)识别器把信息数据传给通信模块。
(3)通信模块与售货机的主控系统通信,主控系统显示面值,启动售货机的面板键,显示出哪个货道有货,哪个货道已经售完,并等待顾客按键选择商品。
(4)顾客选择商品后,售货机自动把商品送出,等待顾客取走。
(5)显示余额,如果金额足够多,顾客可以选择找币或者继续买商品;如果款额不够,售货机经过延时予以退币。
退币分为两种情况:一种是由货币识别器完成退纸币,另一种是由硬币的通信模块完成退硬币。
(6)系统复零,完成售货。
自动售货机的硬件原理构成如下图2.2所示图1.2 自动售货机硬件结构图综合所述,售货机系统可以分为三部分组成,即自动售货机的控制子系统、通讯子系统、硬币器子系统以及纸币器子系统。
其中控制子系统是本设计研究重点。
这些内容在下文中进一步介绍。
1.1.1自动售货过程的控制子系统简述控制子系统由以下四个部分组成,分别是预设自动售货机系统、金额累计、可售指示和退币系统、售完检测系统、售出累计及自测功能系统。
1、预设自动售货机系统。
自动售货机售出的同类商品可分为若干品种,其售前设定价格须预先寄存在控制系统内。
售货机的价格设置由按键和存储器组成。
通过按键选择被设价商品的种类及价格,并将价格写入存储器中,该存储器本身具有掉电保护功能,属于软件设置方式。
此外,在简易售货机中,由于出售商品的种类少,价格变化下,使用币种单一,也可以用硬件设置价格,才用拨码开关对应方式,结构简单,操作方便。
2、金额累计、可售指示和退币系统。
控制系统的核心CPU 对识币、退币、无货检验及购货信号进行循环检查,当有识币信号后,将金额数值送入金额累计存储器中进行累计,并通过串行接口使可售指示灯亮,提示购货。