|
| 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) |
| |
template<int STATES, int INPUTS>
class LinearPlantInversionFeedforward< STATES, INPUTS >
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
template<int STATES, int INPUTS>
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.
- Parameters
-
| r | The current reference state. |
| next_r | The next reference state. |
| dt | The timestep for this run. |