This technical whitepaper presents an automatic workflow for implementing MPC controllers. The process uses MapleSim to generate a model of the system, whose dynamic equations are then extracted using Maple. From there, Maple is used to formulate the MPC problem, and generate the solver, which it then automatically converts into the C code of the MPC controller.
The advantage of using a symbolic tool such as Maple is that the required procedures and their corresponding derivatives are automatically computed and optimized whenever there is a change in any of the dynamic equations representing the system. Automating the workflow using Maple’s symbolic computation engine saves time, removes human error, and produces highly optimized controller code.