Professional Documents
Culture Documents
Lecture # 01
Basic Training Workshop
Training on MITIBUSHI
Q. What is PLC?
Ans:
PLC is a programmable logic controller (PLCs), also referred as
Programmable Controllers, and is in the computer family. They are used in
commercial and industrial applications. A PLC monitors inputs, makes
decisions based on its program, and controls outputs to automate a process
or machine.
Or
Programmable logic Controller is a hardware control system by using
programming.
Basic PLC Operation
PLCs consist of input modules or points, a Central Processing Unit
(CPU), and output modules or points. An input accepts a variety of digital or
analog signals from various field devices (Sensors) and converts them into a
logic signal that can be used by the CPU. The CPU makes decisions and
executes control instructions based on program instructions in memory.
Output modules convert control instructions from CPU into a digital or analog
signal that can be used to control various field devices (actuators). A
programming device is used the desired instructions. These instructions
determine what the PLC will do for a specific input. An operator interface
device allows process information to be displayed and new control
parameters to be entered.
CPU
Inpu
t
Mod
ule
Central
Processing
Unit
Program
ming
device
Outp
ut
Mod
ule
Operator
Interface
PLCs
The same, as well as more complex tasks can be done with a PLC. Wiring
between devices and relay contacts is done in the PLC program. Hard wiring,
though still required to connect field devices, is less intensive, modifying the
application and correcting errors are easier to handle. It is easier to create
and change a program in a PLC than it is to wire and rewire a circuit.
ADVANTAGES OF THE PLC
The following are some of the major advantages of using a programmable
controller:
Flexibility
In the past, each different electronically controlled production machine
required its own controller; 15 machines might require 15 different
controllers. Now, it is possible to use just one model of PLC to run any one of
the 15 machines. Furthermore, you would probably need fewer than 15
controllers, because one PLC can easily run many machines. Each of the 15
machines under PLC control would have its own distinct program.
Implementing Changes and Correcting Errors
With a wired relay panel, any program alterations required time for rewiring
of panels and devices. When a PLC program circuit or sequence design
change is mad, the PLC program can be changed from a keyboard sequence
in a matter of minutes. No rewiring is required for a PLC-controlled system.
Also, if a programming error has to be corrected in a PLC control ladder
diagram, a change can be typed in quickly.
Large Quantities of Contacts
The PLC has a large number of contacts for each coil available in its
programming. Suppose that a panel-wired relay has four contacts and all are
in use when a design change requiring three more contacts is made. It would
mean that time must be taken to.
Simplicity of Ordering Control System Components
A PLC is one device with one delivery date. When the PLC arrives, all the
counters, relays and other components also arrive. In designing a relay
panel, on the other hand, you may have dozens of different relays and timers
from dozen different suppliers.
Documentation
An immediate printout of the true PLC Circuit is available in minutes, if
required. There is no need to look for the blueprint of the circuit and remote
files. The PLC Prints out the actual circuit in operation at a given moment.
Often, the file prints for relay panels are not properly kept up to date. A PLC
printout is the circuit at the present time; no wire tracing is needed for
verification.
Security
A PLC program change cannot be made unless the PLC is properly unlocked
and programmed. Relay panels tend to undergo undocumented changes.
People on late shifts don`t always record panel alternation made when the
office area is locked up for the night.
Ease of Changes by Reprogramming
Since the PLC can be reprogrammed quickly, mixed production processing
can be accomplished. For example, if part B comes down the assembly line
while part A is still being processed, a program for part B`s processing can
be reprogrammed into the production machinery in a matter of seconds.
These are some of the advantages of using a Programmable Logic Controller.
There will, of course, be other advantages in individual applications and
industries.
DISADVANTAGES OF THE PLC
Following are some of the disadvantages of, or perhaps precaution for, using
PLCs:
Newer Technology
It is difficult to change some personnel`s thinking from ladder and relays to
PLC computer concepts.
Fixed Program/Circuit Operations
If some applications and circuits are single function. It doesn`t pay to use a
PLC that includes multiple programming capabilities if they are not needed.
The PLC is most effective when periodic changes in operation are made.
Environmental Consideration
Certain process environments, such as high heat and vibration, interfere with
the electronic devices in PLCs, which limits their use.
Number Systems
Since a PLC is a computer, it stores information in the form of On or Off
conditions (1 or 0), referred to as binary digits (bits). Sometimes binary digits
are used individually and sometimes they are used to represent numerical
values.
Decimal System
Various number systems are used by PLCs. All number systems have the
same three characteristics: digits, base, weight. The decimal system, which
is commonly used in everyday life, has the following characteristics:
Ten Digits:
0,1,2,3,4,5,6,7,8,9
Base:
10
Weights:
Binary System
The binary system is used by programmable controllers. The binary system
has the following characteristics:
Ten Digits:
0, 1
Base:
Weights:
In the binary system 1s and 0s are arranged into columns. Each column is
weighted. The first column has a binary weight of 2o. This is equivalent to a
decimal 1. This is referred to as the least significant bit. The binary weight is
doubled with each succeeding column. The next column, for example, has a
weight of 21, which is equivalent to a decimal 2. The decimal value is doubles
in each successive column. The number in the far left hand column is
referred to as the most significant bit. In this example, the most significant
bit. In this example, the most significant bit has a binary weight of 27. This is
equivalent to a decimal 128.
Most Significant Bit
27
128
0
64
32
16
8
+16
24
In the following example the fourth and sixth column from the right contain a
1. The decimal value of the fourth column from the right is 8, and decimal
value of the sixth column from right is 32. The decimal equivalent of this
binary number is 40.
128
64
32
16
8
+32
40
Logic 0, Logic 1
Programmable controllers can easily
Their low cost makes them suitable for installing in places which
attracted no such interest in the past. This is the fact accountable for
today's market being swamped with cheap automatons and
"intelligent" toys.
So if you are into electronics, you will undoubtedly want to master the
great potential of microcontrollers and put it to good use.
1. Power is off and all is still... Program is loaded, everything is set, with
no indications of what is about to take place...
2. As soon as the power is on, it all happens too quickly to follow! First
one to register the change is the control logic. It halts all the circuits
except the quartz oscillator. First few milliseconds pass in hurried
preparations and loading of parasitic capacitances...
3. As voltage reaches its maximum, oscillator frequency stabilizes. SFR
registers are loaded with bits indicating the states of the subsystems,
and all the pins are designated as input. Impulse sequence starts
dictating the pace and the electronics is now fully operational. From
this point on, time is measured in microseconds and nanoseconds.
EEPROM Memory
EEPROM is a special kind of memory not available with all MCUs.
Its contents can be changed during runtime (as with RAM), but is also saved
after the power is off (as with ROM).
SFR Registers
Special Function Registers are special elements of RAM, their
purpose predefined by the manufacturer. Each of these registers is named
and controls a certain subsystem of MCU. For example: by writing zeros and
ones to the SFR register which controls an I/O port, each of these pins can be
designated as input or output (each register bit corresponds to one of the
port pins).
Program Counter
This is the "engine" which starts the program and points to the
memory address of the instruction to be executed. Immediately upon its
execution, value of counter increments by 1. Due to this automatic increase,
program executes one instruction at a time, just the way it was written.
However... value of a counter can be changed anytime with a "jump" to a
new program memory location as a result. This is how routines and branch
Control Logic
As the name implies, this is the "Big Brother" which supervises and controls
every aspect of operations within MCU, and it cannot be manipulated. It
comprises several parts, the most important ones including:
Instructions Decoder
Part of the electronics which "recognizes"
different program instructions and directs the other circuits accordingly.
Accumulator
A special SFR register highly interconnected with ALU. It
can be described as a working desk for performing operations on data
(adding, shifting, etc). Also, this is the register which holds the result of
the operation. Of SFR registers, Status Register is specifically associated
A/D Converter
Another convenient instrument not available with all MCUs. Usually
there are several separate channels so that multiple analog values can be
measured simultaneously. Commonly, converters are 8, 10, or 12-bit and this
is sufficient for most tasks.
As shown on the image below, A/D conversion (converting analog
value to a numeral) starts with changing the bit in the appropriate SFR
register. Hence, voltage on input pin is measured (this sampling takes a few
microseconds) and stored in another SFR register as a numeral.
In our example, 8-bit A/D converter is used and the default voltage is
5V. This divides the scale in 256 units, with the smallest voltage range that
can be represented of 19.53mV (5V / 256 = 19.53mV). On such a "crude"
scale, voltage of 2.204V is represented by numeral 113 (113 x 19.53mV =
2.207V).
Converters of higher resolutions (10 and 12-bit) have much finer
scales of 1024 or 4096 units, respectively. Using one of these instruments
under the same conditions from the previous example would significantly
reduce the inaccuracy (as shown on the image below).
Register
ROM and RAM registers are nameless and are usually peers.
SFR registers are named (differently with different MCUs) and each has
its role.
I/O Ports
To be of any practical use, microcontroller needs to be connected
to other electronics and to the environs. For this purpose, every MCU has one
or more registers (also known as ports) which are connected to the pins on
its case. Why I/O? Because every pin can be designated as eiher input or
output to suit user's needs.
Oscillator
This is the rhythm section of the miniature orchestra. Stable
pace provided by this instrument allows harmonious and synchronous
functioning of all other parts of MCU. Commonly, oscillator frequency is
stabilized using a quartz-crystal or a ceramic resonator. It can also work
without an element for stabilizing frequency (as RC oscillator). Note that
instructions are executed at a rate several times slower than the pace
dictated by the oscillator. This happens because instructions take several
steps to be accomplished (execution period of different instructions may vary
on different MCUs). Therefore, if your system uses 20MHz quartz-crystal,
execution period of one program instruction will not be 50 ns, but more likely
200, 400 or a "whole" 800 ns.
Timers
Majority of programs utilizes these miniature electronic
"stopwatches". Commonly, timers are 8 or 16-bit registers whose value
automatically increases upon an impulse. If timer is stimulated by an internal
MCU oscillator, it can be used for measuring time between two occurrences
(register value at the start of measuring = T1, register value at the end of
Watchdog Timer
The name itself implies the role of this instrument. It is a
timer with input connected to an independent MCU RC oscillator. If Watchdog
is enabled, MCU is reset every time it overflows, and the program execution
starts anew (much as if the power had just been turned on). The idea is to
prevent that from happening by means of special instruction. Whole concept
is based upon a fact that every program technically "goes around", i.e.
executes within a number of simpler or more complex loops. If, beside the
regular instructions, key places in the program were added an instruction for
resetting the Watchdog, its safeguard function would pass unnoticed. If, for
some reason, (in industrial environment, electrical interference is common)
Program Counter "gets stuck" at a memory location with no return, the everincreasing Watchdog Timer eventually overflows and voila - MCU is reset.
Interrupt
Electronics is generally way faster than physical processes in
the environment it controls. Therefore, microcontroller spends most of its
time in expecting an occurrence or waiting for tasks to be accomplished. To
avoid the repeated checks of input pins and internal registers, interrupt was
introduced. It is a signal which breaks the standard order of program
execution. In case of an interrupt, MCU comes to a halt, and determines the
source of interrupt. If certain action is required, current value of Program
Counter is set aside to Stack and the appropriate routine (interrupt routine) is
executed.
Stack is a special part of RAM for storing the current value of Program
Counter, so that program could "know" where to pick up after the interrupt
routine. It can be multi-leveled, i.e. routines can be executed within other
routines.
Reset pin frequently marked as MCLR (Master Clear Reset) is used for
"external" reset of microcontroller by bringing the logical zero or one
(depending on the MCU). If not preinstalled, a simple external brown out
reset circuit can be connected to this pin.
Memory
1.
2.
3.
4.
RAM
ROM
EPROM
EEPROM
Memory
Installation of PLC