PLC CIMS Lab. 2012.04.13. PLC ? PLC 기대효과 The Changes of Control System • 기계적 제어 방식 – 링크, 레버, 캠 – 자동선반, 방적기, 인쇄기 – 동작제어 확실 / 마모, 원가과다, 변경 곤란 • 유체적 제어방식 – 공기압, 유압을 이용한 제어 – 느린 스위칭, 크기 문제 • 전기적 제어 방식 – – – – – 전기 에너지를 이용 유접점(릴레이), 무접점(로직?) 시퀀스 방식 단순, 저렴, 빠른 동작 속도, 수명이 길다, 소형, 낮은 소비전력 But 하드 와이어드(Hard Wired) 로직 : 납땜, 배관, 절단 필요 소프트 와이어드 로직 : PLC ! 3/32 What is PLC? • PLC (Programmable Logic Controller) – A digital electronic device that uses a programmable memory to store instructions and to implement specific functions such as logic, sequence, timing, counting and arithmetic to control machines and processes* – 각종 제어반에서 사용하던 릴레이, 타이머, 카운터 등의 기능을 반도체 소자인 IC 등으로 대체한 일종의 마이크로 컴퓨터(μ-com) – 논리적 프로그램을 통한 시스템 제어 4/32 *A definition by NEMA(National Electrical Manufacturing Association) What is Relay, Timer, Counter..Etc? • 조작용 기기 – 누름버튼 스위치(Push Button Switch) – 유지형 스위치 누름 버튼 스위치 토글 스위치 셀렉터 스위치 5/32 What is Contact? • 접점(Contact) – – – – 전류를 통전(ON) 또는 단전(OFF)시키는 역할을 하는 점 a접점 : 초기상태에서 고정접점과 가동접점이 떨어져 있는 접점 b접점 : 초기상태에서 고정 접점과 가동접점이 접촉되어 있는 접점 c접점 : a접점과 b접점이 공통의 가동접점을 공유. 전환접점 6/32 What is Relay, Timer, Counter..Etc?(cont.) • 검출용 기기 – 마이크로 스위치 • 외력이용 – 리밋 스위치 – 근접 스위치 • 코일 인덕턴스 및 캐퍼시티 변화 이용 – 광전 센서 리밋 스위치 광전센서 근접 스위치 활용 7/32 What is Relay, Timer, Counter..Etc?(cont.) • 신호처리기 – 릴레이(relay) : 전자코일에 전원을 걸어 가동철편을 움직여 접점을 개폐. 계전기(繼電器) • 분기, 증폭, 변환, 반전, 메모리 기능 수행 릴레이(외형) 릴레이의 구조 8/32 What is Relay, Timer, Counter..Etc?(cont.) • 신호처리기(cont.) – 타이머(timer) : 입력 신호가 주어지고 일정 시간이 경과한 후 접점을 ON 또는 OFF시킴 – 카운터(counter) : 입력 신호 여부에 따라 수를 계수하는 기기 • 가산식(0부터 시작), 감산식(소정의 수치로부터 감소), 가감산식 • 표시 · 경보기기 – 표시등 – 발광다이오드(LED) 타이머(카운터 겸용) 표시등 발광다이오드 9/32 Remind : What is PLC? • PLC (Programmable Logic Controller) – A digital electronic device that uses a programmable memory to store instructions and to implement specific functions such as logic, sequence, timing, counting and arithmetic to control machines and processes* – 각종 제어반에서 사용하던 릴레이, 타이머, 카운터 등의 기능을 반도체 소자인 IC 등으로 대체한 일종의 마이크로 컴퓨터(μ-com) – 논리적 프로그램을 통한 시스템 제어 10/32 *A definition by NEMA(National Electrical Manufacturing Association) What is PLC made of? • PLC의 구조 – – – – 제어 연산부(CPU) 메모리부(RAM, ROM) 입력부 : CPU가 처리할 수 있는 신호로 변환 출력부 : 연산 결과에 따라 대상물 작동, 데이터 전송 PLC의 구조 11/32 What is Sequence Diagram? • 시퀀스도(Sequence Diagram) – 시퀀스 제어시스템을 도면화 한 것 • 릴레이 논리도 – 릴레이, 접점과 같은 각종 시퀀스 기호를 사용하여 회로를 표현 릴레이 논리도 – 자기 유지 회로 릴레이 논리도 – 지연 회로 12/32 RL: relay, PB: push button M: Motor, MC: electromagnetic contactor, R,S,T: 삼상제어를 의미 THR: thermal relay What is Ladder Diagram? • 래더선도(Ladder Diagram: LD) – 코일이나 점접 등을 그래픽 기호로 표시하고 사다리꼴 모양으로 프로그 램을 표현하는 방법 – 릴레이 논리도와 유사 – 모선(line)과 가로줄(lung)로 구성 – 접점과 코일만을 입력과 출력 장치로 표시 동 작 의 흐 름 Input/ a normally open contact Output Input/ a normally closed contact Output 신호의 흐름 Series Parallel Output PLC의 구조 래더 다이어그램 13/32 PLC Programming (2) Logic Instruction* Texas Instruments Mitsubishi A series Mnemonic Action Mnemonic Action STR Store (start a new rung of a ladder diagram) Output Series components Parallel components Inverse action (used in conjunction with other instructions to invert their function, e.g. ANDNOT = NAND function. LD Start rung with an open contact Output Series elements Parallel elements As for NOT, eg; ORI meaning NOR function OUT AND OR NOT OUT AND OR ..I ORB Or together parallel branches ANB And together series circuit blocks Table 1 Typical logic instruction sets 14/23 *An example from class material What is Ladder Diagram?(cont.) • LD로 작성된 프로그램은 IL(Instruction List: 어셈블리 언어 형 태의 언어)로 변환되어 진다 1. LD X400 2. OR Y430 3. 4. 5. 6. ANI X401 OUT Y430 OUT Y431 END start a rung with a normally open contact connect a normally open contact (associated with output Y430) in parallel connect a normally closed contact in series drive an output channel drive another channel end of program - return to start 15/32 What is Time Chart? • 타임차트(Time Chart) – 회로를 구성하는 요소들의 전류 흐름 여부에 따른 상호관계를 시간에 대 하여 표시 • 진리표(Truth Table) – 타임차트를 단순화 하여 부울(Boolean)논리로 나타낸 것 릴레이 회로도 16/32 PLC Programming : Scenario 1 • Input : 3개의 토글 스위치(I:0/0, I:0/1, I:0/2) • Output : 빨간등(O:0/0), 노란등(O:0/1), 파란등(O:0/2) Buzzer(O:0/7) • Rules – – – – – 모든 스위치가 꺼져 있으면 파란등 켜짐 (O:0/2) 첫 번째 스위치 켜지면 노란등 켜짐 (O:0/1) 두 번째 스위치도 켜지면 빨간등 켜짐 (O:0/0) 두 번째 스위치까지 켜진 상태가 5초 유지되면 buzzer 울림 (O:0/7) 첫 번째 스위치 꺼진 상태에서 나머지 스위치가 켜지면 빨간등 (O:0/0) 과 buzzer (O:0/0) – 첫 번째 스위치 3번 켜지면 빨간등 켜짐 (O:0/0) 17/32 PLC Programming : Scenario 1(cont.) 18/32 PLC Programming : Scenario 2 • Input : 3개의 토글 스위치(I:0/0, I:0/1, I:0.2) 3개의 센서(I:0/5, I:0/6, I:0/7) • Output : 모터의 움직임(O:0/5, O:0/6) • Rules – – – – 첫 번째 스위치 켜지면 모터 오른쪽으로 이동 (O:0/5) 오른쪽 끝까지 이동하면 센서(I:0/5)가 위치 감지하여 정지 두 번째 스위치 켜지면 모터 왼쪽으로 이동 (O:0/6) 왼쪽 끝까지 이동하면 센서(I:0/6) 가 위치 감지하여 2초 후 정지 – 모터가 양쪽으로 이동할 수 없도록 해야 함 – 모터 이동하면 이동센서(I:0/7)가 이동 감지 19/32 PLC Programming : Scenario 2(cont.) 20/32 PLCMotion • A PLC simulation tool made by Intelitek Inc. – http://www.intelitek.com • 주의사항 – 평가버전이므로 한 달 후에 만기 (1주일 만에 만기되기도 하니 유의하세요) – 프로그램 받기 위한 메일주소 알려주세요 (공개된 소프트트웨어가 아니므로 게시판에 올리기 어렵습니다) – 시뮬레이션 실행상태(Simulation and On-Line)는 필요할 때만 (오래 켜주면 컴퓨터에 상당한 부하가 걸립니다) 21/32 Set up 1. Run setup.exe 2. Follow the instructions that appear on the screen 3. Every time you start the program, choose “Run in Evaluation Mode” 22/32 Program • PLC Editor – To draw and modify a ladder diagram • PLC Simulator – To run a ladder diagram • Human Machine Interface – HMI PLC Line – HMI Gate – HMI IceCream – Input : Switches/ Sensors 23/32 PLC Editor 24/32 Creat a Ladder Diagram (1) 1. Run PLC Editor 2. Open a new file - Menu : File-New , Icon : 3. Show Grid if you want to - Menu : Ladder-Show Grid, Icon : 4. To add rungs 1. Menu : Ladder-Add Rung, Icon : 2. Click grey squares 25/32 Creat a Ladder Diagram (2) 5. Activate a rung - Click grey squares 6. Add relay - Menu : Ladder-Relay, Icon : 7. Add coil - Menu : Ladder-Coil, Icon : 8. Parallel - Menu : :Ladder-Line, Icon : - Click grid 26/32 Creat a Ladder Diagram (3) 9. Modify - Menu : Ladder-Object Properties → Click the object 10. Timer - Menu : Ladder-Box, Icon : - Address : T4:number(0~225) - Preset : The amount of time - Accum : interval 11. Counter - Menu : Ladder-Box, Icon : - Address : C5:number(0~225) - Preset : The number to count - Accum : interval To use Time or Counter as an input, you should choose ‘Internal Bit’ 27/32 View PLC Ladders (1) 1. Run HMI - PLC Simulator will appear over the HMI 2. Close the current diagram - Menu : File-Close, Icon : 3. Open a ladder diagram - Menu : File-Open, Icon : 4. Run the model - Menu : Simulate-Simulation and On-Line, Icon : 28/32 View PLC Ladders (2) - HMI PLC Line 29/32 View PLC Ladders (3) 30/32 Quiz 1. PLC는 무엇인가? 2. 다음 ladder diagram의 시간에 따른 상태를 그리세요 ? 31/32 Homework • PLCMotion의 HMI 중 한가지를 골라 적당한 상황을 가정하여 시나리 오를 작성하고, 작성한 시나리오를 ladder diagram으로 작성 – – • 하나 이상의 timer or counter, serial input, parallel input or output 포함 5줄 이상 작성 제출물 1. 시나리오에 대한 간단한 설명 2. Ladder diagram (작성된 ladder diagram은 default로 다음 주소에 저장됩니다 C:\Program Files\Intelitek\PLCMotion\AB_work ) 메일제목/파일제목에 학번과 이름 적어주세요 • • 제출 기한 : 2009년 월 일 자정까지 jinoo02@snu.ac.kr 로 보내주세요 32/32 Appendix A : Internal Bit 33/32 Appendix B : Relay Contact Submenu 34/32 Appendix C : Box Submenu 35/32