Feedback-Controlled Inverted Pendulum Car

ENGS 26: Control Theory -f@ Dartmouth College
System Modeling - PID Control - MATLAB - Hardware Validation
Feedback-controlled inverted pendulum car setup
Overview System Modeling Implementation Results Deliverables
Project Overview
System Modeling

The system was modeled as a feedback loop consisting of a compensator, motor, drivetrain, cart-pendulum dynamics, and angular position sensor. Equations of motion for the cart-pendulum system were derived from Newtonian mechanics and linearized about the upright equilibrium.

These equations were transformed into the Laplace domain to obtain the plant transfer function relating motor voltage input to pendulum angle output.

Closed-loop block diagram for the pendulum car system
Open-loop block diagram for the pendulum car system

Experimental Measurements

Measurements were taken to estimate the transfer function for each block, except the compensator which we must design. This includes the following (see report for more details):

Control Design & Specifications

A PID controller was selected due to its ability to balance responsiveness, stability, and steady-state accuracy.

Controller Implementation
Theoretical root locus for compensator
Theoretical compensator root locus and transfer function.
Experimental root locus for compensator
Experimental compensator root locus and transfer function.
Experimental root locus for compensator
Theoretical root locus for compensator

An ideal compensator was first designed in MATLAB using SISOTOOL and validated through root locus, Bode, and Nyquist analyses. The transfer function was derived from the graph, and component values were solved for and translated into a physical analog circuit using resistors and capacitors.

Challenge: the first compensator (we called "theoretical") derived had a slow performnace, response rate, and had a large gain that saturated the power amp of the motor--there were clearly factors like friction and other dynamics we did not model for. Resistor and capacitor values were adjusted one by one to address each issue. More detailed problems and tuning can be found in the report below.

Results & Performance

The final controller successfully stabilized the inverted pendulum in hardware. The system demonstrated fast response, minimal overshoot, and robust recovery from disturbances.

Frequency-domain analysis confirmed adequate phase margin and closed-loop bandwidth, while time-domain testing validated real-world performance.

Deliverables
Report thumbnail
Final Report (PDF)