0% found this document useful (0 votes)
208 views32 pages

Digital Control: Fundamentals: ENGI 7825: Control Systems II Andrew Vardy

This document provides an introduction to digital control systems. It discusses how computers are discrete-time systems incorporated into modern control systems, and how they offer advantages over analog components like being customizable through software. It contrasts digital and analog components. Notation for discrete-time signals is introduced. Sampled data systems that have both continuous and discrete-time components are described, involving analog-to-digital conversion and zero-order holding. Key differences between continuous and discrete-time systems are that discrete systems are governed by difference equations rather than differential equations. The z-transform, which is the tool for analyzing discrete systems analogous to the Laplace transform for continuous systems, is motivated and its definition provided.

Uploaded by

Zhraa Nor
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)
208 views32 pages

Digital Control: Fundamentals: ENGI 7825: Control Systems II Andrew Vardy

This document provides an introduction to digital control systems. It discusses how computers are discrete-time systems incorporated into modern control systems, and how they offer advantages over analog components like being customizable through software. It contrasts digital and analog components. Notation for discrete-time signals is introduced. Sampled data systems that have both continuous and discrete-time components are described, involving analog-to-digital conversion and zero-order holding. Key differences between continuous and discrete-time systems are that discrete systems are governed by difference equations rather than differential equations. The z-transform, which is the tool for analyzing discrete systems analogous to the Laplace transform for continuous systems, is motivated and its definition provided.

Uploaded by

Zhraa Nor
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/ 32

Digital

Control:
Fundamentals
ENGI 7825: Control Systems II
Andrew Vardy
Introduction
• So far we have considered only continuous-time (CT) systems.
However, computers are very often incorporated into modern control
systems. Computers are discrete-time (DT) components.
• Computers have the following advantageous characteristics for
control systems:
– They continuously grow both faster and cheaper; Microcontrollers
(complete computer on one IC) often cost < $5
– Fully customizable through software
– Operation is static and largely invariant to environmental conditions
• We can contrast digital computers with analog electronic components
(e.g. resistors, inductors, capacitors, op-amps)
– Not easily customizable once installed and may deviate from specs
– Affected by variations in temperature
– Produce analog (i.e. CT) signals which are quite susceptible to noise
Notation
• The material to come on Digital Control comes from
different sources:
– “Feedback Control of Dynamic Systems”, 6th Edition, by Franklin,
Powell, and Emami-Naeini (Sections 8.1, 8.2)
– “Feedback Control Systems”, 5th Edition, by Phillips and Parr
(Sections 11.6, 11.7, 11.8, 12.9, 13.4, 14.2)
– “Control Systems Engineering”, 5th Edition, by Nise (z-transform
tables)
– “Linear System Theory and Design”, 4th Edition by Chen (Section
4.2)
• The notation will consequently vary:
– Quantities with unqualified references to time are continuous-
time: e.g. u(t)
– Quantities which refer to integer multiples of the sampling
period, T, are discrete samples: e.g. u(kT)
• Often the T is dropped, leaving an index k: u(k)
• Sometimes square brackets are used for discrete-time signals: u[k]
unique relationship between the excitation and response, input and output, or cause and effect
is essential in defining a system. A system with only one input terminal and only one output
terminal is called a single-variable system or a single-input single-output (SISO) system.
A system with two or more input terminals and/or two or more output terminals is called

Discrete-Time Systems
a multivariable system. More specifically, we can call a system a multi-input multi-output
(MIMO) system if it has two or more input terminals and output terminals, a single-input
multi-output (SIMO) system if it has one input terminal and two or more output terminals.

Figure 2.1 System.


5
Discrete-time signals are sequences of numbers (e.g. u[k] and y[k]) above. They may
be sampled from CT signals (as above) or they may be produced by inherently discrete
processes.
Sampled Data Systems
• A system with both CT and DT components is often
referred to as a sampled data system
• In practice, most control systems are sampled data
systems
• An analog-to-digital (A/D) converter samples a
physical variable and translates it into a digital
number
– We usually assume this occurs at a fixed sampling
period, T
• In most sampled data systems, a digital controller
replaces a continuous controller as shown...
560 Chapter 8 Digital Control
Figure 8.1
Continuous controller Plant
Block diagrams for a
basic control system: 1'(1) G(s) yet)
(a) continuous system;
(b) with a digital Sensoc
computer

Ca)

Plant

r(t) GCs) y( I)

Sensor

(b)

• If the input is CT then r(t) must be sampled as shown. However, the


input will often be DT in which case no sampling is required on the
input. case the sample petiod is fixed essentially by the length of the code, provided that no
logic branches are present, which could vary the amount of code executed.
There also may be a sampler and an AID converter for the input command rCt),
• The D/A converter converts the controller output to an
analog signal which is held until the next period of
duration T. This is known as zero-order hold (ZOH).
ZOH incurs an average delay of T/2.
8.2 Dynamic Analysis of Discrete Systems
Figure 8.2 u
The delay due to the u(k7)
hold operation Continuous control, u(t)

Control from D/A

2 3 4 5 6 7 8 kT

• This delay is one reason we generally wish to increase


controller. Slower sample rates can be used if orne adju lments are made i
digital cOlltroller or orne performance degradation i acceptable. Use of the di
the frequency of the digital controller’s operation.
design method described in Section 8.6 allow for a much lower ample r
that is desirable to minimize hardware costs; however, be t performance of a d
controller is obtained when the sample rate is greater than 2S limes th bandwi
It is worth noting that the single most important impact of implementing a co
For discrete systems a similar procedure is available. The z-transform IS
defined by
Fundamental Differences
Z(f(k)} = F(z) = Lf(k)z-k,
00

(8.2)
k=O
• CT systems are governed by differential equations
wheref(k) is the sampled version off(t), as shown in Fig. 8.3, and k = 0, 1,2,3, ...
refers to discrete sample times to, tl, t2, 13, .... This leads directly to a property
• For DT systems the notion of a derivative is not so
analogous to Eq. (8.1), specifically, that
well defined; DT systems are governed by difference
ZIf(k - I)} = Z-IF(Z). (8.3)
equations
This relation allows us to easily find the transfer function of a discrete system, given the
• The following is a general 2 nd order difference
difference equations of that system. For example, the general second-order difference
equationequation:
y(k) = -aly(k - I) - a2y(k - 2) + bou(k) + blu(k - 1) + b2U(k - 2)

The “new value” at y(k) is obtained from the past


can be• converted from this form to the z-transform of the variables y(k), u(k), ... by
invokingvalues of y(k-1) and y(k-2) as well as current and past
Eq. (8.3) once or twice to arrive at
2)y(Z) + (bo + blz- I + b2Z- 2)U(Z).
values of u.
Y(z) = (-alz- I
- a2Z- (8.4

Equation (8.4) then results in the discrete transfer function


I 2
f u(t) consists of steps (see Fig. 8.2) that on average, are delayed
8.2 Dynamic Analysis of Discrete System
as shown io the figure. If we simply incorporate thi T/2 delay into

Motivation for the Z-Transform


sis of Lhe ystem. an excellent prediction of the effects of sampling
rates much slower The z-transform
than is the mathematical
20 times bandwidth. toolthi
We will d! Cll for the analysis of
8.3 .3. plays the same role for discrete systems that the Laplace tran
systems. This section will give a short description of the z-
• Why did we ever start using the Laplace
c Analysis ofin Discrete
analyzing discrete
Systems systems, and show how it relates to th
Transform (LT) for control systems?
– The LT simplifies the treatment of derivatives,
the mathematical tool for the
8.2.1 analysis of linear discrete systems. It
z-Transform
allowing differential equations to be easily solved
for discrete systems that the Laplace transfotID does for continuous
on will give aand allowing transfer functions to be found
short
In description
the analysis of the
ofz-transform,
continuousdescribe
systems,its use
we use the Lap
te systems, and show howby
defined it relates to the Laplace transform.
• Recall the definition of the LT and the crucial 00
orm .c{f(t)} = F(s) = 10 f(t)e- si dt
identity that establishes the LT of a derivative
under zero initial conditions:
continuous systems, we use the Laplace transfOlID, which is
which leads directly to the important property that (with ze
00

.c{f(t)} = F(s) = 10 f(t)e- si dt, .cif(t)} = sF(s).


Definition Derivative property of LT
of LT that (with zero initial conditions)
y to the important property
Relation (8.1) enables us easily to find the transfer functi
_ _ _ __ _L -_ _ _ _ _ _
_ _ _ __ _L -_ _ _ _ _ _ ______
Z-Transform
______ ______
______
o T 2T 3T
o T 2T 3T
• The z-transform is the counterpart of the Laplace
transform for DT systems. It is defined as follows:
For discrete systems a similar procedure is available. The z-transform IS
For discrete systems a similar procedure is available. The z-transform
defined by IS
00
defined by
Z(f(k)} = F(z) = Lf(k)z-k,
00 (8.2)
k=O
Z(f(k)} = F(z) = Lf(k)z-k, (8.2)
wheref(k) is the sampled version off(t), as shown in Fig. 8.3, and k = 0, 1,2,3, ...
Note that k is an index referring to discrete sample times.
• refers k=O
to discrete sample times to, tl, t2, 13, .... This leads directly to a property
wheref(k) is the sampled version off(t), as shown in Fig. 8.3, and k = 0, 1,2,3, ...
Like s, z is a complex variable.
analogous to Eq. (8.1), specifically, that
refers to discrete sample times to, tl, t2, 13, .... This leads directly to a property
• Analogous to the derivative property of the LT we have:
analogous ZIf(k
to Eq. (8.1), specifically, - I)} = Z-IF(Z).
that (8.3)
This relation allows us to easily find the
ZIf(k transfer
- I)} function of a discrete system, given the
= Z-IF(Z). (8.3)
difference equations of that system. For example, the general second-order difference
This allows us to turn difference equations into transfer
This• equation
relation allows us to easily find the transfer function of a discrete system, given the
functions in the same way as the derivative property in
difference equations of that system. For example, the general second-order difference
y(k) = -aly(k - I) - a2y(k - 2) + bou(k) + blu(k - 1) + b2U(k - 2)
equation
the Laplace domain.
can be converted from this form to the z-transform of the variables y(k), u(k), ... by
y(k) = Eq.
invoking -aly(k I) or
(8.3) -once - twice 2) +atbou(k) + blu(k - 1) + b2U(k - 2)
a2y(kto- arrive
k=O k=O
k=O
_ __ _L -_ _ _ _ _ _
wheref(k)
wheref(k)
wheref(k) isis
is the
______
the
the sampled
sampled
sampled
______
version
version
version off(t),
off(t),
off(t), as
as as shown
shown
shown inin in8.3,
Fig.
Fig. Fig.
8.3, 8.3,
and
and k and
=
k =
0, 0, =1,2,3,
k1,2,3, 0,...
1,2,
...
T 2T 3T
refers
refers todiscrete
refers toto discretesample
discrete sampletimes
sample times
times to, tl,
tl,t2,
to, tl, t2,.... ThisThis
13, ....
This leads
leads leads directly
directly
directly to to a toproperty
a property a pro
The Transfer Function of a DT System
to, t2,13,
13, ....
analogous
analogous tototoEq.
analogous Eq.(8.1),
Eq. (8.1),specifically,
(8.1), specifically,
specifically, thatthat
that
For discrete systems a similar procedure is available. The z-transform IS
ZIf(kZIf(k
ZIf(k - =
-- I)}
I)} I)}
= = Z-IF(Z).
Z-IF(Z).
Z-IF(Z). (8.3)
(8.3)
ed by
This
This • We can find the transfer function of a DT system by using the
relation
relation allows
allows us
This relation allowsZ(f(k)}usto to easily
easily
us to easily find
findfind
the
the
00
the transfer
transfer
transfer function
function
function ofof of a discrete
a discrete
a discretesystem, system,
system,given thegiv
given the
difference equations ofofthat = F(z) = Lf(k)z-k,
z-transform. Consider again the general second-order
system. For For
example, the general second-order(8.2) difference
difference
difference equations
equations of thatthat system.
system. For example,
example, the the general
general second-order
second-order diffe
difference
k=O
equationdifference equation:
equation
equation
ef(k) is the sampled version off(t), as shown in Fig. 8.3, and k = 0, 1,2,3, ...
y(k)
to discrete ==-aly(k
sample times- -I) -tl,a2y(k 13, -.... +2)bou(k)
2)- This + leads +directly
+
blu(k - to1)a+-property
b2U(k+ 2) - 2)
-b2U(k
y(k) = -aly(k - I) - a2y(k - 2) + bou(k) + blu(k - 1) + b2U(k - 2)
y(k) -aly(k to,I) -t2,a2y(k bou(k) blu(k 1)
gous
cantobeEq. (8.1), specifically,
converted from this that form to the z-transform of the variables y(k), u(k), ... by
can
can be
be converted
converted from
from thisthis form
form to to
the the z-transform
z-transform of of the
the variables
variables y(k), y(k),
u(k), u(k),
... .
by

invoking Now apply
Eq. (8.3) once ZIf(kor twice
- I)}
invoking Eq. (8.3) once or twice to arrive at
to=arrive at
Z-IF(Z). (8.3)
invoking Eq. (8.3) once or Itwice to 2arrive at 2
elation allows Y(z) = (-alz-
us to easily find the a2Z- )y(Z)
- Itransfer +
function
2 (bo
of a+ blz- I
discrete + b2Z-
system, )U(Z).
given the
2 (8.4)
Y(z) (-alz-
Y(z)= =(-alz- I
-
2)y(Z)
a2Z-
-a2Z- +
)y(Z) +
(bo +
(bo +
blz-blz-
I
+
I
+
b2Z-
ence equations of that system. For example, the general second-order difference
2
b2Z- )U(Z). (8.4
)U(Z).
Equation (8.4) then results in the discrete transfer function
ionEquation(8.4)
Equation thenresults
(8.4)then results
in in
thethe discrete
discrete transfer
transfer function
function
YCz) bo + blz- + b2Z-
I 2
y(k) = -aly(k - I) - a2y(k - 2) +
YCz) bou(k) + +
1 ++alCI
blu(k +
I - I 1) + 2 2 - 2)
b2U(k
YCz) = bo
U(z) bo blz- ++
blz- a2c 2
b2Z-.b2Z-
e converted from this form to the z-transform
U(z) +
=1 +1alCI
of alCI
the + +
variables
• Similar to LT we seldom use the raw definition of the z-
U(z) = a2c a2c 2 .u(k), ... by
2y(k),
.
ing Eq. (8.3) once or twice to arrive at
8.2.2 transform but make use of tables instead...
z-Transform Inversion
2 2
I
+ (bo + blz- + b2Z-
Y(z) = (-alz- - a2Z- )y(Z)
I
)U(Z). (8.4)
8.2.2 z-Transform Inversion
This is perhaps the most important theorem for our purposes
and will more typically be written like this:

Note that this property is defined for positive n. If n is negative


(i.e. positive time shift) then we have the following:

We will soon need to


apply this theorem
for n = 1:
Inverse z-Transform
In a somewhat similar fashion to the ILT, we can obtain the inverse
z-Transform using partial fraction expansion. In the s-domain the
terms corresponding to exponentials were of the form,
1 at
() e
s +a
In the z-domain we have,
z akT
aT
() e
z e
Therefore we will try to reduce z-domain expressions into the
following form,
Az Bz
F (z) = + + ···
z z1 z z2
We require the z in the numerator. This can be achieved by
expanding F (z)/z instead of F (z), then multiplying by z...
e.g. Find the sampled time function corresponding to F (z).

0.5z
F (z) =
(z 0.5)(z 0.7)

We expand F (z)/z,

F (z) 0.5 A B 2.5 2.5


= = + = +
z (z 0.5)(z 0.7) z 0.5 z 0.7 z 0.5 z 0.7

Therefore,
2.5z 2.5z
F (z) = +
z 0.5 z 0.7
Apply the inverse z-Transform on each term,

f (kT ) = 2.5(0.5)k + 2.5(0.7)k

Notice that do not get f (t). We only get back its sampled values.
Discrete-Time State Space
• The discrete-time (DT) state space representation is
of the following form:

• This is quite similar to the continuous-time (CT)


representation except that we have a shift in time as
opposed to a derivative
• In CT we needed to handle higher-order derivatives
which was achieved by defining a stack of state
variables
• In DT we can apply the same idea to handle larger
time shifts.
State-space Representation of Time-invariant Scalar Di↵erence Equations

• Consider the following common form of difference


Consider the following scalar di↵erence equation:

equation:
y(k + n) + a1 y(k + n 1) + a2 y(k + n 2) + . . . + an 1 y(k + 1) + an y(k) = bu(k)

• We can assign the “base” variable y(k) as our first


where k denotes the kth sampling instant, y(k) is the system output at the k-th sam-
state variable and create further state variables to
pling instant, and u(k) is the input at the k-th sampling instant. Let us define:
represent all subsequent time shifts:
x1 (k) = y(k)

x1 (k + 1) = x2 (k)

x2 (k + 1) = x3 (k)
.. ..
. .
xn 1 (k + 1) = xn (k)

xn (k + 1) = a1 xn (k) a2 xn 1 (k) ... an x1 (k) + bu(k)

2 3
2 3 0 1 0 ... 0 2 3 2 3
x1 (k + 1) 6 7 x1 (k) 0
6 7 6
6
0 0 1 76
7 6 x2 (k) 7 6 7
6 x2 (k + 1) 7 7 6 0 7
pling instant, and u(k) is the input at the k-th sampling instant. Let us define:

x1 (k) = y(k)

x1 (k + 1) = x2 (k)

x2 (k + 1) = x3 (k)
.. ..
. .
xn 1 (k + 1) = xn (k)

xn (k + 1) = a1 xn (k) a2 xn 1 (k) ... an x1 (k) + bu(k)

• The final state space representation easily follows:


2 3
2 3 0 1 0 ... 0 2 3 2 3
x1 (k + 1) 6 7 x1 (k) 0
6 7 6
6
0 0 1 76
7 6 x2 (k) 7 6 7
6 x2 (k + 1) 7 7 6 0 7
6 7 = 6 ... 76
.. 7 6 7 u(k)
6 .. 7 6
6
76
74 7 + 6 .. 7
4 . 5 6 . 5 4 . 5
4 1 7
5
xn (k + 1) xn (k) b
an an 1 an 2 a1
2 3
x1 (k)
h i6
6 x2 (k) 7
7
y(k) = 1 0 0 ... 0 6
6 .. 7
7
4 . 5
xn (k)

or
• Notice that this is in Controller Canonical Form (CCF)
x(k + 1) = Gx(k) + Hu(k)
Solution of the DT State Space Equations
• Consider just the DT state space difference equation:

• We will assume that x(0) and the input u(k) are


known. We can solve for k = 0, 1, 2, ...
• In the CT solution to the state-space equation we found
something similar, only more exotic because it involved the
matrix exponential. Our approach then was to try using
Laplace to obtain an easier-to-compute solution. Here we do
the same, except we use the z-transform instead.
• First we restate the state-space difference equation:

• We rewrite this as individual row equations:

• Now take the z-transform...


z-transform

Express as a vector-matrix equation and solve for X(z):


We can equate the time-domain solution (above left) and the z-transform solution
(above right) and denote Φ(k) = Ak. Note that Φ(k) is the state transition matrix for
our discrete-time solution, but it is not the matrix exponential. Now we have an
alternative way of computing Φ(k):

Notice how closely this followed the derivation of the state-space solution in CT
Example
• Consider the DT system with the following transfer function:

• We can determine the difference equation for this system and


then obtain the state-space equation

COVERED ON BOARD
• Now that we have the state-space representation, we can
solve for Y(z) and then y(k):

• Recall our general solution:


In this example we have x(0) = 0 (after all we started with a
transfer function which implicitly assumes x(0) = 0).
• Lets assume we have a step input. The z-transform of the step function is
z/(z-1). We fill this into the above solution and into Y(z) = C X(z):

• Applying partial fraction expansion and then the inverse z-transform:

• The output is the sequence 0, 1, 4, 11, 26,...


Solution for Sampled Data Systems
• The solution just presented works for purely DT
systems, but what if the plant is CT? There are a
couple of possibilities (we take the bolded path):
– Design controller in CT then translate to DT
• Using approximate mappings from s-domain to z-domain (e.g.
Tustin’s method, MPZ)
– Translate CT plant model to DT, then design controller
in DT
• Use approximate mappings from from s- to z- (as above)
• Or...
• Use the exact mapping for state-space representations we are
about to discuss
e the solutions. This chapter discusses solutions of state equations, how
t to
into statex(t)
If we compute and y(t)and at t =
onlyother e k =x(τ
kT fortopics. 0,We)1, . . .=, then e(4.11) and )(4.10)
dτ become
−Aτ
#t −Aτ
r functions equations, related # discuss
τ =0 first theBu(τ
se and then the time-varying x((k + 1)T ) = (I + T A)x(kT ) + T0 Bu(kT )
case.
Thus we x((khave+ 1)T ) = (I + T A)x(kT ) + T Bu(kT )
• [We are following the solution presented in section 4.2 of
y(kT
y(kT )) =
“Linear System Theory and Design” by Chen]Cx(kT
=Cx(kT + Du(kT
) +) Du(kT ) ) $ t
Equations e−At x(t) − e0 x(0) = e−Aτ Bu(τ ) dτ
is isThis isAssume we begin with a purely CT state-space representation
a •discrete-time
a discrete-timestate-space
state-spaceequation
equation and andcancan easily
easily be computed
be computed 0 on acomputer.
on a digital digital co
ar
is time-invariant
discretization (LTI) state-space
is the easiest equation
and its solution, developed earlier this term:
to
to carry outbut
This discretization is the
Because easiest
the inverse carry out
of e−At is but
eAt yields
yields
and the
e0 = theI asleast
least accurate accurate
discussed results results
for
in (3.54)theand for
same t
(3.52
. We discuss next
We Tdiscuss nextẋ(t) =a different
a different discretization.
Ax(t) +discretization.
Bu(t) At
$ t (4.2)
A(t−τ
If an
If an input u(t)input u(t)
is is generated
generated by
by a a digital
x(t)
digital =computer
e x(0)
computer followed
+ e by
followed
) a digital-to-analog
Bu(τby ) dτa digital-to
converter, theny(t) Cx(t)
u(t)=will + Du(t) constant. This situation often
be piecewise (4.3) in computer control
0 arises
nverter, then u(t)This willisbe the
piecewise
solution of
constant.
(4.2).
This situation often arises in compute
The input u(t) will be produced by a computer and will be
• respectively,
and Dofare,
control systems. Letn × n, n × p, q × n, and q × p constant matrices.
control systems. Let It is instructive to verify that (4.5) is the solution of (4.2). To verify Zero- this
held constant throughout each sample period:
o find the solution excited by the initial state x(0) and the input u(t). The
u(t)
that (4.5) u(kT )(4.2)
satisfies
=studied u[k]
and the
=:Section initial
for condition
≤ t < (kwe +x(t)1)T = x(0) at t = Order
0. Indeed
(4.12)
n the exponential function of A in 3.6. InkTparticular, need Hold
3.55) for
u(t)
reduces =
to u(kT ) =: u[k] for kT ≤ t < (k +
or k = 0, 1, 2, . . . . This input changes values only at discrete-time instants. For this input,
1)T
We evaluate our CT solution at discrete time steps t = kT
•solution
k =the0, 1, 2, of. d.(4.9)
.e.AtThis input
still equals
At changes
(4.5).
At values
Computing only
(4.5) at tat=discrete-time
kT and t = (k + and t
instants.
1)T For th
yields
= Ae = e A
e solution = (k+1) T
of (4.9) dt still equals (4.5). Computing
AkT
(4.5)
! kT at t = kT and t = (k + 1)T y
A(kT −τ )
x[k] := x(kT ) = e x(0) + e Bu(τ ) dτ (4.13)
lution. Premultiplying e−At on both sides of (4.2) yields0 ! kT
AkT A(kT −τ )
and −At x[k] :=
−At x(kT ) =
−At e x(0) + e Bu(τ ) dτ
e ẋ(t) − e Ax(t) = e Bu(t) 0
! (k+1)T
d x[k + 1] := x((k + 1)T ) = e A(k+1)T
x(0) + eA((k+1)T −τ ) Bu(τ ) dτ (4.14)
0
d ! −At −At (k+1)T
ecan x(t) = e as Bu(t)A(k+1)T
" !
Equation (4.14)
x[k + 1] be written
dt := x((k + 1)T ) = e x(0) + eA((k+1)T −τ ) Bu(τ ) dτ
the k = 0, 1,
forsolution of 2,
(4.9) . This
. . . still u(t)
input
equals u(kT
= (4.5).
changes u[k] only
=:values
)Computing for
at kT
(4.5) at≤t =
discrete-time
t <kT +instants.
(k and1)T
t = (kFor
+ this (4.12)
1)T input,
yields
the solution of (4.9) still equals (4.5). Computing (4.5) at t = kT and t = (k + 1)T yields
for k = 0, 1, 2, . . . . This input changes values only at discrete-time instants. For this input,
! kT
AkT A(kT −τ )
x[k] := x(kT ) =
the solution of (4.9) still equals (4.5).e
AkT
x(0) +
! kT
Computing (4.5) e
A(kT
Bu(τ
at−τt )= kT and) tdτ (4.13)
= (k + 1)T yields
x[k] := x(kT ) = e x(0) + 0e Bu(τ ) dτ (4.13)
0 ! kT
and x[k] := x(kT ) = e AkT
x(0) + eA(kT −τ ) Bu(τ ) dτ (4.13)
and
0!
(k+1)T
A(k+1)T (k+1)T
and x[k + 1] := x((k + 1)T ) = A(k+1)T x(0) eA((k+1)T −τ )
Bu(τ ) dτ
!
x[k + 1] := x((k + 1)T ) = e e x(0) + + A((k+1)T
e −τ )
Bu(τ ) dτ (4.14)
(4.14)
0 0! (k+1)T
Equation x[kcan
(4.14) + be
1]
be := x((k as
written +
as1)T ) = eA(k+1)T x(0) + eA((k+1)T −τ ) Bu(τ ) dτ (4.14)
• We can re-write the second equation as follows and then
Equation (4.14) can written
0
recognize that it contains the first:
"" ! !kT kT # #
Equation (4.14)x[k
can+be1]written
x[k + 1]==eeATATaseAkT
eAkTx(0)
x(0)++ eA(kT eA(kT
−τ )−τ )
Bu(τ Bu(τ
)dτ)dτ
" 0 0! kT #
x[k + 1] =!!eAT
(k+1)TeAkT x(0) +
(k+1)T eA(kT −τ ) Bu(τ )dτ
++ eA(kT
e
+T+T
A(kT −τ−τ
Bu(τ
) )
0
Bu(τ) dτ
) dτ
kT
kT (k+1)T
!
+ and (4.13)
which becomes, after substituting (4.12) eA(kT +T −τ )
Bu(τ ) dτ the new variable α :=
and introducing
which becomes, after substituting (4.12) kT and (4.13) and introducing the new variable α :=
kT + T − τ ,
kT + which
T − τbecomes,
, after substituting (4.12) and$!(4.13)
T
and%introducing the new variable α :=
kT + T − τ , x[k + 1] = eATATx[k] +
$! TAα
e Adα Bu[k]
%
x[k + 1] = e x[k] + 0 $! Te α dα %Bu[k]
x[konly
Thus, if an input changes value + 1]at=discrete-time eAα dα
eAT x[k] + 0instants kT andBu[k]
if we compute only the
0
Thus, if anatinput changes valueand
only at discrete-time instants kT and if we compute only the
where α
• Thus,
responses t = = kT
kT , + T -
then (4.9) (4.10) become
τ. We have also substituted in our DT u[k]
responses atiftan=input changes
kT , then value
(4.9) andonly at discrete-time
(4.10) become instants kT and if we compute only the
which is constant within the integrated interval and can
responses x[k +
at t = kT , then (4.9) and = Ad x[k]
1](4.10) + Bd u[k]
become (4.15)
therefore be factored out.
x[ky[k]
+ 1]==CAx[k]
d x[k]
++DdBu[k]
d u[k] (4.15)
(4.16)
d x[k + 1] = Ad x[k] + Bd u[k] (4.15)
y[k] = Cd x[k] + Dd u[k] (4.16)
AT
kT + T − τ , A d = e BdkT= eAτ dτ B Cd = C Dd = D (
which becomes, after substituting (4.12) and 0 (4.13) and introducing the new variable α :=
$! T %
+ Tis−aτdiscrete-time
kTThis , state-space
x[k + 1] = eequation.
AT
x[k] + Note ethat
Aα there is no approximation involv
dα Bu[k]
$! T0 of (4.9)
this derivation and (4.15) yields the exact solution % at t = kT if the input is piece
AT Aα
Thus,
constant.if an input x[k
changes+ 1]
value=only
e x[k]
at +
discrete-time
e dα Bu[k]
instants
• This is now a purely DT representation. We can establish a kT and if we compute only the
0
responses at t =the
We discuss , then (4.9) andof
kT computation (4.10) become
Bd . Using (3.51), we have
Thus, ifcorrespondence between the given CT system (A, B, C, D) and
an input changes value"only!at discrete-time instants # kT and if we compute only the
its DT equivalent (A
responses d, B
T
at t = kT , then (4.9) and d, C
x[k d, D
+ 1]
(4.10) = dA):
becomed x[k]
2
2 τ + Bd u[k] (4.15)
I + Aτ + A + · · · dτ
y[k] = Cd x[k]2!+ Dd u[k]
0 (4.16)
E-SPACE SOLUTIONS AND REALIZATIONS
x[k + 1] =2Ad x[k] +3 Bd u[k] 4 (4.15)
T T 2 T 3
I + = CAd x[k]
= T y[k] + +ADd + u[k] A + ··· (4.16)
with 2! 3! 4!
This power series can be computed!recursively
" T #as in computing (3.51). If A is nonsing
AT
Ad =
then the series can Bd using
beewritten as, = eAτ dτ B
(3.51), Cd = C Dd = D (4
0
! 2 3 #
T 2 T 3
This is a discrete-time
A −1 state-space
TA+ A equation.
+ A Note
+ · · ·that
+ I there
− I is=noA−1approximation
(eAT − I) involve
this The only practical issue is in computing B
• derivation 2! the exact
and (4.15) yields 3! solution of (4.9) d. A few short
at t = kT if the input is piecew
Thus manipulations (see Chen for details) lead to the following:
constant.
we have
We discuss the computation of Bd . Using (3.51), we have
−1
Bd = "A T ! (Ad − I)B 2 (if A is
# nonsingular) (
τ
I + Aτ + A2 + · · · dτ
Using this formula, we can avoid
0 computing an2!infinite series.
The MATLAB function [ad,bd]=c2d(a,b,T) transforms the continuous-time
T2 T3 2 T4 3
= T I + state
equation in (4.9) into the discrete-time A + equation
A + in (4.15).
A + ···
2! 3! 4!
Ad = e Bd = e dτ B Cd = C Dd = D
0

This is a discrete-time state-space equation. Note that there is no approximation invol


Example
this derivation and (4.15) yields the exact solution of (4.9) at t = kT if the input is pie
constant.
• Assume we start with the following transfer function
We discuss the computation of Bd . Using (3.51), we have
(appropriate form for a servomotor):
" T! 2 #
τ
I + Aτ + A2 + · · · dτ
0 2!
T2 T3 2 T4 3
= TI+ A+ A + A + ···
• We can obtain the CT state space model quite directly
2! 3! 4!
This power series can be computed recursively as in computing (3.51). If A is nonsin
then the series can be written as, using (3.51),
! 2 3 #
CE SOLUTIONS AND REALIZATIONS T 2 T 3
A −1
TA+ A + A + · · · + I − I = A−1 (eAT − I)
2! 3!
Simply apply our derived DT equivalents. We’ll say that T = 0.1 s
with •Thus we have
!" T #
Ad = eAT BBd d== A−1 (A
eAτd dτ
− I)BB Cd A=isCnonsingular)
(if Dd = D (4.17)
0
Using this formula, we can avoid computing an infinite series.
This is•a discrete-time state-space equation. Note that there is no approximation involved in
Unfortunately, A is singular, so this doesn’t work! Phillips and
The MATLAB function [ad,bd]=c2d(a,b,T) transforms the continuous-tim
this derivation and (4.15) yields the exact solution of (4.9) at t = kT if the input is piecewise
constant.
Parr present another method which does work, but we’ll just
equation in (4.9) into the discrete-time state equation in (4.15).
use Matlab.
We discuss the computation of Bd . Using (3.51), we have
! #
Conversion from CT to DT using Matlab
• The function c2d converts from CT to DT state-space
representations. In fact you have been using this all along,
since Matlab is inherently DT (it runs on a computer).
c2d Converts continuous-time dynamic system to discrete time.

SYSD = c2d(SYSC,TS,METHOD) computes a discrete-time model SYSD with


sampling time TS that approximates the continuous-time model SYSC.
The string METHOD selects the discretization method among the following:
'zoh' Zero-order hold on the inputs
'foh' Linear interpolation of inputs
'impulse' Impulse-invariant discretization
'tustin' Bilinear (Tustin) approximation.
'matched' Matched pole-zero method (for SISO systems only).
The default is 'zoh' when METHOD is omitted. The sampling time TS should
be specified in the time units of SYSC (see "TimeUnit" property).

• For the example we execute: [Ad, Bd] = c2d(A, B, 0.1)


This is the step response of the original
system. Note that the system is a DC
motor so as we continue to apply a
step input it is quite reasonable for the
output (motor shaft angle) to increase
continually.

This is the step


response of the
converted DT
system. Note
that T = 0.1 s, so
the responses do
match. Discrete Time Steps

You might also like