Learning Free Terminal Time Optimal Closed-loop Control of Manipulators

Wei Hu, Yue Zhao, Weinan E, Jiequn Han, Jihao Long

TL;DR

This paper introduces a supervised learning framework to train neural network policies for "free terminal time" optimal control of robotic manipulators, allowing robots to dynamically optimize both their movements and task durations. By combining a time-marching open-loop solver, a modified QRnet architecture to handle terminal discontinuities, and an adaptive sampling strategy, the approach achieves a 98% success rate and near-globally optimal costs across an exceptionally large state space.

What Problem Does This Paper Address?

In robotics, traditional control strategies (like PID or sliding mode control) excel at tracking predefined trajectories but often ignore the robot's intrinsic nonlinear dynamics, leading to suboptimal performance. Model Predictive Control (MPC) considers dynamics but is computationally heavy for real-time online optimization over long horizons.

"Free terminal time" optimal control offers a powerful alternative: it allows the system to dynamically determine the best time duration ($t_f$) to complete a task while minimizing a cost function (e.g., balancing time, energy, and acceleration). However, solving this closed-loop control problem is notoriously difficult. Traditional methods that solve the Hamilton-Jacobi-Bellman (HJB) equation suffer from the "curse of dimensionality" in high-dimensional systems like a 7-Degree-of-Freedom (DoF) robot arm. Furthermore, the optimal control policy often exhibits severe discontinuities or non-differentiability right at the terminal state, causing standard neural networks to fail or become unstable.

Methods

The authors tackle these challenges using an Exploration-Labeling-Training (ELT) framework consisting of three core components:

  1. Iterative DDP Solver with a Marching Scheme: To generate high-quality open-loop training data, the authors use Differential Dynamic Programming (DDP). To prevent the solver from getting stuck in local minima, they introduce a marching scheme that gradually refines the time discretization from coarse to fine grids. The terminal time $t_f$ is updated iteratively using gradient descent followed by quasi-Newton methods.
  2. Modified QRnet for Free Terminal Time: Standard Multi-Layer Perceptrons (MLPs) struggle to stabilize at the terminal state due to control policy discontinuities. The authors adapt QRnet, an architecture that injects a Linear Quadratic Regulator (LQR) solution into the network as a stabilizing prior. Because free terminal time problems don't naturally fit the standard LQR framework (the running cost at the terminal state is non-zero), the authors formulate a fixed-time LQR approximation conditioned on the predicted remaining optimal time. A separate neural network is trained to predict this optimal remaining time ($\hat{t}_f$).
  3. IVP Enhanced Sampling with Automatic Resampling Times (IVP-ART): To combat "distribution mismatch"—where small errors accumulate and drift the robot away from its trained distribution—the authors introduce IVP-ART. This algorithm automatically simulates the current closed-loop policy and identifies the exact timestamp where the trajectory drifts past a threshold $\tau$ from the optimal path, adaptively generating new initial states to query the open-loop solver.

Datasets

The method was evaluated using simulated data generated for a 7-DoF KUKA LWR iiwa 14 manipulator.

  • Domain Scale: The initial positions ($q_0$) were sampled from a massive 7-dimensional cube. This domain is roughly $50^7 \approx 7.8 \times 10^{11}$ times larger than domains used in prior similar studies, representing a much more realistic and challenging deployment scenario.
  • Data Split: The initial dataset consisted of 500 training trajectories, 100 validation trajectories, and 1,000 testing trajectories.

Key Insights and Ideas

  • The Terminal Discontinuity Trap: The authors discovered that even when states are uniformly close to the target, the optimal control inputs vary drastically across all 7 dimensions (see Figure 1). This divergence explains why standard MLPs fail completely at stabilizing the robot arm at the very end of the trajectory.
  • Time-Conditioned LQR Priors: By blending the LQR control matrix with a smoothing sigmoid function that activates only near the terminal state ($t < t_M$), the modified QRnet successfully bridges the gap between global neural network approximation and local linear stability.
Divergence of optimal control around the terminal state (left) and comparison with LQR approximation (right).

Key Results

  • Solver Convergence: The proposed time-discretization marching scheme boosted the open-loop DDP solver's convergence rate from 82.8% to 96.7%.
  • Policy Performance: A standard MLP policy achieved a 0% success rate due to terminal instability. In contrast, the proposed IVP-ART ensemble network with the modified QRnet achieved a 98% success rate.
  • Optimality: The IVP-ART ensemble achieved an average cost ratio of 1.17 (where 1.0 is the theoretical open-loop optimum), vastly outperforming the popular DAGGER baseline, which only managed an 81% success rate and a cost ratio of 3.19 (see Figure 2).
Cumulative distribution of cost ratios comparing IVP-ART iterations and the DAGGER baseline.

Limitations and Future Work

While highly effective, the current formulation has a few limitations:

  • Fixed Terminal State: The policy is trained for a fixed target configuration ($x_f$). If the target changes, the network must be retrained. The authors aim to extend this to varying terminal states in future work.
  • Lack of Constraints: The current optimization does not explicitly account for environmental obstacles or self-collision avoidance constraints, which are critical for real-world deployment.

Summary updated

BibTeX
@inproceedings{hu2023learning,
  author = {Wei Hu and Yue Zhao and Weinan E and Jiequn Han and Jihao Long},
  title = {{Learning Free Terminal Time Optimal Closed-loop Control of Manipulators}},
  booktitle = {ACC},
  year = {2023},
  doi = {10.23919/acc63710.2025.11107674},
}
Figure