simple_pendulum.controllers.tvlqr

Time-varying Linear Quadratic Regulator (TVLQR)

Subpackages

Submodules

simple_pendulum.controllers.tvlqr.tvlqr

tvLQR Controller

class simple_pendulum.controllers.tvlqr.tvlqr.TVLQRController(data_dict, mass=1.0, length=0.5, damping=0.1, gravity=9.81, torque_limit=inf)

Bases: AbstractController

Controller acts on a predefined trajectory.

get_control_output(meas_pos=None, meas_vel=None, meas_tau=None, meas_time=None)

The function to read and send the entries of the loaded trajectory as control input to the simulator/real pendulum.

Parameters:
meas_posfloat, deault=None

the position of the pendulum [rad]

meas_velfloat, deault=None

the velocity of the pendulum [rad/s]

meas_taufloat, deault=None

the meastured torque of the pendulum [Nm]

meas_timefloat, deault=None

the collapsed time [s]

Returns:
des_posfloat

the desired position of the pendulum [rad]

des_velfloat

the desired velocity of the pendulum [rad/s]

des_taufloat

the torque supposed to be applied by the actuator [Nm]

init(x0)

Initialize the controller. May not be necessary.

Parameters:
``x0``: ``array like``

The start state of the pendulum

set_Qf(Qf)

This function is useful only for RoA purposes. Used to set the final S-matrix of the tvlqr controller.

Parameters:
Qfmatrix

the S-matrix from time-invariant RoA estimation around the up-right position.

set_goal(x)

Set the desired state for the controller. May not be necessary.

Parameters:
``x``: ``array like``

The desired goal state of the controller