No. Using a gyro is fine, that’s a high quality one. Using the wheel encoders is harder.
Mulvaney has a great suggestion - “what is fast?”. Maybe PID is enough.
Conceptually, the problem is you are building a PID controller to a single setpoint for a system with tons of inertia.
By the time you’re arriving at the setpoint, you have a ton of momentum from the turn, and just turning the control input to zero actually isn’t enough to stop your robot at the setpoint. You need to reduce or even reverse the control input before you actually arrive, for snappy performance.
A position PID controller alone wont do that mathematically. You’re on the right track with the D term, which will reduce acceleration, but there are better methods.
The first conceptual layer here is to use a PIDF form, where you predict the control input required (F), then apply the error correction (PID), rather than only applying error correction.
It’s easy for a flywheel, since a single flywheel rpm setting will use a set amount of energy. So F can be a constant ratio to the rpm setpoint. After the F is applied, the flywheel control is already “almost right”, and the PID doesn’t have to do much.
For a drivetrain turn, we need to predict the desired control input to replicate the effect of F. As a simplification, I recommend imagining four phases - start, accelerating, traveling, decelerating, and stopped.
A trapezoidal motion profile will use a velocity cap to set the maximum travel speed (traveling), an acceleration cap to set the maximum slope of the velocity (acceleration and deceleration), and solve for a series of velocity setpoints that result in the robot arriving at the final position with zero velocity (start and stop).
That series of setpoints is fed into the motors, and then a layer of PID helps the motors stay on target.
So when you’re in the decelerating phase, it’s now possible for your control theory to produce a reversing force - if you’re moving too fast, your controller will command the motors to slow down or even reverse themselves now.
Have you done “drive to distance” with motion profiling? This is the same concept but with angular velocity off the pigeon being your feedback instead of an encoder distance.
I don’t actually know if the wpi profiledPID command does this or not, I’m only an armchair programmer