At the moment I am home for Easter so I cant work on the physical parts of the project. Nevertheless, I used a little spare time to think about the control system for the inverted pendulum. I started off by constructing the equations of motion for the pendulum using Mathematica and transfering them to XCos my first atempt while somewhat asthetically pleasing took far to long to implement:
Then I refreshed my controll theorey memories with this awesome tutorial: https://www.youtube.com/watch?v=M_jchYsTZvM and implemented linearization and poleplacement for the controll loop in the same Python script: https://cdn.hackaday.io/files/1647527048749568/inverted_pendulum_controll.py
With that in place I was able to run the first simulation of the inverted pendulum in the upright position:
In the beginning the pendulum recovers from beeing in a slightly of vertical angle. Afterwards it performs a controlled movement of the Wagon on which it is mounted forward and backwards.