Left Half-Plane
zero phase error tracking · sampling zeros · feedforward

Plotter

Two servo axes, a pen, today's sheet: a square with corners, a three-lobed curve, and a circle test. Each axis answers late, the heavy one later, so a circle drawn at speed comes out a tilted ellipse. The obvious fix, feeding each axis the exact inverse of its model, sends the pen off the paper: sampling put a zero of the model outside the unit circle, and its inverse is unstable. Stand in for that one zero with five numbers, pick a feedrate, and draw the circle at full speed anyway.

world —runs today 0best today —Tomizuka 1987 —
Where you stand today

Each axis is a carriage with a current loop and a mechanical lag, its position loop closed every 20 ms with velocity feedback. Sampled, the closed loop from command to pen is z⁻¹B(z⁻¹)/A(z⁻¹), and one zero of B sits outside the unit circle. The feedforward you tune inverts A and the good zero exactly and puts your five taps, g₋₂ … g₂, where 1/Bᵘ should be; a negative index looks ahead, which the plotter can, because the whole path is known. Cost is the mean distance from the ink to the sheet's line, in millimetres, plus a tenth of a point per second of drawing, so a slow pen pays too. The references each run at the feedrate that suits them best; you choose yours. Hidden today: the two axes are a few percent off the model on gain, lag and current loop, so even Tomizuka's own filter keeps a residual.

The trick

The trick is a palindrome

Feedforward wants the inverse of the plant, and the plant's model has a zero outside the unit circle, so the inverse has a pole there and explodes: try it on the ladder, the pen leaves the paper within a second. Tomizuka's move is not to invert that zero but to mirror it in time. Where the model has Bᵘ(z⁻¹) = 1 − zᵘz⁻¹, the filter uses Bᵘ(z) = 1 − zᵘz, a step into the future instead of the past, scaled by 1/Bᵘ(1)². From reference to pen the two multiply into Bᵘ(z⁻¹)Bᵘ(z), whose coefficients read the same forwards and backwards. A palindrome in time has zero phase at every frequency: the pen may be a little short of the corner, it is never late for it, and both axes are never late by different amounts, which is what a contour sees. Press Mirror and the ellipse becomes a circle. Then look at what it cost: the gain rolls off, the corners round, and a filter with negative side lobes, tuned on the drawing, beats the textbook by a few percent. It has for thirty years.

Cards
Do not invert the bad zero; mirror it in time, and the phase error is exactly zero.zpetc
F = zd A(z⁻¹) Bᵘ(z) / (Bᵃ(z⁻¹) Bᵘ(1)²), y/r = Bᵘ(z⁻¹)Bᵘ(z)/Bᵘ(1)² = |Bᵘ(ejωT)|²/Bᵘ(1)²zero phase error tracking, Tomizuka 1987: real and positive on the unit circle, one at DC, rolling off above, paid for with d + deg Bᵘ samples of preview

Split the closed loop's zeros into the ones you may cancel, Bᵃ, and the ones you may not, Bᵘ, outside or too near the unit circle. Invert A and Bᵃ as usual. For Bᵘ, replace 1/Bᵘ(z⁻¹) by Bᵘ(z)/Bᵘ(1)²: the same polynomial with z⁻¹ turned into z, which is noncausal, which is fine when the reference is known ahead. What the output sees is Bᵘ(z⁻¹)Bᵘ(z), a symmetric FIR, so its frequency response is real: unit gain at DC, no phase anywhere, a gain that falls with frequency. On this plotter's zero near −1.6 the paper sees 0.24z + 0.53 + 0.24z⁻¹.

The residual is gain, not phase, and gain error is the benign kind: it shrinks a contour symmetrically where phase error tilts and smears it. Flattening the gain is the next thirty years of the literature: cascade a symmetric FIR with negative side lobes (Haack and Tomizuka 1991; Torfs, De Schutter and Swevers 1992), which is what your taps do when you push g₋₂ and g₂ below zero. Every improvement keeps the palindrome.

Where this game's Mirror button · feedforward, the same author twelve years earlier · Echo, the same author two years later
Deeper Tomizuka, Zero phase error tracking algorithm for digital control, ASME JDSMC 1987 · Butterworth, Pao & Abramovitch, Analysis and comparison of three discrete-time feedforward model-inverse control techniques, Mechatronics 2012

Sample a smooth plant fast enough and it grows a zero outside the unit circle.sampling-zeros
relative degree r ≥ 3, T → 0: the r − 1 sampling zeros → roots of the Euler–Frobenius polynomial; r = 3: z² + 4z + 1 = 0, z = −3.73, −0.27Åström, Hagander & Sternby 1984: a continuous plant with no zeros at all gets discrete zeros from the hold, and one of them is outside

A zero-order hold turns a continuous plant into a discrete one, and the discrete model has zeros the continuous one never had. For a plant whose input reaches the output through three integrations or lags, as here (current loop, velocity lag, position), fast sampling puts one of those zeros outside the unit circle, at −3.73 in the limit, closer in at practical rates: this plotter's axes sit near −1.6 and −1.5 at 20 ms. It is not a property of the machine. It is a property of looking at the machine only at the sampling instants.

Feedback does not mind: a zero outside the circle limits nothing about stability, and the position loop here is closed happily around it. Inversion minds a great deal, because an inverse turns every zero into a pole. Ignoring the zero costs a fraction of a sample of delay per axis, which a contour forgives; inverting it costs the paper. The bad zero is the cheapest honest reason feedforward is harder than feedback.

Where every sampled servo with a smooth plant · pole for the picture in the s-plane · state-feedback, which never inverts
Deeper Åström, Hagander & Sternby, Zeros of sampled systems, Automatica 1984 · Åström & Wittenmark, Computer-Controlled Systems, ch. 2

The inverse of a stable plant need not be stable, and the cure is to run part of it backwards.stable-inversion
1/(1 − zᵘz⁻¹) = Σ zᵘk z−k diverges for |zᵘ| > 1; = −Σ zᵘ−k zk converges, but runs into the futurethe same rational function has a causal expansion that explodes and a noncausal one that does not

A zero outside the unit circle is a pole of the inverse outside the unit circle, and a causal filter with such a pole grows by |zᵘ| every sample; on the ladder, the exact inverse's command is astronomically large within a second and the pen slams into its end stops. The other expansion of the same fraction is stable but noncausal: it needs the future of the reference. With the whole path known in advance, as it is for a plotter, that future is free, and stable inversion becomes a matter of running the bad part of the inverse backwards in time over the stored reference.

ZPETC is the two-term truncation of that idea, chosen for phase rather than gain; the noncausal series is the long version, exact at every frequency but needing more preview. For plants fed in real time the preview is a buffer, and its length is the price: Preview, on the racing line, is the same trade in another costume.

Where the ladder's second rung · feedforward
Deeper Devasia, Chen & Paden, Nonlinear inversion-based output tracking, IEEE TAC 1996 · Butterworth, Pao & Abramovitch, Mechatronics 2012

A contour forgives a delay and punishes every other kind of phase.contour-error
tracking error e(t) = r(t) − y(t); contour error ε(t) = mins ‖y(t) − r(s)‖the first measures when the pen arrives, the second only where the ink lies; a common delay on both axes moves e and not ε

The score here is contour error: the distance from each dot of ink to the nearest point of the line it was meant to draw. Under that measure a pure delay is invisible, so ignoring the bad zero, which costs each axis about half a sample of lag, costs the paper almost nothing, and on some days it sits level with Tomizuka on the ladder. What the paper does see is phase that differs between axes, and phase that is not a delay: two axes late by different amounts draw a circle as a tilted ellipse, and the all-pass lag of the mirrored-inside filter, ZMETC, smears every corner one way. Gain error, by contrast, shrinks a shape symmetrically, which is why the zero-phase filter's roll-off is the cheaper flaw to carry.

Tracking error is the measure in Tomizuka's paper, and the right one for a single axis following a moving target; contour error is the machinist's, and the reason contouring machines add cross-coupled control between the axes on top of whatever each axis does alone. The switch from one to the other changes which controller wins, which is a good thing to know before choosing a cost.

Where this game's cost · Countersteer, where the error is the lane
Deeper Koren, Cross-coupled biaxial computer control for manufacturing systems, ASME JDSMC 1980

References
  1. M. Tomizuka, "Zero phase error tracking algorithm for digital control," ASME Journal of Dynamic Systems, Measurement, and Control, vol. 109, no. 1, pp. 65–68, 1987.
  2. K. J. Åström, P. Hagander, and J. Sternby, "Zeros of sampled systems," Automatica, vol. 20, no. 1, pp. 31–38, 1984.
  3. M. Tomizuka and D. E. Whitney, "Optimal discrete finite preview problems (why and how is future information important?)," ASME Journal of Dynamic Systems, Measurement, and Control, vol. 97, no. 4, pp. 319–325, 1975.
  4. B. Haack and M. Tomizuka, "The effect of adding zeroes to feedforward controllers," ASME Journal of Dynamic Systems, Measurement, and Control, vol. 113, no. 1, pp. 6–10, 1991.
  5. D. Torfs, J. De Schutter, and J. Swevers, "Extended bandwidth zero phase error tracking control of nonminimal phase systems," ASME Journal of Dynamic Systems, Measurement, and Control, vol. 114, no. 3, pp. 347–351, 1992.
  6. J. A. Butterworth, L. Y. Pao, and D. Y. Abramovitch, "Analysis and comparison of three discrete-time feedforward model-inverse control techniques for nonminimum-phase systems," Mechatronics, vol. 22, no. 5, pp. 577–587, 2012.
  7. S. Devasia, D. Chen, and B. Paden, "Nonlinear inversion-based output tracking," IEEE Transactions on Automatic Control, vol. 41, no. 7, pp. 930–942, 1996.
  8. Y. Koren, "Cross-coupled biaxial computer control for manufacturing systems," ASME Journal of Dynamic Systems, Measurement, and Control, vol. 102, no. 4, pp. 265–272, 1980.
  9. M. Tomizuka, T.-C. Tsao, and K.-K. Chew, "Analysis and synthesis of discrete-time repetitive controllers," ASME Journal of Dynamic Systems, Measurement, and Control, vol. 111, no. 3, pp. 353–358, 1989.
  10. K. J. Åström and B. Wittenmark, Computer-Controlled Systems: Theory and Design, 3rd ed. Prentice Hall, 1997.