For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tune PIDF gains

Starting points and a tuning procedure for your drive and angle motor gains.

The basic idea

YAGSL reads PIDF values from pidfproperties.json in your module folder — generate or edit it with config.yagsl.com.

This has been hashed and boiled down to the simplest form like this before:

  • P: if you're not where you want to be, get there.

  • I: if you haven't been where you want to be for a long time, get there faster.

  • D: if you're getting close to where you want to be, slow down.

Tuning procedure

Another good way to describe it, from CTRE:

Manual tuning typically follows this process:

  1. Set PP, II, and DD to zero.

  2. Increase PP until the output starts to oscillate around the setpoint.

  3. Increase DD as much as possible without introducing jittering to the response.

For the drive motor, also set the feedforward terms (s, v, a — see below) before fine-tuning P; a good feedforward means P only has to correct small errors.

WPILib walkthrough

WPILib has lots of great documentation on PID, so it's worth reading directly:

Basics of PID
Tuning velocity, like the drive motors!
Tuning position, like the steering/angle/azimuth motors!

The current pidfproperties.json shape

The schema changed in YAGSL 2026.8.05 — f and iz (integral zone) and the old output clamp are gone. Feedforward is now expressed as s/v/a (kS/kV/kA, matching WPILib's SimpleMotorFeedforward). See the schema changes reference if you're migrating an older config by hand.

If you leave drive v (kV) at 0, YAGSL auto-derives it from the drive motor's free speed and your gearing, so a reasonable feedforward exists even before you've tuned anything by hand.

You can also add a pidfproperties_sim.json alongside it — YAGSL will load that one instead when running in simulation (RobotBase.isSimulation()), so you can use looser gains in sim without touching your competition robot's config.

Starting points

The right PIDF values vary per-robot, but these are reasonable starting points to iterate from, organized by motor controller type.

When the drive motor type for every module is talonfx_* (or alike — krakenx60, falcon500) this is a reasonable starting point:

Once you have a reasonable starting point, use config.yagsl.com to regenerate pidfproperties.json with your updated numbers, or hand-edit the file directly — both work, since the parser only cares about the final JSON.

Last updated

Was this helpful?