0% found this document useful (0 votes)
90 views22 pages

13 - Digital Controller Design

The document discusses digital controller design for sampled-data systems. It introduces the zero-order hold equivalence and how to approximate a continuous-time controller K(s) with a discrete-time controller Kd(z). There are two main approaches: direct design using the ZOH equivalence GZOH(z), or approximating an existing continuous design with Kd(z). Integration is also approximated, with the forward Euler method discussed as one example to estimate 1/s. The overall goal is to design a stable, high-performance digital controller for a sampled-data system.

Uploaded by

Everton Colling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views22 pages

13 - Digital Controller Design

The document discusses digital controller design for sampled-data systems. It introduces the zero-order hold equivalence and how to approximate a continuous-time controller K(s) with a discrete-time controller Kd(z). There are two main approaches: direct design using the ZOH equivalence GZOH(z), or approximating an existing continuous design with Kd(z). Integration is also approximated, with the forward Euler method discussed as one example to estimate 1/s. The overall goal is to design a stable, high-performance digital controller for a sampled-data system.

Uploaded by

Everton Colling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Control Systems 2

Lecture 13: Digital controller design

Roy Smith

2018-5-22 13.1

Digital control system design

Sampled-data closed-loop

y(k) y(t) u(t) u(k) r(k)


G(s) ZOH Kd (z) +
T

GZOH (z) equivalence


GZOH (z)

y(k) r(k)
G(s) ZOH Kd (z) +
T

2018-5-22 13.2
Zero-order hold equivalence — transfer function

y(k) y(t) u(t) u(k)


G(s) ZOH
T

| {z }
GZOH (z)

(
1 k = 0,
Input: u(k) = , u(t) = step(t) − step(t − T ).
0 k 6= 0
  G(s)
Output: y(s) = 1 − e−T s .
s

We now sample this, and take the Z-transform,


  
−T s G(s)
GZOH (z) = Z 1−e
s
 
−1 G(s)
= (1 − z )Z .
s

2018-5-22 13.3

Zero-order hold equivalence — state space

y(k) y(t) u(t) u(k)


G(s) ZOH
T

| {z }
GZOH (z)

Integrating Φ(t) over a single sample period (kT to kT + T ):


Z kT +T
AT
x(kT + T ) = e x(kT ) + eA(kT +T −τ ) Bu(τ ) dτ,
kT

 Z T

  AT Aη
A B ZOH-equivalence  e e B dη 
 0 
C D =⇒
C D

2018-5-22 13.4
Zero-order hold equivalence — frequency domain
(2 − s)
Example: G(s) = , T = 0.6
(2s + 1)(s + 2)

0.1 1 π/T 10
log ω
1 (rad/sec)

GZOH (ejω )

0.1
G(jω)

G(jω)e−jωT /2
Magnitude
0.01

1 π/T 10
log ω
0 (rad/sec)

−90

G(jω)
−180
GZOH (ejω )

Phase (deg.) G(jω)e−jωT /2

2018-5-22 13.5

Digital control system design

Sampled-data closed-loop

y(k) y(t) u(t) u(k) r(k)


G(s) ZOH Kd (z) +
T

K(s) approximation
≈ K(s)

y(k) r(k)
G(s) ZOH Kd (z) +
T

2018-5-22 13.6
Design approaches

Continuous-time
design
G(s) K(s)

ZOH-equivalence Approximation
of G(s) and of K(s) with
sample/hold Kd (z)

GZOH (z) Kd (z)


Discrete-time
design

2018-5-22 13.7

Design approaches

Continuous-time
design
G(s) K(s)

Sampled-data
design
ZOH-equivalence Approximation
of G(s) and of K(s) with
sample/hold Kd (z)

GZOH (z) Kd (z)


Discrete-time
design

2018-5-22 13.8
Design by approximation

1. Design a continuous-time controller, K(s)


I Verify stability, performance and bandwidth
I Verify margins and robustness

2. Select a sample-rate, T

3. Find Kd (z) approximating K(s)

4. Calculate the ZOH-equivalent GZOH (z)

5. Check the stability of the GZOH (z), Kd (z) loop

6. Simulate Kd (z) with G(s) (including sample/hold).


I Verify simulated performance
I Examine intersample behaviour

2018-5-22 13.9

Controller approximation

Approach: approximating the integrators

y(t) x(t) y(k) x(k)


1/s ≈ F (z)

If F (z) ≈ 1/s, then, s ≈ F −1 (z), =⇒ Kd (z) = K(s) |s=F −1 (z)

1
I F (z)
s
sx(s) x(s) zx(z) x(z)

A B A B
y(s) u(s) y(z) u(z)
C D C D

2018-5-22 13.10
Integration

x(t)
y(t) x(t)
1/s
x(kT +T )
Z t
y(t) = y(0) + x(τ ) dτ,
0
x(kT )

y(kT +T ) − y(kT )
Time
[sec.]
kT kT +T

The signal, y(t), over a single T second sample period is,


Z kT +T
y(kT + T ) = y(kT ) + x(τ ) dτ.
kT

2018-5-22 13.11

Trapezoidal approximation
ŷ(kT + T ) = ŷ(kT ) + T x(kT ) + (x(kT + T ) − x(kT ))T /2.

Taking z-transforms,
T
z ŷ(z) = ŷ(z) + T x(z) + (z − 1)x(z),
2

Approximation: x(t)

ŷ(z) T z+1
= F (z) = . x(kT +T )
x(z) 2 z−1
So the substitution is,
2 z−1 x(kT )
s ←− .
T z+1
ŷ(kT +T ) − ŷ(kT )
Time
[sec.]
kT kT +T

This is known as a bilinear (or Tustin) transform.

2018-5-22 13.12
Frequency mapping
Pole locations under bilinear transform:
bilinear
{ s | real(s) < 0 } { z | |z| < 1 }
−→

K(s) stable ⇐⇒ Kd (z) stable.

imag imag
2π/T 1

2 (z−1)
s= T (z+1)
π/T

−→ real
real
−1 1

−π/T

−1
−2π/T

2018-5-22 13.13

Bilinear frequency distortion

Ω : discrete-frequencies: ejΩT , Ω ∈ (−π, π].

Frequency mapping:

Continuous frequencies, ω to discrete frequencies, Ω.


2 z−1
Substitute s = jω and z = ejΩT into s = :
T z+1
−jΩT

2 1−e 2 j sin(ΩT /2) 2
jω = −jΩT
= = j tan(ΩT /2).
T (1 + e ) T cos(ΩT /2) T

Frequency distortion:
2
Ω= tan−1 (ωT /2)
T

2018-5-22 13.14
Bilinear frequency distortion

2
Ω= tan−1 (ωT /2)
T

Discrete frequency
Ω [rad/sample]
π

Bilinear distortion

Continuous frequency
ω [rad/sec]

−3π/T −2π/T −π/T π/T 2π/T 3π/T

−π
Ω = ωT

The Ω = ωT line is the sampling mapping.


2018-5-22 13.15

Prewarping

α(z − 1)
s= , α ∈ (0, π/T ), maps {real{s} < 0} to {|z| < 1}.
(z + 1)

Modifying the frequency distortion


Select a frequency ωpw .

Solve for α such that K(jωpw ) = Kd ejωpw T .

The “prewarped” transform makes K(jω) = Kd (ejωT ) at ω = 0 and ω = ωpw .

α(ejωpw T − 1)
jω0 = = jα tan(ωpw T /2),
(ejωpw T + 1)
ωpw
which implies that: α= .
tan(ωpw T /2)

2018-5-22 13.16
Prewarping

2
Frequency distortion (bilinear:) Ω = tan−1 (ωT /2).
T

2
Frequency distortion (with prewarping): Ω = tan−1 (ω/α)
T

Discrete frequency
Ω [rad/sample]
π Prewarping distortion

Bilinear distortion

Continuous frequency
ωpw ω [rad/sec]

−3π/T −2π/T −π/T π/T 2π/T 3π/T

−π
Ω = ωT

2018-5-22 13.17

Controller approximations
Bilinear approximation: Kbl (ejω ), Prewarped Tustin approximation: Kpw (ejω )
10 Magnitude
Kbl (ejω )
10 ωpw K(jω)
1 log ω (rad/sec)

Kpw (ejω )
0.1

0.01

90

Kbl (ejω )
10
0 log ω (rad/sec)
ωpw

Kpw (ejω )
−90 K(jω)

Phase (deg.)
−180

2018-5-22 13.18
Choosing a prewarping frequency

The prewarping frequency must be in the range: 0 < ωpw < π/T .
I α = 2/T (standard bilinear) corresponds to ωpw = 0.

Possible options for ωpw depend on the problem:


I The cross-over frequency (helps preserve the phase margin);
I The frequency of a critical notch;
I The frequency of a critical oscillatory mode.

The best choice depends on the most important features in your control design.

Remember: K(s) stable implies Kd (z) stable.


But you must check that (1 + GZOH (z)Kd (z))−1 is stable!

2018-5-22 13.19

Example

Plant model:

5(1 − s/zrhp ) (s2 + 2ζηωm s + η 2 ωm


2
) 1
G(s) =
(1 + τ s) (s + 2ζωm s + ωm ) η 2
2 2

where τ = 0.5, zrhp = 70, ωm = 20, ζ = 0.05, and η = 1.2.

IMC desgn
Tideal (s) = 3rd order Butterworth filter with bandwidth: 25 [rad./sec.]

Q(s) = Tideal (s)G−1


mp (s)

K(s) = (I − Q(s)G(s))−1 Q(s).

2018-5-22 13.20
Loopshapes
100 Magnitude

L(jω)
10
K(jω)
G(jω) 1 10 100
1 log ω (rad/sec)

0.1

0.01

0.001

90

1 10 100
0 log ω (rad/sec)
K(jω)

−90
L(jω)
G(jω)
−180

Phase (deg.)
−270

2018-5-22 13.21

Sensitivity and complementary sensitivity

Magnitude
10

2
S(jω)
10 100
1 log ω (rad/sec)

T (jω)

0.1

2018-5-22 13.22
Step response
Output

Amplitude
1.4

1.2

1.0

0.8

0.6

0.4 y(t)

0.2

0 time (sec)
0.5 1.0 1.5 2.0
−0.2

2018-5-22 13.23

Step response

Actuation
Amplitude
1.4

1.2
u(t)
1.0

0.8

0.6

0.4

0.2

0 time (sec)
0.5 1.0 1.5 2.0
−0.2

2018-5-22 13.24
Bilinear/Trapezoidal/Tustin transform

Bilinear transform
π
Nyquist frequency: 100 radians/second =⇒ T = .
100


Kbl (z) = K(s) 2 z−1
s= T z+1

Discrete-time analysis
GZOH (z)

y(k) r(k)
G(s) ZOH Kd (z) +
T

2018-5-22 13.25

Loopshapes: bilinearly transformed controller


100 Magnitude

10
1 10 100
1 log ω (rad/sec)
Kd (ejω )
G(jω)
0.1
GZOH (ejω )

0.01 Ld (ejω )
K(jω)
0.001 L(jω)
90

1 10 100
0 log ω (rad/sec)

−90
G(jω)
−180
GZOH (ejω ) K(jω)
Phase (deg.)
−270 Ld (ejω ) Kd (ejω )
L(jω)

2018-5-22 13.26
Sensitivity and complementary sensitivity: bilinearly transformed controller

Magnitude
10

2
S(jω)

1 log ω (rad/sec)
10 100
Sd (ejω )

Td (ejω )
T (jω)

0.1

2018-5-22 13.27

Step response: bilinearly transformed controller


Output

Amplitude
1.4

y(k)
1.2

1.0

0.8

0.6 y(t)

0.4

0.2

0 time (sec)
0.5 1.0 1.5 2.0
−0.2

2018-5-22 13.28
Step response: bilinearly transformed controller

Actuation
Amplitude
1.4

1.2
u(t)
1.0

0.8
u(k)

0.6

0.4

0.2

0 time (sec)
0.5 1.0 1.5 2.0
−0.2

2018-5-22 13.29

Prewarped Tustin transform

Prewarped Tustin transform

π
Nyquist frequency: 100 radians/second =⇒ T = .
100
Select the prewarping frequency at ωpw = ωm (20 radians/sec.).


Kpw (z) = K(s) z−1
s=α z+1

where,
ωpw
α= .
tan(ωpw T /2)

2018-5-22 13.30
Loopshapes: prewarped Tustin controller
100 Magnitude

10
1 10 100
1 log ω (rad/sec)
Kd (ejω )
G(jω)
0.1
GZOH (ejω )

0.01 Ld (ejω )
K(jω)
0.001 L(jω)
90

1 10 100
0 log ω (rad/sec)

−90
G(jω)
−180
GZOH (ejω ) K(jω)
Phase (deg.)
−270 Ld (ejω ) Kd (ejω )
L(jω)

2018-5-22 13.31

Sensitivity and complementary sensitivity: prewarped Tustin controller

Magnitude
10

2
S(jω)

1 log ω (rad/sec)
10 Sd (ejω ) 100

Td (ejω )
T (jω)

0.1

2018-5-22 13.32
Step response: prewarped Tustin controller
Output

Amplitude
1.4

y(k)
1.2

1.0

0.8

0.6 y(t)

0.4

0.2

0 time (sec)
0.5 1.0 1.5 2.0
−0.2

2018-5-22 13.33

Step response: prewarped Tustin controller

Actuation
Amplitude
1.4

1.2
u(t)
1.0

0.8
u(k)

0.6

0.4

0.2

0 time (sec)
0.5 1.0 1.5 2.0
−0.2

2018-5-22 13.34
Sample rate selection

Sample rate selection is critical to digital control design.

Main considerations
I Sampling/ZOH will (approximately) introduce a delay of T /2 seconds.

I Anti-aliasing filters will need to be designed and these will also introduce
phase lag.

I The system runs “open-loop” between samples.

I Very fast sampling can introduce additional noise.

I Very fast sampling makes all of the poles appear close to 1. The controller
design can become numerically sensitive.

2018-5-22 13.35

Designing for digital implementation

Sampled-data implementation
d(t)
Gd (s)

r(k)
y(t) u(t) u(k)
+ G(s) ZOH Kd (z)

n(t) ym (t) ỹm (t)


+ Fa (s) ỹm (k)
T

Continuous-time design
d(t)
Gd (s)

r(t)
y(t) u(t)
+ G(s) e−sT /2 K(s)

n(t) ym (t) ỹm (t)


+ Fa (s)

2018-5-22 13.36
Sensitivity function

We want a similar discrete sensitivity function up to the frequency where


|Ŝd (jω)| returns to 1.

Magnitude
5
Ŝd1 (jω)
1 10
log ω
1 (rad/sec)
π/T1
ωB

S(jω)
0.1

0.01

Ŝd (s) = (I + Fa (s)G(s)e−sT1 /2 K(s))−1 Approximate discrete sensitivity

2018-5-22 13.37

Sensitivity function

In this example, for ω > 20 rad./sec.,

|1 − Ŝd (jω)|  1 =⇒ π/T = 20 is about the minimum.

Magnitude
5
Ŝd1 (jω)
10 20
ω
1 (rad/sec)
π/T1
ωB

S(jω)
0.1

0.01

Ŝd (s) = (I + Fa (s)G(s)e−sT1 /2 K(s))−1

2018-5-22 13.38
Loop-shaping interpretation
For ω up to where |Fa (jω)G(jω)K(jω)| <  and remains very small,
   
we want Fa (jω)G(jω)K(jω)e−jωT1 /2 ≈ Gd ejωT1 Kd ejωT1 .
(Gd (z) is the ZOH-equivalent of Fa (s)G(s))

imag

|S(jω)| > 1

−1 1 real

−j
L̂d1 (jω) L(jω)

2018-5-22 13.39

Discrete-time sensitivity function

What is the actual discrete sensitivity function,


1
Sd (s) = for π/T1 = 20.9 [rad./sec.]?
(1 + Gd (ejω ) Kd (ejω ))

Magnitude
5
Sd1 (jω) Ŝd1 (jω)
1 10
log ω
1 (rad/sec)
π/T1
ωB

S(jω)
0.1

0.01

Kd (z) is a prewarped Tustin approximation with ωpw = ωB .

2018-5-22 13.40
Discrete-time loopshape: Ld1 (s) = Gd (s)Kd (s), T1 = 0.15 seconds

Gd (s) is a ZOH-equivalent transform of G(s).


Kd (z) is a prewarped Tustin approximation with ωpw = ωB .

imag

|S(jω)| > 1

−1 1 real

Ld1 (jω)

−j
L̂d1 (jω) L(jω)

2018-5-22 13.41

Choosing a slower sample rate.

Choosing T2 = 0.5 seconds =⇒ π/T2 = 6.28 rad./sec.

Magnitude
50
Ŝd2 (jω)
10
Sd2 (jω)
S(jω)
1 10
log ω
1 (rad/sec)
π/T2
ωB

0.1

0.01

Kd (z) is a prewarped Tustin approximation with ωpw = ωB .

2018-5-22 13.42
Choosing a slower sample rate.
Choosing T2 = 0.5 seconds =⇒ π/T2 = 6.28 rad./sec.

imag

L̂d2 (jω)

−1 1 real
Ld2 (jω)

−j
L(jω)

2018-5-22 13.43

Fast sampling

Fast sampling period: Tf .

Control appropriate (slower) sampling period: Ts


(typically Ts = M Tf for integer M > 1).

ỹs (k) ỹ(t) y(t)


Fas (z) Faf (s)
Ts Tf

Digital Digital Fast Anti-aliasing


downsampling filter sampler filter

2018-5-22 13.44

You might also like