MARATTO

article · IAES International Journal of Robotics and Automation (IJRA)

Design and implementation of NMPC for a two-DOF robotic arm using CasADi

Abstract

Achieving accurate joint-space tracking in multi-link robotic arms is complicated by strong configuration-dependent nonlinearities and mandatory actuator limits that classical controllers are structurally unable to enforce. This paper presents a nonlinear model predictive control (NMPC) scheme for a two-degree-of-freedom (2-DOF) serial robotic arm, implemented within the CasADi symbolic computing environment to leverage automatic differentiation and sparse interior-point solving. The complete set of Lagrangian equations of motion-inertia, Coriolis, and gravity terms-is incorporated directly into the optimizer's prediction model through fourth-order Runge-Kutta (RK4) integration, eliminating the need for linearization. Torque, velocity, and angle bounds are imposed as native hard inequality constraints at every step of the finite-horizon optimization. Systematic simulations pit the proposed NMPC against a Ziegler-Nichols-tuned decentralized PID at two distinct sampling periods. The NMPC achieved a 95% reduction in peak tracking error relative to PID (0.0058 rad vs. 0.1347 rad for Joint 1), with mean error decreases of 64.65% and 57.58% for Joints 1 and 2 respectively, at an average solver time of 0.053 s-comfortably within the 0.1 s control cycle. The findings demonstrate that online NMPC with unabridged nonlinear dynamics is computationally practical for real-time joint control on standard computing hardware.

Research topics

  • Advanced Control Systems Optimization
  • Robotic Mechanisms and Dynamics
  • Iterative Learning Control Systems

Sustainable Development Goals

Read the original research

This page summarises published work. The authoritative version sits with the publisher.

DOI: 10.11591/ijra.v15i2.pp307-318

Is something wrong with this record? Report it or request removal.

Discussion

Discuss this research

Have you built on this work, tried to replicate it, or seen it applied in practice? Share what you know. Verified researchers and MARATTO™ domain experts can open a discussion, and any member can reply. Contributions are reviewed before they appear.

No discussion yet. Open the first thread.