Rotary Inverted Pendulum

The Inverted Pendulum in a Nutshell:

The Human Analogy

This is a prologue for the frequently asked question "What is it good for?"

The inverted pendulum is a classical control problem, induced by the laws of gravity. By nature, the inverted pendulum is a marginally unstable system. This is intuitively evident if you've ever tried to balance a broom stick on your hand. You immediately notice that you must "compensate" by moving your hand, to keep the stick balanced atop your hand. In fact, just standing up makes you an inverted pendulum. You may take for granted all of the second nature things you do to compensate, but the fact is, everyone is processing information about there own inversion. If you don't believe me, you can do a simple experiment to prove it to yourself.

The Experiment:

It's simple, sit in a chair that spins. With your eyes open, spin around 50 times relatively quickly. Now try to close your eyes and stand up straight. Not gonna happen, essentially you are overloading your processor, to the point where it can not perform the simple tasks (sending correct signals to the muscles in the feet) to stand up still.

The Human System: (Balancing the Broom Stick)

The way a human being performs this task is by using sensors; particularly the eyes for the "sense" of sight, and the hand for the "sense" of touch. Generally speaking, you don't need the three other sensors: nose, ears, and mouth to balance the broom stick. Nothing about the taste, smell or the sound will help you "compensate" more effectively. We also use a dynamic processor, called the brain and various actuators such as our extremities (arms, legs, feet, etc.)

The interaction of all the Sensors, Controllers, and Actuators allows human beings perform dynamic tasks like standing, walking, talking, balancing brooms sticks, and at the highest level designing inverted pendulums ;-) Granted some of us have more refined processors than others. I would argue that natural athletes have more refined actuators, and innately skilled artists have more refined sensors.

The Process:

The stream of information from the eyes and hand muscles, is sent to the brain, where it processes the information. From that processing, one makes perceived judgments about which way and how fast the pendulum is falling. Then, if the objective of the brain is to balance the stick, it sends a signal to the arm telling the muscles which way to move.

The Conclusion:

The understanding of the inverted pendulum is not only useful to geeks who want to make computers control systems but for medical doctors, scientist and researchers in the field of amputees and prosthetics. Understanding what the patient is dealing with, when the brain is damaged, or the actuators are missing or the sensors stop working. In the broader scope of the question "What is it good for?" I would proceed to answer, EVERYTHING!!!

The Project Description (Coming really soon)

The rest of this page is devoted to the "cool stuff" like how to fabricate the model and use the laws of electricity and magnetism (with all of it's abstractions e.g. Digital Logic, Software) to over come the laws of gravity.

The Process:

The stream of information from the sensors (digital encoders), is sent to the micro-controller, where it processes the information. From that processing it determines the displacement and the velocity of the falling pendulum. Then, if the micro-controller is programmed to do so, it can make logical decisions about which direction and how much force is needed to compensate for balancing. The controller then sends a signal to the actuator (motor) to control the system.

Video:

Check out the Video (Click on the 'Watch in High Quality' link just under the video on the right)

Pictures:

Check out some of the Pictures from the build. This page shows actual work from some of the longest, most intense days leading up to the project showcase. From mechanical design, machining, fabrication, circuit design, analysis, debugging, programming. WE DID IT ALL!

Source Code:

The following source code is written in C with the Codevision AVR compiler. Codevision is a specialized, efficient compiler for the AVR family of micro-controllers from Atmel. The code is well documented, if you cant read it, then you cant read C.

The architecture is comprised of 2 micro-controllers. The slave, which handel's all of the interrupts from the motor and pendulum positions. The master acts as a communication buffer which processes all of the communication between the Pendulum MCU and the Laptop MCU via the serial port.