资源描述
自动装料卸料演示设计
一、课题设计目的
本课题设计通过生活中的一个较简单的工作过程,如何进行系统的分析它的工作流程,画出主电路原理图、PLC端子分配图、状态转移图,在三菱FX2N系列编程平台上编梯形图、软仿真、调试;同时学习了用上位机组态软件根据题目要求设计合理的监控界面、脚本程序、变量的链接、数据的通信与交换方式等等。
这样就有PLC的软硬件设计和上位机的监控程序设计,形成了一个完整的监控系统。
二、课题内容及要求
设计:小车在S1、S2间作往复运动,由M1拖动。小车在S1点加入物料(由电磁阀YV控制),时间10S。小车装完料后从S1点运动到S2点,由电机M2带动小车倾倒物料,时间3S,然后M2断电,车斗复原。小车在M1的拖动下运动退回S1点,再次循环。小车每循环3次后,要求停30秒后再开始工作。要求根据工作示意图,画出端子分配图、梯形图和主电路图。如果采用经验设计法,要求画出工作流程图;如果采用顺序控制方法,要求画出状态转移图。项目示意图见图2.1。
图2.1 项目示意图
三、课题设计仪器、设备及材料
由三菱FX2N可编程控制器及其编程软件、MCGS组态软件通用版、模拟版、计算机等组成设计平台。
四、课题设计原理
1、MCGS组态软件功能
1.1 MCGS组态软件的整体结构
MCGS 5.5软件系统包括组态环境和运行环境两个部分。MCGS组态环境是生成用户应用系统的工作环境,由可执行程序McgsSet.exe支持,其存放于MCGS目录的Program子目录中。组态环境:
组态生成
应用系统
运行环境:
解释执行
组态结果
组态结果
数据库
图4.1组态软件整体结构
用户在MCGS组态环境中完成动画设计、设备连接、编写控制流程、编制工程打印报表等全部组态工作后,生成扩展名为.mcg的工程文件,又称为组态结果数据库,其与MCGS 运行环境一起,构成了用户应用系统,统称为“工程” 。
MCGS运行环境是用户应用系统的运行环境,由可执行程序McgsRun.exe支持,其存放于MCGS目录的Program子目录中。在运行环境中完成对工程的控制工作。组态软件整体结构见图4.1。
主控窗口
设备窗口
用户窗口
实时数据库
运行策略
MCGS工控组态软件
菜单设计
设置工程属性
设定存盘结构
添加工程设备
连接设备变量
注册设备驱动
创建动画显示
设置报警窗口
人机交互界面
定义数据变量
编写控制流程
使用功能构件
1.2 MCGS组态软件五大组成部分见图4.2:
图4.2 组态软件五大组成部分
1.3基于MCGS可完成以下工作:
Ø 建立一个新工程
Ø 设计画面流程
Ø 定义数据变量
Ø 进行动画连接
Ø 添加模拟设备,使整个画面能模拟运行。
2、编制“装料卸料演示设计”的PLC控制程序,使之能够完成课题设计要求。
3、通过连接MCGS和PLC,完成整体的监视和控制功能。
MCGS组态软件与外部设备的通讯:MCGS通过设备驱动程序与外部设备进行数据交换。包括数据采集和发送设备指令。设备驱动程序是由VB、VC程序设计语言编写的DLL(动态连接库)文件,设备驱动程序中包含符合各种设备通讯协议的处理程序,将设备运行状态的特征数据采集进来或发送出去。MCGS负责在运行环境中调用相应的设备驱动程序,将数据传送到工程中的各个部分,完成整个系统的通讯过程。每个驱动程序独占一个线程,达到互不干扰的目的。
本设计需要利于MCGS中FX2N的驱动程序进行设备的通道连接,使组态软件与PLC相联系。
五、主要设计重点、难点
PLC程序的模块化设计,MCGS的动画制作、脚本程序,上位机与PLC的综合调试。
六、课题设计步骤
1、PLC系统设计:
1.1首先根据工作过程,分析主要有哪几步组成,然后画出工作流程图见图6.1
图6.1工作流程图
1.2根据工作过程分析I/O信号,画出I/O分配表见图6.2和PLC端子分配图见图6.3。
输入I信号:启动SB1(X0),停止信号X3,左限位开关S1(X1),右限位开关S2(X2);
输出O信号:装料Y0(由电磁阀YV控制),由电动机M1控制的右行出发KM1(Y1)和卸料返回KM2(Y2),由电机M2控制的卸料KM3(Y3)。
图6.2 I/O分配表
图6.3 PLC端子分配图
1.3根据要求设计主电路图见图6.4
要求小车右行和返回由电动机M1控制,小车倾倒物料由电动机M2控制,因此主电路就需要两台电机的正反转电路。
图6.4 主电路图
1.4这里采用顺序控制法设计比较简单,根据设计要求画出状态转移图见图6.5
图6.5 状态转移图
1.5为了达到更好的设计效果,丰富上位机动画效果和画面,必须要有必要的中间变量来实现设计,编程中用到的中间变量功能用途表见图6.6
图6.6 中间变量功能用途表
1.6编写梯形图如下:
2、上位机MCGS监控系统的设计
2.1设计“自动装料卸料演示设计”监控画面组态图见图6.7
图6.7 监控画面组态图
首先在用户窗口,点新建窗口,生成窗口0,在窗口0属性中重命名为装料卸料组态,选择背景颜色为绿色,然后在工具条中点工具箱选择图中需要的元件组态即可。
2.2在实时数据库中新增所有需要的数据对象,并定义数据变量的名称、类型、初始值和数值范围等等,必要时可以添加注释。实时数据库见图6.8
图6.8 实时数据库
2.3 窗口、实时数据库和PLC三者建立链接:将用户窗口中图形对象与实时数据库中的数据对象建立相关性链接,再通过设置通道与PLC三者建立链接,并设置相应的动画属性。在系统运行过程中,图形对象的外观和状态特征,由数据对象的实时采集值驱动,从而实现了图形的动画效果。窗口、实时数据库和PLC三者链接关系见图6.9
图6.9窗口、实时数据库和PLC三者链接关系
2.4编写必要的脚本程序,使动画更加丰富、形象和达到设计的需要,所以一般上位机组态当中脚本程序是必须的。
双击运行策略进入循环策略,由循环策略进入策略组态,在策略组态的工具栏中点策略工具箱和新增策略行,从策略工具箱中选择脚本程序拖到新增策略框中,策略工具箱见图6.10,策略组态见图6.11
图6.10策略工具箱
图6.11 策略组态
双击策略组态的脚本程序进行编写,本设计的脚本程序如下:
IF 车1<=0 THEN %当车1的位置小于等于0时,左限位开关等于1,
M1=1 即左限位开关压合。
ENDIF
IF 车1>0 THEN %当车1的位置大于0时,左限位开关等于0,即
M1=0 左限位开关打开。
ENDIF
IF Y1=1 THEN %当输出信号Y1等于1时,车1开始以一定
车1=车1+10 速度前进。
ENDIF
IF 车1>=720 THEN %当车1的位置大于等于720时,右限位开关等
M2=1 于1,即右限位开关压合。
ENDIF
IF 车1<720 THEN %当车1的位置小于720时,右限位开关等于0,
M2=0 即左限位开关打开。
ENDIF
IF 车1>=780 THEN %当车1的位置大于等于780时,车1的位置
车1=770 被默认到位置770。
ENDIF
IF Y2=1 THEN %当输出信号Y2等于1时,车1开始以一定
车1=车1-10 速度后退。
ENDIF
IF 车1<=0 THEN %当车1的位置小于等于0时,车1的位置被默
车1=0 认到位置0。
ENDIF
2.5进行设备组态:首先进入设备窗口,双击进入设备组态,在设备组态的工具栏选设备工具箱,在工具箱中选则通用串口父设备和三菱FX-232,生成设备组态中的通用串口父设备0和设备0,设备组态图见图6.12
图6.12 设备组态图
双击生成的通用串口父设备0,进入通用串口属性编辑的基本设置,通用串口设备设置见图6.13
图6.13通用串口设备设置
双击生成的设备0,在设备0的设备属性设置中对基本属性和通道连接进行设置。
点击基本属性中的内部属性,后再点击设置设备内部属性右端生成的省略号,生成三菱-FX232通道属性设置,点击增加通道,设置需要的通道类型、通道地址、连续通道个数、数据位的位数、操作方式,输出Y0的设置见图6.14
图6.14输出Y0的设置
注:中间继电器M的设置同上在此省略,数据寄存器D的设置见图6.15
图6.15 数据寄存器D的设置
最终的通道属性设置结果见图6.16
图6.16 通道属性设置结果
最后对设备属性设置中的通道链接进行设置,左键点击通道连接后,进如通道连接设置,使对应数据对象和通道类型匹配,例如数据对象Y0对应读写Y0、数据对象M0对应读写M0、数据对象D0对应读WB0,总之有多少项,就要有多少对应数据对象。通道链接设置结果见图6.17
图6.17 通道链接设置结果
2.6将所建立的工程存盘,并运行该工程:
上位机监视PLC的运行:按下可编程控制器模拟版的启动按钮X0,观看上位机中的监控画面的动画效果是否与按照PLC的输出同步进行:按下模拟版的停止按钮X3,观察上位机中的监控画面是否停止工作。
上位机控制PLC的运行:通过监控画面中的启动、停止按钮控制PLC的工作,观察PLC是否正常工作。
如果有问题,调试程序或上位机监控画面直到达到满意的效果。
七、课题设计的总结
1对设计的小结:这个课题设计通过生活中常见的一个较简单工作实例,由分析工作过程,从设计PLC程序,到对上位机监控画面的设计,再到PLC与监控画面的联机调试,这样一步步的扩展开,最终实现了一个完整的监控系统。
2对设计的收获与体会:在整个设计过程中,虽然是一个较简单的监控画面,但是它基本包括了设计一个监控系统的方方面面,很庆幸在恩师的帮助和指导下,独立完成了从PLC控制系统的设计,到上位监控界面的设计,听从了恩师的建议,同时也加入了自己的设计想法,通过这次设计极大的增强了本人对学习工控领域的信心,相信任何复杂的工程设计,都是由小块较简单的组成较复杂的庞大工程,只要肯钻研和勤奋,最终会一块一块地解决,直到解决所有问题。
3对设计的进一步完善提出建议:PLC设计程序还不够理想,比如急停设计的不够;也没有自动和手动程序的切换,只有自动程序;上位监控系统界面在下料结束后,让小车再动,这样显得更形象,可以通过修改梯形图来实现;同样在小车运料过程中,不能看到小车里的料,如果能看到运送的料,那么动画会更好一些,这个可以通过增加脚本程序和改进动画实现,不过有一定的难度。
八、参考文献
[1] 廖常初.FX系列PLC编程及应用[M].机械工业出版社,2007.07.
[2] 郑萍. 现代电气控制技术[M].重庆:重庆大学出版社,2001.12
[3] 吴作明.工业组态软件与PLC应用技术[M]. 北京:北京航空航天大学出版社,2007.01.
[4] 岳庆来. 变频器、可编程控制器及触摸屏综合应用技术. 机械工业出版社,2006.05.
[5] 郑萍. 可编程控制器原理及应用实验指导书[M].西华大学出版,2007.05.
请删除以下内容,O(∩_∩)O谢谢!!!conduction, transfer of heat or electricity through a substance, resulting from a difference in temperature between different parts of the substance, in the case of heat, or from a difference in electric potential, in the case of electricity. Since heat is energy associated with the motions of the particles making up the substance, it is transferred by such motions, shifting from regions of higher temperature, where the particles are more energetic, to regions of lower temperature. The rate of heat flow between two regions is proportional to the temperature difference between them and the heat conductivity of the substance. In solids, the molecules themselves are bound and contribute to conduction of heat mainly by vibrating against neighboring molecules; a more important mechanism, however, is the migration of energetic free electrons through the solid. Metals, which have a high free-electron density, are good conductors of heat, while nonmetals, such as wood or glass, have few free electrons and do not conduct as well. Especially poor conductors, such as asbestos, have been used as insulators to impede heat flow (see insulation). Liquids and gases have their molecules farther apart and are generally poor conductors of heat. Conduction of electricity consists of the flow of charges as a result of an electromotive force, or potential difference. The rate of flow, i.e., the electric current, is proportional to the potential difference and to the electrical conductivity of the substance, which in turn depends on the nature of the substance, its cross-sectional area, and its temperature. In solids, electric current consists of a flow of electrons; as in the case of heat conduction, metals are better conductors of electricity because of their greater free-electron density, while nonmetals, such as rubber, are poor conductors and may be used as electrical insulators, or dielectrics. Increasing the cross-sectional area of a given conductor will increase the current because more electrons will be available for conduction. Increasing the temperature will inhibit conduction in a metal because the increased thermal motions of the electrons will tend to interfere with their regular flow in an electric current; in a nonmetal, however, an increase in temperature improves conduction because it frees more electrons. In liquids and gases, current consists not only in the flow of electrons but also in that of ions. A highly ionized liquid solution, e.g., saltwater, is a good conductor. Gases at high temperatures tend to become ionized and thus become good conductors (see plasma), although at ordinary temperatures they tend to be poor conductors. See electrochemistry; electrolysis; superconductivity. Almost everyone has experienced the Doppler effect, though perhaps without knowing what causes it. For example, if one is standing on a street corner and an ambulance approaches with its siren blaring, the sound of the siren steadily gains in pitch as it comes closer. Then, as it passes, the pitch suddenly lowers perceptibly. This is an example of the Doppler effect: the change in the observed frequency of a wave when the source of the wave is moving with respect to the observer. The Doppler effect, which occurs both in sound and electromagnetic waves—including light waves—has a number of applications. Astronomers use it, for instance, to gauge the movement of stars relative to Earth. Closer to home, principles relating to the Doppler effect find application in radar technology. Doppler radar provides information concerning weather patterns, but some people experience it in a less pleasant way: when a police officer uses it to measure their driving speed before writing a ticket. Sound and light are both examples of energy, and both are carried on waves. Wave motion is a type of harmonic motion that carries energy from one place to another without actually moving any matter. It is related to oscillation, a type of harmonic motion in one or more dimensions. Oscillation involves no net movement, only movement in place; yet individual points in the wave medium are oscillating even as the overall wave pattern moves. The term periodic motion, or movement repeated at regular intervals called periods, describes the behavior of periodic waves—waves in which a uniform series of crests and troughs follow each other in regular succession. A period (represented by the symbol T ) is the amount of time required to complete one full cycle of the wave, from trough to crest and back to trough. Period is mathematically related to several other aspects of wave motion, including wave speed, frequency, and wavelength. Frequency (abbreviated f ) is the number of waves passing through a given point during the interval of one second. It is measured in Hertz (Hz), named after nineteenth-century German physicist Heinrich Rudolf Hertz (1857-1894), and a Hertz is equal to one cycle of oscillation per second. Higher frequencies are expressed in terms of kilohertz (kHz; 103 or 1,000 cycles per second); megahertz (MHz; 106 or 1 million cycles per second); and gigahertz (GHz; 109 or 1 billion cycles per second.) Wavelength (represented by the symbol λ, the Greek letter lambda) is the distance between a crest and the adjacent crest, or a trough and an adjacent trough, of a wave. The higher the frequency, the shorter the wavelength. Amplitude, though mathematically independent from the parameters discussed, is critical to the understanding of sound. Defined as the maximum displacement of a vibrating material, amplitude is the "size" of a wave. The greater the amplitude, the greater the energy the wave contains: amplitude indicates intensity, which, in the case of sound waves, is manifested as what people commonly call "volume." Similarly, the amplitude of a light wave determines the intensity of the light. electromagnetic radiation,energy radiated in the form of a wave as a result of the motion of electric charges. A moving charge gives rise to a magnetic field, and if the motion is changing (accelerated), then the magnetic field varies and in turn produces an electric field. These interacting electric and magnetic fields are at right angles to one another and also to the direction of propagation of the energy. Thus, an electromagnetic wave is a transverse wave. If the direction of the electric field is constant, the wave is said to be polarized (see polarization of light). Electromagnetic radiation does not require a material medium and can travel through a vacuum. The theory of electromagnetic radiation was developed by James Clerk Maxwell and published in 1865. He showed that the speed of propagation of electromagnetic radiation should be identical with that of light, about 186,000 mi (300,000 km) per sec. Subsequent experiments by Heinrich Hertz verified Maxwell's prediction through the discovery of radio waves, also known as hertzian waves. Light is a type of electromagnetic radiation, occupying only a small portion of the possible spectrum of this energy. The various types of electromagnetic radiation differ only in wavelength and frequency; they are alike in all other respects. The possible sources of electromagnetic radiation are directly related to wavelength: long radio waves are produced by large antennas such as those used by broadcasting stations; much shorter visible light waves are produced by the motions of charges within atoms; the shortest waves, those of gamma radiation, result from changes within the nucleus of the atom. In order of decreasing wavelength and increasing frequency, various types of electromagnetic radiation include: electric waves, radio waves (including AM, FM, TV, and shortwaves), microwaves, infrared radiation, visible light, ultraviolet radiation, X rays, and gamma radiation. According to the quantum theory, light and other forms of electromagnetic radiation may at times exhibit properties like those of particles in their interaction with matter. (Conversely, particles sometimes exhibit wavelike properties.) The individual quantum of electromagnetic radiation is known as the photon and is symbolized by the Greek letter gamma. Quantum effects are most pronounced for the higher frequencies, such as gamma rays, and are usually negligible for radio waves at the long-wavelength, low-frequency end of the spectrum.
展开阅读全文