|
bitsim
Model, simulate, estimate and control robots in C++
|
A linear state feedback about an operating point, \(u = u_{ref} - K (x - x_{ref})\), with optional bounds on each input. More...
#include <lqr.h>
Public Member Functions | |
| LQRController (const Matrix &K) | |
| void | set_reference (const Vector &x_ref, const Vector &u_ref) |
| Set the operating point: the state to hold and the input that holds it. Both start at zero. | |
| void | set_input_bounds (const Vector &lower, const Vector &upper) |
| Clip each input to [lower, upper]. | |
| Vector | control (const Vector &x) const |
| const Matrix & | gain () const noexcept |
| const Vector & | state_reference () const noexcept |
| const Vector & | input_reference () const noexcept |
| uint_t | n_states () const noexcept |
| uint_t | n_inputs () const noexcept |
A linear state feedback about an operating point, \(u = u_{ref} - K (x - x_{ref})\), with optional bounds on each input.
The gain usually comes from lqr() or dlqr() for a model linearised about the operating point, such as a hover or a trim, and the reference is that point: \(x_{ref}\) the state and \(u_{ref}\) the input that holds it there. Changing \(x_{ref}\) to another state the same input holds, such as another position at hover, makes the controller go there.
With bounds, each input is clipped to them. The gain was designed without them, so a clipped input no longer minimises the cost; LinearMPC takes the bounds into account instead.
|
explicit |
| K | The gain, inputs x states |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| void bitsim::control::LQRController::set_input_bounds | ( | const Vector & | lower, |
| const Vector & | upper ) |
Clip each input to [lower, upper].
| std::invalid_argument | if the sizes do not match, or lower > upper |
Set the operating point: the state to hold and the input that holds it. Both start at zero.
| std::invalid_argument | if the sizes do not match the gain |
|
inlinenoexcept |