Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 71

Mechatronics Servicing

NCIII

PROGRAMMABLE LOGIC
CONTROLLER
Mechatronics
PROGRAMMABLE
LOGIC CONTROLLER
https://www.watelectronics.com/how-to-program-the-programmable-logic-controllers/
History of PLC
The PLC or Programmable Logic Controller has
revolutionized the automation industry.
Today PLCs can be found in everything from
factory equipment to vending machines, but prior
to New Year’s Day 1968 the programmable
controller didn’t even exist. Instead, what existed
was a unique set of challenges that needed a
solution.
Before the Programmable
Controller
Before the days of the PLC the
only way to control machinery
was through the use of relays.
Relays work by utilizing a coil
that, when energized, creates a
magnetic force to effectively
pull a switch to the ON or OFF
position.
Before the Programmable
Controller
When the relay is de-energized,
the switch releases and returns
the device to its standard ON
or OFF position. So, for
example, if I wanted to control
whether a motor was ON or
OFF, I could attach a relay
between the power source and
the motor.
There could be several motors in one factory
that need to be controlled, so what do you
do? You add lots of power relays. So
factories started to amass electrical cabinets
full of power relays. But wait, what switches
the coil in the power relays ON and OFF
before the power relay turns the motor ON,
and what if I want to control that? What do
you do? More relays.
These relays are known as control relays
because they control the relays that
control the switch that turns the motor ON
and OFF. I could keep going, but I think
you get the picture of how machines were
controlled pre-PLC, and, more
importantly, I think you start to see some
of the problems with this system of
electromechanical control via relays.
History of PLC
The Problem with Relays
Think about modern factories, and how many motors
and ON/OFF power switches you would need to
control just one machine. Then add on all the control
relays you need and what you get is… Yes, machine
control, but you also get a logistical nightmare.
All these relays had to be hardwired in a very specific
order for the machine to work properly, and heaven
forbid if one relay would have an issue,
History of PLC
the system as a whole would not work.
Troubleshooting would take hours, and because coils
would fail and contacts would wear out, there was
need for lots of troubleshooting.
These machines had to follow a strict maintenance
schedule and they took up a lot of space. Then what if
you wanted to change something? You would basically
have to redo the entire system. It soon became clear
that there were problems installing and maintaining
these large relay control systems
History of PLC
Let’s hear from a controls designer in the thick of
things in the early ‘70s
The relay based control systems I created included
anywhere from 50 to well over 100 relays. The
electrical enclosures to house the controls would
typically be six feet wide by four feet high, mounted
near the machinery. Picture lots of wires bundled and
laced together, connecting the relays, timers,
counters, terminals, and other components, all nice
and tidy.
History of PLC
Then picture after a few months or years the same
wiring, after many engineering changes and
troubleshooting, being out of the wire duct or
unlaced; in many cases wires were added in a
crisscross point to point pattern to take the shortest
route and amount of time to make the change. We
referred to the condition of these control enclosures
as a rat’s nest; reliability suffered, along with an
increase in difficulty during troubleshooting, or making
additional operational engineering changes.”
History of PLC
Birth of the PLC Solution
So what was the solution? I am sure this is the
exact question that engineers at the Hydra-Matic
division of General Motors were struggling with
every day. Fortunately, at that time, the concept of
computer control had started to make its way into
conversations at large corporations such as GM.
According to Dick Morley, the undisputed father
of the PLC, “The programmable controller was
detailed on New Year’s Day, 1968.”
History of PLC
The popular forum PLCDEV.com outlines a
list of requirements that GM engineers put
out for a “standard machine controller.” It is
this request that Dick Morley and his
company, Bedford and Associates, were
responding to when the first PLC was
envisioned. Besides replacing the relay
system, the requirements listed by GM for
this controller included:
History of PLC
1. A solid-state system that was flexible like a
computer but priced competitively with a like kind
relay logic system.
2. Easily maintained and programmed in line with the
already accepted relay ladder logic way of doing
things.
3. It had to work in an industrial environment with all
its dirt, moisture, electromagnetism and vibration.
4. It had to be modular in form to allow for easy
exchange of components and expandability.
The programming look of the PLC required that it be easily
understood and used by maintenance electricians and plant
engineers. As relay-based control systems evolved and
became more complicated, the use of physical component
location wiring diagrams also evolved into the relay logic
being shown in a ladder fashion. The control power hot wire
would be the left rail, with the control power neutral as the
right rail. The various relay contacts, pushbuttons, selector
switches, limit switches, relay coils, motor starter coils,
solenoid valves, etc., shown in their logical order would form
the ladder’s rungs. It was requested that the PLC be
programmed in this Ladder Logic fashion.
History of PLC
History of PLC
The PLC in its teenage years
The first PLCs had the ability to work with input and output
signals, relay coil/contact internal logic, timers and counters.
Timers and counters made use of word size internal
registers, so it wasn’t too long before simple four-function
math became available. The PLC continued to evolve with
the addition of one-shots, analog input and output signals,
enhanced timers and counters, floating point math, drum
sequencers and mathematic functions. Having built-in PID
(Proportional-Integral-Derivative) functionality was a huge
advantage for PLCs being used in the process industry.
History of PLC
Common sets of instructions evolved into fill-in-
the-blank data boxes that have made
programming more efficient. The ability to use
meaningful Tag Names in place of non-
descriptive labels has allowed the end user to
more clearly define their application, and the
ability to import/export the Tag Names to other
devices eliminates errors that result when
entering information into each device by hand
History of PLC
As the functionality of the PLC evolved, programming
devices and communications also saw rapid growth. The
first programming devices were dedicated, but
unfortunately the size of suitcases. Later, hand-held
programming devices came into the picture, but soon were
replaced with proprietary programming software running
on a personal computer. AutomationDirect’s DirectSOFT,
developed by Host Engineering, was the first Windows-
based PLC programming software package. Having a PC
communicating with a PLC provided the ability to not only
program, but also allowed easier testing and
History of PLC
Communications started with the MODBUS protocol
using RS-232 serial communications. The addition of
various automation protocols communicating over RS-
485, DeviceNet, Profibus, and other serial
communication architectures have followed. The use
of serial communications and the various PLC
protocols also allowed PLCs to be networked with
other PLCs, motor drives, and human to machine
interfaces (HMI). Most recently Ethernet and protocols
such as EtherNet/IP (for Industrial Protocol) have
gained tremendous popularity.
Step by Step Procedure of PLC Programming
Programmable Logic Controllers (PLCs) are the major
components in industrial automation and control systems.
The controlling nature of PLC is ranging from simple- push
button switching to a single motor to several complex
control structures.
The PLC programming is an important task of designing and
implementing control application depending on customers
need.
A PLC program consists of a set of instructions either in
textual or graphical form, which represents the logic to be
implemented for specific industrial real-time applications.
A dedicated PLC programming software comes from a
PLC hardware of specific manufacturer that allows
entry and development of user application code, which
can be finally download to the PLC hardware.
This software also ensures Human Machine Interface
(HMI) as a graphical representation of variables. Once
this program gets downloaded to the PLC and if the
PLC is placed in Run mode, then the PLC continuously
works according to the program.
Before going to the program of the PLC, let us know the
basics of the PLC programming and its basic concepts.
PLC Programming Basics

A CPU of the PLC executes


two different programs:

1. The Operating System


2. The User Program
The Operating System
The operating system organizes all the functions, operations and
sequences of the CPU that are not associated with a control task.
The OS tasks include

• Handling a hot restart and warm restart


• Updating and outputting the process image tables of input and
outputs
• Executing the user program
• Detecting and calling the interrupts
• Managing the memory areas
• Establishing communication with programmable devices
The User Program
It is a combination of various functions which
are required to process an automated task.
This must be created by the users and need to
be downloaded to the CPU of the PLC. Some
of the tasks of the user program include:

• Initiating all the conditions for starting the


specified task
• Reading and evaluating all binary and
analog input signals
• Specifying output signals to all binary and
analog output signals
• Executing interrupts and handling errors
In present industrial automation sector, there are several
leading PLC manufactures that develop typical PLC’s ranging
from small to high-end PLC’s.
Each and every PLC manufacturer has its own dedicated
software to program and configure the PLC hardware. But the
PLC programming language is varied depending on the
manufacturers.
Some manufacturers have common programming languages,
and some others have dissimilar. Some of the standard
programming languages of PLC are basically of two types,
which are further sub-divided into several types, which are as
follows:
1. Textual language
•Instructions List (IL)
•Structured Text (ST)

2. Graphical language
•Ladder Diagrams (LD)
•Function Block Diagram (FBD)
•Sequential Function Chart (SFC)
Compared with text-based languages, graphical
languages are preferred by many users to program
a PLC due to their simple and convenient
programming features.
All the necessary functions and functional blocks
are available in the standard library of each PLC
software. These function blocks include timers,
counters, strings, comparators, numeric,
arithmetic, bit-shift, calling functions, and so on.
PLC Programming Devices
Various types of programming devices are used to enter,
modify and troubleshoot a PLC program. These
programming terminal devices include handheld and PC
based devices. In the handheld programming device method,
a proprietary device is connected to PLC through a
connecting cable. This device consists of a set of keys that
allows to enter, edit and dump the code into the PLC. These
handheld devices consist of small display to make the
instruction that has been programmed visible. These are
compact and easy to use devices, but these handheld devices
have limited capabilities.
Most popularly a Personal Computer (PC) is used for
programming the PLC in conjunction with the software
given by the manufacturer. By using this PC we can
run the program in either online or offline mode, and
can also edit, monitor, diagnose and troubleshoot the
program of the PLC.
The way of transferring the program to the PLC is
shown in the above figure wherein the PC consists of
program code corresponding to control application
which is transferred to the PLC CPU via programming
cable.
PLC PROGRAMMING LANGUAGE
https://www.youtube.com/watch?v=kQ2CBzCCqic
Ladder Logic PLC Programming
Among several programming languages ladder logic diagram is
the most basic and simplest form of programming the PLC.
Before going to program the PLC with this language, one should
know some basic information about it. The below figure shows
the hardwired-ladder diagram wherein the same lamp load is
controlled by two push button switches, In case if any one of the
switches gets closed, the lamp glows. Here two horizontal lines
are called rungs which are connected between two vertical lines
called rails. Each rung establishes the electrical continuity
between positive (L) and negative rails (N) so that the current
flows from the input to output devices. Some of the symbols used
in ladder logic programming are shown in the figure.
L N
Push Button
Switch 1 Lamp

Rung 0

Push Button
Switch 2 Lamp

Rung 1

Positive Rail Negative Rail

Ladder Logic PLC Programming


Input switches are types include normally closed
and normally opened as shown above. In addition
to above given functional symbols, there are
several functions like timer, counter, PID, etc.,
which are stored in the standard library to
program complex tasks.
Step-By-Step Procedure for Programming
PLC Using Ladder Logic
The procedure for programming a PLC for a certain
application depends on the type of standard
manufacturer software tool and the type of control
application. But in order to give a basic guidance to
the students, this article provides a simple approach of
designing control application in PLC programming
software, as given below But this way of
programming doesn’t exactly fit into all the types of
programming tools and control applications.
Step 1: Analyze and Get the Idea of Control
Application
The primary step to program the PLC is to get the idea for
which you are going to develop an application-based
program. If you are driving a line follower robot by the use of
DC motor when the push button is pressed. This status must
be displayed by the LED light when the motor gets turn on.
The motor is also attached with a sensor (Here it is
considered as another switch) that detects obstacles, so when
this turned on, the motor should be turned off. And
correspondingly, if the motor switched off, the buzzer should
be turned on.
Step 2: List All the Conditions and Get the
Design using Flowchart

The variables of the above project are


M: Motor, A: Input Switch 1, B: Input Switch
2, L:LED and Bu: Buzzer, and the designing of
the logic is easy with the implementation of
flow chart, which is given below for the above
application.
Start

Switch On A
Switch On C
Switch On B

Yes
If
Switch On B Buzzer is On
Obstacle

No
Motor is started
and LED is On

Flowchart of PLC Programming


Step3: Open and Configure the PLC
Programming Software
Open the programming software installed in the
PC that comes with PLC hardware. Select the
hardware model of the PLC in the software and
configure it with appropriate input and output
modules. Select the ladder language (LD) from
the list of the programming languages and choose
the hardware processor and give a name for the
program.
Step 4: Add the Required Rungs and Address
Them

Add the required rungs based on the control


application logic and give the address to the
each and every input and outputs. The
ladder logic diagram of the above
discussed example is given below.
Rung 1 M
A B

Rung 2 L
C B

Rung 3 Bu
B A C

Example of Ladder Logic Program


Step 5: Check the Errors and Simulate It

Locate the Online section in the menu bar and


select Online. Check for the errors and make
necessary changes after selecting Offline.
Again, go online and select the Run option to
simulate it.
Step6: Download the Program to PLC CPU
Memory
After the successful simulation of the program, download
the program to CPU by selecting the Download option
through a network or communication cable.
Please refer to this link to know more about Programming
Languages & its types.
This is about the PLC programming basics and its
procedural steps. We hope that the given content is clear and
easy for understanding. It is also possible to know and
understand it better with specified software of particular
PLC like RSLogix 500, Codesys, step 7, etc.
Logic circuit
analysis and
development
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 Not Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 AND Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 OR Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 NAND Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 NOR Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 XOR Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 XNOR Gate
1.1. Logic circuit analysis and development
1.1. Logic circuit analysis and development
 Logic Gates and truth table
 Gates with three inputs
1.Determine & document mechatronics and
automation control circuits’ requirements

1.1. Logic circuit analysis and


development
A. Sequential circuit
1.Determine & document mechatronics and
automation control circuits’ requirements

1.1. Logic circuit analysis and


development
A. Sequential circuit
1.Determine & document mechatronics and
automation control circuits’ requirements

1.1. Logic circuit analysis and


development
A. Sequential circuit
1.Determine & document mechatronics and
automation control circuits’ requirements
1.1. Logic circuit analysis
and development
A. Sequential circuit
1.Determine & document mechatronics and
automation control circuits’ requirements
1.1. Logic circuit analysis and
development
A. Sequential circuit
1.1. Logic circuit analysis and development
A. Sequential circuit
Draw the equivalent logic gate diagram for
the circuit below.
1.1. Logic circuit analysis and
development
A. Sequential circuit
1.1. Logic circuit analysis and development
A. Sequential circuit
Draw the equivalent contact symbology
diagram for the logic gates shown below.
1.1. Logic circuit analysis and
development
A. Sequential circuit
1.Determine & document mechatronics and
automation control circuits’ requirements

1.1. Logic circuit analysis and


development
B. Ladder circuit
1.1. Logic circuit analysis and
development
B. Ladder circuit
B. Ladder circuit
To be continued…….

You might also like