simple_pendulum.controllers.open_loop

Open Loop Control

Submodules

simple_pendulum.controllers.open_loop.open_loop

Open Loop Controller

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

Bases: AbstractController

get_control_output(meas_pos, meas_vel, meas_tau=0, meas_time=0, verbose=False)

The function to read and send the entries of the loaded trajectory as control input to the simulator/real pendulum. Switches to lqr control when in its region of attraction.

Parameters:
meas_posfloat

the position of the pendulum [rad]

meas_velfloat

the velocity of the pendulum [rad/s]

meas_taufloat, deault=0

the meastured torque of the pendulum [Nm]

meas_timefloat, deault=0

the collapsed time [s]

verbosebool, default=False

whether to print when the controller switches between preloaded trajectory and lqr

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_goal(x)

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

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

The desired goal state of the controller

class simple_pendulum.controllers.open_loop.open_loop.OpenLoopController(data_dict)

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_goal(x)

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

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

The desired goal state of the controller