Team-OKC-Robotics / FRC-2023

The FRC team #2718 Team OKC Robotics code for the 2023 season
Other
2 stars 0 forks source link

Arm control improvements and tuning #52

Closed jkleiber closed 1 year ago

jkleiber commented 1 year ago

Summary The arm control needs to be improved. Specifically, the following things need to be added:

  1. A feedforward term needs to be added to the arm rotate PID. Currently the motor power is decided purely with PID. This change would be to have motor power = pid + ff where ff is a feedforward variable. A good initial guess at what ff is could be:

    ff = sign(setpoint) * Kf * setpoint^2

    where Kf is some parameter file gain (probably something like 0.05 or 0.1), sign is there to ensure the feed forward goes in the direction the arm is going, and setpoint is the target value for the arm's rotation

  2. Once feedforward is added, the arm rotate PID will need to be tuned. It is likely that the Kp will need to decrease, but it's worth trying to increase the Kd first to see how effective that is.

  3. We should get the mech team to make the extend faster. This will likely require tuning the extend PID to not oscillate

  4. Finally, we should reduce the open loop ramp rate limits on the arm so it can go faster. We need to do this carefully to make sure stuff doesn't break though.

Work to do

Verification