View Single Post
  #4   Spotlight this post!  
Unread 03-02-2014, 14:05
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: How do you Tune the PID Values?

For teleop, just do this:
Code:
SmartDashboard.putData("PID Controller",controller);
controller can be replaced by subsystem.getPIDController().

Also, in terms of actual tuning techniques, here's the procedure I use:
  • Raise the P constant until your controller oscillates. If the oscillations are too big, lower the constant a little bit.
  • Raise the D constant to damp the oscillation, causing it to converge. D also slows down the controller's approach to the setpoint, so striking a balance between P and D can take some tweaking.
  • If you have P and D tuned, and it oscillates & converges, but not to the correct setpoint, increase I. This is called "steady-state error" and a positive, non-zero integral constant will cause the controller to correct for it.

In general, P makes approach faster, but can cause larger oscillations; D causes oscillations to converge, but slows approach; and I can correct for steady-state error and causes faster approach, but can lead to intense oscillations if set too high (search "integral windup" for more details).
__________________
I code stuff.
Reply With Quote