Hey guys i have some questions for this library.
1.Is this autotune library made to work itself or you have to combine it with the original arduino pid library?
2.Where exactly i should put the values i have to get the right output?
3.What is Kp, Ki and Kd?
Thanks for your answers in advance guys, sorry for my bad english.
P.S Almost forgot here are the links to the libraries
Well, trying to tune a PID implementation without understanding what PID is, seems like a futile exercise.
You might notice that those variable names correspond to the three letters that spell PID. Once you understand what PID is, the meaning of the three tuning parameters should become obvious.
ok,
so i understood from wikipedia that,
Kp is proportion and its for direct correction of the error and when it goes bigger error is getting smaller
Ki is integral and its for faster correction of bigger errors
Kd is derivative and its for faster correction of the changing error and correcting it
But i dont want to now how it works .Its enough for me that there is a library ready for use by newbies like me. So i just want to understand the basics of the code like where to put the IMU data, where to put the motor speed data i want and such.Thank you !
IMO you NEED to understand what the PID algorithm is in order to make use of it in your code. It's quite simple, although the summary you gave doesn't seem quite accurate to me and I hope that wasn't taken directly from Wikipedia.
Once you understand that the PID algorithm provides three feedback components and the parameters you listed define the gain of the three components, using them is simple. But unless/until you understand what PID is and what PID does, it is IMO futile for you to try to tune it.
I assume you have got the concept that PID provides three feedback components which are intended to reduce an error to zero, where the error is the difference between the actual state of your system, and your desired state.
The proportional component produces a correction which is proportional to the error. In mechanical terms, you could think of it as a spring.
The derivative component produces a correction which opposes changes in the error. In mechanical terms you could think of it as a damper.
The integral term produces a correction which is proportional to the sustained error over some period. If you're still thinking in mechanical terms then you could visualise this as a ride height leveling system on a car's suspension.