MTE 484: Digital Control Applications
Estimated study time: 45 minutes
Table of contents
Sources and References
- Franklin, G. F., Powell, J. D., and Workman, M. L. Digital Control of Dynamic Systems, 3rd ed., Addison-Wesley, 1998.
- Ogata, K. Discrete-Time Control Systems, 2nd ed., Prentice Hall, 1995.
- Astrom, K. J. and Wittenmark, B. Computer-Controlled Systems: Theory and Design, 3rd ed., Prentice Hall, 1997.
- Ljung, L. System Identification: Theory for the User, 2nd ed., Prentice Hall, 1999.
- Khalil, H. K. Nonlinear Systems, 3rd ed., Prentice Hall, 2002.
- MIT OpenCourseWare 6.302 Feedback Systems and 2.010 Modeling, Dynamics and Control.
- Stanford EE 271 Digital Control Systems public lecture materials.
Chapter 1: Continuous Versus Discrete System Modelling
1.1 The Physical Plant and Its Continuous Model
A mechatronic plant — a DC motor with inertia and friction, a flexible beam with a piezoelectric actuator, a pneumatic positioning stage — is governed by continuous differential equations derived from Newton’s laws, Kirchhoff’s laws, and constitutive relations. For a permanent-magnet DC motor driving a load \( J \) with viscous friction \( b \), the electromechanical equations are
\[ L \frac{di}{dt} + R i + K_e \omega = v(t), \qquad J \frac{d\omega}{dt} + b\omega = K_t i - \tau_L. \]Eliminating the current when the electrical time constant \( L/R \) is much faster than the mechanical one yields the familiar first-order velocity model
\[ \tau \dot\omega + \omega = K v, \]with \( \tau = JR/(RB + K_e K_t) \) and \( K = K_t / (RB + K_e K_t) \). In continuous design this leads to Laplace transfer function \( G(s) = K / (\tau s + 1) \), root-locus plots, and PID tuning by Bode or Nyquist criteria.
1.2 The Computer in the Loop
A digital controller samples \( y(t) \) through an analog-to-digital converter (ADC) every \( T \) seconds, computes an update using fixed- or floating-point arithmetic, and writes a command through a digital-to-analog converter (DAC) — typically a zero-order hold that keeps the output constant until the next update. The resulting loop is a hybrid or sampled-data system: the plant is continuous, the controller is discrete, and the two are bridged by sampler and hold.
Three consequences flow from this:
- The useful signal space is limited by the Nyquist frequency \( \omega_N = \pi/T \); anything faster aliases.
- Phase lag is introduced by the hold, approximately \( \omega T / 2 \) radians, reducing closed-loop margin.
- The controller’s dynamics are difference equations, not differentials, and their stability region is the unit disk, not the left-half plane.
1.3 Linearity, Time Invariance, and State-Space
Throughout the course we assume the plant is linear time-invariant (LTI) near a nominal operating point. A nonlinear plant \( \dot x = f(x,u) \) linearized about \( (x_0,u_0) \) gives
\[ \dot{\tilde x} = A \tilde x + B \tilde u, \qquad \tilde y = C \tilde x + D \tilde u, \]with \( A = \partial f / \partial x \big|_0 \) and \( B = \partial f / \partial u \big|_0 \). State-space is more than a notational convenience — it is the natural language of multi-input multi-output (MIMO) systems, modal decomposition, and modern pole placement, and it survives discretization cleanly.
Chapter 2: Sampling and Reconstruction
2.1 The Ideal Sampler
An ideal sampler multiplies a continuous signal \( x(t) \) by an impulse train:
\[ x^\star(t) = \sum_{k=0}^{\infty} x(kT)\, \delta(t - kT). \]The Laplace transform of \( x^\star \) is periodic in imaginary \( s \) with period \( 2\pi/T \), showing that sampling replicates the continuous spectrum at multiples of the sampling frequency \( \omega_s = 2\pi/T \).
2.2 Shannon’s Sampling Theorem and Aliasing
If \( X(j\omega) = 0 \) for \( |\omega| \ge \omega_N = \omega_s/2 \), then \( x(t) \) is recoverable exactly from \( \{x(kT)\} \) by ideal low-pass filtering. If the signal contains energy above \( \omega_N \), those components alias to frequencies below \( \omega_N \) — an oscillation at \( \omega_s - \omega \) appears indistinguishable from one at \( \omega \). For a control loop, aliased sensor noise or unmodelled resonances can destabilize the system in ways invisible to any purely discrete-domain analysis.
2.3 The Zero-Order Hold
Most DACs implement a zero-order hold (ZOH): \( u(t) = u(kT) \) for \( kT \le t < (k+1)T \). Its continuous transfer function is
\[ G_{\text{ZOH}}(s) = \frac{1 - e^{-sT}}{s}, \]a low-pass filter with magnitude \( |T \operatorname{sinc}(\omega T/2)| \) and linear phase \( -\omega T/2 \). The half-sample phase lag is the fundamental cost of digital control — it shrinks phase margin and must be budgeted into the controller.
2.4 Choosing the Sampling Rate
A useful heuristic is \( \omega_s = 20 \omega_{bw} \) to \( 40 \omega_{bw} \), where \( \omega_{bw} \) is the closed-loop bandwidth. Slower sampling saves CPU and quieter anti-alias filters but introduces phase lag and performance degradation; faster sampling costs computation, worsens quantization noise if the ADC word length is modest, and can expose numerical issues in ill-conditioned difference equations. For servo positioning of a 50-Hz closed-loop bandwidth, 1 kHz is a sensible starting point.
| Plant class | Typical bandwidth | Recommended \( f_s \) |
|---|---|---|
| Process (thermal) | 0.01–0.1 Hz | 1–10 Hz |
| Motion servo | 10–100 Hz | 200–2000 Hz |
| Vibration / audio | 100 Hz–10 kHz | 5–40 kHz |
| Hard-disk head | 1–10 kHz | 20–100 kHz |
Chapter 3: Z-Transform Fundamentals
3.1 Definition
For a sequence \( \{x_k\} \) the unilateral z-transform is
\[ X(z) = \sum_{k=0}^{\infty} x_k\, z^{-k}, \]converging outside some circle \( |z| > r_0 \). The complex variable \( z \) plays the role that \( s \) plays in continuous systems, and the mapping \( z = e^{sT} \) links the two domains.
3.2 Key Pairs and Properties
| Sequence | \( X(z) \) | Region of convergence |
|---|---|---|
| \( \delta_k \) | \( 1 \) | all \( z \) |
| \( 1 \) (step) | \( z/(z-1) \) | \( \lvert z\rvert>1 \) |
| \( a^k \) | \( z/(z-a) \) | \( \lvert z\rvert>\lvert a\rvert \) |
| \( k a^k \) | \( az/(z-a)^2 \) | \( \lvert z\rvert>\lvert a\rvert \) |
| \( \cos(k\omega T) \) | \( z(z - \cos\omega T)/(z^2 - 2z\cos\omega T + 1) \) | \( \lvert z\rvert>1 \) |
Essential properties: linearity; time shift \( x_{k-n} \leftrightarrow z^{-n} X(z) \) (for causal sequences); convolution \( \{x\} \ast \{h\} \leftrightarrow X(z) H(z) \); initial value \( x_0 = \lim_{z\to\infty} X(z) \); final value \( \lim_{k\to\infty} x_k = \lim_{z\to 1} (z-1) X(z) \) provided all poles of \( (z-1)X(z) \) lie strictly inside the unit disk.
3.3 Inverse Transform Techniques
Three practical methods:
- Partial-fraction expansion of \( X(z)/z \), then table lookup — the standard route for rational \( X(z) \).
- Long division of numerator by denominator to obtain the first few samples directly.
- Residue / contour integral \( x_k = (2\pi j)^{-1} \oint X(z) z^{k-1} dz \) — useful for closed-form analysis.
3.4 The Map \( z = e^{sT} \)
Stable continuous poles (negative real part) map to the open unit disk. Constant-damping curves in the s-plane become logarithmic spirals in z; constant-frequency lines become radial lines at angle \( \omega T \). The mapping is many-to-one: s-plane strips of height \( \omega_s \) fold onto the same z-plane, which is another way of seeing aliasing.
Chapter 4: Pulse Transfer Function
4.1 Plant Preceded by ZOH
The most common configuration is sampler–ZOH–plant–sampler, whose pulse transfer function is
\[ G(z) = (1 - z^{-1})\, \mathcal{Z}\!\left\{ \mathcal{L}^{-1}\!\left[\frac{G(s)}{s}\right]_{t = kT} \right\}. \]For \( G(s) = a/(s+a) \),
\[ G(z) = \frac{1 - e^{-aT}}{z - e^{-aT}}. \]The pole moves from \( s = -a \) to \( z = e^{-aT} \), as the z-plane mapping predicts; the zero at infinity in continuous time becomes a finite zero whose location depends on \( T \).
4.2 Sampled Zeros
Discretization generically introduces new zeros not present in \( G(s) \). For a plant of continuous relative degree \( r \ge 2 \), the ZOH-discretized plant has additional zeros. For short sampling periods some of these zeros approach the unit circle from outside — producing non-minimum-phase sampled zeros even when \( G(s) \) is minimum-phase. Tustin’s discretization does not share this defect but distorts the frequency axis.
4.3 Cascaded Systems Without Intermediate Sampler
If two continuous blocks share no sampler between them, their pulse transfer function is
\[ G_1 G_2(z) = \mathcal{Z}\!\{ g_1(t) \ast g_2(t) \}_{t = kT} \ne G_1(z) G_2(z). \]Only when a sampler separates them do the z-transforms multiply. This is a frequent source of error in first drafts of a digital controller analysis.
4.4 Closed-Loop Transfer Function
For a unity-feedback loop with digital controller \( D(z) \) and plant pulse transfer \( G(z) \),
\[ \frac{Y(z)}{R(z)} = \frac{D(z) G(z)}{1 + D(z) G(z)}. \]The characteristic equation \( 1 + D(z) G(z) = 0 \) determines stability by the location of its roots relative to the unit circle.
Chapter 5: Discrete State-Space
5.1 Exact Discretization
Given the continuous state-space \( (A,B,C,D) \) with zero-order-hold input, the exact discrete model is
\[ x_{k+1} = \Phi x_k + \Gamma u_k, \qquad y_k = C x_k + D u_k, \]with
\[ \Phi = e^{AT}, \qquad \Gamma = \left(\int_0^T e^{A\sigma} d\sigma\right) B. \]When \( A \) is invertible, \( \Gamma = A^{-1}(\Phi - I) B \). Numerically, the matrix exponential is computed by scaling and squaring of a Padé approximant; MATLAB’s c2d with the zoh option does this reliably.
5.2 Solution of the Difference Equation
By iteration,
\[ x_k = \Phi^k x_0 + \sum_{j=0}^{k-1} \Phi^{k-1-j} \Gamma u_j. \]The discrete mode matrix \( \Phi^k \) decomposes through the eigenvalues of \( \Phi \); each eigenvalue \( \lambda_i \) gives a mode \( \lambda_i^k \) which decays iff \( |\lambda_i| < 1 \).
5.3 Controllability and Observability
\( (\Phi, \Gamma) \) is controllable iff \( [\Gamma, \Phi\Gamma, \dots, \Phi^{n-1}\Gamma] \) has full row rank. \( (\Phi, C) \) is observable iff \( [C^\top, \Phi^\top C^\top, \dots, (\Phi^\top)^{n-1} C^\top] \) has full column rank. A continuous system can lose controllability under discretization at pathological sampling rates \( T = 2\pi k / \omega \) that align with an oscillatory mode — sample faster or slower to recover controllability.
5.4 Transfer Function from State-Space
\[ G(z) = C (zI - \Phi)^{-1} \Gamma + D. \]Poles of \( G(z) \) are eigenvalues of \( \Phi \) (minus any uncontrollable-unobservable ones that cancel).
Chapter 6: Stability Analysis
6.1 Stability Region in the Z-Plane
A discrete LTI system is asymptotically stable iff all poles lie strictly inside the unit circle \( |z|=1 \). The unit circle itself corresponds to marginal stability; the exterior is instability. Contrast with continuous systems, where the boundary is the imaginary axis.
6.2 Jury Test
The Jury stability test is the discrete analogue of Routh-Hurwitz. Given a polynomial
\[ P(z) = a_n z^n + a_{n-1} z^{n-1} + \dots + a_0, \quad a_n > 0, \]we build a tableau whose first two rows are the coefficients and their reversal; subsequent rows contract by two columns using \( 2\times 2 \) determinants. Necessary conditions include \( P(1) > 0 \), \( (-1)^n P(-1) > 0 \), \( |a_0| < a_n \). The full tableau test augments these with inequalities on the last elements of each pair of rows.
For a second-order \( P(z) = z^2 + a_1 z + a_0 \), stability reduces to \( |a_0| < 1 \), \( a_1 + a_0 + 1 > 0 \), \( a_1 - a_0 - 1 < 0 \) — a triangular region in \( (a_0, a_1) \)-space.
6.3 Bilinear Transform and Routh
Substituting \( z = (1+w)/(1-w) \) maps the unit disk to the left-half w-plane; the transformed polynomial in \( w \) can be tested by standard Routh-Hurwitz. This is algebraically heavier than Jury but links discrete stability to the continuous toolkit.
6.4 Nyquist Criterion on the Unit Circle
Traverse \( z = e^{j\omega T} \) for \( \omega \in [0, \pi/T] \) and count encirclements of \( -1 \) by the open-loop \( L(z) = D(z)G(z) \). Stability requires encirclements to balance unstable open-loop poles. Phase and gain margins are read directly as with continuous systems.
6.5 Lyapunov for Discrete Systems
For the linear system \( x_{k+1} = \Phi x_k \), Lyapunov’s discrete theorem states that \( \Phi \) is stable iff for every positive-definite \( Q \) the equation \( \Phi^\top P \Phi - P = -Q \) has a positive-definite solution \( P \). This underwrites robust-control and nonlinear-stability proofs.
Chapter 7: Performance Specifications in Discrete Domain
7.1 Time-Domain Measures
Rise time, settling time, overshoot, and steady-state error translate directly from continuous usage. A dominant complex pole pair at \( z = r e^{\pm j\theta} \) corresponds approximately to continuous damping \( \zeta \) and natural frequency \( \omega_n \) through
\[ r = e^{-\zeta \omega_n T}, \qquad \theta = \omega_n T \sqrt{1-\zeta^2}. \]A common target such as \( \zeta = 0.7, \omega_n = 2\pi \cdot 10 \) rad/s at \( T = 1 \) ms puts the pole at roughly \( r = 0.956, \theta = 0.045 \) rad.
7.2 Steady-State Error
For a unity-feedback discrete loop with open-loop \( L(z) \), the steady-state error to a step input is \( 1/(1 + K_p) \) with position constant \( K_p = \lim_{z\to 1} L(z) \); to a ramp input the velocity constant is
\[ K_v = \lim_{z \to 1} \frac{(z-1) L(z)}{T}. \]The factor \( 1/T \) appears because the discrete ramp \( kT \) has z-transform \( Tz/(z-1)^2 \), in contrast to \( 1/s^2 \) in continuous time.
7.3 Root-Locus Design Regions
On the z-plane we overlay constant-damping spirals and constant-natural-frequency arcs. The designer places closed-loop poles inside a desired region bounded by (i) a damping spiral giving minimum \( \zeta \); (ii) a settling-time circle \( |z| \le e^{-\omega_n \zeta T_s} \); (iii) a bandwidth arc limiting \( \theta \). This is the digital analogue of the s-plane “pie wedge” design target.
Chapter 8: Digital Controller Design by Emulation
8.1 Design-Then-Discretize Philosophy
Emulation starts from a continuous controller \( D(s) \) designed by familiar s-plane tools and replaces it with a discrete \( D(z) \) that approximates the same input-output behaviour. This is attractive when the sampling rate is fast relative to the closed-loop bandwidth and when existing continuous designs need to be ported to a microcontroller.
8.2 Forward and Backward Euler
Forward Euler: \( s \approx (z-1)/T \). Simple but maps some stable s-domain poles outside the unit disk — risky near the stability boundary.
Backward Euler: \( s \approx (z-1)/(Tz) \). Always maps the left-half s-plane inside the unit disk but compresses frequencies heavily.
8.3 Tustin (Bilinear) Approximation
\[ s \leftarrow \frac{2}{T} \frac{z-1}{z+1}. \]The Tustin (or trapezoidal) approximation maps the imaginary s-axis onto the unit circle one-to-one via \( \omega_c = (2/T) \tan(\omega_d T/2) \), so stability is preserved exactly and frequency response is accurate at low frequencies but warped near the Nyquist rate. Prewarping — choosing continuous design parameters so that one critical frequency maps exactly — is standard: replace a corner at \( \omega_0 \) by the continuous design corner \( \omega_0' = (2/T) \tan(\omega_0 T/2) \).
8.4 Matched Pole-Zero (MPZ)
Poles and zeros of \( D(s) \) are mapped individually by \( z = e^{sT} \), and the DC gain is preserved. A \( (z+1)^r \) factor is often appended to match the continuous controller’s relative degree, placing extra zeros at the Nyquist frequency. MPZ retains the pole-zero structure but does not preserve frequency response as faithfully as Tustin at higher frequencies.
8.5 Comparison
| Method | Stability preserved? | Frequency fidelity | Complexity |
|---|---|---|---|
| Forward Euler | No | Low-frequency only | Simplest |
| Backward Euler | Yes | Warped | Simple |
| Tustin | Yes | High (prewarp for exactness at one frequency) | Moderate |
| Matched pole-zero | Yes | Good pole/zero placement, modest magnitude fidelity | Moderate |
Chapter 9: Direct Z-Domain Design
9.1 Root Locus in Z
With \( D(z) = K D_0(z) \) and plant \( G(z) \), the closed-loop characteristic equation \( 1 + K D_0(z) G(z) = 0 \) generates a root locus as \( K \) varies. The rules — asymptotes, break-in / break-away, angle condition — are identical to continuous root locus, but the design target region is inside the unit disk, not the left-half plane.
9.2 Truxal’s Method
Truxal’s synthesis specifies the desired closed-loop transfer function \( T(z) \) directly, then solves
\[ D(z) = \frac{1}{G(z)} \cdot \frac{T(z)}{1 - T(z)}. \]Requirements: \( T(z) \) must share all unstable zeros of \( G(z) \) (to avoid unstable pole-zero cancellation); \( 1 - T(z) \) must share all unstable poles of \( G(z) \) (for internal stability); the relative degree of \( T(z) \) must be at least that of \( G(z) \) (for causal \( D(z) \)).
9.3 Deadbeat and Minimum-Time Control
If we choose \( T(z) = z^{-n} \) for an \( n \)-step plant, the closed-loop poles are all at the origin and the error settles in exactly \( n \) samples — deadbeat response. It is fast but typically demands unrealistically large control signals and is fragile to modelling error and unmodelled dynamics between samples (intersample ripple). Dahlin’s controller softens deadbeat by choosing \( T(z) = (1-a)/(1-az^{-1}) \cdot z^{-d} \), trading settling time for smoother actuation.
9.4 Pole Placement by State Feedback
For the discrete state-space \( (\Phi, \Gamma) \) and controllable pair, the state feedback \( u_k = -K x_k \) places the closed-loop eigenvalues of \( \Phi - \Gamma K \) at any prescribed locations. Ackermann’s formula:
\[ K = \begin{bmatrix} 0 & \cdots & 0 & 1 \end{bmatrix} \mathcal{C}^{-1} \alpha_c(\Phi), \]where \( \mathcal{C} \) is the controllability matrix and \( \alpha_c \) the desired characteristic polynomial. For output feedback, combine pole placement with a state observer
\[ \hat x_{k+1} = \Phi \hat x_k + \Gamma u_k + L(y_k - C \hat x_k), \]choosing \( L \) by duality to place observer poles faster than controller poles (typically by a factor of 2–5).
Chapter 10: Frequency Response in the Discrete Domain
10.1 Discrete Frequency Response
The frequency response of \( G(z) \) is \( G(e^{j\omega T}) \) for \( \omega \in [0, \pi/T] \). Magnitude and phase are plotted against \( \omega \) on a Bode-like diagram, but the response is periodic and ends at the Nyquist frequency.
10.2 The W-Plane
To reuse the continuous Bode machinery without the periodicity, introduce the bilinear map
\[ w = \frac{2}{T} \frac{z-1}{z+1}, \qquad z = \frac{1 + Tw/2}{1 - Tw/2}. \]The unit circle maps to the imaginary w-axis; \( \omega_w = (2/T)\tan(\omega T/2) \) is the pseudo-frequency. Transfer functions in \( w \) look just like continuous transfer functions and admit standard Bode, Nyquist, and lead/lag design. After design, invert the map to get \( D(z) \).
10.3 Lead and Lag Compensators
A discrete lead compensator raises phase near the crossover to restore phase margin cost by the ZOH and computation delay. Designed in the w-plane it takes the form
\[ D(w) = K \frac{1 + w/\omega_1}{1 + w/\omega_2}, \quad \omega_2 > \omega_1, \]and is discretized by the same bilinear map. Lag compensators \( (\omega_2 < \omega_1) \) add low-frequency gain for steady-state accuracy at the cost of slightly reduced phase margin.
Chapter 11: PID Discretization
11.1 Continuous PID
\[ u(t) = K_p e(t) + K_i \int_0^t e(\tau) d\tau + K_d \frac{de}{dt}. \]Practical implementations low-pass-filter the derivative term \( K_d s / (1 + s/N) \) and separate set-point weighting: proportional and derivative often act on measurement, not on error, to avoid derivative kick.
11.2 Discrete PID
Trapezoidal (Tustin) integration of the integral term and backward-difference approximation of the derivative yield
\[ u_k = K_p e_k + K_i T \sum_{j=0}^{k} \frac{e_j + e_{j-1}}{2} + \frac{K_d}{T}(e_k - e_{k-1}). \]A more numerically friendly velocity form computes the increment
\[ \Delta u_k = K_p (e_k - e_{k-1}) + K_i T e_k + \frac{K_d}{T}(e_k - 2 e_{k-1} + e_{k-2}), \]and adds it to the previous output; the velocity form avoids integrator bookkeeping and simplifies anti-windup.
11.3 Anti-Windup
Whenever the actuator saturates, the integral term continues to grow under pure PID, yielding large overshoot when the control signal eventually re-enters the linear region. Remedies:
- Conditional integration: freeze the integrator whenever saturation is active.
- Back-calculation: subtract from the integrator a term proportional to \( (u - u_{\text{sat}}) \).
- Velocity form with clamping: clamp \( u_k \) directly and let the velocity form handle the restart.
Chapter 12: System Identification
12.1 Why Identify
A first-principles model rarely captures every friction, cogging torque, or resonance that shows up in the hardware. System identification estimates a discrete model directly from measured input-output data, yielding parameters consistent with the plant as it actually is.
12.2 ARX and Related Structures
The auto-regressive with exogenous input (ARX) model is
\[ A(q^{-1}) y_k = B(q^{-1}) u_k + e_k, \]with \( A(q^{-1}) = 1 + a_1 q^{-1} + \dots + a_n q^{-n} \) and \( B(q^{-1}) = b_1 q^{-1} + \dots + b_m q^{-m} \), where \( q^{-1} \) is the backshift operator. Written as a regression \( y_k = \varphi_k^\top \theta + e_k \), with regressor \( \varphi_k = [-y_{k-1},\dots,-y_{k-n}, u_{k-1},\dots, u_{k-m}]^\top \), the parameters \( \theta \) are estimated by ordinary least squares.
Variants: ARMAX adds moving-average noise \( C(q^{-1}) e_k \); output-error (OE) models separate plant and noise; Box-Jenkins is the general case. Model structure is chosen from known plant order and from residual whiteness / AIC / BIC tests.
12.3 Least-Squares Estimator
Stack \( N \) data rows into \( Y = \Phi \theta + E \). The batch least-squares estimate is
\[ \hat\theta = (\Phi^\top \Phi)^{-1} \Phi^\top Y, \]optimal under white Gaussian noise. Persistent excitation of the input — a rich enough spectrum, such as a pseudorandom binary sequence (PRBS) — is required for \( \Phi^\top \Phi \) to be well-conditioned.
12.4 Recursive Least Squares (RLS)
For online identification, RLS updates the estimate sample by sample:
\[ \hat\theta_k = \hat\theta_{k-1} + K_k (y_k - \varphi_k^\top \hat\theta_{k-1}), \]with gain \( K_k = P_{k-1} \varphi_k / (\lambda + \varphi_k^\top P_{k-1} \varphi_k) \) and covariance update \( P_k = (P_{k-1} - K_k \varphi_k^\top P_{k-1})/\lambda \). The forgetting factor \( \lambda \in (0.95, 1] \) weights recent data more heavily, enabling tracking of slow parameter drift.
12.5 Validation
Split data into estimation and validation sets. A good model predicts the validation set with small residuals, and the residuals are approximately white (autocorrelation near the impulse) and uncorrelated with past inputs (cross-correlation near zero). Don’t trust a model that fits estimation data perfectly but misses validation data — that is overfitting.
Chapter 13: Nonlinear Phenomena
13.1 Sources of Nonlinearity
No mechatronic system is truly linear. Typical actuators saturate; sensors quantize; mechanical couplings exhibit deadband (no motion until a threshold force is applied) and backlash (play between gear teeth); friction includes Coulomb and Stribeck components; quantization from ADC/DAC wordlength rounds control signals. Any of these can destabilize a nominally stable linear design.
13.2 Saturation and Deadband
Saturation clips the actuator output at \( \pm u_{\max} \). In a loop with integrator it causes wind-up (Section 11.3). Deadband outputs zero until the input magnitude exceeds a threshold; it introduces a steady-state error in position control that cannot be removed by integral action alone.
13.3 Backlash
Backlash models a gap between two rigid parts: for input \( u \) and output \( y \),
\[ \dot y = \begin{cases} \dot u & \text{if } (y = u - \Delta, \dot u > 0) \text{ or } (y = u + \Delta, \dot u < 0), \\ 0 & \text{otherwise.} \end{cases} \]Its describing function has magnitude less than unity and a phase lag — a common cause of gear-train limit cycles.
13.4 Limit Cycles
A nonlinear loop may settle into a sustained oscillation (limit cycle) that no linear analysis predicts. For relay or saturation nonlinearities, the describing function method approximates the nonlinearity by its fundamental-harmonic gain \( N(A) \) as a function of oscillation amplitude \( A \). A limit cycle is predicted where
\[ 1 + N(A) G(j\omega) = 0, \]which gives the candidate amplitude and frequency. The method is accurate when the plant is strongly low-pass so harmonics generated by the nonlinearity are filtered before they complete the loop.
13.5 Phase-Plane Analysis
For second-order nonlinear systems, trajectories in the \( (x, \dot x) \) plane reveal equilibria, stable and unstable manifolds, limit cycles, and multiple basins of attraction. Isoclines and numerical integration are the practical tools. Phase portraits accompany Lyapunov analysis and describing functions to give intuition about what a controller is actually doing at the edge of its linear regime.
13.6 Lyapunov Stability
For \( x_{k+1} = f(x_k) \) with \( f(0)=0 \), an equilibrium is stable if a positive-definite function \( V(x) \) has \( \Delta V = V(f(x)) - V(x) \le 0 \). Global asymptotic stability follows from strict negativity and radial unboundedness of \( V \). For practical nonlinear mechatronics — friction compensation, variable-structure control, sliding-mode schemes — Lyapunov arguments are the main design and verification tool.
Chapter 14: Practical Implementation
14.1 Fixed-Point Arithmetic and Quantization
Low-cost microcontrollers often execute control algorithms in fixed-point arithmetic. The controller designer must choose Q-format (integer and fractional bits) per variable so that internal signals neither overflow nor lose precision. Coefficient quantization can shift poles significantly — a narrow-bandwidth IIR section with poles near \( z = 1 \) is particularly sensitive. The delta operator \( \delta = (z-1)/T \) improves numerical conditioning at high sample rates compared with the shift operator.
14.2 Biquad Sections
Implement high-order digital filters as cascades of second-order sections (biquads):
\[ H(z) = \prod_{i=1}^{L} \frac{b_{0i} + b_{1i} z^{-1} + b_{2i} z^{-2}}{1 + a_{1i} z^{-1} + a_{2i} z^{-2}}. \]Cascade realization is more robust to coefficient quantization than a single direct-form high-order filter, and parallel realization distributes roundoff noise.
14.3 Computation Delay
A controller that samples at \( kT \) and applies the new \( u_k \) at \( kT + \tau_c \) introduces a computation delay \( \tau_c \). Modelled as an extra \( z^{-1} \) when \( \tau_c \approx T \), or as a fractional delay otherwise, it must be folded into the design — either by budgeting extra phase margin or by predictive compensation (Smith predictor, observer-based prediction).
14.4 Task Scheduling and Jitter
Hard real-time operating systems (FreeRTOS, Zephyr, bare-metal timer ISRs) pin the control task to a deterministic period. Jitter in the sampling instant degrades performance proportionally to the loop bandwidth. Rule: sample and update in the ISR; do non-time-critical diagnostics in lower-priority tasks.
14.5 ADC and DAC Considerations
Match ADC resolution to the signal-to-noise ratio of the sensor (12-bit ADC on a 60 dB SNR accelerometer is wasted — 10 bits suffice). Oversample and decimate when quantization noise must be suppressed below a modest anti-alias filter. Use simultaneous-sample ADCs when multiple channels must agree on a common time reference.
Chapter 15: Case Studies
15.1 Velocity Servo of a DC Motor
Plant: \( G(s) = 20/(0.05 s + 1) \). Requirement: zero steady-state error to a step, 2% settling in 40 ms, overshoot under 10%, sampling at 1 kHz.
A continuous PI \( D(s) = 4(1 + 25/s) \) gives phase margin 60° and the desired transient. Discretize by Tustin:
\[ D(z) = \frac{4(1 + 0.025(z+1)/(z-1) \cdot 25)}{1} \]simplifies to a two-tap controller \( D(z) = (K_p + K_i T / 2) + (K_i T/2 - K_p) z^{-1} \) over \( 1 - z^{-1} \). Implement with the velocity form and back-calculation anti-windup; verify in simulation that sensor noise at 300 Hz does not excite the 200 Hz mechanical resonance through the ZOH.
15.2 Mechatronic Positioning Stage
A voice-coil-driven stage with mass \( m \) and coil resistance \( R_c \), plant \( G(s) = K_f/(m s^2 + b s) \). The dominant requirements are sub-micron positioning under a step command and rejection of floor vibration at 20 Hz.
Strategy: state-space model including stage position, velocity, and a disturbance state (constant disturbance estimator). Discretize exactly via \( \Phi = e^{AT} \) at 5 kHz. Design by pole placement with poles at \( z = 0.94 \pm 0.05j \) for the dominant pair and faster observer poles at \( z = 0.8 \pm 0.1j \). Add an integrator on tracking error for zero steady-state error; augment with a notch at the first structural mode.
15.3 Inverted Pendulum Cart
Classic underactuated nonlinear plant with linearization
\[ A = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & -mg/M & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & (M+m)g/(M\ell) & 0 \end{bmatrix}, \quad B = \begin{bmatrix} 0 \\ 1/M \\ 0 \\ -1/(M\ell) \end{bmatrix}. \]Discretize at 100 Hz. Stabilize the upright equilibrium by LQR state feedback with \( Q = \operatorname{diag}(10, 1, 100, 1) \) and \( R = 1 \); build a reduced-order observer driven by cart position and pendulum angle measurements. Use a swing-up controller (energy-based nonlinear law) until the pendulum is within the linear region, then switch to the stabilizing LQR. Saturation of the motor is explicit; anti-windup on the integral of cart-position error prevents wind-up during swing-up.
Chapter 16: Summary and Study Checklist
16.1 Essential Concepts
- Sampled-data systems are hybrid: continuous plant plus discrete controller plus sampler plus hold.
- Aliasing is a hardware problem; anti-alias filters are not optional.
- Z-plane stability is the unit disk; the mapping \( z = e^{sT} \) links domains.
- Pulse transfer functions for ZOH-sampled plants are computed by \( (1-z^{-1}) \mathcal{Z}\{G(s)/s\} \).
- Discretization by Tustin preserves stability and maps frequencies through a warping relation.
- Direct z-domain design (root locus in z, Truxal, pole placement) avoids emulation artifacts when sample rate is close to the bandwidth.
- System identification produces a model that matches the hardware you have, not the one you wish you had.
- Nonlinearities (saturation, deadband, backlash, quantization, limit cycles) require specific analytical tools (describing functions, phase portraits, Lyapunov).
- Implementation details — computation delay, fixed-point arithmetic, task scheduling — are part of the design, not an afterthought.
16.2 Canonical Exam-Style Problems
- Given a continuous plant and sampling period, derive \( G(z) \) via ZOH and analyze closed-loop stability using the Jury test for a proportional controller.
- Design a digital PID by Tustin for a first-order plant; evaluate steady-state error, phase margin, and overshoot.
- Discretize a continuous state-space model exactly; place closed-loop poles by Ackermann’s formula; design a reduced-order observer.
- Estimate ARX parameters from a given dataset by least squares; validate residual whiteness.
- Apply the describing function method to a relay-plus-integrator loop; predict limit-cycle amplitude and frequency.
- Translate a controller between s, w, and z using bilinear maps with prewarping.
- Analyze the effect of a half-sample computation delay on an otherwise designed loop; compensate by observer-based prediction.
16.3 What to Remember
Digital control is not continuous control plus a sampler. It is a self-contained discipline with its own stability region, its own transforms, and its own pitfalls. The concepts compound: sampling creates aliasing, aliasing forces anti-alias filters, filters introduce phase lag, phase lag demands lead compensation, lead compensation in discrete time amplifies noise, noise amplification demands derivative filters, derivative filters introduce new poles, and every step must stay inside the unit disk. Master the chain, and the physical plant at the end of the chain — whether gear-train, piezoelectric stage, quadrotor, or surgical robot — yields to rigorous, repeatable design.