Gravity Compensation Control
============================

.. note::

    Type: Closed loop control

    State/action space constraints: -

    Optimal: -

    Versatility: only compensates for gravitational force acting on the pendulum, no swing-up or stabilization at the upright position

Theory
------

A controller compensating the gravitational force acting on the pendulum. The control function is given by:

.. math::

    u(\theta) = mgl \sin(\theta)

where `u` is commanded torque, `m`  is a weight of `0,5 kg` attached to the rod together with the mass of the rod and the mounting parts, `l` is the length of `0,5 m` of the rod, `g` is  gravitational acceleration on earth of :math:`9.81 \, ms^{-2}`  and :math:`\theta` is the current position of the pendulum. 


While the controller is running it actively compensates for the gravitational force acting on the pendulum, therefore the pendulum can be moved as if it was in zero-g.