Programmable Logic Controllers Part 1. UWI 2012
2 February 2013
UWI
1
Books
2 February 2013
UWI
2
What is a PLC? A programmable logic controller (PLC), also referred to as a programmable controller, is the name given to a type of computer commonly used in commercial and industrial control applications.
2 February 2013
UWI
3
PLC is different from a Personal Computer
PLCs differ from office computers in the types of tasks that they perform and the hardware and software they require to perform these tasks.
2 February 2013
UWI
4
INTRODUCTION TO PLCS Advantages of PLCs
• Cost effective for controlling complex systems. • Flexible and can be reapplied to control other systems quickly and easily. • Computational abilities allow more sophisticated control. • Trouble shooting aids make programming easier and reduce downtime. • Reliable components make these likely to operate for years before failure. 2 February 2013
UWI
5
Siemens S7-200 PLC
2 February 2013
UWI
6
An example
2 February 2013
UWI
7
Programmable Logic Controller Digital computer used for the control of machinery and process control systems.
2 February 2013
UWI
8
PLC Origin - Developed to replace relays in the late 1960s; - Costs dropped and became popular by 1980s; - Now used in many industrial designs. 2 February 2013
UWI
9
The need of a programmable controller • In USA, 1969, car industry requires a programmable controller
2 February 2013
UWI
10
Conditions • Condition of use in industrial envirement: – Electric noise, dust, temperature, humidity, … Context:
In the 60s, computers require a particular environment.
2 February 2013
UWI
11
Conditions • Variety and number of inputs/outputs: – Different types of signals
• • • • •
Voltage; Current; Analogical; Digital; Logic.
2 February 2013
UWI
12
What PLCs offer today Standards (logic signals): – – – – – – –
+ 5 Volts (DC) + 12 Volts (DC) + 24 Volts (AC, DC) + 48 Volts (AC, DC) 120 Volts (AC, DC) 230 Volts (AC, DC) 100 Volts (DC)
2 February 2013
UWI
13
What PLCs offer today • Standard (analogue signals): – Range of voltage: • 0 5 Volts ; 0 10 Volts • -5 +5 Volts ; -10 +10 Volts
– Range of current: • 0 20 mA ; 4 20 mA
2 February 2013
UWI
14
Programming the PLCs IEC 6113-3 standard • Simple programming language “LADDER”; • Function block diagram (graphical); • Structured text programming (high-level programming); • Instruction list; • Sequential chart (graphical). 2 February 2013
UWI
15
Programming the PLC
PLC programs may be written on a personal computer then, downloaded by a direct connection cable or over a network to the PLC.
2 February 2013
UWI
16
Costs
Acceptable costs Context: In the 60s, computers are of a rather astronomical cost.
2 February 2013
UWI
17
The precursors • Allen Bradley – 60% of the North-American market
• Siemens • Modicon • ALSPA (1971 - France) • Télémécanique (1971 - France) 2 February 2013
UWI
18
Functional organization • Non-modular PLC
2 February 2013
UWI
19
Functional organization • Modular PLC
Have as many inputs and outputs as we want. 2 February 2013
UWI
20
Power Module This module generates the set of voltage necessary for the good functioning of the automatism. +24 VCC
110 VCA / 220 VCA
Power Alimentation module
+/- 12 VCC
+5 VCC 2 February 2013
UWI
21
PLC components
2 February 2013
UWI
22
Power module It is necessary to administer correctly this resource.
PCA ≥
∑ PCC
+24 VCC
110 VCA / 220 VCA
Alimentation
+/- 12 VCC
+5 VCC 2 February 2013
UWI
23
Module of alimentation • Calculation of the balance of power
2 February 2013
UWI
24
A L I M E N T A T I O N
U N I T E
C A R T E
C E N T R A L E
D ' E N T R É E
C A R T E D E S O R T I E
M O D U L E D E
BUS INTERNE OU EXTERNE
F O N C .
CPU
• Composed by: – processor: • Micro-processor or micro-controller
– memory: • ROM, RAM, EPROM, E2PROM
2 February 2013
UWI
25
CPU Functions: • Reading the information from the entries; • Execution of the totality of the instructions of the program written in the memory; • Sending the actions.
2 February 2013
UWI
26
The processor
Types of available instructions: – Logic; – Arithmetic; – Transfer of memory; – Counting; – Temporization.
2 February 2013
UWI
27
The processor
Types of available instructions – Immediate reading of entries; – Immediate writing on exit modules; – Connections, jumps; – Test of bit or word; – Conversion.
2 February 2013
UWI
28
The processor
Types of available instructions: – Interruption; – Control P.I.D.
2 February 2013
UWI
29
Memory
Capacity in ko or Mo – Big PLCs: • some Mo.
2 February 2013
UWI
30
Memory • Type of memories: – RAM: Random Access Memory Inout (Writing)
RAM
Exit (Reading)
Address 2 February 2013
UWI
31
A L I M E N T A T I O N
U N I T E
C A R T E
C E N T R A L E
D ' E N T R É E
C A R T E D E S O R T I E
M O D U L E D E
BUS INTERNE OU EXTERNE
F O N C .
Memory • Type of memory: – ROM: Read Only Memory Out (Reading)
ROM Address 2 February 2013
UWI
32
A L I M E N T A T I O N
U N I T E
C A R T E
C E N T R A L E
D ' E N T R É E
C A R T E D E S O R T I E
M O D U L E D E
BUS INTERNE OU EXTERNE
F O N C .
Memory • Type of memory: – PROM: Programmable Read Only Memory • Programmed just once.
– EPROM: Erasable Programmable Read Only Memory • Can be reprogrammed. • Erasable by rays.
2 February 2013
UWI
33
A L I M E N T A T I O N
U N I T E
C A R T E
C E N T R A L E
D ' E N T R É E
C A R T E D E S O R T I E
M O D U L E D E
BUS INTERNE OU EXTERNE
F O N C .
Memory • Type of memory: – E2PROM: Electrically Erasable Programmable Read Only Memory • Reprogrammed; • Electrically erasable.
2 February 2013
UWI
34
A L I M E N T A T I O N
U N I T E
C A R T E
C E N T R A L E
D ' E N T R É E
C A R T E D E S O R T I E
M O D U L E D E
BUS INTERNE OU EXTERNE
F O N C .
Memory Copy the inputs
Sensor
7
Input Card
CPU
0
I 124.X
I 124
I 125.X I 126.X
Copy 2 February 2013
UWI
35
Memory • Results sent to the output card
7
CPU
Exit card
0
Q124.X
Q 124
Actuator
Q125.X Q126.X
Image 2 February 2013
UWI
36
CPU Mode of synchronous functioning:
– Synchronous reading of all the entries; – Synchronous writing in all the exits.
2 February 2013
UWI
37
CPU • Sequential traitment : Reset
Reading the entries
Executing the program
Writing the results
2 February 2013
UWI
38
Logical Control with Relays
115VA C wall plug
relay logic
input B (normally open)
input A (normally closed)
A
B
output C (normally open)
C ladder logic
2 February 2013
UWI
39
push buttons
Relay Logic in a PLC power supply +24V com.
PLC inputs
ladder logic
A
B
C
outputs
115Vac AC power
light
neut. 2 February 2013
UWI
40
Reading Ladder Logic HOT
NEUTRAL A
B
C
D
G
E
F
H
INPUTS
X
Y
OUTPUTS
Note: Power needs to flow through some combination of the inputs (A,B,C,D,E,F,G,H) to turn on outputs (X,Y).
2 February 2013
UWI
41
A Ladder Logic Example A
B
B
Note: When A is pushed, the output B will turn on, and the input B will also turn on and keep B on perma nently - until power is removed. Note: The line on the right is being left of and is implied in these diagrams.
2 February 2013
UWI
f intentionally
42
Mnemonics
00000 00001 00002 00003 00004 00005 00006 00007 00008
LDN LD AND LD LD AND OR ST END
A B
the mnemonic code is equivalent to the ladder logic below
C D X A
B
C
D
X
END
Note: The notation shown above is not standard Allen-Bradley notation. The program to the right would be the A-B equiva lent.
2 February 2013
UWI
SOR BST XIC A XIO B NXB XIO C XIO D BND OTE X EOR END 43
Structured Text i := 0; REPEAT i := i + 1; UNTIL i >= 10 END_REPEA T;
Sequential Flow Charts
Start
power up
Execution follows multiple paths flash
power down
End 2 February 2013
UWI
45
An example
2 February 2013
UWI
46
PLC in a Control Loop PROCESS
Connections to actuators
Feedback from sensors/switches PLC
Ladder Logic Inputs x Normally open, an active input x will close the contact and allow power to flow. x Normally closed, power flows when the input x is not open. x IIT immediate inputs will take current values, not those from the previous input scan. (Note: this instruction is actually an output that will update the input table with the current input values. Other input contacts can now be used to examine the new values.)
Ladder Logic Outputs When power is applied (on) the output x is activated for the left output, but turned off for the output on the right. x
x
An input transition on will cause the output x to go on for one scan (this is also known as a one shot relay) x OSR
When the L coil is energized, x will be toggled on, it will stay on until the U coil is energized. This is like a flip-flop and stays set even when the PLC is turned off. x x L U Some PLCs will allow immediate outputs that do not wait for the program scan to end before setting an output. (Note: This instruction will only update the outputs using the output table, other instruction must change the individual outputs.) x IOT
Note: Outputs are also commonly shown using parentheses ’-( )-’ instead of the circle. This is because many of the programming systems are text based and circles cannot be drawn.
The figure shows the sketch of a continuous filling operation. This process requires that boxes moving on a conveyor be automatically positioned and filled. The sequence of operation for the continuous filling operation is as follows: • Start the conveyor when the start button is momentarily pressed. • Stop the conveyor when the stop button is momentarily pressed. • Energize the run status light when the process is operating. • Energize the standby status light when the process is stopped. • Stop the conveyor when the right edge of the box is first sensed by the photo sensor. • With the box in position and the conveyor stopped, open the solenoid valve and allow the box to fill. Filling should stop when the level sensor goes true. • Energize the full light when the box is full. The full light should remain energized until the box is moved clear of the photo sensor.
2 February 2013
UWI
50
Continuous filling operation PLC program
2 February 2013
UWI
51