Discrete-time systems
Objective: Designing digital control systems.
These typically arise in one of two ways:
• The system we wish to control is digital.
For example:
− NYSE end of day prices;
− Internet traffic;
− Number of students in ECE 147b.
• The system is continuous and we are sampling it via an A/D board and actuating it via
a D/A board.
For example:
− Electromechanical systems (robots, motors, vehicles);
− Complex chemical production processes.
− Biological processes.
The measurements and the actuation are also quantized. This may or may not be a
significant issue in the control design.
Roy Smith: ECE 147b 1: 1
Digital control systems
Control is a hidden technology:
When it works well nobody notices!
Espresso machine: 1 or 2 loops (temperature, pressure).
Automobile: 5 to 20 control loops (engine, climate, brakes, radio)
Mars rovers: 10 to 20 control loops (navigation, speed control)
Aircraft: 50 or more loops (flight control, servos, redundancy)
Process control: 100 to 1000 control loops (levels, temperature, pressures)
And when it doesn’t the results can be catastrophic.
Saab aircraft crash: pilot/control system interaction
Chernobyl nuclear reactor: operation at an unstable condition
Roy Smith: ECE 147b 1: 2
Digital control systems
Why digital?
Key aspects:
− Easily reprogrammed (cf. changing resistors/capacitors in an analog control circuit).
− Easier to implement complicated algorithms.
− Integration with remote systems and digital communication.
− More detailed user interface (terminal or web based).
− Cost is going down and speed is going up.
Why analog?
Some applications are still analog:
− Simple, mass produced systems (toaster, thermostat).
− Very high frequency control loops.
− Highly reliable simple control systems.
− On-chip integrated systems (e.g. electrostatic gyroscopes).
Roy Smith: ECE 147b 1: 3
Digital control systems
A few examples:
Roy Smith: ECE 147b 1: 4
Digital control systems
Typical digital control system
y(k) y(t) u(t) u(k)
r(k)
v @
@ P (s) ZOH C(z) +
T
6
−
Components:
− Plant: P (s), continuous time
− Controller: C(z), discrete-time
− Sampler (A/D board): y(k) = y(t) |t=kT for k = 0, 1, 2, . . .
− Zero-order-hold (D/A) board: u(t) = u(kT ) for kT ≤ t < kT + T .
Roy Smith: ECE 147b 1: 5
Components
Sampler: y(k) = y(t) |t=kT , k = 0, 1, 2, . . . . T is the sampling period.
4
y(k)
3
2 y(t)
1
Continuous signal: 0
-1
-2
0 T 2T 3T 4T 5T 6T
Time: t
4
y(k)
3
2
1
Discrete sequence: 0
-1
-2
0 1 2 3 4 5 6
Time index: k
Roy Smith: ECE 147b 1: 6
Components
Zero-order hold: u(t) = u(k), for kT ≤ t < kT + T.
4
u(k)
3
2
1
Discrete sequence: 0
-1
-2
0 1 2 3 4 5 6
Time index: k
4
u(k) u(t)
3
2
1
Continuous signal: 0
-1
-2
0 T 2T 3T 4T 5T 6T
Time: t
Roy Smith: ECE 147b 1: 7
Consequences
y(t) u(k) u(t)
@
ZOH @
T
4
y(k)
3
2 y(t)
1
Input signal: u(t) 0
-1
-2
0 T 2T 3T 4T 5T 6T
Time: t
4
u(k) u(t)
3
2
1
Output signal: y(t) 0
-1
-2
0 T 2T 3T 4T 5T 6T
Time: t
Roy Smith: ECE 147b 1: 8
More consequences
Quantization
y(t)
1 LSB
spacing
y(t) u(k) u(t)
@
ZOH @
T u(t)
Potential error of ±1/2 LSB in the best case.
Example: 12 bit A/D and D/A on a ±10 volt scale: 1 LSB = 0.00488 volts.
Roy Smith: ECE 147b 1: 9
Design Approaches
Objective: Design C(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
Roy Smith: ECE 147b 1: 10
Design Approaches
Approach: Design C(s) and choose C(z) to approximate C(s)
y(k) u(k)
r(k)
v @
@ P (s) ZOH C(z) +
T
6
−
C(s)
u(t) e(t) u(t) u(k) e(k) e(t)
@
C(s) ≈ ZOH C(z) @
T
Roy Smith: ECE 147b 1: 11
Design Approaches
Approach: Model P (z) (equivalent to P (s) at samples), and design C(z).
P (z)
y(k) y(t) u(t)
r(k)
v @
@ P (s) ZOH C(z) +
T
6
−
y(k) y(t) u(t) u(k) y(k) u(k)
f @
@ f f f
P (s) ZOH = P (z)
T
Roy Smith: ECE 147b 1: 12
Design Approaches
Objective: Design C(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
Roy Smith: ECE 147b 1: 13
Experiments
Preview: Inverted pendulum experiment
Balance the pendulum, θ = 0, in the center of the track, p = 0.
Control is via a motor driven cart carrying the pendulum.
θ Pendulum
Cart
Track
Roy Smith: ECE 147b 1: 14
Experiments
Preview: A successful design
0.06 Position (meters)
Measured
0.04
Estimated
0.02
- 0.02
0 0.5 1 1.5 2 2.5 3 3.5 4
time (seconds)
0.1 Angle(radians)
0.08 Estimated
0.06
Measured
0.04
0.02
0 0.5 1 1.5 2 2.5 3 3.5 4
time (seconds)
Roy Smith: ECE 147b 1: 15
Experiments
Preview: A successful design
Roy Smith: ECE 147b 1: 16