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.

Overloaded function.

  1. __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.

  1. __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

  2. __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

U(*args, **kwargs)

Overloaded function.

  1. 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.

  1. 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.