You are on page 1of 44

DIGITAL CONTROL (EEEE 789)

Dr. AbdullaIsmail
Professor of Electrical Engineering
axicad@rit.edu

Course Outline (Topics):

Introduction to Digital Control


Discrete Time Systems & Difference Equations
The Z-transform
Impulse Response and Step response of Discrete-Time
Systems
Frequency Response of Discrete-Time Systems
Modeling Digital Control Systems
Steady-State Error Computation for Digital Control Systems
Stability of Digital Control Systems
Digital Control System Design
State-Space Analysis of Discrete-Time Systems

Digital Control

Discrete Time Systems

Introduction
Digital control involves systems whose control is updated
at discrete time instants.
Discrete-time models provide mathematical relations
between the system variables at these time instants.
Here, we develop the mathematical properties of discretetime models.
Difference Equations are used to model Discrete Time
Dynamical Systems.
Digital Control

Discrete Time Systems

Analog Systems with Piecewise Constant Inputs

In most engineering applications, it is necessary to


control a physical system or plant so that it behaves
according to given design specifications.
Typically, the plant is analog, the control is piecewise
constant, and the control action is updated periodically.
This arrangement results in an overall system that is
conveniently described by a discrete-time model.
We demonstrate this concept using a simple example.

Digital Control

Discrete Time Systems

Analog Systems with Piecewise Constant Inputs


Example 1

Consider the tank control system of Figure 1.

In the figure, lowercase letters denote perturbations from fixed


steady-state values.

The variables are defined as

It is necessary to maintain a constant fluid level by adjusting the fluid


flow rate into the tank.
Obtain an analog mathematical model of the tank, and use it to obtain a
discrete-time model for the system with piecewise constant inflow qi and
output h.
Digital Control

Discrete Time Systems

Analog Systems with Piecewise Constant Inputs


Example 1 .. Solution

Although the fluid system is nonlinear,


a linear model can satisfactorily
describe the system
The linearized model for the outflow
valve is analogous to an electrical
resistor and is given by

6
Digital Control

Discrete Time Systems

Analog Systems with Piecewise Constant Inputs


Example 1 .. Solution

Assuming an incompressible fluid, the principle of conservation of


mass reduces to the volumetric balance:
rate of fluid volume increase = rate of volume fluid in
rate of volume fluid out:
where C is the area of the tank or its fluid capacitance.

The term H is a constant and its derivative is zero, and the term Q
cancels so that the remaining terms only involve perturbations.

Substituting for the outflow q0 from the linearized valve equation into
the volumetric fluid balance gives the analog mathematical model
where = RC is the fluid time constant for
7
Digital
Control
the tank.

Discrete Time Systems

Analog Systems with Piecewise Constant Inputs


Example 1 .. Solution

The solution of this differential equation

h(t ) e

( t t 0 ) /

1 t ( t ) /
h(t 0 ) e
qi ( )d
C t0

h( k 1) e T / h( k ) R 1 e T / qi ( k )
where the variables at time kT are denoted by the argument k.

This is the desired discrete time model describing the system with
piecewise constant control.

The obtained model is called a difference equation.

For a linear time-invariant analog plant, we have a linear time-invariant


difference equation.

8
Digital Control

Difference Equations

Difference equations arise in problems where the independent


variable, usually time, is assumed to have a discrete set of
possible values.

The nonlinear difference equation

with forcing function u(k) is said to be of order n because the difference


between the highest and lowest time arguments of y(.) and u(.) is n.

The equations we deal with in this text are almost exclusively


linear and are of the form

Digital Control

Difference Equations
We further assume that the coefficients ai, bi, i = 0, 1, 2, . . .
, are constant.
The difference equation is then referred to as linear time
invariant, or LTI.
If the forcing function or input u(k) is equal to zero, the
equation is said to be homogeneous.
Difference equations can be solved using iterations.
Alternatively, Z-transform method provide a convenient
approach for solving LTI difference equations, as discussed
in the next section.
Digital Control

10

Difference Equations

Example
Determine the order of the equation.
Is the equation (a) linear ?
(b) time-invariant ? (c) homogeneous ?
(i)

y k 2 0.8 y k 1 .07 y k u k

(ii)

y k 4 sin 0.4 k y k 1 .03 y k 0

(iii)

y k 1 0.1 y 2 k

Digital Control

11

Difference Equations

Example (i) .. solution


Determine the order of the equation.
Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?

y k 2 0.8 y k 1 .07 y k u k
Second order.
All terms linear and have constant coefficients
LTI.
A forcing function appears in the equation
nonhomogeneous.
Digital Control

12

Difference Equations

Example (ii) .. solution


Determine the order of the equation.
Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?

y k 4 sin 0.4k y k 1 .03 y k 0

Fourth order.
Second coefficient is time-dependent but all the terms
are linear linear time varying.
No forcing function homogeneous.

Digital Control

13

Difference Equations

Example (iii) .. solution


Determine the order of the equation.
Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?

y k 1 0.1 y k
2

First order.
RHS is a nonlinear function of y(k) nonlinear.
No forcing function homogeneous.
No terms depending explicitly on time time invariant.

Digital Control

14

Solution of Difference Equations


Solution by iterations.
Solution by Z-transform Method.

Digital Control

15

Difference Equations
Example 1
The DT input(sequence) x[k] = 2ku[k] is applied to the
discrete time system described by the following difference
equation:

y[k + 1] 0.4 y[k] = x[k].

Solve for y(k) by iteration (0 k 5) given the initial


condition y[1] = 4 and the input sequence to be a ramp of
amplitude 2, i.e. 2ku(k).
x[k]

Digital Control

DTS

y[k]

16

Difference Equations
Example 1 .. Solution
Express y[k + 1] 0.4y[k] = x[k] as follows:
y[k] = 0.4y[k 1] + x[k 1]
= 0.4y[k 1] + 2(k 1) u(k 1)
which can alternatively be expressed as

DTS
Input sequence x[k]

Digital Control

Output sequence y[k]

17

Difference Equations
Example 1 .. Solution
By iterating from k = 0, the output response is computed
as follows:

DTS
Input sequence x[k]

Digital Control

Output sequence y[k]

18

Difference Equations
The output response y[k] can be expressed as

The zero-input component yzi[k] for a DT system is the response


produced by the system because of the initial conditions, and is not due
to any external input.
To calculate the zero-input component yzi[k], we assume that the
applied input sequence x[k] = 0.
On the other hand, the zero-state response yzs[k] arises due to the
input sequence and does not depend on the initial conditions of the
system.
To calculate the zero-state response yzs[k], the initial conditions are 19
Digital Control
assumed to be zero.

Difference Equations
Example 2
Repeat Example1 to calculate
(i)the zero-input response yzi[k],
(ii)(ii) the zero-state response yzs[k], and
(iii)(iii) the overall output response y[k] for 0 k 5.
y[k + 1] 0.4y[k] = x[k].
x[k] = 2ku[k]

20
Digital Control

Difference Equations
Example 2 .. Solution
(i) The zero-input response of the system is obtained by
solving the following difference equation:
y[k + 1] 0.4y[k] = x[k],
with input x[k] = 0 and initial condition y[1] = 4.
The difference equation reduces to
with initial condition yzi[1] = 4.
Iterating for k = 0, 1, 2, 3, 4, and 5 yields

21
Digital Control

Difference Equations
Example 2 .. Solution
(ii) The zero-state response of the system is calculated by
solving the following difference equation:

with initial condition yzs[1] = 0.


Iterating the difference equation for k = 0, 1, 2, 3, 4,
and 5 yields

Digital Control

Difference Equations
Example 2 .. Solution
(iii) Adding the zero-input and zero-state components
obtained in parts (i) and (ii), yields

Note that the overall output response y[k] is identical to


the output response obtained in Example 1.

Digital Control

Impulse response of a system


In last section, a constant-coefficient difference equation
is used to specify the inputoutput characteristics of an
LTID system.
In this section, we will define the impulse response of
DTS and illustrate how the impulse response of an LTID
system can be derived directly from the difference
equation modeling the LTID system.

Digital Control

24

Impulse response of a system


Definition1 The impulse response h[k] of an LTID system
is the output of the system when a unit impulse [k] is
applied at the input of the LTID system.
The impulse response can be expressed as follows:
[k] h[k],
with zero initial conditions.
Note that an LTID system satisfies the linearity and the
time-shifting properties.
Therefore, if the input is a scaled and time-shifted
impulse function a[k k0], the output of the DT
system is also scaled by a factor of a and time-shifted
by k0, i.e.
a[k k0] ah[k k0],
for any arbitrary constants a and k0.

Digital Control

25

Impulse response of a system


Example 3
Consider the LTID systems with the following inputoutput
relationships:

(a) Calculate the impulse responses for the two LTID


systems.
(b) Also, determine the output responses of the LTID systems
when the input is given by x[k] = 2[k] + 3[k 1].

Digital Control

26

Impulse response of a system


Example 3 .. Solution
(i)
(a) The impulse response of a system is the output of the
system when the input sequence x[k] = [k].
Therefore, the impulse response h[k] of system (i) can
be obtained by substituting y[k] by h[k] and x[k] by [k] in Eq.
y[k] = x[k 1] + 2x[k 3]
In other words, the impulse response for system (i) is given
by

h[k] = [k 1] + 2[k 3].


Digital Control

27

Impulse response of a system


Example 3 .. Solution
(b) To evaluate the output response resulting from the
input sequence x[k] = 2[k] + 3[k 1], we use the
linearity and time-invariance properties of the system.
The outputs resulting from the two terms 2[k] and 3[k
1] in the input sequence are as follows:
2[k] 2h[k] = 2[k 1] + 4[k 3]
and

3[k 1] 3h[k 1] = 3[k 2] + 6[k 4].

Applying the superposition principle, the output y[k] to


input x[k] = 2[k] + 3[k 1] is given by
Digital Control

28

Impulse response of a system


Example 3 .. Solution
2[k] + 3[k 1] 2h[k] + 3h[k 1]
or y[k] = (2[k 1] + 4[k 3]) + (3[k 2] + 6[k 4])
= 2[k 1] + 3[k 2] + 4[k 3] + 6[k 4]).
(ii)
(a) On substituting y[k] by h[k] and x[k] by [k] in Eq.
y[k + 1] 0.4y[k] = x[k] , the impulse response of the LTID
system (ii) is represented by the following recursive
equation: h[k + 1] 0.4h[k] = [k].
Digital Control

29

Impulse response of a system


Example 3 .. Solution
The above Eq. is a difference equation, which can be
solved by substituting k = m 1. The resulting equation is
given by h[m] = [m 1] + 0.4h[m 1]
To solve for the delayed response h[m 1], we substitute k =
m 2 in Eq. h[k + 1] 0.4h[k] = [k] . The resulting expression
is given by h[m 1] = [m 2] + 0.4h[m 2].
Substituting the above value of h[m 1] from the Eq. for
h[m - 1] in the Eq. h[k + 1] 0.4h[k] = [k] yields
h[m] = [m 1] + 0.4[m 2] + (0.4)2h[m 2].
30
Digital Control

Impulse response of a system


Example 3 .. Solution
The aforementioned procedure can be repeated for the
delayed impulse response h[m 3] on the right-hand
side of the equation, then for the resulting h[m 4], and
so on.
The final result is as follows:

or
or
Digital Control

which is the required


expression for the impulse
response of the system.

31

Impulse response of a system


Example 3 .. Solution
(b) Next, we proceed to calculate the output of the LTID
system for the input sequence x[k] = 2[k] + 3[k 1].
Because the system is linear and time-invariant, the output
sequence y[k] resulting from input x[k] = 2[k] + 3[k 1] is
given by 2[k] + 3[k 1] 2h[k] + 3h[k 1] , or

Digital Control

Impulse response of a system


Exercise
The impulse response of an LTID system is given by
h[k] = 0.5ku[k]. Determine the output of the system for the
input sequence x[k] = [k 1] + 3[k 2] + 2[k 6].

Digital Control

Impulse response of a system


Exercise .. Solution
The impulse response of an LTID system is given by
h[k] = 0.5ku[k]. Determine the output of the system for
the input sequence x[k] = [k 1] + 3[k 2] + 2[k
6].
Because the system is LTID, it satisfies the linearity and
time-shifting properties.
The individual responses to the three terms [k 1],
3[k 2], and 2[k 6] in the input sequence x[k] are
given by

Digital Control

Impulse response of a system


Exercise .. Solution

and
Applying the principle of superposition, the overall
response to the input sequence x[k] is given by
y[k] = h[k 1] + 3h[k 2] + 2h[k 6].

Digital Control

Impulse response of a system


Exercise .. Solution

The impulse response h[k] and


the resulting output sequence
are plotted below

Impulse response
h[k] of the LTID system
Digital Control

Output y[k] of the LTID system for input


x[k] = [k 1] + 3[k 2] + 2[k 6].

MATLAB APPLICATION
EXAMPLE 1
The DT sequence x[k] = 2ku[k] is applied at the input of an
LTID system described by the following difference equation:
y[k + 1] 0.4 y[k] = x[k], with the initial condition y[1] = 4.
Compute the output response y[k] of the LTID system for 0
k 50 using MATLAB.

Digital Control

MATLAB APPLICATION
EXAMPLE 1

Digital Control

MATLAB APPLICATION
EXAMPLE 2
The DT sequence x[k] = 0.5ku[k] is applied at the input of
an LTID system described by the following second-order
difference equation:
y[k + 2] + y[k + 1] + 0.25y[k] = x[k + 2],
with initial conditions y[1] = 1 and y[2] = 2.
Compute the output response y[k] of the LTID system for
0 k 50 using MATLAB.

Digital Control

MATLAB APPLICATION
EXAMPLE 2 .. Solution

Digital Control

MATLAB APPLICATION
EXAMPLE 2 .. Solution

Digital Control

MATLAB APPLICATION
EXAMPLE 2 .. Solution

Digital Control

42

Exercise Problems
1. Consider the input sequence x[k]=2u[k] applied to a DT system modeled
with the following inputoutput relationship:
y[k + 1] 2y[k] = x[k], and initial condition y[1] = 2.

2. Repeat Problem 1 for the applied input x[k] = (0.5)k u[k] and the input
output relationship y[k + 2] y[k + 1] + 0.5y[k] = x[k], with initial
conditions y[1] = 0 and y[2] = 1.
3. Repeat Problem 1 for the applied input x[k] = (1)k u[k] and the input
output relationship y[k + 2] 0.75y[k + 1] + 0.125y[k] = x[k], with ancillary
conditions y[1] = 1 and y[2] = 1.
Digital Control

43

Exercise Problems
4. The MATLAB function impz can be used to determine the impulse
response of an LTID system from its difference equation
representation. Determine the first 50 samples of the impulse
response of the LTID systems with the difference equations specified
in Problems 1-3.

Digital Control

44

You might also like