![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
The voltage a motor needs to hold a velocity and acceleration, from characterization: staticFriction * sign(velocity) + velocity gain * velocity + acceleration gain * acceleration. More...
#include <MotorFeedforward.hpp>
Classes | |
| struct | Gains |
Public Types | |
| using | AngularAcceleration = decltype(AngularVelocity{} / Duration{}) |
| using | VelocityGain = decltype(Voltage{} / AngularVelocity{}) |
| using | AccelerationGain = decltype(Voltage{} / AngularAcceleration{}) |
Public Member Functions | |
| MotorFeedforward (Gains gains) | |
| Voltage | compute (AngularVelocity velocity, AngularAcceleration acceleration=AngularAcceleration{}) const |
The voltage a motor needs to hold a velocity and acceleration, from characterization: staticFriction * sign(velocity) + velocity gain * velocity + acceleration gain * acceleration.
Velocities are of whatever the gains were measured on (a flywheel, a drive wheel). A drive side converts its linear velocity to wheel angular velocity by dividing by the wheel radius.
| using rz::MotorFeedforward::AccelerationGain = decltype(Voltage{} / AngularAcceleration{}) |
| using rz::MotorFeedforward::AngularAcceleration = decltype(AngularVelocity{} / Duration{}) |
| using rz::MotorFeedforward::VelocityGain = decltype(Voltage{} / AngularVelocity{}) |
|
inlineexplicit |
|
nodiscard |