Quote:
Originally Posted by UriF
[+] About the PID Gains, I'm totally clueless as to what to set them to, so I just set the P variable to 0.1 and zeroed out the others. (Perhaps this was causing the unexpected results when I directly used the Gyro as input, because the output was always @ 100% all the time); Could I set them to something more appropriate?
|
A p of .1 would take an error of 10 to create a 1.0 (100%) output. The error is calculated by subtracting the setpoint from the current position. If you are using,
As Ether suggested, -180 to 180 range, that may be a little high. It would only take an error of 10 degrees to create full motor output.
So, get the input corrected to match the suggested range. This isn't just scaling or constraining, btw. You will need to add or subtract the extra turns if they are in there (fmod).
Make sure your setpoint is in the same terms as the input, degrees.
And then start tuning your p gain. Don't worry about the others for now.