Professional Documents
Culture Documents
AUTOMATION
1.2 Contents
Applications
Automation tools
Limitations
2
High initial cost: The automation of a new product or plant typically requires a very
large initial investment in comparison with the unit cost of the product.
1.4 Applications
o Automated retail
o Automated mining
o Automated manufacturing
o Home automation
o Industrial automation
3
1.6 Automation tools
4
Chapter 2: PROGRAMMABLE LOGIC CONTROLLER
5
2.1 PLC ARCHITECHTURE
Program: - In PLC ladder logic programming is used Vertical and horizontal form.
Function for Programming: - In this programming we use Timers, Counters, and Flags, PII,
PIQ and program.
System Data: - System data is a processor .It includes RAM, ROM, ALU, Memory sub
module and Serial port.
6
Fig.2: PLC SCAN CYCLE
1. Housekeeping or start: plc is the purpose of build m/c control computer design to read the
digital &analog input from various the sensors. Execute a user defined logic program &write
resulting digital &analog outputs values to various elements.eg: indication lamp, motors.
2. Input scan: The digital and analog values present at the output card is Saved to an input
memory table.
3. Logic execution: The user program is a scanned element by element then rung by rung until
end of the program and resulting value written to memory table.
4.Output scan: value from the resulting output memory table are written to output module.
Once the o/p scan is complete the process repeats itself until the plc is power down. The timer
takes to complete a scan cycle is approximately enough the scan millisecond. In order plc but in
new plcs the scan cycle time is only a few millisec.
1. Flexibility1.New technologies
2. Correcting errors2.Costly.
4.High speed.
7
2.4 Logic programming
Although it seems each model of PLC has its own idiosyncratic standard for programming,
thereDoes exist an international standard for controller programming that most PLC
manufacturers at least attempt to confirm to. This is the IEC 61131-3 standard, which will be
the standard presented in this chapter.
One should take solace in the fact that despite differences in the details of PLC programming
from one manufacturer to another and from one model to another, the basic principles are
largely the same.
There exist much greater disparities between different general-purpose programming languages
(e.g.C/C++, BASIC, FORTRAN, Pascal, Java, Ada, etc.) Than between the programming
languages supported by different PLCs, and this fact does not prevent computer programmers
from being Multilingual. After learning how to Program one model of PLC, it is quite easy
to adapt to programming other makes and models of PLC. If you are learning to program a
particular PLC that does not exactly conform to the IEC 61131-3 standard, you will still be able
to apply every single principle discussed in this chapter The fundamental concepts are truly
that universal.
The IEC 61131-3 standard specifies five distinct forms of programming language for industrial
Controllers:
Ladder Diagram (LD)
Structured Text (ST)
Instruction List (IL)
Function Block Diagram (FBD)
Sequential Function Chart (SFC)
The following (simplified) illustration shows a small PLC with two of its discrete input
channels electrically energized, causing those two bits to have 1 statuses. The color-
highlighted contacts in the programming editor softwares display shows a collection of
contacts addressed to those input bits in various states (colored = closed ; un-colored = open).
As you can see, any contact addressed to a set bit (1) is in its actuated state, while any contact
addressed to a cleared bit (0) is in its normal state:
8
Fig.3: CONTACTS INSIDE PLC`s MEMORY & ON EDITING SOFTWARE
Remember that a colored contact is a closed contact. The contacts appearing as colored
areeither normally-closed contact with 0 bit states, or normally-open contacts with 1 bit
states.It is the combination of bit state and contact type (NO vs. NC) that determines whether a
particularcontact will be open or closed at any given time. Correspondingly, it is a combination
of coloredhighlighting and contact type that indicates the real-world energization status of a
particular PLCinput at any given time. In my teaching experience, the main problem I see
students having withthis concept is over-simplification: they want to directly associate
electrical energization with coloron the screen, and that is not necessarily.
Once again, the fundamental rule one should keep in mind when examining a Ladder Diagram
PLC program is that each virtual contact shown in the program actuates whenever it. reads a
1 state in its respective bit. Secondly, a colored contact is closed, while an Un-colored contact
is open.
Normally-open (NO) virtual contacts will only pass virtual power (be colored) if their
respective bits are set (1). Normally-closed (NC) virtual contacts naturally pass virtual power
while in their resting states, when their respective bits are cleared (0).
9
2.4 Ladder Diagram (LD) programming
In the United States, the most common language used to program PLCs is Ladder
Diagram(LD), also known as Relay Ladder Logic (RLL). This is a graphical language showing
the logicalrelationships between inputs and outputs as though they were contacts and coils in a
hard-wiredelectromechanical relay circuit. This language was invented for the express purpose
of making PLCprogramming feel natural to electricians familiar with relay-based logic and
control circuits. WhileLadder Diagram programming has many shortcomings, it remains
extremely popular and so will bethe primary focus of this chapter.
Every Ladder Diagram program is arranged to resemble an electrical diagram, making this
agraphical (rather than text-based) programming language. Ladder diagrams are to be thought
of as virtual circuits, where virtual power flows through virtual contacts (when closed) to
energizevirtual relay coils to perform logical functions. None of the contacts or coils seen in
a LadderDiagram PLC program are real; rather, they act on bits in the PLCs memory, the
logical interrelationships between those bits expressed in the form of a diagram resembling a
circuit.Contacts appear just as they would in an electrical relay logic diagram as short vertical
linesegments separated by a horizontal space. Normally-open contacts are empty within the
spacebetween the line segments, while normally-closed contacts have a diagonal line crossing
throughthat space. Coils are somewhat different, appearing as either circles or pairs of
parentheses. Otherinstructions appear as rectangular boxes.
10
Each horizontal line is referred to as a rung; just as each horizontal step on a stepladder is
calleda rung. A common feature among Ladder Diagram program editors, as seen on this
screenshot, isFor example, you can see coil T2 energized at the upper-right corner of the screen
(filled with lightblue coloring), while coil T3 is not. Correspondingly, each normally-open T2
contact appears colored,indicating its closed status, while each normally-closed T2 contact is
uncolored. By contrast, eachnormally-open T3 contact is uncolored (since coil T3 is
unpowered) while each normally-closed T3contact is shown colored to indicate its conductive
status. Likewise, the current count values oftimers T2 and T3 are shown as 193 and 0,
respectively. The output value of the math instructionbox happens to be 2400, also shown in red
text.
11
Our systems wiring is shown in the following diagram:
Fig.5
A ladder program to determine if at least two out of the three sensors detect flame is shown
here,with the tag names referencing each contact and coil:
Fig.6
Series-connected contacts in a Ladder Diagram perform the logical AND function, while
parallelcontacts perform the logical OR function. Thus, this two-out-of-three flame-sensing
program couldbe verbally described as:
Burner is lit if either A and B, or either B and C, or A and C
An alternate way to express this is to use the notation of Boolean algebra, where
multiplicationrepresents the AND function and addition represents the OR function:
Burner lit = AB + BC + AC
12
Fig.7
Those two energized input channels set bits (1 status) in the PLCs memory representingthe
status of flame sensors B and C. Flame sensor As bit will be clear (0 status) because
itscorresponding input channel is de-energized. The fact that the output channel LED is
energized (andthe Burner lit indicator lamp is energized) tells us the PLC program has set
that correspondingbit in the PLCs output memory register to a 1 state.
Examining the Ladder Diagram program with status indication enabled, we would see how just
one of the series-connected contact pairs are passing virtual power to the output coil.
Fig.8
13
Contacts and relays are not just useful for implementing simple logic functions, but they may
alsoperform latching functions as well. A very common application of this in industrial PLC
systemsis a latching start/stop program for controlling electric motors by meansof
momentary-contactpushbutton switches.
Note the use of normally-open (NO) pushbutton switch contacts (again!), with no
auxiliarycontact providing status indication of the contactor to the PLC. This is a very minimal
program,shown for the strict purpose of illustrating the use of set and reset latching coils in
LadderDiagram PLC programming.
Fig.9
Set and Reset coilsare examples of what is known in the world of PLC programming
asretentive instructions. A retentive instruction retains its value after being virtually de-
energizedin the Ladder Diagram circuit. A standard output coil is non-retentive, which
means it does notlatch when de-energized. The concept of retentive and non-retentive
instructions will appear againas we explore PLC programming, especially in the area of timers.
14
It should be noted that the duration of a single PLC program scan is typically very
short:measured in milliseconds. If this program were actually tested in a real PLC, you would
probablynot be able to see either test lamp light up, since each pulse is so short-lived.
Contacts and coils represent only the most basic of instructions in the Ladder Diagram
PLCprogramming language. Many other instructions exist, which will be discussed in the
followingsubsections.
2.5 Counters
A counter is a PLC instruction that either increments (counts up) or decrements (counts
down)an integer number value when prompted by the transition of a bit from 0 to 1 (false to
true).Counter instructions come in three basic types: up counters, down counters, and
up/down counters.Both up and down counter instructions have single inputs for triggering
counts, whereasup/down counters have two trigger inputs: one to make the counter increment
and one to make the counter decrement.
To illustrate the use of a counter instruction, we will analyze a PLC-base system designed to
count objects as they pass down a conveyor belt.
Fig.10
In this system, a continuous (unbroken) light beam causes the light sensor to close its
outputcontact, energizing discrete channel IN4. When an object on the conveyor belt interrupts
15
thelight beam from source to sensor, the sensors contact opens, interrupting power to input
IN4. Apushbutton switch connected to activate discrete input IN5 when pressed will serve as a
manualreset of the count value. An indicator lamp connected to one of the discrete output
channels willserve as an indicator of when the object count value has exceeded some pre-set
limit.
We will now analyze a simple Ladder Diagram program designed to increment a counter
Instruction each time the light beam breaks.
Fig.11
Status indication is shown in this Ladder Diagram program, with the counters preset value(PV)
of 25 and the counters current value (CV) of 0 shown highlighted in blue. The present value is
something programmed into the counter instruction before the system put into service, and it
servesas a threshold for activating the counters output (Q), which in this case turns on the
count indicatorlamp (the OUT counts reached coil). According to the IEC 61131-3
16
programming standard, thiscounter output should activate whenever the current value is equal
to or greater than the presetvalue (Q is active if CV PV).
Fig.12
If all we did not care about maintaining an accurate total count of objects past 25 but
merelywished the program to indicate when 25 objects had passed by we could also use a
down counterinstruction preset to a value of 25, which turns on an output coil when the count
reaches zero.
Fig.13
Here, a load input causes the counters current value to equal the preset value (25)
whenactivated. With each sensor pulse received, the counter instruction decrements. When it
reacheszero, the Q output activates.
2.6 Timers
A timer is a PLC instruction measuring the amount of time elapsed following an event.
Timerinstructions come in two basic types: on-delay timers and off-delay timers. Both on-
delay andoff-delay timer instructions have single inputs triggering the timed function.
An on-delay timer activates an output only when the input has been active for a
minimumamount of time. Take for instance this PLC program, designed to sound an audio
alarm siren priorto starting a conveyor belt. To start the conveyor belt motor, the operator must
17
press and holdthe Start pushbutton for 10 seconds, during which time the siren sounds,
warning people to clearaway from the conveyor belt that is about to start. Only after this 10-
second start delay does themotor actually start (and latch on):
Fig.14
Similar to an up counter, the on-delay timers elapsed time (ET) value increments once
persecond until the preset time (PT) is reached, at which time its output (Q) activates. In this
program,the preset time value is 10 seconds, which means the Q output will not activate until
the Startswitch has been depressed for 10 seconds. The alarm siren output, which is not
activated by thetimer, energizes immediately when the Start pushbutton is pressed.
An important detail regarding this particular timers operation is that it be non-retentive.
Thismeans the timer instruction should not retain its elapsed time value when the input is de-
activated.Instead, the elapsed time value should reset back to zero every time the input de-
activates. Thisensures the timer resets itself when the operator releases the Start pushbutton.
A retentive on delaytimer, by contrast, maintains its elapsed time value even when the input is
de-activated. Thismakes it useful for keeping running total times for some event.
For example, if we wished to add a retentive timer to our conveyor control system to record
totalrun time for the conveyor motor, we could do so using an enabled IEC 61131-3 timer
instructionlike this:
18
Fig.15
When the motors contactor bit (OUT contactor) is active, the timer is enabled and allowed
totime. However, when that bit de-activates (becomes false), the timer instruction as a whole
isdisabled, causing it to freeze and retain its current time (CT) value23. This allows the motor
tobe started and stopped, with the timer maintaining a tally of total motor run time.If we wished
to give the operator the ability to manually reset the total run time value to zero,we could hard-
wire an additional switch to the PLCs discrete input card and add reset contactsto the
program like this.
Fig.16
Whenever the Reset switch is pressed, the timer is enabled (EN) but the timing input (IN)
isDisabled, forcing the timer to (non-retentively) reset its current time (CT) value to zero.
The other major type of PLC timer instruction is the off-delay timer. This timer
instructiondiffers from the on-delay type in that the timing function begins as soon as the
instruction is deactivated,not when it is activated. An application for an off-delay timer is a
cooling fan motorcontrol for a large industrial engine. In this system, the PLC starts an electric
cooling fan as soon asthe engine is detected as rotating, and keeps that fan running for two
minutes following the enginesshut-down to dissipate residual heat:
19
Fig.17
When the input (IN) to this timer instruction is activated, the output (Q) immediately
activates(with no time delay at all) to turn on the cooling fan motor contactor. This provides the
enginewith cooling as soon as it begins to rotate (as detected by the speed switch connected to
the PLCsdiscrete input). When the engine stops rotating, the speed switch returns to its
normally-openposition, de-activating the timers input signal which starts the timing sequence.
The Q outputremains active while the timer counts from 0 seconds to 120 seconds. As soon as
it reaches 120seconds, the output de-activates (shutting off the cooling fan motor) and the
elapsed time valueremains at 120 seconds until the input re-activates, at which time it resets
back to zero.
The following timing diagrams compare and contrast on-delay with off-delay timers:
Fig.18
20
While it is common to find on-delay PLC instructions offered in both retentive and non-
retentiveforms within the instruction sets of nearly every PLC manufacturer and model, it is
almost unheardof to find retentive off-delay timer instructions. Typically, off-delay timers are
non-retentive only.
2.7 COMPARISON INSTRUCTION AND MATHINSTRUCTIONS IN PLC
PROGRAMMING
COMPARISON INSTRUCTION
A comparison instruction compares values of data. Depending on the data to be compared it
returns true or false logic. They are controlling instructions and can be used any-where in a
ladder logic program, except at the right-most position of a rung. Some of the comparison
instructions are as follows:
Fig 19
The Q output for each instruction box activates whenever the evaluated comparison function
21
is true and the enable input (EN) is active. If the enable input remains active but the
comparison function is false, the Q output de-activates. If the enable input de-de-activates, the
Q output retains Bits last state.
EQU [Equal]
This input instruction is true when Source A = Source B.
The EQU instruction compares two user specified values. If the values are equal, it
allows rung continuity. The rung goes true and the output is energized
You must enter a word address for Source A. You can enter a program constant or a
word address for Source B.
22
If the value at Source A is greater than or equal to the value at Source B, the instruction
is logically false.
Enter a word address for Source A. Enter a constant or a word address for Source B.
If the value at source A is greater than the value at source B, the instruction is logically
false.
GRT [Greater Than]
This input instruction compares two user specified values.
If the value stored in Source A is greater than the value stored in Source B, it allows
rung continuity. The rung will go "true" and the output will be energized (provided no
other instructions affect the rung's status).
If the value at Source A is less than or equal to the value at Source B, the instruction is
logically false.
23
If the value stored in Source A is greater than or equal to the value stored in Source B, it
allows rung continuity. The rung will go true and the output will be energized (provided
no other instructions affect the rung's status).
If the value at Source A is less than the value at Source B, the instruction is logically
false.
The instruction is true when the Test value is between the limits or is equal to either
limit.
If the Test value is outside the limits, the instruction is false.
MATH INSTRUCTIONS
Mathematical functions are controlled instructions which retrieve one or more values, perform
an operation and store the result in memory. In a ladder logic program, when its rung is true,
the mathematical operation is performed. Commonly used math instructions include:
24
Fig20
As with the data comparison instructions, each of these math instructions must be enabled byan
energized signal to the enable (EN) input. Input and output values are linked to each
mathinstruction by tag name.
An example showing the use of such instructions is shown here, converting a
temperaturemeasurement in units of degrees Fahrenheit to units of degrees Celsius. In this
particular case, theprogram inputs a temperature measurement of 138F and calculates the
equivalent temperature of 58.89 C
25
Fig 21
AND INSTRUCTION
OR INSTRUCTION
NAND INSTRUCTION
NOT INSTRUCTION
X-OR INSTRUCTION
X-NOR INSTRUCTION
HMI stands for Human Machine Interface. This is the interface between the operator and
the controller.The HMI is the controller operating panel. The panel comprises a numeric
keypad and a LCD screen that displays text.The keypad is used to input data into the
application, such as Timer values.
The PLC's Display screen can show operator messages, variable information from the
program and system information.
26
4.1 Advantages of HMI:
Disadvantages :
a. When a push button is pressed then the output will goes on after 100 seconds.
27
Fig 22
b. When a start push button is pressed then the 1st output will goes on and then after 100
seconds then 2nd output will goes on but the 1st output will goes off.
Fig 23
28
Fig 24
29
4.1 INTRODUCTION
SCADA stands for Supervisory Control And Data Acquisition. It generally refers to
an industrial control system: a computer system monitoring and controlling a process.
The process can be industrial, infrastructure or facility based as described below:
Infrastructure processes may be public or private, and include water treatment and
distribution, wastewater collection and treatment, oil and gas pipelines, electrical power
transmission and distribution, wind farms, civil defence siren systems, and large
communication systems,utility processes occur both in public facilities and private ones,
including buildings, airports, ships, and space stations. They monitor and control
heating, ventilation, and air conditioning systems (HVAC), access, and energy
consumption.
A supervisory (computer) system, gathering (acquiring) data on the process and sending
commands (control) to the process.
Remote terminal units (RTUs) connecting to sensors in the process, converting sensor
signals to digital data and sending digital data to the supervisory system.
Programmable logic controller (PLCs) used as field devices because they are more
economical, versatile, flexible, and configurable than special-purpose RTUs.
30
4.3 Systems concepts
The term SCADA usually refers to centralized systems which monitor and control
entire sites, or complexes of systems spread out over large areas ( anything from
an industrial plant to a nation). Most control actions are performed automatically
by RTUs or by PLCs. Host control functions are usually restricted to basic overriding or
supervisory level intervention. For example, a PLC may control the flow of cooling water
through part of an industrial process, but the SCADA system may allow operators to change the
set points for the flow, and enable alarm conditions, such as loss of flow and high temperature,
to be displayed and recorded. The feedback control loop passes through the RTU or PLC, while
the SCADA system monitors the overall performance of the loop.
Data acquisition begins at the RTU or PLC level and includes meter readings and equipment
status reports that are communicated to SCADA as required. Data is then compiled and
formatted in such a way that a control room operator using the HMI can make supervisory
decisions to adjust or override normal RTU (PLC) controls. Data may also be fed to an
Historian, often built on a commodity Database Management System, to allow trending and
other analytical auditing.
31
SCADA systems typically implement a distributed database, commonly referred to as a tag
database, which contains data elements called tags or points. A point represents a single input
or output value monitored or controlled by the system. Points can be either "hard" or "soft". A
hard point represents an actual input or output within the system, while a soft point results from
logic and math operations applied to other points. (Most implementations conceptually remove
the distinction by making every property a "soft" point expression, which may, in the simplest
case, equal a single hard point.) Points are normally stored as value-timestamp pairs: a value,
and the timestamp when it was recorded or calculated. A series of value-timestamp pairs gives
the history of that point. It is also common to store additional metadata with tags, such as the
path to a field device or PLC register, design time comments, and alarm information.
32
33