⟿ INVERTED PENDULUM ON A CART // PID FEEDBACK STABILIZATION

Pendulum PID Control

AUTOMATIC BALANCING · INDEPENDENT PID TUNING · FREQUENCY RESPONSE BODE DIAGRAM
DESIRED CLOSED-LOOP
SYSTEM PARAMETERS
TARGETS & DISTURBANCE
PHYSICAL SYSTEM (AUTOMATIC SINE WAVE TRACKING)
TIME RESPONSE HISTORY θ* (cmd) [°] θ (act) [°]
CONTROL FORCE HISTORY (u) u [N]
CLOSED-LOOP BODE DIAGRAM (θ* ➔ θ) Magnitude [dB] Phase [°]
SYSTEM STATE DIAGNOSTICS
PENDULUM ANGLE θ
θ̇ = — °/s
CART POSITION x
ẋ = — m/s
CONTROL FORCE u
|u| ≤ 200 N
STABILITY STATUS
mode: CLOSED LOOP
TRACKED MAGNITUDE
phase shift: —
Inverted Pendulum PID Control Dynamics
The translational force u(t) is applied to the cart. Under feedback control, a PID controller is connected to the pendulum angle: u(t) = − ( Kp·e(t) + Ki·∫e(t)dt + Kd·de(t)/dt ), where the angle error is e(t) = θ* − θ(t).
For the pendulum to remain stable upright, the controller must push the cart in the direction of the fall. This translates to positive gains Kp, Ki, Kd > 0 in this feedback structure.
Note that Kp must be greater than the gravity effect (M+m)·g (approx. 11.8 N/rad for default masses) to overcome the falling torque. Because the cart's position is uncontrolled in this single-loop angle PID structure, the cart may drift left or right while maintaining the pendulum upright!