PLC控制的自动灌装机系统的设计毕业设计
- 格式:pdf
- 大小:1.36 MB
- 文档页数:27
基于P L C的饮料自动罐装系统毕业设计The Standardization Office was revised on the afternoon of December 13, 2020毕业设计(论文)题目:自动化生产线中的饮料灌装系统——软件设计学生姓名:学号:专业:班级:指导教师:年月日河北工程大学毕业设计(论文)任务书题目:自动化生产线中的饮料灌装系统——软件设计学生姓名:学号:专业班级:学院:设计起止日期:题目性质一:实际工程目科理论研其他题目性质二:真题模目其他技术要求及原始数据:系统基于PLC-200,主要功能完成饮料灌装生产过程,明确装瓶,传送,盖盖,检测过程,并可以启动,移位,复位按钮进行操作,实现手动,自动全过程。
主要任务: 1、绘制工作流程图或顺序功能图;2、编写全程序T型图或指令表;3、运用程序进行调试;4、编写设计说明书;学生(签字):系主任(签字):指导教师(签字):院长(签字):河北工程大学毕业设计(论文)评语学生姓名专业班级毕业设计(论文)题目自动化生产线中的饮料灌装系统——软件设计1、指导老师评语:指导教师(签字)年月日2、评阅人评语:评阅人(签字)年月日3、答辩组评语:答辩组组长(签字)年月日摘要随着工业自动化水平日益提高,众多工业企业均面临着传统生产线的改造和重新设计问题。
PLC(可编程序控制器)是以微处理器为核心的工业控制装置,它将传统的继电器控制系统与计算机技术结合在一起,近年来在工业自动控制、机电一体化、改造传统产业等方面得到普遍应用。
作为通用工业控制计算机,其实现了工业控制领域接线逻辑到存储逻辑的飞跃,在世界工业控制中发挥着越来越重要的作用。
在饮料行业,自动化生产线的生产方式是推广的最普及的一种生产模式,它促使灌装的速度大幅提升,同时也使得灌装精度更高,给企业带来了不可小觑的生产力。
鉴于此,设计者利用PLC的功能和特点设计出了一款饮料灌装生产流水线控制系统。
饮料灌装机PLC控制系统设计饮料灌装机是饮料加工线上必不可少的设备,它有着高效、精准、可靠的特点。
而PLC控制系统是灌装机的核心,它可以实现灌装过程中的高速控制、精度控制和自动化控制。
1. PLC控制系统的工作原理PLC即可编程逻辑控制器,是现代工业控制的重要组成部分。
PLC控制系统由PLC、传感器、执行器、触摸屏人机界面等组成。
其工作原理是由PLC通过程序控制执行器的运动,实时读取传感器所感应的数据和触摸屏显示器上的指令,达到对灌装过程中物料流量、重量、速度等参数的实时监测和控制。
2. 设计要点饮料灌装机的PLC控制系统设计需要考虑以下几点:(1) 控制方式的选择:灌装机的控制方式分为手动和自动两种,手动控制方式操作简单,适用于小规模生产;自动控制方式可以通过预设程序实现自动加工,适用于大规模生产。
(2) 程序的设计:程序的设计包括监控和管理,需要实现数据采集、运算和调节等功能。
程序设计需要考虑到控制精度和反应速度两个方面,确保灌装过程中的稳定性和速度。
(3) 传感器的选择:传感器可以通过测量传输介质的温度、压力、流量等参数,将实时数据传递给PLC控制器。
传感器的选择需要考虑到其精度、稳定性和可靠性等因素。
(4) 触摸屏人机界面:触摸屏人机界面可以实现现场监控和控制,它需要具备操作简单、易于维护、直观友好等特点,以方便操作管理人员进行实时监控和控制。
(5) 增加安全措施:灌装过程中涉及到高压、高温、高速等复杂环境,需要在PLC控制系统中增加安全措施,如温度传感器报警、超重报警等,以确保职工的安全。
3. 优点PLC控制系统的优点包括:(1) 稳定性高:PLC控制系统运行稳定,能够实时调节灌装流量、速度、质量等参数,使产品质量更加稳定。
(2) 自动化程度高:PLC控制系统可以通过程序预设自动进行灌装过程,实现产品的自动化生产,节省人力成本。
(3) 精度高:PLC控制系统能够实时监测和控制灌装过程中的各项参数,确保产品质量的一致性。
基于PLC灌装机控制系统毕业论文|灌装机控制系统基于PLC灌装机控制系统毕业论文摘要 PLC控制是目前工业上最常用的自动化控制方法,由于其控制方便,能够承受恶劣的环境,因此,在工业上优于单片机的控制。
PLC 将传统的继电器控制技术、计算机技术和通信技术融为一体,专门为工业控制而设计,具有功能强、通用灵活、可靠性高、环境适应性强、编程简单、使用方便以及体积小、重量轻、功耗低等一系列优点,因此在工业上的应用越来越广泛。
本文主要讲述可编程控制器与灌装机中的控制方法和原理,采用了新的检测方法,实现了整个生产线的自动化。
本论文详细论述了灌装机控制系统的设计步骤,通过对灌装机系统的充分了解,以行业现状为出发点,结合其他行业自动控制技术的应用情况,提出了基于PLC的灌装机控制系统的基本结构。
用可编程控制器设计了多移阀开启、破瓶检测、破瓶捡出、自动压盖等过程的自动控制。
最后,简要介绍了组态软件,对模拟过程进行了详细的叙述,并附有灌装机控制系统的组态画面。
本系统设计中完成了灌装机控制系统的硬件的配置和软件方面的设计,并利用组态软件实现了实时监控系统的设计。
采用PLC来控制生产线,实现了控制系统的自动化,对劳动生产率的提高,对液体的质量和产量的提高都具有深远的意义。
关键词:灌装机控制系统;可编程控制器;组态软件Abstract PLC control is the most commonly used industrial automation control method,because of its convenient control to withstand an adverse environment,it is better than MCU controltechnology ,computer and communication technologies are integrated specifically for industrial control and design,have store function,common flexible,high reliability and environmental adaptability,and programming simple,easy to use and small size,light weight,a series of low-power advantages in industrial applications become more extensive. This paper introduces briefly the programmable logical controller and the century star monitoring software uses in the filling machine of controlling method and the principle, used the new examination method, andachieve the automation of the entire production line. This paper describes in detail the control system ofthe filling machine design steps, is based on theself-industry and the application of the other tradeon auto-control technique, proposed the frame of the control system based on programmable logicalcontroller. Design the control system of the filling machine based on the programmable logical controllerand designs the control system, inspecting and picking out the broken bottle. the simulation software of configuration briefly and describe simulation processin detail, there are production line configuration screen. This design completes the carbonatedproduction line hardware configuration and software design and uses century star configuration software to monitor real-time system, to achieve the image of the entire design image and practical.. Not only improvethe labor productivity, but also has far-reaching significance of the improvement of quality and yield. Keywords: Carbonated filling machine control system, Programmable Logical Controller, Configurationsoftware 目录摘要 I Abstract II 第1章引言 11.1设计的目的和意义 1 1.2设计项目发展情况简介 2 1.2.1 可编程序逻辑控制器 2 1.2.2 我国灌装业的缺陷 3 1.3汽水灌装机控制系统方案设想与优点 3 1.4论文的主要构成 3 第2章灌装控制系统总体介绍 5 2.1 灌装机的主要类型 52.1.1 旋转型灌装机 5 2.1.2 直线型灌装机 5 2.2 灌装的基本方法介绍 6 3.3 灌装机以及灌装方式的确定 7 3.3.1 灌装机的确定 7 3.3.2 灌装方式的确定 7 第3章汽水灌装机控制系统设计方案 9 3.1 总体设计思路 9 3.2 灌装机控制系统的具体流程 9 第4章汽水灌装机控制系统的硬件设计11 4.1 PLC的选型 11 4.1.1 选择PLC控制的原因 114.1.2 PLC介绍 11 4.1.3 PLC型号的选择 12 4.2 PLC硬件系统的连接 13 4.3 灌装机的传动原理 14 4.4 灌装机的重要硬件详解 15 4.4.1 灌装机的供瓶机构 15 4.4.2 瓶的升降机构 15 4.4.3 灌装阀的功能 15 第5章汽水灌装机控制系统的软件设计 17 5.1 系统程序的指令介绍 17 5.2 可编程序控制器I/O分配 17 5.3 工作过程分析 18 5.3.1 正常灌装流程 18 5.3.2 灌装出现次品的流程 21 5.3.3 次品捡出器 22 5.3.4 贮料缸的相关程序 24 第6章监控程序的软件设计 25 6.1 组态软件简介 25 6.1.1 组态软件的选择 25 6.1.2 世纪星组态软件简介 25 6.1.3 世纪星软件组成 25 6.2 组态画面的具体设计 26 6.2.1 组态图形界面的设计 26 6.2.2 组态的变量设计 27 6.2.3 应用程序命令语言编辑 28 6.2.4 动画连接 29 第7章监控系统通信的实现 31 7.1 通信连接 31 7.1.1 CPM2A的通信连接方式 31 7.1.2 CPM2A的上位通信协议 31 7.1.3 编写上位机通信程序 31 7.1.4 实现上位机对PLC的监控 32 7.2 计算机与PLC通信 32 7.3 世纪星与PLC通信 33 7.4 监控系统的现场调试 34 7.4.1 PLC系统的现场调试 34 7.4.2 上位计算机系统的现场调试 35 结论 36 参考文献 37 致谢 38 附录组态运行效果图 39 第1章引言 1.1设计的目的和意义随着现代科学技术的发展,人民生活水平的提高,人们的消费习惯也随之相应的变化,同时对消费品的包装提出了更高的要求。
毕业设计(论文)题目:全自动灌装机的PLC自动控制设计及故障处理摘要传统的继电器控制设备不仅体积大,耗电多、效率低且故障率高,已无法满足现代生产快速反应、精确度高且连续稳定运行时间长的要求。
另外灌装液体大多粘度(cps)较高因此普通灌装机无法实现液体自流灌装。
PLC是一种专门为在工业环境下应用而设计的数字运算操作的电子装置,具有通用性好,可靠性高,安装灵活,扩展方便,性价比高等一系列优点,通过PLC控制伺服电机的升降来精确控制灌装量的多少,主要用于高粘度等液体的灌装。
本文主要介绍了基于PLC和伺服系统等机电产品的控制系统可以很好地满足现下各种用户对于灌装设备的使用要求。
关键词PLC 伺服系统全自动灌装调试目录第1章全自动灌装机控制系统用户需求及其分析 (1)第2章电气线路设计2.1总体功能设计 (1)2.2电气产品选型 (3)2.3具体实施 (5)第3章控制模块的程序设计思路及设计3.1PLC与触摸屏的选型 (6)3.2PLC的输入输出点位表和接线图 (7)3.3PLC与触摸屏通讯模块设置 (8)3.4PLC编程要点3.4.1PLC控制补液电机减少生产环节 (9)3.4.2PLC控制急停按钮保护设备及操作人员 (10)3.4.3PLC控制设备清洗次数保持设备清洁 (12)第4章设计过程中的故障处理及设备调试与维护4.1各类传感器的接线过程出现的问题 (13)4.2伺服驱动器与伺服电机及PLC间的通讯问题 (15)4.3PLC与触摸屏间通讯问题 (17)4.4全自动灌装机调试 (18)第5章结论 (19)致谢 (20)参考文献 (21)附录 (22)第1章全自动灌装机控制系统用户需求及其分析近几年随着机器设备自动化的不断升级,自动灌装机的维护,操作和保养越来越容易,自动化技术的升级对自动灌装机操作人员的专业技能也没以前那么复杂和那么高了,所以产品灌装的质量直接与自动灌装机的质量水平和先进水平有关。
基于PLC控制的全自动灌装机系统的设计摘要食品机械是专为食品工业提供服务的,大约有70%的包装机械是为食品包装提供服务的,最近几年饮料业迅速发展,市场对液体灌装设备的需求量增长迅猛。
国内的包装机械起歩较晚, 而国外发达国家的包装设备已经向高效率、高精度、高自动化程度方向发展,目前虽然采用引进一消化的发展模式能满足生产需求,但技术含量不高,特别是对光、磁和计算机等先进技术的应用较少,从而使得国内与国外相比在包装机械的包装精度和运行稳定性上还是存在着较大差距的。
本论文以全自动液体灌装机作为研究对象,采用欧姆龙CMP1A 型PLC对其控制系统进行软件设计,并利用组态王做出监控系统,实现基于欧姆龙PLC与组态王的控制系统。
采用模块化的设计方法,对全自动液体灌装机的主要控制要求进行程序设计,由理瓶机、灌装机、封盖机和外围辅机构成的四块控制模块,再结合组态王软件开发设计出一种适合工厂流水线化作业的全自动灌装机控制系统界面,对灌装机的工作流程实现实时监控,实现控制系统的分块管理、集中控制的功能,实现了灌装生产高速化、精确化、智能化、多功能化以及操作界面人性化的要求。
关键词:灌装机、PLC、组态王。
AbstractFood Machinery is designed to provide services to the food industry, about 70% of the packaging machinery is to provide services for the food packaging, beverage industry developed rapidly in recent years, market demand for the rapid growth of liquid filling equipment. Domestic packaging machinery since late walk, and packaging equipment in developed countries has been developed to a high efficiency, high precision, high degree of automation direction, although the current model of development with the introduction of a digestion can meet theproduction needs, but not high-tech, in particular the application of less light, magnetism and advanced computer technology, making domestic and foreign in the packaging compared the accuracy and stability of packaging machinery running or there is a big gap.In this paper, automatic liquid filling machine as the research object, using Omron CMP1A its type PLC control system software design and configuration king made use of monitoring systems, Omron PLC-based control system and configuration of the king. Modular design approach, the main control requirements for automatic liquid filling machine for program design, control module consists of four Unscramble, filling machine, capping machine and peripheral auxiliary composition, combined with so fewer configuration king development and design of a suitable factory assembly line jobs automatic filling machine interface control system, filling machine workflow for real-time monitoring, management and control system of the block, centralized control function to achieve a high-speed bottling oriented, accurate, intelligent, multi-functional and user-friendly interface requirements.Keywords: filling machine, PLC, King View.目录1 绪论 (1)1.1 课题研究的意义 (1)1.2 全自动灌装机的发展概况 (2)1.2.1 国内外全自动灌装机的发展状况 (2)1.2.2 国内外全自动灌装机制造业的发展趋势 (2)1.3 全自动灌装生产线 (4)1.3.1 液体灌装的基本原理 (4)1.3.2 液体灌装的方式 (4)1.3.3 灌装的定量方法 (4)1.3.4 影响灌装的因素 (6)1.3.5 灌装机及外围辅机的概况与种类 (6)1.4 本论文研究的主要内容 (7)2 可编程控制器 (8)2.1 PLC发展的历史 (8)2.2 可编程控制器的发展阶段及其定义 (9) 2.2.1 可编程控制器的发展阶段 (9)2.2.2 可编程控制器的定义 (10)2.3 PLC的特点 (10)2.4 可编程控制器的分类 (13)2.4.1 按照容量和功能分类 (13)2.4.2 按照结构形式分类 (14)2.4.3 按照使用情况分类 (15)2.5 PLC的应用 (15)2.6 PLC的基本组成和工作原理 (16)2.6.1 PLC的基本组成 (16)2.6.2 PLC的工作原理 (20)3 组态王及其组态王与PLC的通信 (23) 3.1 组态王简介 (23)3.2 组态王软件的功能及特点 (24)3.2.1 组态王软件的功能 (24)3.2.2 组态王软件的特点 (25)3.2.3 组态王软件数据处理过程 (25)3.2.4 组态王寄存器说明 (26)3.3 组态王新建一个工程 (28)3.4 组态王与PLC的通信 (29)4 基于PLC的全自动灌装机系统设计 (33) 4.1 确定全自动灌装机的控制要求 (35) 4.2 计算输入输出点数并选型 (35)4.3 全自动灌装机控制系统的梯形图设计 (37)4.3.1 传送系统的设计 (37)4.3.2 理瓶机系统的设计 (38)4.3.3 灌装机系统的设计 (38)4.3.4 封盖机系统的设计 (40)5 组态王监控界面的设计 (41)5.1 关于组态王变量的问题 (41)5.2组态王的动画连接 (43)5.3 组态界面设计以及调试 (45)6 结论 (48)致谢 (49)参考文献 (50)附录1:基于PLC控制的全自动灌装机系统程序代码 (51)1 绪论1.1 课题研究的意义随着全球经济的迅速发展,人们在日常生活中对包装品的需求越来越大,而且与传统包装工业相比,精确、节约、高效成了现代包装技术的发展方向,从而使得包装机械不论在制造水平还是在技术上都需要不断的创新。
继续教育学院C o l l e g e O f C o n t i n u i n g E d u c a t i o n Of J i a n g s u U n i v e r s i t y 本科毕业论文基于PLC的旋转灌装机控制系统设计学生学号:学生姓名:专业班级:指导教师姓名:指导教师职称:年月基于PLC的旋转灌装机控制系统设计专业班级:学生姓名:指导教师:教师职称:摘要食品机械是专为食品工业服务的,包装机械大约有70%是为食品包装服务的,特别是近年来饮料工业迅速发展,使得液体灌装设备的需求大量增长。
美国、日本等国的包装设备正在向高效率、高精度、高自动化程度方向发展。
我国的包装机械起步较晚,主要是采用引进一消化的发展模式,虽能满足生产需求,但技术含量不高,特别是对光、磁和计算机等先进技术的应用较少,从而使得我国包装机械的包装精度和运行稳定性同国外设备相比存在着较大差距。
本论文对集清洗、灌装、加盖三合一体的旋转型灌装机一XG-24128进行控制系统研究,使其对500ml PET瓶灌装速度可达18000BPH以上,单个封盖头的工作效率可达行稳定性,自动生产可以实现无瓶不灌装和无瓶不加盖。
并对XG-24128型灌装机的关键技术-一个伺服泵同时控制两个灌装头并实现连续灌装的控制设计进行研究。
首先,对XG-24128型灌装机进行控制系统方案设计。
在研究XG-24128型灌装机整体结构的基础上分析其灌装的工艺流程,并根据设计要求确定灌装机控制系统的整体方案。
其次,明确控制系统的硬件配置。
根据灌装机的设备状况和工艺要求,确定PLC的类型及相关模块,对I/O 口进行定义,并对伺服电机、步进电机和其他电器元件进行选型和布置。
接着,对XG-24128型灌装机的关键技术-一个伺服泵同时控制两个灌装头并实现连续灌装的控制设计进行研究。
分析连续灌装时灌装头位置的确定,对灌装速度进行初步分配,并对其换向机构进行研究。
毕业设计说明书题目基于plc的饮料灌装机控制系统设计专业机械制造与自动化班级 1001 班学生姓名指导老师2016年1月3日目录摘要 (1)第一章绪论 (3)1.1 设计内容 (3)1.2 控制要求 (3)1。
3 设计要求 (3)第二章控制系统方案设计 (4)2。
1 饮料灌装流水线的基本结构 (4)2.2灌装流水线的工作原理 (5)第三章硬件控制设计 (6)3。
1 PLC的选择 (6)3.2 传感器的选择 (7)3。
3 硬件电路的设计 (7)第四章软件控制设计 (8)4。
1 系统流程图 (8)4。
2 I/O分配表 (10)4.3 I/O接线图 (11)4.4梯形图 (12)4.5指令表 (14)第五章调试说明 (15)第六章总结 (15)致谢 (16)参考文献 (17)摘要随着计算机和网络通讯技术的发展,企业对生产过程的自动控制和信息通讯提出了更高的要求.饮料生产线比较复杂,生产环节也很多。
其中饮料的灌装就是饮料生产线上重要的生产环节.控制系统主要由一台PLC、交流异步电机、液罐、多个灌装状态检测传感器、故障报警蜂鸣器、产量统计显示器等组成.其中电机用来控制运送饮料瓶的传送带部分。
本控制系统有两个特点:一是输入、输出设备比较多;二是所需实现的控制是顺序逻辑控制、模块控制以及计算统计功能。
采用PLC控制饮料灌装生产线,实现了饮料生产线的自动化、智能化。
对劳动生产率的提高,饮料质量和产量的提高具有深远的意义。
关键词可编程序控制器(PLC)/自动化/智能化AbstractWith the computer and network communication technology,business-to-production process automation and information and communication put forward higher requirements。
Beverage production line more complex production processes are also numerous。
内容摘要作为通用工业控制计算机,可编程控制器实现了工业控制领域接线逻辑到存储逻辑的飞跃,在世界工业控制中发挥着越来越重要的作用。
而现代社会对灌装食品的安全要求越来越高,为使灌装出的食品整齐、美观并且具有良好的包装质量,要求灌装机具有精确的动作、定位精度及较高的生产率和一定的柔性,因此对灌装机的控制要求是越来越高。
传统的继电器已经不能满足现代生产的要求了。
所以研制高效、经济且有一定柔性的新型灌装机械是非常迫切的。
本课题利用PLC的功能和特点设计出了一款饮料灌装生产流水线控制系统。
主要用了西门子S7-200PLC,传感器,继电器等。
采用 PLC 是用了它的自动控制能力好的特点,这样可以在生产过程中无需有人控制。
设计了以 S7-200系列 PLC 为基础的灌装机控制系统,硬件设计包括控制系统的硬件配置、输入输出点分配、计数显示和PLC外部接线图的绘制;软件设计包括梯形图、语句表设计和控制系统流程图的绘制和七段码显示。
关键词:工业控制:可编程控制器;系统硬件接线图;I/O 端口分配表目录第1章引言 (1)1.1设计内容 (1)1.2控制要求 (1)第2章系统总体方案设计 (2)2.1 PLC的工作原理 (2)2.2可编程序控制器的组成 (2)2.3可编程序控制器的特点 (3)2.4可编程控制器PLC的应用 (4)2.5系统可靠性设计 (5)第3章 PLC控制系统设计 (7)3.1 确定I/O信号数量,选择PLC类型 (7)3.2 I/O地址的分配与编号 (8)3.3 PLC外部接线图 (9)3.4 七段码显示器示意图 (10)3.5七段码显示器显示数字0—9 (10)3.6控制流程图 (11)3.7程序梯形图编制 (12)结论 (21)设计总结 (22)谢辞 (23)附录 1 (24)附录 2 (31)参考文献 (32)第1章引言1.1设计内容:饮料灌装机的PLC控制系统设计1.2控制要求:(1)系统通过开关设定为自动操作模式,一旦启动,则传送带的驱动电机启动并一直保持到停止开关动作或灌装设备下的传感器检测到一个瓶子时停止;瓶子装满饮料后,传送带驱动电机必须自动启动,并保持到又检测到一个瓶子或停止开关动作。
PLC控制自动罐装机是一种自动化生产设备,可广泛应用于食品、医药、化工等行业的罐装生产线。
本文将介绍一个基于PLC控制的自动罐装机的设计方案,包括设备结构、控制系统、电气系统等方面。
一、设备结构该自动罐装机包括进料、计量、灌装、封口、装箱等部分,具体结构如下:1.进料部分:该部分包括料斗、输送带、电机等设备,用于将原料送到计量部分。
2.计量部分:该部分包括称重传感器、计量仪表等设备,用于对原料进行准确计量。
3.灌装部分:该部分包括灌装机、气动阀门等设备,用于对原料进行灌装。
4.封口部分:该部分包括封口机、加热器等设备,用于将罐装好的产品进行封口。
5.装箱部分:该部分包括输送带、打码机等设备,用于将罐装好的产品进行装箱和标识。
二、控制系统该自动罐装机采用PLC控制系统,实现对整个生产过程的控制和管理。
具体控制系统如下:1.进料控制:通过对进料电机的控制,实现原料的自动输送。
2.计量控制:通过对称重传感器和计量仪表的控制,实现对原料的准确计量。
3.灌装控制:通过对灌装机和气动阀门的控制,实现对原料的准确灌装。
4.封口控制:通过对封口机和加热器的控制,实现对罐装好的产品的封口。
5.装箱控制:通过对输送带和打码机的控制,实现对罐装好的产品的装箱和标识。
三、电气系统该自动罐装机的电气系统由主控制柜、电机控制柜、传感器控制柜等部分组成。
具体电气系统如下:1.主控制柜:该部分包括PLC主机、触摸屏、电源等设备,用于实现对整个自动罐装机的控制和监控。
2.电机控制柜:该部分包括进料电机、输送带电机、封口机电机等设备,用于实现对各个电机的控制和调节。
3.传感器控制柜:该部分包括称重传感器、气动阀门、加热器等设备,用于实现对各种传感器的控制和监控。
四、总结本文介绍了一个基于PLC控制的自动罐装机的设计方案,包括设备结构、控制系统、电气系统等方面。
该自动罐装机具有结构合理、控制精准、生产效率高等优点,可广泛应用于食品、医药、化工等行业的罐装生产线中。
Automatic Code Generation for PLC ControllersKrzysztof SachaWarsaw University of Technology, Nowowiejska 15/19, 00-665 Warszawa, Polandk.sacha@.plAbstract. The paper describes a formal method for automatic generation ofprograms for PLC controllers. The method starts from modeling the desired be-havior of the system under design by means of a state machine with the abilityto measure time and ends-up with a complete program written in a ladder dia-gram language. The model is formal, yet readable, and can be verified againstthe behavioral and safety requirements. The conversion of the model into a pro-gram is done automatically, which reduces the need for further programverification.1 IntroductionComputerized control systems are used in many industrial applications in which a mal-function of the system can endanger the environment or human life. The systems that are used in such application areas are expected to exhibit always an acceptable behavior. Such a property, often referred to as dependability, is a system-level attribute, which must be considered at hardware as well as software level. The typical hardware devices used in industrial control are Programmable Logic Controllers (PLC) that are designed in such a way that promotes reliability and predictability of the controller operation, and makes the design of time- and safety-critical systems easier.PLC is a specialized computer, which has a set of input interfaces to sensors, a set of output interfaces to actuators and an operating system that manages the repeated execution of the following cycle:•Reading all input sensors and storing the read data as values of input variables. •Processing the inputs and computing the new values of the output variables. •Updating all outputs with the current values of output variables.The maximum duration of each execution cycle is bounded and guaranteed by the operating system. This introduces an explicit granularity of time: An input signal that does not hold for at least the maximum duration of the cycle can remain unnoticed by the PLC. Moreover, a response to an input signal cannot be expected earlier than in the next consecutive cycle of execution.Programming of a PLC deals with the computing phase of the execution cycle only. The core part of the computation relates to calculations of Boolean conditions that define the current state of the controller and the current values of two-state output variables. The programming languages, standardized in [1], include: Instruction List (IL), Structured Text (ST), Ladder Diagram (LD) and Function Block Diagram (FBD).304 K.SachaA PLC can be used alone, but in many real applications it is a part of a bigger sys-tem that consists of several PLCs and computers coupled and working together. The development of such a system can be driven by a set of UML-based models [2] that describe the required behavior of the system as a whole, and of all of its components. The conceptual tool that is offered by UML to model this type of processing that is done by a PLC is state diagram – a model that describes the states an object can have and how events (input signals) affect those states over time.The goal of this paper is to describe a formal method for automatic programming of PLCs, which uses a subset of UML-based state diagram model to define a correct control algorithm, and to implement the algorithm automatically using the ladder dia-gram language. The choice of the target language (LD) has been motivated by the widespread use of certified programming environments offered by the majority of PLC manufacturers. Nevertheless, generation of a program in C language executed under a POSIX-type operating system is also possible. The advantages of the method are simplicity that has been verified in student labs, easy interfacing to UML-based software development process and tools, and the possibility of automatic code genera-tion. The verification of the program correctness can be performed at the model level.The paper is organized as follows. Section 2 provides the reader with a short over-view of the subset of UML-based state diagram model that is used in the paper. Sec-tion 3 introduces a formal definition of the finite state time machine that defines the semantics of the state diagram model. The process of converting a finite state time machine into a program, written in the ladder diagram language, is described in Sec-tion 4. The description is illustrated using a case study of a bottling line controller. Fi-nal remarks and plans for future work are given in Conclusions.2 State DiagramBasically, state diagram is a graph that shows how an object reacts to events that originate in the outside world. It consists of states that capture distinct modes of the object behavior and transitions between states that are caused by events and accom-panied with actions. Relating the model to the structure of PLCs one can note that events correspond to the occurrences of input signals, and actions correspond to changes of the output signals. The modeling concept is simple and consistent with the mathematical theory of finite state machines. UML adds further elements to this model:•Entry and exit actions of a state that are executed on entering and exiting the state. •Guards, i.e. Boolean conditions that enable or disable transitions.•Internal transitions that are handled without causing a change in state. •Deferred events that are memorized for handling in another state.•Time events that correspond to the expirations of predefined periods of time.Entry and exit actions of a state do not add any new semantics to the model as they can easily be reassigned to transitions that input or output the state. Guards deal with the attributes of an object and do not apply to modeling of PLCs. Internal transitions and deferred events violate the rule that the only memory of an object is state, andAutomatic Code Generation for PLC Controllers 305 therefore are excluded of the model that is used in this paper. If an event could make a permanent change to an output or had to be memorized, an explicit change to the ob-ject state must be shown.A substantial extension to the model of a finite state machine is the introduction of time events. Such an event originates inside the modeled object, and breaks the rule that the reaction of the object to an external event depends on the current state only. An additional memory of timers that measure the flow of time is needed. An attempt to describe the extension is given by the theory of timed automata [3]. Still another formal model of a finite state time machine is introduced in Sect. 3.A disadvantage of a state diagram, as described above, is the lack of tools for man-aging complexity of real systems that can have hundreds or even thousands of states reflecting very general or very detailed properties of the modeled objects. One way to capture the behavior of such a complex system is to describe its behavior using many levels of abstraction. UML offers hierarchical state diagrams, in which a state can have sub-states, each of which can be shown in another state diagram. A transition that leads to a super-state activates the internal state diagram in its initial state. A tran-sition that roots in a super-state can occur in each of its internal sub-states.The presence of nested states leads to quite a new concept of a history indicator that is used to memorize the last sub-state on exit of a super-state, so that it’s possible to go back to this sub-state at a later time. History indicator adds memory to the model – a discussion of this feature is given in Sect. 4.2.3 Finite State Time MachineFinite state machine is a recognized tool for defining the algorithms of processing the enumerative sets of events. The automaton-like graphical models are formal, as well as understandable to engineers and computer programmers. What is missing to a clas-sical finite state machine is the ability to model time. In this section we define a new model of a finite state time machine that adds time to the classical Moore automaton. Definition. A finite state time machine is a tuple A = ( S, Σ, Γ, τ , δ, s0 , ε, Ω, ω), whereS is a finite set of states,Σis a finite set of input symbols,Ωis a finite set of output symbols,Γis a finite set of timer symbols,τ: Γ→ S × R+ is an injective function, called timer function,δ: (S ×Σ∪ S ×Σ×Γ) → S is a function, called transition function, which is total on S ×Σ and partial on S ×Σ×Γ:(s,a,t)∈Dom(δ ) ⇔(∃ r∈R+)[τ ( t )= (s,r)]s0 ∈S is the initial state,ε∈R+ is the granularity of time,ω: S →Ω is an output function.Notation:R+ is the set of positive real numbers, Dom(δ ) is the domain of function δ. Cardinality of a set X will be denoted card(X).306 K.SachaIt can be noted from the above definition that a finite state time machine is finite, and looks much like a Moore automaton with three additional elements: Γ, τ , ε. The rationale that stands behind the timer symbols can be explained as follows. The only memory of a Moore automaton is state. Adding time to such an automaton adds an additional kind of memory that stores durations of time intervals. This additional kind of memory is explicitly shown as a set of timer symbols. Each timer symbol will be converted in the implementation process into a timer device that measures time.For an example, consider a train-detecting sensor [4] that signals ‘a’ if a train is approaching, ‘b’ if not, and ‘Error’ if a failure of the device has been detected. The sensor can stutter for a time ∆t after a train has passed the sensor. The control system is expected to filter the stuttering and to react on the ‘Error’ signal immediately.The behavior of the required system can be described precisely using an automaton that could measure time (Fig. 1). The automaton starts in state N and reads the input. If the train approaches, the input reads ‘a’ and the automaton moves to state T. Now the input can stutter, but the automaton does not react to signal ‘b’, until it has contin-ued to be in state T at least through the period ∆t. Afterwards, if ‘b’ still holds, the automaton returns back to state N and continues as before. If the input reads ‘Error’, the automaton moves to state X.Fig. 1. Filtering device with detection of errorsThe notation in Fig. 1 suggests that period ∆t is attributed to a transition between states, rather than to a state. This is because a transition is enabled by a combination of an input symbol and a timer symbol.Formal definition of the filtering device can be written as follows:S = { N, T, X }Σ= {a, b, Error}Ω= {no approach, approach, don’t know}Γ= {t1 }τ : τ ( t1 ) = ( T, ∆t )δ: δ (N, a)= T δ (N, b)= N δ (N, Error)= X δ (T, a)= T δ (T, b)= T δ (T, Error)= Xδ (T, a, t1 )= T δ (T, b, t1 )= N δ (T, Error, t1 )= Xδ (X, a)= X δ (X, b)= X δ (X, Error)= Xs0 = Nω: ω(N) = no approach ω(T) = approach ω(X) = don’t knowThe granularity of time ε has not been defined in [4].Automatic Code Generation for PLC Controllers 307 3.1 Execution of a Finite State Time MachineMoore automaton models a device that cooperates with its environment. The execu-tion of an automaton starts in state s0. The environment generates a sequence of inputsymbols a0 , a1 ,…, a k ,… and the automaton moves through a sequence of states s0 , s1 ,…, s k ,… such that s k+1=δ(s k, a k) for k= 0,1,…. Each state s k of the automaton corre-sponds to an output symbol q k=ω(s k ). This way the automaton responds to a se-quence of input symbols a0 ,a1 ,…, a k ,… with a sequence of output symbols q0 , q1 ,…,q k ,….A finite state time machine adds to the model the dimension of time. The function τ defines for each state s∈S a set of timers T(s), such that:T(s)= { t∈Γ: (∃ r∈R+)[τ ( t )= (s,r)] }A timer t, such that τ(t)= (s,r), will be denoted t s,r. The same symbol will be used for the value of r, rounded up to the nearest multiplicity of ε. This will not lead to a misunderstanding, as the actual meaning of t s,r will always be clear from the context.A nonempty set T(s) can be ordered with respect to the value of t s,r:T(s)= { t s,r1 , …t s,rp }The sequence { t s,r1, … t s,rp } defines a partition of time into p+1 intervals:[0, t s,r1) … , [t s,rp ,∞)There is only one interval [0,∞) if the set T(s) was empty. The execution of a finite state time machine starts in state s0. When it enters a state s∈S, it enters the first time interval [0, t s,r1) as well. The machine executes in this interval by taking an input sym-bol a and moving from the current state s to the next state s’∈S, such that s’=δ(s,a).If the machine has continued to be in state s at least through t s,r1 time units, then itmoves to the time interval [t s,r1 , t s,r2), then to [t s,r2 , t s,r3) and so on. The machine exe-cutes in a time interval [t s,rj , t s,r(j+1)) by taking an input symbol a and moving from the current state s to the next state s’∈ S, such that s’=δ(s,a,t s,rj). The flow of time does not depend on the sequence of input symbols. Therefore, unlike in a Moore automa-ton, there is no deterministic mapping from an input sequence a0 ,a1 ,…, a k ,… to an output sequence q0 , q1 ,…, q k ,…. The response of a finite state time machine depends on the time intervals within the sequence of input symbols.3.2 Relation to Other ModelsMoore automaton is equivalent to a finite state time machine with no timers, i.e.: •(∀s∈S)[card(T(s))= 0]If the above condition holds, then no partitioning of time exists and there is a single time interval [0,∞) for each state of the automaton.PLC-automaton [4] can be converted into a finite state time machine such that: •(∀s∈S)[card(T(s))≤ 1]308 K. SachaLet P = ( S, Σ, δ, s 0, ε, St, Se, Ω, ω ) be a PLC-automaton. The equivalent finite state time machine A = ( S, Σ, Γ, τ, δ, s 0, ε, Ω, ω ) can be constructed as follows:• The elements S, Σ, s 0, ε, Ω, ω of A are equal to S, Σ, s 0, ε, Ω, ω of P , respectively. • The other three elements of A are the following: Γ = U s ∈S: St(s)>0 { t s,St(s) } − note that this defines the timer function τ, as well.δ (s,a) = δ (s,a,t s,St(s) ) = δ (s,a)Timed automaton [3] represents a broader class of models than finite state time ma-chine. This is because a clock of a timed automaton can measure time between two arbitrary transitions in a state transition graph, while the life of a timer of a finite state time machine is limited to the period of time, in which the machine continues being in a single state. A minor drawback of timed automaton is the lack of output symbols. The advantages of the model of a finite state time machine are simplicity, expres-siveness and ease of implementation. The limitation on the life of timers helps in keeping the size of the state space small. To demonstrate the expressive power of the model, consider a requirement to measure the time period between two events: ‘a ’ and ‘b ’, and to classify the delay as: Short , middle , long or infinite . The problem can-not be represented directly as a PLC-automaton [4]. Finite state time machine model (Fig. 2) is simple and understandable.Fig. 2. Measurement and classification of time periods (0 < ∆t 1 < ∆t 2 < ∆t 3)The semantics of a finite state machine can be defined formally using the Duration Calculus [5], which is a real-time extension to the discrete interval temporal logic. Such a definition allows formal reasoning and proving correctness of the model. This topic is not covered by this paper.4 Code GenerationA developer defines the algorithm of processing input signals into output signals of a PLC by means of a state diagram. The semantics of this model is defined formally by ⎧ ⎨ s if St(s)> 0 and a ∈Se(s) δ (s,a) otherwise ⎩—duration <∆t 1—∆t 1≤duration <∆t 2 —∆t 2≤duration <∆t 3 —duration ≥∆t 3Automatic Code Generation for PLC Controllers 309 a finite state time machine. Input and output symbols of the machine correspond to particular combinations of input or output signals of the PLC, respectively. Timer symbols correspond to timers, i.e. program elements that can measure time and signal the expiration of time periods that are defined by the timer function.The states of the finite state time machine are stored within the controller as states of flip-flops, used by a program. Using n flip-flops one can store at most 2n states. The mapping of states into the states of flip-flops (coding of states) is not unique, and can be a result of a design decision or an optimization procedure. A program of the controller implements the transition function in such a way that each pass through the program fires a single transition between the states of the finite state time machine.PLC program takes the form of a ladder diagram [1] and is structured into a se-quence of lines, each of which describes a Boolean condition to set or reset a flip-flop, a timer or an output signal, according to the values of input signals, states of flip-flops and timers. The Boolean conditions reflect the selected coding of states and imple-ment the transition function, the output function and the timer function.The development process of a PLC program consists of two phases. The first phase, which corresponds to the requirements modeling and analysis, followed by a safety analysis, requires creativity of the developer and must be performed manually. The second phase, which corresponds to program design and implementation, can be per-formed automatically. The first phase is not covered by this paper, but a detailed dis-cussion can be found in [6,7].Design and implementation phase starts with the verified model of a state diagram developed previously. The phase consists of the six basic steps:1.Coding states.2.Implementing the timer function.3.Implementing the transition function.4.Filling up the state space (error recovery).5.Implementing the output function.6.Building a program.A description of the conversion process from a state diagram to a ladder diagram, given in the reminder of Sect. 4, will be illustrated using a case study of a simple bot-tling line. Although simply stated, the problem contains many of the elements of ac-tual control systems.4.1 Case StudyA bottling line (Fig. 3) consists of a bottle supply with a gate, a conveyor system, a scale platform and a bottle-filling pipe with a valve. Bottles to be filled are drawn one by one from the supply of bottles and moved to the scale platform by the conveyor. As soon as the bottle is at required position, a contact sensor attached to the platform is depressed and the bottle-filling valve is opened. The scale platform measures the weight of the bottle with its contents. When the bottle is full, the bottle-filling valve is shut off, and an operator manually removes the bottle from the line. Removing the bottle releases the contact sensor, and the entire cycle repeats automatically.310 K. SachaThe current line status is described by a set of two-state signals issued by the plant sensors and switches:S start the line: A manual signal that enables the repetitive line operation;P suspend the line: A manual signal that suspends temporarily the bottling process; R bottle ready: A signal from the electrical contact of the platform sensor;F bottle full: A signal issued by the scale.The controller reads the current line status and yields the three control signals: G open the gate of the bottle supply (a pulse signal of the length ∆t 1),T start the conveyor,Z open the bottle-filling valve.Fig. 3. Bottling lineThere are three different modes of control of the bottling line: Working (regular line operation), Blocked (when something went wrong) and Suspended (a mainte-nance mode). Different modes of control are modeled as different states in a state dia-gram (Fig. 4). Working mode is modeled as a super-state, which has four sub-states nested that correspond to the particular phases of the bottling process.Fig. 4. Optimized state diagram of a bottling-lineline gate ready full valve line conveyorAutomatic Code Generation for PLC Controllers 311 The model defines the desired behavior of the bottling line. It implements a safety feature that the line is blocked until a manual intervention (confirmed by depressing of S), if the bottle on the scale platform was broken or the bottle-filling phase has not been finished within the period of ∆t2. The process of building the requirements speci-fication, safety analysis and the optimization of the model, has been described and discussed in detail in [7].4.2 Coding StatesThe algorithm for coding states in a hierarchical state diagram traverses the hierarchy in a top-down manner and assigns a separate group of flip-flops to code the sub-states of each super-state. This way, at least two flip-flops are needed to code the three states at the top level in Fig. 4, and the next two flip-flops are used to code the sub-states within the state Working. A selected coding of states is shown in Table 1.Table 1. The coding of states (flip-flops: M1, M2, M3, M4)M1 M2 M3 M4 Bottling line state0 0 Blocked1 0 0 0 Stopped1 0 0 1 Gate Open1 0 1 1 Moving1 0 1 0 Bottle Filling1 1 ∗∗SuspendedThere are six states at the lowest level of nesting shown explicitly in Fig. 4 and listed in Table 1. However, the history indicator adds an additional implicit memory of the former sub-states of the state Working that are to be re-entered from Suspended. Hence, there are in fact four sub-states nested in the state Suspended that correspond to sub-states of the state Working. These sub-states preserve the same coding of M3 and M4. The two transitions between Working and Suspended in Fig. 4 are then trans-formed into a set of four pairs of transitions between the corresponding sub-states. The semantics of history indicator and the transformation described above is defined formally in Sect. 4.3. One can note that the coding of states presented in Table 1 is more economical than the one-hot coding used routinely for hardwired controllers. 4.3 Formal ModelThere are nine states, sixteen input symbols and two timers in the finite state time ma-chine, which defines the semantics of the state diagram in Fig. 4. These sets together with the timer function and the transition function are defined below:S = { Blocked, Stopped, GateOpen, Moving, BottleFilling,Suspended-Stopped, Suspended-Open, Suspended-Moving, Suspended-Filling } Σ= { S⋅P⋅R⋅F , S⋅P⋅R⋅F , S⋅P⋅R⋅F , S⋅P⋅R⋅F , ..., S⋅P⋅R⋅F }Γ= { t1, t2 }τ : τ ( t1 )= (GateOpen,∆t1 ) τ ( t2 )= (BottleFilling,∆t2 )312 K. Sachaδ: δ (Blocked, S )= Stoppedδ (Stopped, P )= Suspended-Stoppedδ (Stopped, S ⋅ P ⋅ R )= GateOpen δ (GateOpen, P )= Suspended-Openδ (GateOpen, P, t 1 )= Suspended-Open δ (GateOpen, P, t 1 )= Movingδ (Moving, P )= Suspended-Movingδ (Moving, P ⋅ R )= BottleFilling δ (BottleFilling, P)= Suspended-Fillingδ (BottleFilling, P, t 2 )= Suspended-Filling δ (BottleFilling, P ⋅ R ⋅ F )= Stoppedδ (BottleFilling, P ⋅ R )= Blockedδ (BottleFilling, P, t 2 )= Blocked δ (Suspended-Stopped, P )= Stoppedδ (Suspended-Open, P )= GateOpenδ (Suspended- Moving, P )= Moving δ (Suspended-Filling, P )= BottleFillingIn all other cases δ (s, a)= s and δ (s, a, t)= s . These transitions are not shown in Fig4. The usual Boolean notation for the subsets of input symbols is used in the above definition of the function δ, e.g.: S ⋅ P ⋅ R represents the set { S ⋅ P ⋅ R ⋅ F , S ⋅ P ⋅ R ⋅ F }.4.4 Implementing TimersEach timer symbol of a finite state time machine is implemented within a PLC con-troller by a separate timer block of a ladder diagram. A timer block is a conceptual device that has one input signal, which can set (enable) the timer, and one output sig-nal. As long as the input signal equals 0, the timer is reset with the output equal to 0. When the input signal changes to 1, the timer is set and starts counting time. The out-put signal changes to 1 as soon as the input signal has continued to be 1 for a prede-fined period of time. Such type of a timer block is called a delay on make flip-flop .A Boolean condition that sets a timer depends on the coding of this state, which is assigned to the timer by the timer function. For example, timers t 1 and t 2 (See Sect.4.2), are assigned to states Gate Open and Bottle Filling , respectively. Hence, the conditions to set the timers can be read from Table 1:Each time the above two expressions are executed by a PLC, time is counted and the outputs of the timers are set appropriately.4.5 Implementing the Transition FunctionThe transition function of a finite state time machine defines conditions to set or reset flip-flops. It is implemented by a sequence of Boolean expressions that depend on the coding of states, input signals and timers.Consider the transition from Blocked to Stopped in Fig. 4, described formally as: δ (Blocked, = Stopped . The transition occurs in a state such that M1= 0 and M2= 0 (Table 1), when S = 0. After the transition has occurred, the state changes to the one, in which M1= 1 and M2= 0 and M3= 0 and M4= 0. So, the transition is implemented by setting M1 flip-flop and resetting M3, M4:M2M1S M4M2M1 S M3M2M1 S M1⋅⋅=⋅⋅=⋅⋅= Res Res Set M4M3M2M1t2 M4M3M2 M1 t1 ⋅⋅⋅=⋅⋅⋅=Set SetSimilarly, to implement the transition from Bottle Filling to Blocked one must reset M1 (M2 is reset in Bottle Filling , the values of M3 and M4 are insignificant). Hence:Boolean expressions that implement the other transitions by setting and resetting particular flip-flops can be defined similarly.In order to ensure the atomicity of transitions, a set of secondary flip-flops can be used, assigned on a one-to-one basis to the primary flip-flops that are used to encode the system states. The secondary flip-flops store the next state of the system, calcu-lated by the execution of Boolean expressions, until the computation of all the expres-sions has been finished. The next state is then converted into the current state by copying the state of secondary flip-flops to the primary flip-flops [6].There are four flip-flops in Table 1. Denote the secondary flip-flops: M11 … M14, respectively. A complete sequence of Boolean expressions that implement the transi-tion function can be defined as follows:It can be noted that the expressions to set timers have been placed in the sequence before the expressions that implement the transition function. A PLC controller sam-ples all the input signals at the beginning of each program cycle, before executing any Boolean expressions. This way the input signals are up-to-date, but stable during the entire program execution. The output of a timer can also be used as an input to ex-pressions. Therefore the timers are processed before the computation of expressions that implement the transition function can start.The functions can be minimized using the standard rules of Boolean algebra, e.g.: 4.6 Filling Up the State SpaceThe requirement for high dependability of a control program cannot be fulfilled with-out a planned reaction to faults that can develop during the program execution. M4M3M2M1t2P R P M1⋅⋅⋅⋅⋅+⋅=)( Res M4M M2M1P t2)R (M11⋅⋅⋅⋅⋅+=3 Res (b5)M14M4M13M3M12M2M11M1M2M1S M4M3M2M1R P M14M2M1S M4M M2M1F R P M13M2M1P M12M4M M2M1t2)P R P (M11M4M3M2M1R P S M14M M M2M1t1P M13M2M1P M12M2M1S M11M4M3M2M1t2 M4M3M2 M1 t1 ====⋅⋅+⋅⋅⋅⋅⋅=⋅⋅+⋅⋅⋅⋅⋅⋅=⋅⋅=⋅⋅⋅⋅⋅+⋅=⋅⋅⋅⋅⋅⋅=⋅⋅⋅⋅⋅=⋅⋅=⋅⋅=⋅⋅⋅=⋅⋅⋅= (d4) (d3) (d2) (d1)................................................... Res (b8)3 Res (b7) Res (b6)3 Res (b5)Set b4)(43Set (b3)Set )2b (Set (b1)Set (a2)Set (a1)。
摘要通过编写可编程控制器程序实现对饮料罐的自动灌装和手动灌装流程。
随时通过检测信号的导入控制传送带的运行(其中包括主传送带电机和次品传送带的运行),同时实现对灌瓶的计数,并区分出合格产品的数量。
其中在灌装过程中要准确的对空的饮料罐进行定位,灌装结束后,系统设备液位检测仪器对液位进行检测,生成的检测信号输入PLC,进行运行分析。
瓶子停顿时间为1秒,灌装时间为5秒,同时随时能手动对计数器进行复位操作,随时控制灌装流水线的运行。
并在此基础上,灌装结束后给饮料瓶贴上标签。
PLC选用日本三菱公司的FX2N系列。
关键词:三菱FX2NPL;MC,MCR主控指令;饮料灌装;液位检测AbstractProgrammable controller by writing programs to achieve the automatic filling of beverage cans and manual filling process. At any time by detecting the signal into control of the operation of conveyor belt (including the main conveyor belt motor and defective operation), while achieving a count of filling bottles, and to distinguish the number of qualified products.In the filling process in which the right to accurately locate the empty beverage cans, filling the end, the system equipment, liquid level instrumentation for liquid level detection, the generated test signal input PLC, to run the analysis.Pause time is 1 second bottle, filling time of 5 seconds, while the counter at any time can be reset manually at any time control the filling line operation.PLC selected Japan's Mitsubishi Corp. FX2N series.Key words: Mitsubishi FX2NPL; MC, MCR master directives; beverage filling; level detection.目录前言 (1)一、设计任务 (3)1、课题内容 (3)2、控制要求 (3)3、课题要求 (3)二、总体设计方案 (3)1、饮料灌装流水线的基本结构 (3)2、选择电器元件 (5)3、流水线灌装的工作原理 (7)4、系统流程图 (8)三、电气控制电路设计 (9)1.自动操作模式 (9)2.手动操作模式 (9)3.报警 (10)4.计数过程 (10)四、PLC设计 (10)1、选择PLC (10)2、I/O点的编号分配和PLC外部接线图 (11)3、控制面板图 (12)4、梯形图 (13)5、指令表 (15)五、调试过程及结果 (18)六、总结 (19)参考文献 (20)谢辞 (21)前言目前,饮料厂的自动化灌装生产线中已经有越来越多的机器在使用先进的灌装技术来提高机器的自动化控制水平和生产效率,而应用PLC完成电气部分的控制是工业自动化电气控制的主要发展方向。
摘要随着工业自动化水平日益提高,众多工业企业均面临着传统生产线的改造和重新设计问题。
PLC(可编程序控制器)是以微处理器为核心的工业控制装置,它将传统的继电器控制系统与计算机技术结合在一起,近年来在工业自动控制、机电一体化、改造传统产业等方面得到普遍应用。
作为通用工业控制计算机,其实现了工业控制领域接线逻辑到存储逻辑的飞跃,在世界工业控制中发挥着越来越重要的作用。
在饮料行业,自动化生产线的生产方式是推广的最普及的一种生产模式,它促使灌装的速度大幅提升,同时也使得灌装精度更高,给企业带来了不可小觑的生产力。
鉴于此,设计者利用PLC的功能和特点设计出了一款饮料灌装生产流水线控制系统。
本文所涉及的饮料灌装自动化生产线采用PLC控制,流量计计量,确保了灌装的速度和精度。
本文详细论述了饮料灌装机控制系统的设计步骤,通过对灌装机系统的充分了解,以行业现状为出发点,结合其他行业自动控制技术的应用情况,提出了基于PLC的饮料灌装机控制系统的基本结构。
本系统设计中完成了饮料灌装机控制系统的硬件的配置和软件方面的设计,实现了饮料灌装机控制系统的自动化。
对劳动生产率的提高,对饮料的质量和产量的提高都具有深远的意义。
利用PLC控制饮料灌装生产过程,可有效提高灌装生产效率,并显著增加控制系统的可靠性和柔性。
关键词:可编程控制器;自动化;灌装;生产线AbstractWith the increasing level of industrial automation, many industrial enterprises are faced with the transformation of traditional production line and re-design problem. PLC (programmable logic controller) is a microprocessor as the core of industrial control devices, it will relay the traditional control system combined with computer technology in recent years in industrial automation, mechanical and electrical integration, the transformation of traditional industries such as generally applied. As a general-purpose industrial control computer, the realization of industrial control wiring logical leap in logic to storage, industrial control in the world is playing an increasingly important role. In beverage industry, automated production line mode of production is to promote the most popular a kind of production mode, it causes the filling speed increases, but make the filling a higher precision, to bring enterprise cannot small gaze of productivity. In view of this, the designers of the use of PLC functions and features designed a beverage filling production line control system.This paper involves the drinks filling automation production line adopts PLC control, flow meter metering, insure the filling speed and precision.This paper describes in detail the control system of the drinks filling machine design steps, a brief introduction of the drinks filling machine control system and base on the self-industry and the application of the other trade on auto-control technique, proposed the frame of the control system based on programmable logical controller. This design completes the drinks production line hardware configuration and software design, to a chieve the automation of the carbonated drinks filling machine. Not only improve the labor productivity, but also has far-reaching significance of the improvement of quality and yield.PLC control of the use of beverage filling production process, which can effectively improve the production efficiency of filling, and significantly increase the reliability of control systems and flexible. Keywords: Programmable controller;Automation;Filling;Production line目录摘要 (I)ABSTRACT ................................................................................................................. I I 前言 .. (1)1.概述 (2)1.1概论 (2)1.2设计任务与要求 (3)1.3相关预备知识 (3)1.3.1 PLC的定义 (3)1.3.2 PLC的基本组成 (3)1.3.3 PLC的功能与特点 (4)1.3.4 PLC的应用范围 (4)1.4总体方案设计 (5)2.系统机械结构设计 (7)2.1电机的选择 (7)2.1.1 丝杠电机的选择 (7)2.1.2 传送带电机的选择 (10)2.2滚珠丝杠副的计算 (11)2.2.1 最大工作载荷F m的计算 (11)2.2.2 最大动载荷C的计算 (11)2.2.3 额定动载荷C a的校核 (11)2.2.4 刚度的验算 (12)2.3滚动轴承的选择 (12)2.3.1 丝杠滚动轴承的选择 (13)2.3.2 滚筒滚动轴承的选择 (13)2.4联轴器的选择 (14)2.4.1 传送带电机联轴器的选择 (14)2.4.2 丝杠电机联轴器的选择 (14)2.5灌装机储液箱的尺寸确定 (14)3.电气控制系统硬件设计 (15)3.1总体方案分析 (15)3.2控制系统的I/O点及地址分配 (15)3.2.1 输入信号I/O点地址分配 (15)3.2.2 输出信号I/O点地址分配 (16)3.3电气元件选型 (17)3.3.1 PLC的选型 (17)3.3.2 断路器的选型 (17)3.3.3 接触器的选型 (18)3.3.4 行程开关的选型 (18)3.3.5 光电传感器的选型 (18)3.3.6 流量计的选型 (19)3.3.7 电磁阀的选型 (19)3.4电气控制系统原理图 (20)3.4.1 电气原理图总体设计 (20)3.4.2 传送带电机接线图 (20)3.4.3 丝杠电机接线图 (21)3.4.4 电磁阀接线图 (22)3.4.5 控制系统接线图 (22)4.电气控制系统软件设计 (23)4.1STEP7-M ICRO/WIN软件介绍 (23)4.2电气控制系统程序设计 (25)4.2.1 电气控制系统流程图 (25)4.2.2 传送带前进 (26)4.2.3 光电传感器开始计瓶数 (27)4.2.4 喷口下压 (28)4.2.5 系统开始进行灌装 (29)4.2.6 喷口上抬 (30)4.3PLC程序调试 (31)4.3.1 调试思路 (31)4.3.2 调试结果 (31)总结与体会 (34)致谢 (35)参考文献 (36)附录:系统程序梯形图 (37)前言工业现代化的进程,对生产过程的自动控制和信息通信提出了更高的要求。