ImplicitModelFollower_2_1
- class wpimath.controller.ImplicitModelFollower_2_1(*args, **kwargs)
Bases:
pybind11_object
Contains the controller coefficients and logic for an implicit model follower.
Implicit model following lets us design a feedback controller that erases the dynamics of our system and makes it behave like some other system. This can be used to make a drivetrain more controllable during teleop driving by making it behave like a slower or more benign drivetrain.
For more on the underlying math, read appendix B.3 in https://file.tavsys.net/control/controls-engineering-in-frc.pdf.
@tparam States Number of states. @tparam Inputs Number of inputs.
Overloaded function.
__init__(self: wpimath._controls._controls.controller.ImplicitModelFollower_2_1, A: numpy.ndarray[numpy.float64[2, 2]], B: numpy.ndarray[numpy.float64[2, 1]], Aref: numpy.ndarray[numpy.float64[2, 2]], Bref: numpy.ndarray[numpy.float64[2, 1]]) -> None
Constructs a controller with the given coefficients and plant.
- Parameters:
A – Continuous system matrix of the plant being controlled.
B – Continuous input matrix of the plant being controlled.
Aref – Continuous system matrix whose dynamics should be followed.
Bref – Continuous input matrix whose dynamics should be followed.
__init__(self: wpimath._controls._controls.controller.ImplicitModelFollower_2_1, plant: wpimath._controls._controls.system.LinearSystem_2_1_1, plantRef: wpimath._controls._controls.system.LinearSystem_2_1_1) -> None
__init__(self: wpimath._controls._controls.controller.ImplicitModelFollower_2_1, plant: wpimath._controls._controls.system.LinearSystem_2_1_2, plantRef: wpimath._controls._controls.system.LinearSystem_2_1_2) -> None
__init__(self: wpimath._controls._controls.controller.ImplicitModelFollower_2_1, plant: wpimath._controls._controls.system.LinearSystem_2_1_3, plantRef: wpimath._controls._controls.system.LinearSystem_2_1_3) -> None
- U(*args, **kwargs)
Overloaded function.
U(self: wpimath._controls._controls.controller.ImplicitModelFollower_2_1) -> numpy.ndarray[numpy.float64[1, 1]]
Returns the control input vector u.
- Returns:
The control input.
U(self: wpimath._controls._controls.controller.ImplicitModelFollower_2_1, i: int) -> float
Returns an element of the control input vector u.
- Parameters:
i – Row of u.
- Returns:
The row of the control input vector.
- calculate(x: numpy.ndarray[numpy.float64[2, 1]], u: numpy.ndarray[numpy.float64[1, 1]]) numpy.ndarray[numpy.float64[1, 1]]
Returns the next output of the controller.
- Parameters:
x – The current state x.
u – The current input for the original model.
- reset() None
Resets the controller.