|
Re: PID Controller behaving erratically
Set the kP just low enough that you don't get oscillation. As you've seen, that doesn't always give enough power to get to the desired target, and you get a steady-state error. Now increase kI just high enough to overcome that error. Then tweak kD to account for rotational inertia so it doesn't overshoot badly and oscillate again.
It helps if you can modify the PID constants while the code is running. Perhaps you could use SmartDashboard for that.
|