Acrobot Swing Up with MATLAB
Yu Xiao
TL;DR
The paper tackles swing-up control for underactuated acrobots (2-link and 3-link) by deriving Lagrangian-based dynamics and recasting them into a first-order mass-matrix form, then solving trajectory optimization problems with direct collocation in MATLAB using OptimTraj. It validates the dynamics through passive simulations and computes minimum-control-effort swing-up trajectories under boundary and box constraints with $\dot{x}=f(x,u,t)$ and $M(q)\\ddot{q}+C(q,\\dot{q})\\dot{q}=\\tau_{g}(q)+Bu$ formulations. The work provides explicit $M(q)$, $C(q,\\dot{q})$, and $\\tau_g(q)$ for both 2-link and 3-link configurations, demonstrates the 2-link swing-up and extends the approach to 3-link systems, and offers a practical optimization-based framework for underactuated swing-up tasks using direct collocation. It sets the stage for future stability and controllability analyses and broadens the applicability to longer-link acrobot chains with the same optimization methodology.
Abstract
This note presents a solution of the swing-up task of two acrobots using trajectory optimization method. The equations of motion for 2-link and 3-link acrobot are manually derived, and then form the dynamics of the robots. Numerical integration method is used to simulate the behaviour of passive robots, with the goal of showing the correctness of the complicated dynamics of the 3-link acrobot. Direct collocation method is used to optimize the trajectory of state and control of the robots with bounds on both.
