Class FFController

java.lang.Object
com.cdarobotics.cdalib.controllers.Controller
com.cdarobotics.cdalib.controllers.FFController

public class FFController extends Controller
A feedforward Controller. The output is computed purely from the current measurement as kS + kF * current + cos(kCos * current), combining a static term, a term proportional to the measurement, and a cosine term (e.g. to compensate for gravity on a rotating arm).
  • Constructor Details

    • FFController

      public FFController(double target, double kS, double kF, double kCos)
      Parameters:
      target - the initial setpoint
      kS - the static feedforward term
      kF - the gain applied proportionally to the current measurement
      kCos - the scale applied to the measurement inside the cosine term
  • Method Details

    • update

      public double update(double current, double dt)
      Description copied from class: Controller
      Computes the control output for this loop.
      Specified by:
      update in class Controller
      Parameters:
      current - the current measured value
      dt - the time elapsed since the previous update, in seconds
      Returns:
      the control output to apply