NB2 Demo
Inverted pendulum
The inverted pendulum is a classic problem from the textbooks of control theory.
A pendulum of mass
m,
length L,
and angle α from the vertical, hinged to a wheeled cart of mass
M,
must be balanced upright by jostling the cart from side to side with force
u.
This system is highly dynamic and nonlinear. Its equations of motion are:
where g
is the acceleration due to gravity. It is also very unstable.
One miscue and the pendulum will come crashing down.
The following plot shows the performance of an NB2 controller, plugged in for the
first time without any prior training or tuning, balancing the inverted pendulum
with precision and robustness
through a series of setpoint changes and load disturbances.
NB2 controlling the inverted pendulum
The pendulum angle α is plotted in red.
The controller output, in this case the force appplied to the side of the cart, is plotted in blue.
The load disturbances were as follows.
At 6 seconds: 1000% increase in mass
m.
At 12 seconds: revert to original
m;
250% increase in mass
M.
At 18 seconds: revert to original
M;
500% increase in length
L.
At 24 seconds: revert to original
L;
50% reduction in maximum applied force right;
25% reduction in maximum applied force left.