Programmable Logic Controllers: Introduction To Plcs
Programmable Logic Controllers: Introduction To Plcs
Programmable Logic Controllers: Introduction To Plcs
Introduction to PLCs
(Chapter 1)
Instructor: Eng. Mohammad Aqel Second Semester, 2007/2008
1
What is a PLC?
Is a microprocessor base controller that uses a programmable memory to store instructions and to implement functions such as logic, timing, counting in order to control machines .
Input devices, e.g. sensors such as switches, and output devices in the system being controlled, e.g. motor, valves, etc., are connected to the PLC. The operator enters a sequence of instructions e.g. ladder logic diagram. The program then is downloaded into the memory of the PLC. The controller monitors the inputs status and outputs status according to this program and carries out the control rules for which it has been programmed. 2
In a traditional industrial control system, all control devices are wired directly to each other . In a PLC system, however, the PLC replaces the wiring between the devices. Instead of being wired directly to each other, all equipment is wired to the PLC. Then, the control program inside the PLC provides the "wiring" connection between the devices. The control program is the computer program stored in the PLCs memory that tells the PLC whats supposed to be going on in the system. The use of a PLC to provide the wiring connections between system devices is called 3 softwiring.
It also executes the control program stored in the PLCs memory. In essence, the CPU is the "brains" of a programmable controller.
6
The CPU has three parts: the processor the memory system the power supply
The processor is the section of the CPU that codes, decodes, and computes data. The memory system is the section of the CPU that stores both the control program and data from the equipment connected to the PLC. The power supply is the section that provides the PLC with the voltage and current it needs to operate.
7
There are two basic types of input and output devices: discrete analog Discrete devices are inputs and outputs that have only two states: on and off. A 1 means that the device is on and a 0 means that the device is off.
Analog devices are inputs and outputs that can have an infinite number of states. These devices can not only be on and off, but they can also be barely on, almost totally on, not quite off, etc.
10
Instructions are little computer codes that make the inputs and outputs as what you want the result, such as (add and subtract data, time and count events, compare information, etc.). remember, changing the system is a snap (fast). If you want the system to act differently, just change the instructions in the control program. all PLCs use two basic types of instructions: contacts coils 11
Ladder Logic
Ladder logic is the main programming method used for PLCs. ladder logic has been developed to mimic (like) relay logic. By selecting ladder logic as the main programming method, the amount of retraining needed for engineers and tradespeople was greatly reduced. A relay is a simple device that uses a magnetic 13field to control a switch, as pictured in next slide.
The contact that closes when the coil is energized is called normally open. The normally closed contacts touch when the input coil is not energized. Relays are normally drawn in schematic form using a circle to represent the input coil. The output contacts are shown with two parallel lines. Normally open contacts are shown as two lines, Normally closed contacts are shown with two lines with a diagonal line through them.
14
input coil
OR
normally closed
normally open
OR
Example of a Relay
The first relay on the left is used as normally closed, and will allow current to flow until a voltage is applied to the input A.
115VAC wall plug
The second relay is normally open and will not allow current to flow until a voltage is applied to the input B.
relay logic
If current is flowing through the first two relays then current will flow through the coil in the third relay, and close the switch for output C.
Ladder logic form, This can be read logically as C will be on if A is off and B is on.
15
C ladder logic
PLC
inputs
ladder logic
outputs
115V ac AC pow er
light
16
neut.
A Seal-in Circuit
Many relays also have multiple outputs and this allows an output relay to also be an input simultaneously. The input B will only be on when the output B is on. If B is off, and A is energized, then B will turn on.
17
The second rung of Figure is more complex, there are actually multiple combinations of inputs that will result in the output Y turning on.
INPUTS
OUTPUTS
18
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).
Mnemonics
This is other method programming PLCs. for
An example of mnemonics is shown in Figure. In this example the instructions are read one line at a time from top to bottom.
19
power down
End
20
PLC Connections
When a process is controlled by a PLC it uses inputs from sensors to make decisions and update outputs to drive actuators, as shown in Figure below. The control loop is a continuous cycle of the PLC reading inputs, solving the ladder logic, and then changing the outputs. When power is turned on initially the PLC does a quick check to ensure that the hardware is working properly.
If there is a problem the PLC will halt and indicate there is an error. For example, if the PLC backup battery is low and power was lost, the memory will be corrupt
21
CASE STUDY
Problem: Try to develop a ladder logic diagram that will allow three switches in a room to control a single light.
?
22
Solution1
Solution: There are two possible approaches to this problem. The first assumes that any one of the switches on will turn on the light, but all three switches must be off for the light to be off.
23
Solution2
The second solution assumes that each switch can turn the light on or off, regardless of the states of the other switches. This method is more complex and involves thinking through all of the possible combinations of switch positions.
24
Summary
Normally open and closed contacts. Relays and their relationship to ladder logic. PLC outputs can be inputs, as shown by the seal in circuit. Programming can be done with ladder logic, mnemonics, SFCs. There are multiple ways to write a PLC program.
25
ASSIGNMENT PROBLEM
Develop a simple ladder logic program that will turn on an output X if inputs A and B, or input C is on.
26