Sunday, September 01, 2019

Steps to Install Python Control library (For LQR control) On Raspberry Pi


I got a Raspberry Pi 3 and would like to program python on it with LQR for stabilized control. Here are the steps that I took to install the Python control package and its dependencies:
pip3 install control --upgrade
sudo apt-get install build-essential
sudo apt-get install ninja-build
sudo apt install gfortran
pip3 install slycot
To test the installed control package, run the following snippet:
>>> import control
>>> control.lqr([[1]], [[1]],[[1]],[[1]])
(array([[2.41421356]]), array([[2.41421356]]), array([-1.4142135+0.j], dtype=complex64))