The author, coming from a background in computer vision, embarked on a project to enhance their understanding of trajectory optimization and Model Predictive Control by creating a simulation demonstration. The article details the formulation of the cart-pole system problem, including equations of motion and control actions. The author implements an optimization problem using Model Predictive Control to stabilize the pendulum in a vertical position. They discuss the differences between single and multiple shooting techniques and the real-time implementation of a non-linear optimizer to solve the optimization problem. Surprisingly, the author successfully deploys the simulation to the browser using WebAssembly, achieving real-time performance with minimal optimizations. The web application allows for interactive exploration and testing of the system.
https://garethx.com/posts/cart-pole-mpc/