You are on page 1of 7

22/10/2021

Control System Technology 1 Programmable Logic Controllers Control System Technology 2 Programmable Logic Controllers

Objectives
To introduce programmable logic controllers
After completing this chapter, students will be able to
1.Describe the following parts of PLC: power supply, processor,
input module, output module and programming unit

12. Programmable Logic


2.Describe the step-by-step operation of a PLC as it runs a small
ladder diagram program
3.Draw a PLC input/output diagram
Controllers 4.Draw a PLC ladder diagram program
5.Use timing functions in a PLC program
6.Use counter functions in a PLC program
7.Use sequencer functions in a PLC program

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 3 Programmable Logic Controllers Control System Technology 4 Programmable Logic Controllers

§1.Introduction §1.Introduction
- PLC is a digital electronic device designed to control machines - PLC is a digital electronic device designed to control machines
and processes by performing event-driven and time-driven and processes by performing event-driven and time-driven
sequential operations sequential operations
- PLC can be programmed without special programming skills, - PLC can be programmed without special programming skills,
and it can be maintained by factory maintenance technicians and it can be maintained by factory maintenance technicians
- The Hydramatic Division, General Motors Corporation specified - The Hydramatic Division, General Motors Corporation specified
the design criteria for the first programmable logic controller in the design criteria for the first programmable logic controller in
1968 1968
- PLCs now include modules that perform - PLCs now include modules that can
• functions such as logic, timing, counting, sequencing, PID • perform functions such as logic, timing, counting, sequencing,
control, and fuzzy logic PID control, and fuzzy logic
• arithmetic operations, analyze data • perform arithmetic operations, analyze data
communicate with other programmable controllers and host • communicate with other programmable controllers and host
computers. Some advantages of PLCs include computers
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 5 Programmable Logic Controllers Control System Technology 6 Programmable Logic Controllers

§1.Introduction §2.PLC Hardware


- Advantages of PLCs - Five functional components found in all PLCs, and two others
• Flexibility: PLC can handle many different operations, (6 and 7) found in some ones
and software changes are easier to implement 1.Power supply 2.Processor module 3.Input modules
than hardware changes 4.Output modules 5.Programming unit
• Reliability: Solid-state devices are more reliable and 6.PID controller unit 7.Data communication unit
easier to maintain than mechanical relays and Processor mudule PID control module Data communication module
Input and output modules
timers
POWER PROCESSOR 8 8 8 8 4 2 PID
• Lower cost:
DATA
PLCs benefit from the ability of computer SUPPLY MODULE DC
INPUTS
DC
OUTPUTS
AC
INPUTS
AC ANALOG ANALOG
OUTPUTS INPUTS OUTPUTS
COMM.

RUN 1 2 1 2 1 2 1 2 1 1
systems to deliver increasingly complex AC ON SCAN
3
5
4
6
3
5
4
6
3
5
4
6
3
5
4
6
2
3
2 PV1 PV2
7 8 7 8 7 8 7 8 4
functions at diminishing cost dC ON
FAULT OUT1 OUT2

• Documentation:PLC programming equipment can provide an


immediate printout of the current control circuit.
Writing access panels
There is no need for drawings that become Components in a PLC: a power supply, a processor module,
outdated as the control circuit is modified input modules, output modules, and a programming unit

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

1
22/10/2021

Control System Technology 7 Programmable Logic Controllers Control System Technology 8 Programmable Logic Controllers

§2.PLC Hardware §2.PLC Hardware


Power Supply Processor Module
A PLC actually requires two power supplies Processor module = central processing unit (CPU)
• 120/240𝑉 ac power CPU = a microprocessor + a read-only memory unit (ROM) +
• dc power a random access memory unit (RAM) + an I/O interface
ROM: information stored in ROM is permanent
RAM: information stored in RAM is temporary
PLC operating system (OS) is stored in ROM
The data used by the PLC is stored in RAM

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 9 Programmable Logic Controllers Control System Technology 10 Programmable Logic Controllers

§2.PLC Hardware §2.PLC Hardware


Processor Module Input Modules
The processor has two operating modes Two types of input modules: discrete, analog. The majority of
• PROGRAM: processor allows to make changes in the program inputs to a PLC are of the discrete type, bringing open and
• RUN: processor repeats the following four-step cycle under the closed inputs from pushbutton contacts, limit switches, pressure
control of the operating system: switches, …
A typical input module has 4/8/16/32 input terminals, plus a
- Input scan: store a new image of input conditions
common terminal (L2), and a ground terminal
- Program scan: derive the new image of output conditions
Input module converts each input into a logic level voltage
- Output scan: transfer the new image of output
• convert an open contact into a logic 0 voltage (0𝑉)
conditions to output devices
- Housekeeping tasks: communication and other tasks • convert a closed contact into a logic 1 voltage (5𝑉)
When the processor scans the inputs → reads logic levels of all
inputs and stores logic levels in the input image section of RAM
Inputs of analog signals are used for control and data acquisition
→ process variables must be converted to a digital form
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 11 Programmable Logic Controllers Control System Technology 12 Programmable Logic Controllers

§2.PLC Hardware §2.PLC Hardware


Output Modules PID and Communications Modules
Discrete output modules provide ON/OFF signals to operate - The PID module provides three-mode control of two process
lamps, relays, solenoids, motor starters, … variables
When the processor scans the output image section of RAM, a - The communications module provides direct communication
logic 1 results in an ON signal to the output device, and a logic 0 with the operator, a programming terminal, other PLCs or a
results in an OFF signal. Triacs or relays are used to control ac supervisory computer
output devices, and transistors or relays are used to control dc
output devices. A typical output module has 4/8/16/32 output
terminals, plus a hot terminal (L1) and a ground terminal
Analog outputs require 8 to 16 bits from the output image section
of memory. A digital-to-analog converter converts the binary
number stored in the output image into an analog voltage (or
current) between one output terminal and the common terminal

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

2
22/10/2021

Control System Technology 13 Programmable Logic Controllers Control System Technology 14 Programmable Logic Controllers

§2.PLC Hardware §3.PLC Programming and Operation


Programming Unit Ladder Diagram Programming
L1 L2 IM:1 OM:1 L1 L2
The programming unit enables the operator to enter a new start L2
PROCESSOR
L1
Sol a
air cylinder with spring return
program, examine the program in memory, change the program 1LS stop
1
2
1
2
light
0 1 1 0
LS1 L
in memory, monitor the status of inputs or outputs, display the light L SW1
3
input image status
3
Sol a 4 4
contents of registers, and display timer and counter values air supply line exhaust line Gnd Gnd
2-position, 3-way valve SW1 input output
Programming devices include hand-held programmers, CRT a. Schematic diagram
module
0 0
module
L1 L2 output image status
terminals, and personal computers (with special software) start
stop
c. PLC input/output diagram
CR1
LS1 L1 L2
start stop LS1 Sol a
CR1
IM:1-1 IM:1-2 IM:1-3 OM:1-1
CR1 Sol a
OM:1-1 SW1 light

SW1
L
IM:1-4 OM:1-2
light
b. Ladder diagram d. PLC program (ladder diagram language)

PLC implementation of a ladler diagram control circuit for a pneumatic cylinder. Observe
the use of a NC stop pushbutton in the input diagram with a NO contact symbol in the
PLC program to implement the NC stop function

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 15 Programmable Logic Controllers Control System Technology 16 Programmable Logic Controllers

§3.PLC Programming and Operation §3.PLC Programming and Operation


Ladder Diagram Programming (LD programming) Ladder Diagram Programming (LD programming)
The LD language places a number of restrictions on ladder L1 L2 IM:1 L1 L2 L1 IM:2 L1 L2
PB1 PB3
diagram programs, and the restrictions vary with different L2
1
PB1
3
PB3

manufacturers. Typical limitations include the following IM:2-1 OM:2-1 IM:2-3 OM:2-3
PB2 PB2 PB4 PB4

• The output must be at the right end of the rung 2


IM:2-2 OM:2-2
4
IM:2-4 OM:2-4

• Power must flow from left to right, up, or down a. Two ways to implement a NO switching function
Output OM:2-1 is OFF when PB1 is not pressed and ON when PB1 is pressed
b. Two ways to implement a NC switching function
Output OM:2-3 is ON when PO3 is not pressed and OFF when PB3 is pressed
Output OM:2-2 is OFF when PB2 is not pressed and ON when PB2 is pressed Output OM:2-4 is ON when PB4 is not pressed and OFF when PB4 is pressed

• Power must never flow from right to left Two ways to implement a NO switch and two ways to implement a NC switch. Observe
• The number of series contacts is limited to 11 (or some other the double negative effect in PB2; it causes the NC switch, PB2, to behave like a NO
switch. Also note that both methods of implementing a NC switch involve use of a single
number set by the manufacturer) negative
• The number of parallel contacts is limited to 7 (or some other
number set by the manufacturer)
• A rung can have only one output
• The single output must be on the top line in a rung

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 17 Programmable Logic Controllers Control System Technology 18 Programmable Logic Controllers

§3.PLC Programming and Operation §3.PLC Programming and Operation


PLC Operation PLC Operation
In the RUN mode, PLC repeats the following four-step cycle: In the RUN mode, PLC repeats the following four-step cycle:
input scan, program scan, output scan, and housekeeping tasks input scan, program scan, output scan, and housekeeping tasks
Cycle 1 START and SW1 are open, STOP and LS1 are closed Cycle 2 START, SW1, STOP, and LS1 are all closed
Input scan new input image Input scan new input image
IM:1-1= 0, IM:1-2= 1, IM:1-3= 1, IM:1-4= 0 IM:1-1= 1, IM:1-2= 1, IM:1-3= 1, IM:1-4= 1
Program scan Rung 1:lM:1-1 = FALSE , OM:1-1 = FALSE , Program scan Rung 1:lM:1-1 = TRUE , OM:1-1 = FALSE ,
L1
start stop LS1 Sol a
L2
IM:1-2= TRUE, IM:1-3= TRUE, path L1
start stop LS1 Sol a
L2
IM:1-2= TRUE, IM:1-3= TRUE, path
IM:1-1 IM:1-2 IM:1-3 OM:1-1 is FALSE, 0 is stored in cell OM:1-1 IM:1-1 IM:1-2 IM:1-3 OM:1-1 is TRUE, 1 is stored in cell OM:1-2
OM:1-1 SW1 light
Rung 2:lM:1-4= FALSE, 0 is stored in cell OM:1-1 SW1 light
Rung 2:lM:1-4= TRUE , 1 is stored in cell
IM:1-4 OM:1-2
PLC program (ladder diagram language)
OM:1-2 IM:1-4 OM:1-2
PLC program (ladder diagram language)
OM:1-2
Output scan Both solenoid a and the light are OFF Output scan Both Sol a and the light are ON

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

3
22/10/2021

Control System Technology 19 Programmable Logic Controllers Control System Technology 20 Programmable Logic Controllers

§3.PLC Programming and Operation §3.PLC Programming and Operation


PLC Operation PLC Operation
In the RUN mode, PLC repeats the following four-step cycle: In the RUN mode, PLC repeats the following four-step cycle:
input scan, program scan, output scan, and housekeeping tasks input scan, program scan, output scan, and housekeeping tasks
Cycle 3 START is open, SW1, STOP, and LS1 are all closed Cycle 4 START and LS1 are open, STOP and SW1 are closed
Input scan new input image Input scan new input image
IM:1-1= 0, IM:1-2= 1, IM:1-3= 1, IM:1-4= 1 IM:1-1= 0, IM:1-2= 1, IM:1-3= 0, IM:1-4= 1
Program scan Rung 1:lM:1-1 = FALSE , OM:1-1 = TRUE , Program scan Rung 1:lM:1-1 = FALSE , OM:1-1 = TRUE ,
L1
start stop LS1 Sol a
L2
IM:1-2= TRUE, IM:1-3= TRUE, path L1
start stop LS1 Sol a
L2
IM:1-2 = TRUE , IM:1-3 = FALSE ,
IM:1-1 IM:1-2 IM:1-3 OM:1-1 is TRUE, 1 is stored in cell OM:1-1 IM:1-1 IM:1-2 IM:1-3 OM:1-1 path is FALSE, 0 is stored in cell
OM:1-1 SW1 light
Rung 2:lM:1-4= TRUE , 1 is stored in cell OM:1-1 SW1 light OM:1-1
IM:1-4 OM:1-2
PLC program (ladder diagram language)
OM:1-2 IM:1-4 OM:1-2
PLC program (ladder diagram language)
Rung 2:lM:1-4= TRUE , 1 is stored in cell
Output scan Both Sol a and the light are ON OM:1-2
Output scan Both Sol a is OFF, the light are ON

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 21 Programmable Logic Controllers Control System Technology 22 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


Timer Function Timer Function
- The Timer is the most frequently used PLC function, and Time - Two types of timers are used in PLCs
Delay On is the most common timing function. Both Time Delay • one-input nonretentive timer (one input, one output, and a
On and Time Delay Off are used in PLCs. Our discussion will preset delay time)
focus on Time Delay On • two-input retentive timer (two inputs, one output, and two
L1 L2
L1
PLC O.L.
L2 start stop pump motor status bits that can be used as internal outputs)
IM:1-1 OM:1-1 M IM:1-1 IM:1-2 OM:1-1
start
pump motor
up OM:1-1
IM:1-2 OM:1-2
stop Sol. a pump motor up Not Sol. b Sol. a
down
IM:1-3 OM:1-3 OM:1-1 IM:1-3 OM:1-3 OM:1-2
up Sol. b
pump motor down Not Sol. a Sol. b
IM:1-4 OM:1-4
down OM:1-1 IM:1-4 OM:1-2 OM:1-3
a. PLC input/output diagram b. PLC lader diagram program

The input/output diagram and the LD program of a PLC used to control the hydraulic
hoist. Observe the use of a NO stop pushbutton in the input diagram with a NC contact
symbol in the PLC program to implement the NC stop function

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 23 Programmable Logic Controllers Control System Technology 24 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


Timer Function - Ex.12.1: The batch blending process is to be controlled by a
L1 L2
start stop LS1 Sol a Time/event-driven sequential control system
Sol. a Sol. b
IM:1-1 IM:1-2 IM:1-3 OM:1-1 water syrup Initial conditions drain valve open, water and
OM:1-1 SW1 light
LL3 syrup valves closed, mixer OFF, tank empty.
IM:1-4 OM:1-2
PLC program (ladder diagram language)
LL2 Sol. c The design criteria specifies five-step process
A generic two-input, retentive timer and a drain
L1
IM:1-5 Done
L2
typical timing diagram. The timer is shown with
LL1
STEP 1: fill the tank with water to level of LL2
Enable/ CYCLE ON
D
Reset
T:12
the output address T:12. In the timing diagram, Begins when START is pressed and ends when
L
IM:1-9 Enable
Enable/Reset, and Run are inputs. T:12, T:12- START
Run TIMER E
T:12E E, and T:12-R are outputs. Observe that the PB
the liquid level switch LL2 closes
Run
Preset R timing diagrams of T:12-E and Enable/Reset STEP 2: add syrup to the level of switch LL3
Delay (min or sec) T:12R
match exactly, but the diagrams of T:12-R and
Typical timing diagram
Run do not. Output T:12-R is ON only when and begin mixing the two ingredients
Enable/Reset Enable/Reset is ON. Run input is ON, and Begins when LL2 closes and ends when LL3
Run
Done is OFF, Output T:12 (Done) is ON only
T:12E
after the preset time delay has been reached, closes. When STEP 2 is done, the mixture in
T:12R
T:12 and it goes OFF when Enable/Reset goes OFF the tank will be 60% water and 40% syrup

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

4
22/10/2021

Control System Technology 25 Programmable Logic Controllers Control System Technology 26 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


L1 L2
START LL1 CYCLE ON
1

- Ex.12.1: The batch blending process is to be controlled by a The PLC program consists of six rungs IM:1-1 IM:1-2 OM:1-4

Time/event-driven sequential control system • Rung 1 turns ON output OM:1-4 (CYCLE CYCLE OM:1-4 T:4
Sol. a Sol. b ON Sol. c
water syrup STEP 3: finish mixing the two ingredients ON light) when START is pressed and 2 OM:1-4 T:4 OM:1-3

LL3 Begins when LL3 closes and ends 5𝑚𝑖𝑛 later keeps it ON until the tank is empty at the 3 CYCLE ON LL2 Done Sol. a
LL2 Sol. c
STEP 4: drain the mixture from the tank end of STEP 5. Initially, the true path is OM:1-4 IM:1-3
LL2 LL3
T:4
Done
OM:1-1
Sol. b
drain
LL1 through the normally closed T:4 contact. 4 IM:1-3 IM:1-4 T:4 OM:1-2
CYCLE ON
Begins when STEP 3 is done and ends when In STEP 4, the true path is through the 5 Done
TIMER
L switch LL1 opens normally open LL1 contact OM:1-4
Enable/Reset D
T:4
START Enable
PB STEP 5: maintain the initial conditions • Rung 2 closes the normally open drain IM:1-4
Run E
T:4-E
Run
Begins when LL1 opens and ends when valve when OM:1-4 is ON and before Preset
5 min
R
T:4-R

START is pressed to begin another batch timer T:4 is done 6


Sol. b Mixer

OM:1-2 OM:1-5
Draw a PLC ladder diagram program that satisfies the above • Rung 3 energizes solenoid a when
design criteria OM:1-4 goes ON, deenergizes it when LL2 T:4-R

Solution closes, and keeps it from going back ON when the level drops
below LL2 in step 4
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 27 Programmable Logic Controllers Control System Technology 28 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


L1 L2
START LL1 CYCLE ON
1

The PLC program consists of six rungs IM:1-1 IM:1-2 OM:1-4


Counter Function
• Rung 4 energizes solenoid b when LL2 OM:1-4
CYCLE ON
T:4
Sol. c
L1
IM:1-6 Done
L2 A generic, two-input counter. The counter is shown with the
UP COUNTER output address C:7, the preset value 120, and the count
closes, deenergizes it when LL3 closes, 2
OM:1-4 T:4 OM:1-3
Enable/Reset D
C:7 register address RA:0027. When the Enable/Reset line is
IM:1-5 Enable
and keeps it from going back ON when 3
CYCLE ON LL2 Done Sol. a Count E OFF, the counter Ignores changes on the count input Ime,
Preset C:7E
the level drops below LL3 in step 4 OM:1-4 IM:1-3 T:4 OM:1-1 120 output (C:7) IS OFF, and the count register (RA:0027) is
Count Register
LL2 LL3 Done Sol. b
RA:0027 reset to 0. When the Enable/Reset line is ON, the counter
• Rung 5 enables the timer while the 4
IM:1-3 IM:1-4 T:4 OM:1-2 increments the count register by 1 each time the count input
CYCLE ON light is ON, starts the timer 5
TIMER
Enable/Reset D
Done line goes from OFF to ON. The counter output (C:7) IS OPF
OM:1-4 T:4 until the count in RA:0027 reaches the preset value (120).
when LL3 closes, and turns ON output Enable
At that time, C:7 IS turned ON and remains ON until
Run E
T:4 when the timer is done (5-min delay) IM:1-4 T:4-E
Run Enable/Reset is turned OFF. The counter continues to
Preset R
increment the count register beyond the preset value, even
• Rung 6 turns the mixer ON during 5 min T:4-R
Sol. b Mixer though the output is ON, indicating it is done
STEPS 2 and 3 6
OM:1-2 OM:1-5

T:4-R

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 29 Programmable Logic Controllers Control System Technology 30 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


Sequencer Function Sequencer Function L1 L2
L1 SW1 L2
IM:1-4 UP COUNTER Done
Display of
Count Register Enable/Reset D
0 1 5 IM:1-3 OM:1-2 SE:2
RA:0125
UP COUNTER IM:1-3 Enable
customers Enable/Reset D Count E
in store OM:1-2 C:5
Steps: 5 SE:2-E
ON
Count
IM:1-1 Preset output module OM:1
SW1
999 Steps pointer:
Count Register
OFF Starting Register:
RA:0125
RA: 1051
0 0 0 0 0 0 0 0 RA: 0151
DOWN COUNTER 0 0 1 0 0 1 1 1 RA: 0152
enter Enable/Reset D 0 1 1 0 1 1 0 0 RA: 0153
1 0 1 0 0 1 0 0 RA: 0154
OM:1-2 C:6 1 0 0 0 0 1 1 0 RA: 0155
LS2
Count OM:1-1
IM:1-2 Preset OM:1-2
exit 999 OM:1-3
Count Register OM:1-4
OM:1-5
RA:0125 OM:1-6
OM:1-7
a. Schematic diagram b. PLC program OM:1-8

A two-counter PLC program maintains a count A generic sequencer with the I output address SE:2. When the Enable/Reset line is OFF,
of the number of customers in a store the sequencer is reset to STEP 1, it ignores changes on the step input line, and output
SE:2 is OFF. When the Enable/Reset line is ON, the step pointer advances one step
each time the step input line goes from OFF to ON. Output SE:2 goes ON when the
sequencer advances to the last step. The sequencer remains in the last step and SE:2
remains ON until Enable/Reset is turned OFF
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

5
22/10/2021

Control System Technology 31 Programmable Logic Controllers Control System Technology 32 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


L1 start stop run light L2
Sequencer Function IM:1-6 IM:1-7 OM:1-1
- Ex.12.2: The industrial blending process consists of a blending
OM:1-1 SE:2
tank with provisions to add measured amounts of water, syrup,
TIMER
Enable/Reset D
and solids to the tank. The process has the following six steps
T:8

Run
T:8 solid feeder
• Drain valve open and everything else
OM:1-1 Preset
30 sec
OFF, delay 30𝑠 after START is pressed
SEQUENCER
Enable/Reset D
Done water metering pump
water
syrup metering pump
syrup
• Close drain valve, turn water metering
OM:1-1 SE:2
pump ON, turn run light ON, delay 90𝑠
Step
T:8 Steps: 12
output module OM:1
Run
R
• Turn syrup metering pump ON, turn
Starting Register drain valve
RA:0151 START drain mixer ON, delay 60𝑠
Typical timing diagram
STOP • Turn syrup metering pump OFF, turn
Run
Enable/Reset solids feeder ON, delay 30𝑠
• Turn water metering pump OFF, turn solids feeder OFF, delay 90𝑠
T:8

A generic sequencer with timed steps. The timer is enabled by its own output, causing it
to reset immediately after it has finished a 30𝑠 delay. After it has reset, the timer • Open tank drain valve, turn mixer OFF, delay 60𝑠 to drain the tank
immediately begins another 30𝑠 delay (assuming OM:1-1 is ON). The timing diagram
illustrates the sequence of pulses produced by the timer in this circuit Solution
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 33 Programmable Logic Controllers Control System Technology 34 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions TIMER SEQUENCER RA: Register
Steps: 12 Address Content
0151 0000 0000
The input and output assignments are as follows STEP 1: holds the sequencer in the Steps Pointer:
RA:0150
0152
0153
0010
0010
0011
0011
Starting Register 0154 0010 0011

Start PB IM:1-6 RUN light OM:1-1 reset condition, and only Delay
30 sec RA:0151
0155
0156
0011
0011
0111
0111
Output Destination 0157 0011 0111

memory RA:0151 holds the OM:1


0158 0011 0001

Stop PB IM:1-7 Water metering pump OM:1-2 0159


0160
0011
0011
0001
0001

solid feeder condition for STEP 1 0161


0162
0000
0000
0001
0001

Syrup metering pump OM:1-3 0 0 0 0 0 0 0 0


L1 L2 IM:1 OM:1 L1 L2

Solids feeder OM:1-4 L2 L1


run light
water metering pump syrup metering pump STEP 2: has a dwell of 90𝑠 → memory 1 1 M
water pump
water syrup
Agitator OM:1-5 RA:0152, RA:0153, RA:0154
2 2 M
syrus pump
3 3 M
solid feed
Run Drain valve OM:1-6 hold the following condition 4 4 M
mixer
R 5 5 M
drain valve start drain
START drain The timer has a 30𝑠 delay. All of the for STEP 2 stop
6 6
7 7

STOP
delays are multiples of 30𝑠, so the timed- 0 0 1 0 0 0 1 1
8 8

step sequencer in Figure 12.12 will be drain valve closed run light ON
water metering pump ON
Gnd
input
Gnd
output
satisfactory. module module

STEP 3: has a dwell of 60𝑠 → memory RA:0155 and RA:0156


hold the conditions for STEP 3
0 0 1 1 0 1 1 1

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 35 Programmable Logic Controllers Control System Technology 36 Programmable Logic Controllers

§4.PLC Programming Functions TIMER SEQUENCER RA: Register §4.PLC Programming Functions
Steps: 12 Address Content

STEP 4: has a dwell of 30𝑠 → only


0151 0000 0000
Steps Pointer:
RA:0150
0152
0153
0010
0010
0011
0011
Compare Functions
Starting Register 0154 0010 0011
memory cell RA:0l57 holds Delay
30 sec RA:0151
0155
0156
0157
0011
0011
0011
0111
0111
0111
Six possible comparisons that a PLC could make
Output Destination
the conditions for STEP 4 0158 0011 0001

• if operand 1 = operand 2 then EQ function → ON, else OFF


OM:1 0159 0011 0001
0160 0011 0001
0161 0000 0001
0 0 1 1 1 0 1 1 0162 0000 0001

• if operand 1 ≠ operand 2 then NE function → ON, else OFF


STEP 5: has a dwell of 90𝑠 → memory L1 L2 IM:1 OM:1 L1 L2
L2 L1
run light • if operand 1 ≥ operand 2 then GE function → ON, else OFF
RA:0158, RA:0159, RA:0160 1 1 M

• if operand 1 < operand 2 then LT function → ON, else OFF


water pump
2 2 M
hold conditions for STEP 5 3 3 M
syrus pump

• if operand 1 > operand 2 then GT function → ON, else OFF


solid feed
0 0 1 1 0 0 0 1 4 4 M
mixer
5 5 M

STEP 6: has a dwell of 60𝑠 → memory


start
stop
6 6
drain
• if operand 1 ≤ operand 2 then LE function → ON, else OFF
7 7

cells RA:0l61 and RA:0162 8


Gnd
8
Gnd
hold conditions for STEP 6 input
module
output
module
0 0 0 0 0 0 0 1

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

6
22/10/2021

Control System Technology 37 Programmable Logic Controllers Control System Technology 38 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


Arithmetic Functions Control Functions
Arithmetic functions perform arithmetic operations on one or two A control function alters the way a PLC scans its program. The
operands and store the result in a destination memory register. control function is programmed as a rung in the ladder diagram
An arithmetic function is programmed as a rung in the ladder program with a NO enable contact and an output symbol
diagram program with a NO enable contact, a specification box, The following four control functions are used in PLCs
and an output symbol
• Skip (SK): when its Enable contact is ON, the skip function
The following operations are performed causes a portion of a program to be passed over when the
• Addition: operand 1 + operand 2 program is scanned
• Subtraction: operand 1 − operand 2 • Master Control Relay (MCR): MCR function ≈ skip function.
• Multiplication: operand 1 × operand 2 There are two differences: (1) skip instruction does nothing
• Division: operand 1 / operand 2 when its Enable contact is OFF; the MCR instruction does
nothing when its Enable contact is ON; (2) when activated
• Square root: operand × operand (enable OFF), the MCR instruction turns the specified number
of outputs OFF
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 39 Programmable Logic Controllers Control System Technology 40 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


Control Functions Data Move Functions
The following four control functions are used in PLCs Medium and large PLCs have programming functions that copy
• Jump (JMP): jump function causes the PLC scan to go data from one place and put them in another place
immediately to the next labeled (LBL) rung in the program. The The following are four move functions
difference between a jump and a skip is that the skip specifies • Move (MV): move function copies data from the source register
how many rungs to pass over and the jump specifics where the into the destination register
bypass ends
• Block Transfer (BT): block transfer function copies data from a
• Jump to subroutine (JSR): JSR function causes the scan to go block of source registers into a block of destination registers
to another section of the program that ends with a runs that has
• Table to Register (TR): TR function copies data from a block of
a return label (RET). When it reaches the RET label, the PLC
source registers into a single destination register, one source
scan moves to the rung immediately after the JSR rung that register at a time
sent it to the subroutine
• Register to Table (RT): RT function copies data from a single
source register into a block of destination registers, one
destination register at a time. RT is the reverse of TR function
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

Control System Technology 41 Programmable Logic Controllers Control System Technology 42 Programmable Logic Controllers

§4.PLC Programming Functions §4.PLC Programming Functions


Bit Manipulation Functions PID Control Function
Bit manipulation functions change the bits in a memory register - In some PLCs, the PID control function is built into an I/O
in some manner. These functions fall into three general classes: module. The figure shows a PID module that provides two PID
changing the status of individual bits, moving bits in a register controllers capable of controlling two process variables. In other
left or right, and performing logical operations on corresponding PLCs, the PID function is programmed as a rung in the ladder
bits in two operands (stored in memory registers) diagram program. Figure 12.15 shows a programmed PID
• Changing status: bit set (BS), bit clear (BC), bit follow (BF) control function
L1 L2
Enable: Enables the function when ON
• Bit moving: shift right, shift left, rotate right, rotate left PID CONTROLLER
Enable
Manual/Auto: OFF for manual, ON for automatic control
• Logical: AND, OR, EXCLUSIVE OR Manual/Auto Setpoint: register that holds the setpoint
Setpoint:
RA:0325
Process Variable: register that holds the process variable
Process Variable:
RA:0326
Error: register that holds the error
Error:
RA:0330
Output: register that holds the output.
Output:
RA:0331
P: RA:0327
P: register holds the proportional gain setting
I: RA:0328
D: RA:0329
I: register holds integral action time constant
D: register holds the derivative time setting
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

You might also like