The z-transform and discretising a plant
The z-transform does for difference equations what the Laplace transform does for differential equations. With it you can turn a continuous plant and a sampling period into a discrete model and test a digital loop by hand.
THE SHORT ANSWER
The z-transform X(z) = Σ x[k]z⁻ᵏ turns a sequence into a function of z in which a one-sample delay becomes multiplication by z⁻¹, so linear difference equations become pulse transfer functions G(z) = Y(z)/U(z). A continuous plant driven through a zero-order hold has the exact sampled model G(z) = (1 − z⁻¹)Z{G(s)/s}. The sampled loop is stable when every closed-loop pole lies inside the unit circle.
Convert between difference equations and pulse transfer functions, discretise a first-order plant behind a zero-order hold, and find the gain at which a sampled loop becomes unstable.
The previous chapter mapped one continuous pole to z = e^{sT}. That tells you where a sampled mode sits, but not how a held input drives the plant or what feedback does to the pole. The z-transform supplies the missing algebra.
Review the previous lesson: Discrete poles: from the left half-plane to the unit circleFirst, picture it
A digital controller never sees a curve. It sees a list of numbers y[0], y[1], y[2], … taken every T seconds, and it produces another list u[0], u[1], u[2], …. The rule that connects the lists is a difference equation such as y[k+1] = 0.8y[k] + 0.2u[k]: the new value is a fraction of the old value plus a share of the input. The z-transform packs a whole list into one function X(z), and in that packed form 'one sample later' becomes multiplication by z. Rules that step through time turn into fractions in z, which you can multiply, connect in a loop and test for stability.
Build the idea step by step
Define X(z) as the sum of x[k]z^{−k} over k = 0, 1, 2, …. Delaying a sequence by one sample multiplies its transform by z^{−1}, so every linear difference equation becomes a ratio of polynomials in z, the pulse transfer function G(z) = Y(z)/U(z). To find G(z) for a physical plant, look at what the computer does to it: it holds each command constant for one sampling period (a zero-order hold) and reads the output at the sampling instants. During each period the plant therefore responds to a step, which is why the formula contains G(s)/s: G(z) = (1 − z^{−1})Z{G(s)/s}. This model is exact at the sampling instants. Its poles are judged against the unit circle: the samples decay when every pole has |z| < 1. Closing a loop around G(z) moves the poles, and a gain that is harmless in continuous time can push a pole out of the circle through z = −1.
Read the equations
Definition of the one-sided z-transform. The coefficient of z^{−k} is the sample at step k, so you can read a sequence straight from a series in z^{−1}.
Transform pairs to memorise. The unit step is the case a = 1 of the geometric sequence, and the sampled exponential is the case a = e^{−αT}. The z-transform is linear, so sums and constant multiples carry over term by term.
Shift property. A delay of one sample is multiplication by z^{−1}, for a sequence that is zero before k = 0. An advance is multiplication by z, with a correction for the initial value, just as differentiation in s carries x(0).
A difference equation and its pulse transfer function, for zero initial conditions. To go back, multiply out the form in z^{−1} and read each z^{−1} as a one-sample delay.
Zero-order-hold discretisation of a plant. Find the unit-step response of G(s), sample it at t = kT, take its z-transform, and multiply by (1 − z^{−1}).
The first-order result. In the time domain it reads y[k+1] = a·y[k] + K(1 − a)·u[k]. The pole a lies between 0 and 1 and moves towards 1 as the sampling gets faster.
Stability in the z-plane. The left half of the s-plane maps to the inside of the unit circle. A pole on the negative real axis makes its mode change sign at every sample.
Proportional feedback u[k] = K_c(r[k] − y[k]) on the first-order plant. The single closed-loop pole moves left as the gain grows and crosses z = −1 at K_c·K = (1 + a)/(1 − a). The continuous loop has no such upper limit.
Final-value theorem. It holds when all poles of (z − 1)X(z) are inside the unit circle. For a unit step into a stable G(z) it gives the DC gain G(1).
Two substitutions for turning a controller C(s) into C(z). Tustin is the trapezoidal rule and matches the frequency response more closely; backward Euler is the rectangle rule and is simpler.
Discrete PI controller in incremental form. With Tustin the last term becomes (K_i·T/2)(e[k] + e[k−1]).
Half-sample delay rule. Seen from the continuous side, a zero-order hold acts like a time delay of T/2. At frequency ω it removes about ωT/2 rad of phase.
What the symbols mean
- value of a sequence at sample k; zero for k < 0
- integer sample index
- sampling period, s (written Ts in some other chapters)
- complex variable of the z-transform, dimensionless; multiplying by 1/z delays one sample
- z-transform of the sequence x[k]
- unit pulse: 1 at k = 0 and 0 elsewhere
- ratio of a geometric sequence; for the plant, the discrete pole e^{−T/τ}, dimensionless
- input coefficient of the difference equation; K(1 − a) for the first-order plant
- decay rate of a continuous exponential, 1/s
- continuous transfer function and pulse transfer function of the plant
- plant DC gain (output unit per input unit) and time constant, s
- proportional controller gain, input unit per output unit
- reference, output, error r − y and command at sample k
- PI gains; K_i is K_p-units per second
- angular frequency, rad/s, and the phase change caused by the hold, rad
T is the sampling period in seconds; some other chapters on this site write the same quantity as Ts. All sequences start at k = 0, so this is the one-sided z-transform. The zero-order-hold model assumes that the command changes only at sampling instants and that the computation takes no time; a full sample of computation delay adds one more factor z^{−1}.
Sample a first-order plant and find its gain limit
The plant has gain K = 1 and time constant τ = 1 s. The computer updates every T = 0.2 s. First compute the discrete pole.
Apply the zero-order-hold result. Check the DC gain: 0.1813/(1 − 0.8187) = 1.
Write it as a difference equation: cross-multiply and read z·Y(z) as y[k+1].
Close the loop with u[k] = K_c(r[k] − y[k]). The closed-loop pole is the coefficient of y[k].
Require |z| < 1. The right-hand inequality gives K_c > −1 and the left-hand one gives the upper limit, 10.03. The continuous loop, with its pole at s = −(1 + K_c), is stable for every positive gain.
Choose K_c = 2. The pole is 0.4562, well inside the unit circle.
Step the difference equation for a unit-step reference from y[0] = 0. Each new sample is 0.4562 times the last one plus 0.3625.
Find the final value with the final-value theorem. It equals K_c/(1 + K_c), the same steady state as the continuous loop, so the steady-state error is 1/3.
Now push the gain past the limit. At K_c = 10.2 the pole is outside the unit circle on the negative side, so the deviation from the final value flips sign and grows by 3% at every sample.
Reference table
Each pair converges for |z| larger than the magnitude of its pole. A zero-order hold turns K/(τs + 1) into K(1 − a)/(z − a) with a = e^(−T/τ).
More detail and model assumptions
Why G(s)/s appears in the hold formula
Send the single command u[0] = 1 and zero afterwards. The hold turns it into a rectangular pulse of width T, which is a unit step at t = 0 minus a unit step at t = T. Let g_step(t) be the plant's unit-step response, the inverse Laplace transform of G(s)/s. The plant output is then g_step(t) − g_step(t − T). Sample it and transform: the delayed copy gets a factor z^{−1}, so the result is (1 − z^{−1})·Z{g_step(kT)}. That is the hold formula.
For G(s) = K/(τs + 1) the step response sampled at t = kT is K(1 − a^k) with a = e^{−T/τ}. The table gives its transform as K[z/(z − 1) − z/(z − a)] = K(1 − a)z/((z − 1)(z − a)). Multiply by (1 − z^{−1}) = (z − 1)/z and the result is G(z) = K(1 − a)/(z − a). Two checks: the pole a is the image of the plant pole s = −1/τ under z = e^{sT}, and the DC gain G(z = 1) = K equals G(s = 0).
The same steps work for other plants. An integrator G(s) = 1/s has the ramp t as its step response, so G(z) = (1 − z^{−1})·Tz/(z − 1)² = T/(z − 1). With proportional feedback its closed-loop pole is 1 − K_c·T. The loop is stable only for 0 < K_c·T < 2, and at K_c·T = 1 the pole sits at z = 0 and the output reaches the reference in one sample.
Tustin and backward Euler: turning C(s) into code
A controller designed in s must become a difference equation before it can run. Both methods replace integration by a numerical rule. Backward Euler adds a rectangle that uses the newest sample, which corresponds to s ≈ (z − 1)/(Tz). Tustin adds a trapezoid between the last two samples, which corresponds to s ≈ (2/T)(z − 1)/(z + 1). Substitute for s, clear the fractions, and read off the difference equation with z^{−1} as a one-sample delay.
Both methods keep a stable controller stable. Tustin maps the left half of the s-plane exactly onto the inside of the unit circle, and backward Euler maps it into the smaller circle of radius 1/2 centred at z = 1/2. Forward Euler, s ≈ (z − 1)/T, has no such guarantee and can turn a stable filter into an unstable one, so avoid it for fast controller dynamics.
For a PI controller, backward Euler gives u[k] = u[k−1] + K_p(e[k] − e[k−1]) + K_i·T·e[k]. This incremental form stores only the previous command and the previous error, and clamping u[k] to the actuator limits stops integrator windup at the same time. The product K_i·T must appear in the code. If the sampling period changes and the code does not, the integral gain changes with it.
The half-sample delay rule
A held command is a staircase. On average the staircase lags the smooth signal it approximates by half a sampling period. The frequency response of the hold confirms this: (1 − e^{−jωT})/(jωT) has the phase −ωT/2 rad, the phase of a pure delay of T/2.
Use this to budget phase margin before you discretise anything. At the gain crossover frequency ω_c the hold costs about ω_c·T/2 rad. With ω_c = 2 rad/s and T = 0.2 s that is 0.2 rad, or 11.5°. If the computation takes a full sample before the command is applied, add another ω_c·T rad. The rule is an estimate for ω_c·T well below 1; for an exact answer compute the poles of the loop built from G(z).
Final values and steady-state error in z
The point z = 1 plays the role that s = 0 plays in continuous time. A constant sequence has its pole there, the DC gain of a pulse transfer function is G(1), and an integrator is a pole at z = 1. The final-value theorem reads x[∞] = lim (z − 1)X(z) as z → 1. It is valid only when every pole of (z − 1)X(z) lies inside the unit circle, so check stability first.
For a unit-step reference, R(z) = z/(z − 1), so the output of a stable closed loop T(z) settles at T(1). With proportional control of the first-order plant, T(1) = K_c·K/(1 + K_c·K). This is the same steady-state value as in continuous time, because the hold model keeps the DC gain K. Sampling changes the stability limit and the transient, not the steady-state error.
Connect the example to the lab
Open the discrete-poles lab and set σ = −1 s⁻¹, ω = 0 and T = 0.2 s. The lab reports |z| ≈ 0.819. That is the plant pole a = e^{−T/τ} of the worked example, where τ = 1 s. Change T to 0.5 s and the pole moves to about 0.607. The lab maps one open-loop pole only. The closed-loop pole a − K_c·K(1 − a) and the gain limit (1 + a)/(1 − a) are your hand calculation: the limit is 10.03 for T = 0.2 s and 4.08 for T = 0.5 s.
Map the plant pole to the z-planeMake a prediction before moving a control.
- PREDICTThe plant 1/(s + 1) is sampled first with T = 0.2 s and then with T = 0.5 s. Predict the discrete pole a for each period and the largest stable proportional gain (1 + a)/(1 − a).
- CHANGE ONE THINGIn the lab set σ = −1, ω = 0 and T = 0.2 s, and pin the run. Then change only T to 0.5 s.
- OBSERVERead |z| in both runs: about 0.819, then about 0.607. The continuous curve is identical in the two runs; only the spacing of the samples changes.
- EXPLAINThe plant pole a = e^{−T/τ} is the map z = e^{sT} applied to s = −1/τ, so a longer period gives a smaller a. The gain limit (1 + a)/(1 − a) falls from 10.03 to 4.08. The loop tolerates less gain because each held command acts for longer before the next measurement corrects it.
Use the zero-order-hold formula for the plant, and keep Tustin and backward Euler for the controller. The plant really does sit behind a hold, so the hold formula is its exact sampled model. Tustin and backward Euler are approximations for turning a controller C(s) into code. Also, never compare z-plane poles taken at different sampling periods without converting them back to seconds.
Check your understanding+
A first-order plant with proportional feedback is stable for every positive gain in continuous time. Why does the sampled loop become unstable at a finite gain?
Between samples the command is frozen, so the controller keeps pushing on old information. The closed-loop pole a − K_c·K(1 − a) moves left along the real axis as the gain rises and leaves the unit circle at z = −1 when K_c·K = (1 + a)/(1 − a). Beyond that gain every correction overshoots by more than the error it started with, and the error alternates in sign and grows.Solve these before opening the solutions
Work each problem on paper first. Open the answer to check yours, then the full solution if you need the steps, and mark how it went.
Use the table and linearity to find X(z) for the sequence below. Where are its poles, and what do they tell you?
Show answer
AnswerX(z) = z(z − 2)/((z − 0.5)(z − 1)), with poles at 0.5 and 1.
Show full solution
Solution
Transform each term with the table.
Combine over the common denominator.
The pole at 0.5 belongs to the decaying part, and the pole at 1 belongs to the constant −2 that remains. Check with the final-value theorem.
For the difference equation below, find the pulse transfer function and its poles. With zero initial conditions and a unit-step input, compute y[0] to y[3] and the final value.
Show answer
AnswerG(z) = 2z/((z − 0.5)(z − 0.6)), stable. The samples are 0, 2, 4.2, 6.02 and the final value is 10.
Show full solution
Solution
Transform with the shift property: each delay becomes a factor z^{−1}.
Factor the denominator. Both poles are inside the unit circle, so the system is stable.
Step the equation y[k] = 1.1y[k−1] − 0.3y[k−2] + 2u[k−1] with u = 1 from k = 0.
The system is stable, so the final value is the DC gain G(1).
A plant G(s) is driven through a zero-order hold with T = 0.5 s. Find G(z), the difference equation, and the range of proportional gain K_c for which the sampled loop is stable.
Show answer
AnswerG(z) = 0.8848/(z − 0.7788). The loop is stable for −0.25 < K_c < 2.010.
Show full solution
Solution
Identify K = 4 and τ = 2 s, then compute the pole.
Apply the first-order result and write the difference equation.
With u[k] = K_c(r[k] − y[k]) the closed-loop pole is a − K_c·K(1 − a).
Require −1 < z < 1. The upper gain limit is (1 + a)/(1 − a) divided by K.
Discretise the low-pass filter F(s) with T = 0.05 s using (a) Tustin and (b) backward Euler. Write each result as a difference equation and compare its pole with the exact value e^{−10T}.
Show answer
AnswerTustin: y[k] = 0.6y[k−1] + 0.2(u[k] + u[k−1]), pole 0.6. Backward Euler: y[k] = (2/3)y[k−1] + (1/3)u[k], pole 0.667. The exact pole is 0.607.
Show full solution
Solution
Tustin: with T = 0.05 s the substitution is s = 40(z − 1)/(z + 1).
Divide numerator and denominator by z and read off the difference equation.
Backward Euler: the substitution is s = (z − 1)/(0.05z).
Compare the poles. Both approximations are stable and both keep the DC gain F(1) = 1; Tustin lands closer to the exact pole.
Exam level. The plant G(s) sits behind a zero-order hold with T = 0.25 s. The controller is a PI law with K_p = 0.5 and K_i = 2 s⁻¹, discretised by backward Euler. (a) Find G(z) and C(z). (b) Find the closed-loop characteristic equation and decide stability. (c) Find the steady-state error for a unit-step reference. (d) Compute y[1], y[2] and y[3] from rest.
Show answer
AnswerG(z) = 0.7869/(z − 0.6065) and C(z) = (z − 0.5)/(z − 1). The poles 0.410 ± j0.212 have magnitude 0.462, so the loop is stable. The steady-state error is zero, and y = 0.787, 1.038, 1.077.
Show full solution
Solution
Plant: K = 2 and τ = 0.5 s.
Controller: replace 1/s by Tz/(z − 1). Here K_i·T = 0.5.
Characteristic equation 1 + C(z)G(z) = 0. The roots are complex, and the product of a complex pair is |z|², so |z| = √0.2131 = 0.462 < 1.
Steady-state error. The controller pole at z = 1 becomes a zero of the error transfer function, so the final-value theorem gives zero.
Step the two difference equations with r = 1, starting from y[0] = 0, u[−1] = 0 and e[−1] = 0. The commands are u[0] = 1, u[1] = 0.7131 and u[2] = 0.5681.
Mark each exercise after you check your answer. Marks stay in this browser.
Terms this lecture teaches
- z-transformz변환
- zero-order hold (ZOH)영차 홀드
- digital control디지털 제어
- unit circle단위원
- discretization이산화
- discrete-time pole이산 극점
Frequently asked questions
Why does the zero-order-hold formula contain G(s)/s?
The hold turns each command into a rectangular pulse, which is a step minus a step delayed by one period. The plant therefore responds to steps, whose response is the inverse transform of G(s)/s, and sampling that difference gives the factor (1 − z⁻¹).
How do I find the gain limit of a sampled first-order loop?
With the plant K/(τs + 1) behind a hold and proportional feedback, the closed-loop pole is z = a − KcK(1 − a) with a = exp(−T/τ). Requiring |z| < 1 gives KcK < (1 + a)/(1 − a); for τ = 1 s and T = 0.2 s that limit is about 10.03, while the continuous loop has none.
When should I use Tustin and when the zero-order-hold formula?
Use the zero-order-hold formula for the plant, because the plant really sits behind a hold and the formula is exact at the samples. Use Tustin or backward Euler to turn a controller C(s) into a difference equation; both keep a stable controller stable, while forward Euler does not guarantee it.
Does sampling change the steady-state error?
Not for a stable loop built on the zero-order-hold plant model, because the hold keeps the DC gain: G(z) at z = 1 equals G(s) at s = 0. With proportional control the step output still settles at KcK/(1 + KcK); sampling changes the stability limit and the transient instead.
Why the next lesson follows
Everything in this chapter assumed that the samples describe the signal faithfully. The next chapter shows when they do not: a signal that changes too fast for the sampling period shows up in the samples as a slower one.
Further reading
Finished the reading and the exercises? Mark the lecture as done to tick it on the syllabus. Progress stays in this browser.
EIGENROOM · https://eigenroom.com/theory/z-transform · Updated 2026-11-15