---
title: Trajectory Replay via PID Control
url: https://www.emergentmind.com/topics/trajectory-replay-via-pid-control
type: topic
---

# Trajectory Replay via PID Control

Trajectory replay via PID control refers to the faithful reproduction of desired reference trajectories in nonlinear and potentially underactuated mechanical systems using feedback laws centralizing proportional-integral-derivative (PID) structure. This paradigm has been extensively studied in geometric, model-based, and data-driven settings, with rigorous conditions on convergence, stability, and robustness across a variety of platforms, including rolling bodies, aerial vehicles, internally actuated rigid bodies, and helicopters. Modern approaches address the challenges posed by coupled dynamics, underactuation, parameter uncertainties, external disturbances, and the necessity of coordinate-invariant control for systems evolving on non-Euclidean configuration spaces.

## 1. Fundamental Principles of Trajectory Replay via PID Control

Trajectory replay aims to ensure that the system output tracks a prerecorded trajectory $y_{\mathrm{ref}}(t)$ despite model mismatches, nonlinearity, coupling, and external disturbances. The PID controller—featuring proportional, integral, and derivative feedback on the tracking error—forms the backbone of this approach, providing disturbance rejection, bias cancellation, and rapid transient response.

For mechanical systems with configuration $q(t) \in \mathcal{Q}$ (possibly a Lie group), the control law must respect the geometric structure. Notably, for non-Euclidean configuration spaces, the definition of error, the computation of gradients, and the integration of error signals require intrinsic (coordinate-independent) formulations. This leads to the geometric PID framework, which augments standard PID with Riemannian geometry and covariant derivatives for integrator updates [1610.04395].

In underactuated or coupled systems not naturally fitting the mechanical system template required for geometric PID, feedback regularization is employed. This transforms the closed-loop dynamics into an appropriate form by injecting quadratic-in-velocity (Christoffel) and potential-shaping terms, after which a geometric PID becomes applicable to the regularized system [1609.09557].

## 2. Methodological Frameworks

### 2.1 Feedback Regularization and Geometric PID

In systems such as the hoop robot on an inclined plane, the natural dynamics do not immediately present as a simple mechanical system due to unwanted coupling and drift terms. The feedback-regularization procedure identifies and cancels these terms through a precisely engineered inner-loop torque, rendering the nominal error dynamics compatible with Levi-Civita-geometric PID control.

For a hoop robot with state $(o, \theta, \theta_a, \omega, \omega_a)$, the regularized dynamics for position and actuator variables are

\[
\mathbb{I}(\theta_a)\,\nabla_{\omega_a}\,\omega_e = \Delta_h + \tilde\tau_u,
\]
where $\omega_e$ is the velocity error, $\mathbb{I}(\theta_a)$ is the coupled inertia, $\Delta_h$ bundles constant biases (e.g., unknown incline), and $\tilde\tau_u$ is the geometric PID control input [1609.09557].

The outer PID loop is constructed intrinsically:
\[
\tilde\tau_u = -\mathbb{I}(\theta_a)\bigl(k_p\,\eta_e + k_d\,\omega_e + k_I\,o_I\bigr),
\]
where $o_I$ evolves via
\[
\dot o_I = \eta_e - \Gamma(\theta_a)\,\omega_a\,o_I.
\]

### 2.2 Geometric PID on Lie Groups

For systems evolving on Lie groups (e.g., rigid bodies, multirotors), the geometric PID control framework defines configuration and velocity errors intrinsically and updates the integral error using the Levi-Civita connection. The general PID torque for configuration error $E$ and velocity error $\xi_e$ is

\[
\tau = -I \left(K_P\,\eta + K_D\,\xi_e + K_I\,\zeta\right) + f_{\mathrm{ff}}(E, \xi_e, \xi_d),
\]
with $I$ the inertia tensor, $\eta = \mathrm{grad}\,V(E)$, and $\zeta$ the integral state evolved via $I\,\nabla_{\xi_e}\,\zeta = I\,\eta$ [1610.04395].

### 2.3 Model-Free and Adaptive Approaches

In high-dimensional, nonlinear, or empirically tuned environments (e.g., two-degree-of-freedom helicopters or UAVs), PID controller design may leverage LQR-based synthesis on an augmented model followed by the application to the true system, possibly using an ultra-local model to estimate and cancel all unmodeled dynamics online (i-LQR-PID) [2103.10988].

Alternatively, PID gain tuning itself can be formulated as a sequential learning problem with explicit modeling of input-dependent noise, as in heteroscedastic Bayesian optimization (HBO-PID). Here, repeated replays of the trajectory are used to minimize RMS tracking error under a two-stage GP optimizer, efficiently adapting PID gains for best tracking in the presence of stochasticity and system uncertainties [2512.24249].

## 3. Stability, Robustness, and Performance Guarantees

Careful Lyapunov analysis underpins PID-based trajectory replay in geometric settings. Characteristic Lyapunov candidates on the error and integrator bundles establish almost-global (or almost-semiglobal) asymptotic convergence, often with locally exponential rates outside small neighborhoods. For example:

- For the hoop robot, gains $(k_p, k_d, k_I)$ must satisfy $0 < k_I < k_d^3(1-\delta^2)/\mu$ and $k_p > \max\{k_1, k_2, 2\kappa k_d^2\}$ to guarantee semi-almost-global convergence and exact rejection of constant biases (e.g., inclined plane) [1609.09557].
- For rigid bodies with internal rotors on $SO(3)$, geometric PID control enables almost-global attitude tracking on the level-set of the momentum map, with stability conditional on similar gain inequalities [1703.07839].

Model-free ultra-local methods relax strict model knowledge assumptions, but stability relies on fast enough estimation and sufficient smoothness of the unmodeled dynamics. For i-LQR-PID, closed-loop error dynamics approximate a stable polynomial system safeguarded by LQR-based pole placement [2103.10988].

HBO-PID leverages empirical replay performance as the optimization metric. While not guaranteed a priori, the two-stage GP approach delivers empirical robustness and accuracy on both simulated and real UAVs, consistently outperforming classical and random-search-based PID tuning in trajectory tracking metrics [2512.24249].

## 4. Practical Implementation and Tuning

Implementation of trajectory replay via PID involves the following recurring steps:

- **Reference Processing**: At control step $t$, the reference trajectory $y_{\mathrm{ref}}(t)$ and its derivative(s) (and possibly second derivatives for feedforward) are computed.
- **Error Computation**: The current measurement $y(t)$ (or configuration and its velocity in geometric settings) is compared to the reference, yielding the tracking error in the appropriate intrinsic coordinates.
- **Integrator Update**: For geometric controllers, the integrator state is updated via intrinsic differential equations (e.g., covariant transport); for standard PID, via filtered sums or forward Euler integration.
- **Feedback Law Application**: Torque, force, or control input is synthesized as a combination of scaled error, its derivative, and the integrator, possibly plus feedforward and regularization terms.
- **Actuator Saturation and Anti-windup**: Real systems implement saturation logic and anti-windup for the integral state.
- **Gain Tuning**: For geometric PID, explicit inequalities on gains guarantee convergence; in data-driven methods like HBO-PID, gains are optimized via episodic replay and stochastic search [1609.09557, 2512.24249].

A range of sampling rates, filtering windows, and integrator schemes are documented, usually trading off reactivity against noise sensitivity or actuator constraints [2103.10988, 2512.24249].

## 5. Representative Results and Comparative Performance

The following summarizes documented performance in benchmark scenarios:

| Platform                         | Approach                        | Position Error (RMS)     | Attitude/Angle Error (RMS) | Key Robustness/Notes                                          |
|-----------------------------------|----------------------------------|--------------------------|----------------------------|--------------------------------------------------------------|
| Hoop robot on incline             | Feedback-regularized geometric PID [1609.09557] | $<2$ mm in $<2$ s         | bounded actuator velocity   | Robust to $50\%$ parameter mismatch, unknown tilt $\beta\le36^\circ$ |
| Quanser 2-DoF helicopter         | Model-free i-LQR-PID [2103.10988] | Pitch $0.94^\circ$      | Yaw $2.33^\circ$           | Faster settling ($\sim4$ s), robust to ±5% gain perturbations |
| UAV (simulation—ellipse, spiral)  | HBO-PID [2512.24249]             | $0.137$–$0.305$ m        | $0.323^\circ$–$0.649^\circ$| $24.7-42.9\%$/ $40.9-78.4\%$ error reduction vs SOTA         |
| Rigid body with internal rotors   | Geometric PID [1703.07839]       | Attitude error $\to0$    | Velocity error $\to0$       | AGAT from almost all initial conditions                      |

These results confirm both the accuracy and robustness of PID-based trajectory replay, especially when geometric structure and adaptive tuning are exploited.

## 6. Extensions, Limitations, and Generalizations

Geometric PID and its feedback-regularized extensions accommodate fully actuated, underactuated, coupled, and constrained (holonomic or nonholonomic) mechanical systems. The rigorous split between coordinate-invariant feedback (geometry) and model-based or model-free adaptation (regularization, HBO-tuning) enables deployment across rigid bodies, rolling robots, aerial vehicles, and laboratory platforms.

Limitations include:

- Model-free schemes such as i-LQR-PID and HBO-PID rely on accurate differentiation of noisy signals and may suffer staggered performance if the unmodeled dynamics vary rapidly or sensor noise is high.
- In highly nonlinear, rapidly varying, or high-dimensional parameter landscapes, tuning efficiency and sample complexity can remain a bottleneck.

A plausible implication is that further integration of geometric model-based methodologies and advanced sequential learning may yield increasingly robust, globally stable trajectory replay across broader robotic domains.

## 7. References

- Feedback-regularization and geometric PID for underactuated mechanical systems: [1609.09557]
- Geometric PID framework for mechanical systems: [1610.04395]
- Almost-global geometric PID for internally actuated rigid bodies: [1703.07839]
- Model-free i-LQR-PID architecture for multirotors: [2103.10988]
- Heteroscedastic Bayesian optimization for PID tuning in UAVs: [2512.24249]

Source: https://www.emergentmind.com/topics/trajectory-replay-via-pid-control