Class FFController
java.lang.Object
com.cdarobotics.cdalib.controllers.Controller
com.cdarobotics.cdalib.controllers.FFController
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).-
Field Summary
Fields inherited from class com.cdarobotics.cdalib.controllers.Controller
target -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleupdate(double current, double dt) Computes the control output for this loop.Methods inherited from class com.cdarobotics.cdalib.controllers.Controller
getTarget, setTarget
-
Constructor Details
-
FFController
public FFController(double target, double kS, double kF, double kCos) - Parameters:
target- the initial setpointkS- the static feedforward termkF- the gain applied proportionally to the current measurementkCos- the scale applied to the measurement inside the cosine term
-
-
Method Details
-
update
public double update(double current, double dt) Description copied from class:ControllerComputes the control output for this loop.- Specified by:
updatein classController- Parameters:
current- the current measured valuedt- the time elapsed since the previous update, in seconds- Returns:
- the control output to apply
-