Auto with Path Planner leading to Oscillating

Our team has been dabbling in autonomous code and we’ve gotten to the point where we can select our auto in shuffleboard, change the FRC Driver station to autonomous mode, and then enable the auto. Still, instead of taxing like intended, our robot’s motor started oscillating like crazy. Any advice for troubleshooting?

Rumbbly-Swerve-/src/main/java/frc/robot at main · frc4087/Rumbbly-Swerve-

That sounds like badly-tuned PID(F) control. Take a look at Introduction to PID — FIRST Robotics Competition documentation and probably more resources I can’t remember but they’re out there somewhere!

1 Like

Specifically, the PID values you might want to look at are in your HolonomicPathFollowerConfig class in your PathPlanner configuration:

A kP value of 100 would probably lead to issues. For comparison, the PathPlanner documentation examples have a kP of 5 and the CTRE Swerve PathPlanner example uses 10.

1 Like

The P constant in your auto configs looks really high (100). I would lower that until you stop seeing the oscillation.