This is the first year my team is using the NavX MXP and I am at a lost for the Rotate to Angle portion. First off: What does PIDF stand for and how do I get said inputs? I have looked at the example code that is found on the NavX Wiki, but I am still confused. We use are using an Xbox Controller and Tank Drive, so we are mostly using this feature just to drive in a straight line. Any help would be great, thank you!
And one of the few ways to get PIDF values is to randomly test them in the code. Have an absolute value if testing, since PID never actually reaches the setpoint. So, if you’re using a motor (like a CIM) then the motor will stall since it’ll never actually get to the setpoint (which is how our team accidentally burnt out a CIM motor).
I don’t think what he wrote is correct. A tuned controller will definitely reach its setpoint. The only thing I will point out is that a setpoint must have tolerances, otherwise, it can never truly hit an exact number.
That said, if you’re not familiar with PID, you should google this and there’s tons of information on it. Quick Summary:
E is error. This is the difference between value and setpoint.
P is proportional. so if Kp*E = output
I is integral, so sum (E) *Ki = output
D is derivative, so (E,now - E,last) *Kd = output
If you add all of these together you’ll get an actual output from a PID controller. That’s a quick summary and it’s likely not occurring actually like that, but it gives you a general idea.
proportional is designed to do most of the work. Integral is designed to push small errors towards the setpoint. Derivative is usually designed to counteract strong pushes.
F component is a (usually experimentally determined) value (or values) that is added to the output. It can be a fixed value (if there is only one setpoint) or it can be in a lookup table or function within the controller.