pythongekkompc

Is it possible to use this gekko MPC method online on a real robot?


I want to do some trajectory tracking on a real robot, and I want to use MPC, so I found this gekko. I can make to simulations of my robot and stuff, but is it possible to use it real-time, as I see it take some time to calculate the optimal solution, and I am not quite sure coding wise how to do it, if you just take the first imput and give it to the real system and then update the state values with the sensor reading, and then use the m.solve() function again, and so on.

Thanks in advance


Solution

  • Yes, Gekko is certainly possible to do real-time control but you'll need to pay attention to a few things:

    There is a lot of real-time MPC code and an application with the Temperature Control Lab (TCLab) on the course for Machine Learning and Dynamic Optimization. Below is MPC in action.

    TCLab MPC

    Here is the device:

    TCLab