吉林建筑大学城建学院电气信息工程系课程设计目录摘要·············································································································IABSTRACT···································································································II第1章绪论································································································11.1设计目的··························································································11.2设计的主要内容················································································1第2章PLC的结构及设计原理·····································································12.1PLC的结构·······················································································12.2PLC的分类·······················································································22.3PLC的工作原理················································································22.4PLC设计交通灯所用指令介绍····························································3第3章程序编写···························································································53.1控制要求··························································································53.2依据要求画时序图············································································63.3交通灯程序图····················································································7程序调试······································································································10结论···········································································································11致谢···········································································································12参考文献·································································································13吉林建筑大学城建学院电气信息工程系课程设计第I页共II页本次课程设计主要能完成:用PLC进行编程完成交通十字路口红绿灯的设计,控制对象:南北主干道和东西主干道各有六个交通灯,其中左转有红、黄、绿三个;直行有红、黄、绿三个;南北人行道和东西人行道各有红、黄、绿三个交通灯。先根据要求画出时序图,再利用CX-Programmer软件进行编程,并用MicrosoftOfficeVisio2003软件画出模拟现场十字交通路口,使编程更容易让人接受看懂。应用PLC可编程技术,是因为现今很多工程已经运用了PLC来设计程序,可编程控制器(PLC)以微处理器为核心,普遍采用继电接触器控制系统的梯形图语言进行程序设计,编程容易,功能扩展方便,修改灵活,而且结构简单,抗干扰能力强。欧姆龙可编程控制器指令丰富,可以接各种输出、输入扩充设备,有丰富的特殊扩展设备,其中的模拟输入设备和通信设备更是符合交通灯控制系统的要求与特点,能够方便地联网通信。关键字:交通灯;梯形图;梯形图吉林建筑大学城建学院电气信息工程系课程设计第II页共II页ABSTRACTThecurriculumdesignismainlytocompletethetrafficintersectiontrafficlightsdesign,controlobject:Northandsouthmainroadsandtrunkroad,therearesixtrafficlights,whichturnleftturnred,yellow,greenthree;straightlineisred,yellow,greenthree;NorthandWestRoadandEastandWestarered,yellow,greenthreetrafficlights,andCX-Programmersoftwarefortheprogramming,andOfficeVisioMicrosoft2003softwaretomakeprogrammingmoreeasytounderstand.ThereasonwhytheapplicationofPLCtechnology,becausemanyprojectshavebeenusingPLCtodesignprocedures,becausetheprogrammablecontroller(PLC)tothecoreofthesystem,thegeneraluseoftherelaycontactorcontrolsystembasedontheelectricalschematicdiagramoftheprogramdesign,easytoextend,easytoexpand,flexible,andsimplestructure,stronganti-interferenceability.SIEMENSprogrammablecontrollerinstructionisrich,canbeconnectedtoavarietyofoutput,inputexpansionequipment,awealthofspecialequipment,inwhichtheanaloginputdevicesandcommunicationsequipmentisinlinewiththerequirementsoftrafficlightcontrolKeywords:Trafficlight;Technology;Ladderdiagram吉林建筑大学城建学院电气信息工程系课程设计第1页共14页第1章绪论在十字路口设置交通灯可以对交通进行有效的疏通,并为交通参与者的安全提供了强有力的保障。但是随着社会、经济的快速发展,原先的交通灯控制系统已经不能适应现在日益繁忙的交通状况。如何改善交通灯控制系统,使其适应现在的交通状况,成为研究的课题。由于PLC具有对使用环境适应性强的特性,同时其内部定时器资源十分丰富,可对目前普遍使用的“渐进式”信号灯进行精确控制,特别对多岔路口的控制可方便地实现。因此值得研究将PLC应用于交通灯系统中。1、按要求画出各时间段交通灯的时序图。2、CX-Programmer软件进行此次交通红绿灯课题设计的编程3、通过此次课程设计掌握低压电器和可编程控制器设计的相关知识。1.3设计要求1、正常循环按下启动按钮,交通灯开始工作,先亮南北方向绿灯和东西方向红灯,主干道南北方向左转绿灯亮10S,黄灯亮2S后红灯亮;左转绿灯灭的同时直行绿灯亮,持续30S,绿灯闪亮3S,黄灯亮2S后,红灯亮。当南北主干道红灯全亮时,东西主干道按照南北主干道相同的规律依次点亮左转和直行方向灯。人行道上的红、黄和绿灯与同方向主干道上的直行灯运行方式相同。2、急车强制通过控制急车的强通受强通开关控制。无急车时,按正常循环运行,又急车来时,打开急车强通开关,不管原来信号灯的状态,一律让急车来车方向的绿灯亮,直到急车通过,断开急车强通开关,信号的状态立即转为急车放行方向的绿灯闪亮3S,随后按正常时序控制。第2章PLC的结构及设计原理2.1PLC的结构吉林建筑大学城建学院电气信息工程系课程设计第2页共14页PLC实质是一种专用于工业控制的计算机其硬件结构基本上与微型计算机从结构上分,PLC分为固定式和组合式(模块式)两种。固定式PLC包括CPU板、I/O板、显示面板、内存块、电源等,这些元素组合成一个不可拆卸的整体。模块式PLC包括CPU模块、I/O模块、内存、电源模块、底板或机架,这些模块可以按照一定规则组合配置。图2-1PLC的基本结构框图2.2PLC的分类1、按PLC的结构形式分类:①整体式;②模块式。2、按PLC的I/O点数分类:①小型256点以下;②中型256点以上,2048点以下;③大型2048点以上。3、按PLC功能分类:抵挡型,中挡型,高档型。2.3PLC的工作原理1.PLC的工作方式1、输入采样阶段,在此阶段,顺序读入所有输入缎子通断状态,并将读入的信息存入内存,接着进入程序执行阶段,在程序执行时,即使输入信号发生变化,内存中输入信息也不变化,只有在下一个扫描周期的输入采样阶段才能读入信息。2、程序执行阶段:PLC对用户程序扫描。吉林建筑大学城建学院电气信息工程系课程设计第3页共14页图2-1PLC的扫描工作过程图图2-2PLC的扫描周期图3、输出刷新阶段:当扫描用户程序结束后,PLC就进入输出刷新阶段。在此期间,CPU按照I/O映象区内对应的状态和数据刷新所有的输出锁存电路,再经输出电路驱动相应的外设,当所有指令执行完毕通过隔离电路,驱动功率放大器,电路是输出端子向外界输出控制信号驱动外部负载。2.4PLC设计交通灯所用指令介绍1、LD、OUT指令LD(Load):LD指令(叫做取指令)适用于梯形图中与左母线相连的第一个常开接点,表示一个逻辑的开始。OUT(Out):线圈驱动指令(又叫输出指令)适用于将运算结果驱动输出继电器、辅助继电器、定时器、计数器、状态继电器和功能指令线圈,但不能用与输入继电器。OUT指令用于继电器和定时器时必须有常值K紧随K分别表示定时器的定时时间或计数器的计数次数,它也作为一个步序。图2-3LD及OUT指令符号吉林建筑大学城建学院电气信息工程系课程设计第4页共14页2、ANI、AND指令AND(And):AND指令(叫与指令)适用于和接点串联的常开接点。ANI(AndInverse):本指令(叫与反指令)适用于和接点串联的常闭接点。图2-4AND及ANI指令符号3、OR、ORI指令OR(Or):这条指令(叫或指令)适用于和接点并联的常开接点。ORI(OrInverse