3. TEXT BOOKS
• Mechatronics Electronic control system in Mechanical and Electrical Engineering, W Bolton,
Pearson Education, 1st Ed., 2005.
REFERENCE BOOKS:
• Mechatronics by HMT Ltd. - Tata McGrawHill, 1st Edition, 2000
Further Reference:
National Programme on Technology Enhanced Learning (NPTEL)
https://nptel.ac.in/courses/112103174/1 by Dr. S. N. Joshi (IITG)
4. • Explain the concepts of PLC, the process of integration in mechatronics system.
Learning Objectives
5. Module 3
Programmable logic controller: Introduction to PLC's, basic structure, Principle of
operation, Programming (concept of ladder diagram), concept of latching & selection
of a PLC.
6. Programmable Logic Controller
• PLC: Basically a controller.
• Controller: Controls the parameters of the system that affects the system
performance. (e.g. car)
• Logical controller: controls the parameters with certain logic. (e.g. Lift)
• Programmable: Can be reprogrammed for different tasks by end user
Introduction
7. Programmable Logic Controller
• Microprocessor-based controller, uses programmable memory to store
instructions to implement functions like, logic, sequence, timing, etc. to control
parameters of the system for effectiveness.
• Can be reprogrammed for different tasks by end user.
Introduction
8. Programmable Logic Controller
Reasons why PLCs are being widely used
• Rugged and designed to withstand vibrations, temperature, humidity and noise
• User friendly, fast and easy to operate
• Eliminate the need for hard wired relay logic
• Automation in industries (Assembly, Bottling plant, Welding, Painting, MHE etc.)
• Its input and output modules can be extended depending on the requirements
9. Programmable Logic Controller
Advantages
• Less wiring, Wiring between devices and relay contacts are done in the PLC
program.
• Easier and faster to make changes.
• Troubleshooting aids make programming easier and reduce downtime.
• Reliable components make these likely to operate for years before failure.
10. Programmable Logic Controller
Advantages
• Eliminates much of the hard wiring that was associated with conventional relay
control circuits.
• The program takes the place of the external
wiring that would be required for control of a
process.
11. Programmable Logic Controller
Advantages
• Increased Reliability: Once a program has been written and tested it can be
downloaded to other PLCs.
• Since all the logic is contained in the PLC’s
memory, there is no chance of making a
logic wiring error.
12. Programmable Logic Controller
Advantages
• More Flexibility: Original equipment manufacturers (OEMs) can provide system
updates for a process by simply sending out a new program.
• It is easier to create and change a program in a
PLC than to wire and rewire a circuit.
• End-users can modify the program in the field.
13. Programmable Logic Controller
Advantages
• Lower Costs: Originally PLCs were designed to replace relay control logic.
• Generally, if an application requires more than
about 6 control relays, it will usually be less
expensive to install a PLC.
14. Programmable Logic Controller
Advantages
• Communications Capability: A PLC can communicate with other controllers or
computer equipment
• They can be networked to perform functions as:
supervisory control, data gathering, monitoring
devices and process parameters, and
downloading and uploading of programs.
15. Programmable Logic Controller
Advantages
• Faster Response Time: PLCs operate in real-time which means that an event
taking place in the field will result in an operation or output taking place.
• Machines that process thousands of items per
second and objects that spend only a fraction of
a second in front of a sensor require the PLC’s
quick response capability.
16. Programmable Logic Controller
Advantages
• Easier To Troubleshoot: PLCs have resident diagnostic and override functions
that allows users to easily trace and correct software and hardware problems.
• The control program can be watched in real-time
as it executes to find and fix problems.
20. Programmable Logic Controller
Basic Structure
1. Power supply
2. Central processing unit (CPU)
3. Storage / Memory
4. Input/output interface circuit
5. The function module
6. The communication module
7. Programming unit
21. Basic Structure
• PLC power supply converts a line voltage, commonly 120 or 240
volts AC, or Alternating Current, into a useable DC, or Direct
Current, voltage, commonly 24 volts, to power on the PLC and its
components.
• Modular style PLC racks, the power supply is also part of the
backplane or rack.
• While the main power supply is the primary source of power for the
PLC, there is usually a battery backup as well, to provide energy to
the memory of the PLC in case of a power supply failure
Power supply
22. Programmable Logic Controller
CPU
• Control centre of the PLC
• Performs the routine check
• It controls and processes all the operations within the PLC
Processor Module
23. Programmable Logic Controller
Memory: The memory elements available in PLC are;
• ROM: Permanent storage for the OS and fixed data.
• RAM: For user's program.
• Programs in RAM can be changed by the user.
• To prevent the loss of these programs, when the supply is switched off, a
battery is provided in the PLC to maintain the RAM contents for a period of time.
24. Programmable Logic Controller
lnput / Output (l/O) circuitry
• I/O unit provides the interface between the system
and outside world.
• Programs are entered into using the input unit.
• The programs, can also be entered by means of PC,
with an appropriate software package.
25. Programmable Logic Controller
lnput circuitry
• I/O unit provides the interface between the
system and outside world.
• Programs are entered into using the input unit.
• The programs, can also be entered by means
of PC, with an appropriate software package.
26. Programmable Logic Controller
Output circuitry
• I/O unit provides the interface between the
system and outside world.
• PLCs employ an optical isolator, which uses
light to electrically isolate the internal
components from the input and output
terminals.
28. • It is used to program a PLCs.
• It is a graphical programming language which expresses logical operations with
symbolic notation using ladder diagrams.
• It is used by engineers and electricians to execute logical, sequential, counting,
timing and arithmetic tasks in order to carry industrial automation applications.
• Ladder logic programming is still used today because the core fundamental logic
principles for machine and process control are still the same.
Ladder Logic / Ladder Program
Concept of Ladder Logic
29. • In the earlier days, machine and process automation
was accomplished using a hard wired control system
known as relay logic.
• Ladder logic was originally designed to replace the
use of hard wired relay logic circuits for machine
control.
• The ladder logic programming code actual looks like
an electrical schematic drawing.
Ladder Logic / Ladder Program
Concept of Ladder Logic
30. • In PLC programming, ladder logic is a programming language, used for
developing logical expressions in order to automate tasks / process.
Ladder Logic / Ladder Program
Concept of Ladder Logic
31. • Ladder logic is used extensively for programming PLCs in industrial automation
applications.
• E.g. : Material Handling Conveyor System / Pallet Packing and Strapping.
• Ball Mill Lubrication System / Logistics Package Conveying and Sorting.
• Cement Batching / Beverage Bottling and Labelling.
• Hopper and Tank Level Control / Air / Liquid Flow and Pressure Control.
Ladder Logic / Ladder Program
Concepts Ladder Logic
32. • A ladder diagram is a type of schematic diagram used in industrial automation that represents
logic control circuits.
• Ladder diagrams are composed of two vertical power rails and horizontal logic rungs to form what
looks like a ladder. The control logic in a ladder diagram is contained within the rungs.
Ladder Logic / Ladder Program
What is a Ladder Diagram?
• The name “ladder diagram” is derived
from the program’s resemblance to a
ladder with two vertical rails and a series
of horizontal rungs between them.
• The rails are called “power rails” in the
ladder diagram.
33. • The reason is because the early control system designers were accustomed to relay logic control
circuits and ladder diagrams closely mimic these.
• The person / staff already knows how to read relay control circuits, so using ladder diagrams for
programming a PLC.
• Also, they were easily able to troubleshooting control system problems.
Ladder Logic / Ladder Program
Why is a ladder diagram used for PLC programming?
34. Ladder diagram / Logic
• Ladder diagram (LD): official name given in the international PLC programming
standard IEC-61131. (International Electrotechnical Commission)
• Symbols represent opening and closing relays, counters, timers, shift registers,
etc.
• Symbols are arranged in the desired program routine.
• Rules in ladder logic are termed “rungs.”
• Each rung has a single output.
35. The Logic Behind The Ladder
Seven basic steps of a ladder diagram.
1. Rails: Two rails (power rails) in a ladder diagram, represented by vertical lines.
• The power flows from the left hand side to the right hand side.
2. Rungs: Horizontal lines, connects the rails to the logic expressions.
36. The Logic Behind The Ladder
(a), (b) Alternative ways of drawing an electric circuit, (c) comparable rung in a ladder program.
The sequence followed by a PLC when carrying out a program as follows.
1. Scan the inputs associated with one rung of the ladder program.
2. Solve the logic operation involving those inputs.
3. Set/reset the outputs for that rung.
4. Move on to the next rung and repeat operations 1, 2, 3.
5. Move on to the next rung and repeat operations 1, 2, 3.
6. And so on until the end of the program with each rung of the ladder program scanned in turn.
7. The PLC then goes back to the beginning of the program and starts again.
if A and B are both closed then a solenoid (output) is energised.
37. The Logic Behind The Ladder
3. Inputs: Inputs are external control actions (Sensors and Transducers).
E.g. Push button being pressed, limit switch being triggered.
• Inputs are hardwired to the PLC terminals.
• Represented in the ladder diagram by a normally open (NO) or normally closed
(NC) contact symbol.
38. The Logic Behind The Ladder
4. Outputs: Outputs are external devices (Actuators).
E.g. Turn on and off an electric motor or a solenoid valve.
• The outputs are hardwired to the PLC terminals.
• Represented in the ladder diagram by a relay coil symbol.
39. The Logic Behind The Ladder
5. Logic Expressions: The logic expressions are used in combination with the
inputs and outputs to formulate the desired control
operations.
6. Address Notation: Address notation describes the input, output, logic expression,
memory addressing structure of the PLC.
• Tag names: descriptions allocated to the addresses.
40. The Logic Behind The Ladder
7. Comments:
• Important part of a ladder diagram.
• Comments are displayed at the start of each rung.
• Used to describe the logical expressions and control operations of that rung.
• Understanding ladder diagrams are easier by using comments.
41.
42. How to Read Ladder Logic
Microprocessors operates on the binary concept.
‘Binary’: principle, is that the event/s can be thought of in one of two states.
The states can be defined as:
• 1 or 0
• True or False
• On or Off
• High or Low
• Yes or No
43. How to Read Ladder Logic
• Ladder logic uses symbolic expressions and a graphical editor for reading and
writing code making it easier.
• If real world event is translated into ladder logic, it symbolically expressed in the
form of a normally open (NO) contact.
E.g. events like a button being pushed or a limit switch being activated.
44. How to Read Ladder Logic
Example
• Consider event ‘A’, has one of two states, TRUE or FALSE (1 or 0).
• Event is associated with the normally open (NO) contact can be TRUE or FALSE.
• If the event is TRUE, highlighted in green.
ladder logic truth table
45. How to Read Ladder Logic
• A normally open (NO) contact alone cannot decide what action to take to
automate the event
• It merely tells, what is the state of the event.
• Logic is the ability to decide what action needs to be taken depending on the
state of one or more events.
• Logic concept – IF, THEN logic functions.
46. Ladder Logic Functions
• Consider an event = A. Allocated to normally open (NO) contact.
• In ladder logic, the events are defined as PLC inputs.
• Let the result of the logic function = ‘Y’.
• The result of a rung logic function is defined as a PLC output.
• The two fundamental elements on a rung in a ladder diagram is first line of code.
47. Ladder Logic Functions
Two possible logic iterations:
• IF A = FALSE THEN Y = FALSE
• IF A = TRUE THEN Y = TRUE
Ladder Logic Basics – In Built Functions
48. Ladder Logic Functions
Two possible logic iterations:
• IF A = FALSE THEN Y = FALSE
• IF A = TRUE THEN Y = TRUE
Ladder Logic Basics – In Built Functions
Ladder logic diagram expressed symbolically in the
form of a normally open (NO) contact for the input and
the output relay coil.
49. In ladder logic fundamental logic functions are;
1. AND
2. OR
3. NOR
4. NAND
5. XOR
Ladder Logic Functions
53. Ladder Logic
The sequence followed by a PLC when carrying out a program
1. Scan the inputs associated with one rung of the ladder program.
2. Solve the logic operation involving those inputs.
3. Set/reset the outputs for that rung.
4. Move on to the next rung and repeat operations 1, 2, 3.
5. Move on to the next rung and repeat operations 1, 2, 3.
6. So on until the end of the program with each rung of the ladder program.
The PLC then goes back to the beginning of the program and starts again.
55. Concept of Latching
• There are situations where it is necessary to hold a coil energized, even when the input which
energized it ceases.
• The term latch circuit is used for the circuit which carries out such an operation.
• It is a self-maintaining circuit, after being energized, it maintains that state until another input is
received.
56. Concept of Latching
• When Input 1 is energized and closes, there is an output. However, when there is an output, a
set of contacts associated with the output is energized and closes. The contacts is in OR the
Input 1 contacts.
• Even if Input 1 contacts open, the circuit will still maintain the output energized.
• The only way to release the output is by operating the normally closed contact Input 2
57. Concept of Latching
An example of a latch circuit: consider the requirement for a PLC to control a motor
• We require is a system that will still stop if a failure occurs in the stop switch.
• The program now has the stop switch as open contacts. However, because the hard-wired stop
switch has normally closed contacts, then the program receives the signal to close the program
contacts.
• Pressing the stop switch then opens the program contacts and stops the system
Stop system: (b) safe
58. Selection of a PLC
The following criteria need to be considered:
1. Types of inputs/outputs required, like;
- Isolation
- Out-board power supply for inputs/outputs
- Signal conditioning
2. lnput/Output capacity required
3. Size of memory required: linked with no. of I/O and complexity of program used
4. Speed and power required for CPU: linked to the no. of types of instructions,
handled by a PLC.