Contains the controller coefficients and logic for an implicit model follower. More...
#include <frc/controller/ImplicitModelFollower.h>
Public Types | |
using | StateVector = Vectord<States> |
using | InputVector = Vectord<Inputs> |
Public Member Functions | |
template<int Outputs> | |
ImplicitModelFollower (const LinearSystem< States, Inputs, Outputs > &plant, const LinearSystem< States, Inputs, Outputs > &plantRef) | |
Constructs a controller with the given coefficients and plant. | |
ImplicitModelFollower (const Matrixd< States, States > &A, const Matrixd< States, Inputs > &B, const Matrixd< States, States > &Aref, const Matrixd< States, Inputs > &Bref) | |
Constructs a controller with the given coefficients and plant. | |
const InputVector & | U () const |
Returns the control input vector u. | |
double | U (int i) const |
Returns an element of the control input vector u. | |
void | Reset () |
Resets the controller. | |
InputVector | Calculate (const StateVector &x, const InputVector &u) |
Returns the next output of the controller. | |
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.
States | Number of states. |
Inputs | Number of inputs. |
using frc::ImplicitModelFollower< States, Inputs >::InputVector = Vectord<Inputs> |
using frc::ImplicitModelFollower< States, Inputs >::StateVector = Vectord<States> |
|
inline |
Constructs a controller with the given coefficients and plant.
plant | The plant being controlled. |
plantRef | The plant whose dynamics should be followed. |
|
inline |
Constructs a controller with the given coefficients and plant.
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. |
|
inline |
Returns the next output of the controller.
x | The current state x. |
u | The current input for the original model. |
|
inline |
Resets the controller.
|
inline |
Returns the control input vector u.
|
inline |
Returns an element of the control input vector u.
i | Row of u. |