LQ Optimal Control of Inverted Pendulum
Snapshot of the front panel of the simulator:
Description of the simulated system
pendulum_model.pdf gives a
mathematical desciption of the system - the cart with pendulum, and the
stabilizing control system.
Aims of this simulator is to see how LQ control quite easily can be
used to solve a difficult control problem, namely stabilizing an unstable
The LQ controller is a very powerful control law because it always
stabilizes a process, and because the tuning of the controller is quite
intuitive via the weights of the states and the control variables in the
Although the pendulum itself is not a particularly useful process, it
has many similarities to important processes:
- In upright position - it is then called an inverted pendulum - it is
similar to a rocket being launched.
- In downright position - it is then an ordinary pendulum - it is
similar to a crane with load.
Unless otherwise stated, set the parameters back to default values
after each of the tasks. (This can be done via Edit / Reintialize
values to default.)
- Select upright stabilization.
- Is the controller able to stabilize the pendulum after an angle
disturbance at any cart position reference (try a number of different
- Theoretical question: How can you change one of the elements of
the Q matrix to obtain more damped movement of the cart? Is this
verified in a simulation?
- Theoretical question: How can you change the (one) element of the
R matrix to obtain smoother control action?Is this verified in a
simulation? Is it also verified in the eigenvalues of the control
- What is the maximum angle disturbance that the control system can
- To check the robustness of the control system: Assume that the
real cart mass, Mreal, is different from the mass, Mmodel,
assumed in the design of the controller. Assume that Mmodel
= 1 kg. What is the minimum Mreal and what is the maximum Mreal
that the control system can handle (before it becomes unstable)? (Find
the answer using simulations.)
- Select downright stabilization.
- Set the controller in manual control mode. Apply a disturbance to
the pendulum angle. Try to stabilize the pendulum at zero cart
position. Easy or difficult?
- Set the controller in automatic control mode. Is the controller
able to stabilize the pendulum after an angle disturbance at any cart
position reference (try a number of different references)? Is the
automatic feedback control better than the manual control?
- Observe that the controller parameters in the downright operating
point and in the upright operating point are different. Why are they
Updated 8. February 2008.