---
title: Soft Cart-Pole Control Benchmark
url: https://www.emergentmind.com/topics/soft-cart-pole
type: topic
---

# Soft Cart-Pole Control Benchmark

The Soft Cart–Pole system represents a high-dimensional, continuum-model benchmark for dynamic optimal control in rigid-soft underactuated robotics. This system incorporates a standard cart–rail–pendulum architecture extended with a deformable soft link, capturing rich nonlinear continuum deformations such as bending, twisting, stretching, and shearing. The Soft Cart–Pole serves as a critical testbed for the synthesis and evaluation of advanced control methodologies capable of handling stiff, high-dimensional dynamics and stringent actuation constraints [2602.03435].

## 1. Continuum Modeling and Dynamics

The Soft Cart–Pole’s configuration vector is
\[
\bm q = [d,\,\theta,\,\bm q_{\xi}^\top]^\top \in \mathbb{R}^{11},
\]
with \(d\) representing the cart’s translational position, \(\theta\) the revolute joint at the cart–soft-link interface, and \(\bm q_{\xi}\in\mathbb{R}^9\) denoting soft-link strain coefficients. These coefficients parameterize the soft-body’s deformation via second-order Legendre polynomials, supporting three degrees of freedom for each of bending, twisting, stretching, and shearing modes.

The full state is
\[
\bm x = [\bm q^\top,\; \dot{\bm q}^\top ]^\top \in \mathbb{R}^{22},
\]
and the control input is scalar cart force \(u=F\in \mathbb{R}\), subject to the box constraint \(|F| \le 200\, \mathrm{N}\).

The forward dynamics, derived using the Geometric Variable Strain (GVS) finite-dimensional continuum-rod discretization, take the Lagrangian form:
\[
\bm M(\bm q)\, \ddot{\bm q} + \bm h(\bm q, \dot{\bm q}) = \bm B(\bm q)\, u.
\]
Here, \(\bm M(\bm q)\) is the generalized mass/inertia matrix, \(\bm h(\bm q, \dot{\bm q})\) encapsulates Coriolis, gravity, internal elastic, and damping effects, and \(\bm B(\bm q)\) maps the applied cart force into the generalized coordinates. 

The internal strain energy term is constructed via a continuum-strain model:
\[
V_{\mathrm{strain}}(\bm q) = \frac{1}{2} \int_0^L (\bm \xi(s) - \bm \xi^*)^\top \bm K (\bm \xi(s) - \bm \xi^*)\, ds,
\]
with \(\bm \xi(s)\) the local strain vector, \(\bm \xi^*\) the stress-free configuration, and \(\bm K\) the stiffness matrix. Analytical derivatives are made possible by parameterizing strain with a second-order Legendre polynomial basis as
\(\bm \xi(s) = \sum_{m=0}^2 L_m(s)\, \bm a_m\), enabling efficient computation of mass and potential terms for optimal control applications.

## 2. Optimal Control Problem Formulation

The swing-up task is cast as a fixed-horizon optimal control problem on \(t\in[0,2]\) s. The initial state corresponds to the static, downward configuration:
\[
\bm x(0) = [d(0)=0, \theta(0)=0, \bm q_{\xi}(0)=\bm 0, \dot{\bm q}(0)=\bm 0],
\]
with the target state 
\[
\bm x_{\rm target} = [\bar{\bm q}^\top,\, \bm 0^\top ]^\top,\qquad \bar d = 0,\; \bar \theta = \pi,
\]
and the soft link in its upright equilibrium shape.

The total cost is
\[
J = \ell_f(\bm x(t_f)) + \int_0^{t_f} \ell(\bm x(t), u(t))\, dt,
\]
with stage and terminal costs defined as quadratic penalties on deviations from the target state and on control effort:
\[
\ell(\bm x, u) = \frac{1}{2}(\bm x - \bm x_{\rm target})^\top Q (\bm x - \bm x_{\rm target}) + \frac{1}{2}u^2 R,
\]
\[
\ell_f(\bm x) = \frac{1}{2}(\bm x - \bm x_{\rm target})^\top Q_f (\bm x - \bm x_{\rm target}).
\]

Constraints imposed include:
- System dynamics: \(\dot{\bm x} = \bm f(\bm x, u)\),
- Box-constraint on input: \(|u| \le F_{\max}\),
- (Optional) box-constraints on strain to preclude unphysical continuum bending.

## 3. Solution Algorithms

Three model-based optimal control algorithms are instantiated for the Soft Cart–Pole:

### 3.1. Direct Collocation (DC)
A grid of \(N=100\) time nodes is established, and the trapezoidal rule is enforced via “defect” constraints:
\[
\bm x_{k+1} = \bm x_k + \frac{h}{2}\left[ \bm f(\bm x_k, u_k) + \bm f(\bm x_{k+1}, u_{k+1}) \right],\quad k = 0,...,N-1,
\]
generating a large, sparse nonlinear program (NLP) solved using an interior-point solver with analytic gradients derived from the GVS model.

### 3.2. Box-Implicit Differential Dynamic Programming (Box-IDDP)
A shooting-based approach where input sequence \(\{u_k\}\) is optimized; state trajectory is generated through implicit Euler integration:
\[
\bm g(\bm x_k, \bm x_{k+1}, u_k) = \bm x_{k+1} - \bm x_k - h \bm f(\bm x_{k+1}, u_k) = \bm 0.
\]
The backward pass constructs a local quadratic model of the cost-to-go, with per-time-step box quadratic programs to enforce input constraints. The forward pass solves for the next state using a (Newton–dogleg) algorithm.

### 3.3. Nonlinear Model Predictive Control (NMPC)
At each control instant, a finite-horizon OCP is solved over \(p=100\) steps (covering 1.0 s), again using the Box-IDDP routine. Only the first input is applied before the horizon is shifted and the process repeats, incorporating a warm-start from the previous solution.

### 3.4. Implicit Integration and Solver Techniques
Implicit Euler is utilized in all shooting-based methods for numerical stability given the underlying stiffness of continuum mechanics. The nonlinear residual is solved using a trust-region Dogleg solver (Coleman-Li), leveraging exact partial derivatives supplied by the GVS model.

## 4. Implementation and Computational Aspects

The solvers are implemented with the following settings:
- DC: \(N=100\), with solver tolerance \(10^{-6}\), and no mesh refinement.
- Box-IDDP/NMPC: time step \(h = 0.01\) s, Dogleg tolerance \(10^{-8}\) on residual norm.

Runtimes on an Intel i7-12700H (16 GB RAM) are summarized in the table:

| Method      | Time per Iteration | Time to Convergence | Real-time Feasibility |
|-------------|-------------------|---------------------|----------------------|
| DC          | 0.14 s            | ≈200 s (≈1000 it.)  | Offline              |
| Box-IDDP    | 0.05 s/sweep      | ≈2.5 s (≈50 it.)    | Yes (at 100 Hz)      |
| NMPC        | 0.04 s/solve      | Online*             | 10 Hz feasible       |

*NMPC solves Box-IDDP in receding-horizon mode, with average solve time 0.04 s per cycle.

Initialization via GVS resolution-warm-start (progressively solving the rigid, constant-curvature, and full GVS models) reduces Box-IDDP iterations from ≈80 (random) to ≈30. DC converges robustly, but with higher per-iteration computational cost.

## 5. Results and Comparative Analysis

Simulation reveals distinct control strategies:
- Cart position \(d(t)\): DC and Box-IDDP generate characteristic back-and-forth, non-minimum-phase excursions; NMPC employs a pronounced unidirectional swing.
- Joint angle \(\theta(t)\): All controllers achieve \(\pi\) at \(t_f=2\) s; DC and Box-IDDP incorporate rapid endpoint oscillations to damp soft-link dynamics.
- Mean bending strain \(\langle \kappa_z(t) \rangle\): DC and Box-IDDP excite higher-frequency micro-bending near \(t_f\); NMPC produces smoother, lower-amplitude strain responses.

Performance metrics indicate:
- 100% swing-up success for all methods.
- Swing-up time: DC ≈1.8 s, Box-IDDP ≈1.9 s, NMPC ≈2.0 s.
- Box-IDDP exhibits lowest total control effort \(\int_0^{t_f}|u|^2\,dt\); DC incurs the highest due to aggressive terminal oscillations.

Trade-offs are explicit:
- Box-IDDP provides fastest convergence and lowest online computation, with some sensitivity to local minima.
- DC is preferable for strict constraint enforcement, albeit with 3× greater per-iteration cost.
- NMPC combines Box-IDDP efficiency with feedback robustness, tolerating moderate model/parameter mismatch and disturbances with only modest increase in computation and slight degradation in settling speed.

## 6. Significance and Research Implications

The Soft Cart–Pole exemplifies the transition from low-order, rigid-body benchmarks to continuum high-order models in dynamic optimal control for underactuated soft robots. The adoption of the GVS continuum equations allows for analytically precise gradients, facilitating both efficient and robust algorithmic implementation. The benchmarks established for optimal control algorithms—Direct Collocation, Box-IDDP, and NMPC—provide a reference for control robustness, computational efficiency, and real-time feasibility in high-fidelity, high-DoF settings [2602.03435].

Distinguishing features include explicit modeling of continuum deformation, high-dimensional state–action representations, and the use of implicit integration to address stiff dynamics. The quantitative analyses of solver performance, convergence, and closed-loop robustness furnish critical data for future expansions to experimental platforms and for algorithmic innovation in the domain of soft continuum robot control.

Source: https://www.emergentmind.com/topics/soft-cart-pole