Professional Documents
Culture Documents
Dr. AbdullaIsmail
Professor of Electrical Engineering
axicad@rit.edu
Digital Control
As in the case of analog control, mathematical models are needed for the
analysis and design of digital control systems.
A common configuration for digital control systems is shown in Figure 1.
The configuration includes a digital-to-analog converter (DAC), an
analog subsystem, and an analog-to-digital converter (ADC).
The DAC converts numbers calculated by a microprocessor or computer
into analog electrical signals that can be amplified and used to control an
analog plant.
The analog subsystem includes the plant as well as the amplifiers and
actuators necessary to drive it.
Figure 1
3
Digital Control
We begin by developing models for the ADC and DAC, then for the
combination of DAC, analog subsystem, and ADC.
4
Digital Control
ADC Model
The ADC can be modeled as an ideal
sampler with sampling period T as shown
in Figure 2.
DAC Model
The input-output relationship of the DAC is given by
(1)
Figure 2.
5
Digital Control
Figure 3
ADC
DAC
Digital Control
7
Digital Control
Digital Control
Figure. (a) Input signal to an ideal sampler. (b) Output signal of an ideal
sampler. (c) Output signal of a zero-order-hold (ZOH) device.
Digital Control
10
Digital Control
We now have
11
Digital Control
Digital Control
Figure 4
12
For a linear time invariant (LTI) system with impulsesampled input, the output is given by
15
Digital Control
Digital Control
16
19
Digital Control
20
Digital Control
Using the DAC model given before, and assuming that the
transfer function of the analog subsystem is G(s), the
transfer function of the DAC and analog subsystem
cascade is
21
Digital Control
Figure: Impulse
response of a DAC and
analog subsystem.
(a) Response of an
analog system to step
inputs. (b) Response of
an analog system to a
unit pulse input.
22
Digital Control
Example 2
Find GZAS(z) for the cruise control system for the vehicle
shown in Figure 1, where u is the input force, v is the velocity
of the car, and b is the viscous friction coefficient.
Solution
We first draw a schematic to represent the cruise control
system as shown in Figure right.
Using Newtons law, we obtain the following model:
Digital Control
24
Example 2 .. Solution
Example 2 .. Solution
The corresponding partial fraction expansion is
where
Using
Example 3
Find GZAS(z) for the series R-L circuit shown
in Figure with the inductor voltage as
output.
Solution
Using the voltage divider rule gives
Hence, using
,we obtain
27
Digital Control
Figure 1
Digital Control
Figure 2
28
Digital Control
29
30
Digital Control
Digital Control
31
Digital Control
32
33
Digital Control
Digital Control
34
35
Digital Control
or in terms of z as
Digital Control
36
Digital Control
37
Digital Control
38
Digital Control
39
The standard inputs considered are the sampled step, the sampled
ramp, and the sampled parabolic.
Digital Control
40
Digital Control
Figure 2
Figure 1
41
42
43
Digital Control
44
46
Digital Control
Digital Control
47
Digital Control
48
due to a Parabolic or
Exponential input
Digital Control
49
Solution
The loop gain of the system is given by
Digital Control
51
Solution
The transfer function of the system can be written as
Thus, the position error constant for analog control is K/a,
and the steady-state error is
52
Digital Control
MATLAB Commands
The transfer function for the ADC, analog subsystem, and
DAC combination can be easily obtained using the MATLAB.
Assume that the sampling period is 0.1 s and that the transfer
function of the analog subsystem is G.
The MATLAB command to obtain a digital transfer function
from an analog transfer function is
MATLAB Commands
For example, the numerator polynomial (2s2 + 4s + 3) is
entered as
BACKUP SLIDES
Digital Control
56
57
Digital Control
58
Digital Control
59
Digital Control
60
Digital Control
61
Digital Control
62
Digital Control
In practice, finite bandwidth is an idealization associated with infiniteduration signals, whereas finite duration implies infinite bandwidth.
To show this, assume that a given signal is to be band limited. Band
limiting is equivalent to multiplication by a pulse in the frequency
domain.
By the convolution theorem, multiplication in the frequency domain is
equivalent to convolution of the inverse Fourier transforms.
Hence, the inverse transform of the band-limited function is the
convolution of the original time function with the sinc function, a
function of infinite duration.
We conclude that a band-limited function is of infinite duration.
In practice, the sampling rate chosen is often larger than the
lower bound specified in the sampling theorem. A rule of thumb
is to choose s as
The choice of the constant k depends on the application.
63
Digital Control
MATLAB Files
c2d
Convert model from continuous to discrete time
Syntax
sysd = c2d(sys,Ts)
sysd = c2d(sys,Ts,method)
sysd = c2d(sys,Ts,opts)
[sysd,G] = c2d(sys,Ts,method)
[sysd,G] = c2d(sys,Ts,opts)
Sys is Continuous-time
dynamic system model
Sysd is Discrete-time
dynamic system model
Ts is Sampling Time
Description
sysd = c2d(sys,Ts) discretizes the continuous-time dynamic system model sys using zero-order
hold on the inputs and a sample time of Ts seconds.
sysd = c2d(sys,Ts,method) discretizes sys using the specified discretization method method.
sysd = c2d(sys,Ts,opts) discretizes sys using the option set opts, specified using the
c2dOptions command.
[sysd,G] = c2d(sys,Ts,method) returns a matrix, G that maps the continuous initial conditions x0
and u0 of the state-space model sys to the discrete-time initial state vector x [0]. method is
64
optional. To specify additional discretization options, use [sysd,G] = c2d(sys,Ts,opts).
MATLAB Files
Example
Discretize the continuous-time transfer function:
with input delay Td = 0.35 second. To discretize this system using the triangle (firstorder hold) approximation with sample time Ts = 0.1 second, type
H = tf([1 -1], [1 4 5], 'inputdelay', 0.35);
Hd = c2d(H, 0.1, 'foh'); % discretize with FOH method and
% 0.1 second sample time
Transfer function:
0.0115 z^3 + 0.0456 z^2 - 0.0562 z - 0.009104
--------------------------------------------z^6 - 1.629 z^5 + 0.6703 z^4
Sampling time: 0.1
Digital Control
65
MATLAB Files
Example
The next command compares the continuous and discretized step responses.
step(H,'-',Hd,'--')
Digital Control
66
MATLAB Files
d2c Converts discrete-time dynamic system to continuous time.
SYSC = d2c(SYSD,METHOD)
computes a continuous-time model SYSC that approximates the discretetime model SYSD. The string METHOD selects the conversion method
among the following:
'zoh'
Zero-order hold on the inputs
'foh'
Linear interpolation of inputs
'tustin' Bilinear (Tustin) approximation
'matched' Matched pole-zero method (for SISO systems only)
The default is 'zoh' when METHOD is omitted.
Digital Control
67
MATLAB Files
Example
Consider the discrete-time model with transfer function
and sample time Ts = 0.1 s.
You can derive a continuous-time zero-order-hold equivalent model by typing
Hc = d2c(H)
Discretizing the resulting model Hc with the default zero-order hold method and
sampling time Ts = 0.1s returns the original discrete model H(z):
c2d(Hc,0.1)
To use the Tustin approximation instead of zero-order hold, type
Hc = d2c(H,'tustin')
As with zero-order hold, the inverse discretization operation
c2d(Hc,0.1,'tustin')
gives back the original H(z).
Digital Control
68