|
Re: Wheel encoder to Jaguar Wiring
kP/gain/Proportional: This does most of the work. The output is proportional to the difference between what you want and what you have. output = (setpoint - process_variable)*kP, also known as gain
kI/Integral: This integrates the error over time, multiplies it by kI, and adds it to the output. Be very careful with this one, you should need a very tiny bit (a decimal with at least 2 0's in front of the digit seems about right). Too much and you will overshoot. Because of how it is designed, it will not stop applying power until it overshoots and unwinds the integral.
kD/Derivative: This takes the curve of the past action and accounts for momentum. The faster you have gone, the more this works to slow you down. This is always working against proportional.
you might not be "tinkering" with the PID values enough. Try setting kI and kD to 0 and then tuning kP. If it overshoots too much or oscillates, then turn it down. If it dosen't, increase it till it does and dial it in to the perfect number. You probably don't need kI and kD.
To give you an idea of scale, my inputs are all scaled to inches/second and the gain is 0.01. I did my math on the cRio (using Victors for output).
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
|