RIT VEXU Core API
|
#include <linear_plant_inversion_feedforward.h>
Public Member Functions | |
template<int OUTPUTS> | |
LinearPlantInversionFeedforward (LinearSystem< STATES, INPUTS, OUTPUTS > &plant, const double &dt) | |
LinearPlantInversionFeedforward (const EMat< STATES, STATES > &A, const EMat< STATES, INPUTS > &B, const double &dt) | |
EVec< INPUTS > | calculate (const EVec< STATES > &r, const EVec< STATES > &next_r) |
EVec< INPUTS > | calculate (const EVec< STATES > &next_r) |
EVec< INPUTS > | calculate (const EVec< STATES > &r, const EVec< STATES > &next_r, const double &dt) |
EVec< INPUTS > | calculate (const EVec< STATES > &next_r, const double &dt) |
void | reset (const EVec< STATES > &initial_state) |
void | reset () |
void | set_r (const EVec< STATES > &r) |
This class computes a feedforward control input by inverting the discrete plant dynamics. A continuous linear system is provided, it is then discretized on some timestep, then the feedforward control input is computed to satisfy:
B_d * u_ff = next_state - A_d * current_state
|
inline |
Constructs a feedforward given a plant and the nominal timestep.
OUTPUTS | The number of outputs of the plant. |
plant | The linear system. |
dt | The nominal timestep in seconds. |
|
inline |
Construts a feedforward given the state and input matrices from a plant.
A | The state matrix of the linear system. |
B | The input matrix of the linear system. |
dt | The nominal timestep in seconds. |
|
inline |
Computes the feedforward control input given only the next reference state. This assumes that the previous reference is already set.
next_r | The next reference state. |
|
inline |
Computes the feedforward control input given only the next reference state. This assumes that the previous reference is already set.
This is slower because it discretizes A and B on each run, requiring computing a matrix exponential. Don't use this unless you have to.
next_r | The next reference state. |
dt | The timestep for this run. |
|
inline |
Computes the feedforward control input given the current reference state and the next reference state. This also sets the current reference state to the next reference state for you.
r | The current reference state. |
next_r | The next reference state. |
|
inline |
Computes the feedforward control input given the current reference state and the next reference state. This also sets the current reference state to the next reference state for you. Use this function if your timestep is not the same between each run.
This is slower because it discretizes A and B on each run, requiring computing a matrix exponential. Don't use this unless you have to.
r | The current reference state. |
next_r | The next reference state. |
dt | The timestep for this run. |
|
inline |
Resets the reference to all zeros, and the feedforward to zero.
|
inline |
Resets the reference to the given state, and the feedforward to zero.
initial_state | The state to set the current reference to. |
|
inline |
Sets the current reference to a given state.
r | The state to set the current reference to. |