Modeling and CasADi-Based NMPC for Stabilization and Tracking of Multiple Desired Reference Configurations in a Double Inverted Pendulum
Indrazno Siradjuddin1, Yan Watequlis Syaifudin1, Wahyu Aulia Nurwicaksana1, Ida Lailatul Fitria1, Handry Khoswanto2
- 1 Politeknik Negeri Malang
- 2 Petra Christian University
IEEE International Symposium on Consumer Electronics (ISCE), 2025
This paper presents a modeling and control approach for a double inverted pendulum system mounted on a cart using Nonlinear Model Predictive Control (NMPC) implemented via the CasADi framework. The dynamic model is derived from Lagrangian mechanics and discretized using a fourth-order Runge-Kutta method to ensure accurate state propagation. The NMPC controller is designed to stabilize the inherently unstable system and accurately track multiple desired reference configurations, including transitions between upright and inverted states of both pendulum links. The optimization problem is solved at each time step using IPOPT, leveraging symbolic differentiation and efficient numerical solvers within CasADi. Simulation results demonstrate the robustness and accuracy of the proposed control strategy in achieving smooth transitions between complex setpoints while strictly adhering to input and state constraints. Notably, the controller successfully stabilizes the system from an initially inverted configuration and tracks piecewise constant references with minimal steady-state error, even during abrupt changes in cart position and pendulum orientation. These results validate the effectiveness of the CasADi-based NMPC formulation as a powerful tool for controlling highly nonlinear and underactuated systems.
DOI10.1109/isct66099.2025.11297277