Games Inverted Pendulum on Cart and PIDController Class

Gunther

Active Member
Licensed User
Longtime User
Hi,

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)

B4X:
' 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.

upload_2018-11-30_10-25-9.png
 

Attachments

  • PIDController.zip
    62.6 KB · Views: 456
Last edited:
Top