Games Inverted Pendulum on Cart and PIDController Class


Active Member
Licensed User
Longtime User

after so many questions here I want to contribute something which is not the main path of interest but was a side issue.

This litte App is showing the Inverted Pendulum on a cart which is actuated by motors on the wheels. The pendulum is freely jointed.

The controlling process behind is done by a PID Controller Class. One instance is controlling the Angle of the Pendulum, the other the position of the cart.

With the settings in the Initialization Procedure you may have influences to the dampening of the disturbances or it swings up ;o)

' Settings of Angel Controller
angleController.setGains( 1800, 5, 50 )
' Settings of Position Controller
positionController.setGains( .55, 0.05, .25)

You may put disturbance on the pendulum by left and right keys. You may drag and drop also the items in this world by the mouse.



    62.6 KB · Views: 314
Last edited: