You are on page 1of 612

Industrial Automation

Second Semester 2017/2018


Lecturer: Dr Mohannad Jreissat

Department of Industrial Engineering


Faculty of Engineering

Textbooks:
Groover, Mikell P. , Automation, Production Systems, and Computer-
Integrated Manufacturing, Global Edition, 4th edition
Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill
Companies Inc., 5th edition

Email: Drjreissat@gmail.com
Office: E3088
Introduction To Industrial
Automation and Control
Key words:
 Industry
Systematic Economic Activity that could be related to
Manufacture/Service/Trade.

 Automation
In General, It is the mechanism for systems that “move by itself”. It
is defined as a set of technologies that results in operation of
machines and systems without significant human intervention and
achieves performance superior to manual operation in terms of
power, precision and speed of operation.
Introduction To Industrial
Automation and Control

1. Why does an automated system achieve superior


performance compared to a manual one?

2. Can you give an example where this happens?


Introduction To Industrial
Automation and Control

 Control
A set of technologies that achieves desired patterns of variations of
operational parameters and sequences for machines and systems by
providing the input signals necessary.
3. Can you explain the above definition in the context of
a common control system, such as temperature control in
an oven?

4. Is the definition applicable to open-loop as well as


closed loop control?
Automation VS. Control systems

 Automation Systems may include Control Systems but the


reverse is not true. Control Systems may be parts of Automation
Systems.

 The main function of control systems is to ensure that outputs


follow the set points. However, Automation Systems may have
much more functionality, such as computing set points for
control systems, monitoring system performance, plant start-up
or shutdown, job and equipment scheduling etc.

** Automation Systems are essential for most modern industries. It


is therefore important to understand why they are so.
5. Can you give an example of an automated system,
which contains a control system as a part of it?

6. What are the other parts of the system?


Industrial Automation vs. Industrial
Information Technology
 Industrial Automation makes extensive use of Information Technology

Major IT areas that are used in the context of Industrial Automation


1. Industrial Automation also involves significant amount of
hardware technologies, related to Instrumentation and
Sensing, Actuation and Drives, Electronics for Signal
Conditioning, Communication and Display, Embedded as well
as Stand-alone Computing Systems etc.
2. As Industrial Automation systems grow more sophisticated in
terms of the knowledge and algorithms they use, as they
encompass larger areas of operation comprising several units
or the whole of a factory, or even several of them, and as they
integrate manufacturing with other areas of business, such as,
sales and customer care, finance and the entire supply chain of
the business, the usage of IT increases dramatically. However,
the lower level Automation Systems that only deal with
individual or , at best, a group of machines, make less use of IT
and more of hardware, electronics and embedded computing.
Role of automation in industry
 Manufacturing processes, basically, produce finished product from
raw/unfinished material using energy, manpower and equipment
and infrastructure.

 Since an industry is essentially a “systematic economic activity”,


the fundamental objective of any industry is to make profit.

 Roughly speaking,
Profit = (Price/unit – Cost/unit) x Production Volume ……… (1)
So profit can be maximised by producing good quality products,
which may sell at higher price, in larger volumes with less production
cost and time.
The major parameters that affect the cost/unit of
a mass-manufactured industrial product.
The major factors that contribute to Overall
Production Time
 Automation affects all of these factors.
 Firstly, automated machines have significantly lower production
times. For example, in machine tools, manufacturing a variety of
parts, significant setup times are needed for setting the operational
configuration and parameters whenever a new part is loaded into
the machine. This can lead to significant unproductive for expensive
machines when a variety of products is manufactured. In Computer
Numerically Controlled (CNC) Machining Centers set up time is
reduced significantly with the help of Automated Tool Changers,
Automatic Control of Machines from a Part Program loaded in the
machine computer.
 Similarly, systems such as Automated Guided Vehicles, Industrial
Robots, Automated Crane and Conveyor Systems reduce material
handling time.
 Automation also reduces cost of production significantly by efficient
usage of energy, manpower and material.
 The product quality that can be achieved with automated precision
machines and processes cannot be achieved with manual
operations. Moreover, since operation is automated, the same
quality would be achieved for thousands of parts with little
variation.
 Industrial Products go through their life cycles, which consists of
various stages.

Typical Industrial Product Life Cycle


Industrial Product Life Cycle:

1. At first, a product is conceived based on Market feedbacks, as


well as Research and Development Activities.
2. Once conceived the product is designed. Prototype
Manufacturing is generally needed to prove the design.
3. Once the design is proved, Production Planning and Installation
must be carried out to ensure that the necessary resources and
strategies for mass manufacturing are in place.
4. This is followed by the actual manufacture and quality control
activities through which the product is mass-produced.
5. This is followed by a number of commercial activities through
which the product is actually sold in the market.
6. Automation also reduces the overall product life cycle i.e., the
time required to complete (i) Product conception and design
(ii) Process planning and installation (iii) Various stages of the
product life cycle are shown as in the Figure before.
Economy of Scale and Economy of Scope

 Economy of Scale
 Reduction in cost per unit resulting from increased production,
realized through operational efficiencies. Economies of scale
can be accomplished because as production increases, the cost
of producing each additional unit falls.
 Automation facilitates economy of scale, since, as explained
above, it enables efficient large-scale production.
 Economy of Scope
 The situation that arises when the cost of being able
manufacture multiple products simultaneously proves more
efficient than that of being able manufacture single product at
a time.
 Economy of scope arises in several sectors of manufacturing, but
perhaps the most largely in electronic product manufacturing
where complete product life cycle, from conception to market,
are executed in a matter of months, if not weeks. Therefore, to
shrink the time to market drastically use of automated tools is
mandated in all phases of the product life cycle. Additionally,
since a wide variety of products need to be manufactured within
the life period of a factory, rapid programmability and
reconfigurability of machines and processes becomes a key
requirement for commercial success. Such an automated
production system also enables the industry to exploit a much
larger market and also protects itself against fluctuations in
demand for a given class of products. Indeed it is being driven by
the economy of scope, and enabled by Industrial Automation
Technology that Flexible Manufacturing (i.e. producing various
products with the same machine) has been conceived to increase
the scope of manufacturing.
7. Can you give an example of an industry where economy of
scope is more significant than the economy of scale?

Ans: One such example would a job shop which manufactures


custom machine parts by machining according to customer
drawings. Another example would be a factory to manufacture
Personal Computer components

8. Can you give an example of an industry where economy of


scale is more significant than the economy of scope?

Ans: One such example would be a Power plant. Another one


would be a Steel Plant.
Types of production systems
Major industrial processes can be categorized as follows based on
their scale and scope of production.

• Continuous flow process: Manufactured product is in continuous


quantities i.e., the product is not a discrete object. Moreover, for
such processes, the volume of production is generally very high,
while the product variation is relatively low. Typical examples of
such processes include Oil Refineries, Iron and Steel Plants, Cement
and Chemical Plants.

• Mass Manufacturing of Discrete Products: Products are discrete


objects and manufactured in large volumes. Product variation is
very limited. Typical examples are Appliances, Automobiles etc.
Types of production systems
• Batch Production: In a batch production process the product is
either discrete or continuous. However, the variation in product
types is larger than in continuous-flow processes. The same set
of equipment is used to manufacture all the product types.
However for each batch of a given product type a distinct set of
operating parameters must be established. This set is often
referred to as the “recipe” for the batch. Typical examples here
would be Pharmaceuticals, Casting Foundries, Plastic moulding,
Printing etc.
• Job shop Production: Typically designed for manufacturing small
quantities of discrete products, which are custom built, generally
according to drawings supplied by customers. Any variation in
the product can be made. Examples include Machine Shops,
Prototyping facilities etc.
Types of Production Systems
Types of Automation Systems

• Automation systems can be categorized based on


the flexibility and level of integration in
manufacturing process operations.

• Various automation systems can be classified as


follows :
Types of Automation Systems
1. Fixed Automation: It is used in high volume production with
dedicated equipment, which has a fixed set of operation and
designed to be efficient for this set. Continuous flow and
Discrete Mass Production systems use this automation. e.g.
Distillation Process, Conveyors, Paint Shops, Transfer lines etc.

• A process using mechanized machinery to perform fixed and


repetitive operations in order to produce a high volume of
similar parts.
Types of Automation Systems
2. Programmable Automation: It is used for a changeable
sequence of operation and configuration of the machines using
electronic controls. However, non-trivial programming effort may
be needed to reprogram the machine or sequence of operations.
Investment on programmable equipment is less, as production
process is not changed frequently. It is typically used in Batch
process where job variety is low and product volume is medium
to high, and sometimes in mass production also. e.g. in Steel
Rolling Mills, Paper Mills etc.
3. Flexible Automation: It is used in Flexible Manufacturing Systems
(FMS) which is invariably computer controlled. Human operators
give high-level commands in the form of codes entered into
computer identifying product and its location in the sequence and
the lower level changes are done automatically. Each production
machine receives settings/instructions from computer. These
automatically loads/unloads required tools and carries out their
processing instructions. After processing, products are automatically
transferred to next machine. It is typically used in job shops and
batch processes where product varieties are high and job volumes
are medium to low. Such systems typically use Multi purpose CNC
machines, Automated Guided Vehicles (AGV) etc.
4. Integrated Automation: It denotes complete automation of a
manufacturing plant, with all processes functioning under
computer control and under coordination through digital
information processing. It includes technologies such as
computer-aided design and manufacturing, computer-aided
process planning, computer numerical control machine tools,
flexible machining systems, automated storage and retrieval
systems, automated material handling systems such as robots and
automated cranes and conveyors, computerized scheduling and
production control. It may also integrate a business system
through a common database. In other words, it symbolizes full
integration of process and management operations using
information and communication technologies. Typical examples
of such technologies are seen in Advanced Process Automation
Systems and Computer Integrated Manufacturing (CIM)
Types of Automation Systems
As can be seen from above, from Fixed Automation to CIM the
scope and complexity of automation systems are increasing.
Degree of automation necessary for an individual manufacturing
facility depends on manufacturing and assembly specifications,
labor conditions and competitive pressure, labor cost and work
requirements.
One must remember that the investment on automation must
be justified by the consequent increase in profitability. To
exemplify, the appropriate contexts for Fixed and Flexible
Automation are compared and contrasted.
• Fixed automation is appropriate in the following

circumstances:

1. Low variability in product type as also in size, shape, part

count and material

2. Predictable and stable demand for 2- to 5-year time period, so

that manufacturing capacity requirement is also stable

3. High production volume desired per unit time

4. Significant cost pressures due to competitive market

conditions. So automation systems should be tuned to

perform optimally for the particular product.


• Flexible automation, on the other hand is used in the following
situations:

1. Significant variability in product type. Product mix requires a


combination of different parts and products to be
manufactured from the same production system

2. Product life cycles are short. Frequent upgradation and design


modifications alter production requirements

3. Production volumes are moderate, and demand is not as


predictable
9. During a technical visit to an industry how can you identify the
type of automation prevailing there from among the above types?

10. For what kind of a factory would you recommend computer


integrated manufacturing and why?

11. What kind of automation would you recommend for


manufacturing
a. Light bulbs
b. Garments
c. Textile
d. Cement
e. Printing
f. Pharmaceuticals
g. Toys 3
Summary
 Definition of Automation and its relations with fields of Automatic
Control and Information Technology: It is seen that both control
and IT are used in automation systems to realize one or more of
its functionalities. Also, while Control Technology is used for
operation of the individual machines and equipment, IT is used
for coordination, management and optimized operation of overall
plants.
 The role played by Automation in realizing the basic goal of
profitability of a manufacturing industry: It is seen that
Automation can increase profitability in multiple ways by
reducing labour, material and energy requirements, by improving
quality as well as productivity. It is also seen that Automation is
not only essential to achieve Economy of Scale, but also for
Economy of Scope.
 Types of Factories and Automation Systems that are
appropriate for them: Factories have been classified into four
major categories based on the product volumes and product
variety. Similarly Automation Systems are also categorized into
four types and their appropriateness for the various categories
of factories explained.
Part II AUTOMATION AND
CONTROL TECHNOLOGIES
Chapters:
4. Introduction to Automation
5. Industrial Control Systems
6. Hardware Components for Automation and Process
Control
7. Computer Numerical Control
8. Industrial Robotics
9. Discrete Control and Programmable Logic Controllers

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist.
No portion of this material may be reproduced, in any form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book
Automation, Production Systems, and Computer-Integrated Manufacturing, Fourth Edition, by Mikell P. Groover.
Automation and Control Technologies
in the Production System

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Ch 4 Introduction to Automation
Sections:
1. Basic Elements of an Automated System
2. Advanced Automation Functions
3. Levels of Automation

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Automation Defined

Automation is the technology by which a process or


procedure is accomplished without human assistance
 Basic elements of an automated system:
1. Power - to accomplish the process and operate
the automated system
2. Program of instructions – to direct the process
3. Control system – to actuate the instructions

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Elements of an Automated System

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Power to Accomplish the
Automated Process
 Power for the process
 To drive the process itself
 To load and unload the work unit
 Transport between operations
 Power for automation
 Controller unit
 Power to actuate the control signals
 Data acquisition and information processing

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Electricity -
The Principal Power Source
 Widely available at moderate cost
 Can be readily converted to alternative forms, e.g.,
mechanical, thermal, light, etc.
 Low level power can be used for signal transmission,
data processing, and communication
 Can be stored in long-life batteries

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Program of Instructions

Set of commands that specify the sequence of steps in the


work cycle and the details of each step
 Example: NC part program
 During each step, there are one or more activities
involving changes in one or more process parameters
 Examples:
 Temperature setting of a furnace
 Axis position in a positioning system
 Motor on or off

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Decision-Making in a
Programmed Work Cycle
 Following are examples of automated work cycles in which
decision making is required:
 Operator interaction
 Automated teller machine
 Different part or product styles processed by the
system
 Robot welding cycle for two-door vs. four door car
models
 Variations in the starting work units
 Additional machining pass for oversized sand
casting

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Features of a Work Cycle Program

 Number of steps in the work cycle


 Manual participation in the work cycle (e.g., loading
and unloading workparts)
 Process parameters - how many must be controlled?
 Operator interaction - does the operator enter
processing data?
 Variations in part or product styles
 Variations in starting work units - some adjustments in
process parameters may be required to compensate
for differences in starting units

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Control System – Two Types
1. Closed-loop (feedback) control system – a system in
which the output variable is compared with an input
parameter, and any difference between the two is used
to drive the output into agreement with the input
2. Open-loop control system – operates without the
feedback loop
 Simpler and less expensive
 Risk that the actuator will not have the intended
effect

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
(a) Feedback Control System and
(b) Open-Loop Control System

(a)

(b)

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Positioning System Using
Feedback Control
A one-axis position control system consisting of a leadscrew
driven by a dc servomotor and using an optical encoder as
the feedback sensor

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
When to Use an
Open-Loop Control System
 Actions performed by the control system are simple
 Actuating function is very reliable
 Any reaction forces opposing the actuation are small
enough as to have no effect on the actuation
 If these conditions do not apply, then a closed-loop control
system should be used

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Advanced Automation Functions

1. Safety monitoring
2. Maintenance and repair diagnostics
3. Error detection and recovery

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Safety Monitoring
Use of sensors to track the system's operation and identify
conditions that are unsafe or potentially unsafe
 Reasons for safety monitoring
 To protect workers and equipment
 Possible responses to hazards:
 Complete stoppage of the system
 Sound an alarm
 Reduce operating speed of process
 Take corrective action to recover from the safety
violation
© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Maintenance and Repair Diagnostics

 Status monitoring
 Monitors and records status of key sensors and
parameters during system operation
 Failure diagnostics
 Invoked when a malfunction occurs
 Purpose: analyze recorded values so the cause of
the malfunction can be identified
 Recommendation of repair procedure
 Provides recommended procedure for the repair
crew to effect repairs

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Error Detection and Recovery
1. Error detection – functions:
 Use the system’s available sensors to determine
when a deviation or malfunction has occurred
 Correctly interpret the sensor signal
 Classify the error
2. Error recovery – possible strategies:
 Make adjustments at end of work cycle
 Make adjustments during current work cycle
 Stop the process to invoke corrective action
 Stop the process and call for help
© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Levels of Automation
1. Device level – actuators, sensors, and other hardware
components to form individual control loops for the next
level
2. Machine level – CNC machine tools and similar
production equipment, industrial robots, material
handling equipment
3. Cell or system level – manufacturing cell or system
4. Plant level – factory or production systems level
5. Enterprise level – corporate information system

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Levels of Automation

© 2016 Pearson Education, Ltd. All rights reserved. This material is protected under all copyright laws as they currently exist. No portion of this material may be reproduced, in any
form or by any means, without permission in writing from the publisher. For the exclusive use of adopters of the book Automation, Production Systems, and Computer-Integrated
Manufacturing, Fourth Edition, by Mikell P. Groover.
Industrial Automation
First Semester 2018/2019
Lecturer: Dr Mohannad Jreissat

Department of Industrial Engineering


Faculty of Engineering

Textbooks:
Groover, Mikell P. , Automation, Production Systems, and Computer-
Integrated Manufacturing, Global Edition, 4th edition
Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill
Companies Inc., 5th edition

Email: Drjreissat@hu.edu.jo
Office: E3088
Industrial Automation
Study of methods and technologies for controlling energy,
material and information flows in production processes

Advantages due to the automation of production processes:


 Better product quality
 Improved flexibility (use of the same plant for building
multiple products)
 Reduced production time and costs
 Reduced time for complying with new laws
 Better use of available resources

Improved competitiveness of the company


Planning of production processes

There are also feedback paths from nodes to higher levels


Role of automation
Flexible manufacturing systems

Control of production processes


Main problem: products become obsolete ⇨ companies have to
quickly adapt production processes
Solution: flexible manufacturing systems, i.e. ability to produce different
product types and adapt to new products

The control of manufacturing systems is split into several subproblems


of different nature.
Management science

Management: decisions can be either “instinctive” or structured


 “Instinctive” decisions:
Pros: rapidity and flexibility
Cons: no quantitative model
- limited number of the alternatives
- limited understanding of decision criteria

Drawbacks can be extremely critical if decisions are complex


(several alternatives / mutually dependent choices / limited resources)
Management science
 Structured decisions (based on a quantitative model):
Pros:
* Better understanding of the problem
- consideration of all possible alternatives
- precise decision criteria
* optimal decisions can be taken even for complex problems
Cons:
*getting a mathematical model of a decision problem might
be time and resource consuming
- trade-off between time/resources for decision-making and
benefits of optimality. Very often optimality wins !
Example: Product Mix
A company manufactures two radio models (low-cost and high-end)
and produces two components
Department A: antennas
- no more than 120h hours of production per day
- 1h of work for a low-cost antenna
- 2h of work for a high-end antenna
Department B: cases
- no more than 90h hours of production per day
- 1h of work for a low-cost case
- 1h of work for a high-end case

The company has two assembly lines (1 radio =1 antenna + 1 case)


- Line 1: production of low-cost models. No more than 70 units/day
- Line 2: production of high-end models. No more than 50 units/day
Example: Product Mix

Profits: $20 for a low-cost radio and $30 for a high-end radio
Assuming the company will sell all the radios, which is the optimal
number of units, for each model, that must be produced daily for
maximizing the revenue?
Optimal daily production plan = mix of two products
Example: Product Mix

Instinctive (and greedy) manager: higher profits for high-end models


⇨ maximize their production (50 units/day)
Department A: 100h for high-end antennas (50 antennas)
⇨20h for low-cost antennas(20 antennas)
Department B: 50h for high-end cases (50 cases)
⇨20h for low-cost cases (20 cases)

Line 1: 20 low-cost radios per day


Line 2: 50 high-end radios per day
Daily profits: 20*20+50*30= $1900. Is there any better solution ?
Example: Product Mix
Smart manager: 60 low-cost models and 30 high-end models

Department A: 60h for high-end antennas (30 antennas)


⇨60h for low-cost antennas (60antennas)
Department B: 30h for high-end cases (30 cases)
⇨60h for low-cost cases (60 cases)

Line 1: 60 low-cost radios per day


Line 2: 30 high-end radios per day

Daily profits: 60*20 + 30*30 = $2100


Example: Product Mix

 Decisions taken by the smart manager are optimal


(profits cannot increase)

 - How the manager came up with this plan ? How can


we certify it is optimal ?
Automation of decision processes
Decisions based on quantitative models: workflow
This is an introduction to programmable logic controllers - PLCs for short .
Here is a picture of a simple one.
A programmable logic controller is unit of hardware used to control and
automate an industrial processes. They were initially designed to replace
hardwired relay-based controls. Nowadays they can even perform PID control
action.
PLCs are used to solve control problems from simple to complex and over the
last 20 years have been very popular in industry. A controls engineer’s
responsibilities may be designing PLC systems and troubleshooting and
enhancing functionality after installation.

-----other notes---------
This picture was taken from here:
http://www.controltech.cz/images/clanky/image30.jpg

1
This sketch is the initial concept for a very common situation – an electric
machine that can be started and stopped from two separate locations. In this
case the machine is ….
You may add safety features and interlocking options (e.g., option to prevent
remote shutdown) and the logic can become quite complicated -…

The diagram shows inputs (push buttons), outputs (the voltages applied to the
machine) and a logic – which in thos case it is implemented through the wiring.
These are the essential components in a PLC

2
Here are three main aspect of a programmable logic controller or PLC. Inputs,
outputs and the control program. The inputs are connected to sensor devices
that inform the PLC about the environment. The program uses a set of logical
instructions that drives the outputs based on the inputs. The outputs are
connected to equipment needs to be controlled.

3
Some example Input devices for a PLC or Programmable Logic Controllers are
push buttons, proximity switches, photoelectric sensors, temperature sensors,
etc. Anything that can measure the environment and then transmit a signal to
the PLCs input.

PLC outputs are anything that would need to be controlled based on the inputs
like motors, indicator lights, fans or heating elements.

PLCs come in a variety of flavors…


--------------

Picture sources:

Push button
http://www.nfauto.co.uk/images/november/push_button_switch1.jpg
Photo sensor
http://www.advancedmanufacturing.com/MarApr03/images/photoelectric_01.jp
g

4
Pressure sensor
http://www.flowtechnik.co.uk/images/pressure-sensor-hd.jpg
Motor
http://www.kingsolar.com/catalog/mfg/dayton/5k586.jpg

4
A relay is a device that responds to a voltage change by activating a switch.
When the input is energized with a voltage a current will flow thought the coil
and cause it to become magnetized. Magnetic force will pull the contact close
and thus close the circuit. When the input voltage taken away the magnet will
de-actiave and the contact will open again. A relay and a contactor basically
serve the same function. The name contactor is simply used for high current.

5
Here we show two common types of Programmable Logic Controllers or PLCs
a single box type and a modular or rack type.

The box type is smaller and used for simpler control situations. It is supplied as
an stand alone package that is ready for implementation. That is a box type
PLC has everything it needs to control a process. Some of the most basic of
theses only have 4 outputs. They typically can have from 4 to 40 inputs and
outputs. Depending on size and functionality they can cost between $100 and
$1000.

The modular type consists of a central rack that house various modules such
as power supply, processor, analog or digital input and outputs and
communications, and special function modules. The modules are selected
based on the control problem. I/O modules can always be added after the unit
it installed to suit new needs and the I/O modules can be much more
specialized than that of the box type PLCs. It is used for larger and more
complex operations. Typically has from 20 to 100 inputs and outputs and up.
These units typically start at $500 and can get pretty expensive

---other notes---

6
Box type picture is from
http://www.schneider-electric.no/produkte/automation/img/48/nano1.jpg

The rack type picture is from


http://www.ab.com/en/epub/catalogs/12762/2181376/2416247/1239760/15512
29/

6
Here some examples of what PLCs are used for. They are implemented in a
variety of control operations from large to small. Carwashes are a popular use
for PLCs because it involves intricate use sensors and motors, but also has
the need for relatively complex logic. Carwashes have several wash types that
use or doesn’t use certain features. It is often a unique and involved process,
but it is greatly simplified when done in the PLCs software as opposed to a
hardware implementation.

PLCs are used for sorting packages on a conveyor by operating a diverter.


One conveyor can move many types of packages. A sensor can detect a
package type and a series of diverters can sort them at the end of the belt. In
this way, one conveyor can be used instead of many. But the PLC is flexible, it
can be reprogrammed if and when the sorting task changes or if enhanced
operation is needed.

PLCs are used to operate greenhouse irrigations systems. It can be used to


control how often and the amount of water distributed to certain areas. It can
control a large amount of valves to certain areas and is flexible as the
greenhouse’s needs change.

7
Lumber mills use PLCs to control the main saw and loading of wood while
various sensors ensure safe operation so that people and equipment are not
harmed. A lumber mill saw is very expensive and many precautions must be
taken to ensure that nothing goes wrong when moving lumber through the mill.

PLCs can withstand the hash condition desert conditions while controlling an
oil recovery process. Temperatures can get higher than 120 degrees
Fahrenheit in the desert, yet a plc can read sensors and control the motors
necessary for oil extraction. These tiny computers are meant to be rugged.

-----other notes---------

A store's automatic sliding doors are controlled during both business and off-
hours using Pico. The store
also uses Pico to allow off-hour access to employees only.

A self-service, coin-
operated carwash needs to count the number of quarters inserted, as well as
time the wash cycle per car. A Pico controller is programmed to do both.

7
Often industrial equipment will use three phase power for various reasons
such as cost, size and durability. Suppose some industrial woodworking
equipment is installed at a residential home. In order to use the equipment, the
normal two phase power into the house needs to be converted into three
phase power via a converter. Some of the equipment is located in the garage
and some in the basement. The three phase power needs to be available at
both locations. Consequently, the converter needs to be able to be activated
and deactivated from both locations.

-----------Other Notes------------------
Source: http://www.metalwebnews.com/howto/phase-converter/phase-
converter.html
Picture of converter: http://www.phase-a-matic.com/RotaryDescription.htm

8
The converter has three contacts. Two are connected to the 220 VAC source.
The other is connected to a starting capacitor and a push button. When the
power is switched on nothing immediately happens. The 3-phase converter
has a motor that needs to be started via a starting capacitor. After the motor
has started only the 220 VAC source is required for continued operation. When
3-phase power is no longer needed, the process is stopped by disconnecting
power.

However this is just the basic concept of operation. The process should simply
have one button for start and one button for stop at each location. This means
that a timed relay will take the place of the momentary push button, and a
relay latching system is need instead of a the power switch. In this way, the
system can operate using push buttons.

9
Here is a block diagram that shows the manner in which each device is
connected to each other. Hopefully the wiring looks a little confusing. The
blocks in yellow represent ‘Relay logic’. The light blue are output devices. The
wiring would be much simpler with a PLC.

10
Here is the main control box for the converter with the components labeled.
This is how the control mechanism is put together without a PLC. The switch
and momentary push button have been replaced with start and stop buttons.
Logical operation is supplied by the start relay and a time delay relay.

11
This is the wiring schematic with a PLC. When using a PLC wiring becomes
very simple and this helps avoid problems. The inputs are on the left and the
output are on the right. Notice how the PLC took the place of two relays, the
start relay and the timed relays. By replacing these two components the PLC
has already almost paid for itself. And each panel is much simpler

One thing that is missing is the program that the PLC must run to control the
process correctly. At each point, an input and output are connected to the PLC
there is an address. This address is used in the software to keep track of the
different devices.

--------Other Notes-------------
Timer relay- $47.85 at
http://www.mstores.umich.edu/catalog/grainger/electrical/relays/time_delay_rel
ays/5YZ86.html
The allen bradley model is more expensive~ $75

12
Suppose there is a process where there could be a pressure build up. A
solenoid is powered to keep a valve shut. Every time a pressure sensor is
tripped a solenoid is de-activated for 10 seconds that in turn allows a the valve
to open and the pressure to be released. After 10 seconds, power is restored
to the solenoid and the valve is closed. (A solenoid is another type of relay.)
Also suppose that the process needs to count how many times the solenoid is
de-activated. Without a PLC the process would follow this diagram. The
pressure sensor would feed information in a timer and a counter (two separate
unites of hardware).

But what if the process included 10 sensors and 10 solenoids? We’d need 10
timers and 10 counters. That’s a lot of hardware. And if an manual release
button and other safety sensors were also needed, the situation can become
complex and involve a large amount of hardware. If any one unit failed the
whole system would have to be shut down, the fault found and then fixed.
Before PLCs, however, this is how it was done.

13
Instead of a large amount of devices and the resulting complicated wiring, one
piece of hardware, a PLC can take the place of all 20 the timers and counters.
It can implement all the necessary logic within its programming. And if the PLC
breaks, it is easily replaced.

14
PLCs replace all the wiring and individual pieces of hardware like counters,
timers and relays. Before PLCs were used the wiring, configuring and
troubleshooting all these components would often get very complicated. With
a PLC, all wiring is done in software. This adds an additional benefit were if a
change needed to be made, no disconnecting of hardware would be required.
No one would have to disconnect wires and move around hardware. That can
be very time consuming and tedious. Only the PLC’s program would need to
be updated and then loaded into the PLC’s memory.

15
So in essence, a PLC is a special microprocessor based controller. It has
programmable memory that is used to store a program that instructs the PLC
on how to control machines or processes. PLCs were invented to replace relay
logic hardware. The PLCs program is where this replacement occurs.

The PLC was first developed in 1968 and by 1980 was very popular for
industrial control. Now if there is industry there are probably PLCs present.

Even though PLCs are computers, they are extremely rugged. They are
designed to withstand harsh conditions such as vibrations, high temperature,
humidity and noise.

16
PLC has four major internal components. The CPU which contains the
microprocessor, registers, control clock and various other processing units.
The memory contains user’s program, program data storage and PLCs
operating system. And the input and outputs provides the interface between
the system and the outside world.

17
The inputs and outputs on a PLC can be analog, discrete or digital depending
on the specific PLCs and what features it possesses. Common input and
outputs voltages are 12 to 24 volts DC, 120 volts AC and 5 volts for TTL logic
devices.

The PLCs CPU is protected by Optoisolators. That is it is electrically isolated


from its inputs and outputs. The Optoisolators uses a LED and photo sensor
to convey voltage information. This way if there is a large voltage spike, the
PLC and its CPU will not be damaged.

The DC inputs and outputs on a PLC are always specified as sinking or


sourcing. An input or output said to be sourcing when it uses a PLC as its
power source. An input or output said to be sinking when it provides its own
power that produces current thought the PLC. Quite often, sinking inputs are
used for sensors and sourcing outputs are used for loads.

Some PLC haves communications inputs and outputs. This can be serial or
parallel cables or even the ability to communicate on an Ethernet. Is useful in
large controls situations where many PLCs in remote locations are controlled
by one master PLC.

18
A PLC works by continuously running a program that checks the inputs and
then updates the outputs. First the inputs are checked and saved. The
program is executed using the saved inputs values. Output states are updated.
The process of the PLC running thought its program is called scanning.

The total time for a PLC to complete one loop is called cycle time. Typical
scanning times are from 10ms to 100ms.

19
PLC programming is called ladder logic. It’s not the usual type of programming
you may have seen before such as BASIC, C or assembly. It is a graphical
programming language that uses graphical symbols to provide the PLC with
the logical instructions needed to perform control operations. Learning how to
use and implement PLCs is basically learning ladder logic.

When PLCs first arrived they were made to replace relay hardware. It was
preferred that a minimum about of retraining would be necessary for the
engineers and trades people to operate and implement the PLCs. As a result
ladder logic was developed to mimic relay logic. Ladder logic programs
resemble relay logic schematics.

20
Let’s start the introduction to ladder logic by comparing it to a circuit diagram.
Here is a simple circuit for operating an electric motor. When the button is
pushed the circuit will close causing the relay to close and the motor to run.
When the button is released the circuit will open and the motor will stop. Below
is the same operation in ladder logic. Power is said to flow from the left power
rail to the right rail. The ladder logic is the program inside the PLC.

However, ladder logic is not a circuits schematic and ladder logic doesn’t show
the relative positions of components to each other as a circuits diagram does.
An important distinction is that a ladder logic program is a set of logical
instructions and not a way to physically connect components.

21
Ladder logic is so named because the diagram looks like a ladder. Each step
in the program is called a rung. The vertical lines on the left and right are the
power rails. Each rung defines one operation in the control process. The
ladder diagram is read from left to right and from top to bottom. Each rung
starts with one or more inputs and ends with at lease one output.

22
There are quite a few manufacturers of PLCs. Each has its own brand of
ladder logic programming. Though they are all very similar and if you can
program in one manufacture’s ladder logic language it is easy to use them all.
Here are a few standard symbols. The power rails, the open and closed
contact and the output device. Power is always said to flow from left to right.
Power flows though an open or closed contact depending on input conditions.
And if power can get to an output device it turns on. Contacts are always on
the left side of the ladder and output devices are always on the right side.

The contacts and the output device can either be real input and output
connections on the PLCs or they can be special functions in the ladder
program.

23
A contact is assigned to a device that is part of the control process. It always
follows the state of the device it is assigned too. It can be assigned to a input,
an output or even a variable in the PLCs memory. A contact’s assigned device
can be a push button, a temperature sensor, a motor or even an bit marker or
counter that only exists in the PLCs memory.

Power only flows through a normally open contact when the device assigned
to the contact is in its ON state. Power only flows through a normally closed
contact when the device assigned to the contact is in its OFF state

24
So here is the first example.

Consider a motor operated by a button. For as long as the button is held down
the motor will be on. When the motor is on an on light must be on. When the
motor is off the off light must be on.

Here is an example of how contacts can follow the state of an input or output
device. The contact labeled button follows the state of a button wired to the
PLC. The contact labeled Motor follows the state of the Motor output device.

25
Sometime you need a machine to keep running even after the start button has
stopped being depressed. This is latching when needed. When the start button
is closed the motor will turn on.

The contact labeled motor will follow the state of the output device labeled
motor. So by pressing the start button the Motor contact will also activated.
When the start button is released, the motor will stay active because of the
motor contact on the lower rung will still be in the on state. The stop button
must be used to turn the motor off by causing it’s contact to open.

26
From the earlier example, here is a very simple ladder logic program and its
wiring schematic. A wiring diagram is always needed because the PLC
program isn’t a wiring schematic and lacks the information about sensors are
wired . Ladder logic looks much like a schematic of physical components but
remember it’s just a graphical program.

It is desired that when the pressure is too high the pressure sensor is tripped.
The PLC detects this and deactivates the solenoids for 10 seconds to open the
release valve. Also a count of the event is made.

When the pressure is high enough, the sensor will close the contacts and form
an electrical connection. Current will flow from the PLC to the ground and this
will inform the PLC that the sensor is in it’s ON state. Since the sensor is
programmed as normally open according to the programming, power only
flows when its assigned device is in its ON state.

Once the sensor it in the ON state, the counter will increase and the timer will
turn on. The timer will remain in the ON state for 10 seconds regardless of the
state of the Pressure Sensor contact. The timer contact is programmed as
normally closed, therefore when the output Timer is ON, the timer contact will

27
de-activate. This will cause the Solenoid to de-activate and the pressure
release valve will open.

27
As before a Manual shut off can be added to the system as well as a safety
sensor. Here is the wiring schematic for the PLC. Notice that the safety sensor
and manual shut off are wired such that they are usually in a ON state. When
these two devices are activated they cause on open and the PLC detects that
these devices are in the OFF state. This is so if there is any problem with
these input devices it is more likely that they will fail open and thus de-activate
the solenoid and venting pressure.

And of course as before the process can become large if more sensor and
solenoids were required. The PLC program would have to be repeated for
each sensor-solenoid pair and more input and output device would be wired to
the PLC.

28
Notice that the manual release and safety sensor are programmed as normally
open. This is so if there is any problem with the system or the safety sensor or
shut off the solenoid will lose power and the pressure release valve will open
causing the process to fail safe.

Ladder logic is always draw in the way the device is preferred to fail. Here if
the Safety Sensor or Manual shut off components fail or if the PLC fails the
Solenoid will be de-activated. This is the safest way for the process to fail
because the pressure value will open if there is any problem.

29
As an example, consider an industrial mixer a where a drum is to be filled with
liquid. After it is full, a heater is used to heat the liquid until it reaches a certain
temperature. Then the drum is to rotated for 10 minutes, then the process
stops.

--------------
Picture from:
http://www.monoequip.com/images/Equipment/ind_cake_mixer.jpg

30
Here is the SFC for this process. SFC are useful when the control process
involves a series of steps. The process stays in the current state until a
condition is satisfied.

31
Here is the wiring diagram for the mixer. As always all the inputs and output
are wired directly to the PLC. The operating logic is all stored in the PLC as a
ladder logic program. So based on the inputs of the start button, the Level full
floater and the Temperature sensor the PLC will decide when to turn on the
Pump, heater and motor.

32
Here is the ladder logic for the pump and the heater. Once the start button is
pressed the pump will stay on until the liquid is at the required level. This is
done through latching with the Pump contact. When the floater is activated, it
will stop the pump at the required level.

Once the level switch is active the pump will be shut off and the heater will be
activated. The liquid will be heated until the temperature switch is triggered.
There the heater is latched so even if the liquid level goes down it will still be
heated until the required temperate is reached.

The Temperature reached contact is not assigned to an input or output of the


PLC. But instead to an internal output device that only exists in the PLCs
memory.

33
There is the continuation of the ladder logic program. In total it has four rungs.

Here you can see at the top, that once the Temperature sensor is tripped it will
activate the Temperature reached output device. This device only exists in the
PLCs memory and acts as a variable. Once active it latches its self to the on
state. This insures that the timer is only activated once and the heater doesn’t
turn back on if the liquid cools.

Once the timer is activated it will cause the 10 minutes timer contact to close
and the mixing motor to turn on. The motor will operate for 10 minutes and
then stop.

34
Since Ladder logic is essentially a computer program it is subject to bugs and
faults. Therefore any program needs to be tested for accuracy and robustness.
One method of testing is called forcing. This is where input states are forced to
certain states in software. Programming errors can sometimes be found by
forcing inputs at various stages in the ladder program.

Time checks can also be built into the ladder logic program. This is where
additional ladder rungs might be includes so that when a function starts a timer
is started. If the function does not complete when the timer finishes a fault is
signaled. The function might be the moving of a piston or filling a drum with
liquid.

Many PLCs have a simulate mode where the installed program can be run and
inputs and outputs simulated so that they can be checked.

PLC ladder logic software can test against programming syntax errors.

35
Ladder logic can do much more than what has been shown so far. It can utilize
registers and bits to store and move data. There are data comparison function
such as checking for equal to, less than or greater than. There are arithmetic
operations such as addition, subtraction and multiplication. There are functions
that can transform number to different bases or formats. Some PLCs can
provide PID (proportional integral derivative) calculations to control a variable
simply by being provided the necessary parameters.

36
At this point you should realize how PLCs can solve many problems in
industry.

PLCS are flexible and can be reapplied to control other systems quickly and
easily. They are cost effective for controlling complex systems. They posses
high computational abilities that allow more sophisticated control through
ladder logic. Trouble shooting aids make programming easier and reduce
downtime. Reliable components make PLCs likely to operate for years before
failure.
You should also realize that right now, if you had a PLC and a enough ladder
logic knowledge you could construct a sophisticated machine with little
problem as far as operational logic is concerned.

37
38
Chapter 4: Fundamentals of Logic

Textbook: Petruzella, Frank D., Programmable Logic Controllers.


McGraw Hill Companies Inc., 5th edition
Automation

2
Automation

3
Automation

Sometime called: Boolean instruction

4
Automation

5
Automation

6
Automation

7
Automation

8
Automation

Sometime called:
Boolean instruction

9
 The Binary Concept

 The PLC, like all digital equipment, operates on the binary


principle.
 The term binary principle refers to the idea that many things can be
thought of as existing in only one of two states.
 These states are 1 and 0.
 The 1 and 0 can represent ON or OFF, open or closed, true or false,
high or low, or any other two conditions.
AND, OR, and NOT Functions

The basic rules that apply to an AND gate


are:

•If all inputs are 1, the output will be 1.

•If any input is 0, the output will be 0.


 AND, OR, and NOT Functions
 The basic rules that apply to an OR gate are:

• If one or more inputs are 1, the output is .1

• If all inputs are 0, the output will be .0


 AND, OR, and NOT Functions
 The logical NOT function can be performed on a contact input simply
by using a normally closed instead of a normally open contact
Programmable Logic Controller
Boolean Algebra

normally open contact normally closed contact

Or (OR)

Or Not (OR NOT)

And (AND)
Programmable Logic Controller
Boolean Algebra

And not

Out (OUT)

Or Out (OR OUT)

Output Not (OUT NOT)


 Hardwired Logic versus Programmed Logic
 The term hardwired logic refers to logic control functions that are determined
by the way devices are electrically interconnected.
 Hardwired logic can be implemented using relays and relay ladder schematics.
 Relay ladder schematics are universally used and understood in industry.
 Figure shows a typical relay ladder schematic of a motor stop/start
control station with pilot lights
 The instructions used are the relay equivalent of normally open (NO) and
normally closed (NC) contacts and coils..
Hardwired Logic versus Programmed Logic
PLC contact symbolism is a simple way of expressing the
control logic in terms of symbols.
These symbols are basically the same as those used for
representing hardwired relay control circuits.
A rung is the contact symbolism required to control an
output.
Some PLCs allow a rung to have multiple outputs while
others allow only one output per rung.
A complete ladder logic Program then consists of several
rungs, each of which controls
an output.
 Hardwired Logic versus Programmed Logic
 In programmed logic all mechanical switch contacts are represented
by a software contact symbol and all electromagnetic coils are
represented by a software coil symbol.
 Because the PLC uses ladder logic diagrams, the conversion from any
existing relay logic to programmed logic is simplified.
 Each rung is a combination of input conditions (symbols) connected
from left to right, with the symbol that represents the output at the
far right.
 The symbols that represent the inputs are connected in
series,parallel, or some combination of the two to obtain the desired
logic.
 The following group of examples illustrates the relationship between
the relay ladder schematic, the ladder logic program, and the
equivalent logic gate circuit.
Programmable Logic Controller

 Hardwired Logic versus Programmed Logic


Programmable Logic Controller

 Hardwired Logic versus Programmed Logic


Programmable Logic Controller

 Hardwired Logic versus Programmed Logic


Programmable Logic Controller

 Hardwired Logic versus Programmed Logic


Programmable Logic Controller

 Hardwired Logic versus Programmed Logic


Programmable Logic Controller

 Hardwired Logic versus Programmed Logic

e.g :-
Programmable Logic Controller

 Hardwired Logic versus Programmed Logic

e.g-:
Programmable Logic Controller

Hardwired Logic versus


Programmed Logic

e.g :-
Programmable Logic Controller

 Hardwired Logic versus Programmed Logic

e.g-:
Programmable Logic Controller

Hardwired Logic versus Programmed Logic

e.g :- A Burglar Alarm


Consider the design of a burglar alarm for a house. When activated an
alarm and lights will be activated to encourage the unwanted guest to
leave. This alarm be activated if an unauthorized intruder is detected by
window sensor and a motion detector. The window sensor is effectively
a loop of wire that is a piece of thin metal foil that encircles the
window. If the window is broken, the foil breaks breaking the conductor.
This behaves like a normally closed switch. The motion sensor is
designed so that when a person is detected the output will go on. As
with any alarm an activate/deactivate switch is also needed. The
basic operation of the alarm system, and the inputs and outputs of the
controller are itemized
Programmable Logic Controller

Hardwired Logic versus Programmed Logic

e.g :- A Burglar Alarm

The inputs and outputs are chosen to be;


A = Alarm and lights switch (1 = on) W = Window/Door sensor (1 = OK)
M = Motion Sensor (0 = OK)
S = Alarm Active switch (1 = on)
The basic operation of the alarm can be described with rules.
1.If alarm is on, check sensors.
2.If window/door sensor is broken (turns off), sound alarm and turn on
Lights
Programmable Logic Controller

 Hardwired Logic versus Programmed Logic

e.g :- A Burglar Alarm


 Hardwired Logic versus Programmed Logic
e.g :- A Burglar Alarm
Chapter 2

© 2011, The McGraw-Hill Companies, Inc.


2.1

The I/O Section


© 2011, The McGraw-Hill Companies, Inc.
The input/output (I/O) section of a PLC is the
section to which all field devices are connected
and provides the interface between them and
the CPU. Inputs
Input/output
arrangements
are built into a
fixed PLC.
Outputs
Modular types use
external I/O
modules that plug
into the PLC.
© 2011, The McGraw-Hill Companies, Inc.
I/O Modules
Rack-based I/O
section made up of
individual I/O
modules

Input interface modules accept signals from the


machine or process devices and convert them into
signals that can be used by the controller.

Output interface modules convert controller signals


into external signals used to control the machine or
process.
© 2011, The McGraw-Hill Companies, Inc.
The hardware assembly that houses I/O modules,
processor modules, and power supplies is referred to as
the chassis.

A logical rack is an addressable unit consisting of 128


input points and 128 output points.

© 2011, The McGraw-Hill Companies, Inc.


The ability to locate the I/O modules near the field
devices minimizes the amount of wiring required.
The remote rack is linked to the local rack
through a pair of
communications modules.
A rack is referred to as
a remote rack when it
is located away from
the processor module.

© 2011, The McGraw-Hill Companies, Inc.


The PLC’s memory system stores information
about the status of all the inputs and outputs. To
keep track of all this information, it uses a system
called addressing.
An address is a label or number that indicates where
a certain piece of information is located in a PLC’s
memory.
Rack/slot-based addressing schemes are used with
Allen-Bradley PLC-5 and SLC 500 controllers,

Tag-based addressing is used with Allen-Bradley


ControlLogix controllers.

© 2011, The McGraw-Hill Companies, Inc.


PLC-5 rack/slot-based addressing format.

I1:27/17 - Input, file 1, rack 2, group 7, bit 17


O0:34/07 - Output, file 0, rack 3, group 4, bit 7
I1:0/0 - Input, file 1, rack 0, group 0, bit 0
O0:1/1- Output, file 0, rack 0, group 1, bit 1
© 2011, The McGraw-Hill Companies, Inc.
SLC 500 rack/slot-based addressing format.

O:4/15 - Output module in slot 4, terminal 15


I:3/8 - Input module in slot 3, terminal 8
O:6.0 - Output module, slot 6
I:5.0 - Input module, slot 5
© 2011, The McGraw-Hill Companies, Inc.
Every input and output device connected to a
discrete I/O module is addressed to a specific bit
in the PLC’s memory.

A bit is a binary digit that can be either 1 or 0.


© 2011, The McGraw-Hill Companies, Inc.
Analog I/O
modules use
a word
addressing
format.

The bit part of


the address is
usually not used
but can be
addressed by the
programmer if
necessary.
© 2011, The McGraw-Hill Companies, Inc.
Allen-Bradley ControlLogix controllers use a
tag-based addressing format.

Instead of a fixed numeric format, a tag


(alphanumeric name) is used to address data.
The field devices are assigned tag names when the
PLC ladder logic program is developed.
© 2011, The McGraw-Hill Companies, Inc.
PC-based control runs on personal or industrial
hardened computers. Also known as soft PLCs,
they simulate the functions of a PLC on a PC,

This implementation uses


an input/output card in
conjunction with the PC
as an interface for the
field devices.

© 2011, The McGraw-Hill Companies, Inc.


Combination I/O
modules can
have both input
and output
connections in
the same
physical module.

© 2011, The McGraw-Hill Companies, Inc.


An I/O module is
made up of a printed
circuit board and a Status
terminal assembly. Lights

The printed circuit


board contains
electronic circuitry.
The terminal
assembly is used
for making field-
wiring connections.
© 2011, The McGraw-Hill Companies, Inc.
Most PLC modules have plug-in wiring terminal
strips that plug into the actual module.

If there is a problem
with a module, the
entire strip is
removed, a new
module is inserted,
and the terminal
block is plugged into
the new module.

© 2011, The McGraw-Hill Companies, Inc.


I/O modules can be 8, 16, 32, or 64 point cards.

The points refers to the number of inputs or outputs


available.
A high-density 64 point card provides a greater space
saving but with less rated current output per output.

© 2011, The McGraw-Hill Companies, Inc.


2.2

Discrete I/O
Modules
© 2011, The McGraw-Hill Companies, Inc.
The discrete I/O
interface module
connects
field input
devices of the
ON/OFF nature.

The classification of
discrete I/O covers
bit oriented
inputs and outputs.

© 2011, The McGraw-Hill Companies, Inc.


Each discrete I/O module is powered by
some field supplied voltage source.
Since these voltages can be of different magnitude or
type, I/O modules are available at various AC and DC
voltage ratings.

© 2011, The McGraw-Hill Companies, Inc.


The modules themselves receive their voltage
and current for proper operation from the
backplane of the rack enclosure into which
they are inserted.
Backplane power is provided by the PLC module
power supply and is used to power the electronics that
reside on the I/O module circuit board.

Currents required
by the loads are
normally provided
by user-supplied
power.
© 2011, The McGraw-Hill Companies, Inc.
AC discrete input module block
diagram.

The circuit is made up of a power section and a logic


section.
An optical isolator is used to provide electrical isolation
between the power and logic circuitry.
The input LED turns on or off, indicating the status of
the input device.
© 2011, The McGraw-Hill Companies, Inc.
AC discrete input module schematic
diagram.

When the pushbutton is closed AC is applied to the


bridge rectifier input.
This results in a low-level DC output voltage that is
applied across the LED of the optical isolator.
When light from the LED strikes the phototransistor,
it switches it into conduction.
© 2011, The McGraw-Hill Companies, Inc.
AC discrete output module block diagram.

The module is composed of the power section and the


logic section, coupled by an isolation circuit.

The power output interface can be thought of as


an electronic switch that turns the output load
device on and off.
© 2011, The McGraw-Hill Companies, Inc.
AC discrete output module schematic diagram.

When the processor calls for the output load to be


energized, a voltage is applied across the LED of the
opto-isolator.
This in turn triggers the triac AC semiconductor switch
into conduction allowing current to flow to the output
load.
© 2011, The McGraw-Hill Companies, Inc.
Individual AC outputs are usually limited by
the size of the triac to 1 A or 2 A.

For controlling larger


loads an interposing
relay is connected to
the output module.
The contacts of the
relay can then be used
to control a larger load
or motor starter,

© 2011, The McGraw-Hill Companies, Inc.


Discrete output modules are used to turn field
output devices either on or off.

Output modules can be purchased with transistor,


triac, or relay output

© 2011, The McGraw-Hill Companies, Inc.


Certain DC I/O modules specify whether the
module is designed for interfacing with
current-source or current-sink devices.

If the module is a current-sourcing module, then the


input or output device must be a current-sinking device.
© 2011, The McGraw-Hill Companies, Inc.
If the module is a current-sinking
module,
then the input or output device must be a
current-sourcing device.

© 2011, The McGraw-Hill Companies, Inc.


2.3

Analog I/O
Modules
© 2011, The McGraw-Hill Companies, Inc.
Analog input
and output
devices have an
infinite number
of values.
Typical analog inputs and outputs vary from
0 to 20 milliamps, 4 to 20 milliamps, or 0 to 10 volts.
The analog input interface module accepts an
analog signal and converts it to a digital signal.

The analog output module accepts a digital signal and


converts it to an analog signal that operates the output.
© 2011, The McGraw-Hill Companies, Inc.
The two basic types of analog input modules are
voltage sensing and current sensing.

A varying DC voltage in the low millivolt range,


proportional to the temperatures being monitored,
is produced by the thermocouples.
© 2011, The McGraw-Hill Companies, Inc.
The main element of the analog input module is
an analog-to-digital (A/D) converter
Bipolar input modules can accept signals that swing
between a negative and positive value.
Unipolar input modules can accept an input signal
that varies in the positive direction only.
Resolution refers to the smallest change in input signal
value that can be sensed

© 2011, The McGraw-Hill Companies, Inc.


Unlike voltage input signals, current signals are
not as sensitive to noise and typically are not
distance limited.
The current sensing loop power may be supplied by
the sensor or the analog output module.

Shielded twisted pair cable is normally recommended


for connecting any type analog input signal.
© 2011, The McGraw-Hill Companies, Inc.
The main element of the analog
output module is an
digital-to-analog (D/A) converter
The analog output module receives from the
processor digital data, which are converted into
a proportional voltage or current to control an
analog field device.

The analog output signal is varied


under the control of the PLC
program and can be used for
control of an analog control valve.
© 2011, The McGraw-Hill Companies, Inc.
Analog I/O control system
The PLC controls the
amount of fluid placed
in a holding tank by
adjusting the
percentage of the valve
opening.

The valve is initially opened 100 percent.


As the fluid level in the tank approaches the preset
point, the processor modifies the output, which
adjusts the valve to maintain a set point.
© 2011, The McGraw-Hill Companies, Inc.
2.4

Special I/O
Modules
© 2011, The McGraw-Hill Companies, Inc.
High-speed counter modules are used to count
pulses from sensors, encoders, and switches
that operate at very high speeds.

They have the


electronics needed to
count independently of
the processor.

A typical count rate available is 0 to 100 kHz, which


means the module would be able to count 100,000 pulses
per second.
© 2011, The McGraw-Hill Companies, Inc.
The thumbwheel module allows the use of
thumbwheel switches for feeding
information to the PLC to be used in the
control program.

© 2011, The McGraw-Hill Companies, Inc.


The TTL module allows the
transmitting and receiving of
TTL (Transistor-Transistor-
Logic) signals.

This module allows devices that


produce TTL-level signals to
communicate with the PLC’s
processor

© 2011, The McGraw-Hill Companies, Inc.


An encoder-counter
module allows the
user to read the
signal from an
encoder on a
real-time basis
and stores this
information so it can
be read later by the
processor.

© 2011, The McGraw-Hill Companies, Inc.


The BASIC or ASCII module runs user
written BASIC and C programs.

Typical applications include


interfaces to bar code readers,
© 2011, The McGraw-Hill Companies, Inc.
robots, printers, and displays.
The stepper-motor module provides pulse trains
to a stepper-motor translator, which enables
control of a stepper motor.

The commands for the module are determined by the


control program in the PLC.
© 2011, The McGraw-Hill Companies, Inc.
The BCD-output module enables a PLC to
operate devices that require BCD-coded signals
such as seven-segment displays

© 2011, The McGraw-Hill Companies, Inc.


The proportional-integral-derivative (PID)
module is used in process control applications
that incorporate PID algorithms.

This arrangement prevents the


CPU from being burdened with
© 2011, The McGraw-Hill Companies, Inc.
complex calculations.
Motion and position control modules are used in
applications involving accurate high-speed
machining and packaging operations.

Intelligent position
and motion
control modules
permit PLCs to
control stepper
and servo motors.

© 2011, The McGraw-Hill Companies, Inc.


Serial communications modules
are used to establish point-to-
point connections with other
intelligent devices for the
exchange of data.

Communication
modules provide for
connection to PLC
networks.

© 2011, The McGraw-Hill Companies, Inc.


2.5

I/O
Specifications
© 2011, The McGraw-Hill Companies, Inc.
Discrete I/O Module Specifications
Nominal Input Voltage - Specifies the magnitude (e.g., 5
V, 24 V, 230 V) and type (AC or DC) of user-supplied
voltage that a module is designed to accept.

Input Threshold Voltages - Specifies the minimum


ON-state voltage at which logic 1 is recognized and
the maximum OFF-state voltage at which logic 0 is
recognized.

Nominal Current Per Input - Specifies the minimum


input current that the discrete input devices must be
capable of driving to operate the input circuit.
© 2011, The McGraw-Hill Companies, Inc.
Discrete I/O Module Specifications
Ambient Temperature Rating - Specifies what the
maximum temperature of the air surrounding the I/O
modules should be for best operating conditions.

Input ON/OFF Delay (response time) - Specifies the


maximum time duration required by an input module’s
circuitry to recognize that a field device has switched ON
(input ON-delay) or switched OFF (input OFF-delay).
Output Voltage - This AC or DC value specifies the
magnitude (e.g., 5 V, 115 V, 230 V) and type (AC or
DC) of user-supplied voltage at which a discrete output
module is designed to operate.
© 2011, The McGraw-Hill Companies, Inc.
Discrete I/O Module Specifications
Output Current - Specifies the maximum current that a
single output and the module as a whole can safely carry
under load (at rated voltage).
Inrush Current - Specifies the maximum inrush current
and duration (e.g., 20 A for 0.1 s) for which an output
circuit can exceed its maximum continuous current
rating.

Short Circuit Protection - Specifies whether the


particular output module’s design has individual
protection for each circuit or if fuse protection is
provided for groups (e.g., 4 or 8) of outputs.
© 2011, The McGraw-Hill Companies, Inc.
Discrete I/O Module Specifications
Leakage Current - This value specifies the amount of
current still conducting through an output circuit even
after the output has been turned off.

Electrical Isolation - The specification for


electrical isolation, typically 1500 or 2500
volts AC, rates the module’s capacity for
sustaining an excessive voltage at its input
or output terminals.

Points Per Module - This specification defines the


number of field inputs or outputs that can be
connected to a single module.
© 2011, The McGraw-Hill Companies, Inc.
Discrete I/O Module Specifications
Backplane Current Draw - This value indicates the
amount of current the module requires from the
backplane. The sum of the backplane current drawn
for all modules in a chassis is used to select the
appropriate chassis power supply rating.

Power Backplane
Supply

© 2011, The McGraw-Hill Companies, Inc.


Analog I/O Module Specifications
Channels Per Module - Whereas individual circuits on
discrete I/O modules are specified as points per module,
circuits on analog I/O modules are specified as channels
per module.

Input Current/Voltage Range(s) - These are the voltage


or current signal ranges that an analog input module is
designed to accept.

Output Current/Voltage Range(s) - This specification


defines the current or voltage signal
ranges that a particular analog output module is
designed to output under program control.
© 2011, The McGraw-Hill Companies, Inc.
Analog I/O Module Specifications
Input Protection - Analog input circuits are usually
protected against accidentally connecting a voltage that
exceeds the specified input voltage range.
Resolution - The resolution specifies how accurately
an analog value can be represented digitally. This will
determine the smallest measurable unit of current or
voltage change that can be detected.

Input Impedance and Capacitance - For analog I/Os,


these values must be matched to the external
device connected to the module. Typical ratings are
in the Megohm and Picofarad range.
© 2011, The McGraw-Hill Companies, Inc.
Analog I/O Module Specifications
Common-Mode Rejection - Noise is generally caused by
electromagnetic interference, radio frequency
interference, and ground loops.

Noise that is picked up


equally in parallel wires is
rejected because the
difference is zero. Twisted
pair wires are used to ensure
that this type of noise is
equal on both wires.

© 2011, The McGraw-Hill Companies, Inc.


2.6

The Central
Processing
Unit (CPU)
© 2011, The McGraw-Hill Companies, Inc.
The central processing unit (CPU) is built into
fixed PLCs while modular types typically use a
plug-in module.

CPU, controller, and processor are all terms used by


different manufacturers to denote the same module that
performs basically the same functions.
© 2011, The McGraw-Hill Companies, Inc.
A processor module can be divided into two
sections: the CPU section and the memory section

The CPU
executes the
program.

The memory
stores the
program along
with other
retrievable
data.
© 2011, The McGraw-Hill Companies, Inc.
The PLC power supply provides the necessary
power to the processor and I/O modules plugged
into the backplane of the rack.

The power supply


converts the AC input
voltage into the usable
DC voltage required by
the CPU, memory, and
I/O electronic circuitry.

© 2011, The McGraw-Hill Companies, Inc.


The CPU contains the similar type of
microprocessor found in a personal computer.

A PLC microprocessor is designed to facilitate


industrial control rather than provide general
purpose computing.
© 2011, The McGraw-Hill Companies, Inc.
The CPU of a PLC system may contain more
than one processor.

Fault-tolerant PLC systems support dual processors for


critical processes. These systems allow the user to
configure the system with redundant (two) processors,
which allows transfer of control to the second processor
in the event of a processor fault.
© 2011, The McGraw-Hill Companies, Inc.
Associated with the processor unit will be a
number of status LED indicators to provide
system diagnostic information to the operator.

© 2011, The McGraw-Hill Companies, Inc.


Many electronic components found in processors
and other types of PLC modules are sensitive to
electrostatic voltages that can degrade their
performance or damage them.

When not in use, store


modules in a static-shield
bag.

© 2011, The McGraw-Hill Companies, Inc.


2.7

Memory Design
© 2011, The McGraw-Hill Companies, Inc.
Memory is the element that stores information,
programs, and data in a PLC.

The complexity of the program determines the amount


of memory required.

© 2011, The McGraw-Hill Companies, Inc.


Memory location refers to an address in the
CPU’s memory where a binary word can be
stored. Each binary piece of data is a bit
and eight bits make up one byte.

The program is stored in the memory as 1s and 0s, which


are typically assembled in the form of 16-bit words.

© 2011, The McGraw-Hill Companies, Inc.


Sections of memory used to store the status of
inputs are called input status files or tables.

© 2011, The McGraw-Hill Companies, Inc.


Input Table Simulation

© 2011, The McGraw-Hill Companies, Inc.


Sections of memory used to store the status of
outputs are called output status files or tables.

© 2011, The McGraw-Hill Companies, Inc.


Output Table Simulation

© 2011, The McGraw-Hill Companies, Inc.


2.8

Memory Types
© 2011, The McGraw-Hill Companies, Inc.
Memory types can be placed into two general
categories: volatile and nonvolatile.
Nonvolatile memory has the ability to retain stored
information when power is removed accidentally or
intentionally.

Volatile memory will lose its stored information if all


operating power is lost or removed.

PLCs have programmable memory that allows users


to develop and modify control programs. This
memory is made nonvolatile so that if power is lost,
the PLC holds its programming.
© 2011, The McGraw-Hill Companies, Inc.
Nonvolatile Read Only Memory (ROM) stores
programs, and data that cannot be changed
after the memory chip has been manufactured.

ROM is used by the PLC


for the operating system
and controls the system
software that the user uses
to program the PLC.

© 2011, The McGraw-Hill Companies, Inc.


Random Access Memory (RAM) is designed so
that information can be written into or read
from the memory.
PLCs use RAM as a temporary storage area of data
that may need to be quickly changed.

RAM is volatile so
battery backup is
required for it to avoid
losing data in the event
of a power loss

© 2011, The McGraw-Hill Companies, Inc.


Erasable Programmable Read-Only Memory
(EPROM) provides some level of security
against unauthorized or unwanted changes in
a program.

EPROMs are
designed so that
data stored in them
can be read, but not
easily altered
without special
equipment. UV EPROM memory can
only be erased with an
ultraviolet light.
© 2011, The McGraw-Hill Companies, Inc.
Electrically erasable programmable read-only
memory (EEPROM) is a nonvolatile memory
that offers the same programming flexibility as
does RAM.

The EEPROM can be


electrically overwritten
with new data instead of
being erased with
ultraviolet light.

Because the EEPROM is nonvolatile memory, it does


not require battery backup.
© 2011, The McGraw-Hill Companies, Inc.
Flash EEPROMs are similar to EEPROMs in
that they can only be used for backup storage.

Flash memory is
extremely fast at
saving and
retrieving files.

Flash memory is also sometimes built into the


processor module, where it automatically
backs up parts of RAM.

© 2011, The McGraw-Hill Companies, Inc.


2.9

Programming
Terminal Devices
© 2011, The McGraw-Hill Companies, Inc.
A programming terminal device is needed to
enter, modify, and troubleshoot the PLC
program.
The hand-held proprietary
programming terminal has
a connecting cable so that it
can be plugged into a PLC’s
programming port.

Hand-held programmers are compact and inexpensive


but have limited display capabilities.

© 2011, The McGraw-Hill Companies, Inc.


The most popular method of PLC programming
is to use a personal computer in conjunction with
the manufacturer’s programming software.

© 2011, The McGraw-Hill Companies, Inc.


2.10

Recording and
Retrieving Data
© 2011, The McGraw-Hill Companies, Inc.
Printers are used to provide hard-copy printouts
of the processor’s memory in ladder program
format.

A printout
can show
programs of
any length
and analyze
the complete
program.

© 2011, The McGraw-Hill Companies, Inc.


The program in the PLC is entered directly
from the keyboard or downloaded from the
computer hard drive or thumb drive.

© 2011, The McGraw-Hill Companies, Inc.


Some CPUs support the
use of a memory
cartridge that provides
portable EEPROM
storage for the user
program.

The cartridge can be used


to copy a program from
one PLC to another similar
type PLC.

© 2011, The McGraw-Hill Companies, Inc.


2.11

Human Machine
Interfaces (HMIs)
© 2011, The McGraw-Hill Companies, Inc.
A human machine interface (HMI) can be
connected to communicate with a PLC and to
replace pushbuttons, selector switches, pilot
lights, thumbwheels, and other operator control
panel devices

© 2011, The McGraw-Hill Companies, Inc.


Human machine
interfaces allow you to
view the operation in real
time.

You can configure display screens to:


• Replace hardwired pushbuttons and pilot lights
with realistic-looking icons.
• Allow the operator to change timer and counter
presets.
• Show alarms, complete with time of occurrence.

© 2011, The McGraw-Hill Companies, Inc.


Chapter 2: PLC Hardware Components

Textbook: Petruzella, Frank D., Programmable Logic Controllers.


McGraw Hill Companies Inc., 5th edition
 The I/O Section

The input/output (I/O) section of a PLC is the section to which all field devices are
connected and provides the interface between them and the CPU.
Input/output arrangements are built into a fixed PLC while modular types use
external I/O modules that plug into the PLC.
Input interface modules accept signals from the machine or process devices and
convert them into signals that can be used by the controller
Output interface modules convert controller signals into external signals used to
control the machine or process
Automation

PLC Hardware components


3
Automation

PLC Hardware components


4
Automation

PLC Hardware components


5
Automation

PLC Hardware components


6
Programmable Logic Controller

 The I/O Section


 each input and output pin in slot of the PLC will have an address

The address is used by the processor to identify where the device is located to monitor
or control it.
Automation

8
Automation

9
Automation

10
Automation

11
Automation

12
Automation

13
Automation

14
Automation

15
Automation

16
Automation

17
Automation

18
Automation

19
Automation

20
Automation

21
Automation

22
Automation

23
Automation

24
Automation

25
Automation

26
Automation

27
Automation

28
Automation

29
Automation

30
Automation

31
Automation

32
Automation

33
Automation

34
Automation

35
Automation

36
Automation

37
Automation

38
Programmable Logic Controller

 The Central Processing Unit (CPU)

Processors vary in processing speed and memory options.


A processor module can be divided into two sections: the CPU section and the
memory section.
 The CPU section executes the program and makes the decisions needed by the PLC
to operate and communicate with other modules.
The memory section electronically stores the PLC program along with other
retrievable digital information.
Programmable Logic Controller

 The Central Processing Unit (CPU)

The PLC power supply provides the necessary power (typically 5 VDC) to the
processor and I/O modules
Power supplies are available for most voltage sources encountered.
 The power supply converts 115 VAC or 230 VAC into the usable DC voltage required
by the CPU, memory, and I/O electronic circuitry.
PLC power supplies are normally designed to withstand momentary losses of
power without affecting the operation of the PLC.
 Holdup time , which is the length of time a PLC
can tolerate a power loss,
typically ranges from 10 milliseconds to
3 seconds.
The CPU executes the operating system, manages
memory, monitors inputs, evaluates the user logic
(appropriate ladder program) and turns on the
outputs.
Programmable Logic Controller

 The Central Processing Unit (CPU)

The CPU of a PLC system may contain more than one processor. One advantage of
using multiprocessing is that the overall operating speed is improved
Associated with the processor unit will be a number of status LED indicators to
provide system diagnostic information to the operator .
Also, a keys wich may be provided that allows you to select one of the following
three modes of operation: RUN, PROG, and REM.
RUN Position :- Executes the ladder program and energizes output devices
PROG Position :- Allows you to perform program entry and editing
REM Position
•Places the processor in the Remote mode: either the REMote Run, REMote Program,
or REMote Test mode
• Allows you to change the processor mode from a programmer/operator interface
device
•Allows you to perform online program editing
Automation

42
Automation

43
Automation

44
Automation

45
Programmable Logic Controller

 Memory Design
Memory is the element that stores information, programs, and data in a PLC.
The user memory of a PLC includes space for the user program as well as ddressable
memory locations for storage of data.
 Data are stored in memory locations by a process called writing.
Data are retrieved from memory by what is referred to as reading.
 The complexity of the program determines the amount of memory required.
 Memory elements store individual pieces of information called bits (for binary digits
 The program is stored in the memory as 1s and 0s, which are typically assembled in
the form of 16-bit words.
Memory sizes are commonly expressed in thousands of words that can be stored in
the system; thus 2 K is a memory of 2000 words, and 64 K is a memory of
64,000words.
The memory size varies from as small as 1 K for small systems to 32 MB for very large
systems.
Programmable Logic Controller

 Memory Design
Memory capacity is an important prerequisite for determining whether a particular
processor will handle the requirements of the specific application.
Memory location refers to an address in the CPU’s memory where a binary word can
be stored.
A word usually consists of 16 bits.
 A rule of thumb for memory locations is one location per coil or contact.
One K of memory would then allow a program containing 1000 coils and contacts to
be stored in memory.
The memory of a PLC may be broken
into sections that have specific functions
Programmable Logic Controller

 Memory Design
Sections of memory used to store the status of inputs and outputs are called input
status files or tables and output status files or tables ( Figure.)
These terms simply refer to a location where the status of an input or output device
is stored.
Each bit is either a 1 or 0, depending on whether the input is open or closed.
A closed contact would have a binary 1 stored in its respective location in the input
table, whereas an open contact would have a 0 stored.
 A lamp that is ON would have a 1 stored in its respective location in the output table,
whereas a lamp that is OFF would have a 0 stored.
 Input and output image tables are constantly being revised by the CPU.
Each time a memory
location is examined
,the table changes if
the contact or coil has
changed state
Automation

49
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

This type of interface connects field input devices of the ON/OFF nature such as
selector switches, pushbuttons, and limit switches.
Likewise, output control is limited to devices such as lights, relays, solenoids, and
motor starters that require simple ON/OFF switching.
The classification of discrete I/O covers bit oriented inputs and outputs.
In this type of input or output, each bit represents a complete information element
in itself and provides the status of some external contact or advises of the presence or
absence of power in a process circuit.
Each discrete I/O module is powered by some field supplied voltage source. Since
these voltages can be of different magnitude or type, I/O modules are available at
various AC and DC voltage ratings,
Programmable Logic Controller

 The I/O Section

 Discrete I/O Modules


Programmable Logic Controller

 The I/O Section

Discrete I/O Modules


Figure shows the block diagrams for one input of a typical alternating current (AC)
discrete input module.
The input circuit is composed of two basic sections: the power section and the logic
section.
An optical isolator is used to provide electrical isolation between the field wiring and the
PLC backplane internal circuitry.
The input LED turns on or off, indicating the status of the input device.
Logic circuits process the digital signal to the processor.
Internal PLC control circuitry
typically operates at 5 VDC
or less volts.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Modules


•The input noise filter consisting of the capacitor and resistors R1 and R2 removes
false signals that are due to contact bounce or electrical interference.
•When the pushbutton is closed, 120 VAC is applied to the bridge rectifier input.
•This results in a low-level DC output voltage that is applied across the LED of the
optical isolator.
 The I/O Section
 Discrete I/O Modules
•The zener diode (Z D ) voltage rating sets the minimum threshold level of voltage that can be
detected.
•When light from the LED strikes the phototransistor, it switches into conduction and
the status of the pushbutton is communicated in logic to the processor.
•The optical isolator not only separates the higher AC input voltage from the logic circuits
but also prevents
damage to the processor
Due to line voltage transients.
•In addition, this isolation also
helps reduce the effects of
electrical noise, common in the
industrial environment, which
can cause erratic operation of the
processor.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules
The input signal for the PLC can be either AC or DC
If the input signal is AC then the circuit that convert this AC signal into DC was shown
in previous slide

If the input signal is DC then the circuit below will be used to convert the signal into
5 volt signal
Programmable Logic Controller

 The I/O Section


 Discrete I/O Modules
Discrete input modules perform four tasks in the PLC control system. They:

• Sense when a signal is received from a field device.

• Convert the input signal to the correct voltage level for the particular PLC.

• Isolate the PLC from fluctuations in the input signal’s voltage or current.

• Send a signal to the processor indicating which sensor originated the signal.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

Figure shows the block diagram for one output of a typical discrete output module.
Like the input module, it is composed of two basic sections: the power section and
the logic section, coupled by an isolation circuit.
The output interface can be thought of as an electronic switch that turns the output
load device on and off.
Logic circuits determine the output status.
An output LED indicates the status of the output signal.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

A simplified diagram for a single output of a discrete AC output module is shown in Figure.
The operation of the circuit can be summarized as follows:
•the digital logic circuits of the processor sets the output status according to the
program.
•When the processor calls for an output load
to be energized, a voltage is applied across
the LED of the opto-isolator.
•The LED then emits light, which switches the
phototransistor into conduction.
•This in turn triggers the triac AC semiconductor
switch into conduction allowing current to
flow to the output load.
Programmable Logic Controller

 The I/O Section


 Discrete I/O Modules

•PLC outputs must convert the 5Vdc logic levels on the PLC data bus to external
voltage levels. This can be done with circuits similar to those shown below.

Transistor (DC output)


Programmable Logic Controller

 The I/O Section


 Discrete I/O Modules

TRIAC (AC output)


t
Programmable Logic Controller

 The I/O Section


 Discrete I/O Modules

Relay (AC and DC output)


Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

Certain DC I/O modules specify whether the module is designed for interfacing with
current-source or current-sink devices.
If the module is a current-sourcing module, then the input or output device must be
a current-sinking device.
Conversely, if the module is specified as current-sinking, then the connected device
must be current-sourcing.
Some modules allow the user to select whether the module will act as current
sinking or current sourcing, thereby allowing it to be set to whatever the field devices
require.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

In general, sinking (NPN) and sourcing (PNP) are terms used to describe a current
signal flow relationship between field input and output devices in a control system and
their power supply.
Figure illustrates the current flow relationship between sinking and sourcing inputs
to a DC input module.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

A major issue with outputs is mixed power sources.


It is good practice to isolate all power supplies and keep their commons separate,
but this is not always feasible.
Some output modules, such as relays, allow each output to have its own common.
Other output cards require that multiple, or all, outputs on each card share the same
common.
Each output card will be isolated from the rest, so each common will have to be
connected.
It is common for beginners to only connect the common to one card, and forget the
other cards
-then only one card seems to work!
Programmable Logic Controller

The I/O Section


Discrete I/O Modules
The output card shown in Figure 3.5 is an example of a 24Vdc output card that has
a shared common.
This type of output card would typically use transistors for the outputs.
In this example the outputs are connected to a low current light bulb (lamp) and a
relay coil.

Consider the circuit through the lamp,


starting at the 24Vdc supply.

When the output 07 is on, current can


flow in 07 to the COM, thus completing
the circuit, and allowing the light to turn
on.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules

If the output is off the current cannot flow, and the light will not turn on.
The output 03 for the relay is connected in a similar way. When the output 03 is
on, current will flow through the relay coil to close the contacts and supply 120Vac to
the motor.
This card could have many
different voltages applied
from different sources, but
all the power supplies
would need a single shared
common.

Sinking
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules
The circuits in Figure had the sequence of power supply, then device, then PLC
card, then power supply.
Sourcing
In this example the positive terminal
Of the 24Vdc supply is connected to the
output card directly.
When an output is on power will be
supplied to that output.
Programmable Logic Controller

 The I/O Section


Discrete I/O Modules
In this example the 24Vdc supply is connected directly to both relays (note that
this requires 2 connections now, whereas the previous example only required one).
When an output is activated the output switches on and power is delivered to the
output devices.
This layout is more similar to Figure
3.6 with the outputs supplying voltage,
but the relays could also be used to
connect outputs to grounds, as in
Figure .3.5
When using relay outputs it is possible
to have each output isolated from the
next. A relay output card could have AC
and DC outputs beside each other.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
Earlier PLCs were limited to discrete or digital I/O interfaces, which allowed only
on/off-type devices to be connected.
This limitation meant that the PLC could have only partial control of many process
applications.
Today, however, a complete range of both discrete and analogue interfaces are
available that will allow controllers to be applied to practically any type of control
process.
 Discrete devices are inputs and outputs that have only two states: on and off.
In comparison, analogue devices represent physical quantities that can have an
infinite number of values.
Typical analogue inputs and outputs vary from 0 to 20 milliamps, 4 to 20 milliamps,
or 0 to 10 volts.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
Figure 2-22 illustrates how PLC analogue input and output modules are used in
measuring and displaying the level of fluid in a tank.
The analogue input interface module contains the circuitry necessary to accept an
analogue voltage current signal from the level transmitter field device.
This input is converted from an analogue to a digital value for use by the processor.
The circuitry of the analogue output module accepts the digital value from the
processor and converts it back to an analogue signal that drives the field tank level
meter.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
Analogue input modules normally have multiple input channels that allow 4, 8, or
16 devices to be interface to the PLC.
The two basic types of analogue input modules are voltage sensing and current
sensing.
Analogue sensors measure a varying physical quantity over a specific range and
generate a corresponding voltage or current signal.
Common physical quantities measured by a PLC analogue module include
temperature, speed, level, flow, weight, pressure, and position.
For example, a sensor may measure temperature over a range of 0 to 500°C, and
output a corresponding voltage signal that varies between 0 and 50 mV.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
Figure illustrates an example of a voltage sensing input analogue module used to
measure temperature.
The connection diagram applies to an Allen-Bradley Micro- Logic 4-channel analogue
thermocouple input module.
A varying DC voltage in the low millivolt range, proportional to the temperature
being monitored, is produced by the thermocouple.
This voltage is amplified and
Digitized by the analogue input module
and then sent to the processor on
command from a program
instruction.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
Because of the low voltage level of the input signal, a twisted shielded
pair cable is used in wiring the circuit to reduce unwanted electrical noise signals that
can be induced in the conductors from other wiring.
 When using an ungrounded thermocouple, the shield must be connected to ground
at the module end.
To obtain accurate readings from each of the channels, the temperature between
the thermocouple wire and the input
channel must be compensated for.
A cold junction compensating (CJC)
thermistor is integrated in the
terminal block for this purpose.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
The transition of an analogue signal to digital values is accomplished by an analogue-
to-digital (A/D) converter, the main element of the analogue input module.
 Analogue voltage input modules are available in two types: unipolar and bipolar.
 Unipolar modules can accept an input signal that varies in the positive direction only.
For example, if the field device outputs 0 V to 110 V, then the unipolar modules
would be used.
Bipolar signals swing between a maximum negative value and a maximum positive
value.
For example, if the field device outputs 210 V to 110 V a bipolar module would be
used.
The resolution of an analogue input channel refers to the smallest change in input
signal value that can be sensed and is based on the number of bits used in the digital
representation.
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
Analogue input modules must produce a range of digital values between a maximum
and minimum value to represent the analogue signal over its entire span.
 Typical specifications are as follows:
Programmable Logic Controller

 The I/O Section


 Analogue I/O Modules
The analogue output interface module receives from the processor digital data,
which are converted into a proportional voltage or current to control an analogue field
device.
 The transition of a digital signal to analogue values is accomplished by a digital-to-
analogue (D/A) converter, the main element of the analog output module.
An analogue output signal is a continuous and changing signal that is varied under
the control of the PLC program.
Common devices controlled by a PLC analogue output module include instruments,
control valves, chart recorder, electronic drives, and other types of control devices that
respond to analogue signals.
Programmable Logic Controller

 The I/O Section


 Special I/O Modules
 HIGH-SPEED COUNTER MODULE
The high-speed counter module is used to provide an interface for applications
requiring counter speeds that surpass the capability of the PLC ladder program.
High-speed counter modules are used to count pulses ( Figure ) from sensors,
encoders, and switches that operate at very high speeds.
They have the electronics needed to count independently of the processor.
A typical count rate available is 0 to 100 kHz, which means the module would
be able to count 100,000 pulses per second.
Programmable Logic Controller

 The I/O Section


 Special I/O Modules
 ENCODER-COUNTER MODULE
An encoder-counter module allows the user to read the signal from an encoder (
Figure ) on a real-time basis and stores this information so it can be read later by the
processor.
Programmable Logic Controller

 The I/O Section


 Special I/O Modules
 STEPPER-MOTOR MODULE
The stepper-motor module provides pulse trains to a stepper-motor translator,
which enables control of a stepper motor ( Figure.)
The commands for the module are determined by the control program in the PLC.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications

 NOMINAL INPUT VOLTAGE

 This discrete input module voltage value specifies the magnitude (e.g., 5 V, 24 V, 230
V) and type (AC or DC) of user-supplied voltage that a module is designed to accept.

 Input modules are typically designed to operate correctly without damage within a
range of plus or minus 10 percent of the input voltage rating.

 With DC input modules, the input voltage may also be expressed as an operating
range (e.g., 24–60 volts DC) over which the module will operate.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications

 INPUT THRESHOLD VOLTAGES

 This discrete input module specification specifies two values:


1a minimum ON-state voltage that is the minimum voltage at which logic 1 is
recognized as absolutely ON;
2a maximum OFF-state voltage which is the voltage at which logic 0 is recognized as
absolutely OFF.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications

 NOMINAL CURRENT PER INPUT

This value specifies the minimum input current that the discrete input devices must
be capable of driving to operate the input circuit.

 This input current value, in conjunction with the input voltage, functions as a
threshold to protect against detecting noise or leakage currents as valid signals.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications

 AMBIENT TEMPERATURE RATING


 This value specifies what the maximum temperature of the air surrounding the I/O
modules should be for best operating conditions.
 INPUT ON/OFF DELAY

 Also known as response time , this value specifies the maximum time duration
required by an input module’s circuitry to recognize that a field device has switched
ON (input ON-delay) or switched OFF (input OFF- delay).
 This delay is a result of filtering circuitry provided to protect against contact bounce
and voltage transients.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications

 OUTPUT VOLTAGE
This AC or DC value specifies the magnitude (e.g., 5 V, 115 V, 230 V) and type (AC or
DC) of user-supplied voltage at which a discrete output module is designed to operate.
The output field device that the module interfaces to the PLC must be matched to
this specification.
Output modules are typically designed to operate within a range of plus or minus 10
percent of the nominal output voltage rating.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications


 OUTPUT CURRENT
These values specify the maximum current that a single output and the module as a
whole can safely carry under load (at rated voltage).
This rating is a function of the module’s components and heat dissipation
characteristics.
A device drawing more than the rated output current results in overloading, causing
the output fuse to blow.
As an example, the specification may give each output a current limit of 1 A.
The overall rating of the module current will normally be less than the total of the
individuals.
 The overall rating might be 6 A because each of the eight devices would not
normally draw their 1 A at the same time.
Other names for the output current rating are maximum continuous current and
maximum load current.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications


 ELECTRICAL ISOLATION
Recall that I/O module circuitry is electrically isolated to protect the low-level
internal circuitry of the PLC from high voltages that can be encountered from field
device connections.
The specification for electrical isolation, typically 1500 or 2500 volts AC, rates the
module’s capacity for sustaining an excessive voltage at its input or output terminals.
Although this isolation protects the logic side of the module from excessive input or
output voltages or current, the power circuitry of the module may be damaged.
Programmable Logic Controller

 The I/O Section

 Discrete I/O Specifications


 POINTS PER MODULE
This specification defines the number of field inputs or outputs that can be
connected to a single module.
Most commonly, a discrete module will have 8, 16, or 32 circuits; however, low-end
controllers may have only 2 or 4 circuits.
Modules with 32 or 64 input or output bits are referred to as high-density modules.
 Some modules provide more than one common terminal, which allows the user to
use different voltage ranges on the same card as well as to distribute the current more
effectively.
Programmable Logic Controller

 The I/O Section


 Analogue modules
 CHANNELS PER MODULE
Whereas individual circuits on discrete I/O modules are referred to as points,
circuits on analog I/O modules are often referred to as channels.
These modules normally have 4, 8, or 16 channels.
Analog modules may allow for either single-ended or differential connections.
Single-ended connections use a single ground terminal for all channels
or for groups of channels.
Differential connections use a separate positive and negative terminal for each
channel.
If the module normally allows 16 single-ended connections, it will generally allow
only 8 differential connections.
Single-ended connections are more susceptible to electrical noise.
Programmable Logic Controller

 The I/O Section


 Analogue modules
 INPUT CURRENT/VOLTAGE RANGE(S)
These are the voltage or current signal ranges that an analog input module is
designed to accept.
The input ranges must be matched accordingly to the varying current or voltage
signals generated by the analog sensors.
 OUTPUT CURRENT/VOLTAGE RANGE(S)
This specification defines the current or voltage signal ranges that a particular
analog output module is designed to output under program control.
The output ranges must be matched according to the varying voltage or current
signals that will be required to drive the analog output Devices.
Programmable Logic Controller

 The I/O Section


 Analogue modules
 OUTPUT CURRENT/VOLTAGE RANGE(S)
This specification defines the current or voltage signal ranges that a particular analog
output module is designed to output under program control.
 The output ranges must be matched according to the varying voltage or current
signals that will be required to drive the analog output devices.
 RESOLUTION
The resolution of an analog I/O module specifies how accurately an analog value
can be represented digitally.
This specification determines the smallest measurable unit of current or voltage. The
higher the resolution (typically specified in bits), the more accurately an analog value
can be represented.
 INPUT IMPEDANCE AND CAPACITANCE
For analog I/Os, these values must be matched to the external device connected to
the module.
Typical ratings are in Megohm (MV) and picofarads (pF).
Chapter 3: Number Systems and Codes

Textbook: Petruzella, Frank D., Programmable Logic Controllers.


McGraw Hill Companies Inc., 5th edition
Decimal System

The radix or base of a number system determines


the total number of different symbols or digits
used by the system.

The decimal system has a base of 10.

In the decimal system, 10 unique numbers or


digits ( 0 through 9) are used: the total number
of symbols is the same as the base, and the symbol
with the largest value is 1 less than the base.
Decimal System

The decimal system can be summarized as follows:

Ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Base: 10

Weights: 1, 10, 100, 1000, …(powers of base 10)


Decimal System
Weighted value in the decimal system
Binary System
The binary system has a base of 2.

The only allowable digits are 0 and 1

Digital Signal Waveform: with digital circuits it is easy


to distinguish between two voltage levels - +5 V and O V,
which can be related to the binary digits 1 and 0.

Volts +5 High (H) (1)

0 Low (L) (0)


Time
Binary System

The binary system can be summarized as follows:

Two digits: 0, 1

Base: 2

Weights: 1, 2, 4, 8, 16, 32, …(powers of base 2)


Binary System Decimal Binary

Since the binary system uses only 0 0000


two digits, each position of a binary
1 0001
number can go through only two
changes, and then a 1 is carried to
2 0010
the immediate left position.
3 0011
To express the number in the 4 0100
binary system requires many 5 0101
more digits than in the decimal 6 0110
system. 7 0111
8 1000
Converting For Binary To Decimal
Converting For Binary To Decimal

Another Method
In the binary number
when you see a 1, multiply
128 64 32 16 8 4 2 1
that 1 times the value that
is directly over it. Where
you see a 0 in the box,
just ignore it.

If we add only those numbers which have a binary 1


in the box under them, we come up with
128+32+8+4+1 which equals 173.
Bits – Bytes - Words
Each digit of a binary number is known as a bit.

A group of 8 bits is known as a byte.


16-Bit Word
A group of bits that occupies one or more storage
MSB
locations Bit
and is treated as a unit is known as a word.

A 16-bit word is made up of two bytes (Upper and Lower).

The least Upper


significant
Byte bit (LSB) is the digit that represents
LSB
the smallest value.

The most significant bit (MSB) is the digit that represents


the largest value.
PLC Processor Memory Size
The size of the programmable controller relates to the
amount of user program that can be stored.

The 1 K word memory


size shown can store
1,024 words, or 16,380
(1,024 x 16) bits of
information using
16-bit words or 32,768
(1,024 x 32) using
32 bit words.
Converting For Decimal To Binary
Binary Representation Of Data
Even though the binary system has only two digits,
it can be used to represent any quantity that can be
represented in the decimal system. Computer memory
is then a series of binary 1s and 0s.
SLC 500 Modular Chassis Output Status File

AEach
One
wordbit
16-bit
represents
will output
be file
thein
created word
“on” is
orreserved
“off”
the table state
only ifforofeach
the one slot
processor
TheMade
column
up of
onsingle
the right
bitslists
grouped
the output
into 16-bit
module words
address.
output
in the
finds anpoint.
chassis.
outputThese points
module are numbered
residing 0 through15.
in a particular slot.
1. The binary number system has a base of 8.
(True/False)

2. The decimal number 7 would be written in


binary as 1011. (True/False)

3. To express a number in decimal requires fewer


digits than in the binary system. (True/False)

4. For a base 2 number system, the weight value


associated with the 3rd digit would be 4.
(True/False)
5. What is the decimal value of binary 110000 ?
a. 48 c. 13
b. 26 d. 7
6. The decimal number 15 would be written in
binary as:
a. 1111 c. 4C
b. 1000 d. 00011001

7. Data can be stored in one 16-bit word as two


separate groups of 8-bit data. (True/False)
8. A group of 8 bits is known as a byte.
(True/False)

9. The MSB is the digit that represents the


smallest value. (True/False)

10. Since the binary system has only two digits,


it is limited as far as representing very large
quantities. (True/False)
Negative Numbers
In the binary system it is not possible to use positive
and negative symbols to represent the polarity of a
number.
One method is of representing a binary number as
either a positive or negative value is to use an extra digit,
or sign bit, at the MSB of the number. In the sign bit
position, a “0” indicates that the number is positive,
and a “1” indicates a negative number.

Sign
Sign Decimal
Decimal
Bit Magnitude
Bit MagnitudeBits
Bits Value
Value
Negative Numbers

Another method of expressing a negative number in a


digital system is by using the complement of a binary
number. To represent a negative number in 1's
complement you simply take the numbers magnitude
and flip all the bits (i.e. 1 becomes 0, and 0 becomes 1).

+3 binary representation: 0011

-3 binary representation: 1100 (1’s complement)


Negative Numbers

The most common way to express a negative binary


number is to show it as a 2’s complement number. The
2’s complement is the binary number that results
when 1 is added to the 1’s complement.

+3 binary representation: 0011

-3 binary representation: 1100 (1’s complement)

-3 binary representation: 1101 (2’s complement)


Octal System
The octal numbering system can be summarized
as follows:

Eight digits: 0, 1, 2, 3, 4, 5, 6, 7

Base: 8

Weights: 1, 8, 64, 512, …(powers of base 8)

The octal number system is sometimes used


because 8 data bits make up a byte of information
that can be easily addressed by the PLC user or
programmer.
Octal System
The Allen-Bradley PLC-5 family of PLCs uses
the octal numbering systems for addressing
of I/O modules.

I:2/16 O:3/22
Octal System
The digits range from 0 to 7; therefore, numbers
8 and 9 are not allowed!
Converting Octal To Decimal
As in all other numbering system, each digit in an
octal number has a weighted decimal value
according to its position.
Converting Octal-to-Binary
Octal is used to handle large binary numbers. One octal
digit is used to express three binary digits.
Hexadecimal System
The hexadecimal (hex) numbering system can
be summarized as follows:

Sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Base: 16

Weights: 1, 16, 256, …(powers of base 16)

The hex numbering system is used in PLCs because


a word of data often consists of 16 data bits, or
two 8-bit bytes.
Hexadecimal-to-Decimal Conversion
To convert a hexadecimal number to its decimal
equivalent, the hexadecimal digits in the columns are
multiplied by the base 16 weight.
Hexadecimal-to-Binary Conversion
Using the hex numbering system allows the status
of a large number of binary bits to be represented
in a small space such as a PLC programming display.
BCD (Binary-Coded Decimal) System

The BCD (Binary-Coded Decimal) numbering system


provides a convenient way of handling large numbers
that need to be inputted to or outputted from a PLC.

There is no easy way to go from binary to decimal


and back. The BCD system provides a means of
converting a code readily handled by humans (decimal)
to a code readily handled by equipment (binary).
Examples Of Numeric
Values In:
Decimal,
Binary,
BCD,
and Hexadecimal,
Representation
BCD Representation Of Decimal Number

Conversion from Decimal to BCD is straightforward.


You merely use 4 bits to represent each decimal digit.
BCD Thumb-Wheel Switch Interface
A decimal number
The circuit board is selected
has one connection
for each bit’s
weight plus a
common

The thumb-wheel
switch outputs the
equivalent 4-bits
of BCD data
Typical PLC Number Conversion Instruction

Convert To Decimal Instruction

This instruction will convert the binary bit pattern


at the source address N7:23, into a BCD bit pattern
of the same decimal value as the destination address,
O:20. The instruction executes every time it is scanned
and the instruction is true.
Gray Code
The Gray code is a special type of binary code that does
not use position weighting.

It is set up so that as we progress from one number to


the next, only one bit changes. For this reason, the Gray
code is considered to be an error-minimizing code.

Because only one bit changes at a time, the speed of


transition for the Gray code is considerably faster
than that for codes such as BCD.
Gray Code
Gray codes are used with with position encoders for
accurate control of the motion of robots, machine tools,
and servomechanisms.
The encoder disk is attached
Typical Encoder Disk to a rotating shaft and outputs
a digital Gray code signal that
is used to determine the position
of the shaft.
ASCII Code

ASCII stands for American Standard Code for


Information Interchange. It is an alphanumeric code
because it indicates letters as well as numbers.

The keystrokes
on the keyboard
of a computer are
converted directly
into ASCII for
processing by the
computer.
Parity Bit
Some PLC communications systems use a parity bit
to check the accuracy of data transmission. For example,
when data are transferred between PLCs, one of the
binary bits may accidentally change states.

Parity is a system where each character transmitted


contains one additional bit known as a parity bit. The bit
may be binary 0 or binary 1, depending on the number
of 1’s and 0’s in the character itself.

Two systems of parity are normally used:


odd and even.
Odd parity Parity Bit
means that the
total number of
binary 1 bits in
the character,
including the
parity bit, is odd.

Even parity
means that the
total number of
binary 1 bits in
the character,
including the
parity bit, is even.
Binary Addition

When adding with binary numbers, there are only


four conditions that can occur.
Binary Addition

When adding larger binary numbers, the resulting


1’s are carried into higher-order columns.
Binary Subtraction
To subtract from larger binary numbers, subtract
column by column, borrowing from the adjacent
column when necessary. Remember that when
borrowing from the adjacent column, there are
two digits, i. e., 0 borrow 1 gives 10.
Binary Subtraction
To subtract using the 1’s complement:
1. Change the subtrahend to 1’s complement
2. Add the two numbers
3. Remove the last carry and add it to the number

1’s complement
Binary Multiplication

When multiplying binary numbers, there are only


four conditions that can occur.

0x0=0

0x1=0

1x0=0

1x1=1
Binary Multiplication

To multiply numbers with more than one digit,


form partial products and add them together.

101
x 110
000
101
101
11110
Binary Division

The process for dividing one binary number by


another is the same for both binary and decimal
numbers.
111
10 1110
10
11
10
10
10
00
Typical PLC Add, Subtract,
Multiply, and Divide Instructions
PLC Data Comparison Instructions
Are used to compare the relative magnitude of two
quantities.

At times devices may need to be controlled when they


are less than, equal to or greater than other data values
or set points used in the application, like timer and
counter values.

A = B (A equals B)

A > B (A is greater than B)

A < B (A is less than B)


11. In the binary system + and – symbols are
used to indicate whether a number is positive or
negative. (True/False)

12. Numbers 8 and 9 are not used in the octal


number system. (True/False)

13. The octal number 153 would be written in


binary as:
a. 011 101 001 c. 011 111 101
b. 001 101 011 d. 010 100 011
14. The hexadecimal (hex) numbering system is a
base ______ system.
(a) 2
(b) 8
(c) 10
(d) 16

15. What is the decimal equivalent for the BCD


number 1000 0100 0010 0001?
(a) 8421
(b) 7863
(c) 1234
(d) 3728
16. The Gray code is set up so that as we progress
from one number to the next, only one bit changes.
(True/False)

17. Which code is used to convert the keystrokes


on the keyboard of a computer for the
processor?
(a) BCD
(b) HEX
(c) ASCII
(d) OCTAL
18. A parity bit is used to check the _______ of data
transmission.
(a) speed
(b) type
(c) accuracy
(d) time

19. What is the sum of binary numbers 1100 and


1011?
a. 10110 c. 10111
b. 11100 d. 00111
20. Which instruction is used to compare the
relative magnitude of two quantities?
(a) Add
(b) Subtract
(c) Multiply
(d) Less Than
Chapter 5: Basic of PLC Programming

Textbook: Petruzella, Frank D., Programmable Logic Controllers.


McGraw Hill Companies Inc., 5th edition
5.1

Processor Memory
Organization
The memory space can be divided into two
broad categories: program files and Data files.

Program and
Data file
organization for
the SLC 500
controller.
Program files are the areas of processor memory
where ladder logic programming is stored.
Program files are the part of
the processor memory that
stores the user ladder logic
program. The program
accounts for most of the total
memory of a given PLC system.
The Data file portion of the processor’s memory
stores input and output status, processor status,
the status of various bits, and numerical data.
These files are
organized by
the type of data
they contain.
The input image table
is allocated to storing
the on/off status of
connected discrete
inputs.

If the input is on (switch


closed), its corresponding
bit in the table is set to 1.

If the input is off (switch


open), the corresponding
bit is cleared, or reset to 0.
The output image table is
allocated to storing the
on/off status of connected
discrete outputs.
If the program calls for
an output to be ON, its
corresponding bit in the
table is set to 1.

If the program calls for


an output to be OFF, its
corresponding bit in the
table is set to 0.
Typically, micro PLCs have a fixed number of
inputs and outputs.

This controller has 20 discrete inputs with addresses I/0 through


I/19 and 12 discrete outputs with addresses O/1 through O/11.
5.2

Program Scan
During each program scan cycle, the processor
reads all the inputs, takes these values, and
energizes or de-energizes the outputs according to
the user program.
The time it takes to complete a scan cycle is a
measure of how fast the controller can react to
changes in inputs.

If a controller has to react to


an input signal that
changes states twice during
the scan time, it is possible
that the PLC will never be
able to detect this change.
The scan time is a function of:
• The speed of the processor module
• The length of the ladder program
• The type of instructions executed
• The actual ladder true/false conditions

The PLC computes the scan time each


time the END instruction is executed.

Typical scan time data include the


maximum scan time and the last scan time.
Scan process applied to a single rung program.
Vertical versus horizontal scan patterns.
5.3

PLC Programming
Languages
PLC programming language refers to the
method by which the user communicates
information to the PLC.

Standard PLC programming languages


Ladder diagram language is the most commonly
used PLC language and is designed to mimic
hardwired relay logic.

Hardwired relay
control circuit

Equivalent ladder
diagram program
Instruction list programming language consists
of a series of instructions that refer to the basic
AND, OR, and NOT logic gate functions.

Hardwired relay
control circuit

Equivalent instruction
list program
Functional block diagram programming uses
instructions that are programmed as blocks wired
together to accomplish certain functions.
Ladder diagram and functional block diagram
programming used to produce the same logical
output.

Ladder diagram

Equivalent
function block
diagram.
Sequential
function chart
programming
language is
similar to a
flowchart of
your process.

The program is split into


steps with multiple
operations happening in
parallel branches.
Structured text is a high level language primarily
used to implement more complex procedures.

Ladder diagram

Equivalent
structured text
program.
5.4

Relay Type Instructions


The ladder diagram language is a symbolic set
of instructions used to create the controller
program.

Representations of contacts and coils are the basic


symbols of the logic ladder diagram instruction set.
The Examine If Closed (XIC) instruction looks
and operates like a normally open relay contact.

Associated with each XIC


instruction is a memory bit
linked to the status of an
input device or an internal
logical condition in a rung.
The memory bit is set to 1 or 0 depending on the
status of the input.
A 1 corresponds to a true status or on condition.

If the instruction memory bit is a 1 (true) this


instruction will allow rung continuity through itself,
like a closed relay contact.
A 0 corresponds to a false status or off condition.

If the instruction memory bit is a 0 (false) this


instruction will not allow rung continuity through
itself and will assume a normally open state just like
an open relay contact.
The Examine If Open (XIO) instruction looks
and operates like a normally closed relay
contact.

This instruction asks the PLC’s processor to examine


if the contact is open.

It does this by examining the bit at the memory


location specified by the address for a 0 or 1.
As with any other input the memory bit is set to 1 or 0
depending on the status of the input. A 1 corresponds to
a true status or on condition.

The instruction is interpreted as false when the bit is


1 and will not allow rung continuity through itself.
A 0 corresponds to a off condition.

The instruction is interpreted as true when the bit is


0 and will not allow rung continuity through itself.
The Output Energize (OTE) instruction looks
and operates like a relay coil.

This instruction signals the PLC to energize


(switch on) or de-energize (switch off ) the output.

The instruction is associated with a memory bit that


energizes the output when set to 1 and de-energizes
the output when reset to 0.
OTE instruction
is set to 1 to
energize the
output.

A true logic
path is
established by
the input
instructions in
the rung.
Action of the field device and PLC bit.

A signal
present makes
the NO bit (1)
true; a signal
absent makes
the NO bit (0)
false.
The reverse is
true for an
NC bit.
The main function of the ladder logic diagram
program is to control outputs based on input
conditions.
Each contact or coil symbol is referenced with an
address that identifies what is being evaluated and
what is being controlled.

The same contact


instruction can be
used throughout the
program whenever
that condition needs
to be evaluated.
For an output to be activated or energized, at
least one left-to-right true logical path must exist.

A complete closed
path is referred to
as having logical
continuity.

When logical continuity exists in at least one path, the


rung condition and Output Energize instruction are
said to be true.
5.5

Instruction Addressing
To complete the entry of a relay-type instruction,
you must assign an address to each instruction.
Address indicates
what input is
connected to what
input device

Address indicates
what output is
connected to what
output device
The assignment of an I/O address can be
included in the I/O connection diagram.

Inputs and outputs are typically represented by


squares and diamonds, respectively.
5.6

Branch Instructions
Branch instructions are used to create parallel
paths of input condition instructions.

The rung will be


true if either
instruction
A or B is true.
Parallel branches can be used to allow more than
one combination of input conditions.

Either A and not B, or C provides logical


continuity and energizes output D.
Output branching allows a true logic path to
control multiple outputs

Either A or B provides a
true logical path to all
three output instructions:
C, D, and E.

Additional input
instructions can be
programmed in the
output branches.
Input and output branches can be nested to avoid
redundant instructions and to speed up processor
scan time.

A nested branch starts or ends within another branch.


In some PLC models, the
programming of a nested
branch cannot be done
directly.

It is possible, however,
to program a logically
equivalent branching
condition.
There may be limitations to the number of
series contact instructions that can be included
in one rung of a ladder diagram as well as
limitations to the number of parallel branches.
The PLC will not allow
for programming of
vertical contacts.

Reprogrammed to eliminate
vertical contact.
The processor examines the ladder logic rung for logic
continuity from left to right.

If programmed as shown,
contact combination
FDBC would be ignored.

Reprogrammed circuit.
5.7

Internal Relay
Instructions
An internal output does not directly control an
output field device.

The advantage of using internal outputs is that there


are many situations in which an output instruction is
required in a program but no physical connection to a
field device is needed.
Internal relay used for a program that requires
more series contacts than the rung allows.

This PLC allows for only 7 series contacts when 12


are actually required for the programmed logic.
5.8

Programming Examine
If Closed and Examine
If Open Instructions
Examine If Closed (XIC) instruction

Both the NO and the NC pushbuttons are represented


in the program by the Examine If Closed instruction.

The normal state of the field input device (NO


or NC) does not matter to the controller.

What matters is that contacts need to closed to energize


the output.
Examine If Open (XIO) instruction

The pushbutton is represented in the user program by


an Examine If Open instruction.

This is because the rung must be true when the


external pushbutton is open and false when the
pushbutton is closed.
The logic states (0 or 1) indicate whether an instruction
is true or false and is the basis of controller operation.
The time aspect relates to the repeated scans of the
program, wherein the input table is updated with the
most current status bits.
5.10

Modes Of Operation
The program mode is used to enter
a new program, edit or update an
existing program, upload files and
download files.

The run mode is used to


execute the user program.

The test mode is used to operate


or monitor the user program
without energizing any outputs.

The remote position allows the PLC to be remotely


changed between program and run mode by a
personal computer connected to the PLC processor.
Automation

5.2 Program scan:

70
Automation

71
Automation

72
Automation

73
Automation

74
Automation

75
Automation

76
Automation

77
Automation

78
Automation

Notice: We will use this


scan pattern through out
79
this course
Automation

80
Automation

81
Automation

82
Automation

83
Automation

84
Automation

85
Automation

86
Automation

87
Automation

88
Automation

89
Automation

90
Automation

91
Automation

92
Automation

93
Automation

94
Automation

95
Automation

96
Automation

97
Automation

98
Automation

99
Automation

100
Automation

101
Automation

102
Automation

103
Automation

104
Automation

105
Automation

106
Automation

107
Automation

108
Automation

109
Automation

110
Automation

111
Automation

112
Automation

113
Automation

114
Automation

115
Automation

116
Chapter 6: Developing Fundamental PLC
Wiring Diagrams and Ladder Logic
Programs

Textbook: Petruzella, Frank D., Programmable Logic Controllers.


McGraw Hill Companies Inc., 5th edition
6.1

Electromagnetic
Control Relays
A PLC was designed to
replace control relays that
made logic decisions.

An electrical relay
is a magnetic
switch which uses
electromagnetism
to switch contacts.
Relay operation.

De-energized

Energized
Normally open (NO) and normally closed (NC)
contacts.
NO contacts are open
when the coil is
de-energized and closed
when the coil is energized

NC contacts are closed


when the coil is
de-energized and open
when the coil is energized
Relay symbols.

The letter M
frequently indicates
a motor starter coil.

CR is used for
control relays.
Control relay used to control two pilot lights.

Switch open and Switch closed and


coil de-energized coil energized
Equivalent PLC simulation of a control
relay used to control two pilot lights.
6.2

Contactors
A contactor is a special type of
relay designed to handle heavy
power loads that are beyond
the capability of control relays.
PLC used in
conjunction
with a contactor
to switch power
on and off to a
pump.
6.3

Motor Starters
Contactor
The motor starter is
made up of a
contactor with an
overload relay
attached physically
and electrically to it.
Overload
Relay
Hardwired three-phase magnetic motor starter.
PLC programmed magnetic motor starter.
Simulated PLC magnetic motor starter.
6.4

Manually Operated
Switches
Manually operated switches are controlled by hand.

Makes a circuit Opens the When the


when it is circuit when it is button is
pressed and pressed and pressed, the top
returns to its returns to the contacts open
open position closed position before the
when the button when the button bottom contacts
is released. is released. are closed.
A selector switch operator is rotated (instead of
pushed) to open and close contacts of the
attached contact block.
Dual in-line package (DIP) switches are small
switch assemblies designed for mounting on
printed circuit board modules

DIP switches use binary


(on/off) settings to set the
parameters for a
particular module.
6.5

Mechanically Operated
Switches
A mechanically operated switch is controlled
automatically by factors such as pressure,
position, or temperature.

Limit switches are designed to operate


only when a predetermined limit is
reached, and they are usually actuated
by contact with an object such as a cam.
A temperature switch, or
thermostat, is used to sense
temperature changes.

Temperature
switches open or
close when a
designated
temperature is
reached.
Pressure switches are used to
control the pressure of liquids
and gases.

They are designed to


open or close their
contacts when a
specified pressure is
reached and can be
pneumatically (air)
or hydraulically
(liquid) actuated.
Level switches
are used to sense
liquid levels.

The float switch is a type of level


switch which is weighted so that
as the liquid rises the switch
floats and turns upside down,
actuating its internal contacts.
6.6

Sensors
Proximity sensors detect
the presence of an object
without physical
contact.

These solid-
state electronic
devices are
completely
encapsulated.
Proximity sensors operate on different principles,
depending on the type of matter being detected.

Inductive proximity sensors are used to detect both


ferrous metals (containing iron) and nonferrous
metals (such as copper, aluminum, and brass).

Inductive proximity sensors


operate with electromagnetic
field which varies in strength
relative to a target.
The method of connecting a proximity sensor
varies with the type of sensor and its
application.

Three-wire
sensor

Two-wire
sensor
Proximity sensor
sensing range.

Most proximity sensors


come equipped with an LED
status indicator to verify the
output switching action.
A small leakage current flows through the sensor even
when the output is turned off.

When the sensor is on, a small voltage drop is lost


across its output terminals.

To operate properly, a
proximity sensor
should be powered
continuously.

The bleeder resistor allows


enough current for the sensor
to operate but not enough to
turn on the input.
Capacitive proximity sensors operate within an
electrostatic field and are actuated by both
conductive and nonconductive materials.

When the target nears the sensing surface, it enters


the electrostatic field of the electrodes and changes
the capacitance of the oscillator.
Capacitive proximity sensors will sense metal objects
as well as nonmetallic materials such as paper, glass,
liquids, and cloth.

The larger the dielectric constant of a target, the


easier it is for the capacitive sensor to detect. This makes
possible the detection of materials inside nonmetallic
containers.
A magnetic reed switch is
composed of two flat contact tabs
that are sealed in a glass tube.

When a magnetic force is generated parallel to the


reed switch, the reeds will be drawn together to
actuate the switch.
The photovoltaic cell and the photoconductive
cell are examples of light sensors.

Photovoltaic solar cell Photoconductive cell


A photoelectric sensor operates by
detecting a visible or invisible beam of
light and responding to a change in the
received light intensity.

Photoelectric
sensors are
composed of a
transmitter (light
source) and a
receiver (sensor
The scan technique refers to the method used by
photoelectric sensors to detect an object.

The through-beam scan technique places the


transmitter and receiver in direct line with each other.

Because the light beam travels in only one direction,


through-beam scanning provides long-range sensing.
In a retroreflective scan
technique, the transmitter and
receiver are housed in the
same enclosure.

This arrangement requires the use of a separate


reflector mounted across from the sensor to return light
back to the receiver.
Fiber optic sensors
use a flexible cable
containing tiny
fibers that channel
light from emitter
to receiver

Fiber optic sensor


systems are
completely
immune to all
forms of electrical
interference.
Bar code scanners are the
eyes of a data collection
system.

A bar code module


reading the bar code on
boxes as they move
along a conveyor line.

The PLC is programmed to divert the boxes to the


appropriate product lines according to the bar
code data.
An ultrasonic sensor operates by
sending high-frequency sound
waves toward the target and
measuring the time it takes for
the pulses to bounce back.

The returning echo


signal is electronically
converted to a 4- to 20-
mA output, which
supplies a monitored
measurement of level to
external control devices.
A strain gauge
converts a
mechanical
strain into an
electric signal.

The force applied to the load


cell causes it to bend. This
bending action also distorts the
physical size of the cell, which in
turn changes its resistance.
The thermocouple is
the most widely used
temperature sensor.

Thermocouples operate on the


principle that when two dissimilar
metals are joined, a predictable
DC voltage will be generated
Flow measurement involves converting the
kinetic energy that the fluid has into some other
measurable form.

Turbine flowmeters use their rotational speed to


indicate the flow velocity.
Tachometer generators convert
rotational speed into an analog
voltage signal that can be used
for control applications.
An encoder is used to convert
linear or rotary motion into a
binary digital signal.

The optical encoder uses a


light source shining on an
optical disk with lines or
slots that interrupt the
beam of light to an optical
sensor. An electronic circuit
counts the interruptions of
the beam and generates the
encoder’s digital output
pulses.
6.7

Output Control Devices


Symbols for output control devices.
Symbols for output control devices.
An actuator is a device that converts an
electrical signal into mechanical movement.
An electromechanical solenoid is an actuator that
uses electrical energy to magnetically cause mechanical
control action.
Solenoid valves are electromechanical devices that work
by passing an electrical current through a coil, thereby
changing the state of the valve.
Stepper motors rotate in discrete
increments when electrical command
pulses are applied to it in the proper
sequence.

Every revolution is
divided into a number
of steps, and the motor
must be sent a voltage
pulse for each step.

The amount of rotation is directly proportional to the


number of pulses, and the speed of rotation is relative to
the frequency of those pulses.
Servo motors operate in closed-loop mode, while
stepper motors operate in open-loop mode.
6.8

Seal-In Circuits
A seal-in circuit is a method of maintaining
current flow after a momentary switch has been
pressed and released.

Hardwired

Programmed
Simulated seal-in circuit.
Motor seal-in
circuit
implemented using
the Allen-Bradley
Pico controller.
6.9

Latching Relays
Electromagnetic latching relays are
designed to hold the relay closed after
power has been removed from the coil.

The latch coil is momentarily


energized to set the latch and hold
the relay in the latched position.

The unlatch coil is momentarily


energized to disengage the
mechanical latch and return the
relay to the unlatched position.
The PLC output latch (OTL) and output unlatch
(OTU) instructions duplicate the operation of
the electromagnetic latching relay.

The OTL and OTU instructions have the same address.


The OTL instruction can only turn a bit on and the OTU
instruction can only turn a bit off.
Hardwired and programmed latching circuits.

Hardwired

Programmed
Simulated
programmed
latching circuit.
Process used to control the level of water in a
storage tank.
Manual Mode -The
pump will start if the
water in the tank is at
any level except low.

Automatic Mode - When


the level of water reaches
the high point, the pump
will start.
-When the water level
reaches the low point, the
pump will stop .
Program used to control the water level.
I/O connections for program.
Simulated action of program used to
control the water level.

B – Manual
A - Auto
6.10

Converting Relay
Schematics into PLC
Ladder Programs
A sequential control process is required for
processes that demand that certain operations
be performed in a specific order.

In a filling and capping operations, the tasks are (1) fill


bottle and (2) press on cap. These tasks must be
performed in the proper order.
Combination controls require that certain
operations be performed without regard to the
order in which they are performed.

Here, the tasks are (1) place label 1 on bottle and (2)
place label 2 on bottle. The order in which the tasks are
performed does not really matter.
Automatic control involves maintaining a
desired set point at an output.

When maintaining a certain set-point temperature in a


furnace, if there is deviation from that set point, an error
is determined by comparing the output against the set
point and using this error to make a correction.
Sequential process control relay schematic.

1. Start button is pressed.


2. Table motor is started.
3. Package moves to the
position of the limit
switch and
automatically stops.
Sequential process control program.
Sequential process control program simulation.
Instructions programmed for optimum scan time.

The series instructions are programmed from the most


likely to be false to the least likely to be false.

The parallel path


that is most often
true is placed on
the top of the rung.
Hardwired jog circuit with control relay.
Equivalent programmed jog circuit.
Simulated programmed jog circuit.
6.11

Writing a Ladder
Logic Program
Directly from a
Narrative Description
Drilling process that
requires the drill press to
turn on only if there is a
part present and the
operator has one hand on
each of the start switches.
Simulated drilling process program
A motorized overhead garage door is to be
operated automatically to preset open and
closed positions.
Motorized overhead garage door program.
Simulated motorized overhead garage door program.
Continuous
filling operation.
This process
requires that
boxes moving on
a conveyor be
automatically
positioned and
filled.
Continuous filling operation program.
Simulated continuous filling operation program.
Chapter 7:
Programming
Timers

Textbook: Petruzella, Frank D., Programmable Logic Controllers.


McGraw Hill Companies Inc., 5th edition
Timers
There are very few industrial control systems that do not
need at least one or two timed functions. They are used to
activate or de-activate a device after a preset interval of
time.
Time delay relays and solid-state timers are used to provide a time
delay. They may have displays, pots or other means of operator
interface for time settings and electromechanical or solid state
outputs.

Time Delay Solid-State


Relay Timer
On-Delay Timing Relay

Operating coil
NO Nontimed contacts are
controlled directly by
Instantaneous the timer coil, as in a
contacts general-purpose
NC control relay.

When the coil is


energized, the timed
contacts are are
prevented from opening
NO
or closing until the time
Time control delay period has elapsed.
contacts However, when the coil is
NC de-energized, the timed
contacts return
Time adjustment instantaneously to their
normal state.
Timed Contact Symbols
On-Delay Symbols

Normally open, timed Normally closed, timed


closed contact (NOTC) open contact (NCTO)

Contact is open when Contact is closed when


relay coil is de-energized relay coil is de-energized

When relay is energized, When relay is energized,


there is a time delay in there is a time delay in
closing opening
Timed Contact Symbols
Off Delay Symbols

Normally open, timed Normally closed, timed


open contacts (NOTO). closed contacts (NCTC).
Contact is normally Contact is normally
open when relay coil closed when relay coil
is de-energized. is de-energized.
When relay coil is When relay coil is
energized, contact closes energized, contact opens
instantly. instantly.
When relay coil is de- When relay coil is de-
energized, there is a time energized, there is a time
delay before the contact delay before the contact
opens. closes.
On-Delay Relay Timer Circuit (NOTC Contact)
L1 S1
L2 Sequence of operation
S1 open, TD de-energized,
TD1 open, L1 is off.
L1
S1 closes, TD energizes,
timing period starts,
10 s
TD1 still open, L1 is still off.

10 s After 10 s, TD1 closes, L1 is


switched on.
Input
ON
S1 is opened, TD de-
OFF
Output energizes, TD1 opens
Timing Diagram instantly, L1 is switched off.
On-Delay Relay Timer Circuit (NCTO Contact)
L1 L2
S1 Sequence of operation
S1 open, TD de-energized,
TD1 closed, L1 is on.
L1
S1 closes, TD energizes,
10 s timing period starts, TD1
is still closed, L1 is still on.
10 s After 10 s, TD1 opens,
L1 is switched off.
Input
On
Output S1 is opened, TD de-energizes,
Off TD1 closes instantly, L1 is
Timing Diagram switched on.
Off-Delay Relay Timer Circuit (NOTO Contact)
L1 L2
S1 Sequence of operation
S1 open, TD de-energized,
TD1 open, L1 is off.
L1
S1 closes, TD energizes,
TD1 closes instantly,
10 s L1 is switched on.
S1 is opened, TD de-energizes,
10 s
timing period starts, TD1 is
still closed, L1 is still on.
Input
On
Off After 10 s, TD1 opens, L1 is
Output
switched off.
Timing Diagram
Off-Delay Relay Timer Circuit (NCTC Contact)
L1 L2
S1 Sequence of operation
S1 open, TD de-energized,
TD1 closed, L1 is on.
L1
S1 closes, TD energizes,
TD1 opens instantly,
10 s L1 is switched off.

10 s S1 is opened,
TD de-energizes, timing
period starts, TD1 is still
Input
On
open, L1 is still off.
Output
Off After 10 s, TD1 closes,
L1 is switched on.
Timing Diagram
Programmed Timer Instructions

PLC timers are output instructions that provide the


same functions as timing relays and solid state timers.

Some advantages of PLC timers:

their settings can be altered easily

the number of PLC timers used


can be increased or decreased by
programming changes without
wiring changes

timer accuracy and repeatability


are extremely high
RSLogic Timer Commands

TON

Timer/Counter

Command Name Description

TON Timer On-Delay Counts time base


intervals when the
instruction is “true”
RSLogic Timer Commands

TOF

Timer/Counter

Command Name Description

TOF Timer Off-Delay Counts time base


intervals when the
instruction is “false”
RSLogic Timer Commands

RTO RES

Timer/Counter

Command Name Description


Counts time base
RTO Retentive Timer intervals when the
ON instruction is “true” and
retains the accumulated
value when the
instruction goes "false" or
when power cycle occurs
When this instruction is
RES Reset
"true" it resets the count
of the RTO counter
Quantities Associated with the Timer Instruction
Preset Time – Represents the time duration of the timing
circuit. For example, if a time delay of 10 s is required,
the timer will have a preset of 10 s.

Accumulated Time – Represents the amount of time that


has elapsed from the moment the timing coil became
energized.

Time Base – Timers can typically be programmed with


several different time bases: 1 s, 0.1 s, and 0.01 s are
typical time bases. For example, if you enter 0.1 for the
time base and 50 for the preset time the timer would
have a 5 s delay (50 x 0.1 s = 5 s).
Coil-Formatted Timer Instruction
Contact determines The timer assigned
rung continuity an address
The type of timer
is specified XXX

TON

Preset value PR:YYY


Time base 0.1 s
Accumulated value AC:000
When the timer rung has logic continuity, the timer's
accumulated value increases. When accumulated value equals
the preset value, the output is energized and and the timed
output contact associated with the output is closed. The timed
contact can be used as many times as you wish throughout the
program as a NO or NC contact.
Generic Block-Formatted Timer Instruction
Timers are most often represented by boxes in a ladder
logic.
Control line controls the actual timing operation of the timer.
Whenever this line is true the timer will time.
Retentive timer block

Preset time
Time base
Accumulated time Output line

The timer continuously compares its accumulated time with its


preset time. Its output is logic 0 as long as the accumulated
time is less than the preset time. When the two become equal
the output changes to logic 1.
Reset line resets the the timer's accumulated value to zero.
On-Delay Timer Instruction
The on-delay timer
operates so that, when the Input Timer
rung containing the timer is
true, the timer time-out
period commences.
Timer Sequence True
False The timed output
Rung condition becomes true
sometimes after the
Timed period timer rung becomes
On delay
time duration true; hence the timer
is said to have an on
True
delay.
False ON
Timed output bit
OFF
Allen-Bradley On-Delay Timer Instruction
Allen-Bradley PLC-5 and SLC-500 controller timer
elements each take three data table words: the
control word, preset word, and accumulated word.

The control word uses three control bits: Enable (EN) bit,
Timer-Timing (TT) bit, and Done-Bit (DN).

TIMER TABLE

/EN /TT /DN


T4:0 0 0 0
Allen-Bradley On-Delay Timer Instruction
The Enable (EN) bit is true (has a status of 1)
whenever the timer instruction is true. When the
timer instruction is false, the enable bit is false (has
a status of 0)
Enable bit false
TON
TIMER ON DELAY
Timer T4:0 EN

T4:0
Enable bit true
EN
Allen-Bradley On-Delay Timer Instruction
The Timer-Timing (TT) bit is true whenever the
accumulated value of the timer is changing, which
means the timer is timing.

TON
TIMER ON DELAY
Timer T4:0 EN
Preset 50
Accumulated 10

T4:0
Timer-Timing bit true
TT
Allen-Bradley On-Delay Timer Instruction
The Done-Bit (DN) changes state whenever the
accumulated value reaches the preset value. Its
state depends on the type of timer being used.

TON
TIMER ON DELAY
Timer T4:0 EN
Preset 50 DN
Accumulated 10
50

T4:0
Done-bit changes state
DN
Allen-Bradley On-Delay Timer Instruction
The preset value (PRE) word is the set point of the
timer, that is, the value up to which the timer will
time.
The accumulated value (ACC) word is the value that
increments as the timer is timing. The accumulated
value will stop incrementing when its value reaches
the preset value.

TIMER TABLE
/EN /TT /DN .PRE .ACC
T4:0 0 0 0 0 0
Allen-Bradley On-Delay Timer Instruction
The information to be entered includes:
TON
TIMER ON DELAY
Timer T4:0 EN
Time base 1.0
Preset 15 DN
Accumulated 0

Timer number which must come from the timer file.


Time base which is expressed in seconds.
Preset value which is the length of the time delay.
Accumulated value which is normally entered as 0.
On-Delay Timer Program

Ladder Logic Program


L1 L2
Input A TON
TIMER ON DELAY
Input A Output B G
Timer T4:0 EN
Time base 1.0
Preset 10
Accumulated 0 DN
10 Output C R
T4:0 Output B

EN Output D Y
T4:0 Output C

TT
T4:0 Output D

DN
On-Delay Timer Program
Timing Diagram

On
Input condition A
Off
On
Timer-enable bit
Off
On
Timer-timing bit
Off
4s 4s
On
Timer-done bit
Off

Timer accumulated 0
value
On-Delay Timer Program
Timers are 3-word elements

Word
EN TT DN Internal use 0
Preset value PRE 1
Accumulated value ACC 2

Word 0 is the control word


Word 1 stores the preset value

Word 2 stores the accumulated value


On-Delay Timer With Instantaneous Output

Relay Ladder Schematic Diagram

Stop Start
L1 L2

1TD

1TD-1
(instantaneous M
contact)

1TD-2
(5 s)
(timed contact)
On-Delay Timer With Instantaneous Output

Programmed Circuit

Ladder logic program

Inputs Internal
Stop Start Output
relay
L1 L2

Stop
Motor M
Start Internal Motor
relay M

Timer
PR: 5
TB: 1 s Output
line
Start-Up Warning Signal Circuit
Relay Ladder Schematic Diagram
L1 Start-up Reset L2
PB1 PB2 CR1

CR1-1
1TD

CR1-2
Horn

CR1-3
1TD-1
(10 s)
Start-Up Warning Signal Circuit
Programmed Circuit

Ladder logic program


Inputs
Output
PB1 PB2 TON
Start-up TIMER ON DELAY
Timer T4:0 EN
PB1
Time base 1.0
T4:0 DN
Reset Preset 10 Horn
PB2 Accumulated 100
EN
Horn
T4:0 T4:0

DN EN
Timed Closed Solenoid Value Program

Ladder logic program


Input Output

L1 L2
Switch SW_1 TON
Timer On Delay
SW_1 EN Valve
Timer timer_1
Preset 12000 DN
Accumulated 120000

timer_1.dn Valve
Automatic Sequential Control System
L1 Start
L2
Stop PB2
Relay Ladder PB1
Lube oil OL
pump motor
Schematic
M1
Diagram

M1-1 Main drive


motor OL
PS1
M2

(lube oil
pressure switch) 1TD

OL

M3
1TD-1 Feed
(15 s) motor
Automatic Sequential Control System
Programmed Circuit
Ladder logic program
Inputs PB1 PB2 M1 Outputs
OL
PB1
M1
M1
PB2 OL

PS1 M2 M2
PS1
OL
M3

TON
TIMER ON DELAY EN
Timer T4:0
Time base 1.0 DN
Preset 15
Accumulated 150

T4:0 M3

DN
Off-Delay Programmed Timer
The off-delay timer (TOF) operation will keep the output
energized for a period after the rung containing the timer
has gone false.

Ladder logic program Output


Input
L1 L2

S1 I:1.0/0 TOF
TIMER OFF DELAY
I:1.0/0 EN O:2.0/1 PL
TIMER T4:3
Time base 1.0 DN
Preset 15
Accumulated 0
15

T4:3/DN O:2.0/1
Off-Delay Programmed Timer
Timing Diagram

True
Input condition
S1 False

Timed period

Off delay
timed duration

True (logic 1)

Timed output False (logic 0)

O:2.0/1 Preset value = accumulated value


Off-Delay Timer Used To Switch Motors Off
Input Ladder logic program
Output L2
L1

5000

10000

15000
Pneumatic Off-Delay Timer
L1 L2

Relay Ladder
Schematic
Diagram
Programmed Pneumatic Off-Delay Timer
Equivalent Programmed Circuit
Ladder logic program
Input Outputs

L1 L2

5
Fluid Pumping Process

Operation

 Before starting, PS1 must be closed.


 When the pump start button is pressed, the pump starts. The
button can then be released and the pump continues to operate.
 When the stop button is pushed, the pump stops.
 PS2 and PS3 must be closed for 5 s after the pump starts. If
either PS2 or PS3 opens, the pump will shut off and will not not
be able to start again for another 14 s.
Fluid Pumping Process Program
Ladder logic program

Inputs Output
L1 L2

05
Retentive Timer
A retentive timer accumulates time whenever the device
receives power, and maintains the current time should
power be removed from the device. Once the device
accumulates time equal to its preset value, the contacts of
the device change state. The retentive timer must be
intentionally reset with a separate signal for the
accumulated time to be reset.
Electromechnical Retentive Timer
Once power is applied, the motor
starts turning the cam. The
Cam operated positioning of the lobes determines
contact the time it takes to activate the
contacts. If power is removed from
Motor-driven the motor, the shaft stops but does
cam not reset.
Retentive On-Delay Timer Program
The PLC-programmed RETENTIVE ON-DELAY timer
(RTO) operates in the same way as the nonretentive on-
delay timer (TON), with one major exception. This is a
retentive timer reset (RTR) instruction.
Unlike the TON, the RTO
will hold its accumulated
value when the timer rung
goes false and will continue
timing where it left off when
the timer rung goes true
again. This timer must be
Same address accompanied by a timer reset
(RES) instruction to reset the
accumulated value of the
timer to zero.
Retentive On-Delay Timer Program

03
9
Retentive On-Delay Timing Chart
Enable bit is reset when
input pushbutton PB1 is
opened

Accum = Preset
Accum value retained
when rung goes false

When reset PB2 is closed,


the T4:2/DN bit is reset to
0. Accumulated value is
reset and held at zero until
the reset pushbutton is
opened.
Retentive On-delay Alarm Program
Ladder logic program L2
L1

60000
0

The purpose of the RTO timer is to detect whenever a piping


system has sustained a cumulative overpressure condition of 60 s.
At that point, a horn is sounded automatically. You can silence the
alarm by switching the key switch to the rest position.
Bearing Lubrication
Program
Sequence Of Operation

To start the machine, the operator turns SW on.


Before the motor shaft starts to turn, the bearings are supplied
with oil by the pump for 10 s.
The bearings also receive oil when the machine is running.
When the operator turns SW off to stop the machine, the oil
pump continues to supply oil for 15 s.
A retentive timer is used to track the total running time of the
pump. When the total running time is 3 h, the motor is shut down
and a pilot light is turned on to indicate that the filter and oil
need to be changed.
A reset button is provided to reset the process after the filter and
oil have been changed.
Bearing Lubrication Program

10
0

15

10800
Cascading Timers
The programming of two or more timers together is
called cascading. Timers may be interconnected, or
cascaded to satisfy any required control logic.

Relay Schematic
Diagram

Three motors started


automatically in
sequence with a 20-s
time delay between
each motor startup.
Equivalent Time-Delayed Motor-Starting Program

20000

20000
Annunciator Flasher Circuit
Two timers can be interconnected to form an oscillator
circuit. The oscillator logic is basically a timing circuit
programmed to generate periodic output pulses of any
duration. They can be used as part of an annunciator
system to indicate an alarm condition.

The oscillator circuit output


is programmed in series with
the alarm condition. If the
alarm condition is true, the
appropriate output
indicating light will flash.
Annunciator Flasher Circuit
Cascading of Timers for Longer Time Delays

30000

12000
Control of Traffic Lights in One Direction

A typical application for PLC timers is the control of


traffic lights.

Control of Traffic in One Direction


Sequence of Operation

Red Green Amber


30 s 25 s 5s
Control of Traffic Lights in One Direction

30

25

You might also like