Downloads
The files we used in our project may be downloaded by clicking the following link.
Run 'gui.m' to open the GUI used to control the parameters of our Simulink inverted pendulum model. The Simulink model is named 'Pend_Model.mdl' and should automatically open when 'gui.m' is run. The script used to generate the simulation length as a function of controller sampling period is in the file named 'stability.m'. The parameters of the model can be changed at the top of the script. This file can be run separately from 'gui.m' if desired.
Each time the simulation is run in 'gui.m', the resulting data used to plot the cart position and pendulum angle is saved to 'data.csv'. This is the file which our VPython simulation, called 'inverted_pendulum.py', reads to generate the simulation video. If you would like to run the VPython simulation on your own computer after running the simulation in 'gui.m', we recommend downloading and installing the version of Python found at the following link.
Choose your operating system under "Download" on the left side of the screen, and follow the instructions to install two components. After correctly installing VPython, you should be able to double click on 'inverted_pendulum.py' to automatically open a window with the simulation video. Make sure that 'inverted_pendulum.py' and 'data.csv' are in the same folder.