Package com.crossbotics.ftchelper.tuning
Class PidTunables
java.lang.Object
com.crossbotics.ftchelper.tuning.PidTunables
The four PID gains of one controller as
Tunables, in one line.
static final PidTunables LIFT = PidTunables.of("Lift", 0.004, 0, 0.0002, 0.05);
// every loop:
LIFT.applyTo(liftPid);
The menu then shows "Lift/kP", "Lift/kI", "Lift/kD" and "Lift/kF". Steps are 1/8 of each
starting value (or small defaults when a value is 0).
What the four gains do: see PidController and Tutorial 07 (docs/tutorials/07-pid-lift.md).
Docs: docs/guides/tuning.md
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TunableThe four gains, each one changeable from theTuningMenu.final TunableThe four gains, each one changeable from theTuningMenu.final TunableThe four gains, each one changeable from theTuningMenu.final TunableThe four gains, each one changeable from theTuningMenu. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(PidController pid) Copies the current values into the controller.static PidTunablesMakes the four tunables "group/kP" ...
-
Field Details
-
kP
The four gains, each one changeable from theTuningMenu. "final": set once, never replaced. -
kI
The four gains, each one changeable from theTuningMenu. "final": set once, never replaced. -
kD
The four gains, each one changeable from theTuningMenu. "final": set once, never replaced. -
kF
The four gains, each one changeable from theTuningMenu. "final": set once, never replaced.
-
-
Method Details
-
of
Makes the four tunables "group/kP" ... "group/kF".- Parameters:
group- the name shown in the menu, e.g. "Lift"kP- the P gain in your codekI- the I gain in your codekD- the D gain in your codekF- the feedforward in your code- Returns:
- the four tunables together
-
applyTo
Copies the current values into the controller. Call every loop, so a change in the menu is felt on the robot right away.- Parameters:
pid- the controller to update
-