1#ifndef BITSIM_CONTROL_LQR_H
2#define BITSIM_CONTROL_LQR_H
140 bool bounded_{
false};
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
const Matrix & gain() const noexcept
Definition lqr.h:130
Vector control(const Vector &x) const
Definition lqr.cpp:200
const Vector & state_reference() const noexcept
Definition lqr.h:131
LQRController(const Matrix &K)
Definition lqr.cpp:167
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.
Definition lqr.cpp:176
const Vector & input_reference() const noexcept
Definition lqr.h:132
uint_t n_states() const noexcept
Definition lqr.h:133
void set_input_bounds(const Vector &lower, const Vector &upper)
Clip each input to [lower, upper].
Definition lqr.cpp:187
uint_t n_inputs() const noexcept
Definition lqr.h:134
Controllers: PID controllers, line following, a quadrotor flight controller, a fixed wing autopilot,...
Definition control_module.h:18
DiscreteLinearModel discretise(const Matrix &A, const Matrix &B, real_t dt)
Discretise for a step dt, with the input held over the step (zero-order hold): and ,...
Definition lqr.cpp:41
Matrix solve_care(const Matrix &A, const Matrix &B, const Matrix &Q, const Matrix &R)
Solve the continuous algebraic Riccati equation.
Definition lqr.cpp:101
LQRSolution dlqr(const Matrix &A, const Matrix &B, const Matrix &Q, const Matrix &R)
The LQR of : with P from solve_dare().
Definition lqr.cpp:154
RealMat Matrix
The matrices of the linear models and the controllers.
Definition lqr.h:20
LQRSolution lqr(const Matrix &A, const Matrix &B, const Matrix &Q, const Matrix &R)
The LQR of : with P from solve_care().
Definition lqr.cpp:161
Matrix solve_dare(const Matrix &A, const Matrix &B, const Matrix &Q, const Matrix &R)
Solve the discrete algebraic Riccati equation.
Definition lqr.cpp:62
RealColVec Vector
The vectors of the linear models and the controllers: states, inputs.
Definition lqr.h:23
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
ColVec< real_t > RealColVec
Dynamically sized column vector.
Definition bitsim_types.h:122
double real_t
real_t
Definition bitsim_types.h:20
DynMat< real_t > RealMat
Dynamically sized matrix of type double.
Definition bitsim_types.h:56
A linear model in discrete time, .
Definition lqr.h:29
Matrix A
Definition lqr.h:30
Matrix B
Definition lqr.h:31
The gain of a linear quadratic regulator and the cost matrix it comes from: the input minimises the ...
Definition lqr.h:74
Matrix K
Definition lqr.h:75
Matrix P
Definition lqr.h:76