Process Control
Process Control
Process Control
EL-4612 (4-3-2 )
PRE-REQUISITE EP-4211,EL-4231
CHAPTER ONE
Process control fundamentals
Instructor : Dessie Fentaw(Capt.) 2018
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.
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
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.
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.
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.
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.
1.5 SUMMARY
Steam
Process
fluid
Ti(t) T(t)
T
Condensate
return
Process
fluid
Ti(t) T(t)
T
Condensate
return
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
controller fluid
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
possible disturbances.
Transmitter
Inlet process temperature Process TT
Ti(t), the process flow f(t), fluid
Points:
Points:
• How it works?
TEMPERATURE
of the decrease in inlet temperature, but then it
INLET
increases, even above the set point and
TIME
TEMPERATURE
OUTLET
This oscillatory response is typical of feedback
control and shows that it is essentially a trial and TIME
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
Points:
• How it works?
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
Feedforward
In this example, The feedforward controller
TT
of the other disturbances enter
the process, this strategy will not f(t) Ti(t) T(t)
set point. T
Condensation
retun
Washing machine
Feedforward
Oven control system
Microwave oven
Feedback
Air conditioner control system
?:
How to choose a proper control system?
• Low cost
In this example, TC
SP
Feedforward control
+
now compensate for Feedforward
controller
the “major” +
disturbance;
Steam
feedback control
compensate for all TT
TT
T
Condensation
retun
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
• Voltmeters
• Digital Multimeters
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
• Converters
– Flash ADC
– Delta-Sigma ADC
– Dual Slope (integrating) ADC
– Successive Approximation ADC
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
Advantages Disadvantages
• No precision external
components needed
0 5 10 15 20 25
Resolution (Bits)
• 10 bit resolution or
0.0009765625V of Vref
• Vin= .6 volts
• Vref=1volts
• Find the digital value of
Vin
Final
Control
Element
Process
Current-to-voltage conversion
For example
pneumatically
hydraulically controlled
• For example
Flow Valve
Temperature Heater
Digital signal
Switching devices
Controlling devices
GTO
TRIAC
P I 2 Ron
5/29/2019 Dessie Fentaw 225
Application of SCR is shown below
Power MOSFET
IGBT
Solenoid
Electrical motor
i. DC motor
ii. AC motor
• Push • Rotary
• Pull • Open
• Clapper • Closed
Push Solenoids
• Force is Directed AWAY
from Solenoid
• Characteristics
– Strokes from 5° to 90°
– As Stroke Increases
Starting Torque
http://www.camdec.com
http://www.gwlisk.com
http://www.ledex.com
http://www.ramcompany.com
http://www.takaha.com
Series field
Shunt field
Compound
120 f
ns (rpm)
p
Q K p
K proportionality constant m3 / s/Pa1/2
p p2 p1 pressure difference (Pa)
Q Qmin RS / Smax
Process equation
Dynamic behavior of 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
Process Lag
The time delay that process responds to the load change
e r b
e error
b measured indication of variable
r setpoint of variable (reference)
r b
ep 100
bmax bmin
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
Example,
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
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
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
p K F t p(0) e p e p
p(0) controller output at t=0
From r b
ep 100
bmax bmin
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%
t
p(t ) K I e p dt p (0)
0
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
PD
PID
where
PI (0) integral term at t = 0
One-to-One correspondence
Eliminate offset
de p
p K Pep K P K D p0
dt
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.
A two position controller with neutral zone made from op amps and a comparator.
V1 = Vin
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
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.
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.
where, the input voltage has been set equal to the controller error voltage.
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.
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.
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
The zero error term of the proportional mode is not necessary because
the integral automatically accommodates for offset and nominal setting.
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).
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.
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.
PLCs have been gaining popularity on the factory floor and will probably remain
predominant for some time to come.
Flexible and can be reapplied to control other systems quickly and easily.
Reliable components make these likely to operate for years before failure.
The CPU, which controls all PLC activity, can further be broken down into:
memory system.
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
Features
Features
It is much simpler to change program then wiring!
Inputs
Push buttons
Sensors
.....
Relay contacts
Solenoid valves
Signal devices (such as lamps, alarms, etc.)
Motors
...
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.
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.
outputs, and
the logic.
Note:
Notice that;
but the ladder logic inside the PLC has one normally
open contact, and one normally closed contact. Figure 3
A PLC Illustrated With Relays
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.
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,
They are "optically" separated, or in other words, signal is transmitted through light.
a CPU sees this as logic zero (supply between collector and transmitter falls under 1V)
thus the voltage between collector and emitter falls to 0.7V , and
Inversely it means that a signal at the output exists and is interpreted as logic one.
Mentioning is that sinking-sourcing and sourcing - sinking pairing is always used, and not
sourcing-sourcing or sinking-sinking pairing.
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".
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.
+ 01
24 V dc
Power 02
Supply
- 03
V+
04
Relay 05
Sensor output
06
V-
07
COM
Fig.1.1
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.
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 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.
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.
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.
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).
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
+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.
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.
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.
COM
+V
00
V+
PLC Input Card
for Sinking Sensors Two wire
Sensor V+
Power
01 V- supply
V-
Fig.1.8
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.
• For example, the addition of timers and counters allowed event based
control.
normally become active when the input is true. But, some functions, such as
TOF timers, can remain active when the input is off.
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.
When A is true,
the MOV function moves a floating point
number from the source to the destination
address.
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.
When C is true,
the integer value of 123 will be placed in
the integer file N7:23.
SUB(value,value,destination) – subtract
MUL(value,value,destination) – multiply
DIV(value,value,destination) – divide
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.
COS(value,destination) – cosine
SIN(value,destination) – sine
TAN(value,destination) – tangent
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 equation uses the same memory locations chosen in the previous
logic diagram.
Topics:
The steps will be executed in a simple order that may change as the result of some simple
decisions.
The other functions may be used but are not necessary for
most PLC applications.
Figure 7
Flowchart Symbols
4. When the sequence may change use decision blocks for branching.
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.
The first operation is to open the outlet valve and close the inlet valve.
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.
Step 1:
Add labels to each block (name each
block) in the flowchart, as shown in
Figure 9.
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.
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 line will only be true for the first scan of the PLC,
and
Figure 11
Initial Reset of States
The ladder logic for the first state is shown in Figure 12.
This logic turns on the outlet valve and turns off the inlet
valve.
Figure 12
5/29/2019 Ladder Logic for the Operation F1 495
Dessie Fentaw (DEC)
Cont…
Figure 13
Ladder Logic for Flowchart Operations F2 and F3
5/29/2019 Dessie Fentaw (DEC) 496
Cont…
F4, and
similar.
Figure 14
5/29/2019 Ladder Logic for Operations F4 and497
Dessie Fentaw (DEC) F5
Cont…
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.
Figure 16
5/29/2019 Dessie Fentaw (DEC) 499
Label the Flowchart Blocks and Arrows
The first section of ladder logic is
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
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.
Likewise
Figure 19
A State Diagram
5/29/2019 Dessie Fentaw (DEC) 503
Consider the design of a coffee vending machine.
STATES
o user choose - enough money has been entered and the user
is making coffee selection
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.
• 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
This technique will produce larger programs, but it is a simple method to understand, and easy to debug.
The locations B3/1 to B3/4 are internal memory locations that will be used to track which states are on.
Figure 26
Ladder Logic to Initialize Traffic Light Controller
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
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.
Figure 30
Ladder Logic for State Three
Figure 31
Ladder Logic for State Four
U: S --> {0, 1}
x is in F
THANKYOU !!!