Chapter 11: State Estimation for Control (Control-Facing Only)

Lesson 2: Observer Design for Robot States

This lesson develops deterministic state observers for robot manipulators and other robotic systems, focusing on Luenberger-type observers for linearized joint-space models. We derive the observer error dynamics, establish design conditions based on observability, and show how to implement discrete-time observers in software for feedback control. The lesson remains control-facing: we assume that accurate robot kinematics and dynamics are known from previous robotics courses but build the estimation layer needed for state-feedback controllers developed in earlier chapters.

1. Conceptual Overview of State Observers in Robot Control

In previous chapters we often assumed that the full state \( \mathbf{x}(t) \) of the robot was directly available to the controller, e.g. joint positions and velocities. In practice, sensors usually provide only a subset of the state (e.g. encoders give positions, but velocities are noisy when numerically differentiated). A state observer is a dynamical system that reconstructs an estimate \( \hat{\mathbf{x}}(t) \) of the true state from input and output measurements.

For a linearized joint-space model around an operating point we write

\[ \dot{\mathbf{x}}(t) = \mathbf{A}\mathbf{x}(t) + \mathbf{B}\mathbf{u}(t), \quad \mathbf{y}(t) = \mathbf{C}\mathbf{x}(t), \]

where \( \mathbf{x} \) typically stacks joint positions and velocities, \( \mathbf{u} \) stacks actuator inputs (e.g. motor voltages or joint torques \( \boldsymbol{\tau} \)), and \( \mathbf{y} \) contains measured outputs (e.g. encoder readings).

A classical full-order observer (Luenberger observer) uses the same model driven by the known input and corrects the prediction using the output estimation error:

\[ \dot{\hat{\mathbf{x}}}(t) = \mathbf{A}\hat{\mathbf{x}}(t) + \mathbf{B}\mathbf{u}(t) + \mathbf{L}\big(\mathbf{y}(t) - \hat{\mathbf{y}}(t)\big), \quad \hat{\mathbf{y}}(t) = \mathbf{C}\hat{\mathbf{x}}(t), \]

where \( \mathbf{L} \) is the observer gain. Intuitively, the observer simulates the robot model forward in time and nudges the simulated state toward consistency with sensor data.

flowchart TD
  R["Reference r"] --> C["Controller (uses x_hat)"]
  C --> U["Control input u (e.g. tau)"]
  U --> P["Robot plant (A,B)"]
  P --> Y["Sensors y (e.g. joint positions)"]
  Y --> O["Observer: x_hat dynamics"]
  O --> C
        

In this lesson we focus on deterministic observers, assuming that the model and measurements are exact. Stochastic extensions (e.g. Kalman filters) and nonlinear observers for the full robot dynamics are treated in subsequent lessons.

2. Linearized Joint-Space Model for Observers

From robotics courses you know the manipulator dynamics in joint space:

\[ \mathbf{M}(\mathbf{q})\ddot{\mathbf{q}} + \mathbf{C}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}} + \mathbf{g}(\mathbf{q}) = \boldsymbol{\tau}, \]

where \( \mathbf{q} \) are joint positions, \( \dot{\mathbf{q}} \) joint velocities, \( \mathbf{M}(\mathbf{q}) \) the inertia matrix, \( \mathbf{C}(\mathbf{q},\dot{\mathbf{q}}) \) Coriolis/centrifugal effects and \( \mathbf{g}(\mathbf{q}) \) gravity terms. To design linear observers, we consider a small deviation around a nominal operating point \( (\mathbf{q}_0,\dot{\mathbf{q}}_0,\boldsymbol{\tau}_0) \).

Define the state vector \( \mathbf{x} = \begin{bmatrix} \mathbf{q} \\ \dot{\mathbf{q}} \end{bmatrix} \) and the input vector \( \mathbf{u} = \boldsymbol{\tau} \). Via standard linearization (reviewed in earlier chapters), we obtain a local state-space model:

\[ \dot{\mathbf{x}} = \mathbf{A}\mathbf{x} + \mathbf{B}\mathbf{u}, \quad \mathbf{A} = \begin{bmatrix} \mathbf{0} & \mathbf{I} \\ \mathbf{A}_{21} & \mathbf{A}_{22} \end{bmatrix}, \quad \mathbf{B} = \begin{bmatrix} \mathbf{0} \\ \mathbf{B}_2 \end{bmatrix}, \]

where \( \mathbf{A}_{21}, \mathbf{A}_{22}, \mathbf{B}_2 \) are derived from the Jacobians of the dynamics. Typical measurements are joint positions from encoders, so

\[ \mathbf{y} = \mathbf{C}\mathbf{x}, \quad \mathbf{C} = \begin{bmatrix} \mathbf{I} & \mathbf{0} \end{bmatrix}. \]

Here, only positions are measured, while velocities must be reconstructed via the observer. This is a standard scenario in robot control.

3. Luenberger Observer and Error Dynamics

For the linear model in Section 2, a full-order Luenberger observer is defined by

\[ \dot{\hat{\mathbf{x}}} = \mathbf{A}\hat{\mathbf{x}} + \mathbf{B}\mathbf{u} + \mathbf{L}\big(\mathbf{y} - \hat{\mathbf{y}}\big), \quad \hat{\mathbf{y}} = \mathbf{C}\hat{\mathbf{x}}. \]

Define the estimation error \( \mathbf{e} = \mathbf{x} - \hat{\mathbf{x}} \). Subtracting observer dynamics from plant dynamics,

\[ \dot{\mathbf{e}} = \dot{\mathbf{x}} - \dot{\hat{\mathbf{x}}} = \mathbf{A}\mathbf{x} + \mathbf{B}\mathbf{u} - \Big(\mathbf{A}\hat{\mathbf{x}} + \mathbf{B}\mathbf{u} + \mathbf{L}(\mathbf{C}\mathbf{x}-\mathbf{C}\hat{\mathbf{x}})\Big), \]

\[ \dot{\mathbf{e}} = \big(\mathbf{A} - \mathbf{L}\mathbf{C}\big)\mathbf{e}. \]

Thus, the observer error evolves autonomously with system matrix \( \mathbf{A} - \mathbf{L}\mathbf{C} \). The design objective is:

  • Choose \( \mathbf{L} \) so that all eigenvalues of \( \mathbf{A} - \mathbf{L}\mathbf{C} \) have negative real parts (continuous time), i.e. \( \operatorname{Re}(\lambda_i(\mathbf{A}-\mathbf{L}\mathbf{C})) < 0 \).
  • Optionally, place these eigenvalues to achieve a desired convergence rate for the estimation error.

The key structural property is observability. The pair \( (\mathbf{A},\mathbf{C}) \) is observable if the observability matrix

\[ \mathcal{O} = \begin{bmatrix} \mathbf{C} \\ \mathbf{C}\mathbf{A} \\ \vdots \\ \mathbf{C}\mathbf{A}^{n-1} \end{bmatrix} \quad \text{has full column rank}, \]

where \( n \) is the state dimension. Under observability, the following fundamental result holds:

Theorem (Luenberger):

If \( (\mathbf{A},\mathbf{C}) \) is observable, then for any set of desired eigenvalues \( \{\lambda_1,\dots,\lambda_n\} \) with \( \operatorname{Re}(\lambda_i) < 0 \), there exists a gain matrix \( \mathbf{L} \) such that \( \sigma(\mathbf{A}-\mathbf{L}\mathbf{C}) = \{\lambda_i\} \).

Proof sketch (duality):

  • Consider the transpose system \( \dot{\mathbf{z}} = \mathbf{A}^\top \mathbf{z} + \mathbf{C}^\top \mathbf{v} \) with input \( \mathbf{v} \). The pair \( (\mathbf{A}^\top,\mathbf{C}^\top) \) is controllable if and only if \( (\mathbf{A},\mathbf{C}) \) is observable.
  • From state-feedback theory (Chapter 3 and 9), controllability allows arbitrary pole placement via state-feedback \( \mathbf{v} = -\mathbf{K}^\top \mathbf{z} \).
  • Under this feedback, \( \dot{\mathbf{z}} = (\mathbf{A}^\top - \mathbf{C}^\top\mathbf{K}^\top)\mathbf{z} \). Taking transposes, we get an error dynamics matrix \( \mathbf{A} - \mathbf{K}\mathbf{C} \). Setting \( \mathbf{L} = \mathbf{K} \) yields the desired observer error dynamics.

This duality means we can reuse pole-placement algorithms for state-feedback (e.g. from Chapters 3 and 9) to compute observer gains.

4. Observability for Joint-Space Robot Models

For many manipulators, joint encoders measure all joint positions \( \mathbf{q} \), but not velocities directly. Consider the local linear model for a single joint approximated as a damped double integrator:

\[ \dot{\mathbf{x}} = \begin{bmatrix} 0 & 1 \\ 0 & -d \end{bmatrix} \mathbf{x} + \begin{bmatrix} 0 \\ b \end{bmatrix} u, \quad \mathbf{x} = \begin{bmatrix} q \\ \dot{q} \end{bmatrix}, \quad y = \begin{bmatrix} 1 & 0 \end{bmatrix}\mathbf{x}, \]

where \( d > 0 \) models viscous damping and \( b > 0 \) a torque-to-acceleration gain. The observability matrix is

\[ \mathcal{O} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \]

which has full rank. Thus, the pair \( (\mathbf{A},\mathbf{C}) \) is observable: from the position measurement and the dynamics, velocity can be reconstructed.

For an \( n \)-DOF manipulator, stacking all joints yields

\[ \mathbf{x} = \begin{bmatrix} \mathbf{q} \\ \dot{\mathbf{q}} \end{bmatrix} \in \mathbb{R}^{2n}, \quad \mathbf{C} = \begin{bmatrix} \mathbf{I}_n & \mathbf{0} \end{bmatrix}. \]

If the local dynamics matrix \( \mathbf{A} \) has the standard second-order structure (non-singular inertia matrix, non-pathological operating point), one typically obtains an observable pair. Non-observability can arise if some joints are unmeasured or if sensor signals are linearly dependent (e.g. redundant position encoders with no independent information).

For observer design in this chapter, we assume:

  • All controlled joints are equipped with independent position sensors.
  • The linearized pair \( (\mathbf{A},\mathbf{C}) \) is observable or at least detectable (all unstable modes are observable).

5. Discrete-Time Observer and Design Procedure

Real controllers run digitally with sampling period \( T_s \). For the sampled-data model with zero-order hold (ZOH), we have

\[ \mathbf{x}_{k+1} = \mathbf{A}_d \mathbf{x}_k + \mathbf{B}_d \mathbf{u}_k, \quad \mathbf{y}_k = \mathbf{C}\mathbf{x}_k, \]

where

\[ \mathbf{A}_d = e^{\mathbf{A}T_s}, \quad \mathbf{B}_d = \int_0^{T_s} e^{\mathbf{A}\sigma}\,\mathrm{d}\sigma\,\mathbf{B}. \]

A discrete-time Luenberger observer is then

\[ \hat{\mathbf{x}}_{k+1} = \mathbf{A}_d \hat{\mathbf{x}}_k + \mathbf{B}_d \mathbf{u}_k + \mathbf{L}_d\big(\mathbf{y}_k - \mathbf{C}\hat{\mathbf{x}}_k\big). \]

The error dynamics satisfy

\[ \mathbf{e}_{k+1} = (\mathbf{A}_d - \mathbf{L}_d \mathbf{C})\mathbf{e}_k, \]

so we choose \( \mathbf{L}_d \) such that all eigenvalues of \( \mathbf{A}_d - \mathbf{L}_d\mathbf{C} \) lie strictly inside the unit circle.

A practical design rule (compatible with earlier control chapters) is:

  • Design the state-feedback gain \( \mathbf{K} \) for the controller first, achieving desired closed-loop poles for \( \mathbf{A}_d - \mathbf{B}_d\mathbf{K} \).
  • Choose observer poles 3–10 times faster (in continuous time) or significantly closer to the origin (in discrete time), but not too extreme to avoid noise amplification.
  • Use a pole-placement routine (e.g., Python place_poles, MATLAB place) for the dual pair \( (\mathbf{A}_d^\top,\mathbf{C}^\top) \) and then transpose the gain.
flowchart TD
  S["Start with linearized A,B,C and sample time Ts"] --> O1["Check observability of (A_d,C)"]
  O1 -->|ok| P1["Select desired observer poles"]
  O1 -->|not ok| FIX["Add/upgrade sensors or restrict state"]
  P1 --> P2["Use pole placement on (A_d^T,C^T)"]
  P2 --> LGAIN["Compute L_d from feedback gain transpose"]
  LGAIN --> IMP["Implement discrete-time observer in code"]
  IMP --> TUNE["Test with robot model and tune poles if needed"]
        

6. Python Implementation for a Joint-Space Observer

We illustrate a discrete-time observer for a 2-DOF manipulator, modeled near an operating point as two decoupled damped double integrators. For matrix computations we use numpy and scipy. For more realistic robot models, one can integrate this with roboticstoolbox-python (Peter Corke) to obtain \( \mathbf{A}, \mathbf{B}, \mathbf{C} \) from a RigidBodyTree-like model and then apply the same observer design.


import numpy as np
from scipy.linalg import expm
from scipy.signal import place_poles

# 2-DOF approximate joint model: each joint as damped double integrator
n_joints = 2
d = 1.0   # damping coefficient (simplified)
b = 5.0   # torque-to-accel gain (simplified)

# Continuous-time A,B,C for stacked [q1, qdot1, q2, qdot2]^T
Ac = np.array([[0, 1, 0, 0],
               [0, -d, 0, 0],
               [0, 0, 0, 1],
               [0, 0, 0, -d]])
Bc = np.array([[0, 0],
               [b, 0],
               [0, 0],
               [0, b]])
Cc = np.array([[1, 0, 0, 0],
               [0, 0, 1, 0]])  # measure both joint positions

Ts = 0.001  # 1 kHz control loop

# Discretization (simple matrix exponential + integral for B_d)
Ad = expm(Ac * Ts)

# For B_d under ZOH: integral_0^Ts exp(Ac*s) ds * Bc
# Use block matrix trick:
mat = np.block([[Ac, Bc],
                [np.zeros((2, 4)), np.zeros((2, 2))]])
exp_mat = expm(mat * Ts)
Ad_from_block = exp_mat[:4, :4]
Bd = exp_mat[:4, 4:]

# Check they match reasonably
assert np.allclose(Ad, Ad_from_block, atol=1e-9)
Ad = Ad_from_block

# Design discrete-time observer gain L_d
# First, pick desired eigenvalues (faster than controller).
# For example, if controller poles are near 0.9, choose observer near 0.3.
desired_poles = np.array([0.3, 0.35, 0.4, 0.45])

# Dual system: (Ad.T, Cc.T)
pp = place_poles(Ad.T, Cc.T, desired_poles)
Ld = pp.gain_matrix.T

print("Observer gain L_d:")
print(Ld)

# Simple simulation loop (no process noise) showing convergence
x_true = np.array([[0.1],   # q1
                   [0.0],   # qdot1
                   [-0.2],  # q2
                   [0.0]])  # qdot2
x_hat = np.zeros((4, 1))
u = np.zeros((2, 1))  # zero torque for this test

for k in range(1000):
    # True system evolution (for demo: linear model assumed exact)
    x_true = Ad @ x_true + Bd @ u
    y = Cc @ x_true

    # Observer update
    x_hat = Ad @ x_hat + Bd @ u + Ld @ (y - Cc @ x_hat)

# After enough steps, x_hat should be very close to x_true
print("Final estimation error:", (x_true - x_hat).ravel())
      

In an actual robot controller (e.g. using ros_control), the above observer update would run inside the real-time loop using the measured y at each cycle. The estimated state \( \hat{\mathbf{x}}_k \) can then be fed to any state feedback or model-based controller developed in previous chapters.

7. C++ Implementation with Eigen

In C++, the Eigen library is commonly used for linear algebra in robotics (together with ROS, Orocos KDL, or Pinocchio for kinematics and dynamics). Below is a minimal observer implementation for the same 2-DOF joint model, assuming the observer gain has been computed offline (e.g. with MATLAB or Python) and hard-coded.


#include <Eigen/Dense>

using Eigen::Matrix2d;
using Eigen::Matrix4d;
using Eigen::Vector4d;
using Eigen::Vector2d;

struct JointObserver2DOF {
  Matrix4d Ad;
  Eigen::Matrix<double,4,2> Bd;
  Eigen::Matrix<double,2,4> C;
  Eigen::Matrix<double,4,2> Ld;

  Vector4d x_hat;

  JointObserver2DOF() {
    // Example numeric values (should be computed to match your robot model)
    Ad.setIdentity();
    Ad(0,1) = 0.001;
    Ad(2,3) = 0.001;
    // ... fill remaining entries with realistic discretization ...

    Bd.setZero();
    Bd(1,0) = 0.005;
    Bd(3,1) = 0.005;

    C.setZero();
    C(0,0) = 1.0;
    C(1,2) = 1.0;

    // Observer gain Ld (example numbers):
    Ld <<
      0.8,  0.0,
      50.0, 0.0,
      0.0,  0.8,
      0.0,  50.0;

    x_hat.setZero();
  }

  void reset(const Vector4d& x0_hat) {
    x_hat = x0_hat;
  }

  void update(const Vector2d& y_meas,
              const Vector2d& u_k) {
    // Discrete-time observer update:
    // x_hat(k+1) = Ad * x_hat(k) + Bd * u(k) + Ld * (y(k) - C * x_hat(k))
    Vector2d y_hat = C * x_hat;
    x_hat = Ad * x_hat + Bd * u_k + Ld * (y_meas - y_hat);
  }

  Vector4d getStateEstimate() const {
    return x_hat;
  }
};

// In a real robot controller (e.g. in a ROS control loop),
// you would instantiate JointObserver2DOF and call update() each cycle,
// using measured joint positions as y_meas and commanded torques as u_k.
      

In practice, you can obtain \( \mathbf{A}_d, \mathbf{B}_d \) from a dynamics library such as Orocos KDL or Pinocchio by linearizing the continuous-time model at an operating point and discretizing it.

8. Java Implementation with EJML

For Java-based robotics stacks (including some ROS integrations), the EJML library provides efficient matrix operations. Below we implement a simple observer loop, again assuming that the matrices have been computed beforehand.


import org.ejml.simple.SimpleMatrix;

public class JointObserver2DOF {
    private SimpleMatrix Ad;   // 4x4
    private SimpleMatrix Bd;   // 4x2
    private SimpleMatrix C;    // 2x4
    private SimpleMatrix Ld;   // 4x2
    private SimpleMatrix xHat; // 4x1

    public JointObserver2DOF() {
        Ad = SimpleMatrix.identity(4);
        Ad.set(0, 1, 0.001);
        Ad.set(2, 3, 0.001);
        // ... fill remaining entries ...

        Bd = new SimpleMatrix(4, 2);
        Bd.zero();
        Bd.set(1, 0, 0.005);
        Bd.set(3, 1, 0.005);

        C = new SimpleMatrix(2, 4);
        C.zero();
        C.set(0, 0, 1.0); // q1
        C.set(1, 2, 1.0); // q2

        Ld = new SimpleMatrix(4, 2);
        Ld.set(0, 0, 0.8);
        Ld.set(1, 0, 50.0);
        Ld.set(2, 1, 0.8);
        Ld.set(3, 1, 50.0);

        xHat = new SimpleMatrix(4, 1);
        xHat.zero();
    }

    public void reset(SimpleMatrix x0Hat) {
        xHat = x0Hat.copy();
    }

    public void update(SimpleMatrix yMeas, SimpleMatrix u) {
        // yMeas: 2x1; u: 2x1
        SimpleMatrix yHat = C.mult(xHat);
        SimpleMatrix innovation = yMeas.minus(yHat);
        xHat = Ad.mult(xHat).plus(Bd.mult(u)).plus(Ld.mult(innovation));
    }

    public SimpleMatrix getStateEstimate() {
        return xHat;
    }
}
      

EJML integrates well with other Java robotics frameworks and can be used in simulation as well as on-board control software for robots with JVM-capable controllers.

9. MATLAB/Simulink Implementation

MATLAB is widely used for robot control design, and Simulink allows graphical implementation of observer-based controllers. For joint-space robots modeled using robotics.RigidBodyTree (Robotics System Toolbox), one can extract linearizations and design observers as follows:


% Assume 'robot' is a robotics.RigidBodyTree with gravity etc. configured.
% linearize about a given configuration q0, qdot0, tau0:
q0     = [0; 0];       % 2-DOF example
qdot0  = [0; 0];
tau0   = [0; 0];

x0     = [q0; qdot0];  % operating point
u0     = tau0;

% Use a custom function or robotics toolbox helper to compute A,B,C,D
% e.g., A,B,C,D = linearizeRobot(robot, x0, u0);
% For illustration, assume we already have Ac,Bc,Cc,Dc:

% Discretize
Ts = 1e-3;
sysc = ss(Ac, Bc, Cc, Dc);
sysd = c2d(sysc, Ts, 'zoh');
Ad = sysd.A;
Bd = sysd.B;
Cd = sysd.C;

% Check observability
Ob = obsv(Ad, Cd);
if rank(Ob) < size(Ad,1)
    error('System not observable at this operating point.');
end

% Choose observer poles (discrete-time) faster than controller poles
observer_poles = [0.3 0.35 0.4 0.45];  % example
Ld = place(Ad', Cd', observer_poles).'; % duality

% In Simulink:
% - Use a State-Space block for the plant (Ad,Bd,Cd,Dd).
% - Add a second State-Space block for the observer with input [u; y]
%   and internal dynamics: xhat(k+1) = Ad*xhat + Bd*u + Ld*(y - C*xhat).
% - Feed xhat to your state-feedback controller instead of x.
      

In Simulink, the observer can be implemented either using a dedicated state-space block or by expanding the update equations with standard Sum, Gain, and Unit Delay blocks. This makes it easy to combine with existing robot models and control diagrams from previous chapters.

10. Wolfram Mathematica Implementation

Mathematica has built-in support for state-space models and estimators. Below is a sketch for a single-joint observer using StateSpaceModel and StateOutputEstimator.


(* Continuous-time double integrator with damping *)
d = 1.0;  b = 5.0;
Ac = { {0, 1}, {0, -d} };
Bc = { {0}, {b} };
Cc = { {1, 0} };
Dc = { {0} };

sysc = StateSpaceModel[{Ac, Bc, Cc, Dc}];

(* Discretize *)
Ts = 0.001;
sysd = ToDiscreteTimeModel[sysc, Ts, Method -> "ZeroOrderHold"];
Ad = StateSpaceModel[sysd]["A"];
Bd = StateSpaceModel[sysd]["B"];
Cd = StateSpaceModel[sysd]["C"];

(* Choose observer poles and compute estimator gain *)
observerPoles = {0.3, 0.35};
estimator = StateOutputEstimator[sysd, observerPoles];

Ld = estimator["EstimatorGain"]; (* This is L_d *)

(* Simulate closed-loop system with observer *)
u[k_] := 0;  (* zero input for test *)
x0 = {0.1, 0.0};
xhat0 = {0.0, 0.0};

(* Use RecurrenceTable or DiscreteOutputResponse to simulate
   the coupled plant-observer system. *)
      

Using StateOutputEstimator, Mathematica automatically constructs the augmented system with the observer dynamics, which can then be simulated or used for symbolic analysis of error convergence.

11. Problems and Solutions

Problem 1 (Observer Error Dynamics for a Manipulator Joint):

Consider the single-joint model of Section 4 with continuous-time matrices

\[ \mathbf{A} = \begin{bmatrix} 0 & 1 \\ 0 & -d \end{bmatrix}, \quad \mathbf{B} = \begin{bmatrix} 0 \\ b \end{bmatrix}, \quad \mathbf{C} = \begin{bmatrix} 1 & 0 \end{bmatrix}, \]

where \( d > 0 \), \( b > 0 \). Let the observer be

\[ \dot{\hat{\mathbf{x}}} = \mathbf{A}\hat{\mathbf{x}} + \mathbf{B}u + \mathbf{L}\big(y - \mathbf{C}\hat{\mathbf{x}}\big), \quad \mathbf{L} = \begin{bmatrix} \ell_1 \\ \ell_2 \end{bmatrix}. \]

(a) Derive the error dynamics matrix \( \mathbf{A}_e = \mathbf{A} - \mathbf{L}\mathbf{C} \). (b) Find conditions on \( \ell_1,\ell_2 \) so that the observer is asymptotically stable.

Solution:

(a) We have \( \mathbf{L}\mathbf{C} = \begin{bmatrix} \ell_1 \\ \ell_2 \end{bmatrix} \begin{bmatrix} 1 & 0 \end{bmatrix} = \begin{bmatrix} \ell_1 & 0 \\ \ell_2 & 0 \end{bmatrix} \), hence

\[ \mathbf{A}_e = \mathbf{A} - \mathbf{L}\mathbf{C} = \begin{bmatrix} -\ell_1 & 1 \\ -\ell_2 & -d \end{bmatrix}. \]

(b) The characteristic polynomial is

\[ p(\lambda) = \det(\lambda \mathbf{I} - \mathbf{A}_e) = \lambda^2 + (d+\ell_1)\lambda + (d\ell_1 + \ell_2). \]

For asymptotic stability, both coefficients must be positive:

\[ d + \ell_1 > 0, \quad d\ell_1 + \ell_2 > 0. \]

Since \( d > 0 \), we can choose any \( \ell_1 > -d \) and then any \( \ell_2 > -d\ell_1 \) to obtain a stable observer.

Problem 2 (Observer Pole Placement via Duality):

Let \( \mathbf{A} \in \mathbb{R}^{n\times n} \), \( \mathbf{C} \in \mathbb{R}^{p\times n} \) define an observable pair. Show that designing \( \mathbf{L} \) with desired eigenvalues for \( \mathbf{A}-\mathbf{L}\mathbf{C} \) is equivalent to designing state-feedback \( \mathbf{K} \) for the dual system \( \dot{\mathbf{z}} = \mathbf{A}^\top \mathbf{z} + \mathbf{C}^\top \mathbf{v} \).

Solution:

Consider state-feedback \( \mathbf{v} = -\mathbf{K}^\top\mathbf{z} \) for the dual system. The closed-loop matrix is \( \mathbf{A}^\top - \mathbf{C}^\top\mathbf{K}^\top \). Taking transpose gives

\[ \big(\mathbf{A}^\top - \mathbf{C}^\top\mathbf{K}^\top\big)^\top = \mathbf{A} - \mathbf{K}\mathbf{C}. \]

Thus, specifying eigenvalues for \( \mathbf{A}-\mathbf{L}\mathbf{C} \) is equivalent to specifying eigenvalues for \( \mathbf{A}^\top - \mathbf{C}^\top\mathbf{K}^\top \), and we may set \( \mathbf{L} = \mathbf{K} \). Since observability of \( (\mathbf{A},\mathbf{C}) \) equals controllability of \( (\mathbf{A}^\top,\mathbf{C}^\top) \), standard pole-placement algorithms for state-feedback can be used to design \( \mathbf{L} \).

Problem 3 (Separation of Controller and Observer Poles):

Consider a continuous-time system with state-feedback controller \( \mathbf{u} = -\mathbf{K}\hat{\mathbf{x}} \) and Luenberger observer. Assuming \( \mathbf{D} = \mathbf{0} \) for simplicity, show that the eigenvalues of the combined plant+observer closed-loop system are the union of the eigenvalues of \( \mathbf{A}-\mathbf{B}\mathbf{K} \) and \( \mathbf{A}-\mathbf{L}\mathbf{C} \).

Solution:

The true state satisfies \( \dot{\mathbf{x}} = \mathbf{A}\mathbf{x} - \mathbf{B}\mathbf{K}\hat{\mathbf{x}} \), and the observer error follows \( \dot{\mathbf{e}} = (\mathbf{A}-\mathbf{L}\mathbf{C})\mathbf{e} \). Write \( \hat{\mathbf{x}} = \mathbf{x} - \mathbf{e} \), then

\[ \dot{\mathbf{x}} = \mathbf{A}\mathbf{x} - \mathbf{B}\mathbf{K}(\mathbf{x}-\mathbf{e}) = (\mathbf{A}-\mathbf{B}\mathbf{K})\mathbf{x} + \mathbf{B}\mathbf{K}\mathbf{e}. \]

Define the augmented state \( \boldsymbol{\xi} = \begin{bmatrix} \mathbf{x} \\ \mathbf{e} \end{bmatrix} \); then

\[ \dot{\boldsymbol{\xi}} = \begin{bmatrix} \mathbf{A}-\mathbf{B}\mathbf{K} & \mathbf{B}\mathbf{K} \\ \mathbf{0} & \mathbf{A}-\mathbf{L}\mathbf{C} \end{bmatrix} \begin{bmatrix} \mathbf{x} \\ \mathbf{e} \end{bmatrix}. \]

This is an upper block-triangular matrix, so its eigenvalues are the eigenvalues of the diagonal blocks: \( \sigma(\mathbf{A}-\mathbf{B}\mathbf{K}) \cup \sigma(\mathbf{A}-\mathbf{L}\mathbf{C}) \). Thus controller and observer poles can be designed independently (separation principle).

Problem 4 (Discrete-Time Observer Stability Condition):

For a discrete-time observer \( \mathbf{e}_{k+1} = (\mathbf{A}_d - \mathbf{L}_d\mathbf{C})\mathbf{e}_k \), state and output dimensions \( n \) and \( p \), respectively, show that asymptotic stability is equivalent to the spectral radius condition \( \rho(\mathbf{A}_d - \mathbf{L}_d\mathbf{C}) < 1 \).

Solution:

Solutions of the linear time-invariant difference equation are

\[ \mathbf{e}_k = (\mathbf{A}_d - \mathbf{L}_d\mathbf{C})^k \mathbf{e}_0. \]

A necessary and sufficient condition for \( \mathbf{e}_k \rightarrow \mathbf{0} \) as \( k \rightarrow \infty \) for all initial errors is that all eigenvalues of \( \mathbf{A}_d - \mathbf{L}_d\mathbf{C} \) lie strictly inside the unit disk, i.e. spectral radius \( \rho(\mathbf{A}_d - \mathbf{L}_d\mathbf{C}) < 1 \). This follows from the Jordan canonical form and standard results on powers of matrices.

Problem 5 (Observability of Position-Only Measurements):

Consider an \( n \)-DOF robot with state \( \mathbf{x} = [\mathbf{q}^\top, \dot{\mathbf{q}}^\top]^\top \) and measurement \( \mathbf{y} = \mathbf{q} \). Assume the linearized model around a non-singular configuration has inertia matrix \( \mathbf{M}_0 \) and viscous damping \( \mathbf{D}_0 \), so that the second-order form is

\[ \mathbf{M}_0 \ddot{\mathbf{q}} + \mathbf{D}_0 \dot{\mathbf{q}} = \boldsymbol{\tau}. \]

Show that, under the assumption that \( \mathbf{M}_0 \) is non-singular, the pair \( (\mathbf{A},\mathbf{C}) \) with \( \mathbf{C} = [\mathbf{I}_n \ \mathbf{0}] \) is observable.

Solution (sketch):

Writing the system in first-order form yields

\[ \dot{\mathbf{x}} = \begin{bmatrix} \mathbf{0} & \mathbf{I}_n \\ \mathbf{0} & -\mathbf{M}_0^{-1}\mathbf{D}_0 \end{bmatrix} \mathbf{x} + \begin{bmatrix} \mathbf{0} \\ \mathbf{M}_0^{-1} \end{bmatrix} \boldsymbol{\tau}, \quad \mathbf{C} = \begin{bmatrix} \mathbf{I}_n & \mathbf{0} \end{bmatrix}. \]

The observability matrix has first block row \( \mathbf{C} = [\mathbf{I}_n \ \mathbf{0}] \) and second block row \( \mathbf{C}\mathbf{A} = [\mathbf{0} \ \mathbf{I}_n] \). Therefore

\[ \mathcal{O}_2 = \begin{bmatrix} \mathbf{I}_n & \mathbf{0} \\ \mathbf{0} & \mathbf{I}_n \end{bmatrix}, \]

which already has full rank \( 2n \). Higher powers of \( \mathbf{A} \) are not needed. Hence the pair is observable, and joint velocities are recoverable from position measurements and the known dynamics near the operating point.

12. Summary

In this lesson we introduced deterministic state observers for robot manipulators, starting from linearized joint-space models. We defined the Luenberger observer, derived the error dynamics \( \dot{\mathbf{e}} = (\mathbf{A}-\mathbf{L}\mathbf{C})\mathbf{e} \) (or its discrete-time counterpart) and identified observability as the key structural property guaranteeing the existence of stabilizing observer gains. Exploiting the duality between controllability and observability, we connected observer design to standard pole-placement techniques used earlier for state-feedback control.

Finally, we showed how to implement discrete-time observers in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica, and we analyzed the separation between controller and observer design. These tools provide the estimation backbone for the extended Kalman filtering and sensor-fusion methods that will be developed in the next lesson.

13. References

  1. Luenberger, D. G. (1964). Observers for multivariable systems. IEEE Transactions on Automatic Control, 11(2), 190–197.
  2. Luenberger, D. G. (1971). An introduction to observers. IEEE Transactions on Automatic Control, 16(6), 596–602.
  3. Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Transactions of the ASME—Journal of Basic Engineering, 82(1), 35–45.
  4. Hermann, R., & Krener, A. J. (1977). Nonlinear controllability and observability. IEEE Transactions on Automatic Control, 22(5), 728–740.
  5. Kreindler, E., & Sarachik, P. (1964). On the concepts of controllability and observability of linear systems. IEEE Transactions on Automatic Control, 9(2), 129–136.
  6. Isidori, A. (1995). Nonlinear Control Systems. Springer. (Chapters on observers and output feedback.)
  7. Spong, M. W., Hutchinson, S., & Vidyasagar, M. (2006). Robot Modeling and Control. Wiley. (Sections on state estimation and observers.)
  8. Tayebi, A., & McGilvray, S. (2004). Attitude stabilization of a VTOL quadrotor aircraft. IEEE Transactions on Control Systems Technology, 14(3), 562–571. (Observer-based attitude control theory.)
  9. Sontag, E. D. (1998). Mathematical Control Theory. Springer. (Sections on observability and observers.)
  10. Chen, C.-T. (1999). Linear System Theory and Design. Oxford University Press. (Chapters on observer design and separation principle.)