Box-iLQR

Safe Optimal Control using Log Barrier Constrained iLQR

Abhijeet1, and Suman Chakravorty1

1Texas A&M University, College Station, Texas, U.S.A.


Manuscript (PDF)    |    Matlab Code    |    Video    |    Snapshots


Abstract

This paper presents a constrained iterative Linear Quadratic Regulator (iLQR) framework for nonlinear optimal control problems with box constraints on both states and control inputs. We incorporate logarithmic barrier functions into the stage cost to enforce box constraints (upper and lower bounds on variables), yielding a smooth interior-point formulation that integrates seamlessly with the standard iLQR backward–forward pass. The Hessian contributions from the log barriers are positive definite, preserving and enhancing the positive definiteness of the quadratic approximations in iLQR and providing an intrinsic regularization effect that improves numerical stability and convergence. Moreover, since the negative logarithm is convex, the addition of log barrier terms preserves convexity if the cost is already convex. We further analyze how the barrier-augmented iLQR naturally adapts feedback gains near constraint boundaries. In particular, at convergence, the feedback terms associated with saturated control channels go to zero, recovering a purely feedforward behavior whenever control is saturated. Numerical examples on constrained nonlinear control problems demonstrate that the proposed method reliably respects box constraints and maintains favorable convergence properties.


Swing-up Tasks for Pendulum, Cart-pole and Acrobot


Pendulum swing-up without any constraints.

Pendulum swing-up with actuation constraints: -1 < u < 1.

Cartpole swing-up without any constraints.

Cart-pole swing-up with state and control constraints (-2 < u < 2 and -0.2 < x1 < 0.2).

Acrobot swing-up without any constraints.

Acrobot swing-up with control constraints: -5 < u < 5.

Trajectory comparison using snapshots

A descriptive caption for my image
Fig. 1: Time-lapse visualization of the pendulum swing-up task, comparing the unconstrained trajectory (light blue) against the trajectory with both state and control constraints (red).

A descriptive caption for my image
Fig. 2: Time-lapse visualization of the cart-pole swing-up task, comparing the unconstrained trajectory (light blue) against the trajectory with both state and control constraints (red). Vertical dotted lines (--) denote the state constraint (-0.2 < x1 < 0.2).

A descriptive caption for my image
Fig. 3: Time-lapse visualization of the acrobot swing-up task, comparing the unconstrained trajectory (light blue) against the trajectory with both state and control constraints (red).

Citation

If you use our work, please cite our paper:


@misc{abhijeet2026boxilqr,
      title={Safe Optimal Control using Log Barrier Constrained iLQR}, 
      author={Abhijeet and Suman Chakravorty},
      year={2026},
      eprint={2602.05046},
      archivePrefix={arXiv},
      primaryClass={math.OC},
      url={https://arxiv.org/abs/2602.05046}, 
}