Hello, I am a programmer from Team 85. We are currently trying to use PathPlanner for the first time (by loading Choreo trajectories into PathPlanner and running them as autos using AutoBuilder). However, when tuning the 2 PID controller in the HolonomicPathFollowerConfig under AutoBuider.configureHolonmic, the first PID (the translation PID) is showing strange behavior. This is the code excerpt I am talking about:
AutoBuilder.configureHolonomic(
this::getPoseEstimatorPose,
this::setAutoStart,
() → kinematics.toChassisSpeeds(getModuleStates()),
this::runVelocity,
new HolonomicPathFollowerConfig(
new PIDConstants(2.1, 0, 0),
new PIDConstants(1.5, 0, 0),
MAX_LINEAR_SPEED,
DRIVE_BASE_RADIUS,
new ReplanningConfig()),
() →
DriverStation.getAlliance().isPresent()
&& DriverStation.getAlliance().get() == Alliance.Red,
this);
The translation PID controller seems to not act like a PID controller at all. The main concern with this is that when adjusting the P value to drive a further or shorter distance, it has the opposite effect on driving forwards and backwards. For example, if the P value is at zero, both forwards and backwards go the same distance. However, if the P is increased even a very small amount, the forwards driving will go a shorter distance, and the backwards driving will go a longer distance, but with the same difference. If it goes .5 meters shorter forwards than it will go .5 meter further backwards. I’ve never seen anything like this, so any help would be appreciated.
Thanks from Team 85!