• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 1 year ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Proportional-Integral-Derivative controller simulation to balance a ball on cart

PID Controller Simualation

A Proportional-Integral-Derivative controller to self balance a ball on a rolling cart. Use arrow keys to control the cart, and disturb the ball.

Try on Web

https://sparshg.github.io/pid-balancer/

Downloads for Desktop

Windows, Mac: https://github.com/sparshg/pid-balancer/releases

(Should work on Linux too, didn't compile)

Implementation Details

Physics for the simulation is implemented according to this paper (excluding the counter-balances and connecting rod)

I used Runge-Kutta method (4th order) to solve the system. System's energy will remain almost constant when controller is off and there is no drag.

Camera dynamics are implemented with the help of this video

Screenshot 2023-04-29 at 7 16 31 PM 2