I am creating a soccer robot that needs to move very precisely, hence the need for PID.
However I have absolutely no clue on how to use the PID library.
How does the PID work? Do you specify the desired RPM or %power or something completely different?
Could someone post a simple example of using the PID library. Explaining how to tune it, what pins to plug the encoder into and what each command does, and anything I missed.
The motor is a lego NXT motor, it has two encoder outputs. For the motor output just say print(50percent power) or something like that, don't bother with motor specifics.
PID is complicated and you are asking for all 4 semesters boiled down into 1 post.
search this list for PID, there has been a lot of discussion about how to make it work.
your first step is to make it work,
tuning is not hard to get it kinda/sorta close. some things are generic so you might be able to work with generic settings.
for fine tuning you have to either become extremely knowledgeable in the complexities of interactions of the control, or randomly plug in numbers and do more of what works and less of what does not until you are satisfied.