PID can be a complicated topic. There are many posts around detailing how to tune PID. The WPIlib comes with a PIDController, and there are two examples built into the FRC examples. But neither of them are for a drivetrain. If you are using CommandBased architecture, then they do have a PIDSubsystem.
But without a mentor, I would forget the PID stuff. The theory often gets tossed in with the practical, and then you have a minimum power output problem too. It could work, but there is a lot to learn. I usually start by teaching a simple system that acts like the Proportional stuff you have in code, but is a little more grainy:
if (currAngle < (angle-2)){
if(currAngle < (angle - 60)){
drive.arcadeDrive(0,-.7);//very far off target, turn fast
}else if(currAngle < (angle - 30)){
drive.arcadeDrive(0,-.6 );//slow down as you approach
}else if(currAngle < (angle - 8)){
drive.arcadeDrive(0,-.55);//keep slowing down
}else{
drive.arcadeDrive(0,-.4);//this is the slowest you can go and the robot still turns
}
}else if(currAngle > (angle+2)){
if(currAngle > (angle + 60)){
drive.arcadeDrive(0, .7);//very far off target, turn fast
}else if(currAngle > (angle + 30)){
drive.arcadeDrive(0, .6);//slow down as you approach
}else if( currAngle > (angle + 8)){
drive.arcadeDrive(0,.55);//keep slowing down
}else{
drive.arcadeDrive(0,.4);//this is the slowest you can go and the robot still turns
}
}
else{
drive.arcadeDrive(0, 0);//close to target, stop turning
}
Here you won’t hit a stalling motor just because you are too close to the target as long as you get that .4 to be the right number. These numbers are very dependent on your mechanical system. And as a point that needs to be focused on, if you are moving forward the power require to turn is less than if you are not moving forward or backward. You may need to add more gradations, with in-between output values, between more angles. I.e. add another else if for angles less than 15. Most of all, try this in an absolute voltage control mode, rather than percent voltage control mode. Though this is only an option on a talonSRX, you can fake it with any motor controller by doing something like this:
drive.arcadeDrive(0,(-.47 * 12) / ControllerPower.getInputVoltage());
Getting the voltage at the roborio and using it to divide the voltage you want to output, will rescale the voltage getting to the motors, making it easier to compensate for variation in the battery voltage.