The world is full of systems that we see as continuous.
When you
speak on a telephone, your voice
signal is a continuous pressure function of time that gets converted to
a continuous voltage function of time.
When you
fly in an airplane, the altitude
is a continuous function of time.
In refining
an ingot of silicon - to make wafers for computer chips - the temperature
of
the ingot is a continuous function of time.
The angular
orientation of
a communications satellite - with respect to a target antenna on
the ground - is a continuous function of time.
Goals
For This Lesson
There's more to these systems. In every case on the previous page, the
signal that was discussed eventually gets measured and converted to a digital
signal - a sequence of digitally represented numbers - then gets processed
and the information gets used. That leads us to some statements of what
you need to know about that process.
Given a linear system with a sampled output,
Be able to describe the system mathematically in the Z-domain given an
s-domain transfer function.
Your general goal is:
Given
a system in which there is conversion between analog and digital representations
- in both directions,
Be able to determine system models that will permit you to predict response.
The systems mentioned above are all systems that generate continuous signals.
But they have something else in common. All of those signals are digitized
after they are measured, and the digitized signals have these features.
The signals
are digitized at discrete times. For the voice signal on the phone, a digital
representation is generated thousands of times each second, and it is the
digital signal that gets transmitted to Ten Sleep, Wyoming when you make
a phone call to Ten Sleep.
Something else that is important is that after being processed, most of
these signals are then converted back into analog signals in the analog
world.
Your digitized
voice signal is converted back into a pressure
wave at the far end of the telephone call so that the person you called
can hear you.
The altitude
signal is processed - with other information - to generate a signal that
controls the ailerons. That signal may be computed digitally but it must
eventually be an analog signal to do the control.
The temperature
of the silicon ingot is processed to produce a control signal to keep the
temperature in bounds.
The angular
orientation is similarly processed to generate
a control signal that drives a motor to control orientation.
In every one of these systems there is a constant conversion between signal
forms. You may have an analog signal that is converted to a digital
signal. Then some processing computations may be done on that information.
However, eventually the signal will be converted back to an analog signal
to perform some function in the real/analog world.
Some
Sampled System Examples
There are at least two distinct things that happen that cause us to need
to use sampled system methods, including the Z-transform.
A system
may be driven by a signal from a computer. The computer signal only
changes at discrete instants. That sampled signal drives an analog
system, and later the output of the system is measured with a computer
controlled instrument which effectively samples the system output.
Within a
computer, signals are processed using a numerical algorithm. For
example, an integral controller might be implemented by sampling a measurement
signal, forming an error and integrating that error numerically.
In both of these cases, when they arise you will need to use Z-transform
methods to analyze the system so that you can predict system behavior.
You have two problems here.
First you
need some understanding of the conversions that take place, and how that
process takes place. You need that to understand limitations of sampling
rate, word length and more.
You also
need some understanding of how to predict behavior. That means you
will have to come to grips with Z transforms. More importantly, you
will need to know how to use Z transforms in the mixed analog-digital systems
you will probably encounter.
Next, we'll look at a simple
prototype system - an example of a computer driving a system.
A signal
is generated within a computer.
The signal
goes through a D/A that produces an analog signal. That analog signal is
a sequence of steps.
The analog
signal drives an analog system.
The output
of the analog system is measured with a digital instrument that contains
a D/A, producing another digital signal.
The critical thing that happens here is that the analog system acts upon
the stepped output from the D/A. We need to consider what happens
there.
The analog
system acts upon an input signal that is a sequence of steps - constant
values.
The constant
values come about because the computer generates a value, puts that value
through the D/A, which holds that value until the computer generates another
output value.
The analog
system responds to that sequence of constant - step - values.
The output
of the analog system is converted into a sequence of sample values that
are represented digitally.
From the
computer to the A/D output, this is a sampled system.
The input
to the D/A is a sampled, digital signal.
The output
from the A/D is a sampled, digital signal.
Here's the system again.
Finally, we reach a very interesting
conclusion.
Even though
the dynamics of this system are analog dynamics, from input to output the
system is a sampled system.
Like other
sampled systems, this system can be described with a transfer function
that uses the sampled frequency variable,
z.
In other
words, we can describe the input-output relationship with Z-transforms.
Even though we understand that concept intellectually, it's better if we
see how the input and output occur. Below, there's an opportunity
to see how a sequence of steps goes through a system like the one below.
The
system we will consider has a transfer function,
G(s)
= 1/(s + 1).
The output
of the D/A occurs once a second.
Notice how
the output varies in time, but also focus on the value of the output at
the end of each sample period. Those are the times when the A/D would
measure the output Here's a clip that shows the analog system input and
output.
Play the
clip. Instructions for playing the clip are given below.
Notice
how the dynamics of the system affect the response.
Notice that
going from any sample time to the next, the starting value for that period
affects the ending value for that period.
At any even
period, 1, 2, 3, etc., the response at that point is due to the starting
value, and the input during the previous period.
Now, the trick is to get
a mathematical expression that relates the following:
The
output
at a sample instant,
The
output
at the previous sample instant,
The
input
(constant) during the sample period.
For a first order system, that's not a difficult task, and we'll take that
up next. To get the mathematical expression we want, we need a few
definitions.
The output
at the next sample instant is denoted by yk+1.
The output
at the sample instant is denoted by yk.
The input
(constant) during the sample period is denoted by uk.
Then, the expression that relates all of these is given by the following:
yk+1.=
e-(T/t)yk+
(1 - e-(T/t))uk
The expression for the
output is consistent with what we know from linear systems theory.
The output
contains a zero-input response proportional to the last value of the state,
yk.
The output
contains a zero-state response proportional to the input, uk.
The output
is the sum of the zero-input response and the zero-state response.
The result
can also be obtained from differential equation solutions in the usual
way. Either way, we get:
yk+1
= e-(T/t)yk+
(1 - e-(T/t)))uk
Now, let us simplify this a little so that we don't get bogged down in
algebra in our analysis.
Let: a
= e-(T/t)
Then: yk+1
= ayk
+ (1 - a)uk
This can be Z-transformed to get:
zY[z] = aY[z]
+ (1-a)U[z]
This can be solved for
the sampled transfer function:
(Y[z]/U[z]) = G[z]
= (1 - a)/(z
-a)
This is an interesting result.
A first order continuous
(analog) system gets converted into a first order sampled (digital) system.
The sampled system has
a pole a: z = a
where a
is given by a
= e-T/t
The pole is less than
one - inside the unit circle - so the sampled system is stable.
The transition from the analog system to the equivalent sampled system
is not too difficult then, at least for a first order linear system.
Some obvious questions remain.
What about higher
order systems? How can we get equivalents
for them?
How about closed
loop control systems? How do we apply
what we have in that situation?
Clearly, you need more work in this area, and we'll take that up in another
lesson.
Getting
Transfer Functions From Difference Equations
Sampled systems are described by difference equations - in contrast with
continuous systems that are described by differential equations.
However, just as in continuous systems, there are advantages to working
with transfer function descriptions. In this section we will look
at the process of getting a transfer function from a system that is described
by a difference equation.
Let's first take a first order difference equation. Here is a simple
first order difference equation.
yk+1
= ayk
+ buk+1
We can Z-transform
this difference equation and get a transfer function for the system that
is described by the difference equation. Do that now.
zY[z] = aY[z]
+ bU[z]
We can solve for the
ratio of the output transform, Y[z], in terms of the input transform, U[z].
Y[z]/U[z] = b/(z
-
a)
Now, note the features of the transfer function we found.
The transfer function
is a function of z, not s. What did you expect?
This first order transfer
function has one pole, and it is at
z = a
The system satisfies a first order difference
equation,
yk+1
= ayk
+ buk+1
There are other features of this transfer function that we can see, but
we need to take some time with that. One important feature is the
DC gain!
We have come to use the concept of DC gain in continuous systems often.
That concept can be extended to the transfer function we have for our first
order sampled system. Let's look at what we have:
We have a transfer function:
Y[z]/U[z] =
G[z] = b/(z
- a)
We know the transform
of a unit step (from the first lesson on sampled systems) That transform
is:
U[z] = z/(z -
1)
We
can compute the transform of the output, Y[z], from:
Y[z] = U[z]G[z]
= [z/(z - 1)]b/(z
- a)
Apply the final value
theorem to the transform of the output, and the final value of yk
is given by:
= b/(1
- a)
and that's the DC
Gain because the input was a unit step!
We
can generalize this result, and we will need to do that for more complex
transfer functions. In general we will have the following.
If we have a system with
a transfer function, G[z],
And, if the input of the
system reaches a steady state value, Uss,
Then, the output of the
system, yk, will reach a steady state value Yss
given
by:
YSS
= GDC USS where GDC
= DC Gain = G[1]
In general, if we have
a system with a transfer function, G[z], then, the DC gain of the
system is going to be G[1].
What
that means is that if we have any input that reaches a steady state, then
the output will reach a steady state equal to the input steady state times
the DC gain. There are some things to worry about.
If the system is unstable
(poles outside the unit circle) then the output will not reach a steady
state.
If the transfer function
has a pole at z = 1, then the analysis breaks down. We will need
to consider this possibility at greater length later.
Transfer
Functions For Higher Order Systems
In the last section, we looked at a first order system. It had one
pole and it satisfied a first order difference equation. We need
to examine higher order systems - systems with more poles and which satisfy
higher order difference equations.
We will start with a second order system.
Here's the difference
equation for the system.
yk
= ayk-1 + byk-2 + cuk
Z-transform the difference
equation to get:
Y[z] = z-1aY[z]
+ z-2bY[z] + cU[z]
Once we have the difference equation transformed, we can solve for the
ratio of the output transform to the input transform. Solving for
Y[z]/U[z], we get:
Y[z]/U[z] = c/(1 +
z-1a+ z-2b)
= z2c/(z2
+ a z+ b)
This is the transfer function for this system, and as we noted previously,
it is a function of z. Note also that this system satisfies a second
order difference equation and that the system has two
poles.
System
Performance
Here's a question for you.
Assume that you have a
second
order system. It will have two
poles and satisfy a second
order difference equation.
Assume that you put a
step
input into the system.
Assume that you want the
system to respond so that the system settles to within
10% of the final value within five (5) sampling periods.
Where should the poles
be in the z-plane?
In
order to answer that question, we will have to consider the step response
of a sampled system with two poles - a second order sampled system.
The output of the system will be:
Y[z] = U[z]* z2c/(z2
+ a z+ b)
For a step input
U[z] = z/(z - 1).
Then
Y[z] = z3c/(z2
+ a z+ b)(z - 1)
We
need to compute the inverse transform of Y[z] to get the response.
It helps if we have the poles, so let us find the poles.
We have a pole at z = -1, and two more poles
that are solutions of:
z2
+ a z+ b = 0
Each pole in the response will make a contribution
to the response.
The pole at z = 1 will contribute a step (constant
value) to the output
The second order poles will contribute decaying
oscillations to the response if the poles are complex. If the poles
are real they will contribute two decaying (exponential-like) terms.
We can compute the response in either of two
ways. We can do a partial fraction expansion and convert back to
the time domain (inverse Z-transform), or we can solve the difference equation
for the system with the step input.
We can inquire about different aspects of the response, and one immediate
question is:
What is the DC gain of
the system?
We
need to know the DC gain to compute the steady state response. If
we input a constant to the system, and if the response of the system settles
out to a constant steady state value, then the ratio
of the output steady state value to the input constant is the DC gain.
Let's look at that in our example system. If we have a step input,
the transform of the output is given by:
Y[z] = z3c/(z2
+ a z+ b)(z - 1)
We also know the final value theorem, and we clearly need to apply it to
this situation, so we need to examine the limit:
Note that (1 - z-1) is
the same as (z - 1)/z, so this limit becomes:
= c/(1 + a +b)
Here you can play a clip that will let you see the effect of pole position
on the step response. We have adjusted the system to have a constant
DC gain of 1.0, and the input is a unit step.
Note the following as the clip plays.
The response looks much
like the responses you have seen for second order continuous systems.
However, for poles in the left half of the z-plane, near to -1, you can
get some very strange responses.
There is a set of poles
that produce an output of one - exactly. Step the clip to see that.
We
can relate the performance to the pole position. The quadratic factor
has two poles, and they can be two real poles
or a pair of complex conjugate poles.
The poles are solutions of:
z2
+ a z+ b = 0
and, the exact solutions are given by:
We will examine the two specific cases separately.
For complex poles, the discriminant will be negative. In that case,
the poles are at:
and we can compute the magnitude of the poles.
We know from the first lesson on sampled systems that the magnitude of
the pole determines the decay rate, and we can easily compute the magnitude
of the poles. Both poles have the same magnitude because the two
poles are complex conjugates. We can form the sum of the squares
of the real and imaginary components of the poles. That's going
to be the square of the magnitude.
So, we conclude that a
quadratic factor, z2 + a z+ b, has two poles, both of
magnitude b0.5.
If
we know how rapidly we want the system to respond, then we can put some
bounds on the pole locations. Let's look at a specific situation
and do some calculations of response time.
Example
E1
Given a second order sampled system (two poles) where we can place the
poles wherever we want, we will examine the following question.
Assume that we want a
system that responds within 10% in ten sample periods.
Where should the poles
be?
We know that the the system will have a transfer function with a denominator
of z2 + a z+ b.
Since we know the form of the transfer function, we know - from the material
above - that the magnitude of the two poles is b0.5.
Now, we want to guarantee that the system response will die out 90% of
the way in ten sample periods, and we know that the response will contain
a term of the form:
C1z1k+
C2z2k
This is the decaying
part of the response, and we want it to die out to 10% of the initial value
in 10 sample periods. However, we know that both of the roots can
be written in two forms.
z1 =
(a
+ jb)
= Aejf
z2 =
(a
- jb)
= Ae-jf
And, the response, is
going to have two terms.
C1Akejfk+
C2Ake-jfk
We can bound the response
(taking advantage of the fact that C1
= C1*, so |C1|
= |C2|.
C1Akejfk+
C2Ake-jfk
< 2|C1||A|k
And this will decay
to 10% of its original value when:
|A|k
= 0.1|A|
or when:
kln(|A|) = ln(0.1)
+ ln(|A|)
or when:
k = [ln(0.1) +
ln(|A|)]/ln(|A|)
Actually, for the problem
above, we want k to be 10, so we must have:
Here is a simulation of a sampled system. In this simulation you
have:
yk
= ayk-1 + byk-2 + cuk
You can enter a, b
and c into the text boxes and run the simulation.
You should be able
to enter a value of 0.6 for b and see that the response gets to within
10% of the final value in just about 10 sample periods. (Note that
the horizontal scale is in sample periods for this simulation.)