0% found this document useful (0 votes)
23 views

Lecture 6 - PLC - Note

Uploaded by

Pasindu Saranath
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Lecture 6 - PLC - Note

Uploaded by

Pasindu Saranath
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Programmable Logic Controllers

Programmable Logic Controller (PLC)

PLC is a digital electronic device that uses a programmable memory to store instructions
for obtaining logic, sequencing, timing, counting and arithmetic to control machine and
processes. The advantage of using PLC is that it is possible to modify a control system
without having the input and output devices rewired and without using new or modified
control valves ito change the required logic. The only requirement being that an operator
has to key in a different set of instructions. The result is a flexible system that can be used
in control systems that vary quite widely in their nature and complexity.

PLC is similar to using a computer but has certain features that are specific to their use as
controllers. These are:
1. They are rugged and designed to withstand vibrations, temperature, humidity and
noise.
2. The interfacing for inputs and outputs is inside the controller.
3. They are easily programmed and have an easily understood programming
language. Programming is primary concerned with logic and switching
operations.

PLCs were first conceived in 1968. They are now widely used and extend from self-
contained units for use with around 20 digital inputs/outputs to modular systems that can
be used for large number if inputs/outputs, handle digital or analogue inputs/outputs and
also carry out PID control modes.

Architecture of a PLC is given by the figure below.

Data bus
Address bus
Control bus Program
panel

Input
Clo CPU Memory I/O unit
channels

Output
channels
Architecture of a PLC

Palitha Dassanayake 1
Programmable Logic Controllers

Ladder Diagrams

PLC is programming in general is conducted by ladder diagrams. Each horizontal line,


i.e. rung of the ladder, represents a line in the program. Some basic logics of writing a
PLC are as follows.

Input normally open contacts

Input normally closed contacts

Inputs in series, logic AND

Inputs in parallel, logic OR

or Output Devices

A special instruction

The sequence followed by a PLC when carrying out a program can be summarized as
follows.

1. Scan the inputs associated with one rung of the ladder program.
2. Solve the logic operations involving these inputs.
3. Set/reset the output for that rung.
4. Move on to the next rung and repeat operations 1,2,3 until the end of the program.

Palitha Dassanayake 2
Programmable Logic Controllers

Ladder Programming of PLC


Following below is example of PLC programming to implement the mentioned
operations

I0.0 Q0.
1.
0

I0.1 Q0.
2. 1

I0.0 I0.1 Q0.


3. 0

I0.0 Q0.
0
4.

I0.1
Fig 7

Explanation of each rung


1. When I0.0 is on Q0.0 is on otherwise it is off
2. When I0.0 is off Q0.0 is on otherwise it is off
3. When both I0.0 and I0.1 are on Q0.0 is on otherwise it is off.
4. When I0.0 or I0.1 is on Q0.0 is on otherwise it is off.

Timer
Timers are very useful in automation. A timer circuit is specified by stating the interval to
be timed and the conditions or events that are to start and /or stop the timer. In S7 –200,
you can count in step of 1ms,10ms or 100ms depending upon the timer. Timer has two
operands, bit operand and the byte operand. Depending on how it is used, the relevant
one will be accessed automatically by the program.
There are three types of timers available.
1. On-Delay Timer (TON) for timing a single interval
2. Retentive On-Delay Timer (TONR) for accumulating a number of timed intervals
3. Off-Delay Timer (TOF) for extending time past a false condition (in other words,
such as cooling a motor after it is turned off)
Counter
When it is required to count some event, we can make use of a counter. Counter can be
incremented or decremented according to the way it is used (Up counter and down
counter). Also a counter (Up/Down counter) can be used to operate as incrementing and
decrementing depending upon the event.

Palitha Dassanayake 3
Programmable Logic Controllers

Draw Ladder diagrams to obtain the following cases


Ex 1: A bulb is to be on after 20 seconds when a switch is on and bulb is to be off when
the switch is off.
Ex 2: When a switch is on, a bulb is to be on, and it is to be off after 15 seconds when the
switch is off.
Ex 3: Write a PLC ladder diagram to show an incremental counter by using two switches
and a bulb such that when switch one is switched five times the bulb is on and when the
switch two is pressed the counter gets reset irrespective of the current count value.

Input/Output Processing of PLC


There are two methods that can be used for input/output processing.
1. Continuous updating- This involves the CPU scanning the input channels as they
occur in the program instructions. Each inputs point is examined individually and
its effect on the program is determined. There will be a built in delay typically
about 3 ms, when each input is examined in order to ensure that only valid input
signals are read by the microprocessor to avoid counting an input signal twice.
2. Mass input/output copying- Because with continuous updating, there has to be 3
ms delay in each input, the time taken to examine several hundred of input/output
points can become comparatively long. To allow a more rapid execution of a
program, a specific area of RAM is used as a buffer store between the control
logic and the input/output unit. Each input/output has an address in this memory.
At the start of each program cycle of the CPU scans all the inputs and copies their
status into the input/output addresses in RAM. As the program gets executed the
stored data is read, as required from RAM and the logic operation is carried out.
The resulting output signals are stored in the reserved input/output section of
RAM. At the end of each program cycle all the outputs are transferred from RAM
to the appropriate channels. The outputs are latched so that they retain their status
until the next updating.

The given questions are based on switches and bulbs or can be validated using switches
and bulbs easily. These questions will give you an understanding of basic ladder
programming.

1.0 A bulb is to be on when a switch is on and after 10 seconds to be off automatically.


If the switch is off before 10 seconds, the bulb should also be off with the switch.

2.0 A bulb is to be on after 20 seconds when a switch is on and bulb is to be off when
the switch is off.

3.0 When a switch is on, a bulb is to be on, and it is to be off after 15 seconds when the
switch is off.

4.0 There are two switches S1 and S2 and a bulb B1. The bulb should be on if and if

Palitha Dassanayake 4
Programmable Logic Controllers

only one switch is on, otherwise it is off (Bulb is off if both switches are on). Add another
bulb B2 to this system so that it is on if and only if S1 and B1 are both on, otherwise it is
off. Draw a truth table for this system and try to obtain the logic for B2 using only inputs
(without using B1 as an input). Validate your answer by rewriting the ladder by only
using switches (S1 and/or S2) to obtain B2.

5.0 Write a PLC ladder diagram to show an incremental counter with two inputs, one
switch S1 to increment the counter, one switch S2 to reset the counter. Take the preset
value as 5 and have one output bulb B1 to be on if the actual count is more or equal to 5.
When the counter is reset, the count should be equal to zero.

Question
There is a waiting room at an organization for the workers to wait to meet the managers.
The room was ventilated by a fan that supplies chilled air and it was being operated
throughout. There was a complaint from the workers that when the room was crowded,
ventilation was not sufficient and they feel very uncomfortable. Hence, the management
has installed another fan and ask the workers to switch it off, when there is less workers
in the waiting room. However, it has been found this is not being practicing well, and
most of the time both fans are working unnecessarily. You have been asked to automate
the switching on and off fans depending upon the number of workers inside the room.
There is an entry door and exit door. Assuming that workers cannot enter through exit
door and exit through the entry door and having two sensors to detect when someone
comes in goes out.
(a) it is required to design an electronic circuit to obtain the following requirements.
 Both fans should be in OFF position when nobody inside the room.
 Only one fan should be on when there is less than or equal to two workers inside
the room
 Assume that only maximum of five workers can be accommodated and entry door
get locked until a worker goes through the exit door.
 Consider S1 sensor is ON when someone enters and S2 sensor is on when
someone moves out.
 F1 should be ON to run the first fan and F2 should be ON to run the second fan
by the PLC output and fans are off otherwise.

Write a PLC program to work in the required manner considering S1, S2 are inputs and
F1, F2 and L are outputs. L is connected in such a way that when L is in ON position, the
entry door gets locked.

(b) After some times, the management wants to do the following modification to the
system to avoid the frequency of switching on and off of the fans.
 There should be a delay of 10 seconds before any of the fan is ON and it should
be ON if the condition for the fan does not get changed during that10 seconds.
 Also, before a fan is switched to OFF position, it should be checked whether the
condition remains the same for 8 seconds. If the condition (for the fan to be off)
does not get changed during that time, then it should be OFF.

Palitha Dassanayake 5
Programmable Logic Controllers

Modify the program written in (a) to satisfy this timing requirements.

You can use the following counters and timers as you wish using S7-200

On Delay Timer Off Delay Timer


TXX TXX

IN TON IN TOF
Q Q
PT ET PT ET

Table for timers (TON and TOF non retentive) (You cannot use the same timer for TON
and TOF at the same time)

Timer Number (TXX) Resolution Maximum Value (sec)


T32, T96 1 ms 32.767
T33-T36, T97-T100 10 ms 327.67
T37-T63, T101-T255 100 ms 3276.7

Up Counter Down Counter Up/Down Counter

CXX CXX CXX


CU CTU CD CTD CU CTUD

R LD CD

PV PV R

PV

Counter number CXX can be used from C0 to C255 and cannot exceed values 32,767 or
–32,767. You cannot use the same counter for two

Palitha Dassanayake 6

You might also like