LQRController
A Linear Quadratic Regulator (LQR) for controlling a system modeled by state-space equations.
LQR is a form of optimal control that finds the best control input to apply to a system by minimizing a quadratic cost function. The cost function balances two competing goals:
State Error: How far the system is from its desired target state (penalized by the
Qmatrix).Control Effort: How much energy or effort is used to control the system (penalized by the
Rmatrix).
The controller computes the optimal control input u using a simple state-feedback law: u = -Kx, where x is the system's state error and K is the optimal gain matrix.
Thank you to Tyler Veness and WPILib!
Parameters
The state matrix.
The input matrix.
The state cost matrix.
The control cost matrix.
The time step for the discrete-time model (your loop time)
See also
Constructors
Constructs a controller with the given coefficient matrices.
Constructs a controller with the given plant model and cost matrices.