Direct digital design
Calculating C(z) to control P (z)
Continuous-time
design
P(s) C(s)
Model P(s), and
sample/hold as Approximation
P(z) of C(s) with C(z)
P(z) C(z)
Discrete-time
design
• ZOH equivalence gives P (z).
• Design C(z) for good closed-loop control of P (z)
Roy Smith: ECE 147b 7: 1
Direct digital design
Design methods for P (z)
1
• Pole placement for
1 + P (z)C(z)
• Frequency response based designs (loopshaping)
• Root locus
• Tuning PID controllers
The above methods are analogous to the continuous time methods (except for the different
interpretation between s-plane and z-plane).
The following does not have a continous time analogue.
• Finite settling time (deadbeat) control.
Roy Smith: ECE 147b 7: 2
Deadbeat control
Ideal closed-loop response:
y(k) r(k)
& M(z) &
Consider the best possible closed-loop response:
M(z) = z −1
z
A step input, r(z) =
z−1
1
Gives y(z) = (a delayed step output).
z−1
The error (e(z) = r(z) − y(z)) is simply a unit pulse: e(z) = 1.
Roy Smith: ECE 147b 7: 3
Deadbeat control
Approach:
y(z) #$
r(z)
! % P (z) ! C(z) ! +!
!"
"
−
P (z)C(z)
The closed-loop response is: M(z) = .
1 + P (z)C(z)
So:
• Choose M(z), the desired closed-loop response.
• Solve the above to get C(z).
Roy Smith: ECE 147b 7: 4
Deadbeat control
Approach:
P (z)C(z)
M(z) = .
1 + P (z)C(z)
So,
P (z)C(z) = M(z) + M(z)P (z)C(z)
C(z)P (z)(1 − M(z)) = M(z)
Which gives,
1 M(z)
C(z) =
P (z) (1 − M(z))
Ideal case: M(z) = z −1
1 z −1
C(z) =
P (z) (1 − z −1 )
Why can’t we do this for continuous time systems ?
Roy Smith: ECE 147b 7: 5
Deadbeat control
Example:
1
P (s) = A double integrator: e.g. satellite force to position response
s2
ZOH equivalent
! "
P (s)
P (z) = (1 − z −1 )Z
s
! "
−1 1
= (1 − z )Z
s3
2 −1
T z (1 + z −1 )
= (1 − z −1 )
2(1 − z −1 )3
2 −1
T z (1 + z −1 )
=
2 (1 − z −1 )2
Roy Smith: ECE 147b 7: 6
Deadbeat control
Example:
1
P (s) = A double integrator: e.g. satellite force to position response
s2
Ideal response: M(z) = z −1
1 z −1 2 (1 − z −1 )2 z −1
C(z) = =
P (z) (1 − z −1) T 2 z −1(1 + z −1 ) (1 − z −1 )
−1
2 (1 − z ) 2 (z − 1)
= 2 =
T (1 + z −1 ) T 2 (z + 1)
In the time domain:
2 (1 − z −1)
u(z) = e(z)
T 2 (1 + z −1 )
2 −1 −1
u(z)T (1 + z ) = 2(1 − z )e(z)
T u(k) + T 2u(k − 1) = 2e(k) − 2e(k − 1)
2
2 2
u(k) = −u(k − 1) + 2 e(k) − 2 e(k − 1)
T T
This is causal.
Roy Smith: ECE 147b 7: 7
Deadbeat control
Deadbeat control example:
1
P (s) = desired response: M(z) = z −1
s2
1.5
Sampled plant output, y(k)
0.5
0
5 10 15 20 25
Time: seconds
-0.5
-1 Controller output, u(k)
-1.5
Roy Smith: ECE 147b 7: 8
Deadbeat control
Intersample behavior
1
P (s) = desired response: M(z) = z −1
s2
2
Plant output, y(t) Sampled plant output, y(k)
1.5
0.5
0
5 10 15 20 25
Time: seconds
-0.5
-1 Controller output, u(k) Plant input, u(t)
-1.5
Roy Smith: ECE 147b 7: 9
Deadbeat control
Sample rate selection
5
P (s) = , desired response: M(z) = z −1
(s2 + 2s + 5)
1. 4
Sampled plant output, y(k)
1. 2
Plant input, u(t)
0. 8
Controller output, u(k) Sample period:
0. 6
T = 1.0 seconds
0. 4 Plant output, y(t)
0. 2
0
0 1 2 3 4 5 6 7 8 9 10
Time: seconds
Roy Smith: ECE 147b 7: 10
Deadbeat control
Sample rate selection
5
P (s) = , desired response: M(z) = z −1
(s2 + 2s + 5)
2.5
Sampled plant output, y(k)
1.5
Plant output, y(t)
1
Sample period:
0.5
T = 0.5 seconds
Plant input, u(t)
0
Controller output, u(k)
-0.5
-1
0 1 2 3 4 5 6 7 8 9 10
Time: seconds
Roy Smith: ECE 147b 7: 11
Deadbeat control
Sample rate selection
5
P (s) = , desired response: M(z) = z −1
(s2 + 2s + 5)
1.4
1.2 Controller output, u(k)
Sampled plant output, y(k)
1
0.8
Plant input, u(t) Sample period:
0.6
T = 2.0 seconds
Plant output, y(t)
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time: seconds
Roy Smith: ECE 147b 7: 12
Deadbeat control
Sample rate selection comparison
5
P (s) = , desired response: M(z) = z −1
(s2 + 2s + 5)
1.4
Plant output, y(t), T = 0.5 seconds
Plant output, y(t), T = 1.0 seconds
1.2
0.8
Plant output, y(t), T = 2.0 seconds
Plant output:
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time: seconds
Roy Smith: ECE 147b 7: 13
Deadbeat control
Sample rate selection comparison
5
P (s) = , desired response: M(z) = z −1
(s2 + 2s + 5)
2.5 Plant input, u(t), T = 0.5 seconds
2
Plant input, u(t), T = 1.0 seconds
1.5
Plant input:
0.5
Plant input, u(t), T = 2.0 seconds
-0.5
-1
0 1 2 3 4 5 6 7 8 9 10
Time: seconds
Roy Smith: ECE 147b 7: 14
Deadbeat control
Potential problems:
1. An aggressive design can lead to poor intersample behavior.
2. Making the sampling faster, without modifying the closed-loop requirement
(e.g. M(z) = z −1 ), makes the design more aggressive.
3. The calculated controller may not be causal if the specified response, M(z), is “faster”
than the system can respond.
4. P (z)C(z) could have an unstable pole/zero cancellation. Note that
1 M(z)
C(z) = ,
P (z) (1 − M(z))
and if P (z) has a zero outside the unit circle, the C(z) will have a pole outside the unit
circle.
Be aware that the zeros of P (z) will change as a the sampling period changes.
Roy Smith: ECE 147b 7: 15