Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I am attempting to build a single axis inverted pendulum using a PID system to keep the rod balanced. I am interested in writing a program to simulate the rod tipping over and the effects of moving the base (pivot point) left or right to counter the tipping effect. I can't quite figure out the math to model a rod of uniform density that is standing on end falling over. I remember learning formulas for pendulums in physics class but it was for pendulums that swing less than 15 or so degrees (assuming that for values close to 0 sin(x)=x). Also, I'm not sure I know how to model a scenario where the base of the rod that is tipping over is pushed quickly back "under" the rod (beneath and actually slightly past the center of mass of the rod). Any and all help would be appreciated.

Collin

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Inverted Pendulum Simulation

**Physics Forums | Science Articles, Homework Help, Discussion**