Robot spinning

I am currently using okapi ChassisControllerPID with two encoders, and whenever I add the angle PID gains, the robot will spin infinitely while gradually accelerating. The same thing happens when I try to get the robot to turn. Does anyone know why this is happening, and how do I fix it? This is the code I made to configure the drivetrain.
std::shared_ptrokapi::OdomChassisController chassis = okapi::ChassisControllerBuilder()
.withMotors({18, -15}, {-17, 2})
.withGains(
{0.002, 0, 0.00004},
{0.002, 0, 0.00004},
{0.0001, 0.0002, 0.00004}
)
.withSensors(
ADIEncoder{‘A’, ‘B’},
ADIEncoder{‘G’, ‘H’, true}
)
.withDimensions(AbstractMotor::gearset::green, {{2.75_in, 15.25_in}, quadEncoderTPR})
.withOdometry(StateMode::CARTESIAN)
.buildOdometry();
okapi::OdomState state;

Can you share a video of what you mean by spinning infinitely? Also, does this only happen when you have a move command?

looks like they are prepaired for next years game…
but on a more serious note,

the fact that it is accelerating, makes me think that it might be turning the wrong way, or atleast the turn error is increasing, (i dont know okapi, so i cant quite tell) are you using an inertial sensor? and if so it could be that the inertial sensor is mounted upsidedown, or the turning is the opposite direction according to which direction it is turning.

We aren’t using an inertial sensor, just two tracking wheels.

It happens on all commands related to movement.

I found out the drivetrain ports were backwards. I reconfigured them and they work now.