PLC Course
PLC Course
PLC Course
TECHNICAL COURSES
Programmable Logic
Controller (PLC)
SAFETY REQUIREMENTS
1.GENERAL
Participant must become thoroughly familiar with the following safety requirements
and first aid procedures, and must observe the safety requirements at all times.
Maximum safety of personnel is of primary importance, followed closely by
protection of equipment from damage. Careful observation of these safety
requirements will minimize hazards or injury to personnel and equipment.
Warning, Cautions, and Notes, which are intended to emphasize critical information.
Safety Requirements also include procedures to be observed in the event of certain
operating malfunctions and important precautions to be observed when personnel are
working in a special environment (such as in an explosive atmosphere) or with a
special substance.
WARNING
CAUTION
A CAUTION points out a precaution which, if not observed, could result in damage
or destruction of equipment.
NOTE
Participant has to use the following safety precautions during this course:
-Coverall.
-Safety helmet.
-Safety shoes/boots.
-Leather gloves.
Course Contents
1. Objectives P 06- 07
Attachments:
Transparency T1
Course Objectives
- Power supply.
- Central Processing Unit (CPU)
- Memory (RAM – EPROM)
- Discrete input / output modules.
- Analogue input/ output modules.
- Response Speed (Scan time).
- PID Control Loops.
- Remote I/O.
- The Operator Interface.
Transparency T2
- Communication with other LAN’s.
- Ladder rungs.
- Statements format.
- Control Flowchart.
- Hand-held.
- Desk and laptop.
- IBM PC.
-
8. Perform PLC fault diagnosis.
- LED’s status.
- PLC diagnostic display.
- Last output set technique.
- Uncompleted operation techniques.
2.Course Outline
4. Course Manual
Handout for Course Participants
And it is designed to receive input signals and emit output signals according to its
program logic.
PLC has taken over the logic functions from relays in plant and machine control
applications as they are:
▪ More compact
▪ Cheaper in most applications.
▪ More reliable.
▪ Easier to fault/ find and maintain.
▪ Easier too change sequence or logic
Overall, they provide a much better means of controlling plant and machines than
electromechanical devices
Input Output
Device; Device
Switch Solenoid
Push Valve,
Button. etc. Lamp, etc.
Before we look at the use of PLC to provide us with the means of sequencing, it is
quite useful to understand the use of logic devices to provide us with a particular
sequence. We can then accomplish the same sequence using a PLC.
1. Logic Devices
AND gate logic symbol and truth table,
OR gate logic symbol and truth table,
NOT function logic symbol and truth table,
Diode logic and circuit,
Three-input NAND logic,
NAND/ NOR equality,
Combining logic circuits,
Exclusive OR gate,
R-S flip-flop,
J-K flip-flop, and
Functional logic system.
System variables. Again, this area is hidden from the user and consists of
pointers and. stored data which the operating system uses to keep track of what to
do next.
PLC variables , This is a storage area where the current values of timers, counters
and control relays (sometimes called flags) are located.
User program. The user program (what we write) is normally stored in the PLC
in an area of battery-protected random access memory (RAM). It is safe against
power failures and is capable of being modified by a programming terminal as
faults (or bugs) are identified. In many cases once we have proved the program we
store it in a more permanent form of memory to protect it against eventual battery
failure. Typically we use a programming terminal to copy the program to erasable
programmable read only memory (EPROM) or electrical erasable programmable
read only memory (EEPROM, which is more often referred to as E2PROM).
EPROM has the disadvantage of requiring a high intensity ultraviolet light source
to erase its contents prior to reprogramming, but has the advantage of being four
times cheaper.
User data storage. The last part of the battery-protected RAM area is set aside
for us to store results and data under the control of our program. Typically we
could use this area to store calibration constants or the current operating
conditions. In cases where this data is constant we may copy some or all of it into
( EPROM or EEPROM to protect it from battery failure.
The memory is normally included as part of the CPU module. Additions to this often
consist of plug in modules which allow selection of the memory type and size to suit
the application. In some bus based systems extra memory is added by plugging extra
cards into the rack.
would not even be sufficient to light an indicator lamp. Each section of the industrial
and process control industries has standardized on a series of control voltages. The
PLC manufacturers produce modules to meet these needs. The following list of input
types is not exhaustive, but is typical. 24 V d.c.; 24-60 V d.c.; 24 V a.c.; 110 V a.c.;
240 V a.c.
Output modules also have to work at the same voltages; there is, however, the added
consideration of how much power will need to be switched. Many hydraulic valves
require in the order of 400 watts, while some signal switching applications require the
use of special low noise reed relays which are only capable of switching <100 mW.
The manufacturers provide a range of modules to meet most of our needs, with relay
contacts of up to 5 amp capacity, reed relays, transistor outputs and solid state a.c.
relays (SCRs).
Both input and output modules require not only a signal line but a supply or common
line, as shown in Figures 5 and 6.
It can be seen in Figure 5 that the computer circuitry and the real world voltages are
normally kept separate by the use of 'Opto isolator' modules. These consist of a light-
emitting diode (LED) and a phototransistor mounted together in a single package.
Current flowing into the input causes the LED to turn on. This light falls on the
photosensitive transistor turning it on and allowing current to flow in the output stage.
As the only 'connection' from input to output is light, the two are totally isolated
giving protection to the output from any condition on the input.
The most efficient use of space and of wire is to use one shared or 'common supply
or return wire (line) for all the inputs and another line for all the outputs on the PLC.
In the majority of cases this is the preferred method to use. There are occasions,
however, when this method cannot be used because the supply to all outputs cannot
be connected together, or the input returns cannot 'commoned'. To meet this need, I/O
modules are available with 'isolated' input and output. Figures 7 and 8 describe
examples for both input and output conditions where this is true.
The connections to the I/O modules are normally made through high-quality screw
terminals mounted on the module. Most manufacturers allow the terminals to unplug
from the module enabling it to be replaced in service without unscrewing all the
terminals.
The analog input module works by measuring the voltage on its input terminals and
allowing the PLC program to read it as a binary code. The larger the code the larger
the measured voltage. Such a device is known as an analog to digital (A/D) converter,
but fortunately for the vast majority of applications no deep knowledge of the subject
is required as all the hard work is done for us by the PLC manufacturer. A standard
program built into the operating system is used to read the binary value and scale it to
the required units.
When using analog inputs most analog input modules will be equipped with more
than one input. The very simplest will have what is referred to as 'single wire' inputs;
that is, each of the input voltages is measured relative to a common reference point.
Figure 9 shows how this arrangement works.
Each channel can now read exactly the required voltage, and the leads for each
channel run together in a screened cable to reduce the effects of electrical noise.
Many transducers are now available whose output consists of a current flow in the
range 4-20 mA, which is proportional to the measured input; they are often termed
'process transmitters' (Figure 10) and have the advantage of very simple and
understandable connections. In addition, current loop circuits are not easily affected
by electrical noise enabling the transmitters to be sited, when required, at great
distances from the PLC.
7. Analog Outputs
Analog outputs are necessary when we require the PLC to output a variable d.c.
voltage. This may be simply to drive an indicating meter or to provide a speed
demand to a motor control amplifier. As with the analog input modules, the required
voltage is handled within the PLC as a binary number. This is sent to an output
module which, contains a digital to analog converter (D/A). As with inputs the
manufacturer will specify the resolution of the conversion accuracy and the full scale
voltage, or current, output. Unlike the analog input there is no conversion delay, the
voltage appears at the output as soon as the binary code is output.
Most modules use a four-wire system, as shown in Figure 11, two wires providing
the output voltage, while the other two are used as feedback into the converter to
compensate for any voltage drop in the output leads.
Unlike a hardwired relay control system, the PLC can only do one thing at a time.
Each line of our program is active in turn as the CPU interprets it. There are two
important effects of this: the first concerns the consequences of the program rungs
being operated in a known sequence, while the second is known as scan speed, which
is the time interval between the same line of code being executed twice. In a typical
system this, speed will be in the range of 5-100ms. Figure 12 indicates how the time
is used.
In the second time window the CPU reads all the inputs into a memory area known
as the 'process image'. It is from this frozen image of the inputs that our program will
read the state of all inputs. This has the effect of every line of the program making its
decisions on exactly the same set of input data. Were this not the case the state of any
input could change during the duration of a single program scan, giving totally
unpredictable results when an input is read more than once in the program.
Similarly, all outputs set and cleared as the program is scanned to update an output
process image'. At the end of the program scan all the PLC outputs are updated from
this image, giving the effect of making the PLC appear to do everything at once, as
would a relay panel.
The actual scan speed of any PLC is determined by the following factors:
The greater the number of functions that are added to a given hardware configuration,
the slower it will run as it has to execute a larger system program to decode and
implement each rung of the user's program.
As we can only cause an output to change the state once every scan, our response to
an input changing state will at best be the time for a single scan, and at worst the time
for two scans. This is shown in Figure13.
If higher performance is required the most obvious answer would be to use a more
powerful (faster) CPU. Such a change would, however, only give an increase in
performance of 300-400 per cent. In many cases we may need improvements in the
orders of magnitudes. A better (and cheaper) method is to identify those few opera-
tions that require this extreme speed and handle them outside of the main PLC.
The diagram in figure 13 demonstrates the conditions that will produce both the
minimum and maximum delays between the program seeing an input change and
responding with a change of output. Only when the input has changed before the start
of the program scan will the change be seen by our program.
The gain shown is used to change the rate of response of the system, however, an
additional problem with using high gain we overcompensate for any varying
conditions
In our aim to eliminate, or at least reduce, overshoot the gain will have been reduced
to such a point that it may take quite a long time to achieve the target. This situation
can be improved by adding a further signal which is proportional to the rate of change
of the error signal, i.e. as we get closer to the target we reduce the error signal. Such a
system is known as a differential term; it allows us to increase the gain while
reducing the risk of overshooting. Its effect is shown in Figure 15 and is the final
effect known as differential feedback, which is the 'D' part of PID.
Such control systems using proportional integral differential controls (PID) for the
basis of the majority of feedback control systems. Many PLCs have the necessary
software built in or available to implement such a system using analog input and
output modules. Although the detail for each manufacturer will be different, the same
basic information needs to be supplied by us, the user, to set up the control loop,
namely: analog input, analog output, command input, gain, integration constant,
differential constant, maximum and minimum output limits and how often the output
is to be updated. However, we can only update once per PLC scan, the PID program
itself further reducing our scan time by a few milliseconds for each control loop
running. To maintain reasonable control of any system the output should updated at
the very least 10 times the rate at which changes can take place. This limits the PLC
solution to slow temperature or level control applications. Some manufacturers
provide a solution to this problem by providing self contained modules with their
own separate analog inputs, outputs and control processors which control one or two
feedback loops at very high speed, without any intervention loading of the main PLC.
The input and output wiring costs for a physically large piece of equipment can be
high both in terms of the wire and labor to install them. Most large plant and
equipment is of modular design and can be wired in the same way. To enable this mid
to large range, PLCs support remote I/O systems. These are small racks of inputs and
outputs which we can distribute around the plant to where the inputs and outputs are
physically required. The sub-racks are then easily connected back to the PLC using
screened communication cables, as shown in Figure 16.
the machine manually; the maintenance engineer will want to know why the machine
has stopped. Correctly programmed, the PLC has the capability of providing this and
any other data it has access to or generates. With the correct interface panel it is easy
for us to display the data and receive decisions and data from the system user.
respond with a key press or data. These requirements can be achieved in several
ways, the most common being to add an extra module to the PLC rack which
communicates with a simple display terminal, or to add a 'smart' terminal which
connects to the PLC's programming port and is able to read data from the PLC's
memory.
While the systems we could use will have a different method of text entry and
message selection, the principles are the same for all. We will assume the operator
interface selected is of the 'smart' variety and is plugged into the programming port
(Figure18). We start by defining and entering all the required messages into the
display module through a computer or keyboard. We now have the capability of
displaying not only fixed data, but of adding variable text and numbers. For
instance, we could display a message which includes the production totals. This is
achieved by placing special 'markers' in the fixed text where variable data is to be
added as the message is printed. These markers tell the module's operating
system where in the PLC the variable data can be found and how it is to be printed
Typically the variable data will be of the following types.
the operator. Once the programmer has set up the links the entire operation is
transparent to the PLC. Control modules for graphical displays are an extension to the
display modules described above, pictures as well as text being saved in its memory.
the LAN. Connecting PLCs from different manufacturers is, however, a different
problem. This requires specialized computers known as 'bridges' which can link one
LAN to another.
14. Programming
Our program is entered into the PLC through the keyboard of the
terminal. The majority of programs are written and entered as a series of ladder rungs.
This is not however, the only method of representing a program. Two others in
common use are:
1-Statement format, where the program is entered as lines of instructions, much in the
way a conventional computer program would be written.
Figure 20 indicates how the same program would be represented in all three formats.
The program to allow the entry of code in statement format is relatively simple,
allowing us to type the instructions for each line of the program, and then check its
validity normally on a line-by-line basis.
required. If we consider the case program written using ladder format, the state of
each contact, flag and output is indicated by highlighting the 'Made' conditions. This
can be seen in Figure 21.
Hand-held The cheapest programming terminal is the hand-held type, looking rather
like an Overgrown calculator and costing a few hundred pounds. It simply plugs into
the programmer port of the PLC from which it obtains its power. Such devices are
capable of allowing us to enter a program directly into the PLC, copy the PLC
contents into EPROM and can be used for testing programs and the system.
Desk and laptop All serious programming and development is carried out using a
full function programming terminal with increasing speed, memory, disk space and
screen resolution. They come ready configured with all the required software to
develop PLC programs.
IBM PC-based solutions The vast majority of the computers described above are
based on the IBM PC (Figure 23). It is possible to buy and install the required
software on an existing PC. There are a number of minor disadvantages to this
approach: (1) as the function keys are used as the special 'ladder rung' keys, a chart of
the key positions is required; (2) separate equipment is required to connect the PC to
the PLC, and program EPROMS.
They are, however, of limited use in the diagnosis of machine sequence or software
problems unless the user has a full, detailed understanding of the machine operations
and the control program. Normally, maintenance staff who are sent to diagnose and
rectify a system fault are not present prior to the breakdown occurring and thus are
not aware of where in its sequence the machine has stopped. This makes diagnosis
much more difficult than the situation in which they were present and able to observe
the exact location within the program where the fault occurred. A number of simple
techniques are described below which are aimed at making use of the information
within the PLC to simplify the diagnostic activity
17.2 Last output set technique
The objective of this technique is to use an additional
set of status lamps to indicate the last output set during the sequencing of a machine
or process plant. If we know', the last operation started we should quickly be able to
determine the reason for the fault condition
Transparency (T 3)
NAND/NOR Equality
Transparency (T 5)
Exclusive OR Gate
R-S Flip-Flop
Transparency T6
J-K Flip-Flop
Transparency (T 10)
Transparency (T 12)
Transparency (T 14)
Figure 16 Logical Model Closed Loop Control with Integral and Derivative of
Error Term (PID).
Transparency (T 15)
Figure 17 Simple Message Display Controlled by PLC Outputs