Techniquecore
Controller discretization by emulation
Also called emulation design, digital redesign.
Designs a continuous controller and turns it into a discrete one by Tustin, matched pole-zero or hold equivalents.
Emulation design first designs a continuous controller by the usual tools, then replaces it by a discrete controller that runs on a computer with the sampling period . The plant still gets its input through a zero-order hold. The common maps are the Tustin (bilinear) map, Tustin with prewarping, the matched pole-zero map, the hold equivalent of , and the Euler maps. This page covers the choice among them and what each does to the margins of the loop. For the map itself and its use for filters, see the bilinear transform; for the exact discrete model of the plant, see zero-order hold discretization. The emulated loop is an approximation: the hold adds a delay of about , which costs phase margin, and this cost is the main check.
In plain words
Most controllers are designed with continuous formulas, but they run on a computer that reads the sensor and sets the actuator only at fixed times. Emulation keeps the continuous design and turns its formula into a rule that updates at each sample. There are several ways to do this. The best common way keeps the behaviour of the controller at low and middle frequencies close to the original and never turns a well-behaved controller into a badly behaved one. All ways have one cost that no formula removes: the actuator value is held between the samples, which acts like a small delay of half a sample. This delay reduces the safety margin of the loop. If the samples are frequent compared with the speed of the loop, the loss is small; if not, design the controller with the delay in mind or design it directly in discrete time.
When it applies
- A continuous controller exists, or the designer prefers continuous tools such as loop shaping or PID rules.
- The sampling is fast compared with the loop: the crossover frequency and the period give a small , so that the loss rad of phase is acceptable.
- An anti-aliasing filter before the sampler is in the design or its lag is small at ; see aliasing.
- If is large, or the plant has fast dynamics near the Nyquist frequency , a direct discrete design on the exact sampled plant is better.
The template
- Design with some margin to spare for the hold: plan on losing about rad of phase margin (a rule of thumb from the delay of of the hold).
- Choose . Take so that is a few degrees, and so that the anti-aliasing filter has little lag at .
- Map to :
- Tustin: .
- Tustin with prewarping at : , which makes equal to exactly at , usually the crossover or a notch frequency.
- Matched pole-zero: map each pole and zero to , put zeros at for excess poles if wanted, and match the gain at (or at another frequency).
- Hold equivalent: , exact for inputs that are constant between samples.
- Euler: forward or backward .
- Write the difference equation. From comes . For PID controllers, see the PID controller page for the usual forms and the anti-windup.
- Check the sampled loop. Discretize the plant exactly with the zero-order hold, close the loop with , and compute the phase margin, and the closed-loop poles in (all inside the unit circle for an asymptotically stable loop).
What each map preserves (theorems).
- Tustin. With , . So with : the discrete response is the exact continuous response at a warped frequency. The map sends the open left half-plane onto the open unit disc, so a BIBO stable gives a BIBO stable of the same order, and the gain at is exact. Prewarping changes the constant so that maps to itself.
- Backward Euler sends the left half-plane into the disc , so BIBO stability is kept.
- Forward Euler sends a pole to , which is inside the unit circle if and only if ; for a real this needs . It can turn a BIBO stable into a that is not.
- Matched pole-zero places the poles exactly at , the poles of the sampled version of .
- Hold equivalent gives the exact samples of the output of when its input is held, so it treats the controller as if it had a hold at its input.
Classic examples
The lead network of the lead-lag page. Take and the lead from the lead-lag compensator page: crossover 4.41659 rad/s, phase margin 49.63 degrees and in continuous time. The plant is discretized exactly with the zero-order hold, and the controller by each map. Measured phase margins of the sampled loop, in degrees; the column "rule" is in degrees:
| rule | forward Euler | backward Euler | Tustin | Tustin, prewarped at | matched | hold equivalent | |
|---|---|---|---|---|---|---|---|
| 0.01 s | 48.36 | 49.13 | 47.61 | 48.36 | 48.36 | 48.35 | 48.82 |
| 0.02 s | 47.10 | 48.65 | 45.61 | 47.10 | 47.10 | 47.04 | 47.88 |
| 0.05 s | 43.30 | 47.31 | 39.71 | 43.30 | 43.33 | 42.98 | 44.23 |
| 0.1 s | 36.98 | 45.50 | 30.25 | 36.94 | 37.13 | 35.76 | 35.15 |
| 0.2 s | 24.32 | 43.64 | 12.83 | 24.14 | 25.34 | 20.25 | 7.20 |
Measured peak sensitivity :
| forward Euler | backward Euler | Tustin | prewarped | matched | hold equivalent | |
|---|---|---|---|---|---|---|
| 0.05 s | 1.514 | 1.762 | 1.638 | 1.636 | 1.647 | 1.661 |
| 0.1 s | 1.597 | 2.295 | 1.935 | 1.921 | 1.985 | 2.153 |
| 0.2 s | 1.644 | 5.308 | 3.030 | 2.849 | 3.495 | 10.502 |
All closed loops in the table have their poles inside the unit circle. What the numbers show:
- Tustin follows the rule to within 0.2 degrees for all : the map itself is nearly exact near , and the loss is the hold.
- Prewarping helps only a little here (25.34 against 24.14 degrees at s), since the warp moves only from 4.417 to 4.347 rad/s at s and to 4.159 rad/s at s.
- The Euler maps turn the frequency variable: , so forward Euler evaluates at turned by , and backward Euler at turned by . On this lead, backward Euler loses the most margin among the Euler and Tustin maps.
- Forward Euler keeps the most phase margin on this lead, because its turn offsets part of the hold. This is a property of this example, not a rule: its controller pole is at s, which makes alternate in sign from sample to sample, and for s the pole leaves the unit circle.
- The hold equivalent of the lead raises the crossover (5.43 rad/s at s, 6.39 rad/s at s) and is the worst at large .
With (at s) the loss is about 6 degrees, which most designs accept.
Variations
- Discrete design. Discretize the plant exactly and design in the -domain, by root locus or loop shaping in or by a state-space method. This avoids the approximation of emulation and is needed for slow sampling.
- Account for the hold in the design. Add a delay , or a Padé approximation of it, to the plant before the continuous design, then emulate. The design then sees the loss of phase and can make up for it.
- Delta operator. Writing the discrete controller in the variable improves the numerical behaviour at fast sampling, when the poles in crowd near 1.
- PID specific forms. Backward differences for the derivative with the filter, forward or Tustin for the integral; see the PID controller page.
- Digital redesign. Methods that choose to match the continuous closed loop, not only , at the sampling instants or in a norm.
Pitfalls
- Slow sampling. The hold costs rad of phase whatever map is used. At s the example lost about 25 degrees with Tustin and more with the others.
- Forward Euler on fast poles. It maps a pole to , which leaves the unit circle when .
- Warping of sharp features. A notch or a resonance moves in frequency with Tustin. Prewarp at that frequency.
- No anti-aliasing filter. Noise above folds down into the band of the loop; the filter itself adds lag that must enter the margin check.
- Checking only against . The comparison must include the hold and the exact sampled plant; a that matches well can still give a poor loop.
- Numbers at fast sampling. With very small , the coefficients of in are close to each other and lose digits; use the delta operator or a state-space form.
Exercises
- Apply Tustin to . (Answer: .)
- For the lead of the example and s, where does forward Euler put the controller pole, and what is the largest that keeps it inside the unit circle? (Answer: ; s.)
- At s, to which discrete frequency does Tustin map the continuous frequency 4.41659 rad/s? (Answer: rad/s.)
- Use the rule to predict the phase margin with Tustin at s. (Answer: rad degrees, so 43.30 degrees, as measured.)
- Compute the prewarped constant for rad/s at s, and compare it with . (Answer: , against 20.)
References
- Arnold Tustin, A method of analysing the behaviour of linear systems in terms of time series, Journal of the Institution of Electrical Engineers, Part IIA 94(1) (1947) 130-142, the whole paper (the bilinear substitution)
- Karl Johan Åström and Björn Wittenmark, Computer-Controlled Systems, third edition, Prentice Hall, 1997, Chapter 8 (approximation of continuous-time controllers)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag WMT4YH Edit this page History Report an error Markdown