MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC

github.com/TinyMPC/TinyMPC @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
10,100 symbols 18,170 edges 382 files 687 documented · 7% updated 32d ago★ 1,05612 open issues

Browse by type

Functions 7,313 Types & classes 2,787
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

TinyMPC: Model-Predictive Control on Resource-Constrained Microcontrollers

If you have any questions related to the solver, visit the GitHub Discussions page. This guarantees accessibility for everyone.

The documentation is available at tinympc.org

High-level language interfaces with detailed examples and code generation are available in Python, Julia, and MATLAB.

Excited to hear your TinyMPC success stories, share them with us!

Building

For Windows - Enable wsl before following prompts below

  1. On terminal, clone this repo
git clone https://github.com/TinyMPC/TinyMPC.git
  1. Navigate to root directory and run
cd TinyMPC && mkdir build && cd build
  1. Run CMake configure step
cmake ..
  1. Build TinyMPC
cmake --build .

Examples

  • Run the quadrotor_hovering example
./examples/quadrotor_hovering
  • Run the codegen_cartpole example then follow the same building steps inside that directory
./examples/codegen_cartpole

Citing TinyMPC

If you are using TinyMPC, we encourage you to

  • Put a star ⭐ on this repository.

  • Cite the related papers:

@inproceedings{tinympc,
      title={TinyMPC: Model-Predictive Control on Resource-Constrained Microcontrollers}, 
      author={Khai Nguyen and Sam Schoedel and Anoushka Alavilli and Brian Plancher and Zachary Manchester},
      booktitle={IEEE International Conference on Robotics and Automation (ICRA)},
      year={2024},
}
@inproceedings{tinympc-adaptive,
      title={Robust and Efficient Embedded Convex Optimization through First-Order Adaptive Caching}, 
      author={Ishaan Mahajan and Brian Plancher},
      booktitle={IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
      year={2025},
}
@inproceedings{conic-tinympc,
      title={Code Generation and Conic Constraints for Model-Predictive Control on Microcontrollers with Conic-TinyMPC}, 
      author={Ishaan Mahajan and Khai Nguyen and Sam Schoedel and Elakhya Nedumaran and Moises Mata and Brian Plancher and Zachary Manchester},
      booktitle={IEEE International Conference on Robotics and Automation (ICRA)},
      year={2026},
}

Bug reports and support

Please report any issues via the Github issue tracker. All types of issues are welcome including bug reports, documentation typos, feature requests and so on.

Running on MCUs

Numerical benchmarks against other solvers on MCUs are available here.

TinyMPC on the Crazyflie

TinyMPC-integrated firmware on the Crazyflie nano-quadrotor is available here.

TinyMPC-AL

An earlier version (not optimized) which can deal with nonlinear dynamics (e.g., bicycle models) is available here.

Notes

Core symbols most depended-on inside this repo

Shape

Function 3,908
Method 3,405
Class 2,750
Enum 37

Languages

C++100%

Modules by API surface

include/Eigen/Eigen/src/Core/arch/NEON/PacketMath.h772 symbols
include/Eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h326 symbols
include/Eigen/Eigen/src/Core/arch/NEON/TypeCasting.h323 symbols
include/Eigen/Eigen/src/Core/arch/AVX/PacketMath.h293 symbols
include/Eigen/Eigen/src/Core/arch/SSE/PacketMath.h235 symbols
include/Eigen/Eigen/src/Core/arch/AVX512/PacketMath.h228 symbols
include/Eigen/Eigen/src/Core/functors/UnaryFunctors.h222 symbols
include/Eigen/Eigen/src/Core/MathFunctions.h216 symbols
include/Eigen/Eigen/src/Core/GenericPacketMath.h188 symbols
include/Eigen/Eigen/src/Core/util/ForwardDeclarations.h187 symbols
include/Eigen/Eigen/src/Core/arch/GPU/PacketMath.h169 symbols
include/Eigen/Eigen/src/Core/CoreEvaluators.h150 symbols

For agents

$ claude mcp add TinyMPC \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page