View Single Post
  #1   Spotlight this post!  
Unread 18-02-2013, 01:04
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,753
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
PIDController tuning

First, physical setup:
We've got a set up with 3 motors, each getting feedback from a different potentiometer. Two motors are AndyMark PG-71's, mated with a 1-turn potentiometer. For one of them (we'll call it the A motor), we cover about 3/4 of the potentiometer, and the second (we'll call it the B motor) uses about half of the turn. Lastly, we have a Mini-CIM hooked up through a toughbox mini and an additional 2-1 reduction (we'll call this the C motor), with a 10 turn potentiometer going through about 8 turns total.

Friday we spent an ungodly amount of time trying to tune the PID constants for each of these motors, and simply could not get it to stop oscillating horribly at whatever setpoint we wanted it to be at. Getting fed up and wanting to see some progress before going home, we finally replaced the PIDController class with our own little function that implemented some simple rate-smoothing feedback, which mostly works. However, we've now discovered that the battery voltage really affects our function (It was working perfectly smoothly and predictably... then we replaced the battery and started getting some oscillation in the movement we didn't have before). We can add in a term for that to compensate (along with sufficient testing to ensure it does what its supposed to do), but I'd really rather just have the PIDController class working correctly.

So, who has experience working with this class, and can give us some pointers on roughly what values we should be passing in for our P, I, and D constants? Is it worth spending more time trying to get that class to work, or should we continue down the path with our own custom class? Would the PIDController class have the same issue with varied behavior based on battery voltage?
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA

Last edited by Jon Stratis : 18-02-2013 at 01:11.