Software · Controls

PID Tuning Lab

Tune a simulated robot arm one gain at a time, the way we tune real mechanisms.

Why?

Single-jointed arm

Click or drag to move the goal
Goal–
Actual–
Error–

Position vs time

Goal Measured

    Motor output

    Voltage±12 V limit

    Last step response

    Since the goal last changed
    Rise time 10–90%
    –
    Overshoot
    –
    Settling time ±2%
    –
    Error now
    –
    Bump recovery
    –

    Go deeper

    Things to try
      What the feedforward terms do

      Feedforward doesn't wait for error. kG holds the mechanism up against gravity. kS overcomes friction in the direction of the error. On our robots that is kS in the gain slot with StaticFeedforwardSign = UseClosedLoopSign, like the 2026 shooter hood. kV supplies the voltage a moving setpoint needs, so on the arm and elevator it only matters with the motion profile on. Feed Forward Control explains each term.

      kP, kI and kD

      With good feedforward, many FRC mechanisms only need kP. kI can remove a small leftover error, but it builds up during long moves and causes overshoot. kD damps overshoot when kP alone rings. See PID Controllers.

      The motion profile

      A trapezoid motion profile moves the setpoint smoothly toward the goal with a speed and acceleration limit. On an MW-Lib mechanism that is calling setTargetPositionMotionProfile(...) instead of setTargetPosition(...). Turn it on under More controls in Free play.

      Copying gains to the robot

      The simulated mechanism

      The controller runs every 20 ms like a roboRIO loop. The physics runs every 1 ms.