PROCESS CONTROL INSTRUMENTATION
EL-4612 (4-3-2 )
PRE-REQUISITE EP-4211,EL-4231
CHAPTER ONE
Process control fundamentals
Instructor : Dessie Fentaw(Capt.) 2018
5/29/2019 Dessie Fentaw 1
What is Process Control?
Process control: is the act of controlling a final control element to change the
manipulated variable to maintain the process variable at a desired Set Point.
The Following are definitions of some terms we will be using in out discussion of process
control:
The manipulated variable (MV) is a measure of resource being fed into the process, for
instance how much thermal energy.
A final control element (FCE) is the device that changes the value of the manipulated
variable.
The controller output (CO) is the signal from the controller to the final control element.
The process variable (PV) is a measure of the process output that changes in response to
changes in the manipulated variable.
The Set Point (SP) is the value at which we wish to maintain the process variable.
5/29/2019 Dessie Fentaw 2
Control Systems
In process control, the basic objective is to regulate the
value of some quantity
We have a desired value that is referred to as the reference
or set point
We also must have some way of measuring the actual
value of that quantity
We must also have some method of comparing the
measured quantity to the reference value
We finally need some method of changing the quantity
5/29/2019 Dessie Fentaw 3
Let us see simple process control
The process
The process is shown diagrammatically below
5/29/2019 Dessie Fentaw 4
The previous slide shows a system that has liquid
flowing in at some rate Qin, and flowing out at another
rate Qout.
The liquid has a height or level h. The formula for Qout
is Qout = K*sqrt(h), thus the flow rate out of the tank is
dependent on the height h.
If h is too low for the Qout be less than Qin then the
height will increase. If the height increases to a point
that Qout is more than Qin than the height will decrease.
At some value of h Qout will equal Qin – it is at this point
the tank has self-regulated
5/29/2019 Dessie Fentaw 5
Looking at the tank in Slide above and given the following
information:
Qin = 2.5 gal/min
Qout = K*sqrt(h) and K = 1.2 (gal/min)
At what height will the tank self-regulate to?
First we must realize that the tank will stabilize at the point that Qin
= Qout, we have the relationship 2.5 gal/min = 1.2*sqrt(h).
h = ((2.5 gal/min)/(1.2))2 = 4.34 ft
5/29/2019 Dessie Fentaw 6
Human – Aided control
In this case a human has been added to the
process.
The human can adjust the height by opening
and closing the valve to change Qout in such
a way that the height can be adjusted .
In this case the controlled variable is still
the height, but the height can be
manipulated by a person changing the
manipulated or controlling variable Qout
5/29/2019 Dessie Fentaw 7
In this process a human can regulate the level using a sight
tube ‘S’ to compare the level ‘h’ to the objective ‘H’ and
adjust the value to change the level.
By a succession of incremental opening and closing of the
valve, the human can bring the level to set point value H.
And maintain it there by continues monitoring of the sight
tube and adjustment of the valve, the height is regulated.
5/29/2019 Dessie Fentaw 8
Automatic control
For automatic control the
system is modified as shown
below.
An automatic level-control
system replaces the human
with a controller and uses a
sensor to measure the level.
5/29/2019 Dessie Fentaw 9
In the previous slide the person is replaced by an automatic
control system.
The height is measured by a sensor (a float or electronic),
and a controller (typically a microcomputer or other
electronic circuitry) will signal an actuator to open/close the
valve controlling Qout
Again the height is adjusted to a set point H by manipulating
Qout
5/29/2019 Dessie Fentaw 10
Servomechanism-Type Control System
The goal of such systems is to move
the arm of the robot using servo-
motors from point A to point B, or
any of series of movements.
Often used in repetitive
manufacturing processes
This course will NOT cover such
systems, although they use similar
technologies.
This course concentrates on
PROCESS Control.
5/29/2019 Dessie Fentaw 11
This block diagram of a control loop defines all the basic
elements and signals involved.
Process control block diagram
5/29/2019 Dessie Fentaw 12
Process
In the previous example the flow of liquid in and out of the tank, the tank it
self, and the liquid all constitute a process to be placed under control with
respect to the fluid level.
There are single-variable processes, in which only one variable is to be
controlled.
As well as multivariable processes in which many variable perhaps
interrelated may require regulation.
Measurement
To effect control of a variable in process we must have information on
variable itself.
Such information is found by measuring the variable
A measurement refers to the conversion of the variable in to some other
corresponding analog form, such as electric voltage and current.
5/29/2019 Dessie Fentaw 13
5/29/2019 Dessie Fentaw 14
The physical diagram of a control loop and its
corresponding block diagram look similar. Note the use of
current- and pressure-transmission signals.
psi = Pounds per square inch
1 psi =6.8948×103 pa
5/29/2019 Dessie Fentaw 15
5/29/2019 Dessie Fentaw 17
The physical diagram of a control loop and its
corresponding block diagram look similar. Note the use of
current- and pressure-transmission signals.
5/29/2019 Dessie Fentaw 18
Control system Evaluation
Control system objective is best represented by three requirements
The control system should be stable
Provide the best possible steady-state regulation
Provide the best possible transient regulation
A control system can actually
cause a system to become
unstable.
5/29/2019 Dessie Fentaw 19
One of the measures of control system
performance is how the system
responds to changes of set point or a
transient disturbance in damped
response.
5/29/2019 Dessie Fentaw 20
In cyclic or under damped response, the
variable will exhibit oscillations about
the reference value.
5/29/2019 Dessie Fentaw 21
The quarter-amplitude criterion
Two criteria for judging the quality of
control-system response are the
minimum area and quarter amplitude.
Specifies that the amplitude of each
peak of the cycle response must be a
quarter of the preceding peak
Thus a2 =a1/4 ,a3 =a2/4 and so on
5/29/2019 Dessie Fentaw 22
Analog and Digital processing
Data were represented by the magnitude of voltages & and currents in analog
from (continuous signal from), procssing of this data (amplifing, filtering,
clipping etc....) is colled analog processing.
Most modern control systems now employ digital computer to perform
controllers operations.
In computers data are represented as binary numbers consisting of a specific
number of bits.
Proecssing this digital signals is referred to as digital processing.
5/29/2019 Dessie Fentaw 23
Graph (a) shows how output variable b
changes as an analog of variable c. Graph
(b) shows how a digital output variable, n,
would change with variable c.
5/29/2019 Dessie Fentaw 24
An ADC converts analog data, such as voltage, into a digital
representation, in this case 4 bits.
5/29/2019 Dessie Fentaw 25
Types of control
ON/OFF control
In this controller the final control element has only two states, on & off.
fig. below shows on/off control system.
The objective is to maintain the temperature in a system at reference value Tref.
A sensors cinvert temperature values in to a resistance in analog fashin.' i.e ,R
varies smoothly & continuously with T.
5/29/2019 Dessie Fentaw 26
This ON/OFF control system can either heat or cool or do neither. No variation of the
degree of heating or cooling is possible.
5/29/2019 Dessie Fentaw 27
Signal conditioning converts the variable R in to analog voltage, V. Thus, V is an
analog of T as well. The differential amplifier multiplies the difference between v
& a reference voltage, vref, by gain k to produce an error voltagV ve.
Vref is simply as that voltage from the converter which would be produced by Tref.
This system is digital because the relays will either be open or colosed so that the
heater or the cooler will be either be on or off.
The diodes direct the current to appropriate relay to produce heating or cooling,
based on polarity.
5/29/2019 Dessie Fentaw 28
This system also exhibits a dead band &hysteresis.
The dead band is a range of temperature in which no action
will occur.
Hysteresis means that the behavior of the system is different
at the same value of temperature is increasing or decreasing.
of course our home &auto heaters and air conditioners are
some of the control system which work according to the same
ON/OFF mode.
5/29/2019 Dessie Fentaw 29
Analog control
Fig. below shows a process in which a heater is used to control the temperature
in an oven.
In this case heater output Q is an analog of the excitaion voltage Va and the heat
can be varied continuously.
Notice that every signal is anloge; vT analog of T, the error E analog of
difference b/n the reference, Vref & the temperaure voltage, VT .
Vref voltage result from referenc temperatuer Tref
5/29/2019 Dessie Fentaw 30
An analog control system such as this allows continuous variation of some parameter,
such as heat input, as a function of error.
5/29/2019 Dessie Fentaw 31
Digital control
Involve the use of computer in modren applications, although in the past digital
logic circuits are used.
There are two approaches in digital control.
1. Supervisory conrol (SC)
2. Direct direct digital control(DDC)
5/29/2019 Dessie Fentaw 32
Supervisory control(SC)
Computers were first didn't have good relibility; they suffered frequent failures
and breakdown.
In SC a single computer could monitor many control loops &use appropriarte
software to optimize the set point for overall plant operation.
If the computer failed, the analog loops kept the process running by using the last
setpoints until th computer came back on line. fig.below shows such from of
digital control system.
5/29/2019 Dessie Fentaw 33
In supervisory control, the computer monitors measurements and updates setpoints,
but the loops are still analog in nature
5/29/2019 Dessie Fentaw 34
Direct digital control(DDC)
In recent days computer becomes more reliable & miniaturized, they have taken over
the controller function.
Thus the analog processing loop is discaded.
The ADC & DAC provide the interface with the process measurement &control action.
The computer inputs the digital equivalent of the temperature, NT, as an ADC O/P of
the I/P voltage VT.
5/29/2019 Dessie Fentaw 35
Error detection &controller action are detrmined by softwere.
The computer then prvides an output directly to th heater via digital representation
NQ Which is converted to the exciton voltage VQ by the DAC.
This direct digital control system lets the computer perform the error detection
and controller functions.
5/29/2019 Dessie Fentaw 36
Programmable logic cintroller (PLC)
In past electrical realys wired accoreding to complex digram into what was called a
relay logic controller.
In recent years this controller is replaced by PLC. Originally it deigend to discrete -
state(ON/OFF) systems but these days used to implement DDC. Fig below show how
thermal limit switch is used instead of sensr or to indicate when the temprature has
risen above or fallen below the limit temperatue.
These are simply switches designed to open (or colse) when the temperature reaches
creset certain preset value.
5/29/2019 Dessie Fentaw 37
A programmable logic controller
(PLC) is an outgrowth of ON/OFF-
type control environments.
In this case the heater and cooler are
either ON or OFF.
5/29/2019 Dessie Fentaw 38
Analog data Representation
Electric current and pneumatic pressures are the most common
means of information transmission in the industrial environment.
5/29/2019 Dessie Fentaw 39
One of the advantages of current as a transmission signal is that it is
nearly independent of line resistance.
5/29/2019 Dessie Fentaw 40
A transfer function shows how a system-block output variable varies
in response to an input variable, as a function of both static input
value and time.
5/29/2019 Dessie Fentaw 41
Uncertainties in block transfer functions build up as more blocks are
involved in the transformation.
5/29/2019 Dessie Fentaw 42
Hysteresis is a predictable error resulting from differences in the
transfer function as the input variable increases or decreases.
5/29/2019 Dessie Fentaw 43
Comparison of an actual curve and its best-fit straight line, where the
maximum deviation is 5% FS.
5/29/2019 Dessie Fentaw 44
THE INTRODUCTION OF
AUTOMATIC PROCESS CONTROL
5/29/2019 Dessie Fentaw 45
GOAL:
Maintaining process variables (temperatures, pressures,
flows, compositions, levels) at a desired operating value.
Processes are dynamic in nature, and changes are always
occurring. The important variables those related to safety,
product quality, and production rates will not achieve design
conditions.
5/29/2019 Dessie Fentaw 46
POINTS:
1.1 PROCESS CONTROL SYSTEM
1.2 IMPORTANT TERMS
1.3 TYPES OF CONTROL SYSTEMS
1.4 CONTROL STRATEGIES
1.5 SUMMARY
5/29/2019 Dessie Fentaw 47
1.1 PROCESS CONTROL SYSTEM
• Manual process control
• Automatic process control
5/29/2019 Dessie Fentaw 48
1.1 PROCESS CONTROL SYSTEM
Steam
Process
fluid
Ti(t) T(t)
T
Condensate
return
Figure 1-1 Heat exchanger
The purpose of this unit: To heat the process fluid
from some inlet temperature, Ti(t), up to a desired
outlet temperature, T(t).
5/29/2019 Dessie Fentaw 49
Steam
Process
fluid
Ti(t) T(t)
T
Condensate
return
Figure 1-1 Heat exchanger
In this process many variables can change,
causing the outlet temperature to deviate from
its desired value. If this happens, some action
must be taken to correct for this deviation.
5/29/2019 Dessie Fentaw 50
• Manual process control
(1) Measure the temperature T(t);
(2) Compare it to its desired value
(3) Based on this comparison, decide what to
do to correct for any deviation. The steam valve
can be manipulated to correct for the deviation.
Steam
Process
fluid
Ti(t) T(t)
T
5/29/2019
Condensate
Dessie Fentaw 51
return
How it works?
Steam
Process
fluid
Ti(t) T(t)
T
Condensate
return
If the outlet temperature T(t) is above its desired
value, the steam valve can be throttled back to
cut the steam flow(energy) to the heat exchanger;
If the outlet temperature T(t) is below its desired
value, the steam valve could be opened more to
increase the steam flow to the heat exchanger.
5/29/2019 Dessie Fentaw 52
Disadvantages of manual process control
(1) The operator should look at the temperature
frequently to take corrective action whenever it
deviates its desired value.
(2) Different operators would make different
decisions as to how to move the steam valve,
resulting in inconsistent operation.
(3) This corrective procedure would require a
large number of operators.
So, We would like to accomplish this control
automatically. Without requiring intervention from
the operator.
5/29/2019 Dessie Fentaw 53
• Automatic process control:
SP
(1) Measure the outlet
temperature of the TC
Controller
process stream by a
sensor(thermocouple, Final control
element
resistance temperature Steam
device, thermisters, etc.)
(2) Transmitter transmits Transmitter
the signal to the Process TT
controller fluid
(3) Controller compare Ti(t) T(t)
Sensor
the signal to the desired T
value, and decides what Condensate
return
to do to maintain the
temperature at its desired
value. Fig. 1-2 Heat exchanger control loop
(4) The controller sends a signal to the final control element to
manipulate
5/29/2019 the steam flow. Dessie Fentaw 54
Three components of all control systems:
SP
(1)Sensor/transmitter.
The primary and Controller
TC
secondary elements. Final control
element
Steam
(2) Controller. The
brain of the control Transmitter
system. Process TT
fluid
(3) Final control Ti(t) T(t)
Sensor
element. A control T
valve, but not always. Condensate
return
(variable-speed
pumps, conveyors Fig. 1-2 Heat exchanger control loop
and electric motors)
5/29/2019 Dessie Fentaw 55
Three basic operations:
SP
(1) Measurement(M).
Measuring the variable to Controller
TC
be controlled Final control
element
Steam
(2) Decision(D). Based on
the measurement, the Transmitter
controller decides what to Process TT
fluid
do to maintain the
Ti(t) T(t)
variable at its desired Sensor
T
value. Condensate
return
Fig. 1-2 Heat exchanger control loop
(3) Action(A). As a controller’s decision, the system
must take an action. This is usually accomplished by
the final control element.
5/29/2019 Dessie Fentaw 56
1.2 IMPORTANT TERMS
• Controlled variable (process variable, measurement).
The variable that must be controlled at some desired
value. SP
•Controlled object or Controller
TC
Process. The object Final control
that need to be element
Steam
controlled.
Transmitter
Process TT
fluid
• Set point. The desired Ti(t) T(t)
Sensor
T
value of the controlled Condensate
variable. return
5/29/2019
Fig. 1-2 Heat exchanger control loop
Dessie Fentaw 57
1.2 IMPORTANT TERMS
• Manipulated variable. The variable used to maintain the
controlled variable at its desired value.
• Disturbance(upset). Any
variable that causes the SP
controlled variable to
deviate away from the set Controller
TC
point. Final control
element
• In the heat exchanger, Steam
possible disturbances.
Transmitter
Inlet process temperature Process TT
Ti(t), the process flow f(t), fluid
The energy content of the T (t)
i T(t)
Sensor
steam, ambient condition, T
Condensate
process fluid composition return
and fouling.
5/29/2019
Fig. 1-2 Heat exchanger control loop
Dessie Fentaw 58
1.2 IMPORTANT TERMS
• NOTE. Disturbances are always occurring in processes,
transient conditions are very common. It is because of
these disturbances that automatic process control is
needed. If there were no disturbances, design operating
conditions would prevail, and there would be no
necessity of continuously “monitoring” the process.
With these preceding terms defined, we can say:
The objective of an automatic process control system is
to adjust the manipulated variable to maintain the
controlled variable at its set point in spite of disturbances.
5/29/2019 Dessie Fentaw 59
• Why control is important?
(1) Safety: Prevent injury to plant personnel, protect the
environment by preventing emission and minimizing
waste and prevent damage to the process equipment.
(2) Maintain product quality (composition, purity, color,
etc.) on a continuous basis and with minimum cost.
(3) Maintain plant production rate at minimum cost.
So, we can say that the reasons for automation of
process plants are to provide safety and at same time
maintain desired product quality, high plant throughput,
and reduce demand on human labor.
5/29/2019 Dessie Fentaw 60
1.3 TYPES OF CONTROL SYSTEM
Two types of control system:
(1) Regulatory control In some processes the controlled
variable deviated from the set point because of
disturbances, regulatory control refers to systems
designed to compensate for these disturbances.
(2) Servo control In some processes, the most important
disturbance is the set point itself. That is, the set point
may be changed as a function of time. Servo control
refers to control systems designed for this purpose.
In the process industries, regulatory control is far more
common that servo control.
5/29/2019 Dessie Fentaw 61
1.4 CONTROL STRATEGIES
Points:
(1) Feedback control (closed-loop control)
(2) Feedforward control (open-loop control)
(3) Choose a proper control system
5/29/2019 Dessie Fentaw 62
(1) Feedback control (closed-loop control)
Points:
• How it works?
• The block diagrams of feedback control
• The characteristics of feedback control
5/29/2019 Dessie Fentaw 63
1.4 CONTROL STRATEGIES
(1) Feedback control (closed-loop control)
•How it works? SP
If the inlet process TC
Controller
temperature decreases,
Final control
thus creating a disturbance, element
Steam
its effect must propagate
through the heat exchanger
Transmitter
before the outlet Process TT
temperature decreases. fluid
T(t)
Once the outlet temperature T (t) i
Sensor
T
changes, the signal from Condensate
the transmitter to the return
controller also changes.
5/29/2019
Fig. 1-2 Heat exchanger control loop
Dessie Fentaw 64
1.4 CONTROL STRATEGIES
(1) Feedback control (closed-loop control)
•How it works? SP
It is then that the controller TC
Controller
becomes aware that a
Final control
deviation from set point has element
Steam
occurred and it must
compensate for the
Transmitter
disturbance by Process TT
manipulating the steam fluid
T (t) T(t)
valve. The controller then i
Sensor
T
signals the valve to Condensate
increase its opening and return
thus increase the steam
flow.
5/29/2019
Fig. 1-2 Heat exchanger control loop
Dessie Fentaw 65
1.4 CONTROL STRATEGIES
The response of feedback control (closed-loop control)
At first the outlet temperature decreases because
TEMPERATURE
of the decrease in inlet temperature, but then it
INLET
increases, even above the set point and
TIME
continuous to oscillate until it finally stabilizes.
TEMPERATURE
OUTLET
This oscillatory response is typical of feedback
control and shows that it is essentially a trial and TIME
error operation. That is, when the controller
CONTROLLER
OUTPUT
notices that the outlet temperature has decreased
below the SET POINT, it signals the valve to
TIME
open. But the opening is more Fig.1-3 Response of
feedback control
5/29/2019 Dessie Fentaw 66
1.4 CONTROL STRATEGIES
TEMPERATURE
Than required. Therefore, the
outlet temperature increases
INLET
above the SET POINT. Noticing
TIME
this, the controller signals the
TEMPERATURE
valve to close again somewhat to
bring the temperature back down.
OUTLET
This trial and error continued until
TIME
the temperature reached and
stayed at SET POINT.
CONTROLLER
OUTPUT TIME
Fig.1-3
5/29/2019 Dessie Fentaw Response of 67
• The block diagrams of feedback control system
Disturbance 1 Disturbance 2
Output
SP
Final control Process Or
Controller
element or plant Controlled
Summing
- variable
junction
Sensor/
Transmitter
Fig 1-4 Block diagrams of closed-loop control systems
5/29/2019 Dessie Fentaw 68
1.4 CONTROL STRATEGIES
• The characteristics of feedback control
The advantage of feedback control
Compensate for all disturbances
The result of any disturbance entering the process is to
make the controlled variable deviate from the SET POINT.
Once the controlled variable deviates from the set point,
the controller changes its output to return the controlled
variable to SET POINT(its desired value).
The feedback control loop does not know, nor does it
care, which disturbance enters the process. It only tries
to maintain the controlled variable at set point, and in
this way compensates for all disturbances. The feedback
controller works with minimum knowledge of the
process. Actually, the only information it needs is in
which direction to move, and how much to move is
5/29/2019 Dessie Fentaw 69
usually adjusted by trial and error.
1.4 CONTROL STRATEGIES
• The characteristics of feedback control
The disadvantage of feedback control
SP
Can compensate for a
disturbance only AFTER Controller
TC
the controlled variable Final control
has deviated from the set element
Steam
point because of the
disturbance. Transmitter
Process TT
Can not give the fluid
controlled variable a Ti(t) T(t)
Sensor
timely control (laggard) T
Condensate
return
5/29/2019 Dessie Fentaw 70
(2) Feedforward control (open-loop control)
Points:
• How it works?
• The block diagram of feedforward control
• The characteristics of feedforward control
5/29/2019 Dessie Fentaw 71
• How it works?
The feedforward control is a very common control
strategy in the process industries. It is the simplicity
that accounts for its popularity.
The objective of feedforward control is to measure
the disturbances and compensate for them before
the controlled variable deviates from the set point.
If applied correctly, the controlled variable
deviation would be minimum.
5/29/2019 Dessie Fentaw 72
(2) Feedforward control (open-loop control)
Suppose that “major” SP
disturbance is the inlet Feedforward
temperature Ti(t). To controller
implement feedforward
Steam
control, this disturbance
TT
must first be measured
and then a decision made Ti(t) T(t)
as to manipulate the T
Condensation
retun
steam valve to
compensate for them.
Fig 1-5 Feedforward
control
5/29/2019 Dessie Fentaw 73
(2) Feedforward control (open-loop control)
Fig 1-5 shows this control SP
strategy. Feedforward
controller
measure the inlet
temperature Steam
TT
Feedforward controller
makes the decision about Ti(t) T(t)
T
how to manipulate the Condensation
retun
steam valve to maintain
the controlled variable at Fig 1-5 Feedforward
set point. control
5/29/2019 Dessie Fentaw 74
• The Block diagrams of Feedforward control
Sensor/
Tranmitter Process flow
Disturbances
Output
SP
Final control Process Or
Controller
element or plant Controlled
variable
Fig 1-6 Block diagrams of feedforward control
5/29/2019 Dessie Fentaw 75
• The characteristics of feedforward control
The disadvantage of feedforward control
Feedforward control cannot compensate
for all disturbances that enter the process
5/29/2019 Dessie Fentaw 76
• The characteristics of feedforward control
The disadvantage of feedforward control
SP
Feedforward
In this example, The feedforward controller
control system can compensate
only one of disturbances. If any Steam
TT
of the other disturbances enter
the process, this strategy will not f(t) Ti(t) T(t)
compensate for it, and the result T
Condensation
retun
will be a permanent deviation
from set point of the controlled
Fig 1-5 Feedforward
variable. control
5/29/2019 Dessie Fentaw 77
• The characteristics of feedforward control
The advantage of feedforward control
SP
It has the characteristic Feedforward
controller
of forward control
Steam
So, if we use this strategy
TT
correctly, the controlled
variable will not deviate Ti(t) T(t)
set point. T
Condensation
retun
Fig 1-5 Feedforward
control
5/29/2019 Dessie Fentaw 78
Some examples:
Washing machine
Feedforward
Oven control system
Microwave oven
Feedback
Air conditioner control system
5/29/2019 Dessie Fentaw 79
(3) Choose a proper control system
Review:
• Feedback control system
• Feedforward control system
?:
How to choose a proper control system?
5/29/2019 Dessie Fentaw 80
• Proper Control System
• Can get the output that a process need
• Low cost
5/29/2019 Dessie Fentaw 81
• Contrast
Feedforward Feedback Control
Control System System
Can not compensate Can compensate all
all disturbances disturbances
Simple structure Complex structure
Low cost High cost
5/29/2019 Dessie Fentaw 82
• Choice
An open-loop
system
• Simplicity and low cost
Trade-off:
• Complexity and higher cost
Premise: Ensure the A closed-loop
requirement of system
industrial production
5/29/2019 Dessie Fentaw 83
• Feedforward control with feedback control
In this example, TC
SP
Feedforward control
+
now compensate for Feedforward
controller
the “major” +
disturbance;
Steam
feedback control
compensate for all TT
TT
other disturbances. T(t)
f(t) Ti(t)
T
Condensation
retun
Fig 1-6 Feedforward control with
feedback control
5/29/2019 Dessie Fentaw 84
• feedforward control with feedback control
Notice: the three basic TC
SP
operations, M,D,A are
+
still present in this Feedforward
controller
more “advanced” +
control strategy.
Steam
The sensors and TT
TT
transmitters perform
the measurement. f(t) Ti(t) T(t)
T
Condensation
Both feedforward and retun
feedback controller
make the decision. Fig 1-6 Feedforward control with
feedback control
The steam valve takes
action.
5/29/2019 Dessie Fentaw 85
1.5 SUMMARY
• The need for automatic process control
• The principles of a control system, we can
use three letters to describe, M, D and A
• Present the basic components of a process
control system: sensor/transmitter, controller,
and final control element
5/29/2019 Dessie Fentaw 86
1.5 SUMMARY
• Present two types of control strategies:
Feedforward control or feedback control, we
also discussed their advantages and
disadvantages,
• Give the principles of choosing the proper
control system
5/29/2019 Dessie Fentaw 87
5/29/2019 Dessie Fentaw 88
5/29/2019 Dessie Fentaw 89
5/29/2019 Dessie Fentaw 90
5/29/2019 Dessie Fentaw 91
5/29/2019 Dessie Fentaw 92
5/29/2019 Dessie Fentaw 93
5/29/2019 Dessie Fentaw 94
CHAPTER 2
Analog and Digital signal conditioning
application to process control
Instructor : Dessie Fentaw(Capt.)
2016
5/29/2019 Dessie Fentaw 95
5/29/2019 Dessie Fentaw 96
5/29/2019 Dessie Fentaw 97
5/29/2019 Dessie Fentaw 98
5/29/2019 Dessie Fentaw 99
5/29/2019 Dessie Fentaw 100
5/29/2019 Dessie Fentaw 101
5/29/2019 Dessie Fentaw 102
5/29/2019 Dessie Fentaw 103
5/29/2019 Dessie Fentaw 104
5/29/2019 Dessie Fentaw 105
5/29/2019 Dessie Fentaw 106
5/29/2019 Dessie Fentaw 107
5/29/2019 Dessie Fentaw 108
5/29/2019 Dessie Fentaw 109
5/29/2019 Dessie Fentaw 110
5/29/2019 Dessie Fentaw 111
5/29/2019 Dessie Fentaw 112
5/29/2019 Dessie Fentaw 113
5/29/2019 Dessie Fentaw 114
5/29/2019 Dessie Fentaw 115
5/29/2019 Dessie Fentaw 116
5/29/2019 Dessie Fentaw 117
5/29/2019 Dessie Fentaw 118
5/29/2019 Dessie Fentaw 119
5/29/2019 Dessie Fentaw 120
5/29/2019 Dessie Fentaw 121
5/29/2019 Dessie Fentaw 122
5/29/2019 Dessie Fentaw 123
5/29/2019 Dessie Fentaw 124
5/29/2019 Dessie Fentaw 125
5/29/2019 Dessie Fentaw 126
5/29/2019 Dessie Fentaw 127
5/29/2019 Dessie Fentaw 128
5/29/2019 Dessie Fentaw 129
5/29/2019 Dessie Fentaw 130
5/29/2019 Dessie Fentaw 131
5/29/2019 Dessie Fentaw 132
5/29/2019 Dessie fenetaw 133
5/29/2019 Dessie fenetaw 134
5/29/2019 Dessie fenetaw 135
5/29/2019 Dessie fenetaw 136
5/29/2019 Dessie fenetaw 137
5/29/2019 Dessie fenetaw 138
5/29/2019 Dessie fenetaw 139
5/29/2019 Dessie fenetaw 140
5/29/2019 Dessie fenetaw 141
5/29/2019 Dessie fenetaw 142
5/29/2019 Dessie fenetaw 143
5/29/2019 Dessie fenetaw 144
5/29/2019 Dessie fenetaw 145
5/29/2019 Dessie fenetaw 146
5/29/2019 Dessie fenetaw 147
5/29/2019 Dessie fenetaw 148
5/29/2019 Dessie fenetaw 149
5/29/2019 Dessie fenetaw 150
5/29/2019 Dessie fenetaw 151
5/29/2019 Dessie fenetaw 152
5/29/2019 Dessie fenetaw 153
5/29/2019 Dessie fenetaw 154
5/29/2019 Dessie fenetaw 155
5/29/2019 Dessie fenetaw 156
5/29/2019 Dessie fenetaw 157
5/29/2019 Dessie fenetaw 158
5/29/2019 Dessie fenetaw 159
5/29/2019 Dessie fenetaw 160
5/29/2019 Dessie fenetaw 161
5/29/2019 Dessie fenetaw 162
5/29/2019 Dessie fenetaw 163
5/29/2019 Dessie fenetaw 164
5/29/2019 Dessie fenetaw 165
5/29/2019 Dessie fenetaw 166
5/29/2019 Dessie fenetaw 167
5/29/2019 Dessie fenetaw 168
5/29/2019 Dessie fenetaw 169
Analog to digital convertors (ADC)
Presentation Outline
• Introduction: Analog vs. Digital?
• Examples of ADC Applications
• Types of A/D Converters
• A/D Subsystem used in the microcontroller
chip
• Examples of Analog to Digital Signal
Conversion
• Successive Approximation ADC
5/29/2019 Dessie fenetaw 171
Analog Signals
Analog signals – directly measurable quantities
in terms of some other quantity
Examples:
• Thermometer – mercury height rises as
temperature rises
• Car Speedometer – Needle moves farther
right as you accelerate
• Stereo – Volume increases as you turn the
knob.
5/29/2019 Dessie fenetaw 172
Digital Signals
Digital Signals – have only two states. For digital
computers, we refer to binary states, 0 and 1.
“1” can be on, “0” can be off.
Examples:
• Light switch can be either on or off
• Door to a room is either open or closed
5/29/2019 Dessie fenetaw 173
Examples of A/D Applications
• Microphones - take your voice varying pressure waves in the air
and convert them into varying electrical signals
• Strain Gages - determines the amount of strain (change in
dimensions) when a stress is applied
• Thermocouple – temperature measuring device converts
thermal energy to electric energy
• Voltmeters
• Digital Multimeters
5/29/2019 Dessie fenetaw 174
Just what does an
A/D converter DO?
• Converts analog signals into binary words
5/29/2019 Dessie fenetaw 175
Analog Digital Conversion
2-Step Process:
• Quantizing - breaking down analog value is a
set of finite states
• Encoding - assigning a digital word or number
to each state and matching it to the input
signal
5/29/2019 Dessie fenetaw 176
Step 1: Quantizing
Output Discrete Voltage
Example: States Ranges (V)
You have 0-10V signals. 0 0.00-1.25
Separate them into a set 1 1.25-2.50
of discrete states with
2 2.50-3.75
1.25V increments. (How
did we get 1.25V? See 3 3.75-5.00
next slide…) 4 5.00-6.25
5 6.25-7.50
6 7.50-8.75
7 8.75-10.0
5/29/2019 Dessie fenetaw 177
Quantizing
The number of possible states that the converter can
output is:
N=2n
where n is the number of bits in the AD converter
Example: For a 3 bit A/D converter, N=23=8.
Analog quantization size:
Q=(Vmax-Vmin)/N = (10V – 0V)/8 = 1.25V
5/29/2019 Dessie fenetaw 178
Encoding
Output Output Binary Equivalent
• Here we assign the States
digital value (binary 0 000
number) to each state
1 001
for the computer to
read. 2 010
3 011
4 100
5 101
6 110
7 111
5/29/2019 Dessie fenetaw 179
Accuracy of A/D Conversion
There are two ways to best improve accuracy of A/D
conversion:
• increasing the resolution which improves the
accuracy in measuring the amplitude of the analog
signal.
• increasing the sampling rate which increases the
maximum frequency that can be measured.
5/29/2019 Dessie fenetaw 180
Resolution
• Resolution (number of discrete values the converter can
produce) = Analog Quantization size (Q)
(Q) = V range / 2^n, where V range is the range of analog
voltages which can be represented
• limited by signal-to-noise ratio (should be around 6dB)
• In our previous example: Q = 1.25V, this is a high resolution.
A lower resolution would be if we used a 2-bit converter, then
the resolution would be 10/2^2 = 2.50V.
5/29/2019 Dessie fenetaw 181
Sampling Rate
Frequency at which ADC evaluates analog signal. As we
see in the second picture, evaluating the signal more often
more accurately depicts the ADC signal.
5/29/2019 Dessie fenetaw 182
Aliasing
• Occurs when the input signal is changing much faster
than the sample rate.
For example, a 2 kHz sine wave being sampled at 1.5
kHz would be reconstructed as a 500 Hz (the aliased
signal) sine wave.
Nyquist Rule:
• Use a sampling frequency at least twice as high as
the maximum frequency in the signal to avoid
aliasing.
5/29/2019 Dessie fenetaw 183
Overall Better Accuracy
• Increasing both the sampling rate and the resolution you
can obtain better accuracy in your AD signals.
5/29/2019 Dessie fenetaw 184
A/D Converter Types By Danny Carpenter
• Converters
– Flash ADC
– Delta-Sigma ADC
– Dual Slope (integrating) ADC
– Successive Approximation ADC
5/29/2019 Dessie fenetaw 185
Flash ADC
• Consists of a series of comparators, each one
comparing the input signal to a unique
reference voltage.
• The comparator outputs connect to the inputs
of a priority encoder circuit, which produces a
binary output
5/29/2019 Dessie fenetaw 186
Flash ADC Circuit
5/29/2019 Dessie fenetaw 187
How Flash Works
• As the analog input voltage exceeds the
reference voltage at each comparator, the
comparator outputs will sequentially saturate
to a high state.
• The priority encoder generates a binary
number based on the highest-order active
input, ignoring all other active inputs.
5/29/2019 Dessie fenetaw 188
ADC Output
5/29/2019 Dessie fenetaw 189
Flash
Advantages Disadvantages
• Simplest in terms of
operational theory • Lower resolution
• Expensive
• Most efficient in terms of • For each additional
speed, very fast output bit, the number of
• limited only in terms of comparators is doubled
comparator and gate
• i.e. for 8 bits, 256
propagation delays
comparators needed
5/29/2019 Dessie fenetaw 190
Sigma Delta ADC
• Over sampled input signal
goes to the integrator
• Output of integration is
compared to GND
• Iterates to produce a
serial bit stream
• Output is serial bit stream
with # of 1’s proportional
to Vin
5/29/2019 Dessie fenetaw 191
Outputs of Delta Sigma
5/29/2019 Dessie fenetaw 192
Sigma-Delta
Advantages Disadvantages
• High resolution • Slow due to oversampling
• No precision external
components needed
5/29/2019 Dessie fenetaw 193
Dual Slope Converter
Vin
tFIX tmeas
t
• The sampled signal charges a capacitor for a fixed
amount of time
• By integrating over time, noise integrates out of the
conversion
• Then the ADC discharges the capacitor at a fixed rate
with the counter counts the ADC’s output bits. A longer
discharge time results in a higher count
5/29/2019 Dessie fenetaw 194
Dual Slope Converter
Advantages Disadvantages
• Input signal is averaged • Slow
• Greater noise immunity • High precision external
than other ADC types components required to
• High accuracy achieve accuracy
5/29/2019 Dessie fenetaw 195
Successive Approximation ADC
• A Successive Approximation Register (SAR) is added to the
circuit
• Instead of counting up in binary sequence, this register counts
by trying all values of bits starting with the MSB and finishing
at the LSB.
• The register monitors the comparators output to see if the
binary count is greater or less than the analog signal input and
adjusts the bits accordingly
5/29/2019 Dessie fenetaw 196
Successive Approximation ADC Circuit
5/29/2019 Dessie fenetaw 197
Output
5/29/2019 Dessie fenetaw 198
Successive Approximation
Advantages Disadvantages
• Capable of high speed and • Higher resolution successive
reliable approximation ADC’s will be
• Medium accuracy compared slower
to other ADC types • Speed limited to ~5Msps
• Good tradeoff between speed
and cost
• Capable of outputting the
binary number in serial (one
bit at a time) format.
5/29/2019 Dessie fenetaw 199
ADC Types Comparison
ADC Resolution Comparison
Dual Slope
Flash
Successive Approx
Sigma-Delta
0 5 10 15 20 25
Resolution (Bits)
Type Speed (relative) Cost (relative)
Dual Slope Slow Med
Flash Very Fast High
Successive Appox Medium – Fast Low
Sigma-Delta Slow Low
5/29/2019 Dessie fenetaw 200
Successive Approximation Example
• 10 bit resolution or
0.0009765625V of Vref
• Vin= .6 volts
• Vref=1volts
• Find the digital value of
Vin
5/29/2019 Dessie fenetaw 201
Successive Approximation
• MSB (bit 9)
– Divided Vref by 2
– Compare Vref /2 with Vin
– If Vin is greater than Vref /2 , turn MSB on (1)
– If Vin is less than Vref /2 , turn MSB off (0)
– Vin =0.6V and V=0.5
– Since Vin>V, MSB = 1 (on)
5/29/2019 Dessie fenetaw 202
Successive Approximation
• Next Calculate MSB-1 (bit 8)
– Compare Vin=0.6 V to V=Vref/2 + Vref/4= 0.5+0.25 =0.75V
– Since 0.6<0.75, MSB is turned off
• Calculate MSB-2 (bit 7)
– Go back to the last voltage that caused it to be turned on (Bit 9)
and add it to Vref/8, and compare with Vin
– Compare Vin with (0.5+Vref/8)=0.625
– Since 0.6<0.625, MSB is turned off
5/29/2019 Dessie fenetaw 203
Successive Approximation
• Calculate the state of MSB-3 (bit 6)
– Go to the last bit that caused it to be turned on (In
this case MSB-1) and add it to Vref/16, and
compare it to Vin
– Compare Vin to V= 0.5 + Vref/16= 0.5625
– Since 0.6>0.5625, MSB-3=1 (turned on)
5/29/2019 Dessie fenetaw 204
Successive Approximation
• This process continues for all the remaining
bits.
5/29/2019 Dessie fenetaw 205
Final Control/Final Control
Elements
5/29/2019 Dessie Fentaw 206
Final Control
• The function of final control element is to
translate low-energy control signal into a level
of action
5/29/2019 Dessie Fentaw 207
Final Control Operation
Control signal
Signal Conversions Actuator
Final
Control
Element
Process
Fig. Elements of the final control opration
5/29/2019 Dessie Fentaw 208
Signal Conversions
The modification to the control signal to properly
interface with the actuator
For example, the electric motor actuator to operate the
valve
Current-to-voltage conversion
The devices that perform signal conversions are called
transducers
5/29/2019 Dessie Fentaw 209
Actuator
The translation of control signal into action on the
control element
For example
– Valve (control element) Mechanism to open
or close the valve
can be electrically (Solenoid, or motor)
pneumatically
hydraulically controlled
– Heater (control element) Relay switch
5/29/2019 Dessie Fentaw 210
Control Element
• The device that influences the process variables
• For example
Flow Valve
Temperature Heater
5/29/2019 Dessie Fentaw 211
Signal Conversions
Signal conversion is to convert low-energy control
signal to a high-energy signal to drive the actuator
The signal from controller comes in 3 forms
Electrical current 4-20 mA
Pneumatic pressure 3 to 15 psi
Digital signal
5/29/2019 Dessie Fentaw 212
Common element to perform analog signal
conversion are
Relay
Amplifiers
Common element to perform digital signal
conversion are
ON/OFF control
DAC
Direct action
5/29/2019 Dessie Fentaw 213
Pneumatic Signals
In pneumatic system, signals is carried in form
of gas pressure
The pressure gas travels at speed of 330 m/s.
There are 3 types of conversion
Amplification
Nozzle/Flapper system
Current-to-Pressure converters
5/29/2019 Dessie Fentaw 214
Amplification
Pneumatic amplifier or booster raise pressure
via a regulator
As the input pressure increases, the diaphragm
motion will move the plug into the booster
5/29/2019 Dessie Fentaw 215
As the signal pressure varies, the
diaphragm motion will move the plug
in the body block of the booster.
If motion is down, the gas leak is
reduced and pressure in the out put line
is increased.
The device is reveres acting, because a
high-pressure will cause out put
pressure to decrease. many other
designs are also used
A pneumatic amplifier or booster converts the signal pressure to a higher
Pressure or the same pressure
5/29/2019 Dessie Fentaw 216
Nozzle/Flapper System
An important signal coversion is from pressure
to mechanicaal motion and vice versa.
This conversion can be provided by a
nozzle/flapper system(sometimes called a
nozzle/baffle system). Adiagram of this device
is sown in figure below .
A regulated supply of pressure, usually over 20
psi, provides a source of air through the
restriction.
The nozzle is open at the end where the gap
exists between the nozzle and flapper ,and air
escape in this region.
5/29/2019 Dessie Fentaw 217
Current-to-Pressure Converters
The current- to-pressure, or simply I/P converter, is an important element in
process control.
often, when we want to use the low-level electric current signal to do work, it is
easier to let the work be done by a pneumatic signal.
The I/P converter diven us a linear way of translatin the 4-to 20-mA current in to
a 3-to15- psig signal.
5/29/2019 Dessie Fentaw 218
I/P Converter
• Convert 4-20 mA into 3-to-15 psi signal
5/29/2019 Dessie Fentaw 219
There are many designes for these converter, but the basic princiipl almost always
involves the ues of a nozzle/floapper system.
Fig above illustrates a simply way to construct such a converter.
Notic that the current through a coil produces a force that will tend to pull the
flapper down and close off the gap.
5/29/2019 Dessie Fentaw 220
A high current produces a high pressure so that the device is direct acting .
Adjustment of the spring and perhaps the position relative to the pivot to
which they are attached allows the unit to be calibrated so that 4mA
corresponds to 3 psi and 20 mA corresponds to 15 psi
5/29/2019 Dessie Fentaw 221
Power Electronics
The high power electronics devices to convert low-
level energy signal to high-level energy signal
The devices is categorized into
Switching devices
Controlling devices
5/29/2019 Dessie Fentaw 222
Switching Devices
The solid-state semicoductor devices that can
either be in an off or on state
SCR
GTO
TRIAC
5/29/2019 Dessie Fentaw 223
SCR
SCR or thyristor is the device that conducts current
in the forward bias direction if a positive voltage is
applied to the gate
SCR will continue to conduct unless there is the
forward bias is removed
5/29/2019 Dessie Fentaw 224
During the ON state, there will be voltage
drop across SCR called Ron
The power dissipated in SCR is
P I 2 Ron
5/29/2019 Dessie Fentaw 225
Application of SCR is shown below
5/29/2019 Dessie Fentaw 226
The figure illustrated
how the SCR can be
used in full-wave
rectifier to control
power to the load
5/29/2019 Dessie Fentaw 227
The trigger signal can be implemented as shown
below
The opto-coupler allows the control voltage to
change current through the photoresistor
5/29/2019 Dessie Fentaw 228
• Thus, changing the charging rate of the
capacitor
• When the capacitor voltage reaches the
required gate triggered voltage, the capacitor
discharge through R, turn on the SCR
5/29/2019 Dessie Fentaw 229
Gate Turn-Off Thyristor (GTO)
A significant improvement to SCR
Turn on in forward bias with positive voltage
Turn off in forward bias with negative voltage
5/29/2019 Dessie Fentaw 230
TRIAC
Can conduct current in both direction
Positive gate voltage will conduct in one
direction
Negative gate voltage will conduct in opposite
direction
5/29/2019 Dessie Fentaw 231
5/29/2019 Dessie Fentaw 232
TRIAC is limited in applications because it is
slow
To turn off by taking voltage across the
TRIAC to zero
In order to provide necessary positive and
negative voltage the TRIAC is used with
DIAC
5/29/2019 Dessie Fentaw 233
Controlling Device
The devices that are used to smooth control
of current flow through it
BJT
Power MOSFET
IGBT
5/29/2019 Dessie Fentaw 234
Actuator
If a valve is used to control fluid flow, some mechanism must
physically open or close the valve.
If a heater is to warm a system, some device must tern the heater on
or off or vary its excitation.
These are examples of the requirements for an actuator in the
process-control loop.
Notice the distinction of this device from both the input control
signal and the control element itself (valve, heater ,and so on, as
shown in figure below).
5/29/2019 Dessie Fentaw 235
Electrical Actuator
Action is the result of input electrical signal
Solenoid
Electrical motor
i. DC motor
ii. AC motor
iii. Stepping motor
5/29/2019 Dessie Fentaw 236
Solenoid
An elementary device that converts an electrical
signal into mechanical motion (linear)
The solenoid consists of a coil and plunger
5/29/2019 Dessie Fentaw 237
The plungr may be freeatanding or spring loaded.
The coil will have some voltage or current rating and may be dc ac.
Solenoid specfications include the electrical rating and the plunger pull or
push force when excited by the specified voltage
5/29/2019 Dessie Fentaw 238
Turning Electrical Power into
Mechanical Work
5/29/2019 Dessie Fentaw 239
Presentation Agenda
• Discuss how a Solenoid Works
• Show some different types of Solenoids
• Discuss Applications for Solenoid use.
• Introduce Web Resources
5/29/2019 Dessie Fentaw 240
How a Solenoid Works.
1. Apply Current
2. Magnetic Field Builds
3. Stop and Plunger
Become Attracting
Magnets
4. Magnetic Force Drives
Plunger to Stop
5/29/2019 Dessie Fentaw 241
Basics Types of Solenoids
• Push • Rotary
• Pull • Open
• Clapper • Closed
5/29/2019 Dessie Fentaw 242
Types of Solenoids
Pull Solenoids
• Force is Directed Back
towards Solenoid.
Push Solenoids
• Force is Directed AWAY
from Solenoid
5/29/2019 Dessie Fentaw 243
Types of Solenoids
Clapper Solenoids
• Typically Force
application can be the
same as a Push or Pull
• Greater amount of End
Force/Hold Force
5/29/2019 Dessie Fentaw 244
Types of Solenoids
Rotary Solenoids • Every Company has
• Apply a Torque over a different ways to
range of Rotation. obtain the rotary
motion.
5/29/2019 Dessie Fentaw 245
Types of Solenoids
Rotary Solenoids
• Other Configurations:
5/29/2019 Dessie Fentaw 246
Types of Solenoids
• Open Frame Solenoids • Closed Frame Solenoids
or Tubular Solenoids
5/29/2019 Dessie Fentaw 247
Typical Solenoid Applications
• Linear Applications
– Valve Actuators
– Latching/Switching
– Pushing/Pulling Objects
• Sorting
• Shutters
• Characteristics
– Size as Force
– Limited Stroke Lengths
• 5/8” is a Long Stroke
5/29/2019 Dessie Fentaw 248
Typical Solenoid Applications
• Rotary Solenoids
– Sorting Machines
– Shutter Actuators
• Characteristics
– Strokes from 5° to 90°
– As Stroke Increases
Starting Torque
5/29/2019 Dessie Fentaw 249
Web Resources For Solenoids
http://www.camdec.com
http://www.gwlisk.com
http://www.ledex.com
http://www.ramcompany.com
http://www.takaha.com
5/29/2019 Dessie Fentaw 250
Conclusions
• Solenoids Convert Electrical Energy to
Mechanical Work
• Different Types of Solenoids for
Different Types of Applications
– Linear and Rotary
• Major Considerations
– Size
– Stroke and Force Limitations
5/29/2019 Dessie Fentaw 251
5/29/2019 Dessie Fentaw 252
DC Motor
The rotation of DC motor is produced by the
interaction of two constant magnetic fields
One from the permanent magnets, the other is from
a current passing through a wire
5/29/2019 Dessie Fentaw 253
5/29/2019 Dessie Fentaw 254
Many DC motors use electromagnet instead of a
permanent magnet to provide static field
Series field
Shunt field
Compound
5/29/2019 Dessie Fentaw 255
5/29/2019 Dessie Fentaw 256
• Series field
– Large starting torque
– Difficult to control speed
– Good in applications for starting heavy load
• Shunt field
– Smaller starting torque
– Good speed control
– Application: conveyer system
• Compound field
– Attempts to obtain the best of features of both of
the two previous types
5/29/2019 Dessie Fentaw 257
Synchronous Motor
• An AC motor distinguished by a rotor spinning
with coils passing magnets at the same rate as
the alternating current and resulting magnetic
field which drives it.
5/29/2019 Dessie Fentaw 258
• The speed of rotation of a synchronous motor
is related to frequency of ac excitation
120 f
ns (rpm)
p
5/29/2019 Dessie Fentaw 259
Induction Motor
• An induction motor (IM) is a type of
asynchronous AC motor where power is
supplied to the rotating device by means of
electromagnetic induction.
• Stator windings are arranged around the rotor
so that when energized with a polyphase
supply they create a rotating magnetic field
pattern which sweeps past the rotor.
5/29/2019 Dessie Fentaw 260
• This changing magnetic field pattern can
induce currents in the rotor conductors. These
currents interact with the rotating magnetic
field created by the stator and the rotor will
turn.
5/29/2019 Dessie Fentaw 261
5/29/2019 Dessie Fentaw 262
Step Motor
• The rotation of step motor is done by
sequence of pulses train
• The speed of step motor is determined by the
rate of pulse
• A driver circuit is used to converted the pulse
train into proper driving signals
5/29/2019 Dessie Fentaw 263
5/29/2019 Dessie Fentaw 264
5/29/2019 Dessie Fentaw 265
5/29/2019 Dessie Fentaw 266
Pneumatic Actuators
• Conversion of pressure signal into action
F A p1 p2
p1 p2 pressure difference (Pa)
A diaphragm area m 2
F force (N)
• If we need to double the available force for a given
pressure, it is only to double the diaphragm area
5/29/2019 Dessie Fentaw 267
• The action of pneumatic actuator is shown
below
• The shaft position is linearly related to applied
control pressure
A
x p
5/29/2019 Dessie Fentaw
k 268
Example
Suppose a force of 400 N must be applied to
open a valve. Find the diaphragm area if a
control gauge pressure of 70 kPa (10 psi) must
provide this force
5/29/2019 Dessie Fentaw 269
Hydraulic Actuator
• The inherent compressibility of gases cause
limit to the output force
• When large force is required, hydraulic
actuator may be employed.
• The basic idea is the same except fluid is
incompressible
• The hydraulic pressure is given by
5/29/2019 Dessie Fentaw 270
F1
pH
A1
• This pressure is transferred equally to the
working piston as
Fw pH A2
5/29/2019 Dessie Fentaw 271
• Thus, the working force is given by
A2
Fw F1
A1
5/29/2019 Dessie Fentaw 272
Example
a. Find the working force resulting from 200 N
applied to a 1 cm radius forcing piston if the
working piston has a radius of 6 cm
b. Find the hydraulic pressure.
5/29/2019 Dessie Fentaw 273
Control Elements
• The device to control variables.
• A general standard devices are
– Mechanical
– Electrical
– Fluid valve
5/29/2019 Dessie Fentaw 274
Mechanical Control Element
• Perform some mechanical operation
• Examples are
– Solid-Material Hopper Valve
– Paper Thickness
5/29/2019 Dessie Fentaw 275
Solid-Material Hopper Valve
• The control system is to maintain the flow of
grain from storage bin
• The flow depends on the height of the grain in
the bin
5/29/2019 Dessie Fentaw 276
5/29/2019 Dessie Fentaw 277
Paper Thickness
• Control of paper thickness
• Paper thickness is controlled by the height of
the roller
5/29/2019 Dessie Fentaw 278
Electrical Control Element
• A direct electrical effect on the process control
situation
• Examples are
– Motor-Speed Control
– Temperature Control
5/29/2019 Dessie Fentaw 279
Motor-Speed Control
• The speed of motor depends on supply
voltage, load, and others
• The motor speed control regulate the
operating voltage or current
5/29/2019 Dessie Fentaw 280
Temperature Control
• Control of temperature through a heater
which is directly supply by electrical signal
5/29/2019 Dessie Fentaw 281
Fluid Valve
• The element to regulate the flow of fluid
• The regulation of the flow is done by placing a
variable-size restriction in the flow path
5/29/2019 Dessie Fentaw 282
• The flow rate varies with square root of
pressure drop
Q K p
K proportionality constant m3 / s/Pa1/2
p p2 p1 pressure difference (Pa)
5/29/2019 Dessie Fentaw 283
5/29/2019 Dessie Fentaw 284
5/29/2019 Dessie Fentaw 285
Control Valve Type
• Classified by relationship
between the valve stem
position and the flow rate
– Quick Opening
• Used for full ON/full OFF
• Small motion of the stem,
resulted in maximum possible
flow rate
– Linear
• Flow rate varies linearly with stem
position
Q S
5/29/2019
Qmax S max Dessie Fentaw 286
– Equal Percentage
• Percentage change in stem position equal percentage
change in flow rate
• Range of flow rate is
Qmax
R
Qmin
• The flow rate is given by
Q Qmin RS / Smax
5/29/2019 Dessie Fentaw 287
Example
An equal percentage valve has a maximum
flow of 50 cm3/s and a minimum of 2 cm3/s. If
the full travel is 3 cm, find the flow at a 1 cm
opening
5/29/2019 Dessie Fentaw 288
CHAPTER 3
Process control loop tuning and
Controllers
5/29/2019 Dessie Fentaw 289
Introduction
In this chapter, we study the nature of controller action for
systems with operations and variables that range over
continuous values.
The controller inputs the results of measurements of the
controller variable and determines an appropriate output to the
final control element.
Essentially, the controller is some form of computer either
analog or digital, pneumatic or electronic.
5/29/2019 Dessie Fentaw 290
Closed-loop control system in process control.
5/29/2019 Dessie Fentaw 291
The Controller provides a corrective signal. Output will depend on vε.
The Output signal conditioning or Signal conditioner is the interface between the
controller output (a signal) to the output actuator.
The Output actuator or Final correcting device directly affects a process change: motor,
heater, solenoid, etc.
The Input sensor detects any changes in the process respect to the set-point.
The Input signal conditioning converts the output from the input sensor to a process
variable signal.
5/29/2019 Dessie Fentaw 292
The Controller is the heart of any electronic control system and possesses the following
characteristics:
i. It maintains the process variable within acceptable limits of the set point.
ii. The smaller the variations of the process from the set point the better the controller.
iii. The faster the controller responds when the process variable deviates from the set point
the better the controller.
5/29/2019 Dessie Fentaw 293
Controller Principles
The controller takes input, solve certain
equations to calculate the proper output
The equations describe the mode or action of
the controller
5/29/2019 Dessie Fentaw 294
Process Characteristics
To select which mode of operation to used
depends on the characteristics of the process
Process equation
Dynamic behavior of the process
5/29/2019 Dessie Fentaw 295
The control of liquid temperature in the tank
The controlled variable is TL(liquid temprature)
5/29/2019 Dessie Fentaw 296
TL depends on many parameters in the process
TL F (QA , QB , QS , TA , TS , T0 )
where QA , QB flow rates in pipes A and B
QS steam flow rate
TA ambient temperature
T0 inlet fluid temperature
TS steam temperature
The controller loop adjusts QS and regulate the TL, regardless
of each parameters vary with each other
5/29/2019 Dessie Fentaw 297
Process Load
Set of parameters in the process that results in controlled
variable equal to setpoint value, excluding controlled
variable
When the load changes, the controlling variable is adjusted
to compensate for this change to bring back to the setpoint
Process Lag
The time delay that process responds to the load change
5/29/2019 Dessie Fentaw 298
Example
An inlet flow is suddenly double. The process
gradually change the liquid temperature.
5/29/2019 Dessie Fentaw 299
Self-Regulation
A significant characteristic of some processes to adopt a
specific value or stable value of controlled variable under
nominal load without regulation via process control loop is
called self-regulation.
The control operations are significantly affected by the self
regulation.
5/29/2019 Dessie Fentaw 300
Control System Parameters
Error
Variable Range
Control Parameter Range
Control Lag
Dead Time
Cycling
Controller Modes
5/29/2019 Dessie Fentaw 301
Error
The deviation or error of the controlled
variable from the set point is given by
e r b
e error
b measured indication of variable
r setpoint of variable (reference)
5/29/2019 Dessie Fentaw 302
The previous equation is error as an absolute sense
To express error as percent of span
r b
ep 100
bmax bmin
5/29/2019 Dessie Fentaw 303
Example
The temperature has a range of 300 to 440 K and a set
point of 384 K. Find the percentage of span error
when the temperature is 379 k
5/29/2019 Dessie Fentaw 304
Control Parameter Range
The controller output expressed as percentage
where 0 % is the minimum controller output and
100 % is the maximum controller output
u umin
p 100
umax umin
p controller output as percent of full scale
u value of the output
umax maximum value of controlling parameter
5/29/2019
umin minimum value of controlling parameter
Dessie Fentaw 305
Example
A controller outputs a 4-to-20 mA signal to control motor speed from 140 to
600 rpm with a linear dependence. Calculate (a) current corresponding to 310
rpm and (b) the value of (a) expressed as the percentage of control output.
Soln.
We find the slope m and intersect by the linear equation
5/29/2019 Dessie Fentaw 306
Control Lag
The time for the process-control loop to make
necessary adjustment to the final control element
Example,
A change in liquid temperature occurs, it is required
some finite time for the control system to
physically actuate the steam control valve
5/29/2019 Dessie Fentaw 307
Dead Time
Dead time is the delay from when a controller
output signal is issued until when the measured
process variable (PV) first begins to respond.
The presence of dead time is never a good thing in a
control loop.
5/29/2019 Dessie Fentaw 308
Cycling
An oscillation of the error about zero
It means the controlled variable varies up and
down between the setpoint
5/29/2019 Dessie Fentaw 309
Controller Modes
Discontinuous controller mode
A discrete state of output from the controller
Continuous controller mode
Smoothly continuous adjust the output
The choice is depended on
Process characteristics
Cost analysis
Product rate
Other industrial factors
5/29/2019 Dessie Fentaw 310
Direct Action
When controlled variable increases as controller output increases
Level control
• Level increase, the value should open more (drive signal
should increase)
Reverse Action
When an increase in controlled variable cause a
decrease in controller output
Temperature control
If temperature increase, the drive to the heater should be
decrease
5/29/2019 Dessie Fentaw 311
Discontinuous Controller Modes
Two position mode
Multi-position mode
Floating control mode
5/29/2019 Dessie Fentaw 312
Two Position Mode
The controller will output 2 values of signal
depends on ep
0% e p 0
p
100% e p 0
Heater,
if temperature drops below setpoint, the heater is
turn ON.
If the temperature rises above the setpoint, it is turn
OFF
5/29/2019 Dessie Fentaw 313
Neutral Zone
During -ep to ep, the controller output will not
change
This is design to prevent excessive cycling
5/29/2019 Dessie Fentaw 314
Example
A liquid-level control system linearly converts a displacement
of 2 to 3 m into a 4 to 20 mA control signal. A relay serves as
the two position controller to open or close an inlet valve. The
relay closes at 12 mA and opens at 10 mA. Find (a) the
relation between displacement level and current and (b) the
neutral zone or displacement gap in meter
5/29/2019 Dessie Fentaw 315
Multi position Mode
Provide several intermediate setting of
controller outputs
Try to reduce cycling behavior and overshoot
This mode is represent by
p pi e p ei i 1, 2,...n
5/29/2019 Dessie Fentaw 316
Example
100 e p e1
p 50 e1 e p e1
0 e p e1
5/29/2019 Dessie Fentaw 317
The graph represents the error and the control output
The overshoot and undershoot are due to process lag time
and controller lag time
5/29/2019 Dessie Fentaw 318
Floating-Control Mode
p is not uniquely determined by error ep
Single speed floating controller
The output p of the controller change at a fixed rate
when error exceeds the neutral zone
dp
KF e p e p
dt
dp
rate of change of controller output with time
dt
K F rate constant (%/s)
e p half the neutral zone
5/29/2019 Dessie Fentaw 319
The previous equation is integrated, we get
p K F t p(0) e p e p
p(0) controller output at t=0
It shows that the present output depends on the time history
of error
5/29/2019 Dessie Fentaw 320
If deviation persists, the controller saturates at either
100% or 0%
5/29/2019 Dessie Fentaw 321
Multiple Speed
The possible rate for controller depends on
magnitude of ep
dp
K Fi e p e pi
dt
5/29/2019 Dessie Fentaw 322
Continuous Controller Mode
Proportional control mode
Integral control mode
Derivative control mode
5/29/2019 Dessie Fentaw 323
Proportional Control Mode
Each value of error (ep) has a unique value of
controller output in one-to-one correspondence
p K p e p p0
K p proportional gain between error
and controller output (% per %)
p0 controller output with no error (%)
5/29/2019 Dessie Fentaw 324
Direct and Reverse Action
From r b
ep 100
bmax bmin
As b (measured)increases --> p decreases -->
reverse action
To get direct action, put negative sign for Kp
5/29/2019 Dessie Fentaw 325
Proportional Band
The range of error to cover 0 to 100% controller
output is called proportional band (PB)
100
PB
5/29/2019
K
Dessie Fentawp 326
Summary
If error is zero, the output is constant equal to p0
If there is error, for every 1% of error, a correction
Kp percent is added to or subtracted from p0,
depending on the sign of error
There is a band of error about zero of magnitude PB
within which the output is not saturate at 0% or
100%
5/29/2019 Dessie Fentaw 327
Offset
A load change permanently effects the output of the
controller
Example
5/29/2019 Dessie Fentaw 328
Integral Control Mode
Integral mode eliminates offset by allowing the
controller to adapt by changing zero output.
Integral action is provided by summing error over
time, multiplying that sum by a gain and adding the
result to the present controller output.
t
p(t ) K I e p dt p (0)
0
5/29/2019 Dessie Fentaw 329
p(0) is the controller output when the integral
action starts
KI expresses how much controller output in
percent is needed for every percent time
dp (t )
accumulative error, an Kother
I ep
way
dt
When error occurs, the controller begins to
increase (decrease) its output at a rate that
depends on the size of the error and the gain
5/29/2019 Dessie Fentaw 330
Example
An integral controller has a reset action of 2.2 minutes. Express the integral controller
constant in s-1.Solution:
Find the output of this controller to a constant error of 2.2%.
Given Data: Reset action time = TI = 2.2 min =
132 Seconds
Error = ep = 2.2%
Asked: Integral controller constant = KI = ?
Controller output = p = ?
5/29/2019 Dessie Fentaw 331
Summary
If error is zero, the output stays fixed at value equal
to what it was when the error went to zero
If error is not zero, the output will begin to increase
or decrease at a rate of KI percent/second for every
1% of error
5/29/2019 Dessie Fentaw 332
Integral mode controller action
a). The rate of output change depends on error
b).an illustration of integral mode output and error
5/29/2019 Dessie Fentaw 333
Derivative Control Mode
Derivative action responds to the rate at which the
errors is changing. That is, the derivative of the error
de p
p (t ) K D
dt
KD tells us how much percentage change the controller
output for every percent-per-second rate of change of
error
5/29/2019 Dessie Fentaw 334
Summary
If error is zero, the mode provide no output
Derivative action is not use alone because it provides
no action when error is constant
If the error is changing, the mode contribute an output
KD percent for every 1 % per s of rate of change of
error
5/29/2019 Dessie Fentaw 335
How would a derivative controller with KD = 4 s respond to an error that
varies as ep=2.2 Sin(0.04t)?
Solution
Given: KD = 4 s ep = 2.2 Sin(0.04t) Asked: Derivative controller o/p=?
For derivative mode, p(t) = KD (dep/dt)
p(t) = 4 x d/dt(2.2 Sin(0.04t))
= 4 x 2.2 x Cos(0.04t) x 0.04
= 0.352 Cos(0.04t)
5/29/2019 Dessie Fentaw 336
5/29/2019 Dessie Fentaw 337
Composite Control Mode
The combination of basic modes
Gain advantage of each modes
Eliminate some limitations
Example
PI
PD
PID
5/29/2019 Dessie Fentaw 338
Proportional-Integrate
Control (PI)
Combination of proportional mode and integral
mode
t
p K P e p K P K I e p dt PI (0)
0
where
PI (0) integral term at t = 0
5/29/2019 Dessie Fentaw 339
Example
A PI controller is reverse acting, PB=20, 12 repeats per minute. Find (a)
Proportional gain (b) Integral gain, and (c) Time that the controller output will
reach 0% after a constant error of 1.5% starts. The controller output when the error
occurred was 72%.
5/29/2019 Dessie Fentaw 340
5/29/2019 Dessie Fentaw 341
Summary
One-to-One correspondence
Eliminate offset
When the error is zero, p = pI(0)
If the error is not zero, the proportional term
contributes a correction and the integral term begin
to increase the accumulate value
5/29/2019 Dessie Fentaw 342
5/29/2019 Dessie Fentaw 343
Proportional Derivative
Control (PD)
Combination of proportional and derivative modes.
de p
p K Pep K P K D p0
dt
Cannot eliminate the offset proportional controller
Can handle fast process load changes if offset error
is acceptable
5/29/2019 Dessie Fentaw 344
5/29/2019 Dessie Fentaw 345
Example
A PD controller has Kp = 2.0, KD = 2 s, and P0 = 40%. Plot the controller output for
the error input shown in Fig below
5/29/2019 Dessie Fentaw 346
Three-Mode Controller (PID)
Powerful Complex Controller
Combines the proportional, integral, and derivative
modes
Can be used in any process condition
t
de p
p K P e p K P K I e p dt K P K D pI (0)
0
dt
5/29/2019 Dessie Fentaw 347
Design of Analog Controllers
Instructor : Dessie Fentaw
5/29/2019 Dessie Fentaw 348
Introduction
This chapter provides a detailed description of how controller
modes are implemented using analog techniques. Both
electronic techniques and pneumatic techniques are discussed.
More emphasis is given on the electronic controllers, realized
using op amps as the active element because of its wide spread
use.
Pneumatic techniques are also discussed because there are many
operations where a complete implementation of process control
loop uses pneumatic methods.
5/29/2019 Dessie Fentaw 349
Objectives
The objectives of this chapter are to provide an understanding of how controller
modes are implemented using electronic techniques. After the detailed study of
this chapter, you should able to:
1. Diagram the physical appearance of an analog controller.
2. Diagram and describe how two position and three position control can be
implemented using comparators
3. Draw a schematics and describe how op amps can be used to implement
the proportional, integral and derivative modes of analog control
4. Design an op amp circuit that will implement the proportional integral,
proportional derivative, and proportional integral derivative control
modes.
5/29/2019 Dessie Fentaw 350
General Features
An analog controller is a device that implements different controller
modes using analog signals to represent the loop parameters.
The analog signal may be in the form of an electric current or a
pneumatic air pressure.
The controller accepts a measurement expressed in terms of one of these
signals, calculates an output for the mode being used, and outputs an
analog signal of the same type.
Since controller does solve equations, it can be treated as an analog
computer.
The controller must be able to add, subtract, multiply, integrate and find
derivatives of analog voltages or pressures.
5/29/2019 Dessie Fentaw 351
Typical Physical Layout
Fig. Typical physical appearance of a controller
5/29/2019 Dessie Fentaw 352
Electronic controllers
Electronic method of realizing controller
modes necessitates the use of OPAMPs as the
primary circuit elements.
Error detector
The detection of an error signal is done in
electronic controllers by taking the difference
between voltages. One voltage is generated by the
process signal current passed through a
resistor. The second voltage represents the set
point, which is usually generated by a voltage
divider using a constant voltage as a source.
5/29/2019 Dessie Fentaw 353
Error detector
An error detector also can be made from a differential amplifier as shown in
Figure.
The sensor signal current passes to ground through RL providing a signal
voltage Vm = IRL.
The differential amplifier then subtracts this from the set point voltage.
Error detector using a ground based current and a differential amplifier.
5/29/2019 Dessie Fentaw 354
Two Position controller
Two Position controller implementation using OPAMP is shown as
figure below represents the OPAMP implementation of ON/OFF
controller with adjustable neutral zone.
A two position controller with neutral zone made from op amps and a comparator.
5/29/2019 Dessie Fentaw 355
Two Position controller
Assume that, if the controller input voltage, Vin reaches a value VH then the
comparator output should go to the ON state, which is defined as some voltage V0.
When the input voltage falls bellow a value VL the comparator output should
switch to the OFF state, which is defined as 0 V.
This defines a two position controller with a neutral zone of:
NZ = VH - VL
as shown in the Figure
5/29/2019 Dessie Fentaw 356
Two Position controller
Assume that, in the beginning, the comparator is in the OFF state. i.e.
the voltage, V1 at the input of the comparator is less than the set
point voltage, Vsp. Hence,
Vout = 0
The comparator output switches states when the voltage on its input,
V1 is equal to the set point value Vsp Analyzing this circuit,
Substituting Vout = 0 yields
V1 = Vin
5/29/2019 Dessie Fentaw 357
Two Position controller
The comparator changes to ON state when V1 = Vin = VH. Thus, the high (ON)
switch voltage is
VH = Vsp
and the corresponding output voltage Vout is
Vout = V0 With this V1 changes to
5/29/2019 Dessie Fentaw 358
Three position controller
The figure below shows how a simple three position controller can be
realized with op amps and comparators.
A three position controller using two comparators and op amps
5/29/2019 Dessie Fentaw 359
Three position controller
Assume that, the output of the comparators is 0 V for the
OFF state and V0 volts for the ON state.
The summing amplifier also includes a bias voltage input,
VB which allows the three position mode response to be
biased up or down in voltage to suit particular needs.
The inverter is needed to convert the sign of the inverting
action of the summing amplifier.
5/29/2019 Dessie Fentaw 360
Three position controller
5/29/2019 Dessie Fentaw 361
Three position controller
Response of the three position controller
5/29/2019 Dessie Fentaw 362
Proportional Mode controller design
Implementation of this mode requires a circuit that has the response given by:
P = Kp ep + P0
Where P = controller output 0 – 100 %
Kp = Proportional gain
ep = error in percent of variable range
P0 = Controller output with no error
5/29/2019 Dessie Fentaw 363
Implementation of P Mode controller using
OPAMP
If both the controller output and error expressed in terms of voltage, then
the above equation is a summing amplifier.
Figure shows such an electronic proportional controller.
An op amp proportional mode Controller
5/29/2019 Dessie Fentaw 364
Implementation of P Mode controller using OPAMP
Now, the analog electronic equation for the output voltage is:
Vout = Gp Ve + V0
Where, Vout = output voltage
Gp = R2/R1 = gain, Ve = Error voltage, V0 = output with zero error
Thus, first identify that the output voltage range of the circuit, whatever it is,
represents a swing of 0% to 100%. Thus, if a final control element needs 0 to 5
V, then a Zener is added as shown in the Figure so that the op amp output can
swing only between 0 and 5V.
A zener diode used to clamp the output swing of an op amp controller
5/29/2019 Dessie Fentaw 365
Implementation of P Mode controller using OPAMP
Design Procedure:
First, for the input, determine the range of measurement from which the error voltage
was produced.
e.g. Consider that, the temperature is to be measured and controlled from 100°C to
200°C and this is converted to 2.0 to 8.0 V.
Hence, the measurement range is (8.0 – 2.0) = 6.0V. Then error voltage can be expressed
as a percent of this range. This will be correlated with the error in equation 2.15. i.e,
Where, ep = error expressed as percentage of span
r = set point value (Reference)
b = measured indication of variable
bmax = maximum of measured value
bmin = minimum of measured value
5/29/2019 Dessie Fentaw 366
Implementation of P Mode controller using OPAMP
Finally, calculate the gain (Gp) of which is not simply Kp. The actual value of
Gp must be determined so that its effect in voltage is the same as that required by Kp in
terms of percent.
e.g. Kp = 4 %/%
The output voltage range = 0 to 5 V
Input voltage span = 2 to 8 V
Find corresponding Gp
Solution:
Input voltage range = (8-2) V = 6 V.
5/29/2019 Dessie Fentaw 367
Implementation of P Mode controller using OPAMP
Method 1
Kp = 4 %/% means: if the error constitutes 1 % of the input range, then the output must
be changed by 4 % of its range.
1 % of the input range = (0.01) (6V) = 0.06 V
4 % of the output = ( 0.04) ( 5 V) = 0.2 V
Now, Gp = (Kp % of the output)/ (1 % of the input range)
Gp = 0.2/0.06 = 3.33
Method2:
PB = 100/Kp
PB = Percent of error that will cause a 100 % change of output.
Now, with the given data, PB = 100/4 = 25 %
Therefore, 25 % change of input error must produce a 100 % change of output.
Now, 25 % change of input is = (0.25) (6 V) = 1.5 V
100 % of the output = 5 V
So, Gp = (5V)/(1.5 V) = 3.33.
5/29/2019 Dessie Fentaw 368
Integral Mode controller
The general representation of integral controller is:
Where, P( t) = controller output in percent of full scale
KI = integration gain (per/s)
ep(t) = deviations in percent of full scale variable value
PI(0) = Controller output at t = 0
5/29/2019 Dessie Fentaw 369
Implementation of I-mode Using OPAMP
Integral controller implemented using OPAMPs is shown in Figure.
An op amp integral mode controller
Analysis of the circuit gives,
5/29/2019 Dessie Fentaw 370
Implementation of I-mode Using OPAMP
The values of R and C can be adjusted to obtain the desired integration time.
The initial controller output is the integrator output at t = 0.
If KI is made too large, the output rises so fast that overshoots of the optimum
setting occur and cycling is produced.
Determination of GI
The actual value of GI and therefore R and C, is determined from KI and the
input and output voltage ranges.
Integral gain says that, an input error of 1 % must produce an output that
changes as KI % per second. Or if an error of 1 % lasts for 1 s, the output must
change by KI percent.
5/29/2019 Dessie Fentaw 371
Implementation of I-mode Using OPAMP
Integral gain says that, an input error of 1 % must produce an output that changes as KI
% per second. Or if an error of 1 % lasts for 1 s, the output must change by KI percent.
e.g. Consider an input range of 6 V Output range of 5V
KI = 3.0 %/(%-min)
Note: Integral gain is often given in minutes because industrial processes are slow,
compared to a time of seconds. This gain is often expressed as integration time, TI,
which is just the inverse of the gain.
5/29/2019 Dessie Fentaw 372
Implementation of I-mode Using OPAMP
e.g. Consider an input range of 6 V Output range of 5V KI = 3.0 %/(%-min)
Note: Integral gain is often given in minutes because industrial processes are
slow, compared to a time of seconds. This gain is often expressed as integration
time, TI, which is just the inverse of the gain.
Solution
First convert the time units to seconds.
Therefore, [(3 %)/(%-min)][( 1min/60s)] = 0.05%/(%-s)
Error of 1 % for 1 sec = (0.01)(6V)(1s) = 0.06 V-s
KI % of the output = (0.0005)( 5V) = 0.0025 V
The integral gain GI = (KI % of the output ) / (Error of 1 % for 1 sec)
= (0.0025V)/(0.06 V-s)
= 0.0417 s-1 Values of R and C can be selected from this.
5/29/2019 Dessie Fentaw 373
Derivative mode
The derivative mode is never used alone because it can not provide a
controller output when the error is zero or constant.
The control mode equation is given by:
5/29/2019 Dessie Fentaw 374
Implementation of derivative controller using OPAMP
Consider an OPAMP differentiator circuit shown in below.
OPAMP differentiator circuit
The theoretical transfer function for this circuit will be given by
where, the input voltage has been set equal to the controller error voltage.
5/29/2019 Dessie Fentaw 375
Implementation of derivative controller using OPAMP
From ac analysis, we can write these currents in terms of voltage and
impedance as
Equation shows that the magnitude of the output voltage increases linearly
with frequency, so in principle, as the frequency goes to infinity, so does the
output. Clearly this is unacceptable in control theory.
5/29/2019 Dessie Fentaw 376
Implementation of derivative controller using OPAMP
From a practical perspective, this circuit can not be used because it tends
to be unstable, that is, it may begin to exhibit spontaneous oscillations in
the output voltage.
The reason for this instability is the occurrence of very large gain at high
frequencies where the derivative is very large.
In order to make a practical circuit, a modification is provided that
essentially clamps the gain above some frequency to a constant value.
A Practical derivative mode op amp controller
5/29/2019 Dessie Fentaw 377
Implementation of derivative controller using OPAMP
5/29/2019 Dessie Fentaw 378
Implementation of derivative controller using OPAMP
Guidelines to design derivative mode controller
1. Estimate the maximum frequency at which the physical system can respond, fmax.
2. Set 2π fmax R1C = 0.1 and solve for R1( C is found from the mode derivative gain
requirement)
3. Equation shows that the following responses will result from this selection:
f = 0.1 fmax Vout = 0.995 (2π fR2C) |Ve| Derivative action
f = fmax Vout = 0.707 (2π fR2C) |Ve| Transition action
f = 10fmax Vout = 0.0995 (2π fR2C)|Ve| No Derivative action
Assuming this criterion has been met, we can ignore R1 for the controller design and
define the circuit derivative gain or derivative time in seconds as GD = R2C. GD will
be determined from the design controller derivative gain KD.
5/29/2019 Dessie Fentaw 379
Composite controller modes
Composite modes combine the advantages of each mode and in some
cases eliminate the disadvantages. Composite modes are implemented
easily using op amp techniques.
Proportional - Integral mode
PI controller is the combination of proportional and integral controller defined by:
Where, P = controller output in percent of full scale
ep = process error in percent of the maximum
Kp = Proportional gain
KI= Integral gain
PI(0) = initial controller integral output
5/29/2019 Dessie Fentaw 380
Composite controller modes
Implementation of PI controller using op amps Figure a shows one method of
implementation of the PI controller using op amps.
An op amp proportional integral (PI) mode controller
5/29/2019 Dessie Fentaw 381
Proportional - Integral mode
To derive an expression for the output voltage of this circuit, first define
nodes and currents as shown in the Figure.
An op amp proportional integral (PI) mode controller
5/29/2019 Dessie Fentaw 382
Proportional - Integral mode
Note that, there is no current through op amp input terminals and no voltage
across the input terminals. Therefore, Va = 0 and
I1 + I2 = 0
I3 – I2 = 0
The relationship between the voltage across the capacitor and current
through a capacitor is given by
5/29/2019 Dessie Fentaw 383
Proportional - Integral mode
Where Vc is the voltage across the capacitor. Combining this with Ohm’s law
allows the preceding current equations to be written in terms of voltage as:
5/29/2019 Dessie Fentaw 384
Proportional - Integral mode
In order to solve for Vout, integrate this equation to eliminate the derivative on
Vout. i.e.:
5/29/2019 Dessie Fentaw 385
Proportional Derivative Mode
PD controller is the combination of proportional and derivative mode of
controllers. The general definition of PD controller is:
Where, P = Controller output in percent of full output
Kp = Proportional gain
KD = Derivative time constant (s)
ep = error in percent of full scale range
P(0) = Zero error controller output
5/29/2019 Dessie Fentaw 386
Proportional Derivative Mode
Implementation of PD controller using op amps.
Figure shows how a PD controller can be implemented using op amps.
Where the quantities are defined in the figure and the output inverter has
been included. This circuit includes the clamp to protect against high gain at
high frequency in the derivative term.
An op amp Proportional Derivative (PD) mode controller
5/29/2019 Dessie Fentaw 387
Proportional Derivative Mode
With the condition becomes as usual, 2π fmax RC = 0.1. Assuming this criterion
has been met, while deriving the equation for the PD response given below.
5/29/2019 Dessie Fentaw 388
Proportional Derivative Mode
Derivation of PD controller response
Analysis of PD circuit can be performed using the circuit shown in Figure
showing currents and nodes. The voltage across the op amp input terminals,
Vb = 0. Also there is no current in to the op amp inputs.
An op amp Proportional Derivative (PD) mode controller
5/29/2019 Dessie Fentaw 389
Proportional Derivative Mode
Application of KCL, to the two active nodes provides the equations:
I1 + I2 -I3 = 0
I4+ I3 = 0
Ohm’s law and the differential relation between current and voltage for a
capacitor can be used to express these equations in terms of voltage.
5/29/2019 Dessie Fentaw 390
Proportional Derivative Mode
Substituting one over the other we have:
5/29/2019 Dessie Fentaw 391
Proportional Derivative Mode
After rearranging and some more algebra, this reduces to:
PD controller still has the offset error of a proportional controller
because the derivative term cannot provide reset action.
5/29/2019 Dessie Fentaw 392
Three Mode Controller
Three mode controllers is the combination of proportional, integral and
derivative mode of controllers.
Characterized by:
Where, P = controller output in percent of full scale
ep = process error in percent of the maximum
Kp = Proportional gain
KI= Integral gain
KD= Derivative gain
PI(0) = initial controller integral output
The zero error term of the proportional mode is not necessary because
the integral automatically accommodates for offset and nominal setting.
5/29/2019 Dessie Fentaw 393
Three Mode Controller
Implementation of three mode controller using op amps
Three mode controller can be implemented by a straight application of op amps as
shown in Figure below.
Implementation of a three mode (PID) controller with op amps
5/29/2019 Dessie Fentaw 394
Three Mode Controller
For the analysis, assume the voltages as indicated in figure as shown
5/29/2019 Dessie Fentaw 395
Three Mode Controller
5/29/2019 Dessie Fentaw 396
Three Mode Controller
R3 has been chosen from 2π fmax R3CD = 0.1 for stability
5/29/2019 Dessie Fentaw 397
Chapter 4
Programmable Logic Controllers and
Applications
CONTENTS
1. What is PLC
2. Electrical Ladder Logic Diagrams
3. Software Ladder Logic Diagrams
4. PLC Implementation
5. An example
5/29/2019 Dessie Fentaw (DEC) 398
Programmable Logic Controllers(PLC)
Every control system may be divided into three general sections:
input devices (sensors),
controllers, and
output devices (actuators).
The input devices sense what is going on in the process, the
controller decides what to do about it, and the output devices
manipulate the process to achieve the desired result.
5/29/2019 Dessie Fentaw (DEC) 399
Programmable Logic Controllers(PLC)
A programmable logic controller or PLC is a general-purpose
controller, applicable to many different types of process control
applications.
The word “programmable” in its name reveals just why PLCs are
so useful: the end-user is able to program, or instruct, the PLC to
do virtually any control function imaginable.
Unlike PID loop controllers, which are special-purpose devices
intended to perform a single type of control function, a PLC may
be instructed to do almost anything with the signals it receives
from input devices.
5/29/2019 Dessie Fentaw (DEC) 400
Programmable Logic Controllers(PLC)
PLCs were introduced to industry as electronic replacements
for electromechanical relay controls.
In applications where relays typically control the starting and
stopping of electric motors and other discrete output devices,
the reliability of an electronic PLC meant fewer system
failures and longer operating life.
The re-programmability of a PLC also meant changes could be
implemented to the control system strategy must easier than
with relay circuits, where re-wiring was the only way to alter
the system’s function.
5/29/2019 Dessie Fentaw (DEC) 401
Programmable Logic Controllers(PLC)
Additionally, the computer-based nature of a PLC meant that
process control data could now be communicated by the PLC
over networks, allowing process conditions to be monitored in
distant locations, and by multiple operator stations.
The legacy of PLCs as relay-replacements is probably most
evident in their traditional programming language: a graphical
convention known as a Ladder Diagram.
5/29/2019 Dessie Fentaw (DEC) 402
Programmable Logic Controllers(PLC)
Large PLC systems consist of a rack into which circuit “cards”
are plugged.
These cards include processors, input and output (I/O) points,
communications ports, and other functions necessary to the
operation of a complete PLC system.
Such “modular” PLCs may be configured differently according
to the specific needs of the application.
Individual card failures are also easier to repair in a modular
system, since only the failed card need be replaced, not all the
cards or the whole card rack.
5/29/2019 Dessie Fentaw (DEC) 403
Programmable Logic Controllers(PLC)
Small PLC systems consist of a monolithic “brick”
containing all processor, I/O, and communication functions.
These PLCs are typically far less expensive than their
modular cousins, but are also more limited in I/O capability
and must be replaced as a whole in the event of failure.
The following photographs show several examples of real
PLC systems, some modular and some monolithic.
5/29/2019 Dessie Fentaw (DEC) 404
Programmable Logic Controllers(PLC)
The first photograph is of a Siemens (Texas Instruments) 505 series PLC
The power supply and processor card for each rack is located on the left-hand
end, with I/O cards plugged into slots in the rest of the rack.
Input devices such as switches and sensors connect by wire to terminals on input
cards, while output devices such as lamps, solenoids, and motor contactor coils
connect by wire to terminals on output cards.
5/29/2019 Dessie Fentaw (DEC) 405
Programmable Logic Controllers(PLC)
One of the benefits of modular PLC construction is that I/O cards
may be changed out as desired, altering the I/O configuration of the
PLC as needed.
If, for example, the PLC needs to be configured to monitor a
greater number of sensors, more input cards may be plugged into
the rack and subsequently wired to those sensors.
Or, if the type of sensor needs to be changed – perhaps from a 24
volt DC sensor to one operating on 220 volts AC – a different type
of input card may be substituted to match the new sensor(s).
5/29/2019 Dessie Fentaw (DEC) 406
Programmable Logic Controllers(PLC)
photograph shows an Allen-Bradley (Rockwell) PLC-5 system, used to monitor
and control the operation of a large natural gas compressor.
Like the Siemens 505 PLC seen previously, this Allen-Bradley
PLC-5 system is fully modular and configurable.
5/29/2019 Dessie Fentaw (DEC) 407
Programmable Logic Controllers(PLC)
A modern PLC manufactured by Siemens appears in this photograph, an S7-300,
which is a different design of modular PLC.
Instead of individual cards plugging into a rack, this modular PLC design uses
individual modules plugging into each other on their sides to form a wider unit.
5/29/2019 Dessie Fentaw (DEC) 408
Programmable Logic Controllers(PLC)
While the Siemens S7 and
Rockwell ControlLogix PLC
platforms represent large-
scale, modular PLC systems,
there exist much smaller PLCs
available for a fraction of the
cost.
5/29/2019 Dessie Fentaw (DEC) 409
Programmable Logic Controllers(PLC)
The above figure is a semi-modular PLC design, with a minimum
of input/output (I/O) channels built into the processor module, but
having the capacity to accept multiple I/O modules plugged in to
the side, much like the Siemens S7-300 PLC.
5/29/2019 Dessie Fentaw (DEC) 410
Programmable Logic Controllers(PLC)
low-end PLCs are strictly monolithic, with no ability to accept additional I/O
modules.
5/29/2019 Dessie Fentaw (DEC) 411
Programmable Logic Controllers(PLC)
Some low-end PLCs are strictly monolithic, with no ability to
accept additional I/O modules.
This General Electric Series One PLC (used to monitor a small-
scale hydroelectric power generating station) is an example of a
purely monolithic design, having no “expansion” slots to accept
I/O cards.
A disadvantage of monolithic PLC construction is that damaged
I/O cannot be independently replaced.
5/29/2019 Dessie Fentaw (DEC) 412
Programmable Logic Controllers(PLC)
If an I/O channel on one of these PLCs becomes damaged, the entire
PLC must be replaced to fix the problem.
In a modular system, the damaged I/O card may simply be
unplugged from the rack and replaced with a new I/O card.
Another disadvantage of monolithic PLCs is the inherently fixed
nature of the I/O.
The end-user cannot customize the I/O configuration to match the
application.
For these reasons, monolithic PLCs are usually found on small-scale
processes with few I/O channels and limited potential for expansion.
5/29/2019 Dessie Fentaw (DEC) 413
Input/output (I/O) capabilities
Every programmable logic controller must have some means of
receiving and interpreting signals from real-world sensors such as
switches, and encoders, and also be able to effect control over
real-world control elements such as solenoids, valves, and motors.
This is generally known as input/output, or I/O, capability.
Monolithic (“brick”) PLCs have a fixed amount of I/O capability
built into the unit, while modular (“rack”) PLCs use individual
circuit board “cards” to provide customized I/O capability.
5/29/2019 Dessie Fentaw (DEC) 414
Input/output (I/O) capabilities
5/29/2019 Dessie Fentaw (DEC) 415
Input/output (I/O) capabilities
Some PLCs have the ability to connect to processor-less
remote racks filled with additional I/O cards or modules,
thus providing a way to increase the number of I/O channels
beyond the capacity of the base unit.
The connection from host PLC to remote I/O racks usually
takes the form of a special digital network, which may span a
great physical distance.
5/29/2019 Dessie Fentaw (DEC) 416
Input/output (I/O) capabilities
5/29/2019 Dessie Fentaw (DEC) 417
Objectives:
Know general PLC issues
To be able to write simple ladder logic programs
Understand the operation of a PLC
5/29/2019 Dessie Fentaw (DEC) 418
Introduction
The advent of the PLC began in the 1970s, and has become the most common
choice for manufacturing controls.
PLCs have been gaining popularity on the factory floor and will probably remain
predominant for some time to come.
Most of this is because of the advantages they offer;
Cost effective for controlling complex systems.
Flexible and can be reapplied to control other systems quickly and easily.
Computational abilities allow more sophisticated control.
Trouble shooting aids make programming easier and reduce downtime.
Reliable components make these likely to operate for years before failure.
5/29/2019 Dessie Fentaw (DEC) 419
What are PLCs and How do they work?
PLCs are often defined as a very small model of industrial computers that
contain hardware and software used to perform control functions.
A PLC consists of two basic sections:
the central processing unit (CPU), and
the input/output interface system.
The CPU, which controls all PLC activity, can further be broken down into:
the processor, and
memory system.
5/29/2019 Dessie Fentaw (DEC) 420
What are PLCs and How do they work?
The input/output system is physically connected to field devices
(e.g., switches, sensors, motor starters, light, valves, etc.), and
provides the interface between the CPU and the information providers (inputs) and
controllable devices (outputs). Origin - in 1968
Original goals:
Programmable
communication capable
Maintainable
Reliable
Compact
inexpensive
Additional features:
• discrete & continuous control
5/29/2019 Dessie Fentaw (DEC) 421
PLC - Introduction
What does PLC stand for?
PLC - programmable logic controller
PLC implements logic control functions by means of a
program
5/29/2019 Dessie Fentaw (DEC) 422
PLC - Introduction
Features
5/29/2019 Dessie Fentaw (DEC) 423
PLC - Introduction
Features
5/29/2019 Dessie Fentaw (DEC) 424
PLC - Introduction
An application example 1: Gate Control
PLC can sense a vehicle at the entrance or exit, and open
and close the gate automatically
The current vehicle count is easily determined by
programming a simple counter
5/29/2019 Dessie Fentaw (DEC) 425
PLC - Introduction
An application example 2: Conveyor System
PLC can be used to start/stop latching logic for motor
control
Counters can be used for monitoring product amounts
5/29/2019 Dessie Fentaw (DEC) 426
PLC - Introduction
Comparing traditional and programmable control systems - 1
5/29/2019 Dessie Fentaw (DEC) 427
PLC - Introduction
Comparing traditional and programmable control systems - 2
In traditional control, the switches S1, S2 and S3 must close for K1 to be
turned on - the wiring makes the rule
In PLC systems, the program is written to perform the logic “when S1 is
closed AND S2 is closed AND S3 is closed, THEN turn on K1” - the
program makes the rule
It is much simpler to change program then wiring!
5/29/2019 Dessie Fentaw (DEC) 428
PLC - Introduction
How does a PLC differ from a computer?
A computer is optimized for calculation and display tasks
A computer is programmed by specialists
A PLC is designed for (logic) control and regulation tasks
A PLC is programmed by non-specialists
A PLC is well adapted to industrial environment
5/29/2019 Dessie Fentaw (DEC) 429
PLC - Introduction
Why are PLCs so common?
They are cost-effective
They are flexible, reliable and compact
They have significant advantages over traditional
control systems based on relay or pneumatics
5/29/2019 Dessie Fentaw (DEC) 430
PLC - Introduction
Where are PLCs used?
In every industry where automation is involved, from
individual machines to whole processes.
5/29/2019 Dessie Fentaw (DEC) 431
PLC - Introduction
What tasks do PLCs perform?
The logic control tasks such as interlocking, sequencing,
timing and counting (previously undertaken with relays or
pneumatics)
In addition, PLCs can perform a variety of calculation,
communication and monitoring tasks
5/29/2019 Dessie Fentaw (DEC) 432
PLC - Introduction
Outputs & Power Supply
Communication
Ports (RS-485)
Inputs
5/29/2019 Dessie Fentaw (DEC) 433
PLC Components
Structure of a PLC
5/29/2019 Dessie Fentaw (DEC) 434
PLC Components
5/29/2019 Dessie Fentaw (DEC) 435
PLC - Introduction
The PLC processor
5/29/2019 Dessie Fentaw (DEC) 436
PLC - Introduction
PLC Input/Output Devices
5/29/2019 Dessie Fentaw (DEC) 437
PLC - Introduction
PLC Input Devices
Push buttons
Switches (limit switches, level switches, etc.)
Sensors
.....
5/29/2019 Dessie Fentaw (DEC) 438
PLC - Introduction
PLC Output Devices
Relay contacts
Solenoid valves
Signal devices (such as lamps, alarms, etc.)
Motors
...
5/29/2019 Dessie Fentaw (DEC) 439
PLC - Introduction
Programming terminal
5/29/2019 Dessie Fentaw (DEC) 440
PLC - Introduction
Programming is done through programming terminal
Programming terminal translates engineering language
(logic control) to machine language (binary code)
5/29/2019 Dessie Fentaw (DEC) 441
PLC - Introduction
Programming through standard computer
Most PLC manufacturers offer software packages that allow a
standard computer to be used as a programming terminal
5/29/2019 Dessie Fentaw (DEC) 442
PLC - Introduction
Programming through standard computer
5/29/2019 Dessie Fentaw (DEC) 443
PLC - Introduction
Relating the program to inputs and outputs
The CPU reads the data from the inputs
The program in the CPU uses the inputs to evaluate the
control logic.
As the program runs, the CPU updates the data
The CPU writes the data to the output
5/29/2019 Dessie Fentaw (DEC) 444
PLC - Introduction
Relating the program to inputs and outputs
5/29/2019 Dessie Fentaw (DEC) 445
PLC - Introduction
Data Flow in the PLC
5/29/2019 Dessie Fentaw (DEC) 446
PLC - Introduction
One of the advantages of PLC is that it can be programmed by non-
specialists
Program can be written either in the form of a
statement list: a set of mnemonic instructions representing a function of
the CPU
or a ladder diagram: a graphical language resembling the electrical
relay diagrams
5/29/2019 Dessie Fentaw (DEC) 447
Ladder Logic
Ladder logic is the main programming method used for PLCs.
A relay is a simple device that uses a magnetic field to control a
switch, as pictured in Figure 1.
When a voltage is applied to the input coil, the resulting current
creates a magnetic field.
The magnetic field pulls a metal switch (or reed) towards it and the
contacts touch, closing the switch.
The contact that closes when the coil is energized is called normally
open.
The normally closed contacts touch when the input coil is not
energized.
Relays are normally drawn in schematic form using a circle to
represent the input coil. Figure 1:
The output contacts are shown with two parallel lines. Simple Relay Layouts and
Normally open contacts are shown as two lines, and Schematics
will be open (non-conducting) when the input is not energized.
Normally closed contacts are shown with two lines with a diagonal line
through them.
When the input coil is not energized the normally closed contacts will
be closed (conducting).
5/29/2019 Dessie Fentaw (DEC) 448
Relays are used to let one power source close
a switch for another (often high current)
power source, while keeping them isolated.
An example of a relay in a simple control
application is shown in Figure 2.
In this system the first relay on the left is used as
normally closed, and will allow current to flow until a
voltage is applied to the input A.
Figure 2
The second relay is normally open and will not allow
A Simple Relay Controller
current to flow until a voltage is applied to the input B.
If current is flowing through the first two relays then
current will flow through the coil in the third relay, and
close the switch for output C.
This circuit would normally be drawn in the ladder logic
form.
This can be read logically as C will be on if A is off and
B is on.
5/29/2019 Dessie Fentaw (DEC) 449
The example in Figure 2 does not show the entire control system, but only the
logic.
When we consider a PLC there are;
inputs,
outputs, and
the logic.
Figure 3 shows a more complete representation of the PLC.
5/29/2019 Dessie Fentaw (DEC) 450
Here there are two inputs from push buttons.
We can imagine the inputs as activating 24V DC relay
coils in the PLC.
This in turn drives an output relay that switches 115V
AC, that will turn on a light.
Note:
in actual PLCs inputs are never relays, but outputs
are often relays.
The ladder logic in the PLC is actually a computer
program that the user can enter and change.
Notice that;
both of the input push buttons are normally open,
but the ladder logic inside the PLC has one normally
open contact, and one normally closed contact. Figure 3
A PLC Illustrated With Relays
5/29/2019 Dessie Fentaw (DEC) 451
Programming:
The first PLCs were programmed with a technique
that was based on relay logic wiring schematics.
An example of ladder logic can be seen in Figure 4.
To interpret this diagram imagine that the power is on the
vertical line on the left hand side, we call this the hot rail.
On the right hand side is the neutral rail.
In the figure there are two rungs, and on each rung
there are combinations of inputs (two vertical lines)
and outputs (circles). Figure 4
A Simple Ladder Logic Diagram
If the inputs are opened or closed in the right
combination the power can flow from the hot rail, through In the top rung the contacts are normally
the inputs, to power the outputs, and finally to the open and normally closed.
neutral rail.
Which means if input A is on and input B is
An input can come from a sensor, switch, or any other
off, then power will flow through the output
type of sensor.
and activate it.
An output will be some device outside the PLC that is
switched on or off, such as lights or motors.
Any other combination of input values will
5/29/2019 Dessie Fentaw (DEC) result in the output X being off. 452
The second rung of Figure 4 is more complex,
there are actually multiple combinations of inputs that will result in the output Y turning on.
On the left most part of the rung, power could flow through the top if C is off and D is on.
Power could also (and simultaneously) flow through the bottom if both E and F are true.
This would get power half way across the rung, and then if G or H is true the power will be delivered to
output.
Other methods for programming PLCs:
One of the earliest techniques involved mnemonic instructions.
These instructions can be derived directly from the ladder logic diagrams and entered into the PLC
through a simple programming terminal.
An example of mnemonics is shown in Figure 5.
5/29/2019 Dessie Fentaw (DEC) 453
The first line 00000 has the instruction LDN (input load and
not) for input 00001.
This will examine the input to the PLC and
if it is off it will remember a 1 (or true),
if it is on it will remember a 0 (or false).
The next line uses an LD (input load) statement to look at
the input.
If the input is off it remembers a 0,
if the input is on it remembers a 1 (note: this is the
reverse of the LD).
The AND statement recalls the last two numbers
remembered and
if the are both true the result is a 1, otherwise the
result is a 0. Figure 5
An Example of a Mnemonic Program
This result now replaces the two numbers that were and Equivalent Ladder Logic
recalled, and there is only one number remembered.
The process is repeated for lines 00003 and 00004, but
when these are done there are now three numbers
remembered.
The oldest number is from the AND,
the newer numbers are from the two LD Dessie
5/29/2019 instructions.
Fentaw (DEC) 454
The AND in line 00005 combines the results from the last LD instructions and now there are
two numbers remembered.
The OR instruction takes the two numbers now remaining and
if either one is a 1 the result is a 1, otherwise the result is a 0.
This result replaces the two numbers, and there is now a single number there.
The last instruction is the ST (store output) that will look at the last value stored and
if it is 1, the output will be turned on,
if it is 0 the output will be turned off.
The ladder logic program in Figure 5, is equivalent to the mnemonic program.
Even if you have programmed a PLC with ladder logic,
it will be converted to mnemonic form before being used by the PLC.
5/29/2019 Dessie Fentaw (DEC) 455
Input adjustment interface
Input adjustment module turns a level of real logic to a level that suits CPU unit
For example, input from a sensor which works on 24 VDC must be converted to a signal of 5 VDC in order
for a CPU to be able to process it.
This is typically done through opto-isolation
Opto-isolation means that:
there is no electrical connection between external world and CPU unit.
They are "optically" separated, or in other words, signal is transmitted through light.
External device brings a signal which turns LED on,
whose light in turn incites photo transistor which in turn starts conducting, and
a CPU sees this as logic zero (supply between collector and transmitter falls under 1V)
When input signal stops LED diode turns off,
transistor stops conducting,
collector voltage increases, and
CPU receives logic 1 as information.
5/29/2019 Dessie Fentaw (DEC) 456
Output adjustment interface
Output interface is similar to input interface.
CPU brings a signal to LED diode and turns it on.
Light incites a photo transistor which begins to conduct electricity, and
thus the voltage between collector and emitter falls to 0.7V , and
a device attached to this output sees this as a logic zero.
Inversely it means that a signal at the output exists and is interpreted as logic one.
Photo transistor is not directly connected to a PLC controller output.
Between photo transistor and an output usually there is a relay or
a stronger transistor capable of interrupting
5/29/2019 Dessie Fentawstronger
(DEC) signals. 457
Connecting sensors and execution devices
Two terms most frequently mentioned when discussing connections to inputs or
outputs are:
"sinking" and "sourcing".
The most brief definition of these two concepts would be:
SINKING = Common GND line (-)
SOURCING = Common VCC line (+)
5/29/2019 Dessie Fentaw (DEC) 458
Input lines
Following pictures display some examples of sensor outputs and their connection with a PLC
controller.
Mentioning is that sinking-sourcing and sourcing - sinking pairing is always used, and not
sourcing-sourcing or sinking-sinking pairing.
5/29/2019 Dessie Fentaw (DEC) 459
Output lines
PLC controller output lines usually can be:
Transistors in PNP connection
Transistors in NPN connection
Relays
The following two pictures display a realistic way how a PLC manages external devices.
Main difference between these two pictures is a position of "output load device".
By "output load device" we mean some relay, signalization light or similar.
5/29/2019 Dessie Fentaw (DEC) 460
5/29/2019 Dessie Fentaw (DEC) 461
Input Devices / Sensor Wiring
i.e. examining the various electrical wiring techniques for sensors.
When a sensor detects a logical change it must signal that change to the PLC.
This is typically done by switching a voltage or current on or off.
In some cases the output of the sensor is used to switch a load directly,
completely eliminating the PLC.
Typical out-puts from sensors (and inputs to PLCs) are listed below in relative
popularity.
Sinking/Sourcing - Switches current on or off.
Plain Switches - Switches voltage on or off.
Solid State Relays - These switch AC outputs.
TTL (Transistor Transistor Logic) - Uses 0V and 5V to indicate logic levels.
5/29/2019 Dessie Fentaw (DEC) 462
Switches
The simplest example of sensor outputs are switches and relays.
A simple example is shown in Figure 1.1. PLC Input Card
24 V DC
NO PB 00
+ 01
24 V dc
Power 02
Supply
- 03
V+
04
Relay 05
Sensor output
06
V-
07
COM
Fig.1.1
In the figure a NO contact switch is connected to input 01.
A sensor with a relay output is also shown.
The sensor must be powered separately, therefore the V+ and V- terminals are connected
to the power supply.
The output of the sensor will become active when a phenomenon has been detected.
This means the internal switch (probably a relay) will be closed allowing current to flow and
the positive voltage will be applied to input 06.
5/29/2019 Dessie Fentaw (DEC) 463
Transistor Transistor Logic (TTL)
Transistor-Transistor Logic (TTL) is based on two voltage levels, 0V for false and 5V for true.
The voltages can actually be slightly larger than 0V, or lower than 5V and still be detected correctly.
This method is very susceptible to electrical noise on the factory floor, and should only be used when
necessary.
TTL outputs are common on electronic devices and computers.
When connecting to other devices simple circuits can be used to improve the signal, such as the Schmitt
trigger in Fig.1.2. Vi
Vi Vo
t
Vo
t
Fig.1.2
A Schmitt trigger will receive an input voltage between 0-5V and convert it to 0V or 5V.
If the voltage is in an ambiguous range, about 1.5-3.5V it will be ignored.
If a sensor has a TTL output the PLC must use a TTL input card to read the values.
If the TTL sensor is being used for other applications it should be noted that the maximum current output
is normally about 20mA.
5/29/2019 Dessie Fentaw (DEC) 464
Sinking/Sourcing
Sinking sensors allow current to flow into the sensor to the voltage common,
while sourcing sensors allow current to flow out of the sensor from a positive source.
For both of these methods the emphasis is on current flow, not voltage.
By using current flow, instead of voltage, many of the electrical noise problems are reduced.
When discussing sourcing and sinking we are referring to the output of the sensor that is
acting like a switch.
In fact the output of the sensor is normally a transistor, that will act like a switch (with some
voltage loss).
A PNP transistor is used for the sourcing output, and an NPN transistor is used for the
sinking input.
When discussing these sensors the term sourcing is often interchanged with PNP, and
sinking with NPN.
5/29/2019 Dessie Fentaw (DEC) 465
A simplified example of a sinking output sensor is shown in Fig.1.3.
V+
V+
Physical
phenomenon Current flows in
Sensor
when switched on
output NPN
Sensor
&
Detector
Active
Line
V-
V-
Fig.1.3
The sensor will have some part that deals with detection, this is on the left.
The sensor needs a voltage supply to operate, so a voltage supply is needed for the sensor.
If the sensor has detected some phenomenon then it will trigger the active line.
The active line is directly connected to an NPN transistor.
If the voltage to the transistor on the active line is 0V, then the transistor will not allow
current to flow into the sensor.
If the voltage on the active line becomes larger (say 12V) then the transistor will switch on
and allow current to flow into the sensor to the common.
5/29/2019 Dessie Fentaw (DEC) 466
Sourcing sensors are the complement to sinking sensors.
The sourcing sensors use a PNP transistor, as shown in Fig.1.4.
V+
V+
Physical
phenomenon
Active
Sensor Line
&
Detector Current flows out
PNP when switched on
Sensor
output
V-
V-
Fig.1.4
When the sensor is inactive the active line stays at the V+ value, and the
transistor stays switched off.
When the sensor becomes active the active line will be made 0V, and the
transistor will allow current to flow out of the sensor (hence sourcing).
5/29/2019 Dessie Fentaw (DEC) 467
Direct Control Using NPN/PNP Sensors
Most NPN/PNP sensors are capable of handling currents up to a few amps, and
they can be used to switch loads directly.
An example using sourcing and sinking sensors to control lights is shown in
Fig.1.5.
V+ V+
Power
Sensor NPN Siinking
supply
V- V- (COM)
V+ V+
Power
Sensor PNP Sourcing
supply
V- V- (COM)
Fig.1.5
In the sinking system in Figure 1.5 the light has V+ applied to one side.
The other side is connected to the NPN output of the sensor.
When the sensor turns on the current will be able to flow through the light, into the output
to V- common.
(Note: Yes, the current will be allowed to flow into the output for an NPN sensor.)
In the sourcing arrangement the light will turn on when the output becomes active, allowing
current
5/29/2019to flow from the V+, thought the sensor,
Dessie Fentawthe
(DEC)light and to V- (the common). 468
A PLC Input Card for Sinking Sensors
At this point it is worth stating the obvious –
The output of a sensor will be an input for a PLC.
And, as we saw with the NPN sensor, this does not necessarily indicate where current is flowing.
There are two viable approaches for connecting sensors to PLCs.
The first is to always use PNP sensors and normal voltage input cards.
The second option is to purchase input cards specifically designed for sourcing or sinking
sensors.
An example of a PLC card for sinking sensors is shown in Fig.1.6.
+V Current flow
V+
Internal Card Electronics
V+ Power
supply
V-
Sensor
NPN
00 V- (COM)
01
Fig.1.6
Note: PLC Data Bus External Electrical
When a PLC input card does not have a common but it has a V+ instead, it can be used for NPN
sensors.
In this case the current will flow out of the card (sourcing) and we must switch it to ground.
5/29/2019 Dessie Fentaw (DEC) 469
ASIDE:
This card is shown with 2 optocouplers (one for each output).
Inside these devices the is an LED and a phototransistor, but no electrical connection.
These devices are used to isolate two different electrical systems.
In this case they protect the 5V digital levels of the PLC computer from the various external voltages
and currents.
The dashed line in the figure represents the circuit, or current flow path when the sensor is active.
This path enters the PLC input card first at a V+ terminal (Note: there is no common on this card) and
flows through an optocoupler.
This current will use light to turn on a phototransistor to tell the computer in the PLC the input current is
flowing.
The current then leaves the card at input 00 and passes through the sensor to V-. When the sensor is
inactive the current will not flow, and the light in the optocoupler will be off.
The optocoupler is used to help protect the PLC from electrical problems outside the PLC.
5/29/2019 Dessie Fentaw (DEC) 470
PLC Input Card for Sourcing Sensors
The input cards for PNP sensors are similar to the NPN cards, as shown in Fig.1.7.
Current flow
00 V+
PNP Sensor
Internal Card Electronics
V-
01
V+
Power
supply
V-
Com
Fig.1.7
Note: PLC Data Bus External Electrical
When we have a PLC input card that has a common then we can use PNP sensors.
In this case the current will flow into the card and then out the common to the power
supply.
The current flow loop for an active sensor is shown with a dashed line.
Following the path of the current we see that it begins at the V+, passes through the sensor,
in the input 00, through the optocoupler, out the common and to the V-.
5/29/2019 Dessie Fentaw (DEC) 471
Two Wire Sensors
Wiring is a major concern with PLC applications, so to reduce the total number of wires, two wire sensors
have become popular.
But, by integrating three wires worth of function into two, we now couple the power supply and sensing
functions into one.
Two wire sensors are shown in Figure 1.8. 00 V+
Two wire V+
Power
Sensor supply
V- V-
PLC Input Card
for Sourcing Sensors 01
COM
+V
00
V+
PLC Input Card
for Sinking Sensors Two wire
Sensor V+
Power
01 V- supply
V-
Fig.1.8
A two wire sensor can be used as either a sourcing or sinking input.
In both of these arrangements the sensor will require a small amount of current to power the sensor, but
when active it will allow more current to flow.
This requires input cards that will allow a small amount of current to flow (called the leakage current), but
also be able to detect when the current has exceeded
5/29/2019 a given
Dessie Fentaw (DEC) value. 472
Sourcing and Sinking Schematic Symbols
When drawing wiring diagrams, the symbols in Figure 1.9 are used for
sinking and sourcing proximity sensors.
Notice that:
In the sinking sensor when the switch closes (moves up to the terminal) it
contacts the common.
Closing the switch in the sourcing sensor connects the output to the V+.
On the physical sensor the wires are color coded as indicated in the
diagram.
The brown wire is positive,
The blue wire is negative and
The output is white for sinking and black for sourcing.
The outside shape of the sensor may change for other devices, such
as photo sensors which are often
5/29/2019
shown as round circles.
Dessie Fentaw (DEC) 473
The Comparator (Schmitt trigger )
When the op-amp has one input sensor signal connected to its inverting input
terminal and a second input sensor signal connected to its noninverting input
terminal, it will compare the voltage level of the two inputs and the output will
be the amount of difference between the two signals multiplied by the gain.
Since the gain for this configuration is infinite, the slightest difference in voltage
between the two inputs will cause the output to be driven to its maximum value.
This maximum value is called saturation, and it will be approximately the full
amount of the power supply voltage.
If Vnonin signal > Vinv Signal, the Vo will be +ve saturation.
If Vinv Signal is larger, the Vo will be -ve saturation.
Fig.1.10 shows the modifications that can be made to the comparator circuit to
make the comparator a useful circuit (Schmitt trigger ).
5/29/2019 Dessie Fentaw (DEC) 474
For example;
R is connected in series with a cadmium sulfide cell (CdS cell) that is a light
sensor.
Which provide a voltage drop circuit that is connected to the noninverting
input.
And a reference voltage is applied to the inverting input through
potentiometer.
A diode and the coil of a control relay are connected in series with the
output terminal.
The diode will ensure that only +ve voltage will pass to the coil to energize
it.
If the pot is set to provide 5V to the inverting input,
the output will be –ve as long as the voltage supplied by the sensor to the
noninvrting terminal is < 5V.
As long as the output voltage is –ve , the diode will be reverse biased & no
current will flow to the relay coil.
If the light conditions change and the sensor’s resistance changes so
that the voltage drop ckt produces a voltage > 5V reference voltage,
The output will become +ve & the diode will be forward biased and allow
current to flow to the coil of the CR.
When current flows through the CR coil, it becomes magnetized and closes
the NO contacts.
5/29/2019 Dessie Fentaw (DEC) 475
PLC Functions
Ladder logic input contacts and output coils allow simple logical decisions.
However, Functions extend basic ladder logic to allow other types of
control.
• For example, the addition of timers and counters allowed event based
control.
Most of the functions will:
use PLC memory locations to get values, store values and track function status.
normally become active when the input is true. But, some functions, such as
TOF timers, can remain active when the input is off.
Hence, Basic PLC Function Categories as;
5/29/2019 Dessie Fentaw (DEC) 476
Combinatorial Logic Lists
(i.e. a form of digital logic, in w/h shift registers/stacks
the o/p states depend on the i/p Sequencers
states, but not on other factor.)
Program Control
relay contacts and coils
branching/looping
Event
Immediate inputs/outputs
Timer instructions
fault/interrupt detection
counter instructions
Input and Output
Data Handling
PID
Moves
Communications
Mathematics
High speed counters
Conversions
ASCII string functions
Numerical Logic
Boolean operations
Comparisons
5/29/2019 Dessie Fentaw (DEC) 477
Data Handling
Move Functions
There are two basic types of move functions;
MOV (value, destination) - moves a value from one location in memory and
place it in another memory location.
MVM (value, mask, destination) - moves a value to a memory location, but with
a mask to select specific bits.
5/29/2019 Dessie Fentaw (DEC) 478
Examples of the basic MOV are given as shown;
When A is true,
the MOV function moves a floating point
number from the source to the destination
address.
The data in the source address is left
unchanged.
When B is true,
the floating point number in the source will
be converted to an integer and stored in the
destination address in integer memory.
The floating point number will be rounded
up or down to the nearest integer.
When C is true,
the integer value of 123 will be placed in
the integer file N7:23.
5/29/2019 Dessie Fentaw (DEC) 479
Mathematical Functions
Mathematical functions will retrieve one or more values, perform an
operation and store the result in memory.
The Arithmetic Functions are:
ADD (value,value,destination) - add two values
SUB(value,value,destination) – subtract
MUL(value,value,destination) – multiply
DIV(value,value,destination) – divide
NEG(value,destination) - reverse sign from positive/negative
CLR(value) - clear the memory location
5/29/2019 Dessie Fentaw (DEC) 480
Consider an ADD function as shown;
That will retrieve values from N7:4 and F8:35, convert them both to the
type of the destination address, add the floating point numbers, and store
the result in F8:36.
The function has two sources labeled source A and source B.
5/29/2019 Dessie Fentaw (DEC) 481
An application of the arithmetic function is shown as;
Most of the operations provide the
results we would expect.
The second ADD function retrieves a value
from N7:3, adds 1 and overwrites the
source - this is normally known as an
increment operation.
The first DIV statement divides the integer
25 by 10, the result is rounded to the
nearest integer, in this case 3, and the
result is stored in N7:6.
The NEG instruction takes the new value of
-10, not the original value of 0, from N7:4
invert the sign and store it in N7:7.
5/29/2019 Dessie Fentaw (DEC) 482
A list of more advanced functions are given as:
ACS(value,destination) - inverse cosine
COS(value,destination) – cosine
ASN(value,destination) - inverse sine
SIN(value,destination) – sine
ATN(value,destination) - inverse tangent
TAN(value,destination) – tangent
XPY(value,value,destination) - X to the power of Y
LN(value,destination) - natural log
LOG(value,destination) - base 10 log
SQR(value,destination) - square root
CPT(destination,expression) - accept an expression and
perform a complex calculation.
5/29/2019 Dessie Fentaw (DEC) 483
An equation has been converted to ladder logic as;
Given
LN
– Assign A = F8:0 Source A F8:1
Destination F8:4
B = F8:1
C = F8:2 XPY
Source A 21.78
D = F8:3 Source B F8:2
Destination F8:5
The first step in the conversion is to convert
the variables in the equation to unused ACS
Source A F8:3
memory locations in the PLC. Destination F8:6
The equation can then be converted using MUL
the most nested calculations in the equation, Source A F8:5
Source B F8:6
such as the LN function. In this case the Destination F8:7
results of the LN function are stored in ADD
Source A F8:4
another memory location, to be recalled Source B F8:7
later. Destination F8:7
The other operations are implemented in a SQR
Source A F8:7
similar manner. Destination F8:0
5/29/2019 Dessie Fentaw (DEC) 484
• The same equation could have been implemented with a CPT function as
shown;
The equation uses the same memory locations chosen in the previous
logic diagram.
The expression is typed directly into the PLC programming software.
5/29/2019 Dessie Fentaw (DEC) 485
Conversions:
Ladder logic conversion functions are;
TOD(value,destination) - convert from BCD to 2s compliment
FRD(value,destination) - convert from 2s compliment to BCD
DEG(value,destination) - convert from radians to degrees
RAD(value,destination) - convert from degrees to radians
Examples of the conversion functions are given as shown;
5/29/2019 Dessie Fentaw (DEC)
The functions load in a source value, do the conversion, and store the results.486
FLOWCHART BASED DESIGN
Topics:
Describing process control using flowcharts
Conversion of flowcharts to ladder logic
A flowchart is ideal for a process that has sequential process steps.
The steps will be executed in a simple order that may change as the result of some simple
decisions.
The symbols used for flowcharts are shown in Figure 7.
5/29/2019 Dessie Fentaw (DEC) 487
These blocks are connected using arrows to indicate the
sequence of the steps.
The different blocks imply different types of program actions.
Programs always need a start block, but PLC programs rarely
stop so the stop block is rarely used.
Other important blocks include operations and decisions.
The other functions may be used but are not necessary for
most PLC applications.
Figure 7
Flowchart Symbols
5/29/2019 Dessie Fentaw (DEC) 488
The general method for constructing flowcharts is:
1. Understand the process.
2. Determine the major actions, these are drawn as blocks.
3. Determine the sequences of operations, these are drawn with arrows.
4. When the sequence may change use decision blocks for branching.
o Once a flowchart has been created ladder logic can be written.
There are two basic techniques that can be used,
the first presented uses blocks of ladder logic code.
The second uses normal ladder logic.
5/29/2019 Dessie Fentaw (DEC) 489
Example:
A flowchart is shown in Figure 8, for a control system for a large water tank.
Statement:
When a start button is pushed the tank will start to fill, and the flow out will be stopped.
When full, or the stop button is pushed the outlet will open up, and the flow in will be stopped.
In the flowchart the general flow of execution starts at the top.
The first operation is to open the outlet valve and close the inlet valve.
Next, a single decision block is used to wait for a button to be pushed.
when the button is pushed the yes branch is followed and the inlet valve is opened, and the outlet
valve is closed.
Then the flow chart goes into a loop that uses two decision blocks to wait until the tank is full, or the
stop button is pushed.
If either case occurs the inlet valve is closed and the outlet valve is opened.
The system then goes back to wait for the start button to be pushed again.
5/29/2019 Dessie Fentaw (DEC) 490
Figure 8
A Flowchart for a Tank Filler
5/29/2019 Dessie Fentaw (DEC) 491
BLOCK LOGIC METHOD
Step 1:
Add labels to each block (name each
block) in the flowchart, as shown in
Figure 9.
Each of the numbered steps will then be converted
to ladder logic
5/29/2019 Dessie Fentaw (DEC) Figure 9 492
Labeling Blocks in the Flowchart
Each block in the flowchart will be converted to a block of ladder logic.
To do this we will use the MCR (Master Control Relay) instruction.
The instruction is shown in Figure 10, and will appear as a matched pair of outputs labeled MCR.
If the first MCR line is true then the ladder logic on the following lines will be scanned as normal to
the second MCR.
If the first line is false the lines to the next MCR block will all be forced off.
If a normal output is used inside an MCR block, it may be forced off.
Therefore latches will be used in this method
Figure 10
5/29/2019 The MCR
DessieFunction
Fentaw (DEC) 493
STEP 2:
Write ladder logic to force the PLC into the first state
The first part of the ladder logic required will reset
the logic to an initial condition, as shown in Figure
11.
The line will only be true for the first scan of the PLC,
and
at that time it will turn on the flowchart block F1
which is the reset all values off operation.
All other operations will be turned off.
Figure 11
Initial Reset of States
5/29/2019 Dessie Fentaw (DEC) 494
STEP 3
Write ladder logic for each function in the flowchart
The ladder logic for the first state is shown in Figure 12.
When F1 is true the logic between the MCR lines will be
scanned,
if F1 is false the logic will be ignored.
This logic turns on the outlet valve and turns off the inlet
valve.
It then turns off operation F1, and turns on the next
operation F2.
Figure 12
5/29/2019 Ladder Logic for the Operation F1 495
Dessie Fentaw (DEC)
Cont…
The ladder logic for operation F2 is
simple, and
when the start button is pushed, it will
turn off F2 and turn on F3.
The ladder logic for operation F3 opens
the inlet valve and moves to operation
F4.
Figure 13
Ladder Logic for Flowchart Operations F2 and F3
5/29/2019 Dessie Fentaw (DEC) 496
Cont…
The ladder logic for operation F4 turns off
F4, and
if the tank is full it turns on F6,
otherwise F5 is turned on.
The ladder logic for operation F5 is very
similar.
Figure 14
5/29/2019 Ladder Logic for Operations F4 and497
Dessie Fentaw (DEC) F5
Cont…
The ladder logic for operation F6 turns
the outlet valve on and
turns off the inlet valve.
It then ends operation F6 and
returns to operation F2.
Figure 15
Ladder Logic for Flowchart Operation F6
5/29/2019 Dessie Fentaw (DEC) 498
SEQUENCE BITS
In general there is a preference for methods that
do not use MCR statements or latches.
The flowchart used in the previous example can
be implemented without these instructions using
the following method.
The first step to this process is shown in Figure
16.
As before each of the blocks in the flowchart are
labelled, but now the connecting arrows
(transitions) in the diagram must also be labelled.
These transitions indicate when another function
block will be activated.
Figure 16
5/29/2019 Dessie Fentaw (DEC) 499
Label the Flowchart Blocks and Arrows
The first section of ladder logic is
shown in Figure 17.
This indicates when the transitions
between functions should occur.
All of the logic for the transitions
should be kept together, and
appear before the state logic that
follows in Figure 17.
Figure 17
The Transition Logic
5/29/2019 Dessie Fentaw (DEC) 500
The logic shown in Figure 18
will keep a function on, or
switch to the next function.
Consider the first ladder rung for F1,
it will be turned on by transition T1 and
once function F1 is on it will keep itself on,
unless T2 occurs shutting it off.
If T2 has occurred the next line of ladder logic
will turn on F2.
The function logic is followed by output logic
that relates output values to the active
functions.
Figure 18
5/29/2019 Dessie Fentaw (DEC)The Function Logic and Outputs501
STATE BASED DESIGN
Topics:
Describing process control using state diagrams
Conversion of state diagrams to ladder logic
A system state is a mode of operation.
Consider a bank machine that will go through very carefully selected states.
The general sequence of states might be idle, scan card, get secret number, select
transaction type, ask for amount of cash, count cash, deliver cash/return card, then idle.
5/29/2019 Dessie Fentaw (DEC) 502
A State based system can be described with system
states, and the transitions between those states.
A state diagram is shown in Figure 19.
The diagram has two states, State 1 and State 2.
If the system is in state 1 and A happens the system
will then go into state 2,
otherwise it will remain in State 1.
Likewise
if the system is in state 2, and B happens the system
will return to state 1.
As shown in the figure this state diagram could be
used for an automatic light controller.
Figure 19
A State Diagram
5/29/2019 Dessie Fentaw (DEC) 503
Consider the design of a coffee vending machine.
The first step requires the identification of vending machine
states as shown:
STATES
o idle - the machine has no coins and is doing nothing
o inserting coins - coins have been entered and the total is
displayed
o user choose - enough money has been entered and the user
is making coffee selection
o make coffee - the selected type is being made
o service needed - the machine is out of coffee, cups, or
another error has occurred
5/29/2019 Dessie Fentaw (DEC) 504
The states are then drawn in a state diagram as shown in Figure 20.
Transitions are added as needed between the states.
Here we can see that when powered up the machine will start in an idle state.
The transitions here are based on the inputs and sensors in the vending machine.
5/29/2019
Figure 20 Dessie Fentaw (DEC) 505
State Diagram for a Coffee Machine
State Diagram Example
Consider the traffic lights in Figure 21.
The normal sequences for traffic lights are
a green light in one direction for a long period of
time, typically 10 or more seconds.
This is followed by a brief yellow light, typically 4
seconds.
It is understood that a green or yellow light in one
direction implies a red light in the other direction.
Pedestrian buttons are provided so that when
pedestrians are present a cross walk light can be
turned on and the duration of the green light Figure 21
increased.
Traffic Lights
5/29/2019 Dessie Fentaw (DEC) 506
The first step for developing a controller is to define the inputs and outputs of the system as shown.
The inputs are used when defining the transitions.
The outputs can be used to define the system state.
Use a state table as shown in Figure 22.
Here the light sequences are listed in order.
5/29/2019 Figure 22 Dessie Fentaw (DEC) 507
System State Table for Traffic Lights
Transitions can be added to the state table to clarify the operation, as shown in Figure 23.
Here the transition from Green E/W to Yellow E/W is S1.
• this means is that a cross walk button must be pushed to end the green light. This is not normal,
normally the lights would use a delay.
The transition from Yellow E/W to Green N/S is caused by a 4 second delay (this is normal.)
The next transition is also abnormal, requiring that the cross walk button be pushed to end the Green
N/S state.
The last state has a 4 second delay before returning to the first state in the table.
Figure 23
State Table with Transitions
5/29/2019 Dessie Fentaw (DEC) 508
A state diagram for the system is shown in Figure 24.
This diagram is equivalent to the state table in Figure 23, but it can be valuable for doing
visual inspection.
Figure 24
A Traffic Light State Diagram
5/29/2019 Dessie Fentaw (DEC) 509
Conversion to Ladder Logic
Block Logic Conversion
State diagrams can be converted directly to ladder logic using block logic.
This technique will produce larger programs, but it is a simple method to understand, and easy to debug.
The traffic light example is to be implemented in ladder logic.
The inputs and outputs are defined in Figure 25.
first scan is the address of the first scan in the PLC.
The locations B3/1 to B3/4 are internal memory locations that will be used to track which states are on.
5/29/2019 Figure 25 Dessie Fentaw (DEC) 510
Inputs and Outputs for Traffic Light Controller
The initial ladder logic block shown in Figure 26
will initialize the states of the PLC,
so that only state 1 is on.
The first scan indicator first scan will execute the
MCR block when the PLC is first turned on, and
the latches will turn on the value for state 1 B3/1
and turn off the others.
Figure 26
Ladder Logic to Initialize Traffic Light Controller
5/29/2019 Dessie Fentaw (DEC) 511
Figure 27
General Output Control Logic
5/29/2019 Dessie Fentaw (DEC) 512
The first state is implemented in Figure 28. If state 1 is active this will be active.
The transition is S1 or I/1 which will end state 1 B3/1 and start state 2 B3/2.
Figure 28
Ladder Logic for First State
5/29/2019 Dessie Fentaw (DEC) 513
The second state is more complex because it involves a time delay, as shown in Figure 29.
When the state is active the RTO timer will be timing.
When the timer is done state 2 will be unlatched, and state 3 will be latched on.
The timer is retentive, so it must also be reset when the state is done, so that it will start at zero the next
time the state starts.
5/29/2019 Figure 29 Dessie Fentaw (DEC) 514
Ladder Logic for Second State
The third and fourth states are shown in Figure 30 and Figure 31.
Their layout is very similar to that of the first two states.
Figure 30
Ladder Logic for State Three
Figure 31
Ladder Logic for State Four
5/29/2019 Dessie Fentaw (DEC) 515
Chapter Five
Introduction to fuzzy logic
Instructor Dessie Fentaw
5/29/2019 dessie F 516
Introduction
Fuzzy logic is a form of many-valued logic that deals with approximate, rather
than fixed and exact reasoning.
Compared to traditional binary logic (where variables may take on true or false
values), fuzzy logic variables may have a truth value that ranges in degree
between 0 and 1.
Fuzzy logic has been extended to handle the concept of partial truth, where the
truth value may range between completely true and completely false.
Furthermore, when linguistic variables are used, these degrees may be managed
by specific functions.
The term "fuzzy logic" was introduced with the 1965 proposal of fuzzy set
theory by Lotfi A. Zadeh. Fuzzy logic has been applied to many fields,
from control theory to artificial intelligence.
5/29/2019 dessie F 517
Introduction
Fuzzy logic is a superset of conventional (Boolean) logic that has been
extended to handle the concept of partial truth ,truth values between
"completely true" and "completely false.
Zadeh says that rather than regarding fuzzy theory as a single theory, we
should regard the process of ``fuzzification'' as a methodology to generalize
any specific theory from a crisp (discrete) to a continuous (fuzzy) form .
Just as there is a strong relationship between Boolean logic and the concept of
a subset, there is a similar strong relationship between fuzzy logic and fuzzy
subset theory.
5/29/2019 dessie F 518
Introduction
In classical set theory, a subset U of a set S can be defined as a
mapping from the elements of S to the elements of the set {0, 1},
U: S --> {0, 1}
This mapping may be represented as a set of ordered pairs, with
exactly one ordered pair present for each element of S.
The first element of the ordered pair is an element of the set S, and
the second element is an element of the set {0, 1}.
The value zero is used to represent non-membership, and the value
one is used to represent membership.
The truth or falsity of the statement.
5/29/2019 dessie F 519
Introduction
x is in U
is determined by finding the ordered pair whose first element is x. The
statement is true if the second element of the ordered pair is 1, and the statement
is false if it is 0.
Similarly, a fuzzy subset F of a set S can be defined as a set of ordered pairs,
each with the first element from S, and the second element from the interval
[0,1], with exactly one ordered pair present for each element of S.
This defines a mapping between elements of the set S and
values in the interval [0,1].
The value zero is used to represent complete non-membership, the value one is
used to represent complete membership, and values in between are used to
represent intermediate DEGREES OF MEMBERSHIP.
5/29/2019 dessie F 520
Introduction
The set S is referred to as the UNIVERSE OF DISCOURSE for the fuzzy subset
F. Frequently, the mapping is described as a function, the MEMBERSHIP
FUNCTION of F. The degree to which the statement
x is in F
is true is determined by finding the ordered pair whose first element is x.
The DEGREE OF TRUTH of the statement is the second element of the
ordered pair.
In practice, the terms "membership function" and fuzzy subset get used
interchangeably.
5/29/2019 dessie F 521
fuzzy logic system
A fuzzy logic system (FLS) can be defend as the nonlinear mapping of
an input data set to a scalar output data .
A FLS consists of four main parts:
fuzzifier
rules
inference engine, and
defuzzifier.
These components and the general architecture of a FLS is shown in
Figure below.
5/29/2019 dessie F 522
fuzzy logic system
Figure 1 A Fuzzy Logic System
5/29/2019 dessie F 523
fuzzy logic system
The process of fuzzy logic is explained in Algorithm
Fuzzy logic algorithm
1. Define the linguistic variables and terms (initialization)
2. Construct the membership functions (initialization)
3. Construct the rule base (initialization)
4. Convert crisp input data to fuzzy values
using the membership functions (fuzzification)
5. Evaluate the rules in the rule base (inference)
6. Combine the results of each rule (inference)
7. Convert the output data to non-fuzzy values (defuzzification)
5/29/2019 dessie F 524
fuzzy logic system
Firstly, a crisp set of input data are gathered and converted to a
fuzzy set using fuzzy linguistic variables, fuzzy linguistic
terms and membership functions.
This step is known as fuzzification. Afterwards, an inference
is made based on a set of rules.
Lastly, the resulting fuzzy output is mapped to a crisp output
using the membership functions, in the defuzzification step.
5/29/2019 dessie F 525
fuzzy logic system
In order to exemplify the usage of a FLS, consider an air
conditioner system controlled by a FLS shown below
The system adjusts the temperature of the room according to the
current temperature of the room and the target value.
The fuzzy engine periodically compares the room temperature
and the target temperature, and produces a command to heat or
cool the room.
5/29/2019 dessie F 526
fuzzy logic system
Figure 2 : A Simple FLS to Control an Air Conditioner.
5/29/2019 dessie F 527
Linguistic Variables
Linguistic variables are the input or output variables of the system whose values
are words or sentences from a natural language, instead of numerical values. A
linguistic variable is generally decomposed into a set of linguistic terms.
Example: Consider the air conditioner in Figure 2. Let temperature (t) is the
linguistic variable which represents the temperature of a room.
To qualify the temperature, terms such as \hot" and \cold" are used in real life.
These are the linguistic values of the temperature. Then,
T(t) = (too-cold, cold, warm, hot, too-hot) can be the set of decompositions for
the linguistic variable temperature.
Each member of this decomposition is called a linguistic term and can cover a
portion of the overall values of the temperature.
5/29/2019 dessie F 528
Membership Functions
Membership functions are used in the fuzzification and defuzzification steps
of a FLS, to map the non-fuzzy input values to fuzzy linguistic terms and vice
versa.
A membership function is used to quantify a linguistic term. For instance,
in Figure 3, membership functions for the linguistic terms of temperature
variable are plotted.
Note that, an important characteristic of fuzzy logic is that a numerical value
does not have to be fuzzified using only one membership function.
In other words, a value can belong to multiple sets at the same time. For
example, according to Figure 3, a temperature value can be considered as
“cold" and “too-cold" at the same time, with different degree of memberships.
5/29/2019 dessie F 529
Membership Functions
Figure 3: Membership Functions for T(temperature) = {too-cold, cold, warm,
hot, too-hot}.
5/29/2019 dessie F 530
Fuzzy Rules
In a FLS, a rule base is constructed to control the output variable. A fuzzy
rule is a simple IF-THEN rule with a condition and a conclusion.
In Table 1,sample fuzzy rules for the air conditioner system in Figure 2 are
listed.
Table 2 shows the matrix representation of the fuzzy rules for the said FLS.
Row captions in the matrix contain the values that current room temperature
can take, column captions contain the values for target temperature, and each
cell is the resulting command when the input variables take the values in that
row and column.
For instance, the cell (3, 4) in the matrix can be read as follows: If
temperature is cold and target is warm then command is heat.
5/29/2019 dessie F 531
Fuzzy Rules
5/29/2019 dessie F 532
Inference
Fuzzy inference is the process of formulating the mapping
from a given input to an output using fuzzy logic.
The mapping then provides a basis from which decisions
can be made.
THANKYOU !!!
5/29/2019 dessie F 533