Inverted Pendulum

Inverted Pendulum

Technical Specifications

Hardware: Geared rotary motor, Incremental encoders, Weighted pendulum arm
Software: MATLAB, Simulink
Control System Elements: State selector, PID loop, Jacobian balance function

For this project, I developed a control system for an inverted pendulum that self-balances and can recover when disturbed. Using MATLAB and Simulink, I combined Lagrangian and Hamiltonian dynamics to model motion and calculate system parameters, and Jacobian transformations to track positions. A state selector and PID loops enable seamless transitions between swing-up and balancing, ensuring precise and adaptive control.

This project not only showcases the practical application of control theory but also serves as a foundation for more complex balancing systems in robotics, such as self-balancing rockets and stabilization mechanisms in drones.

Demo Video

Project Gallery

Inverted Pendulum Setup

Using matrix transformations and frame rotations, we are able to track the pendulum's tip relative to the base

Control System Interface

By applying Lagrangian dynamics (L = T - V), to the Euler-Lagrange equations of motion, we can simulate motion of the pendulum, and predict its response to specific inputs

Work Envelope Visualization

The work envelope represents all possible points the system can reach. This was plotted in MATLAB using Plot 3. Because the system has only 2 degrees-of-freedom, the work envelope is a surface area

Hamiltonian Approach Visualization

The Hamiltonian approach is used to calculate the physical parameters of the system by analyzing the input torque, mechanical power, and energy losses

State Selector Diagram

The state selector uses a MATLAB logic function combined with a Simulink multiport switch to transition the system between swing-up and balancing, based on its position

Overall Control System in Simulink

Here is the overall control system, modeled using Simulink. It combines the state selector, a PID loop for automatic swing-up, and the balancing functionality which uses an error function to drive the system parameters to 0