Quote:
Originally Posted by Wasabi Fan
The issue here is that, as velocity PID is implemented in the Talons currently, P is useless..
|
This is totally false in practice. Proof by counter-example:
254 used Talon-based velocity control on both our drive motors and our flywheel last season. In both cases, we used a PD+F controller and were able to track our setpoints to within +/- single digit RPM despite no integral action, even with varying battery voltage, system load, and (for the drive) while traversing defenses.
The reason why this works well is (a) feedforward, and (b) a really fast 1KHz control loop. Both of these factors let you crank up your feedback gains without sacrificing stability.
Feedforward helps because it deals with the nominal dynamics of the system so that feedback only needs to worry about dealing with modeling errors and disturbances. Usually this means that feedforward is doing most of the heavy lifting, so the feedback gains can be really aggressive because the disturbance is pretty small in magnitude. Likewise, a faster loop means that your P term can correct for the current error very quickly, so even if you overshoot by a little bit, a millisecond later you are compensating.
Our tuning methodology was to start with a nominal battery and load (e.g. flat floor and no other systems running) and tune F first, as recommended in the Talon SRX Software Reference Manual. Once this was working, we tuned our P gain until we oscillated (very quickly! 1KHz loop

) around the setpoint. Then we crank up D until the oscillation is no longer noticeable to your eye or in a plot of system response. For both of our systems last year, this meant a D gain on the order of 4-5x Kp.
I understand the sentiment around saying that integral gain is the only way to ensure that in the steady state (error=0), your system continues to operate at your desired setpoint. This is theoretically correct. But, with a sufficiently high Kp and Kd, you can react quickly to very, very small errors that are about the same magnitude as your velocity measurement error. In other words, more than good enough for FRC.