2D version of a rotary inverted pendulum with swing-up and balance controllers
This is a detailed non-linear model of an actual RIP system from the Department of Electronics at York. Most notably, it includes the effects of gearbox backlash. It uses a full state feedback controller for balancing and an energy-based controller for the swing-up stage. The user interface below allows you to change the coefficients of the control laws (gains), where α is the angular position of the pendulum and θm is the angular position of the motor's rotor which drives the arm (if not for gearbox backlash, it would be directly proportional to the linear position of the pendulum's pivot point). The system input is the voltage applied to the motor (Vm). You can also choose to include or exclude the effects of gearbox backlash in the simulation.
Balance controller: Vm = θm + θ'm - α - α'
Swing-up controller: Vm = α'cos(α)
Here is a short video of the real system performing the same task: