Z-Transforms
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
After reading these notes, you should be able to:
- Recognize the transform of variables x[n] \rightarrow \mathcal{X}(z), v[n] \rightarrow \mathcal{V}(z)
- Use scaling and shifting identities to convert difference equations into polynomials in z or z^{-1}.
- Recognize that the abstract 'K' and 'H' operators can be represented as rational functions of z.
- Use Black's formula to compute closed loop transfer functions!!!!
- Use pattern matching to convert back to the time domain:
- Generate system difference equations
- Determine natural frequencies
- Compute specific outputs using the partial fraction expansion.
- Compute steady-state behavior directly from the closed-loop transfer function!!
The z transform gives us a way to specify input-output behavior in a way that allows us to make very concrete use of Black's formula, and to analyze feedback systems. Don't miss that!!!!
Change in velocity (acceleration) is proportional to force:
Change in position is proportional to velocity:
Change in force is proportional to control input (inductor L\frac{di_L}{dt} = v_{L}):
Notice the reappearance of \gamma, our generic proportionality factor usually calibrated by measurement.
If p_d[n] is the desired position at sample time n and p[n] is the actual location, we define the error at time n to be:
Our control input c[n] is:
The Z-transform of a time-series x[n] is given by the summation:
There are some subtleties about the unilateral Z transform, and almost all of them have to do with the meaning of shift relationships like
Consider a time sequence in the form of a geometric series. That is,
The Z-transform of the time sequence in the form of a geometric series is easily calculated using infinite summation formulas as in
For values of z>a, meaning az^{-1}<1, the summation has a finite value given by
If w[n] = \alpha x[n-1], a scaled and shifted version of x[n], the Z-transform of w[n] is related to the Z-transform of x[n] as:
We can see this by writing out the Z-transform of w[n] explicitly:
Where we used the fact that z^{-(n-1)}z^{-1} = z^{-n}.
We changed the starting value of n in the summation because we know that x[0-1]=0 which means the n=0 term is 0. We can relabel the index of the sum using n'=n-1.
Remember our system model from section 2. We can rewrite our difference equation for velocity using Z-transforms as:
where \mathcal{V} denotes the Z transform of the sequence v.
Solving for \mathcal{V}(z), we get:
We had a similar difference equation for the position p[n] so we can write that its Z-transform is:
And likewise we can relate the Z-transforms for the force and control input:
Combining these we get:
This describes how we go from an input control to an output of position, which we draw schematically as:
If \;\;\;v[n] = c_1x[n] + c_2 w[n] \;\;\;\;
Then \;\;\;\mathcal{V}(z) = c_1 \mathcal{X}(z) + c_2 \mathcal{W}(z).
We can see this by distributing the sum:
From the control input difference equation:
We get the Z-transform:
We call the system that gives the control input from the error K(z) and add it to the schematic of our system. (The image below shows E(z) as an output of the K(z) block but should be viewed as an input multiplied by K(z))
We described our "plant" as
We can use Black's formula to combine the K and H operators to get:
We define
We can expand out \mathcal{G}(z) using the definitions of \mathcal{K} and \mathcal{H},
If we define \alpha \equiv \Delta T^3 \gamma (K_p + \frac{K_d}{\Delta T}) and \beta \equiv \Delta T^3 \gamma \frac{K_d}{\Delta T}, we can rewrite the numerator and the second term in the denominator to get:
Expanding the (1-z^{-1})^3 term:
If: \mathcal{P}(z) = \mathcal{H}(z) \mathcal{P}_d(x) and \mathcal{H}(z) = \frac{\sum_{l=0}^{L'} b_l z^{-l}}{1-\sum_{l=1}^{L} a_l z^{-l}}, that is \mathcal{H}(z) is a rational function in z
Then: The difference equation is:Alternatively, we can isolate p[n] to one side to get the equation in "update form",
The natural frequencies of the difference equation are all the \lambda's such that
That is, the \lambda's are the roots of the polynomial, the solutions to the polynomial equation
For polynomials above order three, the natural frequencies are usually impossible to calculate analytically. So either one guesses or uses an iterative numerical procedure. Almost every programming language has a math package with such an iterative numerical procedure, also called a "root-finder". For example, in matlab, the command
We say that \mathcal{H}(z) represents a difference equation if it has a rational function representation, that is, \mathcal{H}(z) can be represented as the ratio of numerator and denominator polynomials in z.
If \mathcal{H}(z) has a rational function representation, and the roots of the denominator polynomial are all less or equal to one in magnitude, \mathcal{H}(z) represents a stable difference equation. And if the roots of the denominator polynomial are strictly less than 1 in magnitude, then the difference equation is strictly stable.
We had found that:
So:
or we could write it as
When using unilateral transforms, one should be careful to write equations in terms of delays, n-1, n-2,... because it is easy to violate the assumption that variables are zero for n < 0 when writing advances. For example, if x[n] = 0 for n < 0, and x[n] = 1 , n \ge 0 (x is the unit step), and y is related to x by
Avoiding writing advances is why we usually write \mathcal{H}(z) as rational functions in NEGATIVE powers of z.
If we have a system where the force applied at time n is proportional to the error we have:
Since \mathcal{P}(z) = \mathcal{G}(z) \mathcal{P}_d(z), we get the difference equation:
The natural frequencies \lambda will be the roots of the equation \lambda ^2 -2 \lambda + (1+ K_p\Delta T^2), which we already know are larger than one in magnitude for all K_p > 0.
The proportion feedback closed-loop system is always unstable.
Assume that we have the system:
Suppose p_d[n] =1 for n\geq 0 and p[n] = 0 for n<0.
Since we recognize that p_d[n] = a^n where a=1, we know its Z-transform is:
Thus the Z-transform for p[n] is:
From this, can we recover p[n]?
If \lambda_1 and \lambda_2 are the natural frequencies, \lambda_1 is NOT EQUAL to \lambda_2, and neither is equal to 1, then
By linearity and pattern matching, this suggests that:
By cross-multiplying, and exploiting the fact that the roots of the denominator polynomial of \mathcal{P}(z) are unique (that is \lambda_1, \lambda_2, and 1 are unique values), you should be able to find that,
Again note that this is only true with \lambda_1,\lambda_2, and 1 are distinct. It is possible analyze the case of repeated roots, but the resulting formulas do not lend much insight.
If a system is strictly stable, and the input to the system is a unit step, then eventually the output of the system will be
That is, we can compute the steady-state step response by evaluating the closed-loop transfer function at z = 1.