so this doesnt exactly answer your question but here are some good things to know about PID loops for those who are unfamiliar:
PID is really P + I + D = V, in which P is your proportional component, I is your integral component, D is your derivative component, and V is the velocity you output to the motors
Note that in code, V doesnt have to be something in m/s or mi/h, when you output say .7 to the motors, that will turn the motor at a constant speed (for all intensive purposes of this application)
Proportional component: P = A * (error)
Error = intended position - current position
where A is a constant that you have to choose. when people say they are “tuning” a PID loop, they are basically adjusting the K constant until the system stays at the position you want it to. notice that you need to have some sort of sensor to tell you your current position
Integral Component: I = B * ( .5 * (error_at_time1 + error_at_time2) * amount of time between the two measurements)
where B is another constant. so basically what i have written up here is a discrete way to calculate an integral called the trapezoidal rule, there’s other methods, but this one should work. notice you have to know the time at each measurement, there is a time keeping function built in to the CRIO, it’ll just take a little manual searching to find it
Derivative Component: D = C * (error_at_time2 - error_at_time1) / amount of time between the two measurements
where C is again another constant. note that i’m simply finding the slop between two measurements, which is the discrete approximation of the derivative. make sure in both the derivative and integral components that you use two measurements that are as close to each other as possible
Now to start off with, i like to set A, B, and C so that if my motor is as far away from the target, it will output a 1 (full throttle at least in my year) to the motors. then, you change those numbers through experimentation to find constants that work best
here is a nice little table in wikipedia that tells you how to change your constants based on what your problem is
http://en.wikipedia.org/wiki/PID_controller gives a nice table that tells you how to change each constant based on what kind of error you have
For most applications in FRC, you should only need the P component, which will save you a ton of time and trouble.
(PS: you dont need a graduate degree to understand PID loops, you just need to know how to solve high order linear diff eqs and the appropriate discrete approximations of integrals and derivatives based on your application )