Lecture1 2024
Lecture1 2024
SC42095
1 / 56
Lecture outline
2 / 56
Digital Control (SC42095)
3 / 56
Digital Control (SC42095)
4 / 56
Project assignment
Purpose: learn to apply the design and analysis techniques and the
use of numerical tools
Procedure:
◮ check out the assignments from Brightspace from November 12, at
12:30,
◮ enroll in the corresponding group on Brightspace before November
18, at 12:30,
5 / 56
Project assignment
Purpose: learn to apply the design and analysis techniques and the
use of numerical tools
Procedure:
◮ check out the assignments from Brightspace from November 12, at
12:30,
◮ enroll in the corresponding group on Brightspace before November
18, at 12:30,
◮ if you are retaking the course, you should select a different assignment
from the one you submitted previously
◮ start with the continuous-time control task,
◮ gradually solve the discrete-time problems,
◮ answer the questions in the same order they were asked,
◮ write a short and decent report and submit on Brightspace, (deadline
January 8, 2025, at 14:00)
6 / 56
Project assignment
Purpose: learn to apply the design and analysis techniques and the
use of numerical tools
Procedure:
◮ check out the assignments from Brightspace from November 12, at
12:30,
◮ enroll in the corresponding group on Brightspace before November
18, at 12:30,
◮ if you are retaking the course, you should select a different assignment
from the one you submitted previously
◮ start with the continuous-time control task,
◮ gradually solve the discrete-time problems,
◮ answer the questions in the same order they were asked,
◮ write a short and decent report and submit on Brightspace, (deadline
January 8, 2025, at 14:00)
A design problem .. so no single correct solution ... but many
incorrect ones
Your report will be graded and form your final mark
7 / 56
Project assignment - Resit
8 / 56
Goals of the course
Main subject:
Computer-controlled systems, digital implementation
Analyze discrete-time systems.
Design sampled-data controllers (synthesis).
Identify implementation issues.
Apply the design methodology to a simulated process
(project assignment with Matlab and Simulink).
9 / 56
Contents of lectures
10 / 56
Course materials
Book:
Aström K.J. and Wittenmark B.:
Computer Controlled Systems
3rd ed., Prentice Hall, 1997.
Slides:
available through Brightspace( Inspired
by lecture materials from Tamas
Keviczky, Franky De Bruyne, Brian
Douglas).
Some parts of the book
will not be discussed in
the lectures and are left
for self-study
11 / 56
Supplementary textbook
Book:
L. Keviczky et. al:
Control Engineering, and
Control Engineering: MATLAB Exer-
cises,
Springer, 2019.
12 / 56
Prerequisites
Mathematical analysis
Linear algebra
Dynamical control systems, state-space theory (SC42015)
Working knowledge of Matlab and Simulink
13 / 56
Some important concepts to refresh
14 / 56
Matlab and Simulink
15 / 56
Course information
Brightspace
Basic course information.
Important dates, messages.
Solutions manual, errata for the book.
Exercises, discussion forum, etc.
Course software (for Matlab and Simulink):
◮ Matlab scripts to generate figures in the book:
(see how examples are implemented, etc.)
Other supplementary references.
16 / 56
Roadmap
Output-
feedback
control
State-
feedback
Observer
control
State-space
representation
Sampling
theory
Analysis
Synthesis
Mapping (time-domain)
from s to z
Discretisation
Z-
transformation
17 / 56
Setting the stage; continuous-time design
18 / 56
Setting the stage; continuous-time design
19 / 56
Setting the stage; continuous-time design
20 / 56
Setting the stage; continuous-time design
22 / 56
Computer-controlled systems
u(t) y(t)
Controller (computer) Process
23 / 56
Computer-controlled systems
u(t) y(t)
Controller (computer) Process
r[k]
u(t) yt (t)
u[k]
Digital processor D/A+Hold Process
Clock
y[k] y(t)
A/D Anti-aliasing Sensor
25 / 56
Computer-controlled systems
r[k]
u(t) yt (t)
u[k]
Digital processor D/A+Hold Process
Clock
y[k] y(t)
A/D Anti-aliasing Sensor
26 / 56
The Analog controller is replaced by
A digital processor (which takes a reference signal r [k] and the
process value y [k])
An interface between the analog process and the digital processor
27 / 56
The Analog controller is replaced by
A digital processor (which takes a reference signal r [k] and the
process value y [k])
An interface between the analog process and the digital processor
Note that
Usually, the hold block is a Zero Order Hold (ZOH), which keeps
the signal constant on the last sample value till the next sample value
is read
Frequency response of the sensor and the anti-aliasing filter is
supposed to be flat in the frequency band of interest
28 / 56
The Analog controller is replaced by
A digital processor (which takes a reference signal r [k] and the
process value y [k])
An interface between the analog process and the digital processor
Note that
Usually, the hold block is a Zero Order Hold (ZOH), which keeps
the signal constant on the last sample value till the next sample value
is read
Frequency response of the sensor and the anti-aliasing filter is
supposed to be flat in the frequency band of interest
What the digital processor sees is the process+the interface block →
Digital control should include the effect of the interface block into
the design problem
29 / 56
Designing a digital controller
Approach 2 Approach 1
P(s) P(s)
Discretise Design
(including the
effect of ZOH) P(z) C (s)
Design Discretise
C (z) C (z)
30 / 56
Computer-controlled systems - Approach 1
31 / 56
Computer-controlled systems - Approach 1
32 / 56
Computer-controlled systems - Approach 2
r[k]
u(t) yt (t)
u[k]
Digital processor D/A+Hold Process
Clock
y[k] y(t)
A/D Anti-aliasing Sensor
33 / 56
Computer-controlled systems - Approach 2
r[k]
u(t) yt (t)
u[k]
Digital processor D/A+Hold Process
Clock
y[k] y(t)
A/D Anti-aliasing Sensor
35 / 56
Limitations of computer control
36 / 56
Limitations of computer control
37 / 56
Limitations of computer control
38 / 56
Time-varying behavior
u y
1
Ts+1
u ys
A-D Computer D-A
Clock
39 / 56
Time-varying behavior – cont’d
40 / 56
Time-varying behavior – cont’d
41 / 56
Influence of sampling period
A naive approach:
Design continuous-time controller.
Discretize this controller.
Implement on a computer.
42 / 56
Influence of sampling period – cont’d
y(t)
u(t)
43 / 56
Design continuous-time controller
44 / 56
Design continuous-time controller – cont’d
b a−b
U(s) = K Uc (s) − Y (s) + Y (s)
a s +a
b
u(t) = K uc (t) − y (t) + x(t)
a
dx(t)
= −ax(t) + (a − b)y (t)
dt
45 / 56
Discretize continuous-time controller
b
u(t) = K uc (t) − y (t) + x(t)
a
dx(t)
= −ax(t) + (a − b)y (t)
dt
46 / 56
Discretize continuous-time controller
b
u(t) = K uc (t) − y (t) + x(t)
a
dx(t)
= −ax(t) + (a − b)y (t)
dt
To obtain an algorithm for a computer, the derivative is approximated
with a difference equation; Approximate the derivative:
x(t + h) − x(t)
= −ax(t) + (a − b)y (t)
h
47 / 56
Discretize continuous-time
controller
b
u(t) = K uc (t) − y (t) + x(t)
a
dx(t)
= −ax(t) + (a − b)y (t)
dt
x(t + h) − x(t)
= −ax(t) + (a − b)y (t)
h
Hence, the approximation of the continuous algorithm is obtained as:
b
u(tk ) = K uc (tk ) − y (tk ) + x(tk )
a
x(tk + h) = x(tk ) + h (a − b)y (tk ) − ax(tk )
48 / 56
Discretize continuous-time
controller
b
u(t) = K uc (t) − y (t) + x(t)
a
dx(t)
= −ax(t) + (a − b)y (t)
dt
x(t + h) − x(t)
= −ax(t) + (a − b)y (t)
h
Hence, the approximation of the continuous algorithm is obtained as:
b
u[k] = K uc [k] − y [k] + x[k]
a
x[k + 1] = x[k] + h (a − b)y [k] − ax[k]
49 / 56
Implement discrete-time controller
b
u(tk ) = K uc (tk ) − y (tk ) + x(tk )
a
x(tk + h) = x(tk ) + h (a − b)y (tk ) − ax(tk )
Clock
y:= adin {read process value}
u:= K*(b/a*uc-y+x)
Algorithm dout(u) {output control signal}
x:= x+h*((a-b)*y - a*x)
50 / 56
Performance Comparison
1
Output
0
0 5 10
0.5
Input
−0.5
0 5 10
Time (ω0t)
Digital controller:
slightly higher overshoot
5.7
settling time to 5% is ω0
Analog controller:
5.52
settling time to 5% is ω0
Thus small difference! (The digital controller is slightly worse)
52 / 56
Longer sampling period
a) h = 0.5/ω0 , b) h = 1.08/ω0
(a) (b)
Output
Output
1 1
0 0
0 5 10 15 0 5 10 15
0.5 0.5
Input
Input
0 0
−0.5 −0.5
0 5 10 15 0 5 10 15
Time (ω t) Time (ω t)
0 0
54 / 56
Designing a controller in discrete time
Consider the following control policy (designed following digital
control theory)
0
0 5 10
0.5
Velocity
0 5 10
0.5
Input
−0.5
0 5 10
Time (ω0t)
55 / 56
Summary
discrete-time design.
56 / 56