gravitational acceleration
pendulum length
pendulum mass
slider mass
P θ
D θ
P x
D x
this is a simulation of an inverted pendulum with a PD controller to bring the pendulum angle θ and silder displacement x to zero. it uses RK4 numerical integration and the controller function at the top of the JS code can be easily modified to test new controllers. you can also drag the pendulum around by tapping or clicking.
made by oscar saharoy