iLQR Documentation - spacecraft-design-lab-2019/documentation GitHub Wiki

Explanation of the iLQR/MILQR Algorithm

Control Block Diagram

Red dashed lines represent C-code, everything else is in circuit-python

Design decisions / Lessons Learned

  • Code Language - Autocoded C Initially, the iLQR trajectory optimizer/ optimal controller was going to be implemented in C++ (like all the GNC algorithms). There is working C++ code for a simple iLQR implementation which was tested on a pendulum (iLQR C++ code). This was reasonably simple since the Eigen library supports matrix maths with MATLAB-style operator overloading. However, we discovered it was too difficult to run C++ code from circuit-python hence C++ was scrapped. The optimization is computationally intensive meaning running it purely in python is infeasible. Circuit-python is written in C which makes calling custom C-code easier than C++ code. Hence, it was decided to code the algorithms in C. However, dealing with matrices in C is complex so the code was automatically generated using the MATLAB auto-coder (Autocoding).