|
| 1 | +# Feedback Linearization |
| 2 | + |
| 3 | +## Overview & Motivation |
| 4 | + |
| 5 | +Nonlinear plants such as robot arms, quadrotors, and electromechanical drives are only well-controlled by a fixed linear gain over a narrow operating range. Feedback linearization resolves this by exploiting a known model of the plant's nonlinearity to cancel it exactly in the closed loop, leaving an equivalent linear system — decoupled integrator chains — that a single outer-loop gain set can drive correctly across the full operating envelope. No gain scheduling, no lookup tables, no re-tuning when the operating point changes. |
| 6 | + |
| 7 | +## Mathematical Theory |
| 8 | + |
| 9 | +### Control-Affine Plant |
| 10 | + |
| 11 | +The technique applies to plants whose output $y \in \mathbb{R}^m$ satisfies, after $r$ differentiations, |
| 12 | + |
| 13 | +$$y^{(r)} = a(x) + B(x)\, u$$ |
| 14 | + |
| 15 | +where $x \in \mathbb{R}^n$ is the state, $u \in \mathbb{R}^m$ is the input, $a(x) \in \mathbb{R}^m$ is the **drift term** (known nonlinear dynamics), and $B(x) \in \mathbb{R}^{m \times m}$ is the **decoupling matrix** (state-dependent input gain). The integer $r$ is the relative degree. For mechanical systems ($r = 2$), $B(x) = M(q)$ is the inertia matrix and $a(x) = C(q, \dot{q})\dot{q} + g(q)$ is the Coriolis-plus-gravity term. |
| 16 | + |
| 17 | +### Inner Control Law (Cancellation) |
| 18 | + |
| 19 | +The inner law selects $u$ so that the term $a(x)$ is cancelled and the decoupling matrix is factored out: |
| 20 | + |
| 21 | +$$u = B(x)\, v + a(x)$$ |
| 22 | + |
| 23 | +Substituting into the plant equation yields |
| 24 | + |
| 25 | +$$y^{(r)} = a(x) + B(x)\bigl(B(x)\,v + a(x)\bigr) - a(x) = v$$ |
| 26 | + |
| 27 | +leaving pure integrator chains $y^{(r)} = v$, provided $B(x)$ is nonsingular. |
| 28 | + |
| 29 | +### Outer Control Law (Linear Outer Loop) |
| 30 | + |
| 31 | +With the plant reduced to integrators, a PD outer loop commands the virtual input: |
| 32 | + |
| 33 | +$$v = y_d^{(r)} + K_d\,\dot{e} + K_p\, e, \quad e = y_d - y, \quad \dot{e} = \dot{y}_d - \dot{y}$$ |
| 34 | + |
| 35 | +The closed-loop error satisfies the linear ODE |
| 36 | + |
| 37 | +$$e^{(r)} + K_d\,\dot{e} + K_p\, e = 0$$ |
| 38 | + |
| 39 | +whose eigenvalues are set by choosing $K_p, K_d$. Critical damping per channel requires $K_d = 2\sqrt{K_p}$. |
| 40 | + |
| 41 | +### Combined Law |
| 42 | + |
| 43 | +Expanding yields the single expression evaluated on the hot path: |
| 44 | + |
| 45 | +$$u = B(x)\bigl(y_d^{(r)} + K_d\,\dot{e} + K_p\, e\bigr) + a(x)$$ |
| 46 | + |
| 47 | +No matrix inversion appears on the hot path: the law multiplies by $B(x)$, not by $B(x)^{-1}$. |
| 48 | + |
| 49 | +## Complexity Analysis |
| 50 | + |
| 51 | +| Operation | Time | Space | Notes | |
| 52 | +|--------------|--------------------|--------------|----------------------------------------| |
| 53 | +| Construction | $O(m^2)$ | $O(m^2)$ | Copy two gain matrices | |
| 54 | +| ComputeInput | $O(m^2)$ | $O(m)$ extra | Two matrix-vector products dominate | |
| 55 | +| Model query | $O(m^2)$–$O(nm^2)$ | $O(m^2)$ | Implementation-defined; injected model | |
| 56 | + |
| 57 | +All storage is in fixed-size stack arrays; the law itself performs no heap allocation. |
| 58 | + |
| 59 | +## Step-by-Step Walkthrough |
| 60 | + |
| 61 | +Consider a 2-DOF planar arm with $m = 2$, $K_p = 100 I$, $K_d = 20 I$, and at one instant: |
| 62 | + |
| 63 | +- State $x = [0.1, 0.2]^\top$, $\dot{x} = [0, 0]^\top$. |
| 64 | +- Reference $y_d = [0.5, 0.5]^\top$, $\dot{y}_d = [0, 0]^\top$, $\ddot{y}_d = [0, 0]^\top$. |
| 65 | +- Model returns $B(x) = I$ and $a(x) = [0.3, 0.1]^\top$. |
| 66 | + |
| 67 | +1. Compute error: $e = [0.4, 0.3]^\top$, $\dot{e} = [0, 0]^\top$. |
| 68 | +2. Compute virtual input: $v = 0 + 20 \cdot 0 + 100 \cdot [0.4, 0.3]^\top = [40, 30]^\top$. |
| 69 | +3. Inner law: $u = I \cdot [40, 30]^\top + [0.3, 0.1]^\top = [40.3, 30.1]^\top$. |
| 70 | + |
| 71 | +The gravity-like drift $a(x)$ is added directly; the outer PD term drives position error to zero. |
| 72 | + |
| 73 | +## Pitfalls & Edge Cases |
| 74 | + |
| 75 | +- **Singular decoupling matrix**: if $B(x)$ is rank-deficient the inner law is undefined. The condition $\det B(x) \neq 0$ must hold throughout the operating region. |
| 76 | +- **Model mismatch**: cancellation is only as exact as the model. Unmodelled dynamics or parameter error leaves a residual nonlinearity; pair with a robust or adaptive outer term to bound the error. |
| 77 | +- **Zero dynamics**: exact linearisation of the output may leave internal states unobservable. These zero dynamics can be unstable even when the output tracks perfectly. Verify stability of the internal dynamics before deployment. |
| 78 | +- **Actuator limits**: the inner law can command arbitrarily large $u$ near the start of a transient. Saturation on $u$ breaks the exact cancellation argument; scale $K_p$, $K_d$ or add a reference pre-filter to keep the command within actuator bounds. |
| 79 | +- **Float precision**: for large $m$, matrix products accumulate rounding error proportional to $m \cdot \epsilon_\text{float}$. Verify the gain matrices are well-conditioned. |
| 80 | + |
| 81 | +## Variants & Generalizations |
| 82 | + |
| 83 | +- **Input-output linearization (SISO)**: for scalar output with relative degree $r > 1$, the cancellation uses Lie derivatives $L_f^r h(x)$ and $L_g L_f^{r-1} h(x)$, and the input is $u = (v - L_f^r h(x)) / L_g L_f^{r-1} h(x)$. The singularity condition $L_g L_f^{r-1} h \neq 0$ replaces $\det B \neq 0$. |
| 84 | +- **Computed-torque control**: the mechanical specialisation with $B = M(q)$ and $a = C(q,\dot{q})\dot{q} + g(q)$. The canonical instantiation lives in robotics-toolbox-cpp. |
| 85 | +- **Partial feedback linearization**: linearizes only the input-output channels, leaving the rest of the state dynamics (zero dynamics) uncontrolled by the outer loop. |
| 86 | +- **Adaptive feedback linearization / MRAC**: replaces the fixed model with an online-adapted estimate, enabling cancellation under parametric uncertainty. |
| 87 | + |
| 88 | +## Applications |
| 89 | + |
| 90 | +- Robot manipulators: decoupled Cartesian impedance or position control across the full joint-space workspace. |
| 91 | +- Quadrotor UAVs: attitude and altitude decoupling for independent channel control. |
| 92 | +- Electromechanical drives: cancellation of back-EMF and friction in torque-controlled axes. |
| 93 | +- Chemical process control: inversion of Hammerstein-type nonlinear input maps. |
| 94 | + |
| 95 | +## Connections to Other Algorithms |
| 96 | + |
| 97 | +- **Backstepping**: recursive alternative for strict-feedback systems; tolerates drift terms that cannot be directly cancelled. |
| 98 | +- **Model Reference Adaptive Control (MRAC)**: adapts the model online; complements feedback linearization when the plant parameters are unknown. |
| 99 | +- **LQR**: natural choice for the outer linear loop once the plant has been linearized. |
| 100 | +- **Sliding Mode Control**: robustifies the outer loop against residual model mismatch by adding a discontinuous reaching term. |
| 101 | + |
| 102 | +## References & Further Reading |
| 103 | + |
| 104 | +- A. Isidori, *Nonlinear Control Systems*, 3rd ed., Springer, 1995. |
| 105 | +- J.-J. Slotine, W. Li, *Applied Nonlinear Control*, Prentice-Hall, 1991, Chapter 6. |
| 106 | +- H. K. Khalil, *Nonlinear Systems*, 3rd ed., Prentice-Hall, 2002, Chapter 13. |
0 commit comments