The linear time-varying differential drive controller has a similar form to the LQR, but the model used to compute the controller gain is the nonlinear differential drive model linearized around the drivetrain's current state.
More...
|
| LTVDifferentialDriveController (const frc::LinearSystem< 2, 2, 2 > &plant, units::meter_t trackwidth, const wpi::array< double, 5 > &Qelems, const wpi::array< double, 2 > &Relems, units::second_t dt) |
| Constructs a linear time-varying differential drive controller.
|
|
| LTVDifferentialDriveController (LTVDifferentialDriveController &&)=default |
| Move constructor.
|
|
LTVDifferentialDriveController & | operator= (LTVDifferentialDriveController &&)=default |
| Move assignment operator.
|
|
bool | AtReference () const |
| Returns true if the pose error is within tolerance of the reference.
|
|
void | SetTolerance (const Pose2d &poseTolerance, units::meters_per_second_t leftVelocityTolerance, units::meters_per_second_t rightVelocityTolerance) |
| Sets the pose error which is considered tolerable for use with AtReference().
|
|
DifferentialDriveWheelVoltages | Calculate (const Pose2d ¤tPose, units::meters_per_second_t leftVelocity, units::meters_per_second_t rightVelocity, const Pose2d &poseRef, units::meters_per_second_t leftVelocityRef, units::meters_per_second_t rightVelocityRef) |
| Returns the left and right output voltages of the LTV controller.
|
|
DifferentialDriveWheelVoltages | Calculate (const Pose2d ¤tPose, units::meters_per_second_t leftVelocity, units::meters_per_second_t rightVelocity, const Trajectory::State &desiredState) |
| Returns the left and right output voltages of the LTV controller.
|
|
The linear time-varying differential drive controller has a similar form to the LQR, but the model used to compute the controller gain is the nonlinear differential drive model linearized around the drivetrain's current state.
We precompute gains for important places in our state-space, then interpolate between them with a lookup table to save computational resources.
This controller has a flat hierarchy with pose and wheel velocity references and voltage outputs. This is different from a unicycle controller's nested hierarchy where the top-level controller has a pose reference and chassis velocity command outputs, and the low-level controller has wheel velocity references and voltage outputs. Flat hierarchies are easier to tune in one shot.
See section 8.7 in Controls Engineering in FRC for a derivation of the control law we used shown in theorem 8.7.4.