Titular Curs: S.L. Dr. Ing. Nicoleta-Cristina GĂITAN
Titular Curs: S.L. Dr. Ing. Nicoleta-Cristina GĂITAN
Titular Curs: S.L. Dr. Ing. Nicoleta-Cristina GĂITAN
o
F
tract
mg
mass of the train
plus contribution
of rotating parts
(wheels and rotors)
slope
F
frict
air friction
mechanical
friction
curve
friction
motor force
61
Resulting train model in Matlab
train
inertia
v
position
K
m
C
x
traction force
Fz
C
z
x
friction
air
resistance
v
2
1
M
mgsin(o)
i
C
c
curve friction
slope
radius
taken from
topography database
motor
current
motor
speed
|v|
r(x)
o(x)
a
acceleration
slope
62
Help in modeling: use an electrical
equivalent
water
ambient-water isolation R
1
water
temperature u
energy U
q
solicited
temperature u
2
ambient
temperatur
e u
a
R
1
R
2
C
C
heater-water
isolation
Heat
resistance R
2
U
a
(ambient temperature)
x ~ u
U
q
U
a
Ux
C R C R
x
dt
dx
2 2
1 1
+ =
heating
cooling
Ua
C R
U
C R C
R R
x
dt
dx
q
2 1
2 1
1 1
)
1 1
(
+ +
+
=
Electrical equivalent
u
a
~ u
a
C Bu Ax
dt
dx
+ + =
E Dx
dt
dx
+ =
controller
63
2.2.2 Controllers
2.1 Instrumentation
2.2 Control
2.2.1 Plant modeling
2.2.2 Controllers
2.2.2.1 On/Off (two-point) controller
2.2.2.2 PID controller
2.2.2.3 Nested Controllers
2.3 Programmable Logic Controllers
64
Controllers
Once the plant is known, a controller can be designed to control its output.
If the plant would be perfectly known, no regulation would be needed.
In practice, the plants parameters vary ( e.g. number of passengers in a train),
the plant is subject to disturbances (wind, slope)
The controller needs measuring through sensors the plants state and possibly
the disturbances. In a general model, the desired behaviour of the plant is just a
disturbance.
The controller follows certain quality laws, primarily to stabilize the output within
useful time, not overshoot, minimize energy consumption, etc..
65
Controller (rgulateur, Regler)
set-point
(solicited)
Sollwert
valeur de consigne
plant
Strecke
processus
command
Stellgre
valeur de commande
error
Regelabweichun
g
dviation
process value
Istwert
valeur mesure
regulator
Regler
rgulateur
measureme
nt
Messglied
mesure
e
u
y
the regulator (controller) can be implemented by mechanical elements, electrical elements,
computers,...
controller
x
K
p
power amplifier
Leistungsverstrker
amplificateur de puissance
m
state
Zustand
tat
66
Where is that controller located ?
in the sensor
or in the actuator
(analog PIDs)
as a separate device (analog PIDs)
(some times combined with a recorder)
as an algorithm in a computer
(that can handle numerous "loops").
actors sensors
set-points
67
2.2.2.1 On/Off (two-point) controller
2.1 Instrumentation
2.2 Control
2.2.1 Plant modeling
2.2.2 Controllers
2.2.2.1 On/Off (two-point) controller
2.2.2.2 PID controller
2.2.2.3 Nested Controllers
2.3 Programmable Logic Controllers
68
Two-point controller: principle
The two-point controller (or regulator, Zweipunktregler, Rgulateur tout ou rien)
has a binary output: on or off (example: air conditioning)
commercial controller with integrated
thermometer
room set-point
temperature
measured value
thermometer
heater
control
variable
energy
off on
69
Two-point controller: time response
0.00
0.20
0.40
0.60
0.80
1.00
1
9
1
7
2
5
3
3
4
1
4
9
5
7
6
5
7
3
8
1
8
9
9
7
Note the different time
constants for heating and
cooling:
this is a non-linear
system
If the process is not slow enough, hysteresis or switching period limit are included
to limit switching frequency and avoid wearing off the contactor.
(thermal processes are normally so inertial that no hysteresis is needed)
time
temperature
lower switch point
upper switch point
hysteresis
min period
70
Two-point controller: Input variable as ramp
0.00
0.20
0.40
0.60
0.80
1.00
1.20
0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00
time (s)
v
a
l
u
e
Solicited
Upper bound
Lower bound
Output
%
71
2.2.2.2 PID Controller
2.1 Instrumentation
2.2 Control
2.2.1 Plant modeling
2.2.2 Controllers
2.2.2.1 On/Off (two-point) controller
2.2.2.2 PID controller
2.2.2.3 Nested Controllers
2.3 Programmable Logic Controllers
72
A glance back in time...
ruins of a tin* mine in Cornwall (England), with the machine house for pumping,
where the first steam engines were installed (1790)
*Tin = Sn
tain, Zinn,
stannum
Zk, Zink, zinc
73
Birth of the steam machine (1780 - Thomas
Newcomen)
used for:
pump water
winches
ore crashing
Problem: keep the wheel speed constant.
74
The Watts "governor" (1791) - the first
industrial regulator
75
Flywheel governor
steam pipe
ancestor of automatic control...
e
o = f(e
2
)
valve
cylinder
76
Plant model for the following example
The following examples use a plant modeled by a 2
nd
order differential equation:
2
2
1
1
1
TT s sT m
y
+ +
=
Laplace transfer function
(since system is linear)
differential equation
This transfer function is typical of a plant with slow response, but without dead
time
0
0.2
0.4
0.6
0.8
1
1.2
1.4
0 1 2 3 4 5 6 7 8 9 10
time
delay time constant
gain
In the examples:
T
1
= 1 s
TT
2
= 0.25 s
2
step response
d ~ 0.2, T= 1.5s
plant m y
m TT y T y y = + +
2 1
" '
Temporal response
77
P-controller: simplest continuous regulator
m(t) = K
p
e(t) = K
p
(u(t) y(t))
the P-controller simply amplifies the error to obtain the command
variable
it works, but if the plant has a proportional behavior, an error always remains
set-point
plant
command
variable
e
process value
proportional factor
measurement
P
controlled
variable
K
p
x
u
y
error
m
78
-0.5
0
0.5
1
1.5
2
0 1 2 3 4 5 6 7 8 9 10
P-Controller: Step response
m
(
t
)
,
y
0
(
t
)
x large
large error
smaller asymptotic error
x small
Numerical:
K
p
= 5.0
set-point
The larger the set-point, the greater the error.
(The operator used to "reset" the control by increasing or decreasing the set-point)
command
79
P-Controller: Effect of Load change
-0.5
0
0.5
1
1.5
2
0 1 2 3 4 5 6 7 8 9 10
v
a
l
u
e
u
0
(Solicited)
Not only a set-point change, but a load change causes the error to increase or decrease.
(A load change, modeled by disturbance u
1
, is equivalent to a set-point change)
u
1
(load change)
command
u
0
= set-point plant
m = command
variable
e = error
y
0
= process value
proportional factor
measurement
P-regulator
controlled
variable
K
p
u1 =
disturbance
80
P-Controller: Increasing the proportional
factor
increasing the proportional factor reduces the error, but the system tends to oscillate
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
0 1 2 3 4 5 6 7 8 9 10
time [s]
u
0
(
t
)
,
y
0
(
t
)
81
PI-Controller (Proportional Integral):
introducing the integrator
dt x y
y = level [m]
inflow [m
3
/s]
level (t) = (inflow(t)) dt
t
1
t
2
Example of an integration process
Time response of an integrator
input
output
older symbol
1
s
y x
}
=
t
t
d x y
0
) ( t t
82
PI (Proportional-Integral) Controller
set-point u
0 plant
command
variable
dt
PI
error e
process value y
0
integration
time constant
controller gain Kp
measurement
K
p
1
T
i
m
1
s
The integral factor produces a non-zero control variable even when the error is zero.
83
PI Regulator : Equations
) ) (
1
) ( (
0
}
+ =
t
t
i
p
d e
T
t e K m t t
T
i
= reset time, temps dintgration, Nachstellzeit
e
sT
K m
i
P
~
)
1
1 (
~
+ =
Laplace domain
Time domain
84
PI-Controller: response to set-point change
The integral factor reduced the asymptotical error to zero, but slows down the
response
(if K
p
is increased to make it faster, the system becomes unstable)
Kp = 2,0, T
i
=1,0 s
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
2.2
0 1 2 3 4 5 6 7 8 9 10
time
v
a
l
u
e
Solicited
Output
Command
Integrator
85
PD controller
Basic idea of the PD regulator: take into account not only the value of the
error, but the rate at which the error changes.
Example: when parking a car in front of a wall, the driver not only looks at the
distance to the wall, but also at the speed at which the car approaches the
wall.
86
PD-Controller: Introducing the differentiator
Time response of a differentiator
input
output
dt
dx
y =
equation:
s y x
A perfect differentiator does not exist.
Differentiators increase noise.
Differentiators are approximated by
integrators (filtered differentiator):
1
s
T
d
Nf
1
Instead of differentiating, one can use an
already available variable:
e.g. the speed for a position control
x y
symbol:
87
PD - controller
K
p
u plant
command
variable
s
error
process value y
derivative
factor
proportional factor
measurement
T
d
PD
Adding the D-part allows to react vigorously to changes in set-point or perturbations.
m x
set-point
88
PD Controller: Equations
|
.
|
\
|
+ =
dt
t de
T t e K t m
d p
) (
) ( ) (
Laplace domain
( ) ) (
~
1 ) (
~
s e s T K s m
d p
+ =
Time domain
Td = derivative time, temps de dosage de drive, Vorhaltezeit Tv
89
PID-Controller (Proportional-Integral-
Differential)
The proportional factor K
p
generates an output proportional to the error, it requires a
non-zero error to produce the command variable.
Increasing the amplification K
p
decreases the error, but may lead to instability
The integral time constant T
i
produces a non-zero control variable even when the
error is zero, but makes the system instable (or slower).
The derivative time T
d
speeds up response by reacting to an error change with a
control variable proportional to the steepness of change.
PID
K
p
1
T
i
1
s
set-point plant
command
variable
s
error
process value
derivative
factor
proportional factor
measurement
T
d
90
PID controller: Equations
|
|
.
|
\
|
+ + =
}
dt
t de
T d e
T
t e K t m
d
t
t
i
p
) (
) ) (
1
) ( ) (
0
t t
|
|
|
|
.
|
\
|
+
+ + =
) 1 (
1
1
) (
~
) (
~
s
T
N
s T
sT
K
s e
s m
d
f
d
i
p
Real differentiators include this filtering
time domain
Laplace domain
K
p
= proportional factor, gain, Reglerverstrkung,
T
i
= reset time, temps de dosage dintgration (Nachhaltezeit, T
N
)
Td = derivative time, temps de dosage de drive, Vorhaltezeit Tv
alternate representation:
|
.
|
\
|
+
+ + =
t s
s T
sT
K
s e
s m
d
i
p
1
1 1
) (
~
) (
~
91
PID response summary
0
1
0 1 2 3 4 5 6 7 8 9 10
Solicited P
small
P
large
PI PID U
1
P
small
(K=5) asymptotic error
proportional only
P
large
(K
p
= 15) less error,
but unstable
PI: no remaining error,
but sluggish response
(or instable, if K
p
increased)
differential factor
increases responsiveness
load change (load decreases)
92
PID-Controller: empirical settings
Rise time Overshoot Settling time Steady-State
Error
increasing
Kp Decrease Increase Small Change Decrease
Ti Decrease Increase Increase Eliminate
Td Small Change Decrease Decrease Small Change
Empirical formula of Nichols (1942 !)
0
0.2
0.4
0.6
0.8
1
1.2
1.4
0 1 2 3 4 5 6 7 8 9 10
delay time constant
gain K
step response (open loop)
d ~ 0.2, T= 1.5s
1.2 T
K
V
K
p
= T
i
= 2.0 d T
d
= 0.5 d (N
f
= 10)
Caution: Nichols assumes the plant is
first order with time delay
93
Extract from a controllers manual
You can optimize the regulator yourself. This describes the optimization according to Ziegler-Nichols
Assuming that the process is stable at the operating temperature:
1. Set the Parameters ti und td OFF.
2. Set the Parameters Hcb und Lcb on Auto.
3. The actual value differs now from the solicited value by the Proportional factor.
4. As soon as the temperature stabilize, reduce the value of the proportional band Pb, until the
temperature starts to swing. Note the swinging period T. Increase the proportional band until the
temperature just stops swinging, do not haste. Note the value of the proportional band B.
5. Set the values of Pb, Ti and Td according to the following table in the controller.
But what do you do if this method does not work ?
How do you know that this plant can be controlled by a PID controller (many cannot)
How do you prevent overshoot ? (this method does not)
Trial-and-error cant replaces a serious analysis -> see for further reading.
94
2.2.2.3 Nested controllers
2.1 Instrumentation
2.2 Control
2.2.1 Plant modeling
2.2.2 Controllers
2.2.2.1 On/Off (two-point) controller
2.2.2.2 PID controller
2.2.2.3 Nested Controllers
2.3 Programmable Logic Controllers
95
Several controllers act together: Electricity
Generator
Generator
Active power
frequency (Pf)
controller
Turbine
3-phase Electrical Power Mechanical power
Steam
Valve
control
mechanism
Main
steam
valve
Controllable
excitation
source
Voltage
sensors
Frequency sensor
AQ
AV
AP
AP + j AQ
Af
Reactive power
voltage (QV)
controller
96
Nested control of a continuous plant -
example
Example: position control of a rotating shaft
Nesting regulators allow to maintain the output variable at a determined value
while not exceeding the current or speed limitations
Position
Speed
Torque
torque regulation
(protection)
PID
sol
is
cmd
PID
sol
is
cmd
PID
sol
is
cmd
M
Current
Position
Velocity
tacho
encoder
amplifier
97
Nested loops and time response
A control system consists often of nested loops, with the fastest loop at the inner
level
robot arm trajectory
speed control
torque control
position control
98
Programmable Logic Controllers
Automates Programmables
Speicherprogrammierbare Steuerungen
lim
TIT
TIT_REF_TAB
N_GT
POST_START_TIMER_MOD
100
0
FAULT_STATE[tit1_oor]
FAULT_STATE[tit2_oor]
OR
TIT_RATE_LIM_DN
TIT_RATE_LIM_UP
TIT_ERROR
TIT_REF_MAX_START
WFD_TIT
PID
K_TIT
P
TD_TIT
D
MAX_INT
I
17.3
99
2.3.1 PLCs: Definition and Market
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1 PLCs: Definition and Market
2.3.2 PLCs: Kinds
2.3.3 PLCs: Functions and construction
2.3.4 Continuous and Discrete Control
2.3.5 PLC Programming Languages
2.3.5.1 IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
100
Programmable Logic Controller:
Definition
Definition: small computers, dedicated to automation tasks in an industrial environment"
cabled relay control (hence 'logic'), analog (pneumatic, hydraulic) governors
specialized computer performing control and regulation
Function: Measure, Command, Control
AP = Automates Programmables industriels
SPS = Speicherprogrammierbare Steuerungen
Formerly:
Today:
Distinguish Instrumentation
flow meter, temperature, position,. but also actors (pump, )
Control
programmable logic controllers with digital peripherals & field bus
Visualization
HMI in PLCs (when it exists) is limited to control of operator displays
101
PLC: functions
Measure
Command
Regulation
Event Logging
Communication
Human interface
Protection
(Messen, Schtzen, Regeln = MSR)
PLC = PMC: Protection, Measurement and Control
102
PLC: Characteristics
large number of peripherals: 20..100 I/O per CPU, high density of wiring, easy assembly.
binary and analog Input/Output with standard levels
located near the plant (field level), require robust construction, protection against dirt,
water and mechanical threats, electro-magnetic noise, vibration, extreme temperature
range (-30C..85C)
programming: either very primitive with hand-help terminals on the target
machine itself, or with a lap-top able to down-load programs.
network connection is becoming common, allowing programming on workstations.
primitive Man-Machine interface, either through LCD-display or connection of a laptop
over serial lines (RS232).
economical - 1000.- .. 15'000.- for a full crate.
the value is in the application software (licenses 20'000 ..50'000)
field bus connection for remote I/Os
103
PLC: Location in the control
architecture
Enterprise Network
directly connected
I/O
Control Bus
(e.g. Ethernet)
Engineer
station
I
/
O
I
/
O
I
/
O
I
/
O
C
P
U
Sensor Bus (e.g. ASI)
Field Bus
gateway
Field Stations
Control Station
with Field Bus
direct I/O
I
/
O
Field Devices
FB
gateway
gateway
I
/
O
I
/
O
I
/
O
I
/
O
C
P
U
C
O
M
I
/
O
I
/
O
I
/
O
C
O
M
C
P
U
C
O
M
C
O
M
C
O
M
I
/
O
Field Bus
C
P
U
C
O
M
2
I
/
O
I
/
O
I
/
O
C
P
U
C
O
M
1
C
O
M
2
I
/
O
C
P
U
Operator
station
large
PLCs
small PLC
very simple PLCs
PLC
PLC
C
O
M
1
C
O
M
1
Supervisor
Station
104
PLC: manufacturers
Europe:
Siemens (60% market share) [Simatic],
ABB (includes Hartmann&Braun, Elsag-Bailey, SattControl,) [Industrial
IT
],
Groupe Schneider [Tlmcanique],
WAGO,
Phoenix Contact ...
World Market:
GE-Fanuc,
Honeywell,
Invensys (Foxboro)
Rockwell, (Allen-Bradley,)
Emerson (Fisher Control, Rosemount, Westinghouse)
Hitachi, Toshiba, Fujitsu, Yokogawa
SAIA, Weidmller
Switzerland
large number of bidders, fusions and acquisitions in the last years.
Distinguish PLCs for the open market (OEM) and proprietary PLCs
105
2.3.3 PLCs: Kinds
2.1 Instrumentation
2.2 Control
2.3 Programmable Logic Controllers
2.3.1 PLCs: Definition and Market
2.3.2 PLCs: Kinds
2.3.3 PLCs: Functions and construction
2.3.4 Continuous and Discrete Control
2.3.5 PLC Programming Languages
2.3.5.1 IEC 61131 Languages
2.3.5.2 Function blocks
2.3.5.3 Program Execution
2.3.5.4 Input / Output
2.3.5.5 Structured Text
2.3.5.6 Sequential Function Charts
2.3.5.7 Ladder Logic
2.3.5.8 Instruction Lists
2.3.5.9 Programming environment
106
Kinds of PLC
Monolithic construction
Monoprocessor
Fieldbus connection
Fixed casing
Fixed number of I/O (most of them binary)
No process computer capabilities (no MMC)
Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7
(1)
Modular construction (backplane)
One- or multiprocessor system
Fieldbus and LAN connection
3U or 6U rack, sometimes DIN-rail
Large variety of input/output boards
Connection to serial bus
Small MMC function possible
Typical products: SIMATIC S5-115, Hitachi H-Serie, ABB AC110
(2)
Compact
Modular PLC
(3) Soft-PLC
Windows NT or CE-based automation products
Direct use of CPU or co-processors
107
courtesy ABB
Modular PLC
RS232
CPU CPU Analog
I/O
Binary I/O
backplane
parallel bus
housed in a 19" (42 cm) rack
(height 6U ( = 233 mm) or 3U (=100mm)
concentration of a large number of I/O
Power Supply
high processing power (several CPU)
primitive or no HMI
cost effective if the rack can be filled
tailored to the needs of an application
supply 115-230V~ , 24V= or 48V= (redundant)
fieldbus
LAN
large choice of I/O boards
interface boards to field busses
requires marshalling of signals
fieldbus
developme
nt
environmen
t