PLC overview
PID control and Tuning
PLC History
The first Programmable Logic Controller was developed by
General Motors in 1968, when they were looking for an
alternative to replace complex relay control systems that
meets the following requirements:
Simple programming
Program changes without system intervention (no internal
rewiring)
Smaller, cheaper and more reliable than corresponding relay
control systems
Simple, low cost maintenance
Evolution..
the range of functions has grown considerably
Powerful instruction set
High level programming language feature
Advanced function block implementations
Diagnostics and fault detections
20 years ago, process visualisation, analogue
processing or even the use of a PLC as a controller,
were considered as Utopian..
nowadays, the support of these functions forms an
integral part of many PLCs.
Definition of PLC (IEC 61131-1)
PLC is a digitally operating electronic system, designed
for use in an industrial environment, which uses a
programmable memory for the internal storage of useroriented instructions for implementing specific functions
such as logic, sequencing, timing, counting and
arithmetic, to control, through digital or analog inputs
and outputs, various types of machines or processes.
Both the PLC and its associated peripherals are
designed so that they can be easily integrated in to an
industrial control system and easily used in all their
intended functions.
Architecture of PLC
Typical Subsystems for a PLC system
Network
Communicatio
n
The 7 Parts of The IEC 61131 Standard
Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
Part 7
Part 8
General information
Equipment requirements and tests
Programming Languages
User Guidelines
Communication
Reserved
Fuzzy Control Programming
guidelines for the application and
implementation of programming
languages
IEC 61131 - Part 1 - General Overview
Definitions and glossary of terms used in the standard
List of related / referenced IEC standards
Principal functional characteristics of programmable controller
systems
IEC 61131 - Part 2 - Hardware
Electrical, mechanical and functional requirements for
Programmable Controllers and associated peripherals
Service, storage and transportation conditions
Information to be supplied by manufacturer
Test methods and procedures for verification of compliance of
programmable controllers and associated peripherals
IEC 61131 - Part 3 - Programming Languages
Software, communication and programming-model
Definition of five interlinked programming languages
Syntax and semantics of two textual and two graphical languages:
Ladder Diagram (LD)
Function Block Diagram (FBD)
Sequential Function Chart (SFC) - also known as Grafcet
Instruction List (IL)
Structured Text (ST)
Ladder logic
The contact plan or "ladder logic" language allows an easy transition
from the traditional relay logic diagrams to the programming of
binary functions. It is well suited to express combinational logic.
It is not suited to make reusable modules.
IEC 61131 does not prescribe the minimum requirements for a
compiler / interpreter such as number of rungs per page nor does
it specifies the minimum subset to be implemented.
Therefore, it should not be used for large programs made by
different persons
used in manufacturing, not process control
Ladder Diagram
make contact
break contact
relay coil
Y = A(BC+DE) + FE
Ladder Diagram for D Flip Flop
D:IN1, CL: IN2, CR1: Qn
Function Block Diagrams
Function Blocks can be
Standard
Vendor defined
User defined
IEC 1131-3 allows users to build their own function blocks according to control
program requirements. This is referred to as encapsulating a block function.
The advantage of creating user-defined blocks is that they can be built using
other function blocks, instruction list, or structured text programming with or
without ladder diagram instructions. This allows great flexibility in function block
programming.
Encapsulation also lets the user store a newly created block in a library and use it
as many times as needed in the program just like any other function block.
Function Block Diagrams
EX-OR
function
Q = (AB + C)DEF
Sequential functional chart
Provides a diagrammatic representation of control sequences in a program.
sequential function chart is a flowchart-like framework that can organize the
subprograms or subroutines (programmed in LD, FBD, IL, and/or ST) that
form the control program.
SFC is particularly useful for sequential control operations, where a program flows
from one step to another once a condition has been satisfied (TRUE or FALSE).
The SFC programming framework contains three main elements that organize the
control program:
Steps - A step is a stage in the control process.
Transitions After the PLC executes a step/action, it must receive a transition
before it will proceed to the next step. A transition can take the form of a
variable input, a result of a previous action, or a conditional IF statement.
Actions - An action is a set of control instructions prompting the PLC to
execute a certain control function during that step. An action may be
programmed using any one of the four IEC 61131-3 languages.
Sequential functional chart
SFC diagram
Equivalent flow chart
Instruction List
Structured Text
IEC 61131-3 Elementary Data Types
No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Keyword
Data Type
Bits
BOOL
SINT
INT
DINT
LINT
USINT
Boolean
Short integer
Integer
Double integer
Long integer
Unsigned short integer
1
8
16
32
64
8
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TIME_OF_DAY
or TOD
DATE_AND_TIME
or DT
STRING
BYTE
WORD
DWORD
LWORD
Unsigned integer
Unsigned double integer
Unsigned long integer
Real numbers
Long reals
Duration
Date (only)
Time of day (only)
16
32
64
32
64
Date and time of day
Character string
Bit string of length 8
Bit string of length 16
Bit string of length 32
Bit string of length 64
8
16
32
64
IEC 61131 - Part 4 User Guidelines
Assists the user in:
Utilizing the other parts of the programmable controller standard
Specifying the requirements for applications
Selecting and implementing systems
IEC 61131 - Part 5 Communication
Based on MMS (Manufacturing Message Specifications)
(still in progress)
IEC 61131 - Part 7 Fuzzy Logic
Provides the definition of fuzzy control sets
IEC 61131 - Part 8 Technical Report
Provides guidelines for the application and implementation of
programming languages for programmable controller defined in
part 3
PLC CPU specifications
Processor (clock speed)
Coprocessor
Memory (RAM, Cache)
Communication interfaces
Real time clock resolution
Power consumption
Number of IOs (local and remote)
Memory expansion
Environmental specifications
Signal flow in PLC
Discrete Input
Discrete Output
Analog Input
Analog Output
Digital Input Card specifications
Number of Inputs
Grouping of Inputs
Input Voltage ranges for ON and OFF
switching delay
Source / Sink configurable
Input impedance
Electrical isolation between
field instrumentation to input circuit
Channel to channel
Group to Group
Power consumption
Digital Outputs Card specifications
Number of outputs
Grouping of outputs
Switching type
Output Current
Per Channel
Per group
Module
Switching delay
Opto / Galvanic isolation
Between Controller & Outputs
Between groups of outputs
Overload protection with indication
Power consumption
Analog Input Card specifications
Number of inputs
Current or voltage
Resolution
Electrical input isolation
Input Impedance
Compatibility for use with HART Communicator
Precision
CMRR
Input Filter
Conversion time for all channels
Power consumption
Analog Output Card specifications
Number of outputs
Current or Voltage
Resolution
Load that can be driven
Precision
Conversion time
Isolation
Between Controller & Outputs
Between groups of outputs
Short circuit protection
Power consumption
Pulse Input Card specifications
Number of counter
Modes of counters
inputs 16 bit/ 32 bit
input frequency
Input voltage
Input Resistance
Source or Sink Mode Configurable
Power consumption
PLC Operating Cycle
Four Steps in the PLC Operations
Input Scan
Scan the state of the Inputs
START
Housekeeping
Program Scan
Processes the program logic
Input
Scan
Output
Scan
Output Scan
Energize/de-energize the outputs
Housekeeping
This step includes communications, Internal
Diagnostics, etc.
The steps are continually repeated - processed in a loop
Program
Scan
Execution of software in PLC
Read Input data
Process Input Image
Processing of inputs
Cycle Time
Run
Process algorithms
Environment
software
Processing & Posting
of outputs
Process Output Image
Write Output data
System
software
Hot Standby Controllers
The Hot Standby feature will be active if any of the following occurs
related to the main CPU
Power supply failure in the main controller
Fault in the main CPU
CPU failure
CPU rack communication failure
The Hot Standby advantages in case of failure
Bump less switchover from one CPU to another
Minimum switchover time
No loss of information
No loss of process alarms
CPU synchronization
The transferred User Data includes:
Updation in the process image
Interrupts
Updation of timers
Changing the data through communication links
Located Variables (in State RAM)
All Unlocated Variables (in State RAM)
All instances of DFB and EFB data
SFC states
System Bits and Words
Performance of the Hot Standby Solution
Scan Time
Input
Input
HSBY
HSBY
Input update in the
Standby PLC
First
Section
Only the first
section is
executed in the
Standby PLC
Data
Data
Logic
Output
Primary
Output
Standby
Data transfer
(content)
State RAM
Unlocated
data
DFB instances
Performance of the Hot Standby Solution
Input
Input
HSBY
HSBY
5 ms
per 100 KB
Scan Time
First
Section
Logic
Data
(Copro)
Output
Primary
Data
(Copro)
30 ms
per 100 KB
Output
Standby
Performance of the Hot Standby Solution
First example
Standalone scan time: 80 ms
100 KB data to exchange
Input
Primary
Scan Time
Data
Transfer
Output
Impact of the Hot Standby
System: 5ms
5 ms
HSBY
Logic
Exec
Result
Scan time with HSBY: 85 ms
100 KB data exchanged
30 ms
All the data is exchanged
during the application exec in
less than 80 ms: No impact
due to data exchange
Performance of the Hot Standby Solution
Second example
Standalone scan time: 80 ms
300 KB data to exchange
Input
Result
Primary
Impact of the Hot Standby
System: 25 ms
15 ms
HSBY
Scan Time
90 ms
Logic
Exec
Output
Scan time with HSBY: 105 ms
300 KB data exchanged
Data
Transfer
15 ms due to Input exchange
10 ms due to content exchange
(90 - 80)
Typical PLC Applications
Chemical and petrochemical industries
Manufacturing/Machining
Metals industry
Mining
Power plants
Food/Beverages
PID Control
Open-Loop Systems
An open-loop system cannot compensate for any
disturbances that add to the controllers driving signal
or to the process output.
Closed-Loop Control
Sensitivity reduction and Robustness
Disturbance rejection.
Minimizing steady state error
Improving the transient response
Controller Design
1) Experimental Design or Controller Tuning
no quantitative information on process
highly nonlinear process
also called adhoc approach
2) Model based or Analytical approach
Control system requirements are high
system is too complex to be tuned
Mathematical model of system dynamics
3) Knowledge based approach
Expert Control
Fuzzy Control
Neural networks
Basic Control Actions
Proportional control:
u (t ) K p e(t )
t
Integral control:
u (t ) K i e(t )dt
0
Differential control:
d
u (t ) K d e(t )
dt
U ( s)
Kp
E ( s)
U ( s) K i
E ( s)
s
U ( s)
Kd s
E ( s)
Proportional Control
U(t)
Proportional Control
The time response improves.
There is a steady state offset between the desired
response and the output response .
This offset can be reduced by increasing the
proportional gain; but that may also cause increase
oscillations for higher order systems.
The proportional band is the change in input required
to produce a full range of change in the output due to
the proportional control action.
The controlled variable is maintained within a specified
band of control points around a set point.
PI Controller
PI Controller
An integral controller provides an output rate of change that is
determined by the magnitude of the error and the integral constant.
The controller has the unique ability to return the process back to
the exact set point.
The integral control mode is not normally used by itself because
of its slow response to an error signal.
Proportional plus reset control eliminates any offset error that
would occur with proportional control only.
Reset windup is an inherent disadvantage of proportional plus
reset controllers that are subject to large error signals.
PD controller
PD controller
Derivative action is added to a controller to make it
respond to the rate of change of the error signal.
Derivative action cannot be used as a control mode
alone.
Proportional plus rate control does not eliminate offset
error.
Proportional plus rate control increases system stability.
But one must be careful while using derivative action in
control of very fast processes, or if the measurement is
noisy.
PID controller
PID controller
The PID controller combines the three individual modes to achieve
the advantages of each.
The proportional action responds to the error amplitude.
The integral action eliminates the offset error.
The derivative action provides additional stability to the process.
It finds universal application. But proper tuning of the controller is
difficult.
PID controllers can be used to control most processes, even those
that are difficult to control.
PID Tuning
PID Tuning First Method
Start with obtaining the step response
56
The S-shaped Step Response
Parameters of the S-shaped step response
57
The S-Shaped Step Response
The S-shaped curve may be characterized by
two parameters: delay time L and time
constant T
The transfer function of such a plant may be
approximated by a first-order system with a
transport delay
C s Ke
U s Ts 1
Ls
58
PID Tuning---First Method
59
Transfer Function of PID Controller Tuned
Using the First Method
60
Ziegler-Nichols PID Tuning---Second
Method
Use the proportional controller to force
sustained oscillations
61
PID Tuning---Second Method
Measure the period of sustained oscillation
62
PID Tuning
63
Transfer Function of PID Controller Tuned
Using the Second Method
64