ImplicitModelFollower_1_1
- class wpimath.ImplicitModelFollower_1_1(*args, **kwargs)
Bases:
pybind11_objectContains 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._wpimath.ImplicitModelFollower_1_1, A: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”], B: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”], Aref: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 1]”], Bref: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[1, 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._wpimath.ImplicitModelFollower_1_1, plant: wpimath._wpimath.LinearSystem_1_1_1, plantRef: wpimath._wpimath.LinearSystem_1_1_1) -> None
__init__(self: wpimath._wpimath.ImplicitModelFollower_1_1, plant: wpimath._wpimath.LinearSystem_1_1_2, plantRef: wpimath._wpimath.LinearSystem_1_1_2) -> None
__init__(self: wpimath._wpimath.ImplicitModelFollower_1_1, plant: wpimath._wpimath.LinearSystem_1_1_3, plantRef: wpimath._wpimath.LinearSystem_1_1_3) -> None
- U(*args, **kwargs)
Overloaded function.
U(self: wpimath._wpimath.ImplicitModelFollower_1_1) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[1, 1]”]
Returns the control input vector u.
- Returns:
The control input.
U(self: wpimath._wpimath.ImplicitModelFollower_1_1, i: typing.SupportsInt | typing.SupportsIndex) -> 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: Annotated[numpy.typing.ArrayLike, numpy.float64, '[1, 1]'], u: Annotated[numpy.typing.ArrayLike, numpy.float64, '[1, 1]']) Annotated[numpy.typing.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.