|
Re: PIDController tuning
Be sure your PID is not stuck in a loop. We had wild oscillation yesterday because the PID was in a loop that was being called by periodic tasks. I strongly advocate a 'no loops' architecture.
to determine what range of number makes sense - let's say your position feedback is in degrees, so your setpoint is also in degrees. the motor velocity is in the range of -1 to 1. By definition, your P gain is applied to the difference between commanded and actual (your p error) so if you are off by 5 degrees, and you want to apply a 0.5 motor speed to correct for it, your P gain should be around 0.1, as a starting point. If it still oscillates too much, then back it off a bit.
for integral gain (our PID is on an arm where the load changes based on position, so we use I to close the gap), remember that it is a time parameter measured in minutes. In our case, we ended up with about 0.01 for I.
it is really handy if you can have it graph position in real time. Tell it to do a step move (say from 100 to 150 degrees) and see the shape of how it gets from one to the other. If it doesn't get to exactly the right point, make I smaller (more powerful). If overshoots too far, make P smaller (weaker).
Most systems build in FRC don't need D gain, IMO
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
|