sw/
← projects
VNIT·2016

Anti-windup PID for a rotary inverted pendulum

B.Tech thesis: LQR, state-observer and two-loop PID controllers designed and tested on a Quanser rotary inverted pendulum. The two-loop PID, with anti-windup, held the pendulum steadiest. Presented at the IEEE RAS Summer School on Multi-Robot Systems, NUS.

Problem

The rotary inverted pendulum is the classic benchmark for control: a pendulum on the end of a motor-driven arm, naturally unstable and non-minimum phase, with two degrees of freedom and a single input voltage. The controller has to keep the pendulum upright while also bringing the arm back to its reference. Tuned PID loops give no guarantee of robustness on their own, while LQR is optimal but leans on a full model and every state.

What I did

This was my B.Tech thesis at VNIT, with Vishnu Kandukuri, Kishore Seshadri, Pavan Srikanth, Rohit Salem and Sudheer Kumar, under Dr A. S. Junghare. We modelled the Quanser SRV02 rotary pendulum with Lagrangian mechanics, linearised it into a state-space model, and checked it with root locus, Bode plots, controllability and observability.

We then built three controllers in MATLAB and Simulink and ran them on the real rig through QUARC:

  • LQR state feedback. Solving the Riccati equation with Q = diag(1, 100, 0, 0) and R = 10 gave the gains K = [−0.3162, 4.5266, −0.2427, 0.4090].
  • Full-order state observer. Observer poles at 100 times the dominant closed-loop poles (−157 and −2207.7), placed with Ackermann’s formula, so the controller can estimate the states it cannot measure.
  • Two-loop PID. One loop holds the pendulum angle α, the other tracks the arm angle θ. Gains come from pole placement, using LQR’s closed-loop poles as targets plus a fifth pole at −10, giving KP = 2.7265, KI = 3.1607 for the arm and KP = 8.5362, KI = 52.785, KD = 0.2023 for the pendulum.

With Rohit Salem I extended the two-loop PID with anti-windup. When the control voltage saturates, conditional integration switches the integrator off so it cannot wind up and kick the pendulum over.

Result

On the real pendulum, the two-loop PID was clearly the steadiest. The pendulum stayed within ±0.57°, against −1.4° to 0.85° for LQR, and the arm stayed within −1° to 1.5°, against ±5° for LQR and ±6° for the observer. It did this with the least control effort, ±1 V. The state observer was the most sluggish. We presented the work as a poster at the IEEE RAS Summer School on Multi-Robot Systems 2016 at the National University of Singapore.

esc