Portfolio >> Olin >> Inverted Pendulum on a Cart

- Inverted Pendulum on a Cart
Fall - 06

In ICB, our introductory math/physics course, we completed a series of case studies throughout the semester that taught us about simulation physical systems using basic Newtonian mechanics and approximation techniques such as the Runge-Kutta methods. These all culminated in a partner project in which we had to write a simulation to either control an unstable system or investigate a system with particularly interesting dynamics.

My partner and I chose to attempt to control an inverted pendulum on a cart to keep it upright. This problem is very similar to what the Segway does when it propels a rider. We had to calculate the fundamental governing equations that dictated how the system would change through time. After five or six attempts, we finally arrived at the page-wide equations that the system followed.

Using MATLAB, we coded a simulation using these equations so that we could then add in our own control forces. After validating our simulation using a few "common sense" tests, we added our control force to the cart to keep the rod balanced. We used a technique called PID, which takes into account how far the rod is from vertical, how long it has been that far from vertical, and how quickly its distance from vertical is changing. We ultimately arrived at a set of PID gains that let us balance the rod upright in simulation.

We then decided that we wanted to attempt to build a physical model of the system. Unfortunately, due to limited supplies, we were unable to get the physical model to function in "the real world". Our simulation predicted it would, but wheels slipping and slow motors and other physical limitations held us back. With more time and better materials, we would be able to balance the rod.

Below is a video of our simulation, demonstrating the cart balancing the rod, and a photograph of our attempted physical model.

Get the Flash Player to see this player.

Inverted Pendulum on a Cart

back...