Programmable Logic Controllers NUS IA Programmable Logic Controllers
Programmable Logic Controllers NUS IA- Programmable Logic Controllers 11
Programmable Logic Controllers • microcomputer-based controllers • can be programmed for sequence control purposes • other powerful features: counting and timing, arithmetic processing, process control, etc. • provides flexible automation; reprogrammable. Ladder diagrams can be programmed into the PLC • cost-effective for medium- or large-sized applications • takes up less space; can often replace several hundred relays. NUS IA- Programmable Logic Controllers 22
Programmable Logic Controllers • generally more reliable than relay circuits. Relays have lifecycles of the order of hundreds of thousands while that for the PLC are in millions. • eliminates the often appreciable cost of wiring a relay panel. NUS IA- Programmable Logic Controllers 33
Basic Architecture of PLC NUS IA- Programmable Logic Controllers 44
Basic Operation of the PLC The input program (e. g. ladder diagram) is first entered and stored in memory of the microcomputer. The CPU then reads the “program”, e. g. rung by rung of the ladder diagram at a constant sampling frequency. NUS IA- Programmable Logic Controllers 55
Basic Operation of the PLC The affected output is then changed accordingly. The process repeats until the whole ladder is processed from top to bottom. The program then repeats again from the top rung. NUS For each “rung” of the ladder, the CPU reads the states of the necessary inputs and, together with the states of any internal “relays”, determines the state of the affected output. IA- Programmable Logic Controllers 66
A typical commercial PLC NUS IA- Programmable Logic Controllers 77
Typical PLC Specifications NUS IA- Programmable Logic Controllers 88
Typical Input Interface Circuit To detect state of sensors, switches, etc. NUS IA- Programmable Logic Controllers 99
Typical Output Interface Circuit To translate low voltage/current signals to large current, high voltage outputs. NUS IA- Programmable Logic Controllers 10 10
Programming the PLC Various methods available. Varies from manufacturer to manufacturer. Done directly through a programming unit or through a connection to a PC, depending upon the PLC used. Actual programming is a relatively easy process. The difficult part is deriving the logic, or ladder diagram, required. NUS IA- Programmable Logic Controllers 11 11
Programming the PLC • ladder-diagram based – – • Instruction List (mnemonics) – • NUS carry-over from the popular ladder diagram approach used in the past and familiar to many automation engineers ladder diagram or Boolean expressions of all logic function first derived and “program” input via graphical means of text editor. Low level language similar to assembly language codes. Others: sequential function chart (SFC), function block diagram (FBD), structured text (ST). IA- Programmable Logic Controllers 12 12
Programming the PLC(based on Mitsubishi) Basic Devices Xn: – – Reserved for physical input devices, e. g. limit switches, pushbuttons, sensors, connected directly to inputs of PLC. Number n available limited depending upon PLC used. State of contacts corresponds directly to the physical input connection to the PLC. Any number of contacts available for program. Yn: – – – NUS Reserved for physical output device, e. g. relays, solenoids, motors, connected directly to outputs of PLC. Number n available is limited depending upon PLC used. These are also implemented as “software” relays with many contacts. IA- Programmable Logic Controllers 13 13
Programming the PLC(based on Mitsubishi) Basic Devices Tn: – internal “software” timers used for generating time delays. Number n almost unlimited. Mn: – internal auxiliary “software” relays which comprises a coil and contacts. Number n almost unlimited. Cn: – NUS internal “software” counters for counting events. Number n almost unlimited. IA- Programmable Logic Controllers 14 14
Preparing for the Program The original ladder diagram Input-Output assignments NUS IA- Programmable Logic Controllers 15 15
Preparing for the Program Equivalent PLC ladder diagram NUS IA- Programmable Logic Controllers 16 16
A Sample Programming Language Ladder Diagram NUS 0 LD X 7 1 OR Y 3 2 ANI X 8 3 ANI X 9 4 OUT Y 3 5 END IA- Programmable Logic Controllers Program 17 17
Mnemonic Instructions (based on Mitsubishi) The LD and LDI instruction initiates a new logical block. Y, T, M, C would be contacts associated with the respective devices. OUT connects output device to right hand rail or bus bar. Cannot be used with X input devices. Multiple parallel connections allowed. NUS IA- Programmable Logic Controllers 18 18
Mnemonic Instructions (LD, LDI, OUT) LD OUT LDI OUT END NUS IA- Programmable Logic Controllers X 0 T 0 K 19 T 0 Y 1 M 100 19 x 100 msec 19 19
Mnemonic Instructions (AND, ANI, ORI) NUS IA- Programmable Logic Controllers 20 20
Mnemonic Instructions (AND, ANI, ORI) LD ORI ANI OUT LDI AND OR ANI OR OUT END NUS IA- Programmable Logic Controllers X 0 X 1 Y 1 M 100 Y 2 X 3 Y 1 M 100 X 0 Y 1 21 21
Mnemonic Instructions (ORB, ANB) NUS IA- Programmable Logic Controllers 22 22
Mnemonic Instructions (ORB, ANB) LD ORI LD AND LD ANI ORB OR ANB OR OUT END NUS IA- Programmable Logic Controllers X 1 X 3 X 2 X 3 X 4 X 5 X 6 Y 7 Y 1 23 23
Mnemonic Instructions (MPS, MRD, MPP) NUS IA- Programmable Logic Controllers 24 24
Mnemonic Instructions (MPS, MRD, MPP) Ld AND OR ANI MPS AND OUT MRD AND OUT MPP AND MPS AND OUT MPP AND OUT END NUS IA- Programmable Logic Controllers X 1 X 2 Y 1 M 2 M 3 Y 1 Y 2 Y 1 Y 3 Y 2 Y 1 M 2 M 3 25 25
Mnemonic Instructions (END) • END forces program to end current scan and restart a new scan. • Useful for debugging purposes as instructions after END are ignored. NUS IA- Programmable Logic Controllers 26 26
Timers • “Software” timers are normally available in PLCs. In the Mitsubishi PLC, there are 1 msec, 10 msec and 100 msec timers. These have timer “Coils” and “Contacts”. Ld OUT X 1 T 100 K 235 T 1 Y 1 • If T 1 is a 10 msec timer, then relay Y 1 will turn on after 2. 35 sec after X 1 closes and remains closed. At any time X 1 opens, T 1 resets. NUS IA- Programmable Logic Controllers 27 27
Counters Ld X 1 RST C 0 Ld X 2 OUT C 0 K 5 Ld C 0 OUT Y 1 Closure of X 1 resets the counter C 0 counts up each time its coil is turned ON by X 2. Its output contacts are activated when its coil is turned ON for the fifth time. Thereafter its count value does not change and its outputs remain ON until it is reset to zero X 1 closing. NUS IA- Programmable Logic Controllers 28 28
Program Scan: A single processing of the loaded program from start to END. The process is continuous and once one scan ends, a new one is started. Scan Time: Time period for one scan, dependent upon program length and complexity. Input/Output updating: In some PLCs, all physical inputs are updated at the beginning of the scan and all physical outputs updated at the end of the scan. NUS IA- Programmable Logic Controllers 29 29
Program Scan – Double coiling, or specifying the same output twice, is allowed. In figure, if X 1=ON and X 2=OFF, then Y 2=ON and Y 1=OFF. NUS IA- Programmable Logic Controllers 30 30
Differences between Relay and PLC ladder diagrams For PLC Relay circuit Hardware components, relays and other switches, have a limited number of contacts. NUS Software components, internal relays, inputs and outputs, have a “unlimited” number of contacts. No need to try to “save”. Better to make program easier to read. IA- Programmable Logic Controllers 31 31
Differences between Relay and PLC ladder diagrams For PLC Relay circuit Current flow can take place in any direction. “Current flow" takes place only in one direction, from left to right. Sneak path This ladder diagram will need to be modified for PLC implementation. NUS IA- Programmable Logic Controllers 32 32
Differences between Relay and PLC ladder diagrams Relay circuit For PLC Contacts cannot be placed vertically , with crossover lines. Ladder diagrams are strictly two-dimensional and there can be no crossover lines. Relay circuit. Will need to be modified for PLC. Equivalent PLC circuit NUS IA- Programmable Logic Controllers 33 33
Differences between Relay and PLC ladder diagrams Relay circuit For PLC All rungs of the ladder diagram are active simultaneously. This "parallel" operation sometimes causes "race" problems and malfunctions. Each rung of the ladder is scanned, and acted upon, successively starting from the first rung. When the last rung has been scanned, a new cycle begins from the first rung again. Scanning period of the order of 5 to 50 ms The order in which the rungs are drawn is immaterial. NUS The order in which the rungs are "programmed" into memory is very important. IA- Programmable Logic Controllers 34 34
Program Scan – Program order For the PLC, the order in which the rungs are "programmed" into memory is very important. One output pulse for every positive transition of X 3 NUS IA- Programmable Logic Controllers Y 2 always OFF 35 35
An Example Original Ladder diagram I/O allocation Re-drawn Ladder diagram For PLC NUS IA- Programmable Logic Controllers 36 36
An Example Cannot be programmed X 3 M 1 M 3 M 2 Redrawn M 2=(X 3. M 1+M 2). M 3’ NUS IA- Programmable Logic Controllers 37 37
An Example Program LD AND OR ANI OUT AND OUT LD AND OR OUT END NUS IA- Programmable Logic Controllers X 3 M 1 M 2 M 3 M 2 X 5 Y 12 M 2 X 4 M 1 Y 13 38 38
End of PLC NUS IA- Programmable Logic Controllers 39 39
- Slides: 39