Controller Implementation on a Rotary Inverted Pendulum
CLASSIFIED:
- ±4°
- Steady-state error (20° setpoint, LQR)
- 6 s
- Settling time (20° setpoint, LQR)
- ±45°
- Gain-scheduled sweep range
DOCUMENTS ON FILE · 01
SHORT REPORTPDF · 12 PP · 1.3 MB
Implementation of Linear Controllers on a Rotary Inverted Pendulum
Recommended if you want to skim, e.g. recruiters.
Brief
The rotary inverted pendulum is a classic underactuated-control benchmark: a single motor voltage (SIMO input) must simultaneously drive the rotary arm to a setpoint and keep the pendulum balanced upright. This project derived the system’s linearized model and implemented three controllers on a real Quanser setup, moving from simulation to hardware for each.
Problem
The system is inherently unstable: linearizing about the upright equilibrium gives eigenvalues with one at zero and one on the positive real axis. As the setpoint angle grows, the pendulum’s deviation exceeds the range where the first-order Taylor linearization holds, so a single fixed controller either can’t be pushed to larger sweeps or overshoots badly trying.
Approach
- Derived the system’s equations of motion and linearized state-space model, validated against standard references.
- Designed a pole-placement controller: dominant conjugate poles chosen for an underdamped, fast-rising response, with the remaining (non-dominant) poles placed further into the left half-plane by a standard rule of thumb.
- Designed an LQR controller on the same linearized model, selecting Q and R weighting matrices to penalize state error and control effort.
- Extended to gain-scheduled LQR: a weaker controller taken over at higher pendulum-angle rates of change, so the setpoint can sweep across a much wider range than the linearization alone would support.
- Ran all three on the physical Quanser rotary pendulum, interfaced through Quanser’s QUARC real-time hardware-in-the-loop toolchain.
Results
LQR outperformed pole placement in both settling time and overshoot in simulation. On hardware, LQR achieved a steady-state error of ±4° with a 6-second settling time for a 20° setpoint. For larger excursions both pole placement and plain LQR fail to track; gain-scheduled LQR remained stable across a ±45° sweep, trading some setpoint-tracking accuracy for that stability margin.
Status / Next
Ongoing. Current work is a swing-up controller to automate the transition from the pendant (hanging) position to upright, removing the need to start each hardware run with the pendulum manually raised, and further reducing overshoot in the gain-scheduled controller.