INTRODUCTION TO PROGRAMMABLE LOGIC
CONTROLLERS
WHAT IS PLC?
A programmable logic controller (PLC) is a special form of microprocessor-based
controller that uses programmable memory to store instructions and to implement functions
such as logic, sequencing, timing, counting, and arithmetic in order to control machines and
processes.
HISTORY:
Developed to replace relays in the late 1960s
The PLC was invented in response to the needs of the American automotive
manufacturing industry(primarily General motors).
PLC began in the 1970s, and has become the most common choice for
manufacturing controls.
Costs dropped and became popular by 1980s
Now used in many industrial designs
PLC COMPONENTS:
POWER SUPPLY
- the component that provides power to a PLC CPU and I/O. The power supply
must convert the line voltage to around 5VDC for the PLC to use.
TYPES:
A) 24 volts DC
B) 100 - 240 volts AC
C) 110/220 volts AC
CENTRAL PROCESSING UNIT (CPU)
- the component that processes information and carries out instructions in a PLC.
This is also known as the processor or controller.
INPUT MODULE
- the component where input devices are physically connected to a PLC. The input
module transfer signals to the internal relay.
TYPES:
A) DC - 12 volts
b) DC - 24 volts
C) 110/220 volts AC
OUTPUT MODULE
- the component where output devices are physically connected to a PLC. The
input module transfer signals from the internal relay.
TYPES:
D) Transistor type (24 VDC)
e) Relay/Contact Type(24 VDC/220 VAC)
F) TRIAC Type (110/220 VAC)
INPUT ADJUSTMENT INTERFACE
Adjustment interface also called an interface is placed between input lines and a
CPU unit. The purpose of adjustment interface to protect a CPU from disproportionate
signals from an outside world. Input adjustment module turns a level of real logic to a level
that suits CPU unit (ex. input from a sensor which works on 24 VDC must be converted to a
signal of 5 VDC in order for a CPU to be able to process it). This is typically done through
opto-isolation.
OUTPUT ADJUSTMENT INTERFACE
Output interface is similar to input interface. CPU brings a signal to LED diode and
turns it on. Light incites a photo transistor which begins to conduct electricity, and thus the
voltage between collector and emitter falls to 0.7V, and a device attached to this output
sees this as a logic zero. Inversely it means that a signal at the output exists and is
interpreted as logic one. Photo transistor is not directly connected to a PLC controller
output. Between photo transistor and an output usually there is a relay or a stronger
transistor capable of interrupting stronger signals.
SINKING-SOURCING CONCEPT
PLC has input and output lines through which it is connected to a system it directs.
Input can be keys, switches, sensors while outputs are led to different devices from simple
signalization lights to complex communication modules.
This is a very important part of the story about PLC controllers because it directly
influences what can be connected and how it can be connected to controller inputs or
outputs. Two terms most frequently mentioned when discussing connections to inputs or
outputs are "sinking" and "sourcing". These two concepts are very important in connecting a
PLC correctly with external environment. The most brief definition of these two concepts
would be:
SINKING = Common GND line (-)
SOURCING = Common VCC line (+)
TYPES OF PLC:
1. Unitary
2. Modular
3. Rack Mounted
Unitary
The unitary PLC is one of the earliest types used back in the 1970's and is very compact
with a simplistic design and is the least expensive of PLC types on the market. It houses all
of the basic features such as, the CPU and I/O boards and are commonly used to run small
manufacturing processes or fixed machines.
Advantages
Less scanning time
Usually small, have less memory so cost is less
Less troubleshooting time so less downtime
Disadvantages
Limited number of inputs and outputs
Not suited for future expansion
If part of unit fails, the entire unit may need replacement
Modular
The modular PLC followed on from the unitary PLC and is very similar in size and design
but is slightly more expensive. They consist of 3 basic modules namely, the input, output
and CPU with the power source being provided separately.
Their advantage is allowing a range of modules to slot together to expand the system by
usually mounting them on a DIN(Deutsches Institut für Normung) rail and by simply adding
another unit and connecting the processor of the existing unit via a plug. However this
expansion is limited due to the capability of the CPU and scan speeds.
These are also commonly used for small manufacturing process requirements but with a
possibility of expansion if processes were to increase.
Advantages
The main advantage is that the number of input and output terminals can be
expanded to cope with the changes to the hardware system
Modules can be easily installed or removed without affecting other modules
Disadvantages
Scanning time increases with the increase in input and output module
Limited expansion is allowed depending on type of brand
Rack Mounted
The rack mounted type of PLC is similar to the modular concept, but is implemented
differently. Whereas each module in a modular PLC connects to the base unit directly, a
rack mounting PLC keeps each module separate. All extra modules are connected through
a network, and modules are held in organized racks. This approach allows for larger
systems to be built without becoming overly cluttered and complicated. Modules are well
organized on the rack and can be removed and reinserted as needed.
The rack mounted PLC is more commonly used where large automation processes are
required such as production lines.
Advantages
Allow large extensions to the program
Slot and memory cards can be interchangeable or reprogrammed and easily
replaced.
Disadvantage
Overwhelming initial cost
TYPES OF PLC ACCORDING TO NUMBER OF I/O’s:
1. Micro PLC - less than 100 I/O’s
2. Small PLC - 101 to 526 I/O’s
3. Medium PLC - 527 to 1028 I/O’s
4. Large PLC - 1029 to 5120 I/O’s
INPUT DEVICES
Push-button switch
Limit switch
Timer
Sensing devices
Rotary encoder
Proximity switch
Pressure switch
OUTPUT DEVICES
Alarms
Lights
Valves
Solenoid
Heater
LED display
Motor starters
Motors
\
PLC OPERATION
A PLC works by continually scanning a program. We can think of this scan cycle as
consisting of 3 important steps.
Step 1.CHECK INPUT STATUS
First the PLC takes a look at each input to determine if it is on or off. In other words,
is the sensor connected to the first input on? How about the second input? How
about the third... It records this data into its memory to be used during the next step.
Step 2.EXECUTE PROGRAM
Next the PLC executes your program one instruction at a time. Maybe your program
said that if the first input was on then it should turn on the first output. Since it already
knows which inputs are on/off from the previous step it will be able to decide whether
the first output should be turned on based on the state of the first input. It will store
the execution results for use later during the next step.
Step 3.UPDATE OUTPUT STATUS
Finally the PLC updates the status of the outputs. It updates the outputs based on
which inputs were on during the first step and the results of executing your program
during the second step. Based on the example in step 2 it would now turn on the first
output because the first input was on and your program said to turn on the first output
when this condition is true.
After the third step the PLC goes back to step one and repeats the steps
continuously. One scan time is defined as the time it takes to execute the 3 steps listed
above. Scan time depends upon the speed of CPU and the length of the program. PLCs are
generally programmed in ladder diagram which is a symbolic representation of electric
circuits.
PLC PROGRAMMING LANGUAGES
1. INSTRUCTION LISTS(IL)
An instruction list gives programs as a series of instructions, with each instruction
on a new line. Each instruction consists of an operator followed by one or more
operands, that is, the subjects of the operator. Thus we might have:
LD A
to indicate that the operand A is to be loaded, LD being the operator used to
indicate loading. In terms of ladder diagrams, an operator may be regarded as a
ladder element, and LD is equivalent to starting a rung with open contacts for
input A. Another instruction might be:
OUT Q
to indicate that there is to be an output to Q.
Example:
LD X001
AND X002
OUT Y001
2. STRUCTURED TEXT(ST)
ST b0rrows its syntax from PASCAL, enforces data typing and support structured
programming. The structured text consists of a series of instructions which, as
determined in higher level language, (“IF..THEN..ELSE”) or in loops (WHILE..DO)
can be executed.
Example:
IF value<7 THEN
WHILE value <8 DO
Value:=value+1;
END_WHILE;
END_IF
3. FUNTION BLOCK DIAGRAM(FBD)
Controllers are modeled as signal and data flows through processing elements.
FBD transfers textual programming into connecting building blocks
Example:
4. SEQUENTIAL FUNCTION CHART
Is a graphically oriented language which makes it possible to describe the
chronological order of different actions within the program.
5. LADDER PROGRAMMING
The ladder diagram is basically a symbolic set of instructions used to create the
controller program. This ladder instruction symbols are arranged to obtain the
desired logic.
BASIC LADDER INSTRUCTION SYMBOLS:
Normally Open Instruction
It is the same as the normally open relay contact. For this instruction, the
PLC examines if the contact is closed(ON). If PLC detects ON(1) condition,
the instruction is TRUE. It represents any input such as a normally open
push button or a switch.
Normally Closed Instruction
It is the same as the normally closed relay contact. For this instruction, the
PLC examines if the contact is open(OFF). If PLC detects OFF(0)
condition, the instruction is TRUE. It represents any input such as a
normally closed push button or switch.
Output Energize Instruction
It is the same as a relay coil. The PLC makes this instruction TRUE if
logical continuity exists on a rung. It represents any output that is controlled
by some combination of input logic. It can be a connected device or an
internal relay.
LADDER RUNG
A ladder rung is a set of input instructions(usually at the left portion) and an output
energize instruction(usually at the right). Power flows from left to right of rung 1, then left to
right of rung 2 and so on up to the end of the program. See example below.
Input (condition) instructions Output instructions
X001 X002 Y001
RUNG 1
X003 Y002
RUNG 2
PLC TRAINER 1
PLC TRAINER 2