View Single Post
  #3   Spotlight this post!  
Unread 18-02-2013, 09:11
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: PIDController tuning

Quote:
Originally Posted by Jon Stratis View Post
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?
I had some success this year using "method a" at this link. You will need some way to collect data and graph it. Using PID should allow you to get consistent operation under varying battery charge.