R7003E - Automatic Control Module 4.1 digital...
Transcript of R7003E - Automatic Control Module 4.1 digital...
R7003E - Automatic ControlModule 4.1
digital control
Damiano Varagnolo
1
Digital control
Continuous time
y(t) = b(s)a(s)u(t)
Discrete time
y(k) = b(z)a(z)u(k)
2
Alternative control design workflows
physics-based considerations system identification procedures
{ x = Ax +Bu
y = Cx{ x(k + 1) = Ax(k) +Bu(k)
y(k) = Cx(k)
continuous controller discrete controller
implementation
3
Alternative control design workflows
physics-based considerations system identification procedures
{ x = Ax +Bu
y = Cx{ x(k + 1) = Ax(k) +Bu(k)
y(k) = Cx(k)
continuous controller discrete controller
implementationdiscrete equivalent
3
Alternative control design workflows
physics-based considerations system identification procedures
{ x = Ax +Bu
y = Cx{ x(k + 1) = Ax(k) +Bu(k)
y(k) = Cx(k)
continuous controller discrete controller
implementationdiscrete design
3
physics-based considerations system identification procedures
{ x = Ax +Bu
y = Cx{ x(k + 1) = Ax(k) +Bu(k)
y(k) = Cx(k)
continuous controller discrete controller
implementationdiscrete equivalent
aim: continuous controller ↦ discrete controller Ô⇒ we need a metric
4
Design using discrete equivalents – meaningful only for PIDs
continuous controller Cc(s)↦ discrete controller Cd(z)
Ô⇒ we need a metric find Cd(z) that best approximates Cc(s)
it will always be an approximation!
5
Design using discrete equivalents – meaningful only for PIDs
continuous controller Cc(s)↦ discrete controller Cd(z)
Ô⇒ we need a metric find Cd(z) that best approximates Cc(s)
it will always be an approximation!
5
Design using discrete equivalents – strategies
zero-order hold method
Tustin’s method
matched poles-zeros method
modified matched poles-zeros method
c2d in Matlab
6
Design using discrete equivalents – strategies
zero-order hold method
Tustin’s method
matched poles-zeros method
modified matched poles-zeros method
c2d in Matlab
6
Discrete design – workflow
physics-based considerations system identification procedures
{ x = Ax +Bu
y = Cx{ x(k + 1) = Ax(k) +Bu(k)
y(k) = Cx(k)
continuous controller discrete controller
implementationdiscrete design
7
Discrete design – first step: discretize (A, B, C, D)Aim:
{ x = Ax +Bu
y = Cx +Du↦ { x(k + 1) = Adx(k) +Bdu(k)
y(k) = Cdx(k) +Ddu(k)
Starting point = evolution of x(t) starting from t0:
x(t) = eA(t−t0)x(t0) + ∫t
t0eA(t−τ)Bu(τ)dτ
Sampling x(t) at k + 1 starting from k
(i.e., at t = k∆ +∆ starting from t0 = k∆):
x(k + 1) = eA∆x(k) + ∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
8
Discrete design – first step: discretize (A, B, C, D)Aim:
{ x = Ax +Bu
y = Cx +Du↦ { x(k + 1) = Adx(k) +Bdu(k)
y(k) = Cdx(k) +Ddu(k)
Starting point = evolution of x(t) starting from t0:
x(t) = eA(t−t0)x(t0) + ∫t
t0eA(t−τ)Bu(τ)dτ
Sampling x(t) at k + 1 starting from k
(i.e., at t = k∆ +∆ starting from t0 = k∆):
x(k + 1) = eA∆x(k) + ∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
8
Discrete design – first step: discretize (A, B, C, D)Aim:
{ x = Ax +Bu
y = Cx +Du↦ { x(k + 1) = Adx(k) +Bdu(k)
y(k) = Cdx(k) +Ddu(k)
Starting point = evolution of x(t) starting from t0:
x(t) = eA(t−t0)x(t0) + ∫t
t0eA(t−τ)Bu(τ)dτ
Sampling x(t) at k + 1 starting from k
(i.e., at t = k∆ +∆ starting from t0 = k∆):
x(k + 1) = eA∆x(k) + ∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
8
Discrete design – towards the map
Important: this is an exact map!
x(t) = eA(t−t0)x(t0) + ∫t
t0eA(t−τ)Bu(τ)dτ
↧
x(k + 1) = eA∆x(k) + ∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
how do we discretize u(τ)?Assumption: u(⋅) is piecewise constant:
u(τ) = u(k) τ ∈ [k∆, k∆ +∆)9
Discrete design – towards the map
Important: this is an exact map!
x(t) = eA(t−t0)x(t0) + ∫t
t0eA(t−τ)Bu(τ)dτ
↧
x(k + 1) = eA∆x(k) + ∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
how do we discretize u(τ)?Assumption: u(⋅) is piecewise constant:
u(τ) = u(k) τ ∈ [k∆, k∆ +∆)9
Discrete design – towards the map
Important: this is an exact map!
x(t) = eA(t−t0)x(t0) + ∫t
t0eA(t−τ)Bu(τ)dτ
↧
x(k + 1) = eA∆x(k) + ∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
how do we discretize u(τ)?Assumption: u(⋅) is piecewise constant:
u(τ) = u(k) τ ∈ [k∆, k∆ +∆)9
Discrete design – towards the map
u(τ) = u(k) τ ∈ [k∆, k∆ +∆) implies
∫k∆+∆
k∆eA(k∆+∆−τ)Bu(τ)dτ
=
(∫k∆+∆
k∆eA(k∆+∆−τ)Bdτ)u(k)
=
(∫∆
0eAτ Bdτ)u(k)
10
Discrete design – the map
⎧⎪⎪⎪⎨⎪⎪⎪⎩
x(k + 1) = (eA∆)x(k) + (∫∆
0eAτ Bdτ)u(k)
y(k) = Cx(k) +Du(k)
Thus:Ad ∶= eA∆
Bd ∶= ∫∆
0eAτ Bdτ
Cd ∶= C
Dd ∶=D
c2d in Matlab
11
Discrete design – the map
⎧⎪⎪⎪⎨⎪⎪⎪⎩
x(k + 1) = (eA∆)x(k) + (∫∆
0eAτ Bdτ)u(k)
y(k) = Cx(k) +Du(k)
Thus:Ad ∶= eA∆
Bd ∶= ∫∆
0eAτ Bdτ
Cd ∶= C
Dd ∶=D
c2d in Matlab
11
Discrete design – the map
⎧⎪⎪⎪⎨⎪⎪⎪⎩
x(k + 1) = (eA∆)x(k) + (∫∆
0eAτ Bdτ)u(k)
y(k) = Cx(k) +Du(k)
Thus:Ad ∶= eA∆
Bd ∶= ∫∆
0eAτ Bdτ
Cd ∶= C
Dd ∶=D
c2d in Matlab
11
Discrete design – analogies with continuous time systems
Things that do not change:
controllability and observability indexes
structure of all the canonical forms
how to handle of the reference signals
second order approximations / LQR design strategies
acker and place
12
Discrete design – analogies with continuous time systems
Things that do not change:
controllability and observability indexes
structure of all the canonical forms
how to handle of the reference signals
second order approximations / LQR design strategies
acker and place
12
Discrete design – analogies with continuous time systems
Things that do not change:
controllability and observability indexes
structure of all the canonical forms
how to handle of the reference signals
second order approximations / LQR design strategies
acker and place
12
Discrete design – analogies with continuous time systems
Things that do not change:
controllability and observability indexes
structure of all the canonical forms
how to handle of the reference signals
second order approximations / LQR design strategies
acker and place
12
Discrete design – analogies with continuous time systems
Things that do not change:
controllability and observability indexes
structure of all the canonical forms
how to handle of the reference signals
second order approximations / LQR design strategies
acker and place
12
Discrete design – analogies with continuous time systems
Things that do not change:
controllability and observability indexes
structure of all the canonical forms
how to handle of the reference signals
second order approximations / LQR design strategies
acker and place
12
Discrete design – example:
tContinuousSystem = ss(A,B,C,D);fSamplingPeriod = 0.05;tDiscreteSystem = c2d(tContinuousSystem, fSamplingPeriod);[Ad,Bd,Cd,Dd] = ssdata(tDiscreteSystem);pc = [0.78 + 0.18*j; 0.78 - 0.18*j];po = [0.58 + 0.08*j; 0.58 - 0.08*j];K = acker(Ad,Bd,pc);L = (acker(Ad',Cd',po))';
13