Thread: PID Help
View Single Post
  #1   Spotlight this post!  
Unread 25-12-2014, 11:36
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: PID Help

There are many, many threads on CD and the general internet about PID control. Try searching around.

Here's some good resources from NI:
Quote:
Originally Posted by plnyyanks View Post
Additionally, if you search through NI's website, they have some great resources about PID theory (and their examples are in LV). You can also view the complete help page for the PID VI here.
And here are some more resources:
Quote:
Originally Posted by plnyyanks View Post
The PID VI is entirely mathematical - it doesn't care what the inputs are, all it does it brings the error of the system (Setpoint - Process Variable) down to zero. It will work exactly the same with encoder rates and distances, provided that the SP and PV are scaled the same way (and the constants are tuned properly). I'd be more than happy to explain how some of the math works, if you'd like.

As for your specific system issues, it just looks like the constants aren't tuned properly. Read a little bit about PID Theory (also: wikipedia) and take a look at some tips on designing a good controller (the rest of that page is helpful too). You may also want to start with the Ziegler-Nichols method for tuning (start with all zero, bring P up until it oscillates, add D to dampen and add I to correct for steady state error.

Just another note - if I remember, the LabVIEW implementation of the algorithm doesn't use Kp, Ki, and Kd as straight constants. It actually uses time constants for I and D (so it has Kp, Ti, and Td). You can see details of the NI implementation here. You can verify this in the help popup (ctrl-H) for the VI. Plan your constants accordingly.
And this page looks like it has some cool simulation resources, and some overviews about the theory behind the controller.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android

Last edited by plnyyanks : 25-12-2014 at 11:40.
Reply With Quote