RIT VEXU Core API
|
#include <feedforward.h>
Classes | |
struct | ff_config_t |
Public Member Functions | |
FeedForward (ff_config_t &cfg) | |
double | calculate (double v, double a, double pid_ref=0.0) |
Perform the feedforward calculation. | |
Stores the feedfoward constants, and allows for quick computation. Feedfoward should be used in systems that require smooth precise movements and have high inertia, such as drivetrains and lifts.
This is best used alongside a PID loop, with the form: output = pid.get() + feedforward.calculate(v, a);
In this case, the feedforward does the majority of the heavy lifting, and the pid loop only corrects for inconsistencies
For information about tuning feedforward, I reccommend looking at this post: https://www.chiefdelphi.com/t/paper-frc-drivetrain-characterization/160915 (yes I know it's for FRC but trust me, it's useful)
|
inline |
Creates a FeedForward object.
cfg | Configuration Struct for tuning |
|
inline |
Perform the feedforward calculation.
This calculation is the equation: F = kG + kS*sgn(v) + kV*v + kA*a
v | Requested velocity of system |
a | Requested acceleration of system |