z-Plane Design and Digital Compensators
Once a system is represented in the -domain, many classical design ideas reappear with new geometry. Nise shows block-diagram reduction, stability, steady-state error, root locus, gain design, cascade compensation via the -plane, and digital compensator implementation. The central translation is simple: the unit circle replaces the imaginary axis as the stability boundary.
Digital design has two common routes. One route discretizes an already designed analog compensator, often with the Tustin transformation. Another route designs directly in the -plane using root locus and transient-response grids. In either case, the final controller must be converted into a difference equation that can run on a processor.
Definitions
The exact pole mapping is
For an underdamped continuous pole
the corresponding discrete pole has magnitude
and angle
Thus constant damping-ratio and natural-frequency curves in the -plane are not straight lines like the simplest -plane sketches.
The bilinear or Tustin transformation maps an analog compensator to a digital one using
This maps the stable left half-plane into the unit disk, though it warps frequency unless prewarping is used.
A digital compensator
is implemented by cross-multiplying and translating powers of into sample delays. For example,
implies
Key results
Digital root locus uses the same angle and magnitude conditions as continuous root locus, but on the -plane:
Points on the locus satisfy
and
Stability requires all closed-loop poles inside . As gain changes, poles can cross the unit circle. The crossing is the digital analog of imaginary-axis crossing in continuous time.
Discrete steady-state error also mirrors continuous error. In a unity-feedback digital system,
The final value theorem for sequences is commonly written
provided the closed-loop poles satisfy the required stability conditions. Poles at increase digital system type.
For implementation, always convert the compensator into a causal difference equation. Coefficients must be scaled for numeric precision, saturation must be handled, and sample timing must be deterministic enough for the model assumptions to hold.
Direct -plane design uses root-locus rules that look familiar but feel different. A point near the unit circle decays slowly, even if its angle is large. Moving a pole inward increases decay rate. Moving a pole around the circle changes oscillation frequency. Constant damping-ratio curves bend because the exponential map wraps the -plane into the unit disk. Designers often map desired continuous pole locations to first, then use the digital root locus to see whether those points are achievable.
The Tustin transformation is popular because it maps stable analog poles to stable digital poles. However, it warps frequency: equal intervals of analog frequency do not map to equal intervals of digital frequency. If a compensator must match behavior at a particular frequency, prewarping may be used. Without prewarping, Tustin is still often adequate when the sampling rate is high compared with the important loop bandwidth.
Difference-equation form should be selected with numerical implementation in mind. A high-order transfer function implemented as one direct-form polynomial can be sensitive to coefficient quantization. Cascading first-order and second-order sections is often more robust. Integrators should be protected against windup, and internal states should be bounded or scaled so fixed-point arithmetic does not overflow.
Digital compensators also need startup behavior. Delay states such as and must be initialized. If they are initialized inconsistently with the plant state, the controller can produce a bump at startup. In safety-critical systems, controllers often include bumpless transfer logic so switching between manual and automatic modes does not create a sudden actuator jump.
Testing should compare three responses: the ideal continuous design, the sampled model with zero-order hold, and the actual embedded implementation. Differences among them reveal sampling delay, quantization, saturation, and scheduling effects. Nise's digital chapter gives the classical sampled-data framework; real deployment completes the loop by validating that the code follows the assumed difference equation at the assumed period.
Digital steady-state error design is clearest when the pole at is recognized as the sampled integrator. A digital controller with a factor accumulates error from sample to sample. This can eliminate constant error in a stable loop, but it also creates the same windup risk as an analog integrator. Output limits and reset logic must be included in real implementations.
Root locus in the -plane can be visually misleading if the unit circle is not drawn with equal aspect ratio. A pole that appears safely inside the circle on a stretched plot may actually be close to instability. Always check pole magnitudes numerically. Stability is determined by , not by apparent distance on a distorted display.
The discrete controller should be written in a form that matches code execution order. A difference equation may use current error , previous error , and previous command . If the ADC reading is not available until after the output update, the implemented equation has an extra delay. The timing diagram is part of the controller definition.
When discretizing analog compensators, compare frequency response before trusting the result. Plot the analog compensator and the digital compensator mapped over the frequency range of interest. If they differ near crossover, the sampling period is too slow, prewarping is needed, or direct digital redesign may be preferable. A symbolic transformation alone does not guarantee performance equivalence.
Finally, digital compensators should be tested under finite precision. Floating-point desktop simulations may hide overflow, rounding, and limit-cycle behavior that appears on a microcontroller. Fixed-point scaling, saturation arithmetic, and coefficient quantization can be as important as the nominal transfer function.
A controller update should be written as code-like pseudocode before deployment: read inputs, compute error, update stored states, apply saturation and anti-windup, write output, and save histories. This order determines the realized transfer function and any extra delay.
Reviewing this pseudocode catches many implementation mistakes before hardware testing.
It also documents the exact controller semantics.
That documentation should accompany tests.
Keep it versioned.
Visual
| Design route | Procedure | Advantage | Caution |
|---|---|---|---|
| analog then discretize | design in , map to | uses familiar lead/lag methods | sampling and warping can change margins |
| direct -plane design | design poles in unit disk | accounts for sampling geometry | less intuitive without grids |
| emulation with fast sampling | implement analog-like controller | simple for slow plants | delay and quantization still matter |
| discrete redesign | identify pulse transfer function | accurate sampled model | depends on good sampling assumptions |
Worked example 1: Tustin discretization of a PI controller
Problem: Discretize
with sampling period s using Tustin,
Method:
- Rewrite the controller:
- Substitute :
- Multiply numerator and denominator by :
- Expand:
Thus
- Divide by to express with :
Checked answer: .
Worked example 2: difference equation implementation
Problem: Implement
as a difference equation from error to controller output .
Method:
- Write
- Cross-multiply:
- Expand:
- Translate into one-sample delay:
- Solve for current output:
Checked answer: the update law is .
Code
import numpy as np
def pi_tustin_update(errors):
u = np.zeros_like(errors, dtype=float)
for n in range(len(errors)):
e_now = errors[n]
e_prev = errors[n - 1] if n > 0 else 0.0
u_prev = u[n - 1] if n > 0 else 0.0
u[n] = u_prev + 2.2 * e_now - 1.8 * e_prev
return u
errors = np.ones(10)
u = pi_tustin_update(errors)
print("controller output for unit error:", u)
z_poles = np.roots([1, -1])
print("controller pole:", z_poles)
Common pitfalls
- Designing stable analog poles but discretizing with too slow a sampling period.
- Forgetting that a pole on is an integrator and must be handled carefully with saturation.
- Implementing a noncausal transfer function because numerator order was not checked in form.
- Ignoring coefficient quantization in fixed-point controllers.
- Assuming the zero-order hold output equals a smooth analog control signal.
- Failing to test timing jitter. Digital control assumes consistent sampling.
Connections
- Digital sampling and z-transform introduces the transform and unit-circle stability.
- PID and compensators gives the analog PI/PID forms discretized here.
- Frequency-response design is often used before digital emulation.
- Embedded systems covers timers, ADCs, DACs, and fixed-point implementation concerns.
- Simulation helps compare continuous, sampled, and held responses.