So, we’re currently using a cascading PID control to implement a turn-to-angle function. That is, we’re running a position PID using the output of our gyro, whose outputs feed to our wheel velocity PID.
On the whole, it’s working fine, but there are some fine-tuning issues we’d like to address.
Currently, we are only using P.
Namely, if we make P high enough to get within 1-2 degrees of the setpoint in a reasonable amount of time, the robot builds up enough inertia while turning to overshoot the setpoint. Setting P just high enough to not overshoot the setpoint, we can get to ~5 degree accuracy reasonably quickly, but it takes quite a few seconds more to zero in.
There are two solutions I can think of for this - introducing a bit of I to provide some extra “push,” or setting a “minimum output” around 0 that small output values get raised to.
I’ve done the latter to overcome friction in an elevator control loop before, and it worked wonderfully. But my intuition is that it should not be needed for a cascading loop where the task of overcoming friction at small values should be handled by the inner velocity loop.
Any suggestions?
Addendum: We’re also using a similar P loop to keep the robot driving straight while a button is held, by adding the output as a difference term to our linear velocity. The output is scaled between -1 and 1, where 1 represents max robot speed. We were struggling to find a value of P that worked optimally - if anyone who has done similar things could share what values they have used in the past (with offset being measured in degrees), it’d be appreciated.
We would do further testing to answer these questions ourselves, but we have exhausted our 6 hour window to toy with the robot.
Thanks!