Inverted Pendulum

The inverted pendulum is a classic control problem: balance a rigid rod upright on a moving cart by applying horizontal force. It is inherently unstable — without active feedback, the pendulum falls immediately. This project was the final assignment for my basic control theory course, where I designed and simulated a stabilizing controller using techniques learned throughout the semester.

Control system block diagram — the controller D(s) drives the cart force F to regulate both cart position x and pendulum angle θ

Controller Design

The system has two coupled transfer functions: one from force to cart position Gx(s), and one from force to pendulum angle Gθ(s). The controller was designed using methods covered in the course:

  • Bode plots — for frequency-domain shaping of gain and phase margins
  • Nyquist plots — for stability analysis of the closed-loop system
  • Root locus — for tuning pole placement and transient response

Simulation

I built a simulation model in MATLAB Simulink to verify the controller’s performance and produce a 3D visualization of the pendulum balancing. The simulation confirmed stable regulation of both cart position and pendulum angle under disturbances.

Demo